// File: /workspace/github_cpp_makefile_star2_O1/mbourand[P]webserv/srcs/Utils/URL.cpp
// Function: URL::parse_full(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void URL::parse_full(const std::string& url)
{
	if (url.substr(0, 7) != "http://")
		throw std::invalid_argument("Full url doesnt start with 'http://'");
	_scheme = "http";
	size_t i = 7;

	parse_userinfo(i, url);
	_host = url.substr(i, url.find_first_of(":/", i) - i);
	if (_host.size() == 0)
		throw std::invalid_argument("Empty host in uri");
	i += _host.size();
	if (url[i] == ':')
	{
		i++;
		_port = url.substr(i, url.find_first_of('/', i) - i);
		if (_port.size() == 0)
			throw std::invalid_argument("Empty port in uri");
		i += _port.size();
	}
	if (url[i] == '/')
		parse_partial(url.substr(i));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %r15
movl $0x7, %ecx
movq %r15, %rdi
xorl %edx, %edx
callq 0x74d0
leaq 0x1f7dd(%rip), %rsi     # 0x3aea4
movq %r15, %rdi
callq 0x7180
movl %eax, %ebp
movq (%r15), %rdi
leaq 0x18(%rsp), %r13
cmpq %r13, %rdi
je 0x1b6eb
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
testl %ebp, %ebp
jne 0x1b854
leaq 0x8(%rbx), %rdi
movq 0x10(%rbx), %rdx
leaq 0x1f7cf(%rip), %rcx     # 0x3aed1
movl $0x4, %r8d
xorl %esi, %esi
callq 0x76f0
movq %rsp, %r15
movq $0x7, (%r15)
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1bc0c
movq (%r15), %r12
leaq 0x1f7a5(%rip), %rsi     # 0x3aed6
movl $0x2, %ecx
movq %r14, %rdi
movq %r12, %rdx
callq 0x76c0
subq %r12, %rax
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rax, %rcx
callq 0x74d0
leaq 0x48(%rbx), %rdi
movq %r15, %rsi
callq 0x7590
movq (%r15), %rdi
cmpq %r13, %rdi
je 0x1b77b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x50(%rbx), %r15
testq %r15, %r15
je 0x1b872
addq %r12, %r15
movq %r15, (%rsp)
movq (%r14), %rax
cmpb $0x3a, (%rax,%r15)
jne 0x1b7ff
incq %r15
movq %r15, (%rsp)
movq %r14, %rdi
movl $0x2f, %esi
movq %r15, %rdx
callq 0x75c0
subq %r15, %rax
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rax, %rcx
callq 0x74d0
leaq 0x68(%rbx), %rdi
movq %r12, %rsi
callq 0x7590
movq (%r12), %rdi
cmpq %r13, %rdi
je 0x1b7eb
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x70(%rbx), %rax
testq %rax, %rax
je 0x1b890
addq %r15, %rax
movq %rax, (%rsp)
movq (%rsp), %rdx
movq (%r14), %rax
cmpb $0x2f, (%rax,%rdx)
jne 0x1b845
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq $-0x1, %rcx
callq 0x74d0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1b4ec
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x1b845
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x7260
movq %rax, %r14
leaq 0x1f644(%rip), %rsi     # 0x3aeac
movq %rax, %rdi
callq 0x78c0
jmp 0x1b8ac
movl $0x10, %edi
callq 0x7260
movq %rax, %r14
leaq 0x1f653(%rip), %rsi     # 0x3aed9
movq %rax, %rdi
callq 0x78c0
jmp 0x1b8ac
movl $0x10, %edi
callq 0x7260
movq %rax, %r14
leaq 0x1f647(%rip), %rsi     # 0x3aeeb
movq %rax, %rdi
callq 0x78c0
movq 0x32715(%rip), %rsi     # 0x4dfc8
movq 0x326f6(%rip), %rdx     # 0x4dfb0
movq %r14, %rdi
callq 0x77d0
jmp 0x1b8e2
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x1b8ed
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x1b8ed
jmp 0x1b8e2
movq %rax, %rbx
movq %r14, %rdi
callq 0x7390
movq %rbx, %rdi
callq 0x7810
nop