// File: /workspace/github_cpp_makefile_star2_O3/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 0xaf75e(%rip), %rdi     # 0x121b26
callq 0x58dc2
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x723e3
leaq 0x1ccb90(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0x29b5ba(%rip), %rcx    # 0x30d9a4
movb %al, (%rcx)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x72402
leaq 0x1ccb71(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0x29b59c(%rip), %r13    # 0x30d9a5
movb %al, (%r13)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x72423
leaq 0x1ccb50(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0x29b57c(%rip), %rbx    # 0x30d9a6
movb %al, (%rbx)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x72442
leaq 0x1ccb31(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0x29b55e(%rip), %rcx    # 0x30d9a7
movb %al, (%rcx)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x72461
leaq 0x1ccb12(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
leal 0x7d0(%rax), %ecx
leal 0x76c(%rax), %edx
cmpb $0x51, %al
cmovbl %ecx, %edx
leaq 0x29b52c(%rip), %rax    # 0x30d9a8
movw %dx, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x72495
leaq 0x1ccade(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0x29b50e(%rip), %rcx    # 0x30d9aa
movb %al, (%rcx)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x724b4
leaq 0x1ccabf(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0x29b4f0(%rip), %rcx    # 0x30d9ab
movb %al, (%rcx)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x724d3
leaq 0x1ccaa0(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0x29b4d2(%rip), %r14    # 0x30d9ac
movb %al, (%r14)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x724f3
leaq 0x1cca80(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0x29b4b3(%rip), %r12    # 0x30d9ad
movb %al, (%r12)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x72514
leaq 0x1cca5f(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %ecx
leal 0x7d0(%rcx), %edx
leal 0x76c(%rcx), %eax
cmpb $0x51, %cl
cmovbl %edx, %eax
leaq 0x29b47e(%rip), %r15    # 0x30d9ae
movw %ax, (%r15)
cmpb $0xd, (%rbx)
jb 0x7253c
movb $0x0, (%rbx)
cmpb $0xd, (%r14)
jb 0x72546
movb $0x0, (%r14)
leaq 0x29b457(%rip), %rcx    # 0x30d9a4
cmpb $0x5, (%rcx)
jne 0x7259b
cmpb $0xa, (%r13)
jne 0x7259b
movzwl %ax, %eax
cmpl $0x7cd, %eax            # imm = 0x7CD
jne 0x7259b
leaq 0x1a8a6a(%rip), %rax    # 0x21afd4
leaq 0x1a8a6b(%rip), %r13    # 0x21afdc
movl (%r13), %ecx
orl (%rax), %ecx
jne 0x72593
movl $0x36, (%rax)
xorl %edi, %edi
callq 0x4b2af
leaq 0x1a8aa3(%rip), %rax    # 0x21b030
movl $0x7d2, (%rax)          # imm = 0x7D2
movl $0x1, (%r13)
xorl %edi, %edi
callq 0x58e9b
leaq 0x1cc9c7(%rip), %rax    # 0x23ef70
cmpl $0x0, (%rax)
je 0x725bd
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x29ae44(%rip), %rax    # 0x30d408
orb $0x1, (%rax)
movb (%rbx), %al
addb $-0xd, %al
cmpb $-0xc, %al
jb 0x725ae
leaq 0x29b3d1(%rip), %rax    # 0x30d9a7
movb (%rax), %al
addb $-0x20, %al
cmpb $-0x1f, %al
jb 0x725ae
movb (%r14), %al
addb $-0xd, %al
cmpb $-0xc, %al
jb 0x725ae
movb (%r12), %al
addb $-0x20, %al
cmpb $-0x1f, %al
jb 0x725ae
leaq 0x29b3b0(%rip), %rax    # 0x30d9a8
movzwl (%rax), %ecx
movl $0xfffff7df, %eax       # imm = 0xFFFFF7DF
addl %eax, %ecx
cmpw $-0x65, %cx
jb 0x725ae
movzwl (%r15), %ecx
addl %eax, %ecx
cmpw $-0x65, %cx
jb 0x725ae
leaq 0x29b359(%rip), %rax    # 0x30d974
orb $0x4, (%rax)
leaq 0x1a61b3(%rip), %rax    # 0x2187d8
cmpl $0x0, (%rax)
setne %al
leaq 0x1cc926(%rip), %rcx    # 0x23ef58
cmpl $0x0, (%rcx)
setne %cl
testb %cl, %al
jne 0x725ae
leaq 0x29a161(%rip), %rax    # 0x30c7a8
cmpb $0x0, (%rax)
jne 0x725ae
leaq 0x1cc8e7(%rip), %rax    # 0x23ef3e
cmpb $0x0, (%rax)
jne 0x725ae
leaq 0x2c49b1(%rip), %rax    # 0x337018
cmpb $0x0, (%rax)
jne 0x725ae
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x72683