// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/polymost.c
// Function: polymost_drawaux_glcall
static void polymost_drawaux_glcall(GLenum mode, struct polymostdrawauxcall *draw)
{
#ifdef DEBUGGINGAIDS
	polymostcallcounts.drawaux_glcall++;
#endif

	glfunc.glUseProgram(polymostauxglsl.program);

#if (USE_OPENGL == USE_GL3)
    glfunc.glBindVertexArray(polymostauxglsl.vao);
#else
    glfunc.glEnableVertexAttribArray(polymostauxglsl.attrib_vertex);
	glfunc.glEnableVertexAttribArray(polymostauxglsl.attrib_texcoord);
#endif

	glfunc.glBindBuffer(GL_ARRAY_BUFFER, polymostauxglsl.elementbuffer);
	glfunc.glBufferData(GL_ARRAY_BUFFER, draw->elementcount * sizeof(struct polymostvboitem), draw->elementvbo, GL_STREAM_DRAW);

	if (draw->indexes) {
		glfunc.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, polymostauxglsl.indexbuffer);
		glfunc.glBufferData(GL_ELEMENT_ARRAY_BUFFER, draw->indexcount * sizeof(GLushort), draw->indexes, GL_STREAM_DRAW);
	} else {
		glfunc.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, elementindexbuffer);
		checkindexbuffer(draw->indexcount);
	}

	glfunc.glVertexAttribPointer(polymostauxglsl.attrib_vertex, 3, GL_FLOAT, GL_FALSE,
		sizeof(struct polymostvboitem), (const GLvoid *)offsetof(struct polymostvboitem, v));
	glfunc.glVertexAttribPointer(polymostauxglsl.attrib_texcoord, 2, GL_FLOAT, GL_FALSE,
		sizeof(struct polymostvboitem), (const GLvoid *)offsetof(struct polymostvboitem, t));

	glfunc.glActiveTexture(GL_TEXTURE0);
	glfunc.glBindTexture(GL_TEXTURE_2D, draw->texture0);

	glfunc.glUniform4f(
		polymostauxglsl.uniform_colour,
		draw->colour.r, draw->colour.g, draw->colour.b, draw->colour.a
	);
	glfunc.glUniform4f(
		polymostauxglsl.uniform_bgcolour,
		draw->bgcolour.r, draw->bgcolour.g, draw->bgcolour.b, draw->bgcolour.a
	);
	glfunc.glUniform1i(polymostauxglsl.uniform_mode, draw->mode);

	glfunc.glUniformMatrix4fv(polymostauxglsl.uniform_projection, 1, GL_FALSE, &gorthoprojmat[0][0]);

	glfunc.glUniform1f(polymostauxglsl.uniform_gamma, usegammabrightness == 1 ? curgamma : 1.0);

	glfunc.glDrawElements(mode, draw->indexcount, GL_UNSIGNED_SHORT, 0);

#if (USE_OPENGL == USE_GL3)
    glfunc.glBindVertexArray(0);
#else
	glfunc.glDisableVertexAttribArray(polymostauxglsl.attrib_vertex);
	glfunc.glDisableVertexAttribArray(polymostauxglsl.attrib_texcoord);
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x5632aa(%rip), %rax    # 0x5ed710
movq 0x1f0(%rax), %rax
movl 0x563575(%rip), %edi    # 0x5ed9e8
callq *%rax
leaq 0x563294(%rip), %rax    # 0x5ed710
movq 0x128(%rax), %rax
movl 0x56356b(%rip), %edi    # 0x5ed9f4
callq *%rax
leaq 0x56327e(%rip), %rax    # 0x5ed710
movq 0x128(%rax), %rax
movl 0x563559(%rip), %edi    # 0x5ed9f8
callq *%rax
leaq 0x563268(%rip), %rax    # 0x5ed710
movq 0xf8(%rax), %rax
movl 0x563537(%rip), %esi    # 0x5ed9ec
movl $0x8892, %edi           # imm = 0x8892
callq *%rax
leaq 0x56324d(%rip), %rax    # 0x5ed710
movq 0x100(%rax), %rax
movq -0x10(%rbp), %rcx
movslq 0x38(%rcx), %rcx
imulq $0x14, %rcx, %rsi
movq -0x10(%rbp), %rcx
movq 0x40(%rcx), %rdx
movl $0x8892, %edi           # imm = 0x8892
movl $0x88e0, %ecx           # imm = 0x88E0
callq *%rax
movq -0x10(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x8a540
leaq 0x563214(%rip), %rax    # 0x5ed710
movq 0xf8(%rax), %rax
movl 0x5634e7(%rip), %esi    # 0x5ed9f0
movl $0x8893, %edi           # imm = 0x8893
callq *%rax
leaq 0x5631f9(%rip), %rax    # 0x5ed710
movq 0x100(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x28(%rcx), %ecx
movl %ecx, %esi
shlq %rsi
movq -0x10(%rbp), %rcx
movq 0x30(%rcx), %rdx
movl $0x8893, %edi           # imm = 0x8893
movl $0x88e0, %ecx           # imm = 0x88E0
callq *%rax
jmp 0x8a567
leaq 0x5631c9(%rip), %rax    # 0x5ed710
movq 0xf8(%rax), %rax
movl 0x563450(%rip), %esi    # 0x5ed9a4
movl $0x8893, %edi           # imm = 0x8893
callq *%rax
movq -0x10(%rbp), %rax
movl 0x28(%rax), %edi
callq 0x73910
leaq 0x5631a2(%rip), %rax    # 0x5ed710
movq 0x138(%rax), %rax
movl 0x563479(%rip), %edi    # 0x5ed9f4
movl $0x3, %esi
movl $0x1406, %edx           # imm = 0x1406
xorl %ecx, %ecx
movl $0x14, %r8d
xorl %r9d, %r9d
callq *%rax
leaq 0x563177(%rip), %rax    # 0x5ed710
movq 0x138(%rax), %rax
movl 0x563452(%rip), %edi    # 0x5ed9f8
movl $0x2, %esi
movl $0x1406, %edx           # imm = 0x1406
xorl %ecx, %ecx
movl $0x14, %r8d
movl $0xc, %r9d
callq *%rax
movl $0x84c0, %edi           # imm = 0x84C0
leaq 0x563144(%rip), %rax    # 0x5ed710
callq *0x140(%rax)
leaq 0x563137(%rip), %rax    # 0x5ed710
movq 0xc8(%rax), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %esi
movl $0xde1, %edi            # imm = 0xDE1
callq *%rax
leaq 0x56311c(%rip), %rax    # 0x5ed710
movq 0x1e0(%rax), %rax
movl 0x563403(%rip), %edi    # 0x5eda04
movq -0x10(%rbp), %rcx
movss 0x4(%rcx), %xmm0
movq -0x10(%rbp), %rcx
movss 0x8(%rcx), %xmm1
movq -0x10(%rbp), %rcx
movss 0xc(%rcx), %xmm2
movq -0x10(%rbp), %rcx
movss 0x10(%rcx), %xmm3
callq *%rax
leaq 0x5630e2(%rip), %rax    # 0x5ed710
movq 0x1e0(%rax), %rax
movl 0x5633cd(%rip), %edi    # 0x5eda08
movq -0x10(%rbp), %rcx
movss 0x14(%rcx), %xmm0
movq -0x10(%rbp), %rcx
movss 0x18(%rcx), %xmm1
movq -0x10(%rbp), %rcx
movss 0x1c(%rcx), %xmm2
movq -0x10(%rbp), %rcx
movss 0x20(%rcx), %xmm3
callq *%rax
leaq 0x5630a8(%rip), %rax    # 0x5ed710
movq 0x1c0(%rax), %rax
movl 0x563397(%rip), %edi    # 0x5eda0c
movq -0x10(%rbp), %rcx
movl 0x24(%rcx), %esi
callq *%rax
leaq 0x56308b(%rip), %rax    # 0x5ed710
movq 0x1e8(%rax), %rax
movl 0x56336a(%rip), %edi    # 0x5ed9fc
movl $0x1, %esi
xorl %edx, %edx
leaq 0x563410(%rip), %rcx    # 0x5edab0
callq *%rax
leaq 0x563067(%rip), %rax    # 0x5ed710
movq 0x1c8(%rax), %rax
movq %rax, -0x20(%rbp)
movl 0x563356(%rip), %eax    # 0x5eda10
movl %eax, -0x14(%rbp)
leaq 0x565b8(%rip), %rax     # 0xe0c7c
cmpl $0x1, (%rax)
jne 0x8a6df
leaq 0x565b4(%rip), %rax     # 0xe0c84
movss (%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
jmp 0x8a6ee
movsd 0x272e9(%rip), %xmm0    # 0xb19d0
movsd %xmm0, -0x28(%rbp)
jmp 0x8a6ee
movq -0x20(%rbp), %rax
movl -0x14(%rbp), %edi
movsd -0x28(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
callq *%rax
leaq 0x563009(%rip), %rax    # 0x5ed710
movq 0x120(%rax), %rax
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rcx
movl 0x28(%rcx), %esi
movl $0x1403, %edx           # imm = 0x1403
xorl %ecx, %ecx
callq *%rax
leaq 0x562fe8(%rip), %rax    # 0x5ed710
movq 0x130(%rax), %rax
movl 0x5632bf(%rip), %edi    # 0x5ed9f4
callq *%rax
leaq 0x562fd2(%rip), %rax    # 0x5ed710
movq 0x130(%rax), %rax
movl 0x5632ad(%rip), %edi    # 0x5ed9f8
callq *%rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)