// File: 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
leaq 0xe8a9b(%rip), %rdi     # 0x184db6
callq 0x7add0
callq 0x7a510
movb %al, %cl
leaq 0x2d0856(%rip), %rax    # 0x36cb84
movb %cl, (%rax)
callq 0x7a510
movb %al, %cl
leaq 0x2d0847(%rip), %rax    # 0x36cb85
movb %cl, (%rax)
callq 0x7a510
movb %al, %cl
leaq 0x2d0838(%rip), %rax    # 0x36cb86
movb %cl, (%rax)
callq 0x7a510
movb %al, %cl
leaq 0x2d0829(%rip), %rax    # 0x36cb87
movb %cl, (%rax)
callq 0x7a510
movzbl %al, %eax
movw %ax, %cx
leaq 0x2d0816(%rip), %rax    # 0x36cb88
movw %cx, (%rax)
leaq 0x2d080c(%rip), %rax    # 0x36cb88
movzwl (%rax), %eax
cmpl $0x50, %eax
jle 0x9c3a2
leaq 0x2d07fd(%rip), %rax    # 0x36cb88
movzwl (%rax), %eax
addl $0x76c, %eax            # imm = 0x76C
movw %ax, %cx
leaq 0x2d07eb(%rip), %rax    # 0x36cb88
movw %cx, (%rax)
jmp 0x9c3be
leaq 0x2d07df(%rip), %rax    # 0x36cb88
movzwl (%rax), %eax
addl $0x7d0, %eax            # imm = 0x7D0
movw %ax, %cx
leaq 0x2d07cd(%rip), %rax    # 0x36cb88
movw %cx, (%rax)
callq 0x7a510
movb %al, %cl
leaq 0x2d07be(%rip), %rax    # 0x36cb8a
movb %cl, (%rax)
callq 0x7a510
movb %al, %cl
leaq 0x2d07af(%rip), %rax    # 0x36cb8b
movb %cl, (%rax)
callq 0x7a510
movb %al, %cl
leaq 0x2d07a0(%rip), %rax    # 0x36cb8c
movb %cl, (%rax)
callq 0x7a510
movb %al, %cl
leaq 0x2d0791(%rip), %rax    # 0x36cb8d
movb %cl, (%rax)
callq 0x7a510
movzbl %al, %eax
movw %ax, %cx
leaq 0x2d077e(%rip), %rax    # 0x36cb8e
movw %cx, (%rax)
leaq 0x2d0774(%rip), %rax    # 0x36cb8e
movzwl (%rax), %eax
cmpl $0x50, %eax
jle 0x9c440
leaq 0x2d0765(%rip), %rax    # 0x36cb8e
movzwl (%rax), %eax
addl $0x76c, %eax            # imm = 0x76C
movw %ax, %cx
leaq 0x2d0753(%rip), %rax    # 0x36cb8e
movw %cx, (%rax)
jmp 0x9c45c
leaq 0x2d0747(%rip), %rax    # 0x36cb8e
movzwl (%rax), %eax
addl $0x7d0, %eax            # imm = 0x7D0
movw %ax, %cx
leaq 0x2d0735(%rip), %rax    # 0x36cb8e
movw %cx, (%rax)
leaq 0x2d0723(%rip), %rax    # 0x36cb86
movzbl (%rax), %eax
cmpl $0xc, %eax
jle 0x9c475
leaq 0x2d0714(%rip), %rax    # 0x36cb86
movb $0x0, (%rax)
leaq 0x2d0710(%rip), %rax    # 0x36cb8c
movzbl (%rax), %eax
cmpl $0xc, %eax
jle 0x9c48e
leaq 0x2d0701(%rip), %rax    # 0x36cb8c
movb $0x0, (%rax)
leaq 0x2d06ef(%rip), %rax    # 0x36cb84
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0x9c4ca
leaq 0x2d06e6(%rip), %rax    # 0x36cb8a
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0x9c4ca
leaq 0x2d06db(%rip), %rax    # 0x36cb8e
movzwl (%rax), %eax
cmpl $0x0, %eax
jne 0x9c4ca
leaq 0x1ddcf6(%rip), %rax    # 0x27a1b8
movl $0x1, (%rax)
jmp 0x9c541
leaq 0x2d06b3(%rip), %rax    # 0x36cb84
movzbl (%rax), %eax
cmpl $0x5, %eax
jne 0x9c53f
leaq 0x2d06a5(%rip), %rax    # 0x36cb85
movzbl (%rax), %eax
cmpl $0xa, %eax
jne 0x9c53f
leaq 0x2d069f(%rip), %rax    # 0x36cb8e
movzwl (%rax), %eax
cmpl $0x7cd, %eax            # imm = 0x7CD
jne 0x9c53f
leaq 0x1ddcb4(%rip), %rax    # 0x27a1b4
cmpl $0x0, (%rax)
jne 0x9c532
leaq 0x1ddcb0(%rip), %rax    # 0x27a1bc
cmpl $0x0, (%rax)
jne 0x9c532
leaq 0x1ddc9c(%rip), %rax    # 0x27a1b4
movl $0x36, (%rax)
xorl %edi, %edi
callq 0x6a330
leaq 0x1ddce4(%rip), %rax    # 0x27a210
movl $0x7d2, (%rax)          # imm = 0x7D2
leaq 0x1ddc83(%rip), %rax    # 0x27a1bc
movl $0x1, (%rax)
jmp 0x9c541
movl $0x1, %edi
callq 0x7aee0
leaq 0x201bfe(%rip), %rax    # 0x29e150
cmpl $0x0, (%rax)
je 0x9c55c
jmp 0x9c6c1
leaq 0x2d0085(%rip), %rax    # 0x36c5e8
movl (%rax), %ecx
orl $0x1, %ecx
leaq 0x2d0079(%rip), %rax    # 0x36c5e8
movl %ecx, (%rax)
leaq 0x2d060e(%rip), %rax    # 0x36cb86
movzbl (%rax), %eax
cmpl $0xc, %eax
jle 0x9c585
jmp 0x9c6c1
leaq 0x2d05fa(%rip), %rax    # 0x36cb86
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x9c599
jmp 0x9c6c1
leaq 0x2d05e7(%rip), %rax    # 0x36cb87
movzbl (%rax), %eax
cmpl $0x1f, %eax
jle 0x9c5ad
jmp 0x9c6c1
leaq 0x2d05d3(%rip), %rax    # 0x36cb87
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x9c5c1
jmp 0x9c6c1
leaq 0x2d05c4(%rip), %rax    # 0x36cb8c
movzbl (%rax), %eax
cmpl $0xc, %eax
jle 0x9c5d5
jmp 0x9c6c1
leaq 0x2d05b0(%rip), %rax    # 0x36cb8c
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x9c5e9
jmp 0x9c6c1
leaq 0x2d059d(%rip), %rax    # 0x36cb8d
movzbl (%rax), %eax
cmpl $0x1f, %eax
jle 0x9c5fd
jmp 0x9c6c1
leaq 0x2d0589(%rip), %rax    # 0x36cb8d
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x9c611
jmp 0x9c6c1
leaq 0x2d0570(%rip), %rax    # 0x36cb88
movzwl (%rax), %eax
cmpl $0x7bc, %eax            # imm = 0x7BC
jge 0x9c627
jmp 0x9c6c1
leaq 0x2d055a(%rip), %rax    # 0x36cb88
movzwl (%rax), %eax
cmpl $0x820, %eax            # imm = 0x820
jle 0x9c63d
jmp 0x9c6c1
leaq 0x2d054a(%rip), %rax    # 0x36cb8e
movzwl (%rax), %eax
cmpl $0x7bc, %eax            # imm = 0x7BC
jge 0x9c650
jmp 0x9c6c1
leaq 0x2d0537(%rip), %rax    # 0x36cb8e
movzwl (%rax), %eax
cmpl $0x820, %eax            # imm = 0x820
jle 0x9c663
jmp 0x9c6c1
leaq 0x2d04ea(%rip), %rax    # 0x36cb54
movl (%rax), %ecx
orl $0x4, %ecx
leaq 0x2d04de(%rip), %rax    # 0x36cb54
movl %ecx, (%rax)
leaq 0x1db339(%rip), %rax    # 0x2779b8
cmpl $0x0, (%rax)
je 0x9c692
leaq 0x201aad(%rip), %rax    # 0x29e138
cmpl $0x0, (%rax)
je 0x9c692
jmp 0x9c6c1
leaq 0x2cf2ef(%rip), %rax    # 0x36b988
cmpb $0x0, (%rax)
je 0x9c6a0
jmp 0x9c6c1
leaq 0x201a77(%rip), %rax    # 0x29e11e
cmpb $0x0, (%rax)
je 0x9c6ae
jmp 0x9c6c1
leaq 0x2f9b43(%rip), %rax    # 0x3961f8
cmpb $0x0, (%rax)
je 0x9c6bc
jmp 0x9c6c1
callq 0x9c6d0
popq %rbp
retq
nopw %cs:(%rax,%rax)