// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: format_sat_state(int)
void format_sat_state(int state)
{
char fmt[SLEN+1];

   if(have_state == UBX_STATE) {  // ublox
      if     (state == 0) strcpy(fmt,  "  NO SIG  ");
      else if(state == 1) strcpy(fmt,  "  SEARCH  ");
      else if(state == 2) strcpy(fmt,  "  ACQUIRED");
      else if(state == 3) strcpy(fmt,  "  WEAK SIG");
      else if(state == 4) strcpy(fmt,  "  CODE LOK");
      else if(state == 5) strcpy(fmt,  "  CAR LOK5");
      else if(state == 6) strcpy(fmt,  "  CAR LOK6");
      else if(state == 7) strcpy(fmt,  "  CAR LOK7");
      else                sprintf(fmt, "  UNK:%-3d ", state);
      strcat(out, fmt);
   }
   else if(have_state == SIRF_STATE) {  // SIRF tracking flags
      sprintf(fmt, "   %04X  ", state);
      strcat(out, fmt);
   }
   else if(have_state == STAR_STATE) {
      if     (state == 0) strcpy(fmt, "  SEARCH  ");
      else if(state == 1) strcpy(fmt, "  ACQUIRE ");
      else if(state == 2) strcpy(fmt, "  AGC SET ");
      else if(state == 3) strcpy(fmt, "  PREQ ACQ");
      else if(state == 4) strcpy(fmt, "  BIT SYNC");
      else if(state == 5) strcpy(fmt, "  MSG SYNC");
      else if(state == 6) strcpy(fmt, "  TIME AVL");
      else if(state == 7) strcpy(fmt, "  EPH ACQ ");
      else if(state == 8) strcpy(fmt, "  TRACKING");
      else                strcpy(fmt, "  UNKNOWN ");
      strcat(out, fmt);
   }
   else if(have_state == MOTO_STATE) {
      if     (state == 0) strcpy(fmt, "  SEARCH  ");
      else if(state == 1) strcpy(fmt, "  CODE ACQ");
      else if(state == 2) strcpy(fmt, "  SET AGC ");
      else if(state == 3) strcpy(fmt, "  FREQ ACQ");
      else if(state == 4) strcpy(fmt, "  BIT SYNC");
      else if(state == 5) strcpy(fmt, "  MSG SYNC");
      else if(state == 6) strcpy(fmt, "  TIME ACQ");
      else if(state == 7) strcpy(fmt, "  EPH ACQ ");
      else if(state == 8) strcpy(fmt, "  TRACKING");
      else                strcpy(fmt, "  UNKNOWN ");
      strcat(out, fmt);
   }
}

