// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: drawrooms
void drawrooms(int daposx, int daposy, int daposz,
		 short daang, int dahoriz, short dacursectnum)
{
	int i, j, z, cz, fz, closest;
	short *shortptr1, *shortptr2;

#if defined(DEBUGGINGAIDS)
	if (numscans > MAXWALLSB) debugprintf("damage report: numscans %d exceeded %d\n", numscans, MAXWALLSB);
	if (numbunches > MAXWALLSB) debugprintf("damage report: numbunches %d exceeded %d\n", numbunches, MAXWALLSB);
	if (maskwallcnt > MAXWALLSB) debugprintf("damage report: maskwallcnt %d exceeded %d\n", maskwallcnt, MAXWALLSB);
	if (smostwallcnt > MAXWALLSB) debugprintf("damage report: smostwallcnt %d exceeded %d\n", smostwallcnt, MAXWALLSB);
#endif

	beforedrawrooms = 0;

	globalposx = daposx; globalposy = daposy; globalposz = daposz;
	globalang = (daang&2047);

	globalhoriz = mulscale16(dahoriz-100,xdimenscale)+(ydimen>>1);
	globaluclip = (0-globalhoriz)*xdimscale;
	globaldclip = (ydimen-globalhoriz)*xdimscale;

	i = mulscale16(xdimenscale,viewingrangerecip);
	globalpisibility = mulscale16(parallaxvisibility,i);
	globalvisibility = mulscale16(visibility,i);
	globalhisibility = mulscale16(globalvisibility,xyaspect);
	globalcisibility = mulscale8(globalhisibility,320);

	globalcursectnum = dacursectnum;
	totalclocklock = totalclock;

	cosglobalang = sintable[(globalang+512)&2047];
	singlobalang = sintable[globalang&2047];
	cosviewingrangeglobalang = mulscale16(cosglobalang,viewingrange);
	sinviewingrangeglobalang = mulscale16(singlobalang,viewingrange);

	if ((xyaspect != oxyaspect) || (xdimen != oxdimen) || (viewingrange != oviewingrange))
		dosetaspect();

	//clearbufbyte(&gotsector[0],(int)((numsectors+7)>>3),0L);
	Bmemset(&gotsector[0],0,(int)((numsectors+7)>>3));

	shortptr1 = (short *)&startumost[windowx1];
	shortptr2 = (short *)&startdmost[windowx1];
	i = xdimen-1;
	do
	{
		umost[i] = shortptr1[i]-windowy1;
		dmost[i] = shortptr2[i]-windowy1;
		i--;
	} while (i != 0);
	umost[0] = shortptr1[0]-windowy1;
	dmost[0] = shortptr2[0]-windowy1;

	//============================================================================= //POLYMOST BEGINS
#if USE_POLYMOST
	polymost_drawrooms(); if (rendmode) { return; }
#endif
	//============================================================================= //POLYMOST ENDS

	frameoffset = frameplace + windowy1*bytesperline + windowx1;

	numhits = xdimen; numscans = 0; numbunches = 0;
	maskwallcnt = 0; smostwallcnt = 0; smostcnt = 0; spritesortcnt = 0;

	if (globalcursectnum >= MAXSECTORS)
		globalcursectnum -= MAXSECTORS;
	else
	{
		i = globalcursectnum;
		updatesector(globalposx,globalposy,&globalcursectnum);
		if (globalcursectnum < 0) globalcursectnum = i;
	}

	globparaceilclip = 1;
	globparaflorclip = 1;
	getzsofslope(globalcursectnum,globalposx,globalposy,&cz,&fz);
	if (globalposz < cz) globparaceilclip = 0;
	if (globalposz > fz) globparaflorclip = 0;

	scansector(globalcursectnum);

	if (inpreparemirror)
	{
		inpreparemirror = 0;
		mirrorsx1 = xdimen-1; mirrorsx2 = 0;
		for(i=numscans-1;i>=0;i--)
		{
			if (wall[thewall[i]].nextsector < 0) continue;
			if (xb1[i] < mirrorsx1) mirrorsx1 = xb1[i];
			if (xb2[i] > mirrorsx2) mirrorsx2 = xb2[i];
		}

		for(i=0;i<mirrorsx1;i++)
			if (umost[i] <= dmost[i])
				{ umost[i] = 1; dmost[i] = 0; numhits--; }
		for(i=mirrorsx2+1;i<xdimen;i++)
			if (umost[i] <= dmost[i])
				{ umost[i] = 1; dmost[i] = 0; numhits--; }

		drawalls(0L);
		numbunches--;
		bunchfirst[0] = bunchfirst[numbunches];
		bunchlast[0] = bunchlast[numbunches];

		mirrorsy1 = min(umost[mirrorsx1],umost[mirrorsx2]);
		mirrorsy2 = max(dmost[mirrorsx1],dmost[mirrorsx2]);
	}

	while ((numbunches > 0) && (numhits > 0))
	{
		clearbuf(&tempbuf[0],(int)((numbunches+3)>>2),0L);
		tempbuf[0] = 1;

		closest = 0;              //Almost works, but not quite :(
		for(i=1;i<numbunches;i++)
		{
			if ((j = bunchfront(i,closest)) < 0) continue;
			tempbuf[i] = 1;
			if (j == 0) tempbuf[closest] = 1, closest = i;
		}
		for(i=0;i<numbunches;i++) //Double-check
		{
			if (tempbuf[i]) continue;
			if ((j = bunchfront(i,closest)) < 0) continue;
			tempbuf[i] = 1;
			if (j == 0) tempbuf[closest] = 1, closest = i, i = 0;
		}

		drawalls(closest);

		if (automapping)
		{
			for(z=bunchfirst[closest];z>=0;z=p2[z])
				show2dwall[thewall[z]>>3] |= pow2char[thewall[z]&7];
		}

		numbunches--;
		bunchfirst[closest] = bunchfirst[numbunches];
		bunchlast[closest] = bunchlast[numbunches];
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl $0x0, 0x7e035(%rip)     # 0xa3788
movl %edi, 0x2142f7(%rip)    # 0x239a50
movl %esi, 0x2142f5(%rip)    # 0x239a54
movl %edx, 0x2452fb(%rip)    # 0x26aa60
movl $0x7ff, %edx            # imm = 0x7FF
movl %ecx, %eax
andl %edx, %eax
movw %ax, 0x3a85bb(%rip)     # 0x3cdd30
addl $-0x64, %r8d
movslq 0x255318(%rip), %rsi    # 0x27aa98
movslq %r8d, %rdi
imulq %rsi, %rdi
shrq $0x10, %rdi
movl 0x255302(%rip), %r8d    # 0x27aa94
movl %r8d, %r10d
sarl %r10d
addl %edi, %r10d
movl %r10d, 0x2552fa(%rip)   # 0x27aa9c
movl 0x3a858c(%rip), %edi    # 0x3cdd34
subl %r10d, %r8d
imull %edi, %r8d
imull %r10d, %edi
negl %edi
movl %edi, 0x24d2c5(%rip)    # 0x272a80
movl %r8d, 0x2552ce(%rip)    # 0x27aa90
movslq 0x3a856f(%rip), %rdi    # 0x3cdd38
movslq 0x385d20(%rip), %r8     # 0x3ab4f0
imulq %rsi, %rdi
shrq $0x10, %rdi
movslq %edi, %rsi
imulq %rsi, %r8
shrq $0x10, %r8
movl %r8d, 0x3a8552(%rip)    # 0x3cdd3c
movslq 0x385cfb(%rip), %r8     # 0x3ab4ec
imulq %rsi, %r8
shrq $0x10, %r8
movl %r8d, 0x3a8540(%rip)    # 0x3cdd40
movl 0x3370b2(%rip), %edi    # 0x35c8b8
movslq %edi, %rsi
movslq %r8d, %r8
imulq %rsi, %r8
shrq $0x10, %r8
movl %r8d, 0x3a8529(%rip)    # 0x3cdd44
movslq %r8d, %r8
shlq $0x6, %r8
leaq (%r8,%r8,4), %r8
shrq $0x8, %r8
movl %r8d, 0x3a8517(%rip)    # 0x3cdd48
movw %r9w, 0x3a8513(%rip)    # 0x3cdd4c
movl 0x385ca8(%rip), %r8d    # 0x3ab4e8
movl %r8d, 0x214211(%rip)    # 0x239a58
addl $0x200, %ecx            # imm = 0x200
andl %edx, %ecx
leaq 0x3a84fa(%rip), %rdx    # 0x3cdd50
movswq (%rdx,%rcx,2), %rcx
movl %ecx, 0x24920f(%rip)    # 0x26ea70
movswq (%rdx,%rax,2), %rdx
movl %edx, 0x24920c(%rip)    # 0x26ea78
movslq 0x3a94dd(%rip), %rax    # 0x3ced50
imulq %rax, %rcx
shrq $0x10, %rcx
movl %ecx, 0x2491fb(%rip)    # 0x26ea7c
imulq %rax, %rdx
shrq $0x10, %rdx
movl %edx, 0x2491e5(%rip)    # 0x26ea74
movl 0x7e3b3(%rip), %ecx     # 0xa3c48
cmpl %ecx, %esi
jne 0x258bb
movl 0x7df91(%rip), %edx     # 0xa3830
cmpl 0x7e3a7(%rip), %edx     # 0xa3c4c
jne 0x258b3
cmpl 0x7e3a3(%rip), %eax     # 0xa3c50
je 0x25a4f
cmpl %ecx, %edi
je 0x25948
movl %edi, 0x7e387(%rip)     # 0xa3c48
shlq $0x6, %rsi
leaq (%rsi,%rsi,4), %rcx
movabsq $0x80000000000, %rax    # imm = 0x80000000000
xorl %edx, %edx
idivq %rcx
movq 0x3f03a9(%rip), %rsi    # 0x415c88
movslq 0x3f03aa(%rip), %rdi    # 0x415c90
movl %eax, -0x4(%rsi,%rdi,4)
movl 0x3e1700(%rip), %eax    # 0x406ff0
testl %eax, %eax
jle 0x25948
shll $0x2, %eax
movq 0x3f0382(%rip), %r8     # 0x415c80
movslq %eax, %r9
leaq 0x1(%r9), %r10
subl %edi, %r9d
negq %rdi
leaq (%rdi,%r10), %rax
cmpq $0x1, %rax
je 0x2593c
movslq %r9d, %r11
movl $0x10000000, %eax       # imm = 0x10000000
xorl %edx, %edx
idivq %r11
movl %eax, -0x8(%r8,%r10,4)
movl %eax, %edx
negl %edx
cmovnsl %edx, %eax
shlq $0xe, %rax
xorl %edx, %edx
idivq %rcx
movl %eax, -0x8(%rsi,%r10,4)
decq %r10
decl %r9d
cmpq $0x1, %r10
jg 0x2590b
movl 0x7dee2(%rip), %esi     # 0xa3830
cmpl 0x7e2f8(%rip), %esi     # 0xa3c4c
jne 0x25968
movl 0x3a93f4(%rip), %eax    # 0x3ced50
cmpl 0x7e2ee(%rip), %eax     # 0xa3c50
je 0x25a4f
movslq %esi, %rcx
movl %esi, 0x7e2db(%rip)     # 0xa3c4c
movslq 0x3a93d8(%rip), %rax    # 0x3ced50
movl %eax, 0x7e2d2(%rip)     # 0xa3c50
testl %esi, %esi
jle 0x25a14
movslq 0x40fc0f(%rip), %rdx    # 0x43559c
imulq %rdx, %rax
shlq $0x6, %rax
leaq (%rax,%rax,4), %rdi
movq %rdi, %rax
shrq $0x20, %rax
sarq $0x20, %rdi
imulq %rcx, %rdi
shrq %rdi
movl $0x2800000, %edx        # imm = 0x2800000
subl %edi, %edx
leaq (%rsi,%rsi), %rdi
xorl %r8d, %r8d
leaq 0x40a180(%rip), %r9     # 0x42fb40
leaq 0x433739(%rip), %r10    # 0x459100
movl %edx, %r11d
sarl $0x10, %r11d
movl %edx, %ebp
movslq %r11d, %r11
movl $0x0, %ebx
andl $0xffff, %ebp           # imm = 0xFFFF
je 0x259f8
movswq 0x2(%r9,%r11,2), %r14
movswq (%r9,%r11,2), %rbx
subq %rbx, %r14
movl %ebp, %ebx
imulq %r14, %rbx
shrq $0x10, %rbx
addl %eax, %edx
movswl (%r9,%r11,2), %r11d
addl %ebx, %r11d
shrl $0x6, %r11d
movw %r11w, (%r8,%r10)
addq $0x2, %r8
cmpq %r8, %rdi
jne 0x259c7
shlq $0x14, %rcx
movl $0x1, %edi
leaq 0x4354dc(%rip), %r8     # 0x45af00
movq %rcx, %rax
cqto
idivq %rdi
movl %eax, (%r8,%rdi,4)
incq %rdi
cmpq $0x10000, %rdi          # imm = 0x10000
jne 0x25a24
imull $0x834, %esi, %eax      # imm = 0x834
movl %eax, 0x4754b8(%rip)    # 0x49af00
movb $0x1, 0x4754b5(%rip)    # 0x49af04
movswl 0x3a950a(%rip), %eax    # 0x3cef60
addl $0x7, %eax
sarl $0x3, %eax
movslq %eax, %rdx
leaq 0x3a92fa(%rip), %rdi    # 0x3ced60
xorl %ebx, %ebx
xorl %esi, %esi
callq 0x62f0
movslq 0x3ab2fa(%rip), %rax    # 0x3d0d70
movl 0x7ddb4(%rip), %edx     # 0xa3830
decl %edx
movzwl 0x3ad0fb(%rip), %ecx    # 0x3d2b80
movslq %edx, %rdx
leaq (%rdx,%rdx), %rsi
leaq (%rsi,%rax,2), %r8
negq %rdx
leaq 0x3a94d6(%rip), %r9     # 0x3cef70
leaq 0x3ad0ef(%rip), %r12    # 0x3d2b90
leaq 0x3ab2d8(%rip), %rdi    # 0x3d0d80
leaq 0x3aeee1(%rip), %r15    # 0x3d4990
leaq (%r8,%rbx,2), %r10
movzwl (%r9,%r10), %r11d
subl %ecx, %r11d
leaq (%rsi,%rbx,2), %r14
movw %r11w, (%r12,%r14)
movzwl (%rdi,%r10), %r10d
subl %ecx, %r10d
movw %r10w, (%r15,%r14)
decq %rbx
cmpq %rbx, %rdx
jne 0x25aaf
movzwl (%r9,%rax,2), %edx
subl %ecx, %edx
movw %dx, 0x3ad0a9(%rip)     # 0x3d2b90
movzwl (%rdi,%rax,2), %eax
subl %ecx, %eax
movw %ax, 0x3aee9c(%rip)     # 0x3d4990
callq 0x5158a
leaq 0x5d3e50(%rip), %rax    # 0x5f9950
cmpl $0x0, (%rax)
je 0x25b14
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x157595(%rip), %rax    # 0x17d0b0
movslq 0x3ad05e(%rip), %rcx    # 0x3d2b80
leaq 0x15775b(%rip), %rdx    # 0x17d284
movslq (%rdx), %rdx
imulq %rcx, %rdx
addq (%rax), %rdx
movslq 0x3ab236(%rip), %rax    # 0x3d0d70
addq %rdx, %rax
movq %rax, 0x3b0c4c(%rip)    # 0x3d6790
movzwl 0x7dce5(%rip), %eax     # 0xa3830
movw %ax, 0x3b0c46(%rip)     # 0x3d6798
xorl %eax, %eax
movw %ax, 0x3b0c3f(%rip)     # 0x3d679a
movw %ax, 0x3b0c3a(%rip)     # 0x3d679c
movw %ax, 0x3b0c35(%rip)     # 0x3d679e
movl %eax, 0x7e0e5(%rip)     # 0xa3c54
movw %ax, 0x3b0c2a(%rip)     # 0x3d67a0
movl %eax, 0x3b0c28(%rip)    # 0x3d67a4
movswl 0x3a81c9(%rip), %ebx    # 0x3cdd4c
cmpl $0x1000, %ebx           # imm = 0x1000
jl 0x25b93
addl $0xfffff000, %ebx       # imm = 0xFFFFF000
jmp 0x25bb5
movl 0x213eb7(%rip), %edi    # 0x239a50
movl 0x213eb5(%rip), %esi    # 0x239a54
leaq 0x3a81a6(%rip), %rdx    # 0x3cdd4c
callq 0x25f34
cmpw $0x0, 0x3a8199(%rip)    # 0x3cdd4c
jns 0x25bbc
movw %bx, 0x3a8190(%rip)     # 0x3cdd4c
movb $0x1, %al
movb %al, 0x3b0be4(%rip)     # 0x3d67a8
movb %al, 0x3b0bdf(%rip)     # 0x3d67a9
movl 0x213e80(%rip), %esi    # 0x239a50
movl 0x213e7e(%rip), %edx    # 0x239a54
movswl 0x3a816f(%rip), %ebx    # 0x3cdd4c
leaq 0x4(%rsp), %r14
movq %rsp, %r8
movl %ebx, %edi
movq %r14, %rcx
callq 0x2600d
movl 0x244e6b(%rip), %eax    # 0x26aa60
cmpl (%r14), %eax
jge 0x25c01
movb $0x0, 0x3b0ba7(%rip)    # 0x3d67a8
cmpl (%rsp), %eax
jle 0x25c0d
movb $0x0, 0x3b0b9c(%rip)    # 0x3d67a9
movl %ebx, %edi
callq 0x26132
cmpb $0x0, 0x191e23(%rip)    # 0x1b7a3e
je 0x25dc1
movb $0x0, 0x191e16(%rip)    # 0x1b7a3e
movl 0x7dc02(%rip), %eax     # 0xa3830
leal -0x1(%rax), %ecx
movl %ecx, 0x3b0b75(%rip)    # 0x3d67ac
movl $0x0, 0x3b0b6f(%rip)    # 0x3d67b0
movswq 0x3b0b51(%rip), %rdx    # 0x3d679a
testq %rdx, %rdx
jle 0x25cb9
incq %rdx
xorl %r10d, %r10d
leaq 0x211df5(%rip), %rsi    # 0x237a50
leaq 0x191dee(%rip), %rdi    # 0x1b7a50
leaq 0x244e07(%rip), %r8     # 0x26aa70
leaq 0x248e10(%rip), %r9     # 0x26ea80
movswq -0x4(%rsi,%rdx,2), %r11
shlq $0x5, %r11
cmpw $0x0, 0xc(%r11,%rdi)
js 0x25caa
movl -0x8(%r8,%rdx,4), %r11d
cmpl %ecx, %r11d
jge 0x25c97
movl %r11d, 0x3b0b18(%rip)   # 0x3d67ac
movl %r11d, %ecx
movl -0x8(%r9,%rdx,4), %r11d
cmpl %r10d, %r11d
jle 0x25caa
movl %r11d, 0x3b0b08(%rip)   # 0x3d67b0
jmp 0x25cad
movl %r10d, %r11d
decq %rdx
movl %r11d, %r10d
cmpq $0x1, %rdx
jg 0x25c70
movslq 0x3b0aec(%rip), %rcx    # 0x3d67ac
testq %rcx, %rcx
jle 0x25cfd
movzwl 0x3b0acc(%rip), %edx    # 0x3d6798
addq %rcx, %rcx
xorl %esi, %esi
movzwl (%rsi,%r12), %edi
cmpw (%rsi,%r15), %di
jg 0x25cf4
movw $0x1, (%rsi,%r12)
movw $0x0, (%rsi,%r15)
decl %edx
movw %dx, 0x3b0aa4(%rip)     # 0x3d6798
addq $0x2, %rsi
cmpq %rsi, %rcx
jne 0x25cd1
movslq 0x3b0aac(%rip), %rcx    # 0x3d67b0
leal 0x1(%rcx), %edx
cmpl %eax, %edx
jge 0x25d42
movzwl 0x3b0a86(%rip), %edx    # 0x3d6798
decl %eax
movzwl 0x2(%r12,%rcx,2), %esi
cmpw 0x2(%r15,%rcx,2), %si
jg 0x25d3b
movw $0x1, 0x2(%r12,%rcx,2)
movw $0x0, 0x2(%r15,%rcx,2)
decl %edx
movw %dx, 0x3b0a5d(%rip)     # 0x3d6798
incq %rcx
cmpl %ecx, %eax
jne 0x25d14
xorl %edi, %edi
callq 0x268a1
movzwl 0x3b0a4c(%rip), %eax    # 0x3d679c
decl %eax
movw %ax, 0x3b0a43(%rip)     # 0x3d679c
movswq %ax, %rax
leaq 0x3b0a5c(%rip), %rcx    # 0x3d67c0
movzwl (%rcx,%rax,2), %ecx
movw %cx, 0x3b0a51(%rip)     # 0x3d67c0
leaq 0x3b2a4a(%rip), %rcx    # 0x3d87c0
movzwl (%rcx,%rax,2), %eax
movw %ax, 0x3b2a3f(%rip)     # 0x3d87c0
movslq 0x3b0a24(%rip), %rax    # 0x3d67ac
movzwl (%r12,%rax,2), %ecx
movslq 0x3b0a1c(%rip), %rdx    # 0x3d67b0
movzwl (%r12,%rdx,2), %esi
cmpw %si, %cx
cmovll %ecx, %esi
movswl %si, %ecx
movl %ecx, 0x3b4a18(%rip)    # 0x3da7c0
movzwl (%r15,%rax,2), %eax
movzwl (%r15,%rdx,2), %ecx
cmpw %cx, %ax
cmovgl %eax, %ecx
movswl %cx, %eax
movl %eax, 0x3b4a03(%rip)    # 0x3da7c4
movzwl 0x3b09d4(%rip), %ecx    # 0x3d679c
testw %cx, %cx
jle 0x25b05
cmpw $0x0, 0x3b09bf(%rip)    # 0x3d6798
jle 0x25b05
leaq 0x3b49ea(%rip), %rbx    # 0x3da7d0
leaq 0x3b89e3(%rip), %r13    # 0x3de7d0
addl $0x3, %ecx
movzwl %cx, %esi
shrl $0x2, %esi
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %edx, %edx
callq 0x4abc9
movb $0x1, 0x3b49c7(%rip)    # 0x3da7d0
movswl 0x3b098b(%rip), %r12d   # 0x3d679c
cmpl $0x2, %r12d
jl 0x25e49
movl %r12d, %r15d
xorl %ebp, %ebp
movl $0x1, %r14d
movl %r14d, %edi
movl %ebp, %esi
callq 0x291ca
testl %eax, %eax
js 0x25e41
movb $0x1, (%r14,%rbx)
jne 0x25e41
movslq %ebp, %rax
movb $0x1, (%rax,%rbx)
movl %r14d, %ebp
incq %r14
cmpq %r14, %r15
jne 0x25e22
testw %r12w, %r12w
jle 0x25e8a
xorl %r14d, %r14d
movslq %r14d, %r15
cmpb $0x0, (%r15,%rbx)
je 0x25e66
incl %r14d
cmpl %r12d, %r14d
jl 0x25e52
jmp 0x25e8a
movl %r14d, %edi
movl %ebp, %esi
callq 0x291ca
testl %eax, %eax
js 0x25e5c
movb $0x1, (%r15,%rbx)
jne 0x25e5c
movslq %ebp, %rax
movb $0x1, (%rax,%rbx)
movl %r14d, %ebp
xorl %r14d, %r14d
jmp 0x25e5c
movl %ebp, %edi
callq 0x268a1
cmpb $0x0, 0x385648(%rip)    # 0x3ab4e0
movslq %ebp, %rax
leaq 0x211bae(%rip), %rdi    # 0x237a50
leaq 0x7d8f7(%rip), %r8      # 0xa37a0
leaq 0x384e30(%rip), %r9     # 0x3aace0
je 0x25ee6
leaq 0x3b0907(%rip), %rcx    # 0x3d67c0
movzwl (%rcx,%rax,2), %ecx
testw %cx, %cx
js 0x25ee6
movzwl %cx, %ecx
addl %ecx, %ecx
movswq (%rcx,%rdi), %rdx
movl %edx, %esi
andl $0x7, %esi
movb (%rsi,%r8), %sil
sarl $0x3, %edx
movslq %edx, %rdx
orb %sil, (%rdx,%r9)
movzwl (%rcx,%r13), %ecx
jmp 0x25ebd
movzwl 0x3b08af(%rip), %ecx    # 0x3d679c
decl %ecx
movw %cx, 0x3b08a6(%rip)     # 0x3d679c
movswq %cx, %rdx
leaq 0x3b08bf(%rip), %rdi    # 0x3d67c0
movzwl (%rdi,%rdx,2), %esi
movw %si, (%rdi,%rax,2)
leaq 0x3b28b0(%rip), %rsi    # 0x3d87c0
movzwl (%rsi,%rdx,2), %edx
movw %dx, (%rsi,%rax,2)
testw %cx, %cx
jle 0x25b05
cmpw $0x0, 0x3b086f(%rip)    # 0x3d6798
jg 0x25ded
jmp 0x25b05