// File: mbourand[P]webserv/srcs/Utils/URL.cpp
// Function: URL::parse_partial(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void URL::parse_partial(const std::string& url)
{
	size_t i = 0;

	_path = url.substr(i, std::min(url.find_first_of("?#", i), url.size()) - i);
	i += _path.size();
	if (url[i] == '?')
	{
		i++;
		_query = url.substr(i, std::min(url.find_first_of('#', i), url.size()) - i);
		if (_query.size() == 0)
			throw std::invalid_argument("Empty query in url");
		i += _query.size();
	}
	if (url[i] == '#')
	{
		i++;
		_fragment = url.substr(i, url.size() - i);
		if (_fragment.size() == 0)
			throw std::invalid_argument("Empty fragment in url");
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x3c777(%rip), %rsi     # 0x6aed2
callq 0x9360
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
callq 0x9480
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x22650
movq -0xc0(%rbp), %rsi
movq -0xb8(%rbp), %rdx
movq (%rax), %rcx
subq -0x18(%rbp), %rcx
leaq -0x38(%rbp), %rdi
callq 0x96b0
movq -0xb0(%rbp), %rdi
addq $0x88, %rdi
leaq -0x38(%rbp), %rsi
callq 0x97e0
leaq -0x38(%rbp), %rdi
callq 0x9c98
movq -0xb0(%rbp), %rdi
addq $0x88, %rdi
callq 0x9480
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x9720
movsbl (%rax), %eax
cmpl $0x3f, %eax
jne 0x2e913
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0x23, %esi
callq 0x9450
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rdi
callq 0x9480
movq %rax, -0x78(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x22650
movq -0xd0(%rbp), %rsi
movq -0xc8(%rbp), %rdx
movq (%rax), %rcx
subq -0x18(%rbp), %rcx
leaq -0x68(%rbp), %rdi
callq 0x96b0
movq -0xb0(%rbp), %rdi
addq $0xa8, %rdi
leaq -0x68(%rbp), %rsi
callq 0x97e0
leaq -0x68(%rbp), %rdi
callq 0x9c98
movq -0xb0(%rbp), %rdi
addq $0xa8, %rdi
callq 0x9480
cmpq $0x0, %rax
jne 0x2e8f8
movl $0x10, %edi
callq 0x9340
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xd8(%rbp)
leaq 0x3c61e(%rip), %rsi     # 0x6aed5
callq 0x9be0
jmp 0x2e8be
movq -0xd8(%rbp), %rdi
movq 0x606fc(%rip), %rsi     # 0x8efc8
movq 0x606e5(%rip), %rdx     # 0x8efb8
callq 0x9aa0
movq -0xd8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
callq 0x94c0
jmp 0x2ea1e
movq -0xb0(%rbp), %rdi
addq $0xa8, %rdi
callq 0x9480
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x9720
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0x2ea15
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x9480
movq -0xe8(%rbp), %rsi
movq -0xe0(%rbp), %rdx
movq %rax, %rcx
subq -0x18(%rbp), %rcx
leaq -0xa8(%rbp), %rdi
callq 0x96b0
movq -0xb0(%rbp), %rdi
addq $0xc8, %rdi
leaq -0xa8(%rbp), %rsi
callq 0x97e0
leaq -0xa8(%rbp), %rdi
callq 0x9c98
movq -0xb0(%rbp), %rdi
addq $0xc8, %rdi
callq 0x9480
cmpq $0x0, %rax
jne 0x2ea13
movl $0x10, %edi
callq 0x9340
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xf0(%rbp)
leaq 0x3c513(%rip), %rsi     # 0x6aee8
callq 0x9be0
jmp 0x2e9dc
movq -0xf0(%rbp), %rdi
movq 0x605de(%rip), %rsi     # 0x8efc8
movq 0x605c7(%rip), %rdx     # 0x8efb8
callq 0x9aa0
movq -0xf0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
callq 0x94c0
jmp 0x2ea1e
jmp 0x2ea15
addq $0xf0, %rsp
popq %rbp
retq
movq -0x80(%rbp), %rdi
callq 0x9af0
nopw (%rax,%rax)