// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x48(%rdi), %eax
cmpq $0x20, %rax
je 0xc197
cmpl $0xc, %eax
jne 0xc2b1
movss 0x9c(%rbx), %xmm0
movss 0x140(%rbx), %xmm1
mulss 0x54ad(%rip), %xmm0     # 0x1165c
ucomiss %xmm0, %xmm1
jb 0xc2b1
cvtss2sd 0x1d0(%rbx), %xmm0
movsd 0x52a8(%rip), %xmm1     # 0x11470
mulsd %xmm0, %xmm1
cvtss2sd 0x1dc(%rbx), %xmm2
ucomisd %xmm1, %xmm2
ja 0xc2b1
mulsd 0x501a(%rip), %xmm0     # 0x11200
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xe8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0xa0(%rbx)
movq 0x38(%rbx), %rdx
movq %rdx, 0xc8(%rbx)
andq $0x0, 0xc0(%rbx)
leaq 0xa0(%rbx), %rsi
leal -0x1(%rax), %edi
xorl %r8d, %r8d
cmpq %r8, %rax
je 0xc260
movss (%rdx,%r8,8), %xmm1
movss 0xe8(%rbx), %xmm0
ucomiss %xmm0, %xmm1
jbe 0xc25b
movss 0x4(%rdx,%r8,8), %xmm1
ucomiss %xmm0, %xmm1
jbe 0xc245
cmpq %rdi, %r8
jb 0xc2b1
movl %r8d, %ecx
andb $0x7, %cl
movb $0x1, %r9b
shlb %cl, %r9b
movl %r8d, %ecx
shrl $0x3, %ecx
orb %r9b, (%rsi,%rcx)
incq %r8
jmp 0xc21c
movq 0x148(%rbx), %rcx
cmpl $0xc, %eax
jne 0xc2b8
movl $0x323146, (%rcx)       # imm = 0x323146
movzbl 0xa0(%rbx), %eax
andl $0x7, %eax
movq 0x160(%rbx), %rcx
movl %eax, (%rcx)
movl 0xa0(%rbx), %eax
shrl $0x3, %eax
andl $0x1, %eax
movq 0x168(%rbx), %rcx
movl %eax, (%rcx)
pushq $0x4
popq %rsi
pushq $0x8
popq %rdx
movq %rbx, %rdi
callq 0xebd6
movq 0x170(%rbx), %rcx
movl %eax, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movl $0x323346, (%rcx)       # imm = 0x323346
movzbl 0xa0(%rbx), %ecx
bswapl %ecx
movl %ecx, %eax
shrl $0x4, %eax
movl $0xf000000, %edx        # imm = 0xF000000
andl %edx, %eax
shll $0x4, %ecx
orl %eax, %ecx
movl $0x33000000, %eax       # imm = 0x33000000
movl %ecx, %esi
andl %eax, %esi
shrl $0x2, %ecx
andl %eax, %ecx
leal (%rcx,%rsi,4), %esi
movl $0x55000000, %ecx       # imm = 0x55000000
movl %esi, %edi
andl %ecx, %edi
shrl %esi
andl %ecx, %esi
leal (%rsi,%rdi,2), %esi
shrl $0x18, %esi
movq 0x160(%rbx), %rdi
movl %esi, (%rdi)
movzbl 0xa1(%rbx), %esi
bswapl %esi
movl %esi, %edi
shrl $0x4, %edi
andl %edx, %edi
shll $0x4, %esi
orl %edi, %esi
movl %esi, %edi
andl %eax, %edi
shrl $0x2, %esi
andl %eax, %esi
leal (%rsi,%rdi,4), %esi
movl %esi, %edi
andl %ecx, %edi
shrl %esi
andl %ecx, %esi
leal (%rsi,%rdi,2), %esi
shrl $0x18, %esi
movq 0x168(%rbx), %rdi
movl %esi, (%rdi)
movzbl 0xa2(%rbx), %esi
bswapl %esi
movl %esi, %edi
shrl $0x4, %edi
andl %edx, %edi
shll $0x4, %esi
orl %edi, %esi
movl %esi, %edi
andl %eax, %edi
shrl $0x2, %esi
andl %eax, %esi
leal (%rsi,%rdi,4), %esi
movl %esi, %edi
andl %ecx, %edi
shrl %esi
andl %ecx, %esi
leal (%rsi,%rdi,2), %esi
shrl $0x18, %esi
movq 0x170(%rbx), %rdi
movl %esi, (%rdi)
movq 0x150(%rbx), %rdi
movzbl 0xa3(%rbx), %esi
bswapl %esi
movl %esi, %r8d
shrl $0x4, %r8d
andl %edx, %r8d
shll $0x4, %esi
orl %r8d, %esi
movl %esi, %edx
andl %eax, %edx
shrl $0x2, %esi
andl %eax, %esi
leal (%rsi,%rdx,4), %eax
movl %eax, %edx
andl %ecx, %edx
shrl %eax
andl %ecx, %eax
leal (%rax,%rdx,2), %edx
shrl $0x18, %edx
leaq 0x59da(%rip), %rsi      # 0x11d90
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2060
nop