LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/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 0x13c012(%rip), %rax    # 0x226cf8
xorpd %xmm4, %xmm4
ucomisd (%rax), %xmm4
jae 0xead55
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movsd %xmm0, -0x10(%rbp)
movsd %xmm2, -0x18(%rbp)
movsd %xmm3, -0x20(%rbp)
leaq 0x13bfd2(%rip), %rax    # 0x226ce0
cmpl $0x0, (%rax)
jne 0xead22
movsd %xmm1, -0x8(%rbp)
callq 0x10118
movsd -0x8(%rbp), %xmm1
movaps %xmm1, %xmm0
xorl %edi, %edi
callq 0xea2e5
movsd -0x10(%rbp), %xmm0
xorl %edi, %edi
callq 0xea737
movsd -0x18(%rbp), %xmm0
xorl %edi, %edi
callq 0xea915
movsd -0x20(%rbp), %xmm0
xorl %edi, %edi
addq $0x20, %rsp
popq %rbp
jmp 0xeaafa
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x139da3(%rip), %rax    # 0x226c80
movslq (%rax), %rax
leaq 0x139c01(%rip), %rcx    # 0x226ae8
movsd (%rcx), %xmm3
leaq 0x139bfe(%rip), %rdx    # 0x226af0
movsd (%rdx), %xmm1
leaq 0x139dbf(%rip), %rsi    # 0x226cbc
movl (%rsi), %esi
imulq $0x38, %rax, %r8
addq %r8, %rdi
addq $0x10, %rdi
xorpd %xmm0, %xmm0
cmpq $0x63, %rax
jg 0xecf68
cmpl %esi, -0xc(%rdi)
jl 0xecf25
movsd (%rdi), %xmm2
ucomisd %xmm0, %xmm2
jne 0xecf3e
jp 0xecf3e
movapd %xmm1, %xmm4
movapd %xmm3, %xmm2
incq %rax
addq $0x38, %rdi
movapd %xmm4, %xmm1
movapd %xmm2, %xmm3
jmp 0xecf0e
ucomisd %xmm3, %xmm2
jbe 0xecf4e
movsd %xmm2, (%rcx)
movsd (%rdi), %xmm4
jmp 0xecf56
movapd %xmm2, %xmm4
movapd %xmm3, %xmm2
ucomisd %xmm4, %xmm1
jbe 0xecf62
movsd %xmm4, (%rdx)
jmp 0xecf2d
movapd %xmm1, %xmm4
jmp 0xecf2d
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
cmpl $0x3, %edx
pushq $0x2
popq %rax
cmovll %eax, %ecx
movq %rsi, %rbx
andq $0x0, 0x45(%rsi)
andq $0x0, 0x40(%rsi)
movl %ecx, 0x8(%rsi)
pushq $0x1
popq %rdx
shll %cl, %edx
movl %edx, 0xc(%rsi)
leal 0x1(%rdx), %esi
movl %esi, 0x10(%rbx)
addl $0x2, %edx
movl %edx, 0x14(%rbx)
leal 0x1(%rcx), %edx
movl %edx, 0x18(%rbx)
shll %cl, %eax
movl %eax, 0x1c(%rbx)
movl $0x1001, 0x24(%rbx)     # imm = 0x1001
andl $0x0, 0x2c(%rbx)
movq %rdi, %r14
andq $0x0, 0x30(%rbx)
movl %ecx, %esi
callq 0xedcb4
callq 0xedccf
movl 0xc(%rbx), %edx
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0xedcf8
// File: /workspace/github_cpp_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rsi, %rbx
movq %rdi, %r15
cmpl $0x1000, %edx           # imm = 0x1000
jne 0xedd81
movl 0x2c(%rbx), %eax
testl %eax, %eax
jle 0xedd3d
movzbl 0x30(%rbx), %edx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xede02
shrq $0x8, 0x30(%rbx)
movl 0x2c(%rbx), %eax
addl $-0x8, %eax
movl %eax, 0x2c(%rbx)
jmp 0xedd1a
andl $0x0, 0x2c(%rbx)
movq %r15, %rdi
movq %rbx, %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0xede02
cmpl $0xfff, %r14d           # imm = 0xFFF
jg 0xedd72
movl 0x1c(%rbx), %eax
cmpl %eax, 0x14(%rbx)
jl 0xedd72
movl 0x18(%rbx), %ecx
incl %ecx
movl %ecx, 0x18(%rbx)
pushq $0x1
popq %rax
shll %cl, %eax
movl %eax, 0x1c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movslq %r14d, %rax
movl 0x2c(%rbx), %ecx
shlq %cl, %rax
orq 0x30(%rbx), %rax
leaq 0x2c(%rbx), %r12
movq %rax, 0x30(%rbx)
leaq 0x18(%rbx), %rdx
pushq $-0x8
popq %r13
addl (%rdx), %ecx
movl %ecx, (%r12)
cmpl $0x8, %ecx
jl 0xedd51
movzbl %al, %edx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xede02
movq 0x30(%rbx), %rax
shrq $0x8, %rax
movq %rax, 0x30(%rbx)
movq %r12, %rdx
movl %r13d, %ecx
jmp 0xedd9e
// File: /workspace/github_cpp_makefile_star2_O2/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 0xede9b
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), %esi
cmpl $0x1000, %edx           # imm = 0x1000
jne 0xede60
testl %esi, %esi
je 0xede4d
movq %r14, %rdi
callq 0xedcb4
movl 0x48(%rbx), %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0xede9c
andl $0x0, 0x48(%rbx)
movq %r14, %rdi
xorl %esi, %esi
callq 0xedcb4
movl $0x1, 0x40(%rbx)
jmp 0xede93
cmpl $0xff, %esi
jne 0xede85
movq %r14, %rdi
movl $0xff, %esi
callq 0xedcb4
movl 0x48(%rbx), %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0xede9c
xorl %esi, %esi
leal 0x1(%rsi), %eax
movl %eax, 0x48(%rbx)
movslq %esi, %rax
movb %r15b, 0x4c(%rbx,%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0xee15b
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), %r14
movq 0x20(%r14), %r12
movl (%r14), %esi
movq %rbx, %rdi
callq 0xedebe
movl 0x4(%r14), %esi
movq %rbx, %rdi
callq 0xedebe
xorl %eax, %eax
cmpl $0x0, 0x8(%r14)
setne %al
shll $0x7, %eax
movl 0xc(%r14), %ecx
movl 0x14(%r14), %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
movzbl %dil, %edi
movq %rbx, %rsi
callq 0x9740
movl 0x18(%r14), %edi
movq %rbx, %rsi
callq 0x9740
movl 0x1c(%r14), %edi
movq %rbx, %rsi
callq 0x9740
cmpl $0x0, 0x8(%r14)
je 0xee14d
xorl %r13d, %r13d
movslq (%r12), %rax
cmpq %rax, %r13
jge 0xee14d
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
jmp 0xee10a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq $0x2c
popq %rsi
callq 0xedcb4
movl (%r14), %esi
movq %rbx, %rdi
callq 0xedebe
movl 0x4(%r14), %esi
movq %rbx, %rdi
callq 0xedebe
movl 0x8(%r14), %esi
movq %rbx, %rdi
callq 0xedebe
movl 0xc(%r14), %esi
movq %rbx, %rdi
callq 0xedebe
movb 0x1c(%r14), %al
shlb $0x3, %al
andb $0x18, %al
cmpl $0x0, 0x10(%r14)
je 0xee1c2
movb 0x20(%r14), %cl
decb %cl
orb %cl, %al
movzbl %al, %esi
movq %rbx, %rdi
callq 0xedcb4
movl 0x20(%r14), %edx
leaq 0x35122c(%rip), %r12    # 0x43f404
movq %rbx, %rdi
movq %r12, %rsi
callq 0xedc42
xorl %r13d, %r13d
cmpl 0xc(%r14), %r13d
jge 0xee209
callq 0xc067d
leal (%r15,%r13), %edx
movl 0x8(%r14), %ecx
movq %rbx, %rdi
movq %r12, %rsi
callq 0xedf03
incl %r13d
jmp 0xee1e6
leaq 0x3511f4(%rip), %rsi    # 0x43f404
movq %rbx, %rdi
callq 0xeddcb
pushq $0x3b
popq %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xedcb4
// File: /workspace/github_cpp_makefile_star2_O2/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 0x23a64b(%rip), %rbx    # 0x3296d8
cmpb $0x0, (%rbx)
je 0xef0b7
leaq 0x2083fb(%rip), %rax    # 0x2f7494
movb $0x1, (%rax)
leaq 0x11382d(%rip), %rax    # 0x2028d0
cmpq $0x2000000, (%rax)      # imm = 0x2000000
je 0xef0b4
pushq $0x5
popq %rdi
callq 0x6434c
movb $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x23a573(%rip), %rax    # 0x329660
movsd (%rax), %xmm2
movsd 0x3f77(%rip), %xmm0     # 0xf3070
movapd %xmm0, %xmm3
divsd %xmm2, %xmm3
leaq 0x23a540(%rip), %rax    # 0x329648
movsd (%rax), %xmm1
mulsd %xmm1, %xmm3
xorpd %xmm4, %xmm4
cmpneqsd %xmm4, %xmm2
andpd %xmm3, %xmm2
movlpd %xmm2, 0x35062b(%rip)   # 0x43f750
leaq 0x23a52c(%rip), %rax    # 0x329658
movsd (%rax), %xmm2
ucomisd %xmm4, %xmm2
jbe 0xef167
addsd %xmm0, %xmm2
movapd %xmm0, %xmm4
divsd %xmm2, %xmm4
leaq 0x23a507(%rip), %rax    # 0x329650
movsd (%rax), %xmm3
xorpd 0x405b(%rip), %xmm3     # 0xf31b0
mulsd %xmm1, %xmm3
divsd %xmm2, %xmm3
movapd %xmm0, %xmm2
subsd %xmm4, %xmm2
jmp 0xef17e
leaq 0x23a4e2(%rip), %rax    # 0x329650
movsd (%rax), %xmm3
xorpd 0x4036(%rip), %xmm3     # 0xf31b0
mulsd %xmm1, %xmm3
movsd %xmm2, 0x3505c2(%rip)   # 0x43f748
movsd %xmm3, 0x3505b2(%rip)   # 0x43f740
subsd %xmm2, %xmm0
mulsd %xmm0, %xmm1
subsd %xmm3, %xmm1
movsd %xmm1, 0x350596(%rip)   # 0x43f738
leaq 0x23a497(%rip), %rax    # 0x329640
cmpb $0x0, (%rax)
jne 0xef1ba
leaq 0x23a487(%rip), %rax    # 0x32963c
cmpl $0x0, (%rax)
je 0xef1f0
leaq 0x23a477(%rip), %rax    # 0x329638
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 0x116149(%rip), %rax    # 0x205328
movq (%rax), %rax
movslq %edx, %rcx
leaq 0x1160c4(%rip), %rdx    # 0x2052b0
movq %rax, (%rdx,%rcx,8)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x236585(%rip), %rax    # 0x32581c
cmpl $0x0, (%rax)
je 0xef29d
retq
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq 0x23a39c(%rip), %rax    # 0x329648
movsd (%rax), %xmm0
movsd 0x350480(%rip), %xmm1   # 0x43f738
leaq 0x23a391(%rip), %rax    # 0x329650
movsd (%rax), %xmm2
movsd 0x350475(%rip), %xmm3   # 0x43f740
leaq 0x23a386(%rip), %rax    # 0x329658
movsd (%rax), %xmm4
movsd 0x35046a(%rip), %xmm5   # 0x43f748
leaq 0x23a37b(%rip), %rax    # 0x329660
movsd (%rax), %xmm6
movsd 0x35045f(%rip), %xmm7   # 0x43f750
leaq 0x23a370(%rip), %rax    # 0x329668
movsd (%rax), %xmm8
movsd 0x350452(%rip), %xmm9   # 0x43f758
movsd 0x350451(%rip), %xmm10  # 0x43f760
movsd 0x350450(%rip), %xmm11  # 0x43f768
leaq 0x23a351(%rip), %rax    # 0x329670
movsd (%rax), %xmm12
movsd %xmm12, 0x20(%rsp)
movsd %xmm11, 0x18(%rsp)
movsd %xmm10, 0x10(%rsp)
movsd %xmm9, 0x8(%rsp)
movsd %xmm8, (%rsp)
leaq 0x239503(%rip), %rdi    # 0x328850
leaq 0x30a4c(%rip), %rsi     # 0x11fda0
pushq $0x1a
popq %rcx
movl %ecx, %edx
movl %ecx, %r8d
movl %ecx, %r9d
movb $0x8, %al
callq 0x9060
leaq 0x239f5f(%rip), %rax    # 0x3292cc
movl $0x3, (%rax)
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x35036f(%rip), %xmm1   # 0x43f6f0
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0xef394
jp 0xef394
pushq $0x1
jmp 0xef416
movsd 0x35035c(%rip), %xmm1   # 0x43f6f8
ucomisd %xmm0, %xmm1
jne 0xef3a8
jp 0xef3a8
pushq $0x2
jmp 0xef416
movsd 0x3502c8(%rip), %xmm0   # 0x43f678
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xef3c0
jp 0xef3c0
pushq $0x3
jmp 0xef416
movl 0x3503fa(%rip), %ecx    # 0x43f7c0
cmpl $0x2, %ecx
jge 0xef3cf
pushq $0x4
jmp 0xef416
movl 0x35043b(%rip), %eax    # 0x43f810
cmpl $0x2, %eax
jge 0xef3de
pushq $0x5
jmp 0xef416
movl %ecx, %esi
shrl %esi
leaq 0x350397(%rip), %rdx    # 0x43f780
movsd (%rdx,%rsi,8), %xmm0
cmpq $0x2, %rcx
je 0xef40c
leal -0x1(%rsi), %ecx
addsd (%rdx,%rcx,8), %xmm0
movl %esi, %ecx
addsd 0x8(%rdx,%rcx,8), %xmm0
divsd 0x6674(%rip), %xmm0     # 0xf5a80
ucomisd %xmm1, %xmm0
jne 0xef418
jp 0xef418
pushq $0x6
popq %rax
retq
leaq 0x23a251(%rip), %rcx    # 0x329670
movsd (%rcx), %xmm1
addsd %xmm1, %xmm1
mulsd 0x27289(%rip), %xmm1    # 0x1166b8
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
divsd %xmm0, %xmm1
leaq 0x23a206(%rip), %rcx    # 0x329648
movsd %xmm1, (%rcx)
movl %eax, %edx
shrl %edx
leaq 0x35037f(%rip), %rcx    # 0x43f7d0
movsd (%rcx,%rdx,8), %xmm0
cmpq $0x2, %rax
je 0xef474
leal -0x1(%rdx), %eax
addsd (%rcx,%rax,8), %xmm0
movl %edx, %eax
addsd 0x8(%rcx,%rax,8), %xmm0
divsd 0x660c(%rip), %xmm0     # 0xf5a80
pushq %rbp
movq %rsp, %rbp
cvtsd2ss %xmm0, %xmm0
movss 0x7c70(%rip), %xmm1     # 0xf70f4
mulss %xmm0, %xmm1
cvtss2sd %xmm1, %xmm1
leaq 0x23a1cd(%rip), %rax    # 0x329660
movsd %xmm1, (%rax)
mulss 0x27371(%rip), %xmm0    # 0x116810
cvtss2sd %xmm0, %xmm0
leaq 0x23a1a6(%rip), %rax    # 0x329650
movsd %xmm0, (%rax)
andq $0x0, 0x3502a2(%rip)    # 0x43f758
callq 0xef0e2
callq 0x30ec4
callq 0xef290
leaq 0x23a170(%rip), %rax    # 0x32963c
andl $0x0, (%rax)
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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:
leaq 0x239e9b(%rip), %rax    # 0x329dc1
cmpb $0x0, (%rax)
je 0xefffb
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
leaq 0x2396e6(%rip), %rax    # 0x329628
movsd (%rax), %xmm0
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm0
leaq 0x2396db(%rip), %rax    # 0x329630
movsd (%rax), %xmm1
ja 0xeff6d
ucomisd %xmm2, %xmm1
ja 0xeff6d
callq 0xef4d3
callq 0xef77e
jmp 0xeffe2
movsd %xmm0, 0x34f6cb(%rip)   # 0x43f640
movsd %xmm1, 0x34f6cb(%rip)   # 0x43f648
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %edx
leaq 0x2fe81(%rip), %rsi     # 0x11fe0d
leaq -0x110(%rbp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
callq 0x57ddb
leaq 0x239694(%rip), %rax    # 0x329640
cmpb $0x0, (%rax)
jne 0xeffbd
leaq 0x239684(%rip), %rax    # 0x32963c
cmpl $0x0, (%rax)
je 0xeffe2
movsd 0x34f67b(%rip), %xmm0   # 0x43f640
movsd 0x34f67b(%rip), %xmm1   # 0x43f648
leaq 0x2389cc(%rip), %rdi    # 0x3289a0
leaq 0x2ff08(%rip), %rsi     # 0x11fee3
movb $0x2, %al
callq 0x9060
movsd 0x34f61e(%rip), %xmm0   # 0x43f608
movsd %xmm0, 0x34f61e(%rip)   # 0x43f610
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %rbx
pushq %rax
leaq 0x239dc7(%rip), %rax    # 0x329dd0
movl (%rax), %edi
testl %edi, %edi
je 0xf0029
leaq 0x239dbe(%rip), %rax    # 0x329dd4
movzbl (%rax), %esi
andl $-0x10, %esi
orl $0x9, %esi
movb %sil, (%rax)
callq 0xad52
jmp 0xf0056
leaq 0x20829c(%rip), %rbx    # 0x2f82cc
movl (%rbx), %edi
imulq $0x2260, %rdi, %rax     # imm = 0x2260
leaq 0x2082a0(%rip), %rcx    # 0x2f82e0
cmpl $0x0, (%rcx,%rax)
jle 0xf0056
xorl %esi, %esi
callq 0xad58
movl (%rbx), %edi
xorl %esi, %esi
callq 0xada4
cmpb $0x0, 0x34f5a3(%rip)    # 0x43f600
jne 0xf006c
callq 0xad3f
movsd %xmm0, 0x34f5e4(%rip)   # 0x43f650
movb $0x1, 0x34f58d(%rip)    # 0x43f600
xorl %eax, %eax
movb %al, 0x34f586(%rip)     # 0x43f601
movb %al, 0x34f581(%rip)     # 0x43f602
leaq 0x206f00(%rip), %rax    # 0x2f6f88
movb $0x18, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %rbx
pushq %rax
leaq 0x239d31(%rip), %rax    # 0x329dd0
movl (%rax), %edi
testl %edi, %edi
je 0xf00bf
leaq 0x239d28(%rip), %rax    # 0x329dd4
movzbl (%rax), %esi
andl $-0x10, %esi
orl $0xa, %esi
movb %sil, (%rax)
callq 0xad52
jmp 0xf00ed
leaq 0x208206(%rip), %rbx    # 0x2f82cc
movl (%rbx), %edi
imulq $0x2260, %rdi, %rax     # imm = 0x2260
leaq 0x20820a(%rip), %rcx    # 0x2f82e0
cmpl $0x0, (%rcx,%rax)
jle 0xf00ed
pushq $0x1
popq %rsi
callq 0xad58
movl (%rbx), %edi
xorl %esi, %esi
callq 0xada4
cmpb $0x0, 0x34f50d(%rip)    # 0x43f601
jne 0xf0103
callq 0xad3f
movsd %xmm0, 0x34f555(%rip)   # 0x43f658
movb $0x1, 0x34f4f7(%rip)    # 0x43f601
xorl %eax, %eax
movb %al, 0x34f4ee(%rip)     # 0x43f600
movb %al, 0x34f4ea(%rip)     # 0x43f602
leaq 0x206e69(%rip), %rax    # 0x2f6f88
movb $0x19, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: hold_temp()
void hold_temp()
{
   if(lpt_addr) {  // we are using the parallel port to control temp
      lpt_val = (lpt_val & 0xF0) | 0x06;
      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, DISABLE);
   }
   send_fan_cmd("$HOLD");

   if(a_holding == 0) {
      hold_on_tick = GetMsecs(); 
   }
   a_holding = 1;
   a_heating = 0;
   a_cooling = 0;
   temp_dir = '=';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x239c99(%rip), %rax    # 0x329dd0
movl (%rax), %edi
testl %edi, %edi
je 0xf0157
leaq 0x239c90(%rip), %rax    # 0x329dd4
movzbl (%rax), %esi
andl $-0x10, %esi
orl $0x6, %esi
movb %sil, (%rax)
callq 0xad52
jmp 0xf0189
leaq 0x20816e(%rip), %r14    # 0x2f82cc
movl (%r14), %edi
imulq $0x2260, %rdi, %rax     # imm = 0x2260
leaq 0x208171(%rip), %rcx    # 0x2f82e0
cmpl $0x0, (%rcx,%rax)
jle 0xf0189
pushq $0x1
popq %rbx
movl %ebx, %esi
callq 0xad58
movl (%r14), %edi
movl %ebx, %esi
callq 0xada4
leaq 0x2fd6e(%rip), %rdi     # 0x11fefe
callq 0x57ddb
cmpb $0x0, 0x34f466(%rip)    # 0x43f602
jne 0xf01ab
callq 0xad3f
movsd %xmm0, 0x34f4b5(%rip)   # 0x43f660
movb $0x1, 0x34f450(%rip)    # 0x43f602
xorl %eax, %eax
movb %al, 0x34f446(%rip)     # 0x43f600
movb %al, 0x34f441(%rip)     # 0x43f601
leaq 0x206dc1(%rip), %rax    # 0x2f6f88
movb $0x3d, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: enable_temp_control()
void enable_temp_control()
{
   if(lpt_port) {  // get lpt port address from bios area
      lpt_addr = init_lpt();
   }
   else lpt_addr = 0;

   if(lpt_addr) {  // turn on parallel port temp control unit
      lpt_val = (lpt_val & 0x0F) | 0x90;
      outp(lpt_addr, lpt_val);
   }
   else if(com[fan_port].com_port > 0) { // using serial port lines to control temp
      SetRtsLine(fan_port, ENABLE);
   }
   send_fan_cmd("$INIT");

   low_ok = high_ok = 0;
   HEAT_OVERSHOOT = COOL_UNDERSHOOT = 0.0F;

   temp_control_on = 1;
   hold_temp();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x230e42(%rip), %rax    # 0x32101c
cmpl $0x0, (%rax)
je 0xf0210
callq 0xef0be
leaq 0x239be5(%rip), %rcx    # 0x329dd0
movl %eax, (%rcx)
testl %eax, %eax
je 0xf021a
leaq 0x239bdc(%rip), %rcx    # 0x329dd4
movzbl (%rcx), %esi
andl $0xf, %esi
orl $0x90, %esi
movb %sil, (%rcx)
movl %eax, %edi
callq 0xad52
jmp 0xf023e
leaq 0x239bb9(%rip), %rax    # 0x329dd0
andl $0x0, (%rax)
leaq 0x2080ab(%rip), %rax    # 0x2f82cc
movl (%rax), %edi
imulq $0x2260, %rdi, %rax     # imm = 0x2260
leaq 0x2080af(%rip), %rcx    # 0x2f82e0
cmpl $0x0, (%rcx,%rax)
jle 0xf023e
xorl %esi, %esi
callq 0xada4
leaq 0x2fcbf(%rip), %rdi     # 0x11ff04
callq 0x57ddb
andq $0x0, 0x34f496(%rip)    # 0x43f6e8
andq $0x0, 0x34f486(%rip)    # 0x43f6e0
andq $0x0, 0x34f496(%rip)    # 0x43f6f8
andq $0x0, 0x34f486(%rip)    # 0x43f6f0
leaq 0x239b50(%rip), %rax    # 0x329dc1
movb $0x1, (%rax)
popq %rbp
jmp 0xf0129
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: disable_temp_control()
void disable_temp_control()
{
   if(temp_control_on == 0) return;

   hold_temp();
   if(lpt_addr) {  // using parallel port to control temp
      lpt_val = (lpt_val & 0x0F) | 0x60;
      outp(lpt_addr, lpt_val);
   }
   else if(com[fan_port].com_port > 0) { // using serial port to control temp
     SetRtsLine(fan_port, DISABLE);
   }
   send_fan_cmd("$STOP");

   temp_control_on = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x239b3a(%rip), %rbx    # 0x329dc1
cmpb $0x0, (%rbx)
je 0xf02ec
callq 0xf0129
leaq 0x239b38(%rip), %rax    # 0x329dd0
movl (%rax), %edi
testl %edi, %edi
je 0xf02b8
leaq 0x239b2f(%rip), %rax    # 0x329dd4
movzbl (%rax), %esi
andl $0xf, %esi
orl $0x60, %esi
movb %sil, (%rax)
callq 0xad52
jmp 0xf02dd
leaq 0x20800d(%rip), %rax    # 0x2f82cc
movl (%rax), %edi
imulq $0x2260, %rdi, %rax     # imm = 0x2260
leaq 0x208011(%rip), %rcx    # 0x2f82e0
cmpl $0x0, (%rcx,%rax)
jle 0xf02dd
pushq $0x1
popq %rsi
callq 0xada4
leaq 0x2fc26(%rip), %rdi     # 0x11ff0a
callq 0x57ddb
movb $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: show_osc_pid_values()
void show_osc_pid_values()
{
   if(dac_dac) return;

   sprintf(plot_title, "bP(%.2f %c %.4f) bD(%.2f %c %.4f) bF(%.2f %c %.4f) bI(%.1f %c %.3f)  bO=%.3f bL=%.3f bS=%.3f bR=%.3f b9=%-3d", 
      OSC_P_GAIN,RIGHT_ARROW,osc_k1, 
      OSC_D_TC,RIGHT_ARROW,osc_k2, 
      OSC_FILTER_TC,RIGHT_ARROW,osc_k3, 
      OSC_I_TC,RIGHT_ARROW,osc_k4, 
      OSC_FILTER_OFFSET, osc_k6, osc_k7, osc_k8, osc_postfilter);
   title_type = OTHER;
}

// Assembly:
leaq 0x2353b3(%rip), %rax    # 0x32581c
cmpl $0x0, (%rax)
je 0xf046f
retq
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq 0x239222(%rip), %rax    # 0x3296a0
movsd (%rax), %xmm0
movsd 0x34f3ce(%rip), %xmm1   # 0x43f858
leaq 0x239217(%rip), %rax    # 0x3296a8
movsd (%rax), %xmm2
movsd 0x34f3c3(%rip), %xmm3   # 0x43f860
leaq 0x23920c(%rip), %rax    # 0x3296b0
movsd (%rax), %xmm4
movsd 0x34f3b8(%rip), %xmm5   # 0x43f868
leaq 0x239201(%rip), %rax    # 0x3296b8
movsd (%rax), %xmm6
movsd 0x34f3ad(%rip), %xmm7   # 0x43f870
leaq 0x2391f6(%rip), %rax    # 0x3296c0
movsd (%rax), %xmm8
movsd 0x34f3a8(%rip), %xmm9   # 0x43f880
movsd 0x34f3a7(%rip), %xmm10  # 0x43f888
movsd 0x34f3a6(%rip), %xmm11  # 0x43f890
leaq 0x23919b(%rip), %rax    # 0x32968c
movl (%rax), %eax
movl %eax, 0x20(%rsp)
movsd %xmm11, 0x18(%rsp)
movsd %xmm10, 0x10(%rsp)
movsd %xmm9, 0x8(%rsp)
movsd %xmm8, (%rsp)
leaq 0x238337(%rip), %rdi    # 0x328850
leaq 0x2f9f0(%rip), %rsi     # 0x11ff10
pushq $0x1a
popq %rcx
movl %ecx, %edx
movl %ecx, %r8d
movl %ecx, %r9d
movb $0x8, %al
callq 0x9060
leaq 0x238d93(%rip), %rax    # 0x3292cc
movl $0x3, (%rax)
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: new_postfilter()
void new_postfilter()
{
double post_val;
int i;

   if(1 || (osc_postfilter < post_q_count)) {  // changing filter size,  rebuild filter queue
      if(post_q_count) post_val = post_q_sum / (double) post_q_count;
      else             post_val = osc_PID_out;
      post_q_sum = 0.0;
      for(i=0; i<osc_postfilter; i++) {
         osc_post_q[i] = post_val;
         post_q_sum += post_val;
      }
      post_q_count = osc_postfilter;
      post_q_in = 0;
   }
}

// Assembly:
leaq 0x2390f3(%rip), %rax    # 0x329690
movl (%rax), %ecx
testl %ecx, %ecx
je 0xf05b5
movsd 0x35099d(%rip), %xmm0   # 0x440f48
cvtsi2sd %ecx, %xmm1
divsd %xmm1, %xmm0
jmp 0xf05bd
movsd 0x34f263(%rip), %xmm0   # 0x43f820
andq $0x0, 0x350983(%rip)    # 0x440f48
leaq 0x2390c0(%rip), %rcx    # 0x32968c
movl (%rcx), %ecx
xorl %edx, %edx
testl %ecx, %ecx
movl $0x0, %esi
cmovgl %ecx, %esi
shlq $0x3, %rsi
xorpd %xmm1, %xmm1
leaq 0x34f697(%rip), %rdi    # 0x43fc80
cmpq %rdx, %rsi
je 0xf0605
movsd %xmm0, (%rdx,%rdi)
addsd %xmm0, %xmm1
movsd %xmm1, 0x350949(%rip)   # 0x440f48
addq $0x8, %rdx
jmp 0xf05e9
pushq %rbp
movq %rsp, %rbp
movl %ecx, (%rax)
leaq 0x239082(%rip), %rax    # 0x329694
andl $0x0, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: enable_osc_control()
void enable_osc_control()
{
   osc_discipline = 0;
   set_discipline_mode(SET_DIS_MODE_DISABLE);

   if(rcvr_type == X72_RCVR) {
      set_x72_dds(last_x72_dds);
      osc_pid_initial_voltage = (DATA_SIZE) last_x72_dds;
   }
   else {
      set_dac_voltage(dac_voltage, 5);
      osc_pid_initial_voltage = dac_voltage;
   }

   osc_control_on = 1;
   osc_rampup = 1.0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x20681d(%rip), %rax    # 0x2f7494
movb $0x0, (%rax)
pushq $0x4
popq %rdi
callq 0x6434c
leaq 0x111c47(%rip), %rax    # 0x2028d0
cmpq $0x2000000, (%rax)      # imm = 0x2000000
jne 0xf0ca4
leaq 0x114247(%rip), %rbx    # 0x204ee0
movsd (%rbx), %xmm0
callq 0x6779b
jmp 0xf0cb7
leaq 0x205d55(%rip), %rbx    # 0x2f6a00
movsd (%rbx), %xmm0
pushq $0x5
popq %rdi
callq 0x63c97
movsd (%rbx), %xmm0
leaq 0x20649e(%rip), %rax    # 0x2f7160
movsd %xmm0, (%rax)
leaq 0x238a0b(%rip), %rax    # 0x3296d8
movb $0x1, (%rax)
leaq 0x238a09(%rip), %rax    # 0x3296e0
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: control_osc()
void control_osc()
{
double true_pps;

   // calculate integral of osc signal
   if(trick_scale) {
      if(trick_tick) --trick_tick;
      else {
         true_pps = (pps_offset + trick_value);
         trick_value = (true_pps * trick_scale);

         if(trick_value > MAX_TRICK) trick_value = MAX_TRICK;
         else if(trick_value <= (-MAX_TRICK)) trick_value = (-MAX_TRICK);

         set_pps(user_pps_enable, pps_polarity,  trick_value*1.0E-9, pps1_delay, 300.0, 0);
         request_pps_info();
         sprintf(plot_title,  "Cable trick:  scale=%f  ofs=%f", trick_scale, trick_value);
         title_type = OTHER;
         trick_tick = 5;
      }
   }

   if(osc_control_on) {  // we are controlling the oscillator disciplining
      osc_pid_filter();
   }

   if(dac_dac) {         // we are doing a osc param autotune
      calc_osc_gain();
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x238a1f(%rip), %rbx    # 0x329718
movsd (%rbx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xf0d0d
jnp 0xf0dd2
movl 0x35023d(%rip), %eax    # 0x440f50
testl %eax, %eax
je 0xf0d1e
decl %eax
jmp 0xf0dcc
leaq 0x205a93(%rip), %rax    # 0x2f67b8
movsd (%rax), %xmm1
leaq 0x2389f8(%rip), %r14    # 0x329728
addsd (%r14), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, (%r14)
movsd 0x22f2(%rip), %xmm1     # 0xf3038
ucomisd %xmm1, %xmm0
ja 0xf0d5a
movsd 0x238c(%rip), %xmm1     # 0xf30e0
ucomisd %xmm0, %xmm1
jb 0xf0d63
movsd %xmm1, (%r14)
movapd %xmm1, %xmm0
leaq 0x206fb7(%rip), %rax    # 0x2f7d21
movzbl (%rax), %edi
leaq 0x206fa4(%rip), %rax    # 0x2f7d18
movzbl (%rax), %esi
mulsd 0x23c9(%rip), %xmm0     # 0xf3148
leaq 0x207052(%rip), %rax    # 0x2f7dd8
movsd (%rax), %xmm1
movss 0x25a76(%rip), %xmm2    # 0x116808
xorl %edx, %edx
callq 0x61e97
callq 0x61bf1
movsd (%rbx), %xmm0
movsd (%r14), %xmm1
leaq 0x237aa2(%rip), %rdi    # 0x328850
leaq 0x2f27c(%rip), %rsi     # 0x120031
movb $0x2, %al
callq 0x9060
leaq 0x238509(%rip), %rax    # 0x3292cc
movl $0x3, (%rax)
pushq $0x5
popq %rax
movl %eax, 0x35017e(%rip)    # 0x440f50
leaq 0x2388ff(%rip), %rax    # 0x3296d8
cmpb $0x0, (%rax)
je 0xf0de3
callq 0xf07af
leaq 0x234a32(%rip), %rax    # 0x32581c
cmpl $0x0, (%rax)
je 0xf0df8
popq %rbx
popq %r14
popq %rbp
jmp 0xeead3
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: logg2(long)
int logg2(long x)
{
    unsigned long mask,i;

    if(x == 0) return(-1L);     /* zero is an error, return -1 */
    x--;                        /* get the max index, x-1 */

    for(mask=1,i=0; ; mask*=2,i++) {
        if(x == 0) return(i);   /* return logg2 if all zero */
        x = x & (~mask);        /* AND off a bit */
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0xf1224
decq %rdi
xorl %eax, %eax
movabsq $0x1, %rcx
testq %rdi, %rdi
je 0xf1229
movq %rcx, %rdx
notq %rdx
andq %rdx, %rdi
addq %rcx, %rcx
incl %eax
jmp 0xf120f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: set_fft_scale()
void set_fft_scale()
{
   // configure FFT/histogram plot

   if(fft_type == HIST_TYPE) {     // doing histogram instead of FFT
      plot[FFT].plot_id = "HIST";
      if(fft_db) plot[FFT].units = "dB";
      else       plot[FFT].units = "cnt";

      plot[FFT].user_scale = 0;
      plot[FFT].scale_factor = 1.0F;
      plot[FFT].plot_center = 0.0F;
      plot[FFT].float_center = 1;

      fft_scale = 1;
   }
   else if(fft_db) {
      plot[FFT].plot_id = "FFT";          // assume we are doing an FFT
      plot[FFT].units = "dB";

      plot[FFT].user_scale = 0;
      plot[FFT].scale_factor = 1.0F;
      plot[FFT].plot_center = 0.0F;
      plot[FFT].float_center = 1;
   }
   else {
      plot[FFT].plot_id = "FFT";          // assume we are doing an FFT
      plot[FFT].units = "x ";

      plot[FFT].user_scale = 1;
      plot[FFT].scale_factor = 1.0F / ((float) PLOT_HEIGHT/(float)(VERT_MAJOR*2));
      plot[FFT].plot_center = 0.0F;
      plot[FFT].float_center = 0;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x113b46(%rip), %rax    # 0x20547d
cmpb $0x1, (%rax)
jne 0xf19b1
leaq 0x2e747(%rip), %rax     # 0x12008a
leaq 0x563e6(%rip), %rcx     # 0x147d30
movq %rax, 0xcb0(%rcx)
leaq 0x23843c(%rip), %rax    # 0x329d94
cmpb $0x0, (%rax)
leaq 0x2e72d(%rip), %rax     # 0x12008f
leaq 0x141e3(%rip), %rdx     # 0x105b4c
cmoveq %rax, %rdx
movq %rdx, 0xcb8(%rcx)
andl $0x0, 0xce0(%rcx)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0xce8(%rcx)
andq $0x0, 0xcd8(%rcx)
movl $0x1, 0xccc(%rcx)
leaq 0x2383e3(%rip), %rax    # 0x329d88
movq $0x1, (%rax)
jmp 0xf1a69
leaq 0x2383dc(%rip), %rax    # 0x329d94
cmpb $0x0, (%rax)
leaq 0x1cb8(%rip), %rcx      # 0xf367a
leaq 0x56367(%rip), %rax     # 0x147d30
movq %rcx, 0xcb0(%rax)
je 0xf1a0c
leaq 0x14173(%rip), %rcx     # 0x105b4c
movq %rcx, 0xcb8(%rax)
andl $0x0, 0xce0(%rax)
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, 0xce8(%rax)
andq $0x0, 0xcd8(%rax)
movl $0x1, 0xccc(%rax)
jmp 0xf1a69
leaq 0x110e75(%rip), %rcx    # 0x202888
cvtsi2ssl (%rcx), %xmm0
leaq 0x1afd2(%rip), %rcx     # 0x10c9f0
movq %rcx, 0xcb8(%rax)
movl $0x1, 0xce0(%rax)
leaq 0x110e36(%rip), %rcx    # 0x20286c
movl (%rcx), %ecx
addl %ecx, %ecx
cvtsi2ss %ecx, %xmm1
divss %xmm1, %xmm0
movss 0x56a2(%rip), %xmm1     # 0xf70ec
divss %xmm0, %xmm1
cvtss2sd %xmm1, %xmm0
movsd %xmm0, 0xce8(%rax)
andq $0x0, 0xcd8(%rax)
andl $0x0, 0xccc(%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: calc_fft(int)
long calc_fft(int id)
{
long length, m;
long points;

   fft_id = id;
   set_fft_scale();

   if(fft_type == HIST_TYPE) {  // do histogram instead of an FFT
      if(id == FFT) {
//      edit_error("Cannot calculate the histogram of the histogram plot!");
//      return 0;
id = pre_fft_plot;
      }
      points = calc_plot_hist(id);
   }
   else {  // do FFT instead of histogram
      if(id == FFT) {
        edit_error("Cannot calculate the FFT of the FFT plot!");
        return 0;
      }

      length = max_fft_len;
      if(length < 2) {  /* Check for power of 2 input size */
        edit_error("FFT size must be a power of 2 greater than 1");
        return 0;
      }

      m = logg2(length);
      if((1<<m) != length) {  /* Check for power of 2 input size */
        edit_error("FFT size must be a power of 2.");
        return 0;
      }

      fps = ((1.0F/view_interval)/2.0F) / (float) (length/2);
      points = process_signal(length, id);
   }

   // set scale factors and enable the FFT plot
   if(show_live_fft == 0) {
      plot[FFT].show_stat = 1;
      if(plot[FFT].show_plot == 0) toggle_plot(FFT);
   }

   return points;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
leaq 0x113841(%rip), %rax    # 0x20547e
movb %bl, (%rax)
callq 0xf192c
leaq 0x113832(%rip), %rax    # 0x20547d
cmpb $0x1, (%rax)
jne 0xf1ca3
cmpl $0xe, %ebx
jne 0xf1c5e
leaq 0x238108(%rip), %rax    # 0x329d64
movl (%rax), %ebx
movl %ebx, %edi
callq 0xf1d43
movq %rax, %rbx
leaq 0x1137bb(%rip), %rax    # 0x20542a
cmpb $0x0, (%rax)
jne 0xf1d3b
leaq 0x560b1(%rip), %rax     # 0x147d30
movl $0x1, 0xd84(%rax)
cmpl $0x0, 0xcc8(%rax)
jne 0xf1d3b
pushq $0xe
popq %rdi
callq 0x30233
jmp 0xf1d3b
cmpl $0xe, %ebx
jne 0xf1cb4
leaq 0x2e447(%rip), %rdi     # 0x1200f6
jmp 0xf1d34
leaq 0x2380bd(%rip), %rax    # 0x329d78
movq (%rax), %r14
cmpq $0x1, %r14
jg 0xf1ccd
leaq 0x2e455(%rip), %rdi     # 0x120120
jmp 0xf1d34
movq %r14, %rdi
callq 0xf11f7
pushq $0x1
popq %rdx
movl %eax, %ecx
shll %cl, %edx
movslq %edx, %rax
cmpq %rax, %r14
jne 0xf1d2d
leaq 0x1136b5(%rip), %rax    # 0x2053a0
cvtsi2ssq (%rax), %xmm0
movss 0x53f4(%rip), %xmm1     # 0xf70ec
divss %xmm0, %xmm1
mulss 0x53f4(%rip), %xmm1     # 0xf70f8
movq %r14, %rax
shrq %rax
cvtsi2ss %rax, %xmm0
divss %xmm0, %xmm1
leaq 0x238076(%rip), %rax    # 0x329d90
movss %xmm1, (%rax)
movq %r14, %rdi
movl %ebx, %esi
callq 0xf122b
jmp 0xf1c65
leaq 0x2e419(%rip), %rdi     # 0x12014d
callq 0x214df
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: dump_hist_plot()
void dump_hist_plot()
{
int i;
DATA_SIZE val;

   // dump the plot histogram data to the debug_file

   if(debug_file == 0) return;
   if(plot[FFT].show_plot == 0) return;
   if(fft_type != HIST_TYPE) return;

   if(show_live_fft) {
      fprintf(debug_file, "\nLive %s plot histogram:\n", plot[fft_id].plot_id);
   }
   else {
      fprintf(debug_file, "\nSingle %s plot histogram:\n", plot[fft_id].plot_id);
   }

   for(i=0; i<hist_size; i++) {
      if(plot_hist[i] == 0) continue;  // empty bin
      val = hist_minv + (hist_bin_width*((DATA_SIZE) i));
      fprintf(debug_file, "bin:%d  val:%.9f  count:%ld\n", i, val, plot_hist[i]);
   }

   fprintf(debug_file, "\n");
   fflush(debug_file);
}

// Assembly:
leaq 0x136202(%rip), %rax    # 0x228390
movq (%rax), %rdi
testq %rdi, %rdi
je 0xf226f
leaq 0x55b8f(%rip), %rax     # 0x147d30
cmpl $0x0, 0xcc8(%rax)
je 0xf226f
leaq 0x1132c8(%rip), %rcx    # 0x20547d
cmpb $0x1, (%rcx)
jne 0xf226f
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x113257(%rip), %rcx    # 0x20542a
leaq 0x1132a4(%rip), %rdx    # 0x20547e
movzbl (%rdx), %edx
imulq $0xe8, %rdx, %rdx
cmpb $0x0, (%rcx)
movq (%rax,%rdx), %rdx
leaq 0x2df94(%rip), %rax     # 0x120186
leaq 0x2df73(%rip), %rsi     # 0x12016c
cmoveq %rax, %rsi
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x9560
leaq 0x11b283(%rip), %rax    # 0x20d490
movq (%rax), %rax
leaq 0x113279(%rip), %r13    # 0x205490
leaq 0x11b27a(%rip), %r15    # 0x20d498
leaq 0x11b283(%rip), %r12    # 0x20d4a8
leaq 0x2df76(%rip), %r14     # 0x1201a2
cmpq %rbx, %rax
jle 0xf2270
movq (%r13,%rbx,8), %rcx
testq %rcx, %rcx
je 0xf226a
cvtsi2sd %ebx, %xmm0
mulsd (%r12), %xmm0
addsd (%r15), %xmm0
leaq 0x13613f(%rip), %rax    # 0x228390
movq (%rax), %rdi
movq %r14, %rsi
movl %ebx, %edx
movb $0x1, %al
callq 0x9560
leaq 0x11b229(%rip), %rax    # 0x20d490
movq (%rax), %rax
incq %rbx
jmp 0xf222c
retq
leaq 0x136119(%rip), %rbx    # 0x228390
movq (%rbx), %rsi
pushq $0xa
popq %rdi
callq 0x9480
movq (%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x9420
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: scale_hist_val(int, double)
DATA_SIZE scale_hist_val(int id, DATA_SIZE val)
{
   // convert a raw plot queue data value to it's displayed value

//!!!!!! we need to handle more cases... see label_cursor_val()
   if(tie_plot(id)) {  // it's a time interval error plot
      if(plot[id].show_freq) {  // frequency mode
         val = (DATA_SIZE) tie_to_freq(id, (double) val);
      } 
   }
   else if(id == TEMP) {
////  val /= 1000.0;
   }

   return val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movsd %xmm0, -0x10(%rbp)
movl %edi, %ebx
callq 0x13376
testl %eax, %eax
je 0xf22db
movslq %ebx, %rax
imulq $0xe8, %rax, %rax
leaq 0x55a71(%rip), %rcx     # 0x147d30
cmpl $0x0, 0xd0(%rcx,%rax)
je 0xf22db
movl %ebx, %edi
movsd -0x10(%rbp), %xmm0
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x9daff
movsd -0x10(%rbp), %xmm0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH16_TemplatesAndGenericProgramming/exercises/ex16_53.cc
// Function: main
int main(int argc, char const *argv[])
{
	int i = 0;
	double d = 3.14;
	std::string s = "Hello World!";
	Foo foo;
	Str str;
	// error: cannot bind ‘std::ostream {aka std::basic_ostream<char>}’ lvalue to ‘std::basic_ostream<char>&&’
	// return os << t;
	// print(std::cout, foo);
	print(std::cout, 1) << std::endl;
	print(std::cout, 1, 2.0f) << std::endl;
	print(std::cout, 1, 2.0f, s, str) << std::endl;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x48, %rsp
leaq 0xdd0(%rip), %rsi       # 0x2004
leaq -0x50(%rbp), %rdi
leaq -0x30(%rbp), %rdx
callq 0x1030
leaq -0x30(%rbp), %rdi
callq 0x12fa
movq 0x2d87(%rip), %rdi      # 0x3fd8
pushq $0x1
popq %rsi
callq 0x10b0
movq %rax, %rdi
callq 0x1050
leaq -0x10(%rbp), %rsi
movl $0x1, (%rsi)
leaq -0xc(%rbp), %rdx
movl $0x40000000, (%rdx)     # imm = 0x40000000
movq 0x2d5c(%rip), %rdi      # 0x3fd8
callq 0x1318
movq %rax, %rdi
callq 0x1050
leaq -0x10(%rbp), %rsi
movl $0x1, (%rsi)
leaq -0xc(%rbp), %rdx
movl $0x40000000, (%rdx)     # imm = 0x40000000
movq 0x2d34(%rip), %rdi      # 0x3fd8
leaq -0x50(%rbp), %rcx
leaq -0x30(%rbp), %r8
callq 0x134a
movq %rax, %rdi
callq 0x1050
leaq -0x30(%rbp), %rdi
callq 0x1040
leaq -0x50(%rbp), %rdi
callq 0x1040
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rbx
jmp 0x12e9
jmp 0x12dd
jmp 0x12dd
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x1040
leaq -0x50(%rbp), %rdi
callq 0x1040
movq %rbx, %rdi
callq 0x10c0