// File: /workspace/github_cpp_makefile_star2_O2/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 0x255c4f(%rip), %rax    # 0x2f733c
movl (%rax), %eax
addl $-0x2, %eax
cmpl $0x3, %eax
ja 0xa19af
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movl %edi, %edx
leaq 0x684f5(%rip), %rcx     # 0x109c04
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x8, %edx
ja 0xa183e
movl %edx, %eax
leaq 0x684ea(%rip), %rcx     # 0x109c14
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movabsq $0x412045444f432020, %rax # imm = 0x412045444F432020
jmp 0xa1983
leaq 0x6f849(%rip), %rsi     # 0x110f92
leaq -0x100(%rbp), %rdi
xorl %eax, %eax
callq 0x9060
jmp 0xa1994
cmpl $0x7, %edx
ja 0xa191b
movl %edx, %eax
leaq 0x684ee(%rip), %rcx     # 0x109c5c
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 0xa1994
cmpl $0x8, %edx
ja 0xa183e
movl %edx, %eax
leaq 0x6848f(%rip), %rcx     # 0x109c38
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 0xa1994
movabsq $0x5953205449422020, %rax # imm = 0x5953205449422020
jmp 0xa1828
movabsq $0x494b434152542020, %rax # imm = 0x494B434152542020
movq %rax, -0x100(%rbp)
movl $0x474e49, -0xf9(%rbp)  # imm = 0x474E49
jmp 0xa1994
movabsq $0x4341204850452020, %rax # imm = 0x4341204850452020
movq %rax, -0x100(%rbp)
movl $0x205143, -0xf9(%rbp)  # imm = 0x205143
jmp 0xa1994
movabsq $0x59532047534d2020, %rax # imm = 0x59532047534D2020
movq %rax, -0x100(%rbp)
movl $0x434e59, -0xf9(%rbp)  # imm = 0x434E59
jmp 0xa1994
movabsq $0x574f4e4b4e552020, %rax # imm = 0x574F4E4B4E552020
movq %rax, -0x100(%rbp)
movl $0x204e57, -0xf9(%rbp)  # imm = 0x204E57
jmp 0xa1994
movabsq $0x4c2045444f432020, %rax # imm = 0x4C2045444F432020
movq %rax, -0x100(%rbp)
movl $0x4b4f4c, -0xf9(%rbp)  # imm = 0x4B4F4C
jmp 0xa1994
movabsq $0x5249555143412020, %rax # imm = 0x5249555143412020
movq %rax, -0x100(%rbp)
movl $0x444552, -0xf9(%rbp)  # imm = 0x444552
jmp 0xa1994
movabsq $0x53204b4145572020, %rax # imm = 0x53204B4145572020
movq %rax, -0x100(%rbp)
movl $0x474953, -0xf9(%rbp)  # imm = 0x474953
jmp 0xa1994
movabsq $0x4f4c205241432020, %rax # imm = 0x4F4C205241432020
movq %rax, -0x100(%rbp)
movl $0x374b4f, -0xf9(%rbp)  # imm = 0x374B4F
jmp 0xa1994
movabsq $0x4f4c205241432020, %rax # imm = 0x4F4C205241432020
movq %rax, -0x100(%rbp)
movl $0x354b4f, -0xf9(%rbp)  # imm = 0x354B4F
jmp 0xa1994
movabsq $0x4f4c205241432020, %rax # imm = 0x4F4C205241432020
movq %rax, -0x100(%rbp)
movl $0x364b4f, -0xf9(%rbp)  # imm = 0x364B4F
jmp 0xa1994
leaq 0x6f664(%rip), %rsi     # 0x110f86
jmp 0xa1749
movabsq $0x4741205445532020, %rax # imm = 0x4741205445532020
movq %rax, -0x100(%rbp)
movl $0x204347, -0xf9(%rbp)  # imm = 0x204347
jmp 0xa1994
movabsq $0x4120514552462020, %rax # imm = 0x4120514552462020
jmp 0xa1983
movabsq $0x4120514552502020, %rax # imm = 0x4120514552502020
jmp 0xa1983
movabsq $0x5249555143412020, %rax # imm = 0x5249555143412020
movq %rax, -0x100(%rbp)
movl $0x204552, -0xf9(%rbp)  # imm = 0x204552
jmp 0xa1994
movabsq $0x4120454d49542020, %rax # imm = 0x4120454D49542020
movq %rax, -0x100(%rbp)
movl $0x514341, -0xf9(%rbp)  # imm = 0x514341
leaq 0x284885(%rip), %rdi    # 0x326220
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 0xa1994
movabsq $0x4120454d49542020, %rax # imm = 0x4120454D49542020
movq %rax, -0x100(%rbp)
movl $0x4c5641, -0xf9(%rbp)  # imm = 0x4C5641
jmp 0xa1994