// File: /workspace/github_cpp_makefile_star2_O3/probonopd[P]decodeir/DecodeIR.cpp
// Function: Signal::tryXX()
void Signal::tryXX()	// {500}<-1,1|1,-1>((1,-5, 1:1, 
{
    if ( pFrameEnd[0] < sortBurst.max1 )    // Right hand framing
        return;
	if ( pFrame[1] <= sortBurst.max2 )      // Lead-in
		return;
	if ( nFrameL > 20 || nFrameL < 6 )
		return;
	if ( preemptValue >= prBlaupunkt )
		return;
	if ( sortBurst.min1*4 < sortBurst.max1 )
		return;
	cleanup();
	float u = sortBurst.max1 * (1./18);
    minGlitch = .5*u;
	nMinShort = nMinShort2 = 2*u;
	nMaxShort = nMaxShort2 = 4*u;
	nMinLong = 5*u;
	nMaxLong = 7*u;
	pBit += 2;
	if (*(pBit++) > nMaxShort)
		return;
	nState = 1;
	do
	{
		if ( ! phaseBit() )
			return;
	} while (pBit != pFrameEnd);
	if (nBit < 8)
		return;
	switch (nBit)
	{
	case 9:
	{
		newPreemptValue = prBlaupunkt;
		newPreemptLength = nFrameL;
		int obc = getLsb(0,7);
		int device = getLsb(7,2);
		strcpy(pProtocol, "Blaupunkt{body}");
		if (getLsb(0,9)==511)
		{
			int command = moreBlaupunkt(9);
			if (command>=0 && command != 511)
			{
				int cmds = 0;
				obc = getLsb(0,6);
				device = getLsb(6,3);
				int nextCommand;
				do
				{
					newPreemptLength = (pBit-pFrame)/2;
					++cmds;
					nextCommand = moreBlaupunkt(9);
				} while (nextCommand == command);
				strcpy(pProtocol, "Blaupunkt");
				if (cmds>1)
					sprintf(pMisc, "(%d)", cmds);
			}
			else
			{
				strcpy(pProtocol, "Blaupunkt{prefix}");
				return;
			}
		}
		*pOBC = obc;
		*pDevice = device;
		*pHex = (msb(obc)>>1) + 0x80;
		return;
	}
	case 15:
	case 16:
	{
		newPreemptValue = prBlaupunkt;
		newPreemptLength = nFrameL;
		int obc = getLsb(0,8);
		int device = getLsb(8,nBit-1);
		sprintf(pProtocol, "NRC%d{body}", nBit+1);
		char* pP = pProtocol+5;
		if ( getLsb(0,nBit) == (1<<nBit)-2 )
		{
			int command = moreBlaupunkt(nBit);
			if (command>=0 && command != (1<<nBit)-2)
			{
				*pP = 0;
				int cmds = 0;
				obc = getLsb(0,8);
				device = getLsb(8,nBit-8);
				int nextCommand;
				do
				{
					newPreemptLength = (pBit-pFrame)/2;
					++cmds;
					nextCommand = moreBlaupunkt(nBit);
				} while (nextCommand == command);
				if (cmds>1)
					sprintf(pMisc, "(%d)", cmds);
			}
			else
			{
				strcpy(pP, "{prefix}");
				return;
			}
		}
		*pOBC = obc;
		*pDevice = device;
		return;
	}
	}
	strcpy(pProtocol, "XX");
	*pDevice = nBit;
	char *pt=pMisc;
	for (int ndx= (nBit+7)>>3; --ndx>=0; )
	{
		sprintf(pt,"%02X", cBits[ndx]);
		pt+=2;
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x40(%rdi), %rax
movss 0x1dc(%rdi), %xmm0
ucomiss (%rax), %xmm0
ja 0x4d6b
movq %rdi, %rbx
movq 0x38(%rdi), %rax
movss 0x1e0(%rdi), %xmm1
ucomiss 0x4(%rax), %xmm1
jae 0x4d6b
movl 0x48(%rbx), %ecx
addl $-0x15, %ecx
cmpl $-0xf, %ecx
jb 0x4d6b
cmpl $0x1, 0x54(%rbx)
jg 0x4d6b
movss 0x1d0(%rbx), %xmm1
mulss 0xd843(%rip), %xmm1     # 0x12500
ucomiss %xmm1, %xmm0
ja 0x4d6b
xorps %xmm1, %xmm1
movups %xmm1, 0xa0(%rbx)
movq $0x0, 0xc0(%rbx)
cvtss2sd %xmm0, %xmm0
mulsd 0xd469(%rip), %xmm0     # 0x12150
cvtsd2ss %xmm0, %xmm0
movss 0xd81d(%rip), %xmm1     # 0x12510
mulss %xmm0, %xmm1
movss %xmm1, 0xe0(%rbx)
movaps %xmm0, %xmm1
addss %xmm0, %xmm1
movss %xmm1, 0xf4(%rbx)
movss %xmm1, 0xe4(%rbx)
movss 0xd7e2(%rip), %xmm1     # 0x12500
mulss %xmm0, %xmm1
movss %xmm1, 0xf8(%rbx)
movss %xmm1, 0xe8(%rbx)
movss 0xd7ce(%rip), %xmm2     # 0x12508
mulss %xmm0, %xmm2
movss %xmm2, 0xec(%rbx)
mulss 0xd7c6(%rip), %xmm0     # 0x12514
movss %xmm0, 0xf0(%rbx)
leaq 0xc(%rax), %rcx
movq %rcx, 0xc8(%rbx)
movss 0x8(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x4d7a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, 0xc4(%rbx)
movq %rbx, %rdi
callq 0x106cc
testl %eax, %eax
je 0x4d6b
movq 0xc8(%rbx), %rax
cmpq 0x40(%rbx), %rax
jne 0x4d84
movl 0xc0(%rbx), %r15d
cmpl $0x8, %r15d
jl 0x4d6b
leal -0xf(%r15), %eax
cmpl $0x2, %eax
jae 0x4e72
movl $0x2, 0x5c(%rbx)
movl 0x48(%rbx), %eax
movl %eax, 0x58(%rbx)
movb 0xa0(%rbx), %r13b
leal -0x1(%r15), %edx
movq %rbx, %rdi
movl $0x8, %esi
callq 0xfd2a
movl %eax, %r14d
movq 0x148(%rbx), %rdi
incl %r15d
leaq 0xe19b(%rip), %rsi      # 0x12f8b
movl %r15d, %edx
xorl %eax, %eax
callq 0x2060
movq 0x148(%rbx), %r12
movl 0xc0(%rbx), %r15d
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
callq 0xfd2a
movl $0x1, %edx
movl %r15d, %ecx
shll %cl, %edx
addl $-0x2, %edx
cmpl %edx, %eax
jne 0x50ee
addq $0x5, %r12
movq %rbx, %rdi
movl %r15d, %esi
callq 0x109e0
testl %eax, %eax
js 0x4e59
movl %eax, %r15d
movb 0xc0(%rbx), %cl
movl $0x1, %eax
shll %cl, %eax
addl $-0x2, %eax
cmpl %eax, %r15d
jne 0x5073
movabsq $0x7d7869666572707b, %rax # imm = 0x7D7869666572707B
movq %rax, (%r12)
movb $0x0, 0x8(%r12)
jmp 0x4d6b
cmpl $0x9, %r15d
jne 0x4f8d
movl $0x2, 0x5c(%rbx)
movl 0x48(%rbx), %eax
movl %eax, 0x58(%rbx)
movzbl 0xa0(%rbx), %eax
movzbl 0xa1(%rbx), %ecx
movq 0x148(%rbx), %rdx
movups 0xe0c7(%rip), %xmm0     # 0x12f6c
movups %xmm0, (%rdx)
movzbl 0xa0(%rbx), %edx
movzbl 0xa1(%rbx), %esi
andl $0x1, %esi
shll $0x8, %esi
orl %edx, %esi
cmpl $0x1ff, %esi            # imm = 0x1FF
jne 0x4ff8
movq %rbx, %rdi
movl $0x9, %esi
callq 0x109e0
movl %eax, %r15d
testl %eax, %eax
sets %al
cmpl $0x1ff, %r15d           # imm = 0x1FF
sete %cl
orb %al, %cl
jne 0x510a
movzbl 0xa0(%rbx), %r13d
movl %r13d, %r12d
andl $0x3f, %r12d
movzbl 0xa1(%rbx), %eax
shll $0x2, %eax
andl $0x4, %eax
movl %eax, -0x2c(%rbp)
xorl %r14d, %r14d
movq 0xc8(%rbx), %rax
subq 0x38(%rbx), %rax
movq %rax, %rcx
shrq $0x2, %rcx
shrq $0x3f, %rax
addq %rcx, %rax
shrq %rax
movl %eax, 0x58(%rbx)
incl %r14d
movq %rbx, %rdi
movl $0x9, %esi
callq 0x109e0
cmpl %r15d, %eax
je 0x4f13
shrl $0x6, %r13d
orl -0x2c(%rbp), %r13d
movq 0x148(%rbx), %rax
movabsq $0x6b6e757075616c42, %rcx # imm = 0x6B6E757075616C42
movq %rcx, (%rax)
movw $0x74, 0x8(%rax)
cmpl $0x1, %r14d
je 0x5009
movq 0x150(%rbx), %rdi
leaq 0xe005(%rip), %rsi      # 0x12f86
movl %r14d, %edx
xorl %eax, %eax
callq 0x2060
jmp 0x5009
movq 0x148(%rbx), %rax
movb $0x0, 0x2(%rax)
movw $0x5858, (%rax)         # imm = 0x5858
movl 0xc0(%rbx), %eax
movq 0x160(%rbx), %rcx
movl %eax, (%rcx)
addl $0x7, %eax
sarl $0x3, %eax
testl %eax, %eax
jle 0x4d6b
movq 0x150(%rbx), %r14
movl %eax, %r12d
leaq 0xdf41(%rip), %r15      # 0x12f0c
leaq -0x1(%r12), %r13
movzbl 0x9f(%rbx,%r12), %edx
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2060
addq $0x2, %r14
cmpq $0x1, %r12
movq %r13, %r12
ja 0x4fcb
jmp 0x4d6b
movl %eax, %r12d
andl $0x7f, %r12d
shrl $0x7, %eax
andl $0x1, %ecx
leal (%rax,%rcx,2), %r13d
movq 0x170(%rbx), %rax
movl %r12d, (%rax)
movq 0x160(%rbx), %rax
movl %r13d, (%rax)
bswapl %r12d
movl %r12d, %eax
shll $0x4, %eax
shrl $0x4, %r12d
andl $0x7000000, %r12d       # imm = 0x7000000
orl %eax, %r12d
movl %r12d, %eax
andl $0x33000000, %eax       # imm = 0x33000000
shrl $0x2, %r12d
andl $0x31000000, %r12d      # imm = 0x31000000
leal (%r12,%rax,4), %eax
movl %eax, %ecx
andl $0x55000000, %ecx       # imm = 0x55000000
shrl %eax
andl $0x54000000, %eax       # imm = 0x54000000
leal (%rax,%rcx,2), %eax
shrl $0x19, %eax
orl $0x80, %eax
movq 0x178(%rbx), %rcx
movl %eax, (%rcx)
jmp 0x4d6b
movb $0x0, (%r12)
movb 0xa0(%rbx), %r13b
movl 0xc0(%rbx), %edx
addl $-0x8, %edx
movq %rbx, %rdi
movl $0x8, %esi
callq 0xfd2a
movl %eax, %r14d
xorl %r12d, %r12d
movq 0xc8(%rbx), %rax
subq 0x38(%rbx), %rax
movq %rax, %rcx
shrq $0x2, %rcx
shrq $0x3f, %rax
addq %rcx, %rax
shrq %rax
movl %eax, 0x58(%rbx)
incl %r12d
movl 0xc0(%rbx), %esi
movq %rbx, %rdi
callq 0x109e0
cmpl %r15d, %eax
je 0x509b
cmpl $0x1, %r12d
je 0x50ee
movq 0x150(%rbx), %rdi
leaq 0xdea2(%rip), %rsi      # 0x12f86
movl %r12d, %edx
xorl %eax, %eax
callq 0x2060
movzbl %r13b, %eax
movq 0x170(%rbx), %rcx
movl %eax, (%rcx)
movq 0x160(%rbx), %rax
movl %r14d, (%rax)
jmp 0x4d6b
movq 0x148(%rbx), %rax
movups 0xd6c6(%rip), %xmm0     # 0x127de
movups %xmm0, (%rax)
movw $0x7d, 0x10(%rax)
jmp 0x4d6b