// File: 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
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movl $0x32, %esi
movl $0x6, %edx
callq 0x8bfc0
movl %eax, -0x40(%rbp)
movl $0x1, %eax
cmpl -0x40(%rbp), %eax
jg 0x6723a
cmpl $0x5, -0x40(%rbp)
jg 0x6723a
movl -0x40(%rbp), %esi
addl $0xc0, %esi
movl $0x10, %edi
callq 0x8b1b0
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
jne 0x67225
jmp 0x67669
movq -0x8(%rbp), %rdi
movl -0x34(%rbp), %esi
movq -0x10(%rbp), %rdx
callq 0x67680
jmp 0x67669
cmpl $0x33, -0x40(%rbp)
jne 0x67389
cmpq $0x0, -0x10(%rbp)
je 0x67384
movl $0x38, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x2c(%rbp), %esi
movl $0x8, %edx
callq 0x8bfc0
shll $0xc, %eax
movl %eax, -0x38(%rbp)
movl -0x2c(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x2c(%rbp), %esi
movl $0x8, %edx
callq 0x8bfc0
movl %eax, -0x3c(%rbp)
movl -0x2c(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x2c(%rbp)
movl -0x3c(%rbp), %edi
callq 0x8f7e0
movl %eax, -0x3c(%rbp)
movl $0x0, -0x30(%rbp)
cmpl $0x5, -0x30(%rbp)
jge 0x67382
movl -0x30(%rbp), %esi
addl $0xc1, %esi
movl $0x10, %edi
callq 0x8b1b0
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
jne 0x672cf
jmp 0x67374
cvtsi2sdl -0x38(%rbp), %xmm0
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x58(%rax)
movl -0x3c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
imulq $0x70, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movl -0x3c(%rbp), %edi
cvtsi2sdl -0x38(%rbp), %xmm0
callq 0x8e4a0
movq %rax, -0x50(%rbp)
movsd %xmm0, -0x48(%rbp)
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movq -0x50(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x48(%rbp), %rcx
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rdi
movl -0x2c(%rbp), %esi
movl $0x6, %edx
callq 0x8bfc0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
imulq $0x70, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movl -0x2c(%rbp), %eax
addl $0x6, %eax
movl %eax, -0x2c(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x672a5
jmp 0x67384
jmp 0x67667
cmpl $0x38, -0x40(%rbp)
jne 0x67665
cmpq $0x0, -0x18(%rbp)
je 0x67583
movl $0x38, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x2c(%rbp), %esi
movl $0x8, %edx
callq 0x8c050
cvtsi2sd %eax, %xmm0
movsd 0x57ace(%rip), %xmm1    # 0xbee90
mulsd %xmm1, %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, (%rax)
movl -0x2c(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x2c(%rbp), %esi
movl $0x8, %edx
callq 0x8c050
cvtsi2sd %eax, %xmm0
movsd 0x57adc(%rip), %xmm1    # 0xbeed0
mulsd %xmm1, %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x8(%rax)
movl -0x2c(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x2c(%rbp), %esi
movl $0x8, %edx
callq 0x8c050
cvtsi2sd %eax, %xmm0
movsd 0x57aa1(%rip), %xmm1    # 0xbeec8
mulsd %xmm1, %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x10(%rax)
movl -0x2c(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x2c(%rbp), %esi
movl $0x8, %edx
callq 0x8c050
cvtsi2sd %eax, %xmm0
movsd 0x57a6e(%rip), %xmm1    # 0xbeec8
mulsd %xmm1, %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x18(%rax)
movl -0x2c(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x2c(%rbp), %esi
movl $0x8, %edx
callq 0x8c050
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x70(%rbp)
movl $0x2, %edi
movl $0xb, %esi
callq 0x67da0
movaps %xmm0, %xmm1
movsd -0x70(%rbp), %xmm0
mulsd %xmm1, %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x20(%rax)
movl -0x2c(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x2c(%rbp), %esi
movl $0x8, %edx
callq 0x8c050
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x68(%rbp)
movl $0x2, %edi
movl $0xe, %esi
callq 0x67da0
movaps %xmm0, %xmm1
movsd -0x68(%rbp), %xmm0
mulsd %xmm1, %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x28(%rax)
movl -0x2c(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x2c(%rbp), %esi
movl $0x8, %edx
callq 0x8c050
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x60(%rbp)
movl $0x2, %edi
movl $0x10, %esi
callq 0x67da0
movaps %xmm0, %xmm1
movsd -0x60(%rbp), %xmm0
mulsd %xmm1, %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x30(%rax)
movl -0x2c(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x2c(%rbp), %esi
movl $0x8, %edx
callq 0x8c050
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x58(%rbp)
movl $0x2, %edi
movl $0x10, %esi
callq 0x67da0
movaps %xmm0, %xmm1
movsd -0x58(%rbp), %xmm0
mulsd %xmm1, %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x38(%rax)
cmpq $0x0, -0x20(%rbp)
je 0x67663
movl $0x78, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x2c(%rbp), %esi
movl $0x18, %edx
callq 0x8c050
cvtsi2sd %eax, %xmm0
movsd 0x55a06(%rip), %xmm1    # 0xbcfb8
mulsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0x8(%rax)
movl -0x2c(%rbp), %eax
addl $0x18, %eax
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x2c(%rbp), %esi
movl $0x20, %edx
callq 0x8c050
cvtsi2sd %eax, %xmm0
movsd 0x578ab(%rip), %xmm1    # 0xbee90
mulsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, (%rax)
movl -0x2c(%rbp), %eax
addl $0x20, %eax
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x2c(%rbp), %esi
movl $0x8, %edx
movl %edx, -0x7c(%rbp)
callq 0x8c050
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x78(%rbp)
movl $0x2, %edi
movl $0xc, %esi
callq 0x67da0
movl -0x7c(%rbp), %edx
movaps %xmm0, %xmm1
movsd -0x78(%rbp), %xmm0
mulsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0x10(%rax)
movl -0x2c(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x8bfc0
movl %eax, %eax
cvtsi2sd %rax, %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0x18(%rax)
jmp 0x67665
jmp 0x67667
jmp 0x67669
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)