// File: jansucan[P]diff-dd/src/options.cpp
// Function: Options::Parser::parseCreate(int, char**)
Create
Parser::parseCreate(int argc, char **argv)
{
    Create opts;

    // Skip the executable name. Do not skip the operation name. getopt expects
    // to start at an argument immediately preceding the possible options.
    argc -= 1;
    argv += 1;

    int ch;
    const char *arg_buffer_size = NULL;
    const char *arg_input_file = NULL;
    const char *arg_base_file = NULL;
    const char *arg_output_file = NULL;

    while ((ch = getopt(argc, argv, ":B:i:b:o:")) != -1) {
        switch (ch) {
        case 'B':
            arg_buffer_size = optarg;
            break;

        case 'i':
            arg_input_file = optarg;
            break;

        case 'b':
            arg_base_file = optarg;
            break;

        case 'o':
            arg_output_file = optarg;
            break;

        case ':':
            throw Error("missing argument for option '-" +
                        std::string(1, optopt) + "'");
        default:
            throw Error("unknown option '-" + std::string(1, optopt) + "'");
        }
    }

    argc -= optind;

    /* Convert numbers in the arguments */
    if ((arg_buffer_size != NULL) &&
        parseUnsigned(arg_buffer_size, &(opts.m_buffer_size))) {
        throw Error("incorrect buffer size");
    } else if (opts.m_buffer_size == 0) {
        throw Error("buffer size cannot be 0");
    }

    if (arg_input_file == NULL) {
        throw Error("missing input file");
    } else if (arg_base_file == NULL) {
        throw Error("missing base file");
    } else if (arg_output_file == NULL) {
        throw Error("missing output file");
    } else if (argc != 0) {
        throw Error("too many arguments");
    }

    opts.m_in_file_path = arg_input_file;
    opts.m_base_file_path = arg_base_file;
    opts.m_out_file_path = arg_output_file;

    return opts;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2c0, %rsp            # imm = 0x2C0
movq %rdi, -0x220(%rbp)
movq %rdi, %rax
movq %rax, -0x218(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
callq 0xa9a0
movl -0xc(%rbp), %eax
subl $0x1, %eax
movl %eax, -0xc(%rbp)
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x18(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movl -0xc(%rbp), %edi
movq -0x18(%rbp), %rsi
leaq 0x3ace(%rip), %rdx      # 0xe821
callq 0x3070
movl %eax, -0x20(%rbp)
cmpl $-0x1, %eax
je 0xb0be
movl -0x20(%rbp), %eax
movl %eax, -0x224(%rbp)
subl $0x3a, %eax
je 0xadfb
jmp 0xad78
movl -0x224(%rbp), %eax
subl $0x42, %eax
je 0xadaf
jmp 0xad85
movl -0x224(%rbp), %eax
subl $0x62, %eax
je 0xadd5
jmp 0xad92
movl -0x224(%rbp), %eax
subl $0x69, %eax
je 0xadc2
jmp 0xad9f
movl -0x224(%rbp), %eax
subl $0x6f, %eax
je 0xade8
jmp 0xaf51
movq 0xa1ea(%rip), %rax      # 0x14fa0
movq (%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0xb0b9
movq 0xa1d7(%rip), %rax      # 0x14fa0
movq (%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0xb0b9
movq 0xa1c4(%rip), %rax      # 0x14fa0
movq (%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0xb0b9
movq 0xa1b1(%rip), %rax      # 0x14fa0
movq (%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0xb0b9
movb $0x1, -0xb5(%rbp)
movl $0x10, %edi
callq 0x3180
movq %rax, -0x240(%rbp)
movq 0xa19e(%rip), %rax      # 0x14fb8
movsbl (%rax), %eax
movl %eax, -0x234(%rbp)
leaq -0xa1(%rbp), %rdi
movq %rdi, -0x230(%rbp)
callq 0x34a0
movl -0x234(%rbp), %edx
movq -0x230(%rbp), %rcx
leaq -0xa0(%rbp), %rdi
movl $0x1, %esi
callq 0xc200
jmp 0xae56
leaq 0x39ce(%rip), %rsi      # 0xe82b
leaq -0x80(%rbp), %rdi
leaq -0xa0(%rbp), %rdx
callq 0xc1b0
jmp 0xae6f
leaq 0x39d4(%rip), %rdx      # 0xe84a
leaq -0x60(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0xc160
jmp 0xae85
movq -0x240(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0xc270
jmp 0xae97
movq -0x240(%rbp), %rdi
movb $0x0, -0xb5(%rbp)
leaq 0x9df4(%rip), %rsi      # 0x14ca0
leaq 0x13fd(%rip), %rdx      # 0xc2b0
callq 0x3480
jmp 0xb700
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0xaf29
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0xaf1d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0xaf14
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x3528
leaq -0x80(%rbp), %rdi
callq 0x3528
leaq -0xa0(%rbp), %rdi
callq 0x3528
leaq -0xa1(%rbp), %rdi
callq 0x32f0
testb $0x1, -0xb5(%rbp)
jne 0xaf40
jmp 0xaf4c
movq -0x240(%rbp), %rdi
callq 0x3200
jmp 0xb6e8
movb $0x1, -0x11a(%rbp)
movl $0x10, %edi
callq 0x3180
movq %rax, -0x258(%rbp)
movq 0xa048(%rip), %rax      # 0x14fb8
movsbl (%rax), %eax
movl %eax, -0x24c(%rbp)
leaq -0x119(%rbp), %rdi
movq %rdi, -0x248(%rbp)
callq 0x34a0
movl -0x24c(%rbp), %edx
movq -0x248(%rbp), %rcx
leaq -0x118(%rbp), %rdi
movl $0x1, %esi
callq 0xc200
jmp 0xafac
leaq 0x3899(%rip), %rsi      # 0xe84c
leaq -0xf8(%rbp), %rdi
leaq -0x118(%rbp), %rdx
callq 0xc1b0
jmp 0xafc8
leaq 0x387b(%rip), %rdx      # 0xe84a
leaq -0xd8(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0xc160
jmp 0xafe4
movq -0x258(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0xc270
jmp 0xaff9
movq -0x258(%rbp), %rdi
movb $0x0, -0x11a(%rbp)
leaq 0x9c92(%rip), %rsi      # 0x14ca0
leaq 0x129b(%rip), %rdx      # 0xc2b0
callq 0x3480
jmp 0xb700
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0xb091
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0xb085
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0xb079
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x3528
leaq -0xf8(%rbp), %rdi
callq 0x3528
leaq -0x118(%rbp), %rdi
callq 0x3528
leaq -0x119(%rbp), %rdi
callq 0x32f0
testb $0x1, -0x11a(%rbp)
jne 0xb0a8
jmp 0xb0b4
movq -0x258(%rbp), %rdi
callq 0x3200
jmp 0xb6e8
jmp 0xad45
movq 0x9f0b(%rip), %rax      # 0x14fd0
movl (%rax), %ecx
movl -0xc(%rbp), %eax
subl %ecx, %eax
movl %eax, -0xc(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0xb1f4
movq -0x220(%rbp), %rsi
movq -0x28(%rbp), %rdi
callq 0xb700
movl %eax, -0x25c(%rbp)
jmp 0xb0f2
movl -0x25c(%rbp), %eax
cmpl $0x0, %eax
je 0xb1f4
movb $0x1, -0x142(%rbp)
movl $0x10, %edi
callq 0x3180
movq %rax, -0x270(%rbp)
leaq -0x141(%rbp), %rdi
movq %rdi, -0x268(%rbp)
callq 0x34a0
movq -0x268(%rbp), %rdx
leaq 0x3724(%rip), %rsi      # 0xe85e
leaq -0x140(%rbp), %rdi
callq 0x47f0
jmp 0xb148
movq -0x270(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0xc270
jmp 0xb15d
movq -0x270(%rbp), %rdi
movb $0x0, -0x142(%rbp)
leaq 0x9b2e(%rip), %rsi      # 0x14ca0
leaq 0x1137(%rip), %rdx      # 0xc2b0
callq 0x3480
jmp 0xb700
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0xb6e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0xb1cc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x3528
leaq -0x141(%rbp), %rdi
callq 0x32f0
testb $0x1, -0x142(%rbp)
jne 0xb1e3
jmp 0xb1ef
movq -0x270(%rbp), %rdi
callq 0x3200
jmp 0xb6e8
movq -0x220(%rbp), %rax
cmpl $0x0, (%rax)
jne 0xb2e0
movb $0x1, -0x16a(%rbp)
movl $0x10, %edi
callq 0x3180
movq %rax, -0x280(%rbp)
leaq -0x169(%rbp), %rdi
movq %rdi, -0x278(%rbp)
callq 0x34a0
movq -0x278(%rbp), %rdx
leaq 0x3637(%rip), %rsi      # 0xe874
leaq -0x168(%rbp), %rdi
callq 0x47f0
jmp 0xb24b
movq -0x280(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0xc270
jmp 0xb260
movq -0x280(%rbp), %rdi
movb $0x0, -0x16a(%rbp)
leaq 0x9a2b(%rip), %rsi      # 0x14ca0
leaq 0x1034(%rip), %rdx      # 0xc2b0
callq 0x3480
jmp 0xb700
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0xb2b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x3528
leaq -0x169(%rbp), %rdi
callq 0x32f0
testb $0x1, -0x16a(%rbp)
jne 0xb2cf
jmp 0xb2db
movq -0x280(%rbp), %rdi
callq 0x3200
jmp 0xb6e8
jmp 0xb2e2
cmpq $0x0, -0x30(%rbp)
jne 0xb3c9
movb $0x1, -0x192(%rbp)
movl $0x10, %edi
callq 0x3180
movq %rax, -0x290(%rbp)
leaq -0x191(%rbp), %rdi
movq %rdi, -0x288(%rbp)
callq 0x34a0
movq -0x288(%rbp), %rdx
leaq 0x3566(%rip), %rsi      # 0xe88c
leaq -0x190(%rbp), %rdi
callq 0x47f0
jmp 0xb334
movq -0x290(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0xc270
jmp 0xb349
movq -0x290(%rbp), %rdi
movb $0x0, -0x192(%rbp)
leaq 0x9942(%rip), %rsi      # 0x14ca0
leaq 0xf4b(%rip), %rdx       # 0xc2b0
callq 0x3480
jmp 0xb700
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0xb3a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x3528
leaq -0x191(%rbp), %rdi
callq 0x32f0
testb $0x1, -0x192(%rbp)
jne 0xb3b8
jmp 0xb3c4
movq -0x290(%rbp), %rdi
callq 0x3200
jmp 0xb6e8
cmpq $0x0, -0x38(%rbp)
jne 0xb4b0
movb $0x1, -0x1ba(%rbp)
movl $0x10, %edi
callq 0x3180
movq %rax, -0x2a0(%rbp)
leaq -0x1b9(%rbp), %rdi
movq %rdi, -0x298(%rbp)
callq 0x34a0
movq -0x298(%rbp), %rdx
leaq 0x3492(%rip), %rsi      # 0xe89f
leaq -0x1b8(%rbp), %rdi
callq 0x47f0
jmp 0xb41b
movq -0x2a0(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0xc270
jmp 0xb430
movq -0x2a0(%rbp), %rdi
movb $0x0, -0x1ba(%rbp)
leaq 0x985b(%rip), %rsi      # 0x14ca0
leaq 0xe64(%rip), %rdx       # 0xc2b0
callq 0x3480
jmp 0xb700
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0xb488
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x3528
leaq -0x1b9(%rbp), %rdi
callq 0x32f0
testb $0x1, -0x1ba(%rbp)
jne 0xb49f
jmp 0xb4ab
movq -0x2a0(%rbp), %rdi
callq 0x3200
jmp 0xb6e8
cmpq $0x0, -0x40(%rbp)
jne 0xb597
movb $0x1, -0x1e2(%rbp)
movl $0x10, %edi
callq 0x3180
movq %rax, -0x2b0(%rbp)
leaq -0x1e1(%rbp), %rdi
movq %rdi, -0x2a8(%rbp)
callq 0x34a0
movq -0x2a8(%rbp), %rdx
leaq 0x33bd(%rip), %rsi      # 0xe8b1
leaq -0x1e0(%rbp), %rdi
callq 0x47f0
jmp 0xb502
movq -0x2b0(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0xc270
jmp 0xb517
movq -0x2b0(%rbp), %rdi
movb $0x0, -0x1e2(%rbp)
leaq 0x9774(%rip), %rsi      # 0x14ca0
leaq 0xd7d(%rip), %rdx       # 0xc2b0
callq 0x3480
jmp 0xb700
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0xb56f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0x3528
leaq -0x1e1(%rbp), %rdi
callq 0x32f0
testb $0x1, -0x1e2(%rbp)
jne 0xb586
jmp 0xb592
movq -0x2b0(%rbp), %rdi
callq 0x3200
jmp 0xb6e8
cmpl $0x0, -0xc(%rbp)
je 0xb67a
movb $0x1, -0x20a(%rbp)
movl $0x10, %edi
callq 0x3180
movq %rax, -0x2c0(%rbp)
leaq -0x209(%rbp), %rdi
movq %rdi, -0x2b8(%rbp)
callq 0x34a0
movq -0x2b8(%rbp), %rdx
leaq 0x32eb(%rip), %rsi      # 0xe8c5
leaq -0x208(%rbp), %rdi
callq 0x47f0
jmp 0xb5e8
movq -0x2c0(%rbp), %rdi
leaq -0x208(%rbp), %rsi
callq 0xc270
jmp 0xb5fd
movq -0x2c0(%rbp), %rdi
movb $0x0, -0x20a(%rbp)
leaq 0x968e(%rip), %rsi      # 0x14ca0
leaq 0xc97(%rip), %rdx       # 0xc2b0
callq 0x3480
jmp 0xb700
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0xb655
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0x208(%rbp), %rdi
callq 0x3528
leaq -0x209(%rbp), %rdi
callq 0x32f0
testb $0x1, -0x20a(%rbp)
jne 0xb66c
jmp 0xb678
movq -0x2c0(%rbp), %rdi
callq 0x3200
jmp 0xb6e8
jmp 0xb67c
jmp 0xb67e
jmp 0xb680
movq -0x220(%rbp), %rdi
addq $0x8, %rdi
leaq -0x30(%rbp), %rsi
callq 0xc2d0
jmp 0xb696
movq -0x220(%rbp), %rdi
addq $0x30, %rdi
leaq -0x38(%rbp), %rsi
callq 0xc2d0
jmp 0xb6ac
movq -0x220(%rbp), %rdi
addq $0x58, %rdi
leaq -0x40(%rbp), %rsi
callq 0xc2d0
jmp 0xb6c2
movb $0x1, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
jne 0xb6d8
movq -0x220(%rbp), %rdi
callq 0xa800
movq -0x218(%rbp), %rax
addq $0x2c0, %rsp            # imm = 0x2C0
popq %rbp
retq
movq -0x220(%rbp), %rdi
callq 0xa800
movq -0xb0(%rbp), %rdi
callq 0x3490