// File: /workspace/github_cpp_makefile_star2_O1/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 0xde9b
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movss 0x140(%rdi), %xmm0
ucomiss 0x4943(%rip), %xmm0     # 0x12584
jb 0xde97
movss 0x98(%rbx), %xmm0
movss 0x4a31(%rip), %xmm1     # 0x12688
ucomiss %xmm0, %xmm1
ja 0xde97
ucomiss 0x4a25(%rip), %xmm0     # 0x1268c
ja 0xde97
movss 0x9c(%rbx), %xmm0
movss 0x4a13(%rip), %xmm1     # 0x12690
ucomiss %xmm0, %xmm1
ja 0xde97
ucomiss 0x4a07(%rip), %xmm0     # 0x12694
ja 0xde97
movss 0x4861(%rip), %xmm0     # 0x124fc
ucomiss 0x180(%rbx), %xmm0
ja 0xde97
movss 0x184(%rbx), %xmm0
ucomiss 0x49e1(%rip), %xmm0     # 0x12698
ja 0xde97
movss 0x4923(%rip), %xmm0     # 0x125e8
ucomiss 0x18c(%rbx), %xmm0
ja 0xde97
movss 0x190(%rbx), %xmm0
ucomiss 0x4937(%rip), %xmm0     # 0x12618
ja 0xde97
xorps %xmm0, %xmm0
movups %xmm0, 0xa0(%rbx)
movq 0x38(%rbx), %rax
movq 0x148(%rbx), %rcx
movq %rax, 0xc8(%rbx)
movq $0x0, 0xc0(%rbx)
movl $0x2d4b41, (%rcx)       # imm = 0x2D4B41
movq 0x148(%rbx), %r14
movq %r14, %rdi
callq 0x2090
addq %r14, %rax
movq 0x38(%rbx), %rdx
addq $0x4, %rdx
cmpq 0x40(%rbx), %rdx
ja 0xddee
leaq 0xa0(%rbx), %rsi
xorl %r8d, %r8d
movl $0x2d, %edi
cvttss2si (%rdx), %ecx
movb $0x30, (%rax)
incq %rax
cmpq 0x40(%rbx), %rdx
je 0xdd71
movslq %ecx, %rcx
imulq $0x4da637d, %rcx, %rcx  # imm = 0x4DA637D
movq %rcx, %r9
shrq $0x3f, %r9
sarq $0x24, %rcx
addl %r9d, %ecx
jmp 0xdd81
movb $0x1, %cl
cmpl $0x20, %r8d
jg 0xdddc
movl $0x21, %ecx
subl %r8d, %ecx
movl %ecx, %r9d
sarl $0x1f, %r9d
notl %r9d
andl %ecx, %r9d
addl $-0xc, %r8d
movl %r8d, %r10d
movl %r10d, %ecx
roll $0x1e, %ecx
cmpl $0x5, %ecx
ja 0xddab
btl %ecx, %edi
jae 0xddab
movb $0x2d, (%rax)
incq %rax
leal 0xd(%r10), %r8d
subl $0x1, %r9d
jb 0xddda
movl %r8d, %ecx
andb $0x7, %cl
movl $0x1, %r11d
shll %cl, %r11d
movb $0x31, (%rax)
incq %rax
sarl $0x3, %r8d
movslq %r8d, %rcx
orb %r11b, (%rsi,%rcx)
incl %r10d
jmp 0xdd95
xorl %ecx, %ecx
testb %cl, %cl
jne 0xddee
addq $0x8, %rdx
cmpq 0x40(%rbx), %rdx
jbe 0xdd47
movb $0x0, (%rax)
movzbl 0xa0(%rbx), %eax
shrl $0x7, %eax
movzbl 0xa1(%rbx), %ecx
andl $0x3, %ecx
leal (%rax,%rcx,2), %eax
movq 0x168(%rbx), %rcx
movl %eax, (%rcx)
movl 0xa0(%rbx), %eax
shrl $0x3, %eax
andl $0xf, %eax
movq 0x160(%rbx), %rcx
movl %eax, (%rcx)
movzbl 0xa1(%rbx), %eax
shrl $0x5, %eax
movzbl 0xa2(%rbx), %ecx
andl $0xf, %ecx
leal (%rax,%rcx,8), %eax
movq 0x170(%rbx), %rcx
movl %eax, (%rcx)
bswapl %eax
movl %eax, %ecx
shll $0x4, %ecx
shrl $0x4, %eax
andl $0x7000000, %eax        # imm = 0x7000000
orl %ecx, %eax
movl %eax, %ecx
andl $0x33000000, %ecx       # imm = 0x33000000
shrl $0x2, %eax
andl $0x31000000, %eax       # imm = 0x31000000
leal (%rax,%rcx,4), %eax
movl %eax, %ecx
andl $0x55000000, %ecx       # imm = 0x55000000
shrl %eax
andl $0x54000000, %eax       # imm = 0x54000000
leal (%rax,%rcx,2), %eax
shrl $0x18, %eax
movzbl 0xa2(%rbx), %ecx
shrl $0x5, %ecx
andl $0x1, %ecx
orl %eax, %ecx
movq 0x178(%rbx), %rax
movl %ecx, (%rax)
popq %rbx
popq %r14
popq %rbp
retq