// File: /workspace/github_c_makefile_star2_O3/calmopyrin[P]tedplay/Tedmem.cpp
// Function: TED::ted_process(short*, unsigned int)
void TED::ted_process(short *buffer, unsigned int count)
{
    do {
        switch(++beamx) {

            default:
                break;

            case 2:
                if (VertSubActive)
                	VertSubCount = (VertSubCount+1)&7;
                break;

            case 3:
				if (AttribFetch && beamy==0) {
					VertSubCount = 7;
				}
				break;

             case 4:
                 if (AttribFetch) {
					BadLine |= ((vshift)&7) == (beamy&7);
					if ( BadLine ) {
						ClockingState = THALT1;
					} else
                 		ClockingState = TSS;
                 	if (beamy==203) {
						AttribFetch = false;
						if (!(BadLine & 2)) ClockingState = TSS;
					}
				}
                break;

            case 8:
				HBlanking = false;
				break;

            case 10:
				if (VertSubActive)
					CharacterPosition = CharacterPositionReload;
                break;

            case 16:
				if (ScreenOn) {
					SideBorderFlipFlop = true;
					memset( scrptr, mcol[0], hshift);
					if (nrwscr)
						CharacterWindow = true;
					x = 0;
				}
				if (BadLine & 1)
					DoDMA(tmpClrbuf, 0);
				if (BadLine & 2)
					DoDMA(chrbuf, (BadLine & 1) ? 0 : 0x400);
                break;

			case 18:
				if (ScreenOn && !nrwscr) {
					CharacterWindow = true;
				}
				break;

			case 89:
				if (/*VertSubActive &&*/ VertSubCount == 6)
					CharacterCount = (CharacterCount + 40)&0x3FF;
				break;

            case 90:
    			if ( VertSubActive && VertSubCount == 7 )
					CharacterPositionReload = (CharacterPosition + 40)&0x3FF;
				break;

            case 91:
		    	ClockingState = TRFSH;
		    	break;

			case 94:
				if (ScreenOn && !nrwscr)
  					SideBorderFlipFlop = CharacterWindow = false;
				break;

  			case 96:
				if (ScreenOn && nrwscr)
  					SideBorderFlipFlop = CharacterWindow = false;
				// FIXME this breaks on FF1E writes
				if (BadLine & 1) {
					// swap DMA fetch pointers for colour DMA...
					unsigned char *tmpbuf = clrbuf;
					clrbuf = tmpClrbuf;
					tmpClrbuf = tmpbuf;
				}
  			    break;

			case 111:
				if ((BadLine&1)) {
    			    BadLine = 2;
					VertSubActive = true;
				} else if (BadLine&2) {// in the second bad line, we're finished...
   					BadLine &= ~2;
				}
				break;

            case 102:
		    	ClockingState = fastmode ? TDS : TSS;
		    	break;

		    case 104:
				HBlanking = true;
				break;

		    case 107: // HSYNC start
				break;

			case 256:
			case 128:
				beamx = 15;
				break;
			case 114: // HSYNC end
    			beamx=0;
    			// the beam reached a new line
    			TVScanLineCounter += 1;
    			if ( TVScanLineCounter >= 340 ) {
					TVScanLineCounter = 0;
					scrptr=screen;
//					render_ok=true;
				}
    			switch (++beamy) {

    			    case 4:
    			        if (!fltscr) ScreenOn = AttribFetch;
    			        break;

    			    case 8:
						if (fltscr) ScreenOn = AttribFetch;
    			        break;

					case 200:
						if (fltscr) ScreenOn = false;
						break;

    			    case 204:
						if (!fltscr) ScreenOn = false;
						break;

    			    case 205:
						CharacterCount = 0;
					    // cursor phase counter in TED register $1F
						VertSubActive = false;
						if ((++crsrphase&0x0F) == 0x0F)
    			        	crsrblinkon ^= 1;
    			        break;

					case 251:
						VBlanking = true;
						break;

    			    case 261: // Vertical retrace
						// frame ready...
						//render_ok=true;
						// reset screen pointer ("TV" electron beam)
						scrptr=screen;
						TVScanLineCounter = 0;
						break;

					case 271:
						VBlanking = false;
						break;

					case 512:
					case 312:
					    beamy = 0;
					    CharacterPosition = CharacterPositionReload = 0;
					    AttribFetch = (Ram[0xFF06]&0x10) != 0;
				}
				// is there raster interrupt?
				if (beamy == irqline)
					Ram[0xFF09] |= Ram[0xFF0A]&0x02 ? 0x82 : 0x02;
		}

		if (beamx&1) {	// perform these only in every second cycle
			if (t2on && !((timer2--)&0xFFFF)) {// Timer2 permitted
				timer2=0xFFFF;
				Ram[0xFF09] |= Ram[0xFF0A]&0x10 ? 0x90 : 0x10; // interrupt
			}
			if (t3on && !((timer3--)&0xFFFF)) {// Timer3 permitted
				timer3=0xFFFF;
				Ram[0xFF09] |= Ram[0xFF0A]&0x40 ? 0xC0 : 0x40; // interrupt
			}
			if (!CharacterWindow && !HBlanking && !VBlanking) {
				// we are on the border area, so use the frame color
				*((int*)(scrptr+4)) = framecol;
			}
			if (scrptr != endptr)
				scrptr+=8;
		} else {
			if (t1on && !timer1--) { // Timer1 permitted decreased and zero
				timer1=(t1start-1)&0xFFFF;
				Ram[0xFF09] |= Ram[0xFF0A]&0x08 ? 0x88 : 0x08; // interrupt
			}

			if (!(HBlanking |VBlanking)) {
				if (SideBorderFlipFlop) { // drawing the visible part of the screen
					// call the relevant rendering function
					//switch (scrattr) {
					//	case 0:
					//		hi_text();
					//		break;
					//	case REVERSE :
					//		rv_text();
					//		break;
					//	case MULTICOLOR|REVERSE :
					//	    mc_text_rvs();
					//	    break;
					//	case MULTICOLOR :
					//		mc_text();
					//		break;
					//	case EXTCOLOR|REVERSE :
					//	case EXTCOLOR :
					//		ec_text();
					//		break;
					//	case GRAPHMODE|REVERSE :
					//	case GRAPHMODE :
					//		hi_bitmap();
					//		break;
					//	case EXTCOLOR|MULTICOLOR :
					//	case GRAPHMODE|EXTCOLOR :
					//	case GRAPHMODE|MULTICOLOR|EXTCOLOR :
					//	case REVERSE|MULTICOLOR|EXTCOLOR :
					//	case GRAPHMODE|MULTICOLOR|EXTCOLOR|REVERSE :
					//		mcec();
					//		break;
					//	case GRAPHMODE|MULTICOLOR :
					//	case GRAPHMODE|MULTICOLOR|REVERSE :
					//		mc_bitmap();
					//		break;
					//	default:
				 //   		illegalbank();
				 //   		break;
					//}
					x = (x + 1) & 0x3F;
				}
				if (!CharacterWindow) {
					// we are on the border area, so use the frame color
					*((int*)scrptr) = framecol;
				}
			}

			CycleCounter++;
			if (!(CycleCounter & 0x03) && buffer && int(count) > 0) {
				static unsigned int remainder = 0;
				unsigned int samples = (playbackSpeed + remainder) / 4;
				if (samples) {
					renderSound(samples, buffer);
					if (sidCard) {
						short imBuf[128];
						sidCard->calcSamples(imBuf, samples);
						unsigned int i = samples - 1;
						do {
							buffer[i] += (short)(int(imBuf[i]) * int(masterVolume) / 1000);
						}while (i--);
					}
					storeToBuffer(buffer, samples);
				}
				remainder = (playbackSpeed + remainder) % 4;
				count -= samples;
				buffer += samples;
			}
		}
		if (aligned_write) {
			*aw_addr_ptr = aw_value;
			aligned_write = false;
		}
		switch (ClockingState|(beamx&1)) {
        	case TRFSH|1:
 	    	case TSS|1:
 	    	case TDS|1:
       		case TDS:
     	    	cpuptr->process();
     	    	break;
      		case THALT1|1:
  	    	case THALT2|1:
        	case THALT3|1:
            	cpuptr->stopcycle();
            	ClockingState<<=1;
            	break;
		}

	} while (int(count) > 0 && buffer);

	render_ok = false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x824(%rdi), %rax
movq %rax, 0x8(%rsp)
movl $0x47, %r13d
movl 0x81c(%r14), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x81c(%r14)
cmpl $0x57, %eax
jle 0xb40c
cmpl $0x6d, %eax
jg 0xb44a
addl $-0x58, %eax
cmpl $0xf, %eax
ja 0xb9e2
leaq 0x53ab(%rip), %rcx      # 0x10788
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x6, 0x1b09b(%rip)     # 0x26488
jne 0xb9e2
movl 0x1b0bb(%rip), %eax     # 0x264b4
addl $0x28, %eax
andl $0x3ff, %eax            # imm = 0x3FF
movl %eax, 0x1b0ad(%rip)     # 0x264b4
jmp 0xb9e2
decl %eax
cmpl $0x10, %eax
ja 0xb9e2
leaq 0x5326(%rip), %rcx      # 0x10744
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpb $0x1, 0x1b06a(%rip)     # 0x26498
jne 0xb9e2
movl 0x1b04e(%rip), %eax     # 0x26488
incl %eax
andl $0x7, %eax
movl %eax, 0x1b043(%rip)     # 0x26488
jmp 0xb9e2
cmpl $0x7e, %eax
jg 0xb526
cmpl $0x6e, %eax
je 0xb7c8
cmpl $0x71, %eax
jne 0xb9e2
movl $0x0, 0x81c(%r14)
movl 0x1b05a(%rip), %eax     # 0x264d0
incl %eax
movl %eax, 0x1b052(%rip)     # 0x264d0
cmpl $0x154, %eax            # imm = 0x154
jb 0xb49b
movl $0x0, 0x1b041(%rip)     # 0x264d0
movq 0x8(%rsp), %rax
movq %rax, 0xb6160(%r14)
movl 0x820(%r14), %ecx
leal 0x1(%rcx), %eax
movl %eax, 0x820(%r14)
cmpl $0xf9, %ecx
jg 0xb7fe
cmpl $0xc6, %ecx
jle 0xb90e
cmpl $0xc7, %ecx
je 0xb988
cmpl $0xcb, %ecx
je 0xb9a7
cmpl $0xcc, %ecx
jne 0xb9bd
movl $0x0, 0x1afc2(%rip)     # 0x264b4
movb $0x0, 0x1af9f(%rip)     # 0x26498
movl 0x45fac(%r14), %ecx
incl %ecx
movl %ecx, 0x45fac(%r14)
notl %ecx
movl $0xcd, %eax
testb $0xf, %cl
jne 0xb9bd
xorb $0x1, 0x45fb0(%r14)
jmp 0xb9bd
cmpl $0x7f, %eax
je 0xb536
cmpl $0xff, %eax
jne 0xb9e2
movl $0xf, 0x81c(%r14)
jmp 0xb9e2
cmpb $0x1, 0x1af5f(%rip)     # 0x264ac
jne 0xb9e2
cmpl $0x0, 0x820(%r14)
jne 0xb9e2
movl $0x7, 0x1af1d(%rip)     # 0x26488
jmp 0xb9e2
cmpb $0x1, 0x1af35(%rip)     # 0x264ac
jne 0xb9e2
movl 0x820(%r14), %ecx
movl 0xb6020(%r14), %eax
xorl %ecx, %eax
xorl %edx, %edx
testb $0x7, %al
sete %dl
movl 0x1af0e(%rip), %eax     # 0x264a8
orl %eax, %edx
movl %edx, 0x1af06(%rip)     # 0x264a8
movl $0x10, %edx
movl $0x2, %esi
cmovel %esi, %edx
movl %edx, 0x1aefb(%rip)     # 0x264b0
cmpl $0xcb, %ecx
jne 0xb9e2
movb $0x0, 0x1aee4(%rip)     # 0x264ac
testb $0x2, %al
jne 0xb9e2
movl $0x2, 0x1aed6(%rip)     # 0x264b0
jmp 0xb9e2
cmpb $0x1, 0x1aeb2(%rip)     # 0x26498
jne 0xb9e2
movl 0x1aeae(%rip), %eax     # 0x264a0
movl %eax, 0x1aea4(%rip)     # 0x2649c
jmp 0xb9e2
movb $0x0, 0x1aec5(%rip)     # 0x264c9
jmp 0xb9e2
cmpb $0x1, 0x1aeba(%rip)     # 0x264ca
jne 0xb64f
movb $0x1, 0x1ae8b(%rip)     # 0x264a4
movq 0xb6160(%r14), %rdi
movl 0xb601c(%r14), %edx
movzbl 0xb618a(%r14), %esi
callq 0x3130
cmpl $0x0, 0xb6024(%r14)
je 0xb645
movb $0x1, 0x1ae86(%rip)     # 0x264cb
movl $0x0, 0x1ae7d(%rip)     # 0x264cc
movl 0x1ae52(%rip), %r12d    # 0x264a8
testb $0x1, %r12b
je 0xb878
movq 0xb6100(%r14), %r13
movl 0x1ae47(%rip), %ebp     # 0x264b4
movq 0x1ae1c(%rip), %rax     # 0x26490
leaq (%rax,%rbp), %rsi
cmpq $0x3d8, %rbp            # imm = 0x3D8
jb 0xb857
movl $0x400, %edx            # imm = 0x400
subl %ebp, %edx
movq %r13, %rdi
movq %rax, (%rsp)
callq 0x31b0
subq %rbp, %r13
addq $0x400, %r13            # imm = 0x400
leal 0x28(%rbp), %edx
andl $0x3ff, %edx            # imm = 0x3FF
movq %r13, %rdi
movq (%rsp), %rsi
callq 0x31b0
jmp 0xb872
cmpb $0x1, 0x1ae07(%rip)     # 0x264ca
jne 0xb9e2
cmpl $0x0, 0xb6024(%r14)
jne 0xb9e2
movb $0x1, 0x1aded(%rip)     # 0x264cb
jmp 0xb9e2
cmpb $0x1, 0x1ade0(%rip)     # 0x264ca
jne 0xb704
cmpl $0x0, 0xb6024(%r14)
je 0xb704
xorl %eax, %eax
movb %al, 0x1adcd(%rip)      # 0x264cb
movb %al, 0x1ada0(%rip)      # 0x264a4
testb $0x1, 0x1ad9d(%rip)     # 0x264a8
je 0xb9e2
movdqu 0xb60f8(%r14), %xmm0
pshufd $0x4e, %xmm0, %xmm0     # xmm0 = xmm0[2,3,0,1]
movdqu %xmm0, 0xb60f8(%r14)
jmp 0xb9e2
movl $0x8, 0x1ad79(%rip)     # 0x264b0
jmp 0xb9e2
cmpb $0x1, 0x1ad55(%rip)     # 0x26498
jne 0xb9e2
cmpl $0x7, 0x1ad38(%rip)     # 0x26488
jne 0xb9e2
movl 0x1ad40(%rip), %eax     # 0x2649c
addl $0x28, %eax
andl $0x3ff, %eax            # imm = 0x3FF
movl %eax, 0x1ad36(%rip)     # 0x264a0
jmp 0xb9e2
cmpb $0x1, 0x1ad54(%rip)     # 0x264ca
jne 0xb9e2
cmpl $0x0, 0xb6024(%r14)
jne 0xb9e2
xorl %eax, %eax
movb %al, 0x1ad39(%rip)      # 0x264cb
movb %al, 0x1ad0c(%rip)      # 0x264a4
jmp 0xb9e2
movb $0x1, 0x1ad25(%rip)     # 0x264c9
jmp 0xb9e2
xorl %eax, %eax
cmpl $0x0, 0xb6180(%r14)
setne %al
leal 0x2(,%rax,2), %eax
movl %eax, 0x1aced(%rip)     # 0x264b0
jmp 0xb9e2
movl 0x1acda(%rip), %eax     # 0x264a8
testb $0x1, %al
jne 0xb7e8
testb $0x2, %al
je 0xb9e2
andl $-0x4, %eax
movl %eax, 0x1acc5(%rip)     # 0x264a8
jmp 0xb9e2
movl $0x2, 0x1acb6(%rip)     # 0x264a8
movb $0x1, 0x1ac9f(%rip)     # 0x26498
jmp 0xb9e2
cmpl $0x10d, %ecx            # imm = 0x10D
jle 0xb930
cmpl $0x10e, %ecx            # imm = 0x10E
je 0xb999
cmpl $0x137, %ecx            # imm = 0x137
je 0xb82a
cmpl $0x1ff, %ecx            # imm = 0x1FF
jne 0xb9bd
xorl %eax, %eax
movl %eax, 0x820(%r14)
movl %eax, 0x1ac67(%rip)     # 0x264a0
movl %eax, 0x1ac5d(%rip)     # 0x2649c
movb 0x55ec6(%r14), %cl
shrb $0x4, %cl
andb $0x1, %cl
movb %cl, 0x1ac5a(%rip)      # 0x264ac
jmp 0xb9bd
movq 0x20(%rsi), %rax
movq %rax, 0x20(%r13)
movdqu (%rsi), %xmm0
movups 0x10(%rsi), %xmm1
movups %xmm1, 0x10(%r13)
movdqu %xmm0, (%r13)
movl $0x47, %r13d
testb $0x2, %r12b
je 0xb9e2
movq 0xb60f0(%r14), %r13
notl %r12d
andl $0x1, %r12d
shll $0xa, %r12d
movl 0x1ac1a(%rip), %ebp     # 0x264b4
movq 0x1abef(%rip), %rax     # 0x26490
leaq (%rax,%rbp), %rsi
addq %r12, %rsi
cmpq $0x3d8, %rbp            # imm = 0x3D8
jb 0xb8e8
movl $0x400, %edx            # imm = 0x400
subl %ebp, %edx
movq %r13, %rdi
movq %rax, (%rsp)
callq 0x31b0
subq %rbp, %r13
addq $0x400, %r13            # imm = 0x400
movq (%rsp), %rsi
addq %r12, %rsi
leal 0x28(%rbp), %edx
andl $0x3ff, %edx            # imm = 0x3FF
movq %r13, %rdi
callq 0x31b0
jmp 0xb903
movq 0x20(%rsi), %rax
movq %rax, 0x20(%r13)
movdqu (%rsi), %xmm0
movups 0x10(%rsi), %xmm1
movups %xmm1, 0x10(%r13)
movdqu %xmm0, (%r13)
movl $0x47, %r13d
jmp 0xb9e2
cmpl $0x3, %ecx
je 0xb95d
cmpl $0x7, %ecx
jne 0xb9bd
movl $0x8, %eax
cmpl $0x0, 0xb6028(%r14)
jne 0xb96c
jmp 0xb9bd
cmpl $0xfa, %ecx
je 0xb97a
cmpl $0x104, %ecx            # imm = 0x104
jne 0xb9bd
movq 0x8(%rsp), %rax
movq %rax, 0xb6160(%r14)
movl $0x0, 0x1ab7a(%rip)     # 0x264d0
movl $0x105, %eax            # imm = 0x105
jmp 0xb9bd
movl $0x4, %eax
cmpl $0x0, 0xb6028(%r14)
jne 0xb9bd
movb 0x1ab3a(%rip), %cl      # 0x264ac
movb %cl, 0x1ab52(%rip)      # 0x264ca
jmp 0xb9bd
movb $0x1, 0x1ab53(%rip)     # 0x264d4
movl $0xfb, %eax
jmp 0xb9bd
movl $0xc8, %eax
cmpl $0x0, 0xb6028(%r14)
jne 0xb9b6
jmp 0xb9bd
movb $0x0, 0x1ab34(%rip)     # 0x264d4
movl $0x10f, %eax            # imm = 0x10F
jmp 0xb9bd
movl $0xcc, %eax
cmpl $0x0, 0xb6028(%r14)
jne 0xb9bd
movb $0x0, 0x1ab0d(%rip)     # 0x264ca
cmpl 0xb6184(%r14), %eax
jne 0xb9e2
testb $0x2, 0x55eca(%r14)
movl $0x82, %eax
movl $0x2, %ecx
cmovel %ecx, %eax
orb %al, 0x55ec9(%r14)
testb $0x1, 0x81c(%r14)
jne 0xbb57
cmpb $0x1, 0x65fc0(%r14)
jne 0xba33
subl $0x1, 0x65fc4(%r14)
jae 0xba33
movl 0x65fd0(%r14), %eax
decl %eax
movzwl %ax, %eax
movl %eax, 0x65fc4(%r14)
testb $0x8, 0x55eca(%r14)
movl $0x88, %eax
movl $0x8, %ecx
cmovel %ecx, %eax
orb %al, 0x55ec9(%r14)
cmpb $0x0, 0x1aa8f(%rip)     # 0x264c9
jne 0xba78
testb $0x1, 0x1aa91(%rip)     # 0x264d4
jne 0xba78
cmpb $0x1, 0x1aa58(%rip)     # 0x264a4
jne 0xba5f
movl 0x1aa78(%rip), %eax     # 0x264cc
incl %eax
andl $0x3f, %eax
movl %eax, 0x1aa6d(%rip)     # 0x264cc
cmpb $0x0, 0x1aa65(%rip)     # 0x264cb
jne 0xba78
movl 0xb6138(%r14), %eax
movq 0xb6160(%r14), %rcx
movl %eax, (%rcx)
movq 0x1a9f9(%rip), %rax     # 0x26478
incq %rax
movq %rax, 0x1a9ef(%rip)     # 0x26478
testb $0x3, %al
jne 0xbc2c
testq %r15, %r15
je 0xbc2c
testl %ebx, %ebx
jle 0xbc2c
movl 0x1aa30(%rip), %eax     # 0x264d8
addl 0xb71b8(%r14), %eax
movl %eax, %r13d
shrl $0x2, %r13d
movl %r13d, %ebp
cmpl $0x4, %eax
jb 0xbb3c
movq %r14, %rdi
movl %r13d, %esi
movq %r15, %rdx
callq 0xc1e4
movq 0xb71d0(%r14), %rdi
testq %rdi, %rdi
je 0xbb21
movq (%rdi), %rax
leaq 0x10(%rsp), %rsi
movq %rbp, %rdx
callq *0x48(%rax)
leaq 0x1a9f3(%rip), %rax     # 0x264e0
movl (%rax), %eax
leal -0x1(%r13), %ecx
movl %r13d, %edx
movswl 0x10(%rsp,%rcx,2), %esi
imull %eax, %esi
movslq %esi, %rsi
imulq $0x10624dd3, %rsi, %rsi # imm = 0x10624DD3
movq %rsi, %rdi
shrq $0x3f, %rdi
shrq $0x26, %rsi
addl %edi, %esi
addw %si, (%r15,%rcx,2)
decq %rcx
decl %edx
jne 0xbaf6
movq %r14, %rdi
movq %r15, %rsi
movl %r13d, %edx
callq 0xc150
movl 0x1a9a3(%rip), %eax     # 0x264d8
addl 0xb71b8(%r14), %eax
andl $0x3, %eax
movl %eax, 0x1a993(%rip)     # 0x264d8
subl %r13d, %ebx
leaq (%r15,%rbp,2), %r15
movl $0x47, %r13d
jmp 0xbc2c
cmpb $0x1, 0x65fc1(%r14)
jne 0xbb9e
movl 0x65fc8(%r14), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x65fc8(%r14)
testw %ax, %ax
jne 0xbb9e
movl $0xffff, 0x65fc8(%r14) # imm = 0xFFFF
testb $0x10, 0x55eca(%r14)
movl $0x90, %eax
movl $0x10, %ecx
cmovel %ecx, %eax
orb %al, 0x55ec9(%r14)
cmpb $0x1, 0x65fc2(%r14)
jne 0xbbe5
movl 0x65fcc(%r14), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x65fcc(%r14)
testw %ax, %ax
jne 0xbbe5
movl $0xffff, 0x65fcc(%r14) # imm = 0xFFFF
testb $0x40, 0x55eca(%r14)
movl $0xc0, %eax
movl $0x40, %ecx
cmovel %ecx, %eax
orb %al, 0x55ec9(%r14)
cmpb $0x0, 0x1a8df(%rip)     # 0x264cb
jne 0xbc11
cmpb $0x0, 0x1a8d4(%rip)     # 0x264c9
jne 0xbc11
cmpb $0x0, 0x1a8d6(%rip)     # 0x264d4
jne 0xbc11
movl 0xb6138(%r14), %eax
movq 0xb6160(%r14), %rcx
movl %eax, 0x4(%rcx)
movq 0xb6160(%r14), %rax
cmpq 0xb6168(%r14), %rax
je 0xbc2c
addq $0x8, %rax
movq %rax, 0xb6160(%r14)
cmpb $0x1, 0x1a889(%rip)     # 0x264bc
jne 0xbc4b
movb 0x1a88d(%rip), %al      # 0x264c8
movq 0x1a87e(%rip), %rcx     # 0x264c0
movb %al, (%rcx)
movb $0x0, 0x1a871(%rip)     # 0x264bc
movl 0x81c(%r14), %eax
andl $0x1, %eax
orl 0x1a855(%rip), %eax     # 0x264b0
addl $-0x3, %eax
cmpl $0x3e, %eax
ja 0xbc99
btq %rax, %r13
jae 0xbc77
movq 0x45fb8(%r14), %rdi
callq 0x449a
jmp 0xbc99
movabsq $0x4000000040004000, %rcx # imm = 0x4000000040004000
btq %rax, %rcx
jae 0xbc99
movq 0x45fb8(%r14), %rdi
callq 0x7420
shll 0x1a817(%rip)           # 0x264b0
testl %ebx, %ebx
jle 0xbca6
testq %r15, %r15
jne 0xb3ab
movb $0x0, 0x45fa4(%r14)
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq