// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpl $0x5, 0x48(%rax)
jge 0x1308f
jmp 0x13368
movq -0x30(%rbp), %rdi
movss 0x7009(%rip), %xmm0     # 0x1a0a4
callq 0x18840
cmpl $0x0, %eax
je 0x130d3
movq -0x30(%rbp), %rax
movss 0x70b7(%rip), %xmm0     # 0x1a168
ucomiss 0x98(%rax), %xmm0
ja 0x130d3
movq -0x30(%rbp), %rax
movss 0x98(%rax), %xmm0
movss 0x709e(%rip), %xmm1     # 0x1a16c
ucomiss %xmm1, %xmm0
jbe 0x130d8
jmp 0x13368
movq -0x30(%rbp), %rax
movss 0x708c(%rip), %xmm0     # 0x1a170
ucomiss 0x9c(%rax), %xmm0
ja 0x13106
movq -0x30(%rbp), %rax
movss 0x9c(%rax), %xmm0
movss 0x7073(%rip), %xmm1     # 0x1a174
ucomiss %xmm1, %xmm0
jbe 0x1310b
jmp 0x13368
movq -0x30(%rbp), %rax
movss 0x7061(%rip), %xmm0     # 0x1a178
ucomiss 0x180(%rax), %xmm0
ja 0x13139
movq -0x30(%rbp), %rax
movss 0x184(%rax), %xmm0
movss 0x7048(%rip), %xmm1     # 0x1a17c
ucomiss %xmm1, %xmm0
jbe 0x1313e
jmp 0x13368
movq -0x30(%rbp), %rax
movss 0x6f72(%rip), %xmm0     # 0x1a0bc
ucomiss 0x18c(%rax), %xmm0
ja 0x1316c
movq -0x30(%rbp), %rax
movss 0x190(%rax), %xmm0
movss 0x6f7d(%rip), %xmm1     # 0x1a0e4
ucomiss %xmm1, %xmm0
jbe 0x13171
jmp 0x13368
movq -0x30(%rbp), %rdi
callq 0x16180
movq -0x30(%rbp), %rax
movq 0x148(%rax), %rdi
leaq 0x7f80(%rip), %rsi      # 0x1b10c
callq 0x2120
movq -0x30(%rbp), %rax
movq 0x148(%rax), %rcx
movq %rcx, -0x38(%rbp)
movq 0x148(%rax), %rdi
callq 0x20a0
movq -0x38(%rbp), %rcx
movq %rax, %rdx
movq -0x30(%rbp), %rax
addq %rdx, %rcx
movq %rcx, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq 0x38(%rax), %rax
addq $0x4, %rax
movq %rax, -0x20(%rbp)
movq -0x30(%rbp), %rcx
movq -0x20(%rbp), %rax
cmpq 0x40(%rcx), %rax
ja 0x132c6
movq -0x30(%rbp), %rcx
movq -0x20(%rbp), %rax
cvttss2si (%rax), %eax
movl $0x34c, %esi            # imm = 0x34C
cltd
idivl %esi
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb $0x30, (%rax)
movq -0x20(%rbp), %rax
cmpq 0x40(%rcx), %rax
jne 0x1322c
cmpl $0x21, -0x14(%rbp)
jl 0x13221
jmp 0x132c6
movl $0x21, %eax
subl -0x14(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x1322e
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
cmpl $0xd, -0x14(%rbp)
je 0x1324f
cmpl $0x15, -0x14(%rbp)
je 0x1324f
cmpl $0x19, -0x14(%rbp)
je 0x1324f
cmpl $0x21, -0x14(%rbp)
jne 0x13261
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb $0x2d, (%rax)
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, %eax
jge 0x13271
jmp 0x132b3
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb $0x31, (%rcx)
movl -0x14(%rbp), %ecx
andl $0x7, %ecx
movl $0x1, %esi
shll %cl, %esi
movl -0x14(%rbp), %ecx
sarl $0x3, %ecx
movslq %ecx, %rcx
movzbl 0xa0(%rax,%rcx), %edx
orl %esi, %edx
movb %dl, 0xa0(%rax,%rcx)
jmp 0x1322e
jmp 0x132b5
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
jmp 0x131d1
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rax
movb $0x0, (%rax)
movl $0x7, %esi
movl $0x3, %edx
callq 0x16030
movq -0x30(%rbp), %rdi
movl %eax, %ecx
movq 0x168(%rdi), %rax
movl %ecx, (%rax)
movl $0x3, %esi
movl $0x4, %edx
callq 0x16030
movq -0x30(%rbp), %rdi
movl %eax, %ecx
movq 0x160(%rdi), %rax
movl %ecx, (%rax)
movl $0xd, %esi
movl $0x7, %edx
callq 0x16030
movq -0x30(%rbp), %rdi
movl %eax, %ecx
movq 0x170(%rdi), %rax
movl %ecx, (%rax)
movq 0x170(%rdi), %rax
movl (%rax), %esi
movl $0x8, %edx
callq 0x15e70
movq -0x30(%rbp), %rdi
movl %eax, -0x3c(%rbp)
movl $0x15, %esi
movl $0x1, %edx
callq 0x16030
movl -0x3c(%rbp), %ecx
movl %eax, %edx
movq -0x30(%rbp), %rax
addl %edx, %ecx
movq 0x178(%rax), %rax
movl %ecx, (%rax)
addq $0x40, %rsp
popq %rbp
retq
nop