// File: /workspace/github_cpp_makefile_star2_O3/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
movq $0x0, 0x10(%rsp)
movl $0x18, %edi
callq 0x4350
leaq 0x316(%rip), %rcx       # 0xc1a8
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movq %rbx, 0x10(%rax)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x116a(%rip), %r13      # 0xd01a
movq %r13, 0x18(%rsi)
leaq 0x117b(%rip), %rbp      # 0xd036
movq %rbp, 0x10(%rsi)
movq %r12, %rdi
callq 0x4d64
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0xbee0
leaq 0x8(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq (%r14), %r12
movq $0x0, 0x10(%rsp)
movl $0x18, %edi
callq 0x4350
leaq 0x345(%rip), %rcx       # 0xc242
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movq %rbx, 0x10(%rax)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %r13, 0x18(%rsi)
movq %rbp, 0x10(%rsi)
movq %r12, %rdi
callq 0x4d6e
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0xbf3d
leaq 0x8(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq (%r14), %r12
movq $0x0, 0x10(%rsp)
movl $0x18, %edi
callq 0x4350
leaq 0x3ba(%rip), %rcx       # 0xc314
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movq %rbx, 0x10(%rax)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %r13, 0x18(%rsi)
movq %rbp, 0x10(%rsi)
movq %r12, %rdi
callq 0x4d82
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0xbf9a
leaq 0x8(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq (%r14), %r12
movq $0x0, 0x10(%rsp)
movl $0x18, %edi
callq 0x4350
leaq 0x523(%rip), %rcx       # 0xc4da
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movq %rbx, 0x10(%rax)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %r13, 0x18(%rsi)
movq %rbp, 0x10(%rsi)
movq %r12, %rdi
callq 0x4d78
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0xbff7
leaq 0x8(%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 0xc1a0
jmp 0xc1a0
jmp 0xc1a0
jmp 0xc1a0
movq %rax, %r12
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0xc0d3
leaq 0x8(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0xc0d3
jmp 0xc1a0
jmp 0xc0d0
movq %rax, %r12
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0xc0d3
leaq 0x8(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0xc0d3
jmp 0xc1a0
jmp 0xc0d0
movq %rax, %r12
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0xc0d3
leaq 0x8(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0xc0d3
jmp 0xc1a0
jmp 0xc0d0
movq %rax, %r12
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0xc0d3
leaq 0x8(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0xc0d3
jmp 0xc1a0
jmp 0xc0d0
movq %rax, %r12
movq %r13, %rdi
callq 0x4310
jmp 0xc188
movq %rax, %r12
jmp 0xc188
movq %rax, %r12
movq 0x108(%rbx), %rax
testq %rax, %rax
je 0xc0f0
leaq 0xf8(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0xe8(%rbx), %rax
testq %rax, %rax
je 0xc10d
leaq 0xd8(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0xc8(%rbx), %rax
testq %rax, %rax
je 0xc12a
leaq 0xb8(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0xa8(%rbx), %rax
testq %rax, %rax
je 0xc147
leaq 0x98(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x88(%rbx), %rax
testq %rax, %rax
je 0xc160
movq %r15, %rdi
movq %r15, %rsi
movl $0x3, %edx
callq *%rax
movq 0x58(%rbx), %rdi
cmpq 0x28(%rsp), %rdi
je 0xc170
callq 0x4310
movq 0x38(%rbx), %rdi
cmpq 0x30(%rsp), %rdi
je 0xc180
callq 0x4310
movq %r14, %rdi
callq 0xcf26
movq %rbx, %rdi
callq 0xcf54
movq %r12, %rdi
callq 0x45a0
jmp 0xc1a0
jmp 0xc1a0
jmp 0xc1a0
jmp 0xc1a0
movq %rax, %rdi
callq 0x4df2