LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
subq $0x38, %rsp
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, 0x20(%rdx)
movl $0x1, 0x8(%rdx)
movq 0x2bd3(%rip), %rdi      # 0x4168
leaq 0xb04(%rip), %rsi       # 0x20a0
leaq -0x20(%rbp), %rcx
callq 0x1260
testl %eax, %eax
jne 0x168d
movq -0x20(%rbp), %r14
testq %r14, %r14
je 0x1684
movl 0x4(%r14), %edi
movl 0x8(%r14), %esi
movl 0xc(%r14), %edx
callq 0x1290
cmpl $-0x1, %eax
je 0x15ec
movl %eax, %ebx
movq 0x18(%r14), %rsi
movl 0x10(%r14), %edx
movl %eax, %edi
callq 0x1210
testl %eax, %eax
je 0x15f2
movl %ebx, %edi
callq 0x10f0
movq 0x28(%r14), %r14
jmp 0x15b1
movq -0x20(%rbp), %rdi
callq 0x1280
movl $0xc, %edi
callq 0x1160
movq %rax, %r14
movq 0x2b61(%rip), %rax      # 0x4170
movq %rax, (%r14)
movl 0x2b60(%rip), %eax      # 0x4178
movl %eax, 0x8(%r14)
movl $0xc, %edx
movl %ebx, %edi
movq %r14, %rsi
callq 0x1080
movq $0x0, (%r14)
movl $0x0, 0x8(%r14)
xorl %r15d, %r15d
leaq (%r14,%r15), %rsi
movl $0xc, %edx
subq %r15, %rdx
movl %ebx, %edi
callq 0x1110
addl %eax, %r15d
movslq %r15d, %r15
cmpq $0xc, %r15
jb 0x163d
movl 0x8(%r14), %eax
movl %eax, 0x2b1e(%rip)      # 0x4184
movq (%r14), %rax
movq %rax, 0x2b0c(%rip)      # 0x417c
movl %ebx, %edi
callq 0x10f0
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa31(%rip), %rdi       # 0x20bc
jmp 0x1694
leaq 0xa11(%rip), %rdi       # 0x20a5
callq 0x11d0
movl $0x1, %eax
jmp 0x1679
// File: /workspace/github_c_makefile_star2_O3/Arlu[P]RDMA-Hello-World/setup_ib.c
// Function: get_client_dest
int get_client_dest()
{
    int sockfd, connfd, len;
    struct sockaddr_in server_address, client_address;

    // Start connection:
    sockfd = socket(AF_INET, SOCK_STREAM, 0);
    if (sockfd == -1)
    {
        perror("Socket creation failed!\n");
        return 1;
    }

    memset(&server_address, 0, sizeof(server_address));
    server_address.sin_family = AF_INET;
    server_address.sin_addr.s_addr = htonl(INADDR_ANY);
    server_address.sin_port = htons(PORT);

    if (bind(sockfd, (struct sockaddr*)&server_address, sizeof(server_address)))
    {
        perror("Socket bind failed!\n");
        return 1;
    }

    if (listen(sockfd, 5))
    {
        perror("Listen failed...\n");
        return 1;
    }

    len = sizeof(client_address);

    connfd = accept(sockfd, (struct sockaddr*)&client_address, &len);
    if (connfd < 0)
    {
        perror("Server accept failed!\n");
        return 1;
    }

    // Get client details:
    {
        char *buf;
        buf = (char*)malloc(sizeof(struct IBDest));
        int offset = 0;

        // Get him details.
        while (offset < sizeof(struct IBDest))
            offset += read(connfd, buf + offset, sizeof(struct IBDest) - offset);

        memcpy(&remote_dest, buf, sizeof(struct IBDest));

        // Send my details:
        memset(buf, 0, sizeof(struct IBDest));
        offset = 0;

        memcpy(buf, &local_dest, sizeof(struct IBDest));
        write(connfd, 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 $0x30, %rsp
movl $0x1, %r14d
movl $0x2, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x1290
cmpl $-0x1, %eax
je 0x17a1
movl %eax, %ebx
leaq -0x44(%rbp), %rsi
movq $0x0, 0x8(%rsi)
movl $0x901f0002, %eax       # imm = 0x901F0002
movq %rax, (%rsi)
movl %ebx, %edi
movl $0x10, %edx
callq 0x11c0
testl %eax, %eax
jne 0x17aa
movl %ebx, %edi
movl $0x5, %esi
callq 0x1170
testl %eax, %eax
jne 0x17b3
leaq -0x24(%rbp), %rdx
movl $0x10, (%rdx)
leaq -0x34(%rbp), %rsi
movl %ebx, %edi
callq 0x11f0
testl %eax, %eax
js 0x17bc
movl %eax, %r14d
movl $0xc, %edi
callq 0x1160
movq %rax, %r15
xorl %r12d, %r12d
leaq (%r15,%r12), %rsi
movl $0xc, %edx
subq %r12, %rdx
movl %r14d, %edi
callq 0x1110
addl %eax, %r12d
movslq %r12d, %r12
cmpq $0xc, %r12
jb 0x173d
movl 0x8(%r15), %eax
movl %eax, 0x2a1d(%rip)      # 0x4184
movq (%r15), %rax
movq %rax, 0x2a0b(%rip)      # 0x417c
movq 0x29f8(%rip), %rax      # 0x4170
movq %rax, (%r15)
movl 0x29f7(%rip), %eax      # 0x4178
movl %eax, 0x8(%r15)
movl $0xc, %edx
movl %r14d, %edi
movq %r15, %rsi
callq 0x1080
movl %ebx, %edi
callq 0x10f0
xorl %r14d, %r14d
jmp 0x17c8
leaq 0x938(%rip), %rdi       # 0x20e0
jmp 0x17c3
leaq 0x948(%rip), %rdi       # 0x20f9
jmp 0x17c3
leaq 0x954(%rip), %rdi       # 0x210e
jmp 0x17c3
leaq 0x95d(%rip), %rdi       # 0x2120
callq 0x11d0
movl %r14d, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2971(%rip), %eax      # 0x4184
movl %eax, 0x14(%r14)
movl 0x2963(%rip), %eax      # 0x4180
movl %eax, 0x1c(%r14)
movzwl 0x2954(%rip), %eax      # 0x417c
movw %ax, 0x50(%r14)
movb $0x1, 0x56(%r14)
movw $0xc01, 0x7f(%r14)      # imm = 0xC01
movq 0x2968(%rip), %rdi      # 0x41a8
movq %r14, %rsi
movl $0x129181, %edx         # imm = 0x129181
callq 0x1050
testl %eax, %eax
jne 0x189e
leaq -0xa0(%rbp), %rsi
movl $0x3, (%rsi)
movw $0x70e, 0x82(%rsi)      # imm = 0x70E
movb $0x7, 0x84(%rsi)
movl 0x2904(%rip), %eax      # 0x4178
movl %eax, 0x18(%rsi)
movb $0x1, 0x7e(%rsi)
movq 0x2926(%rip), %rdi      # 0x41a8
movl $0x12e01, %edx          # imm = 0x12E01
callq 0x1050
testl %eax, %eax
jne 0x18a7
movl %ebx, %eax
addq $0x90, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x892(%rip), %rdi       # 0x2137
jmp 0x18ae
leaq 0x8a6(%rip), %rdi       # 0x2154
callq 0x11d0
movl $0x1, %ebx
jmp 0x1890
// File: /workspace/github_c_makefile_star2_O3/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 0x23b6(%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), %eax
movl %eax, 0xc(%r9)
leaq -0x98(%rbp), %rax
movq $0x4, (%rax)
movq $0x0, 0x8(%rax)
movq %r9, 0x10(%rax)
movaps 0x523(%rip), %xmm0      # 0x2330
movups %xmm0, 0x18(%rax)
movq %rdi, 0x28(%rax)
movl %esi, 0x30(%rax)
movl $0x0, 0x48(%rax)
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_O3/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 %r12
pushq %rbx
subq $0x12c0, %rsp           # imm = 0x12C0
movslq %edi, %r14
xorl %r15d, %r15d
leaq 0x2293(%rip), %r12      # 0x4188
leaq -0x12e0(%rbp), %rbx
movq 0x18(%r12), %rdi
movq (%rdi), %rax
movl $0x64, %esi
movq %rbx, %rdx
callq *0x60(%rax)
testl %eax, %eax
js 0x1f4e
je 0x1efc
movl %eax, %eax
shlq $0x4, %rax
leaq (%rax,%rax,2), %rax
xorl %ecx, %ecx
movl -0x12d8(%rbp,%rcx), %esi
testl %esi, %esi
jne 0x1f6a
xorl %edx, %edx
cmpq %r14, -0x12e0(%rbp,%rcx)
sete %dl
addl %edx, %r15d
addq $0x30, %rcx
cmpq %rcx, %rax
jne 0x1f21
testl %r15d, %r15d
jle 0x1efc
xorl %eax, %eax
jmp 0x1f7f
movq 0x20a3(%rip), %rcx      # 0x3ff8
movq (%rcx), %rdi
leaq 0x3f1(%rip), %rsi       # 0x2350
movl %eax, %edx
xorl %eax, %eax
callq 0x1120
jmp 0x1f7a
leaq (%rcx,%rbp), %rdi
addq $-0x12e0, %rdi          # imm = 0xED20
callq 0x12df
movl $0x1, %eax
addq $0x12c0, %rsp           # imm = 0x12C0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2e86
movq %rax, (%rbx)
movl $0x1, %ebx
testq %rax, %rax
je 0x292b
movq %rax, %r14
movq %rax, %rdi
movl %r12d, %esi
callq 0x2e08
testl %eax, %eax
jne 0x292b
movq %r14, %rdi
movl %r15d, %esi
callq 0x2e24
testl %eax, %eax
jne 0x292b
movq %r14, %rdi
movl %ebp, %esi
callq 0x2e45
testl %eax, %eax
jne 0x292b
movq %r14, %rdi
callq 0x2e66
testl %eax, %eax
jne 0x292b
movq %r14, %rdi
callq 0x2bc0
testl %eax, %eax
jne 0x292b
movq %r14, %rdi
callq 0x31f8
testl %eax, %eax
jne 0x292b
movq %r14, %rdi
callq 0x3298
testl %eax, %eax
jne 0x292b
movl $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_O3/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x80(%rdi), %r14
testq %r14, %r14
je 0x29ae
movq %r14, %rsi
decq %rsi
movq %rbx, %rdi
callq 0x3860
movl %eax, %ecx
movl $0x1, %eax
testl %ecx, %ecx
jne 0x29ba
movl $0x0, 0x88(%rbx)
decq %r14
je 0x29ae
movq 0x80(%rbx), %rsi
testq %rsi, %rsi
jne 0x2971
movl $0x18, 0x88(%rbx)
jmp 0x29ba
movl $0x0, 0x88(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2f79
movl $0x1, %ebx
testl %eax, %eax
jne 0x2a40
movq %r14, %rdi
movl %ebp, %esi
callq 0x2f96
testl %eax, %eax
jne 0x2a40
movq %r14, %rdi
callq 0x3550
testl %eax, %eax
jne 0x2a40
movl $0x0, 0x88(%r14)
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2aed
movq %rdi, %rbx
callq 0x295b
movl $0x1, %ebp
testl %eax, %eax
jne 0x2aed
movq %rbx, %rdi
callq 0x2d0c
testl %eax, %eax
jne 0x2aed
movq %rbx, %rdi
callq 0x341a
testl %eax, %eax
jne 0x2aed
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_O3/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 0x2be7
movl $0x9, 0x88(%rbx)
jmp 0x2c4e
movl $0xffffffff, 0x58(%rbx) # imm = 0xFFFFFFFF
leaq 0x2a96(%rip), %rdi      # 0x568b
xorl %esi, %esi
xorl %eax, %eax
callq 0x21f0
movl %eax, 0x58(%rbx)
cmpl $-0x1, %eax
je 0x2c25
movq 0x50(%rbx), %rdi
shlq $0x3, %rdi
callq 0x21c0
movq %rax, 0x48(%rbx)
testq %rax, %rax
je 0x2c31
movq %rbx, %rdi
popq %rbx
jmp 0x2c55
movl $0xd, 0x88(%rbx)
jmp 0x2c3b
movl $0xc, 0x88(%rbx)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq %rax, 0x90(%rbx)
movl $0x1, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2cd6
movq 0x48(%rbx), %rsi
movq 0x50(%rbx), %r14
shlq $0x3, %r14
movq %r14, %rdx
callq 0x2150
cmpq %rax, %r14
jne 0x2ce2
movq 0x18(%rbx), %rcx
xorl %eax, %eax
testq %rcx, %rcx
je 0x2d04
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x2d04
movq (%rbx), %rsi
xorl %eax, %eax
xorl %edx, %edx
testq %rsi, %rsi
je 0x2cc4
movq 0x48(%rbx), %rdi
xorl %r8d, %r8d
imulq %rax, %rsi
addq %rdi, %rsi
movq (%rcx,%r8,8), %r9
andq %r9, (%rsi,%r8,8)
incq %r8
movq (%rbx), %rsi
cmpq %rsi, %r8
jb 0x2ca4
movq 0x8(%rbx), %rdi
jmp 0x2cc6
xorl %esi, %esi
incq %rdx
addq $0x8, %rax
cmpq %rdi, %rdx
jb 0x2c98
xorl %eax, %eax
jmp 0x2d04
movl $0x10, 0x88(%rbx)
jmp 0x2cff
movl $0xe, 0x88(%rbx)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq %rax, 0x90(%rbx)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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
movq $0x0, 0x48(%rbx)
movl 0x58(%rbx), %edi
cmpl $-0x1, %edi
je 0x2d56
callq 0x2140
testl %eax, %eax
je 0x2d56
movl $0xf, 0x88(%rbx)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq %rax, 0x90(%rbx)
movl $0x1, %eax
jmp 0x2d67
movl $0xffffffff, 0x58(%rbx) # imm = 0xFFFFFFFF
movq $0x0, 0x50(%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2d86
movq 0x50(%rdi), %rcx
testq %rcx, %rcx
je 0x2d86
movq -0x8(%rax,%rcx,8), %rax
movq %rax, (%rsi)
xorl %eax, %eax
retq
movl $0x10, 0x88(%rdi)
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq $-0x2, %rax
addq %rax, %rax
movq %rax, %r12
notq %r12
cmpq %r15, %r12
jb 0x2dae
jmp 0x2ddf
movq 0x50(%r14), %rcx
testq %rcx, %rcx
je 0x2de8
movq -0x8(%rax,%rcx,8), %rax
andq %r12, %rax
movq %rax, (%rbx)
cmpq %r15, %rax
jbe 0x2dfa
movq %r14, %rdi
callq 0x2c55
movq 0x48(%r14), %rax
testq %rax, %rax
jne 0x2dbe
movl $0x10, 0x88(%r14)
movl $0x1, %eax
jmp 0x2dfc
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2f49
movq (%r14), %r15
testq %r15, %r15
je 0x2f56
movq %rsi, %rbx
movl $0x8, %esi
movq %r15, %rdi
callq 0x2160
movq %rax, 0x18(%r14)
testq %rax, %rax
je 0x2f63
shlq $0x3, %r15
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x21b0
xorl %eax, %eax
jmp 0x2f73
movl $0x2, 0x88(%r14)
jmp 0x2f6e
movl $0x1, 0x88(%r14)
jmp 0x2f6e
movl $0x17, 0x88(%r14)
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2688(%rip), %rdi      # 0x56a0
movl $0x2, %esi
xorl %eax, %eax
callq 0x21f0
cmpl $-0x1, %eax
je 0x305d
movl %eax, %ebp
xorl %r15d, %r15d
xorl %edi, %edi
movq %r12, %rsi
movl $0x7, %edx
movl $0x2, %ecx
movl %eax, %r8d
xorl %r9d, %r9d
callq 0x20b0
movq %rax, (%r14)
cmpq $-0x1, %rax
je 0x305d
movl %ebp, %edi
callq 0x2140
cmpl $-0x1, %eax
jne 0x3080
movl $0x16, 0x88(%rbx)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq %rax, 0x90(%rbx)
movl $0x1, %r15d
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x3122
movq %rdi, %rbx
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x21e0
testl %eax, %eax
je 0x3122
movl $0x16, 0x88(%rbx)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq %rax, 0x90(%rbx)
movl $0x1, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x70(%rdi), %r15
movq 0x80(%rdi), %rax
leaq (%rax,%rax,4), %rax
leaq (%r15,%rax,8), %r12
addq $-0x28, %r12
xorl %ebp, %ebp
cmpq %r12, %r15
ja 0x31ed
movq %rdi, %rbx
movq 0x28(%rdi), %r14
shlq $0x3, %r14
movq %r14, %rdi
callq 0x21c0
movq %rax, 0x20(%r15)
testq %rax, %rax
je 0x31cb
addq $0x28, %r15
cmpq %r12, %r15
jbe 0x31af
jmp 0x31ed
movl $0x16, 0x88(%rbx)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq %rax, 0x90(%rbx)
movl $0x1, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
leaq (%rax,%rax,4), %rax
leaq 0x401(,%rax,2), %rdi
movq %rdi, 0x40(%rbx)
movl $0x1, %esi
callq 0x2160
movq %rax, %rcx
movq %rax, 0x38(%rbx)
xorl %eax, %eax
testq %rcx, %rcx
jne 0x324f
movl $0x16, 0x88(%rbx)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq %rax, 0x90(%rbx)
movl $0x1, %eax
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/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)
movq $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)
movl $0x12a, %eax            # imm = 0x12A
xorl %esi, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq $-0x1, %r10
movq $0x0, %r8
syscall
movl %eax, 0x98(%rbx)
movl 0x98(%rbx), %eax
cmpl $-0x1, %eax
je 0x336f
leaq 0x98(%rbx), %r14
movl $0x1e, %edi
callq 0x2220
movl 0x98(%rbx), %r8d
xorl %edi, %edi
movq %rax, %rsi
movl $0x1, %edx
movl $0x1, %ecx
xorl %r9d, %r9d
callq 0x20b0
movq %rax, 0xa0(%rbx)
movq 0xa0(%rbx), %rax
cmpq $-0x1, %rax
je 0x338a
cmpl $-0x1, (%r14)
leaq 0x1a1(%rip), %rcx       # 0x3503
leaq 0x36(%rip), %rax        # 0x339f
cmoveq %rcx, %rax
jmp 0x3376
leaq 0x18d(%rip), %rax       # 0x3503
movq %rax, 0xa8(%rbx)
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r14
retq
movl $0xffffffff, (%r14)     # imm = 0xFFFFFFFF
leaq 0x237e(%rip), %rdi      # 0x5716
callq 0x2210
jmp 0x3357
// File: /workspace/github_c_makefile_star2_O3/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 0x2a88
xorl %ebp, %ebp
cmpl $0x1, %eax
je 0x347e
movq 0xa0(%rbx), %r14
testq %r14, %r14
je 0x3498
movl $0x1e, %edi
callq 0x2220
movq %r14, %rdi
movq %rax, %rsi
callq 0x21e0
testl %eax, %eax
jne 0x3485
movq $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 0x2265(%rip), %rdi      # 0x56f1
callq 0x2210
movl $0x1, %ebp
jmp 0x347e
leaq 0x220b(%rip), %rdi      # 0x56aa
leaq 0x221a(%rip), %rsi      # 0x56c0
leaq 0x221f(%rip), %rcx      # 0x56cc
movl $0xdf, %edx
callq 0x2120
// File: /workspace/github_c_makefile_star2_O3/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 0x2a88
testl %eax, %eax
jne 0x34df
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_O3/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:
movl $0x8, %ecx
leaq 0x568c(%rip), %rdx      # 0x8bc0
xorl %eax, %eax
cmpl %edi, -0x8(%rcx,%rdx)
je 0x354a
addq $0x10, %rcx
cmpq $0x228, %rcx            # imm = 0x228
jne 0x3536
retq
movq (%rcx,%rdx), %rax
retq
nop
// File: /workspace/github_c_makefile_star2_O3/0xADE1A1DE[P]MeasureSuite/lib/src/loader.c
// Function: unload
int unload(measuresuite_t ms, size_t id) {

  struct function_tuple *fct = &ms->functions[id];

  free(fct->arithmetic_results);
  fct->arithmetic_results = NULL;

  free(fct->cycle_results);
  fct->cycle_results = NULL;

  int ret = 0;
  switch (fct->type) {
  case SHARED_OBJECT:
    ret = so_unload_file(ms, fct);
    break;
  case ASM:
#if USE_ASSEMBLYLINE
    if (fct->al == NULL || asm_destroy_instance(fct->al)) {
      ms->errorno = E_LOAD__AL_FREE;
      ret = 1;
    }
    fct->al = NULL;
    __attribute__((fallthrough));
#endif
  case BIN:
  case ELF:
    unmap(ms, fct->code, fct->code_size_bytes);
    fct->code_size_bytes = 0;
  }

  ms->num_functions--;
  reset_permutaions(ms);
  return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x70(%rdi), %rax
leaq (%rsi,%rsi,4), %rcx
leaq (%rax,%rcx,8), %r15
movq 0x18(%r15), %rdi
callq 0x2040
xorl %r14d, %r14d
movq %r14, 0x18(%r15)
movq 0x20(%r15), %rdi
callq 0x2040
movq %r14, 0x20(%r15)
cmpl $0x3, (%r15)
jae 0x38b1
movq 0x8(%r15), %rsi
movq 0x10(%r15), %rdx
movq %rbx, %rdi
callq 0x30e4
movq $0x0, 0x10(%r15)
jmp 0x38c1
jne 0x38c1
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4588
movl %eax, %r14d
decq 0x80(%rbx)
movq %rbx, %rdi
callq 0x38d9
movl %r14d, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/0xADE1A1DE[P]MeasureSuite/lib/src/loader.c
// Function: reset_permutaions
static int reset_permutaions(measuresuite_t ms) {

  // allocate permutation
  ms->permutation =
      realloc(ms->permutation, ms->num_functions * sizeof(size_t));

  if (ms->permutation == NULL) {
    ms->errorno = E_INTERNAL_RANDOMNESS__AI__MALLOC;
    ms->additional_info = strerror(errno);
    return 1;
  }

  for (size_t i = 0; i < ms->num_functions; i++) {
    ms->permutation[i] = i;
  }
  return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x60(%rdi), %rdi
movq 0x80(%rbx), %rsi
shlq $0x3, %rsi
callq 0x21d0
movq %rax, 0x60(%rbx)
testq %rax, %rax
je 0x39a2
movq 0x80(%rbx), %rdx
testq %rdx, %rdx
je 0x39bf
leaq 0x1(%rdx), %rcx
andq $-0x2, %rcx
decq %rdx
movq %rdx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa 0x25b5(%rip), %xmm1     # 0x5ee0
xorl %edx, %edx
movdqa 0x25bb(%rip), %xmm2     # 0x5ef0
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movdqa 0x25bb(%rip), %xmm4     # 0x5f00
movdqa %xmm1, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
movd %xmm5, %esi
notl %esi
testb $0x1, %sil
je 0x397b
movq %rdx, (%rax,%rdx,8)
pxor %xmm3, %xmm5
pextrw $0x4, %xmm5, %esi
testb $0x1, %sil
je 0x3993
leaq 0x1(%rdx), %rsi
movq %rsi, 0x8(%rax,%rdx,8)
addq $0x2, %rdx
paddq %xmm4, %xmm1
cmpq %rdx, %rcx
jne 0x3945
jmp 0x39bf
movl $0xc, 0x88(%rbx)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq %rax, 0x90(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/0xADE1A1DE[P]MeasureSuite/lib/src/loader.c
// Function: create_new_function
static int create_new_function(measuresuite_t ms, enum load_type type,
                               size_t code_size_bytes) {

  DEBUG("Creating new function. type: %d\n", type);
  // check size and allocate more if needed
  if (ms->size_functions <= ms->num_functions) {
    ms->size_functions *= 2;
    DEBUG("Doubled size_functions to %lu\n", ms->size_functions);
    if (realloc_or_fail(ms, (void **)&ms->functions,
                        ms->size_functions * sizeof(struct function_tuple))) {
      return 1;
    }
  }

  // convenience pointer to the new tuple
  struct function_tuple *new = &ms->functions[ms->num_functions];

  new->type = type;

  // initialize the memory for arith_result
  init_arithmetic_results(ms, new);

  // if we need the 'code' segment, initialize that memory
  if (type == ELF || type == BIN || type == ASM) {

    new->code_size_bytes =
        code_size_bytes == 0 ? DEFAULT_CODE_SIZE : code_size_bytes;
    if (map_rwx(ms, (void **)&new->code, new->code_size_bytes)) {
      return 1;
    }
  }

  // Because we don't have any batch_size yet.
  new->cycle_results = NULL;

#ifdef USE_ASSEMBLYLINE
  new->chunks = 0;

  if (type == ASM) {
    // create asm instance
    new->al = asm_create_instance(new->code, (int)new->code_size_bytes);
  } else {
    new->al = NULL;
  }
#else
  if (type == ASM) {
    ms->errorno = E_NO_ASSEMBLYLINE;
    return 1;
  }

#endif

  // specify that we have a new one now
  ms->num_functions += 1;
  reset_permutaions(ms);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
movq 0x78(%rdi), %rax
movq 0x80(%rdi), %rcx
cmpq %rcx, %rax
ja 0x3b8e
leaq (%rax,%rax), %rcx
movq %rcx, 0x78(%rbx)
leaq 0x70(%rbx), %rsi
shlq $0x4, %rax
leaq (%rax,%rax,4), %rdx
movq %rbx, %rdi
callq 0x2fb4
movl %eax, %ecx
movl $0x1, %eax
testl %ecx, %ecx
jne 0x3c05
movq 0x80(%rbx), %rcx
movq 0x70(%rbx), %rax
leaq (%rcx,%rcx,4), %rcx
leaq (%rax,%rcx,8), %r15
movl %ebp, (%r15)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x312b
cmpl $0x3, %ebp
jae 0x3bec
testq %r14, %r14
movl $0xea60, %edx           # imm = 0xEA60
cmovneq %r14, %rdx
movq %rdx, 0x10(%r15)
leaq 0x8(%r15), %rsi
movq %rbx, %rdi
callq 0x3000
movl %eax, %ecx
movl $0x1, %eax
testl %ecx, %ecx
jne 0x3c05
movq $0x0, 0x20(%r15)
testl %ebp, %ebp
jne 0x3bf4
movl $0x21, 0x88(%rbx)
jmp 0x3c05
movq $0x0, 0x20(%r15)
incq 0x80(%rbx)
movq %rbx, %rdi
callq 0x38d9
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/0xADE1A1DE[P]MeasureSuite/lib/src/loader.c
// Function: load_data
int load_data(measuresuite_t ms, enum load_type type, const uint8_t *data,
              size_t data_len, const char *symbol, int *id) {
  if (type == SHARED_OBJECT) {
    ms->errorno = E_INVALID_INPUT__SO_FROM_MEMORY;
    return 1;
  }

  if (*id == -1) {
    if (create_new_function(ms, type, data_len)) {
      return 1;
    }
    *id = (int)ms->num_functions - 1;
  }

  struct function_tuple *fct = &ms->functions[*id];
  /** make sure we got enough space in case we are re-using */
  if (fct->code_size_bytes < data_len) {
    if (realloc_rwx_or_fail(ms, fct->code, fct->code_size_bytes, data_len)) {
      return 1;
    }
    fct->code_size_bytes = data_len;
  }

  switch (type) {
  case ASM: {
#ifdef USE_ASSEMBLYLINE
    if (asm_assemble_string_counting_chunks(
            fct->al, (char *)data, (int)ms->chunk_size, &fct->chunks)) {
      ms->errorno = E_LOAD__ASM_DATA;
      return 1;
    }
    return 0;
#else
    ms->errorno = E_NO_ASSEMBLYLINE;
    return 1;
#endif
  }

  case BIN: {
    memcpy(fct->code, data, data_len);
    return 0;
  }

  case ELF:
    return elf_load_symbol_mem(ms, fct->code, fct->code_size_bytes, data,
                               symbol);

  default:
    return 1;
  }

  ms->errorno = E_SUCCESS;
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
cmpl $0x3, %esi
jne 0x3c42
movl $0xa, 0x88(%r14)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r9, %r13
movq %r8, %r12
movq %rcx, %r15
movq %rdx, %rbx
movl %esi, %ebp
movl (%r9), %eax
cmpl $-0x1, %eax
je 0x3cb0
movq 0x70(%r14), %rcx
cltq
leaq (%rax,%rax,4), %rax
leaq (%rcx,%rax,8), %r13
movq 0x10(%r13), %rdx
cmpq %r15, %rdx
jae 0x3c90
movq 0x8(%r13), %rsi
movq %r14, %rdi
movq %r15, %rcx
callq 0x308c
movl %eax, %ecx
movl $0x1, %eax
testl %ecx, %ecx
jne 0x3c33
movq %r15, 0x10(%r13)
movq %r15, %rdx
cmpl $0x2, %ebp
je 0x3cf4
cmpl $0x1, %ebp
je 0x3cde
movl $0x1, %eax
testl %ebp, %ebp
jne 0x3c33
movl $0x21, 0x88(%r14)
jmp 0x3c33
movq %r14, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x3b41
movl %eax, %ecx
movl $0x1, %eax
testl %ecx, %ecx
jne 0x3c33
movl 0x80(%r14), %eax
decl %eax
movl %eax, (%r13)
jmp 0x3c58
movq 0x8(%r13), %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x21b0
xorl %eax, %eax
jmp 0x3c33
movq 0x8(%r13), %rsi
movq %r14, %rdi
movq %rbx, %rcx
movq %r12, %r8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3f7e
// File: /workspace/github_c_makefile_star2_O3/0xADE1A1DE[P]MeasureSuite/lib/src/checker.c
// Function: check
int check(size_t len, const uint64_t *data, const uint64_t *check_data) {
  size_t total = len;
  int res = OK;
  data += len;
  check_data += len;
  // check first.
  while (len--) {
    res |= (*(--data) != *(--check_data));
  }

  // if where is a mistake, print all
  if (res == WRONG) {
    pretty_print_results(data, check_data, total);
  }
  // and return the result anyway
  return res;
}

// Assembly:
testq %rdi, %rdi
je 0x3d57
movq %rdi, %rcx
decq %rdi
xorl %eax, %eax
movq (%rsi,%rdi,8), %r8
xorl %r9d, %r9d
cmpq (%rdx,%rdi,8), %r8
setne %r9b
orl %r9d, %eax
addq $-0x1, %rdi
jb 0x3d21
cmpl $0x1, %eax
jne 0x3d56
pushq %rax
movq %rsi, %rdi
movq %rdx, %rsi
movq %rcx, %rdx
callq 0x4be0
movl $0x1, %eax
addq $0x8, %rsp
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O3/0xADE1A1DE[P]MeasureSuite/lib/src/io/elf_memory.c
// Function: find_section_offset_mem
void find_section_offset_mem(const uint8_t *src, Elf64_Ehdr hdr,
                             Elf64_Shdr sh_table[], const char *needle,
                             unsigned long *dest) {

  size_t len_needle = strlen(needle);

  /* Read section-header string-table */
  void *sh_str = NULL;
  read_section_mem(src, &sh_table[hdr.e_shstrndx], &sh_str);

  for (int i = 0; i < hdr.e_shnum; i++) {
    char *name = sh_str + sh_table[i].sh_name;

    if (strncmp(name, needle, len_needle) == 0) {
      *dest = i;
      break;
    }
  }
  free(sh_str);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, (%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbp
movq %rdx, %rdi
callq 0x20a0
movq %rax, %r12
movzwl 0x7e(%rsp), %eax
shll $0x6, %eax
movq 0x20(%r15,%rax), %rbx
addq 0x18(%r15,%rax), %rbp
movq %rbx, %rdi
callq 0x21c0
movq %rax, %r13
movq %rax, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x21b0
movzwl 0x7c(%rsp), %ebx
testq %rbx, %rbx
je 0x41d6
xorl %ebp, %ebp
movl (%r15), %edi
addq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2080
testl %eax, %eax
je 0x41cf
incq %rbp
addq $0x40, %r15
cmpq %rbp, %rbx
jne 0x41ac
jmp 0x41d6
movq (%rsp), %rax
movq %rbp, (%rax)
movq %r13, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2040
// File: /workspace/github_c_makefile_star2_O3/0xADE1A1DE[P]MeasureSuite/lib/src/io/elf_memory.c
// Function: read_elf_header_mem
int read_elf_header_mem(const uint8_t *src, Elf64_Ehdr *elf_header) {
  size_t size = sizeof(Elf64_Ehdr);
  char magic[] = {"\177ELF"};
  if (elf_header == NULL                                     // sanity
      || memcpy(elf_header, src, size) == NULL               // read header
      || strncmp((char *)elf_header->e_ident, magic, 4) != 0 // check magic
      || elf_header->e_ident[EI_CLASS] != ELFCLASS64         // is elf64
  ) {
    return 1;
  }
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl $0x1, %ebx
testq %rsi, %rsi
je 0x439e
movq %rsi, %r14
movups (%rdi), %xmm0
movups 0x10(%rdi), %xmm1
movups 0x20(%rdi), %xmm2
movups 0x30(%rdi), %xmm3
movups %xmm3, 0x30(%rsi)
movups %xmm2, 0x20(%rsi)
movups %xmm1, 0x10(%rsi)
movups %xmm0, (%rsi)
leaq 0x1c68(%rip), %rsi      # 0x5feb
movl $0x4, %edx
movq %r14, %rdi
callq 0x2080
testl %eax, %eax
jne 0x439e
xorl %ebx, %ebx
cmpb $0x2, 0x4(%r14)
setne %bl
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/0xADE1A1DE[P]MeasureSuite/lib/src/io/file.c
// Function: filesize
int filesize(measuresuite_t ms, const char *filename, size_t *size) {
  struct stat stats;
  DEBUG("trying to Stat file '%s'\n", filename);
  if (stat(filename, &stats)) {
    ms->errorno = E_INVALID_INPUT__FILE;
    ms->additional_info = strerror(errno);
    return 1;
  }
  *size = stats.st_size;
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x98, %rsp
movq %rdx, %r14
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x21a0
testl %eax, %eax
je 0x43f0
movl $0xb, 0x88(%rbx)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq %rax, 0x90(%rbx)
movl $0x1, %eax
jmp 0x43fa
movq 0x38(%rsp), %rax
movq %rax, (%r14)
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/0xADE1A1DE[P]MeasureSuite/lib/src/io/file.c
// Function: filecopy
int filecopy(measuresuite_t ms, void *dest, size_t dest_size,
             const char *filename) {
  size_t size = 0;
  if (filesize(ms, filename, &size) || size > dest_size) {
    return 1;
  }

  int file = open(filename, O_RDONLY | O_SYNC);
  if (file == -1                                      // open
      || read(file, dest, dest_size) != (ssize_t)size // read
      || close(file) == -1                            // close
  ) {
    ms->errorno = E_INVALID_INPUT__FILE;
    ms->additional_info = strerror(errno);
    return 1;
  };

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r12
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rsp, %r13
movq $0x0, (%r13)
movq %rcx, %rsi
movq %r13, %rdx
callq 0x43a8
testl %eax, %eax
setne %al
movq (%r13), %r13
cmpq %r14, %r13
seta %cl
orb %al, %cl
movl $0x1, %eax
jne 0x44a4
movq %r12, %rdi
movl $0x101000, %esi         # imm = 0x101000
xorl %eax, %eax
callq 0x21f0
cmpl $-0x1, %eax
je 0x4482
movl %eax, %ebp
movl %eax, %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2150
cmpq %r13, %rax
jne 0x4482
movl %ebp, %edi
callq 0x2140
movl %eax, %ecx
xorl %eax, %eax
cmpl $-0x1, %ecx
jne 0x44a4
movl $0xb, 0x88(%rbx)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq %rax, 0x90(%rbx)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/0xADE1A1DE[P]MeasureSuite/lib/src/io/shared_object.c
// Function: so_load_file
int so_load_file(struct measuresuite *ms, struct function_tuple *fct,
                 const char *filename) {

  if (access(filename, F_OK | X_OK | R_OK) != 0) {
    ms->errorno = E_LOAD__SO_FILE;
    ms->additional_info = strerror(errno);
    return 1;
  }

  // clear error
  dlerror();

  // open
  fct->lib_handle = dlopen(filename, RTLD_NOW | RTLD_LOCAL);

  // check
  if (fct->lib_handle == NULL) {
    ms->errorno = E_INTERNAL_MEASURE__AI__DLOPEN;
    ms->additional_info = dlerror();
    return 1;
  }

  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq %rdx, %rdi
movl $0x5, %esi
callq 0x2200
testl %eax, %eax
je 0x44f7
movl $0x1a, 0x88(%rbx)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq %rax, 0x90(%rbx)
movl $0x1, %eax
jmp 0x4517
callq 0x2030
movq %r15, %rdi
movl $0x2, %esi
callq 0x2180
movq %rax, %rcx
movq %rax, 0x10(%r14)
xorl %eax, %eax
testq %rcx, %rcx
je 0x451d
popq %rbx
popq %r14
popq %r15
retq
movl $0x15, 0x88(%rbx)
callq 0x2030
jmp 0x44e9
// File: /workspace/github_c_makefile_star2_O3/0xADE1A1DE[P]MeasureSuite/lib/src/io/shared_object.c
// Function: so_load_symbol
int so_load_symbol(struct measuresuite *ms, struct function_tuple *fct,
                   const char *symbol) {

  // sanity check  the handle
  if (fct->lib_handle == NULL) {
    return 1;
  }

  // clear error
  dlerror();

  // load
  fct->code = dlsym(fct->lib_handle, symbol);

  /// check
  if (fct->code == NULL) {
    ms->errorno = E_INTERNAL_MEASURE__AI__DLSYM;
    ms->additional_info = dlerror();
    return 1;
  }

  return 0;
}

// Assembly:
movl $0x1, %eax
cmpq $0x0, 0x10(%rsi)
je 0x4587
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
callq 0x2030
movq 0x10(%r14), %rdi
movq %r15, %rsi
callq 0x2230
movq %rax, %rcx
movq %rax, 0x8(%r14)
xorl %eax, %eax
testq %rcx, %rcx
jne 0x4582
movl $0x14, 0x88(%rbx)
callq 0x2030
movq %rax, 0x90(%rbx)
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
retq