// File: /workspace/github_cpp_makefile_star2_O2/probonopd[P]decodeir/DecodeIR.cpp
// Function: Signal::tryAK()
void Signal::tryAK()
{
	if ( nFrameL < 5 )
		return;
	if (!framed(10000) || nTotDur < 16*844 || nTotDur > 40*844)
		return;
	if (nMaxDur < 3*844 || nMaxDur > 10*844)
		return;
	if (sortOn.min1 < 300 || sortOn.max1 > 450)
		return;
	if (sortOff.min1 < 350 || sortOff.max1 > 6000)
		return;
	cleanup();
	strcpy(pProtocol, "AK-");
	char *pt = pProtocol+strlen(pProtocol);
	int count=0;
	for (float *pd=pFrame+1; pd<=pFrameEnd ;pd+=2)
	{
		int bt = (int)(*pd) / 844;
		*(pt++)='0';
		if (pd==pFrameEnd)
		{
			if (count >= 33)
				break;
			bt = 33 - count;
		}
		for (;;)
		{
			++count;
			if (count == 13 || count==21 || count==25 || count==33)
			{
				*(pt++)='-';
			}
			if (--bt < 0)
				break;
			*(pt++)='1';
			cBits[count>>3] |= 1 << (count & 7);
		}
	}
	*pt = 0;
	*pSubDevice = getLsb(7,3);
	*pDevice = getLsb(3,4);
	*pOBC = getLsb(13,7);
	*pHex = msb(*pOBC) + getLsb(21,1);

}

// Assembly:
cmpl $0x5, 0x48(%rdi)
jl 0xcff4
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movss 0x140(%rdi), %xmm0
ucomiss 0x48af(%rip), %xmm0     # 0x11684
jb 0xcfec
movss 0x98(%rbx), %xmm0
movss 0x489d(%rip), %xmm1     # 0x11688
ucomiss %xmm0, %xmm1
ja 0xcfec
ucomiss 0x4891(%rip), %xmm0     # 0x1168c
ja 0xcfec
movss 0x9c(%rbx), %xmm0
movss 0x487f(%rip), %xmm1     # 0x11690
ucomiss %xmm0, %xmm1
ja 0xcfec
ucomiss 0x4873(%rip), %xmm0     # 0x11694
ja 0xcfec
movss 0x46cd(%rip), %xmm0     # 0x114fc
ucomiss 0x180(%rbx), %xmm0
ja 0xcfec
movss 0x184(%rbx), %xmm0
ucomiss 0x484d(%rip), %xmm0     # 0x11698
ja 0xcfec
movss 0x478b(%rip), %xmm0     # 0x115e4
ucomiss 0x18c(%rbx), %xmm0
ja 0xcfec
movss 0x190(%rbx), %xmm0
ucomiss 0x479f(%rip), %xmm0     # 0x11614
ja 0xcfec
xorps %xmm0, %xmm0
movups %xmm0, 0xa0(%rbx)
movq 0x38(%rbx), %rax
movq 0x148(%rbx), %rcx
movq %rax, 0xc8(%rbx)
andq $0x0, 0xc0(%rbx)
leaq 0xa0(%rbx), %r15
movl $0x2d4b41, (%rcx)       # imm = 0x2D4B41
movq 0x148(%rbx), %r14
movq %r14, %rdi
callq 0x20a0
movq %rax, %rsi
addq %r14, %rsi
movq 0x38(%rbx), %rdi
addq $0x4, %rdi
xorl %r14d, %r14d
movl $0x34c, %r8d            # imm = 0x34C
pushq $0x21
popq %r9
pushq $0x1
popq %r10
pushq $0x2d
popq %r11
cmpq 0x40(%rbx), %rdi
ja 0xcf52
cvttss2si (%rdi), %eax
cltd
idivl %r8d
movb $0x30, (%rsi)
incq %rsi
cmpq 0x40(%rbx), %rdi
jne 0xcf04
cmpl $0x20, %r14d
jg 0xcf52
movl %r9d, %eax
subl %r14d, %eax
addl $-0xc, %r14d
movl %r14d, %edx
movl %edx, %ecx
roll $0x1e, %ecx
cmpl $0x5, %ecx
ja 0xcf21
btl %ecx, %r11d
jae 0xcf21
movb $0x2d, (%rsi)
incq %rsi
leal 0xd(%rdx), %r14d
testl %eax, %eax
jle 0xcf4c
decl %eax
movl %r14d, %ecx
andb $0x7, %cl
movl %r10d, %r12d
shll %cl, %r12d
movb $0x31, (%rsi)
incq %rsi
sarl $0x3, %r14d
movslq %r14d, %rcx
orb %r12b, (%r15,%rcx)
incl %edx
jmp 0xcf0b
addq $0x8, %rdi
jmp 0xcede
movb $0x0, (%rsi)
pushq $0x7
popq %r14
pushq $0x3
popq %rdx
movq %rbx, %rdi
movl %r14d, %esi
callq 0xebd6
movq 0x168(%rbx), %rcx
movl %eax, (%rcx)
movl 0xa0(%rbx), %eax
shrl $0x3, %eax
andl $0xf, %eax
movq 0x160(%rbx), %rcx
movl %eax, (%rcx)
pushq $0xd
popq %rsi
movq %rbx, %rdi
movl %r14d, %edx
callq 0xebd6
movq 0x170(%rbx), %rcx
movl %eax, (%rcx)
bswapl %eax
movl %eax, %ecx
shrl $0x4, %ecx
movl $0xf0f0f0f, %edx        # imm = 0xF0F0F0F
andl %edx, %ecx
andl %edx, %eax
shll $0x4, %eax
orl %ecx, %eax
movl $0x33333333, %ecx       # imm = 0x33333333
movl %eax, %edx
andl %ecx, %edx
shrl $0x2, %eax
andl %ecx, %eax
leal (%rax,%rdx,4), %eax
movl $0x55000000, %ecx       # imm = 0x55000000
movl %eax, %edx
andl %ecx, %edx
shrl %eax
andl %ecx, %eax
leal (%rax,%rdx,2), %eax
shrl $0x18, %eax
movzbl 0xa2(%rbx), %ecx
btl $0x5, %ecx
adcl $0x0, %eax
movq 0x178(%rbx), %rcx
movl %eax, (%rcx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop