// File: llefranc[P]42_webserv/srcs/parser/ServerInfo.cpp
// Function: ServerInfo::setPort(char const*)
void ServerInfo::setPort(char const *p) 
{
    std::string cString = p;
    if (numberOfWords(p) != 1)
        throw std::runtime_error("Error : " + cString + " - put only one port to listen\n");
    
    cString = *wsTrim(cString);
    for (size_t i = 0; i < cString.size(); i++) 
		if (cString[i] < 48 || cString[i]  > 57)
			throw std::runtime_error("Error : " + cString + " - use only digit for listen\n");
    
    _port = atoi(p);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xf0(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x58f0
movq -0xf0(%rbp), %rsi
movq -0xe8(%rbp), %rdx
leaq -0x30(%rbp), %rdi
callq 0x63e0
jmp 0x8f52
leaq -0x31(%rbp), %rdi
callq 0x55c0
movq -0x10(%rbp), %rdi
callq 0x12310
movq %rax, -0x100(%rbp)
jmp 0x8f6d
movq -0x100(%rbp), %rax
cmpq $0x1, %rax
je 0x9084
movb $0x1, -0x89(%rbp)
movl $0x10, %edi
callq 0x5290
movq %rax, -0x108(%rbp)
leaq 0x1a0e4(%rip), %rsi     # 0x23081
leaq -0x88(%rbp), %rdi
leaq -0x30(%rbp), %rdx
callq 0x9a60
jmp 0x8faf
leaq 0x1a133(%rip), %rdx     # 0x230e9
leaq -0x68(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x66b0
jmp 0x8fc8
movq -0x108(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x5830
jmp 0x8fda
movq -0x108(%rbp), %rdi
movb $0x0, -0x89(%rbp)
movq 0x28001(%rip), %rsi     # 0x30ff0
movq 0x27fd2(%rip), %rdx     # 0x30fc8
callq 0x58a0
jmp 0x9263
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x55c0
jmp 0x925a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x9251
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x9068
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x905c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x5a08
leaq -0x88(%rbp), %rdi
callq 0x5a08
testb $0x1, -0x89(%rbp)
jne 0x9073
jmp 0x907f
movq -0x108(%rbp), %rdi
callq 0x53f0
jmp 0x9251
leaq -0x30(%rbp), %rdi
callq 0x123e0
movq %rax, -0x110(%rbp)
jmp 0x9096
movq -0x110(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x5060
jmp 0x90a8
movq $0x0, -0x98(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x118(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x53b0
movq %rax, %rcx
movq -0x118(%rbp), %rax
cmpq %rcx, %rax
jae 0x922b
movq -0x98(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x59f0
movq %rax, -0x120(%rbp)
jmp 0x90f6
movq -0x120(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jl 0x9131
movq -0x98(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x59f0
movq %rax, -0x128(%rbp)
jmp 0x911e
movq -0x128(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x39, %eax
jle 0x9212
movb $0x1, -0xd9(%rbp)
movl $0x10, %edi
callq 0x5290
movq %rax, -0x130(%rbp)
leaq 0x19f31(%rip), %rsi     # 0x23081
leaq -0xd8(%rbp), %rdi
leaq -0x30(%rbp), %rdx
callq 0x9a60
jmp 0x9162
leaq 0x19f46(%rip), %rdx     # 0x230af
leaq -0xb8(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x66b0
jmp 0x917e
movq -0x130(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x5830
jmp 0x9193
movq -0x130(%rbp), %rdi
movb $0x0, -0xd9(%rbp)
movq 0x27e48(%rip), %rsi     # 0x30ff0
movq 0x27e19(%rip), %rdx     # 0x30fc8
callq 0x58a0
jmp 0x9263
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x91f9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x91ed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x5a08
leaq -0xd8(%rbp), %rdi
callq 0x5a08
testb $0x1, -0xd9(%rbp)
jne 0x9204
jmp 0x9210
movq -0x130(%rbp), %rdi
callq 0x53f0
jmp 0x9251
jmp 0x9214
movq -0x98(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x98(%rbp)
jmp 0x90b3
movq -0x10(%rbp), %rdi
callq 0x57f0
movl %eax, %ecx
movq -0xf8(%rbp), %rax
movl %ecx, (%rax)
leaq -0x30(%rbp), %rdi
callq 0x5a08
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x5a08
movq -0x40(%rbp), %rdi
callq 0x58e0
nopw %cs:(%rax,%rax)