// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: decode_ubx_msg()
void decode_ubx_msg()
{
static int ubx_bytes = 0;  // how many bytes received between time messages
   // Here we decode and parse Ublox UBX format messages

   start_msg_decode(1);
if(ubx_msg_id == UBX_UTC) ubx_bytes = (tsip_wptr+8);
else ubx_bytes += (tsip_wptr+8);
if(ubx_bytes > max_ubx_bytes) max_ubx_bytes = ubx_bytes;
if(1 && debug_file) {  //plugh
   fprintf(debug_file, "Decode UBX: %04X  len:%-3d  bytes:%-4d  max:%-4d\n", ubx_msg_id,tsip_wptr+8, ubx_bytes, max_ubx_bytes);
}

   if     (ubx_msg_id == UBX_NAV)        parse_ubx_nav();
   else if(ubx_msg_id == UBX_STATUS)     parse_ubx_status();
   else if(ubx_msg_id == UBX_CLOCK)      parse_ubx_clock();
   else if(ubx_msg_id == UBX_DOP)        parse_ubx_dop();
   else if(ubx_msg_id == UBX_SPEED)      parse_ubx_speed();
   else if(ubx_msg_id == UBX_UTC)        parse_ubx_utc();
   else if(ubx_msg_id == UBX_GPS)        parse_ubx_gps();
   else if(ubx_msg_id == UBX_SVN)        parse_ubx_svn();
   else if(ubx_msg_id == UBX_RAW)        parse_ubx_raw();
   else if(ubx_msg_id == UBX_RAWX)       parse_ubx_rawx();
   else if(ubx_msg_id == UBX_SBAS)       parse_ubx_sbas();
   else if(ubx_msg_id == UBX_ORB)        parse_ubx_orb();
   else if(ubx_msg_id == UBX_SOL)        parse_ubx_sol();
   else if(ubx_msg_id == UBX_SFRBX)      parse_ubx_sfrbx();
   else if(ubx_msg_id == UBX_SFRB)       parse_ubx_sfrb();
   else if(ubx_msg_id == TRK_SFRBX)      parse_trk_sfrbx();
   else if(ubx_msg_id == TRK_MEAS)       parse_trk_meas();
   else if(ubx_msg_id == UBX_PPS)        parse_ubx_pps();
   else if(ubx_msg_id == UBX_TP)         parse_ubx_tp();
   else if(ubx_msg_id == UBX_TP5)        parse_ubx_tp5();
   else if(ubx_msg_id == UBX_GNSS)       parse_ubx_gnss();
   else if(ubx_msg_id == UBX_CFG)        parse_ubx_cfg();
   else if(ubx_msg_id == UBX_MON)        parse_ubx_mon();
   else if(ubx_msg_id == UBX_VER)        parse_ubx_ver();
   else if(ubx_msg_id == UBX_LEAP)       parse_ubx_leap();
   else if(ubx_msg_id == UBX_DATUM)      parse_ubx_datum();
   else if(ubx_msg_id == UBX_NAK)        parse_ubx_nak();
   else if(ubx_msg_id == UBX_ACK)        parse_ubx_ack();
   else if(ubx_msg_id == UBX_CFG_ANT)    parse_ubx_ant();
   else if(ubx_msg_id == UBX_NAVX5)      parse_ubx_navx5();
   else if(ubx_msg_id == UBX_CFG_TMODE)  parse_ubx_tmode(1);
   else if(ubx_msg_id == UBX_CFG_TMODE2) parse_ubx_tmode(2);  // M8T
   else if(ubx_msg_id == UBX_NAV_RATE)   parse_ubx_rate();
   else if(ubx_msg_id == UBX_SVIN)       parse_ubx_svin();
   else                                  ignore_ubx_msg(ubx_msg_id);

   if(sim_file && sim_delay) {  // throttle sim file messages
      Sleep(sim_delay);
   }
   saw_rcvr_msg = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq $0x1
popq %rdi
callq 0x73dcb
movzwl 0x2cea17(%rip), %edx    # 0x356a80
xorl %eax, %eax
leaq 0x29a1e0(%rip), %rcx    # 0x322252
movzwl (%rcx), %ecx
cmpl $0x121, %edx            # imm = 0x121
je 0x88083
movl 0x2d3e31(%rip), %eax    # 0x35beb4
leal (%rcx,%rax), %r8d
addl $0x8, %r8d
movl %r8d, 0x2d3e22(%rip)    # 0x35beb4
movl 0x2ce9f7(%rip), %r9d    # 0x356a90
cmpl %r9d, %r8d
jle 0x880a8
movl %r8d, 0x2ce9eb(%rip)    # 0x356a90
movl %r8d, %r9d
leaq 0x1a02e1(%rip), %rax    # 0x228390
movq (%rax), %rdi
testq %rdi, %rdi
je 0x880cf
addl $0x8, %ecx
leaq 0x8669e(%rip), %rsi     # 0x10e75f
xorl %eax, %eax
callq 0x9560
movzwl 0x2ce9b1(%rip), %edx    # 0x356a80
movzwl %dx, %edi
leal -0x102(%rdi), %eax
cmpl $0x4, %eax
jbe 0x8822e
leal -0x210(%rdi), %eax
cmpl $0x5, %eax
jbe 0x88248
cmpl $0x112, %edi            # imm = 0x112
je 0x882ef
cmpl $0x120, %edi            # imm = 0x120
je 0x882a8
cmpl $0x121, %edi            # imm = 0x121
je 0x882b2
cmpl $0x122, %edi            # imm = 0x122
je 0x8832e
cmpl $0x130, %edi            # imm = 0x130
je 0x88327
cmpl $0x132, %edi            # imm = 0x132
je 0x882fd
cmpl $0x134, %edi            # imm = 0x134
je 0x88319
cmpl $0x30f, %edi            # imm = 0x30F
je 0x8835f
cmpl $0x310, %edi            # imm = 0x310
je 0x88351
cmpl $0x500, %edi            # imm = 0x500
je 0x88358
cmpl $0x501, %edi            # imm = 0x501
je 0x882e8
cmpl $0x606, %edi            # imm = 0x606
je 0x882bc
cmpl $0x607, %edi            # imm = 0x607
je 0x8834a
cmpl $0x608, %edi            # imm = 0x608
je 0x8833c
cmpl $0x613, %edi            # imm = 0x613
je 0x88343
cmpl $0x61d, %edi            # imm = 0x61D
je 0x882c6
cmpl $0x623, %edi            # imm = 0x623
je 0x882ca
cmpl $0x624, %edi            # imm = 0x624
je 0x882f6
cmpl $0x631, %edi            # imm = 0x631
je 0x88335
cmpl $0x63d, %edi            # imm = 0x63D
je 0x882d4
cmpl $0x63e, %edi            # imm = 0x63E
je 0x882e1
cmpl $0xa04, %edi            # imm = 0xA04
je 0x88304
cmpl $0xa09, %edi            # imm = 0xA09
je 0x88320
cmpl $0xb02, %edi            # imm = 0xB02
je 0x88312
cmpl $0xd01, %edi            # imm = 0xD01
je 0x8830b
cmpl $0xd04, %edi            # imm = 0xD04
jne 0x88262
callq 0x873d7
jmp 0x88364
leaq 0x8147b(%rip), %rcx     # 0x1096b0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x86528
jmp 0x88364
leaq 0x81475(%rip), %rcx     # 0x1096c4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x86d6a
jmp 0x88364
callq 0x88028
jmp 0x88364
callq 0x865ef
jmp 0x88364
callq 0x87272
jmp 0x88364
callq 0x866bb
jmp 0x88364
callq 0x8723f
jmp 0x88364
callq 0x86f7c
jmp 0x88364
callq 0x87250
jmp 0x88364
callq 0x86a3e
jmp 0x88364
callq 0x86869
jmp 0x88364
callq 0x875f7
jmp 0x88364
pushq $0x1
jmp 0x882d6
callq 0x87460
jmp 0x88364
pushq $0x2
popq %rdi
callq 0x8733e
jmp 0x88364
callq 0x87f5c
jmp 0x88364
callq 0x86512
jmp 0x88364
callq 0x867bf
jmp 0x88364
callq 0x87627
jmp 0x88364
callq 0x8722e
jmp 0x88364
callq 0x874ef
jmp 0x88364
callq 0x87e91
jmp 0x88364
callq 0x86ac1
jmp 0x88364
callq 0x8721d
jmp 0x88364
callq 0x87294
jmp 0x88364
callq 0x86b61
jmp 0x88364
callq 0x86691
jmp 0x88364
callq 0x8777d
jmp 0x88364
callq 0x87ef2
jmp 0x88364
callq 0x87323
jmp 0x88364
callq 0x8767a
jmp 0x88364
callq 0x87261
jmp 0x88364
callq 0x864fc
jmp 0x88364
callq 0x87283
leaq 0x1a0055(%rip), %rax    # 0x2283c0
cmpq $0x0, (%rax)
setne %al
leaq 0x185287(%rip), %rcx    # 0x20d600
movq (%rcx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x8838e
callq 0xae83
leaq 0x1a0c0b(%rip), %rax    # 0x228fa0
movl $0x1, (%rax)
popq %rbp
retq