// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: get_version_info()
void get_version_info()
{
   log_packet_id("Packet 0x45 (Software version)");

   ap_major = tsip_byte();
   ap_minor = tsip_byte();
   ap_month = tsip_byte();
   ap_day = tsip_byte();
   ap_year = tsip_byte();
   if(ap_year > TRUNC_YEAR) ap_year += 1900;
   else                     ap_year += 2000;

   core_major = tsip_byte();
   core_minor = tsip_byte();
   core_month = tsip_byte();
   core_day = tsip_byte();
   core_year = tsip_byte();
   if(core_year > TRUNC_YEAR) core_year += 1900;
   else                       core_year += 2000;

   if(ap_month > 12) ap_month = 0;
   if(core_month > 12) core_month = 0;

   if((ap_major == 1) && (core_major == 1) && (core_year == 0)) {
      datum_flag = 1;
   }
   else if((ap_major == 5) && (ap_minor == 10) && (core_year == 1997)) {  // sv6 flag
      if(1 && (tsip_type == 0) && (sv6_flag == 0)) {  // most common SV6 firmware
         tsip_type = SV6_TYPE;
         config_rcvr_type(0);
         need_msg_init = 2002;
      }
      sv6_flag = 1;
   }

   check_tsip_end(1);
   if(tsip_error) return;

   saw_version |= 0x01;

   if(ap_month > 12) return;
   if(ap_month == 0) return;
   if(ap_day > 31) return;
   if(ap_day == 0) return;
   if(core_month > 12) return;
   if(core_month == 0) return;
   if(core_day > 31) return;
   if(core_day == 0) return;
   if(ap_year < 1980) return;
   if(ap_year > 2080) return;
   if(core_year < 1980) return;
   if(core_year > 2080) return;

   have_info |= VERSION_INFO;

   if(text_mode && first_key) return;
   if(zoom_screen) return;
   if(luxor) return;
if(just_read) return;

   show_version_header();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0xa3137(%rip), %rdi     # 0x10ba6e
callq 0x520bf
callq 0x51c47
leaq 0x28f05c(%rip), %rcx    # 0x2f79a4
movb %al, (%rcx)
callq 0x51c47
leaq 0x28f04f(%rip), %r13    # 0x2f79a5
movb %al, (%r13)
callq 0x51c47
leaq 0x28f040(%rip), %r15    # 0x2f79a6
movb %al, (%r15)
callq 0x51c47
leaq 0x28f032(%rip), %rcx    # 0x2f79a7
movb %al, (%rcx)
callq 0x51c47
movzbl %al, %eax
movl $0x7d0, %r14d           # imm = 0x7D0
leal (%rax,%r14), %ecx
movl $0x76c, %r12d           # imm = 0x76C
leal (%rax,%r12), %edx
cmpb $0x51, %al
cmovbl %ecx, %edx
leaq 0x28f009(%rip), %rax    # 0x2f79a8
movw %dx, (%rax)
callq 0x51c47
leaq 0x28effc(%rip), %rcx    # 0x2f79aa
movb %al, (%rcx)
callq 0x51c47
leaq 0x28efef(%rip), %rcx    # 0x2f79ab
movb %al, (%rcx)
callq 0x51c47
leaq 0x28efe2(%rip), %rbx    # 0x2f79ac
movb %al, (%rbx)
callq 0x51c47
leaq 0x28efd5(%rip), %rcx    # 0x2f79ad
movb %al, (%rcx)
callq 0x51c47
movzbl %al, %eax
addl %eax, %r14d
addl %eax, %r12d
cmpb $0x51, %al
cmovbl %r14d, %r12d
leaq 0x28efb9(%rip), %r14    # 0x2f79ae
movw %r12w, (%r14)
cmpb $0xd, (%r15)
jb 0x68a03
movb $0x0, (%r15)
cmpb $0xd, (%rbx)
jb 0x68a0b
movb $0x0, (%rbx)
leaq 0x28ef92(%rip), %rax    # 0x2f79a4
movb (%rax), %al
xorb $0x5, %al
movb (%r13), %cl
xorb $0xa, %cl
orb %al, %cl
sete %al
cmpw $0x7cd, %r12w           # imm = 0x7CD
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x68a6e
movq %r14, %r12
leaq 0x19c598(%rip), %rax    # 0x204fd4
leaq 0x19c599(%rip), %r14    # 0x204fdc
movl (%r14), %ecx
orl (%rax), %ecx
jne 0x68a64
movl $0x36, (%rax)
xorl %edi, %edi
callq 0x473fa
leaq 0x19c5d2(%rip), %rax    # 0x205030
movl $0x7d2, (%rax)          # imm = 0x7D2
movl $0x1, (%r14)
movq %r12, %r14
xorl %edi, %edi
callq 0x52194
leaq 0x1c04f4(%rip), %rax    # 0x228f70
cmpl $0x0, (%rax)
je 0x68a90
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x28e971(%rip), %rax    # 0x2f7408
orb $0x1, (%rax)
movb (%r15), %al
addb $-0xd, %al
cmpb $-0xc, %al
jb 0x68a81
leaq 0x28eefd(%rip), %rax    # 0x2f79a7
movb (%rax), %al
addb $-0x20, %al
cmpb $-0x1f, %al
jb 0x68a81
movb (%rbx), %al
addb $-0xd, %al
cmpb $-0xc, %al
jb 0x68a81
leaq 0x28eeec(%rip), %rax    # 0x2f79ad
movb (%rax), %al
addb $-0x20, %al
cmpb $-0x1f, %al
jb 0x68a81
leaq 0x28eed8(%rip), %rax    # 0x2f79a8
movzwl (%rax), %ecx
movl $0xfffff7df, %eax       # imm = 0xFFFFF7DF
addl %eax, %ecx
cmpw $-0x65, %cx
jb 0x68a81
movzwl (%r14), %ecx
addl %eax, %ecx
cmpw $-0x65, %cx
jb 0x68a81
leaq 0x28ee81(%rip), %rax    # 0x2f7974
orb $0x4, (%rax)
leaq 0x199cdb(%rip), %rax    # 0x2027d8
cmpl $0x0, (%rax)
setne %al
leaq 0x1c044e(%rip), %rcx    # 0x228f58
cmpl $0x0, (%rcx)
setne %cl
testb %cl, %al
jne 0x68a81
leaq 0x28dc89(%rip), %rax    # 0x2f67a8
cmpb $0x0, (%rax)
jne 0x68a81
leaq 0x1c040f(%rip), %rax    # 0x228f3e
cmpb $0x0, (%rax)
jne 0x68a81
leaq 0x2b84d9(%rip), %rax    # 0x321018
cmpb $0x0, (%rax)
jne 0x68a81
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x68b5b