// File: solaldunckel[P]webserv/srcs/Config/ServerConfig.cpp
// Function: ServerConfig::location_loop(__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>&, std::vector<ServerConfig, std::allocator<ServerConfig>>&)
void ServerConfig::location_loop(std::vector<std::string>::iterator &it, std::vector<ServerConfig> &locations) {
  if (is_loc_modifier(*it)) {
    if (*it == "=")
      modifier_ = EXACT;
    else if (*it == "~")
      modifier_ = CASE_SENSITIVE_REG;
    else if (*it == "~*")
      modifier_ = CASE_INSENSITIVE_REG;
    else if (*it == "^~")
      modifier_ = LONGEST;
    else
      throw std::runtime_error("unknown modifier in location");
    it++;
  }
  else
    modifier_ = NONE;
  uri_ = *it++;
  if (*it != "{")
    throw std::runtime_error("missing opening bracket in server block");
  while (*(++it) != "}") {
    if (ServerConfig::directive_[*it])
      (this->*(ServerConfig::directive_[*it]))(++it);
    else
      throw std::runtime_error("invalid directive '" + *it + "' in 'location'");
  }
  locations.push_back(*this);;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rdi
callq 0x92b0
movq %rax, %rdi
callq 0x182d0
testb $0x1, %al
jne 0x1838c
jmp 0x184c0
movq -0x10(%rbp), %rdi
callq 0x92b0
movq %rax, %rdi
leaq 0x2b52c(%rip), %rsi     # 0x438cb
callq 0x8ff0
testb $0x1, %al
jne 0x183aa
jmp 0x183bd
movq -0x88(%rbp), %rax
movl $0x1, 0x70(%rax)
jmp 0x184af
movq -0x10(%rbp), %rdi
callq 0x92b0
movq %rax, %rdi
leaq 0x2b189(%rip), %rsi     # 0x43559
callq 0x8ff0
testb $0x1, %al
jne 0x183db
jmp 0x183ee
movq -0x88(%rbp), %rax
movl $0x2, 0x70(%rax)
jmp 0x184ad
movq -0x10(%rbp), %rdi
callq 0x92b0
movq %rax, %rdi
leaq 0x2b154(%rip), %rsi     # 0x43555
callq 0x8ff0
testb $0x1, %al
jne 0x1840c
jmp 0x1841f
movq -0x88(%rbp), %rax
movl $0x3, 0x70(%rax)
jmp 0x184ab
movq -0x10(%rbp), %rdi
callq 0x92b0
movq %rax, %rdi
leaq 0x2b126(%rip), %rsi     # 0x43558
callq 0x8ff0
testb $0x1, %al
jne 0x1843d
jmp 0x1844d
movq -0x88(%rbp), %rax
movl $0x4, 0x70(%rax)
jmp 0x184a9
movl $0x10, %edi
callq 0x5250
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x90(%rbp)
leaq 0x2b0f0(%rip), %rsi     # 0x4355b
callq 0x51d0
jmp 0x18472
movq -0x90(%rbp), %rdi
movq 0x43b70(%rip), %rsi     # 0x5bff0
movq 0x43b11(%rip), %rdx     # 0x5bf98
callq 0x5920
movq -0x90(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x53b0
jmp 0x18756
jmp 0x184ab
jmp 0x184ad
jmp 0x184af
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x13ae0
movq %rax, -0x30(%rbp)
jmp 0x184ce
movq -0x88(%rbp), %rax
movl $0x0, 0x70(%rax)
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x13ae0
movq %rax, -0x38(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x92b0
movq -0x88(%rbp), %rdi
movq %rax, %rsi
addq $0x50, %rdi
callq 0x5050
movq -0x10(%rbp), %rdi
callq 0x92b0
movq %rax, %rdi
leaq 0x2ab87(%rip), %rsi     # 0x43093
callq 0x9360
testb $0x1, %al
jne 0x18517
jmp 0x18573
movl $0x10, %edi
callq 0x5250
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x98(%rbp)
leaq 0x2aea5(%rip), %rsi     # 0x433da
callq 0x51d0
jmp 0x1853c
movq -0x98(%rbp), %rdi
movq 0x43aa6(%rip), %rsi     # 0x5bff0
movq 0x43a47(%rip), %rdx     # 0x5bf98
callq 0x5920
movq -0x98(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x53b0
jmp 0x18756
jmp 0x18575
movq -0x10(%rbp), %rdi
callq 0x92d0
movq %rax, %rdi
callq 0x92b0
movq %rax, %rdi
leaq 0x2ab05(%rip), %rsi     # 0x43095
callq 0x9360
testb $0x1, %al
jne 0x1859e
jmp 0x1873d
movq -0x10(%rbp), %rdi
callq 0x92b0
movq %rax, %rsi
leaq 0x44057(%rip), %rdi     # 0x5c608
callq 0x18c10
movq %rax, %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
cmpq $0x0, %rax
je 0x1866d
movq -0x10(%rbp), %rdi
callq 0x92b0
movq %rax, %rsi
leaq 0x4402b(%rip), %rdi     # 0x5c608
callq 0x18c10
movq -0x88(%rbp), %rcx
movq %rax, %rdx
movq (%rdx), %rax
movq %rax, -0xa8(%rbp)
movq 0x8(%rdx), %rdx
addq %rdx, %rcx
movq %rcx, -0xa0(%rbp)
andq $0x1, %rax
cmpq $0x0, %rax
je 0x18630
movq -0xa8(%rbp), %rcx
movq -0xa0(%rbp), %rax
movq (%rax), %rax
subq $0x1, %rcx
movq (%rax,%rcx), %rax
movq %rax, -0xb0(%rbp)
jmp 0x1863e
movq -0xa8(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x92d0
movq -0xa0(%rbp), %rdi
movq %rax, %rsi
movq -0xb8(%rbp), %rax
callq *%rax
jmp 0x18738
movb $0x1, -0x79(%rbp)
movl $0x10, %edi
callq 0x5250
movq %rax, -0xc0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x92b0
movq %rax, %rdx
leaq 0x2ad6d(%rip), %rsi     # 0x43402
leaq -0x78(%rbp), %rdi
callq 0x6ad0
jmp 0x186a0
leaq 0x2aed1(%rip), %rdx     # 0x43578
leaq -0x58(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x6a80
jmp 0x186b6
movq -0xc0(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x58c0
jmp 0x186c8
movq -0xc0(%rbp), %rdi
movb $0x0, -0x79(%rbp)
movq 0x43916(%rip), %rsi     # 0x5bff0
movq 0x438b7(%rip), %rdx     # 0x5bf98
callq 0x5920
jmp 0x1875f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x18722
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x18719
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x5aa8
leaq -0x78(%rbp), %rdi
callq 0x5aa8
testb $0x1, -0x79(%rbp)
jne 0x1872a
jmp 0x18736
movq -0xc0(%rbp), %rdi
callq 0x53b0
jmp 0x18756
jmp 0x18575
movq -0x88(%rbp), %rsi
movq -0x18(%rbp), %rdi
callq 0x92f0
addq $0xc0, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x5950
nop