// File: lvandeve[P]base256/base256.cpp
// Function: UnixArgs::parse(int, char**)
bool parse(int argc, char *argv[]) {
    if(!argc) {
      error = "zero length arguments";
      return false;
    }

    binary = argv[0];

    for(int i = 0; i < argc; i++) {
      if(i > 0) command += " ";
      command += std::string(argv[i]);
    }

    for(int i = 1; i < argc; i++) {
      int num = 0;
      std::string s = argv[i];
      if(s == "--") {
        if(!allowpost) {
          error = "invalid loose double dash argument";
          return false;
        }
        for(int j = i + 1; j < argc; j++) {
          if(j > i + 1) post += " ";
          post += std::string(argv[j]);
        }
        break;
      } else if(s.size() > 2 && s[0] == '-' && s[1] == '-') {
        std::string s2 = s.substr(2);
        std::string val = "";
        size_t eq = s2.find('=');
        if(eq != std::string::npos) {
          val = s2.substr(eq + 1);
          s2 = s2.substr(0, eq);
        }
        if(!strings.count(s2)) {
          error = "unkonwn argument: " + s2;
          return false;
        }
        Arg& arg = args[strings[s2]];
        arg.present = true;
        if(!val.empty()) {
          arg.value = val;
        }
      } else if(s.size() > 1 && s[0] == '-') {
        for(int j = 1; j < s.size(); j++) {
          char c = s[j];
          if(!chars.count(c)) {
            error = "unkonwn argument: " + std::string(1, c);
            return false;
          }
          args[chars[c]].present = true;
        }
      } else {
        if(s == "-") {
          error = "loose single dash argument invalid";
          return false;
        }
        if(!allowloose) {
          error = "loose argument " + s + " invalid";
          return false;
        }
        loose.push_back(s);
      }
    }
    return true;
  }

// Assembly:
subq $0x2c8, %rsp            # imm = 0x2C8
movq %rdi, 0x2b8(%rsp)
movl %esi, 0x2b4(%rsp)
movq %rdx, 0x2a8(%rsp)
movq 0x2b8(%rsp), %rax
movq %rax, 0xb8(%rsp)
cmpl $0x0, 0x2b4(%rsp)
jne 0xded0
movq 0xb8(%rsp), %rdi
addq $0xf0, %rdi
leaq 0x1415e(%rip), %rsi     # 0x2201c
callq 0x53c0
movb $0x0, 0x2c7(%rsp)
jmp 0xe985
movq 0xb8(%rsp), %rdi
movq 0x2a8(%rsp), %rax
movq (%rax), %rsi
addq $0x20, %rdi
callq 0x53c0
movl $0x0, 0x2a4(%rsp)
movl 0x2a4(%rsp), %eax
cmpl 0x2b4(%rsp), %eax
jge 0xe009
cmpl $0x0, 0x2a4(%rsp)
jle 0xdf29
movq 0xb8(%rsp), %rdi
leaq 0x1431b(%rip), %rsi     # 0x2223f
callq 0x5280
movq 0x2a8(%rsp), %rax
movslq 0x2a4(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0xa8(%rsp)
leaq 0x27f(%rsp), %rdi
movq %rdi, 0xb0(%rsp)
callq 0x54f0
movq 0xa8(%rsp), %rsi
movq 0xb0(%rsp), %rdx
leaq 0x280(%rsp), %rdi
callq 0x53d0
jmp 0xdf79
movq 0xb8(%rsp), %rdi
leaq 0x280(%rsp), %rsi
callq 0x5360
jmp 0xdf90
leaq 0x280(%rsp), %rdi
callq 0x5558
leaq 0x27f(%rsp), %rdi
callq 0x5300
movl 0x2a4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2a4(%rsp)
jmp 0xdef7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
jmp 0xdff7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
leaq 0x280(%rsp), %rdi
callq 0x5558
leaq 0x27f(%rsp), %rdi
callq 0x5300
jmp 0xe996
movl $0x1, 0x268(%rsp)
movl 0x268(%rsp), %eax
cmpl 0x2b4(%rsp), %eax
jge 0xe97d
movl $0x0, 0x264(%rsp)
movq 0x2a8(%rsp), %rax
movslq 0x268(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x98(%rsp)
leaq 0x23f(%rsp), %rdi
movq %rdi, 0xa0(%rsp)
callq 0x54f0
movq 0x98(%rsp), %rsi
movq 0xa0(%rsp), %rdx
leaq 0x240(%rsp), %rdi
callq 0x53d0
jmp 0xe083
leaq 0x23f(%rsp), %rdi
callq 0x5300
leaq 0x13f43(%rip), %rsi     # 0x21fda
leaq 0x240(%rsp), %rdi
callq 0xfd20
movb %al, 0x97(%rsp)
jmp 0xe0ad
movb 0x97(%rsp), %al
testb $0x1, %al
jne 0xe0bd
jmp 0xe28c
movq 0xb8(%rsp), %rax
testb $0x1, 0x110(%rax)
jne 0xe142
movq 0xb8(%rsp), %rdi
addq $0xf0, %rdi
leaq 0x13f4e(%rip), %rsi     # 0x22032
callq 0x53c0
jmp 0xe0eb
movb $0x0, 0x2c7(%rsp)
movl $0x1, 0x238(%rsp)
jmp 0xe92d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
leaq 0x23f(%rsp), %rdi
callq 0x5300
jmp 0xe996
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
jmp 0xe96e
movl 0x268(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x234(%rsp)
movl 0x234(%rsp), %eax
cmpl 0x2b4(%rsp), %eax
jge 0xe27c
movl 0x234(%rsp), %eax
movl 0x268(%rsp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jle 0xe198
movq 0xb8(%rsp), %rdi
addq $0x40, %rdi
leaq 0x140b0(%rip), %rsi     # 0x2223f
callq 0x5280
jmp 0xe196
jmp 0xe198
movq 0x2a8(%rsp), %rax
movslq 0x234(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x80(%rsp)
leaq 0x20f(%rsp), %rdi
movq %rdi, 0x88(%rsp)
callq 0x54f0
movq 0x80(%rsp), %rsi
movq 0x88(%rsp), %rdx
leaq 0x210(%rsp), %rdi
callq 0x53d0
jmp 0xe1e8
movq 0xb8(%rsp), %rdi
addq $0x40, %rdi
leaq 0x210(%rsp), %rsi
callq 0x5360
jmp 0xe203
leaq 0x210(%rsp), %rdi
callq 0x5558
leaq 0x20f(%rsp), %rdi
callq 0x5300
movl 0x234(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x234(%rsp)
jmp 0xe153
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
jmp 0xe26a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
leaq 0x210(%rsp), %rdi
callq 0x5558
leaq 0x20f(%rsp), %rdi
callq 0x5300
jmp 0xe96e
movl $0x5, 0x238(%rsp)
jmp 0xe92d
leaq 0x240(%rsp), %rdi
callq 0x5220
cmpq $0x2, %rax
jbe 0xe5bd
xorl %eax, %eax
movl %eax, %esi
leaq 0x240(%rsp), %rdi
callq 0x5540
movq %rax, 0x78(%rsp)
jmp 0xe2bb
movq 0x78(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0xe5bd
leaq 0x240(%rsp), %rdi
movl $0x1, %esi
callq 0x5540
movq %rax, 0x70(%rsp)
jmp 0xe2e5
movq 0x70(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0xe5bd
leaq 0x1e8(%rsp), %rdi
leaq 0x240(%rsp), %rsi
movl $0x2, %edx
movq $-0x1, %rcx
callq 0x52c0
jmp 0xe319
leaq 0x1c7(%rsp), %rdi
movq %rdi, 0x68(%rsp)
callq 0x54f0
movq 0x68(%rsp), %rdx
leaq 0x12f49(%rip), %rsi     # 0x21280
leaq 0x1c8(%rsp), %rdi
callq 0x53d0
jmp 0xe346
leaq 0x1c7(%rsp), %rdi
callq 0x5300
leaq 0x1e8(%rsp), %rdi
movl $0x3d, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x5380
movq %rax, 0x1b8(%rsp)
cmpq $-0x1, 0x1b8(%rsp)
je 0xe460
movq 0x1b8(%rsp), %rdx
incq %rdx
leaq 0x198(%rsp), %rdi
leaq 0x1e8(%rsp), %rsi
movq $-0x1, %rcx
callq 0x52c0
jmp 0xe3a9
leaq 0x1c8(%rsp), %rdi
leaq 0x198(%rsp), %rsi
movq %rsi, 0x60(%rsp)
callq 0x5330
movq 0x60(%rsp), %rdi
callq 0x5558
movq 0x1b8(%rsp), %rcx
xorl %eax, %eax
movl %eax, %edx
leaq 0x178(%rsp), %rdi
leaq 0x1e8(%rsp), %rsi
callq 0x52c0
jmp 0xe3f0
leaq 0x1e8(%rsp), %rdi
leaq 0x178(%rsp), %rsi
callq 0x5330
leaq 0x178(%rsp), %rdi
callq 0x5558
jmp 0xe460
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
leaq 0x1c7(%rsp), %rdi
callq 0x5300
jmp 0xe5ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
leaq 0x1c8(%rsp), %rdi
callq 0x5558
jmp 0xe5ab
movq 0xb8(%rsp), %rdi
addq $0xa8, %rdi
leaq 0x1e8(%rsp), %rsi
callq 0x15a60
movq %rax, 0x58(%rsp)
jmp 0xe483
movq 0x58(%rsp), %rax
cmpq $0x0, %rax
jne 0xe4ed
leaq 0x13bc0(%rip), %rsi     # 0x22055
leaq 0x158(%rsp), %rdi
leaq 0x1e8(%rsp), %rdx
callq 0x11ae0
jmp 0xe4ac
movq 0xb8(%rsp), %rdi
addq $0xf0, %rdi
leaq 0x158(%rsp), %rsi
callq 0x5330
leaq 0x158(%rsp), %rdi
callq 0x5558
movb $0x0, 0x2c7(%rsp)
movl $0x1, 0x238(%rsp)
jmp 0xe57b
movq 0xb8(%rsp), %rdi
movq %rdi, %rax
addq $0x60, %rax
movq %rax, 0x48(%rsp)
addq $0xa8, %rdi
leaq 0x1e8(%rsp), %rsi
callq 0x11980
movq %rax, 0x50(%rsp)
jmp 0xe51c
movq 0x48(%rsp), %rdi
movq 0x50(%rsp), %rax
movq (%rax), %rsi
callq 0x15ac0
movq %rax, 0x150(%rsp)
movq 0x150(%rsp), %rax
movb $0x1, 0x78(%rax)
leaq 0x1c8(%rsp), %rdi
callq 0x5480
testb $0x1, %al
jne 0xe570
movq 0x150(%rsp), %rdi
addq $0x38, %rdi
leaq 0x1c8(%rsp), %rsi
callq 0x5050
jmp 0xe56e
jmp 0xe570
movl $0x0, 0x238(%rsp)
leaq 0x1c8(%rsp), %rdi
callq 0x5558
leaq 0x1e8(%rsp), %rdi
callq 0x5558
movl 0x238(%rsp), %eax
testl %eax, %eax
jne 0xe92d
jmp 0xe5a6
jmp 0xe920
leaq 0x1e8(%rsp), %rdi
callq 0x5558
jmp 0xe96e
leaq 0x240(%rsp), %rdi
callq 0x5220
cmpq $0x1, %rax
jbe 0xe7e6
xorl %eax, %eax
movl %eax, %esi
leaq 0x240(%rsp), %rdi
callq 0x5540
movq %rax, 0x40(%rsp)
jmp 0xe5ec
movq 0x40(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0xe7e6
movl $0x1, 0x14c(%rsp)
movslq 0x14c(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0x240(%rsp), %rdi
callq 0x5220
movq %rax, %rcx
movq 0x38(%rsp), %rax
cmpq %rcx, %rax
jae 0xe7e1
movslq 0x14c(%rsp), %rsi
leaq 0x240(%rsp), %rdi
callq 0x5540
movq %rax, 0x30(%rsp)
jmp 0xe64f
movq 0xb8(%rsp), %rdi
movq 0x30(%rsp), %rax
movb (%rax), %al
movb %al, 0x14b(%rsp)
addq $0x78, %rdi
leaq 0x14b(%rsp), %rsi
callq 0x15ae0
movq %rax, 0x28(%rsp)
jmp 0xe67d
movq 0x28(%rsp), %rax
cmpq $0x0, %rax
jne 0xe789
movsbl 0x14b(%rsp), %eax
movl %eax, 0x1c(%rsp)
leaq 0x107(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x54f0
movl 0x1c(%rsp), %edx
movq 0x20(%rsp), %rcx
leaq 0x108(%rsp), %rdi
movl $0x1, %esi
callq 0x5200
jmp 0xe6c7
leaq 0x13987(%rip), %rsi     # 0x22055
leaq 0x128(%rsp), %rdi
leaq 0x108(%rsp), %rdx
callq 0x10f50
jmp 0xe6e5
movq 0xb8(%rsp), %rdi
addq $0xf0, %rdi
leaq 0x128(%rsp), %rsi
callq 0x5330
leaq 0x128(%rsp), %rdi
callq 0x5558
leaq 0x108(%rsp), %rdi
callq 0x5558
leaq 0x107(%rsp), %rdi
callq 0x5300
movb $0x0, 0x2c7(%rsp)
movl $0x1, 0x238(%rsp)
jmp 0xe92d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
jmp 0xe777
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
leaq 0x108(%rsp), %rdi
callq 0x5558
leaq 0x107(%rsp), %rdi
callq 0x5300
jmp 0xe96e
movq 0xb8(%rsp), %rdi
movq %rdi, %rax
addq $0x60, %rax
movq %rax, 0x8(%rsp)
addq $0x78, %rdi
leaq 0x14b(%rsp), %rsi
callq 0x11ca0
movq %rax, 0x10(%rsp)
jmp 0xe7b5
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rax
movq (%rax), %rsi
callq 0x15ac0
movb $0x1, 0x78(%rax)
movl 0x14c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14c(%rsp)
jmp 0xe608
jmp 0xe91e
leaq 0x137ee(%rip), %rsi     # 0x21fdb
leaq 0x240(%rsp), %rdi
callq 0xfd20
movb %al, 0x7(%rsp)
jmp 0xe800
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0xe80a
jmp 0xe83f
movq 0xb8(%rsp), %rdi
addq $0xf0, %rdi
leaq 0x13848(%rip), %rsi     # 0x22068
callq 0x53c0
jmp 0xe827
movb $0x0, 0x2c7(%rsp)
movl $0x1, 0x238(%rsp)
jmp 0xe92d
movq 0xb8(%rsp), %rax
testb $0x1, 0x111(%rax)
jne 0xe8fe
leaq 0x13830(%rip), %rsi     # 0x2208b
leaq 0xc0(%rsp), %rdi
leaq 0x240(%rsp), %rdx
callq 0x11ae0
jmp 0xe872
leaq 0x13809(%rip), %rdx     # 0x22082
leaq 0xe0(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x11c10
jmp 0xe890
movq 0xb8(%rsp), %rdi
addq $0xf0, %rdi
leaq 0xe0(%rsp), %rsi
callq 0x5330
leaq 0xe0(%rsp), %rdi
callq 0x5558
leaq 0xc0(%rsp), %rdi
callq 0x5558
movb $0x0, 0x2c7(%rsp)
movl $0x1, 0x238(%rsp)
jmp 0xe92d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0x5558
jmp 0xe96e
movq 0xb8(%rsp), %rdi
addq $0xd8, %rdi
leaq 0x240(%rsp), %rsi
callq 0x15b40
jmp 0xe91c
jmp 0xe91e
jmp 0xe920
jmp 0xe922
movl $0x0, 0x238(%rsp)
leaq 0x240(%rsp), %rdi
callq 0x5558
movl 0x238(%rsp), %eax
movl %eax, (%rsp)
testl %eax, %eax
je 0xe956
jmp 0xe94a
movl (%rsp), %eax
subl $0x1, %eax
je 0xe985
jmp 0xe954
jmp 0xe97d
jmp 0xe958
movl 0x268(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x268(%rsp)
jmp 0xe014
leaq 0x240(%rsp), %rdi
callq 0x5558
jmp 0xe996
movb $0x1, 0x2c7(%rsp)
movb 0x2c7(%rsp), %al
andb $0x1, %al
addq $0x2c8, %rsp            # imm = 0x2C8
retq
movq 0x270(%rsp), %rdi
callq 0x54e0
nopw %cs:(%rax,%rax)
nopl (%rax)