// File: /workspace/github_cpp_makefile_star2_O1/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 0xaf53e(%rip), %rdi     # 0x121a46
callq 0x58e77
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x72523
leaq 0x1cca50(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0x29b47a(%rip), %rcx    # 0x30d9a4
movb %al, (%rcx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x72542
leaq 0x1cca31(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0x29b45c(%rip), %r13    # 0x30d9a5
movb %al, (%r13)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x72563
leaq 0x1cca10(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0x29b43c(%rip), %rbx    # 0x30d9a6
movb %al, (%rbx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x72582
leaq 0x1cc9f1(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0x29b41e(%rip), %rcx    # 0x30d9a7
movb %al, (%rcx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x725a1
leaq 0x1cc9d2(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
leal 0x7d0(%rax), %ecx
leal 0x76c(%rax), %edx
cmpb $0x51, %al
cmovbl %ecx, %edx
leaq 0x29b3ec(%rip), %rax    # 0x30d9a8
movw %dx, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x725d5
leaq 0x1cc99e(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0x29b3ce(%rip), %rcx    # 0x30d9aa
movb %al, (%rcx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x725f4
leaq 0x1cc97f(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0x29b3b0(%rip), %rcx    # 0x30d9ab
movb %al, (%rcx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x72613
leaq 0x1cc960(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0x29b392(%rip), %r14    # 0x30d9ac
movb %al, (%r14)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x72633
leaq 0x1cc940(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0x29b373(%rip), %r12    # 0x30d9ad
movb %al, (%r12)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x72654
leaq 0x1cc91f(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %ecx
leal 0x7d0(%rcx), %edx
leal 0x76c(%rcx), %eax
cmpb $0x51, %cl
cmovbl %edx, %eax
leaq 0x29b33e(%rip), %r15    # 0x30d9ae
movw %ax, (%r15)
cmpb $0xd, (%rbx)
jb 0x7267c
movb $0x0, (%rbx)
cmpb $0xd, (%r14)
jb 0x72686
movb $0x0, (%r14)
leaq 0x29b317(%rip), %rcx    # 0x30d9a4
cmpb $0x5, (%rcx)
jne 0x726db
cmpb $0xa, (%r13)
jne 0x726db
movzwl %ax, %eax
cmpl $0x7cd, %eax            # imm = 0x7CD
jne 0x726db
leaq 0x1a892a(%rip), %rax    # 0x21afd4
leaq 0x1a892b(%rip), %r13    # 0x21afdc
movl (%r13), %ecx
orl (%rax), %ecx
jne 0x726d3
movl $0x36, (%rax)
xorl %edi, %edi
callq 0x4b25a
leaq 0x1a8963(%rip), %rax    # 0x21b030
movl $0x7d2, (%rax)          # imm = 0x7D2
movl $0x1, (%r13)
xorl %edi, %edi
callq 0x58f50
leaq 0x1cc887(%rip), %rax    # 0x23ef70
cmpl $0x0, (%rax)
je 0x726fd
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x29ad04(%rip), %rax    # 0x30d408
orb $0x1, (%rax)
movb (%rbx), %al
addb $-0xd, %al
cmpb $-0xc, %al
jb 0x726ee
leaq 0x29b291(%rip), %rax    # 0x30d9a7
movb (%rax), %al
addb $-0x20, %al
cmpb $-0x1f, %al
jb 0x726ee
movb (%r14), %al
addb $-0xd, %al
cmpb $-0xc, %al
jb 0x726ee
movb (%r12), %al
addb $-0x20, %al
cmpb $-0x1f, %al
jb 0x726ee
leaq 0x29b270(%rip), %rax    # 0x30d9a8
movzwl (%rax), %ecx
movl $0xfffff7df, %eax       # imm = 0xFFFFF7DF
addl %eax, %ecx
cmpw $-0x65, %cx
jb 0x726ee
movzwl (%r15), %ecx
addl %eax, %ecx
cmpw $-0x65, %cx
jb 0x726ee
leaq 0x29b219(%rip), %rax    # 0x30d974
orb $0x4, (%rax)
leaq 0x1a6073(%rip), %rax    # 0x2187d8
cmpl $0x0, (%rax)
setne %al
leaq 0x1cc7e6(%rip), %rcx    # 0x23ef58
cmpl $0x0, (%rcx)
setne %cl
testb %cl, %al
jne 0x726ee
leaq 0x29a021(%rip), %rax    # 0x30c7a8
cmpb $0x0, (%rax)
jne 0x726ee
leaq 0x1cc7a7(%rip), %rax    # 0x23ef3e
cmpb $0x0, (%rax)
jne 0x726ee
leaq 0x2c4871(%rip), %rax    # 0x337018
cmpb $0x0, (%rax)
jne 0x726ee
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x727c3