// File: mbourand[P]webserv/srcs/Config/ConfigContext.cpp
// Function: ConfigContext::parse_methods(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void ConfigContext::parse_methods(const std::string& directive_value)
{
	std::list<std::string> words = ft::split(directive_value, " \t\n");
	_acceptedMethods.assign(g_webserv.methods.getRegistered().begin(), g_webserv.methods.getRegistered().end());
	if (words.front() == "none")
		return;
	for (std::list<std::string>::const_iterator it = words.begin(); it != words.end(); it++)
	{
		if (g_webserv.methods.getByType(*it) == NULL)
			throw std::invalid_argument("Bad method name in method field in config.");
		_acceptedMethods.remove(g_webserv.methods.getByType(*it));
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xb8(%rbp)
leaq -0x49(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0x9b10
movq -0xb0(%rbp), %rdx
leaq 0x229a0(%rip), %rsi     # 0x6bc67
leaq -0x48(%rbp), %rdi
callq 0xa780
jmp 0x492d2
movq -0xb8(%rbp), %rsi
leaq -0x28(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x2f910
jmp 0x492e8
leaq -0x48(%rbp), %rdi
callq 0x9c98
leaq -0x49(%rbp), %rdi
callq 0x9700
movq -0xc0(%rbp), %rax
addq $0xb0, %rax
movq %rax, -0xd0(%rbp)
leaq 0x4640b(%rip), %rdi     # 0x8f720
addq $0x68, %rdi
callq 0x4dbd0
movq %rax, -0xc8(%rbp)
jmp 0x49327
movq -0xc8(%rbp), %rdi
callq 0x4dbf0
movq %rax, -0x68(%rbp)
leaq 0x463e2(%rip), %rdi     # 0x8f720
addq $0x68, %rdi
callq 0x4dbd0
movq %rax, -0xd8(%rbp)
jmp 0x49350
movq -0xd8(%rbp), %rdi
callq 0x4dc50
movq -0xd0(%rbp), %rdi
movq %rax, -0x70(%rbp)
movq -0x68(%rbp), %rsi
movq -0x70(%rbp), %rdx
callq 0x4dec0
jmp 0x49376
leaq -0x28(%rbp), %rdi
callq 0xcd40
movq %rax, %rdi
leaq 0x23e04(%rip), %rsi     # 0x6d18d
callq 0xdf50
movb %al, -0xd9(%rbp)
jmp 0x49396
movb -0xd9(%rbp), %al
testb $0x1, %al
jne 0x493a2
jmp 0x493f0
movl $0x1, -0x74(%rbp)
jmp 0x4955b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x493d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x9c98
leaq -0x49(%rbp), %rdi
callq 0x9700
jmp 0x49576
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x4956d
leaq -0x28(%rbp), %rdi
callq 0xcc30
movq %rax, -0x88(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0xcc60
leaq -0x28(%rbp), %rdi
callq 0xccb0
movq %rax, -0x98(%rbp)
leaq -0x90(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0xcc60
leaq -0x80(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0xcc80
testb $0x1, %al
jne 0x4944c
jmp 0x49554
leaq -0x80(%rbp), %rdi
callq 0xcce0
movq %rax, %rsi
leaq 0x462c1(%rip), %rdi     # 0x8f720
addq $0x68, %rdi
callq 0x4df00
movq %rax, -0xe8(%rbp)
jmp 0x49471
movq -0xe8(%rbp), %rax
cmpq $0x0, %rax
jne 0x494df
movl $0x10, %edi
callq 0x9340
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xf0(%rbp)
leaq 0x23e73(%rip), %rsi     # 0x6d30f
callq 0x9be0
jmp 0x494a3
movq -0xf0(%rbp), %rdi
movq 0x45b17(%rip), %rsi     # 0x8efc8
movq 0x45b00(%rip), %rdx     # 0x8efb8
callq 0x9aa0
jmp 0x4957f
movq -0xf0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
callq 0x94c0
jmp 0x4956d
movq -0xc0(%rbp), %rax
addq $0xb0, %rax
movq %rax, -0x100(%rbp)
leaq -0x80(%rbp), %rdi
callq 0xcce0
movq %rax, %rsi
leaq 0x4621a(%rip), %rdi     # 0x8f720
addq $0x68, %rdi
callq 0x4df00
movq %rax, -0xf8(%rbp)
jmp 0x49518
movq -0x100(%rbp), %rdi
movq -0xf8(%rbp), %rax
movq %rax, -0xa0(%rbp)
leaq -0xa0(%rbp), %rsi
callq 0x4dfc0
jmp 0x4953b
jmp 0x4953d
leaq -0x80(%rbp), %rdi
xorl %esi, %esi
callq 0xced0
movq %rax, -0xa8(%rbp)
jmp 0x49410
movl $0x0, -0x74(%rbp)
leaq -0x28(%rbp), %rdi
callq 0xceb0
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0xceb0
movq -0x58(%rbp), %rdi
callq 0x9af0
nop