static char *get_human_readable_size(char *buf, int buf_size, int64_t size)

{

    static const char suffixes[NB_SUFFIXES] = "KMGT";

    int64_t base;

    int i;



    if (size <= 999) {

        snprintf(buf, buf_size, "%" PRId64, size);

    } else {

        base = 1024;

        for (i = 0; i < NB_SUFFIXES; i++) {

            if (size < (10 * base)) {

                snprintf(buf, buf_size, "%0.1f%c",

                         (double)size / base,

                         suffixes[i]);

                break;

            } else if (size < (1000 * base) || i == (NB_SUFFIXES - 1)) {

                snprintf(buf, buf_size, "%" PRId64 "%c",

                         ((size + (base >> 1)) / base),

                         suffixes[i]);

                break;

            }

            base = base * 1024;

        }

    }

    return buf;

}

static char *get_human_readable_size(char *buf, int buf_size, int64_t size)

{

    static const char suffixes[NB_SUFFIXES] = "KMGT";

    int64_t base;

    int i;



    if (size <= 999) {

        snprintf(buf, buf_size, "%" PRId64, size);

    } else {

        base = 1024;

        for (i = 0; i < NB_SUFFIXES; i++) {

            if (size < (10 * base)) {

                snprintf(buf, buf_size, "%0.1f%c",

                         (double)size / base,

                         suffixes[i]);

                break;

            } else if (size < (1000 * base) || i == (NB_SUFFIXES - 1)) {

                snprintf(buf, buf_size, "%" PRId64 "%c",

                         ((size + (base >> 1)) / base),

                         suffixes[i]);

                break;

            }

            base = base * 1024;

        }

    }

    return buf;

}

static char *FUNC_0(char *VAR_0, int VAR_1, int64_t VAR_2)

{

    static const char VAR_3[NB_SUFFIXES] = "KMGT";

    int64_t base;

    int VAR_4;



    if (VAR_2 <= 999) {

        snprintf(VAR_0, VAR_1, "%" PRId64, VAR_2);

    } else {

        base = 1024;

        for (VAR_4 = 0; VAR_4 < NB_SUFFIXES; VAR_4++) {

            if (VAR_2 < (10 * base)) {

                snprintf(VAR_0, VAR_1, "%0.1f%c",

                         (double)VAR_2 / base,

                         VAR_3[VAR_4]);

                break;

            } else if (VAR_2 < (1000 * base) || VAR_4 == (NB_SUFFIXES - 1)) {

                snprintf(VAR_0, VAR_1, "%" PRId64 "%c",

                         ((VAR_2 + (base >> 1)) / base),

                         VAR_3[VAR_4]);

                break;

            }

            base = base * 1024;

        }

    }

    return VAR_0;

}

static char *FUNC_0(char *VAR_0, int VAR_1, int64_t VAR_2)
{ static const char VAR_3[NB_SUFFIXES] = "KMGT"; int64_t base; int VAR_4; if (VAR_2 <= 999) { snprintf(VAR_0, VAR_1, "%" PRId64, VAR_2); } else { base = 1024; for (VAR_4 = 0; VAR_4 < NB_SUFFIXES; VAR_4++) { if (VAR_2 < (10 * base)) { snprintf(VAR_0, VAR_1, "%0.1f%c",
(double)VAR_2 / base,
VAR_3[VAR_4]); break; } else if (VAR_2 < (1000 * base) || VAR_4 == (NB_SUFFIXES - 1)) { snprintf(VAR_0, VAR_1, "%" PRId64 "%c",
((VAR_2 + (base >> 1)) / base),
VAR_3[VAR_4]); break; } base = base * 1024; } } return VAR_0; }