LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/mgrosvenor[P]evec/test.c
// Function: test3
static int test3()
{
    int* a = evini(128,64);
    if(evcnt(a) != 0) return 0;
    if(evvsz(a) != 64) return 0;
    evfree(a);
    return 1;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
pushq $0x40
popq %rsi
movl $0x80, %edi
callq 0x12c0
movq %rax, %rbx
movq %rax, %rdi
callq 0x173d
xorl %ebp, %ebp
testq %rax, %rax
jne 0x1e23
movq %rbx, %rdi
callq 0x1aa4
cmpq $0x40, %rax
jne 0x1e23
movq %rbx, %rdi
callq 0x193a
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mgrosvenor[P]evec/test.c
// Function: test4
static int test4()
{
    int* a = evini(128,64);
    for(int i = 0; i < 1000; i++){
        evpsh(a,i);
    }

    for(int i = 0; i < 1000; i++){
        int* ai = evidx(a,i);
        if( *ai != i){ return 0;}
    }

    evfree(a);
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
pushq $0x40
popq %rsi
movl $0x80, %edi
callq 0x12c0
movq %rax, %rbx
xorl %ebp, %ebp
leaq 0x4(%rsp), %r14
pushq $0x4
popq %r15
cmpl $0x3e8, %ebp            # imm = 0x3E8
je 0x1e6f
movl %ebp, 0x4(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1670
movq %rax, %rbx
incl %ebp
jmp 0x1e4e
pushq $-0x1
popq %r14
cmpq $0x3e7, %r14            # imm = 0x3E7
je 0x1e95
incq %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x177e
movl (%rax), %eax
cmpq %rax, %r14
je 0x1e73
xorl %eax, %eax
jmp 0x1ea0
movq %rbx, %rdi
callq 0x193a
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mgrosvenor[P]evec/test.c
// Function: test5
static int test5()
{
    char** a = evini(128,64);
    for(int i = 0; i < 1000; i++){
        evpsh(a,"AA");
    }

    for(int i = 0; i < 1000; i++){
        char* ai = evidx(a,i);
        if( strcmp(ai,"AA"))return 0;
    }

    evfree(a);
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
pushq $0x40
popq %rsi
movl $0x80, %edi
callq 0x12c0
movq %rax, %rbx
movl $0x3e8, %ebp            # imm = 0x3E8
leaq 0x1651(%rip), %r14      # 0x351f
pushq $0x3
popq %r15
subl $0x1, %ebp
jb 0x1eea
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1670
movq %rax, %rbx
jmp 0x1ed2
xorl %r14d, %r14d
cmpq $0x3e8, %r14            # imm = 0x3E8
je 0x1f1c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x177e
movq %rax, %rcx
xorl %eax, %eax
cmpb $0x41, (%rcx)
jne 0x1f27
cmpb $0x41, 0x1(%rcx)
jne 0x1f27
incq %r14
cmpb $0x0, 0x2(%rcx)
je 0x1eed
jmp 0x1f27
movq %rbx, %rdi
callq 0x193a
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mgrosvenor[P]evec/test.c
// Function: test6
static int test6()
{
    char** a = NULL;
    char* str = "AA";
    for(int i = 0; i < 1000; i++){
        evpsh(a,str);
    }

    for(int i = 0; i < 1000; i++){
        char** ai = evidx(a,i);
        if( strcmp(*ai,str))return 0;
    }

    evfree(a);
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl $0x3e8, %ebp            # imm = 0x3E8
xorl %ebx, %ebx
leaq 0x15d3(%rip), %r12      # 0x351f
leaq 0x8(%rsp), %r14
pushq $0x8
popq %r15
subl $0x1, %ebp
jb 0x1f72
movq %r12, 0x8(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1670
movq %rax, %rbx
jmp 0x1f55
xorl %r14d, %r14d
cmpq $0x3e8, %r14            # imm = 0x3E8
je 0x1fa4
movq %rbx, %rdi
movq %r14, %rsi
callq 0x177e
movq (%rax), %rcx
xorl %eax, %eax
cmpb $0x41, (%rcx)
jne 0x1faf
cmpb $0x41, 0x1(%rcx)
jne 0x1faf
incq %r14
cmpb $0x0, 0x2(%rcx)
je 0x1f75
jmp 0x1faf
movq %rbx, %rdi
callq 0x193a
pushq $0x1
popq %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mgrosvenor[P]evec/test.c
// Function: test7
static int test7()
{
    char** a = NULL;
    char* strs[] = {
            "Test",
            "Best",
            "Rest",
            "Vector",
            "Victor",
            0
    };

    for(int i = 0; strs[i]; i++){
        evpsh(a, strs[i]);
    }

    for(int i = 0; i < evcnt(a); i++){
        if(strcmp(a[i],strs[i])) return 0;
    }

    a = evfree(a);
    return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
xorl %r13d, %r13d
leaq 0x3ded(%rip), %r12      # 0x5dc0
leaq 0x8(%rsp), %r14
pushq $0x8
popq %r15
xorl %ebx, %ebx
cmpq $0x28, %r13
je 0x2005
movq (%r13,%r12), %rax
movq %rax, 0x8(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1670
movq %rax, %rbx
addq $0x8, %r13
jmp 0x1fde
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x173d
cmpq %r14, %rax
jbe 0x2031
movq (%rbx,%r14,8), %rdi
movq (%r12), %rsi
callq 0x10b0
incq %r14
addq $0x8, %r12
testl %eax, %eax
je 0x2008
xorl %eax, %eax
jmp 0x203c
movq %rbx, %rdi
callq 0x193a
pushq $0x1
popq %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/mgrosvenor[P]evec/test.c
// Function: test8
static int test8() {
    int* a = NULL;
    int ints[] = { 4,2,6,10,8 };
    int ints_srt[] = { 2,4,6,8,10 };
    const int ints_cnt = sizeof(ints)/sizeof(int);

#define REPEATS 1000
    for(int i = 0; i < REPEATS; i++){
        for(int j = 0; j < ints_cnt; j++){
            evpsh(a, ints[j]);
        }
    }

    if(evcnt(a) != REPEATS * ints_cnt) return 0;


    evsort(a,compare);

    //Remove duplicates
    for(int i = 1; i < evcnt(a); i++){
        if(a[i] == a[i-1]){
            evdel(a,i);
            i--;
        }
    }

    if(evcnt(a) != ints_cnt) {
        printf("%li != %i", evcnt(a) , ints_cnt);
        return 0;
    }

    for(int i =0; i < evcnt(a); i++){
        if(a[i] != ints_srt[i]) {
            printf("%i != %i", a[i], ints_srt[i]);
            return 0;
        }
    }

    a = evfree(a);
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %ebx, %ebx
leaq 0x1502(%rip), %r12      # 0x3560
leaq 0x4(%rsp), %r14
pushq $0x4
popq %r15
xorl %ebp, %ebp
cmpl $0x3e8, %ebp            # imm = 0x3E8
je 0x209e
xorl %r13d, %r13d
cmpq $0x14, %r13
je 0x209a
movl (%r13,%r12), %eax
movl %eax, 0x4(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1670
movq %rax, %rbx
addq $0x4, %r13
jmp 0x2074
incl %ebp
jmp 0x2069
movq %rbx, %rdi
callq 0x173d
xorl %ebp, %ebp
cmpq $0x1388, %rax           # imm = 0x1388
jne 0x2168
leaq 0xbe(%rip), %rsi        # 0x2179
movq %rbx, %rdi
callq 0x1beb
pushq $0x1
popq %rbp
movslq %ebp, %r14
movq %rbx, %rdi
callq 0x173d
cmpq %r14, %rax
jbe 0x20f4
movl (%rbx,%r14,4), %eax
cmpl -0x4(%rbx,%r14,4), %eax
jne 0x20f0
leal -0x1(%r14), %ebp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19e5
incl %ebp
jmp 0x20c6
movq %rbx, %rdi
callq 0x173d
cmpq $0x5, %rax
jne 0x213d
leaq 0x1477(%rip), %r14      # 0x3580
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0x173d
cmpq %r15, %rax
jbe 0x215d
movl (%rbx,%r15,4), %esi
movl (%r14), %edx
incq %r15
addq $0x4, %r14
cmpl %edx, %esi
je 0x210c
leaq 0x1417(%rip), %rdi      # 0x3549
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x1070
jmp 0x2168
movq %rbx, %rdi
callq 0x173d
leaq 0x13f3(%rip), %rdi      # 0x353f
xorl %ebp, %ebp
pushq $0x5
popq %rdx
movq %rax, %rsi
xorl %eax, %eax
callq 0x1070
jmp 0x2168
movq %rbx, %rdi
callq 0x193a
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mgrosvenor[P]evec/test.c
// Function: test9
static int test9()
{
    int* a = evini(128,64);
    for(int i = 0; i < 1000; i++){
        evpsh(a,i);
    }

    for(int i = 0; i < 999; i++){
        evdel(a,0);
        int* ai = evidx(a,0);
        if(*ai != i +1) return 0;
    }

    evdel(a,0);
    if(evcnt(a) != 0) return 0;

    evfree(a);
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
pushq $0x40
popq %rsi
movl $0x80, %edi
callq 0x12c0
movq %rax, %rbx
xorl %ebp, %ebp
leaq 0x4(%rsp), %r14
pushq $0x4
popq %r15
cmpl $0x3e8, %ebp            # imm = 0x3E8
je 0x21c1
movl %ebp, 0x4(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1670
movq %rax, %rbx
incl %ebp
jmp 0x21a0
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x19e5
cmpl $0x3e7, %r15d           # imm = 0x3E7
je 0x21f3
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x177e
movl (%rax), %eax
incl %r15d
cmpl %r15d, %eax
movl %eax, %r15d
je 0x21c4
jmp 0x220f
movq %rbx, %rdi
callq 0x173d
xorl %r14d, %r14d
testq %rax, %rax
jne 0x220f
movq %rbx, %rdi
callq 0x193a
pushq $0x1
popq %r14
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mgrosvenor[P]evec/test.c
// Function: test10
static int test10()
{
    int* a = evini(sizeof(int), 0);
    for(int i = 0;i < 1000;i++){
        evpsh(a, i);
    }

    for(int i = 0;i < 999;i++){
        evpop(a);
        int* a0 = evidx(a,0);
        int* ac = evidx(a,evcnt(a) - 1);

        if(*a0 != 0) return 0;
        if(*ac != 999 - 1 - i) return 0;
    }

    evpop(a);
    if(evcnt(a) != 0) return 0;

    evfree(a);
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
xorl %r12d, %r12d
pushq $0x4
popq %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x12c0
movq %rax, %rbx
leaq 0xc(%rsp), %r15
cmpl $0x3e8, %r12d           # imm = 0x3E8
je 0x2266
movl %r12d, 0xc(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1670
movq %rax, %rbx
incl %r12d
jmp 0x2242
movl $0x3e7, %ebp            # imm = 0x3E7
movq %rbx, %rdi
callq 0x1980
subl $0x1, %ebp
jb 0x22a8
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x177e
movq %rax, %r15
movq %rbx, %rdi
callq 0x173d
leaq -0x1(%rax), %rsi
movq %rbx, %rdi
callq 0x177e
cmpl $0x0, (%r15)
jne 0x22c4
cmpl (%rax), %ebp
je 0x226b
jmp 0x22c4
movq %rbx, %rdi
callq 0x173d
xorl %r14d, %r14d
testq %rax, %rax
jne 0x22c4
movq %rbx, %rdi
callq 0x193a
pushq $0x1
popq %r14
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mgrosvenor[P]evec/test.c
// Function: test11
static int test11()
{
    int* a = evinisz(128);
    int* b = NULL;

    for(int i = 0; i < 1000; i++){
        evpsh(a,i);
    }

    b = evcpy(a);

    for(int i = 0; i < 1000; i++){
        int* ai = (int*)evidx(a,i);
        int* bi = (int*)evidx(b,i);

        //Check that these are indeed different peices of memory
        if(ai == bi) return 0;

        //But that they have the same value
        if(*ai != *bi) return 0;
    }

    evfree(a);
    evfree(b);
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
pushq $0x8
popq %rsi
movl $0x80, %edi
callq 0x12c0
movq %rax, %rbx
xorl %ebp, %ebp
leaq 0xc(%rsp), %r14
pushq $0x4
popq %r15
cmpl $0x3e8, %ebp            # imm = 0x3E8
je 0x231c
movl %ebp, 0xc(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1670
movq %rax, %rbx
incl %ebp
jmp 0x22fb
movq %rbx, %rdi
callq 0x1c5e
movq %rax, %r14
xorl %r15d, %r15d
cmpq $0x3e8, %r15            # imm = 0x3E8
je 0x2363
movq %rbx, %rdi
movq %r15, %rsi
callq 0x177e
movq %rax, %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x177e
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %r12
je 0x2376
movl (%r12), %edx
incq %r15
cmpl (%rcx), %edx
je 0x232a
jmp 0x2376
movq %rbx, %rdi
callq 0x193a
movq %r14, %rdi
callq 0x193a
pushq $0x1
popq %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mgrosvenor[P]evec/test.c
// Function: test12
static int test12()
{
    int* a = NULL;
    size_t c = evcnt(a);
    if(c != 0){
        return 0;
    }

    int sum1    = 0;
    int first   = 0;
    int last    = 0;
    int r       = -1;
    for(int i = 0; i < 1000; i++){
        r = rand();
        if(i == 0){
            first = r;
        }

        evpsh(a,r);
        sum1 += r;
    }

    last = r;

    if(first != *(int*)evhead(a)){
        return 0;
    }

    if(last != *(int*)evtail(a)){
        return 0;
    }

    int sum2 = 0;
    eveach(a, ai){
        sum2 += *ai;
    }

    if(sum1 != sum2){
        return 0;
    }

    evfree(a);

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
pushq $-0x1
popq %rbp
xorl %ebx, %ebx
movl $0x3e8, %r15d           # imm = 0x3E8
xorl %r12d, %r12d
xorl %r13d, %r13d
movl $0x3e8, %r14d           # imm = 0x3E8
subl $0x1, %r14d
jb 0x23dc
callq 0x1110
movl %eax, %ebp
cmpl $0x3e8, %r15d           # imm = 0x3E8
cmovel %eax, %r13d
movl %eax, 0x4(%rsp)
movq %rbx, %rdi
leaq 0x4(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x1670
movq %rax, %rbx
addl %ebp, %r12d
movl %r14d, %r15d
jmp 0x23a5
movq %rbx, %rdi
callq 0x1853
xorl %r14d, %r14d
cmpl (%rax), %r13d
jne 0x2427
movq %rbx, %rdi
callq 0x183d
cmpl (%rax), %ebp
jne 0x2427
movq %rbx, %rdi
callq 0x1853
xorl %ebp, %ebp
testq %rax, %rax
je 0x2413
addl (%rax), %ebp
movq %rbx, %rdi
callq 0x18a5
jmp 0x2402
xorl %r14d, %r14d
cmpl %ebp, %r12d
jne 0x2427
movq %rbx, %rdi
callq 0x193a
pushq $0x1
popq %r14
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/vidarr[P]ringbuffer/test/cached_ringbuffer_test.c
// Function: test_cached_ringbuffer_create
void test_cached_ringbuffer_create() {

    Ringbuffer* buffer = 0;

    buffer = ringbuffer_create(1, 0, 0);
    assert(buffer);
    assert(capacity_func == buffer->capacity);
    assert(add_func == buffer->add);
    assert(pop_func == buffer->pop);
    assert(free_func == buffer->free);

    buffer = buffer->free(buffer);

    fprintf(stdout, "cached ringbuffer_create OK\n");

}

// Assembly:
pushq %rax
pushq $0x1
popq %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x117c
testq %rax, %rax
je 0x13d2
leaq -0x13a(%rip), %rcx      # 0x123f
cmpq %rcx, (%rax)
jne 0x13eb
leaq -0x139(%rip), %rcx      # 0x124c
cmpq %rcx, 0x8(%rax)
jne 0x1404
leaq -0xed(%rip), %rcx       # 0x12a5
cmpq %rcx, 0x10(%rax)
jne 0x141d
leaq -0xdd(%rip), %rcx       # 0x12c6
cmpq %rcx, 0x18(%rax)
jne 0x1436
movq %rax, %rdi
callq 0x12c6
movq 0x3c1c(%rip), %rax      # 0x4fd8
movq (%rax), %rcx
leaq 0x1d16(%rip), %rdi      # 0x30dc
pushq $0x1c
popq %rsi
pushq $0x1
popq %rdx
popq %rax
jmp 0x1070
leaq 0x1c4d(%rip), %rdi      # 0x3026
leaq 0x1c4d(%rip), %rsi      # 0x302d
leaq 0x1c64(%rip), %rcx      # 0x304b
pushq $0x5a
jmp 0x144d
leaq 0x1c7e(%rip), %rdi      # 0x3070
leaq 0x1c34(%rip), %rsi      # 0x302d
leaq 0x1c4b(%rip), %rcx      # 0x304b
pushq $0x5b
jmp 0x144d
leaq 0x1c87(%rip), %rdi      # 0x3092
leaq 0x1c1b(%rip), %rsi      # 0x302d
leaq 0x1c32(%rip), %rcx      # 0x304b
pushq $0x5c
jmp 0x144d
leaq 0x1c86(%rip), %rdi      # 0x30aa
leaq 0x1c02(%rip), %rsi      # 0x302d
leaq 0x1c19(%rip), %rcx      # 0x304b
pushq $0x5d
jmp 0x144d
leaq 0x1c85(%rip), %rdi      # 0x30c2
leaq 0x1be9(%rip), %rsi      # 0x302d
leaq 0x1c00(%rip), %rcx      # 0x304b
pushq $0x5e
popq %rdx
callq 0x1040
// File: /workspace/github_c_makefile_star2_O2/vidarr[P]ringbuffer/test/cached_ringbuffer_test.c
// Function: get_data_buffer
DataBuffer* get_data_buffer(Ringbuffer* cache, size_t min_length_bytes) {

    DataBuffer* db =  0;

    if(0 != cache) {
        db = cache->pop(cache);
    }

    if(0 == db) {
        db = calloc(1, sizeof(DataBuffer));
    }

    if(db->capacity_bytes < min_length_bytes) {
        if(0 != db->data) {
            free(db->data);
            db->data = 0;
        }
    }

    if(0 == db->data) {
        db->data = calloc(1, sizeof(min_length_bytes) * sizeof(uint8_t));
        db->capacity_bytes = min_length_bytes;
    }

    db->bytes_used = 0;

    return db;

}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
testq %rdi, %rdi
je 0x146f
callq *0x10(%rdi)
testq %rax, %rax
je 0x146f
movq %rax, %r14
movq (%rax), %rax
jmp 0x147f
pushq $0x1
popq %rdi
pushq $0x18
popq %rsi
callq 0x1050
movq %rax, %r14
xorl %eax, %eax
movq 0x10(%r14), %rdi
cmpq %rbx, %rax
jae 0x148f
callq 0x1030
jmp 0x1494
testq %rdi, %rdi
jne 0x14a6
pushq $0x1
popq %rdi
pushq $0x8
popq %rsi
callq 0x1050
movq %rax, 0x10(%r14)
movq %rbx, (%r14)
andq $0x0, 0x8(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/vidarr[P]ringbuffer/test/cached_ringbuffer_test.c
// Function: test_cached_free
void test_cached_free() {

    size_t frees_count = 0;

    Ringbuffer* cache =
        ringbuffer_create(50, free_data_buffer, &frees_count);

    Ringbuffer* buffer = ringbuffer_create(21, cache_free, cache);

    size_t i = 0;

    while(10 > frees_count) {
        /* just some abritrary data that has been allocated dynamically */
        ++i;
        /* We want to create really new data buffers, thus cache == 0 ... */
        DataBuffer* db = get_data_buffer(0, 13);
        buffer->add(buffer, db);
    };

    size_t initial_count = frees_count;

    /* Shift some elements out of cache into ringbuffer */
    for(i = 0; i < 3 * buffer->capacity(buffer); ++i) {
        DataBuffer* item = get_data_buffer(cache, i);
        assert(item);
        buffer->add(buffer, item);
    }

    assert(initial_count == frees_count);
    assert(0 == buffer->free(buffer));

    cache = cache->free(cache);

    fprintf(stdout, "free() OK: %zu\n", frees_count);

}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsp, %rdx
andq $0x0, (%rdx)
leaq -0x3b(%rip), %rsi       # 0x14b6
pushq $0x32
popq %rdi
callq 0x117c
movq %rax, %rbx
leaq -0x1e3(%rip), %rsi      # 0x1320
pushq $0x15
popq %rdi
movq %rax, %rdx
callq 0x117c
movq %rax, %r14
pushq $0xd
popq %r15
movq (%rsp), %r12
cmpq $0xa, %r12
jae 0x1535
xorl %edi, %edi
movq %r15, %rsi
callq 0x1453
movq %r14, %rdi
movq %rax, %rsi
callq *0x8(%r14)
jmp 0x1515
xorl %r15d, %r15d
movq %r14, %rdi
callq *(%r14)
leaq (%rax,%rax,2), %rax
cmpq %rax, %r15
jae 0x1566
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1453
testq %rax, %rax
je 0x15a6
movq %r14, %rdi
movq %rax, %rsi
callq *0x8(%r14)
incq %r15
jmp 0x1538
cmpq (%rsp), %r12
jne 0x15c5
movq %r14, %rdi
callq *0x18(%r14)
testq %rax, %rax
jne 0x15e4
movq %rbx, %rdi
callq *0x18(%rbx)
movq 0x3a53(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
movq (%rsp), %rdx
leaq 0x1bba(%rip), %rsi      # 0x314d
xorl %eax, %eax
callq 0x1060
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1b4c(%rip), %rdi      # 0x30f9
leaq 0x1a79(%rip), %rsi      # 0x302d
leaq 0x1b43(%rip), %rcx      # 0x30fe
movl $0xc8, %edx
callq 0x1040
leaq 0x1b4a(%rip), %rdi      # 0x3116
leaq 0x1a5a(%rip), %rsi      # 0x302d
leaq 0x1b24(%rip), %rcx      # 0x30fe
movl $0xcc, %edx
callq 0x1040
leaq 0x1b48(%rip), %rdi      # 0x3133
leaq 0x1a3b(%rip), %rsi      # 0x302d
leaq 0x1b05(%rip), %rcx      # 0x30fe
movl $0xcd, %edx
callq 0x1040
// File: /workspace/github_c_makefile_star2_O2/vidarr[P]ringbuffer/test/cached_ringbuffer_test.c
// Function: main
int main(int argc, char** argv) {

    /* The interface tests */
    size_t free_count = 0;
    Ringbuffer* cache = ringbuffer_create(31, count_free, &free_count);
    free_item = cache_free;
    free_item_additional_arg = cache;

    test_ringbuffer_create();
    test_capacity();
    test_add();
    test_pop();
    cache->free(cache);
    cache = 0;

    /* Caching tests */
    test_cached_ringbuffer_create();
    test_cached_free();

}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0x8(%rsp), %rdx
andq $0x0, (%rdx)
leaq 0x5a(%rip), %rsi        # 0x1672
pushq $0x1f
popq %rdi
callq 0x117c
movq %rax, %rbx
leaq -0x30a(%rip), %rax      # 0x1320
leaq 0x3a2f(%rip), %rcx      # 0x5060
movq %rax, (%rcx)
leaq 0x3a2d(%rip), %rax      # 0x5068
movq %rbx, (%rax)
xorl %eax, %eax
callq 0x1674
xorl %eax, %eax
callq 0x16ef
xorl %eax, %eax
callq 0x177d
xorl %eax, %eax
callq 0x19bb
movq %rbx, %rdi
callq *0x18(%rbx)
callq 0x1360
callq 0x14db
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]spiped/perftests/standalone-enc/fd_drain.c
// Function: fd_drain_internal
static int
fd_drain_internal(void * cookie)
{
	int fd = *((int *)cookie);
	uint8_t mybuf[FD_DRAIN_MAX_SIZE];
	ssize_t readlen;

	/* Loop until we hit EOF or an error. */
	do {
		readlen = read(fd, mybuf, FD_DRAIN_MAX_SIZE);
	} while (readlen > 0);

	/* Check for an error. */
	if (readlen == -1) {
		warnp("read");
		goto err0;
	}

	/* Success! */
	return (0);

err0:
	/* Failure!  This value will be the pid's exit code. */
	return (1);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x4008, %rsp           # imm = 0x4008
movl (%rdi), %ebx
movq %rsp, %r14
movl $0x4000, %edx           # imm = 0x4000
movl %ebx, %edi
movq %r14, %rsi
callq 0x2150
testq %rax, %rax
jg 0x2981
movq %rax, %rcx
xorl %eax, %eax
cmpq $-0x1, %rcx
jne 0x29d1
callq 0x2370
cmpl $0x0, (%rax)
je 0x29c0
movq %rax, %rbx
leaq 0x9809(%rip), %rdi      # 0xc1bd
xorl %eax, %eax
callq 0x955d
andl $0x0, (%rbx)
jmp 0x29ce
leaq 0x97f6(%rip), %rdi      # 0xc1bd
xorl %eax, %eax
callq 0x96ec
pushq $0x1
popq %rax
addq $0x4008, %rsp           # imm = 0x4008
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]spiped/perftests/standalone-enc/standalone_aesctr.c
// Function: standalone_aesctr
int
standalone_aesctr(const size_t * perfsizes, size_t num_perf,
    size_t nbytes_perftest, size_t nbytes_warmup)
{
	struct crypto_aes_key * k_aes;
	uint8_t kbuf[32];

	/* Report what we're doing. */
	printf("Testing AES-CTR\n");

	/* Initialize. */
	memset(kbuf, 0, 32);
	if ((k_aes = crypto_aes_key_expand(kbuf, 32)) == NULL)
		goto err0;

	/* Time the function. */
	if (perftest_buffers(nbytes_perftest, perfsizes, num_perf,
	    nbytes_warmup, 0, aesctr_init, aesctr_func, NULL, k_aes)) {
		warn0("perftest_buffers");
		goto err0;
	}

	/* Clean up. */
	crypto_aes_key_free(k_aes);

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r13
leaq 0x97be(%rip), %rdi      # 0xc1d3
callq 0x20f0
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdi
movaps %xmm0, (%rdi)
movaps %xmm0, 0x10(%rdi)
pushq $0x20
popq %rsi
callq 0x6286
pushq $0x1
popq %rbx
testq %rax, %rax
je 0x2a93
movq %rax, %rbp
movq %rax, 0x10(%rsp)
leaq 0x6e(%rip), %rax        # 0x2ab6
andq $0x0, 0x8(%rsp)
movq %rax, (%rsp)
leaq 0x4b(%rip), %r9         # 0x2aa4
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x9114
testl %eax, %eax
je 0x2a89
leaq 0x974a(%rip), %rdi      # 0xc1c2
xorl %eax, %eax
callq 0x96ec
callq 0x2370
andl $0x0, (%rax)
jmp 0x2a93
movq %rbp, %rdi
callq 0x6326
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]spiped/perftests/standalone-enc/standalone_aesctr.c
// Function: aesctr_func
static int
aesctr_func(void * cookie, uint8_t * buf, size_t buflen, size_t nreps)
{
	struct crypto_aes_key * k_aes = cookie;
	size_t i;

	/* Do the hashing. */
	for (i = 0; i < nreps; i++) {
		/*
		 * In proto_crypt_enc(), we would append the length to buf,
		 * then encrypt the buffer + 4 bytes of length.  For
		 * simplicity, this test does not imitate that details.
		 */
		crypto_aesctr_buf(k_aes, i, buf, buf, buflen);
	}

	/* Success! */
	return (0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %r13d, %r13d
cmpq %r13, %rbx
je 0x2aec
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %r15, %rcx
movq %r14, %r8
callq 0x6cb9
incq %r13
jmp 0x2ace
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]spiped/perftests/standalone-enc/standalone_aesctr_hmac.c
// Function: standalone_aesctr_hmac
int
standalone_aesctr_hmac(const size_t * perfsizes, size_t num_perf,
    size_t nbytes_perftest, size_t nbytes_warmup)
{
	struct aesctr_hmac_cookie aesctr_hmac_cookie;
	struct aesctr_hmac_cookie * ahc = &aesctr_hmac_cookie;
	HMAC_SHA256_CTX ctx;
	uint8_t kbuf[32];

	/* Report what we're doing. */
	printf("Testing HMAC_SHA256 with AES-CTR\n");

	/* Initialize. */
	ahc->ctx = &ctx;
	memset(kbuf, 0, 32);
	if ((ahc->k_aes = crypto_aes_key_expand(kbuf, 32)) == NULL)
		goto err0;

	/* Time the function. */
	if (perftest_buffers(nbytes_perftest, perfsizes, num_perf,
	    nbytes_warmup, 0, aesctr_hmac_init, aesctr_hmac_func, NULL, ahc)) {
		warn0("perftest_buffers");
		goto err0;
	}

	/* Clean up. */
	crypto_aes_key_free(ahc->k_aes);

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x120, %rsp            # imm = 0x120
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r13
leaq 0x96c8(%rip), %rdi      # 0xc1e3
callq 0x20f0
leaq 0x50(%rsp), %rax
movq %rax, 0x20(%rsp)
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rdi
movaps %xmm0, (%rdi)
movaps %xmm0, 0x10(%rdi)
pushq $0x20
popq %rsi
callq 0x6286
movq %rax, 0x28(%rsp)
pushq $0x1
popq %rbx
testq %rax, %rax
je 0x2bac
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x9f(%rip), %rax        # 0x2bfe
andq $0x0, 0x8(%rsp)
movq %rax, (%rsp)
leaq 0x4f(%rip), %r9         # 0x2bbf
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x9114
testl %eax, %eax
je 0x2ba0
leaq 0x9633(%rip), %rdi      # 0xc1c2
xorl %eax, %eax
callq 0x96ec
callq 0x2370
andl $0x0, (%rax)
jmp 0x2bac
movq 0x28(%rsp), %rdi
callq 0x6326
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x120, %rsp            # imm = 0x120
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]spiped/perftests/standalone-enc/standalone_aesctr_hmac.c
// Function: aesctr_hmac_init
static int
aesctr_hmac_init(void * cookie, uint8_t * buf, size_t buflen)
{
	struct aesctr_hmac_cookie * ahc = cookie;
	uint8_t kbuf[32];
	size_t i;

	/* (Re-)Initialize the context. */
	memset(kbuf, 0, 32);
	HMAC_SHA256_Init(ahc->ctx, kbuf, 32);

	/* Set the input. */
	for (i = 0; i < buflen; i++)
		buf[i] = (uint8_t)(i & 0xff);

	/* Success! */
	return (0);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
xorps %xmm0, %xmm0
movq %rsp, %rsi
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
movq (%rdi), %rdi
pushq $0x20
popq %rdx
callq 0x4252
xorl %eax, %eax
cmpq %rax, %rbx
je 0x2bf4
movb %al, (%r14,%rax)
incq %rax
jmp 0x2be6
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]spiped/perftests/standalone-enc/standalone_aesctr_hmac.c
// Function: aesctr_hmac_func
static int
aesctr_hmac_func(void * cookie, uint8_t * buf, size_t buflen, size_t nreps)
{
	struct aesctr_hmac_cookie * ahc = cookie;
	uint8_t hbuf[32];
	uint8_t pnum_exp[8];
	size_t i;

	/* Do the hashing. */
	for (i = 0; i < nreps; i++) {
		/*
		 * In proto_crypt_enc(), we would append the length to buf,
		 * then encrypt the buffer + 4 bytes of length.  After that,
		 * we'd hash the resulting (larger) buffer.  For simplicity,
		 * this test does not imitate those details.
		 */
		crypto_aesctr_buf(ahc->k_aes, i, buf, buf, buflen);
		HMAC_SHA256_Update(ahc->ctx, buf, buflen);
		be64enc(pnum_exp, i);
		HMAC_SHA256_Update(ahc->ctx, pnum_exp, 8);
	}
	HMAC_SHA256_Final(hbuf, ahc->ctx);

	/* Success! */
	return (0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
xorl %r13d, %r13d
pushq $0x8
popq %rbp
cmpq %r13, %rbx
je 0x2c66
movq 0x8(%r15), %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r12, %rcx
movq %r14, %r8
callq 0x6cb9
movq (%r15), %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x43aa
movq %r13, %rax
bswapq %rax
movq %rax, 0x8(%rsp)
movq (%r15), %rdi
leaq 0x8(%rsp), %rsi
movq %rbp, %rdx
callq 0x43aa
incq %r13
jmp 0x2c1e
movq (%r15), %rsi
leaq 0x10(%rsp), %rdi
callq 0x43da
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]spiped/perftests/standalone-enc/standalone_hmac.c
// Function: hmac_init
static int
hmac_init(void * cookie, uint8_t * buf, size_t buflen)
{
	HMAC_SHA256_CTX * ctx = cookie;
	uint8_t kbuf[32];
	size_t i;

	/* (Re-)Initialize the context. */
	memset(kbuf, 0, 32);
	HMAC_SHA256_Init(ctx, kbuf, 32);

	/* Set the input. */
	for (i = 0; i < buflen; i++)
		buf[i] = (uint8_t)(i & 0xff);

	/* Success! */
	return (0);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
xorps %xmm0, %xmm0
movq %rsp, %rsi
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
pushq $0x20
popq %rdx
callq 0x4252
xorl %eax, %eax
cmpq %rax, %rbx
je 0x2d46
movb %al, (%r14,%rax)
incq %rax
jmp 0x2d38
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]spiped/perftests/standalone-enc/standalone_hmac.c
// Function: hmac_func
static int
hmac_func(void * cookie, uint8_t * buf, size_t buflen, size_t nreps)
{
	HMAC_SHA256_CTX * ctx = cookie;
	uint8_t hbuf[32];
	uint8_t pnum_exp[8];
	size_t i;

	/* Do the hashing. */
	for (i = 0; i < nreps; i++) {
		HMAC_SHA256_Update(ctx, buf, buflen);

		/* Hash the iteration number as well. */
		be64enc(pnum_exp, i);
		HMAC_SHA256_Update(ctx, pnum_exp, 8);
	}
	HMAC_SHA256_Final(hbuf, ctx);

	/* Success! */
	return (0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
xorl %r13d, %r13d
pushq $0x8
popq %rbp
cmpq %r13, %r14
je 0x2da3
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x43aa
movq %r13, %rax
bswapq %rax
movq %rax, 0x8(%rsp)
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
movq %rbp, %rdx
callq 0x43aa
incq %r13
jmp 0x2d70
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x43da
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]spiped/perftests/standalone-enc/standalone_pce.c
// Function: standalone_pce
int
standalone_pce(const size_t * perfsizes, size_t num_perf,
    size_t nbytes_perftest, size_t nbytes_warmup)
{
	struct pce pce_actual;
	struct pce * pce = &pce_actual;

	/* Report what we're doing. */
	printf("Testing proto_crypt_enc()\n");

	/* Time the function. */
	if (perftest_buffers(nbytes_perftest, perfsizes, num_perf,
	    nbytes_warmup, 0, pce_init, pce_func, pce_cleanup, pce)) {
		warn0("perftest_buffers");
		goto err0;
	}

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
leaq 0x944b(%rip), %rdi      # 0xc22f
callq 0x20f0
subq $0x8, %rsp
leaq 0x10(%rsp), %rax
leaq 0xf9(%rip), %r10        # 0x2ef2
leaq 0xa6(%rip), %r11        # 0x2ea6
leaq 0x4c(%rip), %r9         # 0x2e53
xorl %ebx, %ebx
movq %r15, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r14, %rcx
xorl %r8d, %r8d
pushq %rax
pushq %r10
pushq %r11
callq 0x9114
addq $0x20, %rsp
testl %eax, %eax
je 0x2e43
leaq 0x9391(%rip), %rdi      # 0xc1c2
xorl %eax, %eax
callq 0x96ec
callq 0x2370
andl $0x0, (%rax)
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]spiped/perftests/standalone-enc/standalone_pce.c
// Function: pce_init
static int
pce_init(void * cookie, uint8_t * buf, size_t buflen)
{
	struct pce * pce = cookie;
	uint8_t kbuf[64];
	size_t i;

	/* Set up encryption key. */
	memset(kbuf, 0, 64);
	if ((pce->k = mkkeypair(kbuf)) == NULL)
		goto err0;

	/* Set the input. */
	for (i = 0; i < buflen; i++)
		buf[i] = (uint8_t)(i & 0xff);

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorps %xmm0, %xmm0
movq %rsp, %rdi
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
callq 0x3774
movq %rax, (%r15)
testq %rax, %rax
je 0x2e99
xorl %eax, %eax
xorl %ecx, %ecx
cmpq %rcx, %rbx
je 0x2e9c
movb %cl, (%r14,%rcx)
incq %rcx
jmp 0x2e8b
pushq $-0x1
popq %rax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]spiped/perftests/standalone-enc/standalone_pce.c
// Function: pce_func
static int
pce_func(void * cookie, uint8_t * buf, size_t buflen, size_t nreps)
{
	struct pce * pce = cookie;
	uint8_t encbuf[PCRYPT_ESZ];
	size_t i;

	/* Encrypt a bunch of times. */
	for (i = 0; i < nreps; i++)
		proto_crypt_enc(buf, buflen, encbuf, pce->k);

	/* Success! */
	return (0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x430, %rsp            # imm = 0x430
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq %rsp, %r13
subq $0x1, %rbx
jb 0x2edf
movq (%r12), %rcx
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x3c8b
jmp 0x2ec5
xorl %eax, %eax
addq $0x430, %rsp            # imm = 0x430
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]spiped/perftests/standalone-enc/standalone_transfer_noencrypt.c
// Function: standalone_transfer_noencrypt
int
standalone_transfer_noencrypt(const size_t * perfsizes, size_t num_perf,
    size_t nbytes_perftest, size_t nbytes_warmup, int method)
{
	struct shared shared_actual;
	const char * method_str;

	/* Report what we're doing. */
	if (method == 0)
		method_str = "two pipes";
	else if (method == 1)
		method_str = "two socketpairs";
	else {
		warn0("method not recognized");
		goto err0;
	}
	printf("Testing sending data over %s, no encryption\n", method_str);

	/* Record the communication method. */
	shared_actual.method = method;

	/* Time the function. */
	if (perftest_buffers(nbytes_perftest, perfsizes, num_perf,
	    nbytes_warmup, 0, perftest_init, perftest_func, perftest_cleanup,
	    &shared_actual)) {
		warn0("perftest_buffers");
		goto err0;
	}

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r8d, %r13d
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %r12
testl %r8d, %r8d
je 0x2f31
cmpl $0x1, %r13d
jne 0x2f94
leaq 0x9324(%rip), %rsi      # 0xc253
jmp 0x2f38
leaq 0x9311(%rip), %rsi      # 0xc249
leaq 0x933a(%rip), %rdi      # 0xc279
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x2060
leaq 0x8(%rsp), %rax
movl %r13d, 0x28(%rax)
subq $0x8, %rsp
leaq 0x2e4(%rip), %r10       # 0x3240
leaq 0x1d5(%rip), %r11       # 0x3138
leaq 0x54(%rip), %r9         # 0x2fbe
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
pushq %rax
pushq %r10
pushq %r11
callq 0x9114
addq $0x20, %rsp
testl %eax, %eax
je 0x2fad
leaq 0x9230(%rip), %rdi      # 0xc1c2
jmp 0x2f9b
leaq 0x92c8(%rip), %rdi      # 0xc263
xorl %eax, %eax
callq 0x96ec
callq 0x2370
andl $0x0, (%rax)
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]spiped/perftests/standalone-enc/standalone_transfer_noencrypt.c
// Function: perftest_func
static int
perftest_func(void * cookie, uint8_t * buf, size_t buflen, size_t nreps)
{
	struct shared * shared = cookie;
	size_t i;

	/* Send bytes. */
	for (i = 0; i < nreps; i++) {
		if (noeintr_write(shared->in[W], buf, buflen)
		    != (ssize_t)buflen) {
			warnp("network_write");
			goto err0;
		}
	}

	/* We've finished sending data. */
	if (close(shared->in[W])) {
		warnp("close");
		goto err0;
	}

	/* Wait until transfer_data has finished. */
	if (readbyte(shared->finished[R]))
		goto err0;

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
incq %r14
movl 0x14(%rbx), %edi
decq %r14
je 0x3181
movq %r12, %rsi
movq %r15, %rdx
callq 0x9064
cmpq %r15, %rax
je 0x314f
callq 0x2370
cmpl $0x0, (%rax)
je 0x31fe
movq %rax, %rbx
leaq 0x919c(%rip), %rdi      # 0xc31b
jmp 0x319e
callq 0x20a0
testl %eax, %eax
je 0x31aa
callq 0x2370
cmpl $0x0, (%rax)
je 0x3207
movq %rax, %rbx
leaq 0x9263(%rip), %rdi      # 0xc401
xorl %eax, %eax
callq 0x955d
andl $0x0, (%rbx)
jmp 0x3215
movl 0x20(%rbx), %ebx
leaq 0x7(%rsp), %r14
pushq $0x1
popq %r15
movl %ebx, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2150
cmpq $-0x1, %rax
je 0x31d6
testq %rax, %rax
je 0x3228
cmpq $0x1, %rax
jne 0x31b6
jmp 0x3224
callq 0x2370
movq %rax, %r12
movl (%rax), %eax
cmpl $0x4, %eax
je 0x31b6
leaq 0x8fd1(%rip), %rdi      # 0xc1bd
testl %eax, %eax
je 0x320e
xorl %eax, %eax
callq 0x955d
andl $0x0, (%r12)
jmp 0x3215
leaq 0x9116(%rip), %rdi      # 0xc31b
jmp 0x320e
leaq 0x91f3(%rip), %rdi      # 0xc401
xorl %eax, %eax
callq 0x96ec
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
xorl %eax, %eax
jmp 0x3218
leaq 0x90fa(%rip), %rdi      # 0xc329
xorl %eax, %eax
callq 0x96ec
callq 0x2370
andl $0x0, (%rax)
jmp 0x3215
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]spiped/perftests/standalone-enc/standalone_transfer_noencrypt.c
// Function: perftest_cleanup
static int
perftest_cleanup(void * cookie)
{
	struct shared * shared = cookie;
	int rc;

	/* Wait for threads to finish. */
	if ((rc = pthread_join(shared->data_thr, NULL))) {
		warn0("pthread_join: %s", strerror(rc));
		goto err0;
	}
	if ((rc = pthread_join(shared->output_thr, NULL))) {
		warn0("pthread_join: %s", strerror(rc));
		goto err0;
	}

	/* Clean up communication. */
	if (close(shared->out[R])) {
		warnp("close");
		goto err0;
	}
	if (close(shared->in[R])) {
		warnp("close");
		goto err0;
	}
	if (close(shared->finished[W])) {
		warnp("close");
		goto err0;
	}
	if (close(shared->finished[R])) {
		warnp("close");
		goto err0;
	}

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
xorl %esi, %esi
callq 0x2030
testl %eax, %eax
jne 0x3261
movq 0x8(%rbx), %rdi
xorl %esi, %esi
callq 0x2030
testl %eax, %eax
je 0x3286
movl %eax, %edi
callq 0x22a0
leaq 0x90d1(%rip), %rdi      # 0xc340
movq %rax, %rsi
xorl %eax, %eax
callq 0x96ec
callq 0x2370
andl $0x0, (%rax)
pushq $-0x1
popq %rax
popq %rbx
retq
movl 0x18(%rbx), %edi
callq 0x20a0
testl %eax, %eax
jne 0x32b6
movl 0x10(%rbx), %edi
callq 0x20a0
testl %eax, %eax
jne 0x32b6
movl 0x24(%rbx), %edi
callq 0x20a0
testl %eax, %eax
jne 0x32b6
movl 0x20(%rbx), %edi
callq 0x20a0
testl %eax, %eax
je 0x32e6
callq 0x2370
cmpl $0x0, (%rax)
je 0x32d6
movq %rax, %rbx
leaq 0x9137(%rip), %rdi      # 0xc401
xorl %eax, %eax
callq 0x955d
andl $0x0, (%rbx)
jmp 0x3281
leaq 0x9124(%rip), %rdi      # 0xc401
xorl %eax, %eax
callq 0x96ec
jmp 0x3281
xorl %eax, %eax
jmp 0x3284
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]spiped/perftests/standalone-enc/standalone_transfer_noencrypt.c
// Function: drain_output
static void *
drain_output(void * cookie)
{
	struct shared * shared = cookie;
	char dummy = 0;

	/* Read until we get an EOF. */
	if (fd_drain(shared->out[R]))
		goto err0;

	/* Notify that we've finished. */
	if (noeintr_write(shared->finished[W], &dummy, 1) != 1) {
		warnp("network_write");
		goto err0;
	}

err0:
	/* Finished! */
	return (NULL);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movb $0x0, 0xf(%rsp)
movl 0x18(%rdi), %edi
callq 0x2960
testl %eax, %eax
jne 0x3347
movl 0x24(%rbx), %edi
leaq 0xf(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x9064
cmpq $0x1, %rax
je 0x3347
callq 0x2370
cmpl $0x0, (%rax)
je 0x3339
movq %rax, %rbx
leaq 0x8fee(%rip), %rdi      # 0xc31b
xorl %eax, %eax
callq 0x955d
andl $0x0, (%rbx)
jmp 0x3347
leaq 0x8fdb(%rip), %rdi      # 0xc31b
xorl %eax, %eax
callq 0x96ec
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]spiped/perftests/standalone-enc/standalone_transfer_noencrypt.c
// Function: transfer_data
static void *
transfer_data(void * cookie)
{
	struct shared * shared = cookie;
	uint8_t mybuf[MAXOUTSIZE];
	ssize_t readlen;

	/* Loop until we hit EOF. */
	do {
		/* Get data from ->in, and break on EOF. */
		if ((readlen = read(shared->in[R], mybuf, MAXOUTSIZE)) == -1) {
			warnp("read");
			goto err0;
		}
		if (readlen == 0)
			break;

		/* Send data to ->out. */
		if (noeintr_write(shared->out[W], mybuf, (size_t)readlen)
		    != readlen) {
			warnp("network_write");
			goto err0;
		}
	} while (1);

	/* When ->in received an EOF, close ->out. */
	if (close(shared->out[W])) {
		warnp("close");
		goto err0;
	}

err0:
	/* Finished! */
	return (NULL);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x4000, %rsp           # imm = 0x4000
movq %rdi, %rbx
movq %rsp, %r14
movl 0x10(%rbx), %edi
movl $0x4000, %edx           # imm = 0x4000
movq %r14, %rsi
callq 0x2150
testq %rax, %rax
je 0x33be
movq %rax, %r15
cmpq $-0x1, %rax
je 0x33a8
movl 0x1c(%rbx), %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x9064
cmpq %r15, %rax
je 0x3361
callq 0x2370
cmpl $0x0, (%rax)
je 0x33f3
movq %rax, %rbx
leaq 0x8f75(%rip), %rdi      # 0xc31b
jmp 0x33de
callq 0x2370
cmpl $0x0, (%rax)
je 0x33ea
movq %rax, %rbx
leaq 0x8e01(%rip), %rdi      # 0xc1bd
jmp 0x33de
movl 0x1c(%rbx), %edi
callq 0x20a0
testl %eax, %eax
je 0x340a
callq 0x2370
cmpl $0x0, (%rax)
je 0x33fc
movq %rax, %rbx
leaq 0x9023(%rip), %rdi      # 0xc401
xorl %eax, %eax
callq 0x955d
andl $0x0, (%rbx)
jmp 0x340a
leaq 0x8dcc(%rip), %rdi      # 0xc1bd
jmp 0x3403
leaq 0x8f21(%rip), %rdi      # 0xc31b
jmp 0x3403
leaq 0x8ffe(%rip), %rdi      # 0xc401
xorl %eax, %eax
callq 0x96ec
xorl %eax, %eax
addq $0x4000, %rsp           # imm = 0x4000
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]spiped/perftests/standalone-enc/standalone_pipe_socketpair_one.c
// Function: pipe_init
static int
pipe_init(void * cookie, uint8_t * buf, size_t buflen)
{
	struct pipeinfo * pipeinfo = cookie;
	uint8_t kbuf[64];
	size_t i;

	/* Set up encryption key. */
	memset(kbuf, 0, 64);
	if ((pipeinfo->k = mkkeypair(kbuf)) == NULL)
		goto err0;

	/* Create socket pairs for the input and output. */
	if (socketpair(AF_UNIX, SOCK_STREAM, 0, pipeinfo->in)) {
		warnp("socketpair");
		goto err0;
	}
	if (socketpair(AF_UNIX, SOCK_STREAM, 0, pipeinfo->out)) {
		warnp("socketpair");
		goto err0;
	}

	/* Set the input. */
	for (i = 0; i < buflen; i++)
		buf[i] = (uint8_t)(i & 0xff);

	/* We haven't finished the event loop. */
	pipeinfo->done = 0;

	/* Create the pipe processes. */
	if ((pipeinfo->out_pid = fd_drain_fork(pipeinfo->out[R])) == -1)
		goto err0;
	if ((pipeinfo->enc_pid = fork_func(pipe_enc, pipeinfo)) == -1)
		goto err0;

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
xorps %xmm0, %xmm0
movq %rsp, %rdi
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
callq 0x3774
movq %rax, (%rbx)
testq %rax, %rax
je 0x3535
leaq 0x10(%rbx), %rcx
pushq $0x1
popq %rdi
movl %edi, %esi
xorl %edx, %edx
callq 0x22b0
testl %eax, %eax
jne 0x3507
leaq 0x18(%rbx), %rcx
pushq $0x1
popq %rdi
movl %edi, %esi
xorl %edx, %edx
callq 0x22b0
testl %eax, %eax
je 0x3542
callq 0x2370
cmpl $0x0, (%rax)
je 0x3527
movq %rax, %rbx
leaq 0x8e95(%rip), %rdi      # 0xc3b0
xorl %eax, %eax
callq 0x955d
andl $0x0, (%rbx)
jmp 0x3535
leaq 0x8e82(%rip), %rdi      # 0xc3b0
xorl %eax, %eax
callq 0x96ec
pushq $-0x1
popq %rax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
xorl %eax, %eax
cmpq %rax, %r14
je 0x3552
movb %al, (%r15,%rax)
incq %rax
jmp 0x3544
andl $0x0, 0x24(%rbx)
movl 0x18(%rbx), %edi
callq 0x29dc
movl %eax, 0x8(%rbx)
cmpl $-0x1, %eax
je 0x3535
leaq 0x13c(%rip), %rdi       # 0x36a9
movq %rbx, %rsi
callq 0x8d58
movl %eax, %ecx
movl %eax, 0xc(%rbx)
xorl %eax, %eax
cmpl $-0x1, %ecx
jne 0x3538
jmp 0x3535
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]spiped/perftests/standalone-enc/standalone_pipe_socketpair_one.c
// Function: pipe_func
static int
pipe_func(void * cookie, uint8_t * buf, size_t buflen, size_t nreps)
{
	struct pipeinfo * pipeinfo = cookie;
	size_t i;

	/* Send bytes. */
	for (i = 0; i < nreps; i++) {
		if (noeintr_write(pipeinfo->in[W], buf, buflen)
		    != (ssize_t)buflen) {
			warnp("network_write");
			goto err0;
		}
	}

	/* We've finished writing stuff. */
	if (shutdown(pipeinfo->in[W], SHUT_WR)) {
		warnp("shutdown");
		goto err0;
	}

	/* Wait for the processes to finish. */
	if (fork_func_wait(pipeinfo->enc_pid))
		goto err0;
	if (fork_func_wait(pipeinfo->out_pid))
		goto err0;

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
incq %r14
movl 0x14(%rbx), %edi
decq %r14
je 0x35c8
movq %r12, %rsi
movq %r15, %rdx
callq 0x9064
cmpq %r15, %rax
je 0x359a
callq 0x2370
cmpl $0x0, (%rax)
je 0x3610
movq %rax, %rbx
leaq 0x8d55(%rip), %rdi      # 0xc31b
jmp 0x35e8
pushq $0x1
popq %rsi
callq 0x2090
testl %eax, %eax
je 0x35f4
callq 0x2370
cmpl $0x0, (%rax)
je 0x3619
movq %rax, %rbx
leaq 0x8d9f(%rip), %rdi      # 0xc387
xorl %eax, %eax
callq 0x955d
andl $0x0, (%rbx)
jmp 0x3627
movl 0xc(%rbx), %edi
callq 0x8db7
testl %eax, %eax
jne 0x3627
movl 0x8(%rbx), %edi
callq 0x8db7
testl %eax, %eax
jne 0x3627
xorl %eax, %eax
jmp 0x362a
leaq 0x8d04(%rip), %rdi      # 0xc31b
jmp 0x3620
leaq 0x8d67(%rip), %rdi      # 0xc387
xorl %eax, %eax
callq 0x96ec
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]spiped/perftests/standalone-enc/standalone_pipe_socketpair_one.c
// Function: pipe_cleanup
static int
pipe_cleanup(void * cookie)
{
	struct pipeinfo * pipeinfo = cookie;

	/* Clean up encryption key. */
	proto_crypt_free(pipeinfo->k);

	/* Clean up sockets. */
	if (close(pipeinfo->in[W])) {
		warnp("close");
		goto err0;
	}
	if (close(pipeinfo->in[R])) {
		warnp("close");
		goto err0;
	}
	if (close(pipeinfo->out[W])) {
		warnp("close");
		goto err0;
	}
	if (close(pipeinfo->out[R])) {
		warnp("close");
		goto err0;
	}

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x3c70
movl 0x14(%rbx), %edi
callq 0x20a0
testl %eax, %eax
jne 0x3672
movl 0x10(%rbx), %edi
callq 0x20a0
testl %eax, %eax
jne 0x3672
movl 0x1c(%rbx), %edi
callq 0x20a0
testl %eax, %eax
jne 0x3672
movl 0x18(%rbx), %edi
callq 0x20a0
testl %eax, %eax
je 0x36a5
callq 0x2370
cmpl $0x0, (%rax)
je 0x3692
movq %rax, %rbx
leaq 0x8d7b(%rip), %rdi      # 0xc401
xorl %eax, %eax
callq 0x955d
andl $0x0, (%rbx)
jmp 0x36a0
leaq 0x8d68(%rip), %rdi      # 0xc401
xorl %eax, %eax
callq 0x96ec
pushq $-0x1
popq %rax
popq %rbx
retq
xorl %eax, %eax
jmp 0x36a3
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]spiped/perftests/standalone-enc/standalone_pipe_socketpair_one.c
// Function: pipe_enc
static int
pipe_enc(void * cookie)
{
	struct pipeinfo * pipeinfo = cookie;
	void * cancel_cookie;

	/* Create the pipe. */
	if ((cancel_cookie = proto_pipe(pipeinfo->in[R], pipeinfo->out[W], 0,
	    pipeinfo->k, &pipeinfo->status, pipe_callback_status, pipeinfo))
	    == NULL) {
		warn0("proto_pipe");
		goto err0;
	}

	/* Let events happen. */
	if (events_spin(&pipeinfo->done))
		warnp("events_spin");

	/* Clean up the pipe. */
	proto_pipe_cancel(cancel_cookie);

	/* Success! */
	return (0);

err0:
	/* Failure!  This value will be the pid's exit code. */
	return (1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl 0x10(%rdi), %edi
movl 0x1c(%r14), %esi
movq (%r14), %rcx
leaq 0x20(%r14), %r8
movq %r14, (%rsp)
leaq 0x7b(%rip), %r9         # 0x3744
xorl %edx, %edx
callq 0x9870
testq %rax, %rax
je 0x3709
movq %rax, %rbx
addq $0x24, %r14
movq %r14, %rdi
callq 0x7be7
testl %eax, %eax
je 0x3732
callq 0x2370
cmpl $0x0, (%rax)
je 0x3724
movq %rax, %r14
leaq 0x8c60(%rip), %rdi      # 0xc35c
xorl %eax, %eax
callq 0x955d
andl $0x0, (%r14)
jmp 0x3732
leaq 0x8c41(%rip), %rdi      # 0xc351
xorl %eax, %eax
callq 0x96ec
callq 0x2370
andl $0x0, (%rax)
pushq $0x1
popq %rax
jmp 0x373c
leaq 0x8c31(%rip), %rdi      # 0xc35c
xorl %eax, %eax
callq 0x96ec
movq %rbx, %rdi
callq 0x9ae2
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq