// File: /workspace/github_cpp_makefile_star2_O1/guoxuanhan[P]NetServer/tcpconnection.cpp
// Function: TcpConnection::TcpConnection(EventLoop*, int, sockaddr_in const&)
TcpConnection::TcpConnection(EventLoop *loop, int fd, const struct sockaddr_in &clientaddr)
    : loop_(loop),
    spchannel_(new Channel()),
    fd_(fd),
    clientaddr_(clientaddr),
    halfclose_(false),
    disconnected_(false),
    asyncprocessing_(false),
    bufferin_(),
    bufferout_()
{
    //注册事件执行函数
    spchannel_->SetFd(fd_);
    spchannel_->SetEvents(EPOLLIN | EPOLLET);
    spchannel_->SetReadHandle(std::bind(&TcpConnection::HandleRead, this));
    spchannel_->SetWriteHandle(std::bind(&TcpConnection::HandleWrite, this));
    spchannel_->SetCloseHandle(std::bind(&TcpConnection::HandleClose, this));
    spchannel_->SetErrorHandle(std::bind(&TcpConnection::HandleError, this));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %r15
movl %edx, %ebp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rsi, 0x10(%rdi)
movl $0x88, %edi
callq 0x4350
movq %rax, %r13
movq %rax, %rdi
callq 0x4b1c
leaq 0x18(%rbx), %r14
movq %r13, 0x18(%rbx)
movl %ebp, 0x20(%rbx)
movups (%r15), %xmm0
movups %xmm0, 0x24(%rbx)
movw $0x0, 0x34(%rbx)
xorl %eax, %eax
movb %al, 0x36(%rbx)
leaq 0x48(%rbx), %rcx
movq %rcx, 0x30(%rsp)
movq %rcx, 0x38(%rbx)
movq %rax, 0x40(%rbx)
movb %al, 0x48(%rbx)
leaq 0x68(%rbx), %rcx
movq %rcx, 0x28(%rsp)
movq %rcx, 0x58(%rbx)
movq %rax, 0x60(%rbx)
movb %al, 0x68(%rbx)
leaq 0x78(%rbx), %r15
movl $0xa0, %edx
movq %r15, %rdi
xorl %esi, %esi
callq 0x41f0
movq %r13, %rdi
movl %ebp, %esi
callq 0x4bba
movq (%r14), %rdi
movl $0x80000001, %esi       # imm = 0x80000001
callq 0x4bc2
movq (%r14), %r12
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movl $0x18, %edi
callq 0x4350
leaq 0x307(%rip), %rcx       # 0xc1ec
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movq %rbx, 0x10(%rax)
movq %rsp, %rsi
movq %rax, (%rsi)
leaq 0x1163(%rip), %r13      # 0xd064
movq %r13, 0x18(%rsi)
leaq 0x1174(%rip), %rbp      # 0xd080
movq %rbp, 0x10(%rsi)
movq %r12, %rdi
callq 0x4d64
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0xbf2f
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq (%r14), %r12
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movl $0x18, %edi
callq 0x4350
leaq 0x337(%rip), %rcx       # 0xc286
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movq %rbx, 0x10(%rax)
movq %rsp, %rsi
movq %rax, (%rsi)
movq %r13, 0x18(%rsi)
movq %rbp, 0x10(%rsi)
movq %r12, %rdi
callq 0x4d6e
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0xbf8b
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq (%r14), %r12
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movl $0x18, %edi
callq 0x4350
leaq 0x3ad(%rip), %rcx       # 0xc358
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movq %rbx, 0x10(%rax)
movq %rsp, %rsi
movq %rax, (%rsi)
movq %r13, 0x18(%rsi)
movq %rbp, 0x10(%rsi)
movq %r12, %rdi
callq 0x4d82
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0xbfe7
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq (%r14), %r12
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movl $0x18, %edi
callq 0x4350
leaq 0x519(%rip), %rcx       # 0xc520
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movq %rbx, 0x10(%rax)
movq %rsp, %rsi
movq %rax, (%rsi)
movq %r13, 0x18(%rsi)
movq %rbp, 0x10(%rsi)
movq %r12, %rdi
callq 0x4d78
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0xc043
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc1e4
jmp 0xc1e4
jmp 0xc1e4
jmp 0xc1e4
movq %rax, %r12
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0xc117
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0xc117
jmp 0xc1e4
jmp 0xc114
movq %rax, %r12
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0xc117
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0xc117
jmp 0xc1e4
jmp 0xc114
movq %rax, %r12
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0xc117
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0xc117
jmp 0xc1e4
jmp 0xc114
movq %rax, %r12
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0xc117
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0xc117
jmp 0xc1e4
jmp 0xc114
movq %rax, %r12
movq %r13, %rdi
callq 0x4310
jmp 0xc1cc
movq %rax, %r12
jmp 0xc1cc
movq %rax, %r12
movq 0x108(%rbx), %rax
testq %rax, %rax
je 0xc134
leaq 0xf8(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0xe8(%rbx), %rax
testq %rax, %rax
je 0xc151
leaq 0xd8(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0xc8(%rbx), %rax
testq %rax, %rax
je 0xc16e
leaq 0xb8(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0xa8(%rbx), %rax
testq %rax, %rax
je 0xc18b
leaq 0x98(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x88(%rbx), %rax
testq %rax, %rax
je 0xc1a4
movq %r15, %rdi
movq %r15, %rsi
movl $0x3, %edx
callq *%rax
movq 0x58(%rbx), %rdi
cmpq 0x28(%rsp), %rdi
je 0xc1b4
callq 0x4310
movq 0x38(%rbx), %rdi
cmpq 0x30(%rsp), %rdi
je 0xc1c4
callq 0x4310
movq %r14, %rdi
callq 0xcf70
movq %rbx, %rdi
callq 0xcf9e
movq %r12, %rdi
callq 0x45a0
jmp 0xc1e4
jmp 0xc1e4
jmp 0xc1e4
jmp 0xc1e4
movq %rax, %rdi
callq 0x4df2