static int img_create(int argc, char **argv)

{

    int c, ret = 0;

    uint64_t img_size = -1;

    const char *fmt = "raw";

    const char *base_fmt = NULL;

    const char *filename;

    const char *base_filename = NULL;

    char *options = NULL;



    for(;;) {

        c = getopt(argc, argv, "F:b:f:he6o:");

        if (c == -1) {

            break;

        }

        switch(c) {

        case '?':

        case 'h':

            help();

            break;

        case 'F':

            base_fmt = optarg;

            break;

        case 'b':

            base_filename = optarg;

            break;

        case 'f':

            fmt = optarg;

            break;

        case 'e':

            error_report("option -e is deprecated, please use \'-o "

                  "encryption\' instead!");

            return 1;

        case '6':

            error_report("option -6 is deprecated, please use \'-o "

                  "compat6\' instead!");

            return 1;

        case 'o':

            options = optarg;

            break;

        }

    }



    /* Get the filename */

    if (optind >= argc) {

        help();

    }

    filename = argv[optind++];



    /* Get image size, if specified */

    if (optind < argc) {

        int64_t sval;

        char *end;

        sval = strtosz_suffix(argv[optind++], &end, STRTOSZ_DEFSUFFIX_B);

        if (sval < 0 || *end) {

            error_report("Invalid image size specified! You may use k, M, G or "

                  "T suffixes for ");

            error_report("kilobytes, megabytes, gigabytes and terabytes.");

            ret = -1;

            goto out;

        }

        img_size = (uint64_t)sval;

    }



    if (options && !strcmp(options, "?")) {

        ret = print_block_option_help(filename, fmt);

        goto out;

    }



    ret = bdrv_img_create(filename, fmt, base_filename, base_fmt,

                          options, img_size, BDRV_O_FLAGS);

out:

    if (ret) {

        return 1;

    }

    return 0;

}

static int img_create(int argc, char **argv)

