static void smp_parse(const char *optarg)

{

    int smp, sockets = 0, threads = 0, cores = 0;

    char *endptr;

    char option[128];



    smp = strtoul(optarg, &endptr, 10);

    if (endptr != optarg) {

        if (*endptr == ',') {

            endptr++;

        }

    }

    if (get_param_value(option, 128, "sockets", endptr) != 0)

        sockets = strtoull(option, NULL, 10);

    if (get_param_value(option, 128, "cores", endptr) != 0)

        cores = strtoull(option, NULL, 10);

    if (get_param_value(option, 128, "threads", endptr) != 0)

        threads = strtoull(option, NULL, 10);

    if (get_param_value(option, 128, "maxcpus", endptr) != 0)

        max_cpus = strtoull(option, NULL, 10);



    /* compute missing values, prefer sockets over cores over threads */

    if (smp == 0 || sockets == 0) {

        sockets = sockets > 0 ? sockets : 1;

        cores = cores > 0 ? cores : 1;

        threads = threads > 0 ? threads : 1;

        if (smp == 0) {

            smp = cores * threads * sockets;

        }

    } else {

        if (cores == 0) {

            threads = threads > 0 ? threads : 1;

            cores = smp / (sockets * threads);

        } else {

            threads = smp / (cores * sockets);

        }

    }

    smp_cpus = smp;

    smp_cores = cores > 0 ? cores : 1;

    smp_threads = threads > 0 ? threads : 1;

    if (max_cpus == 0)

        max_cpus = smp_cpus;

}

static void smp_parse(const char *optarg)

{

    int smp, sockets = 0, threads = 0, cores = 0;

    char *endptr;

    char option[128];



    smp = strtoul(optarg, &endptr, 10);

    if (endptr != optarg) {

        if (*endptr == ',') {

            endptr++;

        }

    }

    if (get_param_value(option, 128, "sockets", endptr) != 0)

        sockets = strtoull(option, NULL, 10);

    if (get_param_value(option, 128, "cores", endptr) != 0)

        cores = strtoull(option, NULL, 10);

    if (get_param_value(option, 128, "threads", endptr) != 0)

        threads = strtoull(option, NULL, 10);

    if (get_param_value(option, 128, "maxcpus", endptr) != 0)

        max_cpus = strtoull(option, NULL, 10);



    

    if (smp == 0 || sockets == 0) {

        sockets = sockets > 0 ? sockets : 1;

        cores = cores > 0 ? cores : 1;

        threads = threads > 0 ? threads : 1;

        if (smp == 0) {

            smp = cores * threads * sockets;

        }

    } else {

        if (cores == 0) {

            threads = threads > 0 ? threads : 1;

            cores = smp / (sockets * threads);

        } else {

            threads = smp / (cores * sockets);

        }

    }

    smp_cpus = smp;

    smp_cores = cores > 0 ? cores : 1;

    smp_threads = threads > 0 ? threads : 1;

    if (max_cpus == 0)

        max_cpus = smp_cpus;

}

static void FUNC_0(const char *VAR_0)

{

    int VAR_1, VAR_2 = 0, VAR_3 = 0, VAR_4 = 0;

    char *VAR_5;

    char VAR_6[128];



    VAR_1 = strtoul(VAR_0, &VAR_5, 10);

    if (VAR_5 != VAR_0) {

        if (*VAR_5 == ',') {

            VAR_5++;

        }

    }

    if (get_param_value(VAR_6, 128, "VAR_2", VAR_5) != 0)

        VAR_2 = strtoull(VAR_6, NULL, 10);

    if (get_param_value(VAR_6, 128, "VAR_4", VAR_5) != 0)

        VAR_4 = strtoull(VAR_6, NULL, 10);

    if (get_param_value(VAR_6, 128, "VAR_3", VAR_5) != 0)

        VAR_3 = strtoull(VAR_6, NULL, 10);

    if (get_param_value(VAR_6, 128, "maxcpus", VAR_5) != 0)

        max_cpus = strtoull(VAR_6, NULL, 10);



    

    if (VAR_1 == 0 || VAR_2 == 0) {

        VAR_2 = VAR_2 > 0 ? VAR_2 : 1;

        VAR_4 = VAR_4 > 0 ? VAR_4 : 1;

        VAR_3 = VAR_3 > 0 ? VAR_3 : 1;

        if (VAR_1 == 0) {

            VAR_1 = VAR_4 * VAR_3 * VAR_2;

        }

    } else {

        if (VAR_4 == 0) {

            VAR_3 = VAR_3 > 0 ? VAR_3 : 1;

            VAR_4 = VAR_1 / (VAR_2 * VAR_3);

        } else {

            VAR_3 = VAR_1 / (VAR_4 * VAR_2);

        }

    }

    smp_cpus = VAR_1;

    smp_cores = VAR_4 > 0 ? VAR_4 : 1;

    smp_threads = VAR_3 > 0 ? VAR_3 : 1;

    if (max_cpus == 0)

        max_cpus = smp_cpus;

}

static void FUNC_0(const char *VAR_0)
{ int VAR_1, VAR_2 = 0, VAR_3 = 0, VAR_4 = 0; char *VAR_5; char VAR_6[128]; VAR_1 = strtoul(VAR_0, &VAR_5, 10); if (VAR_5 != VAR_0) { if (*VAR_5 == ',') { VAR_5++; } } if (get_param_value(VAR_6, 128, "VAR_2", VAR_5) != 0)
VAR_2 = strtoull(VAR_6, NULL, 10); if (get_param_value(VAR_6, 128, "VAR_4", VAR_5) != 0)
VAR_4 = strtoull(VAR_6, NULL, 10); if (get_param_value(VAR_6, 128, "VAR_3", VAR_5) != 0)
VAR_3 = strtoull(VAR_6, NULL, 10); if (get_param_value(VAR_6, 128, "maxcpus", VAR_5) != 0)
max_cpus = strtoull(VAR_6, NULL, 10); if (VAR_1 == 0 || VAR_2 == 0) { VAR_2 = VAR_2 > 0 ? VAR_2 : 1; VAR_4 = VAR_4 > 0 ? VAR_4 : 1; VAR_3 = VAR_3 > 0 ? VAR_3 : 1; if (VAR_1 == 0) { VAR_1 = VAR_4 * VAR_3 * VAR_2; } } else { if (VAR_4 == 0) { VAR_3 = VAR_3 > 0 ? VAR_3 : 1; VAR_4 = VAR_1 / (VAR_2 * VAR_3); } else { VAR_3 = VAR_1 / (VAR_4 * VAR_2); } } smp_cpus = VAR_1; smp_cores = VAR_4 > 0 ? VAR_4 : 1; smp_threads = VAR_3 > 0 ? VAR_3 : 1; if (max_cpus == 0)
max_cpus = smp_cpus; }