// File: /workspace/github_cpp_makefile_star2_O3/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
movq %rsp, %r15
movl $0x7, %ecx
movq %r15, %rdi
xorl %edx, %edx
callq 0x74d0
leaq 0x1fabf(%rip), %rsi     # 0x3aea4
movq %r15, %rdi
callq 0x7180
movl %eax, %ebp
movq (%r15), %rdi
leaq 0x10(%rsp), %r13
cmpq %r13, %rdi
je 0x1b409
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x74b0
testl %ebp, %ebp
jne 0x1b563
leaq 0x8(%rbx), %rdi
movq 0x10(%rbx), %rdx
leaq 0x1fab1(%rip), %rcx     # 0x3aed1
movl $0x4, %r8d
xorl %esi, %esi
callq 0x76f0
leaq 0x20(%rsp), %r15
movq $0x7, (%r15)
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1b91a
movq (%r15), %r12
leaq 0x1fa85(%rip), %rsi     # 0x3aed6
movl $0x2, %ecx
movq %r14, %rdi
movq %r12, %rdx
callq 0x76c0
subq %r12, %rax
movq %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 0x1b499
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x50(%rbx), %r15
testq %r15, %r15
je 0x1b581
addq %r12, %r15
movq (%r14), %rax
movb (%rax,%r15), %al
cmpb $0x3a, %al
jne 0x1b517
incq %r15
movq %r14, %rdi
movl $0x2f, %esi
movq %r15, %rdx
callq 0x75c0
subq %r15, %rax
movq %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 0x1b500
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x70(%rbx), %rax
testq %rax, %rax
je 0x1b59f
addq %rax, %r15
movq (%r14), %rax
movb (%rax,%r15), %al
cmpb $0x2f, %al
jne 0x1b554
movq %rsp, %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq $-0x1, %rcx
callq 0x74d0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1b20a
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x1b554
movq 0x10(%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 0x1f935(%rip), %rsi     # 0x3aeac
movq %rax, %rdi
callq 0x78c0
jmp 0x1b5bb
movl $0x10, %edi
callq 0x7260
movq %rax, %r14
leaq 0x1f944(%rip), %rsi     # 0x3aed9
movq %rax, %rdi
callq 0x78c0
jmp 0x1b5bb
movl $0x10, %edi
callq 0x7260
movq %rax, %r14
leaq 0x1f938(%rip), %rsi     # 0x3aeeb
movq %rax, %rdi
callq 0x78c0
movq 0x32a06(%rip), %rsi     # 0x4dfc8
movq 0x329e7(%rip), %rdx     # 0x4dfb0
movq %r14, %rdi
callq 0x77d0
jmp 0x1b5f0
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x1b5fb
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x1b5fb
jmp 0x1b5f0
movq %rax, %rbx
movq %r14, %rdi
callq 0x7390
movq %rbx, %rdi
callq 0x7810
nop