// File: llefranc[P]42_webserv/srcs/parser/FileParser.cpp
// Function: FileParser::newServer()
void FileParser::newServer(void)
{
	ServerInfo n_srv;
	while (_bracket > 0)
	{
		std::getline(_file, _buf);
		cleanLineFromSpaces(_buf);
		bracketRegulator(_bracket, _buf);

		if (!_buf.compare(0, 9, "location "))	
			newLocation(n_srv);
		else if (!_buf.compare(0, 7, "listen "))
			n_srv.setServer(LIS, 7, _buf);
		else if (!_buf.compare(0, 6, "error "))
			n_srv.setServer(ERR, 6, _buf);
		else if (!_buf.compare(0, 12, "server_name "))
			n_srv.setServer(SRV_N, 12, _buf);
		else if (!_buf.compare(0, 9, "max_body "))
			n_srv.setServer(BODY, 9, _buf);
		else if (!_buf.compare(0, 5, "host "))
			n_srv.setServer(HOST, 5, _buf);
		else if (!_buf.compare(0, 1, "}")) continue;
		else std::runtime_error(errParseMessage("error line : ", _buf.c_str(), ". Not accepting this input\n"));
	}
	addNewServerToMap(n_srv);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xd8(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x8b00
movq -0xd8(%rbp), %rax
cmpl $0x0, 0x228(%rax)
jle 0xbbf6
movq -0xd8(%rbp), %rdi
movq %rdi, %rsi
addq $0x208, %rsi            # imm = 0x208
callq 0x50f0
jmp 0xb892
movq -0xd8(%rbp), %rdi
addq $0x208, %rdi            # imm = 0x208
callq 0x12130
jmp 0xb8a7
movq -0xd8(%rbp), %rsi
movq %rsi, %rdi
addq $0x228, %rdi            # imm = 0x228
addq $0x208, %rsi            # imm = 0x208
callq 0x121d0
jmp 0xb8c6
movq -0xd8(%rbp), %rdi
addq $0x208, %rdi            # imm = 0x208
leaq 0x17916(%rip), %rcx     # 0x231f1
xorl %eax, %eax
movl %eax, %esi
movl $0x9, %edx
callq 0x5710
movl %eax, -0xdc(%rbp)
jmp 0xb8f1
movl -0xdc(%rbp), %eax
cmpl $0x0, %eax
jne 0xb939
movq -0xd8(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0xbc30
jmp 0xb911
jmp 0xbbf1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x8cc0
jmp 0xbc20
movq -0xd8(%rbp), %rdi
addq $0x208, %rdi            # imm = 0x208
leaq 0x17853(%rip), %rcx     # 0x231a1
xorl %eax, %eax
movl %eax, %esi
movl $0x7, %edx
callq 0x5710
movl %eax, -0xe0(%rbp)
jmp 0xb964
movl -0xe0(%rbp), %eax
cmpl $0x0, %eax
jne 0xb9a3
movq -0xd8(%rbp), %rcx
movl $0x7, -0xb0(%rbp)
addq $0x208, %rcx            # imm = 0x208
leaq -0xa0(%rbp), %rdi
xorl %esi, %esi
leaq -0xb0(%rbp), %rdx
callq 0x8dc0
jmp 0xb99e
jmp 0xbbef
movq -0xd8(%rbp), %rdi
addq $0x208, %rdi            # imm = 0x208
leaq 0x177f1(%rip), %rcx     # 0x231a9
xorl %eax, %eax
movl %eax, %esi
movl $0x6, %edx
callq 0x5710
movl %eax, -0xe4(%rbp)
jmp 0xb9ce
movl -0xe4(%rbp), %eax
cmpl $0x0, %eax
jne 0xba10
movq -0xd8(%rbp), %rcx
movl $0x6, -0xb4(%rbp)
addq $0x208, %rcx            # imm = 0x208
leaq -0xa0(%rbp), %rdi
movl $0x1, %esi
leaq -0xb4(%rbp), %rdx
callq 0x8dc0
jmp 0xba0b
jmp 0xbbed
movq -0xd8(%rbp), %rdi
addq $0x208, %rdi            # imm = 0x208
leaq 0x1778b(%rip), %rcx     # 0x231b0
xorl %eax, %eax
movl %eax, %esi
movl $0xc, %edx
callq 0x5710
movl %eax, -0xe8(%rbp)
jmp 0xba3b
movl -0xe8(%rbp), %eax
cmpl $0x0, %eax
jne 0xba7d
movq -0xd8(%rbp), %rcx
movl $0xc, -0xb8(%rbp)
addq $0x208, %rcx            # imm = 0x208
leaq -0xa0(%rbp), %rdi
movl $0x2, %esi
leaq -0xb8(%rbp), %rdx
callq 0x8dc0
jmp 0xba78
jmp 0xbbeb
movq -0xd8(%rbp), %rdi
addq $0x208, %rdi            # imm = 0x208
leaq 0x1772b(%rip), %rcx     # 0x231bd
xorl %eax, %eax
movl %eax, %esi
movl $0x9, %edx
callq 0x5710
movl %eax, -0xec(%rbp)
jmp 0xbaa8
movl -0xec(%rbp), %eax
cmpl $0x0, %eax
jne 0xbaea
movq -0xd8(%rbp), %rcx
movl $0x9, -0xbc(%rbp)
addq $0x208, %rcx            # imm = 0x208
leaq -0xa0(%rbp), %rdi
movl $0x3, %esi
leaq -0xbc(%rbp), %rdx
callq 0x8dc0
jmp 0xbae5
jmp 0xbbe9
movq -0xd8(%rbp), %rdi
addq $0x208, %rdi            # imm = 0x208
leaq 0x176c8(%rip), %rcx     # 0x231c7
xorl %eax, %eax
movl %eax, %esi
movl $0x5, %edx
callq 0x5710
movl %eax, -0xf0(%rbp)
jmp 0xbb15
movl -0xf0(%rbp), %eax
cmpl $0x0, %eax
jne 0xbb57
movq -0xd8(%rbp), %rcx
movl $0x5, -0xc0(%rbp)
addq $0x208, %rcx            # imm = 0x208
leaq -0xa0(%rbp), %rdi
movl $0x4, %esi
leaq -0xc0(%rbp), %rdx
callq 0x8dc0
jmp 0xbb52
jmp 0xbbe7
movq -0xd8(%rbp), %rdi
addq $0x208, %rdi            # imm = 0x208
leaq 0x175a6(%rip), %rcx     # 0x23112
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x5710
movl %eax, -0xf4(%rbp)
jmp 0xbb82
movl -0xf4(%rbp), %eax
cmpl $0x0, %eax
jne 0xbb92
jmp 0xb866
movq -0xd8(%rbp), %rdi
addq $0x208, %rdi            # imm = 0x208
callq 0x5240
movq %rax, %rsi
leaq 0x17565(%rip), %rdi     # 0x23114
leaq 0x17617(%rip), %rdx     # 0x231cd
callq 0x12260
movq %rax, -0x100(%rbp)
jmp 0xbbc4
movq -0x100(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
callq 0x5830
jmp 0xbbd9
leaq -0xd0(%rbp), %rdi
callq 0x5a10
jmp 0xbbe7
jmp 0xbbe9
jmp 0xbbeb
jmp 0xbbed
jmp 0xbbef
jmp 0xbbf1
jmp 0xb866
movq -0xd8(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0xc5d0
jmp 0xbc0b
leaq -0xa0(%rbp), %rdi
callq 0x8cc0
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq -0xa8(%rbp), %rdi
callq 0x58e0
nopl (%rax)