// File: /workspace/github_cpp_makefile_star2_O3/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 %rdi, -0x40(%rbp)
movq 0x82ba0(%rdi), %rbx
movq (%rbx), %rax
movzbl 0x4(%rax), %edx
xorl %r13d, %r13d
cmpq $0x7, %rdx
ja 0x37ecb
leaq 0x5592b(%rip), %rax     # 0x8d7f0
movq (%rax,%rdx,8), %rax
jmp 0x37ecd
xorl %eax, %eax
testq %rax, %rax
leaq 0x3578b(%rip), %rcx     # 0x6d662
cmovneq %rax, %rcx
movl 0x20(%rbx), %r8d
leaq 0x35c49(%rip), %rsi     # 0x6db2f
movl $0x3, %edi
movq %rdx, -0x48(%rbp)
xorl %eax, %eax
callq 0x5342c
movq (%rbx), %r12
movq %rbx, -0x58(%rbp)
movl 0x20(%rbx), %r15d
movzbl 0x7(%r12), %eax
movl %eax, -0x2c(%rbp)
testl %r15d, %r15d
je 0x37f73
xorl %r13d, %r13d
movq %r12, %r14
movq %r13, -0x38(%rbp)
movl -0x2c(%rbp), %eax
cmpb 0x7(%r12), %al
je 0x37f36
movl $0x2, %edi
leaq 0x35cf4(%rip), %rsi     # 0x6dc23
xorl %eax, %eax
callq 0x5342c
movzbl 0x3(%r12), %ebx
leaq 0x6(%rbx), %rax
movq %rax, -0x50(%rbp)
leal -0x4(%rbx), %r13d
leaq 0x8(%r12), %rsi
movq %r14, %rdi
movq %r13, %rdx
callq 0x8a40
addq %rbx, %r12
addq $0x6, %r12
addq %r13, %r14
movq -0x38(%rbp), %r13
addl %ebx, %r13d
addl $-0x4, %r13d
subl -0x50(%rbp), %r15d
jne 0x37f15
movq -0x58(%rbp), %rax
movl %r13d, 0x20(%rax)
movl %r13d, 0x1c(%rax)
movq -0x48(%rbp), %rax
cmpq $0x7, %rax
je 0x38312
testl %eax, %eax
movq -0x40(%rbp), %rbx
jne 0x3833f
movq 0x82ba0(%rbx), %rax
movq (%rax), %r13
movq (%r13), %rax
bswapq %rax
movq %rax, %xmm0
mulsd 0x33dc1(%rip), %xmm0    # 0x6bd78
movsd %xmm0, -0x38(%rbp)
movq %rbx, %rdi
callq 0x387e0
movl %eax, %edi
movsd -0x38(%rbp), %xmm0
callq 0x4f24a
movq %rax, %rsi
movzbl 0x10(%r13), %ecx
cmpb $0x40, %cl
movl $0x40, %eax
cmovbl %ecx, %eax
testb %cl, %cl
je 0x3837e
movzbl %al, %r15d
addq $0x11, %r13
movl -0x2c(%rbp), %eax
andl $0x2, %eax
shrl %eax
leaq (%rax,%rax,2), %rax
movq %rax, -0x48(%rbp)
xorl %r14d, %r14d
movsd %xmm0, -0x38(%rbp)
movq %rsi, -0x50(%rbp)
movq 0x1d28(%rbx), %rax
movslq %r14d, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x5, %rcx
leaq (%rax,%rcx), %rdx
pxor %xmm1, %xmm1
movdqu %xmm1, 0x50(%rax,%rcx)
movdqu %xmm1, 0x40(%rax,%rcx)
movdqu %xmm1, 0x30(%rax,%rcx)
movdqu %xmm1, 0x20(%rax,%rcx)
movdqu %xmm1, 0x10(%rax,%rcx)
movq %rsi, (%rax,%rcx)
movsd %xmm0, 0x8(%rax,%rcx)
movzbl (%r13), %r12d
movzbl 0x1(%r13), %edi
movzbl 0x2(%r13), %esi
testb $0x1, -0x2c(%rbp)
jne 0x3808c
testb $0x1, 0x3(%r13)
je 0x38390
xorpd %xmm0, %xmm0
testb $0x40, %dil
jne 0x38127
addq $0x8, %r13
pxor %xmm1, %xmm1
jmp 0x38183
xorpd %xmm0, %xmm0
testb $0x40, %dil
jne 0x380a0
addq $0x6, %r13
pxor %xmm1, %xmm1
jmp 0x380dd
movb 0x6(%r13), %r8b
movb %r8b, 0x12(%rdx)
movq 0x7(%r13), %r8
bswapq %r8
movq %r8, 0x38(%rdx)
testb $0x10, %dil
je 0x380c9
movq 0xf(%r13), %r9
bswapq %r9
btcq $0x3f, %r9
movq %r9, 0x20(%rdx)
movq %r8, %xmm1
movl 0x17(%r13), %r8d
bswapl %r8d
movl %r8d, 0x50(%rdx)
addq $0x1b, %r13
testb $0x1, %dil
je 0x3811e
movb (%r13), %r8b
movb %r8b, 0x13(%rdx)
testb $0x20, %dil
je 0x3811a
movq 0x1(%r13), %r8
bswapq %r8
btcq $0x3f, %r8
movq %r8, 0x28(%rdx)
movl 0x9(%r13), %r8d
bswapl %r8d
movd %r8d, %xmm0
cvtss2sd %xmm0, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x40(%rdx)
addq $0xd, %r13
addq -0x48(%rbp), %r13
jmp 0x381f8
movq 0x8(%r13), %r8
bswapq %r8
movq %r8, %xmm1
mulsd 0x3276d(%rip), %xmm1    # 0x6a8a8
cvttsd2si %xmm1, %r8d
movb %r8b, 0x12(%rdx)
movq 0x10(%r13), %r8
bswapq %r8
movq %r8, 0x38(%rdx)
testb $0x10, %dil
je 0x38165
movq 0x18(%r13), %r9
bswapq %r9
btcq $0x3f, %r9
movq %r9, 0x20(%rdx)
movq %r8, %xmm1
movq 0x20(%r13), %r8
bswapq %r8
movq %r8, %xmm2
cvtsd2ss %xmm2, %xmm2
movss %xmm2, 0x50(%rdx)
addq $0x30, %r13
testb $0x1, %dil
je 0x381d9
movq (%r13), %r8
bswapq %r8
movq %r8, %xmm0
mulsd 0x3270b(%rip), %xmm0    # 0x6a8a8
cvttsd2si %xmm0, %r8d
movb %r8b, 0x13(%rdx)
xorpd %xmm0, %xmm0
testb $0x20, %dil
je 0x381d5
movq 0x8(%r13), %r8
bswapq %r8
btcq $0x3f, %r8
movq %r8, 0x28(%rdx)
movq 0x10(%r13), %r8
bswapq %r8
movq %r8, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x40(%rdx)
addq $0x18, %r13
testb $0x2, -0x2c(%rbp)
je 0x381f8
movq 0x4(%r13), %r8
bswapq %r8
movq %r8, %xmm2
cvtsd2ss %xmm2, %xmm2
movss %xmm2, 0x54(%rdx)
addq $0xc, %r13
movl %esi, %r9d
andb $0x1, %r9b
incb %r9b
xorl %r8d, %r8d
xorps %xmm2, %xmm2
ucomisd %xmm2, %xmm1
movzbl %r9b, %r9d
movl $0x0, %r10d
cmovnel %r9d, %r10d
cmovpl %r9d, %r10d
movb %r10b, 0x18(%rdx)
xorpd %xmm1, %xmm1
ucomisd %xmm2, %xmm0
jne 0x3822e
jnp 0x3824a
movb $0x14, %r8b
testb $0x4, %sil
jne 0x3824a
xorl %r8d, %r8d
testb $0x2, %sil
setne %r8b
leal (%r8,%r8,4), %r8d
addl $0xe, %r8d
movb %r8b, 0x19(%rdx)
testb $0x2, %dil
je 0x38258
movb $0x1, 0x15(%rdx)
movb $0x4, %r8b
testb $0x4, %dil
je 0x38268
movb $0x1, 0x16(%rdx)
movb $0x5, %r8b
testb $0x4, %sil
je 0x3827a
ucomisd %xmm1, %xmm0
jne 0x38276
jnp 0x3827a
movb %r8b, 0x16(%rdx)
leaq (%rax,%rcx), %rbx
addq $0x10, %rbx
movl $0x1, %edi
movl %r12d, %esi
callq 0x4d28d
movb %al, (%rbx)
testb %al, %al
je 0x3829a
incl %r14d
jmp 0x382b0
movl $0x2, %edi
leaq 0x359ce(%rip), %rsi     # 0x6dc74
movl %r12d, %edx
xorl %eax, %eax
callq 0x5342c
movq -0x40(%rbp), %rbx
decl %r15d
movsd -0x38(%rbp), %xmm0
movq -0x50(%rbp), %rsi
jne 0x3800f
movq %rsi, (%rbx)
movsd %xmm0, 0x8(%rbx)
movl %r14d, 0x1d20(%rbx)
testl %r14d, %r14d
jle 0x38390
leaq 0x359b6(%rip), %rsi     # 0x6dc9b
movl $0x2, %edi
xorl %eax, %eax
callq 0x5342c
movq 0x1d28(%rbx), %rsi
movl 0x1d20(%rbx), %edx
movl $0x2, %edi
callq 0x53432
movl $0x1, %ebx
jmp 0x38392
movq -0x40(%rbp), %rdi
movq 0x82ba0(%rdi), %rax
movq (%rax), %rax
movzbl (%rax), %edx
cmpl $0x6, %edx
ja 0x38356
leaq 0x35a3b(%rip), %rsi     # 0x6dd6a
xorl %ebx, %ebx
movl $0x2, %edi
xorl %eax, %eax
callq 0x5342c
jmp 0x38392
leaq 0x35833(%rip), %rsi     # 0x6db79
xorl %ebx, %ebx
movl $0x3, %edi
xorl %eax, %eax
callq 0x5342c
jmp 0x38392
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 0x33a01(%rip), %xmm0    # 0x6bd78
callq 0x38737
jmp 0x38390
movq %rsi, (%rbx)
movsd %xmm0, 0x8(%rbx)
movl $0x0, 0x1d20(%rbx)
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq