// File: mbourand[P]webserv/srcs/Config/ConfigContext.cpp
// Function: ConfigContext::set_root_default(ConfigContext const*)
void ConfigContext::set_root_default(const ConfigContext* parent)
{
	if (_params.find("root") == _params.end())
	{
		if (parent)
			throw std::invalid_argument("No root in location");
	}
	else
	{
		_params["root"].front() = ft::simplify_path(_params["root"].front());
		if (!ft::is_directory(_params["root"].front().c_str()))
			throw std::invalid_argument("Root parameter is not a folder in config");
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x128(%rbp)
addq $0x20, %rax
movq %rax, -0x120(%rbp)
leaq -0x39(%rbp), %rdi
movq %rdi, -0x118(%rbp)
callq 0x9b10
movq -0x118(%rbp), %rdx
leaq 0x20131(%rip), %rsi     # 0x6a838
leaq -0x38(%rbp), %rdi
callq 0xa780
jmp 0x4a712
movq -0x120(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x4d850
movq %rax, -0x130(%rbp)
jmp 0x4a72b
movq -0x128(%rbp), %rdi
movq -0x130(%rbp), %rax
movq %rax, -0x18(%rbp)
addq $0x20, %rdi
callq 0x4d880
movq %rax, -0x58(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x4da50
movb %al, -0x131(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x9c98
leaq -0x39(%rbp), %rdi
callq 0x9700
movb -0x131(%rbp), %al
testb $0x1, %al
jne 0x4a77e
jmp 0x4a81b
cmpq $0x0, -0x10(%rbp)
je 0x4a816
movl $0x10, %edi
callq 0x9340
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x140(%rbp)
leaq 0x22af5(%rip), %rsi     # 0x6d29c
callq 0x9be0
jmp 0x4a7ae
movq -0x140(%rbp), %rdi
movq 0x4480c(%rip), %rsi     # 0x8efc8
movq 0x447f5(%rip), %rdx     # 0x8efb8
callq 0x9aa0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4a7eb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x9c98
leaq -0x39(%rbp), %rdi
callq 0x9700
jmp 0x4ab96
movq -0x140(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
callq 0x94c0
jmp 0x4ab96
jmp 0x4ab8d
movq -0x128(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x150(%rbp)
leaq -0x99(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x9b10
movq -0x148(%rbp), %rdx
leaq 0x1ffea(%rip), %rsi     # 0x6a838
leaq -0x98(%rbp), %rdi
callq 0xa780
jmp 0x4a85c
movq -0x150(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x4da80
movq %rax, -0x158(%rbp)
jmp 0x4a878
movq -0x158(%rbp), %rdi
callq 0xcd40
movq %rax, %rsi
leaq -0x78(%rbp), %rdi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x32290
jmp 0x4a896
movq -0x128(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x168(%rbp)
leaq -0xc1(%rbp), %rdi
movq %rdi, -0x160(%rbp)
callq 0x9b10
movq -0x160(%rbp), %rdx
leaq 0x1ff6f(%rip), %rsi     # 0x6a838
leaq -0xc0(%rbp), %rdi
callq 0xa780
jmp 0x4a8d7
movq -0x168(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x4da80
movq %rax, -0x170(%rbp)
jmp 0x4a8f3
movq -0x170(%rbp), %rdi
callq 0xcd40
movq %rax, %rdi
leaq -0x78(%rbp), %rsi
movq %rsi, -0x188(%rbp)
callq 0x97e0
leaq -0xc0(%rbp), %rdi
callq 0x9c98
leaq -0xc1(%rbp), %rdi
callq 0x9700
movq -0x188(%rbp), %rdi
callq 0x9c98
leaq -0x98(%rbp), %rdi
callq 0x9c98
leaq -0x99(%rbp), %rdi
callq 0x9700
movq -0x128(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x180(%rbp)
leaq -0x109(%rbp), %rdi
movq %rdi, -0x178(%rbp)
callq 0x9b10
movq -0x178(%rbp), %rdx
leaq 0x1feb7(%rip), %rsi     # 0x6a838
leaq -0x108(%rbp), %rdi
callq 0xa780
jmp 0x4a98f
movq -0x180(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x4da80
movq %rax, -0x190(%rbp)
jmp 0x4a9ab
movq -0x190(%rbp), %rdi
callq 0xcd40
movq %rax, %rdi
callq 0x92b0
movq %rax, -0x1a0(%rbp)
leaq -0x10a(%rbp), %rdi
movq %rdi, -0x198(%rbp)
callq 0x9b10
movq -0x1a0(%rbp), %rsi
movq -0x198(%rbp), %rdx
leaq -0xe8(%rbp), %rdi
callq 0xa780
jmp 0x4a9f5
leaq -0xe8(%rbp), %rdi
callq 0x31db0
movb %al, -0x1a1(%rbp)
jmp 0x4aa09
movb -0x1a1(%rbp), %al
xorb $-0x1, %al
movb %al, -0x1a2(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x9c98
leaq -0x10a(%rbp), %rdi
callq 0x9700
leaq -0x108(%rbp), %rdi
callq 0x9c98
leaq -0x109(%rbp), %rdi
callq 0x9700
movb -0x1a2(%rbp), %al
testb $0x1, %al
jne 0x4aa56
jmp 0x4ab8b
movl $0x10, %edi
callq 0x9340
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x1b0(%rbp)
leaq 0x2283c(%rip), %rsi     # 0x6d2b0
callq 0x9be0
jmp 0x4aa7b
movq -0x1b0(%rbp), %rdi
movq 0x4453f(%rip), %rsi     # 0x8efc8
movq 0x44528(%rip), %rdx     # 0x8efb8
callq 0x9aa0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4aaf8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4aaec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4aad7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x9c98
leaq -0xc1(%rbp), %rdi
callq 0x9700
leaq -0x78(%rbp), %rdi
callq 0x9c98
leaq -0x98(%rbp), %rdi
callq 0x9c98
leaq -0x99(%rbp), %rdi
callq 0x9700
jmp 0x4ab96
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4ab63
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4ab57
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4ab4b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x9c98
leaq -0x10a(%rbp), %rdi
callq 0x9700
leaq -0x108(%rbp), %rdi
callq 0x9c98
leaq -0x109(%rbp), %rdi
callq 0x9700
jmp 0x4ab96
movq -0x1b0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
callq 0x94c0
jmp 0x4ab96
jmp 0x4ab8d
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x9af0
nop