// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_nvs_config()
void parse_nvs_config()
{
u08 nav_sys;

   // 0x51 packet
   log_packet_id("nvs_config");

   nav_sys = tsip_byte();
   tsip_byte();    // rsvd
   tsip_byte();    // coord sys
   el_mask = (float) (s08) tsip_byte();
   amu_mask = (float) tsip_byte();
   tsip_word();    // max rms error
   nvs_filter = tsip_single();  // filtration degree

   have_el_mask = 1;
   have_amu = 1;

   // nav system:
   //  0=GPS+GLONASS
   //  1=GPS
   //  2=GLONASS
   //  3=Galileo
   // 10=GPS+GLONASS+SBAS
   // 11=GPS+SBAS
   // 12=GLONASS+SBAS
   have_gnss_mask = 3;
   if     (nav_sys == 0)  gnss_mask = (GPS | GLONASS);
   else if(nav_sys == 1)  gnss_mask = (GPS);
   else if(nav_sys == 2)  gnss_mask = (GLONASS);
   else if(nav_sys == 3)  gnss_mask = (GALILEO);
   else if(nav_sys == 10) gnss_mask = (GPS | GLONASS | SBAS);
   else if(nav_sys == 11) gnss_mask = (GPS | SBAS);
   else if(nav_sys == 12) gnss_mask = (GLONASS | SBAS);
   else if(nav_sys == 13) gnss_mask = (GALILEO | SBAS);
   else have_gnss_mask = 0;
// sprintf(plot_title, "nav sys:%d", nav_sys); //qqqqqqqqq
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x7db76(%rip), %rdi     # 0x125f9c
callq 0x58dc2
callq 0x587be
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0xa8443
leaq 0x196b30(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0xa8459
leaq 0x196b1a(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0xa846f
leaq 0x196b04(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0xa8485
leaq 0x196aee(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movsbl %al, %eax
cvtsi2ss %eax, %xmm0
leaq 0x264c21(%rip), %rax    # 0x30d0b4
movss %xmm0, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0xa84ad
leaq 0x196ac6(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
leaq 0x264bfa(%rip), %rax    # 0x30d0b8
movss %xmm0, (%rax)
callq 0x588d2
callq 0x58a30
cvtss2sd %xmm0, %xmm0
leaq 0x264bc9(%rip), %rax    # 0x30d0a0
movsd %xmm0, (%rax)
leaq 0x264f1a(%rip), %rax    # 0x30d3fc
movl $0x1, %ecx
movl %ecx, (%rax)
leaq 0x264f08(%rip), %rax    # 0x30d3f8
movl %ecx, (%rax)
leaq 0xc877f(%rip), %rax     # 0x170c78
movl $0x3, (%rax)
cmpb $0xd, %bl
ja 0xa8526
movzbl %bl, %ecx
leaq 0x77642(%rip), %rdx     # 0x11fb50
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
leaq 0xc8756(%rip), %rax     # 0x170c74
movl $0x3, (%rax)
jmp 0xa8595
movl $0x0, (%rax)
jmp 0xa8595
leaq 0xc873f(%rip), %rax     # 0x170c74
movl $0x8001, (%rax)         # imm = 0x8001
jmp 0xa8595
leaq 0xc8730(%rip), %rax     # 0x170c74
movl $0x1, (%rax)
jmp 0xa8595
leaq 0xc8721(%rip), %rax     # 0x170c74
movl $0x8002, (%rax)         # imm = 0x8002
jmp 0xa8595
leaq 0xc8712(%rip), %rax     # 0x170c74
movl $0x8004, (%rax)         # imm = 0x8004
jmp 0xa8595
leaq 0xc8703(%rip), %rax     # 0x170c74
movl $0x2, (%rax)
jmp 0xa8595
leaq 0xc86f4(%rip), %rax     # 0x170c74
movl $0x4, (%rax)
jmp 0xa8595
leaq 0xc86e5(%rip), %rax     # 0x170c74
movl $0x8003, (%rax)         # imm = 0x8003
addq $0x8, %rsp
popq %rbx
popq %rbp
retq