// File: /workspace/github_cpp_makefile_star2_O3/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 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x97676
leaq 0x1a78fd(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
cmpl $0x8b, %eax
jg 0x976e0
cmpl $0x80, %eax
je 0x977dc
cmpl $0x83, %eax
jne 0x977ca
leaq 0x8d354(%rip), %rdi     # 0x1249f1
callq 0x58dc2
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x976b8
leaq 0x1a78bb(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0x275a05(%rip), %rcx    # 0x30d0c4
movb %al, (%rcx)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x97878
leaq 0x1a7898(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
jmp 0x97878
cmpl $0x8c, %eax
je 0x9784e
cmpl $0x8e, %eax
jne 0x977ca
leaq 0x8d31c(%rip), %rdi     # 0x124a19
callq 0x58dc2
callq 0x58964
callq 0x58964
callq 0x588d2
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x97727
leaq 0x1a784c(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0x9773f
leaq 0x1a7834(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x97755
leaq 0x1a781e(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
testb $0x4, %al
je 0x97878
leaq 0x275fd0(%rip), %rax    # 0x30d734
cmpl $0x0, (%rax)
jne 0x97878
movsbl %bl, %ecx
leaq 0x275fb1(%rip), %rax    # 0x30d728
movl %ecx, (%rax)
leaq 0x275b9c(%rip), %rax    # 0x30d31c
cmpl $0x0, (%rax)
jne 0x97878
leaq 0x275d84(%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 0x97878
leaq 0x18108b(%rip), %rcx    # 0x218844
movl $0x7d6, (%rcx)          # imm = 0x7D6
movl $0x6, (%rax)
jmp 0x97878
leaq 0x8d260(%rip), %rdi     # 0x124a31
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x58dc2
leaq 0x8d1fc(%rip), %rdi     # 0x1249df
callq 0x58dc2
callq 0x587be
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0x97800
leaq 0x1a7773(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x97816
leaq 0x1a775d(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
xorl %eax, %eax
testb %bl, %bl
setne %al
leaq 0x2759ac(%rip), %rcx    # 0x30d1d0
movl (%rcx), %edx
andl $-0x2, %edx
orl %edx, %eax
movl %eax, (%rcx)
leaq 0x275a74(%rip), %rax    # 0x30d2a8
cmpl $0x0, (%rax)
jne 0x97846
leaq 0x181004(%rip), %rcx    # 0x218844
movl $0x1e16, (%rcx)         # imm = 0x1E16
movl $0x2, (%rax)
jmp 0x97878
leaq 0x8d1af(%rip), %rdi     # 0x124a04
callq 0x58dc2
callq 0x588d2
movzwl %ax, %eax
leaq 0xd940b(%rip), %rcx     # 0x170c74
movl %eax, (%rcx)
leaq 0xd9406(%rip), %rax     # 0x170c78
movl $0x1, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq