// File: /workspace/github_cpp_makefile_star2_O2/probonopd[P]decodeir/DecodeIR.cpp
// Function: Signal::tryHumax()
void Signal::tryHumax()   //  {56k,105, msb}<-2,2|-3,1|1,-3|2,-2>(T=0,(2,-2,D:7, S:5,T:2,F:6:1,(F:1+1):2),^95m,T=1)+) DAR 2012 
{
	static int M = 0;	// toggle mask or previous T	
	int T;
	static int FC = 0;	// count of bypassed frames
	bool success;
	if (( nFrameL < 7 ) || !framed(420*12) )
		return;
	if (sortOff.max1 > 1.5 * 630) 
		return;
    //if ( sortOn.min1 * 3.6 < sortOff.min1 )
        //return;
	 //if ( sortOff.min1 * 2.5 < sortBurst.min1  || sortOff.min1 * 1.8 > sortBurst.max3)
        //return;
	cleanup();
	success = processHumaxAtoms(0, pFrame, pFrameEnd - pFrame);
	if (!success)
		return;
	float* pFrameEnd2 = pFrameEnd + 1;
	for ( ; pFrameEnd2 < pMainLimit; pFrameEnd2++ ) {
		if ( *pFrameEnd2 > 2000. ) break; // about 3 time the max duration
	};
	success = processHumaxAtoms(12, pFrameEnd + 1, pFrameEnd2 - pFrameEnd); //check for second signal
	setPreempt(prAsync	);  // avoid an Async decode
	makeMsb();
	if (success)  {
		T = getMsb(14,2) ^ getMsb(38,2);				// difference between the toggle values
		if	(( (M == 0) ^ (T == 0) )					// exactly one of M and T must be zero
			&&	getMsb(0,13) == getMsb(24,13)			// all bits other than toggle must be equal
			&&	getMsb(16,8) == getMsb(40,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
		}
	}
	strcpy(pProtocol,"Humax 4Phase"); 
    *pDevice = getMsb(2,6);
	*pSubDevice = getMsb(8,6);
	int tog = getMsb(14,2);
	sprintf(pMisc, "T=%d", tog);
	*pOBC = getMsb(16,7);
	nNote_out = 4;
	strcpy( pMisc, M == 0 ? (nNote_out = 1, nAuxNote_out = 1, "no start frame") : "");
	nFrameCount = FC;
	FC = 0;		// reset static variables
	M = 0;	
}

// Assembly:
cmpl $0x7, 0x48(%rdi)
jl 0xdc78
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movss 0x140(%rdi), %xmm0
ucomiss 0x3c48(%rip), %xmm0     # 0x116c0
jb 0xdc6e
movss 0x190(%rbx), %xmm0
ucomiss 0x3c37(%rip), %xmm0     # 0x116c4
ja 0xdc6e
xorps %xmm0, %xmm0
movups %xmm0, 0xa0(%rbx)
movq 0x38(%rbx), %rdx
movq 0x40(%rbx), %rcx
movq %rdx, 0xc8(%rbx)
andq $0x0, 0xc0(%rbx)
subq %rdx, %rcx
shrq $0x2, %rcx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xf6dc
testb %al, %al
je 0xdc6e
movq 0x10(%rbx), %rax
movq 0x40(%rbx), %rdx
pushq $0x4
popq %rsi
movss 0x3a6c(%rip), %xmm0     # 0x1154c
movq %rsi, %rcx
addq %rdx, %rsi
cmpq %rax, %rsi
jae 0xdaf8
movss (%rsi), %xmm1
leaq 0x4(%rcx), %rsi
ucomiss %xmm0, %xmm1
jbe 0xdae0
addq $0x4, %rdx
shrq $0x2, %rcx
pushq $0xc
popq %rsi
movq %rbx, %rdi
callq 0xf6dc
movl %eax, %r14d
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x264a
movq %rbx, %rdi
callq 0xec52
testb %r14b, %r14b
je 0xdb9e
movb 0xa4(%rbx), %al
xorb 0xa1(%rbx), %al
testb $0x3, %al
setne %al
cmpb %al, 0x77df(%rip)       # 0x1531c
je 0xdb9e
pushq $0xd
popq %r14
movq %rbx, %rdi
xorl %esi, %esi
movl %r14d, %edx
callq 0xeb6a
movl %eax, %r15d
pushq $0x18
popq %rsi
movq %rbx, %rdi
movl %r14d, %edx
callq 0xeb6a
cmpl %eax, %r15d
jne 0xdb9e
movb 0xa2(%rbx), %al
cmpb 0xa5(%rbx), %al
jne 0xdb9e
movb $0x1, 0x77a1(%rip)      # 0x1531c
movl 0x779e(%rip), %r14d     # 0x15320
testl %r14d, %r14d
jne 0xdb8f
movq %rbx, %rdi
callq 0x266a
incl %r14d
movl %r14d, 0x7787(%rip)     # 0x15320
jmp 0xdc6e
movq 0x148(%rbx), %rax
movabsq $0x65736168503420, %rcx # imm = 0x65736168503420
movq %rcx, 0x5(%rax)
movabsq $0x50342078616d7548, %rcx # imm = 0x50342078616D7548
movq %rcx, (%rax)
movzbl 0xa0(%rbx), %eax
andl $0x3f, %eax
movq 0x160(%rbx), %rcx
movl %eax, (%rcx)
movzbl 0xa1(%rbx), %eax
shrl $0x2, %eax
movq 0x168(%rbx), %rcx
movl %eax, (%rcx)
movzbl 0xa1(%rbx), %edx
andl $0x3, %edx
movq 0x150(%rbx), %rdi
leaq 0x4293(%rip), %rsi      # 0x11e91
xorl %eax, %eax
callq 0x2060
movzbl 0xa2(%rbx), %eax
shrl %eax
movq 0x170(%rbx), %rcx
movl %eax, (%rcx)
movl $0x4, 0x88(%rbx)
movq 0x150(%rbx), %rdi
cmpb $0x0, 0x76ed(%rip)      # 0x1531c
je 0xdc3a
leaq 0x44cd(%rip), %rsi      # 0x12105
jmp 0xdc52
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x88(%rbx)
leaq 0x40d5(%rip), %rsi      # 0x11d27
callq 0x2120
movl 0x76c3(%rip), %eax      # 0x15320
movl %eax, 0x60(%rbx)
andl $0x0, 0x76b9(%rip)      # 0x15320
movb $0x0, 0x76ae(%rip)      # 0x1531c
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop