static uint64_t kvmppc_read_int_cpu_dt(const char *propname)

{

    char buf[PATH_MAX];

    union {

        uint32_t v32;

        uint64_t v64;

    } u;

    FILE *f;

    int len;



    if (kvmppc_find_cpu_dt(buf, sizeof(buf))) {

        return -1;

    }



    strncat(buf, "/", sizeof(buf) - strlen(buf));

    strncat(buf, propname, sizeof(buf) - strlen(buf));



    f = fopen(buf, "rb");

    if (!f) {

        return -1;

    }



    len = fread(&u, 1, sizeof(u), f);

    fclose(f);

    switch (len) {

    case 4:

        /* property is a 32-bit quantity */

        return be32_to_cpu(u.v32);

    case 8:

        return be64_to_cpu(u.v64);

    }



    return 0;

}

static uint64_t kvmppc_read_int_cpu_dt(const char *propname)

{

    char buf[PATH_MAX];

    union {

        uint32_t v32;

        uint64_t v64;

    } u;

    FILE *f;

    int len;



    if (kvmppc_find_cpu_dt(buf, sizeof(buf))) {

        return -1;

    }



    strncat(buf, "/", sizeof(buf) - strlen(buf));

    strncat(buf, propname, sizeof(buf) - strlen(buf));



    f = fopen(buf, "rb");

    if (!f) {

        return -1;

    }



    len = fread(&u, 1, sizeof(u), f);

    fclose(f);

    switch (len) {

    case 4:

        

        return be32_to_cpu(u.v32);

    case 8:

        return be64_to_cpu(u.v64);

    }



    return 0;

}

    char buf[PATH_MAX];     strncat(buf, "/", sizeof(buf) - strlen(buf));     strncat(buf, propname, sizeof(buf) - strlen(buf));     f = fopen(buf, "rb");
static uint64_t FUNC_0(const char *propname)

{

    char VAR_0[PATH_MAX];

    union {

        uint32_t v32;

        uint64_t v64;

    } VAR_1;

    FILE *f;

    int VAR_2;



    if (kvmppc_find_cpu_dt(VAR_0, sizeof(VAR_0))) {

        return -1;

    }



    strncat(VAR_0, "/", sizeof(VAR_0) - strlen(VAR_0));

    strncat(VAR_0, propname, sizeof(VAR_0) - strlen(VAR_0));



    f = fopen(VAR_0, "rb");

    if (!f) {

        return -1;

    }



    VAR_2 = fread(&VAR_1, 1, sizeof(VAR_1), f);

    fclose(f);

    switch (VAR_2) {

    case 4:

        

        return be32_to_cpu(VAR_1.v32);

    case 8:

        return be64_to_cpu(VAR_1.v64);

    }



    return 0;

}

static uint64_t FUNC_0(const char *propname)
{ char VAR_0[PATH_MAX]; union { uint32_t v32; uint64_t v64; } VAR_1; FILE *f; int VAR_2; if (kvmppc_find_cpu_dt(VAR_0, sizeof(VAR_0))) { return -1; } strncat(VAR_0, "/", sizeof(VAR_0) - strlen(VAR_0)); strncat(VAR_0, propname, sizeof(VAR_0) - strlen(VAR_0)); f = fopen(VAR_0, "rb"); if (!f) { return -1; } VAR_2 = fread(&VAR_1, 1, sizeof(VAR_1), f); fclose(f); switch (VAR_2) { case 4:
return be32_to_cpu(VAR_1.v32); case 8:
return be64_to_cpu(VAR_1.v64); } return 0; }