// File: /workspace/github_cpp_makefile_star2_O1/DoubleString[P]RtConverter/src/Rtklib/rt17.cpp
// Function: bamboo::DecodeRawdata(bamboo::raw_t*)
static int DecodeRawdata(raw_t *Raw)
{
    rt17_t *rt17 = (rt17_t*) Raw->rcv_data;
    unsigned char *MessageBuffer = rt17->MessageBuffer;
    int Ret = 0;
    unsigned int rif;
    char *RecordType_s = NULL;
    unsigned char RecordType = MessageBuffer[4];
 
    if (RecordType < (sizeof(RawdataTable) / sizeof(char*)))
        RecordType_s = (char*) RawdataTable[RecordType];

    if (!RecordType_s)
        RecordType_s = "Unknown";
  
    tracet(3, "RT17: Trimble packet type=0x57 (RAWDATA), Recordtype=%d (%s), Length=%d.\n", RecordType, RecordType_s, rt17->MessageLength);
      
    /*
    | Reassemble origional message by removing packet headers,
    | trailers and page framing.
    */
    UnwrapRawdata(rt17, &rif);

    /* Process (or possibly ignore) the message */
    switch (RecordType)
    {
    case 0:
        Ret = DecodeType17(Raw, rif);
        break;
    case 7:
        Ret = DecodeType29(Raw);
        break;
    default:
        tracet(3, "RT17: Packet not processed.\n");      
    }

    return Ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x82ba0(%rdi), %rbx
movq (%rbx), %rax
movzbl 0x4(%rax), %edx
xorl %r14d, %r14d
cmpq $0x7, %rdx
movq %rdi, -0x40(%rbp)
ja 0x38548
leaq 0x5510e(%rip), %rax     # 0x8d650
movq (%rax,%rdx,8), %rax
jmp 0x3854a
xorl %eax, %eax
testq %rax, %rax
leaq 0x3510e(%rip), %rcx     # 0x6d662
cmovneq %rax, %rcx
movl 0x20(%rbx), %r8d
leaq 0x355cc(%rip), %rsi     # 0x6db2f
movl $0x3, %edi
movq %rdx, -0x50(%rbp)
xorl %eax, %eax
callq 0x53ec4
movq (%rbx), %r12
movq %rbx, -0x58(%rbp)
movl 0x20(%rbx), %r15d
movzbl 0x7(%r12), %eax
movl %eax, -0x2c(%rbp)
testl %r15d, %r15d
je 0x385f2
xorl %r14d, %r14d
movq %r12, %rbx
movq %r14, -0x38(%rbp)
movl -0x2c(%rbp), %eax
cmpb 0x7(%r12), %al
je 0x385b3
movl $0x2, %edi
leaq 0x35677(%rip), %rsi     # 0x6dc23
xorl %eax, %eax
callq 0x53ec4
movzbl 0x3(%r12), %r14d
leaq 0x6(%r14), %rax
movq %rax, -0x48(%rbp)
leal -0x4(%r14), %r13d
leaq 0x8(%r12), %rsi
movq %rbx, %rdi
movq %r13, %rdx
callq 0x8a50
addq %r14, %r12
addq $0x6, %r12
addq %r13, %rbx
movq -0x38(%rbp), %rax
addl %r14d, %eax
addl $-0x4, %eax
movq %rax, %r14
subl -0x48(%rbp), %r15d
jne 0x38592
movq -0x58(%rbp), %rax
movl %r14d, 0x20(%rax)
movl %r14d, 0x1c(%rax)
movq -0x50(%rbp), %rax
cmpq $0x7, %rax
je 0x38923
testl %eax, %eax
movq -0x40(%rbp), %rbx
jne 0x38953
movq 0x82ba0(%rbx), %rax
movq (%rax), %r13
movq (%r13), %rax
bswapq %rax
movq %rax, %xmm0
mulsd 0x33742(%rip), %xmm0    # 0x6bd78
movsd %xmm0, -0x38(%rbp)
movq %rbx, %rdi
callq 0x38e30
movl %eax, %edi
movsd -0x38(%rbp), %xmm0
callq 0x4fbc6
movq %rax, -0x38(%rbp)
movsd %xmm0, -0x48(%rbp)
movzbl 0x10(%r13), %ecx
cmpb $0x40, %cl
movl $0x40, %eax
cmovbl %ecx, %eax
testb %cl, %cl
je 0x38994
movzbl %al, %r14d
addq $0x11, %r13
movl -0x2c(%rbp), %eax
andl $0x2, %eax
shrl %eax
leaq (%rax,%rax,2), %rax
movq %rax, -0x50(%rbp)
xorl %r15d, %r15d
movq 0x1d28(%rbx), %rax
movl %r15d, %ebx
movslq %r15d, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x5, %rcx
leaq (%rax,%rcx), %r15
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax,%rcx)
movupd %xmm0, 0x50(%rax,%rcx)
movupd %xmm0, 0x40(%rax,%rcx)
movupd %xmm0, 0x30(%rax,%rcx)
movupd %xmm0, 0x20(%rax,%rcx)
movupd %xmm0, 0x10(%rax,%rcx)
movq -0x38(%rbp), %rdx
movq %rdx, (%rax,%rcx)
movsd -0x48(%rbp), %xmm0
movsd %xmm0, 0x8(%rax,%rcx)
movzbl (%r13), %r12d
movzbl 0x1(%r13), %ecx
movzbl 0x2(%r13), %eax
testb $0x1, -0x2c(%rbp)
jne 0x38710
testb $0x1, 0x3(%r13)
je 0x38990
testb $0x40, %cl
jne 0x3879a
addq $0x8, %r13
jmp 0x387f0
testb $0x40, %cl
jne 0x3871b
addq $0x6, %r13
jmp 0x38751
movb 0x6(%r13), %dl
movb %dl, 0x12(%r15)
movq 0x7(%r13), %rdx
bswapq %rdx
movq %rdx, 0x38(%r15)
testb $0x10, %cl
je 0x38743
movq 0xf(%r13), %rdx
bswapq %rdx
btcq $0x3f, %rdx
movq %rdx, 0x20(%r15)
movl 0x17(%r13), %edx
bswapl %edx
movl %edx, 0x50(%r15)
addq $0x1b, %r13
testb $0x1, %cl
je 0x38791
movb (%r13), %dl
movb %dl, 0x13(%r15)
testb $0x20, %cl
je 0x3878d
movq 0x1(%r13), %rdx
bswapq %rdx
btcq $0x3f, %rdx
movq %rdx, 0x28(%r15)
movl 0x9(%r13), %edx
bswapl %edx
movd %edx, %xmm0
cvtss2sd %xmm0, %xmm0
addsd 0x38(%r15), %xmm0
movsd %xmm0, 0x40(%r15)
addq $0xd, %r13
addq -0x50(%rbp), %r13
jmp 0x38862
movq 0x8(%r13), %rdx
bswapq %rdx
movq %rdx, %xmm0
mulsd 0x320fa(%rip), %xmm0    # 0x6a8a8
cvttsd2si %xmm0, %edx
movb %dl, 0x12(%r15)
movq 0x10(%r13), %rdx
bswapq %rdx
movq %rdx, 0x38(%r15)
testb $0x10, %cl
je 0x387d6
movq 0x18(%r13), %rdx
bswapq %rdx
btcq $0x3f, %rdx
movq %rdx, 0x20(%r15)
movq 0x20(%r13), %rdx
bswapq %rdx
movq %rdx, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x50(%r15)
addq $0x30, %r13
testb $0x1, %cl
je 0x38842
movq (%r13), %rdx
bswapq %rdx
movq %rdx, %xmm0
mulsd 0x3209f(%rip), %xmm0    # 0x6a8a8
cvttsd2si %xmm0, %edx
movb %dl, 0x13(%r15)
testb $0x20, %cl
je 0x3883e
movq 0x8(%r13), %rdx
bswapq %rdx
btcq $0x3f, %rdx
movq %rdx, 0x28(%r15)
movq 0x10(%r13), %rdx
bswapq %rdx
movq %rdx, %xmm0
addsd 0x38(%r15), %xmm0
movsd %xmm0, 0x40(%r15)
addq $0x18, %r13
testb $0x2, -0x2c(%rbp)
je 0x38862
movq 0x4(%r13), %rdx
bswapq %rdx
movq %rdx, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x54(%r15)
addq $0xc, %r13
movl %eax, %esi
andb $0x1, %sil
incb %sil
xorl %edx, %edx
xorpd %xmm2, %xmm2
ucomisd 0x38(%r15), %xmm2
movzbl %sil, %esi
movl $0x0, %edi
cmovnel %esi, %edi
cmovpl %esi, %edi
movb %dil, 0x18(%r15)
movsd 0x40(%r15), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm2, %xmm0
jne 0x3889c
jnp 0x388af
movb $0x14, %dl
testb $0x4, %al
jne 0x388af
xorl %edx, %edx
testb $0x2, %al
setne %dl
leal (%rdx,%rdx,4), %edx
addl $0xe, %edx
movb %dl, 0x19(%r15)
testb $0x2, %cl
je 0x388bd
orb $0x1, 0x15(%r15)
testb $0x4, %cl
je 0x388c7
orb $0x1, 0x16(%r15)
testb $0x4, %al
je 0x388de
movsd 0x40(%r15), %xmm0
ucomisd %xmm1, %xmm0
jne 0x388d9
jnp 0x388de
orb $0x4, 0x16(%r15)
movl $0x1, %edi
movl %r12d, %esi
callq 0x4dbc5
movb %al, 0x10(%r15)
testb %al, %al
je 0x388fb
movl %ebx, %r15d
incl %r15d
jmp 0x38914
movl $0x2, %edi
leaq 0x3536d(%rip), %rsi     # 0x6dc74
movl %r12d, %edx
xorl %eax, %eax
callq 0x53ec4
movl %ebx, %r15d
movq -0x40(%rbp), %rbx
decl %r14d
jne 0x3868b
jmp 0x38997
movq -0x40(%rbp), %rdi
movq 0x82ba0(%rdi), %rax
movq (%rax), %rax
movzbl (%rax), %edx
cmpl $0x6, %edx
ja 0x3896a
leaq 0x3542a(%rip), %rsi     # 0x6dd6a
xorl %ebx, %ebx
movl $0x2, %edi
xorl %eax, %eax
callq 0x53ec4
jmp 0x389e6
leaq 0x3521f(%rip), %rsi     # 0x6db79
xorl %ebx, %ebx
movl $0x3, %edi
xorl %eax, %eax
callq 0x53ec4
jmp 0x389e6
movzbl 0x2(%rax), %ecx
movzbl 0x1(%rax), %edx
shll $0x8, %edx
movswl %dx, %esi
orl %ecx, %esi
movl 0x3(%rax), %eax
bswapl %eax
cvtsi2sd %eax, %xmm0
mulsd 0x333ed(%rip), %xmm0    # 0x6bd78
callq 0x38d87
xorl %ebx, %ebx
jmp 0x389e6
xorl %r15d, %r15d
movq -0x38(%rbp), %rax
movq %rax, (%rbx)
movsd -0x48(%rbp), %xmm0
movsd %xmm0, 0x8(%rbx)
movl %r15d, 0x1d20(%rbx)
testl %r15d, %r15d
jle 0x389de
leaq 0x352e0(%rip), %rsi     # 0x6dc9b
movl $0x2, %edi
xorl %eax, %eax
callq 0x53ec4
movq 0x1d28(%rbx), %rsi
movl 0x1d20(%rbx), %edx
movl $0x2, %edi
callq 0x53eca
xorl %ebx, %ebx
testl %r15d, %r15d
setg %bl
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq