// File: /workspace/github_cpp_makefile_star2_O3/probonopd[P]decodeir/DecodeIR.cpp
// Function: Signal::tryCanalSat()
void Signal::tryCanalSat()	// GD 2009  Added tryCanalSat

// CanalSat		{55.5k,250,msb}<-1,1|1,-1>(T=0,(1,-1,D:7,S:6,T:1,0:1,F:7,-89m,T=1)+) 
// where T=0 for the first frame and T=1 for all repeats
// (PID = 018C)
// CanalSatLD     {56k,320,msb}<-1,1|1,-1>(T=0,(1,-1,D:7,S:6,T:1,0:1,F:6,~F:1,-85m,T=1)+)  DAR Aug 2012
// Amino		{56.0k,268,msb}<-1,1|1,-1>(T=1,(7,-6,3,D:4,1:1,T:1,1:2,0:8,F:8,15:4,C:4,-79m,T=0)+)
// also 36k is used
// where T=1 for first frame and T=0 for all repeat frames
// with C = sum of the first 7 nibbles mod 15

// Zaptor		{36k,330,msb}<-1,1|1,-1>(8,-6,2,D:8,T:1,S:7,F:8,E:4,C:4,-74m)+
// where T=0 for all frames except the last, T=1 for last frame, E is a checksum seed
// with C = (D:4+D:4:4+S:4+S:3:4+8*T+F:4+F:4:4+E)&15

