LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: 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
leaq 0x13d035(%rip), %rax    # 0x29be10
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
leaq 0x13d10f(%rip), %rax    # 0x29bef8
movsd (%rax), %xmm0
leaq 0x13765c(%rip), %rdi    # 0x296450
callq 0x15eb90
leaq 0x13d0f8(%rip), %rax    # 0x29bef8
movsd (%rax), %xmm0
leaq 0x138c65(%rip), %rdi    # 0x297a70
callq 0x15eb90
leaq 0x13d0e1(%rip), %rax    # 0x29bef8
movsd (%rax), %xmm0
leaq 0x13a26e(%rip), %rdi    # 0x299090
callq 0x15eb90
leaq 0x13d0ca(%rip), %rax    # 0x29bef8
movsd (%rax), %xmm0
leaq 0x13b877(%rip), %rdi    # 0x29a6b0
callq 0x15eb90
popq %rbp
retq
// File: 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:
pushq %rbp
movq %rsp, %rbp
movss %xmm0, -0x4(%rbp)
movss 0x127db(%rip), %xmm0    # 0x17193c
movss %xmm0, -0x8(%rbp)
movss -0x8(%rbp), %xmm0
movss 0x30071(%rip), %xmm1    # 0x18f1e4
ucomiss %xmm1, %xmm0
jb 0x15f19f
movss -0x4(%rbp), %xmm0
ucomiss -0x8(%rbp), %xmm0
jbe 0x15f185
jmp 0x15f19f
jmp 0x15f187
movss -0x8(%rbp), %xmm0
movss 0x2418c(%rip), %xmm1    # 0x183320
divss %xmm1, %xmm0
movss %xmm0, -0x8(%rbp)
jmp 0x15f166
movss 0x24179(%rip), %xmm0    # 0x183320
mulss -0x8(%rbp), %xmm0
popq %rbp
retq
nop
// File: 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
subq $0x10, %rsp
leaq 0x13c039(%rip), %rax    # 0x29be98
movl (%rax), %eax
addl $0x1, %eax
leaq 0x13c02d(%rip), %rcx    # 0x29be98
movl %eax, (%rcx)
andl $0xffff, %eax           # imm = 0xFFFF
cmpl $0x0, %eax
je 0x15fe79
jmp 0x15feec
callq 0x11ee60
leaq 0x11a598(%rip), %rax    # 0x27a41d
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x15fe8f
jmp 0x15feec
leaq 0x11a566(%rip), %rax    # 0x27a3fc
movb (%rax), %al
movb %al, -0x1(%rbp)
leaq 0x11a55b(%rip), %rax    # 0x27a3fd
cmpb $0x0, (%rax)
je 0x15feb1
leaq 0x11a54e(%rip), %rax    # 0x27a3fc
movb $0x2, (%rax)
leaq 0x11a540(%rip), %rax    # 0x27a3f8
movl (%rax), %ecx
addl $0x1, %ecx
leaq 0x11a534(%rip), %rax    # 0x27a3f8
movl %ecx, (%rax)
callq 0x28690
leaq 0x11a526(%rip), %rax    # 0x27a3f8
movl (%rax), %ecx
addl $-0x1, %ecx
leaq 0x11a51a(%rip), %rax    # 0x27a3f8
movl %ecx, (%rax)
movb -0x1(%rbp), %cl
leaq 0x11a512(%rip), %rax    # 0x27a3fc
movb %cl, (%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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
movl $0x5, %edi
leaq 0x125bc0(%rip), %rsi    # 0x285ad0
callq 0x15ff50
movl $0x6, %edi
leaq 0x1271cf(%rip), %rsi    # 0x2870f0
callq 0x160200
movl $0x7, %edi
leaq 0x1287de(%rip), %rsi    # 0x288710
callq 0x160500
movl $0x8, %edi
leaq 0x129ded(%rip), %rsi    # 0x289d30
callq 0x160960
popq %rbp
retq
nopw (%rax,%rax)
// File: 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
xorl %edi, %edi
leaq 0x12e7b3(%rip), %rsi    # 0x28f5b0
callq 0x15ff50
movl $0x1, %edi
leaq 0x12a542(%rip), %rsi    # 0x28b350
callq 0x160200
movl $0x2, %edi
leaq 0x12bb51(%rip), %rsi    # 0x28c970
callq 0x160500
movl $0x3, %edi
leaq 0x12d160(%rip), %rsi    # 0x28df90
callq 0x160960
popq %rbp
retq
nopw (%rax,%rax)
// File: 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
movl $0xa, %edi
leaq 0x12fd80(%rip), %rsi    # 0x290bd0
callq 0x15ff50
movl $0xb, %edi
leaq 0x13138f(%rip), %rsi    # 0x2921f0
callq 0x160200
movl $0xc, %edi
leaq 0x13299e(%rip), %rsi    # 0x293810
callq 0x160500
movl $0xd, %edi
leaq 0x133fad(%rip), %rsi    # 0x294e30
callq 0x160960
popq %rbp
retq
nopw (%rax,%rax)
// File: 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
movl $0xf, %edi
leaq 0x1355b0(%rip), %rsi    # 0x296450
callq 0x15ff50
movl $0x10, %edi
leaq 0x136bbf(%rip), %rsi    # 0x297a70
callq 0x160200
movl $0x11, %edi
leaq 0x1381ce(%rip), %rsi    # 0x299090
callq 0x160500
movl $0x12, %edi
leaq 0x1397dd(%rip), %rsi    # 0x29a6b0
callq 0x160960
popq %rbp
retq
nopw (%rax,%rax)
// File: jkingan[P]ladyheather/heathmsc.cpp
// Function: recalc_adev_info()
void recalc_adev_info()
{
double msec, msec2;
msec = GetMsecs();
   // recalculate all the adevs from scratch
   reset_adev_bins();    // reset the bins

   extend_com_timeout(ADEV_TIMEOUT); // aaaahhhh
   do_incr_pps_adevs();  // recalculate all the adevs from the queued data
   do_incr_osc_adevs();
   do_incr_chc_adevs();
   do_incr_chd_adevs();
msec2 = GetMsecs();        // aaaahhhh
//sprintf(debug_text2, "recalc adev msecs:%f %f %f", msec,msec2,msec2-msec);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
callq 0xb630
movsd %xmm0, -0x8(%rbp)
callq 0x15ee40
movsd 0x21ca9(%rip), %xmm0    # 0x182ba8
callq 0x88f10
callq 0x15ff00
callq 0x160df0
callq 0x160e40
callq 0x160e90
callq 0xb630
movsd %xmm0, -0x10(%rbp)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: 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
movsd 0xe12c(%rip), %xmm0     # 0x16f068
leaq 0x13addd(%rip), %rax    # 0x29bd20
addsd (%rax), %xmm0
leaq 0x13add2(%rip), %rax    # 0x29bd20
movsd %xmm0, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
leaq 0x13af3d(%rip), %rcx    # 0x29bea0
cmpl (%rcx), %eax
jge 0x161051
movslq -0x4(%rbp), %rcx
leaq 0x124b5a(%rip), %rax    # 0x285ad0
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x124b3f(%rip), %rax    # 0x285ad0
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x2c(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x2c(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x126144(%rip), %rax    # 0x2870f0
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x126129(%rip), %rax    # 0x2870f0
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x2c(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x2c(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x12772e(%rip), %rax    # 0x288710
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x127713(%rip), %rax    # 0x288710
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x2c(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x2c(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x128d18(%rip), %rax    # 0x289d30
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x128cfd(%rip), %rax    # 0x289d30
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x2c(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x2c(%rax)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x160f59
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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
movsd 0xdffc(%rip), %xmm0     # 0x16f068
leaq 0x13acfd(%rip), %rax    # 0x29bd70
addsd (%rax), %xmm0
leaq 0x13acf2(%rip), %rax    # 0x29bd70
movsd %xmm0, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
leaq 0x13ae0d(%rip), %rcx    # 0x29bea0
cmpl (%rcx), %eax
jge 0x161181
movslq -0x4(%rbp), %rcx
leaq 0x12e50a(%rip), %rax    # 0x28f5b0
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x12e4ef(%rip), %rax    # 0x28f5b0
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x2c(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x2c(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x12a274(%rip), %rax    # 0x28b350
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x12a259(%rip), %rax    # 0x28b350
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x2c(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x2c(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x12b85e(%rip), %rax    # 0x28c970
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x12b843(%rip), %rax    # 0x28c970
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x2c(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x2c(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x12ce48(%rip), %rax    # 0x28df90
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x12ce2d(%rip), %rax    # 0x28df90
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x2c(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x2c(%rax)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x161089
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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
movsd 0xdecc(%rip), %xmm0     # 0x16f068
leaq 0x13ac1d(%rip), %rax    # 0x29bdc0
addsd (%rax), %xmm0
leaq 0x13ac12(%rip), %rax    # 0x29bdc0
movsd %xmm0, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
leaq 0x13acdd(%rip), %rcx    # 0x29bea0
cmpl (%rcx), %eax
jge 0x1612b1
movslq -0x4(%rbp), %rcx
leaq 0x12f9fa(%rip), %rax    # 0x290bd0
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x12f9df(%rip), %rax    # 0x290bd0
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x2c(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x2c(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x130fe4(%rip), %rax    # 0x2921f0
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x130fc9(%rip), %rax    # 0x2921f0
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x2c(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x2c(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x1325ce(%rip), %rax    # 0x293810
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x1325b3(%rip), %rax    # 0x293810
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x2c(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x2c(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x133bb8(%rip), %rax    # 0x294e30
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x133b9d(%rip), %rax    # 0x294e30
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x2c(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x2c(%rax)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x1611b9
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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
movsd 0xdd9c(%rip), %xmm0     # 0x16f068
leaq 0x13ab3d(%rip), %rax    # 0x29be10
addsd (%rax), %xmm0
leaq 0x13ab32(%rip), %rax    # 0x29be10
movsd %xmm0, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
leaq 0x13abad(%rip), %rcx    # 0x29bea0
cmpl (%rcx), %eax
jge 0x1613e1
movslq -0x4(%rbp), %rcx
leaq 0x13514a(%rip), %rax    # 0x296450
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x13512f(%rip), %rax    # 0x296450
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x2c(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x2c(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x136734(%rip), %rax    # 0x297a70
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x136719(%rip), %rax    # 0x297a70
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x2c(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x2c(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x137d1e(%rip), %rax    # 0x299090
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x137d03(%rip), %rax    # 0x299090
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x2c(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x2c(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x139308(%rip), %rax    # 0x29a6b0
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x1392ed(%rip), %rax    # 0x29a6b0
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x2c(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x2c(%rax)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x1612e9
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movsd %xmm0, -0x10(%rbp)
movsd %xmm1, -0x18(%rbp)
cmpl $0x0, -0x4(%rbp)
jge 0x16140c
jmp 0x161530
cmpl $0x14, -0x4(%rbp)
jl 0x161417
jmp 0x161530
movslq -0x4(%rbp), %rcx
leaq 0x23d60e(%rip), %rax    # 0x39ea30
shlq $0x6, %rcx
addq %rcx, %rax
movsd 0xdc37(%rip), %xmm0     # 0x16f068
addsd 0x38(%rax), %xmm0
movsd %xmm0, 0x38(%rax)
movsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x23d5e0(%rip), %rax    # 0x39ea30
shlq $0x6, %rcx
addq %rcx, %rax
movsd 0x38(%rax), %xmm0
mulsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
movslq -0x4(%rbp), %rcx
leaq 0x23d5ba(%rip), %rax    # 0x39ea30
shlq $0x6, %rcx
addq %rcx, %rax
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movsd -0x28(%rbp), %xmm0
movslq -0x4(%rbp), %rcx
leaq 0x23d59b(%rip), %rax    # 0x39ea30
shlq $0x6, %rcx
addq %rcx, %rax
addsd 0x8(%rax), %xmm0
movsd %xmm0, 0x8(%rax)
movsd -0x20(%rbp), %xmm0
movsd -0x20(%rbp), %xmm2
movslq -0x4(%rbp), %rcx
leaq 0x23d575(%rip), %rax    # 0x39ea30
shlq $0x6, %rcx
addq %rcx, %rax
movsd 0x10(%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rax)
movsd -0x28(%rbp), %xmm0
movsd -0x28(%rbp), %xmm2
movslq -0x4(%rbp), %rcx
leaq 0x23d547(%rip), %rax    # 0x39ea30
shlq $0x6, %rcx
addq %rcx, %rax
movsd 0x18(%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rax)
movsd -0x20(%rbp), %xmm0
movsd -0x28(%rbp), %xmm2
movslq -0x4(%rbp), %rcx
leaq 0x23d519(%rip), %rax    # 0x39ea30
shlq $0x6, %rcx
addq %rcx, %rax
movsd 0x20(%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movsd %xmm0, -0x8(%rbp)
movsd %xmm1, -0x10(%rbp)
movsd %xmm2, -0x18(%rbp)
movsd %xmm3, -0x20(%rbp)
xorps %xmm0, %xmm0
leaq 0x139a52(%rip), %rax    # 0x29bed8
ucomisd (%rax), %xmm0
jb 0x16248e
jmp 0x1624cf
leaq 0x139a2b(%rip), %rax    # 0x29bec0
cmpl $0x0, (%rax)
jne 0x16249f
callq 0x14040
movsd -0x10(%rbp), %xmm0
xorl %edi, %edi
callq 0x161540
movsd -0x8(%rbp), %xmm0
xorl %edi, %edi
callq 0x161c60
movsd -0x18(%rbp), %xmm0
xorl %edi, %edi
callq 0x161f00
movsd -0x20(%rbp), %xmm0
xorl %edi, %edi
callq 0x1621b0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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
movq %rdi, -0x8(%rbp)
leaq 0x1361e1(%rip), %rax    # 0x29be60
movl (%rax), %eax
movl %eax, -0xc(%rbp)
cmpl $0x64, -0xc(%rbp)
jge 0x165d68
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
leaq 0x1361f5(%rip), %rcx    # 0x29be9c
cmpl (%rcx), %eax
jge 0x165cb0
jmp 0x165d5a
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movsd 0x10(%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x165cd4
jp 0x165cd4
jmp 0x165d5a
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movsd 0x10(%rax), %xmm0
leaq 0x135fd9(%rip), %rax    # 0x29bcc8
ucomisd (%rax), %xmm0
jbe 0x165d14
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movsd 0x10(%rax), %xmm0
leaq 0x135fb8(%rip), %rax    # 0x29bcc8
movsd %xmm0, (%rax)
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movsd 0x10(%rax), %xmm1
leaq 0x135fa1(%rip), %rax    # 0x29bcd0
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x165d58
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movsd 0x10(%rax), %xmm0
leaq 0x135f7c(%rip), %rax    # 0x29bcd0
movsd %xmm0, (%rax)
jmp 0x165d5a
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x165c84
popq %rbp
retq
nopw (%rax,%rax)
// File: 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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
cmpl $0x2, -0x14(%rbp)
jge 0x167653
movl $0x2, %eax
movl %eax, -0x1c(%rbp)
jmp 0x167659
movl -0x14(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x14(%rbp)
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl $0x0, 0x40(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x44(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x48(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0x4c(%rax)
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movl -0x14(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x14(%rax)
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x10(%rbp), %rax
movl 0x18(%rax), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x1c(%rax)
movq -0x10(%rbp), %rax
movl $0x1001, 0x24(%rax)     # imm = 0x1001
movq -0x10(%rbp), %rax
movl $0x0, 0x2c(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x30(%rax)
movq -0x8(%rbp), %rdi
movl -0x18(%rbp), %esi
callq 0x167740
callq 0x167780
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0xc(%rax), %edx
callq 0x1677c0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: 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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
cmpl $0x1000, -0x14(%rbp)    # imm = 0x1000
jne 0x167843
jmp 0x1677de
movq -0x10(%rbp), %rax
cmpl $0x0, 0x2c(%rax)
jle 0x167824
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
andq $0xff, %rax
movl %eax, %edx
callq 0x167950
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rcx
shrq $0x8, %rcx
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rax
movl 0x2c(%rax), %ecx
subl $0x8, %ecx
movl %ecx, 0x2c(%rax)
jmp 0x1677de
movq -0x10(%rbp), %rax
movl $0x0, 0x2c(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x167950
jmp 0x1678b9
movslq -0x14(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0x2c(%rcx), %ecx
shlq %cl, %rax
movq %rax, %rcx
movq -0x10(%rbp), %rax
orq 0x30(%rax), %rcx
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rax
movl 0x18(%rax), %ecx
movq -0x10(%rbp), %rax
addl 0x2c(%rax), %ecx
movl %ecx, 0x2c(%rax)
movq -0x10(%rbp), %rax
cmpl $0x8, 0x2c(%rax)
jl 0x1678b7
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
andq $0xff, %rax
movl %eax, %edx
callq 0x167950
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rcx
shrq $0x8, %rcx
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rax
movl 0x2c(%rax), %ecx
subl $0x8, %ecx
movl %ecx, 0x2c(%rax)
jmp 0x167871
jmp 0x1678b9
movq -0x10(%rbp), %rax
movl 0x14(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x1c(%rcx), %eax
jl 0x1678ef
cmpl $0x1000, -0x14(%rbp)    # imm = 0x1000
jge 0x1678ef
movq -0x10(%rbp), %rax
movl 0x18(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18(%rax)
movl $0x1, %eax
shll %cl, %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x1c(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rax
addq $0x4c, %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x1, 0x40(%rax)
jne 0x16797e
jmp 0x167a32
cmpl $0x1000, -0x14(%rbp)    # imm = 0x1000
jne 0x1679d8
movq -0x10(%rbp), %rax
cmpl $0x0, 0x48(%rax)
je 0x1679c0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x48(%rax), %esi
callq 0x167740
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x48(%rax), %edx
callq 0x167a40
movq -0x10(%rbp), %rax
movl $0x0, 0x48(%rax)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x167740
movq -0x10(%rbp), %rax
movl $0x1, 0x40(%rax)
jmp 0x167a32
movq -0x10(%rbp), %rax
cmpl $0xff, 0x48(%rax)
jne 0x167a14
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x48(%rax), %esi
callq 0x167740
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x48(%rax), %edx
callq 0x167a40
movq -0x10(%rbp), %rax
movl $0x0, 0x48(%rax)
movl -0x14(%rbp), %eax
movb %al, %dl
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rsi
movl 0x48(%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, 0x48(%rsi)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: jkingan[P]ladyheather/heathmsc.cpp
// Function: lookup_gif_hash(unsigned long)
static int lookup_gif_hash(unsigned long key)
{
int hkey;
unsigned long htkey;

   hkey = gif_hash_key(key);
   while((htkey = HT_GET_KEY(get_hash_table(hkey))) != 0xFFFFFL) {
      if(key == htkey) return HT_GET_CODE(get_hash_table(hkey));
      hkey = (hkey + 1) & HT_KEY_MASK;
   }
   return (-1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x16e5c0
movl %eax, -0x14(%rbp)
leaq 0x1128a9(%rip), %rax    # 0x27a4f8
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0xc, %rax
movq %rax, -0x20(%rbp)
cmpq $0xfffff, %rax          # imm = 0xFFFFF
je 0x167ca1
movq -0x10(%rbp), %rax
cmpq -0x20(%rbp), %rax
jne 0x167c91
leaq 0x11287d(%rip), %rax    # 0x27a4f8
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
andq $0xfff, %rax            # imm = 0xFFF
movl %eax, -0x4(%rbp)
jmp 0x167ca8
movl -0x14(%rbp), %eax
addl $0x1, %eax
andl $0x1fff, %eax           # imm = 0x1FFF
movl %eax, -0x14(%rbp)
jmp 0x167c48
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heathmsc.cpp
// Function: add_gif_hash_entry(unsigned long, int)
static void add_gif_hash_entry(unsigned long key, int code)
{
int hkey;

   hkey = gif_hash_key(key);
   while(HT_GET_KEY(get_hash_table(hkey)) != 0xFFFFFL) {
      hkey = (hkey + 1) & HT_KEY_MASK;
   }
   put_hash_table(hkey, HT_PUT_KEY(key) | HT_PUT_CODE(code));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
callq 0x16e5c0
movl %eax, -0x10(%rbp)
leaq 0x112816(%rip), %rax    # 0x27a4f8
movq (%rax), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0xc, %rax
cmpq $0xfffff, %rax          # imm = 0xFFFFF
je 0x167d09
movl -0x10(%rbp), %eax
addl $0x1, %eax
andl $0x1fff, %eax           # imm = 0x1FFF
movl %eax, -0x10(%rbp)
jmp 0x167cdb
movq -0x8(%rbp), %rdx
shlq $0xc, %rdx
movl -0xc(%rbp), %eax
andl $0xfff, %eax            # imm = 0xFFF
cltq
orq %rax, %rdx
leaq 0x1127d3(%rip), %rax    # 0x27a4f8
movq (%rax), %rax
movslq -0x10(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x167d5c
jmp 0x167e8c
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
leaq 0x28dc2(%rip), %rsi     # 0x190b2d
movb $0x0, %al
callq 0x9550
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl (%rax), %esi
callq 0x167a90
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x4(%rax), %esi
callq 0x167a90
movb $0x0, -0x11(%rbp)
movzbl -0x11(%rbp), %eax
movq -0x20(%rbp), %rcx
movl 0x8(%rcx), %esi
xorl %ecx, %ecx
movl $0x80, %edx
cmpl $0x0, %esi
cmovnel %edx, %ecx
orl %ecx, %eax
movb %al, -0x11(%rbp)
movzbl -0x11(%rbp), %eax
movq -0x20(%rbp), %rcx
movl 0xc(%rcx), %ecx
subl $0x1, %ecx
shll $0x4, %ecx
orl %ecx, %eax
movb %al, -0x11(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x14(%rax)
jle 0x167dfd
movzbl -0x11(%rbp), %eax
movq -0x20(%rbp), %rcx
movl 0x14(%rcx), %ecx
subl $0x1, %ecx
orl %ecx, %eax
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rdi
movzbl -0x11(%rbp), %esi
callq 0x167740
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x18(%rax), %esi
callq 0x167740
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x1c(%rax), %esi
callq 0x167740
movq -0x20(%rbp), %rax
cmpl $0x0, 0x8(%rax)
je 0x167e8c
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x167e8a
movq -0x28(%rbp), %rax
movq 0x4(%rax), %rax
movslq -0x2c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movzbl -0x2f(%rbp), %esi
callq 0x167740
movq -0x8(%rbp), %rdi
movzbl -0x2e(%rbp), %esi
callq 0x167740
movq -0x8(%rbp), %rdi
movzbl -0x2d(%rbp), %esi
callq 0x167740
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x167e3b
jmp 0x167e8c
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl $0x2c, %esi
callq 0x167740
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl (%rax), %esi
callq 0x167a90
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x4(%rax), %esi
callq 0x167a90
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x8(%rax), %esi
callq 0x167a90
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0xc(%rax), %esi
callq 0x167a90
movb $0x0, -0x19(%rbp)
movzbl -0x19(%rbp), %eax
movq -0x18(%rbp), %rcx
movl 0x1c(%rcx), %ecx
shll $0x3, %ecx
andl $0x18, %ecx
orl %ecx, %eax
movb %al, -0x19(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x10(%rax)
je 0x167f37
movzbl -0x19(%rbp), %eax
movq -0x18(%rbp), %rcx
movl 0x20(%rcx), %ecx
subl $0x1, %ecx
orl %ecx, %eax
movb %al, -0x19(%rbp)
movq -0x8(%rbp), %rdi
movzbl -0x19(%rbp), %esi
callq 0x167740
leaq 0x34caa9(%rip), %rax    # 0x4b49f4
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x18(%rbp), %rax
movl 0x20(%rax), %edx
callq 0x167630
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x167fa0
callq 0x11ee60
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl -0x2c(%rbp), %edx
addl -0xc(%rbp), %edx
movq -0x18(%rbp), %rax
movl 0x8(%rax), %ecx
callq 0x167ae0
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x167f6a
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x167900
movq -0x8(%rbp), %rdi
movl $0x3b, %esi
callq 0x167740
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heathmsc.cpp
// Function: app_new_rgb(int, int, int)
Colour app_new_rgb(int r, int g, int b)
{
Colour c;

   c.alpha  = 0;
   c.red    = r;
   c.green  = g;
   c.blue   = b;

   return c;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movb $0x0, -0x4(%rbp)
movl -0x8(%rbp), %eax
movb %al, -0x3(%rbp)
movl -0xc(%rbp), %eax
movb %al, -0x2(%rbp)
movl -0x10(%rbp), %eax
movb %al, -0x1(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax,%rax)
// File: 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
leaq 0x23551d(%rip), %rax    # 0x39e8b8
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x1693a5
jmp 0x1693d5
leaq 0x2032c8(%rip), %rax    # 0x36c674
movb $0x1, (%rax)
leaq 0x10e6fa(%rip), %rax    # 0x277ab0
cmpq $0x2000000, (%rax)      # imm = 0x2000000
jne 0x1693c1
jmp 0x1693cb
movl $0x5, %edi
callq 0x95180
leaq 0x2354e6(%rip), %rax    # 0x39e8b8
movb $0x0, (%rax)
popq %rbp
retq
nopw (%rax,%rax)
// File: jkingan[P]ladyheather/heathmsc.cpp
// Function: init_lpt()
unsigned init_lpt()   /* init LPT port,  return base I/O address */
{
   if(lpt_port == 1) return 0x378;
   if(lpt_port == 2) return 0x278;
   if(lpt_port == 3) return 0x3BC;
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x22ce11(%rip), %rax    # 0x3961fc
cmpl $0x1, (%rax)
jne 0x1693f9
movl $0x378, -0x4(%rbp)      # imm = 0x378
jmp 0x16942a
leaq 0x22cdfc(%rip), %rax    # 0x3961fc
cmpl $0x2, (%rax)
jne 0x16940e
movl $0x278, -0x4(%rbp)      # imm = 0x278
jmp 0x16942a
leaq 0x22cde7(%rip), %rax    # 0x3961fc
cmpl $0x3, (%rax)
jne 0x169423
movl $0x3bc, -0x4(%rbp)      # imm = 0x3BC
jmp 0x16942a
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nop
// File: jkingan[P]ladyheather/heathmsc.cpp
// Function: set_default_pid(int)
void set_default_pid(int pid_num)
{
   // standard filter constants
   FILTER_OFFSET = 0.0F;
   FILTER_TC = 2.0F;
   k6 = 0.0F;
   k7 = 0.0F;
   k8 = 1.0F;
   integrator = 0.0F;

   if(pid_num == 0) {        // Warren's tortise slow default values
      P_GAIN = 1.50F; 
      D_TC = 45.0F;
      I_TC = 180.0F;
   }
   else if(pid_num == 1) {   // Mark's medium fast hare values
      P_GAIN = 3.5F;  // 5.0F;
      D_TC = 25.0F;   // 32.0F; 
      I_TC = 100.0F;  // 120.0F 
   }
   else if(pid_num == 2) {   // Mark's fast hare values
      P_GAIN = 10.0F;  
      D_TC = 28.0;     
      I_TC = 112.0F;   
   }
   else if(pid_num == 3) {   // Mark's fast hare-on-meth values
      P_GAIN = 24.0F;  
      D_TC = 12.0;     
      I_TC = 48.0F;   
   }

   calc_k_factors();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
leaq 0x2351f6(%rip), %rax    # 0x39e848
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
leaq 0x2351d8(%rip), %rax    # 0x39e838
movsd 0x5ae8(%rip), %xmm0     # 0x16f150
movsd %xmm0, (%rax)
xorps %xmm0, %xmm0
movsd %xmm0, 0x34b6d1(%rip)   # 0x4b4d48
xorps %xmm0, %xmm0
movsd %xmm0, 0x34b6ce(%rip)   # 0x4b4d50
movsd 0x59de(%rip), %xmm0     # 0x16f068
movsd %xmm0, 0x34b6c6(%rip)   # 0x4b4d58
xorps %xmm0, %xmm0
movsd %xmm0, 0x34b683(%rip)   # 0x4b4d20
cmpl $0x0, -0x4(%rbp)
jne 0x1696e1
leaq 0x23517e(%rip), %rax    # 0x39e828
movsd 0x5a26(%rip), %xmm0     # 0x16f0d8
movsd %xmm0, (%rax)
leaq 0x235173(%rip), %rax    # 0x39e830
movsd 0x25aab(%rip), %xmm0    # 0x18f170
movsd %xmm0, (%rax)
leaq 0x235170(%rip), %rax    # 0x39e840
movsd 0x59a0(%rip), %xmm0     # 0x16f078
movsd %xmm0, (%rax)
jmp 0x1697ab
cmpl $0x1, -0x4(%rbp)
jne 0x169725
leaq 0x23513a(%rip), %rax    # 0x39e828
movsd 0x25a72(%rip), %xmm0    # 0x18f168
movsd %xmm0, (%rax)
leaq 0x23512f(%rip), %rax    # 0x39e830
movsd 0x1998f(%rip), %xmm0    # 0x183098
movsd %xmm0, (%rax)
leaq 0x23512c(%rip), %rax    # 0x39e840
movsd 0x5934(%rip), %xmm0     # 0x16f050
movsd %xmm0, (%rax)
jmp 0x1697a9
cmpl $0x2, -0x4(%rbp)
jne 0x169766
leaq 0x2350f6(%rip), %rax    # 0x39e828
movsd 0x5986(%rip), %xmm0     # 0x16f0c0
movsd %xmm0, (%rax)
leaq 0x2350eb(%rip), %rax    # 0x39e830
movsd 0x2590b(%rip), %xmm0    # 0x18f058
movsd %xmm0, (%rax)
leaq 0x2350e8(%rip), %rax    # 0x39e840
movsd 0x25a00(%rip), %xmm0    # 0x18f160
movsd %xmm0, (%rax)
jmp 0x1697a7
cmpl $0x3, -0x4(%rbp)
jne 0x1697a5
leaq 0x2350b5(%rip), %rax    # 0x39e828
movsd 0x58bd(%rip), %xmm0     # 0x16f038
movsd %xmm0, (%rax)
leaq 0x2350aa(%rip), %rax    # 0x39e830
movsd 0x199c2(%rip), %xmm0    # 0x183150
movsd %xmm0, (%rax)
leaq 0x2350a7(%rip), %rax    # 0x39e840
movsd 0x19a17(%rip), %xmm0    # 0x1831b8
movsd %xmm0, (%rax)
jmp 0x1697a7
jmp 0x1697a9
jmp 0x1697ab
callq 0x169430
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq 0x23122d(%rip), %rax    # 0x39a9fc
cmpl $0x0, (%rax)
je 0x1697d9
jmp 0x1698ab
leaq 0x235048(%rip), %rax    # 0x39e828
movsd (%rax), %xmm0
movsd 0x34b53c(%rip), %xmm1   # 0x4b4d28
leaq 0x23503d(%rip), %rax    # 0x39e830
movsd (%rax), %xmm2
movsd 0x34b531(%rip), %xmm3   # 0x4b4d30
leaq 0x235032(%rip), %rax    # 0x39e838
movsd (%rax), %xmm4
movsd 0x34b526(%rip), %xmm5   # 0x4b4d38
leaq 0x235027(%rip), %rax    # 0x39e840
movsd (%rax), %xmm6
movsd 0x34b51b(%rip), %xmm7   # 0x4b4d40
leaq 0x23501c(%rip), %rax    # 0x39e848
movsd (%rax), %xmm12
movsd 0x34b50e(%rip), %xmm11  # 0x4b4d48
movsd 0x34b50d(%rip), %xmm10  # 0x4b4d50
movsd 0x34b50c(%rip), %xmm9   # 0x4b4d58
leaq 0x234ffd(%rip), %rax    # 0x39e850
movsd (%rax), %xmm8
leaq 0x2341d1(%rip), %rdi    # 0x39da30
leaq 0x2f1a7(%rip), %rsi     # 0x198a0d
movl $0x1a, %r9d
movl %r9d, %edx
movl %r9d, %ecx
movl %r9d, %r8d
movsd %xmm12, (%rsp)
movsd %xmm11, 0x8(%rsp)
movsd %xmm10, 0x10(%rsp)
movsd %xmm9, 0x18(%rsp)
movsd %xmm8, 0x20(%rsp)
movb $0x8, %al
callq 0x9060
leaq 0x234c07(%rip), %rax    # 0x39e4ac
movl $0x3, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heathmsc.cpp
// Function: control_temp()
void control_temp()
{
char cmd[SLEN];

   if(temp_control_on == 0) return;

   if((test_heat > 0.0F) || (test_cool > 0.0F)) {  // manual pwm control is in effect
      heat_time = test_heat;
      cool_time = test_cool;

      sprintf(cmd, "$CTRL %04d", (int) (heat_time-cool_time));
      send_fan_cmd(cmd);

      #ifdef DEBUG_TEMP_CONTROL
         if(pid_debug || bang_bang) {
            sprintf(debug_text,  "heat:%.1f ms  cool:%.1f ms", heat_time, cool_time);
         }
      #endif
   }
   else {   // we are doing the PID filter stuff
      temp_pid_filter();     // update the PID and fan speed
      analyze_bang_bang();   // do autotune analysis
   }

   last_temp = this_temperature;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
leaq 0x2345af(%rip), %rax    # 0x39efa1
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x16a9ff
jmp 0x16aadf
leaq 0x233e02(%rip), %rax    # 0x39e808
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
ja 0x16aa2b
leaq 0x233df6(%rip), %rax    # 0x39e810
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x16aac5
leaq 0x233dd6(%rip), %rax    # 0x39e808
movsd (%rax), %xmm0
movsd %xmm0, 0x34a1f2(%rip)   # 0x4b4c30
leaq 0x233dcb(%rip), %rax    # 0x39e810
movsd (%rax), %xmm0
movsd %xmm0, 0x34a1e7(%rip)   # 0x4b4c38
leaq -0x100(%rbp), %rdi
movsd 0x34a1d0(%rip), %xmm0   # 0x4b4c30
subsd 0x34a1d0(%rip), %xmm0   # 0x4b4c38
cvttsd2si %xmm0, %edx
leaq 0x2e007(%rip), %rsi     # 0x198a7a
movb $0x0, %al
callq 0x9060
leaq -0x100(%rbp), %rdi
callq 0x83980
leaq 0x233d93(%rip), %rax    # 0x39e820
cmpb $0x0, (%rax)
jne 0x16aa9e
leaq 0x233d83(%rip), %rax    # 0x39e81c
cmpl $0x0, (%rax)
je 0x16aac3
movsd 0x34a18a(%rip), %xmm0   # 0x4b4c30
movsd 0x34a18a(%rip), %xmm1   # 0x4b4c38
leaq 0x2330cb(%rip), %rdi    # 0x39db80
leaq 0x2e094(%rip), %rsi     # 0x198b50
movb $0x2, %al
callq 0x9060
jmp 0x16aacf
callq 0x169b60
callq 0x169f80
movsd 0x34a121(%rip), %xmm0   # 0x4b4bf8
movsd %xmm0, 0x34a121(%rip)   # 0x4b4c00
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nopl (%rax,%rax)
// File: jkingan[P]ladyheather/heathmsc.cpp
// Function: apply_heat()
void apply_heat(void)
{
   if(lpt_addr) {  // using parallel port to control temp
      lpt_val = (lpt_val & 0xF0) | 0x09;
      outp(lpt_addr, lpt_val);
   }
   else if(com[fan_port].com_port > 0) { // using serial port DTR line to control temp
      SetDtrLine(fan_port, HEAT);
      SetRtsLine(fan_port, ENABLE);
   }

   if(a_heating == 0) {
      heat_on_tick = GetMsecs(); 
   }
   a_heating = 1;
   a_cooling = 0;
   a_holding = 0;
   temp_dir = UP_ARROW;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x2344b5(%rip), %rax    # 0x39efb0
cmpl $0x0, (%rax)
je 0x16ab37
leaq 0x2344ad(%rip), %rax    # 0x39efb4
movzbl (%rax), %eax
andl $0xf0, %eax
orl $0x9, %eax
movb %al, %cl
leaq 0x234499(%rip), %rax    # 0x39efb4
movb %cl, (%rax)
leaq 0x23448c(%rip), %rax    # 0x39efb0
movl (%rax), %edi
leaq 0x234487(%rip), %rax    # 0x39efb4
movzbl (%rax), %esi
callq 0xb650
jmp 0x16ab7a
leaq 0x20296e(%rip), %rax    # 0x36d4ac
movl (%rax), %eax
movl %eax, %ecx
leaq 0x202977(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
cmpl $0x0, (%rax)
jle 0x16ab78
leaq 0x20294d(%rip), %rax    # 0x36d4ac
movl (%rax), %edi
xorl %esi, %esi
callq 0xb660
leaq 0x20293d(%rip), %rax    # 0x36d4ac
movl (%rax), %edi
xorl %esi, %esi
callq 0xb700
jmp 0x16ab7a
movzbl 0x34a06f(%rip), %eax    # 0x4b4bf0
cmpl $0x0, %eax
jne 0x16ab93
callq 0xb630
movsd %xmm0, 0x34a0ad(%rip)   # 0x4b4c40
movb $0x1, 0x34a056(%rip)    # 0x4b4bf0
movb $0x0, 0x34a050(%rip)    # 0x4b4bf1
movb $0x0, 0x34a04a(%rip)    # 0x4b4bf2
leaq 0x2015b9(%rip), %rax    # 0x36c168
movb $0x18, (%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heathmsc.cpp
// Function: apply_cool()
void apply_cool() 
{
   if(lpt_addr) {  // using parallel port to control temp
      lpt_val = (lpt_val & 0xF0) | 0x0A;
      outp(lpt_addr, lpt_val);
   }
   else if(com[fan_port].com_port > 0) { // using serial port DTR line to control temp
      SetDtrLine(fan_port, COOL);
      SetRtsLine(fan_port, ENABLE);
   }

   if(a_cooling == 0) {
      cool_on_tick = GetMsecs(); 
   }
   a_cooling = 1;
   a_heating = 0;
   a_holding = 0;
   temp_dir = DOWN_ARROW;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x2343e5(%rip), %rax    # 0x39efb0
cmpl $0x0, (%rax)
je 0x16ac07
leaq 0x2343dd(%rip), %rax    # 0x39efb4
movzbl (%rax), %eax
andl $0xf0, %eax
orl $0xa, %eax
movb %al, %cl
leaq 0x2343c9(%rip), %rax    # 0x39efb4
movb %cl, (%rax)
leaq 0x2343bc(%rip), %rax    # 0x39efb0
movl (%rax), %edi
leaq 0x2343b7(%rip), %rax    # 0x39efb4
movzbl (%rax), %esi
callq 0xb650
jmp 0x16ac4d
leaq 0x20289e(%rip), %rax    # 0x36d4ac
movl (%rax), %eax
movl %eax, %ecx
leaq 0x2028a7(%rip), %rax    # 0x36d4c0
imulq $0x2260, %rcx, %rcx     # imm = 0x2260
addq %rcx, %rax
cmpl $0x0, (%rax)
jle 0x16ac4b
leaq 0x20287d(%rip), %rax    # 0x36d4ac
movl (%rax), %edi
movl $0x1, %esi
callq 0xb660
leaq 0x20286a(%rip), %rax    # 0x36d4ac
movl (%rax), %edi
xorl %esi, %esi
callq 0xb700
jmp 0x16ac4d
movzbl 0x349f9d(%rip), %eax    # 0x4b4bf1
cmpl $0x0, %eax
jne 0x16ac66
callq 0xb630
movsd %xmm0, 0x349fe2(%rip)   # 0x4b4c48
movb $0x1, 0x349f84(%rip)    # 0x4b4bf1
movb $0x0, 0x349f7c(%rip)    # 0x4b4bf0
movb $0x0, 0x349f77(%rip)    # 0x4b4bf2
leaq 0x2014e6(%rip), %rax    # 0x36c168
movb $0x19, (%rax)
popq %rbp
retq
nopw (%rax,%rax)