// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rdx, -0x40(%rbp)
movq %rdi, %r14
leaq -0x90(%rbp), %r13
cmpl $0x2, %esi
movq %rdi, -0x38(%rbp)
jl 0x3141
leaq 0x18(%r14), %rax
movq %rax, -0xc8(%rbp)
movl %esi, %eax
movq %rax, -0xd0(%rbp)
movl $0x1, %ebx
leaq -0xa0(%rbp), %r12
movq -0x40(%rbp), %rax
movq (%rax,%rbx,8), %r13
cmpb $0x2d, (%r13)
jne 0x2fbc
leaq 0x1(%r13), %r15
leaq -0x90(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq %r15, %rdi
callq 0x20c0
leaq (%rax,%r13), %rdx
incq %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x29b2
movq %r14, %rdi
movq %r12, %rsi
callq 0x3ff8
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %r13
cmpq %r13, %rdi
je 0x2fab
callq 0x2160
incq %rbx
cmpq %rbx, -0xd0(%rbp)
jne 0x2f4d
jmp 0x3141
leaq -0x50(%rbp), %rax
movq %rax, -0x60(%rbp)
movq $0x0, -0x58(%rbp)
movb $0x0, -0x50(%rbp)
leaq -0xb0(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0xc0(%rbp), %rdi
leaq 0x525b(%rip), %rdx      # 0x8247
movq %rdx, %rsi
callq 0x29b2
movq -0x40(%rbp), %rax
movq (%rax,%rbx,8), %r15
movq %r15, %rdi
movl $0x3d, %esi
callq 0x2090
testq %rax, %rax
jne 0x3020
movq %r15, %rdi
movl $0x3a, %esi
callq 0x2090
testq %rax, %rax
je 0x3080
movq %rax, %r13
leaq 0x1(%rax), %r15
leaq -0x90(%rbp), %r14
movq %r14, -0xa0(%rbp)
movq %r15, %rdi
callq 0x20c0
leaq (%rax,%r13), %rdx
incq %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x29b2
leaq -0xc0(%rbp), %rdi
movq %r12, %rsi
callq 0x2200
movq -0xa0(%rbp), %rdi
cmpq %r14, %rdi
je 0x306f
callq 0x2160
movb $0x0, (%r13)
movq -0x40(%rbp), %rax
movq (%rax,%rbx,8), %r15
movq -0x38(%rbp), %r14
movq %r12, %rdi
movq %r15, %rsi
leaq -0x29(%rbp), %rdx
callq 0x20a0
leaq -0x60(%rbp), %rdi
movq %r12, %rsi
callq 0x2200
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %r13
cmpq %r13, %rdi
je 0x30b3
callq 0x2160
movq 0x50(%r14), %rdi
movq 0x58(%r14), %rsi
leaq -0x60(%rbp), %rdx
callq 0x41fd
cmpq 0x58(%r14), %rax
je 0x31ea
movq %r12, %rdi
leaq -0x60(%rbp), %rsi
leaq -0xc0(%rbp), %rdx
callq 0x34b6
movq -0xc8(%rbp), %rdi
movq %r12, %rsi
callq 0x433a
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x3102
callq 0x2160
movq -0xa0(%rbp), %rdi
cmpq %r13, %rdi
je 0x3113
callq 0x2160
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x312b
callq 0x2160
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
jne 0x2fa6
jmp 0x2fab
movq 0x50(%r14), %rbx
movq 0x58(%r14), %r12
cmpq %r12, %rbx
je 0x31a0
movq -0x38(%rbp), %rax
leaq 0x18(%rax), %r14
leaq -0xa0(%rbp), %r15
movq %r13, -0xa0(%rbp)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x2bfa
movq %r14, %rdi
movq %r15, %rsi
callq 0x448e
testq %rax, %rax
je 0x31b2
movq -0xa0(%rbp), %rdi
cmpq %r13, %rdi
je 0x3197
callq 0x2160
addq $0x20, %rbx
cmpq %r12, %rbx
jne 0x315d
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0xe0(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq -0xa0(%rbp), %rsi
movq -0x98(%rbp), %rdx
addq %rsi, %rdx
leaq -0xf0(%rbp), %rdi
callq 0x2bfa
leaq -0xf0(%rbp), %rsi
movq -0x38(%rbp), %rdi
callq 0x2e48
leaq -0x100(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
addq %rsi, %rdx
leaq -0x110(%rbp), %rdi
callq 0x2bfa
leaq -0x110(%rbp), %rsi
movq -0x38(%rbp), %rdi
callq 0x2d92
movq %rax, %r14
movq -0x110(%rbp), %rdi
cmpq %rbx, %rdi
je 0x3258
callq 0x2160
jmp 0x3258
jmp 0x3255
jmp 0x3255
jmp 0x3255
movq %rax, %r14
leaq -0xa0(%rbp), %rdi
callq 0x351e
jmp 0x3258
movq %rax, %r14
jmp 0x32af
movq %rax, %r14
jmp 0x3270
jmp 0x3255
movq %rax, %r14
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x3270
callq 0x2160
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
jmp 0x32a5
jmp 0x3294
movq %rax, %r14
movq -0xf0(%rbp), %rdi
cmpq %rbx, %rdi
je 0x3297
callq 0x2160
jmp 0x3297
jmp 0x3294
movq %rax, %r14
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x32af
callq 0x2160
movq %r14, %rdi
callq 0x2290
nop