// File: /workspace/github_cpp_makefile_star2_O2/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 $0x648, %rsp            # imm = 0x648
leaq -0x670(%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 0xfbf(%rip), %rdi       # 0x2389
callq 0x11b0
leaq -0xf0(%rbp), %r14
andl $0x0, (%r14)
movq %r14, %rdi
callq 0x1180
movl (%r14), %esi
testl %esi, %esi
je 0x1ce6
movq %rax, %rbx
leaq 0xc66(%rip), %rdi       # 0x205d
xorl %eax, %eax
callq 0x1050
movq (%rbx), %rbx
movq %rbx, %rdi
callq 0x1100
movq %rax, -0x668(%rbp)
testq %rax, %rax
je 0x1cef
movq %rbx, %rdi
callq 0x10c0
leaq 0xc55(%rip), %rdi       # 0x207d
movq %rax, %rsi
xorl %eax, %eax
callq 0x1050
leaq -0x240(%rbp), %rdx
movq -0x428(%rdx), %rdi
cmpq $-0x1, 0x140(%rdi)
jne 0x146a
cmpq $0x288, -0x8(%rdi)      # imm = 0x288
jb 0x146a
movq -0x140(%rdi), %rax
testq %rax, %rax
je 0x146a
pushq $0x1
popq %rsi
pushq $0x34
popq %rcx
callq *%rax
jmp 0x1488
xorpd %xmm0, %xmm0
movupd %xmm0, 0x20(%rdx)
movupd %xmm0, 0x10(%rdx)
movupd %xmm0, (%rdx)
andl $0x0, 0x30(%rdx)
pushq $0x1
popq %rsi
callq 0x11d0
testl %eax, %eax
jne 0x1cf8
leaq 0xf00(%rip), %rdi       # 0x2397
callq 0x11b0
leaq -0x120(%rbp), %rbx
movzwl -0xfe(%rbx), %esi
leaq 0xbe9(%rip), %rdi       # 0x209a
xorl %eax, %eax
callq 0x1050
movq -0x548(%rbx), %rdi
pushq $0x1
popq %rsi
pushq $0x2
popq %rdx
movq %rbx, %rcx
callq 0x1110
testl %eax, %eax
jne 0x1d01
leaq 0xbcd(%rip), %rbx       # 0x20a9
pushq $0x3a
popq %r14
xorl %r15d, %r15d
cmpq $0x10, %r15
je 0x150f
movzbl -0x120(%rbp,%r15), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1050
testb $0x1, %r15b
je 0x150a
movl %r14d, %edi
callq 0x1170
incq %r15
jmp 0x14e3
pushq $0xa
popq %rdi
callq 0x1170
leaq -0x208(%rbp), %rsi
movq -0x460(%rsi), %rdi
callq 0x11a0
testl %eax, %eax
jne 0x1d0a
leaq 0xe74(%rip), %rdi       # 0x23ad
callq 0x11b0
movl -0x1a0(%rbp), %esi
leaq 0xb63(%rip), %rdi       # 0x20ae
xorl %eax, %eax
callq 0x1050
movl -0x188(%rbp), %esi
movl -0x184(%rbp), %edx
leaq 0xb5c(%rip), %rdi       # 0x20c1
xorl %eax, %eax
callq 0x1050
movl -0x198(%rbp), %esi
leaq 0xb6a(%rip), %rdi       # 0x20e3
xorl %eax, %eax
callq 0x1050
movl -0x180(%rbp), %eax
movl $0x100000, %ecx         # imm = 0x100000
cltd
idivl %ecx
movq -0x1b8(%rbp), %rdx
shrq $0x1e, %rdx
leaq 0xb58(%rip), %rdi       # 0x20f8
movl %eax, %esi
xorl %eax, %eax
callq 0x1050
leaq 0xe9e(%rip), %rdi       # 0x244e
callq 0x11b0
movq -0x668(%rbp), %rdi
callq 0x1060
movq %rax, -0x660(%rbp)
testq %rax, %rax
je 0x1d13
leaq 0xe85(%rip), %rdi       # 0x245d
callq 0x11b0
movq -0x668(%rbp), %rdi
pushq $0x1
popq %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x10d0
movq %rax, -0x650(%rbp)
testq %rax, %rax
je 0x1d1c
leaq 0xe67(%rip), %rdi       # 0x2471
callq 0x11b0
xorpd %xmm0, %xmm0
leaq -0xf0(%rbp), %r12
movapd %xmm0, 0x30(%r12)
movapd %xmm0, (%r12)
movapd %xmm0, 0x10(%r12)
movabsq $0x100000002, %rax      # imm = 0x100000002
movq %rax, 0x34(%r12)
movq -0x650(%rbp), %rax
movq %rax, 0x8(%r12)
movq %rax, 0x10(%r12)
movapd 0x9ba(%rip), %xmm0      # 0x2010
movapd %xmm0, 0x20(%r12)
leaq 0xabc(%rip), %r13       # 0x2120
leaq 0xad3(%rip), %rbx       # 0x213e
leaq 0xae6(%rip), %r14       # 0x2158
xorl %r15d, %r15d
movslq -0x100(%rbp), %rax
cmpq %rax, %r15
jge 0x16df
movq -0x660(%rbp), %rdi
movq %r12, %rsi
callq 0x1160
movq %rax, -0x648(%rbp,%r15,8)
testq %rax, %rax
je 0x16c1
movq %rbx, %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x1050
movq -0x648(%rbp,%r15,8), %rax
movl 0x34(%rax), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1050
jmp 0x16da
callq 0x1040
movl (%rax), %edi
callq 0x1080
movq %r13, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x1050
incq %r15
jmp 0x1675
leaq 0xdd1(%rip), %rdi       # 0x24b7
callq 0x11b0
movq -0xf8(%rbp), %rbx
movq %rbx, %rdi
callq 0x1030
movq %rax, -0x670(%rbp)
leaq 0xa60(%rip), %rdi       # 0x2168
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1050
movq -0x670(%rbp), %rsi
movq -0x660(%rbp), %rdi
movq -0xf8(%rbp), %rdx
pushq $0x7
popq %rcx
callq 0x10f0
movq %rax, -0x658(%rbp)
testq %rax, %rax
je 0x1d25
leaq 0xd89(%rip), %rdi       # 0x24cf
callq 0x11b0
movq -0x658(%rbp), %rax
movl 0x24(%rax), %esi
movl 0x28(%rax), %edx
leaq 0xa21(%rip), %rdi       # 0x2180
xorl %eax, %eax
callq 0x1050
movq -0x658(%rbp), %rax
movsd 0x18(%rax), %xmm1
unpcklps 0x8a7(%rip), %xmm1      # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
movq 0x10(%rax), %rsi
subpd 0x8ab(%rip), %xmm1      # 0x2030
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x8a7(%rip), %xmm0      # 0x2040
leaq 0x9f9(%rip), %rdi       # 0x2199
movb $0x1, %al
callq 0x1050
leaq 0xb92(%rip), %rdi       # 0x2340
callq 0x11b0
xorpd %xmm0, %xmm0
leaq -0x60(%rbp), %rdx
movapd %xmm0, (%rdx)
movapd %xmm0, 0x10(%rdx)
movapd %xmm0, 0x20(%rdx)
movl $0x1, 0x8(%rdx)
leaq 0x9e5(%rip), %rdi       # 0x21bc
leaq 0x9eb(%rip), %rsi       # 0x21c9
leaq -0x30(%rbp), %rbx
movq %rbx, %rcx
callq 0x1130
pushq $-0x1
popq %r14
leaq -0x120(%rbp), %r12
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x1833
movl 0x4(%rbx), %edi
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
callq 0x1070
cmpl $-0x1, %eax
je 0x182d
movl %eax, %r13d
movq 0x18(%rbx), %rsi
movl 0x10(%rbx), %edx
movl %eax, %edi
callq 0x10e0
testl %eax, %eax
je 0x1838
movl %r13d, %edi
callq 0x11e0
addq $0x28, %rbx
jmp 0x17f5
movl %r14d, %r13d
jmp 0x1850
movl %r13d, -0xfc(%rbp)
leaq 0x988(%rip), %rdi       # 0x21ce
movl %r13d, %esi
xorl %eax, %eax
callq 0x1050
movq -0x30(%rbp), %rdi
callq 0x1140
pushq $0x22
popq %r14
movq %r14, %rdi
callq 0x1150
movq %rax, %rbx
movq %rax, -0x110(%rbp)
movq -0x670(%rbp), %rax
movq %rax, (%rbx)
movq -0x658(%rbp), %rax
movl 0x28(%rax), %eax
movl %eax, 0x8(%rbx)
movq -0x648(%rbp), %rax
movl 0x34(%rax), %eax
movl %eax, 0xc(%rbx)
movzwl -0x21e(%rbp), %eax
movw %ax, 0x10(%rbx)
leaq 0x12(%rbx), %r15
movupd (%r12), %xmm0
movupd %xmm0, 0x12(%rbx)
movl %r13d, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1332
leaq 0x920(%rip), %rdi       # 0x21e2
movq %rax, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x1050
movq (%rbx), %rsi
movl 0x8(%rbx), %edx
leaq 0x91e(%rip), %rdi       # 0x21fa
xorl %eax, %eax
callq 0x1050
movzwl 0x10(%rbx), %esi
movl 0xc(%rbx), %edx
leaq 0x924(%rip), %rdi       # 0x2215
xorl %eax, %eax
callq 0x1050
leaq 0x930(%rip), %rdi       # 0x222f
xorl %eax, %eax
callq 0x1050
leaq 0x79c(%rip), %rbx       # 0x20a9
pushq $0x3a
popq %r14
xorl %r12d, %r12d
cmpq $0x10, %r12
je 0x193c
movzbl (%r15,%r12), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1050
testb $0x1, %r12b
je 0x1937
movl %r14d, %edi
callq 0x1170
incq %r12
jmp 0x1914
leaq 0xa07(%rip), %rdi       # 0x234a
callq 0x11b0
pushq $0x22
popq %rbx
movq %rbx, %rdi
callq 0x1150
movq %rax, %r15
movq %rax, -0x108(%rbp)
movl %r13d, %edi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x12ec
leaq 0x8c8(%rip), %rdi       # 0x223a
movq %rax, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1050
movq (%r15), %rsi
movl 0x8(%r15), %edx
leaq 0x86d(%rip), %rdi       # 0x21fa
xorl %eax, %eax
callq 0x1050
movzwl 0x10(%r15), %esi
movl 0xc(%r15), %edx
leaq 0x871(%rip), %rdi       # 0x2215
xorl %eax, %eax
callq 0x1050
leaq 0x87d(%rip), %rdi       # 0x222f
xorl %eax, %eax
callq 0x1050
movq %r15, %r13
addq $0x12, %r13
leaq 0x6e2(%rip), %rbx       # 0x20a9
pushq $0x3a
popq %r14
xorl %r12d, %r12d
cmpq $0x10, %r12
je 0x19f7
movzbl (%r13,%r12), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1050
testb $0x1, %r12b
je 0x19f2
movl %r14d, %edi
callq 0x1170
incq %r12
jmp 0x19ce
leaq 0x94c(%rip), %rdi       # 0x234a
callq 0x11b0
movq -0x648(%rbp), %rbx
leaq -0xf0(%rbp), %r14
movl $0x90, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x10b0
pushq $0x1
popq %rax
movl %eax, (%r14)
movb $0x1, %al
movb %al, 0x81(%r14)
movl $0x7, 0x20(%r14)
pushq $0x39
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x11c0
leaq 0x805(%rip), %rdi       # 0x2251
movl %eax, %esi
xorl %eax, %eax
callq 0x1050
movq -0x648(%rbp), %rbx
movl 0xc(%r15), %r12d
movzwl 0x10(%r15), %r15d
movl $0x90, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x10b0
pushq $0x2
popq %rax
movl %eax, (%r14)
pushq $0x1
popq %rax
movl %eax, 0x8(%r14)
movl %r12d, 0x1c(%r14)
movw $0x1201, 0x7f(%r14)     # imm = 0x1201
movw %r15w, 0x50(%r14)
movw $0x101, 0x55(%r14)      # imm = 0x101
movdqu (%r13), %xmm0
movdqu %xmm0, 0x38(%r14)
movw $0x102, 0x4c(%r14)      # imm = 0x102
movq %rbx, %rdi
movq %r14, %rsi
movl $0x129181, %edx         # imm = 0x129181
callq 0x11c0
leaq 0x7aa(%rip), %rdi       # 0x226c
movl %eax, %esi
xorl %eax, %eax
callq 0x1050
movq -0x648(%rbp), %r14
leaq -0xf0(%rbp), %rbx
movl $0x90, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10b0
movl $0x3, (%rbx)
movw $0x612, 0x82(%rbx)      # imm = 0x612
movb $0x1, %al
movb %al, 0x7e(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
movl $0x12e01, %edx          # imm = 0x12E01
callq 0x11c0
leaq 0x773(%rip), %rdi       # 0x2286
movl %eax, %esi
xorl %eax, %eax
callq 0x1050
leaq -0x30(%rbp), %r14
andq $0x0, (%r14)
movq -0x670(%rbp), %rax
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0x30(%rax)
movdqu %xmm0, 0x20(%rax)
movdqu %xmm0, 0x10(%rax)
movdqu %xmm0, (%rax)
movq -0x670(%rbp), %rsi
movq -0x658(%rbp), %rax
movq %rsi, -0x60(%rbp)
movl $0x40, -0x58(%rbp)
movl 0x24(%rax), %eax
movl %eax, -0x54(%rbp)
pxor %xmm0, %xmm0
movdqa %xmm0, 0x10(%rbx)
movdqa %xmm0, 0x20(%rbx)
movdqa %xmm0, 0x70(%rbx)
movdqa %xmm0, 0x60(%rbx)
movdqa %xmm0, 0x50(%rbx)
movdqa %xmm0, 0x40(%rbx)
movdqa %xmm0, 0x30(%rbx)
movdqa %xmm0, (%rbx)
leaq -0x60(%rbp), %rax
movq %rax, 0x10(%rbx)
pushq $0x1
popq %rax
movl %eax, 0x18(%rbx)
pushq $0x2
popq %rax
movl %eax, 0x20(%rbx)
movq -0x108(%rbp), %rax
movq (%rax), %rdx
movq %rdx, 0x28(%rbx)
movl 0x8(%rax), %eax
movl %eax, 0x30(%rbx)
leaq 0x6e5(%rip), %rdi       # 0x22a0
xorl %eax, %eax
callq 0x1050
movq -0x648(%rbp), %rdi
movq (%rdi), %rax
leaq -0xf0(%rbp), %rsi
movq %r14, %rdx
callq *0xd0(%rax)
movl %eax, %ebx
testl %eax, %eax
je 0x1bf1
movl %ebx, %edi
callq 0x1080
movq %rax, %rdi
callq 0x11b0
leaq 0x450(%rip), %rdi       # 0x2048
xorl %esi, %esi
movl %ebx, %edx
xorl %eax, %eax
callq 0x1050
movq -0x650(%rbp), %rbx
pushq $0x1
popq %r14
leaq -0xf0(%rbp), %r15
movq (%rbx), %rax
movq %rbx, %rdi
movl %r14d, %esi
movq %r15, %rdx
callq *0x60(%rax)
testl %eax, %eax
js 0x1cd2
movl %eax, %r12d
setne %al
movl -0xe8(%rbp), %edi
testl %edi, %edi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
je 0x1c64
testl %r12d, %r12d
setne %al
testl %edi, %edi
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x1c15
leaq 0x6ef(%rip), %rdi       # 0x234c
callq 0x11b0
jmp 0x1cbe
callq 0x1090
leaq 0x64d(%rip), %rdi       # 0x22bd
movq %rax, %rsi
movl %r12d, %edx
xorl %eax, %eax
callq 0x1050
movq -0xf0(%rbp), %rsi
movl -0xe8(%rbp), %edx
movl -0xe4(%rbp), %ecx
leaq 0x65e(%rip), %rdi       # 0x22f5
xorl %eax, %eax
callq 0x1050
movl -0xdc(%rbp), %esi
movl -0xd4(%rbp), %edx
movl -0xd0(%rbp), %ecx
leaq 0x662(%rip), %rdi       # 0x2319
xorl %eax, %eax
callq 0x1050
xorl %eax, %eax
addq $0x648, %rsp            # imm = 0x648
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x69c(%rip), %rdi       # 0x2375
callq 0x11b0
pushq $0x1
popq %rdi
callq 0x1120
leaq 0x742(%rip), %rdi       # 0x242f
jmp 0x1cd9
leaq 0x71e(%rip), %rdi       # 0x2414
jmp 0x1cd9
leaq 0x6fb(%rip), %rdi       # 0x23fa
jmp 0x1cd9
leaq 0x6d9(%rip), %rdi       # 0x23e1
jmp 0x1cd9
leaq 0x6b4(%rip), %rdi       # 0x23c5
jmp 0x1cd9
leaq 0x785(%rip), %rdi       # 0x249f
jmp 0x1cd9
leaq 0x763(%rip), %rdi       # 0x2486
jmp 0x1cd9
leaq 0x7b5(%rip), %rdi       # 0x24e1
jmp 0x1cd9