LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/Astor-Bizard[P]ProjetS5_Groupe2/src/reimpl_R_ARM.c
// Function: r_arm_abs16
void r_arm_abs16(FILE* oldF, FILE *newF, Elf32_Ehdr oldElfHeader, ListeSymboles symbList, Str_Reloc tableReloc, int index, Elf32_Addr addrDest, unsigned char *sectionARecopier) {
	uint16_t addrSymbole = (255<<8 & tableReloc.Rel[index].r_info)>>8;
	uint16_t addend = (uint16_t) lire_octets(oldElfHeader.e_ident[EI_DATA], oldF, 2);
	uint16_t valeurSymb = (uint16_t) symbList.symboles[addrSymbole].st_value;
	uint16_t res = valeurSymb + addend;
	fwrite16(newF, oldElfHeader.e_ident[EI_DATA], ByteSwap16(res));
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %rsi
movq 0x78(%rsp), %rax
movslq %edx, %rcx
movzbl 0x25(%rsp), %ebp
movzbl 0x5(%rax,%rcx,8), %r14d
movsbl %bpl, %edi
pushq $0x2
popq %rdx
callq 0x188c
movq 0x58(%rsp), %rcx
shll $0x4, %r14d
addl 0x4(%rcx,%r14), %eax
rolw $0x8, %ax
movzwl %ax, %edx
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x396e
// File: /workspace/github_c_makefile_star2_O2/Astor-Bizard[P]ProjetS5_Groupe2/src/reimpl_R_ARM.c
// Function: r_arm_abs8
void r_arm_abs8(FILE* oldF, FILE *newF, Elf32_Ehdr oldElfHeader, ListeSymboles symbList, Str_Reloc tableReloc, int index, Elf32_Addr addrDest, unsigned char *sectionARecopier) {
	uint16_t addrSymbole = (255<<8 & tableReloc.Rel[index].r_info)>>8;
	uint8_t addend = (uint8_t) lire_octets(oldElfHeader.e_ident[EI_DATA], oldF, 1);
	uint8_t valeurSymb = (uint8_t) symbList.symboles[addrSymbole].st_value;
	uint8_t res = valeurSymb + addend;
	fwrite8(newF, oldElfHeader.e_ident[EI_DATA], res);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %rsi
movq 0x78(%rsp), %rax
movslq %edx, %rcx
movzbl 0x25(%rsp), %ebp
movzbl 0x5(%rax,%rcx,8), %r14d
movsbl %bpl, %edi
pushq $0x1
popq %rdx
callq 0x188c
movq 0x58(%rsp), %rcx
shll $0x4, %r14d
addl 0x4(%rcx,%r14), %eax
movzbl %al, %edx
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x3993
// File: /workspace/github_c_makefile_star2_O2/Astor-Bizard[P]ProjetS5_Groupe2/src/ecritureSH.c
// Function: writeSectionsHeadersToFile
void writeSectionsHeadersToFile(FILE *f, Elf32_Ehdr elfHeader, SectionsHeadersList shList) {
	int i;

	fseek(f, elfHeader.e_shoff, 0);
	for(i=0; i<shList.size; i++) {
		fwrite32(f, elfHeader.e_ident[EI_DATA], shList.headers[i].sh_name);
		fwrite32(f, elfHeader.e_ident[EI_DATA], shList.headers[i].sh_type);
		fwrite32(f, elfHeader.e_ident[EI_DATA], shList.headers[i].sh_flags);
		fwrite32(f, elfHeader.e_ident[EI_DATA], shList.headers[i].sh_addr);
		fwrite32(f, elfHeader.e_ident[EI_DATA], shList.headers[i].sh_offset);
		fwrite32(f, elfHeader.e_ident[EI_DATA], shList.headers[i].sh_size);
		fwrite32(f, elfHeader.e_ident[EI_DATA], shList.headers[i].sh_link);
		fwrite32(f, elfHeader.e_ident[EI_DATA], shList.headers[i].sh_info);
		fwrite32(f, elfHeader.e_ident[EI_DATA], shList.headers[i].sh_addralign);
		fwrite32(f, elfHeader.e_ident[EI_DATA], shList.headers[i].sh_entsize);
	}

	printf("%d en-têtes de sections écrites\n", i);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x60(%rsp), %esi
xorl %r15d, %r15d
xorl %edx, %edx
callq 0x1110
movl 0x88(%rsp), %r14d
movzbl 0x45(%rsp), %ebp
movq 0x78(%rsp), %r12
testl %r14d, %r14d
cmovlel %r15d, %r14d
imulq $0x28, %r14, %r13
cmpq %r15, %r13
je 0x4384
movl (%r12,%r15), %edx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x394c
movl 0x4(%r12,%r15), %edx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x394c
movl 0x8(%r12,%r15), %edx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x394c
movl 0xc(%r12,%r15), %edx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x394c
movl 0x10(%r12,%r15), %edx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x394c
movl 0x14(%r12,%r15), %edx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x394c
movl 0x18(%r12,%r15), %edx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x394c
movl 0x1c(%r12,%r15), %edx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x394c
movl 0x20(%r12,%r15), %edx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x394c
movl 0x24(%r12,%r15), %edx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x394c
addq $0x28, %r15
jmp 0x42dd
leaq 0x1f86(%rip), %rdi      # 0x6311
movl %r14d, %esi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1090
// File: /workspace/github_c_makefile_star2_O2/Arlu[P]RDMA-Hello-World/client.c
// Function: chat
void chat()
{
    struct RemoteMR remote_mr = {
            .remote_addr = (uint64_t)ib_res.buf,
            .rkey = ib_res.mr->rkey
    };

    // Send Hello World via send and receive request:
    memcpy(ib_res.buf, MSG_SEND_RECV, sizeof(MSG_SEND_RECV));
    post_send(BUFFER_SIZE);
    wait_completions(SEND_WRID);

    // Send remote address and rkey:
    memcpy(ib_res.buf, &remote_mr, sizeof(struct RemoteMR));
    post_send(sizeof(struct RemoteMR));
    wait_completions(SEND_WRID);

    // Send Hello World via RDMA Read:
    memcpy(ib_res.buf, MSG_READ, sizeof(MSG_READ));
    post_send(1); // Notify the server for read.
    wait_completions(SEND_WRID);

    // Get remote address and rkey:
    post_recv(sizeof(struct RemoteMR));
    wait_completions(RECV_WRID);
    memcpy(&remote_mr, ib_res.buf, sizeof(struct RemoteMR));

    // Send Hello World via RDMA Write:
    memcpy(ib_res.buf, MSG_WRITE, sizeof(MSG_WRITE));
    post_send_write(remote_mr, BUFFER_SIZE);
    wait_completions(WRITE_WRID);

    post_send(1); // Notify the server for continue.
    wait_completions(SEND_WRID);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x2dda(%rip), %r12      # 0x4188
movq 0x10(%r12), %rax
movq 0x60(%r12), %r14
movl 0x28(%rax), %r15d
movups 0xc51(%rip), %xmm0      # 0x2014
movups %xmm0, 0x10(%r14)
movups 0xc35(%rip), %xmm0      # 0x2004
movups %xmm0, (%r14)
movl $0xa2165, 0x1f(%r14)    # imm = 0xA2165
movl $0x400, %edi            # imm = 0x400
callq 0x1cad
pushq $0x2
popq %rbx
movl %ebx, %edi
callq 0x1e48
movq 0x60(%r12), %rax
movq %r14, (%rax)
movl %r15d, 0x8(%rax)
pushq $0x10
popq %r15
movl %r15d, %edi
callq 0x1cad
movl %ebx, %edi
callq 0x1e48
movq 0x60(%r12), %rax
movups 0xc0d(%rip), %xmm0      # 0x2027
movups %xmm0, (%rax)
movups 0xc0f(%rip), %xmm0      # 0x2033
movups %xmm0, 0xc(%rax)
pushq $0x1
popq %r14
movl %r14d, %edi
callq 0x1cad
movl %ebx, %edi
callq 0x1e48
movl %r15d, %edi
callq 0x1c54
movl %r14d, %edi
callq 0x1e48
movq 0x60(%r12), %rax
movq (%rax), %rdi
movl 0x8(%rax), %esi
movups 0xbf3(%rip), %xmm0      # 0x2050
movups %xmm0, 0xd(%rax)
movups 0xbdb(%rip), %xmm0      # 0x2043
movups %xmm0, (%rax)
movl $0x400, %edx            # imm = 0x400
callq 0x1dc3
pushq $0x8
popq %rdi
callq 0x1e48
movl %r14d, %edi
callq 0x1cad
movl %ebx, %edi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1e48
// File: /workspace/github_c_makefile_star2_O2/Arlu[P]RDMA-Hello-World/client.c
// Function: main
int main(int argc, char *argv[])
{
    if (argc < 2)
    {
        printf("It must get hostname!\n");
        exit(EXIT_FAILURE);
    }

    server_name = strdup(argv[1]);

    if (setup_ib())
    {
        perror("Failed to setup IB.");
    }

    chat();

    close_ib_connection();

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x1, %edi
jle 0x14d9
movq 0x8(%rsi), %rdi
callq 0x1270
leaq 0x2cbb(%rip), %rcx      # 0x4168
movq %rax, (%rcx)
xorl %eax, %eax
callq 0x1833
testl %eax, %eax
jne 0x14cb
callq 0x139c
xorl %eax, %eax
callq 0x1bee
xorl %eax, %eax
popq %rbp
retq
leaq 0xb8e(%rip), %rdi       # 0x2060
callq 0x11d0
jmp 0x14bb
leaq 0xb94(%rip), %rdi       # 0x2074
callq 0x1070
pushq $0x1
popq %rdi
callq 0x1200
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/Arlu[P]RDMA-Hello-World/setup_ib.c
// Function: get_server_dest
int get_server_dest()
{
    int sockfd;
    struct addrinfo hints, *result, *rp;

    memset(&hints, 0, sizeof(struct addrinfo));
    hints.ai_family = AF_UNSPEC; // Allow IPv4 or IPv6.
    hints.ai_socktype = SOCK_STREAM; // TCP

    if (getaddrinfo(server_name, PORT_STR, &hints, &result))
    {
        perror("Found address failed!\n");
        return 1;
    }

    // Start connection:
    for (rp = result; rp; rp = rp->ai_next)
    {
        sockfd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol);

        if (sockfd == -1)
            continue;

        if (!connect(sockfd, rp->ai_addr, rp->ai_addrlen))
            break; // Success.

        close(sockfd);
    }

    if (!rp)
    {
        perror("Connection with the server failed.\n");
        return 1;
    }

    freeaddrinfo(result);

    // Get server details:
    {
        char *buf;
        buf = (char *)malloc(sizeof(struct IBDest));
        int offset = 0;

        // Send my details:
        memcpy(buf, &local_dest, sizeof(struct IBDest));
        write(sockfd, buf, sizeof(struct IBDest));

        // Get him details:
        memset(buf, 0, sizeof(struct IBDest));
        offset = 0;

        while (offset < sizeof(struct IBDest))
            offset += read(sockfd, buf + offset, sizeof(struct IBDest) - offset);

        memcpy(&remote_dest, buf, sizeof(struct IBDest));
    }

    // Finish connection:
    close(sockfd);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
xorps %xmm0, %xmm0
leaq -0x60(%rbp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, 0x20(%rdx)
movl $0x1, 0x8(%rdx)
movq 0x2c49(%rip), %rdi      # 0x4168
leaq 0xb7a(%rip), %rsi       # 0x20a0
leaq -0x28(%rbp), %r14
movq %r14, %rcx
callq 0x1260
testl %eax, %eax
jne 0x1614
movq (%r14), %r14
testq %r14, %r14
je 0x160b
movl 0x4(%r14), %edi
movl 0x8(%r14), %esi
movl 0xc(%r14), %edx
callq 0x1290
cmpl $-0x1, %eax
je 0x1578
movl %eax, %ebx
movq 0x18(%r14), %rsi
movl 0x10(%r14), %edx
movl %eax, %edi
callq 0x1210
testl %eax, %eax
je 0x157e
movl %ebx, %edi
callq 0x10f0
addq $0x28, %r14
jmp 0x153a
movq -0x28(%rbp), %rdi
callq 0x1280
pushq $0xc
popq %r14
movq %r14, %rdi
callq 0x1160
movq %rax, %r15
movq 0x2bd3(%rip), %rax      # 0x4170
movq %rax, (%r15)
movl 0x2bd2(%rip), %eax      # 0x4178
movl %eax, 0x8(%r15)
movl %ebx, %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1080
andq $0x0, (%r15)
andl $0x0, 0x8(%r15)
xorl %eax, %eax
movslq %eax, %r12
cmpq $0xb, %r12
ja 0x15e1
leaq (%r15,%r12), %rsi
movq %r14, %rdx
subq %r12, %rdx
movl %ebx, %edi
callq 0x1110
addq %r12, %rax
jmp 0x15c2
movl 0x8(%r15), %eax
movl %eax, 0x2b99(%rip)      # 0x4184
movq (%r15), %rax
movq %rax, 0x2b87(%rip)      # 0x417c
movl %ebx, %edi
callq 0x10f0
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xaaa(%rip), %rdi       # 0x20bc
jmp 0x161b
leaq 0xa8a(%rip), %rdi       # 0x20a5
callq 0x11d0
pushq $0x1
popq %rax
jmp 0x15fe
// File: /workspace/github_c_makefile_star2_O2/Arlu[P]RDMA-Hello-World/setup_ib.c
// Function: connect_between_qps
int connect_between_qps()
{
    struct ibv_qp_attr qp_attr = {
            .qp_state		= IBV_QPS_RTR,
            .path_mtu		= MTU,
            .dest_qp_num	= remote_dest.qpn,
            .rq_psn			= remote_dest.psn,
            .max_dest_rd_atomic	= 1,
            .min_rnr_timer		= 12,
            .ah_attr		= {
                    .is_global	= 0,
                    .dlid		= remote_dest.lid,
                    .sl		= 0,
                    .src_path_bits	= 0,
                    .port_num	= IB_PORT
            }
    };

    if (ibv_modify_qp(ib_res.qp, &qp_attr, IBV_QP_STATE | IBV_QP_PATH_MTU | IBV_QP_DEST_QPN | IBV_QP_RQ_PSN |
                                           IBV_QP_MAX_DEST_RD_ATOMIC | IBV_QP_MIN_RNR_TIMER | IBV_QP_AV)) {
        perror("Failed to modify QP to RTR.\n");
        return 1;
    }

    qp_attr.qp_state	    = IBV_QPS_RTS;
    qp_attr.timeout	    = 14;
    qp_attr.retry_cnt	    = 7;
    qp_attr.rnr_retry	    = 7;
    qp_attr.sq_psn	        = local_dest.psn;
    qp_attr.max_rd_atomic  = 1;
    if (ibv_modify_qp(ib_res.qp, &qp_attr, IBV_QP_STATE | IBV_QP_TIMEOUT | IBV_QP_RETRY_CNT |
                                           IBV_QP_RNR_RETRY | IBV_QP_SQ_PSN | IBV_QP_MAX_QP_RD_ATOMIC))
    {
        perror("Failed to modify QP to RTS.\n");
        return 1;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x90, %rsp
leaq -0xa0(%rbp), %r14
xorl %ebx, %ebx
movl $0x90, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x10e0
movl $0x2, (%r14)
movl $0x5, 0x8(%r14)
movl 0x29f6(%rip), %eax      # 0x4184
movl %eax, 0x14(%r14)
movl 0x29e8(%rip), %eax      # 0x4180
movl %eax, 0x1c(%r14)
movzwl 0x29d9(%rip), %eax      # 0x417c
movw %ax, 0x50(%r14)
movb $0x1, 0x56(%r14)
movw $0xc01, 0x7f(%r14)      # imm = 0xC01
movq 0x29ed(%rip), %rdi      # 0x41a8
movq %r14, %rsi
movl $0x129181, %edx         # imm = 0x129181
callq 0x1050
testl %eax, %eax
jne 0x1819
leaq -0xa0(%rbp), %rsi
movl $0x3, (%rsi)
movw $0x70e, 0x82(%rsi)      # imm = 0x70E
movb $0x7, 0x84(%rsi)
movl 0x2989(%rip), %eax      # 0x4178
movl %eax, 0x18(%rsi)
movb $0x1, 0x7e(%rsi)
movq 0x29ab(%rip), %rdi      # 0x41a8
movl $0x12e01, %edx          # imm = 0x12E01
callq 0x1050
testl %eax, %eax
jne 0x1822
movl %ebx, %eax
addq $0x90, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x917(%rip), %rdi       # 0x2137
jmp 0x1829
leaq 0x92b(%rip), %rdi       # 0x2154
callq 0x11d0
pushq $0x1
popq %rbx
jmp 0x180b
// File: /workspace/github_c_makefile_star2_O2/Arlu[P]RDMA-Hello-World/helper.c
// Function: post_recv
int post_recv(int size)
{
    struct ibv_sge list = {
            .addr	= (uint64_t)ib_res.buf,
            .length = size,
            .lkey	= ib_res.mr->lkey
    };

    struct ibv_recv_wr *bad_wr, wr = {
            .wr_id	    = RECV_WRID,
            .sg_list    = &list,
            .num_sge    = 1,
            .next       = NULL
    };

    ibv_post_recv(ib_res.qp, &wr, &bad_wr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
leaq 0x2525(%rip), %rax      # 0x4188
movq 0x60(%rax), %rcx
leaq -0x18(%rbp), %rdx
movq %rcx, (%rdx)
movl %edi, 0x8(%rdx)
movq 0x10(%rax), %rcx
movq 0x20(%rax), %rdi
movl 0x24(%rcx), %eax
leaq -0x38(%rbp), %rsi
movq $0x1, (%rsi)
andq $0x0, 0x8(%rsi)
movl %eax, 0xc(%rdx)
movq %rdx, 0x10(%rsi)
movl $0x1, 0x18(%rsi)
movq (%rdi), %rax
leaq -0x8(%rbp), %rdx
callq *0xd8(%rax)
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Arlu[P]RDMA-Hello-World/helper.c
// Function: post_send
int post_send(int size)
{
    struct ibv_sge list = {
            .addr	= (uint64_t)ib_res.buf,
            .length = size,
            .lkey	= ib_res.mr->lkey
    };

    struct ibv_send_wr *bad_wr, wr = {
            .wr_id	    = SEND_WRID,
            .sg_list    = &list,
            .num_sge    = 1,
            .opcode     = IBV_WR_SEND,
            .send_flags = IBV_SEND_SIGNALED,
            .next       = NULL
    };

    return ibv_post_send(ib_res.qp, &wr, &bad_wr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
leaq 0x24c9(%rip), %rax      # 0x4188
movq 0x10(%rax), %rcx
movq 0x60(%rax), %rdx
leaq -0x18(%rbp), %r8
movq %rdx, (%r8)
movl %edi, 0x8(%r8)
movl 0x24(%rcx), %ecx
movl %ecx, 0xc(%r8)
xorps %xmm0, %xmm0
leaq -0x98(%rbp), %rsi
movups %xmm0, 0x8(%rsi)
movups %xmm0, 0x18(%rsi)
movups %xmm0, 0x68(%rsi)
movups %xmm0, 0x58(%rsi)
movups %xmm0, 0x48(%rsi)
movups %xmm0, 0x38(%rsi)
andq $0x0, 0x78(%rsi)
movups %xmm0, 0x28(%rsi)
movq $0x2, (%rsi)
movq %r8, 0x10(%rsi)
movabsq $0x200000001, %rcx      # imm = 0x200000001
movq %rcx, 0x18(%rsi)
movl $0x2, 0x20(%rsi)
movq 0x20(%rax), %rdi
movq (%rdi), %rax
leaq -0x8(%rbp), %rdx
callq *0xd0(%rax)
addq $0xa0, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Arlu[P]RDMA-Hello-World/helper.c
// Function: post_send_read
int post_send_read(struct RemoteMR remote_mr, int size)
{
    struct ibv_sge list = {
            .addr	= (uint64_t)ib_res.buf,
            .length = size,
            .lkey	= ib_res.mr->lkey
    };

    struct ibv_send_wr *bad_wr, wr = {
            .wr_id	    = READ_WRID,
            .sg_list    = &list,
            .num_sge    = 1,
            .opcode     = IBV_WR_RDMA_READ,
            .send_flags = IBV_SEND_SIGNALED,
            .wr.rdma.remote_addr = remote_mr.remote_addr,
            .wr.rdma.rkey = remote_mr.rkey,
            .next       = NULL
    };

    ibv_post_send(ib_res.qp, &wr, &bad_wr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
leaq 0x2438(%rip), %rcx      # 0x4188
movq 0x10(%rcx), %rax
movq 0x60(%rcx), %r8
leaq -0x18(%rbp), %r9
movq %r8, (%r9)
movl %edx, 0x8(%r9)
movl 0x24(%rax), %edx
leaq -0x98(%rbp), %rax
movq $0x4, (%rax)
andq $0x0, 0x8(%rax)
movq %r9, 0x10(%rax)
movaps 0x5ac(%rip), %xmm0      # 0x2330
movups %xmm0, 0x18(%rax)
movq %rdi, 0x28(%rax)
movl %esi, 0x30(%rax)
andl $0x0, 0x48(%rax)
movl %edx, 0xc(%r9)
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%rax)
movups %xmm0, 0x60(%rax)
movups %xmm0, 0x70(%rax)
movq 0x20(%rcx), %rdi
movq (%rdi), %rcx
leaq -0x8(%rbp), %rdx
movq %rax, %rsi
callq *0xd0(%rcx)
addq $0xa0, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Arlu[P]RDMA-Hello-World/helper.c
// Function: post_send_write
int post_send_write(struct RemoteMR remote_mr, int size)
{
    struct ibv_sge list = {
            .addr	= (uint64_t)ib_res.buf,
            .length = size,
            .lkey	= ib_res.mr->lkey
    };

    struct ibv_send_wr *bad_wr, wr = {
            .wr_id	    = WRITE_WRID,
            .sg_list    = &list,
            .num_sge    = 1,
            .opcode     = IBV_WR_RDMA_WRITE,
            .send_flags = IBV_SEND_SIGNALED,
            .wr.rdma.remote_addr = remote_mr.remote_addr,
            .wr.rdma.rkey = remote_mr.rkey,
            .next       = NULL
    };

    ibv_post_send(ib_res.qp, &wr, &bad_wr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
leaq 0x23b3(%rip), %rcx      # 0x4188
movq 0x10(%rcx), %rax
movq 0x60(%rcx), %r8
leaq -0x18(%rbp), %r9
movq %r8, (%r9)
movl %edx, 0x8(%r9)
movl 0x24(%rax), %edx
leaq -0x98(%rbp), %rax
movq $0x8, (%rax)
andq $0x0, 0x8(%rax)
movq %r9, 0x10(%rax)
movaps 0x537(%rip), %xmm0      # 0x2340
movups %xmm0, 0x18(%rax)
movq %rdi, 0x28(%rax)
movl %esi, 0x30(%rax)
andl $0x0, 0x48(%rax)
movl %edx, 0xc(%r9)
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%rax)
movups %xmm0, 0x60(%rax)
movups %xmm0, 0x70(%rax)
movq 0x20(%rcx), %rdi
movq (%rdi), %rcx
leaq -0x8(%rbp), %rdx
movq %rax, %rsi
callq *0xd0(%rcx)
addq $0xa0, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Arlu[P]RDMA-Hello-World/helper.c
// Function: wait_completions
int wait_completions(int wr_id)
{
    int finished = 0, count = 1;

    while (finished < count)
    {
        struct ibv_wc wc[WC_BATCH];
        int n;
        do {
            n = ibv_poll_cq(ib_res.cq, WC_BATCH, wc);

            if (n < 0)
            {
                fprintf(stderr, "Poll CQ failed %d\n", n);
                return 1;
            }
        } while (n < 1);

        for (int i = 0; i < n; i++)
        {
            if (wc[i].status != IBV_WC_SUCCESS)
            {
                fprintf(stderr, "Failed status %s (%d) for wr_id %d\n",
                        ibv_wc_status_str(wc[i].status), wc[i].status, (int)wc[i].wr_id);
                return 1;
            }

            if (wc[i].wr_id == wr_id)
                finished++;
        }
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x12c8, %rsp           # imm = 0x12C8
movslq %edi, %r12
leaq 0x2322(%rip), %r13      # 0x4188
pushq $0x64
popq %r14
leaq -0x12f0(%rbp), %r15
xorl %ebx, %ebx
testl %ebx, %ebx
jg 0x1f1c
movq 0x18(%r13), %rdi
movq (%rdi), %rax
movl %r14d, %esi
movq %r15, %rdx
callq *0x60(%rax)
testl %eax, %eax
js 0x1ec8
je 0x1e7b
movq %r13, %rdx
movl %eax, %eax
imulq $0x30, %rax, %rax
xorl %r13d, %r13d
cmpq %r13, %rax
je 0x1ec3
movl -0x12e8(%rbp,%r13), %edi
testl %edi, %edi
jne 0x1ee4
xorl %ecx, %ecx
cmpq %r12, -0x12f0(%rbp,%r13)
sete %cl
addl %ecx, %ebx
addq $0x30, %r13
jmp 0x1e9d
movq %rdx, %r13
jmp 0x1e73
movq 0x2129(%rip), %rcx      # 0x3ff8
movq (%rcx), %rdi
leaq 0x477(%rip), %rsi       # 0x2350
movl %eax, %edx
xorl %eax, %eax
callq 0x1120
jmp 0x1f17
movq 0x210d(%rip), %rax      # 0x3ff8
movq (%rax), %rbx
callq 0x1190
movl -0x12f0(%rbp,%r13), %r8d
movl -0x12e8(%rbp,%r13), %ecx
leaq 0x459(%rip), %rsi       # 0x2363
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1120
pushq $0x1
popq %rax
jmp 0x1f1e
xorl %eax, %eax
addq $0x12c8, %rsp           # imm = 0x12C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/0xADE1A1DE[P]MeasureSuite/bin/arg_parse.c
// Function: parse
int parse(struct opts *dest, int argc, char *argv[]) {
  *dest = default_opts;

  while (1) {
    int this_option_optind = optind ? optind : 1;
    int option_index = 0;

    int option =
        getopt_long(argc, argv, "w:i:o:n:b:cs:", long_options, &option_index);
    if (option == -1)
      break;

    switch (option) {
    case 'c':
      dest->check = 1;
      break;
    case 'w':
      PARSE(dest->arg_width)
      break;
    case 'i':
      PARSE(dest->arg_num_in);
      break;
    case 'o':
      PARSE(dest->arg_num_out);
      break;
    case 'n':
      PARSE(dest->num_batches);
      break;
    case 'b':
      PARSE(dest->batch_size);
      break;
    case 's':
      DEBUG("reading symbol now %s\n", optarg);
      if (optarg == NULL)
        break;
      dest->sym = calloc(strlen(optarg), sizeof(char));
      if (dest->sym == NULL) {
        break;
      }
      strncpy(dest->sym, optarg, strlen(optarg));
      DEBUG("symbol %s\n", optarg);
      break;

    case '?':
      break;

    default:
      printf("?? getopt returned character code 0%o ??\n", option);
    }
  }

  return optind;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movups 0x2caa(%rip), %xmm0     # 0x5040
movups %xmm0, 0x10(%rdi)
movups 0x2c8f(%rip), %xmm0     # 0x5030
movups %xmm0, (%rdi)
leaq 0x2c59(%rip), %r13      # 0x5004
andl $0x0, 0x4(%rsp)
movl %ebp, %edi
movq %rbx, %rsi
leaq 0x2c94(%rip), %rdx      # 0x5050
leaq 0x66fd(%rip), %rcx      # 0x8ac0
leaq 0x4(%rsp), %r8
callq 0x20c0
leal -0x6e(%rax), %ecx
cmpl $0x9, %ecx
jbe 0x23ff
cmpl $0x3f, %eax
je 0x23ab
cmpl $0x62, %eax
je 0x24d7
cmpl $0x63, %eax
je 0x24ca
cmpl $0x69, %eax
je 0x24f8
cmpl $-0x1, %eax
jne 0x2423
jmp 0x2519
movslq (%r13,%rcx,4), %rcx
addq %r13, %rcx
jmpq *%rcx
movq 0x6bc8(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
testq %rdi, %rdi
je 0x23ab
callq 0x2240
movl %eax, 0xc(%r14)
jmp 0x23ab
leaq 0x2c34(%rip), %rdi      # 0x505e
movl %eax, %esi
xorl %eax, %eax
callq 0x20d0
jmp 0x23ab
movq 0x6b99(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
testq %rdi, %rdi
je 0x23ab
callq 0x2240
movl %eax, 0x8(%r14)
jmp 0x23ab
movq 0x6b78(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
testq %rdi, %rdi
je 0x23ab
callq 0x2240
movl %eax, (%r14)
jmp 0x23ab
movq 0x6b58(%rip), %rax      # 0x8fd8
movq (%rax), %r15
testq %r15, %r15
je 0x23ab
movq %r15, %rdi
callq 0x20a0
movq %rax, %rdi
pushq $0x1
popq %rsi
callq 0x2160
movq %rax, 0x18(%r14)
testq %rax, %rax
je 0x23ab
movq %rax, %r12
movq %r15, %rdi
callq 0x20a0
movq %r12, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x2070
jmp 0x23ab
movl $0x1, 0x14(%r14)
jmp 0x23ab
movq 0x6afa(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
testq %rdi, %rdi
je 0x23ab
callq 0x2240
movl %eax, 0x10(%r14)
jmp 0x23ab
movq 0x6ad9(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
testq %rdi, %rdi
je 0x23ab
callq 0x2240
movl %eax, 0x4(%r14)
jmp 0x23ab
movq 0x6ab0(%rip), %rax      # 0x8fd0
movl (%rax), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/0xADE1A1DE[P]MeasureSuite/lib/src/measuresuite.c
// Function: ms_initialize
int ms_initialize(measuresuite_t *dest_ms, int arg_width, int num_arg_in,
                  int num_arg_out) {

  measuresuite_t ms = create_default_ms();
  *dest_ms = ms;

  if (ms == NULL                     // alloc ok?
      || set_argwidth(ms, arg_width) // set arg width
      || set_argin(ms, num_arg_in)   // set arg in
      || set_argout(ms, num_arg_out) // set arg out
      || validate_num_args(ms)       // validate arg counts
      || init_random(ms)             // initialize randomness structures
      || init_json(ms)               // initialize measure structs
      || init_timer(ms)              // initialize timer structures
  ) {
    return 1;
  }

  ms->errorno = E_SUCCESS;
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebp
movl %edx, %r15d
movl %esi, %r12d
movq %rdi, %rbx
xorl %eax, %eax
callq 0x2d6a
movq %rax, (%rbx)
pushq $0x1
popq %rbx
testq %rax, %rax
je 0x28aa
movq %rax, %r14
movq %rax, %rdi
movl %r12d, %esi
callq 0x2cf4
testl %eax, %eax
jne 0x28aa
movq %r14, %rdi
movl %r15d, %esi
callq 0x2d0e
testl %eax, %eax
jne 0x28aa
movq %r14, %rdi
movl %ebp, %esi
callq 0x2d2d
testl %eax, %eax
jne 0x28aa
movq %r14, %rdi
callq 0x2d4c
testl %eax, %eax
jne 0x28aa
movq %r14, %rdi
callq 0x2af4
testl %eax, %eax
jne 0x28aa
movq %r14, %rdi
callq 0x30a7
testl %eax, %eax
jne 0x28aa
movq %r14, %rdi
callq 0x3132
testl %eax, %eax
jne 0x28aa
andl $0x0, 0x88(%r14)
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/0xADE1A1DE[P]MeasureSuite/lib/src/measuresuite.c
// Function: ms_unload_all
int ms_unload_all(measuresuite_t ms) {
  for (size_t i = ms->num_functions; i > 0; i--) {
    if (ms_unload_last(ms)) {
      return 1;
    }
  }
  ms->errorno = E_SUCCESS;
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movq 0x80(%rdi), %r15
incq %r15
pushq $0x1
popq %rbx
decq %r15
je 0x2902
movq %r14, %rdi
callq 0x2914
testl %eax, %eax
je 0x28ef
jmp 0x290c
andl $0x0, 0x88(%r14)
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/0xADE1A1DE[P]MeasureSuite/lib/src/measuresuite.c
// Function: ms_unload_last
int ms_unload_last(measuresuite_t ms) {
  if (ms->num_functions == 0) {
    ms->errorno = E_INTERNAL_FUNCTIONS__NOTHING_TO_UNLOAD;
    return 1;
  }

  if (unload(ms, ms->num_functions - 1)) {
    return 1;
  }

  ms->errorno = E_SUCCESS;
  return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x80(%rdi), %rsi
testq %rsi, %rsi
je 0x2938
decq %rsi
movq %rbx, %rdi
callq 0x362c
testl %eax, %eax
je 0x2940
pushq $0x1
popq %rax
jmp 0x294a
pushq $0x1
popq %rax
pushq $0x18
popq %rcx
jmp 0x2944
xorl %ecx, %ecx
xorl %eax, %eax
movl %ecx, 0x88(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/0xADE1A1DE[P]MeasureSuite/lib/src/measuresuite.c
// Function: ms_measure
int ms_measure(measuresuite_t ms, int batch_size, int num_batches) {

  if (set_num_batches(ms, num_batches)  // set number of batches
      || set_batch_size(ms, batch_size) // set batch size
      || run_measurement(ms)            // measure
  ) {
    return 1;
  }

  ms->errorno = E_SUCCESS;
  return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
movl %edx, %esi
callq 0x2e4e
pushq $0x1
popq %rbx
testl %eax, %eax
jne 0x2987
movq %r14, %rdi
movl %ebp, %esi
callq 0x2e69
testl %eax, %eax
jne 0x2987
movq %r14, %rdi
callq 0x33d0
testl %eax, %eax
jne 0x2987
andl $0x0, 0x88(%r14)
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/0xADE1A1DE[P]MeasureSuite/lib/src/measuresuite.c
// Function: ms_terminate
int ms_terminate(measuresuite_t ms) {
  if (ms == NULL) {
    return 0;
  }
  if (ms_unload_all(ms) // unload all the loaded functions
      || end_random(ms) // free random data spot
      || end_timer(ms)  // free all timer related data
  ) {
    return 1;
  }

  free(ms->json);
  free(ms->functions);
  free(ms->bounds);
  free(ms);
  return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
xorl %ebp, %ebp
testq %rdi, %rdi
je 0x2a30
movq %rdi, %rbx
callq 0x28da
pushq $0x1
popq %rbp
testl %eax, %eax
jne 0x2a30
movq %rbx, %rdi
callq 0x2c1d
testl %eax, %eax
jne 0x2a30
movq %rbx, %rdi
callq 0x32a2
testl %eax, %eax
jne 0x2a30
movq 0x38(%rbx), %rdi
callq 0x2040
movq 0x70(%rbx), %rdi
callq 0x2040
movq 0x18(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/0xADE1A1DE[P]MeasureSuite/lib/src/randomizer.c
// Function: init_random
int init_random(struct measuresuite *ms) {

  size_t count_uint64s = ms->arg_width * ms->num_arg_in;
  // for the measurement / get_one_random_qword
  ms->random_data_len = count_uint64s + 1;

  // sanity check size
  const size_t size_of_random_bin = 102400;
  if (ms->random_data_len > size_of_random_bin) {
    ms->errorno = E_INVALID_INPUT__IN_TOO_LARGE;
    return 1;
  }

  ms->random_data_fd = -1;
  ms->random_data_fd = open(randomfile_name, O_RDONLY);

  if (ms->random_data_fd == -1) {
    ms->errorno = E_INTERNAL_RANDOMNESS__AI__OPEN_FILE;
    ms->additional_info = strerror(errno);
    return 1;
  }

  // allocate data
  ms->random_data = malloc(ms->random_data_len * sizeof(uint64_t));
  if (ms->random_data == NULL) {
    ms->errorno = E_INTERNAL_RANDOMNESS__AI__MALLOC;
    ms->additional_info = strerror(errno);
    return 1;
  }

  // fill
  if (randomize(ms)) {
    return 1;
  }
  return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
imulq (%rdi), %rax
incq %rax
movq %rax, 0x50(%rdi)
cmpq $0x19001, %rax          # imm = 0x19001
jb 0x2b1b
movl $0x9, 0x88(%rbx)
jmp 0x2b7f
orl $-0x1, 0x58(%rbx)
leaq 0x2b65(%rip), %rdi      # 0x568b
xorl %esi, %esi
xorl %eax, %eax
callq 0x21f0
movl %eax, 0x58(%rbx)
cmpl $-0x1, %eax
je 0x2b56
movq 0x50(%rbx), %rdi
shlq $0x3, %rdi
callq 0x21c0
movq %rax, 0x48(%rbx)
testq %rax, %rax
je 0x2b62
movq %rbx, %rdi
popq %rbx
jmp 0x2b84
movl $0xd, 0x88(%rbx)
jmp 0x2b6c
movl $0xc, 0x88(%rbx)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq %rax, 0x90(%rbx)
pushq $0x1
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/0xADE1A1DE[P]MeasureSuite/lib/src/randomizer.c
// Function: randomize
int randomize(struct measuresuite *ms) {
  if (ms->random_data_fd == -1) {
    ms->errorno = E_INTERNAL_RANDOMNESS__UNINITIALIZED;
    return 1;
  }

  size_t len = ms->random_data_len * sizeof(uint64_t);
  size_t bytes_read = read(ms->random_data_fd, ms->random_data, len);
  if (len != bytes_read) {
    // don't care if its EOF (bytes_read == 0) or fail (bytes_read == -1)
    ms->errorno = E_INTERNAL_RANDOMNESS__AI__READ;
    ms->additional_info = strerror(errno);
    return 1;
  }

  if (ms->bounds != NULL) {
    // only set the bound for the data required. otherwise, It will overwrite
    // data somewhere...
    for (size_t i_na = 0; i_na < ms->num_arg_in; i_na++) {
      for (size_t i_w = 0; i_w < ms->arg_width; i_w++) {
        uint64_t *data = ms->random_data + (i_na * ms->arg_width) + i_w;
        *data &= ms->bounds[i_w];
      }
    }
  }
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x58(%rdi), %edi
cmpl $-0x1, %edi
je 0x2be9
movq 0x48(%rbx), %rsi
movq 0x50(%rbx), %r14
shlq $0x3, %r14
movq %r14, %rdx
callq 0x2150
cmpq %rax, %r14
jne 0x2bf5
movq 0x18(%rbx), %rcx
xorl %eax, %eax
testq %rcx, %rcx
je 0x2c15
xorl %edx, %edx
xorl %esi, %esi
cmpq 0x8(%rbx), %rsi
jae 0x2c15
xorl %edi, %edi
movq (%rbx), %r8
cmpq %r8, %rdi
jae 0x2be0
imulq %rdx, %r8
addq 0x48(%rbx), %r8
movq (%rcx,%rdi,8), %r9
andq %r9, (%r8,%rdi,8)
incq %rdi
jmp 0x2bc3
incq %rsi
addq $0x8, %rdx
jmp 0x2bbb
movl $0x10, 0x88(%rbx)
jmp 0x2c12
movl $0xe, 0x88(%rbx)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq %rax, 0x90(%rbx)
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/0xADE1A1DE[P]MeasureSuite/lib/src/randomizer.c
// Function: end_random
int end_random(struct measuresuite *ms) {
  // free field
  free(ms->random_data);
  ms->random_data = NULL;

  // sanity check
  if (ms->random_data_fd != -1) {
    if (close(ms->random_data_fd)) {
      ms->errorno = E_INTERNAL_RANDOMNESS__AI__CLOSE_FILE;
      ms->additional_info = strerror(errno);
      return 1;
    }
  }
  ms->random_data_fd = -1;
  ms->random_data_len = 0;
  return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x48(%rdi), %rdi
callq 0x2040
andq $0x0, 0x48(%rbx)
movl 0x58(%rbx), %edi
cmpl $-0x1, %edi
je 0x2c62
callq 0x2140
testl %eax, %eax
je 0x2c62
movl $0xf, 0x88(%rbx)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq %rax, 0x90(%rbx)
pushq $0x1
popq %rax
jmp 0x2c6d
orl $-0x1, 0x58(%rbx)
andq $0x0, 0x50(%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/0xADE1A1DE[P]MeasureSuite/lib/src/randomizer.c
// Function: get_random_qword
int get_random_qword(struct measuresuite *ms, uint64_t *dest) {
  if (ms->random_data == NULL ||
      ms->random_data_len < 1 // because it would be more than 0 if it would
                              // have been initialized correctly
  ) {
    ms->errorno = E_INTERNAL_RANDOMNESS__UNINITIALIZED;
    return 1;
  }

  *dest = ms->random_data[ms->random_data_len - 1];
  return 0;
}

// Assembly:
movq 0x48(%rdi), %rax
testq %rax, %rax
je 0x2c8c
movq 0x50(%rdi), %rcx
testq %rcx, %rcx
je 0x2c8c
movq -0x8(%rax,%rcx,8), %rax
movq %rax, (%rsi)
xorl %eax, %eax
retq
movl $0x10, 0x88(%rdi)
pushq $0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/0xADE1A1DE[P]MeasureSuite/lib/src/randomizer.c
// Function: get_random_number
int get_random_number(struct measuresuite *ms, size_t max, size_t *dest) {

  // calc mask
  size_t mask = 1;
  do {
    mask = ~(~mask << 1); // shift left 1, will w/1's
  } while (mask < max);

  do {
    if (get_random_qword(ms, dest)) {
      return 1;
    }
    *dest &= mask;
    if (*dest <= max) {
      break;
    }
    randomize(ms);
  } while (1);

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
pushq $-0x2
popq %rax
addq %rax, %rax
movq %rax, %r12
notq %r12
cmpq %r14, %r12
jb 0x2cae
pushq $0x1
popq %rbp
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2c6f
testl %eax, %eax
jne 0x2ce8
movq (%rbx), %rax
andq %r12, %rax
movq %rax, (%rbx)
cmpq %r14, %rax
jbe 0x2ce6
movq %r15, %rdi
callq 0x2b84
jmp 0x2cbf
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/0xADE1A1DE[P]MeasureSuite/lib/src/struct_helpers.c
// Function: set_bounds
int set_bounds(measuresuite_t ms, const uint64_t *bounds) {

  if (bounds == NULL) {
    ms->errorno = E_INVALID_INPUT__BOUNDS_NULL;
    return 1;
  }
  if (ms->arg_width <= 0) {
    ms->errorno = E_INVALID_INPUT__ARG_WIDTH;
    return 1;
  }

  ms->bounds = calloc(ms->arg_width, sizeof(uint64_t));
  if (ms->bounds == NULL) {
    ms->errorno = E_INTERNAL_INITIALIZE__ALLOC;
    return 1;
  }
  memcpy(ms->bounds, bounds, ms->arg_width * sizeof(uint64_t));
  // could tests access here, but if its not an proper array, then the
  // measure-call will SIGSEGV
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
testq %rsi, %rsi
je 0x2e20
movq (%r14), %r15
testq %r15, %r15
je 0x2e2d
movq %rsi, %rbx
pushq $0x8
popq %rsi
movq %r15, %rdi
callq 0x2160
movq %rax, 0x18(%r14)
testq %rax, %rax
je 0x2e3a
shlq $0x3, %r15
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x21b0
xorl %eax, %eax
jmp 0x2e48
movl $0x2, 0x88(%r14)
jmp 0x2e45
movl $0x1, 0x88(%r14)
jmp 0x2e45
movl $0x17, 0x88(%r14)
pushq $0x1
popq %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/0xADE1A1DE[P]MeasureSuite/lib/src/alloc_helper.c
// Function: realloc_or_fail
int realloc_or_fail(struct measuresuite *ms, void **dest, size_t new_len) {

  DEBUG("Reallocing to new length of %lu bytes\n", new_len);

  *dest = realloc(*dest, new_len);

  if (*dest == NULL) {
    ms->errorno = E_INTERNAL_MEASURE__AI__ALLOC;
    ms->additional_info = strerror(errno);
    return 1;
  }

  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rdi
movq %rdx, %rsi
callq 0x21d0
movq %rax, %rcx
movq %rax, (%r14)
xorl %eax, %eax
testq %rcx, %rcx
jne 0x2ec6
movl $0x16, 0x88(%rbx)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq %rax, 0x90(%rbx)
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/0xADE1A1DE[P]MeasureSuite/lib/src/alloc_helper.c
// Function: map_rwx
int map_rwx(struct measuresuite *ms, void **dest, size_t new_len) {
  int fd_zero = open("/dev/zero", O_RDWR);
  if (fd_zero == -1) {
    ms->errorno = E_INTERNAL_MEASURE__AI__ALLOC;
    ms->additional_info = strerror(errno);
    return 1;
  }

  *dest = mmap(NULL, new_len, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE,
               fd_zero, 0);
  // NOLINTNEXTLINE
  if (*dest == MAP_FAILED) {
    ms->errorno = E_INTERNAL_MEASURE__AI__ALLOC;
    ms->additional_info = strerror(errno);
    return 1;
  }

  if (close(fd_zero) == -1) { /*No longer needed*/
    ms->errorno = E_INTERNAL_MEASURE__AI__ALLOC;
    ms->additional_info = strerror(errno);
    return 1;
  }

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x27ba(%rip), %rdi      # 0x56a0
pushq $0x2
popq %rsi
xorl %eax, %eax
callq 0x21f0
cmpl $-0x1, %eax
je 0x2f25
movl %eax, %ebp
xorl %r15d, %r15d
pushq $0x7
popq %rdx
pushq $0x2
popq %rcx
xorl %edi, %edi
movq %r12, %rsi
movl %eax, %r8d
xorl %r9d, %r9d
callq 0x20b0
movq %rax, (%r14)
cmpq $-0x1, %rax
je 0x2f25
movl %ebp, %edi
callq 0x2140
cmpl $-0x1, %eax
jne 0x2f46
movl $0x16, 0x88(%rbx)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq %rax, 0x90(%rbx)
pushq $0x1
popq %r15
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/0xADE1A1DE[P]MeasureSuite/lib/src/alloc_helper.c
// Function: realloc_rwx_or_fail
int realloc_rwx_or_fail(struct measuresuite *ms, void **dest, size_t old_len,
                        size_t new_len) {
  // not using mremap here, because it may clash with errno (and USE_GNU)
  if (munmap(*dest, old_len)) {
    ms->errorno = E_INTERNAL_MEASURE__AI__ALLOC;
    ms->additional_info = strerror(errno);
    return 1;
  }

  return map_rwx(ms, *dest, new_len);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq (%rsi), %rdi
movq %rdx, %rsi
callq 0x21e0
testl %eax, %eax
je 0x2f95
movl $0x16, 0x88(%rbx)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq %rax, 0x90(%rbx)
pushq $0x1
popq %rax
popq %rbx
popq %r14
popq %r15
retq
movq (%r15), %rsi
movq %rbx, %rdi
movq %r14, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x2ece
// File: /workspace/github_c_makefile_star2_O2/0xADE1A1DE[P]MeasureSuite/lib/src/alloc_helper.c
// Function: unmap
int unmap(struct measuresuite *ms, void *dest, size_t old_len) {
  if (dest == NULL) {
    return 0;
  }
  if (munmap(dest, old_len)) {
    ms->errorno = E_INTERNAL_MEASURE__AI__ALLOC;
    ms->additional_info = strerror(errno);
    return 1;
  }

  return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
xorl %ebp, %ebp
testq %rsi, %rsi
je 0x2fe4
movq %rdi, %rbx
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x21e0
testl %eax, %eax
je 0x2fe4
movl $0x16, 0x88(%rbx)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq %rax, 0x90(%rbx)
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/0xADE1A1DE[P]MeasureSuite/lib/src/alloc_helper.c
// Function: init_arithmetic_results
int init_arithmetic_results(measuresuite_t ms, struct function_tuple *fct) {

  /** Arithmetic Res */
  /** +---------------------------------------------------------+ */
  /** |         out1 , out2, ... , out[#numArgOut]              | */
  /** +---------------------------------------------------------+ */
  /**     ^---   out1 * arg_width */

  /** Out1  each sizeof(u64)*/
  /** +---------------------------------------------------------+ */
  /** |         out1[0] , out1[1], ... , out1[#arg_width]       | */
  /** +---------------------------------------------------------+ */

  size_t size = ms->arg_width * ms->num_arg_out * sizeof(uint64_t);
  DEBUG("init_arithmetic_results, size: %lu\n", size);

  fct->arithmetic_results = malloc(size);

  if (fct->arithmetic_results == NULL) {
    ms->errorno = E_INTERNAL_MEASURE__AI__ALLOC;
    ms->additional_info = strerror(errno);
    return 1;
  }

  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rdi
imulq 0x10(%rbx), %rdi
shlq $0x3, %rdi
callq 0x21c0
movq %rax, %rcx
movq %rax, 0x18(%r14)
xorl %eax, %eax
testq %rcx, %rcx
jne 0x3036
movl $0x16, 0x88(%rbx)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq %rax, 0x90(%rbx)
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/0xADE1A1DE[P]MeasureSuite/lib/src/alloc_helper.c
// Function: init_cycle_results
int init_cycle_results(struct measuresuite *ms) {

  FOR_EACH_FUNCTION {

    fct->cycle_results = malloc(ms->num_batches * sizeof(uint64_t));

    if (fct->cycle_results == 0) {
      ms->errorno = E_INTERNAL_MEASURE__AI__ALLOC;
      ms->additional_info = strerror(errno);
      return 1;
    }
  }

  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x70(%rdi), %rcx
imulq $0x28, 0x80(%rdi), %rax
leaq (%rcx,%rax), %r14
addq $-0x28, %r14
movq %rcx, %r15
cmpq %r14, %rcx
ja 0x3099
movq 0x28(%rbx), %rdi
shlq $0x3, %rdi
callq 0x21c0
movq %rax, 0x20(%r15)
leaq 0x28(%r15), %rcx
testq %rax, %rax
jne 0x305a
movl $0x16, 0x88(%rbx)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq %rax, 0x90(%rbx)
xorl %eax, %eax
cmpq %r14, %r15
setbe %al
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/0xADE1A1DE[P]MeasureSuite/lib/src/alloc_helper.c
// Function: init_json
int init_json(struct measuresuite *ms) {

  const unsigned long char_per_long = 10;
  // at max, every function poduces one long per batch
  const unsigned long char_per_batch = char_per_long * ms->size_functions;

  // every batch produces char_per_batch' chars
  const unsigned long dynamic_length = char_per_batch * ms->num_batches;

  // the static stuff...
  const int len_other_stats = 1025;
  ms->json_len = len_other_stats + dynamic_length;

  ms->json = calloc(ms->json_len, sizeof(char));
  if (ms->json == NULL) {
    ms->errorno = E_INTERNAL_MEASURE__AI__ALLOC;
    ms->additional_info = strerror(errno);
    return 1;
  }

  return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x78(%rdi), %rax
imulq 0x28(%rdi), %rax
imulq $0xa, %rax, %rdi
addq $0x401, %rdi            # imm = 0x401
movq %rdi, 0x40(%rbx)
pushq $0x1
popq %rsi
callq 0x2160
movq %rax, %rcx
movq %rax, 0x38(%rbx)
xorl %eax, %eax
testq %rcx, %rcx
jne 0x30f9
movl $0x16, 0x88(%rbx)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq %rax, 0x90(%rbx)
pushq $0x1
popq %rax
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O2/0xADE1A1DE[P]MeasureSuite/lib/src/timer.c
// Function: current_timestamp
uint64_t current_timestamp() {
  struct timeval time = {0};
  gettimeofday(&time, NULL); // get current time

  const long long millisonds_per_second = 1000LL;
  const long long microseconds_per_millisecond = 1000LL;
  uint64_t milliseconds =
      time.tv_sec * millisonds_per_second +
      time.tv_usec / microseconds_per_millisecond; // calculate milliseconds

  return milliseconds;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
xorps %xmm0, %xmm0
movq %rsp, %rbx
movaps %xmm0, (%rbx)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2110
imulq $0x3e8, (%rbx), %rcx    # imm = 0x3E8
movq 0x8(%rbx), %rax
movl $0x3e8, %esi            # imm = 0x3E8
cqto
idivq %rsi
addq %rcx, %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/0xADE1A1DE[P]MeasureSuite/lib/src/timer.c
// Function: init_timer
int init_timer(struct measuresuite *ms) {

  // init timer struct
  memset(&ms->timer, 0, sizeof(ms->timer));

  // try to initialize
  init_fdperf(ms);

  if (ms->timer.fdperf == -1) {
    // if that  failed, we need to resort to RDTSCP
    ms->timer.timer_function = measuresuite_time_rdtscp;
  } else {
    // otherwise we'd use pmc
    ms->timer.timer_function = measuresuite_time_pmc;
  }

  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x98(%rdi)
andq $0x0, 0xa8(%rdi)
movq %rsp, %rdi
movaps %xmm0, (%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x70(%rdi)
movaps %xmm0, 0x60(%rdi)
movaps %xmm0, 0x50(%rdi)
movaps %xmm0, 0x40(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x10(%rdi)
movl $0x80, 0x4(%rdi)
movb $0x60, 0x28(%rdi)
pushq $-0x1
popq %rdx
movl $0x12a, %eax            # imm = 0x12A
xorl %esi, %esi
movq $-0x1, %r10
movq $0x0, %r8
syscall
movl %eax, 0x98(%rbx)
movl 0x98(%rbx), %eax
cmpl $-0x1, %eax
je 0x31fd
leaq 0x98(%rbx), %r14
pushq $0x1e
popq %rdi
callq 0x2220
movl 0x98(%rbx), %r8d
pushq $0x1
popq %rcx
xorl %edi, %edi
movq %rax, %rsi
movl %ecx, %edx
xorl %r9d, %r9d
callq 0x20b0
movq %rax, 0xa0(%rbx)
movq 0xa0(%rbx), %rax
cmpq $-0x1, %rax
je 0x3218
cmpl $-0x1, (%r14)
leaq 0x194(%rip), %rcx       # 0x3384
leaq 0x36(%rip), %rax        # 0x322d
cmoveq %rcx, %rax
jmp 0x3204
leaq 0x180(%rip), %rax       # 0x3384
movq %rax, 0xa8(%rbx)
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r14
retq
movl $0xffffffff, (%r14)     # imm = 0xFFFFFFFF
leaq 0x24f0(%rip), %rdi      # 0x5716
callq 0x2210
jmp 0x31e5
// File: /workspace/github_c_makefile_star2_O2/0xADE1A1DE[P]MeasureSuite/lib/src/timer.c
// Function: end_timer
int end_timer(struct measuresuite *ms) {

  if (ms_get_timer(ms) == RDTSCP) {
    return 0;
  }

  // otherwise we used pmc
  assert(ms->timer.buf != NULL); // and  the buffer shall not be NULL

  if (munmap(ms->timer.buf, sysconf(_SC_PAGESIZE)) == 0) {
    ms->timer.buf = NULL;
    ioctl(ms->timer.fdperf, PERF_EVENT_IOC_DISABLE, 0);
    close(ms->timer.fdperf);
    return 0;
  }
  perror("munmap of timer buffer (pmc) failed.");
  return 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x29cd
xorl %ebp, %ebp
cmpl $0x1, %eax
je 0x3301
movq 0xa0(%rbx), %r14
testq %r14, %r14
je 0x3319
pushq $0x1e
popq %rdi
callq 0x2220
movq %r14, %rdi
movq %rax, %rsi
callq 0x21e0
testl %eax, %eax
jne 0x3308
andq $0x0, 0xa0(%rbx)
movl 0x98(%rbx), %edi
xorl %ebp, %ebp
movl $0x2401, %esi           # imm = 0x2401
xorl %edx, %edx
xorl %eax, %eax
callq 0x2130
movl 0x98(%rbx), %edi
callq 0x2140
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x23e2(%rip), %rdi      # 0x56f1
callq 0x2210
pushq $0x1
popq %rbp
jmp 0x3301
leaq 0x238a(%rip), %rdi      # 0x56aa
leaq 0x2399(%rip), %rsi      # 0x56c0
leaq 0x239e(%rip), %rcx      # 0x56cc
movl $0xdf, %edx
callq 0x2120
// File: /workspace/github_c_makefile_star2_O2/0xADE1A1DE[P]MeasureSuite/lib/src/timer.c
// Function: start_timer
void start_timer(struct measuresuite *ms, uint64_t *start) {
  // we need to reset the PMC if we are using them.

  if (ms_get_timer(ms) == PMC) {
    ioctl(ms->timer.fdperf, PERF_EVENT_IOC_RESET, 0);
  }
  *start = ms->timer.timer_function(ms);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x29cd
testl %eax, %eax
jne 0x3360
movl 0x98(%r14), %edi
movl $0x2403, %esi           # imm = 0x2403
xorl %edx, %edx
xorl %eax, %eax
callq 0x2130
movq %r14, %rdi
callq *0xa8(%r14)
movq %rax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/0xADE1A1DE[P]MeasureSuite/lib/src/error/description.c
// Function: get_error_string
const char *get_error_string(ERROR_NUMBER err) {
  for (size_t i = 0; i < sizeof(error_desc) / sizeof(error_desc[0]); i++) {
    if (error_desc[i].errno == err) {
      return error_desc[i].message;
    }
  }
  return NULL;
}

// Assembly:
xorl %eax, %eax
leaq 0x580f(%rip), %rcx      # 0x8bc0
xorl %edx, %edx
leaq 0x10(%rdx), %rsi
cmpq $0x230, %rsi            # imm = 0x230
je 0x33cd
cmpl %edi, (%rdx,%rcx)
movq %rsi, %rdx
jne 0x33b3
movq -0x8(%rsi,%rcx), %rax
retq
nop