// Assembly:
leaq 0x25b979(%rip), %rax    # 0x30d33c
movl (%rax), %eax
addl $-0x2, %eax
cmpl $0x3, %eax
ja 0xb1c85
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movl %edi, %edx
leaq 0x6e2db(%rip), %rcx     # 0x11fcc0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x8, %edx
ja 0xb1b14
movl %edx, %eax
leaq 0x6e2d0(%rip), %rcx     # 0x11fcd0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movabsq $0x412045444f432020, %rax # imm = 0x412045444F432020
jmp 0xb1c59
leaq 0x7562e(%rip), %rsi     # 0x12704d
leaq -0x100(%rbp), %rdi
xorl %eax, %eax
callq 0x9060
jmp 0xb1c6a
cmpl $0x7, %edx
ja 0xb1bf1
movl %edx, %eax
leaq 0x6e2d4(%rip), %rcx     # 0x11fd18
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movabsq $0x474953204f4e2020, %rax # imm = 0x474953204F4E2020
movq %rax, -0x100(%rbp)
movl $0x202047, -0xf9(%rbp)  # imm = 0x202047
jmp 0xb1c6a
cmpl $0x8, %edx
ja 0xb1b14
movl %edx, %eax
leaq 0x6e275(%rip), %rcx     # 0x11fcf4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movabsq $0x4843524145532020, %rax # imm = 0x4843524145532020
movq %rax, -0x100(%rbp)
movl $0x202048, -0xf9(%rbp)  # imm = 0x202048
jmp 0xb1c6a
movabsq $0x5953205449422020, %rax # imm = 0x5953205449422020
jmp 0xb1afe
movabsq $0x494b434152542020, %rax # imm = 0x494B434152542020
movq %rax, -0x100(%rbp)
movl $0x474e49, -0xf9(%rbp)  # imm = 0x474E49
jmp 0xb1c6a
movabsq $0x4341204850452020, %rax # imm = 0x4341204850452020
movq %rax, -0x100(%rbp)
movl $0x205143, -0xf9(%rbp)  # imm = 0x205143
jmp 0xb1c6a
movabsq $0x59532047534d2020, %rax # imm = 0x59532047534D2020
movq %rax, -0x100(%rbp)
movl $0x434e59, -0xf9(%rbp)  # imm = 0x434E59
jmp 0xb1c6a
movabsq $0x574f4e4b4e552020, %rax # imm = 0x574F4E4B4E552020
movq %rax, -0x100(%rbp)
movl $0x204e57, -0xf9(%rbp)  # imm = 0x204E57
jmp 0xb1c6a
movabsq $0x4c2045444f432020, %rax # imm = 0x4C2045444F432020
movq %rax, -0x100(%rbp)
movl $0x4b4f4c, -0xf9(%rbp)  # imm = 0x4B4F4C
jmp 0xb1c6a
movabsq $0x5249555143412020, %rax # imm = 0x5249555143412020
movq %rax, -0x100(%rbp)
movl $0x444552, -0xf9(%rbp)  # imm = 0x444552
jmp 0xb1c6a
movabsq $0x53204b4145572020, %rax # imm = 0x53204B4145572020
movq %rax, -0x100(%rbp)
movl $0x474953, -0xf9(%rbp)  # imm = 0x474953
jmp 0xb1c6a
movabsq $0x4f4c205241432020, %rax # imm = 0x4F4C205241432020
movq %rax, -0x100(%rbp)
movl $0x374b4f, -0xf9(%rbp)  # imm = 0x374B4F
jmp 0xb1c6a
movabsq $0x4f4c205241432020, %rax # imm = 0x4F4C205241432020
movq %rax, -0x100(%rbp)
movl $0x354b4f, -0xf9(%rbp)  # imm = 0x354B4F
jmp 0xb1c6a
movabsq $0x4f4c205241432020, %rax # imm = 0x4F4C205241432020
movq %rax, -0x100(%rbp)
movl $0x364b4f, -0xf9(%rbp)  # imm = 0x364B4F
jmp 0xb1c6a
leaq 0x75449(%rip), %rsi     # 0x127041
jmp 0xb1a1f
movabsq $0x4741205445532020, %rax # imm = 0x4741205445532020
movq %rax, -0x100(%rbp)
movl $0x204347, -0xf9(%rbp)  # imm = 0x204347
jmp 0xb1c6a
movabsq $0x4120514552462020, %rax # imm = 0x4120514552462020
jmp 0xb1c59
movabsq $0x4120514552502020, %rax # imm = 0x4120514552502020
jmp 0xb1c59
movabsq $0x5249555143412020, %rax # imm = 0x5249555143412020
movq %rax, -0x100(%rbp)
movl $0x204552, -0xf9(%rbp)  # imm = 0x204552
jmp 0xb1c6a
movabsq $0x4120454d49542020, %rax # imm = 0x4120454D49542020
movq %rax, -0x100(%rbp)
movl $0x514341, -0xf9(%rbp)  # imm = 0x514341
leaq 0x28a5af(%rip), %rdi    # 0x33c220
leaq -0x100(%rbp), %rsi
callq 0x96c0
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movabsq $0x4553204347412020, %rax # imm = 0x4553204347412020
movq %rax, -0x100(%rbp)
movl $0x205445, -0xf9(%rbp)  # imm = 0x205445
jmp 0xb1c6a
movabsq $0x4120454d49542020, %rax # imm = 0x4120454D49542020
movq %rax, -0x100(%rbp)
movl $0x4c5641, -0xf9(%rbp)  # imm = 0x4C5641
jmp 0xb1c6a