// File: DoubleString[P]RtConverter/src/Rtklib/rcvraw.cpp
// Function: bamboo::decode_gps_subfrm5(unsigned char const*, bamboo::alm_t*)
static void decode_gps_subfrm5(const unsigned char *buff, alm_t *alm)
{
    double toas;
    int i,sat,week,svid=getbitu(buff,50,6);
    
    if (1<=svid&&svid<=24) { /* page 1-24 */
        
        /* decode almanac */
        sat=getbitu(buff,50,6);
        if (1<=sat&&sat<=32) decode_almanac(buff,sat,alm);
    }
    else if (svid==51) { /* page 25 */
        
        if (alm) {
            i=56;
            toas=getbitu(buff,i,8)*4096; i+=8;
            week=getbitu(buff,i,8);      i+=8;
            week=adjgpsweek(week);
            
            /* decode sv health */
            for (sat=1;sat<=24;sat++) {
                alm[sat-1].svh=getbitu(buff,i,6); i+=6;
            }
            for (sat=1;sat<=32;sat++) {
                alm[sat-1].toas=toas;
                alm[sat-1].week=week;
                alm[sat-1].toa=gpst2time(week,toas);
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl $0x32, %esi
movl $0x6, %edx
callq 0x8bfc0
movl %eax, -0x28(%rbp)
movl $0x1, %eax
cmpl -0x28(%rbp), %eax
jg 0x67c41
cmpl $0x18, -0x28(%rbp)
jg 0x67c41
movq -0x8(%rbp), %rdi
movl $0x32, %esi
movl $0x6, %edx
callq 0x8bfc0
movl %eax, -0x20(%rbp)
movl $0x1, %eax
cmpl -0x20(%rbp), %eax
jg 0x67c3c
cmpl $0x20, -0x20(%rbp)
jg 0x67c3c
movq -0x8(%rbp), %rdi
movl -0x20(%rbp), %esi
movq -0x10(%rbp), %rdx
callq 0x67680
jmp 0x67d8e
cmpl $0x33, -0x28(%rbp)
jne 0x67d8c
cmpq $0x0, -0x10(%rbp)
je 0x67d8a
movl $0x38, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl $0x8, %edx
callq 0x8bfc0
shll $0xc, %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x18(%rbp)
movl -0x1c(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl $0x8, %edx
callq 0x8bfc0
movl %eax, -0x24(%rbp)
movl -0x1c(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x1c(%rbp)
movl -0x24(%rbp), %edi
callq 0x8f7e0
movl %eax, -0x24(%rbp)
movl $0x1, -0x20(%rbp)
cmpl $0x18, -0x20(%rbp)
jg 0x67cf7
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl $0x6, %edx
callq 0x8bfc0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
imulq $0x70, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movl -0x1c(%rbp), %eax
addl $0x6, %eax
movl %eax, -0x1c(%rbp)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x67cb3
movl $0x1, -0x20(%rbp)
cmpl $0x20, -0x20(%rbp)
jg 0x67d88
movsd -0x18(%rbp), %xmm0
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x58(%rax)
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
imulq $0x70, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movl -0x24(%rbp), %edi
movsd -0x18(%rbp), %xmm0
callq 0x8e4a0
movq %rax, -0x38(%rbp)
movsd %xmm0, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movq -0x38(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rcx
movq %rcx, 0x18(%rax)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x67cfe
jmp 0x67d8a
jmp 0x67d8c
jmp 0x67d8e
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop