LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tigr.c
// Function: tigrError
void tigrError(Tigr* bmp, const char* message, ...) {
    char tmp[1024];

    va_list args;
    va_start(args, message);
    vsnprintf(tmp, sizeof(tmp), message, args);
    tmp[sizeof(tmp) - 1] = 0;
    va_end(args);

    printf("tigr fatal error: %s\n", tmp);

    exit(1);
}

// Assembly:
pushq %rbx
subq $0x4d0, %rsp            # imm = 0x4D0
movq %rsi, %r10
leaq 0x20(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x71a6
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rcx
movq %rsi, 0x10(%rcx)
leaq 0x4e0(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rcx)
leaq 0xd0(%rsp), %rbx
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdi
movq %r10, %rdx
callq 0x3230
movb $0x0, 0x3ff(%rbx)
leaq 0x58c7(%rip), %rdi      # 0xcab3
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3060
movl $0x1, %edi
callq 0x3420
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tigr.c
// Function: tigrTime
float tigrTime() {
    static double lastTime = 0;

    struct timeval tv;
    gettimeofday(&tv, NULL);

    double now = (double)tv.tv_sec + (tv.tv_usec / 1000000.0);
    double elapsed = lastTime == 0 ? 0 : now - lastTime;
    lastTime = now;

    return (float)elapsed;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsp, %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3670
cvtsi2sdq (%rbx), %xmm0
cvtsi2sdq 0x8(%rbx), %xmm1
divsd 0x57cb(%rip), %xmm1     # 0xc9f0
addsd %xmm0, %xmm1
movsd 0x928f(%rip), %xmm0     # 0x104c0
movsd %xmm1, 0x9287(%rip)     # 0x104c0
subsd %xmm0, %xmm1
xorpd %xmm2, %xmm2
cmpeqsd %xmm0, %xmm2
andnpd %xmm1, %xmm2
xorps %xmm0, %xmm0
cvtsd2ss %xmm2, %xmm0
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tigr.c
// Function: tigrMouse
void tigrMouse(Tigr* bmp, int* x, int* y, int* buttons) {
    TigrInternal* win = tigrInternal(bmp);
    if (x) {
        *x = win->mouseX;
    }
    if (y) {
        *y = win->mouseY;
    }
    if (buttons) {
        *buttons = win->mouseButtons;
    }
}

// Assembly:
cmpq $0x0, 0x20(%rdi)
je 0x7286
testq %rsi, %rsi
je 0x726b
movl 0x2c4(%rdi), %eax
movl %eax, (%rsi)
testq %rdx, %rdx
je 0x7278
movl 0x2c8(%rdi), %eax
movl %eax, (%rdx)
testq %rcx, %rcx
je 0x7285
movl 0x2c0(%rdi), %eax
movl %eax, (%rcx)
retq
pushq %rax
leaq 0x5772(%rip), %rdi      # 0xca00
leaq 0x5777(%rip), %rsi      # 0xca0c
leaq 0x577b(%rip), %rcx      # 0xca17
movl $0x741, %edx            # imm = 0x741
callq 0x3260
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tigr.c
// Function: tigrTouch
int tigrTouch(Tigr* bmp, TigrTouchPoint* points, int maxPoints) {
    int buttons = 0;
    if (maxPoints > 0) {
        tigrMouse(bmp, &points->x, &points->y, &buttons);
    }
    return buttons ? 1 : 0;
}

// Assembly:
pushq %rax
movl $0x0, 0x4(%rsp)
testl %edx, %edx
jle 0x72c1
leaq 0x4(%rsi), %rdx
leaq 0x4(%rsp), %rcx
callq 0x7257
xorl %eax, %eax
cmpl $0x0, 0x4(%rsp)
setne %al
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tigr.c
// Function: tigrCheckShaderErrors
void tigrCheckShaderErrors(GLuint object) {
    GLint success;
    GLchar info[2048];
    glGetShaderiv(object, GL_COMPILE_STATUS, &success);
    if (!success) {
        glGetShaderInfoLog(object, sizeof(info), NULL, info);
        tigrError(NULL, "shader compile error : %s\n", info);
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x818, %rsp            # imm = 0x818
movl %edi, %ebx
leaq 0xc(%rsp), %r14
movl $0x8b81, %esi           # imm = 0x8B81
movq %r14, %rdx
callq 0x3790
cmpl $0x0, (%r14)
je 0x731e
addq $0x818, %rsp            # imm = 0x818
popq %rbx
popq %r14
retq
leaq 0x10(%rsp), %r14
movl %ebx, %edi
movl $0x800, %esi            # imm = 0x800
xorl %edx, %edx
movq %r14, %rcx
callq 0x30e0
leaq 0x57ad(%rip), %rsi      # 0xcae8
movq %r14, %rdx
xorl %eax, %eax
callq 0x714b
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tigr.c
// Function: tigrCheckProgramErrors
void tigrCheckProgramErrors(GLuint object) {
    GLint success;
    GLchar info[2048];
    glGetProgramiv(object, GL_LINK_STATUS, &success);
    if (!success) {
        glGetProgramInfoLog(object, sizeof(info), NULL, info);
        tigrError(NULL, "shader link error : %s\n", info);
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x818, %rsp            # imm = 0x818
movl %edi, %ebx
leaq 0xc(%rsp), %r14
movl $0x8b82, %esi           # imm = 0x8B82
movq %r14, %rdx
callq 0x3220
cmpl $0x0, (%r14)
je 0x7374
addq $0x818, %rsp            # imm = 0x818
popq %rbx
popq %r14
retq
leaq 0x10(%rsp), %r14
movl %ebx, %edi
movl $0x800, %esi            # imm = 0x800
xorl %edx, %edx
movq %r14, %rcx
callq 0x3210
leaq 0x5772(%rip), %rsi      # 0xcb03
movq %r14, %rdx
xorl %eax, %eax
callq 0x714b
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tigr.c
// Function: tigrCreateShaderProgram
void tigrCreateShaderProgram(GLStuff* gl, const char* fxSource, int fxSize) {
    if (gl->program != 0) {
        glDeleteProgram(gl->program);
        gl->program = 0;
    }

    GLuint vs = glCreateShader(GL_VERTEX_SHADER);
    const char* vs_source = (const char*)&tigr_upscale_gl_vs;
    glShaderSource(vs, 1, &vs_source, &tigr_upscale_gl_vs_size);
    glCompileShader(vs);
    tigrCheckShaderErrors(vs);

    GLuint fs = glCreateShader(GL_FRAGMENT_SHADER);
    const char* fs_sources[] = {
        (const char*)tigr_upscale_gl_fs,
        fxSource,
    };
    const int fs_lengths[] = {
        tigr_upscale_gl_fs_size,
        fxSize,
    };
    glShaderSource(fs, 2, fs_sources, fs_lengths);
    glCompileShader(fs);
    tigrCheckShaderErrors(fs);

    gl->program = glCreateProgram();
    glAttachShader(gl->program, vs);
    glAttachShader(gl->program, fs);
    glLinkProgram(gl->program);
    tigrCheckProgramErrors(gl->program);
    glDeleteShader(vs);
    glDeleteShader(fs);

    gl->uniform_projection = glGetUniformLocation(gl->program, "projection");
    gl->uniform_model = glGetUniformLocation(gl->program, "model");
    gl->uniform_parameters = glGetUniformLocation(gl->program, "parameters");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, %rbx
movl 0xc(%rdi), %edi
testl %edi, %edi
je 0x73c3
callq 0x3140
movl $0x0, 0xc(%rbx)
movl $0x8b31, %edi           # imm = 0x8B31
callq 0x3320
movl %eax, %ebp
leaq 0x3e8a(%rip), %rax      # 0xb260
movq %rsp, %rdx
movq %rax, (%rdx)
leaq 0x3f69(%rip), %rcx      # 0xb34c
movl %ebp, %edi
movl $0x1, %esi
callq 0x37d0
movl %ebp, %edi
callq 0x32e0
movl %ebp, %edi
callq 0x72ef
movl $0x8b30, %edi           # imm = 0x8B30
callq 0x3320
movl %eax, %r14d
leaq 0x3f3f(%rip), %rax      # 0xb350
leaq 0x10(%rsp), %rdx
movq %rax, (%rdx)
movq %r12, 0x8(%rdx)
leaq 0x8(%rsp), %rcx
movl $0xae, (%rcx)
movl %r15d, 0x4(%rcx)
movl %r14d, %edi
movl $0x2, %esi
callq 0x37d0
movl %r14d, %edi
callq 0x32e0
movl %r14d, %edi
callq 0x72ef
callq 0x36c0
movl %eax, 0xc(%rbx)
movl %eax, %edi
movl %ebp, %esi
callq 0x36b0
movl 0xc(%rbx), %edi
movl %r14d, %esi
callq 0x36b0
movl 0xc(%rbx), %edi
callq 0x37c0
movl 0xc(%rbx), %edi
callq 0x7345
movl %ebp, %edi
callq 0x3370
movl %r14d, %edi
callq 0x3370
movl 0xc(%rbx), %edi
leaq 0x568d(%rip), %rsi      # 0xcb1b
callq 0x3180
movl %eax, 0x10(%rbx)
movl 0xc(%rbx), %edi
leaq 0x5686(%rip), %rsi      # 0xcb26
callq 0x3180
movl %eax, 0x14(%rbx)
movl 0xc(%rbx), %edi
leaq 0x567a(%rip), %rsi      # 0xcb2c
callq 0x3180
movl %eax, 0x18(%rbx)
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tigr.c
// Function: tigrGAPIDestroy
void tigrGAPIDestroy(Tigr* bmp) {
    TigrInternal* win = tigrInternal(bmp);
    GLStuff* gl = &win->gl;

    if (tigrGAPIBegin(bmp) < 0) {
        tigrError(bmp, "Cannot activate OpenGL context.\n");
        return;
    }

    if (!gl->gl_legacy) {
        glDeleteTextures(2, gl->tex);
        glDeleteProgram(gl->program);
    }

    tigrCheckGLError("destroy");

    if (tigrGAPIEnd(bmp) < 0) {
        tigrError(bmp, "Cannot deactivate OpenGL context.\n");
        return;
    }
}

// Assembly:
pushq %rbx
cmpq $0x0, 0x20(%rdi)
je 0x7514
movq %rdi, %rbx
callq 0x6665
testl %eax, %eax
js 0x7533
cmpl $0x0, 0x54(%rbx)
jne 0x74f7
leaq 0x38(%rbx), %rsi
movl $0x2, %edi
callq 0x3520
movl 0x44(%rbx), %edi
callq 0x3140
leaq 0x5669(%rip), %rdi      # 0xcb67
callq 0x72cd
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x32c0
testl %eax, %eax
je 0x753c
popq %rbx
retq
leaq 0x54e5(%rip), %rdi      # 0xca00
leaq 0x54ea(%rip), %rsi      # 0xca0c
leaq 0x54ee(%rip), %rcx      # 0xca17
movl $0x741, %edx            # imm = 0x741
callq 0x3260
leaq 0x560c(%rip), %rsi      # 0xcb46
jmp 0x7543
leaq 0x562c(%rip), %rsi      # 0xcb6f
xorl %eax, %eax
callq 0x714b
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tigr.c
// Function: tigrGAPIDraw
void tigrGAPIDraw(int legacy, GLuint uniform_model, GLuint tex, Tigr* bmp, int x1, int y1, int x2, int y2) {
    glBindTexture(GL_TEXTURE_2D, tex);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, bmp->w, bmp->h, 0, GL_RGBA, GL_UNSIGNED_BYTE, bmp->pix);

    if (!legacy) {
        float sx = (float)(x2 - x1);
        float sy = (float)(y2 - y1);
        float tx = (float)x1;
        float ty = (float)y1;

        float model[16] = { sx, 0.0f, 0.0f, 0.0f, 0.0f, sy, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, tx, ty, 0.0f, 1.0f };

        glUniformMatrix4fv(uniform_model, 1, GL_FALSE, model);
        glDrawArrays(GL_TRIANGLES, 0, 6);
    } else {
#if !(__APPLE__ || __ANDROID__)
        glBegin(GL_QUADS);
        glTexCoord2f(1.0f, 0.0f);
        glVertex2i(x2, y1);
        glTexCoord2f(0.0f, 0.0f);
        glVertex2i(x1, y1);
        glTexCoord2f(0.0f, 1.0f);
        glVertex2i(x1, y2);
        glTexCoord2f(1.0f, 1.0f);
        glVertex2i(x2, y2);
        glEnd();
#else
        assert(0);
#endif
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %r9d, %r15d
movl %r8d, %ebp
movq %rcx, %r13
movl %esi, 0xc(%rsp)
movl %edi, %r12d
movl 0x98(%rsp), %ebx
movl 0x90(%rsp), %r14d
movl $0xde1, %edi            # imm = 0xDE1
movl %edx, %esi
callq 0x3460
movl (%r13), %ecx
movl 0x4(%r13), %r8d
subq $0x8, %rsp
movl $0xde1, %edi            # imm = 0xDE1
xorl %esi, %esi
movl $0x8058, %edx           # imm = 0x8058
xorl %r9d, %r9d
pushq 0x18(%r13)
pushq $0x1401                 # imm = 0x1401
pushq $0x1908                 # imm = 0x1908
callq 0x3110
addq $0x20, %rsp
testl %r12d, %r12d
je 0x763e
movl $0x7, %edi
callq 0x30a0
movss 0x3a34(%rip), %xmm0     # 0xb004
xorps %xmm1, %xmm1
callq 0x31a0
movl %r14d, %edi
movl %r15d, %esi
callq 0x3490
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
callq 0x31a0
movl %ebp, %edi
movl %r15d, %esi
callq 0x3490
xorps %xmm0, %xmm0
movss 0x3a01(%rip), %xmm1     # 0xb004
callq 0x31a0
movl %ebp, %edi
movl %ebx, %esi
callq 0x3490
movss 0x39eb(%rip), %xmm0     # 0xb004
movaps %xmm0, %xmm1
callq 0x31a0
movl %r14d, %edi
movl %ebx, %esi
callq 0x3490
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x34d0
subl %ebp, %r14d
cvtsi2ss %r14d, %xmm0
subl %r15d, %ebx
cvtsi2ss %ebx, %xmm1
cvtsi2ss %ebp, %xmm2
cvtsi2ss %r15d, %xmm3
leaq 0x10(%rsp), %rcx
movss %xmm0, (%rcx)
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%rcx)
movss %xmm1, 0x14(%rcx)
movups %xmm0, 0x18(%rcx)
movq $0x3f800000, 0x28(%rcx) # imm = 0x3F800000
movss %xmm2, 0x30(%rcx)
movss %xmm3, 0x34(%rcx)
movabsq $0x3f80000000000000, %rax # imm = 0x3F80000000000000
movq %rax, 0x38(%rcx)
movl 0xc(%rsp), %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x35e0
movl $0x4, %edi
xorl %esi, %esi
movl $0x6, %edx
callq 0x3040
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tigr.c
// Function: tigrEncodeUTF8
char* tigrEncodeUTF8(char* text, int cp) {
    if (cp < 0 || cp > 0x10ffff) {
        cp = 0xfffd;
    }

#define EMIT(X, Y, Z) *text++ = X | ((cp >> Y) & Z)
    if (cp < 0x80) {
        EMIT(0x00, 0, 0x7f);
    } else if (cp < 0x800) {
        EMIT(0xc0, 6, 0x1f);
        EMIT(0x80, 0, 0x3f);
    } else if (cp < 0x10000) {
        EMIT(0xe0, 12, 0xf);
        EMIT(0x80, 6, 0x3f);
        EMIT(0x80, 0, 0x3f);
    } else {
        EMIT(0xf0, 18, 0x7);
        EMIT(0x80, 12, 0x3f);
        EMIT(0x80, 6, 0x3f);
        EMIT(0x80, 0, 0x3f);
    }
    return text;
#undef EMIT
}

// Assembly:
movq %rdi, %rax
cmpl $0x110000, %esi         # imm = 0x110000
movl $0xfffd, %ecx           # imm = 0xFFFD
cmovbl %esi, %ecx
cmpl $0x7f, %ecx
ja 0x76db
movb %cl, (%rax)
incq %rax
retq
movl %ecx, %edx
cmpl $0x7ff, %ecx            # imm = 0x7FF
ja 0x76fb
shrl $0x6, %edx
orb $-0x40, %dl
movb %dl, (%rax)
andb $0x3f, %cl
orb $-0x80, %cl
movb %cl, 0x1(%rax)
addq $0x2, %rax
retq
cmpl $0xffff, %ecx           # imm = 0xFFFF
ja 0x7727
shrl $0xc, %edx
orb $-0x20, %dl
movb %dl, (%rax)
movl %ecx, %edx
shrl $0x6, %edx
andb $0x3f, %dl
orb $-0x80, %dl
movb %dl, 0x1(%rax)
andb $0x3f, %cl
orb $-0x80, %cl
movb %cl, 0x2(%rax)
addq $0x3, %rax
retq
shrl $0x12, %edx
orb $-0x10, %dl
movb %dl, (%rax)
movl %ecx, %edx
shrl $0xc, %edx
andb $0x3f, %dl
orb $-0x80, %dl
movb %dl, 0x1(%rax)
movl %ecx, %edx
shrl $0x6, %edx
andb $0x3f, %dl
orb $-0x80, %dl
movb %dl, 0x2(%rax)
andb $0x3f, %cl
orb $-0x80, %cl
movb %cl, 0x3(%rax)
addq $0x4, %rax
retq
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tigr.c
// Function: tigrBeginOpenGL
int tigrBeginOpenGL(Tigr* bmp) {
#ifdef TIGR_GAPI_GL
    TigrInternal* win = tigrInternal(bmp);
    win->gl.gl_user_opengl_rendering = 1;
    return tigrGAPIBegin(bmp) == 0;
#else
    return 0;
#endif
}

// Assembly:
pushq %rax
cmpq $0x0, 0x20(%rdi)
je 0x7778
movl $0x1, 0x58(%rdi)
callq 0x6665
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
movl %ecx, %eax
popq %rcx
retq
leaq 0x5281(%rip), %rdi      # 0xca00
leaq 0x5286(%rip), %rsi      # 0xca0c
leaq 0x528a(%rip), %rcx      # 0xca17
movl $0x741, %edx            # imm = 0x741
callq 0x3260
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tigr.c
// Function: tigrSetPostShader
void tigrSetPostShader(Tigr* bmp, const char* code, int size) {
#ifdef TIGR_GAPI_GL
    tigrGAPIBegin(bmp);
    TigrInternal* win = tigrInternal(bmp);
    GLStuff* gl = &win->gl;
    tigrCreateShaderProgram(gl, code, size);
    tigrGAPIEnd(bmp);
#endif
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
callq 0x6665
cmpq $0x0, 0x20(%r15)
je 0x77d1
addq $0x38, %r15
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x739b
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
popq %rbx
popq %r14
popq %r15
jmp 0x32c0
leaq 0x5228(%rip), %rdi      # 0xca00
leaq 0x522d(%rip), %rsi      # 0xca0c
leaq 0x5231(%rip), %rcx      # 0xca17
movl $0x741, %edx            # imm = 0x741
callq 0x3260
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tigr.c
// Function: tigrSetPostFX
void tigrSetPostFX(Tigr* bmp, float p1, float p2, float p3, float p4) {
    TigrInternal* win = tigrInternal(bmp);
    win->p1 = p1;
    win->p2 = p2;
    win->p3 = p3;
    win->p4 = p4;
}

// Assembly:
cmpq $0x0, 0x20(%rdi)
je 0x7818
movss %xmm0, 0x94(%rdi)
movss %xmm1, 0x98(%rdi)
movss %xmm2, 0x9c(%rdi)
movss %xmm3, 0xa0(%rdi)
retq
pushq %rax
leaq 0x51e0(%rip), %rdi      # 0xca00
leaq 0x51e5(%rip), %rsi      # 0xca0c
leaq 0x51e9(%rip), %rcx      # 0xca17
movl $0x741, %edx            # imm = 0x741
callq 0x3260
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tigr.c
// Function: find
static const unsigned char* find(PNG* png, const char* chunk, unsigned minlen) {
    const unsigned char* start;
    while (png->p < png->end) {
        unsigned len = get32(png->p + 0);
        start = png->p;
        png->p += len + 12;
        if (memcmp(start + 4, chunk, 4) == 0 && len >= minlen && png->p <= png->end)
            return start + 8;
    }

    return NULL;
}

// Assembly:
pushq %rbx
movq (%rdi), %r8
movq 0x8(%rdi), %rcx
cmpq %rcx, %r8
jae 0x7890
movl (%r8), %eax
bswapl %eax
leal 0xc(%rax), %r10d
addq %r8, %r10
movq %r10, (%rdi)
movl 0x4(%r8), %r11d
cmpl (%rsi), %r11d
setne %r11b
cmpl %edx, %eax
setb %bl
orb %r11b, %bl
addq $0x8, %r8
cmpq %rcx, %r10
cmovaq %r9, %r8
movq %r8, %rax
movq %r10, %r8
testb %bl, %bl
cmovneq %r9, %rax
movq %rax, %r9
jne 0x7840
movq %r10, %r8
movq %rax, %r9
cmpq %rcx, %r10
ja 0x7840
jmp 0x7892
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tigr.c
// Function: depalette
static void depalette(int w,
                      int h,
                      unsigned char* src,
                      TPixel* dest,
                      int bipp,
                      const unsigned char* plte,
                      const unsigned char* trns,
                      int trnsSize) {
    int x, y, c;
    unsigned char alpha;
    int mask, len;

    switch (bipp) {
        case 4:
            mask = 15;
            len = 1;
            break;
        case 2:
            mask = 3;
            len = 3;
            break;
        case 1:
            mask = 1;
            len = 7;
    }

    for (y = 0; y < h; y++) {
        src++;  // skip filter byte
        for (x = 0; x < w; x++) {
            if (bipp == 8) {
                c = *src++;
            } else {
                int pos = x & len;
                c = (src[0] >> ((len - pos) * bipp)) & mask;
                if (pos == len) {
                    src++;
                }
            }
            alpha = 255;
            if (c < trnsSize) {
                alpha = trns[c];
            }
            *dest++ = tigrRGBA(plte[c * 3 + 0], plte[c * 3 + 1], plte[c * 3 + 2], alpha);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rax
movl %esi, -0x4(%rsp)
cmpl $0x1, %r8d
je 0x7b35
cmpl $0x2, %r8d
jne 0x7b43
movl $0x3, %r10d
movl $0x3, %r11d
jmp 0x7b4f
movl $0x7, %r11d
movl $0x1, %r10d
jmp 0x7b4f
movl $0x1, %r11d
movl $0xf, %r10d
cmpl $0x0, -0x4(%rsp)
jle 0x7bf5
movl 0x40(%rsp), %ebx
movq 0x38(%rsp), %rsi
xorl %ebp, %ebp
incq %rdx
testl %edi, %edi
jle 0x7be9
xorl %r15d, %r15d
movzbl (%rdx), %r13d
movl $0x1, %r12d
cmpl $0x8, %r8d
je 0x7b9c
movl %r15d, %r14d
andl %r11d, %r14d
xorl %r12d, %r12d
movl %r11d, %ecx
subl %r14d, %ecx
sete %r12b
imull %r8d, %ecx
shrl %cl, %r13d
andl %r10d, %r13d
movl $0xff000000, %ecx       # imm = 0xFF000000
movl %r13d, %r14d
cmpl %ebx, %r13d
jge 0x7bb1
movzbl (%rsi,%r14), %ecx
shll $0x18, %ecx
addq %r12, %rdx
leaq (%r14,%r14,2), %r14
movzbl (%r9,%r14), %r12d
movzbl 0x1(%r9,%r14), %r13d
movzbl 0x2(%r9,%r14), %r14d
shll $0x10, %r14d
orl %ecx, %r14d
shll $0x8, %r13d
orl %r12d, %r13d
orl %r14d, %r13d
movl %r13d, (%rax)
addq $0x4, %rax
incl %r15d
cmpl %r15d, %edi
jne 0x7b6f
incl %ebp
cmpl -0x4(%rsp), %ebp
jne 0x7b65
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tigr.c
// Function: convert
static void convert(int bypp, int w, int h, const unsigned char* src, TPixel* dest, const unsigned char* trns) {
    int x, y;
    for (y = 0; y < h; y++) {
        src++;  // skip filter byte
        for (x = 0; x < w; x++, src += bypp) {
            switch (bypp) {
                case 1: {
                    unsigned char c = src[0];
                    if (trns && c == *trns) {
                        *dest++ = tigrRGBA(c, c, c, 0);
                        break;
                    } else {
                        *dest++ = tigrRGB(c, c, c);
                        break;
                    }
                }
                case 2:
                    *dest++ = tigrRGBA(src[0], src[0], src[0], src[1]);
                    break;
                case 3: {
                    unsigned char r = src[0];
                    unsigned char g = src[1];
                    unsigned char b = src[2];
                    if (trns && trns[1] == r && trns[3] == g && trns[5] == b) {
                        *dest++ = tigrRGBA(r, g, b, 0);
                        break;
                    } else {
                        *dest++ = tigrRGB(r, g, b);
                        break;
                    }
                }
                case 4:
                    *dest++ = tigrRGBA(src[0], src[1], src[2], src[3]);
                    break;
            }
        }
    }
}

// Assembly:
testl %edx, %edx
jle 0x7d0c
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edi, %eax
xorl %r10d, %r10d
decl %edi
leaq 0x3626(%rip), %r11      # 0xb244
incq %rcx
testl %esi, %esi
jle 0x7cf8
movl %esi, %ebx
cmpl $0x3, %edi
ja 0x7ced
movslq (%r11,%rdi,4), %r14
addq %r11, %r14
jmpq *%r14
movzbl (%rcx), %ebp
testq %r9, %r9
je 0x7cd8
cmpb (%r9), %bpl
jne 0x7cd8
movl %ebp, %r15d
shll $0x10, %r15d
movl %ebp, %r14d
shll $0x8, %r14d
jmp 0x7cb9
movzbl (%rcx), %ebp
movzbl 0x1(%rcx), %r14d
movzbl 0x2(%rcx), %r15d
testq %r9, %r9
je 0x7cc1
cmpb %bpl, 0x1(%r9)
jne 0x7cc1
cmpb %r14b, 0x3(%r9)
jne 0x7cc1
cmpb %r15b, 0x5(%r9)
jne 0x7cc1
shll $0x10, %r15d
shll $0x8, %r14d
orl %ebp, %r14d
orl %r15d, %r14d
jmp 0x7ce6
movl (%rcx), %r14d
jmp 0x7ce6
movzbl (%rcx), %ebp
movzbl 0x1(%rcx), %r15d
shll $0x18, %r15d
movl %ebp, %r12d
shll $0x10, %r12d
movl %ebp, %r14d
shll $0x8, %r14d
orl %r12d, %r14d
orl %r15d, %r14d
orl %ebp, %r14d
jmp 0x7ce6
shll $0x10, %r15d
shll $0x8, %r14d
orl %ebp, %r14d
addl %r15d, %r14d
addl $0xff000000, %r14d      # imm = 0xFF000000
jmp 0x7ce6
imull $0x10101, %ebp, %r14d   # imm = 0x10101
orl $0xff000000, %r14d      # imm = 0xFF000000
movl %r14d, (%r8)
addq $0x4, %r8
addq %rax, %rcx
decl %ebx
jne 0x7c2b
incl %r10d
cmpl %edx, %r10d
jne 0x7c1e
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tigr.c
// Function: encodeByte
static void encodeByte(Save* s, unsigned char v) {
    updateAdler(s, v);

    // Simple RLE compression. We could do better by doing a search
    // to find matches, but this works pretty well TBH.
    if (s->prev == v && s->runlen < 115) {
        s->runlen++;
    } else {
        if (s->runlen)
            endrun(s);

        s->prev = v;
        s->runlen = 1;
    }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movl 0x4(%rdi), %eax
movl 0xc(%rdi), %ecx
movzwl %ax, %edx
shrl $0x10, %eax
addl %esi, %edx
imulq $0x2001f, %rdx, %rsi    # imm = 0x2001F
shrq $0x21, %rsi
imull $0xfff1, %esi, %esi     # imm = 0xFFF1
subl %esi, %edx
addl %edx, %eax
imulq $0x2001f, %rax, %rsi    # imm = 0x2001F
shrq $0x21, %rsi
imull $0xfff1, %esi, %esi     # imm = 0xFFF1
subl %esi, %eax
shll $0x10, %eax
orl %edx, %eax
movl %eax, 0x4(%rdi)
cmpl %ebp, %ecx
jne 0x7d66
movl 0x10(%rbx), %eax
cmpl $0x72, %eax
ja 0x7d66
incl %eax
movl %eax, 0x10(%rbx)
jmp 0x7d7e
cmpl $0x0, 0x10(%rbx)
je 0x7d74
movq %rbx, %rdi
callq 0x7d85
movl %ebp, 0xc(%rbx)
movl $0x1, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tigr.c
// Function: endrun
static void endrun(Save* s) {
    s->runlen--;
    literal(s, s->prev);

    if (s->runlen >= 67)
        encodelen(s, 277, 4, s->runlen - 67);
    else if (s->runlen >= 35)
        encodelen(s, 273, 3, s->runlen - 35);
    else if (s->runlen >= 19)
        encodelen(s, 269, 2, s->runlen - 19);
    else if (s->runlen >= 11)
        encodelen(s, 265, 1, s->runlen - 11);
    else if (s->runlen >= 3)
        encodelen(s, 257, 0, s->runlen - 3);
    else
        while (s->runlen--)
            literal(s, s->prev);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
decl 0x10(%rdi)
movl 0xc(%rdi), %esi
callq 0x7e20
movl 0x10(%rbx), %ecx
cmpl $0x43, %ecx
jb 0x7dae
addl $-0x43, %ecx
movq %rbx, %rdi
movl $0x115, %esi            # imm = 0x115
movl $0x4, %edx
jmp 0x7e05
cmpl $0x23, %ecx
jb 0x7dc5
addl $-0x23, %ecx
movq %rbx, %rdi
movl $0x111, %esi            # imm = 0x111
movl $0x3, %edx
jmp 0x7e05
cmpl $0x13, %ecx
jb 0x7ddc
addl $-0x13, %ecx
movq %rbx, %rdi
movl $0x10d, %esi            # imm = 0x10D
movl $0x2, %edx
jmp 0x7e05
cmpl $0xb, %ecx
jb 0x7df3
addl $-0xb, %ecx
movq %rbx, %rdi
movl $0x109, %esi            # imm = 0x109
movl $0x1, %edx
jmp 0x7e05
cmpl $0x2, %ecx
jbe 0x7e0b
addl $-0x3, %ecx
movq %rbx, %rdi
movl $0x101, %esi            # imm = 0x101
xorl %edx, %edx
popq %rbx
jmp 0x7ed2
subl $0x1, 0x10(%rbx)
jb 0x7e1e
movl 0xc(%rbx), %esi
movq %rbx, %rdi
callq 0x7e20
jmp 0x7e0b
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tigr.c
// Function: literal
static void literal(Save* s, unsigned v) {
    // Encode a literal/length using the built-in tables.
    // Could do better with a custom table but whatever.
    if (v < 144)
        putbitsr(s, 0x030 + v - 0, 8);
    else if (v < 256)
        putbitsr(s, 0x190 + v - 144, 9);
    else if (v < 280)
        putbitsr(s, 0x000 + v - 256, 7);
    else
        putbitsr(s, 0x0c0 + v - 280, 8);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
cmpl $0x8f, %esi
ja 0x7e53
addl $0x30, %ebx
movl $0x7, %ebp
movl %ebx, %esi
movl %ebp, %ecx
shrl %cl, %esi
movq %r14, %rdi
movl $0x1, %edx
callq 0x4b25
addl $-0x1, %ebp
jb 0x7e39
jmp 0x7ecd
cmpl $0xff, %ebx
ja 0x7e80
orl $0x100, %ebx            # imm = 0x100
movl $0x8, %ebp
movl %ebx, %esi
movl %ebp, %ecx
shrl %cl, %esi
movq %r14, %rdi
movl $0x1, %edx
callq 0x4b25
addl $-0x1, %ebp
jb 0x7e66
jmp 0x7ecd
cmpl $0x117, %ebx            # imm = 0x117
ja 0x7ead
addl $0xffffff00, %ebx       # imm = 0xFFFFFF00
movl $0x6, %ebp
movl %ebx, %esi
movl %ebp, %ecx
shrl %cl, %esi
movq %r14, %rdi
movl $0x1, %edx
callq 0x4b25
addl $-0x1, %ebp
jb 0x7e93
jmp 0x7ecd
addl $-0x58, %ebx
movl $0x7, %ebp
movl %ebx, %esi
movl %ebp, %ecx
shrl %cl, %esi
movq %r14, %rdi
movl $0x1, %edx
callq 0x4b25
addl $-0x1, %ebp
jb 0x7eb5
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tigr.c
// Function: build
static int build(State* s, unsigned* tree, unsigned char* lens, int symcount) {
    int n, codes[16], first[16], counts[16] = { 0 };

    // Frequency count.
    for (n = 0; n < symcount; n++)
        counts[lens[n]]++;

    // Distribute codes.
    counts[0] = codes[0] = first[0] = 0;
    for (n = 1; n <= 15; n++) {
        codes[n] = (codes[n - 1] + counts[n - 1]) << 1;
        first[n] = first[n - 1] + counts[n - 1];
    }
    CHECK(first[15] + counts[15] <= symcount);

    // Insert keys into the tree for each symbol.
    for (n = 0; n < symcount; n++) {
        int len = lens[n];
        if (len != 0) {
            int code = codes[len]++, slot = first[len]++;
            tree[slot] = (code << (32 - len)) | (n << 4) | len;
        }
    }

    return first[15];
}

// Assembly:
pushq %rbx
subq $0xc0, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movl %ecx, %eax
testl %ecx, %ecx
jle 0x7f7d
xorl %r8d, %r8d
movzbl (%rdx,%r8), %r9d
incl (%rsp,%r9,4)
incq %r8
cmpq %r8, %rax
jne 0x7f6c
xorl %r8d, %r8d
movl %r8d, 0x40(%rsp)
movl %r8d, 0x80(%rsp)
movl %r8d, (%rsp)
movl $0x1, %r9d
xorl %r10d, %r10d
movl -0x4(%rsp,%r9,4), %r11d
addl %r11d, %r8d
addl %r8d, %r8d
movl %r8d, 0x80(%rsp,%r9,4)
addl %r11d, %r10d
movl %r10d, 0x40(%rsp,%r9,4)
incq %r9
cmpq $0x10, %r9
jne 0x7f9a
movl 0x3c(%rsp), %r8d
addl 0x7c(%rsp), %r8d
cmpl %ecx, %r8d
jg 0x8035
testl %ecx, %ecx
jle 0x8028
shlq $0x4, %rax
xorl %edi, %edi
movzbl (%rdx), %r8d
testl %r8d, %r8d
je 0x801c
leal (,%r8,4), %r9d
movl 0x80(%rsp,%r9), %r10d
leal 0x1(%r10), %ecx
movl %ecx, 0x80(%rsp,%r9)
movslq 0x40(%rsp,%r9), %r11
leal 0x1(%r11), %ebx
movl %r8d, %ecx
negb %cl
shll %cl, %r10d
movl %ebx, 0x40(%rsp,%r9)
orl %edi, %r8d
orl %r10d, %r8d
movl %r8d, (%rsi,%r11,4)
addq $0x10, %rdi
incq %rdx
cmpq %rdi, %rax
jne 0x7fd7
movl 0x7c(%rsp), %eax
addq $0xc0, %rsp
popq %rbx
retq
addq $0x28, %rdi
movl $0x1, %esi
callq 0x3100
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tigr.c
// Function: decode
static int decode(State* s, unsigned tree[], int max) {
    // Find the next prefix code.
    unsigned lo = 0, hi = max, key;
    unsigned search = (rev16(s->bits) << 16) | 0xffff;
    while (lo < hi) {
        unsigned guess = (lo + hi) / 2;
        if (search < tree[guess])
            hi = guess;
        else
            lo = guess + 1;
    }

    // Pull out the key and check it.
    key = tree[lo - 1];
    CHECK(((search ^ key) >> (32 - (key & 0xf))) == 0);

    bits(s, key & 0xf);
    return (key >> 4) & 0xfff;
}

// Assembly:
pushq %rbx
movl (%rdi), %eax
movzbl %al, %ecx
leaq 0x46f0(%rip), %r8       # 0xc740
movzbl (%rcx,%r8), %ecx
movzbl %ah, %eax
movzbl (%rax,%r8), %eax
shll $0x18, %ecx
shll $0x10, %eax
addl %ecx, %eax
addl $0xffff, %eax           # imm = 0xFFFF
testl %edx, %edx
je 0x8090
xorl %ecx, %ecx
leal (%rcx,%rdx), %r8d
shrl %r8d
cmpl (%rsi,%r8,4), %eax
jb 0x8085
incl %r8d
movl %r8d, %ecx
jmp 0x8088
movl %r8d, %edx
cmpl %edx, %ecx
jb 0x8070
decl %ecx
jmp 0x8095
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl (%rsi,%rcx,4), %ebx
xorl %ebx, %eax
movl %ebx, %esi
andl $0xf, %esi
movl %esi, %ecx
negb %cl
shrl %cl, %eax
testl %eax, %eax
jne 0x80bb
callq 0x54af
shrl $0x4, %ebx
andl $0xfff, %ebx            # imm = 0xFFF
movl %ebx, %eax
popq %rbx
retq
addq $0x28, %rdi
movl $0x1, %esi
callq 0x3100
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tigr.c
// Function: hasGLXExtension
static int hasGLXExtension(Display* display, const char* wanted) {
    const char* extensions = glXQueryExtensionsString(display, DefaultScreen(display));
    char* dup = strdup(extensions);
    char* found = 0;

    for (char* start = dup;; start = 0) {
        found = strtok(start, " ");
        if (found == 0 || strcmp(found, wanted) == 0) {
            break;
        }
    }

    free(dup);
    return found != 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl 0xe0(%rdi), %esi
callq 0x3550
movq %rax, %rdi
callq 0x3740
movq %rax, %r14
leaq 0x4cf1(%rip), %r15      # 0xcde2
movq %rax, %rdi
movq %r15, %rsi
callq 0x3640
movq %rax, %r12
testq %rax, %rax
je 0x8118
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3590
movl $0x0, %edi
testl %eax, %eax
jne 0x80f4
movq %r14, %rdi
callq 0x3410
xorl %eax, %eax
testq %r12, %r12
setne %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tipsy.c
// Function: relpath
char *relpath(const char *name, const char *path) {
#ifdef _WIN32
  #define DIR_SEP '\\'
#else
  #define DIR_SEP '/'
#endif
  size_t ln = strlen(name);
  size_t lp = strlen(path);

  while (lp>0 && path[lp] != DIR_SEP) lp--;

  size_t lt = ln + lp + 1;

  char *out = malloc(sizeof(char)*(lt+1));
  strncpy(out, path, lp);
  out[lp] = DIR_SEP;
  strncpy(&out[lp+1], name, ln);
  out[lt] = '\0';

  return out;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
callq 0x3150
movq %rax, %r14
movq %r15, %rdi
callq 0x3150
movq %rax, %r12
testq %rax, %rax
je 0x816c
cmpb $0x2f, (%r15,%r12)
je 0x816c
decq %r12
jne 0x815d
xorl %r12d, %r12d
leaq (%r12,%r14), %rbp
leaq (%r12,%r14), %rdi
addq $0x2, %rdi
callq 0x34f0
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x31b0
leaq (%r12,%r13), %rdi
incq %rdi
movb $0x2f, -0x1(%rdi)
movq %rbx, %rsi
movq %r14, %rdx
callq 0x31b0
movb $0x0, 0x1(%r13,%rbp)
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tipsy.c
// Function: project
Vec project(Vec v0, int snap) {
  float ud = DISTANCE;
  float us = ud-1;
  float vs = fminf(HEIGHT, WIDTH)/2 * SCALE;

  Vec v1 = {(v0.x*us)/(v0.z+ud), (v0.y*us)/(v0.z+ud), (v0.z*us)/(v0.z+ud)};
  Vec v2 = {v1.x*vs+WIDTH/2, v1.y*vs+HEIGHT/2, v1.z+DISTANCE};

  if (snap) { v2.x = floorf(v2.x); v2.y = floorf(v2.y); }

  return v2;
}

// Assembly:
subq $0x38, %rsp
movaps %xmm0, %xmm4
movss 0x48d7(%rip), %xmm0     # 0xcd40
movaps %xmm4, %xmm2
mulss %xmm0, %xmm2
movss 0x48cc(%rip), %xmm3     # 0xcd44
addss %xmm1, %xmm3
divss %xmm3, %xmm2
shufps $0x55, %xmm4, %xmm4     # xmm4 = xmm4[1,1,1,1]
mulss %xmm0, %xmm4
divss %xmm3, %xmm4
movss 0x48b4(%rip), %xmm0     # 0xcd48
mulss %xmm0, %xmm2
addss 0x48ac(%rip), %xmm2     # 0xcd4c
mulss %xmm0, %xmm4
addss 0x48a4(%rip), %xmm4     # 0xcd50
testl %edi, %edi
je 0x84ee
movaps %xmm2, %xmm0
movss %xmm1, 0xc(%rsp)
movss %xmm3, 0x8(%rsp)
movaps %xmm4, 0x20(%rsp)
callq 0x3120
movaps %xmm0, 0x10(%rsp)
movaps 0x20(%rsp), %xmm0
callq 0x3120
movss 0x8(%rsp), %xmm3
movaps 0x10(%rsp), %xmm2
movss 0xc(%rsp), %xmm1
unpcklps %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
jmp 0x84f1
unpcklps %xmm4, %xmm2            # xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
mulss 0x4847(%rip), %xmm1     # 0xcd40
divss %xmm3, %xmm1
addss 0x483f(%rip), %xmm1     # 0xcd44
movaps %xmm2, %xmm0
addq $0x38, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tipsy.c
// Function: barycenter
Vec barycenter(Vec p, Vec v1, Vec v2, Vec v3) {
  float d = (v2.y-v3.y) * (v1.x-v3.x) + (v3.x-v2.x) * (v1.y - v3.y);
  float u = ((v2.y-v3.y) * (p.x-v3.x) + (v3.x-v2.x) * (p.y-v3.y)) / d;
  float v = ((v3.y-v1.y) * (p.x-v3.x) + (v1.x-v3.x) * (p.y-v3.y)) / d;
  float w = 1.0f - u - v;
  Vec ret = {u, v, w}; return ret;
}

// Assembly:
movaps %xmm0, %xmm1
movaps %xmm6, %xmm0
subss %xmm4, %xmm0
subps %xmm6, %xmm4
movaps %xmm2, %xmm3
subss %xmm6, %xmm3
subps %xmm6, %xmm1
shufps $0x55, %xmm6, %xmm6     # xmm6 = xmm6[1,1,1,1]
shufps $0x55, %xmm4, %xmm4     # xmm4 = xmm4[1,1,1,1]
shufps $0x55, %xmm2, %xmm2     # xmm2 = xmm2[1,1,1,1]
movaps %xmm2, %xmm5
subss %xmm6, %xmm5
mulss %xmm0, %xmm5
movaps %xmm4, %xmm7
mulss %xmm3, %xmm7
addss %xmm5, %xmm7
mulss %xmm1, %xmm4
subss %xmm2, %xmm6
mulss %xmm1, %xmm6
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
mulss %xmm1, %xmm0
addss %xmm4, %xmm0
divss %xmm7, %xmm0
mulss %xmm3, %xmm1
addss %xmm1, %xmm6
divss %xmm7, %xmm6
movss 0x2a8e(%rip), %xmm1     # 0xb004
subss %xmm0, %xmm1
subss %xmm6, %xmm1
unpcklps %xmm6, %xmm0            # xmm0 = xmm0[0],xmm6[0],xmm0[1],xmm6[1]
retq
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tipsy.c
// Function: error
static void error(char *fmt, ...) {
  va_list ap;
  va_start(ap, fmt);
  vfprintf(stderr, fmt, ap);
  fprintf(stderr, "\n");
  exit(1);
}

// Assembly:
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %r10
leaq 0x20(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x87ab
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rdx
movq %rdi, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movq 0x780e(%rip), %rbx      # 0xffe0
movq (%rbx), %rdi
movq %r10, %rsi
callq 0x3500
movq (%rbx), %rsi
movl $0xa, %edi
callq 0x3480
movl $0x1, %edi
callq 0x3420
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tipsy.c
// Function: readline
static int readline(char **buf, size_t *buflen, FILE *f) {
  size_t i = 0;
  int ch;
  while ((ch = fgetc(f)) != EOF && ch != '\n') {
    if (ch == '\r') continue;
    if (i + 2 >= *buflen) *buf = realloc(*buf, *buflen = *buflen + 1024);
    (*buf)[i++] = (unsigned char)ch;
  }
  (*buf)[i] = '\0';
  return ch == EOF ? -1 : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
xorl %r12d, %r12d
movq %rbx, %rdi
callq 0x3650
cmpl $0xd, %eax
je 0x8808
movl %eax, %ebp
cmpl $-0x1, %eax
je 0x884f
cmpl $0xa, %ebp
je 0x884f
leaq 0x2(%r12), %rax
movq (%r15), %rsi
cmpq %rsi, %rax
jb 0x8843
movq (%r14), %rdi
addq $0x400, %rsi            # imm = 0x400
movq %rsi, (%r15)
callq 0x3680
movq %rax, (%r14)
movq (%r14), %rax
movb %bpl, (%rax,%r12)
incq %r12
jmp 0x8808
movq (%r14), %rax
movb $0x0, (%rax,%r12)
xorl %eax, %eax
cmpl $-0x1, %ebp
sete %al
negl %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tipsy.c
// Function: mtl_del
void mtl_del(Mtl *mtl) {
  Mtl *next;
  while (mtl != NULL) {
    free(mtl->name);
    if (mtl->map_Ka != NULL) tigrFree(mtl->map_Ka);
    if (mtl->map_Kd != NULL) tigrFree(mtl->map_Kd);
    next = mtl->next;
    free(mtl);
    mtl = next;
  }
}

// Assembly:
testq %rdi, %rdi
je 0x88e7
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rbx), %rdi
callq 0x3410
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x88be
callq 0x5937
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x88cc
callq 0x5937
movq 0x18(%rbx), %r14
movq %rbx, %rdi
callq 0x3410
movq %r14, %rbx
testq %r14, %r14
jne 0x88a8
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tipsy.c
// Function: obj_del
void obj_del(Obj *o) {
  mtl_del(o->mtl);
  list_del(o->v);
  list_del(o->vn);
  list_del(o->vt);
  list_del(o->f);
  free(o);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
callq 0x889c
movq (%rbx), %r14
movq (%r14), %rdi
callq 0x3410
movq %r14, %rdi
callq 0x3410
movq 0x8(%rbx), %r14
movq (%r14), %rdi
callq 0x3410
movq %r14, %rdi
callq 0x3410
movq 0x10(%rbx), %r14
movq (%r14), %rdi
callq 0x3410
movq %r14, %rdi
callq 0x3410
movq 0x18(%rbx), %r14
movq (%r14), %rdi
callq 0x3410
movq %r14, %rdi
callq 0x3410
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3410
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tipsy.c
// Function: obj_flip
void obj_flip(Obj *obj) {
  for (int i = 0; i < obj->v->len; i++) {
    Vec *v = (Vec*)list_get(obj->v, i);
    v->y = -v->y;
    v->z = -v->z;
  }
  for (int i = 0; i < obj->vn->len; i++) {
    Vec *vn = (Vec*)list_get(obj->vn, i);
    vn->y = -vn->y;
    vn->z = -vn->z;
  }
}

// Assembly:
movq (%rdi), %rdx
movslq 0x8(%rdx), %rax
testq %rax, %rax
jle 0x9147
movq (%rdx), %rcx
movslq 0x10(%rdx), %rdx
addq $0x8, %rcx
movaps 0x3c79(%rip), %xmm0     # 0xcda0
movss -0x4(%rcx), %xmm1
movss (%rcx), %xmm2
xorps %xmm0, %xmm1
movss %xmm1, -0x4(%rcx)
xorps %xmm0, %xmm2
movss %xmm2, (%rcx)
addq %rdx, %rcx
decq %rax
jne 0x9127
movq 0x8(%rdi), %rdx
movslq 0x8(%rdx), %rax
testq %rax, %rax
jle 0x9186
movq (%rdx), %rcx
movslq 0x10(%rdx), %rdx
addq $0x8, %rcx
movaps 0x3c3a(%rip), %xmm0     # 0xcda0
movss -0x4(%rcx), %xmm1
movss (%rcx), %xmm2
xorps %xmm0, %xmm1
movss %xmm1, -0x4(%rcx)
xorps %xmm0, %xmm2
movss %xmm2, (%rcx)
addq %rdx, %rcx
decq %rax
jne 0x9166
retq
// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tipsy.c
// Function: surface_cmp
int surface_cmp(const void *a, const void *b) {
  Surface sa = *(Surface*)a;
  Surface sb = *(Surface*)b;

  float amaxz = fmaxf(fmaxf(sa.v1.z, sa.v2.z), sa.v3.z);
  float bmaxz = fmaxf(fmaxf(sb.v1.z, sb.v2.z), sb.v3.z);

  int apoints = (sa.v1.z < bmaxz) + (sa.v2.z < bmaxz) + (sa.v3.z < bmaxz);
  int bpoints = (sb.v1.z < amaxz) + (sb.v2.z < amaxz) + (sb.v3.z < amaxz);

  return apoints - bpoints;
}

// Assembly:
movss 0x8(%rdi), %xmm5
movss 0x14(%rdi), %xmm4
movss 0x20(%rdi), %xmm3
movss 0x8(%rsi), %xmm2
movss 0x14(%rsi), %xmm1
movss 0x20(%rsi), %xmm0
movaps %xmm4, %xmm7
maxss %xmm5, %xmm7
movaps %xmm2, %xmm6
cmpunordss %xmm2, %xmm6
movaps %xmm6, %xmm8
andps %xmm1, %xmm8
movaps %xmm1, %xmm9
maxss %xmm2, %xmm9
andnps %xmm9, %xmm6
orps %xmm8, %xmm6
movaps %xmm0, %xmm8
maxss %xmm6, %xmm8
cmpunordss %xmm6, %xmm6
movaps %xmm6, %xmm9
andnps %xmm8, %xmm9
andps %xmm0, %xmm6
orps %xmm9, %xmm6
xorl %ecx, %ecx
ucomiss %xmm5, %xmm6
cmpunordss %xmm5, %xmm5
movaps %xmm5, %xmm8
andps %xmm4, %xmm8
andnps %xmm7, %xmm5
orps %xmm8, %xmm5
movaps %xmm3, %xmm7
maxss %xmm5, %xmm7
cmpunordss %xmm5, %xmm5
movaps %xmm5, %xmm8
seta %cl
andnps %xmm7, %xmm8
xorl %edx, %edx
ucomiss %xmm4, %xmm6
andps %xmm3, %xmm5
seta %dl
xorl %eax, %eax
ucomiss %xmm3, %xmm6
seta %al
orps %xmm8, %xmm5
xorl %esi, %esi
ucomiss %xmm2, %xmm5
seta %sil
xorl %edi, %edi
ucomiss %xmm1, %xmm5
seta %dil
xorl %r8d, %r8d
ucomiss %xmm0, %xmm5
seta %r8b
addl %esi, %edi
addl %edi, %r8d
subl %r8d, %edx
addl %ecx, %eax
addl %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/codeplea[P]tinyexpr/repl.c
// Function: main
int main(int argc, char **argv) {
    if (argc == 3 && strcmp(argv[1], "-e") == 0) {
        if (eval(argv[2]) == -1) {
            return 1;
        } else {
            return 0;
        }
    } else if (argc == 1) {
        repl();
        return 0;
    } else {
        printf("Usage: %s\n", argv[0]);
        printf("       %s -e <expression>\n", argv[0]);
        return 1;
    }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
cmpl $0x3, %edi
jne 0x235d
movq 0x8(%rbx), %rdi
leaq 0x1cb0(%rip), %rsi      # 0x4004
callq 0x20d0
testl %eax, %eax
je 0x2390
cmpl $0x1, %ebp
je 0x23a5
movq (%rbx), %rsi
leaq 0x1c9b(%rip), %rdi      # 0x4007
xorl %eax, %eax
callq 0x2090
movq (%rbx), %rsi
leaq 0x1c95(%rip), %rdi      # 0x4012
xorl %eax, %eax
callq 0x2090
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq 0x10(%rbx), %rdi
callq 0x23b6
movl %eax, %ecx
xorl %eax, %eax
cmpl $-0x1, %ecx
sete %al
jmp 0x2389
leaq 0x4(%rsp), %rbx
movq %rbx, %rdi
callq 0x2140
movl (%rbx), %eax
jmp 0x2389
// File: /workspace/github_c_makefile_star2_O1/codeplea[P]tinyexpr/repl.c
// Function: eval
static int eval(const char *str) {
    int err = 0;
    double r = te_interp(str, &err);
    if (err != 0) {
        printf("Error at position %i\n", err);
        return -1;
    } else {
        printf("%g\n", r);
        return 0;
    }
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0xc(%rsp), %rbx
movl $0x0, (%rbx)
movq %rbx, %rsi
callq 0x3027
movl (%rbx), %esi
testl %esi, %esi
je 0x23e9
leaq 0x1c52(%rip), %rdi      # 0x402d
xorl %eax, %eax
callq 0x2090
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x23f9
leaq 0x1c53(%rip), %rdi      # 0x4043
movb $0x1, %al
callq 0x2090
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O1/sabotage-linux[P]libnl-tiny/nl.c
// Function: nl_connect
int nl_connect(struct nl_sock *sk, int protocol)
{
	int err;
	socklen_t addrlen;

	sk->s_fd = socket(AF_NETLINK, SOCK_RAW, protocol);
	if (sk->s_fd < 0) {
		err = -nl_syserr2nlerr(errno);
		goto errout;
	}

	if (!(sk->s_flags & NL_SOCK_BUFSIZE_SET)) {
		err = nl_socket_set_buffer_size(sk, 0, 0);
		if (err < 0)
			goto errout;
	}

	err = bind(sk->s_fd, (struct sockaddr*) &sk->s_local,
		   sizeof(sk->s_local));
	if (err < 0) {
		err = -nl_syserr2nlerr(errno);
		goto errout;
	}

	addrlen = sizeof(sk->s_local);
	err = getsockname(sk->s_fd, (struct sockaddr *) &sk->s_local,
			  &addrlen);
	if (err < 0) {
		err = -nl_syserr2nlerr(errno);
		goto errout;
	}

	if (addrlen != sizeof(sk->s_local)) {
		err = -NLE_NOADDR;
		goto errout;
	}

	if (sk->s_local.nl_family != AF_NETLINK) {
		err = -NLE_AF_NOSUPPORT;
		goto errout;
	}

	sk->s_proto = protocol;

	return 0;
errout:
	close(sk->s_fd);
	sk->s_fd = -1;

	return err;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movl $0x10, %edi
movl $0x3, %esi
movl %ebp, %edx
callq 0x3630
movl %eax, 0x18(%rbx)
testl %eax, %eax
js 0x3b86
testb $0x1, 0x28(%rbx)
jne 0x3b37
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3430
testl %eax, %eax
js 0x3bb3
movl 0x18(%rbx), %edi
movq %rbx, %rsi
movl $0xc, %edx
callq 0x3400
testl %eax, %eax
js 0x3b86
leaq 0xc(%rsp), %rdx
movl $0xc, (%rdx)
movl 0x18(%rbx), %edi
movq %rbx, %rsi
callq 0x34c0
testl %eax, %eax
js 0x3b86
movl $0xffffffed, %r14d      # imm = 0xFFFFFFED
cmpl $0xc, 0xc(%rsp)
jne 0x3b98
movl $0xfffffff5, %r14d      # imm = 0xFFFFFFF5
cmpw $0x10, (%rbx)
jne 0x3b98
movl %ebp, 0x1c(%rbx)
xorl %r14d, %r14d
jmp 0x3ba7
callq 0x3090
movl (%rax), %edi
callq 0x3330
movl %eax, %r14d
negl %r14d
movl 0x18(%rbx), %edi
callq 0x3230
movl $0xffffffff, 0x18(%rbx) # imm = 0xFFFFFFFF
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movl %eax, %r14d
jmp 0x3b98
// File: /workspace/github_c_makefile_star2_O1/sabotage-linux[P]libnl-tiny/nl.c
// Function: nl_close
void nl_close(struct nl_sock *sk)
{
	if (sk->s_fd >= 0) {
		close(sk->s_fd);
		sk->s_fd = -1;
	}

	sk->s_proto = 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x18(%rdi), %edi
testl %edi, %edi
js 0x3bcf
callq 0x3230
movl $0xffffffff, 0x18(%rbx) # imm = 0xFFFFFFFF
movl $0x0, 0x1c(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/sabotage-linux[P]libnl-tiny/nl.c
// Function: nl_sendto
int nl_sendto(struct nl_sock *sk, void *buf, size_t size)
{
	int ret;

	ret = sendto(sk->s_fd, buf, size, 0, (struct sockaddr *)
		     &sk->s_peer, sizeof(sk->s_peer));
	if (ret < 0)
		return -nl_syserr2nlerr(errno);

	return ret;
}

// Assembly:
pushq %rax
movl 0x18(%rdi), %eax
leaq 0xc(%rdi), %r8
movl %eax, %edi
xorl %ecx, %ecx
movl $0xc, %r9d
callq 0x3210
testl %eax, %eax
jns 0x3c01
callq 0x3090
movl (%rax), %edi
callq 0x3330
negl %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/sabotage-linux[P]libnl-tiny/nl.c
// Function: nl_sendmsg
int nl_sendmsg(struct nl_sock *sk, struct nl_msg *msg, struct msghdr *hdr)
{
	struct nl_cb *cb;
	int ret;

	struct iovec iov = {
		.iov_base = (void *) nlmsg_hdr(msg),
		.iov_len = nlmsg_hdr(msg)->nlmsg_len,
	};

	hdr->msg_iov = &iov;
	hdr->msg_iovlen = 1;

	nlmsg_set_src(msg, &sk->s_local);

	cb = sk->s_cb;
	if (cb->cb_set[NL_CB_MSG_OUT])
		if (nl_cb_call(cb, NL_CB_MSG_OUT, msg) != NL_OK)
			return 0;

	ret = sendmsg(sk->s_fd, hdr, 0);
	if (ret < 0)
		return -nl_syserr2nlerr(errno);

	return ret;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rdi, %r14
movq 0x30(%rsi), %rax
leaq 0x8(%rsp), %rcx
movq %rax, (%rcx)
movl (%rax), %eax
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rdx)
movq $0x1, 0x18(%rdx)
movl 0x8(%rdi), %eax
movl %eax, 0x10(%rsi)
movq (%rdi), %rax
movq %rax, 0x8(%rsi)
movq 0x30(%rdi), %rax
movq 0x30(%rax), %rcx
testq %rcx, %rcx
je 0x3c5f
movq 0x80(%rax), %rax
movq %rsi, %rdi
movq %rax, %rsi
callq *%rcx
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
jne 0x3c7f
movl 0x18(%r14), %edi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x30d0
testl %eax, %eax
jns 0x3c7f
callq 0x3090
movl (%rax), %edi
callq 0x3330
negl %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/sabotage-linux[P]libnl-tiny/nl.c
// Function: nl_send_auto_complete
int nl_send_auto_complete(struct nl_sock *sk, struct nl_msg *msg)
{
	struct nlmsghdr *nlh;
	struct nl_cb *cb = sk->s_cb;

	nlh = nlmsg_hdr(msg);
	if (nlh->nlmsg_pid == 0)
		nlh->nlmsg_pid = sk->s_local.nl_pid;

	if (nlh->nlmsg_seq == 0)
		nlh->nlmsg_seq = sk->s_seq_next++;

	if (msg->nm_protocol == -1)
		msg->nm_protocol = sk->s_proto;
	
	nlh->nlmsg_flags |= NLM_F_REQUEST;

	if (!(sk->s_flags & NL_NO_AUTO_ACK))
		nlh->nlmsg_flags |= NLM_F_ACK;

	if (cb->cb_send_ow)
		return cb->cb_send_ow(sk, msg);
	else
		return nl_send(sk, msg);
}

// Assembly:
movq 0x30(%rdi), %rax
movq 0x30(%rsi), %rcx
cmpl $0x0, 0xc(%rcx)
jne 0x3cfe
movl 0x4(%rdi), %edx
movl %edx, 0xc(%rcx)
cmpl $0x0, 0x8(%rcx)
jne 0x3d12
movl 0x20(%rdi), %edx
leal 0x1(%rdx), %r8d
movl %r8d, 0x20(%rdi)
movl %edx, 0x8(%rcx)
cmpl $-0x1, (%rsi)
jne 0x3d1c
movl 0x1c(%rdi), %edx
movl %edx, (%rsi)
movzwl 0x6(%rcx), %edx
movl %edx, %r8d
orl $0x1, %r8d
movw %r8w, 0x6(%rcx)
testb $0x10, 0x28(%rdi)
jne 0x3d39
orl $0x5, %edx
movw %dx, 0x6(%rcx)
movq 0xc0(%rax), %rax
testq %rax, %rax
je 0x33d0
jmpq *%rax