// File: /workspace/github_c_makefile_star2_O1/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, 0x59d9bc(%rip)    # 0x5f9950
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jne 0x5c119
leaq 0x15ba82(%rip), %rax    # 0x1b7a28
cmpl $0xc8, (%rax)
jne 0x5c119
movl %r8d, %r13d
movl %edx, %r14d
movl %esi, %r15d
movl %edi, %r12d
movl %ecx, 0x4(%rsp)
callq 0x5bd7e
callq 0x3c626
leaq 0x59d76d(%rip), %rbp    # 0x5f9740
xorl %ebx, %ebx
xorl %edi, %edi
callq *0xa0(%rbp)
movl $0xbe2, %edi            # imm = 0xBE2
callq *0x40(%rbp)
movl $0x2, 0x2c(%rsp)
movzbl %r13b, %eax
leaq 0x3d99b8(%rip), %rsi    # 0x4359b0
movb (%rsi,%rax,4), %dl
movb 0x1(%rsi,%rax,4), %cl
movb 0x2(%rsi,%rax,4), %al
leaq 0x47782(%rip), %rsi     # 0xa378c
cmpl $0x0, (%rsi)
jne 0x5c036
movzbl %dl, %edx
movzbl %cl, %ecx
leaq 0x15b9e8(%rip), %rsi    # 0x1b7a04
movslq (%rsi), %rsi
shlq $0x8, %rsi
addq 0x35fae(%rip), %rsi     # 0x91fd8
movzbl %al, %eax
movb (%rdx,%rsi), %dl
movb (%rcx,%rsi), %cl
movb (%rax,%rsi), %al
movzbl %dl, %edx
cvtsi2ss %edx, %xmm0
movss 0x1d26f(%rip), %xmm1    # 0x792b4
divss %xmm1, %xmm0
leaq 0x8(%rsp), %rsi
movzbl %cl, %ecx
cvtsi2ss %ecx, %xmm2
movss %xmm0, 0x4(%rsi)
divss %xmm1, %xmm2
movss %xmm2, 0x8(%rsi)
movzbl %al, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movl $0x800, %eax            # imm = 0x800
addl %eax, %r12d
xorps %xmm2, %xmm2
cvtsi2ss %r12d, %xmm2
divss %xmm1, %xmm0
movss %xmm0, 0xc(%rsi)
movss 0x1d256(%rip), %xmm0    # 0x792e4
mulss %xmm0, %xmm2
addl %eax, %r15d
xorps %xmm1, %xmm1
cvtsi2ss %r15d, %xmm1
leaq 0x50(%rsp), %rcx
movss %xmm2, (%rcx)
mulss %xmm0, %xmm1
movss %xmm1, 0x4(%rcx)
addl %eax, %r14d
xorps %xmm1, %xmm1
cvtsi2ss %r14d, %xmm1
movl $0x3f800000, 0x10(%rsi) # imm = 0x3F800000
movl %ebx, 0x8(%rcx)
mulss %xmm0, %xmm1
movss %xmm1, 0x14(%rcx)
movl 0x4(%rsp), %edx
addl %eax, %edx
xorps %xmm1, %xmm1
cvtsi2ss %edx, %xmm1
mulss %xmm0, %xmm1
movss %xmm1, 0x18(%rcx)
movl %ebx, 0x1c(%rcx)
movl $0x2, %eax
movl %eax, 0x28(%rsi)
movq $0x0, 0x30(%rsi)
movl %eax, 0x38(%rsi)
movq %rcx, 0x40(%rsi)
movl $0x1, %edi
callq 0x5b735
movl $0x1, %edi
leaq 0x59d62d(%rip), %rax    # 0x5f9740
callq *0xa0(%rax)
movl %ebx, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq