// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, 0x20(%rsp)
leaq 0x38(%rdi), %r14
leaq 0x40(%rdi), %rax
movq %rax, 0x18(%rsp)
pushq $0x1
popq %r15
leaq 0x168(%rsp), %r12
leaq 0x48(%rsp), %r13
pushq $0x2d
popq %rbp
movq %r14, 0x10(%rsp)
cmpl (%rbx), %r15d
jge 0x7bf7
movq 0x8(%rbx), %rax
movslq %r15d, %rcx
movq (%rax,%rcx,8), %rsi
movq %r12, %rdi
movq %r13, %rdx
callq 0x5328
movq %r12, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x45a0
testq %rax, %rax
je 0x7acc
movq 0x20(%rsp), %rdi
movq %r12, %rsi
callq 0x4240
movl (%rbx), %eax
decl %eax
cmpl %eax, %r15d
je 0x7be4
jmp 0x7c09
movq %r12, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x45a0
leaq 0x1(%rax), %rdx
movq %r13, %rdi
movq %r12, %rsi
pushq $-0x1
popq %rcx
callq 0x44a0
movq %r14, %rdi
movq %r13, %rsi
callq 0x8674
leaq 0x28(%rsp), %rbp
cmpq 0x18(%rsp), %rax
je 0x7b14
movq %r14, %rdi
movq %r13, %rsi
callq 0x81ce
movb $0x1, (%rax)
jmp 0x7bdc
movq %r13, %rdi
leaq 0x15aa6(%rip), %rsi     # 0x1d5c4
callq 0x610b
testb %al, %al
jne 0x7b3e
movq %r13, %rdi
leaq 0x146a5(%rip), %rsi     # 0x1c1d6
callq 0x610b
testb %al, %al
je 0x7c8a
leal 0x1(%r15), %ecx
cmpl (%rbx), %ecx
jge 0x7bd7
movq 0x8(%rbx), %rax
movq %rbp, %r14
movl %ecx, 0xc(%rsp)
movslq %ecx, %rbp
movq (%rax,%rbp,8), %rsi
movq %r14, %rdi
leaq 0x68(%rsp), %rdx
callq 0x5328
movq %r14, %rdi
leaq 0x14668(%rip), %rsi     # 0x1c1db
xorl %edx, %edx
callq 0x4270
cmpq $-0x1, %rax
jne 0x7bcf
movq 0x8(%rbx), %rax
movq (%rax,%rbp,8), %rsi
leaq 0x68(%rsp), %r14
movq %r14, %rdi
leaq 0x88(%rsp), %rdx
callq 0x5328
movq %r14, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x1b536
movl %eax, %r15d
movq %r14, %rdi
callq 0x4898
cmpl $0x2, %r15d
jg 0x7d04
movl %r15d, 0x30(%rbx)
movl 0xc(%rsp), %eax
movl %eax, %r15d
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0x4898
movq 0x10(%rsp), %r14
movq %r13, %rdi
callq 0x4898
movq %r12, %rdi
callq 0x4898
incl %r15d
pushq $0x2d
popq %rbp
jmp 0x7a7d
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x30
popq %rdi
callq 0x41e0
movq %rax, %r14
leaq 0x48(%rsp), %rdi
callq 0x7edc
leaq 0x145e8(%rip), %rsi     # 0x1c20d
leaq 0xc8(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x8234
leaq 0x1458c(%rip), %rsi     # 0x1c1ca
leaq 0xa8(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x5328
movb $0x1, %bpl
leaq 0xc8(%rsp), %rsi
leaq 0xa8(%rsp), %rcx
movq %r14, %rdi
xorl %edx, %edx
callq 0x5e96
xorl %ebp, %ebp
leaq 0x2309a(%rip), %rsi     # 0x2ad10
leaq -0x1c2b(%rip), %rdx     # 0x6052
movq %r14, %rdi
callq 0x4730
jmp 0x7d9a
pushq $0x30
popq %rdi
callq 0x41e0
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x7edc
leaq 0x14553(%rip), %rsi     # 0x1c1f9
leaq 0x108(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x8234
leaq 0xe8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x45e0
movb $0x1, %bpl
leaq 0x108(%rsp), %rsi
leaq 0xe8(%rsp), %rcx
movq %r14, %rdi
xorl %edx, %edx
callq 0x5e96
xorl %ebp, %ebp
leaq 0x23020(%rip), %rsi     # 0x2ad10
leaq -0x1ca5(%rip), %rdx     # 0x6052
movq %r14, %rdi
callq 0x4730
jmp 0x7d9a
pushq $0x30
popq %rdi
callq 0x41e0
movq %rax, %r14
leaq 0x68(%rsp), %rdi
callq 0x7edc
leaq 0x144c6(%rip), %rsi     # 0x1c1e6
leaq 0x148(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x8234
leaq 0x14aed(%rip), %rdx     # 0x1c826
leaq 0x88(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x60d3
leaq 0x128(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x5273
movb $0x1, %bpl
leaq 0x148(%rsp), %rsi
leaq 0x128(%rsp), %rcx
movq %r14, %rdi
xorl %edx, %edx
callq 0x5e96
xorl %ebp, %ebp
leaq 0x22f85(%rip), %rsi     # 0x2ad10
leaq -0x1d40(%rip), %rdx     # 0x6052
movq %r14, %rdi
callq 0x4730
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0x4898
jmp 0x7db2
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x88(%rsp), %rdi
callq 0x4898
jmp 0x7dc7
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x148(%rsp), %rdi
callq 0x4898
jmp 0x7ddc
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x68(%rsp), %rdi
callq 0x4898
testb %bpl, %bpl
jne 0x7e17
jmp 0x7e4a
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0x4898
jmp 0x7e05
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x108(%rsp), %rdi
callq 0x4898
jmp 0x7e27
movq %rax, %rbx
movq %r14, %rdi
callq 0x4310
jmp 0x7e4a
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x28(%rsp), %rdi
callq 0x4898
testb %bpl, %bpl
jne 0x7e59
jmp 0x7eb7
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x4898
jmp 0x7e4a
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x4898
jmp 0x7eb7
movq %rax, %rbx
movq %r14, %rdi
callq 0x4310
jmp 0x7eb7
jmp 0x7eb4
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x4898
jmp 0x7e7d
movq %rax, %rbx
movb $0x1, %bpl
leaq 0xc8(%rsp), %rdi
callq 0x4898
jmp 0x7e92
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x48(%rsp), %rdi
callq 0x4898
testb %bpl, %bpl
jne 0x7ea8
jmp 0x7ec6
jmp 0x7eb4
movq %rax, %rbx
movq %r14, %rdi
callq 0x4310
jmp 0x7ec6
jmp 0x7ec3
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x4898
jmp 0x7ec6
movq %rax, %rbx
leaq 0x168(%rsp), %rdi
callq 0x4898
movq %rbx, %rdi
callq 0x4750
nop