// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: get_manuf_params()
void get_manuf_params()
{
u16 test_code;
int sum;

   log_packet_id("Packet 0x8F.41 (Manufacturing Params)");

   sn_prefix = tsip_word();
   serial_num = tsip_dword();
   build_year = sum = tsip_byte();
   if(build_year > TRUNC_YEAR) build_year += 1900;
   else                        build_year += 2000;
   build_month = tsip_byte();
   build_day = tsip_byte();
   build_hour = tsip_byte();
   build_offset = tsip_single();
   test_code = tsip_word();
   check_tsip_end(1);
   if(tsip_error) return;

   if(build_month > 12) build_month = 0;

   sum += sn_prefix + serial_num + test_code + build_month + build_day + build_hour;  // check for zeroed build params
   build_ok = ((build_month <= 12) && (build_month != 0) && 
               (build_day <= 31) && (build_day != 0) &&
               (build_year >= 1980) && (build_year <= 2080) &&
               (build_hour <= 24));

   have_build |= 0x01;
   if(build_ok) have_build |= 0x02;


   if((sum == 0) || build_ok) {
      show_manuf_params();
   }

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

////show_serial_info();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0xace00(%rip), %rdi     # 0x121ea7
callq 0x58e77
callq 0x588f0
leaq 0x2988c8(%rip), %rcx    # 0x30d980
movw %ax, (%rcx)
callq 0x589b0
leaq 0x2988bd(%rip), %rcx    # 0x30d984
movl %eax, (%rcx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x750df
leaq 0x1c9e94(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %r14d
leal 0x7d0(%r14), %eax
leal 0x76c(%r14), %ecx
cmpb $0x51, %r14b
cmovbl %eax, %ecx
leaq 0x298889(%rip), %rax    # 0x30d988
movw %cx, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x75118
leaq 0x1c9e5b(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0x29886b(%rip), %r15    # 0x30d98a
movb %al, (%r15)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x75138
leaq 0x1c9e3b(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0x29884c(%rip), %r12    # 0x30d98b
movb %al, (%r12)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x75159
leaq 0x1c9e1a(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0x29882c(%rip), %r13    # 0x30d98c
movb %al, (%r13)
callq 0x58aae
leaq 0x298820(%rip), %rax    # 0x30d990
movss %xmm0, (%rax)
callq 0x588f0
movl %eax, %ebx
xorl %edi, %edi
callq 0x58f50
leaq 0x1c9de7(%rip), %rax    # 0x23ef70
cmpl $0x0, (%rax)
jne 0x7522c
cmpb $0xd, (%r15)
jb 0x7519c
movb $0x0, (%r15)
leaq 0x2987dd(%rip), %rax    # 0x30d980
movzwl (%rax), %eax
movzwl %bx, %edx
movzbl (%r15), %esi
movzbl (%r12), %edi
movzbl (%r13), %r8d
cmpl $0x19, %r8d
setb %cl
addl %eax, %edx
leaq 0x2987bd(%rip), %rax    # 0x30d984
addl (%rax), %edx
leal -0x1(%rsi), %r9d
movl %esi, %eax
addl %edi, %eax
addl %r8d, %eax
addl %edx, %eax
cmpb $0xc, %r9b
setb %dl
leal -0x1(%rdi), %esi
cmpb $0x1f, %sil
setb %sil
andb %dl, %sil
leaq 0x298796(%rip), %rdx    # 0x30d988
movzwl (%rdx), %edx
addl $0xfffff844, %edx       # imm = 0xFFFFF844
cmpw $0x65, %dx
setb %dl
andb %cl, %dl
andb %sil, %dl
movzbl %dl, %ecx
leaq 0x2981e3(%rip), %rsi    # 0x30d3f4
movl %ecx, (%rsi)
leaq 0x2981d6(%rip), %rsi    # 0x30d3f0
addl %ecx, %ecx
orl (%rsi), %ecx
orl $0x1, %ecx
movl %ecx, (%rsi)
addl %r14d, %eax
je 0x7523b
testb %dl, %dl
jne 0x7523b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7524e