// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: saveoldboard
int saveoldboard(char *filename, int *daposx, int *daposy, int *daposz,
			 short *daang, short *dacursectnum)
{
	short fil, i, j, numsprites, ts;
	int tl;
	struct sectortypev5 v5sect;
	struct walltypev5   v5wall;
	struct spritetypev5 v5spr;
	struct sectortypev6 v6sect;
	struct walltypev6   v6wall;
	struct spritetypev6 v6spr;

	if (mapversion == 4) {
		buildputs("saveoldboard: map version 4 not supported\n");
		return -2;
	} else if (mapversion != 5 && mapversion != 6) {
		buildputs("saveoldboard: map version not 5 or 6\n");
		return -2;
	}

	numsprites = 0;
	for(j=0;j<MAXSTATUS;j++)
	{
		i = headspritestat[j];
		while (i != -1)
		{
			numsprites++;
			i = nextspritestat[i];
		}
	}

	switch (mapversion) {
		case 5:
			if (numsectors > MAXSECTORSV5 || numwalls > MAXWALLSV5 || numsprites > MAXSPRITESV5) {
				buildprintf("saveoldboard: too many sectors/walls/sprites for map version 5 (%d/%d, %d/%d, %d/%d)\n",
					numsectors, MAXSECTORSV5, numwalls, MAXWALLSV5, numsprites, MAXSPRITESV5);
				return -2;
			}
			break;
		case 6:
			if (numsectors > MAXSECTORSV6 || numwalls > MAXWALLSV6 || numsprites > MAXSPRITESV6) {
				buildprintf("saveoldboard: too many sectors/walls/sprites for map version 6 (%d/%d, %d/%d, %d/%d)\n",
					numsectors, MAXSECTORSV6, numwalls, MAXWALLSV6, numsprites, MAXSPRITESV6);
				return -2;
			}
			break;
	}

	if ((fil = Bopen(filename,BO_BINARY|BO_TRUNC|BO_CREAT|BO_WRONLY,BS_IREAD|BS_IWRITE)) == -1)
		return(-1);

	tl = B_LITTLE32(mapversion);
	if (Bwrite(fil,&tl,4) != 4) goto writeerror;

	tl = B_LITTLE32(*daposx);
	if (Bwrite(fil,&tl,4) != 4) goto writeerror;
	tl = B_LITTLE32(*daposy);
	if (Bwrite(fil,&tl,4) != 4) goto writeerror;
	tl = B_LITTLE32(*daposz);
	if (Bwrite(fil,&tl,4) != 4) goto writeerror;
	ts = B_LITTLE16(*daang);
	if (Bwrite(fil,&ts,2) != 2) goto writeerror;
	ts = B_LITTLE16(*dacursectnum);
	if (Bwrite(fil,&ts,2) != 2) goto writeerror;

	ts = B_LITTLE16(numsectors);
	if (Bwrite(fil,&ts,2) != 2) goto writeerror;
	for (i=0; i<numsectors; i++) {
		switch (mapversion) {
			case 6:
				convertv7sectv6(&sector[i], &v6sect);
				if (writev6sect(fil, &v6sect)) goto writeerror;
				break;
			case 5:
				convertv7sectv6(&sector[i], &v6sect);
				convertv6sectv5(&v6sect, &v5sect);
				if (writev5sect(fil, &v5sect)) goto writeerror;
				break;
		}
	}

	ts = B_LITTLE16(numwalls);
	if (Bwrite(fil,&ts,2) != 2) goto writeerror;
	for (i=0; i<numwalls; i++) {
		switch (mapversion) {
			case 6:
				convertv7wallv6(&wall[i], &v6wall);
				if (writev6wall(fil, &v6wall)) goto writeerror;
				break;
			case 5:
				convertv7wallv6(&wall[i], &v6wall);
				convertv6wallv5(&v6wall, &v5wall);
				if (writev5wall(fil, &v5wall)) goto writeerror;
				break;
		}
	}

	ts = B_LITTLE16(numsprites);
	if (Bwrite(fil,&ts,2) != 2) goto writeerror;
	for(j=0;j<MAXSTATUS;j++)
	{
		i = headspritestat[j];
		while (i != -1)
		{
			switch (mapversion) {
				case 6:
					convertv7sprv6(&sprite[i], &v6spr);
					if (writev6sprite(fil, &v6spr)) goto writeerror;
					break;
				case 5:
					convertv7sprv6(&sprite[i], &v6spr);
					convertv6sprv5(&v6spr, &v5spr);
					if (writev5sprite(fil, &v5spr)) goto writeerror;
					break;
			}
			i = nextspritestat[i];
		}
	}

	Bclose(fil);
	return(0);

writeerror:
	Bclose(fil);
	return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movl 0x6e18b(%rip), %eax     # 0x9d798
cmpl $0x4, %eax
jne 0x2f61b
leaq 0x3cc40(%rip), %rdi     # 0x6c259
jmp 0x2f62d
movq %rcx, %r12
leal -0x7(%rax), %ecx
cmpl $-0x2, %ecx
jae 0x2f649
leaq 0x3cc57(%rip), %rdi     # 0x6c284
callq 0x30c8d
pushq $-0x2
popq %rdx
movl %edx, %eax
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r9, %r15
movq %rdx, %r13
movq %rsi, %rbp
xorl %ecx, %ecx
leaq 0x387ec5(%rip), %rsi    # 0x3b7520
leaq 0x3906ce(%rip), %rbx    # 0x3bfd30
xorl %r14d, %r14d
cmpq $0x400, %rcx            # imm = 0x400
je 0x2f68a
leaq (%rsi,%rcx,2), %rdx
movswq (%rdx), %rdx
cmpq $-0x1, %rdx
je 0x2f685
incl %r14d
leaq (%rbx,%rdx,2), %rdx
jmp 0x2f672
incq %rcx
jmp 0x2f665
cmpl $0x6, %eax
je 0x2f6ee
cmpl $0x5, %eax
jne 0x2f74a
movswl 0x3998c1(%rip), %esi    # 0x3c8f60
cmpl $0x401, %esi            # imm = 0x401
setge %cl
movzwl 0x3e05b9(%rip), %eax    # 0x40fc68
movw $0x1001, %dx            # imm = 0x1001
cmpw %dx, %ax
setge %r9b
orb %cl, %r9b
cmpw %dx, %r14w
setge %cl
orb %r9b, %cl
cmpb $0x1, %cl
jne 0x2f74a
movswl %ax, %ecx
movswl %r14w, %r9d
movl $0x1000, (%rsp)         # imm = 0x1000
leaq 0x3cbc9(%rip), %rdi     # 0x6c2aa
movl $0x400, %edx            # imm = 0x400
movl $0x1000, %r8d           # imm = 0x1000
jmp 0x2f73e
movswl 0x39986b(%rip), %esi    # 0x3c8f60
cmpl $0x401, %esi            # imm = 0x401
setge %cl
movzwl 0x3e0563(%rip), %eax    # 0x40fc68
cmpw $0x2001, %ax            # imm = 0x2001
setge %dl
orb %cl, %dl
cmpw $0x1001, %r14w          # imm = 0x1001
setge %cl
orb %dl, %cl
cmpb $0x1, %cl
jne 0x2f74a
movswl %ax, %ecx
movswl %r14w, %r9d
movl $0x1000, (%rsp)         # imm = 0x1000
leaq 0x3cbcd(%rip), %rdi     # 0x6c300
movl $0x400, %edx            # imm = 0x400
movl $0x2000, %r8d           # imm = 0x2000
xorl %eax, %eax
callq 0x22427
jmp 0x2f632
movq %r8, 0x18(%rsp)
movl $0x241, %esi            # imm = 0x241
movl $0x180, %edx            # imm = 0x180
xorl %eax, %eax
callq 0x6490
movl %eax, %ecx
shll $0x10, %ecx
pushq $-0x1
popq %rdx
cmpl $0xffff0000, %ecx       # imm = 0xFFFF0000
je 0x2f635
movq %r15, 0x90(%rsp)
movswl %ax, %r15d
movl 0x6e012(%rip), %eax     # 0x9d798
leaq 0xd0(%rsp), %rsi
movl %eax, (%rsi)
pushq $0x4
popq %rdx
movl %r15d, %edi
callq 0x6af0
movl %r15d, %edi
cmpq $0x4, %rax
jne 0x305b8
movl (%rbp), %eax
leaq 0xd0(%rsp), %rsi
movl %eax, (%rsi)
pushq $0x4
popq %rdx
movl %edi, %ebp
callq 0x6af0
movl %ebp, %edi
cmpq $0x4, %rax
jne 0x305b8
movl (%r13), %eax
leaq 0xd0(%rsp), %rsi
movl %eax, (%rsi)
pushq $0x4
popq %rdx
movl %ebp, %edi
callq 0x6af0
movl %ebp, %edi
cmpq $0x4, %rax
jne 0x305b8
movl (%r12), %eax
leaq 0xd0(%rsp), %rsi
movl %eax, (%rsi)
pushq $0x4
popq %rdx
movl %ebp, %edi
callq 0x6af0
movl %ebp, %edi
cmpq $0x4, %rax
jne 0x305b8
movq 0x18(%rsp), %rax
movzwl (%rax), %eax
leaq 0x26(%rsp), %rsi
movw %ax, (%rsi)
pushq $0x2
popq %rdx
movl %ebp, %edi
callq 0x6af0
movl %ebp, %edi
cmpq $0x2, %rax
jne 0x305b8
movq 0x90(%rsp), %rax
movzwl (%rax), %eax
leaq 0x26(%rsp), %rsi
movw %ax, (%rsi)
pushq $0x2
popq %rdx
movl %ebp, %edi
callq 0x6af0
movl %ebp, %edi
cmpq $0x2, %rax
jne 0x305b8
movzwl 0x3996f7(%rip), %eax    # 0x3c8f60
leaq 0x26(%rsp), %rsi
movw %ax, (%rsi)
pushq $0x2
popq %rdx
movl %ebp, %edi
callq 0x6af0
movl %ebp, %edi
cmpq $0x2, %rax
jne 0x305b8
movl %edi, 0x18(%rsp)
leaq 0xec(%rsp), %r15
leaq 0xed(%rsp), %r12
leaq 0xee(%rsp), %r13
leaq 0x20d1b6(%rip), %rcx    # 0x23ca60
xorl %edx, %edx
leaq 0xd8(%rsp), %rsi
movswq 0x3996a4(%rip), %rax    # 0x3c8f60
cmpq %rax, %rdx
jge 0x2ffa4
movl 0x6decd(%rip), %eax     # 0x9d798
cmpl $0x5, %eax
je 0x2fbba
cmpl $0x6, %eax
movl 0x18(%rsp), %ebp
jne 0x2ff98
movq %rdx, 0x58(%rsp)
movq %rcx, 0x90(%rsp)
movq %rcx, %rdi
callq 0x30cc5
movzwl 0xd8(%rsp), %eax
movw %ax, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movzwl 0xda(%rsp), %eax
movw %ax, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movzwl 0xdc(%rsp), %eax
movw %ax, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movzwl 0xde(%rsp), %eax
movw %ax, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movzwl 0xe0(%rsp), %eax
movw %ax, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movzwl 0xe2(%rsp), %eax
movw %ax, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movl 0xe4(%rsp), %eax
movl %eax, 0x64(%rsp)
movl %ebp, %edi
leaq 0x64(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x6af0
cmpq $0x4, %rax
jne 0x305b6
movl 0xe8(%rsp), %eax
movl %eax, 0x64(%rsp)
movl %ebp, %edi
leaq 0x64(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x6af0
cmpq $0x4, %rax
jne 0x305b6
movl %ebp, %edi
movq %r15, %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movl %ebp, %edi
movq %r12, %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movl %ebp, %edi
movq %r13, %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movl %ebp, %edi
leaq 0xef(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movl %ebp, %edi
leaq 0xf0(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movl %ebp, %edi
leaq 0xf1(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movl %ebp, %edi
leaq 0xf2(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movl %ebp, %edi
leaq 0xf3(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movl %ebp, %edi
leaq 0xf4(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movl %ebp, %edi
leaq 0xf5(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movl %ebp, %edi
leaq 0xf6(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movzwl 0xf8(%rsp), %eax
movw %ax, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movzwl 0xfa(%rsp), %eax
movw %ax, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movzwl 0xfc(%rsp), %eax
movw %ax, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
movl %ebp, %edi
jmp 0x2ff7d
movq %rdx, 0x58(%rsp)
movq %rcx, 0x90(%rsp)
movq %rcx, %rdi
callq 0x30cc5
movq 0xd8(%rsp), %r12
movq %r12, 0x100(%rsp)
movzwl 0xe0(%rsp), %r13d
movw %r13w, 0x108(%rsp)
movzwl 0xe2(%rsp), %r15d
movw %r15w, 0x10a(%rsp)
movl 0xe4(%rsp), %eax
movl %eax, 0xac(%rsp)
movl %eax, 0x10c(%rsp)
movl 0xe8(%rsp), %eax
movl %eax, 0xa8(%rsp)
movl %eax, 0x110(%rsp)
movq 0xec(%rsp), %rax
movq %rax, 0x114(%rsp)
movb 0xf4(%rsp), %al
movb %al, 0x11c(%rsp)
movzwl 0xf5(%rsp), %eax
movw %ax, 0x11d(%rsp)
movzwl 0xf8(%rsp), %eax
movw %ax, 0x56(%rsp)
movw %ax, 0x120(%rsp)
movzwl 0xfa(%rsp), %eax
movw %ax, 0x54(%rsp)
movw %ax, 0x122(%rsp)
movzwl 0xfc(%rsp), %eax
movw %ax, 0x52(%rsp)
movw %ax, 0x124(%rsp)
movw %r12w, 0x28(%rsp)
movl 0x18(%rsp), %ebp
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movq %r12, %xmm0
movdqa %xmm0, 0x150(%rsp)
pextrw $0x1, %xmm0, %eax
movw %ax, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movdqa 0x150(%rsp), %xmm0
pextrw $0x2, %xmm0, %eax
movw %ax, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movdqa 0x150(%rsp), %xmm0
pextrw $0x3, %xmm0, %eax
movw %ax, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movw %r13w, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movw %r15w, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movl 0xac(%rsp), %eax
movl %eax, 0x64(%rsp)
movl %ebp, %edi
leaq 0x64(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x6af0
cmpq $0x4, %rax
jne 0x305b6
movl 0xa8(%rsp), %eax
movl %eax, 0x64(%rsp)
movl %ebp, %edi
leaq 0x64(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x6af0
cmpq $0x4, %rax
jne 0x305b6
movl %ebp, %edi
leaq 0x114(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movl %ebp, %edi
leaq 0x115(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movl %ebp, %edi
leaq 0x116(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movl %ebp, %edi
leaq 0x117(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movl %ebp, %edi
leaq 0x118(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movl %ebp, %edi
leaq 0x119(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movl %ebp, %edi
leaq 0x11a(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movl %ebp, %edi
leaq 0x11b(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movl %ebp, %edi
leaq 0x11c(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movl %ebp, %edi
leaq 0x11d(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movl %ebp, %edi
leaq 0x11e(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movzwl 0x56(%rsp), %eax
movw %ax, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movzwl 0x54(%rsp), %eax
movw %ax, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movzwl 0x52(%rsp), %eax
movw %ax, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
movl %ebp, %edi
leaq 0xec(%rsp), %r15
leaq 0xed(%rsp), %r12
leaq 0xee(%rsp), %r13
movq 0x90(%rsp), %rcx
movq 0x58(%rsp), %rdx
leaq 0xd8(%rsp), %rsi
jne 0x305b8
incq %rdx
addq $0x28, %rcx
jmp 0x2f8b4
movzwl 0x3dfcbd(%rip), %eax    # 0x40fc68
leaq 0x26(%rsp), %rsi
movw %ax, (%rsi)
pushq $0x2
popq %rdx
movl 0x18(%rsp), %ebp
movl %ebp, %edi
callq 0x6af0
movl %ebp, %edi
cmpq $0x2, %rax
jne 0x305b8
leaq 0x181a7c(%rip), %rax    # 0x1b1a50
movq %rax, 0x58(%rsp)
xorl %ecx, %ecx
movswq 0x3dfc85(%rip), %rax    # 0x40fc68
movq %rcx, 0x90(%rsp)
cmpq %rax, %rcx
jge 0x305c4
movl 0x6d79e(%rip), %eax     # 0x9d798
cmpl $0x5, %eax
je 0x3024f
cmpl $0x6, %eax
movl 0x18(%rsp), %ebp
jne 0x305a0
movq 0x58(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x30d86
movl 0xb0(%rsp), %eax
movl %eax, 0x64(%rsp)
movl %ebp, %edi
leaq 0x64(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x6af0
cmpq $0x4, %rax
jne 0x305b6
movl 0xb4(%rsp), %eax
movl %eax, 0x64(%rsp)
movl %ebp, %edi
leaq 0x64(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x6af0
cmpq $0x4, %rax
jne 0x305b6
movzwl 0xb8(%rsp), %eax
movw %ax, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movzwl 0xba(%rsp), %eax
movw %ax, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movzwl 0xbc(%rsp), %eax
movw %ax, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movzwl 0xbe(%rsp), %eax
movw %ax, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movzwl 0xc0(%rsp), %eax
movw %ax, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movl %ebp, %edi
leaq 0xc2(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movl %ebp, %edi
leaq 0xc3(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movzwl 0xc4(%rsp), %eax
movw %ax, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movl %ebp, %edi
leaq 0xc6(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movl %ebp, %edi
leaq 0xc7(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movl %ebp, %edi
leaq 0xc8(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movl %ebp, %edi
leaq 0xc9(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movzwl 0xca(%rsp), %eax
movw %ax, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movzwl 0xcc(%rsp), %eax
movw %ax, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movzwl 0xce(%rsp), %eax
jmp 0x30584
movq 0x58(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x30d86
movl 0xb0(%rsp), %eax
movl 0xb4(%rsp), %r13d
movl %eax, 0x12c(%rsp)
movl %r13d, 0x130(%rsp)
movzwl 0xb8(%rsp), %r12d
movw %r12w, 0x134(%rsp)
movzwl 0xba(%rsp), %ecx
movw %cx, 0xa8(%rsp)
movw %cx, 0x142(%rsp)
movzwl 0xbc(%rsp), %ecx
movw %cx, 0x56(%rsp)
movw %cx, 0x144(%rsp)
orl $-0x1, 0x146(%rsp)
movzwl 0xbe(%rsp), %r15d
movw %r15w, 0x136(%rsp)
movzwl 0xc0(%rsp), %ecx
movw %cx, 0x150(%rsp)
movw %cx, 0x138(%rsp)
movb 0xc2(%rsp), %cl
movb %cl, 0x13a(%rsp)
movzwl 0xc4(%rsp), %ecx
movw %cx, 0xac(%rsp)
movw %cx, 0x13c(%rsp)
movl 0xc6(%rsp), %ecx
movl %ecx, 0x13e(%rsp)
movzwl 0xca(%rsp), %ecx
movw %cx, 0x54(%rsp)
movw %cx, 0x14a(%rsp)
movzwl 0xcc(%rsp), %ecx
movw %cx, 0x52(%rsp)
movw %cx, 0x14c(%rsp)
movzwl 0xce(%rsp), %ecx
movw %cx, 0xd6(%rsp)
movw %cx, 0x14e(%rsp)
movl %eax, 0x64(%rsp)
movl 0x18(%rsp), %ebp
movl %ebp, %edi
leaq 0x64(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x6af0
cmpq $0x4, %rax
jne 0x305b6
movl %r13d, 0x64(%rsp)
movl %ebp, %edi
leaq 0x64(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x6af0
cmpq $0x4, %rax
jne 0x305b6
movw %r12w, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movw %r15w, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movzwl 0x150(%rsp), %eax
movw %ax, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movl %ebp, %edi
leaq 0x13a(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movzwl 0xac(%rsp), %eax
movw %ax, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movl %ebp, %edi
leaq 0x13e(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movl %ebp, %edi
leaq 0x13f(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movl %ebp, %edi
leaq 0x140(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movl %ebp, %edi
leaq 0x141(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x305b6
movzwl 0xa8(%rsp), %eax
movw %ax, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movzwl 0x56(%rsp), %eax
movw %ax, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
orw $-0x1, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
orw $-0x1, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movzwl 0x54(%rsp), %eax
movw %ax, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movzwl 0x52(%rsp), %eax
movw %ax, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x305b6
movzwl 0xd6(%rsp), %eax
movw %ax, 0x28(%rsp)
movl %ebp, %edi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
movl %ebp, %edi
jne 0x305b8
movq 0x90(%rsp), %rcx
incq %rcx
addq $0x20, 0x58(%rsp)
jmp 0x2ffdb
movl %ebp, %edi
callq 0x6220
pushq $-0x1
jmp 0x2f634
leaq 0x26(%rsp), %rsi
movw %r14w, (%rsi)
pushq $0x2
popq %rdx
movl 0x18(%rsp), %ebp
movl %ebp, %edi
callq 0x6af0
movl %ebp, %edi
cmpq $0x2, %rax
jne 0x305b8
movq $0x0, 0x58(%rsp)
cmpq $0x400, 0x58(%rsp)      # imm = 0x400
je 0x30c7d
leaq 0x386f1e(%rip), %rax    # 0x3b7520
movq 0x58(%rsp), %rcx
leaq (%rax,%rcx,2), %rax
movswq (%rax), %rbp
cmpq $-0x1, %rbp
je 0x30c6a
movl 0x6d179(%rip), %eax     # 0x9d798
cmpl $0x5, %eax
je 0x3092c
cmpl $0x6, %eax
movl 0x18(%rsp), %r14d
jne 0x30c61
imulq $0x2c, %rbp, %rdi
leaq 0x24566f(%rip), %rax    # 0x275cb0
addq %rax, %rdi
leaq 0x64(%rsp), %rsi
callq 0x30dfd
movl 0x64(%rsp), %eax
movl %eax, 0x20(%rsp)
movl %r14d, %edi
leaq 0x20(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x6af0
cmpq $0x4, %rax
jne 0x30c74
movl 0x68(%rsp), %eax
movl %eax, 0x20(%rsp)
movl 0x18(%rsp), %edi
leaq 0x20(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x6af0
cmpq $0x4, %rax
jne 0x30c74
movl 0x6c(%rsp), %eax
movl %eax, 0x20(%rsp)
movl 0x18(%rsp), %edi
leaq 0x20(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x6af0
cmpq $0x4, %rax
jne 0x30c74
movzwl 0x70(%rsp), %eax
movw %ax, 0x16(%rsp)
movl 0x18(%rsp), %edi
leaq 0x16(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x30c74
movl 0x18(%rsp), %edi
leaq 0x72(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x30c74
movl 0x18(%rsp), %edi
leaq 0x73(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x30c74
movl 0x18(%rsp), %edi
leaq 0x74(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x30c74
movl 0x18(%rsp), %edi
leaq 0x75(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x30c74
movl 0x18(%rsp), %edi
leaq 0x76(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x30c74
movl 0x18(%rsp), %edi
leaq 0x77(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x30c74
movl 0x18(%rsp), %edi
leaq 0x78(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x30c74
movzwl 0x7a(%rsp), %eax
movw %ax, 0x16(%rsp)
movl 0x18(%rsp), %edi
leaq 0x16(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x30c74
movzwl 0x7c(%rsp), %eax
movw %ax, 0x16(%rsp)
movl 0x18(%rsp), %edi
leaq 0x16(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x30c74
movzwl 0x7e(%rsp), %eax
movw %ax, 0x16(%rsp)
movl 0x18(%rsp), %edi
leaq 0x16(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x30c74
movzwl 0x80(%rsp), %eax
movw %ax, 0x16(%rsp)
movl 0x18(%rsp), %edi
leaq 0x16(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x30c74
movzwl 0x82(%rsp), %eax
movw %ax, 0x16(%rsp)
movl 0x18(%rsp), %edi
leaq 0x16(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x30c74
movzwl 0x84(%rsp), %eax
movw %ax, 0x16(%rsp)
movl 0x18(%rsp), %edi
leaq 0x16(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x30c74
movzwl 0x86(%rsp), %eax
movw %ax, 0x16(%rsp)
movl 0x18(%rsp), %edi
leaq 0x16(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x30c74
movzwl 0x88(%rsp), %eax
movw %ax, 0x16(%rsp)
movl 0x18(%rsp), %edi
leaq 0x16(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x30c74
movzwl 0x8a(%rsp), %eax
movw %ax, 0x16(%rsp)
movl 0x18(%rsp), %edi
leaq 0x16(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x30c74
movzwl 0x8c(%rsp), %eax
movw %ax, 0x16(%rsp)
movl 0x18(%rsp), %edi
leaq 0x16(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x30c74
movzwl 0x8e(%rsp), %eax
jmp 0x30c3a
imulq $0x2c, %rbp, %rdi
leaq 0x245379(%rip), %rax    # 0x275cb0
addq %rax, %rdi
leaq 0x64(%rsp), %rsi
callq 0x30dfd
movl 0x64(%rsp), %eax
movl 0x68(%rsp), %r12d
movl %eax, 0x28(%rsp)
movl %r12d, 0x2c(%rsp)
movl 0x6c(%rsp), %r15d
movl %r15d, 0x30(%rsp)
movb 0x70(%rsp), %cl
movb %cl, 0x34(%rsp)
movb 0x72(%rsp), %cl
movb %cl, 0x35(%rsp)
movzwl 0x75(%rsp), %ecx
movw %cx, 0x36(%rsp)
movdqu 0x7a(%rsp), %xmm0
movdqa %xmm0, 0x90(%rsp)
movdqu %xmm0, 0x38(%rsp)
movzwl 0x8a(%rsp), %r13d
movw %r13w, 0x48(%rsp)
movzwl 0x8c(%rsp), %r14d
movw %r14w, 0x4a(%rsp)
movzwl 0x8e(%rsp), %ecx
movw %cx, 0x150(%rsp)
movw %cx, 0x4c(%rsp)
movl %eax, 0x20(%rsp)
movl 0x18(%rsp), %edi
leaq 0x20(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x6af0
cmpq $0x4, %rax
jne 0x30c74
movl %r12d, 0x20(%rsp)
movl 0x18(%rsp), %edi
leaq 0x20(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x6af0
cmpq $0x4, %rax
jne 0x30c74
movl %r15d, 0x20(%rsp)
movl 0x18(%rsp), %edi
leaq 0x20(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x6af0
cmpq $0x4, %rax
jne 0x30c74
movl 0x18(%rsp), %edi
leaq 0x34(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x30c74
movl 0x18(%rsp), %edi
leaq 0x35(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x30c74
movl 0x18(%rsp), %edi
leaq 0x36(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x30c74
movl 0x18(%rsp), %edi
leaq 0x37(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x6af0
cmpq $0x1, %rax
jne 0x30c74
movdqa 0x90(%rsp), %xmm0
movd %xmm0, %eax
movw %ax, 0x16(%rsp)
movl 0x18(%rsp), %edi
leaq 0x16(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x30c74
movdqa 0x90(%rsp), %xmm0
pextrw $0x1, %xmm0, %eax
movw %ax, 0x16(%rsp)
movl 0x18(%rsp), %edi
leaq 0x16(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x30c74
movdqa 0x90(%rsp), %xmm0
pextrw $0x2, %xmm0, %eax
movw %ax, 0x16(%rsp)
movl 0x18(%rsp), %edi
leaq 0x16(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x30c74
movdqa 0x90(%rsp), %xmm0
pextrw $0x3, %xmm0, %eax
movw %ax, 0x16(%rsp)
movl 0x18(%rsp), %edi
leaq 0x16(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x30c74
movdqa 0x90(%rsp), %xmm0
pextrw $0x4, %xmm0, %eax
movw %ax, 0x16(%rsp)
movl 0x18(%rsp), %edi
leaq 0x16(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x30c74
movdqa 0x90(%rsp), %xmm0
pextrw $0x5, %xmm0, %eax
movw %ax, 0x16(%rsp)
movl 0x18(%rsp), %edi
leaq 0x16(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x30c74
movdqa 0x90(%rsp), %xmm0
pextrw $0x6, %xmm0, %eax
movw %ax, 0x16(%rsp)
movl 0x18(%rsp), %edi
leaq 0x16(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x30c74
movdqa 0x90(%rsp), %xmm0
pextrw $0x7, %xmm0, %eax
movw %ax, 0x16(%rsp)
movl 0x18(%rsp), %edi
leaq 0x16(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x30c74
movw %r13w, 0x16(%rsp)
movl 0x18(%rsp), %edi
leaq 0x16(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x30c74
movw %r14w, 0x16(%rsp)
movl 0x18(%rsp), %edi
leaq 0x16(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
cmpq $0x2, %rax
jne 0x30c74
movzwl 0x150(%rsp), %eax
movw %ax, 0x16(%rsp)
movl 0x18(%rsp), %r14d
movl %r14d, %edi
leaq 0x16(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x6af0
movl %r14d, %edi
cmpq $0x2, %rax
jne 0x305b8
leaq (%rbx,%rbp,2), %rax
jmp 0x3060b
incq 0x58(%rsp)
jmp 0x305ec
movl 0x18(%rsp), %edi
jmp 0x305b8
movl 0x18(%rsp), %edi
callq 0x6220
xorl %edx, %edx
jmp 0x2f635