// File: metopa[P]HTTP_Server/src/network/CPortObtainer.cpp
// Function: CPortObtainer::CPortObtainer(char const*, int)
CPortObtainer::CPortObtainer( const char * port, int connsPerPort ) :
		addrinfo_m( port ), socket_m( addrinfo_m, port ) {
	if ( listen( socket_m, connsPerPort ) == -1 )
		throw PortInitializationException( "listen()", strerror( errno ), port );

	Log.ger<>( DEBUG_NETWORK, port, "is binded to socket", (int) socket_m );
	if ( sscanf( port, "%d", &port_m ) != 1 )
		port_m = -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x90(%rbp)
movq %rdi, %rax
movq %rax, -0x98(%rbp)
movq -0x10(%rbp), %rsi
callq 0x243d0
movq -0x90(%rbp), %rdi
movq %rdi, %rax
addq $0x8, %rax
movq %rax, -0x88(%rbp)
callq 0x241a0
movq %rax, -0x80(%rbp)
jmp 0x23f74
movq -0x80(%rbp), %rsi
movq -0x88(%rbp), %rdi
movq -0x10(%rbp), %rdx
callq 0x245c0
jmp 0x23f8a
movq -0x98(%rbp), %rdi
addq $0x8, %rdi
callq 0x241c0
movl %eax, -0x9c(%rbp)
jmp 0x23fa2
movl -0x9c(%rbp), %edi
movl -0x14(%rbp), %esi
callq 0x65a0
cmpl $-0x1, %eax
jne 0x240fa
movb $0x1, -0x72(%rbp)
movl $0x50, %edi
callq 0x6280
movq %rax, -0xb0(%rbp)
leaq -0x49(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
callq 0x6930
movq -0xa8(%rbp), %rdx
leaq 0x8a1e(%rip), %rsi      # 0x2ca0a
leaq -0x48(%rbp), %rdi
callq 0xa9d0
jmp 0x23ff7
callq 0x6080
movl (%rax), %edi
callq 0x61f0
movq %rax, -0xc0(%rbp)
leaq -0x71(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x6930
movq -0xc0(%rbp), %rsi
movq -0xb8(%rbp), %rdx
leaq -0x70(%rbp), %rdi
callq 0xa9d0
jmp 0x24033
movq -0xb0(%rbp), %rdi
movq -0x10(%rbp), %rcx
leaq -0x48(%rbp), %rsi
leaq -0x70(%rbp), %rdx
movl $0xfffffffe, %r8d       # imm = 0xFFFFFFFE
callq 0x24a00
jmp 0x24053
movq -0xb0(%rbp), %rdi
movb $0x0, -0x72(%rbp)
leaq 0x1a7eb(%rip), %rsi     # 0x3e850
leaq 0x9f4(%rip), %rdx       # 0x24a60
callq 0x68e0
jmp 0x24197
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x24182
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x24176
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x240db
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x240c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x6310
leaq -0x71(%rbp), %rdi
callq 0x6550
leaq -0x48(%rbp), %rdi
callq 0x6310
leaq -0x49(%rbp), %rdi
callq 0x6550
testb $0x1, -0x72(%rbp)
jne 0x240ec
jmp 0x240f8
movq -0xb0(%rbp), %rdi
callq 0x63b0
jmp 0x24176
movq -0x98(%rbp), %rdi
addq $0x8, %rdi
callq 0x241c0
movl %eax, -0xc4(%rbp)
jmp 0x24112
movl -0xc4(%rbp), %eax
movl %eax, -0x78(%rbp)
leaq 0x1b5be(%rip), %rdi     # 0x3f6e0
leaq 0x88ea(%rip), %rcx      # 0x2ca13
movl $0x5, %esi
leaq -0x10(%rbp), %rdx
leaq -0x78(%rbp), %r8
callq 0x24a80
jmp 0x2413d
movq -0x98(%rbp), %rdx
movq -0x10(%rbp), %rdi
addq $0xc, %rdx
leaq 0x7f7d(%rip), %rsi      # 0x2c0d0
movb $0x0, %al
callq 0x64b0
cmpl $0x1, %eax
je 0x2416d
movq -0x98(%rbp), %rax
movl $0xffffffff, 0xc(%rax)  # imm = 0xFFFFFFFF
addq $0xd0, %rsp
popq %rbp
retq
movq -0x88(%rbp), %rdi
callq 0x249a0
movq -0x90(%rbp), %rdi
callq 0x24590
movq -0x20(%rbp), %rdi
callq 0x6920
nopw (%rax,%rax)