// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/polymost.c
// Function: polymost_fillpolygon
void polymost_fillpolygon (int npoints)
{
	PTHead *pth;
	int i;
	unsigned short ptflags = 0;
	struct polymostdrawpolycall draw;

	globalx1 = mulscale16(globalx1,xyaspect);
	globaly2 = mulscale16(globaly2,xyaspect);
	gux = ((double)asm1)*(1.0/4294967296.0);
	gvx = ((double)asm2)*(1.0/4294967296.0);
	guy = ((double)globalx1)*(1.0/4294967296.0);
	gvy = ((double)globaly2)*(-1.0/4294967296.0);
	guo = (((double)xdim)*gux + ((double)ydim)*guy)*-.5 + ((double)globalposx)*(1.0/4294967296.0);
	gvo = (((double)xdim)*gvx + ((double)ydim)*gvy)*-.5 - ((double)globalposy)*(1.0/4294967296.0);

		//Convert int to float (in-place)
	for(i=npoints-1;i>=0;i--)
	{
		((float *)rx1)[i] = ((float)rx1[i])/4096.0;
		((float *)ry1)[i] = ((float)ry1[i])/4096.0;
	}

	if ((unsigned int)globalpicnum >= MAXTILES) globalpicnum = 0;
	if (!palookup[globalpal]) globalpal = 0;

	if (usehightile) ptflags |= PTH_HIGHTILE;

	draw.texture0 = 0;
	pth = PT_GetHead(globalpicnum, globalpal, ptflags, 0);
	if (pth && pth->pic[PTHPIC_BASE]) {
		draw.texture0 = pth->pic[ PTHPIC_BASE ]->glpic;
	}
	draw.texture1 = nulltexture;
	draw.alphacut = 0.f;
	draw.fogcolour.r = draw.fogcolour.g = draw.fogcolour.b = draw.fogcolour.a = 0.f;
	draw.fogdensity = 0.f;

	draw.colour.r = draw.colour.g = draw.colour.b =
		((float)(numpalookups-min(max(globalshade,0),numpalookups)))/((float)numpalookups);
	switch ((globalorientation>>7)&3) {
		case 0:
		case 1: draw.colour.a = 1.0; glfunc.glDisable(GL_BLEND); break;
		case 2: draw.colour.a = 0.66; glfunc.glEnable(GL_BLEND); break;
		case 3: draw.colour.a = 0.33; glfunc.glEnable(GL_BLEND); break;
	}
	if (pth && (pth->flags & PTH_HIGHTILE) && (globalpal != pth->repldef->palnum)) {
		// apply tinting for replaced textures
		draw.colour.r *= (float)hictinting[globalpal].r / 255.0;
		draw.colour.g *= (float)hictinting[globalpal].g / 255.0;
		draw.colour.b *= (float)hictinting[globalpal].b / 255.0;
	}

	draw.modelview = &gidentitymat[0][0];
	draw.projection = &gorthoprojmat[0][0];

	draw.indexbuffer = 0;
	draw.elementbuffer = 0;
	tessectrap((float *)rx1,(float *)ry1,xb1,npoints,&draw);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movl %edi, -0x4(%rbp)
movw $0x0, -0x16(%rbp)
leaq 0x3c6bed(%rip), %rax    # 0x44f598
movl (%rax), %edi
leaq 0x311a64(%rip), %rax    # 0x39a418
movl (%rax), %esi
callq 0x88970
movl %eax, %ecx
leaq 0x3c6bd4(%rip), %rax    # 0x44f598
movl %ecx, (%rax)
leaq 0x3c6bd7(%rip), %rax    # 0x44f5a4
movl (%rax), %edi
leaq 0x311a42(%rip), %rax    # 0x39a418
movl (%rax), %esi
callq 0x88970
movl %eax, %ecx
leaq 0x3c6bbe(%rip), %rax    # 0x44f5a4
movl %ecx, (%rax)
leaq 0x3c8fc5(%rip), %rax    # 0x4519b4
cvtsi2sdl (%rax), %xmm0
movsd 0x2dbbd(%rip), %xmm1    # 0xb65b8
mulsd %xmm1, %xmm0
movsd %xmm0, 0x565131(%rip)   # 0x5edb38
leaq 0x3c8faa(%rip), %rax    # 0x4519b8
cvtsi2sdl (%rax), %xmm0
movsd 0x2db9e(%rip), %xmm1    # 0xb65b8
mulsd %xmm1, %xmm0
movsd %xmm0, 0x56512a(%rip)   # 0x5edb50
leaq 0x3c6b6b(%rip), %rax    # 0x44f598
cvtsi2sdl (%rax), %xmm0
movsd 0x2db7f(%rip), %xmm1    # 0xb65b8
mulsd %xmm1, %xmm0
movsd %xmm0, 0x5650fb(%rip)   # 0x5edb40
leaq 0x3c6b58(%rip), %rax    # 0x44f5a4
cvtsi2sdl (%rax), %xmm0
movsd 0x2db68(%rip), %xmm1    # 0xb65c0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x5650f4(%rip)   # 0x5edb58
leaq 0x3ba2e1(%rip), %rax    # 0x442d4c
cvtsi2sdl (%rax), %xmm0
movsd 0x5650c1(%rip), %xmm2   # 0x5edb38
leaq 0x3ba2d2(%rip), %rax    # 0x442d50
cvtsi2sdl (%rax), %xmm1
mulsd 0x5650b6(%rip), %xmm1   # 0x5edb40
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
leaq 0x1eeb17(%rip), %rax    # 0x2775b0
cvtsi2sdl (%rax), %xmm1
movsd 0x2db13(%rip), %xmm2    # 0xb65b8
mulsd %xmm2, %xmm1
movsd 0x2daff(%rip), %xmm2    # 0xb65b0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x565087(%rip)   # 0x5edb48
leaq 0x3ba284(%rip), %rax    # 0x442d4c
cvtsi2sdl (%rax), %xmm0
movsd 0x56507c(%rip), %xmm2   # 0x5edb50
leaq 0x3ba275(%rip), %rax    # 0x442d50
cvtsi2sdl (%rax), %xmm1
mulsd 0x565071(%rip), %xmm1   # 0x5edb58
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
leaq 0x1eeabe(%rip), %rax    # 0x2775b4
cvtsi2sdl (%rax), %xmm1
movsd 0x2dab6(%rip), %xmm2    # 0xb65b8
mulsd %xmm2, %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
movsd 0x2da8b(%rip), %xmm2    # 0xb65b0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x56502b(%rip)   # 0x5edb60
movl -0x4(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jl 0x88bb7
movslq -0x14(%rbp), %rcx
leaq 0x3ba211(%rip), %rax    # 0x442d60
cvtsi2ssl (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x2d990(%rip), %xmm1    # 0xb64f0
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movslq -0x14(%rbp), %rcx
leaq 0x3ba1ed(%rip), %rax    # 0x442d60
movss %xmm0, (%rax,%rcx,4)
movslq -0x14(%rbp), %rcx
leaq 0x3be1dd(%rip), %rax    # 0x446d60
cvtsi2ssl (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x2d95c(%rip), %xmm1    # 0xb64f0
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movslq -0x14(%rbp), %rcx
leaq 0x3be1b9(%rip), %rax    # 0x446d60
movss %xmm0, (%rax,%rcx,4)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x88b3e
leaq 0x3c21b2(%rip), %rax    # 0x44ad70
movswl (%rax), %eax
cmpl $0x2400, %eax           # imm = 0x2400
jb 0x88bd4
leaq 0x3c21a1(%rip), %rax    # 0x44ad70
movw $0x0, (%rax)
leaq 0x3c2189(%rip), %rax    # 0x44ad64
movslq (%rax), %rcx
leaq 0x34ca5b(%rip), %rax    # 0x3d5640
cmpq $0x0, (%rax,%rcx,8)
jne 0x88bf9
leaq 0x3c2171(%rip), %rax    # 0x44ad64
movl $0x0, (%rax)
cmpl $0x0, 0x58f54(%rip)     # 0xe1b54
je 0x88c0d
movzwl -0x16(%rbp), %eax
orl $0x2, %eax
movw %ax, -0x16(%rbp)
movl $0x0, -0x70(%rbp)
leaq 0x3c2155(%rip), %rax    # 0x44ad70
movswl (%rax), %edi
leaq 0x3c213f(%rip), %rax    # 0x44ad64
movl (%rax), %esi
xorl %ecx, %ecx
movzwl -0x16(%rbp), %edx
callq 0x9a790
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x88c53
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x88c53
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl (%rax), %eax
movl %eax, -0x70(%rbp)
movl 0x564dbf(%rip), %eax    # 0x5eda18
movl %eax, -0x6c(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x68(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x48(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x4c(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x50(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x54(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x44(%rbp)
leaq 0x3c68f5(%rip), %rax    # 0x44f588
movswl (%rax), %eax
movl %eax, -0x74(%rbp)
leaq 0x3c68ec(%rip), %rax    # 0x44f58c
cmpl $0x0, (%rax)
jle 0x88cb3
leaq 0x3c68e0(%rip), %rax    # 0x44f58c
movl (%rax), %eax
movl %eax, -0x78(%rbp)
jmp 0x88cba
xorl %eax, %eax
movl %eax, -0x78(%rbp)
jmp 0x88cba
movl -0x78(%rbp), %eax
leaq 0x3c68c4(%rip), %rcx    # 0x44f588
movswl (%rcx), %ecx
cmpl %ecx, %eax
jge 0x88cf4
leaq 0x3c68ba(%rip), %rax    # 0x44f58c
cmpl $0x0, (%rax)
jle 0x88ce5
leaq 0x3c68ae(%rip), %rax    # 0x44f58c
movl (%rax), %eax
movl %eax, -0x7c(%rbp)
jmp 0x88cec
xorl %eax, %eax
movl %eax, -0x7c(%rbp)
jmp 0x88cec
movl -0x7c(%rbp), %eax
movl %eax, -0x80(%rbp)
jmp 0x88d01
leaq 0x3c688d(%rip), %rax    # 0x44f588
movswl (%rax), %eax
movl %eax, -0x80(%rbp)
movl -0x74(%rbp), %eax
movl -0x80(%rbp), %ecx
subl %ecx, %eax
cvtsi2ss %eax, %xmm0
leaq 0x3c6874(%rip), %rax    # 0x44f588
movswl (%rax), %eax
cvtsi2ss %eax, %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0x5c(%rbp)
movss %xmm0, -0x60(%rbp)
movss %xmm0, -0x64(%rbp)
leaq 0x3c202b(%rip), %rax    # 0x44ad60
movl (%rax), %eax
shrl $0x7, %eax
andl $0x3, %eax
movl %eax, -0x84(%rbp)
subl $0x2, %eax
jb 0x88d64
jmp 0x88d4a
movl -0x84(%rbp), %eax
subl $0x2, %eax
je 0x88d82
jmp 0x88d57
movl -0x84(%rbp), %eax
subl $0x3, %eax
je 0x88da0
jmp 0x88dbc
movss 0x2a094(%rip), %xmm0    # 0xb2e00
movss %xmm0, -0x58(%rbp)
movl $0xbe2, %edi            # imm = 0xBE2
leaq 0x564993(%rip), %rax    # 0x5ed710
callq *0x48(%rax)
jmp 0x88dbc
movss 0x2d85e(%rip), %xmm0    # 0xb65e8
movss %xmm0, -0x58(%rbp)
movl $0xbe2, %edi            # imm = 0xBE2
leaq 0x564975(%rip), %rax    # 0x5ed710
callq *0x40(%rax)
jmp 0x88dbc
movss 0x2d83c(%rip), %xmm0    # 0xb65e4
movss %xmm0, -0x58(%rbp)
movl $0xbe2, %edi            # imm = 0xBE2
leaq 0x564957(%rip), %rax    # 0x5ed710
callq *0x40(%rax)
cmpq $0x0, -0x10(%rbp)
je 0x88e93
movq -0x10(%rbp), %rax
movzwl 0x38(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x88e93
leaq 0x3c1f82(%rip), %rax    # 0x44ad64
movl (%rax), %eax
movq -0x10(%rbp), %rcx
movq 0x40(%rcx), %rcx
movzbl 0x8(%rcx), %ecx
cmpl %ecx, %eax
je 0x88e93
leaq 0x3c1f65(%rip), %rcx    # 0x44ad64
movslq (%rcx), %rdx
leaq 0x5b2df7(%rip), %rax    # 0x63bc00
movzbl (%rax,%rdx,4), %edx
cvtsi2ss %edx, %xmm0
cvtss2sd %xmm0, %xmm2
movsd 0x29f03(%rip), %xmm0    # 0xb2d20
divsd %xmm0, %xmm2
movss -0x64(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm2, %xmm1
cvtsd2ss %xmm1, %xmm1
movss %xmm1, -0x64(%rbp)
movslq (%rcx), %rdx
movzbl 0x1(%rax,%rdx,4), %edx
cvtsi2ss %edx, %xmm1
cvtss2sd %xmm1, %xmm1
divsd %xmm0, %xmm1
movss -0x60(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x60(%rbp)
movslq (%rcx), %rcx
movzbl 0x2(%rax,%rcx,4), %eax
cvtsi2ss %eax, %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x29ea7(%rip), %xmm0    # 0xb2d20
divsd %xmm0, %xmm1
movss -0x5c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x5c(%rbp)
leaq 0x2d7f6(%rip), %rax     # 0xb6690
movq %rax, -0x40(%rbp)
leaq 0x564c0b(%rip), %rax    # 0x5edab0
movq %rax, -0x38(%rbp)
movl $0x0, -0x30(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x4(%rbp), %ecx
leaq 0x3b9e9f(%rip), %rdi    # 0x442d60
leaq 0x3bde98(%rip), %rsi    # 0x446d60
leaq 0x21f701(%rip), %rdx    # 0x2a85d0
leaq -0x70(%rbp), %r8
callq 0x88ef0
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)