// File: legendddhgf[P]Text2RPG/ArgParser.cpp
// Function: ArgParser::ArgParse(int, char**)
void ArgParser::ArgParse(int argc, char **argv) {
  for (int i = 1; i < argc; i++) {
    if (argv[i][0] == '-') opts.push_back(argv[i] + 1); // add to opts
    else { // add to fields (IE: field:target, field=target, field)
      string field, target = string("");
      char *location = strchr(argv[i], '=');
      if (location == nullptr) location = strchr(argv[i], ':');
      if (location != nullptr) {
        target = string(location + 1);
      }
      if (location != nullptr) *location = '\0';
      field = string(argv[i]);
      if (find(expected.begin(), expected.end(), field) == expected.end()) {
        usage1(field);
      }
      fields.insert(pair<string, string>(field, target));
    }
  }
  for (string check : expected) {
    if (fields.find(check) == fields.end()) {
      usage2(check);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x280, %rsp            # imm = 0x280
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x1f8(%rbp)
movl $0x1, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x397f
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x35d3
movq -0x1f8(%rbp), %rax
movq %rax, -0x210(%rbp)
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
incq %rax
movq %rax, -0x208(%rbp)
leaq -0x41(%rbp), %rdi
movq %rdi, -0x200(%rbp)
callq 0x2310
movq -0x208(%rbp), %rsi
movq -0x200(%rbp), %rdx
leaq -0x40(%rbp), %rdi
callq 0x2260
jmp 0x3579
movq -0x210(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x3f70
jmp 0x358b
leaq -0x40(%rbp), %rdi
callq 0x2150
leaq -0x41(%rbp), %rdi
callq 0x21f0
jmp 0x396f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x35c5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x2150
leaq -0x41(%rbp), %rdi
callq 0x21f0
jmp 0x3ae7
leaq -0x78(%rbp), %rdi
callq 0x2270
leaq -0x99(%rbp), %rdi
movq %rdi, -0x218(%rbp)
callq 0x2310
movq -0x218(%rbp), %rdx
leaq 0xcd16(%rip), %rsi      # 0x10313
leaq -0x98(%rbp), %rdi
callq 0x2260
jmp 0x360b
leaq -0x99(%rbp), %rdi
callq 0x21f0
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movl $0x3d, %esi
callq 0x20a0
movq %rax, -0xa8(%rbp)
cmpq $0x0, -0xa8(%rbp)
jne 0x367a
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movl $0x3a, %esi
callq 0x20a0
movq %rax, -0xa8(%rbp)
jmp 0x367a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x99(%rbp), %rdi
callq 0x21f0
jmp 0x3961
cmpq $0x0, -0xa8(%rbp)
je 0x3712
movq -0xa8(%rbp), %rax
incq %rax
movq %rax, -0x228(%rbp)
leaq -0xc9(%rbp), %rdi
movq %rdi, -0x220(%rbp)
callq 0x2310
movq -0x228(%rbp), %rsi
movq -0x220(%rbp), %rdx
leaq -0xc8(%rbp), %rdi
callq 0x2260
jmp 0x36c8
leaq -0x98(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x2230
leaq -0xc8(%rbp), %rdi
callq 0x2150
leaq -0xc9(%rbp), %rdi
callq 0x21f0
jmp 0x3712
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xc9(%rbp), %rdi
callq 0x21f0
jmp 0x3955
cmpq $0x0, -0xa8(%rbp)
je 0x3726
movq -0xa8(%rbp), %rax
movb $0x0, (%rax)
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x238(%rbp)
leaq -0xf1(%rbp), %rdi
movq %rdi, -0x230(%rbp)
callq 0x2310
movq -0x238(%rbp), %rsi
movq -0x230(%rbp), %rdx
leaq -0xf0(%rbp), %rdi
callq 0x2260
jmp 0x3768
leaq -0x78(%rbp), %rdi
movq %rdi, -0x248(%rbp)
leaq -0xf0(%rbp), %rsi
movq %rsi, -0x258(%rbp)
callq 0x2230
movq -0x258(%rbp), %rdi
callq 0x2150
leaq -0xf1(%rbp), %rdi
callq 0x21f0
movq -0x1f8(%rbp), %rdi
addq $0x50, %rdi
movq %rdi, -0x250(%rbp)
callq 0x2b70
movq -0x250(%rbp), %rdi
movq %rax, -0x108(%rbp)
callq 0x29f0
movq -0x248(%rbp), %rdx
movq %rax, -0x110(%rbp)
movq -0x108(%rbp), %rdi
movq -0x110(%rbp), %rsi
callq 0x3fe0
movq %rax, -0x240(%rbp)
jmp 0x37f2
movq -0x1f8(%rbp), %rdi
movq -0x240(%rbp), %rax
movq %rax, -0x100(%rbp)
addq $0x50, %rdi
callq 0x29f0
movq %rax, -0x118(%rbp)
leaq -0x100(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x3fa0
testb $0x1, %al
jne 0x3833
jmp 0x38b3
leaq -0x138(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x20d0
jmp 0x3845
movq -0x1f8(%rbp), %rdi
leaq -0x138(%rbp), %rsi
callq 0x32e0
jmp 0x385a
leaq -0x138(%rbp), %rdi
callq 0x2150
jmp 0x38b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xf1(%rbp), %rdi
callq 0x21f0
jmp 0x3955
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x3955
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x138(%rbp), %rdi
callq 0x2150
jmp 0x3955
movq -0x1f8(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x260(%rbp)
leaq -0x178(%rbp), %rdi
leaq -0x78(%rbp), %rsi
leaq -0x98(%rbp), %rdx
callq 0x4070
jmp 0x38de
movq -0x260(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0x4030
movb %dl, -0x269(%rbp)
movq %rax, -0x268(%rbp)
jmp 0x3900
movb -0x269(%rbp), %al
movq -0x268(%rbp), %rcx
movq %rcx, -0x188(%rbp)
movb %al, -0x180(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x40d0
leaq -0x98(%rbp), %rdi
callq 0x2150
leaq -0x78(%rbp), %rdi
callq 0x2150
jmp 0x396f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x40d0
leaq -0x98(%rbp), %rdi
callq 0x2150
leaq -0x78(%rbp), %rdi
callq 0x2150
jmp 0x3ae7
jmp 0x3971
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x3508
movq -0x1f8(%rbp), %rax
addq $0x50, %rax
movq %rax, -0x190(%rbp)
movq -0x190(%rbp), %rdi
callq 0x2b70
movq %rax, -0x198(%rbp)
movq -0x190(%rbp), %rdi
callq 0x29f0
movq %rax, -0x1a0(%rbp)
leaq -0x198(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x3ef0
testb $0x1, %al
jne 0x39d3
jmp 0x3ade
leaq -0x198(%rbp), %rdi
callq 0x3f30
movq %rax, %rsi
leaq -0x1c0(%rbp), %rdi
movq %rdi, -0x280(%rbp)
callq 0x20d0
movq -0x1f8(%rbp), %rdi
movq -0x280(%rbp), %rsi
addq $0x18, %rdi
callq 0x4130
movq %rax, -0x278(%rbp)
jmp 0x3a15
movq -0x1f8(%rbp), %rdi
movq -0x278(%rbp), %rax
movq %rax, -0x1c8(%rbp)
addq $0x18, %rdi
callq 0x4160
movq %rax, -0x1d0(%rbp)
leaq -0x1c8(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x4100
testb $0x1, %al
jne 0x3a53
jmp 0x3ab3
leaq -0x1f0(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0x20d0
jmp 0x3a68
movq -0x1f8(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0x33e0
jmp 0x3a7d
leaq -0x1f0(%rbp), %rdi
callq 0x2150
jmp 0x3ab3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x3ad0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0x2150
jmp 0x3ad0
leaq -0x1c0(%rbp), %rdi
callq 0x2150
leaq -0x198(%rbp), %rdi
callq 0x3f50
jmp 0x39b7
leaq -0x1c0(%rbp), %rdi
callq 0x2150
jmp 0x3ae7
addq $0x280, %rsp            # imm = 0x280
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x2300