// File: /workspace/github_cpp_makefile_star2_O3/KinderRiven[P]rdma_demo/client.cc
// Function: main
int main(int argc, char** argv)
{
    rdma_context_t _ctx;
    memset(&_ctx, 0, sizeof(_ctx));
    _ctx.num_qps = 1;
    _ctx.ib_buf_size = 2UL * 1024 * 1024;

    rdma_init(&_ctx);
    connect_qpair(&_ctx);


    int ret;
    ret = post_send(&_ctx, IBV_WR_RDMA_WRITE);
    printf("post_send [%d] = %d\n", IBV_WR_RDMA_WRITE, ret);
    poll_cq(&_ctx);

#if 0
    int tmp;
    printf("[addr:%llx][data:%llx]\n", (uint64_t*)_ctx.local_qp->addr, *(uint64_t*)_ctx.local_qp->addr);
    while (true) {
        scanf("%d", &tmp);
        if (tmp) {
            printf("[addr:%llx][data:%llx]\n", (uint64_t*)_ctx.local_qp->addr, *(uint64_t*)_ctx.local_qp->addr);
        } else {
            break;
        }
    }
#endif

#if 0
    ret = post_receive(&_ctx);
    printf("post_receive = %d\n", ret);
    if (!ret) {
        printf("data = %llu\n", *(uint64_t*)_ctx.remote_qp->addr);
    }
#endif
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x658, %rsp            # imm = 0x658
leaq -0x680(%rbp), %rbx
movl $0x578, %edx            # imm = 0x578
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10b0
movl $0x1, 0x570(%rbx)
movq $0x200000, 0x578(%rbx) # imm = 0x200000
leaq 0xfb9(%rip), %rdi       # 0x2389
callq 0x11b0
leaq -0xd0(%rbp), %r14
movl $0x0, (%r14)
movq %r14, %rdi
callq 0x1180
movl (%r14), %esi
testl %esi, %esi
je 0x1d86
movq %rax, %rbx
leaq 0xc5d(%rip), %rdi       # 0x205d
xorl %eax, %eax
callq 0x1050
movq (%rbx), %rbx
movq %rbx, %rdi
callq 0x1100
movq %rax, -0x678(%rbp)
testq %rax, %rax
je 0x1d8f
movq %rbx, %rdi
callq 0x10c0
leaq 0xc4c(%rip), %rdi       # 0x207d
movq %rax, %rsi
xorl %eax, %eax
callq 0x1050
leaq -0x250(%rbp), %rdx
movq -0x428(%rdx), %rdi
cmpq $-0x1, 0x140(%rdi)
jne 0x1477
cmpq $0x288, -0x8(%rdi)      # imm = 0x288
jb 0x1477
movq -0x140(%rdi), %rax
testq %rax, %rax
je 0x1477
movl $0x34, %ecx
movl $0x1, %esi
callq *%rax
jmp 0x149a
pxor %xmm0, %xmm0
movdqu %xmm0, 0x20(%rdx)
movdqu %xmm0, 0x10(%rdx)
movdqu %xmm0, (%rdx)
movl $0x0, 0x30(%rdx)
movl $0x1, %esi
callq 0x11d0
testl %eax, %eax
jne 0x1d98
leaq 0xeee(%rip), %rdi       # 0x2397
callq 0x11b0
leaq -0x130(%rbp), %rbx
movzwl -0xfe(%rbx), %esi
leaq 0xbd7(%rip), %rdi       # 0x209a
xorl %eax, %eax
callq 0x1050
movq -0x548(%rbx), %rdi
movl $0x1, %esi
movl $0x2, %edx
movq %rbx, %rcx
callq 0x1110
testl %eax, %eax
jne 0x1da1
leaq 0xbb7(%rip), %rbx       # 0x20a9
xorl %r14d, %r14d
movzbl -0x130(%rbp,%r14), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1050
testb $0x1, %r14b
je 0x1518
movl $0x3a, %edi
callq 0x1170
incq %r14
cmpq $0x10, %r14
jne 0x14f5
movl $0xa, %edi
callq 0x1170
leaq -0x218(%rbp), %rsi
movq -0x460(%rsi), %rdi
callq 0x11a0
testl %eax, %eax
jne 0x1daa
leaq 0xe60(%rip), %rdi       # 0x23ad
callq 0x11b0
movl -0x1b0(%rbp), %esi
leaq 0xb4f(%rip), %rdi       # 0x20ae
xorl %eax, %eax
callq 0x1050
movl -0x198(%rbp), %esi
movl -0x194(%rbp), %edx
leaq 0xb48(%rip), %rdi       # 0x20c1
xorl %eax, %eax
callq 0x1050
movl -0x1a8(%rbp), %esi
leaq 0xb56(%rip), %rdi       # 0x20e3
xorl %eax, %eax
callq 0x1050
movl -0x190(%rbp), %eax
leal 0xfffff(%rax), %esi
testl %eax, %eax
cmovnsl %eax, %esi
sarl $0x14, %esi
movq -0x1c8(%rbp), %rdx
shrq $0x1e, %rdx
leaq 0xb3e(%rip), %rdi       # 0x20f8
xorl %eax, %eax
callq 0x1050
leaq 0xe86(%rip), %rdi       # 0x244e
callq 0x11b0
movq -0x678(%rbp), %rdi
callq 0x1060
movq %rax, -0x670(%rbp)
testq %rax, %rax
je 0x1db3
leaq 0xe6d(%rip), %rdi       # 0x245d
callq 0x11b0
movq -0x678(%rbp), %rdi
movl $0x1, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x10d0
movq %rax, -0x660(%rbp)
testq %rax, %rax
je 0x1dbc
leaq 0xe4d(%rip), %rdi       # 0x2471
callq 0x11b0
pxor %xmm0, %xmm0
movdqa %xmm0, -0xa0(%rbp)
movdqa %xmm0, -0xd0(%rbp)
movdqa %xmm0, -0xc0(%rbp)
movabsq $0x100000002, %rax      # imm = 0x100000002
movq %rax, -0x9c(%rbp)
movq -0x660(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq %rax, -0xc0(%rbp)
movdqa 0x99d(%rip), %xmm0      # 0x2010
movdqa %xmm0, -0xb0(%rbp)
cmpl $0x0, -0x110(%rbp)
jle 0x170f
leaq -0xd0(%rbp), %rbx
leaq 0xa8a(%rip), %r15       # 0x2120
leaq 0xaa1(%rip), %r12       # 0x213e
leaq 0xab4(%rip), %r13       # 0x2158
xorl %r14d, %r14d
movq -0x670(%rbp), %rdi
movq %rbx, %rsi
callq 0x1160
movq %rax, -0x658(%rbp,%r14,8)
testq %rax, %rax
je 0x16e7
movq %r12, %rdi
movl %r14d, %esi
xorl %eax, %eax
callq 0x1050
movq -0x658(%rbp,%r14,8), %rax
movl 0x34(%rax), %esi
movq %r13, %rdi
xorl %eax, %eax
callq 0x1050
jmp 0x1700
callq 0x1040
movl (%rax), %edi
callq 0x1080
movq %r15, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x1050
incq %r14
movslq -0x110(%rbp), %rax
cmpq %rax, %r14
jl 0x16a7
leaq 0xda1(%rip), %rdi       # 0x24b7
callq 0x11b0
movq -0x108(%rbp), %rbx
movq %rbx, %rdi
callq 0x1030
movq %rax, -0x680(%rbp)
leaq 0xa30(%rip), %rdi       # 0x2168
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1050
movq -0x680(%rbp), %rsi
movq -0x670(%rbp), %rdi
movq -0x108(%rbp), %rdx
movl $0x7, %ecx
callq 0x10f0
movq %rax, -0x668(%rbp)
testq %rax, %rax
je 0x1dc5
leaq 0xd57(%rip), %rdi       # 0x24cf
callq 0x11b0
movq -0x668(%rbp), %rax
movl 0x24(%rax), %esi
movl 0x28(%rax), %edx
leaq 0x9ef(%rip), %rdi       # 0x2180
xorl %eax, %eax
callq 0x1050
movq -0x668(%rbp), %rax
movsd 0x18(%rax), %xmm1
unpcklps 0x875(%rip), %xmm1      # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
movq 0x10(%rax), %rsi
subpd 0x879(%rip), %xmm1      # 0x2030
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x875(%rip), %xmm0      # 0x2040
leaq 0x9c7(%rip), %rdi       # 0x2199
movb $0x1, %al
callq 0x1050
leaq 0xb60(%rip), %rdi       # 0x2340
callq 0x11b0
xorpd %xmm0, %xmm0
leaq -0x100(%rbp), %rdx
movapd %xmm0, (%rdx)
movapd %xmm0, 0x10(%rdx)
movapd %xmm0, 0x20(%rdx)
movl $0x1, 0x8(%rdx)
leaq 0x9b0(%rip), %rdi       # 0x21bc
leaq 0x9b6(%rip), %rsi       # 0x21c9
leaq -0x30(%rbp), %rbx
movq %rbx, %rcx
callq 0x1130
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x185d
movl 0x4(%rbx), %edi
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
callq 0x1070
cmpl $-0x1, %eax
je 0x1857
movl %eax, %r15d
movq 0x18(%rbx), %rsi
movl 0x10(%rbx), %edx
movl %eax, %edi
callq 0x10e0
testl %eax, %eax
je 0x1865
movl %r15d, %edi
callq 0x11e0
movq 0x28(%rbx), %rbx
jmp 0x1822
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0x187d
movl %r15d, -0x10c(%rbp)
leaq 0x95b(%rip), %rdi       # 0x21ce
movl %r15d, %esi
xorl %eax, %eax
callq 0x1050
movq -0x30(%rbp), %rdi
callq 0x1140
movl $0x22, %edi
callq 0x1150
movq %rax, %r12
movq %rax, -0x120(%rbp)
movq -0x680(%rbp), %rax
movq %rax, (%r12)
movq -0x668(%rbp), %rax
movl 0x28(%rax), %eax
movl %eax, 0x8(%r12)
movq -0x658(%rbp), %rax
movl 0x34(%rax), %eax
movl %eax, 0xc(%r12)
movzwl -0x22e(%rbp), %eax
movw %ax, 0x10(%r12)
leaq -0x130(%rbp), %rax
movups (%rax), %xmm0
movups %xmm0, 0x12(%r12)
movq %r12, %r13
addq $0x12, %r13
xorl %r14d, %r14d
movq %r12, %rbx
movl $0x22, %edx
subq %r14, %rdx
movl %r15d, %edi
movq %rbx, %rsi
callq 0x10a0
testq %rax, %rax
je 0x1913
addq %rax, %r14
addq %rax, %rbx
cmpq $0x22, %r14
jb 0x18ed
jmp 0x191a
movq $-0x1, %r14
leaq 0x8c1(%rip), %rdi       # 0x21e2
movl $0x22, %edx
movq %r14, %rsi
xorl %eax, %eax
callq 0x1050
movq (%r12), %rsi
movl 0x8(%r12), %edx
leaq 0x8ba(%rip), %rdi       # 0x21fa
xorl %eax, %eax
callq 0x1050
movzwl 0x10(%r12), %esi
movl 0xc(%r12), %edx
leaq 0x8bc(%rip), %rdi       # 0x2215
xorl %eax, %eax
callq 0x1050
leaq 0x8c8(%rip), %rdi       # 0x222f
xorl %eax, %eax
callq 0x1050
leaq 0x734(%rip), %r14       # 0x20a9
xorl %ebx, %ebx
movzbl (%r13,%rbx), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1050
testb $0x1, %bl
je 0x1996
movl $0x3a, %edi
callq 0x1170
incq %rbx
cmpq $0x10, %rbx
jne 0x1977
leaq 0x9a4(%rip), %rdi       # 0x234a
callq 0x11b0
movl $0x22, %r13d
movl $0x22, %edi
callq 0x1150
movq %rax, %r14
movq %rax, %rbx
movq %rax, -0x118(%rbp)
xorl %r12d, %r12d
movq %rax, -0x38(%rbp)
movl %r15d, %edi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x1190
testq %rax, %rax
je 0x19ed
addq %rax, %rbx
addq %rax, %r12
subq %rax, %r13
jne 0x19cf
leaq 0x846(%rip), %rdi       # 0x223a
movl $0x22, %edx
movq %r12, %rsi
xorl %eax, %eax
callq 0x1050
movq -0x38(%rbp), %r13
movq (%r13), %rsi
movl 0x8(%r13), %edx
leaq 0x7e4(%rip), %rdi       # 0x21fa
xorl %eax, %eax
callq 0x1050
movzwl 0x10(%r13), %esi
movl 0xc(%r13), %edx
leaq 0x7e8(%rip), %rdi       # 0x2215
xorl %eax, %eax
callq 0x1050
leaq 0x7f4(%rip), %rdi       # 0x222f
xorl %eax, %eax
callq 0x1050
addq $0x12, %r14
leaq 0x65c(%rip), %r15       # 0x20a9
xorl %ebx, %ebx
movzbl (%r14,%rbx), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x1050
testb $0x1, %bl
je 0x1a6d
movl $0x3a, %edi
callq 0x1170
incq %rbx
cmpq $0x10, %rbx
jne 0x1a4f
leaq 0x8cd(%rip), %rdi       # 0x234a
callq 0x11b0
movq -0x658(%rbp), %rbx
leaq -0xd0(%rbp), %r15
movl $0x90, %edx
movq %r15, %rdi
xorl %esi, %esi
callq 0x10b0
movl $0x1, %eax
movl %eax, (%r15)
movb $0x1, %al
movb %al, 0x81(%r15)
movl $0x7, 0x20(%r15)
movq %rbx, %rdi
movq %r15, %rsi
movl $0x39, %edx
callq 0x11c0
leaq 0x782(%rip), %rdi       # 0x2251
movl %eax, %esi
xorl %eax, %eax
callq 0x1050
movq -0x658(%rbp), %rbx
movl 0xc(%r13), %r12d
movzwl 0x10(%r13), %r13d
movl $0x90, %edx
movq %r15, %rdi
xorl %esi, %esi
callq 0x10b0
movl $0x2, %eax
movl %eax, (%r15)
movl $0x1, %eax
movl %eax, 0x8(%r15)
movl %r12d, 0x1c(%r15)
movw $0x1201, 0x7f(%r15)     # imm = 0x1201
movw %r13w, 0x50(%r15)
movw $0x101, 0x55(%r15)      # imm = 0x101
movdqu (%r14), %xmm0
movdqu %xmm0, 0x38(%r15)
movw $0x102, 0x4c(%r15)      # imm = 0x102
movq %rbx, %rdi
movq %r15, %rsi
movl $0x129181, %edx         # imm = 0x129181
callq 0x11c0
leaq 0x724(%rip), %rdi       # 0x226c
movl %eax, %esi
xorl %eax, %eax
callq 0x1050
movq -0x658(%rbp), %rbx
leaq -0xd0(%rbp), %r14
movl $0x90, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x10b0
movl $0x3, (%r14)
movw $0x612, 0x82(%r14)      # imm = 0x612
movb $0x1, %al
movb %al, 0x7e(%r14)
movq %rbx, %rdi
movq %r14, %rsi
movl $0x12e01, %edx          # imm = 0x12E01
callq 0x11c0
leaq 0x6ea(%rip), %rdi       # 0x2286
movl %eax, %esi
xorl %eax, %eax
callq 0x1050
leaq -0x30(%rbp), %r15
movq $0x0, (%r15)
movq -0x680(%rbp), %rax
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0x30(%rax)
movdqu %xmm0, 0x20(%rax)
movdqu %xmm0, 0x10(%rax)
movdqu %xmm0, (%rax)
movq -0x680(%rbp), %rsi
movq -0x668(%rbp), %rax
movq %rsi, -0x100(%rbp)
movl $0x40, -0xf8(%rbp)
movl 0x24(%rax), %eax
movl %eax, -0xf4(%rbp)
pxor %xmm0, %xmm0
movdqa %xmm0, 0x10(%r14)
movdqa %xmm0, 0x20(%r14)
movdqa %xmm0, 0x70(%r14)
movdqa %xmm0, 0x60(%r14)
movdqa %xmm0, 0x50(%r14)
movdqa %xmm0, 0x40(%r14)
movdqa %xmm0, 0x30(%r14)
movdqa %xmm0, (%r14)
leaq -0x100(%rbp), %rax
movq %rax, 0x10(%r14)
movl $0x1, %eax
movl %eax, 0x18(%r14)
movl $0x2, %eax
movl %eax, 0x20(%r14)
movq -0x118(%rbp), %rax
movq (%rax), %rdx
movq %rdx, 0x28(%r14)
movl 0x8(%rax), %eax
movl %eax, 0x30(%r14)
leaq 0x63e(%rip), %rdi       # 0x22a0
xorl %eax, %eax
callq 0x1050
movq -0x658(%rbp), %rdi
movq (%rdi), %rax
leaq -0xd0(%rbp), %rsi
movq %r15, %rdx
callq *0xd0(%rax)
movl %eax, %ebx
testl %eax, %eax
je 0x1c98
movl %ebx, %edi
callq 0x1080
movq %rax, %rdi
callq 0x11b0
leaq 0x3a9(%rip), %rdi       # 0x2048
xorl %esi, %esi
movl %ebx, %edx
xorl %eax, %eax
callq 0x1050
movq -0x660(%rbp), %rbx
movq (%rbx), %rax
movq %rbx, %rdi
movl $0x1, %esi
movq %r14, %rdx
callq *0x60(%rax)
testl %eax, %eax
js 0x1d70
movl %eax, %r15d
setne %al
movl -0xc8(%rbp), %edi
testl %edi, %edi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
je 0x1d02
testl %r15d, %r15d
setne %al
testl %edi, %edi
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x1cb1
leaq 0x651(%rip), %rdi       # 0x234c
callq 0x11b0
jmp 0x1d5c
callq 0x1090
leaq 0x5af(%rip), %rdi       # 0x22bd
movq %rax, %rsi
movl %r15d, %edx
xorl %eax, %eax
callq 0x1050
movq -0xd0(%rbp), %rsi
movl -0xc8(%rbp), %edx
movl -0xc4(%rbp), %ecx
leaq 0x5c0(%rip), %rdi       # 0x22f5
xorl %eax, %eax
callq 0x1050
movl -0xbc(%rbp), %esi
movl -0xb4(%rbp), %edx
movl -0xb0(%rbp), %ecx
leaq 0x5c4(%rip), %rdi       # 0x2319
xorl %eax, %eax
callq 0x1050
xorl %eax, %eax
addq $0x658, %rsp            # imm = 0x658
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5fe(%rip), %rdi       # 0x2375
callq 0x11b0
movl $0x1, %edi
callq 0x1120
leaq 0x6a2(%rip), %rdi       # 0x242f
jmp 0x1d77
leaq 0x67e(%rip), %rdi       # 0x2414
jmp 0x1d77
leaq 0x65b(%rip), %rdi       # 0x23fa
jmp 0x1d77
leaq 0x639(%rip), %rdi       # 0x23e1
jmp 0x1d77
leaq 0x614(%rip), %rdi       # 0x23c5
jmp 0x1d77
leaq 0x6e5(%rip), %rdi       # 0x249f
jmp 0x1d77
leaq 0x6c3(%rip), %rdi       # 0x2486
jmp 0x1d77
leaq 0x715(%rip), %rdi       # 0x24e1
jmp 0x1d77