// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x90, %rsp
movb %r8b, %al
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movb %al, -0x15(%rbp)
cmpl $0x3, 0x56267c(%rip)    # 0x5ed920
jne 0x8b2b5
leaq 0x16a2db(%rip), %rax    # 0x1f5588
cmpl $0xc8, (%rax)
je 0x8b2c1
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8b4a2
callq 0x8afa0
callq 0x5a810
xorl %edi, %edi
leaq 0x56243c(%rip), %rax    # 0x5ed710
callq *0xa0(%rax)
movl $0xbe2, %edi            # imm = 0xBE2
leaq 0x56242a(%rip), %rax    # 0x5ed710
callq *0x40(%rax)
movl $0x2, -0x44(%rbp)
movzbl -0x15(%rbp), %eax
movl %eax, %ecx
leaq 0x3e5f03(%rip), %rax    # 0x471200
movl (%rax,%rcx,4), %eax
movl %eax, -0x19(%rbp)
leaq 0x55972(%rip), %rax     # 0xe0c7c
cmpl $0x0, (%rax)
jne 0x8b375
leaq 0x16a24e(%rip), %rax    # 0x1f5564
movslq (%rax), %rcx
leaq 0x3e66e0(%rip), %rax    # 0x471a00
shlq $0x8, %rcx
addq %rcx, %rax
movzbl -0x19(%rbp), %ecx
movb (%rax,%rcx), %al
movb %al, -0x19(%rbp)
leaq 0x16a22c(%rip), %rax    # 0x1f5564
movslq (%rax), %rcx
leaq 0x3e66be(%rip), %rax    # 0x471a00
shlq $0x8, %rcx
addq %rcx, %rax
movzbl -0x18(%rbp), %ecx
movb (%rax,%rcx), %al
movb %al, -0x18(%rbp)
leaq 0x16a20a(%rip), %rax    # 0x1f5564
movslq (%rax), %rcx
leaq 0x3e669c(%rip), %rax    # 0x471a00
shlq $0x8, %rcx
addq %rcx, %rax
movzbl -0x17(%rbp), %ecx
movb (%rax,%rcx), %al
movb %al, -0x17(%rbp)
movzbl -0x19(%rbp), %eax
cvtsi2ss %eax, %xmm0
movss 0x2b253(%rip), %xmm1    # 0xb65d8
divss %xmm1, %xmm0
movss %xmm0, -0x64(%rbp)
movzbl -0x18(%rbp), %eax
cvtsi2ss %eax, %xmm0
movss 0x2b23a(%rip), %xmm1    # 0xb65d8
divss %xmm1, %xmm0
movss %xmm0, -0x60(%rbp)
movzbl -0x17(%rbp), %eax
cvtsi2ss %eax, %xmm0
movss 0x2b221(%rip), %xmm1    # 0xb65d8
divss %xmm1, %xmm0
movss %xmm0, -0x5c(%rbp)
movss 0x27a38(%rip), %xmm0    # 0xb2e00
movss %xmm0, -0x58(%rbp)
movl -0x8(%rbp), %eax
addl $0x800, %eax            # imm = 0x800
cvtsi2ss %eax, %xmm0
movss 0x2b22f(%rip), %xmm1    # 0xb6610
divss %xmm1, %xmm0
movss %xmm0, -0x90(%rbp)
movl -0xc(%rbp), %eax
addl $0x800, %eax            # imm = 0x800
cvtsi2ss %eax, %xmm0
movss 0x2b20f(%rip), %xmm1    # 0xb6610
divss %xmm1, %xmm0
movss %xmm0, -0x8c(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x88(%rbp)
movl -0x10(%rbp), %eax
addl $0x800, %eax            # imm = 0x800
cvtsi2ss %eax, %xmm0
movss 0x2b1e4(%rip), %xmm1    # 0xb6610
divss %xmm1, %xmm0
movss %xmm0, -0x7c(%rbp)
movl -0x14(%rbp), %eax
addl $0x800, %eax            # imm = 0x800
cvtsi2ss %eax, %xmm0
movss 0x2b1c7(%rip), %xmm1    # 0xb6610
divss %xmm1, %xmm0
movss %xmm0, -0x78(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x74(%rbp)
movl $0x2, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
movl $0x2, -0x30(%rbp)
leaq -0x90(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x1, %edi
leaq -0x68(%rbp), %rsi
callq 0x8a450
movl $0x1, %edi
leaq 0x56227b(%rip), %rax    # 0x5ed710
callq *0xa0(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nop