// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rcvraw.cpp
// Function: bamboo::decode_qzs_subfrm45(unsigned char const*, bamboo::alm_t*, double*, double*, int*)
static void decode_qzs_subfrm45(const unsigned char *buff, alm_t *alm,
                                double *ion, double *utc, int *leaps)
{
    int i,j,sat,toas,week,svid=getbitu(buff,50,6);
    
    if (1<=svid&&svid<=5) { /* qzss almanac */
        
        if (!(sat=satno(SYS_QZS,192+svid))) return;
        decode_almanac(buff,sat,alm);
    }
    else if (svid==51) { /* qzss health */
        
        if (alm) {
            i=56;
            toas=getbitu(buff,i,8)*4096; i+=8;
            week=getbitu(buff,i,8);      i+=8;
            week=adjgpsweek(week);
            
            for (j=0;j<5;j++) {
                if (!(sat=satno(SYS_QZS,193+j))) continue;
                alm[sat-1].toas=toas;
                alm[sat-1].week=week;
                alm[sat-1].toa=gpst2time(week,toas);
                alm[sat-1].svh=getbitu(buff,i,6); i+=6;
            }
        }
    }
    else if (svid==56) { /* ion/utc parameters */
        
        if (ion) {
            i=56;
            ion[0]=getbits(buff,i, 8)*P2_30;     i+= 8;
            ion[1]=getbits(buff,i, 8)*P2_27;     i+= 8;
            ion[2]=getbits(buff,i, 8)*P2_24;     i+= 8;
            ion[3]=getbits(buff,i, 8)*P2_24;     i+= 8;
            ion[4]=getbits(buff,i, 8)*pow(2,11); i+= 8;
            ion[5]=getbits(buff,i, 8)*pow(2,14); i+= 8;
            ion[6]=getbits(buff,i, 8)*pow(2,16); i+= 8;
            ion[7]=getbits(buff,i, 8)*pow(2,16);
        }
        if (utc) {
            i=120;
            utc[1]=getbits(buff,i,24)*P2_50;     i+=24;
            utc[0]=getbits(buff,i,32)*P2_30;     i+=32;
            utc[2]=getbits(buff,i, 8)*pow(2,12); i+= 8;
            utc[3]=getbitu(buff,i, 8);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r15
pushq $0x32
popq %rsi
pushq $0x6
popq %rdx
movq %rdi, -0x30(%rbp)
callq 0x459f7
leal -0x1(%rax), %ecx
cmpl $0x4, %ecx
ja 0x30b1e
orl $0xc0, %eax
pushq $0x10
popq %rdi
movl %eax, %esi
callq 0x452fd
testl %eax, %eax
je 0x30d8e
movq -0x30(%rbp), %rdi
movl %eax, %esi
movq %r15, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x30d9d
cmpl $0x38, %eax
je 0x30be5
cmpl $0x33, %eax
jne 0x30d8e
testq %r15, %r15
je 0x30d8e
pushq $0x38
popq %rsi
pushq $0x8
popq %r14
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
movl %r14d, %edx
callq 0x459f7
movl %eax, %r12d
shll $0xc, %r12d
pushq $0x40
popq %rsi
movq %rbx, %rdi
movl %r14d, %edx
callq 0x459f7
movl %eax, %edi
callq 0x47baa
movl %eax, -0x34(%rbp)
cvtsi2sd %r12d, %xmm0
movsd %xmm0, -0x40(%rbp)
pushq $0x48
popq %r12
xorl %ebx, %ebx
pushq $0x5
popq %r13
subl $0x1, %r13d
jb 0x30d8e
leal 0xc1(%rbx), %esi
pushq $0x10
popq %rdi
callq 0x452fd
testl %eax, %eax
je 0x30be1
cltq
imulq $0x70, %rax, %r14
movsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x18(%r15,%r14)
movl -0x34(%rbp), %edi
movl %edi, -0x64(%r15,%r14)
callq 0x4708a
movq %rax, -0x60(%r15,%r14)
movsd %xmm0, -0x58(%r15,%r14)
movq -0x30(%rbp), %rdi
movl %r12d, %esi
pushq $0x6
popq %rdx
callq 0x459f7
movl %eax, -0x6c(%r15,%r14)
addl $0x6, %r12d
incl %ebx
jmp 0x30b82
testq %r12, %r12
je 0x30cfd
pushq $0x38
popq %rsi
pushq $0x8
popq %r15
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
movl %r15d, %edx
callq 0x45a39
cvtsi2sd %eax, %xmm0
mulsd 0x32120(%rip), %xmm0    # 0x62d30
movsd %xmm0, (%r12)
pushq $0x40
popq %rsi
movq %rbx, %rdi
movl %r15d, %edx
callq 0x45a39
cvtsi2sd %eax, %xmm0
mulsd 0x32118(%rip), %xmm0    # 0x62d48
movsd %xmm0, 0x8(%r12)
pushq $0x48
popq %rsi
movq %rbx, %rdi
movl %r15d, %edx
callq 0x45a39
cvtsi2sd %eax, %xmm0
mulsd 0x320ff(%rip), %xmm0    # 0x62d50
movsd %xmm0, 0x10(%r12)
pushq $0x50
popq %rsi
movq %rbx, %rdi
movl %r15d, %edx
callq 0x45a39
cvtsi2sd %eax, %xmm0
mulsd 0x320de(%rip), %xmm0    # 0x62d50
movsd %xmm0, 0x18(%r12)
pushq $0x58
popq %rsi
movq %rbx, %rdi
movl %r15d, %edx
callq 0x45a39
cvtsi2sd %eax, %xmm0
mulsd 0x320c5(%rip), %xmm0    # 0x62d58
movsd %xmm0, 0x20(%r12)
pushq $0x60
popq %rsi
movq %rbx, %rdi
movl %r15d, %edx
callq 0x45a39
cvtsi2sd %eax, %xmm0
mulsd 0x320ac(%rip), %xmm0    # 0x62d60
movsd %xmm0, 0x28(%r12)
pushq $0x68
popq %rsi
movq %rbx, %rdi
movl %r15d, %edx
callq 0x45a39
cvtsi2sd %eax, %xmm0
mulsd 0x32093(%rip), %xmm0    # 0x62d68
movsd %xmm0, 0x30(%r12)
pushq $0x70
popq %rsi
movq %rbx, %rdi
movl %r15d, %edx
callq 0x45a39
cvtsi2sd %eax, %xmm0
mulsd 0x32072(%rip), %xmm0    # 0x62d68
movsd %xmm0, 0x38(%r12)
testq %r14, %r14
je 0x30d8e
pushq $0x78
popq %rsi
pushq $0x18
popq %rdx
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
callq 0x45a39
cvtsi2sd %eax, %xmm0
mulsd 0x31ff4(%rip), %xmm0    # 0x62d18
movsd %xmm0, 0x8(%r14)
pushq $0x20
popq %rdx
movq %rbx, %rdi
movl $0x90, %esi
callq 0x45a39
cvtsi2sd %eax, %xmm0
mulsd 0x31fea(%rip), %xmm0    # 0x62d30
movsd %xmm0, (%r14)
pushq $0x8
popq %r15
movq %rbx, %rdi
movl $0xb0, %esi
movl %r15d, %edx
callq 0x45a39
cvtsi2sd %eax, %xmm0
mulsd 0x32005(%rip), %xmm0    # 0x62d70
movsd %xmm0, 0x10(%r14)
movq %rbx, %rdi
movl $0xb8, %esi
movl %r15d, %edx
callq 0x459f7
movl %eax, %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x18(%r14)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq