// File: xjrueda[P]fixprime/include/Acceptor.h
// Function: fprime::Acceptor::startAcceptor(int)
void startAcceptor(int port) {
            try {
                if (protocolPtr == nullptr)
                    throw runtime_error("Protocol not defined for  session.");
                if (callbacksManager == nullptr)
                    throw runtime_error("CallbacksManager not defined for  session.");
                
                // Create the socket
                SocketConnector server(sessionSetup.getPort());
                setSessionRunning(true);
                while (sessionRunning) {
                    SocketPtr socketPtr(new SocketConnector());
                    server.accept(socketPtr.get());
                    setConnected(true);
                    socketHandler(socketPtr);
                    setIbRunning(false);
                    setObRunning(false);
                    setConnected(false);
                    inboundCondition.notify_one();
                    outboundCondition.notify_one();
                }
            } catch (SocketException& se) {
                //TODO: log error
                std::cout << "Exception was caught:" << se.description() << "\nExiting." << endl;
            } catch (exception& e) {
                //TODO: log error
                cout << "Error starting acceptor: " << e.what() << endl;
            }
            setIbRunning(false);
            setObRunning(false);
            setConnected(false);
            setSessionRunning(false);
            inboundCondition.notify_one();
            outboundCondition.notify_one();
            
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x98(%rbp)
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x9b380
testb $0x1, %al
jne 0xa5b80
jmp 0xa5bf2
movl $0x10, %edi
callq 0x99e80
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xa0(%rbp)
leaq 0x5c49a(%rip), %rsi     # 0x102038
callq 0x99380
jmp 0xa5ba5
movq -0xa0(%rbp), %rdi
movq 0x8d425(%rip), %rsi     # 0x132fd8
movq 0x8d1e6(%rip), %rdx     # 0x132da0
callq 0xa2fe0
jmp 0xa600a
movq -0xa0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x9b9c0
jmp 0xa5e1f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0xa5e1f
movq -0x98(%rbp), %rdi
addq $0x18, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x9dcf0
testb $0x1, %al
jne 0xa5c0c
jmp 0xa5c6d
movl $0x10, %edi
callq 0x99e80
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xa8(%rbp)
leaq 0x5c431(%rip), %rsi     # 0x10205b
callq 0x99380
jmp 0xa5c31
movq -0xa8(%rbp), %rdi
movq 0x8d399(%rip), %rsi     # 0x132fd8
movq 0x8d15a(%rip), %rdx     # 0x132da0
callq 0xa2fe0
jmp 0xa600a
movq -0xa8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x9b9c0
jmp 0xa5e1f
movq -0x98(%rbp), %rdi
addq $0x28, %rdi
callq 0xa2210
movl %eax, -0xac(%rbp)
jmp 0xa5c85
movl -0xac(%rbp), %esi
leaq -0x40(%rbp), %rdi
callq 0x9b790
jmp 0xa5c96
movq -0x98(%rbp), %rdi
movl $0x1, %esi
callq 0xa4c50
jmp 0xa5ca9
jmp 0xa5cab
movq -0x98(%rbp), %rax
testb $0x1, 0x1d8(%rax)
je 0xa5e08
movl $0x20, %edi
callq 0x9dc00
movq %rax, -0xb8(%rbp)
jmp 0xa5cd2
movq -0xb8(%rbp), %rdi
callq 0x9eda0
jmp 0xa5ce0
movq -0xb8(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x9a3b0
jmp 0xa5cf2
leaq -0x50(%rbp), %rdi
callq 0x99890
movq %rax, %rsi
leaq -0x40(%rbp), %rdi
callq 0x99260
jmp 0xa5d09
movq -0x98(%rbp), %rdi
movl $0x1, %esi
callq 0x9acd0
jmp 0xa5d1c
leaq -0x60(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
leaq -0x50(%rbp), %rsi
callq 0x9d5b0
movq -0x98(%rbp), %rdi
movq -0xc0(%rbp), %rsi
callq 0xa2420
jmp 0xa5d45
leaq -0x60(%rbp), %rdi
callq 0xa3930
movq -0x98(%rbp), %rdi
xorl %esi, %esi
callq 0x9e7c0
jmp 0xa5d5e
movq -0x98(%rbp), %rdi
xorl %esi, %esi
callq 0x980c0
jmp 0xa5d6e
movq -0x98(%rbp), %rdi
xorl %esi, %esi
callq 0x9acd0
jmp 0xa5d7e
movq -0x98(%rbp), %rdi
addq $0x208, %rdi            # imm = 0x208
callq 0x99f30
movq -0x98(%rbp), %rdi
addq $0x238, %rdi            # imm = 0x238
callq 0x99f30
leaq -0x50(%rbp), %rdi
callq 0xa3930
jmp 0xa5cab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0xa5e16
movq -0xb8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x9d660
jmp 0xa5e16
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0xa5dfd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0xa3930
leaq -0x50(%rbp), %rdi
callq 0xa3930
jmp 0xa5e16
leaq -0x40(%rbp), %rdi
callq 0x98210
jmp 0xa5ece
leaq -0x40(%rbp), %rdi
callq 0x98210
movl -0x1c(%rbp), %eax
movl %eax, -0xc4(%rbp)
movl $0x2, %ecx
cmpl %ecx, %eax
jne 0xa5f35
movq -0x18(%rbp), %rdi
callq 0x99540
movq %rax, -0x70(%rbp)
movq 0x8cfef(%rip), %rdi     # 0x132e38
leaq 0x5c250(%rip), %rsi     # 0x1020a0
callq 0x9dba0
movq %rax, -0xd0(%rbp)
jmp 0xa5e5e
movq -0x70(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0x9f600
jmp 0xa5e70
movq -0xd0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x9cf40
movq %rax, -0xd8(%rbp)
jmp 0xa5e8c
movq -0xd8(%rbp), %rdi
leaq 0x5c21c(%rip), %rsi     # 0x1020b6
callq 0x9dba0
movq %rax, -0xe0(%rbp)
jmp 0xa5ea8
movq -0xe0(%rbp), %rdi
movq 0x8cdaa(%rip), %rsi     # 0x132c60
callq 0x9e070
jmp 0xa5ebd
leaq -0x90(%rbp), %rdi
callq 0xa4f00
callq 0xa2520
movq -0x98(%rbp), %rdi
xorl %esi, %esi
callq 0x9e7c0
movq -0x98(%rbp), %rdi
xorl %esi, %esi
callq 0x980c0
movq -0x98(%rbp), %rdi
xorl %esi, %esi
callq 0x9acd0
movq -0x98(%rbp), %rdi
xorl %esi, %esi
callq 0xa4c50
movq -0x98(%rbp), %rdi
addq $0x208, %rdi            # imm = 0x208
callq 0x99f30
movq -0x98(%rbp), %rdi
addq $0x238, %rdi            # imm = 0x238
callq 0x99f30
addq $0xf0, %rsp
popq %rbp
retq
movl -0xc4(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0xa5ff9
movq -0x18(%rbp), %rdi
callq 0x99540
movq %rax, -0x68(%rbp)
movq 0x8cedc(%rip), %rdi     # 0x132e38
leaq 0x5c123(%rip), %rsi     # 0x102086
callq 0x9dba0
movq %rax, -0xe8(%rbp)
jmp 0xa5f71
movq -0x68(%rbp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq -0xe8(%rbp), %rdi
movq %rax, %rsi
callq 0x9dba0
movq %rax, -0xf0(%rbp)
jmp 0xa5f96
movq -0xf0(%rbp), %rdi
movq 0x8ccbc(%rip), %rsi     # 0x132c60
callq 0x9e070
jmp 0xa5fab
callq 0xa2520
jmp 0xa5ece
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0xa2520
jmp 0xa5fc8
jmp 0xa5ff9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0xa5ff0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0xa4f00
callq 0xa2520
jmp 0xa5ff7
jmp 0xa5ff9
movq -0x18(%rbp), %rdi
callq 0xa3520
movq %rax, %rdi
callq 0xa6900
nopw (%rax,%rax)