// File: /workspace/github_cpp_makefile_star2_O3/mbourand[P]webserv/srcs/Request.cpp
// Function: Request::parse_method()
void Request::parse_method()
{
	std::string method = _raw.substr(0, _raw.find(' '));
	if (!g_webserv.methods.hasCandidates(method) || method.empty())
	{
		_error_code = 400;
		throw std::invalid_argument("Method could not be recognized.");
	}
	if (ft::contains(_raw, ' ') && g_webserv.methods.getByType(method) != NULL)
	{
		Logger::print("Request method is " + method + ".", true, INFO, VERBOSE);
		_method = g_webserv.methods.getByType(method);
		_parse_start = _raw.find(' ');
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
movq %r14, %rdi
movl $0x20, %esi
xorl %edx, %edx
callq 0x75c0
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x74d0
leaq 0x1a543(%rip), %r15     # 0x4e568
addq $0x68, %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x36192
cmpq $0x0, 0x10(%rsp)
setne %cl
testb %cl, %al
je 0x34185
leaq 0x48(%rsp), %rdx
movb $0x20, (%rdx)
movq 0x8(%rbx), %rdi
movq 0x10(%rbx), %rsi
addq %rdi, %rsi
callq 0xf389
movq 0x8(%rbx), %rcx
addq 0x10(%rbx), %rcx
cmpq %rcx, %rax
je 0x3415e
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x2bfde
testq %rax, %rax
je 0x3415e
leaq 0x96d4(%rip), %rsi      # 0x3d75f
leaq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0xe2cb
leaq 0x958f(%rip), %rsi      # 0x3d630
leaq 0x48(%rsp), %rdi
callq 0x78d0
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x340d3
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x340db
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl $0x1, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x32966
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x3411c
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x34137
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x2bfde
movq %rax, 0x28(%rbx)
movq %r14, %rdi
movl $0x20, %esi
xorl %edx, %edx
callq 0x75c0
movq %rax, 0x198(%rbx)
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x34179
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl $0x190, 0x188(%rbx)     # imm = 0x190
movl $0x10, %edi
callq 0x7260
movq %rax, %r14
leaq 0x959c(%rip), %rsi      # 0x3d73f
movq %rax, %rdi
callq 0x78c0
movq 0x19e16(%rip), %rsi     # 0x4dfc8
movq 0x19df7(%rip), %rdx     # 0x4dfb0
movq %r14, %rdi
callq 0x77d0
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x341e0
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x341e0
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x34211
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x34211
jmp 0x3420e
movq %rax, %rbx
movq %r14, %rdi
callq 0x7390
jmp 0x34211
jmp 0x3420e
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3422c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
movq %rbx, %rdi
callq 0x7810