static uint32_t vmdk_read_cid(BlockDriverState *bs, int parent)

{

    char desc[DESC_SIZE];

    uint32_t cid;

    const char *p_name, *cid_str;

    size_t cid_str_size;

    BDRVVmdkState *s = bs->opaque;



    if (bdrv_pread(bs->file, s->desc_offset, desc, DESC_SIZE) != DESC_SIZE) {

        return 0;

    }



    if (parent) {

        cid_str = "parentCID";

        cid_str_size = sizeof("parentCID");

    } else {

        cid_str = "CID";

        cid_str_size = sizeof("CID");

    }



    p_name = strstr(desc, cid_str);

    if (p_name != NULL) {

        p_name += cid_str_size;

        sscanf(p_name, "%x", &cid);

    }



    return cid;

}

static uint32_t vmdk_read_cid(BlockDriverState *bs, int parent)

{

    char desc[DESC_SIZE];

    uint32_t cid;

    const char *p_name, *cid_str;

    size_t cid_str_size;

    BDRVVmdkState *s = bs->opaque;



    if (bdrv_pread(bs->file, s->desc_offset, desc, DESC_SIZE) != DESC_SIZE) {

        return 0;

    }



    if (parent) {

        cid_str = "parentCID";

        cid_str_size = sizeof("parentCID");

    } else {

        cid_str = "CID";

        cid_str_size = sizeof("CID");

    }



    p_name = strstr(desc, cid_str);

    if (p_name != NULL) {

        p_name += cid_str_size;

        sscanf(p_name, "%x", &cid);

    }



    return cid;

}

    uint32_t cid;
static uint32_t FUNC_0(BlockDriverState *bs, int parent)

{

    char VAR_0[DESC_SIZE];

    uint32_t cid;

    const char *VAR_1, *VAR_2;

    size_t cid_str_size;

    BDRVVmdkState *s = bs->opaque;



    if (bdrv_pread(bs->file, s->desc_offset, VAR_0, DESC_SIZE) != DESC_SIZE) {

        return 0;

    }



    if (parent) {

        VAR_2 = "parentCID";

        cid_str_size = sizeof("parentCID");

    } else {

        VAR_2 = "CID";

        cid_str_size = sizeof("CID");

    }



    VAR_1 = strstr(VAR_0, VAR_2);

    if (VAR_1 != NULL) {

        VAR_1 += cid_str_size;

        sscanf(VAR_1, "%x", &cid);

    }



    return cid;

}

static uint32_t FUNC_0(BlockDriverState *bs, int parent)
{ char VAR_0[DESC_SIZE]; uint32_t cid; const char *VAR_1, *VAR_2; size_t cid_str_size; BDRVVmdkState *s = bs->opaque; if (bdrv_pread(bs->file, s->desc_offset, VAR_0, DESC_SIZE) != DESC_SIZE) { return 0; } if (parent) { VAR_2 = "parentCID"; cid_str_size = sizeof("parentCID"); } else { VAR_2 = "CID"; cid_str_size = sizeof("CID"); } VAR_1 = strstr(VAR_0, VAR_2); if (VAR_1 != NULL) { VAR_1 += cid_str_size; sscanf(VAR_1, "%x", &cid); } return cid; }