// File: BelfordZ[P]SimpleFileServer/Socket.cpp
// Function: Socket::Socket(int)
Socket::Socket(const int port) : m_sock ( -1 )
{
   if (!create())
   {
      throw SocketException("Error creating server socket!");
   }
   if (!bind(port))
   {
      throw SocketException("Error binding to port!");
   }
   if (!listen())
   {
      throw SocketException("Error listening to socket!");
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
leaq 0x64b4(%rip), %rax      # 0xfd78
addq $0x10, %rax
movq %rax, (%rdi)
movl $0xffffffff, 0x8(%rdi)  # imm = 0xFFFFFFFF
callq 0x9b60
testb $0x1, %al
jne 0x9997
movb $0x1, -0x45(%rbp)
movl $0x20, %edi
callq 0x3170
movq %rax, -0xb0(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
callq 0x34a0
movq -0xa8(%rbp), %rdx
leaq 0x19dc(%rip), %rsi      # 0xb2ee
leaq -0x30(%rbp), %rdi
callq 0x3ad0
jmp 0x991d
movq -0xb0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0xa0b0
jmp 0x992f
movq -0xb0(%rbp), %rdi
movb $0x0, -0x45(%rbp)
leaq 0x6427(%rip), %rsi      # 0xfd68
leaq -0x4928(%rip), %rdx     # 0x5020
callq 0x3470
jmp 0x9b56
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x9975
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3548
leaq -0x31(%rbp), %rdi
callq 0x3330
testb $0x1, -0x45(%rbp)
jne 0x9986
jmp 0x9992
movq -0xb0(%rbp), %rdi
callq 0x3210
jmp 0x9b4d
movq -0xa0(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x9c20
testb $0x1, %al
jne 0x9a66
movb $0x1, -0x6a(%rbp)
movl $0x20, %edi
callq 0x3170
movq %rax, -0xc0(%rbp)
leaq -0x69(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x34a0
movq -0xb8(%rbp), %rdx
leaq 0x192b(%rip), %rsi      # 0xb30c
leaq -0x68(%rbp), %rdi
callq 0x3ad0
jmp 0x99ec
movq -0xc0(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0xa0b0
jmp 0x99fe
movq -0xc0(%rbp), %rdi
movb $0x0, -0x6a(%rbp)
leaq 0x6358(%rip), %rsi      # 0xfd68
leaq -0x49f7(%rip), %rdx     # 0x5020
callq 0x3470
jmp 0x9b56
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x9a44
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x3548
leaq -0x69(%rbp), %rdi
callq 0x3330
testb $0x1, -0x6a(%rbp)
jne 0x9a55
jmp 0x9a61
movq -0xc0(%rbp), %rdi
callq 0x3210
jmp 0x9b4d
movq -0xa0(%rbp), %rdi
callq 0x9ca0
testb $0x1, %al
jne 0x9b44
movb $0x1, -0x92(%rbp)
movl $0x20, %edi
callq 0x3170
movq %rax, -0xd0(%rbp)
leaq -0x91(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x34a0
movq -0xc8(%rbp), %rdx
leaq 0x1870(%rip), %rsi      # 0xb323
leaq -0x90(%rbp), %rdi
callq 0x3ad0
jmp 0x9ac1
movq -0xd0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0xa0b0
jmp 0x9ad6
movq -0xd0(%rbp), %rdi
movb $0x0, -0x92(%rbp)
leaq 0x627d(%rip), %rsi      # 0xfd68
leaq -0x4ad2(%rip), %rdx     # 0x5020
callq 0x3470
jmp 0x9b56
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x9b1f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x3548
leaq -0x91(%rbp), %rdi
callq 0x3330
testb $0x1, -0x92(%rbp)
jne 0x9b36
jmp 0x9b42
movq -0xd0(%rbp), %rdi
callq 0x3210
jmp 0x9b4d
addq $0xd0, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x3490
nopw %cs:(%rax,%rax)