// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x90, %rsp
movl 0x18(%rbp), %eax
movl 0x10(%rbp), %eax
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movq %rcx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movl %r9d, -0x20(%rbp)
movl -0xc(%rbp), %esi
movl $0xde1, %edi            # imm = 0xDE1
callq 0x3460
movq -0x18(%rbp), %rax
movl (%rax), %ecx
movq -0x18(%rbp), %rax
movl 0x4(%rax), %r8d
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movl $0xde1, %edi            # imm = 0xDE1
xorl %r9d, %r9d
movl $0x8058, %edx           # imm = 0x8058
movl %r9d, %esi
movl $0x1908, (%rsp)         # imm = 0x1908
movl $0x1401, 0x8(%rsp)      # imm = 0x1401
movq %rax, 0x10(%rsp)
callq 0x3110
cmpl $0x0, -0x4(%rbp)
jne 0x9116
movl 0x10(%rbp), %eax
subl -0x1c(%rbp), %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x24(%rbp)
movl 0x18(%rbp), %eax
subl -0x20(%rbp), %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x28(%rbp)
cvtsi2ssl -0x1c(%rbp), %xmm0
movss %xmm0, -0x2c(%rbp)
cvtsi2ssl -0x20(%rbp), %xmm0
movss %xmm0, -0x30(%rbp)
movss -0x24(%rbp), %xmm0
movss %xmm0, -0x70(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x6c(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x68(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x64(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x60(%rbp)
movss -0x28(%rbp), %xmm0
movss %xmm0, -0x5c(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x58(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x54(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x50(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x4c(%rbp)
movss 0x5f4a(%rip), %xmm0     # 0xf004
movss %xmm0, -0x48(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x44(%rbp)
movss -0x2c(%rbp), %xmm0
movss %xmm0, -0x40(%rbp)
movss -0x30(%rbp), %xmm0
movss %xmm0, -0x3c(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x38(%rbp)
movss 0x5f19(%rip), %xmm0     # 0xf004
movss %xmm0, -0x34(%rbp)
movl -0x8(%rbp), %edi
leaq -0x70(%rbp), %rcx
movl $0x1, %esi
xorl %edx, %edx
callq 0x35f0
movl $0x4, %edi
xorl %esi, %esi
movl $0x6, %edx
callq 0x3040
jmp 0x918c
movl $0x7, %edi
callq 0x30a0
movss 0x5edc(%rip), %xmm0     # 0xf004
xorps %xmm1, %xmm1
callq 0x31a0
movl 0x10(%rbp), %edi
movl -0x20(%rbp), %esi
callq 0x3490
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0x31a0
movl -0x1c(%rbp), %edi
movl -0x20(%rbp), %esi
callq 0x3490
xorps %xmm0, %xmm0
movss 0x5ea8(%rip), %xmm1     # 0xf004
callq 0x31a0
movl -0x1c(%rbp), %edi
movl 0x18(%rbp), %esi
callq 0x3490
movss 0x5e90(%rip), %xmm1     # 0xf004
movaps %xmm1, %xmm0
callq 0x31a0
movl 0x10(%rbp), %edi
movl 0x18(%rbp), %esi
callq 0x3490
callq 0x34d0
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)