// File: joncampbell123[P]haxcc/haxpp.cpp
// Function: parse_argv(int, char**)
static int parse_argv(int argc,char **argv) {
    int nwac=0;
    char *a;
    int i=1;

    while (i < argc) {
        a = argv[i++];

        if (*a == '-' && strcmp(a,"-") != 0/*not "-"*/) {
            do { a++; } while (*a == '-');

            if (!strcmp(a,"h") || !strcmp(a,"help")) {
                help();
                return 1;
            }
            else if (!strcmp(a,"EE")) {
                ppp_only = true;
            }
            else if (!strcmp(a,"ET")) {
                ppt_only = true;
            }
            else if (!strcmp(a,"E")) {
                pp_only = true;
            }
            else {
                fprintf(stderr,"Unknown switch %s\n",a);
                return 1;
            }
        }
        else {
            switch (nwac++) {
                case 0:
                    in_file = a;
                    break;
                case 1:
                    out_file = a;
                    break;
                default:
                    fprintf(stderr,"Unexpected arg %s\n",a);
                    return 1;
            }
        }
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x1, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x151f5
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x24(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x15188
movq -0x20(%rbp), %rdi
leaq 0xf9f6(%rip), %rsi      # 0x24a94
callq 0x33e0
cmpl $0x0, %eax
je 0x15188
jmp 0x150ae
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
je 0x150ae
movq -0x20(%rbp), %rdi
leaq 0xfaf0(%rip), %rsi      # 0x24bc1
callq 0x33e0
cmpl $0x0, %eax
je 0x150f0
movq -0x20(%rbp), %rdi
leaq 0x10943(%rip), %rsi     # 0x25a29
callq 0x33e0
cmpl $0x0, %eax
jne 0x15101
callq 0x15210
movl $0x1, -0x4(%rbp)
jmp 0x151fc
movq -0x20(%rbp), %rdi
leaq 0x10922(%rip), %rsi     # 0x25a2e
callq 0x33e0
cmpl $0x0, %eax
jne 0x1511f
movb $0x1, 0x1e33c(%rip)     # 0x33459
jmp 0x15184
movq -0x20(%rbp), %rdi
leaq 0x10907(%rip), %rsi     # 0x25a31
callq 0x33e0
cmpl $0x0, %eax
jne 0x1513d
movb $0x1, 0x1e31d(%rip)     # 0x33458
jmp 0x15182
movq -0x20(%rbp), %rdi
leaq 0x108e7(%rip), %rsi     # 0x25a2f
callq 0x33e0
cmpl $0x0, %eax
jne 0x1515b
movb $0x1, 0x1e301(%rip)     # 0x3345a
jmp 0x15180
movq 0x1de56(%rip), %rax     # 0x32fb8
movq (%rax), %rdi
movq -0x20(%rbp), %rdx
leaq 0x108c4(%rip), %rsi     # 0x25a34
movb $0x0, %al
callq 0x33f0
movl $0x1, -0x4(%rbp)
jmp 0x151fc
jmp 0x15182
jmp 0x15184
jmp 0x15186
jmp 0x151f0
movl -0x14(%rbp), %eax
movl %eax, -0x28(%rbp)
movl %eax, %ecx
incl %ecx
movl %ecx, -0x14(%rbp)
testl %eax, %eax
je 0x151a5
jmp 0x1519b
movl -0x28(%rbp), %eax
subl $0x1, %eax
je 0x151b7
jmp 0x151c9
movq -0x20(%rbp), %rsi
leaq 0x1e218(%rip), %rdi     # 0x333c8
callq 0x33c0
jmp 0x151ee
movq -0x20(%rbp), %rsi
leaq 0x1e226(%rip), %rdi     # 0x333e8
callq 0x33c0
jmp 0x151ee
movq 0x1dde8(%rip), %rax     # 0x32fb8
movq (%rax), %rdi
movq -0x20(%rbp), %rdx
leaq 0x10869(%rip), %rsi     # 0x25a47
movb $0x0, %al
callq 0x33f0
movl $0x1, -0x4(%rbp)
jmp 0x151fc
jmp 0x151f0
jmp 0x1505d
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)