// File: /workspace/github_cpp_makefile_star2_O1/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 $0x580, %edx            # imm = 0x580
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 0x1dc9
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 0x1dd2
movq %rbx, %rdi
callq 0x10c0
leaq 0xc4c(%rip), %rdi       # 0x207d
xorl %ebx, %ebx
movq %rax, %rsi
xorl %eax, %eax
callq 0x1050
movq -0x678(%rbp), %rdi
leaq -0x140(%rdi), %rax
cmpq $-0x1, 0x140(%rdi)
cmovneq %rbx, %rax
jne 0x1477
cmpq $0x288, 0x138(%rax) # imm = 0x288
jae 0x146a
xorl %ebx, %ebx
jmp 0x1477
movq (%rax), %rcx
testq %rcx, %rcx
cmoveq %rcx, %rax
movq %rax, %rbx
leaq -0x250(%rbp), %rdx
testq %rbx, %rbx
je 0x1491
movl $0x34, %ecx
movl $0x1, %esi
callq *(%rbx)
jmp 0x14b0
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdx)
movups %xmm0, 0x10(%rdx)
movups %xmm0, (%rdx)
movl $0x0, 0x30(%rdx)
movl $0x1, %esi
callq 0x11d0
testl %eax, %eax
jne 0x1ddb
leaq 0xed8(%rip), %rdi       # 0x2397
callq 0x11b0
leaq -0x130(%rbp), %rbx
movzwl -0xfe(%rbx), %esi
leaq 0xbc1(%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 0x1de4
leaq 0xba1(%rip), %rbx       # 0x20a9
xorl %r14d, %r14d
movzbl -0x130(%rbp,%r14), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1050
testb $0x1, %r14b
je 0x152e
movl $0x3a, %edi
callq 0x1170
incq %r14
cmpq $0x10, %r14
jne 0x150b
movl $0xa, %edi
callq 0x1170
leaq -0x218(%rbp), %rsi
movq -0x460(%rsi), %rdi
callq 0x11a0
testl %eax, %eax
jne 0x1ded
leaq 0xe4a(%rip), %rdi       # 0x23ad
callq 0x11b0
movl -0x1b0(%rbp), %esi
leaq 0xb39(%rip), %rdi       # 0x20ae
xorl %eax, %eax
callq 0x1050
movl -0x198(%rbp), %esi
movl -0x194(%rbp), %edx
leaq 0xb32(%rip), %rdi       # 0x20c1
xorl %eax, %eax
callq 0x1050
movl -0x1a8(%rbp), %esi
leaq 0xb40(%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 0xb28(%rip), %rdi       # 0x20f8
xorl %eax, %eax
callq 0x1050
leaq 0xe70(%rip), %rdi       # 0x244e
callq 0x11b0
movq -0x678(%rbp), %rdi
callq 0x1060
movq %rax, -0x670(%rbp)
testq %rax, %rax
je 0x1df6
leaq 0xe57(%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 0x1dff
leaq 0xe37(%rip), %rdi       # 0x2471
callq 0x11b0
xorps %xmm0, %xmm0
movaps %xmm0, -0xa0(%rbp)
movaps %xmm0, -0xd0(%rbp)
movaps %xmm0, -0xc0(%rbp)
movabsq $0x100000002, %rax      # imm = 0x100000002
movq %rax, -0x9c(%rbp)
movq -0x660(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq %rax, -0xc0(%rbp)
movaps 0x98c(%rip), %xmm0      # 0x2010
movaps %xmm0, -0xb0(%rbp)
cmpl $0x0, -0x110(%rbp)
jle 0x171f
leaq -0xd0(%rbp), %rbx
leaq 0xa7a(%rip), %r15       # 0x2120
leaq 0xa91(%rip), %r12       # 0x213e
leaq 0xaa4(%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 0x16f7
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 0x1710
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 0x16b7
leaq 0xd91(%rip), %rdi       # 0x24b7
callq 0x11b0
movq -0x108(%rbp), %rbx
movq %rbx, %rdi
callq 0x1030
movq %rax, -0x680(%rbp)
leaq 0xa20(%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 0x1e08
leaq 0xd47(%rip), %rdi       # 0x24cf
callq 0x11b0
movq -0x668(%rbp), %rax
movl 0x24(%rax), %esi
movl 0x28(%rax), %edx
leaq 0x9df(%rip), %rdi       # 0x2180
xorl %eax, %eax
callq 0x1050
movq -0x668(%rbp), %rax
movsd 0x18(%rax), %xmm1
unpcklps 0x865(%rip), %xmm1      # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
movq 0x10(%rax), %rsi
subpd 0x869(%rip), %xmm1      # 0x2030
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x865(%rip), %xmm0      # 0x2040
leaq 0x9b7(%rip), %rdi       # 0x2199
movb $0x1, %al
callq 0x1050
leaq 0xb50(%rip), %rdi       # 0x2340
callq 0x11b0
xorpd %xmm0, %xmm0
leaq -0x100(%rbp), %rdx
movapd %xmm0, (%rdx)
movapd %xmm0, 0x10(%rdx)
movapd %xmm0, 0x20(%rdx)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x4(%rdx)
leaq 0x999(%rip), %rdi       # 0x21bc
leaq 0x99f(%rip), %rsi       # 0x21c9
leaq -0x30(%rbp), %rbx
movq %rbx, %rcx
callq 0x1130
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x1874
movl 0x4(%rbx), %edi
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
callq 0x1070
cmpl $-0x1, %eax
je 0x186e
movl %eax, %r15d
movq 0x18(%rbx), %rsi
movl 0x10(%rbx), %edx
movl %eax, %edi
callq 0x10e0
testl %eax, %eax
je 0x187c
movl %r15d, %edi
callq 0x11e0
movq 0x28(%rbx), %rbx
jmp 0x1839
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0x1894
movl %r15d, -0x10c(%rbp)
leaq 0x944(%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 0x192a
addq %rax, %r14
addq %rax, %rbx
cmpq $0x22, %r14
jb 0x1904
jmp 0x1931
movq $-0x1, %r14
leaq 0x8aa(%rip), %rdi       # 0x21e2
movl $0x22, %edx
movq %r14, %rsi
xorl %eax, %eax
callq 0x1050
movq (%r12), %rsi
movl 0x8(%r12), %edx
leaq 0x8a3(%rip), %rdi       # 0x21fa
xorl %eax, %eax
callq 0x1050
movzwl 0x10(%r12), %esi
movl 0xc(%r12), %edx
leaq 0x8a5(%rip), %rdi       # 0x2215
xorl %eax, %eax
callq 0x1050
leaq 0x8b1(%rip), %rdi       # 0x222f
xorl %eax, %eax
callq 0x1050
leaq 0x71d(%rip), %r14       # 0x20a9
xorl %ebx, %ebx
movzbl (%r13,%rbx), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1050
testb $0x1, %bl
je 0x19ad
movl $0x3a, %edi
callq 0x1170
incq %rbx
cmpq $0x10, %rbx
jne 0x198e
leaq 0x98d(%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 0x1a04
addq %rax, %rbx
addq %rax, %r12
subq %rax, %r13
jne 0x19e6
leaq 0x82f(%rip), %rdi       # 0x223a
movl $0x22, %edx
movq %r12, %rsi
xorl %eax, %eax
callq 0x1050
movq -0x38(%rbp), %r12
movq (%r12), %rsi
movl 0x8(%r12), %edx
leaq 0x7cc(%rip), %rdi       # 0x21fa
xorl %eax, %eax
callq 0x1050
movzwl 0x10(%r12), %esi
movl 0xc(%r12), %edx
leaq 0x7ce(%rip), %rdi       # 0x2215
xorl %eax, %eax
callq 0x1050
leaq 0x7da(%rip), %rdi       # 0x222f
xorl %eax, %eax
callq 0x1050
addq $0x12, %r14
leaq 0x642(%rip), %r15       # 0x20a9
xorl %ebx, %ebx
movzbl (%r14,%rbx), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x1050
testb $0x1, %bl
je 0x1a87
movl $0x3a, %edi
callq 0x1170
incq %rbx
cmpq $0x10, %rbx
jne 0x1a69
leaq 0x8b3(%rip), %rdi       # 0x234a
callq 0x11b0
movq -0x658(%rbp), %rbx
leaq -0xd0(%rbp), %r15
xorl %r13d, %r13d
movl $0x90, %edx
movq %r15, %rdi
xorl %esi, %esi
callq 0x10b0
movl $0x1, %eax
movl %eax, (%r15)
movb $0x1, %al
movb %al, 0x81(%r15)
movw %r13w, 0x78(%r15)
movl $0x7, 0x20(%r15)
movq %rbx, %rdi
movq %r15, %rsi
movl $0x39, %edx
callq 0x11c0
leaq 0x760(%rip), %rdi       # 0x2251
movl %eax, %esi
xorl %eax, %eax
callq 0x1050
movq -0x658(%rbp), %rbx
movl 0xc(%r12), %r13d
movzwl 0x10(%r12), %r12d
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 %r13d, 0x1c(%r15)
xorl %eax, %eax
movl %eax, 0x14(%r15)
movw $0x1201, 0x7f(%r15)     # imm = 0x1201
movw %r12w, 0x50(%r15)
movw %ax, 0x52(%r15)
movw $0x101, 0x55(%r15)      # imm = 0x101
movups (%r14), %xmm0
movups %xmm0, 0x38(%r15)
movl %eax, 0x48(%r15)
movw $0x102, 0x4c(%r15)      # imm = 0x102
movb %al, 0x4e(%r15)
xorl %r12d, %r12d
movq %rbx, %rdi
movq %r15, %rsi
movl $0x129181, %edx         # imm = 0x129181
callq 0x11c0
leaq 0x6ec(%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 %r12b, 0x84(%r14)
movl %r12d, 0x18(%r14)
movb $0x1, %al
movb %al, 0x7e(%r14)
movq %rbx, %rdi
movq %r14, %rsi
movl $0x12e01, %edx          # imm = 0x12E01
callq 0x11c0
leaq 0x6a7(%rip), %rdi       # 0x2286
movl %eax, %esi
xorl %eax, %eax
callq 0x1050
leaq -0x30(%rbp), %r15
movq $0x0, (%r15)
xorps %xmm0, %xmm0
movaps %xmm0, -0x100(%rbp)
movq -0x680(%rbp), %rax
pcmpeqd %xmm1, %xmm1
movdqu %xmm1, 0x30(%rax)
movdqu %xmm1, 0x20(%rax)
movdqu %xmm1, 0x10(%rax)
movdqu %xmm1, (%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)
movaps %xmm0, 0x10(%r14)
movaps %xmm0, 0x20(%r14)
movaps %xmm0, 0x70(%r14)
movaps %xmm0, 0x60(%r14)
movaps %xmm0, 0x50(%r14)
movaps %xmm0, 0x40(%r14)
movaps %xmm0, 0x30(%r14)
movaps %xmm0, (%r14)
leaq -0x100(%rbp), %rax
movq %rax, 0x10(%r14)
movq $0x1, 0x18(%r14)
movl $0x2, %eax
movl %eax, 0x20(%r14)
movq -0x118(%rbp), %rax
movq (%rax), %rcx
movq %rcx, 0x28(%r14)
movl 0x8(%rax), %ecx
movl %ecx, 0x30(%r14)
movq (%rax), %rdx
leaq 0x5fb(%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 0x1cdb
movl %ebx, %edi
callq 0x1080
movq %rax, %rdi
callq 0x11b0
leaq 0x366(%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 0x1db3
movl %eax, %r15d
setne %al
movl -0xc8(%rbp), %edi
testl %edi, %edi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
je 0x1d45
testl %r15d, %r15d
setne %al
testl %edi, %edi
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x1cf4
leaq 0x60e(%rip), %rdi       # 0x234c
callq 0x11b0
jmp 0x1d9f
callq 0x1090
leaq 0x56c(%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 0x57d(%rip), %rdi       # 0x22f5
xorl %eax, %eax
callq 0x1050
movl -0xbc(%rbp), %esi
movl -0xb4(%rbp), %edx
movl -0xb0(%rbp), %ecx
leaq 0x581(%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 0x5bb(%rip), %rdi       # 0x2375
callq 0x11b0
movl $0x1, %edi
callq 0x1120
leaq 0x65f(%rip), %rdi       # 0x242f
jmp 0x1dba
leaq 0x63b(%rip), %rdi       # 0x2414
jmp 0x1dba
leaq 0x618(%rip), %rdi       # 0x23fa
jmp 0x1dba
leaq 0x5f6(%rip), %rdi       # 0x23e1
jmp 0x1dba
leaq 0x5d1(%rip), %rdi       # 0x23c5
jmp 0x1dba
leaq 0x6a2(%rip), %rdi       # 0x249f
jmp 0x1dba
leaq 0x680(%rip), %rdi       # 0x2486
jmp 0x1dba
leaq 0x6d2(%rip), %rdi       # 0x24e1
jmp 0x1dba