{

    int c, ret = 0;

    uint64_t img_size = -1;

    const char *fmt = "raw";

    const char *base_fmt = NULL;

    const char *filename;

    const char *base_filename = NULL;

    char *options = NULL;



    for(;;) {

        c = getopt(argc, argv, "F:b:f:he6o:");

        if (c == -1) {

            break;

        }

        switch(c) {

        case '?':

        case 'h':

            help();

            break;

        case 'F':

            base_fmt = optarg;

            break;

        case 'b':

            base_filename = optarg;

            break;

        case 'f':

            fmt = optarg;

            break;

        case 'e':

            error_report("option -e is deprecated, please use \'-o "

                  "encryption\' instead!");

            return 1;

        case '6':

            error_report("option -6 is deprecated, please use \'-o "

                  "compat6\' instead!");

            return 1;

        case 'o':

            options = optarg;

            break;

        }

    }



    

    if (optind >= argc) {

        help();

    }

    filename = argv[optind++];



    

    if (optind < argc) {

        int64_t sval;

        char *end;

        sval = strtosz_suffix(argv[optind++], &end, STRTOSZ_DEFSUFFIX_B);

        if (sval < 0 || *end) {

            error_report("Invalid image size specified! You may use k, M, G or "

                  "T suffixes for ");

            error_report("kilobytes, megabytes, gigabytes and terabytes.");

            ret = -1;

            goto out;

        }

        img_size = (uint64_t)sval;

    }



    if (options && !strcmp(options, "?")) {

        ret = print_block_option_help(filename, fmt);

        goto out;

    }



    ret = bdrv_img_create(filename, fmt, base_filename, base_fmt,

                          options, img_size, BDRV_O_FLAGS);

out:

    if (ret) {

        return 1;

    }

    return 0;

}

    if (options && !strcmp(options, "?")) {     if (options && !strcmp(options, "?")) {
static int FUNC_0(int VAR_0, char **VAR_1)

{

    int VAR_2, VAR_3 = 0;

    uint64_t img_size = -1;

    const char *VAR_4 = "raw";

    const char *VAR_5 = NULL;

    const char *VAR_6;

    const char *VAR_7 = NULL;

    char *VAR_8 = NULL;



    for(;;) {

        VAR_2 = getopt(VAR_0, VAR_1, "F:b:f:he6o:");

        if (VAR_2 == -1) {

            break;

        }

        switch(VAR_2) {

        case '?':

        case 'h':

            help();

            break;

        case 'F':

            VAR_5 = optarg;

            break;

        case 'b':

            VAR_7 = optarg;

            break;

        case 'f':

            VAR_4 = optarg;

            break;

        case 'e':

            error_report("option -e is deprecated, please use \'-o "

                  "encryption\' instead!");

            return 1;

        case '6':

            error_report("option -6 is deprecated, please use \'-o "

                  "compat6\' instead!");

            return 1;

        case 'o':

            VAR_8 = optarg;

            break;

        }

    }



    

    if (optind >= VAR_0) {

        help();

    }

    VAR_6 = VAR_1[optind++];



    

    if (optind < VAR_0) {

        int64_t sval;

        char *VAR_9;

        sval = strtosz_suffix(VAR_1[optind++], &VAR_9, STRTOSZ_DEFSUFFIX_B);

        if (sval < 0 || *VAR_9) {

            error_report("Invalid image size specified! You may use k, M, G or "

                  "T suffixes for ");

            error_report("kilobytes, megabytes, gigabytes and terabytes.");

            VAR_3 = -1;

            goto out;

        }

        img_size = (uint64_t)sval;

    }



    if (VAR_8 && !strcmp(VAR_8, "?")) {

        VAR_3 = print_block_option_help(VAR_6, VAR_4);

        goto out;

    }



    VAR_3 = bdrv_img_create(VAR_6, VAR_4, VAR_7, VAR_5,

                          VAR_8, img_size, BDRV_O_FLAGS);

out:

    if (VAR_3) {

        return 1;

    }

    return 0;

}

static int FUNC_0(int VAR_0, char **VAR_1)
{ int VAR_2, VAR_3 = 0; uint64_t img_size = -1; const char *VAR_4 = "raw"; const char *VAR_5 = NULL; const char *VAR_6; const char *VAR_7 = NULL; char *VAR_8 = NULL; for(;;) { VAR_2 = getopt(VAR_0, VAR_1, "F:b:f:he6o:"); if (VAR_2 == -1) { break; } switch(VAR_2) { case '?':
case 'h':
help(); break; case 'F':
VAR_5 = optarg; break; case 'b':
VAR_7 = optarg; break; case 'f':
VAR_4 = optarg; break; case 'e':
error_report("option -e is deprecated, please use \'-o "
"encryption\' instead!"); return 1; case '6':
error_report("option -6 is deprecated, please use \'-o "
"compat6\' instead!"); return 1; case 'o':
VAR_8 = optarg; break; } } if (optind >= VAR_0) { help(); } VAR_6 = VAR_1[optind++]; if (optind < VAR_0) { int64_t sval; char *VAR_9; sval = strtosz_suffix(VAR_1[optind++], &VAR_9, STRTOSZ_DEFSUFFIX_B); if (sval < 0 || *VAR_9) { error_report("Invalid image size specified! You may use k, M, G or "
"T suffixes for "); error_report("kilobytes, megabytes, gigabytes and terabytes."); VAR_3 = -1; goto out; } img_size = (uint64_t)sval; } if (VAR_8 && !strcmp(VAR_8, "?")) { VAR_3 = print_block_option_help(VAR_6, VAR_4); goto out; } VAR_3 = bdrv_img_create(VAR_6, VAR_4, VAR_7, VAR_5,
VAR_8, img_size, BDRV_O_FLAGS); out:
if (VAR_3) { return 1; } return 0; }