LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: show_precise_info(int)
void show_precise_info(int flag)
{
int i;
double xlat,xlon,xalt;

   if(debug_lla) {
      for(i=flag; i<hour_lats; i++) {
         xlat = lat_hr_bins[i];
         xlon = lon_hr_bins[i];
         xalt = alt_hr_bins[i];

         xlat *= RAD_TO_DEG;
         xlon *= RAD_TO_DEG;
         if(lla_file) {
            fprintf(lla_file, "#\n");
            fprintf(lla_file, "# Hour %2d: lat:%14.9f  %.9f\n",  i+1, xlat, (xlat-LAT_REF)/ANGLE_SCALE);
            fprintf(lla_file, "# Hour %2d: lon:%14.9f  %.9f\n",  i+1, xlon, (xlon-LON_REF)/ANGLE_SCALE*COS_FACTOR(xlat));
            fprintf(lla_file, "# Hour %2d: alt:%14.9f  %.9f\n",  i+1, xalt, (xalt-ALT_REF)*FEET_PER_METER);
            fprintf(lla_file, "#\n");
         }
      }
   }
}

// Assembly:
cmpb $0x0, 0x7455c(%rip)     # 0x170c40
je 0xfc898
cmpl %edi, 0x27d690(%rip)    # 0x379d80
jle 0xfc898
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movslq %edi, %r12
leal 0x1(%r12), %ebx
leaq (,%r12,8), %r13
leaq 0x141c82(%rip), %r14    # 0x23e3a0
movq (%r14), %rcx
testq %rcx, %rcx
je 0xfc871
leaq 0x27d96f(%rip), %rax    # 0x37a0a0
movsd (%r13,%rax), %xmm1
movsd 0xca18(%rip), %xmm0     # 0x109158
mulsd %xmm0, %xmm1
movsd %xmm1, -0x38(%rbp)
leaq 0x27d640(%rip), %rax    # 0x379d90
movsd (%r13,%rax), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, -0x30(%rbp)
leaq 0x3574f9(%rip), %rax    # 0x453c60
movsd (%r13,%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movl $0x2, %esi
movl $0x1, %edx
leaq 0x350f9(%rip), %rdi     # 0x13187d
callq 0x9750
movq (%r14), %rdi
leaq 0x23eb5d(%rip), %rax    # 0x33b2f0
movsd (%rax), %xmm2
mulsd 0xc9b9(%rip), %xmm2     # 0x109158
movsd -0x30(%rbp), %xmm0
movapd %xmm0, %xmm1
subsd %xmm2, %xmm1
leaq 0x210805(%rip), %rax    # 0x30cfb8
divsd (%rax), %xmm1
leaq 0x38f82(%rip), %rsi     # 0x135740
movl %ebx, %edx
movb $0x2, %al
callq 0x9560
movq (%r14), %r15
leaq 0x23eb27(%rip), %rax    # 0x33b2f8
movsd (%rax), %xmm0
movsd 0xc97b(%rip), %xmm1     # 0x109158
mulsd %xmm1, %xmm0
movsd -0x38(%rbp), %xmm2
subsd %xmm0, %xmm2
leaq 0x2107c7(%rip), %rax    # 0x30cfb8
divsd (%rax), %xmm2
movsd %xmm2, -0x40(%rbp)
movsd -0x30(%rbp), %xmm0
divsd %xmm1, %xmm0
callq 0x9710
movsd -0x40(%rbp), %xmm1
mulsd %xmm0, %xmm1
movq %r15, %rdi
leaq 0x38f43(%rip), %rsi     # 0x13575e
movl %ebx, %edx
movsd -0x38(%rbp), %xmm0
movb $0x2, %al
callq 0x9560
movq (%r14), %rdi
movsd -0x48(%rbp), %xmm0
movapd %xmm0, %xmm1
leaq 0x23eac4(%rip), %rax    # 0x33b300
subsd (%rax), %xmm1
mulsd 0xf050(%rip), %xmm1     # 0x10b898
leaq 0x38f2d(%rip), %rsi     # 0x13577c
movl %ebx, %edx
movb $0x2, %al
callq 0x9560
movq (%r14), %rcx
movl $0x2, %esi
movl $0x1, %edx
leaq 0x35011(%rip), %rdi     # 0x13187d
callq 0x9750
incq %r12
movslq 0x27d505(%rip), %rax    # 0x379d80
incl %ebx
addq $0x8, %r13
cmpq %rax, %r12
jl 0xfc71e
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: update_precise_survey()
void update_precise_survey()
{
int color;
int plotted;
int i;

   plotted = 0;
   color = precision_samples / (60L*60L);
   color %= 12;

   if(precision_survey || check_precise_posn || show_fixes) {  // plot the points
      if((gps_status == GPS_FIXES) && plot_lla) {  // plot data
         plot_lla_point(1, color+3);
         plotted = 1;
      }
   }
   if(plotted == 0) { // just add point to lla map buffer
      plot_lla_point(0, color+3);
   }

   if(precision_survey) {
      i = add_survey_point();
      if(i) {                      // precision survey has completed
         stop_precision_survey(1); // stop doing the precison survey
         analyze_hours();          // analyze the hourly data
         calc_precise_lla();       // figure up where we are
      }
   }
   else {
      if(show_fixes) ++precision_samples;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x23db01(%rip), %rbx    # 0x33b2e4
movl (%rbx), %eax
movl $0x91a2b3c5, %esi       # imm = 0x91A2B3C5
imulq %rax, %rsi
shrq $0x2b, %rsi
imulq $0x15555556, %rsi, %rax # imm = 0x15555556
shrq $0x20, %rax
shll $0x2, %eax
leal (%rax,%rax,2), %eax
subl %eax, %esi
leaq 0x21068c(%rip), %r15    # 0x30de98
cmpb $0x0, (%r15)
leaq 0x23dabd(%rip), %r14    # 0x33b2d4
jne 0xfd82f
leaq 0x23dac0(%rip), %rax    # 0x33b2e0
cmpb $0x0, (%rax)
jne 0xfd82f
cmpb $0x0, (%r14)
jne 0xfd82f
xorl %edi, %edi
jmp 0xfd84c
leaq 0x20fc66(%rip), %rax    # 0x30d49c
cmpl $0x0, (%rax)
jne 0xfd82b
leaq 0x23da6e(%rip), %rax    # 0x33b2b0
movl $0x1, %edi
cmpb $0x0, (%rax)
je 0xfd82b
addl $0x3, %esi
callq 0xdafbe
cmpb $0x0, (%r15)
je 0xfd881
callq 0xfd597
testl %eax, %eax
je 0xfd889
movl $0x1, %edi
callq 0xfaae1
callq 0xfc899
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xfc0b3
cmpb $0x0, (%r14)
je 0xfd889
incl (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: free_mtie_data(int)
void free_mtie_data(int id)
{
int i;

   if(id < 0) return;
   if(id > MAX_MTIE_CHANS) return;
   if(mtie_taus[id] == 0) return;

   for(i=0; i<mtie_kmax; i++) {
      if(mtie_taus[id][i].vals) {
         if(mtie_taus[id][i].vals->min_vals) free(mtie_taus[id][i].vals->min_vals);
         if(mtie_taus[id][i].vals->max_vals) free(mtie_taus[id][i].vals->max_vals);
      }
   }

   for(i=0; i<mtie_kmax; i++) {
      if(mtie_taus[id][i].vals) {
         free(mtie_taus[id][i].vals);
      }
   }

   free(mtie_taus[id]);
   mtie_taus[id] = 0;

   if(mtie_buf[id]) {
      free(mtie_buf[id]);
      mtie_buf[id] = 0;
   }

   mtie_q_count[id] = 0;
   mtie_q_in = mtie_q_out = 0;
}

// Assembly:
cmpl $0x4, %edi
ja 0xfd983
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x357c00(%rip), %r14    # 0x4554b0
cmpq $0x0, (%r14,%rbx,8)
je 0xfd979
cmpl $0x0, 0x357c12(%rip)    # 0x4554d4
jle 0xfd906
xorl %r15d, %r15d
movq (%r14,%rbx,8), %rax
movq (%rax,%r15,8), %rax
testq %rax, %rax
je 0xfd8f7
movq (%rax), %rdi
testq %rdi, %rdi
je 0xfd8e1
callq 0x9440
movq (%r14,%rbx,8), %rax
movq (%rax,%r15,8), %rax
movq 0x8(%rax), %rdi
testq %rdi, %rdi
je 0xfd8f7
callq 0x9440
incq %r15
movslq 0x357bd3(%rip), %rax    # 0x4554d4
cmpq %rax, %r15
jl 0xfd8c7
cmpl $0x0, 0x357bc7(%rip)    # 0x4554d4
jle 0xfd933
xorl %r15d, %r15d
movq (%r14,%rbx,8), %rax
movq (%rax,%r15,8), %rdi
testq %rdi, %rdi
je 0xfd924
callq 0x9440
incq %r15
movslq 0x357ba6(%rip), %rax    # 0x4554d4
cmpq %rax, %r15
jl 0xfd912
movq (%r14,%rbx,8), %rdi
callq 0x9440
movq $0x0, (%r14,%rbx,8)
leaq 0x357485(%rip), %r14    # 0x454dd0
movq (%r14,%rbx,8), %rdi
testq %rdi, %rdi
je 0xfd961
callq 0x9440
movq $0x0, (%r14,%rbx,8)
leaq 0x357488(%rip), %rax    # 0x454df0
xorl %ecx, %ecx
movl %ecx, (%rax,%rbx,4)
movl %ecx, 0x357b69(%rip)    # 0x4554dc
movl %ecx, 0x357b5f(%rip)    # 0x4554d8
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: free_mtie()
void free_mtie()
{
   free_mtie_data(CHA_MTIE);
   free_mtie_data(CHB_MTIE);
   free_mtie_data(CHC_MTIE);
   free_mtie_data(CHD_MTIE);
   mtie_allocated = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %edi, %edi
callq 0xfd894
movl $0x1, %edi
callq 0xfd894
movl $0x2, %edi
callq 0xfd894
movl $0x3, %edi
callq 0xfd894
leaq 0x13f031(%rip), %rax    # 0x23cce4
movl $0x0, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: save_mtie_phase(int, double)
void save_mtie_phase(int id, double val)
{
   // put a value into the MTIE data buffer

   if(id < 0) return;
   if(id > MAX_MTIE_CHANS) return;
   if(mtie_q_count[id] >= max_mtie_samples) return;

   mtie_buf[id][mtie_q_count[id]] = val;
   ++mtie_q_count[id];
}

// Assembly:
cmpl $0x4, %edi
ja 0xfdd1d
movl %edi, %eax
leaq 0x3570f9(%rip), %rcx    # 0x454df0
movslq (%rcx,%rax,4), %rdx
cmpl 0x3577cf(%rip), %edx    # 0x4554d0
jge 0xfdd1d
pushq %rbp
movq %rsp, %rbp
leaq 0x3570c2(%rip), %rsi    # 0x454dd0
movq (%rsi,%rax,8), %rsi
movsd %xmm0, (%rsi,%rdx,8)
incl %edx
movl %edx, (%rcx,%rax,4)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: scan_mtie_bins(int)
void scan_mtie_bins(int id)
{
int i;
double val;

   // find min/max values in the MTIE data

   if(id < 0) return;
   if(id > MAX_MTIE_CHANS) return;

   for(i=first_show_bin; i<32; i++) {  // !!!!! should start at
      if(mtie[id][i] == (-BIG_NUM)) continue;
      val = (mtie[id][i] / 1.0E9);

      if(val > global_adev_max) global_adev_max = val;
      if(val < global_adev_min) global_adev_min = val;
   }
}

// Assembly:
cmpl $0x4, %edi
ja 0xfe168
pushq %rbp
movq %rsp, %rbp
leaq 0x13ebaa(%rip), %rax    # 0x23cc80
movslq (%rax), %rax
cmpq $0x1f, %rax
jg 0xfe167
leaq 0x13ea06(%rip), %rcx    # 0x23caf0
movsd (%rcx), %xmm3
leaq 0x13e9f3(%rip), %rdx    # 0x23cae8
movsd (%rdx), %xmm0
movl %edi, %esi
imulq $0x328, %rsi, %rsi      # imm = 0x328
leaq (%rsi,%rax,8), %rdi
leaq 0x356023(%rip), %rsi    # 0x454130
addq %rdi, %rsi
incq %rax
movsd 0x2e56d(%rip), %xmm1    # 0x12c688
movsd 0xaf05(%rip), %xmm2     # 0x109028
movsd (%rsi), %xmm4
ucomisd %xmm1, %xmm4
jne 0xfe12f
jnp 0xfe14d
divsd %xmm2, %xmm4
ucomisd %xmm0, %xmm4
jbe 0xfe141
movsd %xmm4, (%rdx)
movapd %xmm4, %xmm0
ucomisd %xmm4, %xmm3
jbe 0xfe14d
movsd %xmm4, (%rcx)
jmp 0xfe151
movapd %xmm3, %xmm4
addq $0x8, %rsi
movq %rax, %rdi
incq %rdi
movapd %xmm4, %xmm3
cmpl $0x20, %eax
movq %rdi, %rax
jne 0xfe123
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: calc_adev_display_size()
void calc_adev_display_size()
{
   adev_bottom_row  = PLOT_TEXT_ROW - 1;
   adev_bottom_row -= (TEXT_Y_MARGIN+TEXT_HEIGHT-1)/TEXT_HEIGHT;
   if(extra_plots) adev_bottom_row -= 2;
   if(all_adevs && (adev_bottom_row >= MOUSE_ROW+1)) adev_bottom_row = MOUSE_ROW+1; // mmmmmm 

   if(all_adevs) adev_bottom_row = MOUSE_ROW+1;
   else          adev_bottom_row = MOUSE_ROW+2+1;  // mmmmmm
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x11a71c(%rip), %rsi    # 0x218890
leaq 0x11a63d(%rip), %rcx    # 0x2187b8
leaq 0x11a692(%rip), %rax    # 0x218814
movl (%rax), %edi
leal -0x1(,%rdi,2), %eax
cltd
idivl %edi
notl %eax
addl (%rsi), %eax
movl %eax, (%rcx)
leaq 0x241bb9(%rip), %rdx    # 0x33fd54
cmpl $0x0, (%rdx)
je 0xfe1a5
addl $-0x2, %eax
movl %eax, (%rcx)
leaq 0x13eb92(%rip), %rax    # 0x23cd3e
cmpb $0x0, (%rax)
je 0xfe1c9
leaq 0x11a5f0(%rip), %rax    # 0x2187a8
movl (%rax), %edx
movl $0x1, %eax
cmpl %edx, (%rcx)
jle 0xfe1ce
incl %edx
movl %edx, (%rcx)
jmp 0xfe1ce
movl $0x3, %eax
leaq 0x11a5d3(%rip), %rdx    # 0x2187a8
addl (%rdx), %eax
movl %eax, (%rcx)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: reset_incr_bins(BIN*, double)
void reset_incr_bins(struct BIN *bins, double period)
{
int b;
S32 m;
struct BIN *B;

   if(bins == 0) return;

   m = 1L;
   for(b=0; b<MAX_ADEV_BINS; b++) {  // flush adev bin data
      B = &bins[b];
      if(B == 0) continue;

      B->m     = m;
      B->n     = 0;
      B->sum   = 0.0;
      B->value = 0.0;
      B->tau   = ((double) m) * period;
      B->accum = 0.0;
      B->i     = 0;
      B->j     = 0;
      B->init  = 0;

      m = next_tau(m, bin_scale);
   }
}

// Assembly:
testq %rdi, %rdi
je 0xfe423
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl $0x1, %eax
movl $0x20, %r14d
xorl %r15d, %r15d
leaq 0x13e8ba(%rip), %r12    # 0x23cc7c
movsd %xmm0, -0x28(%rbp)
movl %eax, -0x20(%rbx,%r14)
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
mulsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
movupd %xmm0, -0x1c(%rbx,%r14)
movl %r15d, -0xc(%rbx,%r14)
movsd %xmm1, -0x8(%rbx,%r14)
movslq %eax, %rdi
movupd %xmm0, (%rbx,%r14)
movl %r15d, 0x10(%rbx,%r14)
movl (%r12), %esi
callq 0xfe1db
movsd -0x28(%rbp), %xmm0
addq $0x38, %r14
cmpq $0x1600, %r14           # imm = 0x1600
jne 0xfe3c7
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: reset_pps_bins()
void reset_pps_bins()
{
   pps_adev_q_overflow = 0.0;
   reset_incr_bins(&pps_adev_bins[0], pps_adev_period);
   reset_incr_bins(&pps_hdev_bins[0], pps_adev_period);
   reset_incr_bins(&pps_mdev_bins[0], pps_adev_period);
   reset_incr_bins(&pps_tdev_bins[0], pps_adev_period);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x13e70f(%rip), %rax    # 0x23cb40
movq $0x0, (%rax)
leaq 0x13e8c1(%rip), %rbx    # 0x23cd00
movsd (%rbx), %xmm0
leaq 0x1284a6(%rip), %rdi    # 0x2268f0
callq 0xfe392
movsd (%rbx), %xmm0
leaq 0x129ab6(%rip), %rdi    # 0x227f10
callq 0xfe392
movsd (%rbx), %xmm0
leaq 0x12b0c6(%rip), %rdi    # 0x229530
callq 0xfe392
movsd (%rbx), %xmm0
leaq 0x12c6d6(%rip), %rdi    # 0x22ab50
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xfe392
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: reset_osc_bins()
void reset_osc_bins()
{
   osc_adev_q_overflow = 0.0;
   reset_incr_bins(&osc_adev_bins[0], osc_adev_period);
   reset_incr_bins(&osc_hdev_bins[0], osc_adev_period);
   reset_incr_bins(&osc_mdev_bins[0], osc_adev_period);
   reset_incr_bins(&osc_tdev_bins[0], osc_adev_period);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x13e6fe(%rip), %rax    # 0x23cb90
movq $0x0, (%rax)
leaq 0x13e868(%rip), %rbx    # 0x23cd08
movsd (%rbx), %xmm0
leaq 0x131f25(%rip), %rdi    # 0x2303d0
callq 0xfe392
movsd (%rbx), %xmm0
leaq 0x12dcb5(%rip), %rdi    # 0x22c170
callq 0xfe392
movsd (%rbx), %xmm0
leaq 0x12f2c5(%rip), %rdi    # 0x22d790
callq 0xfe392
movsd (%rbx), %xmm0
leaq 0x1308d5(%rip), %rdi    # 0x22edb0
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xfe392
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: reset_chc_bins()
void reset_chc_bins()
{
   chc_adev_q_overflow = 0.0;
   reset_incr_bins(&chc_adev_bins[0], chc_adev_period);
   reset_incr_bins(&chc_hdev_bins[0], chc_adev_period);
   reset_incr_bins(&chc_mdev_bins[0], chc_adev_period);
   reset_incr_bins(&chc_tdev_bins[0], chc_adev_period);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x13e6ed(%rip), %rax    # 0x23cbe0
movq $0x0, (%rax)
leaq 0x13e80f(%rip), %rbx    # 0x23cd10
movsd (%rbx), %xmm0
leaq 0x1334e4(%rip), %rdi    # 0x2319f0
callq 0xfe392
movsd (%rbx), %xmm0
leaq 0x134af4(%rip), %rdi    # 0x233010
callq 0xfe392
movsd (%rbx), %xmm0
leaq 0x136104(%rip), %rdi    # 0x234630
callq 0xfe392
movsd (%rbx), %xmm0
leaq 0x137714(%rip), %rdi    # 0x235c50
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xfe392
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: reset_chd_bins()
void reset_chd_bins()
{
   chd_adev_q_overflow = 0.0;
   reset_incr_bins(&chd_adev_bins[0], chd_adev_period);
   reset_incr_bins(&chd_hdev_bins[0], chd_adev_period);
   reset_incr_bins(&chd_mdev_bins[0], chd_adev_period);
   reset_incr_bins(&chd_tdev_bins[0], chd_adev_period);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x13e6dc(%rip), %rax    # 0x23cc30
movq $0x0, (%rax)
leaq 0x13e7b6(%rip), %rbx    # 0x23cd18
movsd (%rbx), %xmm0
leaq 0x138d03(%rip), %rdi    # 0x237270
callq 0xfe392
movsd (%rbx), %xmm0
leaq 0x13a313(%rip), %rdi    # 0x238890
callq 0xfe392
movsd (%rbx), %xmm0
leaq 0x13b923(%rip), %rdi    # 0x239eb0
callq 0xfe392
movsd (%rbx), %xmm0
leaq 0x13cf33(%rip), %rdi    # 0x23b4d0
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xfe392
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: adev_decade(float)
float adev_decade(float val)
{
float decade;

    // convert an ADEV value to the decade it is in
    for(decade=1.0F; decade>=1.0E-19F; decade/=10.0F) {
       if(val > decade) break;
    }
    return decade*10.0F;
}

// Assembly:
ucomiss 0xe8be(%rip), %xmm0     # 0x10cfd4
jbe 0xfe721
movss 0xe8c0(%rip), %xmm0     # 0x10cfe0
retq
movaps %xmm0, %xmm1
movss 0xe8a8(%rip), %xmm0     # 0x10cfd4
movss 0xe8ac(%rip), %xmm2     # 0x10cfe0
movss 0x2dfe8(%rip), %xmm3    # 0x12c724
divss %xmm2, %xmm0
ucomiss %xmm3, %xmm0
jb 0xfe74a
ucomiss %xmm0, %xmm1
jbe 0xfe73c
pushq %rbp
movq %rsp, %rbp
mulss 0xe88a(%rip), %xmm0     # 0x10cfe0
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: adev_mouse()
void adev_mouse()
{
u08 old_disable_kbd;

// return;    // this routine breaks "keep_adevs_fresh"  unless timer_serve is set when calling get_mouse_info()

   // keep mouse lively during long periods of thinking
   if((++adev_mouse_time & 0xFFFF) != 0x0000) return;

   update_pwm();
   if(mouse_shown == 0) return;

   old_disable_kbd = disable_kbd;
   if(kbd_flag) disable_kbd = 2; // (so that do_kbd() won't do anything when it's called by WM_CHAR during get_pending_gps())

   ++timer_serve;
   get_mouse_info();
   --timer_serve;

   disable_kbd = old_disable_kbd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x13dde7(%rip), %rax    # 0x23ccb8
movl (%rax), %ecx
incl %ecx
movl %ecx, (%rax)
testw %cx, %cx
jne 0xfef1b
callq 0xd1865
leaq 0x11c355(%rip), %rax    # 0x21b23d
cmpb $0x0, (%rax)
je 0xfef1b
leaq 0x11c328(%rip), %rbx    # 0x21b21c
movb (%rbx), %r14b
leaq 0x11c31f(%rip), %rax    # 0x21b21d
cmpb $0x0, (%rax)
je 0xfef06
movb $0x2, (%rbx)
leaq 0x11c30b(%rip), %r15    # 0x21b218
incl (%r15)
callq 0x1c406
decl (%r15)
movb %r14b, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: do_incr_pps_adevs()
void do_incr_pps_adevs()
{
   // update each of the PPS adev bins with the latest queue data
   incr_adev(PPS_ADEV, &pps_adev_bins[0]);
   incr_hdev(PPS_HDEV, &pps_hdev_bins[0]);
   incr_mdev(PPS_MDEV, &pps_mdev_bins[0]);
   incr_tdev(PPS_TDEV, &pps_tdev_bins[0]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x1279bf(%rip), %rsi    # 0x2268f0
movl $0x5, %edi
callq 0xfef6f
leaq 0x128fce(%rip), %rsi    # 0x227f10
movl $0x6, %edi
callq 0xff165
leaq 0x12a5dd(%rip), %rsi    # 0x229530
movl $0x7, %edi
callq 0xff3a0
leaq 0x12bbec(%rip), %rsi    # 0x22ab50
movl $0x8, %edi
popq %rbp
jmp 0xff6a5
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: do_incr_osc_adevs()
void do_incr_osc_adevs()
{
   // update each of the OSC adev bins with the latest queue data
   incr_adev(OSC_ADEV, &osc_adev_bins[0]);
   incr_hdev(OSC_HDEV, &osc_hdev_bins[0]);
   incr_mdev(OSC_MDEV, &osc_mdev_bins[0]);
   incr_tdev(OSC_TDEV, &osc_tdev_bins[0]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x130a0d(%rip), %rsi    # 0x2303d0
xorl %edi, %edi
callq 0xfef6f
leaq 0x12c79f(%rip), %rsi    # 0x22c170
movl $0x1, %edi
callq 0xff165
leaq 0x12ddae(%rip), %rsi    # 0x22d790
movl $0x2, %edi
callq 0xff3a0
leaq 0x12f3bd(%rip), %rsi    # 0x22edb0
movl $0x3, %edi
popq %rbp
jmp 0xff6a5
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: do_incr_chc_adevs()
void do_incr_chc_adevs()
{
   // update each of the CHC adev bins with the latest queue data
   incr_adev(CHC_ADEV, &chc_adev_bins[0]);
   incr_hdev(CHC_HDEV, &chc_hdev_bins[0]);
   incr_mdev(CHC_MDEV, &chc_mdev_bins[0]);
   incr_tdev(CHC_TDEV, &chc_tdev_bins[0]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x131fe7(%rip), %rsi    # 0x2319f0
movl $0xa, %edi
callq 0xfef6f
leaq 0x1335f6(%rip), %rsi    # 0x233010
movl $0xb, %edi
callq 0xff165
leaq 0x134c05(%rip), %rsi    # 0x234630
movl $0xc, %edi
callq 0xff3a0
leaq 0x136214(%rip), %rsi    # 0x235c50
movl $0xd, %edi
popq %rbp
jmp 0xff6a5
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: do_incr_chd_adevs()
void do_incr_chd_adevs()
{
   // update each of the CHD adev bins with the latest queue data
   incr_adev(CHD_ADEV, &chd_adev_bins[0]);
   incr_hdev(CHD_HDEV, &chd_hdev_bins[0]);
   incr_mdev(CHD_MDEV, &chd_mdev_bins[0]);
   incr_tdev(CHD_TDEV, &chd_tdev_bins[0]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x13781e(%rip), %rsi    # 0x237270
movl $0xf, %edi
callq 0xfef6f
leaq 0x138e2d(%rip), %rsi    # 0x238890
movl $0x10, %edi
callq 0xff165
leaq 0x13a43c(%rip), %rsi    # 0x239eb0
movl $0x11, %edi
callq 0xff3a0
leaq 0x13ba4b(%rip), %rsi    # 0x23b4d0
movl $0x12, %edi
popq %rbp
jmp 0xff6a5
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: incr_pps_overflow()
void incr_pps_overflow()
{
int b;

   // tweek bin data counts when the PPS/chA adev queue is full
   pps_adev_q_overflow += 1.0;

   for(b=0; b<n_bins; b++) {  
      pps_adev_bins[b].n--; 
      pps_adev_bins[b].j--;
      pps_hdev_bins[b].n--;
      pps_hdev_bins[b].j--;
      pps_mdev_bins[b].n--;
      pps_mdev_bins[b].j--;
      pps_tdev_bins[b].n--;
      pps_tdev_bins[b].j--;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x13d070(%rip), %rax    # 0x23cb40
movsd (%rax), %xmm0
addsd 0x9594(%rip), %xmm0     # 0x109070
movsd %xmm0, (%rax)
leaq 0x13d1d9(%rip), %rax    # 0x23ccc0
movslq (%rax), %rax
testq %rax, %rax
jle 0xffb3c
imulq $0x38, %rax, %rax
xorl %ecx, %ecx
leaq 0x126df4(%rip), %rdx    # 0x2268f0
leaq 0x12840d(%rip), %rsi    # 0x227f10
leaq 0x129a26(%rip), %rdi    # 0x229530
leaq 0x12b03f(%rip), %r8     # 0x22ab50
decl 0x4(%rdx,%rcx)
decl 0x2c(%rdx,%rcx)
decl 0x4(%rsi,%rcx)
decl 0x2c(%rsi,%rcx)
decl 0x4(%rdi,%rcx)
decl 0x2c(%rdi,%rcx)
decl 0x4(%r8,%rcx)
decl 0x2c(%r8,%rcx)
addq $0x38, %rcx
cmpq %rcx, %rax
jne 0xffb11
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: incr_osc_overflow()
void incr_osc_overflow()
{
int b;

   // tweek bin data counts when the OSC/chB adev queue is full
   osc_adev_q_overflow += 1.0;

   for(b=0; b<n_bins; b++) {  
      osc_adev_bins[b].n--;
      osc_adev_bins[b].j--;
      osc_hdev_bins[b].n--;
      osc_hdev_bins[b].j--;
      osc_mdev_bins[b].n--;
      osc_mdev_bins[b].j--;
      osc_tdev_bins[b].n--;
      osc_tdev_bins[b].j--;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x13d047(%rip), %rax    # 0x23cb90
movsd (%rax), %xmm0
addsd 0x951b(%rip), %xmm0     # 0x109070
movsd %xmm0, (%rax)
leaq 0x13d160(%rip), %rax    # 0x23ccc0
movslq (%rax), %rax
testq %rax, %rax
jle 0xffbb5
imulq $0x38, %rax, %rax
xorl %ecx, %ecx
leaq 0x13085b(%rip), %rdx    # 0x2303d0
leaq 0x12c5f4(%rip), %rsi    # 0x22c170
leaq 0x12dc0d(%rip), %rdi    # 0x22d790
leaq 0x12f226(%rip), %r8     # 0x22edb0
decl 0x4(%rdx,%rcx)
decl 0x2c(%rdx,%rcx)
decl 0x4(%rsi,%rcx)
decl 0x2c(%rsi,%rcx)
decl 0x4(%rdi,%rcx)
decl 0x2c(%rdi,%rcx)
decl 0x4(%r8,%rcx)
decl 0x2c(%r8,%rcx)
addq $0x38, %rcx
cmpq %rcx, %rax
jne 0xffb8a
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: incr_chc_overflow()
void incr_chc_overflow()
{
int b;

   // tweek bin data counts when the chC adev queue is full
   chc_adev_q_overflow += 1.0;

   for(b=0; b<n_bins; b++) {  
      chc_adev_bins[b].n--;
      chc_adev_bins[b].j--;
      chc_hdev_bins[b].n--;
      chc_hdev_bins[b].j--;
      chc_mdev_bins[b].n--;
      chc_mdev_bins[b].j--;
      chc_tdev_bins[b].n--;
      chc_tdev_bins[b].j--;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x13d01e(%rip), %rax    # 0x23cbe0
movsd (%rax), %xmm0
addsd 0x94a2(%rip), %xmm0     # 0x109070
movsd %xmm0, (%rax)
leaq 0x13d0e7(%rip), %rax    # 0x23ccc0
movslq (%rax), %rax
testq %rax, %rax
jle 0xffc2e
imulq $0x38, %rax, %rax
xorl %ecx, %ecx
leaq 0x131e02(%rip), %rdx    # 0x2319f0
leaq 0x13341b(%rip), %rsi    # 0x233010
leaq 0x134a34(%rip), %rdi    # 0x234630
leaq 0x13604d(%rip), %r8     # 0x235c50
decl 0x4(%rdx,%rcx)
decl 0x2c(%rdx,%rcx)
decl 0x4(%rsi,%rcx)
decl 0x2c(%rsi,%rcx)
decl 0x4(%rdi,%rcx)
decl 0x2c(%rdi,%rcx)
decl 0x4(%r8,%rcx)
decl 0x2c(%r8,%rcx)
addq $0x38, %rcx
cmpq %rcx, %rax
jne 0xffc03
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: incr_chd_overflow()
void incr_chd_overflow()
{
int b;

   // tweek bin data counts when the chD adev queue is full
   chd_adev_q_overflow += 1.0;

   for(b=0; b<n_bins; b++) {  
      chd_adev_bins[b].n--;
      chd_adev_bins[b].j--;
      chd_hdev_bins[b].n--;
      chd_hdev_bins[b].j--;
      chd_mdev_bins[b].n--;
      chd_mdev_bins[b].j--;
      chd_tdev_bins[b].n--;
      chd_tdev_bins[b].j--;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x13cff5(%rip), %rax    # 0x23cc30
movsd (%rax), %xmm0
addsd 0x9429(%rip), %xmm0     # 0x109070
movsd %xmm0, (%rax)
leaq 0x13d06e(%rip), %rax    # 0x23ccc0
movslq (%rax), %rax
testq %rax, %rax
jle 0xffca7
imulq $0x38, %rax, %rax
xorl %ecx, %ecx
leaq 0x137609(%rip), %rdx    # 0x237270
leaq 0x138c22(%rip), %rsi    # 0x238890
leaq 0x13a23b(%rip), %rdi    # 0x239eb0
leaq 0x13b854(%rip), %r8     # 0x23b4d0
decl 0x4(%rdx,%rcx)
decl 0x2c(%rdx,%rcx)
decl 0x4(%rsi,%rcx)
decl 0x2c(%rsi,%rcx)
decl 0x4(%rdi,%rcx)
decl 0x2c(%rdi,%rcx)
decl 0x4(%r8,%rcx)
decl 0x2c(%r8,%rcx)
addq $0x38, %rcx
cmpq %rcx, %rax
jne 0xffc7c
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: calc_resids(int, double, double)
void calc_resids(int plot, double resid_val, double period)
{
double x,y;

   if(plot < 0) return;
   if(plot >= (NUM_PLOTS+DERIVED_PLOTS)) return;

   resid[plot].resid_count += 1.0;
   y = resid_val;
   x = resid[plot].resid_count * period;

   resid[plot].sum_x  += x;
   resid[plot].sum_y  += y;
   resid[plot].sum_xx += (x*x);
   resid[plot].sum_yy += (y*y);
   resid[plot].sum_xy += (x*y);
//   resid[plot].a0 = 
}

// Assembly:
cmpl $0x13, %edi
ja 0xffd2a
pushq %rbp
movq %rsp, %rbp
movl %edi, %eax
shlq $0x6, %rax
leaq 0x23fb91(%rip), %rcx    # 0x33f850
movsd 0x38(%rcx,%rax), %xmm2
addsd 0x93a3(%rip), %xmm2     # 0x109070
movsd %xmm2, 0x38(%rcx,%rax)
mulsd %xmm1, %xmm2
movsd (%rcx,%rax), %xmm1
addsd %xmm2, %xmm1
movsd %xmm1, (%rcx,%rax)
movsd 0x8(%rcx,%rax), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rcx,%rax)
movapd %xmm2, %xmm1
mulsd %xmm2, %xmm1
addsd 0x10(%rcx,%rax), %xmm1
movsd %xmm1, 0x10(%rcx,%rax)
mulsd %xmm0, %xmm2
mulsd %xmm0, %xmm0
addsd 0x18(%rcx,%rax), %xmm0
movsd %xmm0, 0x18(%rcx,%rax)
addsd 0x20(%rcx,%rax), %xmm2
movsd %xmm2, 0x20(%rcx,%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: add_adev_point(double, double, double, double)
void add_adev_point(double osc_phase, double pps_phase, double chc_phase, double chd_phase)
{
   if(adev_period <= 0) return;
   if(adev_q_allocated == 0) {
      alloc_adev();
   }

   add_pps_adev_point(pps_phase, 0);
   add_osc_adev_point(osc_phase, 0);
   add_chc_adev_point(chc_phase, 0);
   add_chd_adev_point(chd_phase, 0);
   return;
}

// Assembly:
leaq 0x13c34a(%rip), %rax    # 0x23ccf8
xorpd %xmm4, %xmm4
ucomisd (%rax), %xmm4
jae 0x100a1d
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movsd %xmm0, -0x10(%rbp)
movsd %xmm2, -0x18(%rbp)
movsd %xmm3, -0x20(%rbp)
leaq 0x13c30a(%rip), %rax    # 0x23cce0
cmpl $0x0, (%rax)
jne 0x1009ea
movsd %xmm1, -0x8(%rbp)
callq 0x10884
movsd -0x8(%rbp), %xmm1
movaps %xmm1, %xmm0
xorl %edi, %edi
callq 0xffd2b
movsd -0x10(%rbp), %xmm0
xorl %edi, %edi
callq 0x1002ad
movsd -0x18(%rbp), %xmm0
xorl %edi, %edi
callq 0x1004e3
movsd -0x20(%rbp), %xmm0
xorl %edi, %edi
addq $0x20, %rsp
popq %rbp
jmp 0x100745
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: scan_bins(BIN*)
void scan_bins(struct BIN *bin)
{
int i;

   // find the min and max adev values in the specified adev bins
// for(i=0; i<MAX_ADEV_BINS; i++) {
   for(i=first_show_bin; i<MAX_ADEV_BINS; i++) {
// aaaahhhh    if(bin[i].n < min_points_per_bin) break;
      if(bin[i].n < min_points_per_bin) continue;
      if(bin[i].value == 0.0) continue;
      if(bin[i].value > global_adev_max) global_adev_max = bin[i].value;
      if(bin[i].value < global_adev_min) global_adev_min = bin[i].value;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x139f43(%rip), %rax    # 0x23cc80
movslq (%rax), %rax
cmpq $0x63, %rax
jg 0x102dc0
leaq 0x139da3(%rip), %rcx    # 0x23caf0
movsd (%rcx), %xmm2
leaq 0x139d90(%rip), %rdx    # 0x23cae8
movsd (%rdx), %xmm0
leaq 0x139f59(%rip), %rsi    # 0x23ccbc
movl (%rsi), %esi
imulq $0x38, %rax, %r8
addq %r8, %rdi
addq $0x10, %rdi
incq %rax
xorpd %xmm1, %xmm1
cmpl %esi, -0xc(%rdi)
jl 0x102da6
movsd (%rdi), %xmm3
ucomisd %xmm1, %xmm3
jne 0x102d88
jnp 0x102da6
ucomisd %xmm0, %xmm3
jbe 0x102d96
movsd %xmm3, (%rdx)
movapd %xmm3, %xmm0
movsd (%rdi), %xmm3
ucomisd %xmm3, %xmm2
jbe 0x102da6
movsd %xmm3, (%rcx)
jmp 0x102daa
movapd %xmm2, %xmm3
addq $0x38, %rdi
movq %rax, %r8
incq %r8
movapd %xmm3, %xmm2
cmpl $0x64, %eax
movq %r8, %rax
jne 0x102d77
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: init_gif_encoder(_IO_FILE*, GifEncoder*, int)
void init_gif_encoder(FILE *file, GifEncoder *encoder, int depth)
{
int lzw_min;

   lzw_min = depth = (depth < 2 ? 2 : depth);
   encoder->file_state   = IMAGE_SAVING;
   encoder->position     = 0;
   encoder->bufsize      = 0;
   encoder->buf[0]       = 0;
   encoder->depth        = depth;
   encoder->clear_code   = (1 << depth);
   encoder->eof_code     = encoder->clear_code + 1;
   encoder->running_code = encoder->eof_code + 1;
   encoder->running_bits = depth + 1;
   encoder->max_code_plus_one = 1 << encoder->running_bits;
   encoder->current_code = FIRST_CODE;
   encoder->shift_state  = 0;
   encoder->shift_data   = 0;

   /* Write the LZW minimum code size: */
   write_byte(file, lzw_min);

   /* Clear hash table, output Clear code: */
   clear_gif_hash_table();
   write_gif_code(file, encoder, encoder->clear_code);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edx, %ecx
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x3, %edx
movl $0x2, %eax
cmovll %eax, %ecx
xorl %edx, %edx
movq %rdx, 0x45(%rsi)
movq %rdx, 0x40(%rsi)
movl %ecx, 0x8(%rsi)
movl $0x1, %esi
shll %cl, %esi
movl %esi, 0xc(%rbx)
leal 0x1(%rsi), %edi
movl %edi, 0x10(%rbx)
addl $0x2, %esi
movl %esi, 0x14(%rbx)
leal 0x1(%rcx), %esi
movl %esi, 0x18(%rbx)
shll %cl, %eax
movl %eax, 0x1c(%rbx)
movl $0x1001, 0x24(%rbx)     # imm = 0x1001
movl $0x0, 0x2c(%rbx)
movq %rdx, 0x30(%rbx)
testq %r14, %r14
je 0x103d2c
movl %ecx, %edi
movq %r14, %rsi
callq 0x9740
leaq 0x1175e5(%rip), %rax    # 0x21b318
movq (%rax), %rax
xorl %ecx, %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %rdx, (%rax,%rcx,8)
incq %rcx
cmpq $0x2000, %rcx           # imm = 0x2000
jne 0x103d3d
movl 0xc(%rbx), %edx
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x103d7a
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: write_gif_code(_IO_FILE*, GifEncoder*, int)
void write_gif_code(FILE *file, GifEncoder *encoder, int code)
{
   if(code == FLUSH_OUTPUT) {
      /* write all remaining data */
      while(encoder->shift_state > 0) {
         write_gif_byte(file, encoder, encoder->shift_data & 0xff);
         encoder->shift_data >>= 8;
         encoder->shift_state -= 8;
      }
      encoder->shift_state = 0;
      write_gif_byte(file, encoder, FLUSH_OUTPUT);
   }
   else {
      encoder->shift_data |= ((long) code) << encoder->shift_state;
      encoder->shift_state += encoder->running_bits;

      while(encoder->shift_state >= 8) { /* write full bytes */
         write_gif_byte(file, encoder, encoder->shift_data & 0xff);
         encoder->shift_data >>= 8;
         encoder->shift_state -= 8;
      }
   }

   /* If code can't fit into running_bits bits, raise its size.
    * Note that codes above 4095 are for signalling. */
   if((encoder->running_code >= encoder->max_code_plus_one) && (code < 4096)) {
      encoder->max_code_plus_one = (1 << ++encoder->running_bits);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rsi, %rbx
movq %rdi, %r15
cmpl $0x1000, %edx           # imm = 0x1000
jne 0x103dd6
cmpl $0x0, 0x2c(%rbx)
jle 0x103dbd
movzbl 0x30(%rbx), %edx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x103e75
shrq $0x8, 0x30(%rbx)
movl 0x2c(%rbx), %eax
leal -0x8(%rax), %ecx
movl %ecx, 0x2c(%rbx)
cmpl $0x8, %eax
jg 0x103d9b
movl $0x0, 0x2c(%rbx)
movq %r15, %rdi
movq %rbx, %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x103e75
jmp 0x103e10
movslq %r14d, %rax
movl 0x2c(%rbx), %ecx
shlq %cl, %rax
orq %rax, 0x30(%rbx)
addl 0x18(%rbx), %ecx
movl %ecx, 0x2c(%rbx)
cmpl $0x8, %ecx
jl 0x103e10
movzbl 0x30(%rbx), %edx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x103e75
shrq $0x8, 0x30(%rbx)
movl 0x2c(%rbx), %eax
leal -0x8(%rax), %ecx
movl %ecx, 0x2c(%rbx)
cmpl $0xf, %eax
jg 0x103dee
cmpl $0xfff, %r14d           # imm = 0xFFF
jg 0x103e33
movl 0x1c(%rbx), %eax
cmpl %eax, 0x14(%rbx)
jl 0x103e33
movl 0x18(%rbx), %ecx
incl %ecx
movl %ecx, 0x18(%rbx)
movl $0x1, %eax
shll %cl, %eax
movl %eax, 0x1c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: write_gif_byte(_IO_FILE*, GifEncoder*, int)
void write_gif_byte(FILE *file, GifEncoder *encoder, int ch)
{
unsigned char *buf;

   buf = encoder->buf;

   if(encoder->file_state == IMAGE_COMPLETE) return;

   if(ch == FLUSH_OUTPUT) {
      if(encoder->bufsize) {
         write_byte(file, encoder->bufsize);
         write_stream(file, buf, encoder->bufsize);
         encoder->bufsize = 0;
      }
      /* write an empty block to mark end of data */
      write_byte(file, 0);
      encoder->file_state = IMAGE_COMPLETE;
   }
   else {
      if(encoder->bufsize == 255) {
         /* write this buffer to the file */
         write_byte(file, encoder->bufsize);
         write_stream(file, buf, encoder->bufsize);
         encoder->bufsize = 0;
      }
      buf[encoder->bufsize++] = ch;
   }
}

// Assembly:
cmpl $0x1, 0x40(%rsi)
je 0x103f32
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x4c(%rsi), %r12
movl 0x48(%rsi), %edi
cmpl $0x1000, %edx           # imm = 0x1000
jne 0x103ee6
testl %edi, %edi
je 0x103ece
testq %r14, %r14
je 0x103ec7
movq %r14, %rsi
callq 0x9740
movslq 0x48(%rbx), %rdx
movl $0x1, %esi
movq %r12, %rdi
movq %r14, %rcx
callq 0x9750
movl $0x0, 0x48(%rbx)
testq %r14, %r14
je 0x103edd
xorl %edi, %edi
movq %r14, %rsi
callq 0x9740
movl $0x1, 0x40(%rbx)
jmp 0x103f2a
cmpl $0xff, %edi
jne 0x103f1b
testq %r14, %r14
je 0x103f14
movl $0xff, %edi
movq %r14, %rsi
callq 0x9740
movslq 0x48(%rbx), %rdx
movl $0x1, %esi
movq %r12, %rdi
movq %r14, %rcx
callq 0x9750
movl $0x0, 0x48(%rbx)
movslq 0x48(%rbx), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x48(%rbx)
movb %r15b, 0x4c(%rbx,%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: write_gif_header(_IO_FILE*, Gif*)
void write_gif_header(FILE *file, Gif *gif)
{
unsigned char info;
GifScreen *screen;
GifPalette *cmap;
int i;
Colour c;

   if(file == 0) return;
   fprintf(file, "%s", gif->header);  // header info

   // image description
   screen = gif->screen;
   cmap = screen->cmap;
   write_gif_int(file, screen->width);
   write_gif_int(file, screen->height);

   info = 0;
   info = info | (screen->has_cmap ? 0x80 : 0x00);
   info = info | ((screen->color_res - 1) << 4);
// info = info | (screen->sorted ? 0x08 : 0x00);
   if(screen->cmap_depth > 0) {
      info = info | ((screen->cmap_depth) - 1);
   }
   write_byte(file, info);

   write_byte(file, screen->bgcolour);
   write_byte(file, screen->aspect);

   if(screen->has_cmap) {   // palette data
      for(i=0; i<cmap->length; i++) {
         c = cmap->colours[i];
         write_byte(file, c.red);
         write_byte(file, c.green);
         write_byte(file, c.blue);
      }
   }
}

// Assembly:
testq %rdi, %rdi
je 0x104292
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
movq %rbx, %rsi
callq 0x9400
movq 0x8(%r14), %r15
movq 0x20(%r15), %r12
movl (%r15), %r14d
movl $0xff, %r13d
movl %r14d, %edi
andl %r13d, %edi
movq %rbx, %rsi
callq 0x9740
shrl $0x8, %r14d
andl %r13d, %r14d
movl %r14d, %edi
movq %rbx, %rsi
callq 0x9740
movl 0x4(%r15), %r14d
movl %r14d, %edi
andl %r13d, %edi
movq %rbx, %rsi
callq 0x9740
shrl $0x8, %r14d
andl %r13d, %r14d
movl %r14d, %edi
movq %rbx, %rsi
callq 0x9740
xorl %eax, %eax
cmpl $0x0, 0x8(%r15)
setne %al
shll $0x7, %eax
movl 0xc(%r15), %ecx
movl 0x14(%r15), %edx
shll $0x4, %ecx
addl $0xf0, %ecx
leal -0x1(%rdx), %esi
xorl %edi, %edi
testl %edx, %edx
cmovgl %esi, %edi
orl %ecx, %edi
orl %eax, %edi
andl %r13d, %edi
movq %rbx, %rsi
callq 0x9740
movl 0x18(%r15), %edi
movq %rbx, %rsi
callq 0x9740
movl 0x1c(%r15), %edi
movq %rbx, %rsi
callq 0x9740
cmpl $0x0, 0x8(%r15)
je 0x104284
cmpl $0x0, (%r12)
jle 0x104284
xorl %r13d, %r13d
movq 0x4(%r12), %rax
movzbl 0x1(%rax,%r13,4), %edi
movzbl 0x2(%rax,%r13,4), %r14d
movzbl 0x3(%rax,%r13,4), %r15d
movq %rbx, %rsi
callq 0x9740
movl %r14d, %edi
movq %rbx, %rsi
callq 0x9740
movl %r15d, %edi
movq %rbx, %rsi
callq 0x9740
incq %r13
movslq (%r12), %rax
cmpq %rax, %r13
jl 0x104243
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: write_gif_picture(_IO_FILE*, int, GifPicture*)
void write_gif_picture(FILE *file, int top_line, GifPicture *pic)
{
unsigned char info;
GifEncoder *encoder;
int row;

   write_byte(file, 0x2C);   // intro code

   write_gif_int(file, pic->left);
   write_gif_int(file, pic->top);
   write_gif_int(file, pic->width);
   write_gif_int(file, pic->height);

   info = 0;
// info = info | (pic->has_cmap    ? 0x80 : 0x00);
// info = info | (pic->interlace   ? 0x40 : 0x00);
// info = info | (pic->sorted      ? 0x20 : 0x00);
   info = info | ((pic->reserved << 3) & 0x18);
   if(pic->has_cmap) info = info | (pic->cmap_depth - 1);

   write_byte(file, info);

   encoder = &encoder_data;
   init_gif_encoder(file, encoder, pic->cmap_depth);

   row = 0;
   while(row < pic->height) {  // !!!!! kludge: top_line should be passed to this routine
     update_pwm();
     write_gif_line(file, encoder, row+top_line, pic->width);
     row += 1;
   }

   flush_gif_encoder(file, encoder);

   write_byte(file, 0x3B);   // end code
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movl %esi, %r15d
movq %rdi, %rbx
testq %rdi, %rdi
je 0x1042bc
movl $0x2c, %edi
movq %rbx, %rsi
callq 0x9740
movl (%r14), %esi
movq %rbx, %rdi
callq 0x103f57
movl 0x4(%r14), %esi
movq %rbx, %rdi
callq 0x103f57
movl 0x8(%r14), %esi
movq %rbx, %rdi
callq 0x103f57
movl 0xc(%r14), %esi
movq %rbx, %rdi
callq 0x103f57
movb 0x1c(%r14), %al
shlb $0x3, %al
andb $0x18, %al
cmpl $0x0, 0x10(%r14)
je 0x104303
movb 0x20(%r14), %cl
decb %cl
orb %cl, %al
testq %rbx, %rbx
je 0x104313
movzbl %al, %edi
movq %rbx, %rsi
callq 0x9740
movl 0x20(%r14), %edx
leaq 0x3511c6(%rip), %rsi    # 0x4554e4
movq %rbx, %rdi
callq 0x103cc3
cmpl $0x0, 0xc(%r14)
jle 0x104358
xorl %r13d, %r13d
leaq 0x3511ad(%rip), %r12    # 0x4554e4
callq 0xd1865
leal (%r15,%r13), %edx
movl 0x8(%r14), %ecx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x103f9c
incl %r13d
cmpl 0xc(%r14), %r13d
jl 0x104337
leaq 0x351185(%rip), %rsi    # 0x4554e4
movq %rbx, %rdi
callq 0x103e3e
testq %rbx, %rbx
je 0x104387
movl $0x3b, %edi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x9740
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: disable_osc_control()
void disable_osc_control()
{
   if(osc_control_on == 0) return;

   osc_discipline = 1;
   if(rcvr_type == X72_RCVR) {
   }
   else {
      set_discipline_mode(SET_DIS_MODE_ENABLE);
   }

   osc_control_on = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x23a430(%rip), %rbx    # 0x33f6d8
cmpb $0x0, (%rbx)
je 0x1052d4
leaq 0x2081e0(%rip), %rax    # 0x30d494
movb $0x1, (%rax)
leaq 0x113612(%rip), %rax    # 0x2188d0
cmpq $0x2000000, (%rax)      # imm = 0x2000000
je 0x1052d1
movl $0x5, %edi
callq 0x6d6ce
movb $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: calc_k_factors()
void calc_k_factors()
{
   // This routine converts the user friendly input PID constants into the
   // "k" values used by the PID filter algorithm.  It is called whenever
   // a PID filter constant is changed by the user.
   //
   // P_GAIN        -> k1   (PID gain)
   // D_TC          -> k2   (derivative time constant)
   // FILTER_TC     -> k3   (filter time constant)
   // I_TC          -> k4   (integrator time constant)
   // FILTER_OFFSET         (temperature setpoint offset)

   if(I_TC) k4 = ((DATA_SIZE)1.0/I_TC) / (DATA_SIZE) PID_UPDATE_RATE * P_GAIN;
   else     k4 = (DATA_SIZE) 0.0;

   if(FILTER_TC > 0.0) {
      k3 = (DATA_SIZE) 1.0 - ((DATA_SIZE) 1.0/((FILTER_TC*(DATA_SIZE) PID_UPDATE_RATE)+(DATA_SIZE) 1.0));
      k2 = ((DATA_SIZE) -1.0 * D_TC * P_GAIN) / (FILTER_TC*(DATA_SIZE) PID_UPDATE_RATE+(DATA_SIZE) 1.0) * ((DATA_SIZE) PID_UPDATE_RATE/(DATA_SIZE) SCALE_FACTOR);
   }
   else {
      k3 = FILTER_TC;
      k2 = ((DATA_SIZE) -1.0 * D_TC * P_GAIN) * ((DATA_SIZE) PID_UPDATE_RATE/(DATA_SIZE) SCALE_FACTOR);
   }

   k1 = ((P_GAIN/(DATA_SIZE) SCALE_FACTOR) * ((DATA_SIZE) 1.0 - k3)) - k2;

   if(pid_debug || bang_bang) {  // set a marker each time a PID value changes
      if(++test_marker >= MAX_MARKER) test_marker = 1;
      if(test_marker < 0) test_marker = 1;
      mark_q_entry[test_marker] = plot_q_in;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x23a356(%rip), %rax    # 0x33f660
movsd (%rax), %xmm2
movsd 0x3d5a(%rip), %xmm0     # 0x109070
movapd %xmm0, %xmm3
divsd %xmm2, %xmm3
leaq 0x23a323(%rip), %rax    # 0x33f648
movsd (%rax), %xmm1
mulsd %xmm1, %xmm3
xorpd %xmm4, %xmm4
cmpneqsd %xmm4, %xmm2
andpd %xmm3, %xmm2
movlpd %xmm2, 0x3504ee(%rip)   # 0x455830
leaq 0x23a30f(%rip), %rax    # 0x33f658
movsd (%rax), %xmm3
ucomisd %xmm4, %xmm3
jbe 0x10538c
addsd %xmm0, %xmm3
movapd %xmm0, %xmm2
divsd %xmm3, %xmm2
movapd %xmm0, %xmm4
subsd %xmm2, %xmm4
movsd %xmm4, 0x3504b9(%rip)   # 0x455828
leaq 0x23a2da(%rip), %rax    # 0x33f650
movsd (%rax), %xmm2
xorpd 0x3e1e(%rip), %xmm2     # 0x1091a0
mulsd %xmm1, %xmm2
divsd %xmm3, %xmm2
jmp 0x1053ab
movsd %xmm3, 0x350494(%rip)   # 0x455828
leaq 0x23a2b5(%rip), %rax    # 0x33f650
movsd (%rax), %xmm2
xorpd 0x3df9(%rip), %xmm2     # 0x1091a0
mulsd %xmm1, %xmm2
movsd %xmm2, 0x35046d(%rip)   # 0x455820
subsd 0x35046d(%rip), %xmm0   # 0x455828
mulsd %xmm0, %xmm1
subsd %xmm2, %xmm1
movsd %xmm1, 0x35044d(%rip)   # 0x455818
leaq 0x23a26e(%rip), %rax    # 0x33f640
cmpb $0x0, (%rax)
jne 0x1053e3
leaq 0x23a25e(%rip), %rax    # 0x33f63c
cmpl $0x0, (%rax)
je 0x105419
leaq 0x23a24e(%rip), %rax    # 0x33f638
movl (%rax), %ecx
leal 0x1(%rcx), %edx
cmpl $0x9, %ecx
movl $0x1, %ecx
cmovgel %ecx, %edx
testl %edx, %edx
cmovsl %ecx, %edx
movl %edx, (%rax)
leaq 0x115f20(%rip), %rax    # 0x21b328
movq (%rax), %rax
movslq %edx, %rcx
leaq 0x115e9b(%rip), %rdx    # 0x21b2b0
movq %rax, (%rdx,%rcx,8)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: show_pid_values()
void show_pid_values()
{
   if(dac_dac) return;

   sprintf(plot_title, "kP(%.2f %c %.4f) kD(%.2f %c %.4f) kF(%.2f %c %.4f) kI(%.1f %c %.3f)  kO=%.3f kL=%.3f kS=%.3f kR=%.3f k9=%.3f", 
      P_GAIN,RIGHT_ARROW,k1, 
      D_TC,RIGHT_ARROW,k2, 
      FILTER_TC,RIGHT_ARROW,k3, 
      I_TC,RIGHT_ARROW,k4, 
      FILTER_OFFSET, k6, k7, k8, KL_TUNE_STEP);
   title_type = OTHER;
}

// Assembly:
leaq 0x23635e(%rip), %rax    # 0x33b81c
cmpl $0x0, (%rax)
je 0x1054c4
retq
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq 0x23a175(%rip), %rax    # 0x33f648
movsd (%rax), %xmm0
movsd 0x350339(%rip), %xmm1   # 0x455818
leaq 0x23a16a(%rip), %rax    # 0x33f650
movsd (%rax), %xmm2
movsd 0x35032e(%rip), %xmm3   # 0x455820
leaq 0x23a15f(%rip), %rax    # 0x33f658
movsd (%rax), %xmm4
movsd 0x350323(%rip), %xmm5   # 0x455828
leaq 0x23a154(%rip), %rax    # 0x33f660
movsd (%rax), %xmm6
movsd 0x350318(%rip), %xmm7   # 0x455830
leaq 0x23a149(%rip), %rax    # 0x33f668
movsd (%rax), %xmm8
movsd 0x35030b(%rip), %xmm9   # 0x455838
movsd 0x35030a(%rip), %xmm10  # 0x455840
movsd 0x350309(%rip), %xmm11  # 0x455848
leaq 0x23a12a(%rip), %rax    # 0x33f670
movsd (%rax), %xmm12
movsd %xmm12, 0x20(%rsp)
movsd %xmm11, 0x18(%rsp)
movsd %xmm10, 0x10(%rsp)
movsd %xmm9, 0x8(%rsp)
movsd %xmm8, (%rsp)
leaq 0x2392dc(%rip), %rdi    # 0x33e850
leaq 0x30820(%rip), %rsi     # 0x135d9b
movl $0x1a, %edx
movl $0x1a, %ecx
movl $0x1a, %r8d
movl $0x1a, %r9d
movb $0x8, %al
callq 0x9060
leaq 0x239d2d(%rip), %rax    # 0x33f2cc
movl $0x3, (%rax)
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: calc_autotune()
int calc_autotune()
{
double val;

   if(HEAT_OVERSHOOT == 0.0F) return 1;
   if(COOL_UNDERSHOOT == 0.0F) return 2;
   if(ct_samples == 0.0) return 3;
   if(amp_ptr < 2) return 4;
   if(cyc_ptr < 2) return 5;

   val  = tune_amp[amp_ptr/2];
   if(amp_ptr > 2) {
      val += tune_amp[amp_ptr/2-1];
      val += tune_amp[amp_ptr/2+1];
      val /= 3.0;
   }
   if(val == 0.0) return 6;
   P_GAIN = 0.625F * (KL_TUNE_STEP+KL_TUNE_STEP) / (float) val;

   val  = tune_cyc[cyc_ptr/2];
   if(cyc_ptr > 2) {
      val += tune_cyc[cyc_ptr/2-1];
      val += tune_cyc[cyc_ptr/2+1];
      val /= 3.0;
   }
   I_TC   = 0.75F * (float) val;
   D_TC   = 0.1875F * (float) val; 

   k6 = 0.0F;
// integrator = 0.0F;

   calc_k_factors();
   clear_pid_display();
   show_pid_values();

   bang_bang = 0;    // pid autotune analysis done
   return 0;
}

// Assembly:
movsd 0x35021d(%rip), %xmm1   # 0x4557d0
movl $0x1, %eax
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x1055c5
jp 0x1055c5
retq
movsd 0x35020b(%rip), %xmm1   # 0x4557d8
movl $0x2, %eax
ucomisd %xmm0, %xmm1
jne 0x1055da
jnp 0x1055c4
movsd 0x350176(%rip), %xmm0   # 0x455758
movl $0x3, %eax
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x1055f3
jnp 0x1055c4
movl 0x3502a7(%rip), %edx    # 0x4558a0
movl $0x4, %eax
cmpl $0x2, %edx
jl 0x1055c4
movl 0x3502e7(%rip), %ecx    # 0x4558f0
movl $0x5, %eax
cmpl $0x2, %ecx
jl 0x1055c4
movl %edx, %esi
shrl %esi
leaq 0x350242(%rip), %rax    # 0x455860
movsd (%rax,%rsi,8), %xmm0
cmpq $0x2, %rdx
je 0x105641
leal -0x1(%rsi), %edx
addsd (%rax,%rdx,8), %xmm0
movl %esi, %edx
addsd 0x8(%rax,%rdx,8), %xmm0
divsd 0x63c7(%rip), %xmm0     # 0x10ba08
movl $0x6, %eax
ucomisd %xmm1, %xmm0
jne 0x105652
jnp 0x1055c4
leaq 0x23a017(%rip), %rax    # 0x33f670
movsd (%rax), %xmm1
addsd %xmm1, %xmm1
mulsd 0x27047(%rip), %xmm1    # 0x12c6b0
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
divsd %xmm0, %xmm1
leaq 0x239fcc(%rip), %rax    # 0x33f648
movsd %xmm1, (%rax)
movl %ecx, %edx
shrl %edx
leaq 0x350225(%rip), %rax    # 0x4558b0
movsd (%rax,%rdx,8), %xmm0
cmpq $0x2, %rcx
je 0x1056ac
movl %edx, %ecx
addsd -0x8(%rax,%rcx,8), %xmm0
addsd 0x8(%rax,%rcx,8), %xmm0
divsd 0x635c(%rip), %xmm0     # 0x10ba08
pushq %rbp
movq %rsp, %rbp
cvtsd2ss %xmm0, %xmm0
movss 0x7920(%rip), %xmm1     # 0x10cfdc
mulss %xmm0, %xmm1
cvtss2sd %xmm1, %xmm1
leaq 0x239f95(%rip), %rax    # 0x33f660
movsd %xmm1, (%rax)
mulss 0x27131(%rip), %xmm0    # 0x12c808
cvtss2sd %xmm0, %xmm0
leaq 0x239f6e(%rip), %rax    # 0x33f650
movsd %xmm0, (%rax)
movq $0x0, 0x350147(%rip) # 0x455838
callq 0x1052ff
callq 0x33af6
callq 0x1054b7
leaq 0x239f35(%rip), %rax    # 0x33f63c
movl $0x0, (%rax)
xorl %eax, %eax
popq %rbp
retq