// File: /workspace/github_cpp_makefile_star2_O1/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 0x1a0fb(%rip), %r15     # 0x4e568
addq $0x68, %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x365ae
cmpq $0x0, 0x10(%rsp)
setne %cl
testb %cl, %al
je 0x345cd
leaq 0x48(%rsp), %rdx
movb $0x20, (%rdx)
movq 0x8(%rbx), %rdi
movq 0x10(%rbx), %rsi
addq %rdi, %rsi
callq 0xf3d7
movq 0x8(%rbx), %rcx
addq 0x10(%rbx), %rcx
cmpq %rcx, %rax
je 0x345a6
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x2c31e
testq %rax, %rax
je 0x345a6
leaq 0x928c(%rip), %rsi      # 0x3d75f
leaq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0xe31d
leaq 0x9147(%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 0x3451b
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x34523
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 0x32d48
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x34564
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3457f
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x2c31e
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 0x345c1
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 0x9154(%rip), %rsi      # 0x3d73f
movq %rax, %rdi
callq 0x78c0
movq 0x199ce(%rip), %rsi     # 0x4dfc8
movq 0x199af(%rip), %rdx     # 0x4dfb0
movq %r14, %rdi
callq 0x77d0
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x34628
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x34628
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x34659
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x34659
jmp 0x34656
movq %rax, %rbx
movq %r14, %rdi
callq 0x7390
jmp 0x34659
jmp 0x34656
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x34674
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
movq %rbx, %rdi
callq 0x7810