LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/Nealsbo[P]C-Software-Renderer/src/libmath.c
// Function: mat4_rotx
void mat4_rotx( mat4 dest, float r ){
    mat4 m = {
        1.0f,    0.0f,   0.0f, 0.0f,
        0.0f,  cos(r), sin(r), 0.0f,
        0.0f, -sin(r), cos(r), 0.0f,
        0.0f,    0.0f,   0.0f, 1.0f };
    mat4_copy(m, dest);
}

// Assembly:
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
callq 0x1250
movaps %xmm0, 0x30(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x1080
movaps %xmm0, 0x20(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x1080
cvtsd2ss %xmm0, %xmm0
xorps 0x31a9(%rip), %xmm0     # 0x7150
movaps %xmm0, 0x10(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x1250
cvtsd2ss %xmm0, %xmm0
movl $0x3f800000, %eax       # imm = 0x3F800000
movl %eax, (%rbx)
xorps %xmm1, %xmm1
movups %xmm1, 0x4(%rbx)
movapd 0x30(%rsp), %xmm2
unpcklpd 0x20(%rsp), %xmm2       # xmm2 = xmm2[0],mem[0]
cvtpd2ps %xmm2, %xmm2
movupd %xmm2, 0x14(%rbx)
movaps 0x10(%rsp), %xmm2
movss %xmm2, 0x24(%rbx)
movss %xmm0, 0x28(%rbx)
movups %xmm1, 0x2c(%rbx)
movl %eax, 0x3c(%rbx)
addq $0x40, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/Nealsbo[P]C-Software-Renderer/src/libmath.c
// Function: mat4_roty
void mat4_roty( mat4 dest, float r ){
    mat4 m = {
        cos(r), 0.0f, -sin(r), 0.0f,
          0.0f, 1.0f,    0.0f, 0.0f,
        sin(r), 0.0f,  cos(r), 0.0f,
          0.0f, 0.0f,    0.0f, 1.0f };
    mat4_copy(m, dest);
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
cvtss2sd %xmm0, %xmm0
movsd %xmm0, (%rsp)
callq 0x1250
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xc(%rsp)
movsd (%rsp), %xmm0
callq 0x1080
cvtsd2ss %xmm0, %xmm0
xorps 0x3121(%rip), %xmm0     # 0x7150
movaps %xmm0, 0x10(%rsp)
movsd (%rsp), %xmm0
callq 0x1080
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x8(%rsp)
movsd (%rsp), %xmm0
callq 0x1250
cvtsd2ss %xmm0, %xmm0
movss 0xc(%rsp), %xmm1
movss %xmm1, (%rbx)
xorl %eax, %eax
movl %eax, 0x4(%rbx)
movaps 0x10(%rsp), %xmm1
movss %xmm1, 0x8(%rbx)
movaps 0x330a(%rip), %xmm1     # 0x7380
movups %xmm1, 0xc(%rbx)
movl %eax, 0x1c(%rbx)
movss 0x8(%rsp), %xmm1
movss %xmm1, 0x20(%rbx)
movl %eax, 0x24(%rbx)
movss %xmm0, 0x28(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x2c(%rbx)
movl $0x3f800000, 0x3c(%rbx) # imm = 0x3F800000
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/Nealsbo[P]C-Software-Renderer/src/libmath.c
// Function: mat4_projection
void mat4_projection( mat4 dest, float n, float f, float fov, float aspect ){
    float s = 1.0f/tanf(fov * 0.5f * M_PI / 180.0f);
    float zr = n - f;
    
    mat4 m = {
            s/aspect, 0.0f,      0.0f,        0.0f,
                0.0f,    s,      0.0f,        0.0f,
                0.0f, 0.0f, (-n-f)/zr, 2.0f*n*f/zr,
                0.0f, 0.0f,     -1.0f,        0.0f };
    mat4_copy(m, dest);
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movss %xmm3, 0xc(%rsp)
movss %xmm1, 0x8(%rsp)
movaps %xmm0, 0x10(%rsp)
mulss 0x2ed5(%rip), %xmm2     # 0x702c
movq %rdi, %rbx
xorps %xmm0, %xmm0
cvtss2sd %xmm2, %xmm0
mulsd 0x3257(%rip), %xmm0     # 0x73c0
divsd 0x3257(%rip), %xmm0     # 0x73c8
cvtsd2ss %xmm0, %xmm0
callq 0x11d0
movss 0x2e92(%rip), %xmm1     # 0x7014
divss %xmm0, %xmm1
movaps 0x10(%rsp), %xmm4
movaps %xmm4, %xmm0
movss 0x8(%rsp), %xmm5
subss %xmm5, %xmm0
movaps %xmm1, %xmm2
divss 0xc(%rsp), %xmm2
movaps 0x2fa8(%rip), %xmm3     # 0x7150
xorps %xmm4, %xmm3
subss %xmm5, %xmm3
addss %xmm4, %xmm4
mulss %xmm5, %xmm4
unpcklps %xmm4, %xmm3            # xmm3 = xmm3[0],xmm4[0],xmm3[1],xmm4[1]
movss %xmm2, (%rbx)
xorps %xmm2, %xmm2
movups %xmm2, 0x4(%rbx)
movss %xmm1, 0x14(%rbx)
movups %xmm2, 0x18(%rbx)
unpcklps %xmm0, %xmm0            # xmm0 = xmm0[0,0,1,1]
divps %xmm0, %xmm3
movlps %xmm3, 0x28(%rbx)
movaps 0x31c1(%rip), %xmm0     # 0x73a0
movups %xmm0, 0x30(%rbx)
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/Nealsbo[P]C-Software-Renderer/src/libmath.c
// Function: power_f_i
float power_f_i( float x, int y ) {
    int i;
    float s = 1;
    for( i = y; i != 0; --i )
		s *= x;
    return s;
}

// Assembly:
testl %edi, %edi
je 0x4447
movaps %xmm0, %xmm1
movss 0x2bd6(%rip), %xmm0     # 0x7014
mulss %xmm1, %xmm0
decl %edi
jne 0x443e
retq
movss 0x2bc5(%rip), %xmm0     # 0x7014
retq
// File: /workspace/github_c_makefile_star2_O3/Nealsbo[P]C-Software-Renderer/src/main.c
// Function: main
int main(int argc, char* args[]) {
    if( Application_Init() != NULL )
		Application_Run();
	
	Application_Close();

    return 0;
}

// Assembly:
pushq %rax
xorl %eax, %eax
callq 0x137c
testl %eax, %eax
je 0x44f7
xorl %eax, %eax
callq 0x1416
xorl %eax, %eax
callq 0x1867
xorl %eax, %eax
popq %rcx
retq
nop
// File: /workspace/github_c_makefile_star2_O3/Nealsbo[P]C-Software-Renderer/src/objloader.c
// Function: Vertex_Lerp
vertex_t Vertex_Lerp( vertex_t v, float value ){
    vertex_t vert;
    vert.position = vec4_lerp( vert.position, v.position, value );
    vert.normal   = vec4_lerp( vert.normal, v.normal, value );
    vert.uv       = vec2_lerp( vert.uv, v.uv, value );
    return vert;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movaps %xmm0, %xmm4
movss %xmm0, 0xc(%rsp)
movq %rdi, %rbx
movsd (%rdi), %xmm0
movsd 0x8(%rdi), %xmm1
movsd 0x20(%rsp), %xmm2
movsd 0x28(%rsp), %xmm3
callq 0x2ddf
movlhps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
movups %xmm0, (%rbx)
movsd 0x10(%rbx), %xmm0
movsd 0x18(%rbx), %xmm1
movsd 0x30(%rsp), %xmm2
movsd 0x38(%rsp), %xmm3
movss 0xc(%rsp), %xmm4
callq 0x2ddf
movlhps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
movups %xmm0, 0x10(%rbx)
movsd 0x20(%rbx), %xmm0
movsd 0x40(%rsp), %xmm1
movss 0xc(%rsp), %xmm2
callq 0x28b1
movlps %xmm0, 0x20(%rbx)
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/Nealsbo[P]C-Software-Renderer/src/objloader.c
// Function: Vertex_GetPositionElement
float Vertex_GetPositionElement( vertex_t v, int index ){
    switch( index ){
    case 0:
        return v.position.x;
    case 1:
        return v.position.y;
    case 2:
        return v.position.z;
    case 3:
        return v.position.w;
    default:
        return 0;
    }
}

// Assembly:
cmpl $0x3, %edi
ja 0x45d9
leaq 0x8(%rsp), %rax
movl %edi, %ecx
leaq 0x2fa7(%rip), %rdx      # 0x7560
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movss (%rax), %xmm0
retq
movss 0x8(%rax), %xmm0
retq
movss 0xc(%rax), %xmm0
retq
movss 0x4(%rax), %xmm0
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_c_makefile_star2_O3/Nealsbo[P]C-Software-Renderer/src/objloader.c
// Function: Face_Print
void Face_Print(obj_face_t f){
    int i;
    printf("Face:");
    for(i = 0; i <f.vcount; i++)
        printf(" %d/%d/%d", f.indexes[i].x, f.indexes[i].y, f.indexes[i].z );
    printf("\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x346f(%rip), %rdi      # 0x7a70
xorl %eax, %eax
callq 0x1040
testl %ebp, %ebp
jle 0x4641
movl %ebp, %eax
shlq $0x2, %rax
leaq (%rax,%rax,2), %r15
leaq 0x3459(%rip), %r14      # 0x7a76
xorl %r12d, %r12d
movl (%rbx,%r12), %esi
movl 0x4(%rbx,%r12), %edx
movl 0x8(%rbx,%r12), %ecx
movq %r14, %rdi
xorl %eax, %eax
callq 0x1040
addq $0xc, %r12
cmpq %r12, %r15
jne 0x4620
movl $0xa, %edi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x11b0
// File: /workspace/github_c_makefile_star2_O3/Nealsbo[P]C-Software-Renderer/src/objloader.c
// Function: Face_Printp
void Face_Printp(void *_f){
    obj_face_t *f = (obj_face_t *)_f;
    int i;
    printf("Face:");
    for(i = 0; i <f->vcount; i++)
        printf(" %d/%d/%d", f->indexes[i].x, f->indexes[i].y, f->indexes[i].z );
    printf("\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x340b(%rip), %rdi      # 0x7a70
xorl %eax, %eax
callq 0x1040
cmpl $0x0, (%rbx)
jle 0x46ac
movl $0x8, %r15d
leaq 0x33f8(%rip), %r14      # 0x7a76
xorl %r12d, %r12d
movq 0x8(%rbx), %rax
movl -0x8(%rax,%r15), %esi
movl -0x4(%rax,%r15), %edx
movl (%rax,%r15), %ecx
movq %r14, %rdi
xorl %eax, %eax
callq 0x1040
incq %r12
movslq (%rbx), %rax
addq $0xc, %r15
cmpq %rax, %r12
jl 0x4681
movl $0xa, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x11b0
// File: /workspace/github_c_makefile_star2_O3/Nealsbo[P]C-Software-Renderer/src/objloader.c
// Function: Model_Create
obj_model_t *Model_Create( const char *model_name){
    obj_model_t *model = (obj_model_t *)malloc(sizeof(obj_model_t));
    if(model == NULL){
        printf("Error: Cannot create model object '%s'\n", model_name);
        return NULL;
    }

    memcpy(model->name, model_name, MAX_NAME_LENGTH);

    model->vertCount   = 0;                                             //Allocation prepared data for model, box in that case
    model->trisCount   = 0;
    model->position    = vec3_create(0.1, 2.3, 4.5);
    model->rotation    = vec3_create(6.7, 8.9, 0.1);
    model->scale       = vec3_create(1.3, 1.6, 1.9);
    model->baseColor   = Color_Init(63, 127, 191, 255);
    model->diffmap     = NULL;
    model->normalmap   = NULL;
    model->vertices    = NULL;
    model->faces       = NULL;
    model->normals     = NULL;
    model->textcoords  = NULL;

    return model;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x170, %edi            # imm = 0x170
callq 0x11a0
movq %rax, %rbx
testq %rax, %rax
je 0x47b9
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1100
xorl %eax, %eax
movl %eax, 0x120(%rbx)
movl %eax, 0x12c(%rbx)
movss 0x332c(%rip), %xmm0     # 0x7a30
movss 0x3328(%rip), %xmm1     # 0x7a34
movss 0x3324(%rip), %xmm2     # 0x7a38
callq 0x2a24
movlps %xmm0, 0x130(%rbx)
movss %xmm1, 0x138(%rbx)
movss 0x330c(%rip), %xmm0     # 0x7a3c
movss 0x3308(%rip), %xmm1     # 0x7a40
movss 0x32f0(%rip), %xmm2     # 0x7a30
callq 0x2a24
movlps %xmm0, 0x13c(%rbx)
movss %xmm1, 0x144(%rbx)
movss 0x32e8(%rip), %xmm0     # 0x7a44
movss 0x32e4(%rip), %xmm1     # 0x7a48
movss 0x32e0(%rip), %xmm2     # 0x7a4c
callq 0x2a24
movlps %xmm0, 0x148(%rbx)
movss %xmm1, 0x150(%rbx)
movl $0x3f, %edi
movl $0x7f, %esi
movl $0xbf, %edx
movl $0xff, %ecx
callq 0x1e40
movl %eax, 0x154(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x100(%rbx)
movups %xmm0, 0x110(%rbx)
movups %xmm0, 0x158(%rbx)
jmp 0x47ca
leaq 0x32c0(%rip), %rdi      # 0x7a80
movq %r14, %rsi
xorl %eax, %eax
callq 0x1040
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Nealsbo[P]C-Software-Renderer/src/objloader.c
// Function: Model_Free
void Model_Free(void *_model){
    obj_model_t *model = (obj_model_t *)_model;
    if(model == NULL){
        printf("Warning: Free request for NULL model pointer!");
        return;
    }

    if( !model->vertices )
        free(model->vertices);
    if( !model->normals )
        free(model->normals);
    if( !model->textcoords )
        free(model->textcoords);
    if( !model->faces ){
        int i;
        for(i = 0; i < model->trisCount; i++)
            free(model->faces[i].indexes);
        free(model->faces);
    }

    if( !model->diffmap ){
        Bitmap_Free(model->diffmap->bitmap);
        free(model->diffmap);
    }
    
    if( !model->normalmap ){
        Bitmap_Free(model->normalmap->bitmap);
        free(model->normalmap);
    }

    model->vertices   = NULL;
    model->normals    = NULL;
    model->textcoords = NULL;
    model->faces      = NULL;
    model->diffmap    = NULL;
    model->normalmap  = NULL;

    free(model);
    model = NULL;
}

// Assembly:
testq %rdi, %rdi
je 0x4ad4
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x108(%rdi)
jne 0x4ae9
cmpl $0x0, 0x12c(%rbx)
jle 0x4ae2
movl $0x8, %r14d
xorl %r15d, %r15d
movq 0x108(%rbx), %rax
movq (%rax,%r14), %rdi
callq 0x1288
incq %r15
movslq 0x12c(%rbx), %rax
addq $0x10, %r14
cmpq %rax, %r15
jl 0x4aa8
movq 0x108(%rbx), %rdi
jmp 0x4ae4
leaq 0x310b(%rip), %rdi      # 0x7be6
xorl %eax, %eax
jmp 0x1040
xorl %edi, %edi
callq 0x1288
cmpq $0x0, 0x158(%rbx)
jne 0x4b04
callq 0x2755
movq 0x158(%rbx), %rdi
callq 0x1288
cmpq $0x0, 0x160(%rbx)
jne 0x4b1f
callq 0x2755
movq 0x160(%rbx), %rdi
callq 0x1288
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x1288
// File: /workspace/github_c_makefile_star2_O3/Nealsbo[P]C-Software-Renderer/src/raster.c
// Function: Raster_DrawLine
void Raster_DrawLine(vec4 v0, vec4 v1, SDL_Surface *image, color_t color) {
    mat4 sst;
	mat4_screen ( sst, WINDOW_WIDTH / 2, WINDOW_HEIGHT / 2 );
    
    vec2i p0 = vec4_toVec2i( vec4_pdiv( vec4_byMat4( v0, sst ) ) );
    vec2i p1 = vec4_toVec2i( vec4_pdiv( vec4_byMat4( v1, sst ) ) );

    int x0 = p0.x;
    int y0 = p0.y;
    int x1 = p1.x;
    int y1 = p1.y;

    int deltax = abs( x1 - x0 );
    int deltay = abs( y1 - y0 );
    int signx = x0 < x1 ? 1 : -1;
    int signy = y0 < y1 ? 1 : -1;
    int error2, error = ( deltax > deltay ? deltax : -deltay ) / 2;

    while(1) {
        if( x0 >= 0 && y0 >= 0 && x0 < image->w && y0 < image->h )
            renderer_->PutPixel( image, x0, y0, Color_ToUInt32( color ) );
        if( x0 == x1 && y0 == y1 )
            break;

        error2 = error;
        if ( error2 >- deltax ){
            error -= deltay;
            x0    += signx;
        }
        if ( error2 <  deltay ){
            error += deltax;
            y0    += signy;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %esi, 0xc(%rsp)
movq %rdi, %rbx
movaps %xmm3, 0x40(%rsp)
movaps %xmm2, 0x30(%rsp)
movaps %xmm1, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
leaq 0x50(%rsp), %r13
movss 0x2413(%rip), %xmm0     # 0x7ca0
movss 0x240f(%rip), %xmm1     # 0x7ca4
movq %r13, %rdi
callq 0x41e9
movaps 0x10(%rsp), %xmm0
movaps 0x20(%rsp), %xmm1
movq %r13, %rdi
callq 0x2e0f
callq 0x2c3f
callq 0x2dfa
movq %rax, %r15
movq %rax, %r12
shrq $0x20, %r12
movaps 0x30(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
movq %r13, %rdi
callq 0x2e0f
callq 0x2c3f
callq 0x2dfa
movq %rbx, %r13
movq %rax, %r8
shrq $0x20, %r8
xorl %edi, %edi
movl %r8d, %ecx
subl %r12d, %ecx
setg %dil
xorl %edx, %edx
movl %eax, %esi
subl %r15d, %esi
setg %dl
movl %esi, %r9d
negl %r9d
cmovsl %esi, %r9d
movl %ecx, %r14d
negl %r14d
cmovsl %ecx, %r14d
leal -0x1(,%rdx,2), %esi
movl %r14d, %ecx
negl %ecx
cmpl %r14d, %r9d
cmoval %r9d, %ecx
leal -0x1(,%rdi,2), %edi
movl %ecx, %ebp
shrl $0x1f, %ebp
addl %ecx, %ebp
sarl %ebp
movl %r9d, %ebx
negl %ebx
movq %rax, 0x30(%rsp)
movq %r8, 0x20(%rsp)
movl %r9d, 0x10(%rsp)
movl %esi, 0x8(%rsp)
movl %edi, 0x4(%rsp)
testl %r15d, %r15d
js 0x59aa
testl %r12d, %r12d
js 0x59aa
cmpl 0x10(%r13), %r15d
jge 0x59aa
cmpl 0x14(%r13), %r12d
jge 0x59aa
leaq 0x5839(%rip), %rcx      # 0xb1a8
movq (%rcx), %rcx
movq 0x28(%rcx), %rcx
movq %rcx, 0x40(%rsp)
movl 0xc(%rsp), %edi
callq 0x213a
movq %r13, %rdi
movl %r15d, %esi
movl %r12d, %edx
movl %eax, %ecx
callq *0x40(%rsp)
movl 0x4(%rsp), %edi
movl 0x8(%rsp), %esi
movl 0x10(%rsp), %r9d
movq 0x20(%rsp), %r8
movq 0x30(%rsp), %rax
cmpl %eax, %r15d
jne 0x59b4
cmpl %r8d, %r12d
je 0x59ec
cmpl %ebx, %ebp
movl $0x0, %edx
cmovgl %esi, %edx
movl $0x0, %ecx
cmovgl %r14d, %ecx
addl %edx, %r15d
movl %ebp, %edx
subl %ecx, %edx
cmpl %r14d, %ebp
movl $0x0, %ecx
cmovll %edi, %ecx
movl $0x0, %ebp
cmovll %r9d, %ebp
addl %ecx, %r12d
addl %edx, %ebp
jmp 0x5952
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Nealsbo[P]C-Software-Renderer/src/render.c
// Function: Renderer_Putpixel
void Renderer_Putpixel( SDL_Surface *surface, int x, int y, uint32_t pixel ) {
    if ( x > surface->w || x < 0 || y > surface->h || y < 0 )
        return;
    int bpp = surface->format->BytesPerPixel;
    uint8_t *p = (uint8_t *)surface->pixels + y * surface->pitch + x * bpp;
    switch(bpp) {
    case 1:
        *p = pixel;
        break;
    case 2:
        *(uint16_t *)p = pixel;
        break;
    case 3:
        if(SDL_BYTEORDER == SDL_BIG_ENDIAN) {
            p[0] = (pixel >> 16) & 0xff;
            p[1] = (pixel >> 8) & 0xff;
            p[2] = pixel & 0xff;
        } else {
            p[0] = pixel & 0xff;
            p[1] = (pixel >> 8) & 0xff;
            p[2] = (pixel >> 16) & 0xff;
        }
        break;
    case 4:
        *(uint32_t *)p = pixel;
        break;
    }
}

// Assembly:
testl %esi, %esi
js 0x5f72
cmpl %esi, 0x10(%rdi)
jl 0x5f72
testl %edx, %edx
js 0x5f72
cmpl %edx, 0x14(%rdi)
jl 0x5f72
movq 0x8(%rdi), %rax
movzbl 0x11(%rax), %r9d
leal -0x1(%r9), %r8d
cmpl $0x3, %r8d
ja 0x5f72
movslq 0x18(%rdi), %r10
movslq %edx, %rax
imulq %r10, %rax
addq 0x20(%rdi), %rax
movl %esi, %edx
imulq %r9, %rdx
leaq 0x1d5a(%rip), %rsi      # 0x7cc0
movslq (%rsi,%r8,4), %rdi
addq %rsi, %rdi
jmpq *%rdi
movb %cl, (%rax,%rdx)
retq
movb %cl, (%rax,%rdx)
movb %ch, 0x1(%rax,%rdx)
shrl $0x10, %ecx
movb %cl, 0x2(%rax,%rdx)
retq
movl %ecx, (%rax,%rdx)
retq
movw %cx, (%rax,%rdx)
retq
// File: /workspace/github_c_makefile_star2_O3/Nealsbo[P]C-Software-Renderer/src/render.c
// Function: Renderer_DrawWorld
void Renderer_DrawWorld( renderer_t *renderer, SDL_Surface *Surface ) {
	scene_t *scene = renderer->scene;
    SDL_FillRect( Surface, NULL, SDL_MapRGB( Surface->format, 0x00, 0x00, 0x00 ) );
    Renderer_ClearZBuffer( renderer );
    node_t *objList_node = List_Head( Scene_GetObjectList( scene ) );

    while( objList_node != NULL ) {
        Renderer_DrawObject( scene, renderer, List_Data(objList_node), Surface );
        objList_node = objList_node->next;
    }
    renderer->frameCount++;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %r15
movq 0x8(%rsi), %rdi
xorl %r12d, %r12d
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x10a0
movq %r14, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0x1060
movq 0x18(%rbx), %rax
movaps 0x180b(%rip), %xmm0     # 0x7ce0
movups %xmm0, (%rax,%r12,4)
addq $0x4, %r12
cmpq $0xe1000, %r12          # imm = 0xE1000
jne 0x64d5
movq %r15, %rdi
callq 0x6620
movq 0x18(%rax), %r12
testq %r12, %r12
je 0x6511
movq (%r12), %rdx
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rcx
callq 0x5fc4
movq 0x8(%r12), %r12
jmp 0x64f3
incl 0x24(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Nealsbo[P]C-Software-Renderer/src/render.c
// Function: Renderer_Destroy
void Renderer_Destroy( renderer_t *renderer ) {
    if( renderer != NULL ) {
        free( renderer->z_Buffer );
        renderer->z_Buffer = NULL;
        printf( "\nRendered frames: %d\n", renderer->frameCount );
        free( renderer );
    }
}

// Assembly:
testq %rdi, %rdi
je 0x6554
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
callq 0x1288
movq $0x0, 0x18(%rbx)
movl 0x24(%rbx), %esi
leaq 0x17ac(%rip), %rdi      # 0x7cf0
xorl %eax, %eax
callq 0x1040
movq %rbx, %rdi
popq %rbx
jmp 0x1288
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/Nealsbo[P]C-Software-Renderer/src/scene.c
// Function: Scene_Init
scene_t *Scene_Init( camera_t *camera ) {
    scene_t *scene = (scene_t *)malloc(sizeof(scene_t));
    if(scene == NULL) {
        printf( "Error: Cannot create scene!\n" );
        return NULL;
    }

    scene->objectList = (List *)malloc(sizeof(List));
    List_Init( scene->objectList, &Model_Test, &Model_Free );

    scene->mainCamera   = camera;
    scene->directLight = vec3_create( 0.0f, 5.0f, 5.0f );
	scene->directLightColor = vec3_create( 1.0f, 1.0f, 1.0f );
	scene->ambientLightColor = vec3_create( 1.0f, 1.0f, 1.0f );
    scene->currentState = SCENE_STATE_UPDATABLE;
    return scene;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x40, %edi
callq 0x11a0
movq %rax, %rbx
testq %rax, %rax
je 0x65f9
movl $0x28, %edi
callq 0x11a0
movq %rax, 0x30(%rbx)
leaq -0xf6d(%rip), %rsi      # 0x561d
leaq -0x1b12(%rip), %rdx     # 0x4a7f
movq %rax, %rdi
callq 0x1cf0
movq %r14, (%rbx)
movss 0xa84(%rip), %xmm1      # 0x7028
xorps %xmm0, %xmm0
movaps %xmm1, %xmm2
callq 0x2a24
movlps %xmm0, 0x8(%rbx)
movss %xmm1, 0x10(%rbx)
movss 0xa54(%rip), %xmm0      # 0x7014
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
callq 0x2a24
movlps %xmm0, 0x14(%rbx)
movss %xmm1, 0x1c(%rbx)
movss 0xa38(%rip), %xmm0      # 0x7014
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
callq 0x2a24
movlps %xmm0, 0x20(%rbx)
movss %xmm1, 0x28(%rbx)
movl $0x1, 0x38(%rbx)
jmp 0x6605
leaq 0x173b(%rip), %rdi      # 0x7d3b
callq 0x11f0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Nealsbo[P]C-Software-Renderer/src/scene.c
// Function: Scene_FindObjectByName
obj_model_t *Scene_FindObjectByName( scene_t *scene, char *name ) {
	List        *objList = Scene_GetObjectList( scene );
	node_t      *curr    = List_Head( objList );
	obj_model_t *obj     = NULL;
	
	int isFound = FALSE;
	
	while( curr != NULL ) {
		if( strstr( Model_GetName(List_Data(curr)), name ) ) {
			isFound = TRUE;
			break;
		}
        curr = curr->next;
    }
    if(isFound){
		obj = List_Data(curr);
	} else {
		printf( "SceneWarn: Object \"%s\" not found!\n", name );
	}
	return obj;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq 0x30(%rdi), %rax
movq 0x18(%rax), %r14
testq %r14, %r14
je 0x667d
movq (%r14), %rdi
callq 0x5619
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1090
testq %rax, %rax
jne 0x6693
movq 0x8(%r14), %r14
jmp 0x665a
leaq 0x1694(%rip), %rdi      # 0x7d18
xorl %r14d, %r14d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1040
jmp 0x6696
movq (%r14), %r14
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Nealsbo[P]C-Software-Renderer/src/shader.c
// Function: Shader_SetMatrices
void Shader_SetMatrices( shader_t *shader, mat4 model, mat4 view, mat4 mvp ) {
	mat4 tmp;
	mat4_copy( model, shader->m );
	mat4_copy( view, shader->v );
	
	mat4_inv( shader->m, tmp );
	mat4_tsp( tmp, shader->m_it );
	
	mat4_copy( mvp, shader->mvp );
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %r15
movq %rsi, %rdi
movq %r15, %rsi
callq 0x3ab5
leaq 0x40(%r15), %rsi
movq %r14, %rdi
callq 0x3ab5
movq %rsp, %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x2fbc
leaq 0x80(%r15), %rsi
movq %r14, %rdi
callq 0x2f92
addq $0xc0, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3ab5
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/pipde[P]deos-songlib/utils/phrases/scanner.c
// Function: readInt
int
readInt(FILE *fp)
    {
    int x,result;
    result = fscanf(fp,"%d",&x);
    if (result == EOF)
        {
        return 0;
        }
    if (result == 0)
        {
        fprintf(stderr,"SCAN ERROR: attempt to read an integer failed\n");
        fprintf(stderr,"offending character was <%c>\n",fgetc(fp));
        exit(1);
        }
    return x;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x1667(%rip), %rsi      # 0x369c
xorl %r14d, %r14d
leaq -0x14(%rbp), %rdx
xorl %eax, %eax
callq 0x1040
cmpl $-0x1, %eax
je 0x2050
testl %eax, %eax
je 0x205c
movl -0x14(%rbp), %r14d
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rbx, %rdi
callq 0x11d0
// File: /workspace/github_c_makefile_star2_O3/pipde[P]deos-songlib/utils/phrases/scanner.c
// Function: readReal
double
readReal(FILE *fp)
    {
    int result;
    double x;
    result = fscanf(fp," %lf",&x);
    if (result == EOF)
        {
        return 0.0;
        }
    if (result == 0)
        {
        fprintf(stderr,"SCAN ERROR: attempt to read a real number failed\n");
        fprintf(stderr,"offending character was <%c>\n",fgetc(fp));
        exit(2);
        }
    return x;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1678(%rip), %rsi      # 0x36ec
leaq -0x10(%rbp), %rdx
xorl %eax, %eax
callq 0x1040
xorps %xmm0, %xmm0
cmpl $-0x1, %eax
je 0x2090
testl %eax, %eax
je 0x2097
movsd -0x10(%rbp), %xmm0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq %rbx, %rdi
callq 0x121c
// File: /workspace/github_c_makefile_star2_O3/pipde[P]deos-songlib/utils/phrases/scanner.c
// Function: readChar
char
readChar(FILE *fp)
    {
    int result;
    char x;
    result = fscanf(fp," %c",&x);
    if (result == EOF)
        {
        return -1;
        }
    if (result == 0)
        {
        fprintf(stderr,"SCAN ERROR: attempt to read a non-whitespace character failed\n");
        fprintf(stderr,"offending character was <%c>\n",fgetc(fp));
        exit(2);
        }
    return x;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1674(%rip), %rsi      # 0x3723
leaq -0x9(%rbp), %rdx
xorl %eax, %eax
callq 0x1040
movl %eax, %ecx
movb $-0x1, %al
cmpl $-0x1, %ecx
je 0x20ca
testl %ecx, %ecx
je 0x20d1
movb -0x9(%rbp), %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq %rbx, %rdi
callq 0x1268
// File: /workspace/github_c_makefile_star2_O3/pipde[P]deos-songlib/utils/phrases/scanner.c
// Function: readRawChar
char
readRawChar(FILE *fp)
    {
    int result;
    char x;
    result = fscanf(fp,"%c",&x);
    if (result == EOF)
        {
        return -1;
        }
    if (result == 0)
        {
        fprintf(stderr,"SCAN ERROR: attempt to read a raw character failed\n");
        fprintf(stderr,"offending character was <%c>\n",fgetc(fp));
        exit(2);
        }
    return x;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x163b(%rip), %rsi      # 0x3724
leaq -0x9(%rbp), %rdx
xorl %eax, %eax
callq 0x1040
movl %eax, %ecx
movb $-0x1, %al
cmpl $-0x1, %ecx
je 0x2104
testl %ecx, %ecx
je 0x210b
movb -0x9(%rbp), %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq %rbx, %rdi
callq 0x12b4
// File: /workspace/github_c_makefile_star2_O3/pipde[P]deos-songlib/utils/phrases/scanner.c
// Function: readString
char *
readString(FILE *fp)
    {
    int ch,index;
    char *buffer;
    int size = 512;

    /* advance to the double quote */

    skipWhiteSpace(fp);

    ch = fgetc(fp);
    if (ch == EOF) return 0;

    /* allocate the buffer */

    buffer = allocateMsg(size,"readString");

    if (ch != '\"')
        {
        fprintf(stderr,"SCAN ERROR: attempt to read a string failed\n");
        fprintf(stderr,"first character was <%c>\n",ch);
        exit(4);
        }

    /* toss the double quote, skip to the next character */

    ch = fgetc(fp);

    /* initialize the buffer index */

    index = 0;

    /* collect characters until the closing double quote */

    while (ch != '\"')
        {
        if (ch == EOF)
            {
            fprintf(stderr,"SCAN ERROR: attempt to read a string failed\n");
            fprintf(stderr,"no closing double quote\n");
            exit(6);
            }
        if (index > size - 2) 
            {
            ++size;
            buffer = reallocateMsg(buffer,size,"readString");
            }

        if (ch == '\\')
            {
            ch = fgetc(fp);
            if (ch == EOF)
                {
                fprintf(stderr,"SCAN ERROR: attempt to read a string failed\n");
                fprintf(stderr,"escaped character missing\n");
                exit(6);
                }
            buffer[index] = convertEscapedChar(ch);
            }
        else
            buffer[index] = ch;
        ++index;
        ch = fgetc(fp);
        }

    buffer[index] = '\0';

    return buffer;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x2229
movq %rbx, %rdi
callq 0x10b0
cmpl $-0x1, %eax
je 0x2202
movl %eax, %r15d
leaq 0x1656(%rip), %rsi      # 0x379a
movl $0x200, %edi            # imm = 0x200
callq 0x2264
cmpl $0x22, %r15d
jne 0x2221
movq %rax, %r14
movl $0x200, %r15d           # imm = 0x200
xorl %r13d, %r13d
movq %rbx, %rdi
callq 0x10b0
cmpl $0x22, %eax
je 0x21f8
movl %eax, %r12d
cmpl $-0x1, %eax
je 0x2217
leal -0x2(%r15), %eax
cltq
cmpq %rax, %r13
jle 0x21a4
incl %r15d
movslq %r15d, %rsi
movq %r14, %rdi
leaq 0x15fe(%rip), %rdx      # 0x379a
callq 0x2286
movq %rax, %r14
cmpl $0x5c, %r12d
jne 0x21ec
movq %rbx, %rdi
callq 0x10b0
movl %eax, %r12d
cmpl $0x6d, %eax
jg 0x21cb
cmpl $0x22, %r12d
je 0x21e1
cmpl $0x5c, %r12d
jne 0x21e6
movb $0x5c, %r12b
jmp 0x21ec
cmpl $0x6e, %r12d
je 0x21dc
cmpl $0x74, %r12d
jne 0x21ec
movb $0x9, %r12b
jmp 0x21ec
movb $0xa, %r12b
jmp 0x21ec
movb $0x22, %r12b
jmp 0x21ec
cmpl $-0x1, %r12d
je 0x221c
movb %r12b, (%r14,%r13)
incq %r13
jmp 0x2164
movl %r13d, %eax
movb $0x0, (%r14,%rax)
jmp 0x2205
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1340
callq 0x1383
movl %r15d, %edi
callq 0x1300
// File: /workspace/github_c_makefile_star2_O3/pipde[P]deos-songlib/utils/phrases/scanner.c
// Function: allocateMsg
void *
allocateMsg(size_t size,char *where)
    {
    char *s;
    s = malloc(size);
    if (s == 0)
        {
        fprintf(stderr,"%s: could not allocate string, out of memory\n",
            where);
        exit(3);
        }

    return s;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
callq 0x1120
testq %rax, %rax
je 0x227e
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq %rbx, %rdi
callq 0x13c6
// File: /workspace/github_c_makefile_star2_O3/pipde[P]deos-songlib/utils/phrases/scanner.c
// Function: reallocateMsg
static void *
reallocateMsg(void *s,size_t size,char *where)
    {
    char *t;
    t = realloc(s,size);
    if (t == 0)
        {
        fprintf(stderr,"%s: could not reallocate string, out of memory\n",
            where);
        exit(3);
        }

    return t;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdx, %rbx
callq 0x1140
testq %rax, %rax
je 0x22a0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq %rbx, %rdi
callq 0x13ed
// File: /workspace/github_c_makefile_star2_O3/pipde[P]deos-songlib/utils/phrases/scanner.c
// Function: readToken
char *
readToken(FILE *fp)
    {
    int ch,index;
    char *buffer;
    int size = 80;

    skipWhiteSpace(fp);

    ch = fgetc(fp);
    if (ch == EOF) return 0;

    buffer = allocateMsg(size,"readToken");

    index = 0;
    while (!isspace(ch))
        {
        if (ch == EOF) break;
        if (index > size - 2)
            {
            ++size;
            buffer = reallocateMsg(buffer,size,"readToken");
            }
        buffer[index] = ch;
        ++index;
        ch = fgetc(fp);
        }

    /* push back the character that got us out of this loop */

    ungetc(ch,fp);

    if (index > 0)              //there is something in the buffer
        clearerr(fp);           //so force the read to be good

    buffer[index] = '\0';

    return buffer;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x2229
movq %rbx, -0x30(%rbp)
movq %rbx, %rdi
callq 0x10b0
cmpl $-0x1, %eax
je 0x2371
movl %eax, %r15d
leaq 0x1543(%rip), %rsi      # 0x3820
movl $0x50, %edi
callq 0x2264
movq %rax, %rbx
callq 0x11b0
movq %rax, %r12
movq (%rax), %rax
movslq %r15d, %rcx
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x2375
movl $0x50, %r14d
xorl %r13d, %r13d
leal -0x2(%r14), %eax
cltq
cmpq %rax, %r13
jle 0x232b
incl %r14d
movslq %r14d, %rsi
movq %rbx, %rdi
leaq 0x14fd(%rip), %rdx      # 0x3820
callq 0x2286
movq %rax, %rbx
movb %r15b, (%rbx,%r13)
incq %r13
movq -0x30(%rbp), %rdi
callq 0x10b0
movl %eax, %r15d
cmpl $-0x1, %eax
je 0x2355
movq (%r12), %rax
movslq %r15d, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
je 0x2308
movl %r15d, %edi
movq -0x30(%rbp), %r14
movq %r14, %rsi
callq 0x1130
movq %r14, %rdi
callq 0x1100
movl %r13d, %eax
jmp 0x2383
xorl %ebx, %ebx
jmp 0x2387
movl %r15d, %edi
movq -0x30(%rbp), %rsi
callq 0x1130
xorl %eax, %eax
movb $0x0, (%rbx,%rax)
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/pipde[P]deos-songlib/utils/phrases/scanner.c
// Function: readLine
char *
readLine(FILE *fp)
    {
    int ch,index;
    char *buffer;
    int size = 512;
    
    ch = fgetc(fp);
    if (ch == EOF) return 0;

    buffer = allocateMsg(size,"readLine");

    index = 0;
    while (ch != '\n')
        {
        if (ch == EOF) break;
        if (index > size - 2)
            {
            ++size;
            buffer = reallocateMsg(buffer,size,"readLine");
            }
        buffer[index] = ch;
        ++index;
        ch = fgetc(fp);
        }


    if (index > 0)              //there is something in the buffer
        clearerr(fp);           //so force the read to be good

    buffer[index] = '\0';

    return buffer;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x10b0
cmpl $-0x1, %eax
je 0x242e
movl %eax, %r12d
leaq 0x146c(%rip), %rsi      # 0x382a
movl $0x200, %edi            # imm = 0x200
callq 0x2264
movq %rax, %r14
movl $0x200, %r15d           # imm = 0x200
xorl %r13d, %r13d
cmpl $-0x1, %r12d
je 0x2417
cmpl $0xa, %r12d
je 0x2417
leal -0x2(%r15), %eax
cltq
cmpq %rax, %r13
jle 0x2403
incl %r15d
movslq %r15d, %rsi
movq %r14, %rdi
leaq 0x142f(%rip), %rdx      # 0x382a
callq 0x2286
movq %rax, %r14
movb %r12b, (%r14,%r13)
incq %r13
movq %rbx, %rdi
callq 0x10b0
movl %eax, %r12d
jmp 0x23d4
testq %r13, %r13
je 0x2424
movq %rbx, %rdi
callq 0x1100
movl %r13d, %eax
movb $0x0, (%r14,%rax)
jmp 0x2431
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jflatow[P]jfdb/src/db.c
// Function: JFDB_wipe
int JFDB_wipe(const char *path) {
  // remove keys & vals, flag if either one fails
  int failed = 0;
  char fp[JFDB_MAX_PATH + 6];
  snprintf(fp, sizeof(fp), "%s.keys", path);
  remove(fp);
  switch (errno) {
    case 0:
    case ENOENT:
      break;
    default:
      failed |= JFDB_KEYS;
      break;
  }
  snprintf(fp, sizeof(fp), "%s.vals", path);
  remove(fp);
  switch (errno) {
    case 0:
    case ENOENT:
      break;
    default:
      failed |= JFDB_VALS;
      break;
  }
  return failed;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rdi, %rbx
leaq 0x4822(%rip), %rdx      # 0x60bd
movq %rsp, %r14
movl $0x406, %esi            # imm = 0x406
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x10d0
movq %r14, %rdi
callq 0x1060
callq 0x1040
movq %rax, %r15
xorl %ebp, %ebp
testl $0xfffffffd, (%rax)     # imm = 0xFFFFFFFD
setne %bpl
leaq 0x47f2(%rip), %rdx      # 0x60c5
movl $0x406, %esi            # imm = 0x406
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x10d0
movq %r14, %rdi
callq 0x1060
testl $0xfffffffd, (%r15)     # imm = 0xFFFFFFFD
je 0x18f9
orl $0x2, %ebp
movl %ebp, %eax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jflatow[P]jfdb/src/db.c
// Function: JFDB_file_open
static int JFDB_file_open(JFDB *db, const char *path) {
  // get the fd for keys & vals, and sanity check that they look like valid files
  // vals has a different header, but the magic / version are the same
  int fd;
  if ((fd = open(path, O_RDWR, 0644)) < 0) {
    if (errno == ENOENT) {
      if ((fd = open(path, O_RDWR | O_CREAT | O_EXCL, 0644)) < 0) {
        JFDB_set_error(db, JFDB_EFILE, "could not create ('%.32s')", path);
      } else {
        // new file: write the header
        db->tip.magic = JFDB_MAGIC;
        db->tip.version = JFDB_VERSION;
        if (write(fd, &db->tip, sizeof(db->tip)) < sizeof(db->tip))
          JFDB_set_error(db, JFDB_EFILE, "failed to write ('%.32s')", path);
      }
    } else {
      JFDB_set_error(db, JFDB_EFILE, "cannot open file ('%.32s')", path);
    }
  } else {
    // existing file: read the header
    if (read(fd, &db->tip, sizeof(db->tip)) < sizeof(db->tip))
      JFDB_set_error(db, JFDB_EFILE, "failed to read ('%.32s')", path);
    else if (db->tip.magic != JFDB_MAGIC && db->tip.version != JFDB_VERSION)
      JFDB_set_error(db, JFDB_EFILE, "invalid file ('%.32s')", path);
  }
  return fd;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
movl $0x2, %esi
movl $0x1a4, %edx            # imm = 0x1A4
xorl %eax, %eax
callq 0x1190
movl %eax, %ebx
testl %eax, %eax
js 0x1bfd
leaq 0xc0(%r15), %r12
movl $0x70, %edx
movl %ebx, %edi
movq %r12, %rsi
callq 0x1110
cmpq $0x6f, %rax
ja 0x1c4e
leaq 0x4718(%rip), %rdx      # 0x6313
jmp 0x1c7b
callq 0x1040
cmpl $0x2, (%rax)
jne 0x1c6b
movq %r14, %rdi
movl $0xc2, %esi
movl $0x1a4, %edx            # imm = 0x1A4
xorl %eax, %eax
callq 0x1190
movl %eax, %ebx
testl %eax, %eax
js 0x1c74
leaq 0xc0(%r15), %rsi
movq $0x7fdb, 0xc0(%r15) # imm = 0x7FDB
movl $0x70, %edx
movl %ebx, %edi
callq 0x1080
cmpq $0x6f, %rax
ja 0x1c8d
leaq 0x4692(%rip), %rdx      # 0x62de
jmp 0x1c7b
cmpl $0x7fdb, (%r12)         # imm = 0x7FDB
je 0x1c8d
cmpl $0x0, 0xc4(%r15)
je 0x1c8d
leaq 0x46c3(%rip), %rdx      # 0x632c
jmp 0x1c7b
leaq 0x4686(%rip), %rdx      # 0x62f8
jmp 0x1c7b
leaq 0x4648(%rip), %rdx      # 0x62c3
movq %r15, %rdi
movl $0x4, %esi
movq %r14, %rcx
xorl %eax, %eax
callq 0x1b19
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jflatow[P]jfdb/src/db.c
// Function: JFDB_mmap_file
static int JFDB_mmap_file(JFDB *db, int kv, size_t cover, int factor) {
  // if the mmap already includes cover, do nothing
  // otherwise increase the mapping by a size of factor
  JFDB_MMap *m = kv == JFDB_KEYS ? &db->kmap : &db->vmap;
  if (m->size >= cover)
    return 0;

  // we need to remap the memory, there are some open questions and TODOs:
  //  - if we munmap before mmapping again:
  //     we temporarily release the references to the underlying memory
  //     potentially allowing us to re-use the address range
  //     potentially avoiding TLB misses if the OS hasn't released the memory
  //     there's a lot of potential but it could just as easily work against us
  //  - if we mmap again before munmapping:
  //     we ensure that we always retain a reference to the memory
  //     however we are guaranteed to get a different address range
  //  - XXX: we should be taking advantage of mremap when it's available
  //  - alternatively, we could impose an upper bound on the file size and map it once
  //    but its not polite (at best) for a library to hog the address space like that
  //  - we map nearest multiple of PAGESIZE, for which we will anyway incur the cost
  int prot = kv == JFDB_KEYS ? PROT_READ | PROT_WRITE : PROT_READ;
  if (m->size)
    munmap(m->map, m->size);
  m->size = RTM(cover * factor, sysconf(_SC_PAGESIZE));
  m->map = mmap(NULL, m->size, prot, MAP_SHARED, m->fd, 0);
  if (m->map == MAP_FAILED)
    JFDB_set_error(db, JFDB_EMMAP, "cannot mmap %s", kv == JFDB_KEYS ? "keys" : "vals");
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
cmpl $0x1, %esi
movl $0x90, %eax
movl $0xa8, %r13d
cmoveq %rax, %r13
movq 0x10(%rdi,%r13), %rsi
cmpq %rdx, %rsi
jae 0x1d57
movl %ecx, %r12d
movq %rdx, %r15
movq %rdi, %rbx
xorl %eax, %eax
cmpl $0x1, %ebp
sete %al
leal 0x1(,%rax,2), %r14d
testq %rsi, %rsi
je 0x1cf0
movq 0x8(%rbx,%r13), %rdi
callq 0x1170
movl %r12d, %r12d
imulq %r15, %r12
movl $0x1e, %edi
callq 0x11a0
leaq (%r12,%rax), %r15
decq %r15
movl $0x1e, %edi
callq 0x11a0
movq %rax, %rcx
movq %r15, %rax
xorl %edx, %edx
divq %rcx
movq %rax, %r15
movl $0x1e, %edi
callq 0x11a0
imulq %rax, %r15
movq %r15, 0x10(%rbx,%r13)
movl (%rbx,%r13), %r8d
xorl %edi, %edi
movq %r15, %rsi
movl %r14d, %edx
movl $0x1, %ecx
xorl %r9d, %r9d
callq 0x10b0
movq %rax, 0x8(%rbx,%r13)
cmpq $-0x1, %rax
je 0x1d66
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x1, %ebp
leaq 0x4463(%rip), %rax      # 0x61d3
leaq 0x4447(%rip), %rcx      # 0x61be
cmoveq %rax, %rcx
leaq 0x45c1(%rip), %rdx      # 0x6343
movq %rbx, %rdi
movl $0x5, %esi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1b19
// File: /workspace/github_c_makefile_star2_O3/jflatow[P]jfdb/src/db.c
// Function: JFDB_close
JFDB *JFDB_close(JFDB *db) {
  // NB: after calling close, it is not safe to call any other db operations
  //     however, if close fails, it is safe to try and call close again
  // if for some strange reason we can't flush, don't free our resources yet
  if (db->isModified)
    if (JFDB_has_error(JFDB_flush(db)))
      return db;

  // release the mmaps and buffers
  JFDB_mmap_release(db, JFDB_KEYS);
  JFDB_mmap_release(db, JFDB_VALS);
  JFDB_mbuf_release(db, 0);
  JFDB_mbuf_release(db, 1);

  // possibly wipe the files, not normally failable as we just had the path open
  if (db->flags & JFDB_TEMPORARY)
    if (JFDB_wipe(db->path))
      return JFDB_set_error(db, JFDB_EFILE, "failed to wipe files");

  // completely free
  free(db->path);
  free(db);
  return NULL;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x980(%rdi)
je 0x2486
movq %rbx, %rdi
callq 0x2514
cmpl $0x0, 0x88(%rbx)
jne 0x250f
movq %rbx, %rdi
movl $0x1, %esi
callq 0x290c
movq %rbx, %rdi
movl $0x2, %esi
callq 0x290c
movq 0x988(%rbx), %rdi
testq %rdi, %rdi
je 0x24b8
callq 0x542b
movq %rax, 0x988(%rbx)
movq 0x990(%rbx), %rdi
testq %rdi, %rdi
je 0x24d0
callq 0x542b
movq %rax, 0x990(%rbx)
testb $0x1, 0x8c(%rbx)
je 0x24fd
movq (%rbx), %rdi
callq 0x1884
testl %eax, %eax
je 0x24fd
leaq 0x3c1b(%rip), %rdx      # 0x6107
movq %rbx, %rdi
movl $0x4, %esi
xorl %eax, %eax
callq 0x1b19
jmp 0x250f
movq (%rbx), %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1030
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jflatow[P]jfdb/src/db.c
// Function: JFDB_mmap_release
static void JFDB_mmap_release(JFDB *db, int kv) {
  JFDB_MMap *m = kv == JFDB_KEYS ? &db->kmap : &db->vmap;
  if (m->map != MAP_FAILED)
    munmap(m->map, m->size);
  if (m->fd >= 0)
    close(m->fd);
  m->size = 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x1, %esi
movl $0x90, %eax
movl $0xa8, %r14d
cmoveq %rax, %r14
movq 0x8(%rdi,%r14), %rdi
cmpq $-0x1, %rdi
je 0x293a
movq 0x10(%rbx,%r14), %rsi
callq 0x1170
movl (%rbx,%r14), %edi
testl %edi, %edi
js 0x2947
callq 0x1100
movq $0x0, 0x10(%rbx,%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jflatow[P]jfdb/src/db.c
// Function: JFDB_annul
JFDB *JFDB_annul(JFDB *db, const JFT_Stem *primary, int flags) {
  JFT_Leaf leaf = (JFT_Leaf) {};
  JFT *tx = JFT_atom(primary, &leaf, NULL, 0, db->scratch[0], db->scratch[1]);
  if (!tx)
    return JFDB_set_error(db, JFDB_ETRIE, "failed to create atom");
  return JFDB_write(db, tx, flags);
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movq %rsi, %rax
movq %rdi, %rbx
xorps %xmm0, %xmm0
movq %rsp, %rsi
movaps %xmm0, (%rsi)
movq 0x988(%rdi), %r8
movq 0x990(%rdi), %r9
movq %rax, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x4a80
testq %rax, %rax
je 0x2f7a
movq %rbx, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0x2958
jmp 0x2f90
leaq 0x3201(%rip), %rdx      # 0x6182
movq %rbx, %rdi
movl $0x6, %esi
xorl %eax, %eax
callq 0x1b19
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jflatow[P]jfdb/src/db.c
// Function: JFDB_store
JFDB *JFDB_store(JFDB *db,
                 const JFT_Stem *restrict primary,
                 const JFT_Stem *restrict value,
                 const JFT_Stem *restrict indices,
                 JFT_Count numIndices,
                 int flags) {
  JFDB_Region region = JFDB_valloc(db, value->size);
  if (JFDB_has_error(db))
    return db;
  if (pwrite(db->vmap.fd, value->data, value->size, JFDB_voffset(region)) < value->size)
    return JFDB_set_error(db, JFDB_EFILE, "failed to write value");

  JFT_Leaf leaf = (JFT_Leaf) {.size = 1, .data = (JFT_Word *)&region};
  JFT *tx = JFT_atom(primary, &leaf, indices, numIndices, db->scratch[0], db->scratch[1]);
  if (!tx)
    return JFDB_set_error(db, JFDB_ETRIE, "failed to create atom");
  return JFDB_write(db, tx, flags);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r9d, 0x8(%rsp)
movl %r8d, 0xc(%rsp)
movq %rcx, %r15
movq %rdx, %rbp
movq %rsi, %r12
movq %rdi, %rbx
movzwl 0x8(%rdx), %r13d
movl %r13d, %ecx
addl $0xff, %ecx
movl %ecx, %eax
shrl $0x8, %eax
andl $0x1ff00, %ecx          # imm = 0x1FF00
movl $0x1a, %edx
movl 0x4(%rbx,%rdx,8), %esi
subl %ecx, %esi
jae 0x3050
incq %rdx
cmpq $0x22, %rdx
jne 0x2fdc
movl $0xff, %esi
addq 0x118(%rbx), %rsi
movq %rsi, %r14
shrq $0x8, %r14
andl $0xffffff00, %esi       # imm = 0xFFFFFF00
addq %r13, %rsi
movq %rsi, 0x118(%rbx)
movl 0xa8(%rbx), %edi
callq 0x10e0
testl %eax, %eax
je 0x3035
leaq 0x332c(%rip), %rdx      # 0x6352
movq %rbx, %rdi
movl $0x4, %esi
xorl %eax, %eax
callq 0x1b19
movq 0x118(%rbx), %rdx
movq %rbx, %rdi
movl $0x2, %esi
movl $0x2, %ecx
callq 0x1c9b
jmp 0x305e
movl (%rbx,%rdx,8), %r14d
addl %r14d, %eax
movl %eax, (%rbx,%rdx,8)
movl %esi, 0x4(%rbx,%rdx,8)
movq %r13, %rax
shlq $0x20, %rax
movl %r14d, %ecx
orq %rcx, %rax
movq %rax, 0x10(%rsp)
cmpl $0x0, 0x88(%rbx)
jne 0x3105
movl 0xa8(%rbx), %edi
movq 0x10(%rbp), %rsi
shll $0x8, %ecx
movq %r13, %rdx
callq 0x1180
cmpq %r13, %rax
jge 0x30a8
leaq 0x30fa(%rip), %rdx      # 0x6198
movq %rbx, %rdi
movl $0x4, %esi
jmp 0x30fe
leaq 0x18(%rsp), %rsi
movl $0x1, (%rsi)
leaq 0x10(%rsp), %rax
movq %rax, 0x8(%rsi)
movq 0x988(%rbx), %r8
movq 0x990(%rbx), %r9
movq %r12, %rdi
movq %r15, %rdx
movl 0xc(%rsp), %ecx
callq 0x4a80
testq %rax, %rax
je 0x30ef
movq %rbx, %rdi
movq %rax, %rsi
movl 0x8(%rsp), %edx
callq 0x2958
jmp 0x3105
leaq 0x308c(%rip), %rdx      # 0x6182
movq %rbx, %rdi
movl $0x6, %esi
xorl %eax, %eax
callq 0x1b19
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/jflatow[P]jfdb/src/db.c
// Function: JFDB_get_value
JFT_Stem *JFDB_get_value(JFDB *db, JFT *node, JFT_Stem *value) {
  JFT_Leaf leaf = JFT_leaf(node);
  if (leaf.size == 0)
    return NULL;
  JFDB_Region region = *(JFDB_Region *)leaf.data;
  value->size = region.size;
  value->data = db->vmap.map + JFDB_voffset(region);
  return value;
}

// Assembly:
movq %rdx, %rax
movq (%rsi), %rdx
movq %rdx, %rcx
shrq $0x28, %rcx
movl $0xff, %r8d
andl %r8d, %ecx
shrq $0x30, %rdx
andl $0xfff, %edx            # imm = 0xFFF
addq %rsi, %rdx
addq $0x8, %rdx
cmpl %r8d, %ecx
jne 0x3166
movl (%rdx), %ecx
addq $0x4, %rdx
testl %ecx, %ecx
je 0x3183
movzwl 0x4(%rdx), %ecx
movl (%rdx), %edx
movw %cx, 0x8(%rax)
shll $0x8, %edx
addq 0xb0(%rdi), %rdx
movq %rdx, 0x10(%rax)
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/jflatow[P]jfdb/src/db.c
// Function: JFDB_find
JFT_Cursor *JFDB_find(JFDB *db, JFT_Cursor *cursor, const JFT_Stem *key) {
  JFT *trie;
  for (JFT_Offset pos = db->tip.cp.offset; pos; pos = JFT_parent_offset(trie)) {
    trie = JFDB_get_trie(db, pos);
    JFT_cursor_init(cursor, In, trie);
    if (JFT_cursor_find(cursor, key) != JFT_SYMBOL_NIL)
      return cursor;
  }
  return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x128(%rdi), %r12
testq %r12, %r12
je 0x31df
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movabsq $0xffffffffff, %r13     # imm = 0xFFFFFFFFFF
addq 0x98(%r15), %r12
movq %rbx, %rdi
movl $0x1, %esi
movq %r12, %rdx
callq 0x35c4
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3af3
cmpq $-0x2, %rax
jne 0x31e1
movq (%r12), %r12
andq %r13, %r12
jne 0x31ae
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq