// File: /workspace/github_cpp_makefile_star2_O1/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 %rbx
pushq %rax
movl $0x1, %edi
callq 0x7f47d
movzwl 0x2d744b(%rip), %edx    # 0x36ca80
xorl %ecx, %ecx
leaq 0x2a2c14(%rip), %rax    # 0x338252
movzwl (%rax), %esi
cmpl $0x121, %edx            # imm = 0x121
je 0x9564f
movl 0x2dc865(%rip), %ecx    # 0x371eb4
leal (%rsi,%rcx), %r8d
addl $0x8, %r8d
movl %r8d, 0x2dc856(%rip)    # 0x371eb4
cmpl 0x2d742b(%rip), %r8d    # 0x36ca90
jle 0x9566e
movl %r8d, 0x2d7422(%rip)    # 0x36ca90
leaq 0x1a8d1b(%rip), %rcx    # 0x23e390
movq (%rcx), %rdi
testq %rdi, %rdi
je 0x95698
movzwl (%rax), %ecx
addl $0x8, %ecx
movl 0x2d7406(%rip), %r9d    # 0x36ca90
leaq 0x8f0a6(%rip), %rsi     # 0x124737
xorl %eax, %eax
callq 0x9560
movzwl 0x2d73e1(%rip), %edx    # 0x36ca80
cmpl $0x4ff, %edx            # imm = 0x4FF
jg 0x956e8
cmpl $0x12f, %edx            # imm = 0x12F
jle 0x95736
cmpl $0x20f, %edx            # imm = 0x20F
jle 0x9583d
leal -0x210(%rdx), %eax
cmpl $0x5, %eax
ja 0x95917
leaq 0x89fd3(%rip), %rcx     # 0x11f6a8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x93e92
jmp 0x95a4b
cmpl $0x623, %edx            # imm = 0x623
jle 0x9576b
cmpl $0xa03, %edx            # imm = 0xA03
jle 0x957a7
cmpl $0xb01, %edx            # imm = 0xB01
jle 0x9588f
cmpl $0xb02, %edx            # imm = 0xB02
je 0x95a1b
cmpl $0xd01, %edx            # imm = 0xD01
je 0x959b1
cmpl $0xd04, %edx            # imm = 0xD04
jne 0x95a2b
callq 0x946b7
jmp 0x95a4b
cmpl $0x111, %edx            # imm = 0x111
jg 0x957d5
leal -0x102(%rdx), %eax
cmpl $0x4, %eax
ja 0x95a2b
leaq 0x89f3c(%rip), %rcx     # 0x11f694
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x9342e
jmp 0x95a4b
cmpl $0x607, %edx            # imm = 0x607
jg 0x95803
cmpl $0x605, %edx            # imm = 0x605
jg 0x958b1
cmpl $0x500, %edx            # imm = 0x500
je 0x959bb
cmpl $0x501, %edx            # imm = 0x501
jne 0x95a2b
leaq 0x8edcb(%rip), %rdi     # 0x12456d
jmp 0x959c2
cmpl $0x63c, %edx            # imm = 0x63C
jg 0x9586d
cmpl $0x624, %edx            # imm = 0x624
je 0x9597d
cmpl $0x631, %edx            # imm = 0x631
jne 0x95a2b
callq 0x94be4
jmp 0x95a4b
cmpl $0x120, %edx            # imm = 0x120
jg 0x958d3
cmpl $0x112, %edx            # imm = 0x112
je 0x959ce
cmpl $0x120, %edx            # imm = 0x120
jne 0x95a2b
callq 0x93a45
jmp 0x95a4b
cmpl $0x61c, %edx            # imm = 0x61C
jg 0x958f5
cmpl $0x608, %edx            # imm = 0x608
je 0x959d5
cmpl $0x613, %edx            # imm = 0x613
jne 0x95a2b
leaq 0x8ee51(%rip), %rdi     # 0x12467f
callq 0x58e77
callq 0x588f0
jmp 0x959c7
cmpl $0x130, %edx            # imm = 0x130
je 0x9599d
cmpl $0x132, %edx            # imm = 0x132
je 0x95991
cmpl $0x134, %edx            # imm = 0x134
jne 0x95a2b
leaq 0x8edcc(%rip), %rdi     # 0x124634
jmp 0x95a46
cmpl $0x63d, %edx            # imm = 0x63D
je 0x95987
cmpl $0x63e, %edx            # imm = 0x63E
jne 0x95a2b
callq 0x95493
jmp 0x95a4b
cmpl $0xa04, %edx            # imm = 0xA04
je 0x959a7
cmpl $0xa09, %edx            # imm = 0xA09
jne 0x95a2b
callq 0x9453a
jmp 0x95a4b
cmpl $0x606, %edx            # imm = 0x606
je 0x959dc
cmpl $0x607, %edx            # imm = 0x607
jne 0x95a2b
callq 0x94a93
jmp 0x95a4b
cmpl $0x121, %edx            # imm = 0x121
je 0x95a08
cmpl $0x122, %edx            # imm = 0x122
jne 0x95a2b
callq 0x935f4
jmp 0x95a4b
cmpl $0x61d, %edx            # imm = 0x61D
je 0x95a0f
cmpl $0x623, %edx            # imm = 0x623
jne 0x95a2b
callq 0x94762
jmp 0x95a4b
cmpl $0x30f, %edx            # imm = 0x30F
je 0x95a22
cmpl $0x310, %edx            # imm = 0x310
jne 0x95a2b
leaq 0x8ed22(%rip), %rdi     # 0x124658
jmp 0x95a46
leaq 0x8ed03(%rip), %rdi     # 0x124645
jmp 0x95a46
callq 0x934fb
jmp 0x95a4b
leaq 0x8ecf6(%rip), %rdi     # 0x12464e
jmp 0x95a46
callq 0x9361e
jmp 0x95a4b
callq 0x94124
jmp 0x95a4b
leaq 0x8ecee(%rip), %rdi     # 0x124666
jmp 0x95a46
callq 0x949fb
jmp 0x95a4b
movl $0x2, %edi
jmp 0x95a14
leaq 0x8eca4(%rip), %rdi     # 0x12463c
jmp 0x95a46
callq 0x93be6
jmp 0x95a4b
callq 0x9489b
jmp 0x95a4b
callq 0x953a3
jmp 0x95a4b
leaq 0x8eba3(%rip), %rdi     # 0x124565
callq 0x58e77
callq 0x588f0
jmp 0x95a4b
callq 0x93737
jmp 0x95a4b
callq 0x95426
jmp 0x95a4b
leaq 0x8ecc0(%rip), %rdi     # 0x1246a3
callq 0x58e77
callq 0x588f0
movzwl %ax, %eax
leaq 0x2783f9(%rip), %rcx    # 0x30ddf0
movl %eax, (%rcx)
leaq 0x2783f4(%rip), %rax    # 0x30ddf4
movl $0x1, (%rax)
jmp 0x95a4b
callq 0x937e6
jmp 0x95a4b
movl $0x1, %edi
callq 0x9461a
jmp 0x95a4b
callq 0x93b32
jmp 0x95a4b
leaq 0x8ec45(%rip), %rdi     # 0x12466e
jmp 0x95a46
leaq 0x2a67ee(%rip), %rbx    # 0x33c220
leaq 0x8ecea(%rip), %rsi     # 0x124723
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
callq 0x58e77
leaq 0x1a896e(%rip), %rax    # 0x23e3c0
cmpq $0x0, (%rax)
setne %al
leaq 0x18dba0(%rip), %rcx    # 0x223600
movq (%rcx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x95a75
callq 0xaff7
leaq 0x1a9524(%rip), %rax    # 0x23efa0
movl $0x1, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq