// File: /workspace/github_cpp_makefile_star2_O1/probonopd[P]decodeir/DecodeIR.cpp
// Function: Signal::tryF12()
void Signal::tryF12()   //  K=(D:3,H:1,F:8) {37.9k,422}<1,-3|3,-1>(K,-80,K) for H=0. 
						//{37.9k,422}<1,-3|3,-1>(K,-80,K,-208,K,-80,K)+ for H=1. 
		//F32:			//{38k,420, msb}<1,-3|3,-1>(D:8,S:8,F:8,E:8,-100m)* 
{
	if ( nFrameL != 12 && nFrameL != 32 || !framed(nMaxDur*16) )
		return;
    if ( sortBurst.min1 * 1.15 < sortBurst.max1 )
        return;
    nMaxShort = sortBurst.min1 * .4;
    cleanup();
	for (int ndx=0; ndx<nFrameL; ++ndx)
	{
		if (pFrame[2*ndx] > nMaxShort)
		{
			if (pFrame[2*ndx+1] > nMaxShort && ndx<nFrameL-1)
				return;
			cBits[ndx>>3] |= 1 << (ndx&7);
		}
	}
	if (nFrameL == 12) {
		strcpy(pProtocol,"F12");
		*pDevice = getLsb(0,3);
		*pSubDevice = getLsb(3,1);
		*pOBC = getLsb(4,8);
	}
	else {
		strcpy(pProtocol,"F32");
		*pDevice = msb(cBits[0]);
		*pSubDevice =  msb(cBits[1]);
		*pOBC =  msb(cBits[2]);
		sprintf(pMisc, "E = %d",  msb(cBits[3]));
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movslq 0x48(%rdi), %rax
cmpq $0x20, %rax
je 0xcec9
cmpl $0xc, %eax
jne 0xd00e
movss 0x9c(%rdi), %xmm0
movss 0x140(%rdi), %xmm1
mulss 0x577f(%rip), %xmm0     # 0x12660
ucomiss %xmm0, %xmm1
jb 0xd00e
xorps %xmm0, %xmm0
cvtss2sd 0x1d0(%rdi), %xmm0
movsd 0x5573(%rip), %xmm1     # 0x12470
mulsd %xmm0, %xmm1
cvtss2sd 0x1dc(%rdi), %xmm2
ucomisd %xmm1, %xmm2
ja 0xd00e
mulsd 0x52e5(%rip), %xmm0     # 0x12200
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xe8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0xa0(%rdi)
movq 0x38(%rdi), %rdx
movq %rdx, 0xc8(%rdi)
movq $0x0, 0xc0(%rdi)
testl %eax, %eax
setg %cl
jle 0xcfb4
leaq 0xa0(%rdi), %rsi
leaq -0x1(%rax), %r8
xorl %r9d, %r9d
movss (%rdx,%r9,8), %xmm1
movss 0xe8(%rdi), %xmm0
ucomiss %xmm0, %xmm1
jbe 0xcf9f
movss 0x4(%rdx,%r9,8), %xmm1
ucomiss %xmm0, %xmm1
seta %r10b
cmpq %r8, %r9
setl %r11b
testb %r11b, %r10b
jne 0xcfaf
movl %r9d, %ecx
andb $0x7, %cl
movb $0x1, %r10b
shlb %cl, %r10b
movl %r9d, %ecx
shrl $0x3, %ecx
orb %r10b, (%rsi,%rcx)
incq %r9
cmpq %rax, %r9
setb %cl
cmpq %r9, %rax
jne 0xcf5c
jmp 0xcfb4
testb $0x1, %cl
jne 0xd00e
movq 0x148(%rdi), %rcx
cmpl $0xc, %eax
jne 0xd010
movl $0x323146, (%rcx)       # imm = 0x323146
movzbl 0xa0(%rdi), %eax
andl $0x7, %eax
movq 0x160(%rdi), %rcx
movl %eax, (%rcx)
movl 0xa0(%rdi), %eax
shrl $0x3, %eax
andl $0x1, %eax
movq 0x168(%rdi), %rcx
movl %eax, (%rcx)
movb 0xa0(%rdi), %al
movb 0xa1(%rdi), %cl
shrb $0x4, %al
shlb $0x4, %cl
orb %al, %cl
movzbl %cl, %eax
movq 0x170(%rdi), %rcx
movl %eax, (%rcx)
popq %rbp
retq
movl $0x323346, (%rcx)       # imm = 0x323346
movzbl 0xa0(%rdi), %eax
bswapl %eax
movl %eax, %ecx
shrl $0x4, %ecx
movl $0xf000000, %esi        # imm = 0xF000000
andl %esi, %ecx
shll $0x4, %eax
orl %ecx, %eax
movl $0x33000000, %ecx       # imm = 0x33000000
movl %eax, %edx
andl %ecx, %edx
shrl $0x2, %eax
andl %ecx, %eax
leal (%rax,%rdx,4), %eax
movl $0x55000000, %edx       # imm = 0x55000000
movl %eax, %r8d
andl %edx, %r8d
shrl %eax
andl %edx, %eax
leal (%rax,%r8,2), %eax
shrl $0x18, %eax
movq 0x160(%rdi), %r8
movl %eax, (%r8)
movzbl 0xa1(%rdi), %eax
bswapl %eax
movl %eax, %r8d
shrl $0x4, %r8d
andl %esi, %r8d
shll $0x4, %eax
orl %r8d, %eax
movl %eax, %r8d
andl %ecx, %r8d
shrl $0x2, %eax
andl %ecx, %eax
leal (%rax,%r8,4), %eax
movl %eax, %r8d
andl %edx, %r8d
shrl %eax
andl %edx, %eax
leal (%rax,%r8,2), %eax
shrl $0x18, %eax
movq 0x168(%rdi), %r8
movl %eax, (%r8)
movzbl 0xa2(%rdi), %eax
bswapl %eax
movl %eax, %r8d
shrl $0x4, %r8d
andl %esi, %r8d
shll $0x4, %eax
orl %r8d, %eax
movl %eax, %r8d
andl %ecx, %r8d
shrl $0x2, %eax
andl %ecx, %eax
leal (%rax,%r8,4), %eax
movl %eax, %r8d
andl %edx, %r8d
shrl %eax
andl %edx, %eax
leal (%rax,%r8,2), %eax
shrl $0x18, %eax
movq 0x170(%rdi), %r8
movl %eax, (%r8)
movq 0x150(%rdi), %rax
movzbl 0xa3(%rdi), %edi
bswapl %edi
movl %edi, %r8d
shrl $0x4, %r8d
andl %esi, %r8d
shll $0x4, %edi
orl %r8d, %edi
movl %edi, %esi
andl %ecx, %esi
shrl $0x2, %edi
andl %ecx, %edi
leal (%rdi,%rsi,4), %ecx
movl %ecx, %esi
andl %edx, %esi
shrl %ecx
andl %edx, %ecx
leal (%rcx,%rsi,2), %edx
shrl $0x18, %edx
leaq 0x5c71(%rip), %rsi      # 0x12d99
movq %rax, %rdi
xorl %eax, %eax
popq %rbp
jmp 0x2060
nop