// File: /workspace/github_cpp_makefile_star2_O3/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 0x7f2b8
movzwl 0x2d7355(%rip), %edx    # 0x36ca80
xorl %eax, %eax
leaq 0x2a2b1e(%rip), %rcx    # 0x338252
movzwl (%rcx), %ecx
cmpl $0x121, %edx            # imm = 0x121
je 0x95745
movl 0x2dc76f(%rip), %eax    # 0x371eb4
leal (%rcx,%rax), %r8d
addl $0x8, %r8d
movl %r8d, 0x2dc760(%rip)    # 0x371eb4
movl 0x2d7335(%rip), %r9d    # 0x36ca90
cmpl %r9d, %r8d
jle 0x9576a
movl %r8d, 0x2d7329(%rip)    # 0x36ca90
movl %r8d, %r9d
leaq 0x1a8c1f(%rip), %rax    # 0x23e390
movq (%rax), %rdi
testq %rdi, %rdi
je 0x95791
addl $0x8, %ecx
leaq 0x8f094(%rip), %rsi     # 0x124817
xorl %eax, %eax
callq 0x9560
movzwl 0x2d72ef(%rip), %edx    # 0x36ca80
movzwl %dx, %edx
cmpl $0x4ff, %edx            # imm = 0x4FF
jg 0x957dd
cmpl $0x12f, %edx            # imm = 0x12F
jle 0x9582b
cmpl $0x20f, %edx            # imm = 0x20F
jle 0x95932
leal -0x210(%rdx), %eax
cmpl $0x5, %eax
ja 0x95a0c
leaq 0x89fb6(%rip), %rcx     # 0x11f780
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x93f1d
jmp 0x95b40
cmpl $0x623, %edx            # imm = 0x623
jle 0x95860
cmpl $0xa03, %edx            # imm = 0xA03
jle 0x9589c
cmpl $0xb01, %edx            # imm = 0xB01
jle 0x95984
cmpl $0xb02, %edx            # imm = 0xB02
je 0x95b10
cmpl $0xd01, %edx            # imm = 0xD01
je 0x95aa6
cmpl $0xd04, %edx            # imm = 0xD04
jne 0x95b20
callq 0x94732
jmp 0x95b40
cmpl $0x111, %edx            # imm = 0x111
jg 0x958ca
leal -0x102(%rdx), %eax
cmpl $0x4, %eax
ja 0x95b20
leaq 0x89f1f(%rip), %rcx     # 0x11f76c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x934c7
jmp 0x95b40
cmpl $0x607, %edx            # imm = 0x607
jg 0x958f8
cmpl $0x605, %edx            # imm = 0x605
jg 0x959a6
cmpl $0x500, %edx            # imm = 0x500
je 0x95ab0
cmpl $0x501, %edx            # imm = 0x501
jne 0x95b20
leaq 0x8edb6(%rip), %rdi     # 0x12464d
jmp 0x95ab7
cmpl $0x63c, %edx            # imm = 0x63C
jg 0x95962
cmpl $0x624, %edx            # imm = 0x624
je 0x95a72
cmpl $0x631, %edx            # imm = 0x631
jne 0x95b20
callq 0x94c68
jmp 0x95b40
cmpl $0x120, %edx            # imm = 0x120
jg 0x959c8
cmpl $0x112, %edx            # imm = 0x112
je 0x95ac3
cmpl $0x120, %edx            # imm = 0x120
jne 0x95b20
callq 0x93ac9
jmp 0x95b40
cmpl $0x61c, %edx            # imm = 0x61C
jg 0x959ea
cmpl $0x608, %edx            # imm = 0x608
je 0x95aca
cmpl $0x613, %edx            # imm = 0x613
jne 0x95b20
leaq 0x8ee3c(%rip), %rdi     # 0x12475f
callq 0x58dc2
callq 0x588d2
jmp 0x95abc
cmpl $0x130, %edx            # imm = 0x130
je 0x95a92
cmpl $0x132, %edx            # imm = 0x132
je 0x95a86
cmpl $0x134, %edx            # imm = 0x134
jne 0x95b20
leaq 0x8edb7(%rip), %rdi     # 0x124714
jmp 0x95b3b
cmpl $0x63d, %edx            # imm = 0x63D
je 0x95a7c
cmpl $0x63e, %edx            # imm = 0x63E
jne 0x95b20
callq 0x95591
jmp 0x95b40
cmpl $0xa04, %edx            # imm = 0xA04
je 0x95a9c
cmpl $0xa09, %edx            # imm = 0xA09
jne 0x95b20
callq 0x945b5
jmp 0x95b40
cmpl $0x606, %edx            # imm = 0x606
je 0x95ad1
cmpl $0x607, %edx            # imm = 0x607
jne 0x95b20
callq 0x94b1e
jmp 0x95b40
cmpl $0x121, %edx            # imm = 0x121
je 0x95afd
cmpl $0x122, %edx            # imm = 0x122
jne 0x95b20
callq 0x93678
jmp 0x95b40
cmpl $0x61d, %edx            # imm = 0x61D
je 0x95b04
cmpl $0x623, %edx            # imm = 0x623
jne 0x95b20
callq 0x947dd
jmp 0x95b40
cmpl $0x30f, %edx            # imm = 0x30F
je 0x95b17
cmpl $0x310, %edx            # imm = 0x310
jne 0x95b20
leaq 0x8ed0d(%rip), %rdi     # 0x124738
jmp 0x95b3b
leaq 0x8ecee(%rip), %rdi     # 0x124725
jmp 0x95b3b
callq 0x93594
jmp 0x95b40
leaq 0x8ece1(%rip), %rdi     # 0x12472e
jmp 0x95b3b
callq 0x936a2
jmp 0x95b40
callq 0x941ae
jmp 0x95b40
leaq 0x8ecd9(%rip), %rdi     # 0x124746
jmp 0x95b3b
callq 0x94a86
jmp 0x95b40
movl $0x2, %edi
jmp 0x95b09
leaq 0x8ec8f(%rip), %rdi     # 0x12471c
jmp 0x95b3b
callq 0x93c6a
jmp 0x95b40
callq 0x94916
jmp 0x95b40
callq 0x954a1
jmp 0x95b40
leaq 0x8eb8e(%rip), %rdi     # 0x124645
callq 0x58dc2
callq 0x588d2
jmp 0x95b40
callq 0x937bb
jmp 0x95b40
callq 0x95524
jmp 0x95b40
leaq 0x8ecab(%rip), %rdi     # 0x124783
callq 0x58dc2
callq 0x588d2
movzwl %ax, %eax
leaq 0x278304(%rip), %rcx    # 0x30ddf0
movl %eax, (%rcx)
leaq 0x2782ff(%rip), %rax    # 0x30ddf4
movl $0x1, (%rax)
jmp 0x95b40
callq 0x9386a
jmp 0x95b40
movl $0x1, %edi
callq 0x94695
jmp 0x95b40
callq 0x93bb6
jmp 0x95b40
leaq 0x8ec30(%rip), %rdi     # 0x12474e
jmp 0x95b3b
leaq 0x2a66f9(%rip), %rbx    # 0x33c220
leaq 0x8ecd5(%rip), %rsi     # 0x124803
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
callq 0x58dc2
leaq 0x1a8879(%rip), %rax    # 0x23e3c0
cmpq $0x0, (%rax)
setne %al
leaq 0x18daab(%rip), %rcx    # 0x223600
movq (%rcx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x95b6a
callq 0xafe8
leaq 0x1a942f(%rip), %rax    # 0x23efa0
movl $0x1, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq