// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_venus_status()
void parse_venus_status()
{
u08 sub_code;
int def_ofs;
int cur_ofs;
int flags;
u08 jam_status;
u32 tow;
u08 flash_status;
u08 flash_type;

   // message type 0x64 responses

   sub_code = tsip_byte();
   if(sub_code == 0x80) {  // boot status
      log_packet_id("venus boot status");
      flash_status = tsip_byte();
      flash_type = tsip_byte();
      if(flash_status != 0) {
         critical_alarms |= CRIT_ROM;
      }
      else { 
         critical_alarms &= (~CRIT_ROM);
      }
      if(!have_critical_alarms) need_redraw = 7702;
      have_critical_alarms = 2;
   }
   else if(sub_code == 0x83) {  // jamming mode
      log_packet_id("venus jamming mode");
      foliage_mode = tsip_byte();
      jam_status = tsip_byte();
   }
   else if(sub_code == 0x8C) {  // GNSS system selection mask
      log_packet_id("venus gnss selection");
      gnss_mask = tsip_word();
      have_gnss_mask = 1;
//sprintf(plot_title, "gnss mask:%04X", gnss_mask); // ggggg
   }
   else if(sub_code == 0x8E) {  // utc offset
      log_packet_id("venus utc offset status");
      tow = tsip_dword(); // tow in msecs
      tsip_dword();       // tow fraction
      tsip_word();        // week
      def_ofs = (int) (s08) tsip_byte();  // gps offset default
      cur_ofs = (int) (s08) tsip_byte();  // gps offset current
      flags = tsip_byte();

      if(!user_set_utc_ofs && (flags & 0x04)) {
         utc_offset = cur_ofs;
         check_utc_ofs(6);
      }
   }
   else {
      log_packet_id("unsupported status subcode");
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x97550
leaq 0x1a7a23(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
cmpl $0x8b, %eax
jg 0x975ba
cmpl $0x80, %eax
je 0x976b6
cmpl $0x83, %eax
jne 0x976a4
leaq 0x8d39a(%rip), %rdi     # 0x124911
callq 0x58e77
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x97592
leaq 0x1a79e1(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0x275b2b(%rip), %rcx    # 0x30d0c4
movb %al, (%rcx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x97752
leaq 0x1a79be(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
jmp 0x97752
cmpl $0x8c, %eax
je 0x97728
cmpl $0x8e, %eax
jne 0x976a4
leaq 0x8d362(%rip), %rdi     # 0x124939
callq 0x58e77
callq 0x589b0
callq 0x589b0
callq 0x588f0
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x97601
leaq 0x1a7972(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0x97619
leaq 0x1a795a(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x9762f
leaq 0x1a7944(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
testb $0x4, %al
je 0x97752
leaq 0x2760f6(%rip), %rax    # 0x30d734
cmpl $0x0, (%rax)
jne 0x97752
movsbl %bl, %ecx
leaq 0x2760d7(%rip), %rax    # 0x30d728
movl %ecx, (%rax)
leaq 0x275cc2(%rip), %rax    # 0x30d31c
cmpl $0x0, (%rax)
jne 0x97752
leaq 0x275eaa(%rip), %rdx    # 0x30d514
cmpl $0x7e1, (%rdx)          # imm = 0x7E1
setge %dl
cmpl $0x12, %ecx
setl %sil
andb %dl, %sil
cmpl $0x11, %ecx
setl %cl
orb %sil, %cl
jne 0x97752
leaq 0x1811b1(%rip), %rcx    # 0x218844
movl $0x7d6, (%rcx)          # imm = 0x7D6
movl $0x6, (%rax)
jmp 0x97752
leaq 0x8d2a6(%rip), %rdi     # 0x124951
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x58e77
leaq 0x8d242(%rip), %rdi     # 0x1248ff
callq 0x58e77
callq 0x587d1
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0x976da
leaq 0x1a7899(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x976f0
leaq 0x1a7883(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
xorl %eax, %eax
testb %bl, %bl
setne %al
leaq 0x275ad2(%rip), %rcx    # 0x30d1d0
movl (%rcx), %edx
andl $-0x2, %edx
orl %edx, %eax
movl %eax, (%rcx)
leaq 0x275b9a(%rip), %rax    # 0x30d2a8
cmpl $0x0, (%rax)
jne 0x97720
leaq 0x18112a(%rip), %rcx    # 0x218844
movl $0x1e16, (%rcx)         # imm = 0x1E16
movl $0x2, (%rax)
jmp 0x97752
leaq 0x8d1f5(%rip), %rdi     # 0x124924
callq 0x58e77
callq 0x588f0
movzwl %ax, %eax
leaq 0xd9531(%rip), %rcx     # 0x170c74
movl %eax, (%rcx)
leaq 0xd952c(%rip), %rax     # 0x170c78
movl $0x1, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq