// File: /workspace/github_cpp_makefile_star2_O3/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
movl 0x48(%rdi), %eax
cmpq $0x20, %rax
je 0xcf3c
cmpl $0xc, %eax
jne 0xd064
movss 0x9c(%rdi), %xmm0
movss 0x140(%rdi), %xmm1
mulss 0x5708(%rip), %xmm0     # 0x1265c
ucomiss %xmm0, %xmm1
jb 0xd064
xorps %xmm0, %xmm0
cvtss2sd 0x1d0(%rdi), %xmm0
movsd 0x5500(%rip), %xmm1     # 0x12470
mulsd %xmm0, %xmm1
cvtss2sd 0x1dc(%rdi), %xmm2
ucomisd %xmm1, %xmm2
ja 0xd064
mulsd 0x5272(%rip), %xmm0     # 0x12200
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xe8(%rdi)
leaq 0xa0(%rdi), %rdx
xorps %xmm0, %xmm0
movups %xmm0, 0xa0(%rdi)
movq 0x38(%rdi), %rsi
movq %rsi, 0xc8(%rdi)
movq $0x0, 0xc0(%rdi)
leal -0x1(%rax), %r8d
xorl %r9d, %r9d
movss (%rsi,%r9,8), %xmm1
movss 0xe8(%rdi), %xmm0
ucomiss %xmm0, %xmm1
jbe 0xd002
movss 0x4(%rsi,%r9,8), %xmm1
ucomiss %xmm0, %xmm1
jbe 0xcfec
cmpq %r8, %r9
jb 0xd064
movl %r9d, %ecx
andb $0x7, %cl
movb $0x1, %r10b
shlb %cl, %r10b
movl %r9d, %ecx
shrl $0x3, %ecx
orb %r10b, (%rdx,%rcx)
incq %r9
cmpq %r9, %rax
jne 0xcfc8
movq 0x148(%rdi), %rcx
cmpl $0xc, %eax
jne 0xd066
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 0x5c12(%rip), %rsi      # 0x12d90
movq %rax, %rdi
xorl %eax, %eax
popq %rbp
jmp 0x2060
nop