LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zy_trmo()
void parse_zy_trmo()
{
char trmo;

   // surveying / position hold mode
   log_packet_id("survey info");

   if(get_msg_field()) {
      trmo = msg_field[0];  // P=position average mode   K=known position
      if(trmo == 'P') {
         minor_alarms |= MINOR_SURVEY;
         rcvr_mode = RCVR_MODE_SURVEY;
      }
      else if(trmo == 'K') {
         minor_alarms &= (~MINOR_SURVEY);
         rcvr_mode = RCVR_MODE_HOLD;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7b78b(%rip), %rdi     # 0x126172
callq 0x58dc2
callq 0x810b1
testl %eax, %eax
je 0xaaa39
leaq 0x291044(%rip), %rax    # 0x33ba40
movzbl (%rax), %eax
cmpl $0x4b, %eax
je 0xaaa19
cmpl $0x50, %eax
jne 0xaaa39
leaq 0x2627c8(%rip), %rax    # 0x30d1d8
movl (%rax), %eax
orl $0x20, %eax
movb $0xb, %cl
jmp 0xaaa27
leaq 0x2627b8(%rip), %rax    # 0x30d1d8
movl (%rax), %eax
andl $-0x21, %eax
movb $0x7, %cl
leaq 0x2627aa(%rip), %rdx    # 0x30d1d8
movl %eax, (%rdx)
leaq 0x262699(%rip), %rax    # 0x30d0d0
movb %cl, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_true_clock()
void parse_true_clock()
{
double jd;
int utc;

   log_packet_id("clock");

   if(get_msg_field()) jd = atof(msg_field);
   else return;

   if(get_msg_field()) utc = atoi(msg_field);
   else return;

   if(get_msg_field()) {
      tfom = atoi(msg_field);
      have_tfom = 1;
   }
   else return;

   jd /= (24.0*60.0*60.0);
   jd += GPS_EPOCH;

   if(!user_set_utc_ofs && utc) utc_offset = (int) utc;
   check_utc_ofs(33);

   set_gregorian_time(jd);
   if(time_flags & TFLAGS_UTC) {
      gps_to_utc();
   }

   update_gps_screen(4387);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x876ad(%rip), %rdi     # 0x13211c
callq 0x58dc2
callq 0x810b1
testl %eax, %eax
je 0xaaba4
leaq 0x290fb8(%rip), %rdi    # 0x33ba40
callq 0x9470
movsd %xmm0, -0x10(%rbp)
callq 0x810b1
testl %eax, %eax
je 0xaaba4
leaq 0x290f9a(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, %ebx
callq 0x810b1
testl %eax, %eax
je 0xaaba4
leaq 0x290f7f(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x262183(%rip), %rcx    # 0x30cc50
movl %eax, (%rcx)
leaq 0x26217e(%rip), %rax    # 0x30cc54
movl $0x1, (%rax)
movsd -0x10(%rbp), %xmm0
divsd 0x5e52f(%rip), %xmm0    # 0x109018
leaq 0x262c44(%rip), %rax    # 0x30d734
cmpl $0x0, (%rax)
sete %al
testl %ebx, %ebx
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xaab0b
leaq 0x262c1f(%rip), %rax    # 0x30d728
movl %ebx, (%rax)
addsd 0x60d85(%rip), %xmm0    # 0x10b898
leaq 0x262802(%rip), %rax    # 0x30d31c
cmpl $0x0, (%rax)
jne 0xaab60
leaq 0x2629ee(%rip), %rcx    # 0x30d514
cmpl $0x7e1, (%rcx)          # imm = 0x7E1
setge %cl
leaq 0x262bf2(%rip), %rdx    # 0x30d728
movl (%rdx), %edx
cmpl $0x12, %edx
setl %sil
andb %cl, %sil
cmpl $0x11, %edx
setl %cl
orb %sil, %cl
jne 0xaab60
leaq 0x16dcf0(%rip), %rcx    # 0x218844
movl $0x7f1, (%rcx)          # imm = 0x7F1
movl $0x21, (%rax)
callq 0x5c71d
leaq 0x262938(%rip), %rbx    # 0x30d4a4
testb $0x1, (%rbx)
je 0xaab99
leaq 0x262bb0(%rip), %rax    # 0x30d728
cvtsi2sdl (%rax), %xmm1
xorpd %xmm0, %xmm0
subsd %xmm1, %xmm0
callq 0x5c7ed
orb $0x1, (%rbx)
leaq 0x262839(%rip), %rax    # 0x30d3cc
movl $0x1, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x730e8
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_true_extstatus()
void parse_true_extstatus()
{
   log_packet_id("extstatus");

   if(get_msg_field()) {  // position questionable?  0=normal  1=survey?
   }
   else return;

   if(get_msg_field()) {  // sat count related?
   }
   else return;

   if(get_msg_field()) {  // seems to be related to operating mode 
      true_eval = atof(msg_field);  // ,,, much noisier during survey, 
                                    // ... stable in position hold mode
                                    // ... might be 1PPS or osc error related
      have_true_eval = 1;
   }
   else return;

   if(get_msg_field()) {
      temperature = (DATA_SIZE) atof(msg_field);
      if(temperature && (have_temperature == 0)) {
         new_queue(RESET_ALL_QUEUES, 6543); // clear the queues so temp scales nicely
         have_temperature = 116;
      }
   }
   else return;

   if(get_msg_field()) {  // ?
   }
   else return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x7b63f(%rip), %rdi     # 0x1261f7
callq 0x58dc2
callq 0x810b1
testl %eax, %eax
je 0xaac5c
callq 0x810b1
testl %eax, %eax
je 0xaac5c
callq 0x810b1
testl %eax, %eax
je 0xaac5c
leaq 0x290e59(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x292775(%rip), %rax    # 0x33d368
movsd %xmm0, (%rax)
leaq 0x292772(%rip), %rax    # 0x33d370
movl $0x1, (%rax)
callq 0x810b1
testl %eax, %eax
je 0xaac5c
leaq 0x290e2c(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x261df8(%rip), %rax    # 0x30ca18
movsd %xmm0, (%rax)
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xaac30
jnp 0xaac51
leaq 0x262615(%rip), %rbx    # 0x30d24c
cmpl $0x0, (%rbx)
jne 0xaac51
movl $0x7, %edi
movl $0x198f, %esi           # imm = 0x198F
callq 0x1118c
movl $0x74, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x810b1
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_true_geta()
void parse_true_geta()
{
   // attenuator
   log_packet_id("geta");

   if(get_msg_field()) {
      atten_val = atof(msg_field);
      have_atten = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7b593(%rip), %rdi     # 0x126201
callq 0x58dc2
callq 0x810b1
testl %eax, %eax
je 0xaaca0
leaq 0x290dbd(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x2926f9(%rip), %rax    # 0x33d388
movsd %xmm0, (%rax)
leaq 0x2926f6(%rip), %rax    # 0x33d390
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_true_getp()
void parse_true_getp()
{
   // get "pot" values
   log_packet_id("getp");

   if(get_msg_field()) {  // integer
      true_pot1 = atoi(msg_field);
      have_true_pot |= 0x01;
   }
   if(get_msg_field()) {  // integer
      true_pot2 = atoi(msg_field);
      have_true_pot |= 0x02;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7b559(%rip), %rdi     # 0x126206
callq 0x58dc2
callq 0x810b1
testl %eax, %eax
je 0xaacda
leaq 0x290d7e(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x2926c6(%rip), %rcx    # 0x33d394
movl %eax, (%rcx)
leaq 0x2926c5(%rip), %rax    # 0x33d39c
orb $0x1, (%rax)
callq 0x810b1
testl %eax, %eax
je 0xaad02
leaq 0x290d56(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x2926a2(%rip), %rcx    # 0x33d398
movl %eax, (%rcx)
leaq 0x29269d(%rip), %rax    # 0x33d39c
orb $0x2, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_true_getdelay()
void parse_true_getdelay()
{
   log_packet_id("getdelay");

   if(get_msg_field()) {
      cable_delay = atof(msg_field) / 1.0E9;
      have_cable_delay = 444;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7b4fc(%rip), %rdi     # 0x12620b
callq 0x58dc2
callq 0x810b1
testl %eax, %eax
je 0xaad49
leaq 0x290d1c(%rip), %rdi    # 0x33ba40
callq 0x9470
divsd 0x5e2f7(%rip), %xmm0    # 0x109028
leaq 0x263090(%rip), %rax    # 0x30ddc8
movsd %xmm0, (%rax)
leaq 0x262571(%rip), %rax    # 0x30d2b4
movl $0x1bc, (%rax)          # imm = 0x1BC
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_true_getbdelay()
void parse_true_getbdelay()
{
   log_packet_id("getbdelay");

   if(get_msg_field()) {
      pps1_delay = atof(msg_field) / 1.0E9;
      have_pps_delay |= 0x01;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7b4be(%rip), %rdi     # 0x126214
callq 0x58dc2
callq 0x810b1
testl %eax, %eax
je 0xaad8d
leaq 0x290cd5(%rip), %rdi    # 0x33ba40
callq 0x9470
divsd 0x5e2b0(%rip), %xmm0    # 0x109028
leaq 0x263059(%rip), %rax    # 0x30ddd8
movsd %xmm0, (%rax)
leaq 0x26252e(%rip), %rax    # 0x30d2b8
orb $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_true_ppsdbg()
void parse_true_ppsdbg()
{
   log_packet_id("ppsdbg");

   get_msg_field();  // GPS time
   get_msg_field();  // Status - 0
   if(get_msg_field()) { // 32.42914e3   // EFC?
      dac_voltage = (DATA_SIZE) (atof(msg_field) * 4.096 / 65536.0);  // EFC DAC
      if(dac_voltage && (have_dac == 0)) {
         new_queue(RESET_ALL_QUEUES, 6544); // clear the queues so dac scales nicely
         have_dac = 66;
      }
   }
   get_msg_field();  // 0, -3, -2, -1

   if(get_msg_field()) {
//    dac_voltage = (DATA_SIZE) atof(msg_field);  // sawtooth?
//    have_sawtooth = 1;
   }

   get_msg_field();  // 0, 2
   get_msg_field();  // 0,1,3

   if(get_msg_field()) {  // temperature
//    temperature = (DATA_SIZE) atof(msg_field);
//    have_temperature = 117;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x7b482(%rip), %rdi     # 0x12621e
callq 0x58dc2
callq 0x810b1
callq 0x810b1
callq 0x810b1
testl %eax, %eax
je 0xaae08
leaq 0x290c85(%rip), %rdi    # 0x33ba40
callq 0x9470
mulsd 0x73a28(%rip), %xmm0    # 0x11e7f0
mulsd 0x739e0(%rip), %xmm0    # 0x11e7b0
leaq 0x261c29(%rip), %rax    # 0x30ca00
movsd %xmm0, (%rax)
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xaade7
jnp 0xaae08
leaq 0x26250e(%rip), %rbx    # 0x30d2fc
cmpl $0x0, (%rbx)
jne 0xaae08
movl $0x7, %edi
movl $0x1990, %esi           # imm = 0x1990
callq 0x1118c
movl $0x42, (%rbx)
callq 0x810b1
callq 0x810b1
callq 0x810b1
callq 0x810b1
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x810b1
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_true_kaldbg()
void parse_true_kaldbg()
{
   log_packet_id("kaldbg");

   if(get_msg_field()) {} ;  // Unix time
   if(get_msg_field()) {} ;  // -0.32
   if(get_msg_field()) {} ;  // PPS related - 31.42890e3
   if(get_msg_field()) {} ;  // -0.336e-3
   if(get_msg_field()) {} ;  // 0.291      // smoothed phase error in approx 6.5 ns steps
   if(get_msg_field()) {} ;  // 0
   if(get_msg_field()) {} ;  // 0
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7b3f3(%rip), %rdi     # 0x126225
callq 0x58dc2
callq 0x810b1
callq 0x810b1
callq 0x810b1
callq 0x810b1
callq 0x810b1
callq 0x810b1
popq %rbp
jmp 0x810b1
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_true_scale()
void parse_true_scale()
{
   log_packet_id("scalefactor");

   if(get_msg_field()) {
      true_scalefactor = atof(msg_field);
      have_true_scale = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7b3c6(%rip), %rdi     # 0x12622c
callq 0x58dc2
callq 0x810b1
testl %eax, %eax
je 0xaae98
leaq 0x290bc5(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x2924f1(%rip), %rax    # 0x33d378
movsd %xmm0, (%rax)
leaq 0x2924ee(%rip), %rax    # 0x33d380
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_true_getver()
void parse_true_getver()
{
   log_packet_id("getver");

   if(get_msg_field()) {
      msg_field[32] = 0;
      strcpy(tp_sw, msg_field);
   }

   if(get_msg_field()) {
      msg_field[32] = 0;
      strcpy(tp_boot, msg_field);
      if(strstr(msg_field, "BOOT")) {
         send_true_cmd("$PROCEED");  // get out of boot mode
      }
   }

   if(get_msg_field()) {  // FPGA version
      msg_field[32] = 0;
      strcpy(tp_num1, msg_field);
   }

   if(get_msg_field()) {  // software checmsum
      msg_field[32] = 0;
      strcpy(tp_num2, msg_field);
   }

   if(get_msg_field()) {  // FPGA checksum
      msg_field[32] = 0;
      strcpy(tp_num3, msg_field);
   }

   if(get_msg_field()) {
      msg_field[32] = 0;
      strcpy(tp_sn, msg_field);
   }

   have_info |= ALL_ID_INFO;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x7b243(%rip), %rdi     # 0x12623f
callq 0x58dc2
callq 0x810b1
testl %eax, %eax
je 0xab021
leaq 0x290a2f(%rip), %rsi    # 0x33ba40
movb $0x0, 0x20(%rsi)
leaq 0x291fd4(%rip), %rdi    # 0x33cff0
callq 0x9340
callq 0x810b1
testl %eax, %eax
je 0xab064
leaq 0x290a0f(%rip), %rbx    # 0x33ba40
movb $0x0, 0x20(%rbx)
leaq 0x291fe4(%rip), %rdi    # 0x33d020
movq %rbx, %rsi
callq 0x9340
leaq 0x7b1fb(%rip), %rsi     # 0x126246
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
je 0xab064
leaq 0x76768(%rip), %rdi     # 0x1217c7
callq 0x5f228
callq 0x810b1
testl %eax, %eax
je 0xab084
leaq 0x2909cc(%rip), %rsi    # 0x33ba40
movb $0x0, 0x20(%rsi)
leaq 0x291fd1(%rip), %rdi    # 0x33d050
callq 0x9340
callq 0x810b1
testl %eax, %eax
je 0xab0a4
leaq 0x2909ac(%rip), %rsi    # 0x33ba40
movb $0x0, 0x20(%rsi)
leaq 0x291fe1(%rip), %rdi    # 0x33d080
callq 0x9340
callq 0x810b1
testl %eax, %eax
je 0xab0c4
leaq 0x29098c(%rip), %rsi    # 0x33ba40
movb $0x0, 0x20(%rsi)
leaq 0x291ff1(%rip), %rdi    # 0x33d0b0
callq 0x9340
callq 0x810b1
testl %eax, %eax
je 0xab0e4
leaq 0x29096c(%rip), %rsi    # 0x33ba40
movb $0x0, 0x20(%rsi)
leaq 0x292001(%rip), %rdi    # 0x33d0e0
callq 0x9340
leaq 0x262889(%rip), %rax    # 0x30d974
orb $0xf, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_true_sat()
void parse_true_sat()
{
int prn;
double az, el, sig;

   log_packet_id("sat info");

   if(get_msg_field()) {  // receiver channel
   }
   else return;

   if(get_msg_field()) {
      prn = atoi(msg_field);
      if(prn < 1) return;
      else if(prn > 255) return;
   }
   else return;

   az = el = 999.0;
   if(get_msg_field()) {
      el = atof(msg_field);
   }
   else return;
   if(get_msg_field()) {
      az = atof(msg_field);
   }
   else return;
   if((az < 999.0) && (el < 999.0)) {
      set_sat_azel(prn, (float) az, (float) el);
   }

   if(get_msg_field()) {
      sig = atof(msg_field);
      if(sig) {
         sat[prn].tracking = prn;
         sat[prn].level_msg = 55;
         sat[prn].sig_level = (float) sig;
         have_snr |= rinex_gnss(prn);
         record_sig_levels(prn);
      }
      else {
         sat[prn].level_msg = 0;
         sat[prn].tracking = 0;
      }
   }
   else return;

   level_type = "dBc";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x79bcd(%rip), %rdi     # 0x124ccf
callq 0x58dc2
callq 0x810b1
testl %eax, %eax
je 0xab21e
callq 0x810b1
testl %eax, %eax
je 0xab21e
leaq 0x290918(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, %ebx
leal -0x100(%rbx), %eax
cmpl $0xffffff01, %eax       # imm = 0xFFFFFF01
jb 0xab21e
callq 0x810b1
testl %eax, %eax
je 0xab21e
leaq 0x2908ec(%rip), %rdi    # 0x33ba40
callq 0x9470
movsd %xmm0, -0x10(%rbp)
callq 0x810b1
testl %eax, %eax
je 0xab21e
leaq 0x2908ce(%rip), %rdi    # 0x33ba40
callq 0x9470
movsd 0x73679(%rip), %xmm1    # 0x11e7f8
ucomisd %xmm0, %xmm1
movsd -0x10(%rbp), %xmm2
jbe 0xab1a2
ucomisd %xmm2, %xmm1
jbe 0xab1a2
cvtsd2ss %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtsd2ss %xmm2, %xmm1
movl %ebx, %edi
callq 0x5ace1
callq 0x810b1
testl %eax, %eax
je 0xab21e
leaq 0x29088e(%rip), %rdi    # 0x33ba40
callq 0x9470
movl %ebx, %eax
imulq $0x348, %rax, %rax      # imm = 0x348
xorpd %xmm1, %xmm1
addq 0xa4d75(%rip), %rax     # 0x14ff40
ucomisd %xmm1, %xmm0
jne 0xab1d3
jnp 0xab202
movl %ebx, 0x218(%rax)
movl $0x37, 0x1c(%rax)
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x20(%rax)
movl %ebx, %edi
callq 0xdc1dd
leaq 0x262155(%rip), %rcx    # 0x30d34c
orl %eax, (%rcx)
movl %ebx, %edi
callq 0x5cdab
jmp 0xab20d
xorl %ecx, %ecx
movl %ecx, 0x1c(%rax)
movl %ecx, 0x218(%rax)
leaq 0x76ac6(%rip), %rax     # 0x121cda
leaq 0x193cdd(%rip), %rcx    # 0x23eef8
movq %rax, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_true_status()
void parse_true_status()
{
u32 ho;
int val;

   log_packet_id("status");

   if(get_msg_field()) {  // 10MHz
      val = atoi(msg_field);
   }
   else return;

   if(get_msg_field()) {  // 1PPS
      val = atoi(msg_field);
   }
   else return;

   if(get_msg_field()) {  // antenna          
      val = atoi(msg_field);
      if(val) minor_alarms |= (MINOR_ANT_NO_PWR);
      else    minor_alarms &= (~MINOR_ANT_NO_PWR);
      have_antenna = 56;
   }
   else return;

   if(get_msg_field()) {  // holdover duration
      ho = (u32) atoi(msg_field);
      if(ho) holdover = ho;
   }
   else return;

   if(get_msg_field()) {  // num sats
      val = atoi(msg_field);
   }
   else return;

   if(get_msg_field()) {  // state
      val = atoi(msg_field);
      if     (val == 0) discipline_mode = DIS_MODE_NORMAL;
      else if(val == 1) discipline_mode = DIS_MODE_ACQUIRE;     // acquiring
      else if(val == 2) discipline_mode = DIS_MODE_POWERUP;
      else if(val == 3) discipline_mode = DIS_MODE_AUTO_HOLD;
      else if(val == 4) discipline_mode = DIS_MODE_MANUAL_HOLD;
      else if(val == 5) discipline_mode = DIS_MODE_SOFT_HOLD;
      else if(val == 6) discipline_mode = DIS_MODE_NO_GPS;      // no gps
      else if(val == 7) discipline_mode = DIS_MODE_LEARNING;    // training OCXO
      else if(1 || ((val >= 8) && (val <= 17))) {
         true_wait = val;
         discipline_mode = DIS_MODE_WAIT;
      }
      else discipline_mode = DIS_MODE_UNKNOWN;

      true_debug = atoi(msg_field);
      have_true_debug = 1;
      have_ffom = 1;
   }
   else return;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7a7a9(%rip), %rdi     # 0x125b1d
callq 0x58dc2
callq 0x810b1
testl %eax, %eax
je 0xab46d
callq 0x810b1
testl %eax, %eax
je 0xab46d
callq 0x810b1
testl %eax, %eax
je 0xab46d
leaq 0x290699(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x261e25(%rip), %rcx    # 0x30d1d8
movl (%rcx), %edx
andl $-0x7, %edx
testl %eax, %eax
movl $0x6, %esi
cmovel %eax, %esi
orl %edx, %esi
movl %esi, (%rcx)
leaq 0x261e5f(%rip), %rax    # 0x30d22c
movl $0x38, (%rax)
callq 0x810b1
testl %eax, %eax
je 0xab46d
leaq 0x290659(%rip), %rdi    # 0x33ba40
callq 0x95e0
testl %eax, %eax
je 0xab3f9
leaq 0x262061(%rip), %rcx    # 0x30d458
movl %eax, (%rcx)
callq 0x810b1
testl %eax, %eax
je 0xab46d
callq 0x810b1
testl %eax, %eax
je 0xab46d
leaq 0x29062e(%rip), %rdi    # 0x33ba40
callq 0x95e0
cmpl $0x8, %eax
jae 0xab430
shll $0x3, %eax
movabsq $0x1415160302011700, %rdx # imm = 0x1415160302011700
movl %eax, %ecx
shrq %cl, %rdx
jmp 0xab438
movl %eax, 0x2c4bbe(%rip)    # 0x36fff4
movb $0x18, %dl
leaq 0x262058(%rip), %rax    # 0x30d497
movb %dl, (%rax)
leaq 0x2905f8(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x291f4c(%rip), %rcx    # 0x33d3a0
movl %eax, (%rcx)
leaq 0x291f47(%rip), %rax    # 0x33d3a4
movl $0x1, %ecx
movl %ecx, (%rax)
leaq 0x2617f1(%rip), %rax    # 0x30cc5c
movl %ecx, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: two_enviro_mode()
int two_enviro_mode()
{
   // returns true if there is a environmental sensor thermometer on the main 
   // receiver port and on the auxiliary ENVIRO_PORT  - Heather does not 
   // currently support this.

   if((rcvr_type == THERMO_RCVR) && enviro_port_open()) return 1;
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x16d3ca(%rip), %rax    # 0x2188d0
cmpq $0x80000, (%rax)        # imm = 0x80000
jne 0xab52d
leaq 0x262dca(%rip), %rcx    # 0x30e2e0
cmpl $0x0, 0x225d4(%rcx)
je 0xab52d
movl $0x1, %eax
cmpl $0x0, 0x225d0(%rcx)
jg 0xab52f
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: get_enviro_field()
int get_enviro_field()
{
char c;
int i;

   // extract the next field from a sensorr message.  Fields are separated
   // by commas, spaces, or tabs.

   enviro_field[0] = 0;
   if(enviro_msg[enviro_col] == 0) return 0;  // at end-of-message

   i = 0;
   while(enviro_col < (int)sizeof(enviro_msg)) {   // get next field from the thermometer message
      c = enviro_msg[enviro_col];
      if(c == 0) {  // reached end-of-message
         break;
      }
      else if(c == ' ') {  // skip leading spaces, end field on a space
         ++enviro_col;
         if(i) break;
      }
      else if(c == '\t') {  // skip leading spaces, end field on a tab
         ++enviro_col;
         if(i) break;
      }
      else if(c == ',') {  // skip leading spaces, end field on a comma
         ++enviro_col;
         if(i) break;
      }
      else {        // add char to extracted field
         enviro_field[i++] = c;
         enviro_field[i] = 0;
         ++enviro_col;
      }
   }

   return enviro_field[0];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movslq 0x2c1118(%rip), %rcx    # 0x36c654
cmpq $0x201, %rcx            # imm = 0x201
setge %sil
leaq 0x2c0cf2(%rip), %rdx    # 0x36c240
cmpb $0x0, (%rcx,%rdx)
movb $0x0, 0x2c0ef7(%rip)    # 0x36c450
sete %dil
xorl %eax, %eax
orb %sil, %dil
jne 0xab5cf
xorl %esi, %esi
leaq 0x2c0ee3(%rip), %rax    # 0x36c450
movslq %ecx, %rdi
movb (%rdi,%rdx), %dil
movzbl %dil, %r8d
cmpl $0x1f, %r8d
jle 0xab58c
cmpl $0x2c, %r8d
je 0xab592
cmpl $0x20, %r8d
je 0xab592
jmp 0xab5a7
cmpl $0x9, %r8d
jne 0xab5a2
incl %ecx
movl %ecx, 0x2c10ba(%rip)    # 0x36c654
testl %esi, %esi
jne 0xab5c8
xorl %esi, %esi
jmp 0xab5c0
testl %r8d, %r8d
je 0xab5c8
movslq %esi, %r8
leaq 0x1(%r8), %rsi
movb %dil, (%r8,%rax)
movb $0x0, 0x1(%r8,%rax)
incl %ecx
movl %ecx, 0x2c1094(%rip)    # 0x36c654
cmpl $0x201, %ecx            # imm = 0x201
jl 0xab56d
movsbl 0x2c0e81(%rip), %eax    # 0x36c450
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: save_temp1()
void save_temp1()
{
   // if the enviro sensor is the main receiver or the GPS device does not
   // report temperatures, store the main temp sensor reading in the regular 
   // temperature variable/plot (GT plot).

   if(rcvr_type == THERMO_RCVR) {
      temperature = tc1;
      have_temperature = 900;
   }
   else if(have_temperature == 0) {
      temperature = tc1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x16cf07(%rip), %rax    # 0x2188d0
cmpq $0x80000, (%rax)        # imm = 0x80000
jne 0xab9f7
leaq 0x2611d7(%rip), %rax    # 0x30cbb0
movsd (%rax), %xmm0
leaq 0x261034(%rip), %rax    # 0x30ca18
movsd %xmm0, (%rax)
leaq 0x26185d(%rip), %rax    # 0x30d24c
movl $0x384, (%rax)          # imm = 0x384
jmp 0xaba19
leaq 0x26184e(%rip), %rax    # 0x30d24c
cmpl $0x0, (%rax)
jne 0xaba19
leaq 0x2611a6(%rip), %rax    # 0x30cbb0
movsd (%rax), %xmm0
leaq 0x261003(%rip), %rax    # 0x30ca18
movsd %xmm0, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: next_enviro_poll()
int next_enviro_poll()
{
int i;

   // find the next reading that we can poll for

   for(i=0; i<NUM_SENSORS; i++) { 
      if(last_enviro == 0) next_enviro = ENV_TEMP1;
      else if(next_enviro == 0) next_enviro = ENV_TEMP1;
      else next_enviro <<= 1;
      if(next_enviro & (0x0001 << NUM_SENSORS)) next_enviro = ENV_TEMP1;

      if(next_enviro & enviro_sensors) {  // the device supports this reading
         return next_enviro;
      }
   }

   next_enviro = 0;     // device has no known supported readings
   return next_enviro;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x16cefe(%rip), %rax    # 0x218924
movl (%rax), %ecx
leaq 0x16cef1(%rip), %rax    # 0x218920
movl (%rax), %esi
leaq 0x16cef0(%rip), %rdx    # 0x218928
movl (%rdx), %eax
movl $0xb, %edi
movl $0x1, %r8d
testl %ecx, %ecx
je 0xaba5c
testl %eax, %eax
je 0xaba5c
btl $0xa, %eax
leal (%rax,%rax), %eax
cmovbl %r8d, %eax
movl %eax, (%rdx)
jmp 0xaba67
movl $0x1, (%rdx)
movl $0x1, %eax
testl %eax, %esi
jne 0xaba77
decl %edi
jne 0xaba45
movl $0x0, (%rdx)
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: set_lfs_type()
int set_lfs_type()
{
   enviro_field[UNIT_LEN] = 0;
   strcpy(enviro_dev, enviro_field);
   have_info |= (MANUF_PARAMS | PRODN_PARAMS | VERSION_INFO);

   if(strstr(enviro_field, "LFS104A")) { 
      enviro_sensors = (ENV_SN | ENV_TEMP1 | ENV_TEMP2 | ENV_DP | ENV_LUX | ENV_REFALT);
      enviro_type = LFS_ENVIRO;
   }
   else if(strstr(enviro_field, "LFS104B")) {  // LFS104BW
      enviro_sensors = (ENV_SN | ENV_TEMP1 | ENV_TEMP2 | ENV_HUMID | ENV_PRESS | ENV_EMIS);
      enviro_type = LFS_ENVIRO;
   }
   else if(strstr(enviro_field, "LFS108A")) { 
      enviro_sensors = (ENV_SN | ENV_TEMP1 | ENV_RTEMP);
      enviro_type = LFS_ENVIRO;
   }
   else if(strstr(enviro_field, "LFS108B")) { 
      enviro_sensors = (ENV_SN | ENV_TEMP1 | ENV_TEMP2 | ENV_DP);
      enviro_type = LFS_ENVIRO;
   }
   else if(strstr(enviro_field, "LFS108C")) { 
      enviro_sensors = (ENV_SN | ENV_TEMP1 | ENV_TEMP2 | ENV_HUMID);
      enviro_type = LFS_ENVIRO;
   }
   else if(strstr(enviro_field, "LFS108D")) { 
      enviro_sensors = (ENV_SN | ENV_TEMP1 | ENV_TEMP2 | ENV_HUMID);
      enviro_type = LFS_ENVIRO;
   }
   else if(strstr(enviro_field, "LFS108E")) { 
      enviro_sensors = (ENV_SN | ENV_TEMP1 | ENV_COUNT);
      enviro_type = LFS_ENVIRO;
   }
   else return 0;

   return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movb $0x0, 0x2c09dc(%rip)    # 0x36c462
leaq 0x2c09c3(%rip), %rbx    # 0x36c450
leaq 0x2917cc(%rip), %rdi    # 0x33d260
movq %rbx, %rsi
callq 0x9340
leaq 0x261ed1(%rip), %rax    # 0x30d974
orb $0x7, (%rax)
leaq 0x7a81c(%rip), %rsi     # 0x1262c9
movq %rbx, %rdi
callq 0x9090
movl $0x1b3, %ebx            # imm = 0x1B3
testq %rax, %rax
jne 0xabb70
leaq 0x2c0986(%rip), %rdi    # 0x36c450
leaq 0x7a800(%rip), %rsi     # 0x1262d1
callq 0x9090
movl $0x41f, %ebx            # imm = 0x41F
testq %rax, %rax
jne 0xabb70
leaq 0x2c0965(%rip), %rdi    # 0x36c450
leaq 0x7a7e7(%rip), %rsi     # 0x1262d9
callq 0x9090
movl $0x51, %ebx
testq %rax, %rax
jne 0xabb70
leaq 0x2c0948(%rip), %rdi    # 0x36c450
leaq 0x7a7d2(%rip), %rsi     # 0x1262e1
callq 0x9090
movl $0x33, %ebx
testq %rax, %rax
jne 0xabb70
leaq 0x2c092b(%rip), %rdi    # 0x36c450
leaq 0x7a7bd(%rip), %rsi     # 0x1262e9
callq 0x9090
movl $0x17, %ebx
testq %rax, %rax
jne 0xabb70
leaq 0x2c090e(%rip), %rdi    # 0x36c450
leaq 0x7a7a8(%rip), %rsi     # 0x1262f1
callq 0x9090
testq %rax, %rax
jne 0xabb70
leaq 0x2c08f6(%rip), %rdi    # 0x36c450
leaq 0x7a798(%rip), %rsi     # 0x1262f9
callq 0x9090
movl $0x211, %ebx            # imm = 0x211
testq %rax, %rax
je 0xabb92
leaq 0x16cda9(%rip), %rax    # 0x218920
movl %ebx, (%rax)
leaq 0x16cd94(%rip), %rax    # 0x218914
movl $0x3, (%rax)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
xorl %eax, %eax
jmp 0xabb8b
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: detect_enviro_type()
void detect_enviro_type()
{
   // figure up the sensor type and what readings it can do

   enviro_sensors = ENV_TEMP1;   // assume everybody does temperature
   if(strstr(enviro_field, "$PLHEN")) {  // custom Heather BME280 + two thermistors
      enviro_sensors = (ENV_TEMP1 | ENV_TEMP2 | ENV_HUMID | ENV_PRESS);
      enviro_type = HEATHER_ENVIRO;
   }
   else if(strstr(enviro_field, "USB-")) {   // dogratian.com USB devices
      enviro_field[UNIT_LEN] = 0;
      strcpy(enviro_dev, enviro_field);
      have_info |= (MANUF_PARAMS | PRODN_PARAMS | VERSION_INFO);

      if(strstr(enviro_field, "PA")) {  // see what measurements it does
         enviro_sensors = (ENV_SN | ENV_TEMP1 | ENV_HUMID | ENV_PRESS);
         enviro_type = DOG_ENVIRO;
      }
      else if(strstr(enviro_field, "SHT")) {
         enviro_sensors = (ENV_SN | ENV_TEMP1 | ENV_HUMID);
         enviro_type = DOG_ENVIRO;
      }
      else if(strstr(enviro_field, "LM75")) {
         enviro_sensors = (ENV_SN | ENV_TEMP1);
         enviro_type = DOG_ENVIRO;
      }
   }
   else if(strstr(enviro_field, "LFS10")) {
      set_lfs_type();
   }

   next_enviro = 0;  // start the polling cycle
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x16cd7c(%rip), %r14    # 0x218920
movl $0x1, (%r14)
leaq 0x2c089e(%rip), %rdi    # 0x36c450
leaq 0x7a748(%rip), %rsi     # 0x126301
callq 0x9090
testq %rax, %rax
je 0xabbdc
movl $0xf, (%r14)
leaq 0x16cd43(%rip), %rax    # 0x218914
movl $0x2, (%rax)
jmp 0xabca4
leaq 0x2c086d(%rip), %rdi    # 0x36c450
leaq 0x7a71e(%rip), %rsi     # 0x126308
callq 0x9090
testq %rax, %rax
je 0xabc38
movb $0x0, 0x2c0867(%rip)    # 0x36c462
leaq 0x2c084e(%rip), %rbx    # 0x36c450
leaq 0x291657(%rip), %rdi    # 0x33d260
movq %rbx, %rsi
callq 0x9340
leaq 0x261d5c(%rip), %rax    # 0x30d974
orb $0x7, (%rax)
leaq 0x7a6eb(%rip), %rsi     # 0x12630d
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
je 0xabc57
movl $0x1d, (%r14)
jmp 0xabc97
leaq 0x2c0811(%rip), %rdi    # 0x36c450
leaq 0x7a6d3(%rip), %rsi     # 0x126319
callq 0x9090
testq %rax, %rax
je 0xabca4
callq 0xaba79
jmp 0xabca4
leaq 0x2c07f2(%rip), %rdi    # 0x36c450
leaq 0x7a6ab(%rip), %rsi     # 0x126310
callq 0x9090
testq %rax, %rax
je 0xabc78
movl $0x15, (%r14)
jmp 0xabc97
leaq 0x2c07d1(%rip), %rdi    # 0x36c450
leaq 0x7a68e(%rip), %rsi     # 0x126314
callq 0x9090
testq %rax, %rax
je 0xabca4
movl $0x11, (%r14)
leaq 0x16cc76(%rip), %rax    # 0x218914
movl $0x1, (%rax)
leaq 0x16cc7d(%rip), %rax    # 0x218928
movl $0x0, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: decode_heather_enviro(unsigned int, int)
void decode_heather_enviro(unsigned port, int i)
{
   // decode Heather sensor values.  No need to poll for the next readings

   enviro_type = HEATHER_ENVIRO;
   if(get_enviro_field()) {  // humidity
      parse_humidity();
   }
   if(get_enviro_field()) {  // pressure
      parse_pressure();
   }
   if(get_enviro_field()) {  // BME280 temp sensor (room temp) (not currently used)
      parse_temp0();
   }
   if(get_enviro_field()) {  // thermistor 1
      parse_temp1();
      save_temp1();
   }
   if(get_enviro_field()) {  // thermistor 2
      parse_temp2();
   }
   if(get_enviro_field()) {  // ADC channel 3
//lfs parse_adc3();
   }
   if(get_enviro_field()) {  // ADC channel 4
//lfs parse_adc4();
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x16c679(%rip), %rax    # 0x218914
movl $0x2, (%rax)
callq 0xab531
testl %eax, %eax
je 0xac2af
callq 0xab5d1
callq 0xab531
testl %eax, %eax
je 0xac2bd
callq 0xab614
callq 0xab531
testl %eax, %eax
je 0xac2cb
callq 0xab657
callq 0xab531
testl %eax, %eax
je 0xac330
callq 0xab69a
leaq 0x16c5f0(%rip), %rax    # 0x2188d0
cmpq $0x80000, (%rax)        # imm = 0x80000
jne 0xac30e
leaq 0x2608c0(%rip), %rax    # 0x30cbb0
movsd (%rax), %xmm0
leaq 0x26071d(%rip), %rax    # 0x30ca18
movsd %xmm0, (%rax)
leaq 0x260f46(%rip), %rax    # 0x30d24c
movl $0x384, (%rax)          # imm = 0x384
jmp 0xac330
leaq 0x260f37(%rip), %rax    # 0x30d24c
cmpl $0x0, (%rax)
jne 0xac330
leaq 0x26088f(%rip), %rax    # 0x30cbb0
movsd (%rax), %xmm0
leaq 0x2606ec(%rip), %rax    # 0x30ca18
movsd %xmm0, (%rax)
callq 0xab531
testl %eax, %eax
je 0xac33e
callq 0xab6dd
callq 0xab531
popq %rbp
jmp 0xab531
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: send_dac_value(double)
int send_dac_value(double val)
{
unsigned i;

   // send a value to the external DAC port
   if(dac_port_open() == 0) return 0;


   sprintf(out, "%.6f", val);
   sendout(DAC_PORT, '$', ADD_CHAR);
   for(i=0; i<strlen(out); i++) {
      sendout(DAC_PORT, out[i], ADD_CHAR);
   }
   sendout(DAC_PORT, 0x0D, ADD_CHAR);
   sendout(DAC_PORT, 0x0A, EOM);

   return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x26186a(%rip), %rax    # 0x30e2e0
xorl %ebx, %ebx
cmpl $0x0, 0x24834(%rax)
je 0xacb17
cmpl $0x0, 0x24830(%rax)
jle 0xacb17
leaq 0x28f787(%rip), %rbx    # 0x33c220
leaq 0x682c3(%rip), %rsi     # 0x114d63
movq %rbx, %rdi
movb $0x1, %al
callq 0x9060
movl $0x10, %edi
movl $0x24, %esi
xorl %edx, %edx
callq 0xbcaa
cmpb $0x0, (%rbx)
je 0xacaed
movl $0x1, %r14d
xorl %r15d, %r15d
movzbl (%rbx,%r15), %esi
movl $0x10, %edi
xorl %edx, %edx
callq 0xbcaa
movl %r14d, %r15d
movq %rbx, %rdi
callq 0x9120
incl %r14d
cmpq %r15, %rax
ja 0xacac9
movl $0x10, %edi
movl $0xd, %esi
xorl %edx, %edx
callq 0xbcaa
movl $0x1, %ebx
movl $0x10, %edi
movl $0xa, %esi
movl $0x1, %edx
callq 0xbcaa
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: get_dac_field()
int get_dac_field()
{
char c;
int i;

   // extract the next field from a ADC message.  Fields are separated by
   // spaces or tabs.  

   dac_field[0] = 0;
   if(dac_msg[dac_col] == 0) return 0;  // at end-of-message

   i = 0;
   while(dac_col < (int)sizeof(dac_msg)) {   // get next field from the ADC message
      c = dac_msg[dac_col];
      if(c == 0) {  // reached end-of-message
         break;
      }
      else if(c == ' ') {  // skip leading spaces, end field on a space
         ++dac_col;
         if(i) break;
      }
      else if(c == '\t') {  // skip leading spaces, end field on a tab
         ++dac_col;
         if(i) break;
      }
      else {        // add char to extracted field
         dac_field[i++] = c;
         dac_field[i] = 0;
         ++dac_col;
      }
   }

   return dac_field[0];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movslq 0x2bff45(%rip), %rcx    # 0x36ca74
cmpq $0x201, %rcx            # imm = 0x201
setge %sil
leaq 0x2bfb1f(%rip), %rdx    # 0x36c660
cmpb $0x0, (%rcx,%rdx)
movb $0x0, 0x2bfd24(%rip)    # 0x36c870
sete %dil
xorl %eax, %eax
orb %sil, %dil
jne 0xacbad
xorl %esi, %esi
leaq 0x2bfd10(%rip), %rax    # 0x36c870
movslq %ecx, %rdi
movzbl (%rdi,%rdx), %edi
cmpl $0x9, %edi
je 0xacb90
cmpl $0x20, %edi
je 0xacb90
testl %edi, %edi
je 0xacba6
movslq %esi, %r8
leaq 0x1(%r8), %rsi
movb %dil, (%r8,%rax)
movb $0x0, 0x1(%r8,%rax)
incl %ecx
movl %ecx, 0x2bfee6(%rip)    # 0x36ca74
jmp 0xacb9e
incl %ecx
movl %ecx, 0x2bfedc(%rip)    # 0x36ca74
testl %esi, %esi
jne 0xacba6
xorl %esi, %esi
cmpl $0x201, %ecx            # imm = 0x201
jl 0xacb60
movsbl 0x2bfcc3(%rip), %eax    # 0x36c870
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: decode_dac_msg(unsigned int)
void decode_dac_msg(unsigned port)
{
int i;
u08 c;
DATA_SIZE val;

// if(rcvr_type == DAC_RCVR) {
   if(0) {
      start_msg_decode(1);
      ++dac_packets;
   }
   else {
      ++packet_count;
      ++dac_packets;
   }

   // reset the data queues shortly after startup.  
//   if((dac_packets == DAC_RESET_THRESH) && (pause_data == 0)) {
//      new_queue(RESET_ALL_QUEUES, 103);
//   }

   dac_msg[0] = 0;
   if(port == DAC_PORT) {
      for(i=0; i<dac_wptr; i++) {  // copy message from ADC buffer to dac_msg
         c = dac_buf[i];
         dac_msg[i] = c;
         dac_msg[i+1] = 0;
      }
   }
   else {
      for(i=0; i<tsip_wptr; i++) {  // copy message from tsip buffer to dac_msg
         c = tsip_buf[i];
         dac_msg[i] = c;
         dac_msg[i+1] = 0;
      }
   }

   strupr(dac_msg);

   dac_col = 0;     // index of next char to get from DAC (actally ADC) buffer
   if(get_dac_field()) {
      if(is_numeric(dac_field)) {
         val = (DATA_SIZE) atof(dac_field);
         // !!!!!!! do something
      }
      else return;
   }

   saw_rcvr_msg = 1;
   return;
}

// Assembly:
leaq 0x1923be(%rip), %rax    # 0x23ef74
incl (%rax)
leaq 0x1923c5(%rip), %rax    # 0x23ef84
incl (%rax)
movb $0x0, 0x2bfa98(%rip)    # 0x36c660
cmpl $0x10, %edi
jne 0xacc03
leaq 0x28e6b0(%rip), %rax    # 0x33b284
movslq (%rax), %rax
testq %rax, %rax
jle 0xacc37
xorl %ecx, %ecx
leaq 0x28d69b(%rip), %rdx    # 0x33a280
leaq 0x2bfa74(%rip), %rsi    # 0x36c660
movb (%rdx,%rcx), %dil
movb %dil, (%rcx,%rsi)
movb $0x0, 0x1(%rcx,%rsi)
incq %rcx
cmpq %rcx, %rax
jne 0xacbec
jmp 0xacc37
leaq 0x28b648(%rip), %rax    # 0x338252
movzwl (%rax), %eax
testq %rax, %rax
je 0xacc37
xorl %ecx, %ecx
leaq 0x28a635(%rip), %rdx    # 0x337250
leaq 0x2bfa3e(%rip), %rsi    # 0x36c660
movb (%rdx,%rcx), %dil
movb %dil, (%rcx,%rsi)
movb $0x0, 0x1(%rcx,%rsi)
incq %rcx
cmpq %rcx, %rax
jne 0xacc22
pushq %rbp
movq %rsp, %rbp
leaq 0x2bfa1e(%rip), %rdi    # 0x36c660
callq 0x9899
movl $0x0, 0x2bfe23(%rip)    # 0x36ca74
callq 0xacb24
testl %eax, %eax
je 0xacc6a
leaq 0x2bfc0f(%rip), %rdi    # 0x36c870
callq 0x81017
testl %eax, %eax
je 0xacc77
leaq 0x19232f(%rip), %rax    # 0x23efa0
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: two_ticc_mode()
int two_ticc_mode()
{
   // returns true if there is a TICC on the main receiver port and
   // on the auxiliary TICC port.

   if((rcvr_type == TICC_RCVR) && ticc_port_open()) return 1;
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x16baf4(%rip), %rax    # 0x2188d0
cmpq $0x10000, (%rax)        # imm = 0x10000
jne 0xace10
leaq 0x1915ac(%rip), %rcx    # 0x23e398
movl $0x1, %eax
cmpq $0x0, (%rcx)
jne 0xace12
leaq 0x2614e2(%rip), %rcx    # 0x30e2e0
cmpl $0x0, 0x1e114(%rcx)
je 0xace10
cmpl $0x0, 0x1e110(%rcx)
jg 0xace12
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: get_ticc_field()
int get_ticc_field()
{
char c;
int i;

   // extract the next field from a TICC message.  Fields are separated by
   // spaces or tabs.  HP counters embed commas in numbers so we don't end
   // fields with commas.

   ticc_field[0] = 0;
   if(ticc_msg[ticc_col] == 0) return 0;  // at end-of-message

   i = 0;
   while(ticc_col < (int)sizeof(ticc_msg)) {   // get next field from the ticc message
      c = ticc_msg[ticc_col];
      if(c == 0) {  // reached end-of-message
         break;
      }
      else if(c == ' ') {  // skip leading spaces, end field on a space
         ++ticc_col;
         if(i) break;
      }
      else if(c == '\t') {  // skip leading spaces, end field on a tab
         ++ticc_col;
         if(i) break;
      }
      else {        // add char to extracted field
         ticc_field[i++] = c;
         ticc_field[i] = 0;
         ++ticc_col;
      }
   }

   return ticc_field[0];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movslq 0x2bf415(%rip), %rcx    # 0x36c234
cmpq $0x201, %rcx            # imm = 0x201
setge %sil
leaq 0x2befef(%rip), %rdx    # 0x36be20
cmpb $0x0, (%rcx,%rdx)
movb $0x0, 0x2bf1f4(%rip)    # 0x36c030
sete %dil
xorl %eax, %eax
orb %sil, %dil
jne 0xace9d
xorl %esi, %esi
leaq 0x2bf1e0(%rip), %rax    # 0x36c030
movslq %ecx, %rdi
movzbl (%rdi,%rdx), %edi
cmpl $0x9, %edi
je 0xace80
cmpl $0x20, %edi
je 0xace80
testl %edi, %edi
je 0xace96
movslq %esi, %r8
leaq 0x1(%r8), %rsi
movb %dil, (%r8,%rax)
movb $0x0, 0x1(%r8,%rax)
incl %ecx
movl %ecx, 0x2bf3b6(%rip)    # 0x36c234
jmp 0xace8e
incl %ecx
movl %ecx, 0x2bf3ac(%rip)    # 0x36c234
testl %esi, %esi
jne 0xace96
xorl %esi, %esi
cmpl $0x201, %ecx            # imm = 0x201
jl 0xace50
movsbl 0x2bf193(%rip), %eax    # 0x36c030
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: get_ticc_line(unsigned int)
int get_ticc_line(unsigned port)
{
unsigned i;
char c;
double t0;

   // get a line from the TICC menu.

   if(port >= NUM_COM_PORTS) return 1;

   i = 0;
   cfg_buf[i] = 0;
   t0 = GetMsecs();
   while(GetMsecs() < (t0 + 1000.0)) {   // !!!! we need a timeout here
      if(SERIAL_DATA_AVAILABLE(port)) {
         c = get_ticc_char();
         if(c == 0x0A) continue;
         if(c == 0x0D) return 0;
         if(i > (sizeof(cfg_buf) - 2)) break;
         cfg_buf[i++] = c;
         cfg_buf[i] = 0;
      }
   }
   return 1;
}

// Assembly:
cmpl $0x12, %edi
jbe 0xaceae
movl $0x1, %ecx
jmp 0xacf34
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
movb $0x0, 0x2c539f(%rip)    # 0x372260
callq 0xae92
addsd 0x5c16a(%rip), %xmm0    # 0x109038
movsd %xmm0, -0x20(%rbp)
xorl %r15d, %r15d
leaq 0x2c5383(%rip), %r14    # 0x372260
callq 0xae92
movsd -0x20(%rbp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0xacf25
movl %ebx, %edi
callq 0xb9ad
testl %eax, %eax
je 0xacedd
callq 0x5852c
cmpl $0xa, %eax
je 0xacedd
xorl %ecx, %ecx
cmpl $0xd, %eax
je 0xacf2a
cmpl $0x3fe, %r15d           # imm = 0x3FE
ja 0xacf25
movl %r15d, %ecx
leaq 0x1(%rcx), %r15
movb %al, (%rcx,%r14)
movb $0x0, 0x1(%rcx,%r14)
jmp 0xacedd
movl $0x1, %ecx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
movl %ecx, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: pet_data(unsigned char*, int, int)
int pet_data(unsigned char *buf, int k, int check_crlf)
{
int p;

   // returns true if data in buf starting at char k is a valid picpet reading

   if(!isdigit(buf[k+0] & 0xFF)) return 0;
   if(!isdigit(buf[k+1] & 0xFF)) return 0;
   if(buf[k+2] != '.') return 0;

   for(p=3; p<=9; p++) {
      if(isdigit(buf[k+p] & 0xFF) == 0) return 0;
   }
   if(buf[k+10] != ' ') return 0;
   if(ishex(buf[k+11]) == 0) return 0;
   if(ishex(buf[k+12]) == 0) return 0;
   if(check_crlf) {
      if(buf[k+13] != 0x0D) return 0;
      if(buf[k+14] != 0x0A) return 0;
   }
   else {
      if(buf[k+13]) return 0;
   }

   return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movslq %esi, %r12
movzbl (%rdi,%r12), %eax
addl $-0x30, %eax
xorl %ebx, %ebx
cmpl $0x9, %eax
ja 0xad019
movq %rdi, %r14
movzbl 0x1(%rdi,%r12), %eax
addl $-0x30, %eax
cmpl $0x9, %eax
ja 0xad019
cmpb $0x2e, 0x2(%r14,%r12)
jne 0xad019
movl %edx, %r15d
leaq (%r12,%r14), %rax
addq $0x3, %rax
xorl %ebx, %ebx
xorl %ecx, %ecx
movzbl (%rax,%rcx), %edx
addl $-0x3a, %edx
cmpl $-0xa, %edx
jb 0xad019
incq %rcx
cmpq $0x7, %rcx
jne 0xacfad
cmpb $0x20, 0xa(%r14,%r12)
jne 0xad019
movsbl 0xb(%r14,%r12), %edi
leal -0x30(%rdi), %eax
cmpb $0xa, %al
jb 0xacfe4
callq 0x9700
addl $-0x47, %eax
cmpl $-0x6, %eax
jb 0xad019
movsbl 0xc(%r14,%r12), %edi
leal -0x30(%rdi), %eax
cmpb $0xa, %al
jb 0xacffe
callq 0x9700
addl $-0x47, %eax
cmpl $-0x6, %eax
jb 0xad019
movb 0xd(%r14,%r12), %al
testl %r15d, %r15d
je 0xad024
cmpb $0xd, %al
jne 0xad019
cmpb $0xa, 0xe(%r14,%r12)
jne 0xad019
movl $0x1, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
testb %al, %al
jne 0xad019
jmp 0xad014
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: lars_data(char*)
int lars_data(char *buf)
{
int i;

   // returns true if data in buf looks like it comes from a Lars GPSDO

   i = 0;
   if(strstr(buf, "LARS")) i = 1;
   if(strstr(buf, "HELP+INFO")) i = 2;
   if(strstr(buf, "NO PPS")) i = 3;
   if(strstr(buf, "WARMUP")) i = 10;
   if(strstr(buf, "NOLOCK")) i = 11;
   if(strstr(buf, "LOCKED"))i = 12;
   if((i >= 10) && !strchr(buf, '\t')) return 0;
   return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x79342(%rip), %rsi     # 0x126381
callq 0x9090
xorl %r14d, %r14d
testq %rax, %rax
setne %r14b
leaq 0x79331(%rip), %rsi     # 0x126386
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
movl $0x2, %r15d
cmovel %r14d, %r15d
leaq 0x7931f(%rip), %rsi     # 0x126390
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
movl $0x3, %r14d
cmovel %r15d, %r14d
leaq 0x7869b(%rip), %rsi     # 0x125728
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
movl $0xa, %r15d
cmovel %r14d, %r15d
leaq 0x792ee(%rip), %rsi     # 0x126397
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
movl $0xb, %r12d
cmovel %r15d, %r12d
leaq 0x7bcfb(%rip), %rsi     # 0x128dc0
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
movl $0xc, %r14d
cmovel %r12d, %r14d
cmpl $0xa, %r14d
jb 0xad0f5
movq %rbx, %rdi
movl $0x9, %esi
callq 0x9100
testq %rax, %rax
jne 0xad0f5
xorl %r14d, %r14d
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: hp_time(char*)
double hp_time(char *s)
{
unsigned i, j;

   // convert an HP formatted time string to a normal number by removing
   // embedded commas.  Returns the time as a double.

   j = 0;
   for(i=0; i<strlen(s); i++) {  // remove commas
      if(s[i] != ',') {
         s[j++] = s[i];
      }
   }
   s[j] = 0;

   return atof(s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
cmpb $0x0, (%rdi)
je 0xada2f
movl $0x1, %r15d
xorl %r12d, %r12d
movb (%rbx,%r12), %al
cmpb $0x2c, %al
je 0xada19
movl %r14d, %ecx
incl %r14d
movb %al, (%rbx,%rcx)
movl %r15d, %r12d
movq %rbx, %rdi
callq 0x9120
incl %r15d
cmpq %r12, %rax
ja 0xada08
movl %r14d, %r14d
movb $0x0, (%rbx,%r14)
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x9470
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: ticc_phase(char*, int, double, double)
double ticc_phase(char *id, int ticc_mode, double val, double last_val)
{
   // convert TICC/counter readings to phase values

   if((ticc_mode == 'T') || (ticc_mode == 'D') || (ticc_mode == 'L')) { // TICC is in a timestamp mode
      if((TS_WRAP_INTERVAL != 0.0) && (timestamp_wrap == 0.0)) {   // limit time stamps to TS_WRAP_INTERVAL (100.0) seconds
         val = fmod(val, TS_WRAP_INTERVAL);
         last_val = fmod(last_val, TS_WRAP_INTERVAL);
      }

      val -= last_val;     // convert consecutive time stamps to time interval
      if(val <= 0.0) {     // time stamps wrapped, adjust the interval
         if(timestamp_wrap == 0.0) val += TS_WRAP_INTERVAL;  // !!!!! what if still negative? 
         else                      val += timestamp_wrap; //       ... looping could take forever on a bogus value
      }
   }
   else if(ticc_mode == 'P') {  // time interval between samples on same channel
   }
   else if(ticc_mode == 'H') {  // phase
   }
   else if(ticc_mode == 'I') {  // time interval between two channels
      val -= last_val;
   }
   else if(ticc_mode == 'F') {  // frequency counter
      if(nominal_cha_freq <= 0.0) nominal_cha_freq = NOMINAL_FREQ;
      val = ((val - nominal_cha_freq) / nominal_cha_freq) * pps_adev_period;
   }

   return val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
movapd %xmm0, %xmm2
leal -0x44(%rsi), %eax
cmpl $0x8, %eax
ja 0xadaab
leaq 0x721e0(%rip), %rcx     # 0x11fc40
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x25eef8(%rip), %rax    # 0x30c968
movsd (%rax), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jb 0xada93
movabsq $0x416312d000000000, %rcx # imm = 0x416312D000000000
movq %rcx, (%rax)
movsd 0x5de45(%rip), %xmm0    # 0x10b8d8
subsd %xmm0, %xmm2
divsd %xmm0, %xmm2
leaq 0x18f25e(%rip), %rax    # 0x23cd00
mulsd (%rax), %xmm2
jmp 0xadb37
cmpl $0x54, %esi
jne 0xadb37
leaq 0x25ef3d(%rip), %rbx    # 0x30c9f8
movsd (%rbx), %xmm0
xorpd %xmm3, %xmm3
ucomisd %xmm3, %xmm0
jne 0xadb09
jp 0xadb09
movsd 0x5b58d(%rip), %xmm3    # 0x109060
movapd %xmm2, %xmm0
movsd %xmm1, -0x18(%rbp)
movapd %xmm3, %xmm1
callq 0x94d0
movsd %xmm0, -0x10(%rbp)
movsd -0x18(%rbp), %xmm0
movsd 0x5b569(%rip), %xmm1    # 0x109060
callq 0x94d0
xorpd %xmm3, %xmm3
movsd -0x10(%rbp), %xmm2
movapd %xmm0, %xmm1
subsd %xmm1, %xmm2
ucomisd %xmm2, %xmm3
jb 0xadb37
movsd (%rbx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xadb33
jp 0xadb33
addsd 0x5b535(%rip), %xmm2    # 0x109060
jmp 0xadb37
subsd %xmm1, %xmm2
jmp 0xadb37
addsd %xmm0, %xmm2
movapd %xmm2, %xmm0
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: send_track_port()
void send_track_port()
{
int i, j;

   // send message "out" to the TRACK_PORT

   j = strlen(out);
   for(i=0; i<j; i++) {
      sendout(TRACK_PORT, (u08) out[i], ADD_CHAR);
   }
   sendout(TRACK_PORT, 0x0D, ADD_CHAR);
   sendout(TRACK_PORT, 0x0A, ADD_CHAR);
   sendout(TRACK_PORT, 0, FLUSH_COM);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x28e291(%rip), %rbx    # 0x33c220
movq %rbx, %rdi
callq 0x9120
movq %rax, %r14
testl %r14d, %r14d
jle 0xadfc2
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
xorl %r15d, %r15d
movzbl (%rbx,%r15), %esi
movl $0x12, %edi
xorl %edx, %edx
callq 0xbcaa
incq %r15
cmpq %r15, %r14
jne 0xadfa9
movl $0x12, %edi
movl $0xd, %esi
xorl %edx, %edx
callq 0xbcaa
movl $0x12, %edi
movl $0xa, %esi
xorl %edx, %edx
callq 0xbcaa
movl $0x12, %edi
xorl %esi, %esi
movl $0x2, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xbcaa