LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/aligrudi[P]gpss/gpss.c
// Function: gpss_greedymin_cont
static int gpss_greedymin_cont(int *S, int *P, int *ptmk)
{
	int i;
	int S_n = 0;
	for (i = 0; i < pt_n; i++) {
		int p = gpss_greedymin_next(P, ptmk);
		if (p < 0)
			break;
		ptmk[p] = 1;
		S[S_n++] = p;
	}
	return S_n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movslq 0x31a5(%rip), %rbx      # 0x5070
testq %rbx, %rbx
jle 0x20a8
movq 0x31b5(%rip), %rax      # 0x5090
movq %rax, 0x8(%rsp)
movq 0x31a1(%rip), %rax      # 0x5088
movq %rax, 0x20(%rsp)
movq 0x318d(%rip), %r15      # 0x5080
movq 0x317e(%rip), %r14      # 0x5078
xorl %eax, %eax
movq %rdx, 0x10(%rsp)
movq %rsi, 0x28(%rsp)
movq %rax, 0x18(%rsp)
movslq 0x3162(%rip), %rdi      # 0x5074
movl $0x4, %esi
callq 0x1080
movq %rax, %r13
movl $0x4, %esi
movq %rbx, %rdi
callq 0x1080
movq %rax, %rbp
movl $0x4, %esi
movq %rbx, %rdi
callq 0x1080
movq 0x10(%rsp), %rdx
movq %rax, %r12
xorl %eax, %eax
cmpl $0x0, (%rdx,%rax,4)
je 0x1f76
movq 0x8(%rsp), %rcx
movslq (%rcx,%rax,4), %rcx
testq %rcx, %rcx
jle 0x1f76
movq 0x20(%rsp), %rsi
movq (%rsi,%rax,8), %r8
xorl %esi, %esi
movslq (%r8,%rsi,4), %rdi
incl (%r13,%rdi,4)
incq %rsi
cmpq %rsi, %rcx
jne 0x1f65
incq %rax
cmpq %rbx, %rax
jne 0x1f46
xorl %eax, %eax
movq 0x8(%rsp), %rcx
movslq (%rcx,%rax,4), %rcx
testq %rcx, %rcx
jle 0x1feb
movq 0x20(%rsp), %rsi
movq (%rsi,%rax,8), %r11
xorl %esi, %esi
movslq (%r11,%rsi,4), %rdi
cmpl $0x2, (%r13,%rdi,4)
jl 0x1fad
movl $0x1, (%r12,%rax,4)
incq %rsi
cmpq %rsi, %rcx
jne 0x1f99
cmpl $0x0, (%r12,%rax,4)
jne 0x1feb
xorl %esi, %esi
movslq (%r11,%rsi,4), %r8
movslq (%r15,%r8,4), %rdi
testq %rdi, %rdi
jle 0x1fe3
movq (%r14,%r8,8), %r8
xorl %r9d, %r9d
movslq (%r8,%r9,4), %r10
incl (%rbp,%r10,4)
incq %r9
cmpq %r9, %rdi
jne 0x1fd2
incq %rsi
cmpq %rcx, %rsi
jne 0x1fbe
incq %rax
cmpq %rbx, %rax
jne 0x1f80
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
xorl %eax, %eax
movq 0x28(%rsp), %rsi
movl (%rsi,%rax,4), %ecx
movslq %ecx, %rdi
cmpl $0x0, (%rdx,%rdi,4)
jne 0x2029
cmpl $0x0, (%r12,%rdi,4)
jne 0x2029
testl %r9d, %r9d
js 0x2026
movl (%rbp,%rdi,4), %edi
movl %r9d, %r8d
cmpl (%rbp,%r8,4), %edi
jge 0x2029
movl %ecx, %r9d
incq %rax
cmpq %rax, %rbx
jne 0x2000
xorl %eax, %eax
movl (%rsi,%rax,4), %ecx
movslq %ecx, %rdi
cmpl $0x0, (%rdx,%rdi,4)
jne 0x2052
cmpl $0x0, (%r12,%rdi,4)
jne 0x2052
movq 0x8(%rsp), %r8
cmpl $0x1, (%r8,%rdi,4)
je 0x207d
incq %rax
cmpq %rax, %rbx
jne 0x2033
movq %r13, %rdi
movl %r9d, %r13d
callq 0x1030
movq %rbp, %rdi
callq 0x1030
movq %r12, %rdi
callq 0x1030
movq 0x10(%rsp), %rdx
movl %r13d, %ecx
testl %ecx, %ecx
js 0x20ac
movl %ecx, %eax
movl $0x1, (%rdx,%rax,4)
movq 0x30(%rsp), %rax
movq 0x18(%rsp), %rdi
movl %ecx, (%rax,%rdi,4)
movq %rdi, %rax
incq %rax
cmpq %rbx, %rax
jne 0x1f06
jmp 0x20b1
xorl %ebx, %ebx
jmp 0x20b1
movq 0x18(%rsp), %rbx
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/saulvargas[P]re-C-sys/test_recdata.c
// Function: main
int main(int argc, char** argv) {
    FILE* user_data;
    FILE* item_data;
    int N_users;
    int N_items;
    int N_prefs;
    int binary;
    recdata_t* recdata;

    if (!read_args(argc, argv, &user_data, &item_data, &N_users, &N_items, &N_prefs, &binary)) {
        return EXIT_FAILURE;
    }

    recdata = recdata_simple_create(user_data, item_data, N_users, N_items, N_prefs, binary);
    
    fclose(user_data);
    fclose(item_data);
    
    recdata_close(recdata);
    
    return EXIT_SUCCESS;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rsp, %rax
leaq 0x4(%rsp), %r10
leaq 0x18(%rsp), %rdx
leaq 0x10(%rsp), %rcx
leaq 0xc(%rsp), %r8
leaq 0x8(%rsp), %r9
pushq %rax
pushq %r10
callq 0x25d4
addq $0x10, %rsp
testl %eax, %eax
je 0x1270
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl 0xc(%rsp), %edx
movl 0x8(%rsp), %ecx
movl 0x4(%rsp), %r8d
movl (%rsp), %r9d
callq 0x15dd
movq %rax, %rbx
movq 0x18(%rsp), %rdi
callq 0x1060
movq 0x10(%rsp), %rdi
callq 0x1060
movq %rbx, %rdi
callq 0x12b4
xorl %eax, %eax
jmp 0x1275
movl $0x1, %eax
addq $0x20, %rsp
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O3/saulvargas[P]re-C-sys/recdata_simple.c
// Function: recdata_simple_create
recdata_t* recdata_simple_create(FILE* user_data, FILE* item_data, int N_users, int N_items, int N_prefs, int binary) {
    recdata_t* recdata;
    recdata_simple_args_t* args;
    
    recdata = malloc(sizeof(recdata_t));
    recdata->N_users = N_users;
    recdata->N_items = N_items;
    recdata->N_prefs = N_prefs;
    
    recdata->userdata_size = recdata_simple_userdata_size;
    recdata->itemdata_size = recdata_simple_itemdata_size;
    recdata->userdata = recdata_simple_userdata;
    recdata->itemdata = recdata_simple_itemdata;
    recdata->close = recdata_simple_close;
    
    args = malloc(sizeof(recdata_simple_args_t));
    recdata->args = args;
    
    args->binary = binary;
    read_data(&(args->n_userdata), &(args->i_userdata), &(args->r_userdata), user_data, N_users, N_prefs, binary);
    
    read_data(&(args->n_itemdata), &(args->i_itemdata), &(args->r_itemdata), item_data, N_items, N_prefs, binary);
    
    return recdata;    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %r15d
movl %r8d, %ebx
movl %ecx, %ebp
movl %edx, %r13d
movq %rsi, 0x10(%rsp)
movq %rdi, 0x8(%rsp)
movl $0x40, %edi
callq 0x10b0
movq %rax, %r12
movl %r13d, (%rax)
movl %ebp, 0x4(%rax)
movl %ebx, 0x8(%rax)
leaq -0x355(%rip), %rax      # 0x12c8
movq %rax, 0x10(%r12)
leaq -0x357(%rip), %rax      # 0x12d2
movq %rax, 0x18(%r12)
leaq -0x358(%rip), %rax      # 0x12dd
movq %rax, 0x20(%r12)
leaq -0x336(%rip), %rax      # 0x130b
movq %rax, 0x28(%r12)
leaq -0x313(%rip), %rax      # 0x133a
movq %rax, 0x30(%r12)
movl $0x38, %edi
callq 0x10b0
movq %rax, %r14
movq %rax, 0x38(%r12)
movl %r15d, 0x30(%rax)
leaq 0x8(%rax), %rsi
leaq 0x10(%rax), %rdx
movl %r15d, (%rsp)
movq %rax, %rdi
movq 0x8(%rsp), %rcx
movl %r13d, %r8d
movl %ebx, %r9d
callq 0x13b8
leaq 0x18(%r14), %rdi
leaq 0x20(%r14), %rsi
addq $0x28, %r14
movl %r15d, (%rsp)
movq %r14, %rdx
movq 0x10(%rsp), %rcx
movl %ebp, %r8d
movl %ebx, %r9d
callq 0x13b8
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/saulvargas[P]re-C-sys/recdata_transposed.c
// Function: recdata_transposed_create
recdata_t* recdata_transposed_create(recdata_t* recdata0) {
    recdata_t* recdata;
    
    recdata = malloc(sizeof(recdata_t));
    recdata->N_users = recdata0->N_items;
    recdata->N_items = recdata0->N_users;
    recdata->N_prefs = recdata0->N_prefs;
    
    recdata->userdata_size = recdata0->itemdata_size;
    recdata->itemdata_size = recdata0->userdata_size;
    recdata->userdata = recdata0->itemdata;
    recdata->itemdata = recdata0->userdata;
    recdata->close = recdata_transposed_close;
    
    recdata->args = recdata0->args;
    
    return recdata;    
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x40, %edi
callq 0x10b0
movq (%rbx), %xmm0
pshufd $0xe1, %xmm0, %xmm0     # xmm0 = xmm0[1,0,2,3]
movq %xmm0, (%rax)
movl 0x8(%rbx), %ecx
movl %ecx, 0x8(%rax)
movdqu 0x10(%rbx), %xmm0
pshufd $0x4e, %xmm0, %xmm0     # xmm0 = xmm0[2,3,0,1]
movdqu %xmm0, 0x10(%rax)
movdqu 0x20(%rbx), %xmm0
pshufd $0x4e, %xmm0, %xmm0     # xmm0 = xmm0[2,3,0,1]
movdqu %xmm0, 0x20(%rax)
leaq -0x47(%rip), %rcx       # 0x16bc
movq %rcx, 0x30(%rax)
movq 0x38(%rbx), %rcx
movq %rcx, 0x38(%rax)
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/saulvargas[P]re-C-sys/similarity_setcosine.c
// Function: similarity_setcosine_calculate
idpairs_t* similarity_setcosine_calculate(int uid, int k, void* args) {
    recdata_t* recdata;
    int* coo;
    idpairs_t* ud;
    idpairs_t* id;
    int i;
    int j;
    int vid;
    int iid;
    topn_t* topn;
    idpairs_t* pairs;
    
    recdata = args;
    
    coo = calloc(recdata->N_users, sizeof(int));
    
    ud = recdata_userdata(recdata, uid);
    for (i = 0; i < idpairs_size(ud); i++) {
        iid = idpairs_keys(ud)[i];
        id = recdata_itemdata(recdata, iid);
        for (j = 0; j < idpairs_size(id); j++) {
            vid = idpairs_keys(id)[j];
            coo[vid]++;
        }
        idpairs_close_shallow(id);
    }
    idpairs_close_shallow(ud);
    
    coo[uid] = 0;
    
    topn = topn_create(k);
    for (vid = 0; vid < recdata->N_users; vid++) {
        if (coo[vid] > 0) {
            topn_add(topn, vid, coo[vid] / sqrt(recdata_userdata_size(recdata, uid) * recdata_userdata_size(recdata, vid)));
        }
    }
    
    free(coo);

    pairs = topn_get_pairs(topn);
    
    topn_close(topn);

    return pairs;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, 0x4(%rsp)
movl %edi, %ebp
movslq (%rdx), %rdi
movl $0x4, %esi
callq 0x1090
movq %rax, %r14
movq %rbx, %rdi
movl %ebp, (%rsp)
movl %ebp, %esi
callq 0x1298
movq %rax, %r12
movq %rax, %rdi
callq 0x24f1
testl %eax, %eax
jle 0x17dc
xorl %r15d, %r15d
movq %r12, %rdi
callq 0x24f4
movl (%rax,%r15,4), %esi
movq %rbx, %rdi
callq 0x12a6
movq %rax, %r13
movq %rax, %rdi
callq 0x24f1
testl %eax, %eax
jle 0x17c2
xorl %ebp, %ebp
movq %r13, %rdi
callq 0x24f4
movslq (%rax,%rbp,4), %rax
incl (%r14,%rax,4)
incq %rbp
movq %r13, %rdi
callq 0x24f1
cltq
cmpq %rax, %rbp
jl 0x17a0
movq %r13, %rdi
callq 0x24ec
incq %r15
movq %r12, %rdi
callq 0x24f1
cltq
cmpq %rax, %r15
jl 0x177b
movq %r12, %rdi
callq 0x24ec
movslq (%rsp), %rax
movl $0x0, (%r14,%rax,4)
movl 0x4(%rsp), %edi
callq 0x1bbc
movq %rax, %r15
movl (%rbx), %eax
testl %eax, %eax
jle 0x186d
xorl %r12d, %r12d
movl (%r14,%r12,4), %ebp
testl %ebp, %ebp
jle 0x1862
movq %rbx, %rdi
movl (%rsp), %esi
callq 0x127c
movl %eax, %r13d
movq %rbx, %rdi
movl %r12d, %esi
callq 0x127c
imull %r13d, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
ucomisd 0x17cf(%rip), %xmm0     # 0x3008
jb 0x1841
sqrtsd %xmm0, %xmm0
jmp 0x1846
callq 0x10f0
xorps %xmm1, %xmm1
cvtsi2sd %ebp, %xmm1
divsd %xmm0, %xmm1
movq %r15, %rdi
movl %r12d, %esi
movapd %xmm1, %xmm0
callq 0x1e4d
movl (%rbx), %eax
incq %r12
movslq %eax, %rcx
cmpq %rcx, %r12
jl 0x1805
movq %r14, %rdi
callq 0x1030
movq %r15, %rdi
callq 0x1f99
movq %rax, %rbx
movq %r15, %rdi
callq 0x1c09
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/saulvargas[P]re-C-sys/similarity_setcosine.c
// Function: similarity_setcosine_create
similarity_t* similarity_setcosine_create(recdata_t* recdata) {
    similarity_t* similarity;
    
    similarity = malloc(sizeof(similarity_t));
    similarity->calculate = similarity_setcosine_calculate;
    similarity->close = similarity_setcosine_close;
    similarity->args = recdata;
    
    return similarity;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x18, %edi
callq 0x10b0
leaq -0x178(%rip), %rcx      # 0x1738
movq %rcx, (%rax)
leaq -0x20(%rip), %rcx       # 0x189a
movq %rcx, 0x8(%rax)
movq %rbx, 0x10(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/saulvargas[P]re-C-sys/similarity_veccosine.c
// Function: similarity_veccosine_calculate
idpairs_t* similarity_veccosine_calculate(int uid, int k, void* args) {
    recdata_t* recdata;
    double* norm;
    double* coo;
    idpairs_t* ud;
    idpairs_t* id;
    int i;
    int j;
    int vid;
    int iid;
    double r;
    topn_t* topn;
    idpairs_t* pairs;
    
    recdata = ((similarity_veccosine_args_t*) args)->recdata;
    norm = ((similarity_veccosine_args_t*) args)->norm;
    
    coo = calloc(recdata->N_users, sizeof(double));
    
    ud = recdata_userdata(recdata, uid);
    for (i = 0; i < idpairs_size(ud); i++) {
        iid = idpairs_keys(ud)[i];
        r = idpairs_values(ud)[i];
        id = recdata_itemdata(recdata, iid);
        for (j = 0; j < idpairs_size(id); j++) {
            vid = idpairs_keys(id)[j];
            coo[vid] += r * idpairs_values(id)[j];
        }
        idpairs_close_shallow(id);
    }
    idpairs_close_shallow(ud);
    
    coo[uid] = 0.0;
    
    topn = topn_create(k);
    for (vid = 0; vid < recdata->N_users; vid++) {
        if (coo[vid] > 0) {
            topn_add(topn, vid, coo[vid] * norm[uid] * norm[vid]);
        }
    }
    
    free(coo);

    pairs = topn_get_pairs(topn);
    
    topn_close(topn);

    return pairs;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, 0x14(%rsp)
movl %edi, %ebp
movq (%rdx), %rbx
movq 0x8(%rdx), %rax
movq %rax, 0x18(%rsp)
movslq (%rbx), %rdi
movl $0x8, %esi
callq 0x1090
movq %rax, %r14
movq %rbx, 0x8(%rsp)
movq %rbx, %rdi
movl %ebp, 0x10(%rsp)
movl %ebp, %esi
callq 0x1298
movq %rax, %r12
movq %rax, %rdi
callq 0x24f1
testl %eax, %eax
jle 0x19b6
xorl %r15d, %r15d
movq %r12, %rdi
callq 0x24f4
movl (%rax,%r15,4), %r13d
movq %r12, %rdi
callq 0x24f9
movsd (%rax,%r15,8), %xmm0
movsd %xmm0, 0x20(%rsp)
movq 0x8(%rsp), %rdi
movl %r13d, %esi
callq 0x12a6
movq %rax, %r13
movq %rax, %rdi
callq 0x24f1
testl %eax, %eax
jle 0x1998
xorl %ebp, %ebp
movq %r13, %rdi
callq 0x24f4
movslq (%rax,%rbp,4), %rbx
movq %r13, %rdi
callq 0x24f9
movsd (%rax,%rbp,8), %xmm0
mulsd 0x20(%rsp), %xmm0
addsd (%r14,%rbx,8), %xmm0
movsd %xmm0, (%r14,%rbx,8)
incq %rbp
movq %r13, %rdi
callq 0x24f1
cltq
cmpq %rax, %rbp
jl 0x195b
movq %r13, %rdi
callq 0x24ec
incq %r15
movq %r12, %rdi
callq 0x24f1
cltq
cmpq %rax, %r15
jl 0x191d
movq %r12, %rdi
callq 0x24ec
movslq 0x10(%rsp), %r13
movq $0x0, (%r14,%r13,8)
movl 0x14(%rsp), %edi
callq 0x1bbc
movq %rax, %r15
movq 0x8(%rsp), %rax
movl (%rax), %eax
testl %eax, %eax
movq 0x18(%rsp), %rbx
jle 0x1a27
xorl %r12d, %r12d
xorpd %xmm1, %xmm1
movsd (%r14,%r12,8), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x1a1c
mulsd (%rbx,%r13,8), %xmm0
mulsd (%rbx,%r12,8), %xmm0
movq %r15, %rdi
movl %r12d, %esi
callq 0x1e4d
xorpd %xmm1, %xmm1
movq 0x8(%rsp), %rax
movl (%rax), %eax
incq %r12
movslq %eax, %rcx
cmpq %rcx, %r12
jl 0x19ee
movq %r14, %rdi
callq 0x1030
movq %r15, %rdi
callq 0x1f99
movq %rax, %rbx
movq %r15, %rdi
callq 0x1c09
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/saulvargas[P]re-C-sys/similarity_veccosine.c
// Function: calculate_norm
double* calculate_norm(recdata_t* recdata) {
    int i;
    int uid;
    idpairs_t* ud;
    double* norm;
    
    norm = malloc(recdata->N_users * sizeof(double));
     
    for (uid = 0; uid < recdata->N_users; uid++) {
        ud = recdata_userdata(recdata, uid);
        norm[uid] = 0.0;
        for (i = 0; i < idpairs_size(ud); i++) {
            norm[uid] += idpairs_values(ud)[i] * idpairs_values(ud)[i];
        }
        norm[uid] = 1 / sqrt(norm[uid]);
        idpairs_close_shallow(ud);
    }
     
    return norm;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movslq (%rdi), %r15
leaq (,%r15,8), %rdi
callq 0x10b0
movq %rax, %r14
testq %r15, %r15
jle 0x1b55
xorl %r15d, %r15d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x1298
movq %rax, %r12
movq %rax, %rdi
callq 0x24f1
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
testl %eax, %eax
jle 0x1b12
movsd %xmm0, (%rsp)
xorl %r13d, %r13d
movq %r12, %rdi
callq 0x24f9
movsd (%rax,%r13,8), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r12, %rdi
callq 0x24f9
movsd 0x8(%rsp), %xmm1
mulsd (%rax,%r13,8), %xmm1
movsd (%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rsp)
movsd %xmm0, (%r14,%r15,8)
incq %r13
movq %r12, %rdi
callq 0x24f1
cltq
cmpq %rax, %r13
jl 0x1ac4
movsd (%rsp), %xmm0
ucomisd 0x14e9(%rip), %xmm0     # 0x3008
jb 0x1b27
sqrtsd %xmm0, %xmm0
jmp 0x1b2c
callq 0x10f0
movsd 0x14dc(%rip), %xmm1     # 0x3010
divsd %xmm0, %xmm1
movsd %xmm1, (%r14,%r15,8)
movq %r12, %rdi
callq 0x24ec
incq %r15
movslq (%rbx), %rax
cmpq %rax, %r15
jl 0x1a99
movq %r14, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/saulvargas[P]re-C-sys/similarity_veccosine.c
// Function: similarity_veccosine_create
similarity_t* similarity_veccosine_create(recdata_t* recdata) {
    similarity_t* similarity;
    similarity_veccosine_args_t* args;
    
    similarity = malloc(sizeof(similarity_t));
    similarity->calculate = similarity_veccosine_calculate;
    similarity->close = similarity_veccosine_close;
    
    args = malloc(sizeof(similarity_veccosine_args_t));
    args->recdata = recdata;
    args->norm = calculate_norm(recdata);
    similarity->args = args;
    
    return similarity;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x18, %edi
callq 0x10b0
movq %rax, %r14
leaq -0x2be(%rip), %rax      # 0x18c4
movq %rax, (%r14)
leaq -0x138(%rip), %rax      # 0x1a54
movq %rax, 0x8(%r14)
movl $0x10, %edi
callq 0x10b0
movq %rax, %r15
movq %rbx, (%rax)
movq %rbx, %rdi
callq 0x1a6a
movq %rax, 0x8(%r15)
movq %r15, 0x10(%r14)
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/saulvargas[P]re-C-sys/topn.c
// Function: reverse
void reverse(topn_t* topn) {
    int i = 0;
    int j = topn->size - 1;
    while (j > i) {
        swap(topn, i, j);
        j--;
        i++;
    }
}

// Assembly:
movslq 0x14(%rdi), %rax
cmpq $0x2, %rax
jl 0x1cab
movq (%rdi), %rcx
movq 0x8(%rdi), %rdx
addq $-0x2, %rax
xorl %esi, %esi
movl (%rcx,%rsi,4), %edi
movl 0x4(%rcx,%rax,4), %r8d
movl %r8d, (%rcx,%rsi,4)
movl %edi, 0x4(%rcx,%rax,4)
movsd (%rdx,%rsi,8), %xmm0
movsd 0x8(%rdx,%rax,8), %xmm1
movsd %xmm1, (%rdx,%rsi,8)
movsd %xmm0, 0x8(%rdx,%rax,8)
incq %rsi
leaq -0x1(%rax), %rdi
cmpq %rsi, %rax
movq %rdi, %rax
jg 0x1c76
retq
// File: /workspace/github_c_makefile_star2_O3/saulvargas[P]re-C-sys/topn.c
// Function: minChild
int minChild(topn_t* topn, int i) {
    int l = left(i);
    int r = right(i);

    if (l >= topn->capacity) {
        return -1;
    }

    if (r >= topn->size) {
        return l;
    }

    return (topn->values[l] < topn->values[r] || (topn->values[l] == topn->values[r] && topn->keys[l] < topn->keys[r])) ? l : r;
}

// Assembly:
leal 0x1(,%rsi,2), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl 0x10(%rdi), %ecx
jge 0x1d05
leal 0x2(,%rsi,2), %edx
cmpl 0x14(%rdi), %edx
jge 0x1d03
movq 0x8(%rdi), %r8
movslq %ecx, %rax
movsd (%r8,%rax,8), %xmm0
movslq %edx, %rsi
movsd (%r8,%rsi,8), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x1d06
movl %ecx, %eax
retq
ucomisd %xmm1, %xmm0
jne 0x1d1d
jp 0x1d1d
movq (%rdi), %rdi
movl (%rdi,%rax,4), %r8d
movl %ecx, %eax
cmpl (%rdi,%rsi,4), %r8d
jl 0x1d05
movl %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/saulvargas[P]re-C-sys/topn.c
// Function: topn_sort
void topn_sort(topn_t* topn) {
    int i;
    int j;

    int origSize = topn->size;
    int origCapacity = topn->capacity;
    topn->capacity = topn->size;
    while (topn->size > 0) {
        swap(topn, 0, topn->size - 1);
        topn->size--;
        topn->capacity--;
        i = 0;
        j = minChild(topn, i);
        while (j != -1 && (topn->values[i] > topn->values[j] || (topn->values[i] == topn->values[j] && topn->keys[i] > topn->keys[j]))) {
            swap(topn, i, j);
            i = j;
            j = minChild(topn, i);
        }
    }
    topn->size = origSize;
    topn->capacity = origCapacity;
    reverse(topn);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl 0x10(%rdi), %r14d
movl 0x14(%rdi), %r15d
movl %r15d, 0x10(%rdi)
testl %r15d, %r15d
jle 0x1e21
movq (%rbx), %r12
movq 0x8(%rbx), %r13
movl %r15d, %eax
decl %eax
movl (%r12), %ecx
movl (%r12,%rax,4), %edx
movl %edx, (%r12)
movl %ecx, (%r12,%rax,4)
movsd (%r13), %xmm0
movsd (%r13,%rax,8), %xmm1
movsd %xmm1, (%r13)
movsd %xmm0, (%r13,%rax,8)
movq 0x10(%rbx), %xmm0
paddd 0x1297(%rip), %xmm0     # 0x3020
movdqa %xmm0, (%rsp)
movq %xmm0, 0x10(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1cca
cmpl $-0x1, %eax
je 0x1e0f
movl %eax, %ebp
movsd (%r13), %xmm1
xorl %ecx, %ecx
movsd %xmm1, (%rsp)
movslq %ecx, %rax
movslq %ebp, %rsi
movsd (%r13,%rsi,8), %xmm0
ucomisd %xmm0, %xmm1
jbe 0x1dce
movl (%r12,%rax,4), %ecx
movl (%r12,%rsi,4), %edx
jmp 0x1dde
jne 0x1e0a
jp 0x1e0a
movl (%r12,%rax,4), %ecx
movl (%r12,%rsi,4), %edx
cmpl %edx, %ecx
jle 0x1e0a
movl %edx, (%r12,%rax,4)
movl %ecx, (%r12,%rsi,4)
movsd %xmm0, (%r13,%rax,8)
movsd %xmm1, (%r13,%rsi,8)
movq %rbx, %rdi
callq 0x1cca
movsd (%rsp), %xmm1
movl %ebp, %ecx
movl %eax, %ebp
cmpl $-0x1, %eax
jne 0x1db1
movl 0x14(%rbx), %eax
jmp 0x1e19
pshufd $0x55, (%rsp), %xmm0    # xmm0 = mem[1,1,1,1]
movd %xmm0, %eax
testl %eax, %eax
jg 0x1d50
movl %r15d, 0x14(%rbx)
movl %r14d, 0x10(%rbx)
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1c5f
// File: /workspace/github_c_makefile_star2_O3/saulvargas[P]re-C-sys/topn.c
// Function: topn_add
int topn_add(topn_t* topn, int key, double value) {
    int i;
    int j;

    if (topn->size < topn->capacity) {
        i = topn->size;
        j = parent(i);
        topn->keys[i] = key;
        topn->values[i] = value;
        while (i > 0 && (topn->values[j] > topn->values[i] || (topn->values[j] == topn->values[i] && topn->keys[j] > topn->keys[i]))) {
            swap(topn, i, j);
            i = j;
            j = parent(i);
        }
        topn->size++;

        return 1;
    } else {
        if (topn->values[0] > value || (topn->values[0] == value && topn->keys[0] > key)) {
            return 0;
        }
        i = 0;
        j = minChild(topn, i);
        topn->keys[i] = key;
        topn->values[i] = value;
        while (j != -1 && (topn->values[i] > topn->values[j] || (topn->values[i] == topn->values[j] && topn->keys[i] > topn->keys[j]))) {
            swap(topn, i, j);
            i = j;
            j = minChild(topn, i);
        }

        return 1;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movl 0x14(%rdi), %edx
cmpl 0x10(%rdi), %edx
jge 0x1edb
movslq %edx, %rsi
movq (%rbx), %rax
movl %ebp, (%rax,%rsi,4)
movq 0x8(%rbx), %rcx
movsd %xmm0, (%rcx,%rsi,8)
testl %edx, %edx
jle 0x1ece
leal -0x1(%rdx), %edi
shrl $0x1f, %edi
movl %edx, %esi
addl %edi, %edx
decl %edx
sarl %edx
movslq %edx, %rdi
movsd (%rcx,%rdi,8), %xmm0
movsd (%rcx,%rsi,8), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x1ea6
movl (%rax,%rsi,4), %r8d
movl (%rax,%rdi,4), %r9d
jmp 0x1eb7
jne 0x1ece
jp 0x1ece
movl (%rax,%rdi,4), %r9d
movl (%rax,%rsi,4), %r8d
cmpl %r8d, %r9d
jle 0x1ece
movl %r9d, (%rax,%rsi,4)
movl %r8d, (%rax,%rdi,4)
movsd %xmm0, (%rcx,%rsi,8)
movsd %xmm1, (%rcx,%rdi,8)
cmpl $0x2, %esi
jg 0x1e7b
incl 0x14(%rbx)
movl $0x1, %ecx
jmp 0x1f88
movq 0x8(%rbx), %r15
movsd (%r15), %xmm1
xorl %ecx, %ecx
ucomisd %xmm0, %xmm1
ja 0x1f88
movq (%rbx), %r12
jne 0x1f01
jp 0x1f01
cmpl %ebp, (%r12)
jg 0x1f88
xorl %r13d, %r13d
movq %rbx, %rdi
xorl %esi, %esi
movsd %xmm0, (%rsp)
callq 0x1cca
movsd (%rsp), %xmm1
movl %ebp, (%r12)
movsd %xmm1, (%r15)
movl $0x1, %ecx
cmpl $-0x1, %eax
je 0x1f88
movl %eax, %r14d
movslq %eax, %rsi
movsd (%r15,%rsi,8), %xmm0
ucomisd %xmm0, %xmm1
jbe 0x1f43
movl (%r12,%rsi,4), %eax
jmp 0x1f57
ucomisd %xmm1, %xmm0
jne 0x1ed1
jp 0x1ed1
movl (%r12,%rsi,4), %eax
cmpl %ebp, %eax
jge 0x1ed1
movslq %r13d, %rcx
movl %eax, (%r12,%rcx,4)
movl %ebp, (%r12,%rsi,4)
movsd %xmm0, (%r15,%rcx,8)
movsd %xmm1, (%r15,%rsi,8)
movq %rbx, %rdi
callq 0x1cca
movsd (%rsp), %xmm1
movl %r14d, %r13d
cmpl $-0x1, %eax
jne 0x1f2b
jmp 0x1ed1
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/saulvargas[P]re-C-sys/topn.c
// Function: topn_get_pairs
idpairs_t* topn_get_pairs(topn_t* topn) {
    idpairs_t* pairs = idpairs_create(topn_size(topn), malloc(topn_size(topn) * sizeof(int)), malloc(topn_size(topn) * sizeof(double)));
    memcpy(idpairs_keys(pairs), topn->keys, topn_size(topn) * sizeof(int));
    memcpy(idpairs_values(pairs), topn->values, topn_size(topn) * sizeof(double));
    
    return pairs;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movslq 0x14(%rdi), %r14
leaq (,%r14,4), %rdi
callq 0x10b0
movq %rax, %r15
movq %r14, %rdi
shlq $0x3, %rdi
callq 0x10b0
movl %r14d, %edi
movq %r15, %rsi
movq %rax, %rdx
callq 0x24a8
movq %rax, %r14
movq %rax, %rdi
callq 0x24f4
movq (%rbx), %rsi
movslq 0x14(%rbx), %rdx
shlq $0x2, %rdx
movq %rax, %rdi
callq 0x10a0
movq %r14, %rdi
callq 0x24f9
movq 0x8(%rbx), %rsi
movslq 0x14(%rbx), %rdx
shlq $0x3, %rdx
movq %rax, %rdi
callq 0x10a0
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O3/saulvargas[P]re-C-sys/recommender.c
// Function: recommender_recommend
idpairs_t* recommender_recommend(recommender_t* recommender, int uid, int n) {
    recdata_t* recdata;
    idpairs_t* pairs;
    idpairs_t* ud;
    int i;
    int iid;
    int jid;
    topn_t* topn;
    double* scores;
    
    recdata = recommender->recdata;
    
    scores = recommender->recommend(uid, recommender->recdata, recommender->args);

    ud = recdata_userdata(recdata, uid);
    for (i = 0; i < idpairs_size(ud); i++) {
        jid = idpairs_keys(ud)[i];
        scores[jid] = 0.0;
    }
    idpairs_close_shallow(ud);

    topn = topn_create(n);
    for (iid = 0; iid < recdata->N_items; iid++) {
        if (scores[iid] > 0) {
            topn_add(topn, iid, scores[iid]);
        }
    }
    
    free(scores);

    topn_sort(topn);
    pairs = topn_get_pairs(topn);
    idpairs_revert(pairs);
    
    topn_close(topn);

    return pairs;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movl %esi, %r15d
movq %rdi, %rax
movq 0x10(%rdi), %rbx
movq 0x18(%rdi), %rdx
movl %esi, %edi
movq %rbx, %rsi
callq *(%rax)
movq %rax, %r14
movq %rbx, %rdi
movl %r15d, %esi
callq 0x1298
movq %rax, %r15
movq %rax, %rdi
callq 0x24f1
testl %eax, %eax
jle 0x2079
xorl %r12d, %r12d
movq %r15, %rdi
callq 0x24f4
movslq (%rax,%r12,4), %rax
movq $0x0, (%r14,%rax,8)
incq %r12
movq %r15, %rdi
callq 0x24f1
cltq
cmpq %rax, %r12
jl 0x2053
movq %r15, %rdi
callq 0x24ec
movl %ebp, %edi
callq 0x1bbc
movq %rax, %r15
movl 0x4(%rbx), %eax
testl %eax, %eax
jle 0x20c2
xorl %r12d, %r12d
xorpd %xmm1, %xmm1
movsd (%r14,%r12,8), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x20b7
movq %r15, %rdi
movl %r12d, %esi
callq 0x1e4d
xorpd %xmm1, %xmm1
movl 0x4(%rbx), %eax
incq %r12
movslq %eax, %rcx
cmpq %rcx, %r12
jl 0x2099
movq %r14, %rdi
callq 0x1030
movq %r15, %rdi
callq 0x1d20
movq %r15, %rdi
callq 0x1f99
movq %rax, %rbx
movq %rax, %rdi
callq 0x2562
movq %r15, %rdi
callq 0x1c09
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/saulvargas[P]re-C-sys/recommender_ub.c
// Function: recommender_ub_recommend
double* recommender_ub_recommend(int uid, recdata_t* recdata, void* args) {
    idpairs_t* neighbors;
    idpairs_t* vd;
    int i;
    int j;
    int vid;
    double s;
    int iid;
    similarity_t* similarity = ((recommender_ub_args_t*) args)->similarity;
    int k = ((recommender_ub_args_t*) args)->k;
    int binary = ((recommender_ub_args_t*) args)->binary;
    
    double* scores = calloc(recdata->N_items, sizeof(double));
    
    neighbors = similarity_calculate(similarity, uid, k);
    for (i = 0; i < idpairs_size(neighbors); i++) {
        vid = idpairs_keys(neighbors)[i];
        vd = recdata_userdata(recdata, vid);
        s = idpairs_values(neighbors)[i];
        for (j = 0; j < idpairs_size(vd); j++) {
            iid = idpairs_keys(vd)[j];
            scores[iid] += binary ? (s) : (s * idpairs_values(vd)[j]);
        }
        idpairs_close_shallow(vd);
    }
    idpairs_close_deep(neighbors);

    return scores;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edi, %ebp
movq (%rdx), %r15
movl 0x8(%rdx), %r12d
movl 0xc(%rdx), %r13d
movq %rsi, 0x10(%rsp)
movslq 0x4(%rsi), %rdi
movl $0x8, %esi
callq 0x1090
movq %rax, %r14
movq %r15, %rdi
movl %ebp, %esi
movl %r12d, %edx
callq 0x1714
movq %rax, %rbx
movq %rax, %rdi
callq 0x24f1
testl %eax, %eax
jle 0x220d
xorl %ebp, %ebp
movq %rbx, 0x8(%rsp)
movq %rbx, %rdi
callq 0x24f4
movl (%rax,%rbp,4), %esi
movq 0x10(%rsp), %rdi
callq 0x1298
movq %rax, %r12
movq %rbx, %rdi
callq 0x24f9
movsd (%rax,%rbp,8), %xmm0
movsd %xmm0, (%rsp)
movq %r12, %rdi
callq 0x24f1
testl %eax, %eax
jle 0x21ea
xorl %ebx, %ebx
movq %r12, %rdi
callq 0x24f4
movslq (%rax,%rbx,4), %r15
movsd (%rsp), %xmm0
testl %r13d, %r13d
jne 0x21cc
movq %r12, %rdi
callq 0x24f9
movsd (%rax,%rbx,8), %xmm0
mulsd (%rsp), %xmm0
addsd (%r14,%r15,8), %xmm0
movsd %xmm0, (%r14,%r15,8)
incq %rbx
movq %r12, %rdi
callq 0x24f1
cltq
cmpq %rax, %rbx
jl 0x21a4
movq %r12, %rdi
callq 0x24ec
incq %rbp
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x24f1
cltq
cmpq %rax, %rbp
jl 0x216c
movq %rbx, %rdi
callq 0x24cd
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/saulvargas[P]re-C-sys/recommender_ub.c
// Function: recommender_ub_create
recommender_t* recommender_ub_create(recdata_t* recdata, similarity_t* similarity, int k, int binary) {
    recommender_t* recommender;
    recommender_ub_args_t* args;
    
    recommender = malloc(sizeof(recommender_t));
    recommender->recommend = recommender_ub_recommend;
    recommender->close = recommender_ub_close;
    recommender->recdata = recdata;
    
    args = malloc(sizeof(recommender_ub_args_t));
    args->similarity = similarity;
    args->k = k;
    args->binary = binary;
    recommender->args = args;
    
    return recommender;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
movl $0x20, %edi
callq 0x10b0
movq %rax, %r12
leaq -0x141(%rip), %rax      # 0x2114
movq %rax, (%r12)
leaq -0x39(%rip), %rax       # 0x2227
movq %rax, 0x8(%r12)
movq %r15, 0x10(%r12)
movl $0x10, %edi
callq 0x10b0
movq %r14, (%rax)
movl %ebp, 0x8(%rax)
movl %ebx, 0xc(%rax)
movq %rax, 0x18(%r12)
movq %r12, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/saulvargas[P]re-C-sys/recommender_ib.c
// Function: recommender_ib_recommend
double* recommender_ib_recommend(int uid, recdata_t* recdata, void* args) {
    idpairs_t* neighbors;
    idpairs_t* ud;
    int i;
    int j;
    double s;
    int iid;
    int jid;
    idpairs_t** cached_neighbors = ((recommender_ib_args_t*) args)->cached_neighbors;
    int binary = ((recommender_ib_args_t*) args)->binary;
    
    double* scores = calloc(recdata->N_items, sizeof(double));
    
    ud = recdata_userdata(recdata, uid);
    for (i = 0; i < idpairs_size(ud); i++) {
        jid = idpairs_keys(ud)[i];
        neighbors = cached_neighbors[jid];
        s = binary ? 1.0 : idpairs_values(ud)[i];
        for (j = 0; j < idpairs_size(neighbors); j++) {
            iid = idpairs_keys(neighbors)[j];
            scores[iid] += s * idpairs_values(neighbors)[j];
        }
    }
    idpairs_close_shallow(ud);

    return scores;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movl %edi, %ebp
movq (%rdx), %rax
movq %rax, 0x8(%rsp)
movl 0x8(%rdx), %eax
movl %eax, 0x4(%rsp)
movslq 0x4(%rsi), %rdi
movl $0x8, %esi
callq 0x1090
movq %rax, %rbx
movq %r14, %rdi
movl %ebp, %esi
callq 0x1298
movq %rax, %r14
movq %rax, %rdi
callq 0x24f1
testl %eax, %eax
jle 0x237c
xorl %ebp, %ebp
movq %r14, %rdi
callq 0x24f4
movslq (%rax,%rbp,4), %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %r15
movsd 0xd11(%rip), %xmm0      # 0x3010
cmpl $0x0, 0x4(%rsp)
jne 0x2313
movq %r14, %rdi
callq 0x24f9
movsd (%rax,%rbp,8), %xmm0
movsd %xmm0, 0x10(%rsp)
movq %r15, %rdi
callq 0x24f1
testl %eax, %eax
jle 0x2366
xorl %r12d, %r12d
movq %r15, %rdi
callq 0x24f4
movslq (%rax,%r12,4), %r13
movq %r15, %rdi
callq 0x24f9
movsd (%rax,%r12,8), %xmm0
mulsd 0x10(%rsp), %xmm0
addsd (%rbx,%r13,8), %xmm0
movsd %xmm0, (%rbx,%r13,8)
incq %r12
movq %r15, %rdi
callq 0x24f1
cltq
cmpq %rax, %r12
jl 0x2328
incq %rbp
movq %r14, %rdi
callq 0x24f1
cltq
cmpq %rax, %rbp
jl 0x22e2
movq %r14, %rdi
callq 0x24ec
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/saulvargas[P]re-C-sys/recommender_ib.c
// Function: recommender_ib_close
void recommender_ib_close(recdata_t* recdata, void* args) {
    int iid;
    int N_items;
    recommender_ib_args_t* a = args;
    
    N_items = recdata->N_items;
    for (iid = 0; iid < N_items; iid++) {
        idpairs_close_deep(a->cached_neighbors[iid]);
    }
    free(a->cached_neighbors);

    free(args);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movslq 0x4(%rdi), %r14
testq %r14, %r14
jle 0x23be
xorl %r15d, %r15d
movq (%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x24cd
incq %r15
cmpq %r15, %r14
jne 0x23aa
movq (%rbx), %rdi
callq 0x1030
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O3/saulvargas[P]re-C-sys/recommender_ib.c
// Function: calculate_neighbors
idpairs_t** calculate_neighbors(int N_items, similarity_t* similarity, int k) {
    int iid;
    idpairs_t** idpairs;
    
    idpairs = malloc(N_items * sizeof(idpairs_t*));
    for (iid = 0; iid < N_items; iid++) {
        idpairs[iid] = similarity_calculate(similarity, iid, k);
    }
    
    return idpairs;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movl %edi, %ebp
movslq %edi, %r12
leaq (,%r12,8), %rdi
callq 0x10b0
movq %rax, %r15
testl %r12d, %r12d
jle 0x241c
movl %ebp, %r13d
xorl %r12d, %r12d
movq %r14, %rdi
movl %r12d, %esi
movl %ebx, %edx
callq 0x1714
movq %rax, (%r15,%r12,8)
incq %r12
cmpq %r12, %r13
jne 0x2403
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/saulvargas[P]re-C-sys/recommender_ib.c
// Function: recommender_ib_create
recommender_t* recommender_ib_create(recdata_t* recdata, similarity_t* similarity, int k, int binary) {
    recommender_t* recommender;
    recommender_ib_args_t* args;
    
    recommender = malloc(sizeof(recommender_t));
    recommender->recommend = recommender_ib_recommend;
    recommender->close = recommender_ib_close;
    recommender->recdata = recdata;
    
    args = malloc(sizeof(recommender_ib_args_t));
    args->cached_neighbors = calculate_neighbors(recdata->N_items, similarity, k);
    args->binary = binary;
    recommender->args = args;
    
    return recommender;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
movl $0x20, %edi
callq 0x10b0
movq %rax, %r12
leaq -0x1c7(%rip), %rax      # 0x2290
movq %rax, (%r12)
leaq -0xcc(%rip), %rax       # 0x2396
movq %rax, 0x8(%r12)
movq %r15, 0x10(%r12)
movl $0x10, %edi
callq 0x10b0
movq %rax, %r13
movl 0x4(%r15), %edi
movq %r14, %rsi
movl %ebp, %edx
callq 0x23d3
movq %rax, (%r13)
movl %ebx, 0x8(%r13)
movq %r13, 0x18(%r12)
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/saulvargas[P]re-C-sys/idpairs.c
// Function: revert_int
void revert_int(int n, int* v) {
    int i;
    int x;
    for (i = 0; i < n / 2; i++) {
        x = v[i];
        v[i] = v[n - i - 1];
        v[n - i - 1] = x;
    }
}

// Assembly:
cmpl $0x2, %edi
jl 0x252c
movl %edi, %eax
shrl %edi
leaq (%rsi,%rax,4), %rax
addq $-0x4, %rax
negq %rdi
xorl %ecx, %ecx
movl (%rsi), %edx
movl (%rax,%rcx,4), %r8d
movl %r8d, (%rsi)
movl %edx, (%rax,%rcx,4)
addq $0x4, %rsi
decq %rcx
cmpq %rcx, %rdi
jne 0x2514
retq
// File: /workspace/github_c_makefile_star2_O3/saulvargas[P]re-C-sys/idpairs.c
// Function: revert_double
void revert_double(int n, double* v) {
    int i;
    double x;
    for (i = 0; i < n / 2; i++) {
        x = v[i];
        v[i] = v[n - i - 1];
        v[n - i - 1] = x;
    }

}

// Assembly:
cmpl $0x2, %edi
jl 0x2561
movl %edi, %eax
shrl %edi
leaq (%rsi,%rax,8), %rax
addq $-0x8, %rax
negq %rdi
xorl %ecx, %ecx
movsd (%rsi), %xmm0
movsd (%rax,%rcx,8), %xmm1
movsd %xmm1, (%rsi)
movsd %xmm0, (%rax,%rcx,8)
addq $0x8, %rsi
decq %rcx
cmpq %rcx, %rdi
jne 0x2543
retq
// File: /workspace/github_c_makefile_star2_O3/saulvargas[P]re-C-sys/recommender_pop.c
// Function: recommender_pop_recommend
double* recommender_pop_recommend(int uid, recdata_t* recdata, void* args) {
    int iid;
    double* scores;

    (void) uid;
    (void) args;

    scores = calloc(recdata->N_items, sizeof(double));
    for (iid = 0; iid < recdata->N_items; iid++) {
        scores[iid] = recdata_itemdata_size(recdata, iid);
    }

    return scores;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movslq 0x4(%rsi), %r15
movl $0x8, %esi
movq %r15, %rdi
callq 0x1090
movq %rax, %r14
testq %r15, %r15
jle 0x2724
xorl %r15d, %r15d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x128a
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, (%r14,%r15,8)
incq %r15
movslq 0x4(%rbx), %rax
cmpq %rax, %r15
jl 0x2700
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/saulvargas[P]re-C-sys/recommender_pop.c
// Function: recommender_pop_create
recommender_t* recommender_pop_create(recdata_t* recdata) {
    recommender_t* recommender;
    
    recommender = malloc(sizeof(recommender_t));
    recommender->recommend = recommender_pop_recommend;
    recommender->close = recommender_pop_close;
    recommender->recdata = recdata;
    recommender->args = NULL;
    
    return recommender;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x20, %edi
callq 0x10b0
leaq -0x67(%rip), %rcx       # 0x26dc
movq %rcx, (%rax)
leaq -0x20(%rip), %rcx       # 0x272d
movq %rcx, 0x8(%rax)
movq %rbx, 0x10(%rax)
movq $0x0, 0x18(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/antonblanchard[P]will-it-scale/tests/unlink2.c
// Function: testcase_prepare
void testcase_prepare(unsigned long nr_tasks)
{
	int i;
	tmpdirs = (char(*)[sizeof(template)])malloc(sizeof(template) * nr_tasks);
	assert(tmpdirs);

	char tmpfile[PATH_MAX];
	int fd;

	for (i = 0; i < nr_tasks; i++) {
		strcpy(tmpdirs[i], template);
		char *tmpdir = tmpdirs[i];
		assert(mkdtemp(tmpdir) != NULL);
		sprintf(tmpfile, "%s/willitscale", tmpdir);
		fd = open(tmpfile, O_RDWR|O_CREAT, 0600);
		assert(fd >= 0);
		close(fd);
	}

	local_nr_tasks = nr_tasks;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1018, %rsp           # imm = 0x1018
movq %rdi, %rbx
leaq (,%rdi,8), %rax
leaq (%rax,%rax,2), %rdi
callq 0x21e0
movq %rax, 0xa45c(%rip)      # 0xd1c8
testq %rax, %rax
je 0x2e58
movq %rbx, 0x8(%rsp)
testq %rbx, %rbx
je 0x2dfc
movabsq $0x5858585858582e, %r13 # imm = 0x5858585858582E
leaq 0x59e(%rip), %r14       # 0x332e
leaq 0x10(%rsp), %r15
movq 0x8(%rsp), %rbp
xorl %ebx, %ebx
movq 0xa425(%rip), %rax      # 0xd1c8
leaq (%rax,%rbx), %r12
movups 0x550(%rip), %xmm0      # 0x32fe
movups %xmm0, (%rax,%rbx)
movq %r13, 0x10(%rax,%rbx)
movq %r12, %rdi
callq 0x2210
testq %rax, %rax
je 0x2e1a
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x22a0
movq %r15, %rdi
movl $0x42, %esi
movl $0x180, %edx            # imm = 0x180
xorl %eax, %eax
callq 0x2240
testl %eax, %eax
js 0x2e39
movl %eax, %edi
callq 0x2170
addq $0x18, %rbx
decq %rbp
jne 0x2d9c
movq 0x8(%rsp), %rax
movq %rax, 0xa3c8(%rip)      # 0xd1d0
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4f5(%rip), %rdi       # 0x3316
leaq 0x4a1(%rip), %rsi       # 0x32c9
leaq 0x4aa(%rip), %rcx       # 0x32d9
movl $0x1d, %edx
callq 0x2140
leaq 0x4fd(%rip), %rdi       # 0x333d
leaq 0x482(%rip), %rsi       # 0x32c9
leaq 0x48b(%rip), %rcx       # 0x32d9
movl $0x20, %edx
callq 0x2140
leaq 0x462(%rip), %rdi       # 0x32c1
leaq 0x463(%rip), %rsi       # 0x32c9
leaq 0x46c(%rip), %rcx       # 0x32d9
movl $0x15, %edx
callq 0x2140
// File: /workspace/github_c_makefile_star2_O3/antonblanchard[P]will-it-scale/tests/unlink2.c
// Function: testcase
void testcase(unsigned long long *iterations, unsigned long nr)
{
	char tmpfile[PATH_MAX];

	sprintf(tmpfile, "%s/willitscale", tmpdirs[nr]);

	while (1) {
		int fd = open(tmpfile, O_RDWR|O_CREAT, 0600);
		assert(fd >= 0);
		close(fd);
		unlink(tmpfile);

		(*iterations)++;
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
movq %rdi, %rbx
leaq (%rsi,%rsi,2), %rdx
shlq $0x3, %rdx
addq 0xa335(%rip), %rdx      # 0xd1c8
leaq 0x494(%rip), %rsi       # 0x332e
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x22a0
movq %r14, %rdi
movl $0x42, %esi
movl $0x180, %edx            # imm = 0x180
xorl %eax, %eax
callq 0x2240
testl %eax, %eax
js 0x2eec
movq %rsp, %r14
movl %eax, %edi
callq 0x2170
movq %r14, %rdi
callq 0x2080
incq (%rbx)
movq %r14, %rdi
movl $0x42, %esi
movl $0x180, %edx            # imm = 0x180
xorl %eax, %eax
callq 0x2240
testl %eax, %eax
jns 0x2ec2
leaq 0x44a(%rip), %rdi       # 0x333d
leaq 0x3cf(%rip), %rsi       # 0x32c9
leaq 0x444(%rip), %rcx       # 0x3345
movl $0x30, %edx
callq 0x2140
// File: /workspace/github_c_makefile_star2_O3/antonblanchard[P]will-it-scale/tests/unlink2.c
// Function: testcase_cleanup
void testcase_cleanup(void)
{
	int i;
	char tmpfile[PATH_MAX];

	for (i = 0; i < local_nr_tasks; i++) {
		sprintf(tmpfile, "%s/willitscale", tmpdirs[i]);
		unlink(tmpfile);
		rmdir(tmpdirs[i]);
	}
	free(tmpdirs);
}

// Assembly:
cmpq $0x0, 0xa2bd(%rip)      # 0xd1d0
je 0x2f7f
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
leaq 0x404(%rip), %rbx       # 0x332e
movq %rsp, %r14
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0xa28e(%rip), %rdx      # 0xd1c8
addq %r15, %rdx
movq %r14, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x22a0
movq %r14, %rdi
callq 0x2080
movq 0xa26f(%rip), %rdi      # 0xd1c8
addq %r15, %rdi
callq 0x20f0
incq %r12
addq $0x18, %r15
cmpq %r12, 0xa261(%rip)      # 0xd1d0
ja 0x2f33
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r12
popq %r14
popq %r15
movq 0xa242(%rip), %rdi      # 0xd1c8
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O3/pipde[P]deos-songlib/utils/rra/rrainfo.c
// Function: main
int
main(int argc,char **argv)
    {
    int argIndex = 1;

    int i;

    argIndex = processOptions(argc,argv);

    if (argIndex == argc)
        info("stdin",stdin);
    else
        {
        for (i = argIndex; i < argc; ++i)
            {
            FILE *fp = OpenFile(argv[i],"r");
            info(argv[i],OpenFile(argv[i],"r"));
            fclose(fp);
            }
        }

    return 0;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r14d
movl $0x1, %r12d
cmpl $0x2, %edi
jl 0x1662
movl %r14d, %r13d
movl $0x1, %r12d
leaq 0x2a8d(%rip), %r15      # 0x407c
movq (%rbx,%r12,8), %rsi
cmpb $0x2d, (%rsi)
jne 0x1662
movzbl 0x1(%rsi), %eax
cmpl $0x71, %eax
jle 0x1617
cmpl $0x72, %eax
je 0x1639
cmpl $0x73, %eax
jne 0x1645
movl $0x1, 0x5b47(%rip)      # 0x715c
jmp 0x1658
cmpl $0x62, %eax
je 0x162d
cmpl $0x63, %eax
jne 0x164e
movl $0x1, 0x5b3d(%rip)      # 0x7168
jmp 0x1658
movl $0x1, 0x5b2d(%rip)      # 0x7164
jmp 0x1658
movl $0x1, 0x5b1d(%rip)      # 0x7160
jmp 0x1658
cmpl $0x76, %eax
je 0x16dd
movq %r15, %rdi
xorl %eax, %eax
callq 0x17b8
incq %r12
cmpq %r12, %r13
jne 0x15ef
jmp 0x1667
cmpl %r14d, %r12d
jne 0x167f
movq 0x596a(%rip), %rax      # 0x6fd8
movq (%rax), %rsi
leaq 0x2999(%rip), %rdi      # 0x4011
callq 0x1700
jmp 0x16cc
jge 0x16cc
movl %r12d, %r13d
movl %r14d, %eax
movq %rax, -0x30(%rbp)
leaq 0x2e5a(%rip), %r14      # 0x44ec
movq (%rbx,%r13,8), %rdi
movq %r14, %rsi
callq 0x1852
movq %rax, %r15
movq (%rbx,%r13,8), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x1852
movq %r12, %rdi
movq %rax, %rsi
callq 0x1700
movq %r15, %rdi
callq 0x1090
incq %r13
cmpq %r13, -0x30(%rbp)
jne 0x1692
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x5a54(%rip), %rsi      # 0x7138
movq 0x5a55(%rip), %rdx      # 0x7140
leaq 0x297b(%rip), %rdi      # 0x406d
xorl %eax, %eax
callq 0x10b0
xorl %edi, %edi
callq 0x1200
// File: /workspace/github_c_makefile_star2_O3/pipde[P]deos-songlib/utils/rra/rrainfo.c
// Function: info
static void
info(char *name,FILE *in)
    {
    RRA *h;

    h = newRRAHeader();
    readRRAHeader(in,h,0);

    printf("%s\n",name);
    if (channels)
        printf("    %d\n",h->channels);
    else if (sampleRate)
        printf("    %d\n",h->sampleRate);
    else if (samples)
        printf("    %d\n",h->samples);
    else if (bitsPerSample)
        printf("    %d\n",h->bitsPerSample);
    else
        {
        printf("    sampleRate: %d\n",h->sampleRate);
        printf("    bitsPerSample: %d\n",h->bitsPerSample);
        printf("    channels: %d\n",h->channels);
        printf("    samples: %d\n",h->samples);
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
callq 0x1ac3
movq %rax, %rbx
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x1ee9
movq %r15, %rdi
callq 0x1070
cmpl $0x0, 0x5a34(%rip)      # 0x7168
je 0x173a
movl (%rbx), %esi
jmp 0x1762
cmpl $0x0, 0x5a1f(%rip)      # 0x7160
je 0x1748
movl 0x4(%rbx), %esi
jmp 0x1762
cmpl $0x0, 0x5a0d(%rip)      # 0x715c
je 0x1756
movl 0xc(%rbx), %esi
jmp 0x1762
cmpl $0x0, 0x5a07(%rip)      # 0x7164
je 0x177a
movl 0x8(%rbx), %esi
leaq 0x28ae(%rip), %rdi      # 0x4017
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x10b0
movl 0x4(%rbx), %esi
leaq 0x289b(%rip), %rdi      # 0x401f
xorl %eax, %eax
callq 0x10b0
movl 0x8(%rbx), %esi
leaq 0x289e(%rip), %rdi      # 0x4033
xorl %eax, %eax
callq 0x10b0
movl (%rbx), %esi
leaq 0x28a5(%rip), %rdi      # 0x404a
xorl %eax, %eax
callq 0x10b0
movl 0xc(%rbx), %esi
leaq 0x28a6(%rip), %rdi      # 0x405c
jmp 0x1769