// File: mbourand[P]webserv/srcs/Socket/ServerSocket.cpp
// Function: ServerSocket::ServerSocket(int)
ServerSocket::ServerSocket(int port) : m_port(port)
{
	if (!Socket::Create(true))
		throw ServerSocketException("Counldn't create socket.");
	if (!Socket::Bind(this->m_port))
		throw ServerSocketException("Counldn't bind to port.");
	if (!Socket::Listen())
		throw ServerSocketException("Counldn't listen to socket.");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0x1c2e0
movq -0xa0(%rbp), %rdi
leaq 0x73410(%rip), %rax     # 0x8eb00
movq %rax, (%rdi)
movl -0xc(%rbp), %eax
movl %eax, 0x3c(%rdi)
addq $0x40, %rdi
movq %rdi, -0xa8(%rbp)
callq 0x98c0
movq -0xa0(%rbp), %rdi
movl $0x1, %esi
callq 0x1c4d0
movb %al, -0x93(%rbp)
jmp 0x1b722
movb -0x93(%rbp), %al
testb $0x1, %al
jne 0x1b7fb
jmp 0x1b732
movb $0x1, -0x42(%rbp)
movl $0x28, %edi
callq 0x9340
movq %rax, -0xb8(%rbp)
leaq -0x41(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0x9b10
movq -0xb0(%rbp), %rdx
leaq 0x4f1b5(%rip), %rsi     # 0x6a91a
leaq -0x40(%rbp), %rdi
callq 0xa780
jmp 0x1b770
movq -0xb8(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1c1e0
jmp 0x1b782
movq -0xb8(%rbp), %rdi
movb $0x0, -0x42(%rbp)
leaq 0x73394(%rip), %rsi     # 0x8eb28
leaq 0xab5(%rip), %rdx       # 0x1c250
callq 0x9aa0
jmp 0x1b9f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x1b9d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x1b7d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x9c98
leaq -0x41(%rbp), %rdi
callq 0x9700
testb $0x1, -0x42(%rbp)
jne 0x1b7ea
jmp 0x1b7f6
movq -0xb8(%rbp), %rdi
callq 0x94c0
jmp 0x1b9d1
movq -0xa0(%rbp), %rdi
movl 0x3c(%rdi), %esi
callq 0x1c580
movb %al, -0xb9(%rbp)
jmp 0x1b812
movb -0xb9(%rbp), %al
testb $0x1, %al
jne 0x1b8da
jmp 0x1b822
movb $0x1, -0x6a(%rbp)
movl $0x28, %edi
callq 0x9340
movq %rax, -0xd0(%rbp)
leaq -0x69(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x9b10
movq -0xc8(%rbp), %rdx
leaq 0x4f0de(%rip), %rsi     # 0x6a933
leaq -0x68(%rbp), %rdi
callq 0xa780
jmp 0x1b860
movq -0xd0(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x1c1e0
jmp 0x1b872
movq -0xd0(%rbp), %rdi
movb $0x0, -0x6a(%rbp)
leaq 0x732a4(%rip), %rsi     # 0x8eb28
leaq 0x9c5(%rip), %rdx       # 0x1c250
callq 0x9aa0
jmp 0x1b9f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x1b8b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x9c98
leaq -0x69(%rbp), %rdi
callq 0x9700
testb $0x1, -0x6a(%rbp)
jne 0x1b8c9
jmp 0x1b8d5
movq -0xd0(%rbp), %rdi
callq 0x94c0
jmp 0x1b9d1
movq -0xa0(%rbp), %rdi
callq 0x1caf0
movb %al, -0xd1(%rbp)
jmp 0x1b8ee
movb -0xd1(%rbp), %al
testb $0x1, %al
jne 0x1b9c8
jmp 0x1b8fe
movb $0x1, -0x92(%rbp)
movl $0x28, %edi
callq 0x9340
movq %rax, -0xe8(%rbp)
leaq -0x91(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
callq 0x9b10
movq -0xe0(%rbp), %rdx
leaq 0x4f014(%rip), %rsi     # 0x6a94b
leaq -0x90(%rbp), %rdi
callq 0xa780
jmp 0x1b945
movq -0xe8(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x1c1e0
jmp 0x1b95a
movq -0xe8(%rbp), %rdi
movb $0x0, -0x92(%rbp)
leaq 0x731b9(%rip), %rsi     # 0x8eb28
leaq 0x8da(%rip), %rdx       # 0x1c250
callq 0x9aa0
jmp 0x1b9f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x1b9a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x9c98
leaq -0x91(%rbp), %rdi
callq 0x9700
testb $0x1, -0x92(%rbp)
jne 0x1b9ba
jmp 0x1b9c6
movq -0xe8(%rbp), %rdi
callq 0x94c0
jmp 0x1b9d1
addq $0xf0, %rsp
popq %rbp
retq
movq -0xa8(%rbp), %rdi
callq 0x9c98
movq -0xa0(%rbp), %rdi
callq 0x1c3b0
movq -0x18(%rbp), %rdi
callq 0x9af0
nopw %cs:(%rax,%rax)