// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0xc(%rax)
je 0x8dc4
movq -0x8(%rbp), %rax
movl 0xc(%rax), %edi
callq 0x3140
movq -0x8(%rbp), %rax
movl $0x0, 0xc(%rax)
movl $0x8b31, %edi           # imm = 0x8B31
callq 0x3320
movl %eax, -0x18(%rbp)
leaq 0x6298(%rip), %rax      # 0xf070
movq %rax, -0x20(%rbp)
movl -0x18(%rbp), %edi
movl $0x1, %esi
leaq -0x20(%rbp), %rdx
leaq 0x636d(%rip), %rcx      # 0xf15c
callq 0x37d0
movl -0x18(%rbp), %edi
callq 0x32e0
movl -0x18(%rbp), %edi
callq 0x8cd0
movl $0x8b30, %edi           # imm = 0x8B30
callq 0x3320
movl %eax, -0x24(%rbp)
leaq 0x6348(%rip), %rax      # 0xf160
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0xae, -0x48(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x24(%rbp), %edi
leaq -0x40(%rbp), %rdx
leaq -0x48(%rbp), %rcx
movl $0x2, %esi
callq 0x37d0
movl -0x24(%rbp), %edi
callq 0x32e0
movl -0x24(%rbp), %edi
callq 0x8cd0
callq 0x36c0
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x8(%rbp), %rax
movl 0xc(%rax), %edi
movl -0x18(%rbp), %esi
callq 0x36b0
movq -0x8(%rbp), %rax
movl 0xc(%rax), %edi
movl -0x24(%rbp), %esi
callq 0x36b0
movq -0x8(%rbp), %rax
movl 0xc(%rax), %edi
callq 0x37c0
movq -0x8(%rbp), %rax
movl 0xc(%rax), %edi
callq 0x8d30
movl -0x18(%rbp), %edi
callq 0x3370
movl -0x24(%rbp), %edi
callq 0x3370
movq -0x8(%rbp), %rax
movl 0xc(%rax), %edi
leaq 0x76f3(%rip), %rsi      # 0x105ab
callq 0x3180
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x8(%rbp), %rax
movl 0xc(%rax), %edi
leaq 0x76e2(%rip), %rsi      # 0x105b6
callq 0x3180
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x8(%rbp), %rax
movl 0xc(%rax), %edi
leaq 0x76cc(%rip), %rsi      # 0x105bc
callq 0x3180
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x18(%rax)
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)