// File: /workspace/github_cpp_makefile_star2_O1/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
movq %rdi, -0x30(%rbp)
movl $0x32, %esi
movl $0x6, %edx
callq 0x4e341
leal -0x1(%rax), %ecx
cmpl $0x4, %ecx
ja 0x3721a
orl $0xc0, %eax
movl $0x10, %edi
movl %eax, %esi
callq 0x4dbc5
testl %eax, %eax
je 0x374d7
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 0x374e6
cmpl $0x38, %eax
je 0x372eb
cmpl $0x33, %eax
jne 0x374d7
testq %r15, %r15
je 0x374d7
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
movl $0x38, %esi
movl $0x8, %edx
callq 0x4e341
movl %eax, %r12d
shll $0xc, %r12d
movq %rbx, %rdi
movl $0x40, %esi
movl $0x8, %edx
callq 0x4e341
movl %eax, %edi
callq 0x5081e
movl %eax, %r14d
cvtsi2sd %r12d, %xmm0
movsd %xmm0, -0x38(%rbp)
movl $0x48, %r12d
movl $0xc1, %r13d
movl $0x10, %edi
movl %r13d, %esi
callq 0x4dbc5
testl %eax, %eax
je 0x372da
cltq
imulq $0x70, %rax, %rbx
movsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x18(%r15,%rbx)
movl %r14d, -0x64(%r15,%rbx)
movl %r14d, %edi
callq 0x4fbc6
movq %rax, -0x60(%r15,%rbx)
movsd %xmm0, -0x58(%r15,%rbx)
movq -0x30(%rbp), %rdi
movl %r12d, %esi
movl $0x6, %edx
callq 0x4e341
movl %eax, -0x6c(%r15,%rbx)
addl $0x6, %r12d
incl %r13d
cmpl $0xc6, %r13d
jne 0x37284
jmp 0x374d7
testq %r12, %r12
je 0x37434
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
movl $0x38, %esi
movl $0x8, %edx
callq 0x4e390
cvtsi2sd %eax, %xmm0
mulsd 0x35a1a(%rip), %xmm0    # 0x6cd30
movsd %xmm0, (%r12)
movq %rbx, %rdi
movl $0x40, %esi
movl $0x8, %edx
callq 0x4e390
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x35a0b(%rip), %xmm0    # 0x6cd48
movsd %xmm0, 0x8(%r12)
movq %rbx, %rdi
movl $0x48, %esi
movl $0x8, %edx
callq 0x4e390
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x359eb(%rip), %xmm0    # 0x6cd50
movsd %xmm0, 0x10(%r12)
movq %rbx, %rdi
movl $0x50, %esi
movl $0x8, %edx
callq 0x4e390
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x359c3(%rip), %xmm0    # 0x6cd50
movsd %xmm0, 0x18(%r12)
movq %rbx, %rdi
movl $0x58, %esi
movl $0x8, %edx
callq 0x4e390
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x359a3(%rip), %xmm0    # 0x6cd58
movsd %xmm0, 0x20(%r12)
movq %rbx, %rdi
movl $0x60, %esi
movl $0x8, %edx
callq 0x4e390
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x35983(%rip), %xmm0    # 0x6cd60
movsd %xmm0, 0x28(%r12)
movq %rbx, %rdi
movl $0x68, %esi
movl $0x8, %edx
callq 0x4e390
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x35963(%rip), %xmm0    # 0x6cd68
movsd %xmm0, 0x30(%r12)
movq %rbx, %rdi
movl $0x70, %esi
movl $0x8, %edx
callq 0x4e390
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x3593b(%rip), %xmm0    # 0x6cd68
movsd %xmm0, 0x38(%r12)
testq %r14, %r14
je 0x374d7
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
movl $0x78, %esi
movl $0x18, %edx
callq 0x4e390
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x358b6(%rip), %xmm0    # 0x6cd18
movsd %xmm0, 0x8(%r14)
movq %rbx, %rdi
movl $0x90, %esi
movl $0x20, %edx
callq 0x4e390
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x358a7(%rip), %xmm0    # 0x6cd30
movsd %xmm0, (%r14)
movq %rbx, %rdi
movl $0xb0, %esi
movl $0x8, %edx
callq 0x4e390
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x358c1(%rip), %xmm0    # 0x6cd70
movsd %xmm0, 0x10(%r14)
movq %rbx, %rdi
movl $0xb8, %esi
movl $0x8, %edx
callq 0x4e341
movl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x18(%r14)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq