// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ubx_gnss()
void parse_ubx_gnss()
{
int hw_chans;
int use_chans;
int blocks;
int id;
int min_chans;
int max_chans;
u32 flags;

   log_packet_id("UBX_GNSS");

   tsip_byte();  // msg version
   hw_chans = tsip_byte();
   use_chans = tsip_byte();
   blocks = tsip_byte();
//sprintf(debug_text2, "GNSS info hw_chans:%d  use:%d  blocks:%d", hw_chans,use_chans,blocks);

   if(blocks == 0) return;

   gnss_mask = 0x0000;
   have_gnss_mask = 1;
   while(blocks--) {
      id = tsip_byte();
      min_chans = tsip_byte();
      max_chans = tsip_byte();
      tsip_byte();  // reserved
      flags = tsip_dword();

      if(id == 0) {       // GPS
         if(flags & 0x0001) gnss_mask |= GPS;
      }
      else if(id == 1) {  // SBAS
         if(flags & 0x0001) gnss_mask |= SBAS;
      }
      else if(id == 2) {  // GALILEO
         if(flags & 0x0001) gnss_mask |= GALILEO;
      }
      else if(id == 3) {  // Beidou
         if(flags & 0x0001) gnss_mask |= BEIDOU;
      }
      else if(id == 4) {  // IMES
         if(flags & 0x0001) gnss_mask |= IMES;
      }
      else if(id == 5) {  // QZSS
         if(flags & 0x0001) gnss_mask |= QZSS;
      }
      else if(id == 6) {  // GLONASS
         if(flags & 0x0001) gnss_mask |= GLONASS;
      }

if(0 && debug_file) {
   fprintf(debug_file, "gnss blk:%d  hw:%d use:%d  id:%d min:%d max:%d flags:%08X  mask:%04X\n", 
   blocks, hw_chans, use_chans, id,min_chans,max_chans,flags, gnss_mask);
}
   }
// sprintf(debug_text2, "GNSS got mask:%04X", gnss_mask);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x8f272(%rip), %rdi     # 0x12471a
callq 0x58e77
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x954c3
leaq 0x1a9ab0(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x954d9
leaq 0x1a9a9a(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x954ef
leaq 0x1a9a84(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0x95507
leaq 0x1a9a6c(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
testb %bl, %bl
je 0x955e1
leaq 0xdb75e(%rip), %r15     # 0x170c74
movl $0x0, (%r15)
leaq 0xdb754(%rip), %rax     # 0x170c78
movl $0x1, (%rax)
andl $0xff, %ebx
je 0x955e1
leaq 0x8a13b(%rip), %r12     # 0x11f678
leaq 0x1a9a2c(%rip), %r13    # 0x23ef70
callq 0x587d1
movl %eax, %r14d
cmpl $0x100, %eax            # imm = 0x100
jb 0x95558
orb $0x8, (%r13)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x95569
orb $0x8, (%r13)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x9557a
orb $0x8, (%r13)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x9558b
orb $0x8, (%r13)
callq 0x589b0
cmpb $0x6, %r14b
ja 0x955d9
movzbl %r14b, %ecx
movslq (%r12,%rcx,4), %rcx
addq %r12, %rcx
jmpq *%rcx
movl $0x1, %ecx
jmp 0x955d2
movl $0x2000, %ecx           # imm = 0x2000
jmp 0x955d2
movl $0x4, %ecx
jmp 0x955d2
movl $0x8, %ecx
jmp 0x955d2
movl $0x8000, %ecx           # imm = 0x8000
jmp 0x955d2
movl $0x4000, %ecx           # imm = 0x4000
jmp 0x955d2
movl $0x2, %ecx
testb $0x1, %al
je 0x955d9
orl %ecx, (%r15)
decl %ebx
jne 0x95544
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq