// File: /workspace/github_cpp_makefile_star2_O3/TheiaRT[P]libiris/tcp_server.cpp
// Function: TCPServer::dispatch_handler(int)
bool TCPServer::dispatch_handler(int client)
{
    std::string req = "";
    if (read_from_sock(client, req, timeout_microsec) == false) {
        /* No failure/recovery plan yet. */
        perror("read_from_sock failed.");
        return false;
    }

    /* Handle the client's request. */
    std::string response = handler(req);

    /* Write some response back. */
    int nwritten = send(client, response.c_str(), response.length(), 0);
    if (nwritten < 0 || nwritten != response.length()) {
        perror("Could not write to socket.");
        return false;
    }

    close(client);
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movl %esi, %ebx
movq %rdi, 0x28(%rsp)
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1a30(%rip), %rdx      # 0x41fe
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0x2ce2
movq $0x1, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0x90(%rsp)
movaps %xmm0, 0xa0(%rsp)
movaps %xmm0, 0xb0(%rsp)
movaps %xmm0, 0xc0(%rsp)
movaps %xmm0, 0xd0(%rsp)
leal 0x3f(%rbx), %eax
testl %ebx, %ebx
cmovnsl %ebx, %eax
movl %eax, %edx
andl $-0x40, %edx
movl %ebx, %ecx
subl %edx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
sarl $0x6, %eax
cltq
orq %rdx, 0x60(%rsp,%rax,8)
movl $0x400, %edi            # imm = 0x400
callq 0x2030
movq %rax, %r15
movl $0x400, %edx            # imm = 0x400
movq %rax, %rdi
xorl %esi, %esi
callq 0x2100
leal 0x1(%rbx), %ebp
leaq 0x60(%rsp), %rsi
leaq 0x30(%rsp), %r8
movl %ebp, %edi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2190
leaq 0x17f9(%rip), %rdi      # 0x4081
testl %eax, %eax
js 0x29b8
leaq 0x8(%rsp), %r13
leaq 0x60(%rsp), %r12
leaq 0x30(%rsp), %r14
testl %eax, %eax
je 0x28f7
movl $0x3ff, %edx            # imm = 0x3FF
movl %ebx, %edi
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x2090
testl %eax, %eax
jle 0x29b1
movq %r13, %rdi
movq %r15, %rsi
callq 0x2260
movl $0x400, %edx            # imm = 0x400
movq %r15, %rdi
xorl %esi, %esi
callq 0x2100
movl %ebp, %edi
movq %r12, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r14, %r8
callq 0x2190
testl %eax, %eax
jns 0x289f
leaq 0x178f(%rip), %rdi      # 0x4081
jmp 0x29b8
movq %r15, %rdi
callq 0x21f0
leaq 0x50(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x40(%rsp), %rdi
callq 0x2b10
movq 0x28(%rsp), %rax
cmpq $0x0, 0x48(%rax)
je 0x29fb
leaq 0x38(%rax), %rsi
leaq 0x60(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq *0x50(%rax)
movq 0x40(%rsp), %rdi
cmpq %r14, %rdi
je 0x2957
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x21c0
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
movl %ebx, %edi
xorl %ecx, %ecx
callq 0x20e0
testl %eax, %eax
js 0x29a1
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpq 0x68(%rsp), %rax
jne 0x29a1
movb $0x1, %bpl
movl %ebx, %edi
callq 0x2270
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x29cb
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x21c0
jmp 0x29cb
leaq 0x16be(%rip), %rdi      # 0x4066
callq 0x2160
xorl %ebp, %ebp
jmp 0x2984
leaq 0x16d8(%rip), %rdi      # 0x4090
callq 0x2160
leaq 0x168b(%rip), %rdi      # 0x404f
callq 0x2160
xorl %ebp, %ebp
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x29e7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21c0
movl %ebp, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x20b0
jmp 0x2a38
movq %rax, %rbx
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2a3b
movq 0x70(%rsp), %rsi
jmp 0x2a2c
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r14, %rdi
je 0x2a3b
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x21c0
jmp 0x2a3b
jmp 0x2a38
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2a57
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21c0
movq %rbx, %rdi
callq 0x2230
nop