// File: /workspace/github_cpp_makefile_star2_O1/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 0x1dccf(%rip), %rsi     # 0x7583f
movl $0x4, %edi
xorl %eax, %eax
callq 0x4ded0
movl 0x81a78(%rbx), %edx
cmpl $0x27, %edx
jg 0x57b98
leaq 0x1dcc8(%rip), %rsi     # 0x75856
movl $0x2, %edi
jmp 0x57c61
cmpl $0x0, 0x81a8c(%rbx)
je 0x57bcd
leaq 0x70e70(%rbx), %rdi
movzbl 0x81a95(%rbx), %ecx
movzbl 0x81a9c(%rbx), %r8d
shrl $0x2, %r8d
andl $0x7, %r8d
leaq 0x1dcbc(%rip), %rsi     # 0x75882
xorl %eax, %eax
callq 0x8120
movzbl 0x81a95(%rbx), %r15d
testl %r15d, %r15d
movl $0x10, %eax
movl $0x1, %edi
cmovel %eax, %edi
movl %r15d, %esi
callq 0x4dbc5
testl %eax, %eax
je 0x57c52
movl %eax, %r14d
leaq 0x1dce0(%rip), %rsi     # 0x758db
xorl %r12d, %r12d
movl $0x4, %edi
movl %eax, %edx
xorl %eax, %eax
callq 0x4ded0
movzbl 0x81a97(%rbx), %edx
cmpl $0x8b, %edx
jne 0x57c83
movzbl 0x81a9c(%rbx), %r12d
shrl $0x2, %r12d
andl $0x7, %r12d
leal -0x6(%r12), %eax
cmpb $-0x6, %al
ja 0x57c98
leaq 0x1dcdb(%rip), %rsi     # 0x75916
movl $0x2, %edi
movl %r12d, %edx
xorl %eax, %eax
callq 0x4ded0
xorl %r12d, %r12d
jmp 0x57cd2
leaq 0x1dc4c(%rip), %rsi     # 0x758a5
movl $0x2, %edi
movl %r15d, %edx
xorl %eax, %eax
callq 0x4ded0
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movl %r15d, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1dc67(%rip), %rsi     # 0x758f1
movl $0x2, %edi
xorl %eax, %eax
callq 0x4ded0
jmp 0x57cd2
leal -0x1(%r14), %eax
cltq
imulq $0x17c, %rax, %rax      # imm = 0x17C
addq %rbx, %rax
movl %r12d, %edx
shll $0x5, %edx
subq %r12, %rdx
subq %r12, %rdx
addq %rdx, %rax
addq $0x70f52, %rax          # imm = 0x70F52
xorl %ecx, %ecx
movb 0x81a97(%rbx,%rcx), %dl
movb %dl, (%rax,%rcx)
incq %rcx
cmpq $0x1e, %rcx
jne 0x57cbf
cmpl $0x5, %r12d
je 0x57e9a
cmpl $0x4, %r12d
je 0x57e2b
xorl %r15d, %r15d
cmpl $0x3, %r12d
jne 0x57c6e
leaq -0x150(%rbp), %r13
xorl %r15d, %r15d
movl $0x120, %edx            # imm = 0x120
movq %r13, %rdi
xorl %esi, %esi
callq 0x8390
leaq 0x1dc21(%rip), %rsi     # 0x75934
movl $0x4, %edi
movl %r14d, %edx
xorl %eax, %eax
callq 0x4ded0
movl %r14d, %eax
decl %eax
movslq %eax, %rcx
movq %rcx, -0x30(%rbp)
imulq $0x17c, %rcx, %rax      # imm = 0x17C
leaq (%rbx,%rax), %r12
addq $0x70f70, %r12          # imm = 0x70F70
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x35e5c
cmpl $0x1, %eax
jne 0x57c6e
leaq 0x1e(%r12), %rdi
xorl %r15d, %r15d
leaq -0x150(%rbp), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x35e5c
cmpl $0x2, %eax
jne 0x57c6e
addq $0x3c, %r12
xorl %r15d, %r15d
leaq -0x150(%rbp), %rsi
movq %r12, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x35e5c
cmpl $0x3, %eax
jne 0x57c6e
leaq 0x82a90(%rbx), %rdi
leaq 0x1490b(%rip), %rsi     # 0x6c6c7
callq 0x8160
movq -0x30(%rbp), %rcx
leaq (%rcx,%rcx,8), %rdi
testq %rax, %rax
jne 0x57dfa
movl -0x14c(%rbp), %edx
movq 0x1d80(%rbx), %rax
movq %rdi, %rcx
shlq $0x5, %rcx
cmpl 0x4(%rax,%rcx), %edx
jne 0x57dfa
addq %rcx, %rax
movl -0x148(%rbp), %ecx
cmpl 0x8(%rax), %ecx
je 0x57c6e
leaq -0x150(%rbp), %rsi
movl %r14d, (%rsi)
shlq $0x5, %rdi
addq 0x1d80(%rbx), %rdi
movl $0x120, %edx            # imm = 0x120
callq 0x84f0
movl %r14d, 0x70e40(%rbx)
movl $0x2, %r15d
jmp 0x57c6e
movl %r14d, %edi
xorl %esi, %esi
callq 0x4dc2a
movl %eax, %r12d
leaq 0x1db0c(%rip), %rsi     # 0x7594b
movl $0x4, %edi
movl %r14d, %edx
xorl %eax, %eax
callq 0x4ded0
movl $0x9, %r15d
cmpl $0x10, %r12d
je 0x57f06
cmpl $0x1, %r12d
jne 0x57c6e
decl %r14d
movslq %r14d, %rax
imulq $0x17c, %rax, %rax      # imm = 0x17C
leaq (%rbx,%rax), %rdi
addq $0x70fca, %rdi          # imm = 0x70FCA
movq 0x1da8(%rbx), %rdx
leaq 0x1eb0(%rbx), %rcx
leaq 0x1dd0(%rbx), %r14
jmp 0x57f33
xorl %r15d, %r15d
movl %r14d, %edi
xorl %esi, %esi
callq 0x4dc2a
movl %eax, %r12d
leaq 0x1dab1(%rip), %rsi     # 0x75962
movl $0x4, %edi
movl %r14d, %edx
xorl %eax, %eax
callq 0x4ded0
cmpl $0x10, %r12d
je 0x57f3c
cmpl $0x1, %r12d
jne 0x57c6e
decl %r14d
movslq %r14d, %rax
imulq $0x17c, %rax, %rax      # imm = 0x17C
leaq (%rbx,%rax), %rdi
addq $0x70fe8, %rdi          # imm = 0x70FE8
movq 0x1da8(%rbx), %rdx
xorl %r15d, %r15d
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x35e5c
jmp 0x57c6e
decl %r14d
movslq %r14d, %rax
imulq $0x17c, %rax, %rax      # imm = 0x17C
leaq (%rbx,%rax), %rdi
addq $0x70fca, %rdi          # imm = 0x70FCA
movq 0x1da8(%rbx), %rdx
leaq 0x1f10(%rbx), %rcx
leaq 0x1e30(%rbx), %r14
leaq 0x1fd0(%rbx), %r9
jmp 0x57f73
decl %r14d
movslq %r14d, %rax
imulq $0x17c, %rax, %rax      # imm = 0x17C
leaq (%rbx,%rax), %rdi
addq $0x70fe8, %rdi          # imm = 0x70FE8
movq 0x1da8(%rbx), %rdx
leaq 0x1f10(%rbx), %rcx
leaq 0x1e30(%rbx), %r14
leaq 0x1fd0(%rbx), %r9
xorl %r15d, %r15d
xorl %esi, %esi
movq %r14, %r8
callq 0x35e5c
movq (%rbx), %rdi
movsd 0x8(%rbx), %xmm0
movq %r14, %rsi
callq 0x58704
jmp 0x57c6e