// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/polymost.c
// Function: polymost_drawline256
int polymost_drawline256(int x1, int y1, int x2, int y2, unsigned char col)
{
	palette_t colour;
	struct polymostdrawauxcall draw;
	struct polymostvboitem vboitem[2];

	if ((rendmode != 3) || (qsetmode != 200)) return(-1);

	polymost_preparetext();
	setpolymost2dview();	// disables blending, texturing, and depth testing
	glfunc.glDepthMask(GL_FALSE);	// disable writing to the z-buffer
	glfunc.glEnable(GL_BLEND);

	draw.mode = 2;	// Solid colour.

	colour = curpalette[col];
	if (!usegammabrightness) {
		colour.r = britable[curbrightness][ colour.r ];
		colour.g = britable[curbrightness][ colour.g ];
		colour.b = britable[curbrightness][ colour.b ];
	}
	draw.colour.r = colour.r / 255.f;
	draw.colour.g = colour.g / 255.f;
	draw.colour.b = colour.b / 255.f;
	draw.colour.a = 1.f;

	vboitem[0].v.x = (GLfloat)(x1+2048)/4096.f;
	vboitem[0].v.y = (GLfloat)(y1+2048)/4096.f;
	vboitem[0].v.z = 0.f;

	vboitem[1].v.x = (GLfloat)(x2+2048)/4096.f;
	vboitem[1].v.y = (GLfloat)(y2+2048)/4096.f;
	vboitem[1].v.z = 0.f;

	draw.indexcount = 2;
	draw.indexes = NULL;
	draw.elementcount = 2;
	draw.elementvbo = vboitem;

	polymost_drawaux_glcall(GL_LINES, &draw);

	glfunc.glDepthMask(GL_TRUE);	// re-enable writing to the z-buffer

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
cmpl $0x3, 0x59c85a(%rip)    # 0x5fa950
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jne 0x5e26f
leaq 0x15a920(%rip), %rax    # 0x1b8a28
cmpl $0xc8, (%rax)
jne 0x5e26f
movl %r8d, %r13d
movl %edx, %ebp
movl %esi, %r12d
movl %edi, %r15d
movl %ecx, 0x4(%rsp)
callq 0x5ded7
callq 0x3da9c
leaq 0x59c60c(%rip), %r14    # 0x5fa740
xorl %ebx, %ebx
xorl %edi, %edi
callq *0xa0(%r14)
movl $0xbe2, %edi            # imm = 0xBE2
callq *0x40(%r14)
movl $0x2, 0x2c(%rsp)
movzbl %r13b, %eax
leaq 0x3d8855(%rip), %rcx    # 0x4369b0
movd (%rcx,%rax,4), %xmm0
movb 0x2(%rcx,%rax,4), %al
leaq 0x46621(%rip), %rcx     # 0xa478c
cmpl $0x0, (%rcx)
jne 0x5e1ae
movzbl %al, %eax
leaq 0x15a88a(%rip), %rcx    # 0x1b8a04
movslq (%rcx), %rcx
movd %xmm0, %edx
movl $0xff, %esi
movl %edx, %edi
andl %esi, %edi
shlq $0x8, %rcx
addq 0x34e43(%rip), %rcx     # 0x92fd8
movzbl (%rdi,%rcx), %edi
shrl $0x8, %edx
andl %esi, %edx
movb (%rax,%rcx), %al
movzbl (%rdx,%rcx), %ecx
shll $0x8, %ecx
orl %edi, %ecx
movd %ecx, %xmm0
pxor %xmm1, %xmm1
punpcklbw %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3],xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
punpcklwd %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
cvtdq2ps %xmm0, %xmm0
divps 0x1c5dc(%rip), %xmm0    # 0x7a7a0
leaq 0x8(%rsp), %rsi
movlps %xmm0, 0x4(%rsi)
movzbl %al, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x1c3c1(%rip), %xmm0    # 0x7a5a0
movss %xmm0, 0xc(%rsi)
movl $0x3f800000, 0x10(%rsi) # imm = 0x3F800000
movd %r12d, %xmm0
movd %r15d, %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movdqa 0x1c5bf(%rip), %xmm0    # 0x7a7c0
paddd %xmm0, %xmm1
cvtdq2ps %xmm1, %xmm1
movaps 0x1c5c1(%rip), %xmm2    # 0x7a7d0
mulps %xmm2, %xmm1
leaq 0x50(%rsp), %rax
movlps %xmm1, (%rax)
movl %ebx, 0x8(%rax)
movd 0x4(%rsp), %xmm1
movd %ebp, %xmm3
punpckldq %xmm1, %xmm3    # xmm3 = xmm3[0],xmm1[0],xmm3[1],xmm1[1]
paddd %xmm0, %xmm3
cvtdq2ps %xmm3, %xmm0
mulps %xmm2, %xmm0
movlps %xmm0, 0x14(%rax)
movl %ebx, 0x1c(%rax)
movl $0x2, %ecx
movl %ecx, 0x28(%rsi)
movq $0x0, 0x30(%rsi)
movl %ecx, 0x38(%rsi)
movq %rax, 0x40(%rsi)
movl $0x1, %edi
callq 0x5d891
movl $0x1, %edi
leaq 0x59c4d7(%rip), %rax    # 0x5fa740
callq *0xa0(%rax)
movl %ebx, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq