LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: set_prs_sf(int)
void set_prs_sf(int val)
{
   if(read_only) return;

   sprintf(out, "SF%d", val);
   queue_prs_cmd(out, PRS_SF_MSG);
   queue_prs_cmd("SF?", PRS_SF_MSG);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
leaq 0x2d49a8(%rip), %rax    # 0x3961fa
cmpb $0x0, (%rax)
je 0xc1859
jmp 0xc1893
movl -0x4(%rbp), %edx
leaq 0x2d9b9d(%rip), %rdi    # 0x39b400
leaq 0xc5751(%rip), %rsi     # 0x186fbb
movb $0x0, %al
callq 0x9060
leaq 0x2d9b88(%rip), %rdi    # 0x39b400
movl $0x1fe, %esi            # imm = 0x1FE
callq 0x82fd0
leaq 0xc550c(%rip), %rdi     # 0x186d95
movl $0x1fe, %esi            # imm = 0x1FE
callq 0x82fd0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: set_prs_sp(int, int, int)
void set_prs_sp(int r, int n, int a)
{
   if(read_only) return;

   sprintf(out, "SP%d,%d,%d", r,n,a);
   queue_prs_cmd(out, PRS_SP_MSG);
   queue_prs_cmd("SP?", PRS_SP_MSG);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
leaq 0x2d4942(%rip), %rax    # 0x3961fa
cmpb $0x0, (%rax)
je 0xc18bf
jmp 0xc1900
movl -0x4(%rbp), %edx
movl -0x8(%rbp), %ecx
movl -0xc(%rbp), %r8d
leaq 0x2d9b30(%rip), %rdi    # 0x39b400
leaq 0xc56e9(%rip), %rsi     # 0x186fc0
movb $0x0, %al
callq 0x9060
leaq 0x2d9b1b(%rip), %rdi    # 0x39b400
movl $0x202, %esi            # imm = 0x202
callq 0x82fd0
leaq 0xc72aa(%rip), %rdi     # 0x188ba0
movl $0x202, %esi            # imm = 0x202
callq 0x82fd0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: set_prs_to(int)
void set_prs_to(int val)
{
   if(read_only) return;

   sprintf(out, "TO%d", val);
   queue_prs_cmd(out, PRS_TO_MSG);
   queue_prs_cmd("TO?", PRS_TO_MSG);
   queue_prs_cmd("TT?", PRS_TT_MSG);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
leaq 0x2d48d8(%rip), %rax    # 0x3961fa
cmpb $0x0, (%rax)
je 0xc1929
jmp 0xc1974
movl -0x4(%rbp), %edx
leaq 0x2d9acd(%rip), %rdi    # 0x39b400
leaq 0xc5691(%rip), %rsi     # 0x186fcb
movb $0x0, %al
callq 0x9060
leaq 0x2d9ab8(%rip), %rdi    # 0x39b400
movl $0x208, %esi            # imm = 0x208
callq 0x82fd0
leaq 0xc5455(%rip), %rdi     # 0x186dae
movl $0x208, %esi            # imm = 0x208
callq 0x82fd0
leaq 0xc5415(%rip), %rdi     # 0x186d7f
movl $0x206, %esi            # imm = 0x206
callq 0x82fd0
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: update_x72_screen()
void update_x72_screen()
{
int i;

   // update the screen every second.  When the seconds tick, request the
   // high priority messages.

   i = get_norcvr_message();   // returns true if seconds just ticked
   if(i && (prs_poll_tick == 0)) prs_poll_tick = 1;  // trigger high priority message polls

   if(i) {
      if(x72_tic_timer > 0) {  // tic reg changed, wait for it to take effect
         --x72_tic_timer;
         return;
      }
      else x72_tic_timer = 0;

      if(have_x72_pps && x72_state_set && x72_user_dis) {
         x72_sw_discipline();  // do disciplining
      }
      else if(x72_fw_discipline()) {
      }
      else {
         discipline_mode = DIS_MODE_NORMAL;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
callq 0xb2630
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
je 0xc23e9
cmpl $0x0, 0x3099eb(%rip)    # 0x3cbdc8
jne 0xc23e9
movl $0x1, 0x3099df(%rip)    # 0x3cbdc8
cmpl $0x0, -0x4(%rbp)
je 0xc2464
leaq 0x1b7d22(%rip), %rax    # 0x27a118
cmpl $0x0, (%rax)
jle 0xc2412
leaq 0x1b7d16(%rip), %rax    # 0x27a118
movl (%rax), %ecx
addl $-0x1, %ecx
leaq 0x1b7d0a(%rip), %rax    # 0x27a118
movl %ecx, (%rax)
jmp 0xc2464
leaq 0x1b7cff(%rip), %rax    # 0x27a118
movl $0x0, (%rax)
leaq 0x1b7a8a(%rip), %rax    # 0x279eb0
cmpl $0x0, (%rax)
je 0xc244a
leaq 0x1b7abe(%rip), %rax    # 0x279ef0
cmpl $0x0, (%rax)
je 0xc244a
leaq 0x1b7c92(%rip), %rax    # 0x27a0d0
cmpl $0x0, (%rax)
je 0xc244a
callq 0xc2470
jmp 0xc2462
callq 0x94230
cmpl $0x0, %eax
je 0xc2456
jmp 0xc2460
leaq 0x2aa21a(%rip), %rax    # 0x36c677
movb $0x0, (%rax)
jmp 0xc2462
jmp 0xc2464
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_x72_response(int)
void parse_x72_response(int id)
{
   // prepare to decode the multi-line query response

   x72_response = id;
// if(debug_file) fprintf(debug_file, "X72 %d start (%s)\n", id, nmea_msg);
   x72_line = 0;
   scpi_col = 0;
   scpi_status_line[0] = 0;

   strcpy(scpi_status_line, nmea_msg);  // record the first line of the response
   parse_x72_val(x72_response);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
movl %eax, 0x3097b8(%rip)    # 0x3cbd9c
movl $0x0, 0x3097b2(%rip)    # 0x3cbda0
movl $0x0, 0x30979c(%rip)    # 0x3cbd94
movb $0x0, 0x309711(%rip)    # 0x3cbd10
leaq 0x30970a(%rip), %rdi    # 0x3cbd10
leaq 0x2d8403(%rip), %rsi    # 0x39aa10
callq 0x9350
movl 0x309784(%rip), %edi    # 0x3cbd9c
callq 0xc2630
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: info_param(char*)
char *info_param(char *param)
{
int len;
char *s;

   if(param == 0) return 0;

   len = strlen(param);
   s = strstr(scpi_status_line, param);
   if(s) {
      return (s+len+1);
   }

   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0xc415d
movq $0x0, -0x8(%rbp)
jmp 0xc41a1
movq -0x10(%rbp), %rdi
callq 0x9120
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rsi
leaq 0x307b9c(%rip), %rdi    # 0x3cbd10
callq 0x9090
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xc4199
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0xc41a1
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: decode_x72_creg()
void decode_x72_creg()
{
   // set various flags based upon the control reg value

   if(x72_creg & 0x0008) pps_enabled = 0;
   else                  pps_enabled = 1;

   if(x72_creg & 0x0040) x72_sine_level = 0;
   else {
      x72_sine_level = 40;
      if(x72_creg & 0x0080) x72_sine_level += 30;
      if(x72_creg & 0x0100) x72_sine_level += 20;
      if(x72_creg & 0x0200) x72_sine_level += 10;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x1b58fd(%rip), %rax    # 0x279fb8
movl (%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0xc46d1
leaq 0x2a8834(%rip), %rax    # 0x36cf00
movb $0x0, (%rax)
jmp 0xc46db
leaq 0x2a8828(%rip), %rax    # 0x36cf00
movb $0x1, (%rax)
leaq 0x1b58d6(%rip), %rax    # 0x279fb8
movl (%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0xc46fe
leaq 0x1b58e5(%rip), %rax    # 0x279fd8
movl $0x0, (%rax)
jmp 0xc4785
leaq 0x1b58d3(%rip), %rax    # 0x279fd8
movl $0x28, (%rax)
leaq 0x1b58a6(%rip), %rax    # 0x279fb8
movl (%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0xc4733
leaq 0x1b58b3(%rip), %rax    # 0x279fd8
movl (%rax), %ecx
addl $0x1e, %ecx
leaq 0x1b58a7(%rip), %rax    # 0x279fd8
movl %ecx, (%rax)
leaq 0x1b587e(%rip), %rax    # 0x279fb8
movl (%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0xc475b
leaq 0x1b588b(%rip), %rax    # 0x279fd8
movl (%rax), %ecx
addl $0x14, %ecx
leaq 0x1b587f(%rip), %rax    # 0x279fd8
movl %ecx, (%rax)
leaq 0x1b5856(%rip), %rax    # 0x279fb8
movl (%rax), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
je 0xc4783
leaq 0x1b5863(%rip), %rax    # 0x279fd8
movl (%rax), %ecx
addl $0xa, %ecx
leaq 0x1b5857(%rip), %rax    # 0x279fd8
movl %ecx, (%rax)
jmp 0xc4785
popq %rbp
retq
nopw (%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: x72_sync_fail(int)
int x72_sync_fail(int id)
{
int flag;
   // return true is message response is not valid for the requested message
   // !!!!! this routines needs to be more robust...  we currently only
   //       check for health response to a non-health request

   flag = 0;
   if(strstr(scpi_status_line, "ADATA") && (id != X72_HEALTH_MSG)) {  // health response
      need_x72_resync = id;
      flag = 1;
   }
   else if(strstr(scpi_status_line, "CONTROL REG") && (id != X72_GET_CREG_MSG)) {  // health response
      need_x72_resync = id;
      flag = 1;
   }
   else if(strstr(scpi_status_line, "DELTA REG") && (id != X72_GET_PPS_MSG)) {  // health response
      need_x72_resync = id;
      flag = 1;
   }

   if(flag) {  // unexpected response to a query was seen
      if(debug_file) fprintf(debug_file, "\n###! x72 msg %d sync fail! (%s)\n\n", id, scpi_status_line);
      return 1;
   }

   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
leaq 0x307567(%rip), %rdi    # 0x3cbd10
leaq 0xc2916(%rip), %rsi     # 0x1870c6
callq 0x9090
cmpq $0x0, %rax
je 0xc47d6
cmpl $0x2c9, -0x8(%rbp)      # imm = 0x2C9
je 0xc47d6
movl -0x8(%rbp), %eax
movl %eax, 0x3075db(%rip)    # 0x3cbda8
movl $0x1, -0xc(%rbp)
jmp 0xc4840
leaq 0x307533(%rip), %rdi    # 0x3cbd10
leaq 0xc28e8(%rip), %rsi     # 0x1870cc
callq 0x9090
cmpq $0x0, %rax
je 0xc480a
cmpl $0x2c5, -0x8(%rbp)      # imm = 0x2C5
je 0xc480a
movl -0x8(%rbp), %eax
movl %eax, 0x3075a7(%rip)    # 0x3cbda8
movl $0x1, -0xc(%rbp)
jmp 0xc483e
leaq 0x3074ff(%rip), %rdi    # 0x3cbd10
leaq 0xc28c0(%rip), %rsi     # 0x1870d8
callq 0x9090
cmpq $0x0, %rax
je 0xc483c
cmpl $0x2c1, -0x8(%rbp)      # imm = 0x2C1
je 0xc483c
movl -0x8(%rbp), %eax
movl %eax, 0x307573(%rip)    # 0x3cbda8
movl $0x1, -0xc(%rbp)
jmp 0xc483e
jmp 0xc4840
cmpl $0x0, -0xc(%rbp)
je 0xc487e
leaq 0x1d8d23(%rip), %rax    # 0x29d570
cmpq $0x0, (%rax)
je 0xc4875
leaq 0x1d8d16(%rip), %rax    # 0x29d570
movq (%rax), %rdi
movl -0x8(%rbp), %edx
leaq 0xc287b(%rip), %rsi     # 0x1870e2
leaq 0x3074a2(%rip), %rcx    # 0x3cbd10
movb $0x0, %al
callq 0x9550
movl $0x1, -0x4(%rbp)
jmp 0xc4885
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: set_x72_efc(int)
void set_x72_efc(int val)
{
   // set the X72 EFC input enabled
   if(read_only) return;

   last_x72_efc = val;
   user_set_x72_efc = 1;
   save_x72_state();

   val &= 1;
   sprintf(out, "a%d", val);
   queue_x72_cmd(out, X72_SET_FC_MSG);
///   queue_x72_cmd("i", X72_INFO_MSG);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
leaq 0x2d1558(%rip), %rax    # 0x3961fa
cmpb $0x0, (%rax)
je 0xc4ca9
jmp 0xc4cf9
movl -0x4(%rbp), %ecx
leaq 0x1b53fd(%rip), %rax    # 0x27a0b0
movl %ecx, (%rax)
leaq 0x1b53e8(%rip), %rax    # 0x27a0a4
movl $0x1, (%rax)
callq 0x92e20
movl -0x4(%rbp), %eax
andl $0x1, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %edx
leaq 0x2d6726(%rip), %rdi    # 0x39b400
leaq 0xc252c(%rip), %rsi     # 0x18720d
movb $0x0, %al
callq 0x9060
leaq 0x2d6711(%rip), %rdi    # 0x39b400
movl $0x2bc, %esi            # imm = 0x2BC
callq 0x82fd0
addq $0x10, %rsp
popq %rbp
retq
nop
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: set_x72_tic(int)
void set_x72_tic(int val)
{
   // set the X72 PPS TIC offset value
   if(read_only) return;

   if(val < 0) {
      val = IABS(val) % ((int) x72_osc);
      if(val) val = ((int) x72_osc) - val;
   }
   else {
      val = (val % (int) x72_osc);
   }

   last_x72_tic = val;
   user_set_x72_tic = 1;
   save_x72_state();

   sprintf(out, "k%d", val);
   queue_x72_cmd(out, X72_SET_TIC_MSG);
   x72_tic_timer = 6;  // it takes 6 seconds for a TIC change to take effect
   x72_tic_changed = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
leaq 0x2d14e8(%rip), %rax    # 0x3961fa
cmpb $0x0, (%rax)
je 0xc4d1c
jmp 0xc4dd7
cmpl $0x0, -0x4(%rbp)
jge 0xc4d65
cmpl $0x0, -0x4(%rbp)
jge 0xc4d32
xorl %eax, %eax
subl -0x4(%rbp), %eax
movl %eax, -0x8(%rbp)
jmp 0xc4d38
movl -0x4(%rbp), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
leaq 0x1b5106(%rip), %rcx    # 0x279e48
cvttsd2si (%rcx), %ecx
cltd
idivl %ecx
movl %edx, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
je 0xc4d63
leaq 0x1b50ef(%rip), %rax    # 0x279e48
cvttsd2si (%rax), %eax
subl -0x4(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xc4d79
movl -0x4(%rbp), %eax
leaq 0x1b50d9(%rip), %rcx    # 0x279e48
cvttsd2si (%rcx), %ecx
cltd
idivl %ecx
movl %edx, -0x4(%rbp)
movl -0x4(%rbp), %ecx
leaq 0x1b5335(%rip), %rax    # 0x27a0b8
movl %ecx, (%rax)
leaq 0x1b5314(%rip), %rax    # 0x27a0a0
movl $0x1, (%rax)
callq 0x92e20
movl -0x4(%rbp), %edx
leaq 0x2d665f(%rip), %rdi    # 0x39b400
leaq 0xc2469(%rip), %rsi     # 0x187211
movb $0x0, %al
callq 0x9060
leaq 0x2d664a(%rip), %rdi    # 0x39b400
movl $0x2c2, %esi            # imm = 0x2C2
callq 0x82fd0
leaq 0x1b5351(%rip), %rax    # 0x27a118
movl $0x6, (%rax)
movl $0x1, 0x306fed(%rip)    # 0x3cbdc4
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: set_x72_acmos_freq(int)
void set_x72_acmos_freq(int val)
{
   // set the X72 ACMOS freq
   if(read_only) return;

   last_x72_acmos_freq = val;
   user_set_x72_acmos_freq = 1;
   save_x72_state();

   sprintf(out, "o%d", val);
   queue_x72_cmd(out, X72_SET_FREQ_MSG);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
leaq 0x2d1408(%rip), %rax    # 0x3961fa
cmpb $0x0, (%rax)
je 0xc4df9
jmp 0xc4e40
movl -0x4(%rbp), %ecx
leaq 0x1b52a9(%rip), %rax    # 0x27a0ac
movl %ecx, (%rax)
leaq 0x1b528c(%rip), %rax    # 0x27a098
movl $0x1, (%rax)
callq 0x92e20
movl -0x4(%rbp), %edx
leaq 0x2d65df(%rip), %rdi    # 0x39b400
leaq 0xc23f3(%rip), %rsi     # 0x18721b
movb $0x0, %al
callq 0x9060
leaq 0x2d65ca(%rip), %rdi    # 0x39b400
movl $0x2c4, %esi            # imm = 0x2C4
callq 0x82fd0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: set_x72_srvc(int)
void set_x72_srvc(int val)
{
   // set the X72 service pin polarity
   if(read_only) return;

   last_x72_srvc = val;
   user_set_x72_srvc = 1;
   save_x72_state();

   val &= 1;
   sprintf(out, "l%d", val);
   queue_x72_cmd(out, X72_SET_SRVC_MSG);
///   queue_x72_cmd("i", X72_INFO_MSG);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
leaq 0x2d1398(%rip), %rax    # 0x3961fa
cmpb $0x0, (%rax)
je 0xc4e69
jmp 0xc4eb9
movl -0x4(%rbp), %ecx
leaq 0x1b5249(%rip), %rax    # 0x27a0bc
movl %ecx, (%rax)
leaq 0x1b522c(%rip), %rax    # 0x27a0a8
movl $0x1, (%rax)
callq 0x92e20
movl -0x4(%rbp), %eax
andl $0x1, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %edx
leaq 0x2d6566(%rip), %rdi    # 0x39b400
leaq 0xc2384(%rip), %rsi     # 0x187225
movb $0x0, %al
callq 0x9060
leaq 0x2d6551(%rip), %rdi    # 0x39b400
movl $0x2c3, %esi            # imm = 0x2C3
callq 0x82fd0
addq $0x10, %rsp
popq %rbp
retq
nop
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: x72_start_discipline()
void x72_start_discipline()
{
   // enable X72 discipline algorithm... based upon the outline in the
   // X72 manual

   x72_user_dis = 1;  // we are doing software disciplining
   x72_user_state = X72_STATE_START0;
   x72_init_done = 0;
   x72_1pps_present = 0;
   x72_start_timer = 0;

   if(pps_enabled == 0) {  // PPS output must be enabled in order for TIC command to work
      user_pps_enable = 1;
      set_pps(user_pps_enable, pps_polarity,  delay_value, pps1_delay,  pps_threshold, 4);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x1b5205(%rip), %rax    # 0x27a0d0
movl $0x1, (%rax)
movl $0x0, 0x306ed9(%rip)    # 0x3cbdb4
movl $0x0, 0x310963(%rip)    # 0x3d5848
movl $0x0, 0x31095d(%rip)    # 0x3d584c
movl $0x0, 0x31098f(%rip)    # 0x3d5888
leaq 0x2a8000(%rip), %rax    # 0x36cf00
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0xc4f55
leaq 0x2a7ff2(%rip), %rax    # 0x36cf01
movb $0x1, (%rax)
leaq 0x2a7fe8(%rip), %rax    # 0x36cf01
movb (%rax), %cl
leaq 0x2a7fd6(%rip), %rax    # 0x36cef8
movl (%rax), %eax
leaq 0x2a8075(%rip), %rdx    # 0x36cfa0
movsd (%rdx), %xmm0
leaq 0x2a8082(%rip), %rdx    # 0x36cfb8
movsd (%rdx), %xmm1
leaq 0x2a7fbb(%rip), %rdx    # 0x36cefc
movss (%rdx), %xmm2
movl $0x4, %edx
movzbl %cl, %edi
movzbl %al, %esi
callq 0x91b20
popq %rbp
retq
nopw (%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: x72_reset_filter()
void x72_reset_filter(void)
{
   x72_dds_count = 0;
   x72_dds_list[0] = 0.0;
   x72_dds_in = x72_dds_out = 0;
   x72_dds_sum = 0.0;
   filtered_dds = 0.0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x1b519d(%rip), %rax    # 0x27a108
movl $0x0, (%rax)
xorps %xmm0, %xmm0
movsd %xmm0, 0x3109e4(%rip)   # 0x3d5960
movl $0x0, 0x313fda(%rip)    # 0x3d8f60
movl $0x0, 0x313fd4(%rip)    # 0x3d8f64
xorps %xmm0, %xmm0
movsd %xmm0, 0x313fbd(%rip)   # 0x3d8f58
xorps %xmm0, %xmm0
movsd %xmm0, 0x313fc2(%rip)   # 0x3d8f68
popq %rbp
retq
nopl (%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: zpad(char*, int)
void zpad(char *s, int n)
{
int i;
int minus;

   // replace blanks in a string with '0'

   if(s == 0) return;

   minus = 0;
   for(i=0; i<n; i++) {
      if(s[i] == 0) return;
      if(s[i] == ' ') s[i] = '0';
      if(s[i] == '-') {
         s[i] = '0';
         minus = 1;
      }
   }
   if(minus && (s[0] == '0')) s[0] = '-';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0xc4fc7
jmp 0xc5057
movl $0x0, -0x14(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0xc503e
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0xc4ff0
jmp 0xc5057
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x20, %eax
jne 0xc500d
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
movb $0x30, (%rax,%rcx)
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2d, %eax
jne 0xc5031
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
movb $0x30, (%rax,%rcx)
movl $0x1, -0x14(%rbp)
jmp 0xc5033
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xc4fd5
cmpl $0x0, -0x14(%rbp)
je 0xc5057
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jne 0xc5057
movq -0x8(%rbp), %rax
movb $0x2d, (%rax)
popq %rbp
retq
nopl (%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_hbsq()
void parse_star_hbsq()  
{
char *s;

   // output squelch control

   log_packet_id("Star HBSQ");
   user_hbsq = current_hbsq = (-1);

   if(get_msg_field()) { 
      user_hbsq = atoi(msg_field);
      have_star_hbsq |= 0x01;
   }

   if(star_type == OSA_TYPE) {
      s = strchr(nmea_msg, '/');
      if(s) {
         s = s + 1;
         zpad(s,4);
         current_hbsq = atoi(s);
         have_star_hbsq |= 0x02;
      }
   }
   else {
      if(get_msg_field()) { 
         current_hbsq = atoi(msg_field);
         have_star_hbsq |= 0x02;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xc19a3(%rip), %rdi     # 0x187462
callq 0x7add0
leaq 0x2d7459(%rip), %rax    # 0x39cf24
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
leaq 0x2d7448(%rip), %rax    # 0x39cf20
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
callq 0xb0bd0
cmpl $0x0, %eax
je 0xc5b14
leaq 0x2d5131(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, %ecx
leaq 0x2d7423(%rip), %rax    # 0x39cf20
movl %ecx, (%rax)
leaq 0x2d7422(%rip), %rax    # 0x39cf28
movl (%rax), %ecx
orl $0x1, %ecx
leaq 0x2d7416(%rip), %rax    # 0x39cf28
movl %ecx, (%rax)
leaq 0x1b46ad(%rip), %rax    # 0x27a1c8
cmpl $0x4f, (%rax)
jne 0xc5b81
leaq 0x2d4ee9(%rip), %rdi    # 0x39aa10
movl $0x2f, %esi
callq 0x9100
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xc5b7f
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x4, %esi
callq 0xc4fb0
movq -0x8(%rbp), %rdi
callq 0x95c0
movl %eax, %ecx
leaq 0x2d73bc(%rip), %rax    # 0x39cf24
movl %ecx, (%rax)
leaq 0x2d73b7(%rip), %rax    # 0x39cf28
movl (%rax), %ecx
orl $0x2, %ecx
leaq 0x2d73ab(%rip), %rax    # 0x39cf28
movl %ecx, (%rax)
jmp 0xc5bb9
callq 0xb0bd0
cmpl $0x0, %eax
je 0xc5bb7
leaq 0x2d508e(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, %ecx
leaq 0x2d7384(%rip), %rax    # 0x39cf24
movl %ecx, (%rax)
leaq 0x2d737f(%rip), %rax    # 0x39cf28
movl (%rax), %ecx
orl $0x2, %ecx
leaq 0x2d7373(%rip), %rax    # 0x39cf28
movl %ecx, (%rax)
jmp 0xc5bb9
addq $0x10, %rsp
popq %rbp
retq
nop
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: fake_second_check(int)
void fake_second_check(int why)
{
double this_msec;

   // This routine checks to see if we need to fake a time message for receivers
   // that only send time every other second or for SCPI type receivers that
   // take a long time to process the SYST:STAT? message

if((why < 10) && (rcvr_type == UCCM_RCVR)) return;

   if(fake_msec) {                     // fake time stamp enabled
      this_msec = GetMsecs();
if(0 && debug_file) fprintf(debug_file, "fsc %d: this:%f fake:%f  count:%d\n", why, this_msec, fake_msec, fake_count);
      if(this_msec >= (fake_msec)) {  // it's time to fake it
         fake_missing_second(-1.000);  // negative value adds a second
         fake_msec += 1000.0;  // !!!! (1000.0 / nav_rate)?
         if(++fake_count > MAX_FAKE_COUNT) {
if(0 && debug_file) fprintf(debug_file, "fsc reset!  count=%d\n", fake_count);
            fake_count = 0;
            fake_msec = 0.0;  // limit number of consecutive faked seconds
         }
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
cmpl $0xa, -0x4(%rbp)
jge 0xc6203
leaq 0x1b18b8(%rip), %rax    # 0x277ab0
cmpq $0x8, (%rax)
jne 0xc6203
jmp 0xc6292
leaq 0x2a66ce(%rip), %rax    # 0x36c8d8
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xc621b
jp 0xc621b
jmp 0xc6292
callq 0xb630
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
leaq 0x2a66a7(%rip), %rax    # 0x36c8d8
ucomisd (%rax), %xmm0
jb 0xc6290
movsd 0xa8ed9(%rip), %xmm0    # 0x16f118
callq 0xc5f00
movsd 0xa8de4(%rip), %xmm0    # 0x16f030
leaq 0x2a6685(%rip), %rax    # 0x36c8d8
addsd (%rax), %xmm0
leaq 0x2a667a(%rip), %rax    # 0x36c8d8
movsd %xmm0, (%rax)
movl 0x30adc8(%rip), %eax    # 0x3d1030
addl $0x1, %eax
movl %eax, 0x30adbf(%rip)    # 0x3d1030
cmpl $0xa, %eax
jle 0xc628e
movl $0x0, 0x30adb0(%rip)    # 0x3d1030
leaq 0x2a6651(%rip), %rax    # 0x36c8d8
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
jmp 0xc6290
jmp 0xc6292
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_output()
void parse_star_output()
{
   // !!!! 4531
   log_packet_id("Star output");
   if(get_msg_field()) {
      if(strstr(msg_field, "E1")) {
         osa_output_type = 1;
         have_osa_output = 1;
      }
      else if(strstr(msg_field, "FR")) {
         osa_output_type = 2;
         have_osa_output = 1;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0xc04e2(%rip), %rdi     # 0x1875ad
callq 0x7add0
callq 0xb0bd0
cmpl $0x0, %eax
je 0xc7146
leaq 0x2d3b3f(%rip), %rdi    # 0x39ac20
leaq 0xc05e1(%rip), %rsi     # 0x1876c9
callq 0x9090
cmpq $0x0, %rax
je 0xc710f
leaq 0x2d5e52(%rip), %rax    # 0x39cf4c
movl $0x1, (%rax)
leaq 0x2d5e41(%rip), %rax    # 0x39cf48
movl $0x1, (%rax)
jmp 0xc7144
leaq 0x2d3b0a(%rip), %rdi    # 0x39ac20
leaq 0xc05bb(%rip), %rsi     # 0x1876d8
callq 0x9090
cmpq $0x0, %rax
je 0xc7142
leaq 0x2d5e1d(%rip), %rax    # 0x39cf4c
movl $0x2, (%rax)
leaq 0x2d5e0c(%rip), %rax    # 0x39cf48
movl $0x1, (%rax)
jmp 0xc7144
jmp 0xc7146
popq %rbp
retq
nopl (%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_prior()
void parse_star_prior()
{
   // !!!! 4531
   log_packet_id("Star priority");
   if(get_msg_field()) {
      osa_gps_prior = msg_field[0] - '0';
      osa_aux_prior = msg_field[1] - '0';
      have_osa_prior = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0xc045e(%rip), %rdi     # 0x1875b9
callq 0x7add0
callq 0xb0bd0
cmpl $0x0, %eax
je 0xc71a4
leaq 0x2d3aaf(%rip), %rax    # 0x39ac20
movsbl (%rax), %ecx
subl $0x30, %ecx
leaq 0x2d5dc2(%rip), %rax    # 0x39cf40
movl %ecx, (%rax)
leaq 0x2d3a99(%rip), %rax    # 0x39ac20
movsbl 0x1(%rax), %ecx
subl $0x30, %ecx
leaq 0x2d5daf(%rip), %rax    # 0x39cf44
movl %ecx, (%rax)
leaq 0x2d5d9e(%rip), %rax    # 0x39cf3c
movl $0x1, (%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_aux_inp()
void parse_star_aux_inp()
{
   // !!!! 4531
   log_packet_id("Star aux time");
   if(get_msg_field()) {
      osa_aux_c = msg_field[0] - '0';
      osa_aux_t = msg_field[1] - '0';
      have_osa_aux = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0xc040c(%rip), %rdi     # 0x1875c7
callq 0x7add0
callq 0xb0bd0
cmpl $0x0, %eax
je 0xc7204
leaq 0x2d3a4f(%rip), %rax    # 0x39ac20
movsbl (%rax), %ecx
subl $0x30, %ecx
leaq 0x2d5d76(%rip), %rax    # 0x39cf54
movl %ecx, (%rax)
leaq 0x2d3a39(%rip), %rax    # 0x39ac20
movsbl 0x1(%rax), %ecx
subl $0x30, %ecx
leaq 0x2d5d63(%rip), %rax    # 0x39cf58
movl %ecx, (%rax)
leaq 0x2d5d52(%rip), %rax    # 0x39cf50
movl $0x1, (%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_adm()
void parse_star_adm()
{
   // !!!! 4531
   log_packet_id("Star adm");
   if(get_msg_field()) {
      osa_gps_adm = msg_field[0] - '0';
      osa_aux_adm = msg_field[1] - '0';
      have_osa_adm = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0xc03ba(%rip), %rdi     # 0x1875d5
callq 0x7add0
callq 0xb0bd0
cmpl $0x0, %eax
je 0xc7264
leaq 0x2d39ef(%rip), %rax    # 0x39ac20
movsbl (%rax), %ecx
subl $0x30, %ecx
leaq 0x2d5d22(%rip), %rax    # 0x39cf60
movl %ecx, (%rax)
leaq 0x2d39d9(%rip), %rax    # 0x39ac20
movsbl 0x1(%rax), %ecx
subl $0x30, %ecx
leaq 0x2d5d0f(%rip), %rax    # 0x39cf64
movl %ecx, (%rax)
leaq 0x2d5cfe(%rip), %rax    # 0x39cf5c
movl $0x1, (%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_perf()
void parse_star_perf()
{
   // holdover performance

   log_packet_id("Star perf");
   if(get_msg_field()) {
      star_hold_perf = atoi(msg_field);  // 0=disable  1=enable
      have_star_perf = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0xbf6df(%rip), %rdi     # 0x18769a
callq 0x7add0
callq 0xb0bd0
cmpl $0x0, %eax
je 0xc7fe9
leaq 0x2d2c4f(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, 0x303e10(%rip)    # 0x3cbdec
leaq 0x2a45d1(%rip), %rax    # 0x36c5b4
movl $0x1, (%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_wtr()
void parse_star_wtr()
{
char *s;

   // wait to restore
   log_packet_id("Star WTR");

   if(get_msg_field()) {
      star_wtr = atoi(msg_field) * 10;
      have_star_wtr |= 0x01;
   }

   s = strchr(nmea_msg, '/');
   if(s) {
      ++s;
      zpad(s, 4);
      star_wtr_timer = atoi(s);
      have_star_wtr |= 0x02;
   }

   s = strchr(s, '/');
   if(s) { // !!!! 4531 aux timer
      ++s;
      zpad(s, 4);
      star_aux_timer = atoi(s);
      have_star_wtr |= 0x04;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xbf6a5(%rip), %rdi     # 0x1876a4
callq 0x7add0
callq 0xb0bd0
cmpl $0x0, %eax
je 0xc803b
leaq 0x2d2c0b(%rip), %rdi    # 0x39ac20
callq 0x95c0
imull $0xa, %eax, %ecx
leaq 0x2d4eec(%rip), %rax    # 0x39cf10
movl %ecx, (%rax)
leaq 0x2a458b(%rip), %rax    # 0x36c5b8
movl (%rax), %ecx
orl $0x1, %ecx
leaq 0x2a457f(%rip), %rax    # 0x36c5b8
movl %ecx, (%rax)
leaq 0x2d29ce(%rip), %rdi    # 0x39aa10
movl $0x2f, %esi
callq 0x9100
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xc809a
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x4, %esi
callq 0xc4fb0
movq -0x8(%rbp), %rdi
callq 0x95c0
movl %eax, %ecx
leaq 0x2d4e91(%rip), %rax    # 0x39cf14
movl %ecx, (%rax)
leaq 0x2a452c(%rip), %rax    # 0x36c5b8
movl (%rax), %ecx
orl $0x2, %ecx
leaq 0x2a4520(%rip), %rax    # 0x36c5b8
movl %ecx, (%rax)
movq -0x8(%rbp), %rdi
movl $0x2f, %esi
callq 0x9100
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xc80f6
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x4, %esi
callq 0xc4fb0
movq -0x8(%rbp), %rdi
callq 0x95c0
movl %eax, %ecx
leaq 0x2d4e39(%rip), %rax    # 0x39cf18
movl %ecx, (%rax)
leaq 0x2a44d0(%rip), %rax    # 0x36c5b8
movl (%rax), %ecx
orl $0x4, %ecx
leaq 0x2a44c4(%rip), %rax    # 0x36c5b8
movl %ecx, (%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: set_star_hbsq(int)
void set_star_hbsq(int secs)
{
   if(read_only) return;

   sprintf(out, "HBSQ=%d;", secs);
   queue_star_cmd(out, STAR_HBSQ_MSG);

   sprintf(out, "HBSQ;");
   queue_star_cmd(out, STAR_WTR_MSG);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
leaq 0x2ce0e8(%rip), %rax    # 0x3961fa
cmpb $0x0, (%rax)
je 0xc8119
jmp 0xc8168
movl -0x4(%rbp), %edx
leaq 0x2d32dd(%rip), %rdi    # 0x39b400
leaq 0xbf583(%rip), %rsi     # 0x1876ad
movb $0x0, %al
callq 0x9060
leaq 0x2d32c8(%rip), %rdi    # 0x39b400
movl $0xcc, %esi
callq 0x82fd0
leaq 0x2d32b7(%rip), %rdi    # 0x39b400
leaq 0xbf1cf(%rip), %rsi     # 0x18731f
movb $0x0, %al
callq 0x9060
leaq 0x2d32a2(%rip), %rdi    # 0x39b400
movl $0xda, %esi
callq 0x82fd0
addq $0x10, %rsp
popq %rbp
retq
nop
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: set_star_wtr(int)
void set_star_wtr(int secs)
{
   if(read_only) return;

   sprintf(out, "WTR=%d", secs/10);
   queue_star_cmd(out, STAR_WTR_MSG);

   sprintf(out, "WTR");
   queue_star_cmd(out, STAR_WTR_MSG);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
leaq 0x2ce078(%rip), %rax    # 0x3961fa
cmpb $0x0, (%rax)
je 0xc8189
jmp 0xc81e2
movl -0x4(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
movl %eax, %edx
leaq 0x2d3263(%rip), %rdi    # 0x39b400
leaq 0xbf512(%rip), %rsi     # 0x1876b6
movb $0x0, %al
callq 0x9060
leaq 0x2d324e(%rip), %rdi    # 0x39b400
movl $0xda, %esi
callq 0x82fd0
leaq 0x2d323d(%rip), %rdi    # 0x39b400
leaq 0xbf4df(%rip), %rsi     # 0x1876a9
movb $0x0, %al
callq 0x9060
leaq 0x2d3228(%rip), %rdi    # 0x39b400
movl $0xda, %esi
callq 0x82fd0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: set_star_output(int)
void set_star_output(int mode)
{
   // !!!! 4531
   if(read_only) return;

   if(mode == 1) sprintf(out, "OUTPUT_TYPE=E1");
   else if(mode == 2) sprintf(out, "OUTPUT_TYPE=FR");
   else return;
   queue_star_cmd(out, STAR_OUTPUT_MSG);
   queue_star_cmd("OUTPUT_TYPE", STAR_OUTPUT_MSG);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
leaq 0x2cdff8(%rip), %rax    # 0x3961fa
cmpb $0x0, (%rax)
je 0xc8209
jmp 0xc8269
cmpl $0x1, -0x4(%rbp)
jne 0xc8226
leaq 0x2d31ea(%rip), %rdi    # 0x39b400
leaq 0xbf4a0(%rip), %rsi     # 0x1876bd
movb $0x0, %al
callq 0x9060
jmp 0xc8247
cmpl $0x2, -0x4(%rbp)
jne 0xc8243
leaq 0x2d31cd(%rip), %rdi    # 0x39b400
leaq 0xbf492(%rip), %rsi     # 0x1876cc
movb $0x0, %al
callq 0x9060
jmp 0xc8245
jmp 0xc8269
jmp 0xc8247
leaq 0x2d31b2(%rip), %rdi    # 0x39b400
movl $0xe0, %esi
callq 0x82fd0
leaq 0xbf47c(%rip), %rdi     # 0x1876db
movl $0xe0, %esi
callq 0x82fd0
addq $0x10, %rsp
popq %rbp
retq
nop
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: set_star_prior(int, int)
void set_star_prior(int p1, int p2)
{
   // !!!! 4531
   if(read_only) return;

   sprintf(out, "PRIOR_TABLE=%d%d", p1, p2);
   queue_star_cmd(out, STAR_PRIOR_MSG);
   queue_star_cmd("PRIOR_TABLE", STAR_PRIOR_MSG);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
leaq 0x2cdf75(%rip), %rax    # 0x3961fa
cmpb $0x0, (%rax)
je 0xc828c
jmp 0xc82c9
movl -0x4(%rbp), %edx
movl -0x8(%rbp), %ecx
leaq 0x2d3167(%rip), %rdi    # 0x39b400
leaq 0xbf447(%rip), %rsi     # 0x1876e7
movb $0x0, %al
callq 0x9060
leaq 0x2d3152(%rip), %rdi    # 0x39b400
movl $0xe1, %esi
callq 0x82fd0
leaq 0xbf439(%rip), %rdi     # 0x1876f8
movl $0xe1, %esi
callq 0x82fd0
addq $0x10, %rsp
popq %rbp
retq
nop
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: set_star_aux_inp(int, int)
void set_star_aux_inp(int c, int t)
{
   // !!!! 4531
   if(read_only) return;

   sprintf(out, "AUX_INPUT=%d%d", c, t);
   queue_star_cmd(out, STAR_AUX_MSG);
   queue_star_cmd("AUX_INPUT", STAR_AUX_MSG);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
leaq 0x2cdf15(%rip), %rax    # 0x3961fa
cmpb $0x0, (%rax)
je 0xc82ec
jmp 0xc8329
movl -0x4(%rbp), %edx
movl -0x8(%rbp), %ecx
leaq 0x2d3107(%rip), %rdi    # 0x39b400
leaq 0xbf404(%rip), %rsi     # 0x187704
movb $0x0, %al
callq 0x9060
leaq 0x2d30f2(%rip), %rdi    # 0x39b400
movl $0xde, %esi
callq 0x82fd0
leaq 0xbf3f4(%rip), %rdi     # 0x187713
movl $0xde, %esi
callq 0x82fd0
addq $0x10, %rsp
popq %rbp
retq
nop
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: set_star_adm(int, int)
void set_star_adm(int gps, int aux)
{
   // !!!! 4531
   if(read_only) return;

   sprintf(out, "ADM_STATE=%d%d", gps, aux);
   queue_star_cmd(out, STAR_ADM_MSG);
   queue_star_cmd("ADM_STATE", STAR_ADM_MSG);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
leaq 0x2cdeb5(%rip), %rax    # 0x3961fa
cmpb $0x0, (%rax)
je 0xc834c
jmp 0xc8389
movl -0x4(%rbp), %edx
movl -0x8(%rbp), %ecx
leaq 0x2d30a7(%rip), %rdi    # 0x39b400
leaq 0xbf3bd(%rip), %rsi     # 0x18771d
movb $0x0, %al
callq 0x9060
leaq 0x2d3092(%rip), %rdi    # 0x39b400
movl $0xe2, %esi
callq 0x82fd0
leaq 0xbf3ad(%rip), %rdi     # 0x18772c
movl $0xe2, %esi
callq 0x82fd0
addq $0x10, %rsp
popq %rbp
retq
nop
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: clear_star_wtr()
void clear_star_wtr()
{
   // clear wait to restore timer
   if(read_only) return;

   sprintf(out, "CLEAR_WTR_GPS");
   queue_star_cmd(out, STAR_CLEAR_GPS_MSG);
   if(osa_model != 4530) {
      sprintf(out, "CLEAR_WTR_AUX");
      queue_star_cmd(out, STAR_CLEAR_AUX_MSG);  // !!!! 4531
   }

   sprintf(out, "WTR");
   queue_star_cmd(out, STAR_WTR_MSG);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x2cde5f(%rip), %rax    # 0x3961fa
cmpb $0x0, (%rax)
je 0xc83a5
jmp 0xc8426
leaq 0x2d3054(%rip), %rdi    # 0x39b400
leaq 0xbf383(%rip), %rsi     # 0x187736
movb $0x0, %al
callq 0x9060
leaq 0x2d303f(%rip), %rdi    # 0x39b400
movl $0xdb, %esi
callq 0x82fd0
leaq 0x1b1dfa(%rip), %rax    # 0x27a1cc
cmpl $0x11b2, (%rax)         # imm = 0x11B2
je 0xc8400
leaq 0x2d301f(%rip), %rdi    # 0x39b400
leaq 0xbf35c(%rip), %rsi     # 0x187744
movb $0x0, %al
callq 0x9060
leaq 0x2d300a(%rip), %rdi    # 0x39b400
movl $0xdc, %esi
callq 0x82fd0
leaq 0x2d2ff9(%rip), %rdi    # 0x39b400
leaq 0xbf29b(%rip), %rsi     # 0x1876a9
movb $0x0, %al
callq 0x9060
leaq 0x2d2fe4(%rip), %rdi    # 0x39b400
movl $0xda, %esi
callq 0x82fd0
popq %rbp
retq
nopl (%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_atdc()
void parse_star_atdc()
{
   // atdc (automatic temperature and drift compensation) status
   log_packet_id("Star ATDC");

   if(get_msg_field()) {
      star_atdc_on = atoi(msg_field);  // 0=atdc active  1=atdc in progress
      have_star_atdc |= 0x01;
   }
   if(get_msg_field()) {
      star_atdc_time = atoi(msg_field); 
      have_star_atdc |= 0x02;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0xbf317(%rip), %rdi     # 0x187752
callq 0x7add0
callq 0xb0bd0
cmpl $0x0, %eax
je 0xc8471
leaq 0x2d27cf(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, 0x303994(%rip)    # 0x3cbdf0
leaq 0x2a4159(%rip), %rax    # 0x36c5bc
movl (%rax), %ecx
orl $0x1, %ecx
leaq 0x2a414d(%rip), %rax    # 0x36c5bc
movl %ecx, (%rax)
callq 0xb0bd0
cmpl $0x0, %eax
je 0xc84a2
leaq 0x2d279e(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, 0x303967(%rip)    # 0x3cbdf4
leaq 0x2a4128(%rip), %rax    # 0x36c5bc
movl (%rax), %ecx
orl $0x2, %ecx
leaq 0x2a411c(%rip), %rax    # 0x36c5bc
movl %ecx, (%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_temp()
void parse_star_temp()   
{
   // device temperature
   log_packet_id("Star temperature");

   if(get_msg_field()) {
      temperature = (float) atof(msg_field);
      have_temperature = 106;
   } 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0xbf2a1(%rip), %rdi     # 0x18775c
callq 0x7add0
callq 0xb0bd0
cmpl $0x0, %eax
je 0xc84f6
leaq 0x2d274f(%rip), %rdi    # 0x39ac20
callq 0x9480
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x2a3713(%rip), %rax    # 0x36bbf8
movsd %xmm0, (%rax)
leaq 0x2a3f3c(%rip), %rax    # 0x36c42c
movl $0x6a, (%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_tod()
void parse_star_tod()    
{
   // time-of-day output enable/disable (not on NEC GPSDO)
   log_packet_id("Star TOD");

   if(get_msg_field()) {
      if(strstr(msg_field, "OK")) ;
      else if(star_type == OSA_TYPE) {
         strupr(msg_field);
         if(strstr(msg_field, "E")) star_tod = 1;
         else if(strstr(msg_field, "D")) star_tod = 0;
         else star_tod = 2;
         have_pps_rate = 89;
         pps_enabled = 1;
      }
      else {
         star_tod = atoi(msg_field);  // 0=disable  1=enabke
         have_pps_rate = 88;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0xbf262(%rip), %rdi     # 0x18776d
callq 0x7add0
callq 0xb0bd0
cmpl $0x0, %eax
je 0xc85e6
leaq 0x2d26fb(%rip), %rdi    # 0x39ac20
leaq 0xc24a7(%rip), %rsi     # 0x18a9d3
callq 0x9090
cmpq $0x0, %rax
je 0xc853c
jmp 0xc85e4
leaq 0x1b1c85(%rip), %rax    # 0x27a1c8
cmpl $0x4f, (%rax)
jne 0xc85c3
leaq 0x2d26d1(%rip), %rdi    # 0x39ac20
callq 0x9890
leaq 0x2d26c5(%rip), %rdi    # 0x39ac20
leaq 0xc2198(%rip), %rsi     # 0x18a6fa
callq 0x9090
cmpq $0x0, %rax
je 0xc8579
movl $0x1, 0x303871(%rip)    # 0x3cbde8
jmp 0xc85aa
leaq 0x2d26a0(%rip), %rdi    # 0x39ac20
leaq 0xb0ed2(%rip), %rsi     # 0x179459
callq 0x9090
cmpq $0x0, %rax
je 0xc859e
movl $0x0, 0x30384c(%rip)    # 0x3cbde8
jmp 0xc85a8
movl $0x2, 0x303840(%rip)    # 0x3cbde8
jmp 0xc85aa
leaq 0x2a3eff(%rip), %rax    # 0x36c4b0
movl $0x59, (%rax)
leaq 0x2a4942(%rip), %rax    # 0x36cf00
movb $0x1, (%rax)
jmp 0xc85e2
leaq 0x2d2656(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, 0x303813(%rip)    # 0x3cbde8
leaq 0x2a3ed4(%rip), %rax    # 0x36c4b0
movl $0x58, (%rax)
jmp 0xc85e4
jmp 0xc85e6
popq %rbp
retq
nopl (%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_type()
void parse_star_type()   
{
   // module type info
   log_packet_id("Star type");

   star_family[0] = star_variant[0] = 0;

   if(get_msg_field()) {
      msg_field[12] = 0;
      strcpy(star_family, msg_field);
   }

   if(get_msg_field()) {
      msg_field[12] = 0;
      strcpy(star_variant, msg_field);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0xbf17b(%rip), %rdi     # 0x187776
callq 0x7add0
leaq 0x2d48f8(%rip), %rax    # 0x39ceff
movb $0x0, (%rax)
leaq 0x2d48e1(%rip), %rax    # 0x39cef2
movb $0x0, (%rax)
callq 0xb0bd0
cmpl $0x0, %eax
je 0xc863c
leaq 0x2d25fb(%rip), %rax    # 0x39ac20
movb $0x0, 0xc(%rax)
leaq 0x2d48c2(%rip), %rdi    # 0x39cef2
leaq 0x2d25e9(%rip), %rsi    # 0x39ac20
callq 0x9350
callq 0xb0bd0
cmpl $0x0, %eax
je 0xc8664
leaq 0x2d25d3(%rip), %rax    # 0x39ac20
movb $0x0, 0xc(%rax)
leaq 0x2d48a7(%rip), %rdi    # 0x39ceff
leaq 0x2d25c1(%rip), %rsi    # 0x39ac20
callq 0x9350
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_elmask()
void parse_star_elmask()
{
float el_val;

   // antenna elevation mask
   log_packet_id("Star elmask");

   if(get_msg_field()) {
      el_val = (float) atof(msg_field);
      if((el_val >= 0.0) && (el_val <= 90.0)) {
         el_mask = el_val;
         have_el_mask = 1;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xbed3b(%rip), %rdi     # 0x1877ba
callq 0x7add0
callq 0xb0bd0
cmpl $0x0, %eax
je 0xc8aeb
leaq 0x2d218b(%rip), %rdi    # 0x39ac20
callq 0x9480
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x4(%rbp)
movss -0x4(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0xc8ae9
movss -0x4(%rbp), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0xa65c2(%rip), %xmm0    # 0x16f088
ucomisd %xmm1, %xmm0
jb 0xc8ae9
movss -0x4(%rbp), %xmm0
leaq 0x2a37bc(%rip), %rax    # 0x36c294
movss %xmm0, (%rax)
leaq 0x2a3af9(%rip), %rax    # 0x36c5dc
movl $0x1, (%rax)
jmp 0xc8aeb
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_inp_type()
void parse_star_inp_type() 
{
   // input ref type: GPS or PPS (not on Star-4 ATDC devices)
   log_packet_id("Star input");

   if(get_msg_field()) {
      if(strstr(msg_field, "GPS")) {
         gpsdo_ref = 0;
         have_gpsdo_ref = 1;
      }
      else if(strstr(msg_field, "AUX")) {
         gpsdo_ref = 1;
         have_gpsdo_ref = 1;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0xbecbb(%rip), %rdi     # 0x1877c6
callq 0x7add0
callq 0xb0bd0
cmpl $0x0, %eax
je 0xc8b86
leaq 0x2d20ff(%rip), %rdi    # 0x39ac20
leaq 0xcd931(%rip), %rsi     # 0x196459
callq 0x9090
cmpq $0x0, %rax
je 0xc8b4f
leaq 0x2a3326(%rip), %rax    # 0x36be60
movl $0x0, (%rax)
leaq 0x2a331d(%rip), %rax    # 0x36be64
movl $0x1, (%rax)
jmp 0xc8b84
leaq 0x2d20ca(%rip), %rdi    # 0x39ac20
leaq 0xc246f(%rip), %rsi     # 0x18afcc
callq 0x9090
cmpq $0x0, %rax
je 0xc8b82
leaq 0x2a32f1(%rip), %rax    # 0x36be60
movl $0x1, (%rax)
leaq 0x2a32e8(%rip), %rax    # 0x36be64
movl $0x1, (%rax)
jmp 0xc8b84
jmp 0xc8b86
popq %rbp
retq
nopl (%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ubx_nav()
void parse_ubx_nav()
{
S32 msec;

   // get lat/lon/alt
   log_packet_id("UBX_NAV");

   msec = tsip_dword();
   lon = (double) (S32) tsip_dword();
   lat = (double) (S32) tsip_dword();
   alt = (double) (S32) tsip_dword();
   tsip_dword();
   tsip_dword();
   tsip_dword();

   lat = (lat / 1.0E7);
   lon = (lon / 1.0E7);
   alt = alt / 1000.0;

   lat = lat * PI / 180.0;
   lon = lon * PI / 180.0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xbe2e2(%rip), %rdi     # 0x187941
callq 0x7add0
callq 0x7a680
movl %eax, -0x4(%rbp)
callq 0x7a680
cvtsi2sd %eax, %xmm0
leaq 0x2a2b3c(%rip), %rax    # 0x36c1b8
movsd %xmm0, (%rax)
callq 0x7a680
cvtsi2sd %eax, %xmm0
leaq 0x2a2b20(%rip), %rax    # 0x36c1b0
movsd %xmm0, (%rax)
callq 0x7a680
cvtsi2sd %eax, %xmm0
leaq 0x2a2b1c(%rip), %rax    # 0x36c1c0
movsd %xmm0, (%rax)
callq 0x7a680
callq 0x7a680
callq 0x7a680
leaq 0x2a2af2(%rip), %rax    # 0x36c1b0
movsd (%rax), %xmm0
movsd 0xa5ae6(%rip), %xmm1    # 0x16f1b0
divsd %xmm1, %xmm0
leaq 0x2a2adb(%rip), %rax    # 0x36c1b0
movsd %xmm0, (%rax)
leaq 0x2a2ad8(%rip), %rax    # 0x36c1b8
movsd (%rax), %xmm0
movsd 0xa5ac4(%rip), %xmm1    # 0x16f1b0
divsd %xmm1, %xmm0
leaq 0x2a2ac1(%rip), %rax    # 0x36c1b8
movsd %xmm0, (%rax)
leaq 0x2a2abe(%rip), %rax    # 0x36c1c0
movsd (%rax), %xmm0
movsd 0xa5922(%rip), %xmm1    # 0x16f030
divsd %xmm1, %xmm0
leaq 0x2a2aa7(%rip), %rax    # 0x36c1c0
movsd %xmm0, (%rax)
movsd 0xa7ea3(%rip), %xmm0    # 0x1715c8
leaq 0x2a2a84(%rip), %rax    # 0x36c1b0
mulsd (%rax), %xmm0
movsd 0xa5940(%rip), %xmm1    # 0x16f078
divsd %xmm1, %xmm0
leaq 0x2a2a6d(%rip), %rax    # 0x36c1b0
movsd %xmm0, (%rax)
movsd 0xa7e79(%rip), %xmm0    # 0x1715c8
leaq 0x2a2a62(%rip), %rax    # 0x36c1b8
mulsd (%rax), %xmm0
movsd 0xa5916(%rip), %xmm1    # 0x16f078
divsd %xmm1, %xmm0
leaq 0x2a2a4b(%rip), %rax    # 0x36c1b8
movsd %xmm0, (%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ubx_status()
void parse_ubx_status()
{
int mode;

   // get receiver operating mode
   log_packet_id("UBX_STATUS");

   tsip_dword();  // tow
   mode = tsip_byte();
   tsip_byte();
   tsip_byte();
   tsip_byte();
   tsip_double();

if(debug_file) fprintf(debug_file, "rcvr mode:%d\n", mode);

   if     (mode == 0) rcvr_mode = RCVR_MODE_ACQUIRE;
   else if(mode == 1) rcvr_mode = RCVR_MODE_UNKNOWN;  // dead reckoning
   else if(mode == 2) rcvr_mode = RCVR_MODE_2D;
   else if(mode == 3) rcvr_mode = RCVR_MODE_3D;
   else if(mode == 4) rcvr_mode = RCVR_MODE_3D;       // gps+dead reckonong
   else if(mode == 5) rcvr_mode = RCVR_MODE_HOLD;     // (time only fix)
   else               rcvr_mode = RCVR_MODE_UNKNOWN;
   have_rcvr_mode = 3;

   have_tracking = 1;
   if     (rcvr_mode == RCVR_MODE_NO_SATS) minor_alarms |= MINOR_NO_TRACK;
   else if(rcvr_mode == RCVR_MODE_2D_3D)   minor_alarms |= MINOR_NO_TRACK;
   else                                    minor_alarms &= (~MINOR_NO_TRACK);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xbe1ba(%rip), %rdi     # 0x187949
callq 0x7add0
callq 0x7a680
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x4(%rbp)
callq 0x7a510
callq 0x7a510
callq 0x7a510
callq 0x7a9d0
leaq 0x1d3db1(%rip), %rax    # 0x29d570
cmpq $0x0, (%rax)
je 0xc97e0
leaq 0x1d3da4(%rip), %rax    # 0x29d570
movq (%rax), %rdi
movl -0x4(%rbp), %edx
leaq 0xbe17b(%rip), %rsi     # 0x187954
movb $0x0, %al
callq 0x9550
cmpl $0x0, -0x4(%rbp)
jne 0xc97f2
leaq 0x2a2ac3(%rip), %rax    # 0x36c2b0
movb $0x9, (%rax)
jmp 0xc9860
cmpl $0x1, -0x4(%rbp)
jne 0xc9804
leaq 0x2a2ab1(%rip), %rax    # 0x36c2b0
movb $0x63, (%rax)
jmp 0xc985e
cmpl $0x2, -0x4(%rbp)
jne 0xc9816
leaq 0x2a2a9f(%rip), %rax    # 0x36c2b0
movb $0x3, (%rax)
jmp 0xc985c
cmpl $0x3, -0x4(%rbp)
jne 0xc9828
leaq 0x2a2a8d(%rip), %rax    # 0x36c2b0
movb $0x4, (%rax)
jmp 0xc985a
cmpl $0x4, -0x4(%rbp)
jne 0xc983a
leaq 0x2a2a7b(%rip), %rax    # 0x36c2b0
movb $0x4, (%rax)
jmp 0xc9858
cmpl $0x5, -0x4(%rbp)
jne 0xc984c
leaq 0x2a2a69(%rip), %rax    # 0x36c2b0
movb $0x7, (%rax)
jmp 0xc9856
leaq 0x2a2a5d(%rip), %rax    # 0x36c2b0
movb $0x63, (%rax)
jmp 0xc9858
jmp 0xc985a
jmp 0xc985c
jmp 0xc985e
jmp 0xc9860
leaq 0x2a2d86(%rip), %rax    # 0x36c5ed
movb $0x3, (%rax)
leaq 0x2a2bff(%rip), %rax    # 0x36c470
movl $0x1, (%rax)
leaq 0x2a2a32(%rip), %rax    # 0x36c2b0
movzbl (%rax), %eax
cmpl $0x2, %eax
jne 0xc989d
leaq 0x2a2b2b(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
orl $0x8, %ecx
leaq 0x2a2b1f(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
jmp 0xc98da
leaq 0x2a2a0c(%rip), %rax    # 0x36c2b0
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0xc98c3
leaq 0x2a2b05(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
orl $0x8, %ecx
leaq 0x2a2af9(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
jmp 0xc98d8
leaq 0x2a2aee(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
andl $-0x9, %ecx
leaq 0x2a2ae2(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
jmp 0xc98da
addq $0x10, %rsp
popq %rbp
retq
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ubx_clock()
void parse_ubx_clock()
{
S32 bias;
S32 drift;
u32 accu;
u32 freq;

   // get clock bias info  !!!! we need to do something with this
   log_packet_id("UBX_CLOCK");

   tsip_dword();  // tow
   bias = tsip_dword();
   drift = tsip_dword();
   accu = tsip_dword();
   freq = tsip_dword();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xbe073(%rip), %rdi     # 0x187962
callq 0x7add0
callq 0x7a680
callq 0x7a680
movl %eax, -0x4(%rbp)
callq 0x7a680
movl %eax, -0x8(%rbp)
callq 0x7a680
movl %eax, -0xc(%rbp)
callq 0x7a680
movl %eax, -0x10(%rbp)
addq $0x10, %rsp
popq %rbp
retq
nop