// File: /workspace/github_c_makefile_star2_O3/aap[P]pdp11/kd11b.c
// Function: step
void
step(KD11B *cpu)
{
	uint by;
	uint br;
	uint b;
	uint c;
	uint src, dst, sf, df, dm;
	word mask, sign;
	int inhov;
	byte oldpsw;

//	trace("fetch from %06o\n", cpu->r[7]);
//	printstate(cpu);

#define SR_N	010
#define DR_N	011
#define SP	cpu->r[6]
#define PC	cpu->r[7]
#define SR	cpu->r[SR_N]
#define DR	cpu->r[DR_N]
#define TV	cpu->r[012]
#define BA	cpu->ba
#define PSW	cpu->psw
#define RD_B(p)	if(readop(cpu, SR_N, src, by, 0)) goto be; if(readop(cpu, DR_N, dst, by, p)) goto be
#define RD_U(p)	if(readop(cpu, DR_N, dst, by, p)) goto be; SR = DR
#define WR	if(writedest(cpu, b, by)) goto be
#define NZ	setnz(cpu, b)
#define SVC	goto service
#define TRAP(v)	TV = v; goto trap
#define CLV	cpu->psw &= ~PSW_V
#define CLCV	cpu->psw &= ~(PSW_V|PSW_C)
#define SEV	cpu->psw |= PSW_V
#define SEC	cpu->psw |= PSW_C
#define C	if(b & 0200000) SEC
#define NC	if((b & 0200000) == 0) SEC
#define BXT	if(by) b = sxt(b)
#define BR	PC += br
#define CBR(c)	if(((c)>>(cpu->psw&017)) & 1) BR
#define PUSH	SP -= 2; if(!inhov && (SP&~0377) == 0) cpu->traps |= TRAP_STACK
#define POP	SP += 2
#define OUT(a,d)	cpu->ba = (a); cpu->bus->data = (d); if(dato(cpu, 0)) goto be
#define IN(d)	if(dati(cpu, 0, 0)) goto be; d = cpu->bus->data
#define INA(a,d)	cpu->ba = a; if(dati(cpu, 0, 0)) goto be; d = cpu->bus->data
#define TR(m)	trace("%06o "#m"\n", PC-2)
#define TRB(m)	trace("%06o "#m"%s\n", PC-2, by ? "B" : "")

	oldpsw = PSW;

	cpu->ba = PC;
	PC += 2;	/* increment even on bus error */
	IN(cpu->ir);

	by = !!(cpu->ir&B15);
	br = sxt(cpu->ir)<<1;
	src = cpu->ir>>6 & 077;
	sf = src & 7;
	dst = cpu->ir & 077;
	df = dst & 7;
	dm = dst>>3 & 7;
	if(by || (cpu->ir&0077700) == 0300)
		mask = M8, sign = B7;
	else
		mask = M16, sign = B15;

	inhov = 0;
	/* Binary */
	switch(cpu->ir & 0170000){
	case 0110000: case 0010000:	TRB(MOV);
		if(readop(cpu, SR_N, src, by, 0)) goto be;
		if(addrop(cpu, dst, by)) goto be;
		if(dm && fetchop(cpu, DR_N, dst, by, 1)) goto be;
		CLV;
		b = SR; NZ;
		if(dm==0) cpu->r[df] = SR;
		else writedest(cpu, SR, by);
		SVC;
	case 0120000: case 0020000:	TRB(CMP);
		RD_B(0); CLCV;
		b = SR + W(~DR) + 1; NC; BXT;
		if(sgn((SR ^ DR) & ~(DR ^ b))) SEV;
		NZ; SVC;
	case 0130000: case 0030000:	TRB(BIT);
		RD_B(0); CLV;
		b = DR & SR;
		NZ; SVC;
	case 0140000: case 0040000:	TRB(BIC);
		RD_B(1); CLV;
		b = DR & ~SR;
		NZ; WR; SVC;
	case 0150000: case 0050000:	TRB(BIS);
		RD_B(1); CLV;
		b = DR | SR;
		NZ; WR; SVC;
	case 0060000:			TR(ADD);
		by = 0; RD_B(1); CLCV;
		b = SR + DR; C;
		if(sgn(~(SR ^ DR) & (DR ^ b))) SEV;
		NZ; WR; SVC;
	case 0160000:			TR(SUB);
		by = 0; RD_B(1); CLCV;
		b = DR + W(~SR) + 1; NC;
		if(sgn((SR ^ DR) & (DR ^ b))) SEV;
		NZ; WR; SVC;

	/* Reserved instructions */
	case 0170000: case 0070000: goto ri;
	}

	/* Unary */
	switch(cpu->ir & 0007700){
	case 0005000:	TRB(CLR);
		RD_U(1); CLCV;
		b = 0;
		NZ; WR; SVC;
	case 0005100:	TRB(COM);
		RD_U(1); CLV; SEC;
		b = W(~SR);
		NZ; WR; SVC;
	case 0005200:	TRB(INC);
		RD_U(1); CLV;
		b = W(SR+1); BXT;
		if(sgn(~SR&b)) SEV;
		NZ; WR; SVC;
	case 0005300:	TRB(DEC);
		RD_U(1); CLV;
		b = W(SR+~0); BXT;
		if(sgn(SR&~b)) SEV;
		NZ; WR; SVC;
	case 0005400:	TRB(NEG);
		RD_U(1); CLCV;
		b = W(~SR+1); BXT; if(b) SEC;
		if(sgn(b&SR)) SEV;
		NZ; WR; SVC;
	case 0005500:	TRB(ADC);
		RD_U(1); c = ISSET(PSW_C); CLCV;
		b = SR + c; C; BXT;
		if(sgn(~SR&b)) SEV;
		NZ; WR; SVC;
	case 0005600:	TRB(SBC);
		RD_U(1); c = !ISSET(PSW_C)-1; CLCV;
		b = W(SR+c); if(c && SR == 0) SEC; BXT;
		if(sgn(SR&~b)) SEV;
		NZ; WR; SVC;
	case 0005700:	TRB(TST);
		RD_U(0); CLCV;
		b = SR;
		NZ; SVC;

	case 0006000:	TRB(ROR);
		RD_U(1); c = ISSET(PSW_C); CLCV;
		b = (SR&mask) >> 1; if(c) b |= sign; if(SR & 1) SEC; BXT;
		if((PSW>>3^PSW)&1) SEV;
		NZ; WR; SVC;
	case 0006100:	TRB(ROL);
		RD_U(1); c = ISSET(PSW_C); CLCV;
		b = (SR<<1) & mask; if(c) b |= 1; if(SR & B15) SEC; BXT;
		if((PSW>>3^PSW)&1) SEV;
		NZ; WR; SVC;
	case 0006200:	TRB(ASR);
		RD_U(1); c = ISSET(PSW_C); CLCV;
		b = W(SR>>1) | SR&B15; if(SR & 1) SEC; BXT;
		if((PSW>>3^PSW)&1) SEV;
		NZ; WR; SVC;
	case 0006300:	TRB(ASL);
		RD_U(1); CLCV;
		b = W(SR<<1); if(SR & B15) SEC; BXT;
		if((PSW>>3^PSW)&1) SEV;
		NZ; WR; SVC;

	case 0006400:
	case 0006500:
	case 0006600:
	case 0006700:
		goto ri;

	}

	switch(cpu->ir & 0107400){
	/* Branches */
	case 0000400:	TR(BR); BR; SVC;
	case 0001000:	TR(BNE); CBR(0x0F0F); SVC;
	case 0001400:	TR(BEQ); CBR(0xF0F0); SVC;
	case 0002000:	TR(BGE); CBR(0xCC33); SVC;
	case 0002400:	TR(BLT); CBR(0x33CC); SVC;
	case 0003000:	TR(BGT); CBR(0x0C03); SVC;
	case 0003400:	TR(BLE); CBR(0xF3FC); SVC;
	case 0100000:	TR(BPL); CBR(0x00FF); SVC;
	case 0100400:	TR(BMI); CBR(0xFF00); SVC;
	case 0101000:	TR(BHI); CBR(0x0505); SVC;
	case 0101400:	TR(BLOS); CBR(0xFAFA); SVC;
	case 0102000:	TR(BVC); CBR(0x3333); SVC;
	case 0102400:	TR(BVS); CBR(0xCCCC); SVC;
	case 0103000:	TR(BCC); CBR(0x5555); SVC;
	case 0103400:	TR(BCS); CBR(0xAAAA); SVC;

	case 0004000:
	case 0004400:	TR(JSR);
		if(dm == 0) goto ill;
		if(addrop(cpu, dst, 0)) goto be;
		if(dati(cpu, 0, 0)) goto be;
		DR = cpu->b;
		PUSH; OUT(SP, cpu->r[sf]);
		cpu->r[sf] = PC; PC = DR;
		SVC;
	case 0104000:	TR(EMT); TRAP(030);
	case 0104400:	TR(TRAP); TRAP(034);
	case 0007000:
	case 0007400:
	case 0107000:
	case 0107400:
		goto ri;
	}

	// Hope we caught all instructions we meant to
	assert((cpu->ir & 0177400) == 0);

	/* Misc */
	switch(cpu->ir & 0300){
	case 0100:	TR(JMP);
		if(dm == 0) goto ill;
		if(addrop(cpu, dst, 0)) goto be;
		if(dati(cpu, 0, 0)) goto be;
		PC = cpu->b;
		SVC;
	case 0200:
	switch(cpu->ir&070){
	case 000:	TR(RTS);
		BA = SP; POP;
		PC = cpu->r[df];
		IN(cpu->r[df]);
		SVC;
	case 010: case 020: case 030:
		goto ri;
	case 040: case 050:	TR(CCC); PSW &= ~(cpu->ir&017); SVC;
	case 060: case 070:	TR(SEC); PSW |= cpu->ir&017; SVC;
	}
	case 0300:	TR(SWAB);
		if(readop(cpu, DR_N, dst, by, 1)) goto be;
		CLCV;
		b = WD(DR & 0377, (DR>>8) & 0377);
		NZ; WR; SVC;
	}

	/* Operate */
	switch(cpu->ir & 7){
	case 0:	TR(HALT); cpu->state = STATE_HALTED; return;
	case 1:	TR(WAIT); cpu->state = STATE_WAITING; SVC;
	case 2:	TR(RTI);
		BA = SP; POP; IN(PC);
		BA = SP; POP; IN(PSW);
		SVC;
	case 3:	TR(BPT); TRAP(014);
	case 4:	TR(IOT); TRAP(020);
	case 5:	TR(RESET); reset(cpu); SVC;
	}

	// All other instructions should be reserved now

ri:	TRAP(010);
ill:	TRAP(4);
be:	if(cpu->be > 1){
		printf("double bus error, HALT\n");
		cpu->state = STATE_HALTED;
		return;
	}
printf("bus error\n");
	TRAP(4);

trap:
	trace("TRAP %o\n", TV);
	PUSH; OUT(SP, PSW);
	PUSH; OUT(SP, PC);
	INA(TV, PC);
	INA(TV+2, PSW);
	/* no trace trap after a trap */
	oldpsw = PSW;

	tracestate(cpu);
	SVC;

service:
	c = PSW >> 5;
	if(oldpsw & PSW_T){
		oldpsw &= ~PSW_T;
		TRAP(014);
	}else if(cpu->traps & TRAP_STACK){
		cpu->traps &= ~TRAP_STACK;
		inhov = 1;
		TRAP(4);
	}else if(cpu->traps & TRAP_PWR){
		cpu->traps &= ~TRAP_PWR;
		TRAP(024);
	}else if(c < 7 && cpu->traps & TRAP_BR7){
		cpu->traps &= ~TRAP_BR7;
		TRAP(cpu->br[3].bg(cpu->br[3].dev));
	}else if(c < 6 && cpu->traps & TRAP_BR6){
		cpu->traps &= ~TRAP_BR6;
		TRAP(cpu->br[2].bg(cpu->br[2].dev));
	}else if(c < 6 && cpu->traps & TRAP_CLK){
		cpu->traps &= ~TRAP_CLK;
		cpu->lc_int = 0;
		TRAP(0100);
	}else if(c < 5 && cpu->traps & TRAP_BR5){
		cpu->traps &= ~TRAP_BR5;
		TRAP(cpu->br[1].bg(cpu->br[1].dev));
	}else if(c < 4 && cpu->traps & TRAP_BR4){
		cpu->traps &= ~TRAP_BR4;
		TRAP(cpu->br[0].bg(cpu->br[0].dev));
	}else if(c < 4 && cpu->traps & TRAP_RX){
		cpu->traps &= ~TRAP_RX;
		cpu->rcd_int = 0;
		TRAP(060);
	}else if(c < 4 && cpu->traps & TRAP_TX){
		cpu->traps &= ~TRAP_TX;
		cpu->xmit_int = 0;
		TRAP(064);
	}else
	// TODO? console stop
		/* fetch next instruction */
		return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movb 0x30(%rdi), %bpl
movzwl 0xe(%rdi), %eax
movw %ax, 0x22(%rdi)
addl $0x2, %eax
movw %ax, 0xe(%rdi)
xorl %esi, %esi
xorl %edx, %edx
callq 0x1a23
testl %eax, %eax
jne 0x2df8
movb %bpl, 0xb(%rsp)
movq 0x28(%rbx), %rax
movzwl 0xc(%rax), %r13d
movw %r13w, 0x24(%rbx)
testw %r13w, %r13w
sets %bpl
movl %r13d, %eax
shrl $0xf, %eax
movl %eax, 0xc(%rsp)
movl $0xff, %r15d
movl %r13d, %edi
andl %r15d, %edi
callq 0x1424
movzwl 0x24(%rbx), %ecx
movl %ecx, %r12d
shrl $0x6, %r12d
movl %ecx, %r8d
andl $0x3f, %r8d
movl %ecx, %r9d
andl $0x7, %r9d
movl %ecx, %r14d
shrl $0x3, %r14d
andl $0x7, %r14d
movl %ecx, %edx
andl $0x7fc0, %edx           # imm = 0x7FC0
cmpl $0xc0, %edx
sete %dl
orb %bpl, %dl
movl $0xffff, %ebp           # imm = 0xFFFF
cmovnel %r15d, %ebp
movl $0x80, %edx
movl $0x8000, %r15d          # imm = 0x8000
cmovnel %edx, %r15d
leal -0x1000(%rcx), %esi
shrl $0xc, %esi
cmpl $0xe, %esi
ja 0x223a
movl %r12d, %edx
andl $0x3f, %edx
leaq 0x3308(%rip), %rdi      # 0x5110
movslq (%rdi,%rsi,4), %rsi
addq %rdi, %rsi
jmpq *%rsi
movq %r9, 0x10(%rsp)
movl %r8d, %r12d
xorl %r13d, %r13d
movq %rbx, %rdi
movl $0x8, %esi
movl 0xc(%rsp), %ebp
movl %ebp, %ecx
xorl %r8d, %r8d
callq 0x3056
testl %eax, %eax
jne 0x2df8
movq %rbx, %rdi
movl %r12d, %esi
movl %ebp, %edx
callq 0x30a2
testl %eax, %eax
jne 0x2df8
testl %r14d, %r14d
movb 0xb(%rsp), %r15b
je 0x1e79
movq %rbx, %rdi
movl $0x9, %esi
movl %r12d, %edx
movl %ebp, %ecx
movl $0x1, %r8d
callq 0x31b7
testl %eax, %eax
jne 0x2df8
movb 0x30(%rbx), %cl
movzwl 0x10(%rbx), %eax
andb $-0xf, %cl
movzbl %cl, %edx
orb $0x8, %cl
movzbl %cl, %esi
leal 0x4(%rdx), %ecx
testw %ax, %ax
cmovnsl %edx, %esi
movzbl %cl, %ecx
cmovnel %esi, %ecx
movb %cl, 0x30(%rbx)
testl %r14d, %r14d
je 0x2270
movzwl %ax, %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x322e
jmp 0x29c6
movl %r13d, %r12d
movl %r8d, %r14d
xorl %r13d, %r13d
movq %rbx, %rdi
movl $0x8, %esi
movl 0xc(%rsp), %ebp
movl %ebp, %ecx
xorl %r8d, %r8d
callq 0x3056
testl %eax, %eax
movb 0xb(%rsp), %r15b
jne 0x2df8
xorl %r13d, %r13d
movq %rbx, %rdi
movl $0x9, %esi
movl %r14d, %edx
movl %ebp, %ecx
xorl %r8d, %r8d
callq 0x3056
testl %eax, %eax
jne 0x2df8
movb 0x30(%rbx), %dl
andb $-0x4, %dl
movb %dl, 0x30(%rbx)
movzwl 0x10(%rbx), %eax
movzwl 0x12(%rbx), %ecx
movl %ecx, %esi
xorl $0xffff, %esi           # imm = 0xFFFF
leal (%rax,%rsi), %ebp
incl %ebp
btl $0x10, %ebp
jb 0x1f2f
orb $0x1, %dl
movb %dl, 0x30(%rbx)
testw %r12w, %r12w
jns 0x1f49
movzbl %bpl, %edi
callq 0x1424
movzwl %ax, %ebp
movzwl 0x10(%rbx), %eax
movzwl 0x12(%rbx), %ecx
xorl %ecx, %eax
xorl %ebp, %ecx
notl %ecx
andl %eax, %ecx
movzwl %cx, %edi
callq 0x141e
movl 0x30(%rbx), %ecx
movl %ecx, %edx
orb $0x2, %dl
testw %ax, %ax
movzbl %dl, %eax
cmovel %ecx, %eax
andb $-0xd, %al
movzbl %al, %ecx
orb $0x8, %al
movzbl %al, %eax
leal 0x4(%rcx), %edx
testw %bp, %bp
cmovnsl %ecx, %eax
movzbl %dl, %ecx
jmp 0x2060
movl %r8d, %r14d
xorl %r13d, %r13d
movq %rbx, %rdi
movl $0x8, %esi
movl 0xc(%rsp), %ebp
movl %ebp, %ecx
xorl %r8d, %r8d
callq 0x3056
testl %eax, %eax
jne 0x2df8
movq %rbx, %rdi
movl $0x9, %esi
movl %r14d, %edx
movl %ebp, %ecx
movl $0x1, %r8d
callq 0x3056
testl %eax, %eax
jne 0x2df8
movb 0x30(%rbx), %al
movzwl 0x10(%rbx), %ecx
orw 0x12(%rbx), %cx
andb $-0xf, %al
movzbl %al, %edx
orb $0x8, %al
movzbl %al, %eax
leal 0x4(%rdx), %esi
testw %cx, %cx
cmovnsl %edx, %eax
movzbl %sil, %edx
cmovnel %eax, %edx
movb %dl, 0x30(%rbx)
movzwl %cx, %esi
jmp 0x20db
movl %r8d, %r14d
xorl %r13d, %r13d
movq %rbx, %rdi
movl $0x8, %esi
movl 0xc(%rsp), %ebp
movl %ebp, %ecx
xorl %r8d, %r8d
callq 0x3056
testl %eax, %eax
movb 0xb(%rsp), %r15b
jne 0x2df8
xorl %r13d, %r13d
movq %rbx, %rdi
movl $0x9, %esi
movl %r14d, %edx
movl %ebp, %ecx
xorl %r8d, %r8d
callq 0x3056
testl %eax, %eax
jne 0x2df8
movb 0x30(%rbx), %al
movzwl 0x10(%rbx), %ecx
andb $-0xf, %al
movzbl %al, %edx
orb $0x8, %al
movzbl %al, %eax
testw %cx, 0x12(%rbx)
leal 0x4(%rdx), %ecx
cmovnsl %edx, %eax
movzbl %cl, %ecx
cmovnel %eax, %ecx
movb %cl, 0x30(%rbx)
jmp 0x29c9
movl %r8d, %r14d
xorl %r13d, %r13d
movq %rbx, %rdi
movl $0x8, %esi
movl 0xc(%rsp), %ebp
movl %ebp, %ecx
xorl %r8d, %r8d
callq 0x3056
testl %eax, %eax
jne 0x2df8
movq %rbx, %rdi
movl $0x9, %esi
movl %r14d, %edx
movl %ebp, %ecx
movl $0x1, %r8d
callq 0x3056
testl %eax, %eax
jne 0x2df8
movb 0x30(%rbx), %al
movl 0x10(%rbx), %ecx
notl %ecx
andw 0x12(%rbx), %cx
andb $-0xf, %al
movzbl %al, %edx
orb $0x8, %al
movzbl %al, %eax
leal 0x4(%rdx), %esi
testw %cx, %cx
cmovnsl %edx, %eax
movzbl %sil, %edx
cmovnel %eax, %edx
movb %dl, 0x30(%rbx)
movzwl %cx, %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x322e
testl %eax, %eax
movb 0xb(%rsp), %r15b
jne 0x2df8
jmp 0x29c6
movl %r8d, %ebp
xorl %r13d, %r13d
movq %rbx, %rdi
movl $0x8, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3056
testl %eax, %eax
movb 0xb(%rsp), %r15b
jne 0x2df8
xorl %r13d, %r13d
movq %rbx, %rdi
movl $0x9, %esi
movl %ebp, %edx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x3056
testl %eax, %eax
jne 0x2df8
movb 0x30(%rbx), %cl
andb $-0x4, %cl
movb %cl, 0x30(%rbx)
movzwl 0x12(%rbx), %eax
movzwl 0x10(%rbx), %edi
movl %edi, %edx
xorl $0xffff, %edx           # imm = 0xFFFF
leal (%rax,%rdx), %ebp
incl %ebp
btl $0x10, %ebp
jb 0x2168
orb $0x1, %cl
movb %cl, 0x30(%rbx)
xorl %eax, %edi
xorl %ebp, %eax
movl $0xffff, %r14d          # imm = 0xFFFF
andl %r14d, %edi
andl %eax, %edi
jmp 0x21f6
movl %r8d, %ebp
xorl %r13d, %r13d
movq %rbx, %rdi
movl $0x8, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3056
testl %eax, %eax
movb 0xb(%rsp), %r15b
jne 0x2df8
xorl %r13d, %r13d
movq %rbx, %rdi
movl $0x9, %esi
movl %ebp, %edx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x3056
testl %eax, %eax
jne 0x2df8
movb 0x30(%rbx), %cl
andb $-0x4, %cl
movb %cl, 0x30(%rbx)
movzwl 0x10(%rbx), %edi
movzwl 0x12(%rbx), %eax
movl %edi, %ebp
addl %eax, %ebp
cmpl $0x10000, %ebp          # imm = 0x10000
jb 0x21e3
orb $0x1, %cl
movb %cl, 0x30(%rbx)
movl %ebp, %ecx
xorl %eax, %ecx
xorl %eax, %edi
notl %edi
andl %ecx, %edi
movl $0xffff, %r14d          # imm = 0xFFFF
andl %r14d, %edi
callq 0x141e
movl 0x30(%rbx), %ecx
movl %ecx, %edx
orb $0x2, %dl
testw %ax, %ax
movzbl %dl, %eax
cmovel %ecx, %eax
andb $-0xd, %al
movzbl %al, %ecx
orb $0x8, %al
movzbl %al, %eax
leal 0x4(%rcx), %edx
testw %bp, %bp
cmovnsl %ecx, %eax
movzbl %dl, %ecx
cmovnel %eax, %ecx
movb %cl, 0x30(%rbx)
andl %r14d, %ebp
xorl %r13d, %r13d
movq %rbx, %rdi
movl %ebp, %esi
xorl %edx, %edx
jmp 0x29b9
movl %ecx, %edx
andl $0xfc0, %edx            # imm = 0xFC0
addl $0xfffff600, %edx       # imm = 0xFFFFF600
shrl $0x6, %edx
cmpl $0xf, %edx
ja 0x27d8
leaq 0x2ef1(%rip), %rax      # 0x514c
movslq (%rax,%rdx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
xorl %r13d, %r13d
movw $0x8, %ax
jmp 0x2e32
movq 0x10(%rsp), %rdx
movw %ax, (%rbx,%rdx,2)
jmp 0x29c9
movl %r13d, %r14d
movq %rbx, %rdi
movl $0x9, %esi
movl %r8d, %edx
movl 0xc(%rsp), %ebp
movl %ebp, %ecx
movl $0x1, %r8d
callq 0x3056
xorl %r13d, %r13d
testl %eax, %eax
jne 0x2df8
movzwl 0x12(%rbx), %eax
movb 0x30(%rbx), %sil
andb $-0x4, %sil
movl %eax, %edx
shrl %edx
movl %eax, %ecx
andb $0x1, %cl
orb %sil, %cl
movw %ax, 0x10(%rbx)
movb %cl, 0x30(%rbx)
testw %r14w, %r14w
js 0x2974
andl $0x8000, %eax           # imm = 0x8000
orl %edx, %eax
jmp 0x297f
xorl %r13d, %r13d
movq %rbx, %rdi
movl $0x9, %esi
movl %r8d, %edx
movl 0xc(%rsp), %ecx
xorl %r8d, %r8d
callq 0x3056
testl %eax, %eax
movb 0xb(%rsp), %r15b
jne 0x2df8
movzwl 0x12(%rbx), %eax
movw %ax, 0x10(%rbx)
movb 0x30(%rbx), %cl
andb $-0x10, %cl
movzbl %cl, %edx
orb $0x8, %cl
movzbl %cl, %esi
leal 0x4(%rdx), %ecx
testw %ax, %ax
cmovnsl %edx, %esi
movzbl %cl, %ecx
cmovnel %esi, %ecx
jmp 0x2063
movq %rbx, %rdi
movl $0x9, %esi
movl %r8d, %edx
movl 0xc(%rsp), %ebp
movl %ebp, %ecx
movl $0x1, %r8d
callq 0x3056
testl %eax, %eax
jne 0x2394
movzwl 0x12(%rbx), %eax
movw %ax, 0x10(%rbx)
movb 0x30(%rbx), %al
andb $-0x10, %al
orb $0x4, %al
movb %al, 0x30(%rbx)
xorl %r13d, %r13d
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x20de
movq %rbx, %rdi
movl $0x9, %esi
movl %r8d, %edx
movl 0xc(%rsp), %r14d
movl %r14d, %ecx
movl $0x1, %r8d
callq 0x3056
testl %eax, %eax
je 0x287e
xorl %r13d, %r13d
jmp 0x2df8
movl %r13d, %r14d
movq %rbx, %rdi
movl $0x9, %esi
movl %r8d, %edx
movl 0xc(%rsp), %ebp
movl %ebp, %ecx
movl $0x1, %r8d
callq 0x3056
xorl %r13d, %r13d
testl %eax, %eax
jne 0x2df8
movzwl 0x12(%rbx), %edi
movzbl 0x30(%rbx), %ecx
movl %ecx, %eax
andl $0x1, %eax
andb $-0x4, %cl
addl %edi, %eax
cmpl $0x10000, %eax          # imm = 0x10000
setae %dl
orb %cl, %dl
movw %di, 0x10(%rbx)
movb %dl, 0x30(%rbx)
testw %r14w, %r14w
jns 0x23fe
movzbl %al, %edi
callq 0x1424
movzwl %ax, %eax
movzwl 0x10(%rbx), %edi
movb 0xb(%rsp), %r15b
notl %edi
movzwl %ax, %r14d
andl %r14d, %edi
callq 0x141e
movl 0x30(%rbx), %ecx
movl %ecx, %edx
orb $0x2, %dl
testw %ax, %ax
movzbl %dl, %eax
cmovel %ecx, %eax
andb $-0xd, %al
movzbl %al, %ecx
orb $0x8, %al
movzbl %al, %eax
leal 0x4(%rcx), %edx
testw %r14w, %r14w
cmovnsl %ecx, %eax
movzbl %dl, %ecx
cmovnel %eax, %ecx
movb %cl, 0x30(%rbx)
movq %rbx, %rdi
movl %r14d, %esi
jmp 0x29b7
movl %r13d, %r14d
movq %rbx, %rdi
movl $0x9, %esi
movl %r8d, %edx
movl 0xc(%rsp), %ebp
movl %ebp, %ecx
movl $0x1, %r8d
callq 0x3056
xorl %r13d, %r13d
testl %eax, %eax
jne 0x2df8
movzwl 0x12(%rbx), %ecx
movb 0x30(%rbx), %dl
andb $-0x4, %dl
leal (%rcx,%rcx), %eax
movw %cx, 0x10(%rbx)
shrl $0xf, %ecx
orb %dl, %cl
movb %cl, 0x30(%rbx)
testw %r14w, %r14w
jns 0x249e
movzbl %al, %edi
callq 0x1424
movb 0x30(%rbx), %cl
movb 0xb(%rsp), %r15b
movl %ecx, %edx
shrb $0x3, %dl
xorb %cl, %dl
addb %dl, %dl
andb $0x2, %dl
andb $-0xd, %cl
orb %dl, %cl
movzbl %cl, %edx
orb $0x8, %cl
movzbl %cl, %ecx
jmp 0x299e
movl %r13d, %r15d
movq %rbx, %rdi
movl $0x9, %esi
movl %r8d, %edx
movl 0xc(%rsp), %ebp
movl %ebp, %ecx
movl $0x1, %r8d
callq 0x3056
xorl %r13d, %r13d
testl %eax, %eax
jne 0x2df8
movzwl 0x12(%rbx), %eax
andb $-0x3, 0x30(%rbx)
leal -0x1(%rax), %r14d
movw %ax, 0x10(%rbx)
testw %r15w, %r15w
jns 0x2512
movzbl %r14b, %edi
callq 0x1424
movl %eax, %r14d
movzwl 0x10(%rbx), %eax
movb 0xb(%rsp), %r15b
movl %r14d, %ecx
notl %ecx
andl %ecx, %eax
jmp 0x267f
movq %rbx, %rdi
movl $0x9, %esi
movl %r8d, %edx
movl 0xc(%rsp), %ebp
movl %ebp, %ecx
movl $0x1, %r8d
callq 0x3056
xorl %r13d, %r13d
testl %eax, %eax
jne 0x2df8
movzwl 0x12(%rbx), %eax
movw %ax, 0x10(%rbx)
movb 0x30(%rbx), %cl
andb $-0x10, %cl
testw %ax, %ax
setns %dl
shlb $0x3, %dl
incb %dl
cmpw $-0x1, %ax
notl %eax
movzbl %dl, %edx
movl $0x5, %esi
cmovnel %edx, %esi
orb %cl, %sil
movb %sil, 0x30(%rbx)
movzwl %ax, %esi
jmp 0x20db
movl %r13d, %r15d
movq %rbx, %rdi
movl $0x9, %esi
movl %r8d, %edx
movl 0xc(%rsp), %r14d
movl %r14d, %ecx
movl $0x1, %r8d
callq 0x3056
xorl %r13d, %r13d
testl %eax, %eax
jne 0x2df8
movzbl 0x30(%rbx), %ecx
movl %ecx, %eax
andl $0x1, %eax
andb $-0x4, %cl
movzwl 0x12(%rbx), %edx
leal (%rdx,%rdx), %esi
andl %ebp, %esi
orl %eax, %esi
movw %dx, 0x10(%rbx)
movl %edx, %eax
shrl $0xf, %eax
orb %cl, %al
movb %al, 0x30(%rbx)
testw %r15w, %r15w
jns 0x25e9
movzbl %sil, %edi
callq 0x1424
movzwl %ax, %esi
movb 0x30(%rbx), %al
movb 0xb(%rsp), %r15b
movl %eax, %ecx
shrb $0x3, %cl
xorb %al, %cl
addb %cl, %cl
andb $0x2, %cl
andb $-0xd, %al
orb %cl, %al
leal 0x8(%rax), %ecx
testw %si, %si
movzbl %al, %eax
movzbl %cl, %ecx
cmovnsl %eax, %ecx
orb $0x4, %al
testl %esi, %esi
movzbl %al, %eax
cmovnel %ecx, %eax
movb %al, 0x30(%rbx)
movq %rbx, %rdi
movl %r14d, %edx
jmp 0x29b9
movl %r13d, %r15d
movq %rbx, %rdi
movl $0x9, %esi
movl %r8d, %edx
movl 0xc(%rsp), %ebp
movl %ebp, %ecx
movl $0x1, %r8d
callq 0x3056
xorl %r13d, %r13d
testl %eax, %eax
jne 0x2df8
movzwl 0x12(%rbx), %eax
andb $-0x3, 0x30(%rbx)
leal 0x1(%rax), %r14d
movw %ax, 0x10(%rbx)
testw %r15w, %r15w
jns 0x2675
movzbl %r14b, %edi
callq 0x1424
movl %eax, %r14d
movzwl 0x10(%rbx), %eax
movb 0xb(%rsp), %r15b
notl %eax
andl %r14d, %eax
movzwl %ax, %edi
jmp 0x26fc
movl %r13d, %r15d
movq %rbx, %rdi
movl $0x9, %esi
movl %r8d, %edx
movl 0xc(%rsp), %ebp
movl %ebp, %ecx
movl $0x1, %r8d
callq 0x3056
xorl %r13d, %r13d
testl %eax, %eax
jne 0x2df8
movzwl 0x12(%rbx), %eax
movzbl 0x30(%rbx), %ecx
movl %ecx, %edx
andl $0x1, %edx
testw %ax, %ax
sete %sil
orb $-0x4, %sil
movl %eax, %r14d
subl %edx, %r14d
andb %cl, %sil
movw %ax, 0x10(%rbx)
movb %sil, 0x30(%rbx)
testw %r15w, %r15w
jns 0x26ed
movzbl %r14b, %edi
callq 0x1424
movl %eax, %r14d
movzwl 0x10(%rbx), %eax
movb 0xb(%rsp), %r15b
movl %r14d, %ecx
notl %ecx
andl %ecx, %eax
movzwl %ax, %edi
callq 0x141e
movl 0x30(%rbx), %ecx
movl %ecx, %edx
orb $0x2, %dl
testw %ax, %ax
movzbl %dl, %eax
cmovel %ecx, %eax
andb $-0xd, %al
movzbl %al, %ecx
orb $0x8, %al
movzbl %al, %eax
leal 0x4(%rcx), %edx
testw %r14w, %r14w
cmovnsl %ecx, %eax
movzbl %dl, %ecx
cmovnel %eax, %ecx
movb %cl, 0x30(%rbx)
jmp 0x27cf
movl %r13d, %r15d
movq %rbx, %rdi
movl $0x9, %esi
movl %r8d, %edx
movl 0xc(%rsp), %ebp
movl %ebp, %ecx
movl $0x1, %r8d
callq 0x3056
xorl %r13d, %r13d
testl %eax, %eax
jne 0x2df8
movzwl 0x12(%rbx), %r14d
andb $-0x4, 0x30(%rbx)
movw %r14w, 0x10(%rbx)
negl %r14d
testw %r15w, %r15w
jns 0x2781
movzbl %r14b, %edi
callq 0x1424
movl %eax, %r14d
movb 0xb(%rsp), %r15b
testw %r14w, %r14w
je 0x2790
orb $0x1, 0x30(%rbx)
movzwl 0x10(%rbx), %eax
andw %r14w, %ax
movzwl %ax, %edi
callq 0x141e
movl 0x30(%rbx), %ecx
movl %ecx, %edx
orb $0x2, %dl
testw %ax, %ax
movzbl %dl, %eax
cmovel %ecx, %eax
andb $-0xd, %al
leal 0x8(%rax), %ecx
leal 0x4(%rax), %edx
testw %r14w, %r14w
movzbl %al, %eax
movzbl %cl, %ecx
cmovnsl %eax, %ecx
movzbl %dl, %eax
cmovnel %ecx, %eax
movb %al, 0x30(%rbx)
movzwl %r14w, %esi
jmp 0x29b4
movzwl %ax, %eax
addl %eax, %eax
movl %ecx, %edx
andl $0x8f00, %edx           # imm = 0x8F00
xorl %r13d, %r13d
cmpl $0x7fff, %edx           # imm = 0x7FFF
jle 0x283d
cmpl $0x85ff, %edx           # imm = 0x85FF
jg 0x28fa
cmpl $0x82ff, %edx           # imm = 0x82FF
jg 0x29d1
cmpl $0x8000, %edx           # imm = 0x8000
je 0x2b74
cmpl $0x8100, %edx           # imm = 0x8100
je 0x2b39
cmpl $0x8200, %edx           # imm = 0x8200
jne 0x2be6
movzbl 0x30(%rbx), %ecx
andl $0xf, %ecx
movl $0x505, %edx            # imm = 0x505
jmp 0x2bcf
cmpl $0x5ff, %edx            # imm = 0x5FF
jle 0x2933
cmpl $0x8ff, %edx            # imm = 0x8FF
jg 0x2a2f
cmpl $0x600, %edx            # imm = 0x600
je 0x2bc3
cmpl $0x700, %edx            # imm = 0x700
je 0x2bb5
cmpl $0x800, %edx            # imm = 0x800
je 0x2a7d
jmp 0x2be6
movzwl 0x12(%rbx), %eax
movb 0x30(%rbx), %cl
movl %ecx, %edx
andb $-0x4, %dl
andl %eax, %ebp
shrl %ebp
movl %r13d, %esi
xorl %r13d, %r13d
testb $0x1, %cl
cmovel %r13d, %r15d
orl %ebp, %r15d
movw %ax, 0x10(%rbx)
andb $0x1, %al
orb %dl, %al
movb %al, 0x30(%rbx)
testw %si, %si
jns 0x28be
movzbl %r15b, %edi
callq 0x1424
movzwl %ax, %r15d
movb 0x30(%rbx), %al
movl %eax, %ecx
shrb $0x3, %cl
xorb %al, %cl
addb %cl, %cl
andb $0x2, %cl
andb $-0xd, %al
orb %cl, %al
leal 0x8(%rax), %ecx
testw %r15w, %r15w
movzbl %al, %eax
movzbl %cl, %ecx
cmovnsl %eax, %ecx
orb $0x4, %al
testl %r15d, %r15d
movzbl %al, %eax
cmovnel %ecx, %eax
movb %al, 0x30(%rbx)
movq %rbx, %rdi
movl %r15d, %esi
movl %r14d, %edx
jmp 0x20e0
cmpl $0x88ff, %edx           # imm = 0x88FF
jg 0x2a06
cmpl $0x8600, %edx           # imm = 0x8600
je 0x2b90
cmpl $0x8700, %edx           # imm = 0x8700
je 0x2b4a
movw $0x18, %ax
cmpl $0x8800, %edx           # imm = 0x8800
je 0x2e32
jmp 0x2be6
cmpl $0x2ff, %edx            # imm = 0x2FF
jle 0x2a54
cmpl $0x300, %edx            # imm = 0x300
je 0x2b28
cmpl $0x400, %edx            # imm = 0x400
je 0x2b17
cmpl $0x500, %edx            # imm = 0x500
jne 0x2be6
movzbl 0x30(%rbx), %ecx
andl $0xf, %ecx
movl $0x33cc, %edx           # imm = 0x33CC
jmp 0x2bcf
movzbl %dl, %edi
callq 0x1424
movb 0x30(%rbx), %cl
movb 0xb(%rsp), %r15b
movl %ecx, %edx
shrb $0x3, %dl
xorb %cl, %dl
addb %dl, %dl
andb $0x2, %dl
andb $-0xd, %cl
orb %dl, %cl
movzbl %cl, %edx
orb $0x8, %cl
movzbl %cl, %ecx
leal 0x4(%rdx), %esi
testw %ax, %ax
cmovnsl %edx, %ecx
movzbl %sil, %edx
cmovnel %ecx, %edx
movb %dl, 0x30(%rbx)
movzwl %ax, %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x322e
testl %eax, %eax
jne 0x2df8
movb 0x30(%rbx), %cl
xorl %r13d, %r13d
jmp 0x2f1d
cmpl $0x8300, %edx           # imm = 0x8300
je 0x2b9e
cmpl $0x8400, %edx           # imm = 0x8400
je 0x2b58
cmpl $0x8500, %edx           # imm = 0x8500
jne 0x2be6
movzbl 0x30(%rbx), %ecx
andl $0xf, %ecx
movl $0xcccc, %edx           # imm = 0xCCCC
jmp 0x2bcf
cmpl $0x8900, %edx           # imm = 0x8900
je 0x2bac
cmpl $0x8e00, %edx           # imm = 0x8E00
je 0x2264
cmpl $0x8f00, %edx           # imm = 0x8F00
je 0x2264
jmp 0x2be6
cmpl $0x900, %edx            # imm = 0x900
je 0x2a7d
cmpl $0xe00, %edx            # imm = 0xE00
je 0x2264
cmpl $0xf00, %edx            # imm = 0xF00
je 0x2264
jmp 0x2be6
cmpl $0x100, %edx            # imm = 0x100
je 0x2b66
cmpl $0x200, %edx            # imm = 0x200
jne 0x2be6
movzbl 0x30(%rbx), %ecx
andl $0xf, %ecx
movl $0xf0f, %edx            # imm = 0xF0F
jmp 0x2bcf
testl %r14d, %r14d
je 0x2e2e
xorl %r13d, %r13d
movq %rbx, %rdi
movl %r8d, %esi
xorl %edx, %edx
callq 0x30a2
testl %eax, %eax
jne 0x2df8
xorl %r13d, %r13d
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1a23
testl %eax, %eax
jne 0x2df8
andl $0x7, %r12d
movzwl 0x20(%rbx), %eax
movw %ax, 0x12(%rbx)
movl 0xc(%rbx), %eax
addl $-0x2, %eax
movw %ax, 0xc(%rbx)
movzwl %ax, %ecx
cmpl $0xff, %ecx
ja 0x2ada
orb $0x1, 0x34(%rbx)
movw %ax, 0x22(%rbx)
movzwl (%rbx,%r12,2), %eax
movq 0x28(%rbx), %rcx
movw %ax, 0xc(%rcx)
xorl %r13d, %r13d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1b9b
testl %eax, %eax
movb 0xb(%rsp), %r15b
jne 0x2df8
movzwl 0xe(%rbx), %eax
movw %ax, (%rbx,%r12,2)
movzwl 0x12(%rbx), %eax
jmp 0x2cf0
movzbl 0x30(%rbx), %ecx
andl $0xf, %ecx
movl $0xcc33, %edx           # imm = 0xCC33
jmp 0x2bcf
movzbl 0x30(%rbx), %ecx
andl $0xf, %ecx
movl $0xf0f0, %edx           # imm = 0xF0F0
jmp 0x2bcf
movzbl 0x30(%rbx), %ecx
andl $0xf, %ecx
movl $0xff00, %edx           # imm = 0xFF00
jmp 0x2bcf
movzbl 0x30(%rbx), %ecx
andl $0xf, %ecx
movl $0xaaaa, %edx           # imm = 0xAAAA
jmp 0x2bcf
movzbl 0x30(%rbx), %ecx
andl $0xf, %ecx
movl $0x3333, %edx           # imm = 0x3333
jmp 0x2bcf
addw %ax, 0xe(%rbx)
movb 0xb(%rsp), %r15b
jmp 0x29c6
movb 0x30(%rbx), %cl
andb $0xf, %cl
movl $0x1, %edx
shll %cl, %edx
testb %dl, %dl
movb 0xb(%rsp), %r15b
je 0x29c6
jmp 0x2bdd
movzbl 0x30(%rbx), %ecx
andl $0xf, %ecx
movl $0x5555, %edx           # imm = 0x5555
jmp 0x2bcf
movzbl 0x30(%rbx), %ecx
andl $0xf, %ecx
movl $0xfafa, %edx           # imm = 0xFAFA
jmp 0x2bcf
movw $0x1c, %ax
jmp 0x2e32
movzbl 0x30(%rbx), %ecx
andl $0xf, %ecx
movl $0xf3fc, %edx           # imm = 0xF3FC
jmp 0x2bcf
movzbl 0x30(%rbx), %ecx
andl $0xf, %ecx
movl $0xc03, %edx            # imm = 0xC03
btl %ecx, %edx
movb 0xb(%rsp), %r15b
jae 0x29c6
addw %ax, 0xe(%rbx)
jmp 0x29c6
cmpl $0x100, %ecx            # imm = 0x100
jae 0x2dd9
movl %r12d, %eax
leaq 0x2590(%rip), %rdx      # 0x518c
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
cmpl $0x5, %r9d
ja 0x2264
movl %r9d, %eax
leaq 0x2583(%rip), %rcx      # 0x519c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x2, 0x3c(%rbx)
jmp 0x2b6a
movl %r14d, %eax
leaq 0x257c(%rip), %rdx      # 0x51b4
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
notb %cl
orb $-0x10, %cl
andb 0x30(%rbx), %cl
jmp 0x2cff
movq %rbx, %rdi
movl $0x9, %esi
movl %r8d, %edx
movl 0xc(%rsp), %ecx
movl $0x1, %r8d
callq 0x3056
xorl %r13d, %r13d
testl %eax, %eax
jne 0x2df8
movb 0x30(%rbx), %al
movzwl 0x12(%rbx), %ecx
movl %ecx, %edx
rolw $0x8, %dx
andb $-0x10, %al
leal 0x8(%rax), %esi
testw %dx, %dx
movzbl %al, %eax
movzbl %sil, %esi
cmovnsl %eax, %esi
orb $0x4, %al
testw %cx, %cx
movzbl %al, %eax
cmovnel %esi, %eax
movb %al, 0x30(%rbx)
movzwl %dx, %esi
movq %rbx, %rdi
movl 0xc(%rsp), %edx
jmp 0x20e0
testl %r14d, %r14d
je 0x2e2e
xorl %r13d, %r13d
movq %rbx, %rdi
movl %r8d, %esi
xorl %edx, %edx
callq 0x30a2
testl %eax, %eax
movb 0xb(%rsp), %r15b
jne 0x2df8
xorl %r13d, %r13d
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1a23
testl %eax, %eax
jne 0x2df8
movzwl 0x20(%rbx), %eax
movw %ax, 0xe(%rbx)
jmp 0x29c6
andb $0xf, %cl
orb 0x30(%rbx), %cl
movb %cl, 0x30(%rbx)
xorl %r13d, %r13d
movb 0xb(%rsp), %r15b
jmp 0x2f1d
movl 0xc(%rbx), %eax
movw %ax, 0x22(%rbx)
addl $0x2, %eax
movw %ax, 0xc(%rbx)
xorl %r13d, %r13d
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1a23
testl %eax, %eax
movb 0xb(%rsp), %r15b
jne 0x2df8
movq 0x28(%rbx), %rax
movzwl 0xc(%rax), %eax
movw %ax, 0xe(%rbx)
movl 0xc(%rbx), %eax
movw %ax, 0x22(%rbx)
addl $0x2, %eax
movw %ax, 0xc(%rbx)
xorl %r13d, %r13d
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1a23
testl %eax, %eax
jne 0x2df8
movq 0x28(%rbx), %rax
movb 0xc(%rax), %cl
jmp 0x2063
movw $0xc, %ax
jmp 0x2e32
movw $0x10, %ax
jmp 0x2e32
movq %rbx, %rdi
callq 0x19d0
jmp 0x2b6a
movl 0xc(%rbx), %eax
movw %ax, 0x22(%rbx)
addl $0x2, %eax
movw %ax, 0xc(%rbx)
movl %r9d, %r14d
movzwl (%rbx,%r14,2), %eax
movw %ax, 0xe(%rbx)
xorl %r13d, %r13d
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1a23
testl %eax, %eax
movb 0xb(%rsp), %r15b
jne 0x2df8
movq 0x28(%rbx), %rax
movzwl 0xc(%rax), %eax
movw %ax, (%rbx,%r14,2)
jmp 0x29c6
leaq 0x24ad(%rip), %rdi      # 0x528d
leaq 0x24bf(%rip), %rsi      # 0x52a6
leaq 0x24c0(%rip), %rcx      # 0x52ae
movl $0x24e, %edx            # imm = 0x24E
callq 0x10d0
cmpl $0x2, 0x38(%rbx)
jge 0x2e0c
leaq 0x24db(%rip), %rdi      # 0x52e0
callq 0x1040
jmp 0x2e2e
leaq 0x24d7(%rip), %rdi      # 0x52ea
callq 0x1040
movl $0x0, 0x3c(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movw $0x4, %ax
movw %ax, 0x14(%rbx)
movzwl 0xc(%rbx), %eax
addl $-0x2, %eax
movw %ax, 0xc(%rbx)
testl %r13d, %r13d
sete %cl
movzwl %ax, %edx
cmpl $0x100, %edx            # imm = 0x100
setb %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x2e5e
orb $0x1, 0x34(%rbx)
movw %ax, 0x22(%rbx)
movzbl 0x30(%rbx), %eax
movq 0x28(%rbx), %rcx
movw %ax, 0xc(%rcx)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1b9b
testl %eax, %eax
jne 0x2df8
testl %r13d, %r13d
sete %cl
movzwl 0xc(%rbx), %eax
addl $-0x2, %eax
movw %ax, 0xc(%rbx)
movzwl %ax, %edx
cmpl $0x100, %edx            # imm = 0x100
setb %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x2ea8
orb $0x1, 0x34(%rbx)
movw %ax, 0x22(%rbx)
movzwl 0xe(%rbx), %eax
movq 0x28(%rbx), %rcx
movw %ax, 0xc(%rcx)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1b9b
testl %eax, %eax
jne 0x2df8
movzwl 0x14(%rbx), %eax
movw %ax, 0x22(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1a23
testl %eax, %eax
jne 0x2df8
movq 0x28(%rbx), %rax
movzwl 0xc(%rax), %eax
movw %ax, 0xe(%rbx)
movl 0x14(%rbx), %eax
addl $0x2, %eax
movw %ax, 0x22(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1a23
testl %eax, %eax
jne 0x2df8
movq 0x28(%rbx), %rax
movb 0xc(%rax), %cl
movb %cl, 0x30(%rbx)
movl %ecx, %r15d
movw $0xc, %ax
testb $0x10, %r15b
jne 0x2e32
movl 0x34(%rbx), %eax
testb $0x1, %al
jne 0x2fba
testb $0x2, %al
jne 0x2fcb
cmpb $-0x20, %cl
setae %dl
testb $0x4, %al
sete %sil
orb %dl, %sil
je 0x2fda
cmpb $-0x41, %cl
ja 0x2e1f
testb $0x8, %al
jne 0x2fec
testb $0x10, %al
jne 0x2ffe
cmpb $-0x61, %cl
ja 0x2e1f
testb $0x20, %al
jne 0x3017
testb %cl, %cl
js 0x2e1f
testb $0x40, %al
jne 0x3029
testb %al, %al
js 0x303b
btl $0x8, %eax
jae 0x2e1f
andl $0xfffffe04, %eax       # imm = 0xFFFFFE04
movl %eax, 0x34(%rbx)
movl $0x0, 0xb0(%rbx)
movw $0x34, %ax
jmp 0x2e32
andl $-0x2, %eax
movl %eax, 0x34(%rbx)
movl $0x1, %r13d
jmp 0x2e2e
andl $-0x4, %eax
movl %eax, 0x34(%rbx)
movw $0x14, %ax
jmp 0x2e32
andl $-0x8, %eax
movl %eax, 0x34(%rbx)
movq 0x78(%rbx), %rdi
callq *0x70(%rbx)
jmp 0x2e32
andl $-0xc, %eax
movl %eax, 0x34(%rbx)
movq 0x68(%rbx), %rdi
callq *0x60(%rbx)
jmp 0x2e32
andl $-0x1c, %eax
movl %eax, 0x34(%rbx)
movl $0x0, 0x8c(%rbx)
movw $0x40, %ax
jmp 0x2e32
andl $-0x3c, %eax
movl %eax, 0x34(%rbx)
movq 0x58(%rbx), %rdi
callq *0x50(%rbx)
jmp 0x2e32
andl $-0x7c, %eax
movl %eax, 0x34(%rbx)
movq 0x48(%rbx), %rdi
callq *0x40(%rbx)
jmp 0x2e32
andl $0xffffff04, %eax       # imm = 0xFFFFFF04
movl %eax, 0x34(%rbx)
movl $0x0, 0x9c(%rbx)
movw $0x30, %ax
jmp 0x2e32