{
	int HB;
	static int M = 0;	// toggle mask or previous T	
	int T = 0;				// toggle
	static int FC = 0;	// count of bypassed frames
	static int confBits1to32 = 0;	// DAR July 2011
	static int confBits34to65 = 0;	//filled in when a toggle changes state  DAR July 2011

	if ( nFrameL < 11 || nTotDur < 5000) return;
	if (*pFrame < 1000)
	{	
		if (sortBurst.min3 < 570) 
		{                         
			HB = 250;
		}
		else 
		{
			HB = 320;            //DAR AUG 2012 add CanalSatLD                                       
		}
		if (	*pFrame < HB*.5 
			||	nMaxDur < .5*HB 
			||	nMaxDur > 2.5*HB ) 
		{
			return;
		}
	}
	else
	{
		//if (nFreq > 46000)  //DAR March 2011 Some Amino is 36KHz  
		if (sortBurst.min3 < 600) //so use burst times instead
		{                         
			HB = 270;
		}
		else 
		{
			HB = 330;                                                   
		}
		if (	nMaxDur != *pFrame 
			||	nMaxDur < 3.5*HB 
			||	nMaxDur > 14*HB ) // First ON nominally 7 or 8 half bits
		{
			return;
		}
	}

	if (   !framed(40*HB)
		|| sortOn.min1 < HB * .3
		|| sortOn.max2 > HB * 4.5		// nominal 4
        || sortBurst.max2 > HB * 7  )	// nominal 4,-2
	{
		return;
	}

    minGlitch = HB*.25;
	nMinShort2 = HB * .5;
	nMaxShort2 = HB * 1.5;

	cleanup();
	nBit = 1;
	nState = (HB == 270 || HB == 330) ? 0 : 1;
	pBit += 2 - nState;

	while (pBit < pFrameEnd)
	{
		if ( nBit == 1 || ((HB == 270 || HB == 330) && nBit == 2))
		{
			int pulseL = (HB == 270 || HB == 330) && nBit == 1;						// Is initial long MARK?
			nMinShort = HB * (pulseL ? HB == 330 ? 1.5 : 2.4 : .5);	// nominally 2 : 3 : 1
			nMaxShort = nMinLong = HB * (pulseL ? HB == 330 ? 2.5 : 3.5 : 1.5);	// nominally 2 v 3 : 3 v 4 : 1 v 2
			nMaxLong = HB * (pulseL ? HB == 330 ? 3.6 : 4.8 : 2.5);	// nominally 3 : 4 : 2
		}
		if ( ! phaseBit() ) return;
	}
	if ( nBit != ( (HB == 270 || HB == 330) ? 33 : 23 ) ) return;		// wrong number of bits
	if ( (HB == 250 || HB == 320) && getLsb(15,1) ) return;            // bit 15 must be zero for CanalSat

	// look to see if there is a following frame
	float* pFrameEnd1 = pFrameEnd;					// save for later restoration
	float* pFrameEnd2 = pFrameEnd + 1;
	for ( ; pFrameEnd2 < pMainLimit; pFrameEnd2++ )
	{
		if ( *pFrameEnd2 > 40 * HB ) break;
	};
	nState = (HB == 270 || HB == 330) ? 0 : 1;
	pBit = pFrameEnd + 3 - nState;
	pFrameEnd = pFrameEnd2;							// temp change for use by phaseBit{}
	nBit++;

	while ( pBit < pFrameEnd )
	{
		if ( (HB == 270 || HB == 330) && nBit <= 35 )
		{
			int pulseL = nBit == 34;
			nMinShort = HB * (pulseL ? HB == 330 ? 1.5 : 2.4 : .5);
			nMaxShort = nMinLong = HB * (pulseL ? HB == 330 ? 2.5 : 3.5 : 1.5);
			nMaxLong = HB * (pulseL ? HB == 330 ? 3.6 : 4.8 : 2.5);
		}
		if ( ! phaseBit() ) break;
	}
	pFrameEnd = pFrameEnd1;							// restore original value
	makeMsb();
	if ( (HB == 270 || HB == 330) )  //much of the below Amino/Zaptor stuff revised by DAR July 2011
	{
		int s = 0;	// For Amino andZaptor protocols, check checksum
		int tmp1 = getMsb(1,32);  
		int tmp2 = getMsb(34,32); 
		for (int n=1; n<29; n+=4) s += getMsb(n,4);
		if ( getMsb(29,4) != (s&15) ) return; 
		if ( nBit == 66 )
		{
			s = 0;   // check checksum of second frame
			for (int n=34; n<62; n+=4) s += getMsb(n,4);	
			if ( getMsb(62,4) != (s&15) ) return;
			T = ((tmp1 ^ tmp2) & 0xFFFFFFF0);	//mask off checksum nibble
			if ((T == 0x04000000) 			//Amino confirmed; also means subdevice and function codes match
					&& (tmp1 & 0x04000000))		// repeat bit changed from 1 to 0, so tmp1 is a start frame 
			{
				AminoToggleDetected = true;
				confBits1to32 = tmp1;
				confBits34to65 = tmp2;
				if ( FC == 0 ) setzContext();			// save the context value
				FC++;	
				return;			// wait for repeat to come round
			}
			if	((T == 0x00800000)			//Zaptor confirmed; also shows subdevice and function codes match
					&& (tmp2 & 0x00800000)) //repeat bit changed from 0 to 1, so tmp2 is an end frame 
			{  
				ZaptorToggleDetected = true;
				confBits1to32 = tmp1;
				confBits34to65 = tmp2;
			}
		}
	}
	if ( (HB == 250 || HB == 320)&&	nBit == 46 )
	{
		T = getMsb(14,1) ^ getMsb(37,1);				// difference between the toggle values
		if	(	( (M == 0) ^ (T == 0) )					// exactly one of M and T must be zero
			&&	getMsb(1,13) == getMsb(24,13)			// all bits other than toggle must be equal
			&&	getMsb(15,8) == getMsb(38,8) )
		{
			M = 1;										// next frame is valid repeat
			if ( FC == 0 ) setzContext();				// save the context value
			FC++;										// increment count of bypassed frames
			return;										// wait for repeat to come round
		}
	}					
	if ( HB == 250 )
	{
		*pDevice = getMsb(1,7);
		*pSubDevice = getMsb(8,6);
		*pOBC = getMsb(16,7);
		pHex[0] = *pOBC << 1;
		strcpy( pProtocol, "CanalSat" );
		nNote_out = 4;
		strcpy( pMisc, M == 0 ? (nNote_out = 1, nAuxNote_out = 1, "no start frame") : "");
	}
	else if ( HB == 320 )
	{
		*pDevice = getMsb(1,7);
		*pSubDevice = getMsb(8,6);
		*pOBC = getMsb(16,6);
		strcpy( pProtocol, "CanalSatLD" );
		nNote_out = 4;
		strcpy( pMisc, M == 0 ? (nNote_out = 1, nAuxNote_out = 1, "no start frame") : "");
	}
	else 
	{
		if (AminoToggleDetected) HB = 270;		
		else if (ZaptorToggleDetected) HB = 330;	
		else 
		{
			confBits1to32 = getMsb(1,32);
			int tmp3 = confBits1to32 & 0x000000F0; 
			if (tmp3 == 0xF0) HB = 270;			//Amino decided by seed nibble
			else if (tmp3 == 0x50) HB = 330;	//Zaptor 
		}	//  else decide protocol by already determined HB duration 	
		if ( HB == 270 )					//Amino
		{
			*pDevice = (confBits1to32 >> 28) & 0xF;	
			*pSubDevice = (confBits1to32 >> 16) & 0xFF;  //always zero according to the Amino spec
			*pOBC = (confBits1to32 >> 8) & 0xFF;   
			pHex[0] = *pOBC;
			int seed = (confBits1to32 >> 4) & 0xF;
			if (seed != 0x0F) sprintf(pMisc, "E = %d", seed);
			if (nFreq > 46000) strcpy( pProtocol, "Amino-56");
			else strcpy( pProtocol, "Amino-36");
			if (AminoToggleDetected)  nNote_out = 4;
			else
			{
				nNote_out = 1;
				if ((confBits1to32 & 0x04000000) == 0) 
				{
					nAuxNote_out = 1;
					if (*pMisc){strcat(pMisc, ", ");}
					strcat(pMisc, "no start frame");
				}
				else 
				{
					nAuxNote_out = 0;
					if (*pMisc){strcat(pMisc, ", ");}
					strcat(pMisc, "no end frame");
				}
			}
		}
		else if ( HB == 330 )  //Zaptor
		{
			if (!ZaptorToggleDetected && (nBit == 66))  
			{
					if ( FC == 0 ) setzContext();	// save the context value
					FC++;	
					return;			// wait for repeat to come round
			}
			*pDevice = (confBits1to32 >> 24) & 0xFF;
			*pSubDevice = (confBits1to32 >> 16) & 0x7F;  
			*pOBC = (confBits1to32 >> 8) & 0xFF;   
			pHex[0] = *pOBC;
			int seed = (confBits1to32 >> 4) & 0xF;
			if (nFreq > 46000) strcpy( pProtocol, "Zaptor-56");
			else strcpy( pProtocol, "Zaptor-36");
			if (seed != 5) sprintf(pMisc, "E = %d", seed);
			if (ZaptorToggleDetected) nNote_out = 5;  
			else if ((confBits1to32 & 0x00800000) == 0)
			{
				nNote_out = 1;
				nAuxNote_out = 0;
				if (*pMisc){strcat(pMisc, ", ");}
				strcat(pMisc, "no end frame");
			}
			else
			{
				nNote_out = 0;
				nAuxNote_out = 6;
				if (*pMisc){strcat(pMisc, ", ");}
				strcat(pMisc, "no start frame");
			}
		}
	}
	nFrameCount = FC;
	M = 0;		// reset static variables
	FC = 0;		
}

