// File: /workspace/github_cpp_makefile_star2_O3/DoubleString[P]RtConverter/src/Rtklib/skytraq.cpp
// Function: bamboo::decode_stqgps(bamboo::raw_t*)
static int decode_stqgps(raw_t *raw)
{
    int prn,sat,id;
    unsigned char *p=raw->buff+4;
    
    trace(4,"decode_stqgps: len=%d\n",raw->len);
    
    if (raw->len<40) {
        trace(2,"stq gps/qzss subframe length error: len=%d\n",raw->len);
        return -1;
    }
    if (raw->outtype) {
        sprintf(raw->msgtype,"SKYTRAQ GPSSF (%4d): prn=%2d id=%d",raw->len,
                U1(p+1),(p[8]>>2)&0x7);
    }
    prn=U1(p+1);
    if (!(sat=satno(MINPRNQZS<=prn&&prn<=MAXPRNQZS?SYS_QZS:SYS_GPS,prn))) {
        trace(2,"stq gps/qzss subframe satellite number error: prn=%d\n",prn);
        return -1;
    }
    id=save_subfrm(sat,raw);
    if (id==3) return decode_ephem(sat,raw);
    if (id==4) return decode_alm1 (sat,raw);
    if (id==5) return decode_alm2 (sat,raw);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rdi, %rbx
movl 0x81a78(%rdi), %edx
leaq 0x1e811(%rip), %rsi     # 0x757f7
movl $0x4, %edi
xorl %eax, %eax
callq 0x4d55d
movl 0x81a78(%rbx), %edx
cmpl $0x27, %edx
jg 0x5700e
leaq 0x1e80a(%rip), %rsi     # 0x7580e
movl $0x2, %edi
jmp 0x570c5
cmpl $0x0, 0x81a8c(%rbx)
je 0x57043
leaq 0x70e70(%rbx), %rdi
movzbl 0x81a95(%rbx), %ecx
movzbl 0x81a9c(%rbx), %r8d
shrl $0x2, %r8d
andl $0x7, %r8d
leaq 0x1e7fe(%rip), %rsi     # 0x7583a
xorl %eax, %eax
callq 0x8120
movzbl 0x81a95(%rbx), %r14d
testl %r14d, %r14d
movl $0x10, %eax
movl $0x1, %edi
cmovel %eax, %edi
movl %r14d, %esi
callq 0x4d28d
testl %eax, %eax
je 0x570b6
movl %eax, %r15d
leaq 0x1e822(%rip), %rsi     # 0x75893
xorl %r14d, %r14d
movl $0x4, %edi
movl %eax, %edx
xorl %eax, %eax
callq 0x4d55d
movzbl 0x81a97(%rbx), %edx
cmpl $0x8b, %edx
jne 0x570d4
movzbl 0x81a9c(%rbx), %edx
shrl $0x2, %edx
andl $0x7, %edx
leal -0x6(%rdx), %eax
cmpb $-0x6, %al
ja 0x570fc
leaq 0x1e822(%rip), %rsi     # 0x758ce
xorl %r14d, %r14d
movl $0x2, %edi
jmp 0x570e0
leaq 0x1e7a0(%rip), %rsi     # 0x7585d
movl $0x2, %edi
movl %r14d, %edx
xorl %eax, %eax
callq 0x4d55d
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0x570e7
leaq 0x1e7ce(%rip), %rsi     # 0x758a9
movl $0x2, %edi
xorl %eax, %eax
callq 0x4d55d
movl %r14d, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x70f70(%rbx), %r8
movl %r15d, %eax
decl %eax
movslq %eax, %rdi
imulq $0x17c, %rdi, %r13      # imm = 0x17C
leaq (%rbx,%r13), %r12
addq $0x70f70, %r12          # imm = 0x70F70
movl %edx, %ecx
shll $0x5, %ecx
subq %rdx, %rcx
subq %rdx, %rcx
leaq (%rcx,%r12), %rax
addq $-0x1e, %rax
movq $-0x1e, %rcx
movb 0x81ab5(%rbx,%rcx), %sil
movb %sil, 0x1e(%rax,%rcx)
incq %rcx
jne 0x57137
cmpb $0x5, %dl
je 0x57282
movzbl %dl, %eax
cmpl $0x4, %eax
je 0x57234
cmpl $0x3, %eax
jne 0x570e7
movq %rdi, -0x30(%rbp)
leaq -0x150(%rbp), %r13
xorl %r14d, %r14d
movl $0x120, %edx            # imm = 0x120
movq %r13, %rdi
xorl %esi, %esi
callq 0x8390
leaq 0x1e765(%rip), %rsi     # 0x758ec
movl $0x4, %edi
movl %r15d, %edx
xorl %eax, %eax
callq 0x4d55d
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x35822
cmpl $0x1, %eax
jne 0x570e7
leaq 0x1e(%r12), %rdi
xorl %r14d, %r14d
leaq -0x150(%rbp), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x35822
cmpl $0x2, %eax
jne 0x570e7
addq $0x3c, %r12
xorl %r14d, %r14d
leaq -0x150(%rbp), %rsi
movq %r12, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x35822
cmpl $0x3, %eax
jne 0x570e7
leaq 0x82a90(%rbx), %rdi
leaq 0x154b5(%rip), %rsi     # 0x6c6c7
callq 0x8160
movq -0x30(%rbp), %rcx
leaq (%rcx,%rcx,8), %rdi
testq %rax, %rax
je 0x5735d
movq 0x1d80(%rbx), %rax
jmp 0x57389
movq %r8, -0x30(%rbp)
movl %r15d, %edi
xorl %esi, %esi
callq 0x4d2f2
movl %eax, %r12d
leaq 0x1e6b7(%rip), %rsi     # 0x75903
movl $0x4, %edi
movl %r15d, %edx
xorl %eax, %eax
callq 0x4d55d
movl $0x9, %r14d
cmpl $0x1, %r12d
je 0x572e6
cmpl $0x10, %r12d
movq -0x30(%rbp), %rax
jne 0x570e7
movl $0x1e30, %r15d          # imm = 0x1E30
movl $0x1f10, %ecx           # imm = 0x1F10
jmp 0x572f5
movq %r8, -0x30(%rbp)
xorl %r14d, %r14d
movl %r15d, %edi
xorl %esi, %esi
callq 0x4d2f2
movl %eax, %r12d
leaq 0x1e67d(%rip), %rsi     # 0x7591a
movl $0x4, %edi
movl %r15d, %edx
xorl %eax, %eax
callq 0x4d55d
cmpl $0x10, %r12d
je 0x57313
cmpl $0x1, %r12d
movq -0x30(%rbp), %rax
jne 0x570e7
leaq (%rax,%r13), %rdi
addq $0x78, %rdi
movq 0x1da8(%rbx), %rdx
xorl %r14d, %r14d
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x35822
jmp 0x570e7
movl $0x1dd0, %r15d          # imm = 0x1DD0
movl $0x1eb0, %ecx           # imm = 0x1EB0
movq -0x30(%rbp), %rax
leaq (%rax,%r13), %rdi
addq $0x5a, %rdi
movq 0x1da8(%rbx), %rdx
addq %rbx, %rcx
addq %rbx, %r15
leaq 0x1fd0(%rbx), %r9
jmp 0x5733e
movq -0x30(%rbp), %rax
leaq (%rax,%r13), %rdi
addq $0x78, %rdi
movq 0x1da8(%rbx), %rdx
leaq 0x1f10(%rbx), %rcx
leaq 0x1e30(%rbx), %r15
leaq 0x1fd0(%rbx), %r9
xorl %r14d, %r14d
xorl %esi, %esi
movq %r15, %r8
callq 0x35822
movq (%rbx), %rdi
movsd 0x8(%rbx), %xmm0
movq %r15, %rsi
callq 0x57b22
jmp 0x570e7
movl -0x14c(%rbp), %edx
movq 0x1d80(%rbx), %rax
movq %rdi, %rcx
shlq $0x5, %rcx
cmpl 0x4(%rax,%rcx), %edx
jne 0x57389
addq %rax, %rcx
movl -0x148(%rbp), %edx
cmpl 0x8(%rcx), %edx
je 0x570e7
leaq -0x150(%rbp), %rsi
movl %r15d, (%rsi)
shlq $0x5, %rdi
addq %rax, %rdi
movl $0x120, %edx            # imm = 0x120
callq 0x84f0
movl %r15d, 0x70e40(%rbx)
movl $0x2, %r14d
jmp 0x570e7