// File: fieryzig[P]GameServer/TestClient/TestClient.cpp
// Function: main
int main()
{
    init();
    Client* client = new Client(fd);

    PacketInfo pi;
    pi.srcType = ServerType::CLIENT;
    pi.time = time(NULL);
    pi.uid = -1;
    pi.svrid = 0;
    pi.clifd = -1;
    pi.contentLen = 5;
    string content = "Login";
    client->Send(pi, content);

//    thread recvThread(recv_thread);

    for(;;)
    {
        cin >> content;
        pi.time = time(NULL);
        pi.contentLen = content.length();
        int ret = client->Send(pi, content);
        while (client->hasRemain()) client->SendRemain();
        if (content == "Logout") {
            close(client->fd);
            return 0;
        }
    }

//    recvThread.join();

    return 0;
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movl $0x0, -0x4(%rbp)
callq 0x2480
movl $0x2024, %edi           # imm = 0x2024
callq 0x2160
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xe8(%rbp)
movl 0x3b40(%rip), %esi      # 0x6184
callq 0x28e0
jmp 0x264b
movq -0xe8(%rbp), %rax
movq %rax, -0x10(%rbp)
movl $0x0, -0x34(%rbp)
xorl %eax, %eax
movl %eax, %edi
callq 0x2130
movl %eax, -0x30(%rbp)
movl $0xffffffff, -0x2c(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x28(%rbp)
movl $0xffffffff, -0x24(%rbp) # imm = 0xFFFFFFFF
movl $0x5, -0x20(%rbp)
leaq -0x59(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0x2280
movq -0xf0(%rbp), %rdx
leaq 0x1972(%rip), %rsi      # 0x4015
leaq -0x58(%rbp), %rdi
callq 0x21e0
jmp 0x26ae
leaq -0x59(%rbp), %rdi
callq 0x2180
movq -0x10(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0x24(%rbp), %rax
movq %rax, -0x70(%rbp)
movups -0x34(%rbp), %xmm0
movaps %xmm0, -0x80(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x20a0
jmp 0x26e4
movq -0xf8(%rbp), %rdi
movq -0x70(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movaps -0x80(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0xa0(%rbp), %rsi
callq 0x2cb0
jmp 0x270b
leaq -0xa0(%rbp), %rdi
callq 0x20c0
movq 0x38c2(%rip), %rdi      # 0x5fe0
leaq -0x58(%rbp), %rsi
callq 0x21c0
jmp 0x2729
xorl %eax, %eax
movl %eax, %edi
callq 0x2130
movl %eax, -0x30(%rbp)
leaq -0x58(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0x2220
movq -0x108(%rbp), %rsi
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x24(%rbp), %rax
movq %rax, -0xb0(%rbp)
movups -0x34(%rbp), %xmm0
movaps %xmm0, -0xc0(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x20a0
jmp 0x277e
movq -0x100(%rbp), %rdi
movq -0xb0(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movaps -0xc0(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0xe0(%rbp), %rsi
callq 0x2cb0
movl %eax, -0x10c(%rbp)
jmp 0x27b1
leaq -0xe0(%rbp), %rdi
callq 0x20c0
movl -0x10c(%rbp), %eax
movl %eax, -0xa4(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2e40
movb %al, -0x10d(%rbp)
jmp 0x27da
movb -0x10d(%rbp), %al
testb $0x1, %al
jne 0x27e9
jmp 0x2872
movq -0x10(%rbp), %rdi
callq 0x2e60
jmp 0x27f4
jmp 0x27c9
movq -0xe8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x2140
jmp 0x28d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x59(%rbp), %rdi
callq 0x2180
jmp 0x28d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x28c8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x20c0
jmp 0x28c8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x20c0
jmp 0x28c8
leaq 0x17a2(%rip), %rsi      # 0x401b
leaq -0x58(%rbp), %rdi
callq 0x2920
movb %al, -0x10e(%rbp)
jmp 0x288a
movb -0x10e(%rbp), %al
testb $0x1, %al
jne 0x2896
jmp 0x28c3
movq -0x10(%rbp), %rax
movl 0x2020(%rax), %edi
callq 0x22b0
jmp 0x28a7
movl $0x0, -0x4(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x20c0
movl -0x4(%rbp), %eax
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
jmp 0x2717
leaq -0x58(%rbp), %rdi
callq 0x20c0
movq -0x18(%rbp), %rdi
callq 0x2270
nopw (%rax,%rax)