// File: DoubleString[P]RtConverter/src/Rtklib/binex.cpp
// Function: bamboo::decode_bnx_01(bamboo::raw_t*, unsigned char*, int)
static int decode_bnx_01(raw_t *raw, unsigned char *buff, int len)
{
    char *msg;
    int srec=U1(buff),prn=U1(buff+1);
    
    if (raw->outtype) {
        msg=raw->msgtype+strlen(raw->msgtype);
        prn=srec==0x01||srec==0x02||srec==0x04?prn+1:(srec==0x00?0:prn);
        sprintf(msg," subrec=%02X prn=%d",srec,prn);
    }
    switch (srec) {
        case 0x00: return decode_bnx_01_00(raw,buff+1,len-1);
        case 0x01: return decode_bnx_01_01(raw,buff+1,len-1);
        case 0x02: return decode_bnx_01_02(raw,buff+1,len-1);
        case 0x03: return decode_bnx_01_03(raw,buff+1,len-1);
        case 0x04: return decode_bnx_01_04(raw,buff+1,len-1);
        case 0x05: return decode_bnx_01_05(raw,buff+1,len-1);
        case 0x06: return decode_bnx_01_06(raw,buff+1,len-1);
        case 0x14: return decode_bnx_01_14(raw,buff+1,len-1);
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x18(%rbp), %rax
movzbl 0x1(%rax), %eax
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x81a8c(%rax)
je 0x5ba49
movq -0x10(%rbp), %rax
addq $0x70e70, %rax          # imm = 0x70E70
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
addq $0x70e70, %rdi          # imm = 0x70E70
callq 0x92e0
movq %rax, %rcx
movq -0x38(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x28(%rbp)
cmpl $0x1, -0x2c(%rbp)
je 0x5ba07
cmpl $0x2, -0x2c(%rbp)
je 0x5ba07
cmpl $0x4, -0x2c(%rbp)
jne 0x5ba12
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x5ba2b
cmpl $0x0, -0x2c(%rbp)
jne 0x5ba1f
xorl %eax, %eax
movl %eax, -0x40(%rbp)
jmp 0x5ba25
movl -0x30(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
movl -0x2c(%rbp), %edx
movl -0x30(%rbp), %ecx
leaq 0x62d81(%rip), %rsi     # 0xbe7c3
movb $0x0, %al
callq 0x9150
movl -0x2c(%rbp), %eax
movq %rax, -0x48(%rbp)
subq $0x14, %rax
ja 0x5bb57
movq -0x48(%rbp), %rax
leaq 0x6256b(%rip), %rcx     # 0xbdfd0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x1, %rsi
movl -0x1c(%rbp), %edx
subl $0x1, %edx
callq 0x5c5a0
movl %eax, -0x4(%rbp)
jmp 0x5bb5e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x1, %rsi
movl -0x1c(%rbp), %edx
subl $0x1, %edx
callq 0x5c5d0
movl %eax, -0x4(%rbp)
jmp 0x5bb5e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x1, %rsi
movl -0x1c(%rbp), %edx
subl $0x1, %edx
callq 0x5cd10
movl %eax, -0x4(%rbp)
jmp 0x5bb5e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x1, %rsi
movl -0x1c(%rbp), %edx
subl $0x1, %edx
callq 0x5d3d0
movl %eax, -0x4(%rbp)
jmp 0x5bb5e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x1, %rsi
movl -0x1c(%rbp), %edx
subl $0x1, %edx
callq 0x5d950
movl %eax, -0x4(%rbp)
jmp 0x5bb5e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x1, %rsi
movl -0x1c(%rbp), %edx
subl $0x1, %edx
callq 0x5e140
movl %eax, -0x4(%rbp)
jmp 0x5bb5e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x1, %rsi
movl -0x1c(%rbp), %edx
subl $0x1, %edx
callq 0x5e8f0
movl %eax, -0x4(%rbp)
jmp 0x5bb5e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x1, %rsi
movl -0x1c(%rbp), %edx
subl $0x1, %edx
callq 0x5f040
movl %eax, -0x4(%rbp)
jmp 0x5bb5e
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)