// Assembly:
cmpl $0xb, 0x48(%rdi)
jl 0xcb10
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movss 0x6664(%rip), %xmm0     # 0x125ec
ucomiss 0x98(%rdi), %xmm0
ja 0xcb02
movq 0x38(%rbx), %rax
movss (%rax), %xmm0
movss 0x65a3(%rip), %xmm1     # 0x12548
ucomiss %xmm0, %xmm1
movss 0x1c8(%rbx), %xmm1
jbe 0xc019
movss 0x6686(%rip), %xmm2     # 0x12640
ucomiss %xmm1, %xmm2
movl $0xfa, %ecx
movl $0x140, %r15d           # imm = 0x140
cmoval %ecx, %r15d
xorps %xmm2, %xmm2
cvtss2sd %xmm0, %xmm2
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
movsd 0x60ed(%rip), %xmm1     # 0x120d0
mulsd %xmm0, %xmm1
ucomisd %xmm2, %xmm1
ja 0xcb02
xorps %xmm2, %xmm2
cvtss2sd 0x9c(%rbx), %xmm2
ucomisd %xmm2, %xmm1
ja 0xcb02
mulsd 0x6172(%rip), %xmm0     # 0x12180
ucomisd %xmm0, %xmm2
jbe 0xc087
jmp 0xcb02
movss 0x6583(%rip), %xmm2     # 0x125a4
ucomiss %xmm1, %xmm2
movl $0x10e, %ecx            # imm = 0x10E
movl $0x14a, %r15d           # imm = 0x14A
cmoval %ecx, %r15d
movss 0x9c(%rbx), %xmm1
ucomiss %xmm0, %xmm1
jne 0xcb02
jp 0xcb02
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
xorps %xmm2, %xmm2
cvtsi2sd %r15d, %xmm2
mulsd 0x635f(%rip), %xmm2     # 0x123c0
ucomisd %xmm0, %xmm2
ja 0xcb02
movl %r15d, %edx
shll $0x4, %edx
subl %r15d, %edx
subl %r15d, %edx
xorps %xmm0, %xmm0
cvtsi2ss %edx, %xmm0
ucomiss %xmm0, %xmm1
ja 0xcb02
leal (,%r15,8), %ecx
leal (%rcx,%rcx,4), %edx
xorps %xmm1, %xmm1
cvtsi2ss %edx, %xmm1
movss 0x140(%rbx), %xmm0
movss %xmm1, -0x58(%rbp)
ucomiss %xmm1, %xmm0
jb 0xcb02
xorps %xmm0, %xmm0
cvtss2sd 0x180(%rbx), %xmm0
xorps %xmm2, %xmm2
cvtsi2sd %r15d, %xmm2
movsd 0x608e(%rip), %xmm1     # 0x12158
movsd %xmm2, -0x30(%rbp)
mulsd %xmm2, %xmm1
ucomisd %xmm0, %xmm1
ja 0xcb02
xorps %xmm0, %xmm0
cvtss2sd 0x188(%rbx), %xmm0
movsd 0x6078(%rip), %xmm1     # 0x12168
mulsd -0x30(%rbp), %xmm1
ucomisd %xmm1, %xmm0
ja 0xcb02
subl %r15d, %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
movss 0x1e0(%rbx), %xmm1
ucomiss %xmm0, %xmm1
ja 0xcb02
movsd 0x604e(%rip), %xmm0     # 0x12170
movsd -0x30(%rbp), %xmm1
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xe0(%rbx)
movsd 0x5f91(%rip), %xmm0     # 0x120d0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x50(%rbp)
movss %xmm0, 0xf4(%rbx)
movsd 0x601c(%rip), %xmm0     # 0x12178
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x38(%rbp)
movss %xmm0, 0xf8(%rbx)
leaq 0xa0(%rbx), %r13
xorps %xmm0, %xmm0
movups %xmm0, 0xa0(%rbx)
movl $0x1, 0xc0(%rbx)
cmpl $0x10e, %r15d           # imm = 0x10E
setne %dl
xorl %ecx, %ecx
cmpl $0x14a, %r15d           # imm = 0x14A
setne %cl
andb %cl, %dl
movzbl %dl, %r14d
movl %r14d, 0xc4(%rbx)
movl $0x2, %edx
subl %r14d, %edx
leaq (%rax,%rdx,4), %rax
shll $0x3, %ecx
leaq 0x5eab(%rip), %rdx      # 0x12070
movsd (%rcx,%rdx), %xmm0
movsd %xmm0, -0x68(%rbp)
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x34(%rbp)
leaq 0x5e9d(%rip), %rdx      # 0x12080
movsd (%rcx,%rdx), %xmm0
movsd %xmm0, -0x60(%rbp)
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x3c(%rbp)
movq %rax, 0xc8(%rbx)
leaq 0x5e88(%rip), %rax      # 0x12090
movsd (%rcx,%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movq 0x40(%rbx), %r12
movl 0xc0(%rbx), %eax
cmpq %r12, 0xc8(%rbx)
jae 0xc2d0
cmpl $0x1, %eax
je 0xc245
cmpl $0x14a, %r15d           # imm = 0x14A
je 0xc240
cmpl $0x10e, %r15d           # imm = 0x10E
jne 0xc2bb
cmpl $0x2, %eax
jne 0xc2bb
cmpl $0x14a, %r15d           # imm = 0x14A
je 0xc269
movss -0x50(%rbp), %xmm0
movss -0x38(%rbp), %xmm1
movsd 0x5f20(%rip), %xmm2     # 0x12180
cmpl $0x10e, %r15d           # imm = 0x10E
jne 0xc28f
movss -0x50(%rbp), %xmm0
movss -0x38(%rbp), %xmm1
movsd 0x5f05(%rip), %xmm2     # 0x12180
cmpl $0x1, %eax
jne 0xc28f
movss -0x34(%rbp), %xmm0
movss -0x3c(%rbp), %xmm1
movsd -0x48(%rbp), %xmm2
movss %xmm0, 0xe4(%rbx)
movss %xmm1, 0xec(%rbx)
movss %xmm1, 0xe8(%rbx)
mulsd -0x30(%rbp), %xmm2
xorps %xmm0, %xmm0
cvtsd2ss %xmm2, %xmm0
movss %xmm0, 0xf0(%rbx)
movq %rbx, %rdi
callq 0x106cc
testl %eax, %eax
jne 0xc212
jmp 0xcb02
testl %r14d, %r14d
movl $0x17, %ecx
movl $0x21, %edx
cmovnel %ecx, %edx
cmpl %edx, %eax
jne 0xcb02
cmpl $0x140, %r15d           # imm = 0x140
je 0xc2fa
cmpl $0xfa, %r15d
jne 0xc307
cmpb $0x0, 0xa1(%rbx)
js 0xcb02
movq 0x10(%rbx), %rdx
leaq 0x4(%r12), %rsi
movss -0x58(%rbp), %xmm1
movq %rsi, %rcx
cmpq %rdx, %rsi
jae 0xc32a
movss (%rcx), %xmm0
leaq 0x4(%rcx), %rsi
ucomiss %xmm1, %xmm0
jbe 0xc315
movl %r14d, 0xc4(%rbx)
shll $0x2, %r14d
movq %r12, %rdx
subq %r14, %rdx
addq $0xc, %rdx
movq %rdx, 0xc8(%rbx)
movq %rcx, 0x40(%rbx)
incl %eax
movl %eax, 0xc0(%rbx)
movq 0xc8(%rbx), %rax
cmpq 0x40(%rbx), %rax
jae 0xc3fb
cmpl $0x14a, %r15d           # imm = 0x14A
je 0xc375
cmpl $0x10e, %r15d           # imm = 0x10E
jne 0xc3eb
movl 0xc0(%rbx), %eax
cmpl $0x23, %eax
jg 0xc3eb
movsd -0x68(%rbp), %xmm0
cmpl $0x22, %eax
je 0xc392
movsd 0x5d3e(%rip), %xmm0     # 0x120d0
mulsd -0x30(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xe4(%rbx)
movsd -0x60(%rbp), %xmm0
je 0xc3b2
movsd 0x5dc6(%rip), %xmm0     # 0x12178
mulsd -0x30(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xec(%rbx)
movss %xmm0, 0xe8(%rbx)
movsd -0x48(%rbp), %xmm0
je 0xc3da
movsd 0x5da6(%rip), %xmm0     # 0x12180
mulsd -0x30(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xf0(%rbx)
movq %rbx, %rdi
callq 0x106cc
testl %eax, %eax
jne 0xc352
movq %r12, 0x40(%rbx)
movl 0xc0(%rbx), %eax
addl $0x7, %eax
sarl $0x3, %eax
testl %eax, %eax
jle 0xc464
movl %eax, %eax
movl $0x33000000, %ecx       # imm = 0x33000000
movl $0x55000000, %edx       # imm = 0x55000000
movzbl 0x9f(%rbx,%rax), %esi
bswapl %esi
movl %esi, %edi
shll $0x4, %edi
shrl $0x4, %esi
andl $0xf000000, %esi        # imm = 0xF000000
orl %edi, %esi
movl %esi, %edi
andl %ecx, %edi
shrl $0x2, %esi
andl %ecx, %esi
leal (%rsi,%rdi,4), %esi
movl %esi, %edi
andl %edx, %edi
shrl %esi
andl %edx, %esi
leal (%rsi,%rdi,2), %esi
shrl $0x18, %esi
movb %sil, 0x9f(%rbx,%rax)
leaq -0x1(%rax), %rsi
cmpq $0x1, %rax
movq %rsi, %rax
ja 0xc41b
cmpl $0x13f, %r15d           # imm = 0x13F
jg 0xc488
cmpl $0xfa, %r15d
je 0xc62d
cmpl $0x10e, %r15d           # imm = 0x10E
je 0xc4a2
jmp 0xc738
cmpl $0x140, %r15d           # imm = 0x140
je 0xc62d
cmpl $0x14a, %r15d           # imm = 0x14A
jne 0xc738
movzbl (%r13), %esi
andl $0x7f, %esi
movl $0xa1, %eax
movl %esi, %edx
movl %esi, %ecx
shll $0x8, %ecx
movzbl (%rbx,%rax), %esi
orl %ecx, %esi
incq %rax
cmpq $0xa4, %rax
jne 0xc4af
movl %edx, -0x38(%rbp)
movq %r13, -0x30(%rbp)
movzbl 0xa4(%rbx), %r12d
movl %r12d, %edi
shrl $0x7, %edi
andl $0x3f, %r12d
movl $0xa5, %eax
movl %r12d, %edx
movl %r12d, %ecx
shll $0x8, %ecx
movzbl (%rbx,%rax), %r12d
orl %ecx, %r12d
incq %rax
cmpq $0xa8, %rax
jne 0xc4e5
movl %edx, -0x3c(%rbp)
movl %esi, %eax
addl %esi, %esi
movl %esi, -0x48(%rbp)
movq %rdi, -0x58(%rbp)
leal (%rdi,%rax,2), %eax
movl %eax, -0x34(%rbp)
movzbl 0xa8(%rbx), %eax
movq %rax, -0x50(%rbp)
xorl %r13d, %r13d
movl $0xfffffffd, %r14d      # imm = 0xFFFFFFFD
addl $0x4, %r14d
movq %rbx, %rdi
movl %r14d, %esi
movl $0x4, %edx
callq 0xfc9e
addl %eax, %r13d
cmpl $0x19, %r14d
jb 0xc529
movzbl 0xa3(%rbx), %eax
andl $0x7, %eax
movq -0x58(%rbp), %rcx
leal (%rcx,%rax,2), %eax
andl $0xf, %r13d
cmpl %r13d, %eax
movq -0x30(%rbp), %r13
jne 0xcb02
cmpl $0x42, 0xc0(%rbx)
jne 0xc617
shll $0x2, %r12d
xorl %r13d, %r13d
movl $0x1e, %r14d
addl $0x4, %r14d
movq %rbx, %rdi
movl %r14d, %esi
movl $0x4, %edx
callq 0xfc9e
addl %eax, %r13d
cmpl $0x3a, %r14d
jb 0xc582
movzbl 0xa7(%rbx), %eax
andl $0x3, %eax
movq -0x50(%rbp), %rcx
shrl $0x6, %ecx
leal (%rcx,%rax,4), %eax
andl $0xf, %r13d
cmpl %eax, %r13d
jne 0xcb02
xorl -0x48(%rbp), %r12d
andl $-0x10, %r12d
btl $0x11, -0x38(%rbp)
jae 0xc5f0
cmpl $0x4000000, %r12d       # imm = 0x4000000
jne 0xc5f0
movl $0x1, 0xb8(%rbx)
movl -0x34(%rbp), %eax
movl %eax, 0x9d19(%rip)      # 0x16304
jmp 0xca70
btl $0xd, -0x3c(%rbp)
movq -0x30(%rbp), %r13
jae 0xc617
cmpl $0x800000, %r12d        # imm = 0x800000
jne 0xc617
movl $0x1, 0xbc(%rbx)
movl -0x34(%rbp), %eax
movl %eax, 0x9ced(%rip)      # 0x16304
cmpl $0x140, %r15d           # imm = 0x140
je 0xc62d
cmpl $0xfa, %r15d
jne 0xc738
cmpl $0x2e, 0xc0(%rbx)
jne 0xc6bf
movzbl 0xa1(%rbx), %ecx
movl %ecx, %edx
shrl %edx
movzbl 0xa4(%rbx), %eax
movl %eax, %esi
shrl $0x2, %esi
xorl %edx, %esi
andb $0x1, %sil
cmpb %sil, 0x9c9e(%rip)      # 0x162fc
je 0xc6bf
movzbl 0xa0(%rbx), %edx
andl $0x7f, %edx
shll $0x6, %edx
movl %ecx, %esi
shrl $0x2, %esi
orl %edx, %esi
movzbl 0xa3(%rbx), %edx
shll $0x5, %edx
movl %eax, %edi
shrl $0x3, %edi
orl %edx, %edi
cmpl %edi, %esi
jne 0xc6bf
shll $0x7, %ecx
movl $0xff, %edx
andl %edx, %ecx
movzbl 0xa2(%rbx), %esi
shrl %esi
orl %ecx, %esi
shll $0x6, %eax
andl %edx, %eax
movzbl 0xa5(%rbx), %ecx
shrl $0x2, %ecx
orl %eax, %ecx
cmpl %ecx, %esi
jne 0xc6bf
movb $0x1, 0x9c42(%rip)      # 0x162fc
jmp 0xca70
cmpl $0x140, %r15d           # imm = 0x140
je 0xc7ca
cmpl $0xfa, %r15d
jne 0xc738
movzbl 0xa0(%rbx), %eax
andl $0x7f, %eax
movq 0x160(%rbx), %rcx
movl %eax, (%rcx)
movzbl 0xa1(%rbx), %eax
shrl $0x2, %eax
movq 0x168(%rbx), %rcx
movl %eax, (%rcx)
movzbl 0xa2(%rbx), %eax
movl %eax, %ecx
shrl %ecx
movq 0x170(%rbx), %rdx
movl %ecx, (%rdx)
andl $-0x2, %eax
movq 0x178(%rbx), %rcx
movl %eax, (%rcx)
movq 0x148(%rbx), %rax
movabsq $0x7461536c616e6143, %rcx # imm = 0x7461536C616E6143
movq %rcx, (%rax)
movb $0x0, 0x8(%rax)
jmp 0xc81e
cmpl $0x0, 0xb8(%rbx)
je 0xc863
movl 0x9bb9(%rip), %edx      # 0x16304
movl %edx, %eax
shrl $0x1c, %eax
movq 0x160(%rbx), %rcx
movl %eax, (%rcx)
movl %edx, %eax
shrl $0x10, %eax
movl $0xff, %ecx
andl %ecx, %eax
movq 0x168(%rbx), %rsi
movl %eax, (%rsi)
movl %edx, %eax
shrl $0x8, %eax
andl %ecx, %eax
movq 0x170(%rbx), %rcx
movl %eax, (%rcx)
movq 0x178(%rbx), %rcx
movl %eax, (%rcx)
shrl $0x4, %edx
andl $0xf, %edx
cmpl $0xf, %edx
je 0xc7a7
movq 0x150(%rbx), %rdi
leaq 0x65f0(%rip), %rsi      # 0x12d90
xorl %eax, %eax
callq 0x2060
cmpl $0xb3b1, 0x2c(%rbx)     # imm = 0xB3B1
movq 0x148(%rbx), %rax
jl 0xc8d4
movabsq $0x36352d6f6e696d41, %rcx # imm = 0x36352D6F6E696D41
jmp 0xc8de
movzbl 0xa0(%rbx), %eax
andl $0x7f, %eax
movq 0x160(%rbx), %rcx
movl %eax, (%rcx)
movzbl 0xa1(%rbx), %eax
shrl $0x2, %eax
movq 0x168(%rbx), %rcx
movl %eax, (%rcx)
movzbl 0xa2(%rbx), %eax
shrl $0x2, %eax
movq 0x170(%rbx), %rcx
movl %eax, (%rcx)
movq 0x148(%rbx), %rax
movabsq $0x7461536c616e6143, %rcx # imm = 0x7461536C616E6143
movq %rcx, (%rax)
movl $0x444c74, 0x7(%rax)    # imm = 0x444C74
movl $0x4, 0x88(%rbx)
movq 0x150(%rbx), %rdi
cmpb $0x0, 0x9ac6(%rip)      # 0x162fc
je 0xc841
leaq 0x68c6(%rip), %rsi      # 0x13105
jmp 0xc859
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x88(%rbx)
leaq 0x64ce(%rip), %rsi      # 0x12d27
callq 0x2100
jmp 0xcae8
movl 0xbc(%rbx), %eax
testl %eax, %eax
je 0xc923
movl 0x9a8d(%rip), %edx      # 0x16304
movl %edx, %eax
shrl $0x18, %eax
movq 0x160(%rbx), %rcx
movl %eax, (%rcx)
movl %edx, %eax
shrl $0x10, %eax
andl $0x7f, %eax
movq 0x168(%rbx), %rcx
movl %eax, (%rcx)
movzbl %dh, %eax
movq 0x170(%rbx), %rcx
movl %eax, (%rcx)
movq 0x178(%rbx), %rcx
movl %eax, (%rcx)
shrl $0x4, %edx
andl $0xf, %edx
cmpl $0xb3b1, 0x2c(%rbx)     # imm = 0xB3B1
movq 0x148(%rbx), %rax
jl 0xc99f
movabsq $0x352d726f7470615a, %rcx # imm = 0x352D726F7470615A
jmp 0xc9a9
movabsq $0x36332d6f6e696d41, %rcx # imm = 0x36332D6F6E696D41
movq %rcx, (%rax)
movb $0x0, 0x8(%rax)
cmpl $0x0, 0xb8(%rbx)
je 0xc8fd
movl $0x4, 0x88(%rbx)
jmp 0xcae8
movl $0x1, 0x88(%rbx)
testb $0x4, 0x99f9(%rip)      # 0x16307
jne 0xc9e4
movl $0x1, 0x8c(%rbx)
jmp 0xca9a
movzbl (%r13), %ecx
andl $0x7f, %ecx
movl $0xa1, %edx
movl %ecx, %esi
shll $0x8, %esi
movzbl (%rbx,%rdx), %ecx
orl %esi, %ecx
incq %rdx
cmpq $0xa4, %rdx
jne 0xc930
movzbl 0xa4(%rbx), %edx
shrl $0x7, %edx
movl %ecx, %esi
addl %ecx, %ecx
leal (%rdx,%rsi,2), %edx
movl %edx, 0x99a6(%rip)      # 0x16304
movl %ecx, %esi
andb $-0x10, %sil
cmpb $0x50, %sil
je 0xca5b
andl $0xf0, %ecx
cmpl $0xf0, %ecx
je 0xc74b
cmpl $0x14a, %r15d           # imm = 0x14A
je 0xca5b
cmpl $0x10e, %r15d           # imm = 0x10E
je 0xc74b
jmp 0xcae8
movabsq $0x332d726f7470615a, %rcx # imm = 0x332D726F7470615A
movq %rcx, (%rax)
movw $0x36, 0x8(%rax)
cmpl $0x5, %edx
je 0xc9cc
movq 0x150(%rbx), %rdi
leaq 0x63cb(%rip), %rsi      # 0x12d90
xorl %eax, %eax
callq 0x2060
cmpl $0x0, 0xbc(%rbx)
je 0xc9f0
movl $0x5, 0x88(%rbx)
jmp 0xcae8
movl $0x0, 0x8c(%rbx)
jmp 0xca08
testb $-0x80, 0x990f(%rip)    # 0x16306
jne 0xca89
movq $0x1, 0x88(%rbx)
movq 0x150(%rbx), %r14
cmpb $0x0, (%r14)
je 0xca31
movq %r14, %rdi
callq 0x2090
movw $0x202c, (%r14,%rax)    # imm = 0x202C
movb $0x0, 0x2(%r14,%rax)
movq 0x150(%rbx), %r14
movq %r14, %rdi
callq 0x2090
movabsq $0x6620646e65206f6e, %rcx # imm = 0x6620646E65206F6E
movq %rcx, (%r14,%rax)
movabsq $0x656d6172662064, %rcx # imm = 0x656D6172662064
movq %rcx, 0x5(%r14,%rax)
jmp 0xcae8
testl %eax, %eax
jne 0xc871
cmpl $0x42, 0xc0(%rbx)
jne 0xc871
movl 0x9889(%rip), %r14d     # 0x16300
testl %r14d, %r14d
jne 0xca84
movq %rbx, %rdi
callq 0x26e8
incl %r14d
jmp 0xcafb
movabsq $0x600000000, %rax      # imm = 0x600000000
movq %rax, 0x88(%rbx)
movq 0x150(%rbx), %r14
cmpb $0x0, (%r14)
je 0xcac3
movq %r14, %rdi
callq 0x2090
movw $0x202c, (%r14,%rax)    # imm = 0x202C
movb $0x0, 0x2(%r14,%rax)
movq 0x150(%rbx), %r14
movq %r14, %rdi
callq 0x2090
movabsq $0x7472617473206f6e, %rcx # imm = 0x7472617473206F6E
movq %rcx, (%r14,%rax)
movabsq $0x656d6172662074, %rcx # imm = 0x656D6172662074
movq %rcx, 0x7(%r14,%rax)
movl 0x9812(%rip), %eax      # 0x16300
movl %eax, 0x60(%rbx)
movb $0x0, 0x9804(%rip)      # 0x162fc
xorl %r14d, %r14d
movl %r14d, 0x97fe(%rip)     # 0x16300
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop