// File: DoubleString[P]RtConverter/src/Rtklib/binex.cpp
// Function: bamboo::decode_bnx_7f(bamboo::raw_t*, unsigned char*, int)
static int decode_bnx_7f(raw_t *raw, unsigned char *buff, int len)
{
    const static double gpst0[]={1980,1,6,0,0,0};
    char *msg;
    unsigned char *p=buff;
    unsigned int srec,min,msec;
    
    srec=U1(p); p+=1; /* subrecord id */
    min =U4(p); p+=4;
    msec=U2(p); p+=2;
    raw->time=timeadd(epoch2time(gpst0),min*60.0+msec*0.001);
    
    if (raw->outtype) {
        msg=raw->msgtype+strlen(raw->msgtype);
        sprintf(msg," subrec=%02X time%s",srec,time_str(raw->time,3));
    }
    switch (srec) {
        case 0x00: return decode_bnx_7f_00(raw,buff+7,len-7);
        case 0x01: return decode_bnx_7f_01(raw,buff+7,len-7);
        case 0x02: return decode_bnx_7f_02(raw,buff+7,len-7);
        case 0x03: return decode_bnx_7f_03(raw,buff+7,len-7);
        case 0x04: return decode_bnx_7f_04(raw,buff+7,len-7);
        case 0x05: return decode_bnx_7f_05(raw,buff+7,len-7);
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movzbl (%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x30(%rbp), %rax
incq %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x5be80
movl %eax, -0x38(%rbp)
movq -0x30(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x5b2b0
movzwl %ax, %eax
movl %eax, -0x3c(%rbp)
movq -0x30(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x30(%rbp)
leaq 0x624f3(%rip), %rdi     # 0xbe190
callq 0x8e180
movq %rax, -0x60(%rbp)
movsd %xmm0, -0x58(%rbp)
movl -0x38(%rbp), %eax
cvtsi2sd %rax, %xmm1
movl -0x3c(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd 0x62085(%rip), %xmm2    # 0xbdd48
mulsd %xmm2, %xmm0
movsd 0x61149(%rip), %xmm2    # 0xbce18
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movq -0x60(%rbp), %rdi
movsd -0x58(%rbp), %xmm0
callq 0x8e860
movq %rax, -0x50(%rbp)
movsd %xmm0, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq -0x50(%rbp), %rcx
movq %rcx, (%rax)
movq -0x48(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x81a8c(%rax)
je 0x5bd8c
movq -0x10(%rbp), %rax
addq $0x70e70, %rax          # imm = 0x70E70
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rdi
addq $0x70e70, %rdi          # imm = 0x70E70
callq 0x92e0
movq %rax, %rcx
movq -0x88(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x80(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x74(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x70(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x70(%rbp), %rdi
movsd -0x68(%rbp), %xmm0
movl $0x3, %esi
callq 0x8f6d0
movq -0x80(%rbp), %rdi
movl -0x74(%rbp), %edx
movq %rax, %rcx
leaq 0x62dcc(%rip), %rsi     # 0xbeb51
movb $0x0, %al
callq 0x9150
movl -0x34(%rbp), %eax
movq %rax, -0x90(%rbp)
subq $0x5, %rax
ja 0x5be62
movq -0x90(%rbp), %rax
leaq 0x62276(%rip), %rcx     # 0xbe024
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x7, %rsi
movl -0x1c(%rbp), %edx
subl $0x7, %edx
callq 0x5fcf0
movl %eax, -0x4(%rbp)
jmp 0x5be69
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x7, %rsi
movl -0x1c(%rbp), %edx
subl $0x7, %edx
callq 0x5fd20
movl %eax, -0x4(%rbp)
jmp 0x5be69
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x7, %rsi
movl -0x1c(%rbp), %edx
subl $0x7, %edx
callq 0x5fd50
movl %eax, -0x4(%rbp)
jmp 0x5be69
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x7, %rsi
movl -0x1c(%rbp), %edx
subl $0x7, %edx
callq 0x5fd80
movl %eax, -0x4(%rbp)
jmp 0x5be69
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x7, %rsi
movl -0x1c(%rbp), %edx
subl $0x7, %edx
callq 0x5fdb0
movl %eax, -0x4(%rbp)
jmp 0x5be69
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x7, %rsi
movl -0x1c(%rbp), %edx
subl $0x7, %edx
callq 0x5fde0
movl %eax, -0x4(%rbp)
jmp 0x5be69
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)