// File: solaldunckel[P]webserv/srcs/Config/InputArgs.cpp
// Function: InputArgs::parse()
void InputArgs::parse() {
  for (int i = 1; i < argc_; i++) {
    std::string arg = argv_[i];

    if (arg.find('-') == 0) {
      std::string opt = arg.substr(arg.find('-') + 1);

      if (options_.find(opt) != options_.end())
        options_[opt] = true;
      else if (opt == "l" || opt == "-log") {
        if (i + 1 < argc_) {
          std::string opt2 = argv_[i + 1];
          if (opt2.find_first_not_of("0123456789") == std::string::npos) {
            i++;
            int level = ft::stoi(argv_[i]);
            if (level <= 2)
              log_level_ = (LogLevel)level;
            else
              throw webserv_exception("invalid option %\n\n" + helpText(), 0, opt + " " + opt2);
          }
        }
      }
      else
        throw webserv_exception("invalid option -%\n\n" + helpText(), 0, opt);
    } else {
      path_ = arg;
      if (i != argc_ - 1)
        throw webserv_exception("too many arguments\n\n" + helpText(), 0, "test");
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2a0, %rsp            # imm = 0x2A0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x228(%rbp)
movl $0x1, -0xc(%rbp)
movq -0x228(%rbp), %rcx
movl -0xc(%rbp), %eax
cmpl (%rcx), %eax
jge 0xfee6
movq -0x228(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x238(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x230(%rbp)
callq 0x5960
movq -0x238(%rbp), %rsi
movq -0x230(%rbp), %rdx
leaq -0x30(%rbp), %rdi
callq 0x6be0
jmp 0xf7c6
leaq -0x31(%rbp), %rdi
callq 0x55e0
leaq -0x30(%rbp), %rdi
movl $0x2d, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x5730
cmpq $0x0, %rax
jne 0xfd5a
xorl %eax, %eax
movl %eax, %edx
leaq -0x30(%rbp), %rdi
movq %rdi, -0x240(%rbp)
movl $0x2d, %esi
callq 0x5730
movq -0x240(%rbp), %rsi
movq %rax, %rdx
incq %rdx
leaq -0x68(%rbp), %rdi
movq $-0x1, %rcx
callq 0x55a0
jmp 0xf823
movq -0x228(%rbp), %rdi
addq $0x38, %rdi
leaq -0x68(%rbp), %rsi
callq 0x106b0
movq %rax, -0x248(%rbp)
jmp 0xf840
movq -0x228(%rbp), %rdi
movq -0x248(%rbp), %rax
movq %rax, -0x70(%rbp)
addq $0x38, %rdi
callq 0x106e0
movq %rax, -0x78(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x10680
testb $0x1, %al
jne 0xf872
jmp 0xf8da
movq -0x228(%rbp), %rdi
addq $0x38, %rdi
leaq -0x68(%rbp), %rsi
callq 0x10710
movq %rax, -0x250(%rbp)
jmp 0xf88f
movq -0x250(%rbp), %rax
movb $0x1, (%rax)
jmp 0xfd3e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x55e0
jmp 0xfeef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xfedb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xfd4c
leaq 0x34d13(%rip), %rsi     # 0x445f4
leaq -0x68(%rbp), %rdi
callq 0x8ff0
movb %al, -0x251(%rbp)
jmp 0xf8f2
movb -0x251(%rbp), %al
testb $0x1, %al
jne 0xf925
jmp 0xf8fe
leaq 0x338d1(%rip), %rsi     # 0x431d6
leaq -0x68(%rbp), %rdi
callq 0x8ff0
movb %al, -0x252(%rbp)
jmp 0xf916
movb -0x252(%rbp), %al
testb $0x1, %al
jne 0xf925
jmp 0xfc2a
movq -0x228(%rbp), %rcx
movl -0xc(%rbp), %eax
addl $0x1, %eax
cmpl (%rcx), %eax
jge 0xfc25
movq -0x228(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
movq %rax, -0x268(%rbp)
leaq -0x99(%rbp), %rdi
movq %rdi, -0x260(%rbp)
callq 0x5960
movq -0x268(%rbp), %rsi
movq -0x260(%rbp), %rdx
leaq -0x98(%rbp), %rdi
callq 0x6be0
jmp 0xf984
leaq -0x99(%rbp), %rdi
callq 0x55e0
leaq -0x98(%rbp), %rdi
leaq 0x3383d(%rip), %rsi     # 0x431db
xorl %eax, %eax
movl %eax, %edx
callq 0x52f0
cmpq $-0x1, %rax
jne 0xfc06
movq -0x228(%rbp), %rax
movl -0xc(%rbp), %ecx
incl %ecx
movl %ecx, -0xc(%rbp)
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x278(%rbp)
leaq -0xc1(%rbp), %rdi
movq %rdi, -0x270(%rbp)
callq 0x5960
movq -0x278(%rbp), %rsi
movq -0x270(%rbp), %rdx
leaq -0xc0(%rbp), %rdi
callq 0x6be0
jmp 0xfa02
xorl %eax, %eax
movl %eax, %esi
leaq -0xc0(%rbp), %rdi
movl $0xa, %edx
callq 0x41890
movl %eax, -0x27c(%rbp)
jmp 0xfa1f
leaq -0xc0(%rbp), %rdi
callq 0x5aa8
leaq -0xc1(%rbp), %rdi
callq 0x55e0
movl -0x27c(%rbp), %eax
movl %eax, -0xa0(%rbp)
cmpl $0x2, -0xa0(%rbp)
jg 0xfab5
movq -0x228(%rbp), %rax
movl -0xa0(%rbp), %ecx
movl %ecx, 0x30(%rax)
jmp 0xfc04
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x99(%rbp), %rdi
callq 0x55e0
jmp 0xfd4c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xfaa4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x5aa8
leaq -0xc1(%rbp), %rdi
callq 0x55e0
jmp 0xfc14
movb $0x1, -0x149(%rbp)
movl $0x30, %edi
callq 0x5250
movq -0x228(%rbp), %rsi
movq %rax, -0x288(%rbp)
leaq -0x108(%rbp), %rdi
callq 0xff00
jmp 0xfae2
leaq 0x336fd(%rip), %rsi     # 0x431e6
leaq -0xe8(%rbp), %rdi
leaq -0x108(%rbp), %rdx
callq 0x107f0
jmp 0xfafe
leaq 0x33d5e(%rip), %rdx     # 0x43863
leaq -0x148(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x8f70
jmp 0xfb17
leaq -0x128(%rbp), %rdi
leaq -0x148(%rbp), %rsi
leaq -0x98(%rbp), %rdx
callq 0x6a30
jmp 0xfb33
movq -0x288(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
xorl %edx, %edx
leaq -0x128(%rbp), %rcx
callq 0x8b80
jmp 0xfb51
movq -0x288(%rbp), %rdi
movb $0x0, -0x149(%rbp)
leaq 0x4c18a(%rip), %rsi     # 0x5bcf0
leaq -0x6d3d(%rip), %rdx     # 0x8e30
callq 0x5920
jmp 0xfef8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xfbeb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xfbdf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xfbd3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xfbc7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x5aa8
leaq -0x148(%rbp), %rdi
callq 0x5aa8
leaq -0xe8(%rbp), %rdi
callq 0x5aa8
leaq -0x108(%rbp), %rdi
callq 0x5aa8
testb $0x1, -0x149(%rbp)
jne 0xfbf6
jmp 0xfc02
movq -0x288(%rbp), %rdi
callq 0x53b0
jmp 0xfc14
jmp 0xfc06
leaq -0x98(%rbp), %rdi
callq 0x5aa8
jmp 0xfc25
leaq -0x98(%rbp), %rdi
callq 0x5aa8
jmp 0xfd4c
jmp 0xfd3c
movb $0x1, -0x1b1(%rbp)
movl $0x30, %edi
callq 0x5250
movq -0x228(%rbp), %rsi
movq %rax, -0x290(%rbp)
leaq -0x190(%rbp), %rdi
callq 0xff00
jmp 0xfc57
leaq 0x3359b(%rip), %rsi     # 0x431f9
leaq -0x170(%rbp), %rdi
leaq -0x190(%rbp), %rdx
callq 0x107f0
jmp 0xfc73
leaq -0x1b0(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x5200
jmp 0xfc85
movq -0x290(%rbp), %rdi
leaq -0x170(%rbp), %rsi
xorl %edx, %edx
leaq -0x1b0(%rbp), %rcx
callq 0x8b80
jmp 0xfca3
movq -0x290(%rbp), %rdi
movb $0x0, -0x1b1(%rbp)
leaq 0x4c038(%rip), %rsi     # 0x5bcf0
leaq -0x6e8f(%rip), %rdx     # 0x8e30
callq 0x5920
jmp 0xfef8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xfd23
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xfd17
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xfd0b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1b0(%rbp), %rdi
callq 0x5aa8
leaq -0x170(%rbp), %rdi
callq 0x5aa8
leaq -0x190(%rbp), %rdi
callq 0x5aa8
testb $0x1, -0x1b1(%rbp)
jne 0xfd2e
jmp 0xfd3a
movq -0x290(%rbp), %rdi
callq 0x53b0
jmp 0xfd4c
jmp 0xfd3e
leaq -0x68(%rbp), %rdi
callq 0x5aa8
jmp 0xfec4
leaq -0x68(%rbp), %rdi
callq 0x5aa8
jmp 0xfedb
movq -0x228(%rbp), %rdi
addq $0x10, %rdi
leaq -0x30(%rbp), %rsi
callq 0x5050
jmp 0xfd70
movq -0x228(%rbp), %rcx
movl -0xc(%rbp), %eax
movl (%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
je 0xfec2
movb $0x1, -0x21a(%rbp)
movl $0x30, %edi
callq 0x5250
movq -0x228(%rbp), %rsi
movq %rax, -0x298(%rbp)
leaq -0x1f8(%rbp), %rdi
callq 0xff00
jmp 0xfdb4
leaq 0x33452(%rip), %rsi     # 0x4320d
leaq -0x1d8(%rbp), %rdi
leaq -0x1f8(%rbp), %rdx
callq 0x107f0
jmp 0xfdd0
leaq -0x219(%rbp), %rdi
movq %rdi, -0x2a0(%rbp)
callq 0x5960
movq -0x2a0(%rbp), %rdx
leaq 0x333d9(%rip), %rsi     # 0x431ca
leaq -0x218(%rbp), %rdi
callq 0x6be0
jmp 0xfdff
movq -0x298(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
xorl %edx, %edx
leaq -0x218(%rbp), %rcx
callq 0x8b80
jmp 0xfe1d
movq -0x298(%rbp), %rdi
movb $0x0, -0x21a(%rbp)
leaq 0x4bebe(%rip), %rsi     # 0x5bcf0
leaq -0x7009(%rip), %rdx     # 0x8e30
callq 0x5920
jmp 0xfef8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xfea9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xfe9d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xfe85
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x218(%rbp), %rdi
callq 0x5aa8
leaq -0x219(%rbp), %rdi
callq 0x55e0
leaq -0x1d8(%rbp), %rdi
callq 0x5aa8
leaq -0x1f8(%rbp), %rdi
callq 0x5aa8
testb $0x1, -0x21a(%rbp)
jne 0xfeb4
jmp 0xfec0
movq -0x298(%rbp), %rdi
callq 0x53b0
jmp 0xfedb
jmp 0xfec4
leaq -0x30(%rbp), %rdi
callq 0x5aa8
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xf771
leaq -0x30(%rbp), %rdi
callq 0x5aa8
jmp 0xfeef
addq $0x2a0, %rsp            # imm = 0x2A0
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x5950
nopl (%rax,%rax)