// File: /workspace/github_cpp_makefile_star2_O2/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 $0x58, %rsp
movq %rcx, %r14
movl %edx, %ebp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rsi, 0x10(%rdi)
movl $0x88, %edi
callq 0x4320
movq %rax, %r13
movq %rax, %rdi
callq 0x495c
movq %r13, 0x18(%rbx)
movl %ebp, 0x20(%rbx)
movups (%r14), %xmm0
movups %xmm0, 0x24(%rbx)
andw $0x0, 0x34(%rbx)
xorl %eax, %eax
movb %al, 0x36(%rbx)
leaq 0x48(%rbx), %rcx
movq %rcx, 0x38(%rbx)
andq $0x0, 0x40(%rbx)
movb %al, 0x48(%rbx)
leaq 0x68(%rbx), %rcx
movq %rcx, 0x58(%rbx)
andq $0x0, 0x60(%rbx)
leaq 0x18(%rbx), %r14
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 0x49b0
movq (%r14), %rdi
movl $0x80000001, %esi       # imm = 0x80000001
callq 0x49b8
movq 0x18(%rbx), %r12
leaq 0x1b7(%rip), %rax       # 0xab92
leaq 0x40(%rsp), %rsi
movq %rax, (%rsi)
andq $0x0, 0x8(%rsi)
movq %rbx, 0x10(%rsi)
leaq 0x10(%rsp), %rdi
callq 0xb58e
leaq 0x10(%rsp), %rsi
movq %r12, %rdi
callq 0x4a38
leaq 0x10(%rsp), %rdi
callq 0x4a60
movq 0x18(%rbx), %r12
leaq 0x20e(%rip), %rax       # 0xac26
leaq 0x40(%rsp), %rsi
movq %rax, (%rsi)
andq $0x0, 0x8(%rsi)
movq %rbx, 0x10(%rsi)
leaq 0x10(%rsp), %rdi
callq 0xb58e
leaq 0x10(%rsp), %rsi
movq %r12, %rdi
callq 0x4a42
leaq 0x10(%rsp), %rdi
callq 0x4a60
movq 0x18(%rbx), %r12
leaq 0x2a3(%rip), %rax       # 0xacf8
leaq 0x40(%rsp), %rsi
movq %rax, (%rsi)
andq $0x0, 0x8(%rsi)
movq %rbx, 0x10(%rsi)
leaq 0x10(%rsp), %rdi
callq 0xb58e
leaq 0x10(%rsp), %rsi
movq %r12, %rdi
callq 0x4a56
leaq 0x10(%rsp), %rdi
callq 0x4a60
movq 0x18(%rbx), %r12
leaq 0x3bc(%rip), %rax       # 0xae4e
leaq 0x40(%rsp), %rsi
movq %rax, (%rsi)
andq $0x0, 0x8(%rsi)
movq %rbx, 0x10(%rsi)
leaq 0x10(%rsp), %rdi
callq 0xb58e
leaq 0x10(%rsp), %rsi
movq %r12, %rdi
callq 0x4a4c
leaq 0x10(%rsp), %rdi
callq 0x4a60
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xaadf
jmp 0xab08
jmp 0xaadf
jmp 0xab08
jmp 0xaadf
jmp 0xab08
movq %rax, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x4a60
jmp 0xab0d
jmp 0xab08
movq %rax, 0x8(%rsp)
movq %r13, %rdi
callq 0x42f0
jmp 0xab7c
movq %rax, 0x8(%rsp)
jmp 0xab7c
movq %rax, 0x8(%rsp)
leaq 0x38(%rbx), %rax
movq %rax, 0x38(%rsp)
leaq 0x58(%rbx), %rax
movq %rax, 0x30(%rsp)
leaq 0x98(%rbx), %r12
leaq 0xb8(%rbx), %r13
leaq 0xd8(%rbx), %rbp
leaq 0xf8(%rbx), %rdi
callq 0x4a60
movq %rbp, %rdi
callq 0x4a60
movq %r13, %rdi
callq 0x4a60
movq %r12, %rdi
callq 0x4a60
movq %r15, %rdi
callq 0x4a60
movq 0x30(%rsp), %rdi
callq 0x4170
movq 0x38(%rsp), %rdi
callq 0x4170
movq %r14, %rdi
callq 0xb5d6
addq $0x8, %rbx
movq %rbx, %rdi
callq 0xb6d8
movq 0x8(%rsp), %rdi
callq 0x4570