LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/sundale[P]gcode/rs274ngc/interp_read.cc
// Function: Interp::read_y(char*, int*, block_struct*, double*)
int Interp::read_y(char *line,   //!< string: line of RS274 code being processed    
                  int *counter, //!< pointer to a counter for position on the line 
                  block_pointer block,  //!< pointer to a block being filled from the line 
                  double *parameters)   //!< array of system parameters                    
{
  double value;

  CHKS((line[*counter] != 'y'), NCE_BUG_FUNCTION_SHOULD_NOT_HAVE_BEEN_CALLED);
  *counter = (*counter + 1);
  CHKS((block->y_flag != OFF), NCE_MULTIPLE_Y_WORDS_ON_ONE_LINE);
  CHP(read_real_value(line, counter, &value, parameters));
  block->y_flag = ON;
  block->y_number = value;
  return INTERP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movslq (%rdx), %rax
cmpb $0x79, (%rsi,%rax)
jne 0x284f2
movq %rcx, %r14
incl %eax
movl %eax, (%rdx)
cmpb $0x1, 0x280(%rcx)
jne 0x28548
leaq 0xd86b(%rip), %rdi      # 0x35d5b
jmp 0x284f9
leaq 0xad56(%rip), %rdi      # 0x3324f
callq 0xb220
movq %rbx, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0xb8e0
movq 0x14a4e(%rip), %rbx     # 0x3cf60
leaq 0xc6d0(%rbx), %rdi
leaq 0xc94f(%rip), %rsi      # 0x34e6f
pushq $0x50
popq %rdx
callq 0xb940
andw $0x0, 0xc71f(%rbx)
movl $0x1, 0xd670(%rbx)
pushq $0x5
popq %rbx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq -0x18(%rbp), %rcx
movq %rbx, %rdi
callq 0xc040
testl %eax, %eax
je 0x285b4
movl %eax, %ebx
movq 0x149ff(%rip), %r14     # 0x3cf60
movslq 0xd670(%r14), %rax
cmpq $0x30, %rax
jg 0x2853d
imulq $0x50, %rax, %rax
leaq (%r14,%rax), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0xc8eb(%rip), %rsi      # 0x34e6f
pushq $0x50
popq %rdx
callq 0xb940
movslq 0xd670(%r14), %rax
imulq $0x50, %rax, %rcx
xorl %edx, %edx
movb %dl, 0xc71f(%r14,%rcx)
incl %eax
movl %eax, 0xd670(%r14)
movb %dl, 0xc720(%r14,%rcx)
jmp 0x2853d
movb $0x1, 0x280(%r14)
movsd -0x18(%rbp), %xmm0
movsd %xmm0, 0x288(%r14)
xorl %ebx, %ebx
jmp 0x2853d
nop
// File: /workspace/github_cpp_makefile_star2_O2/sundale[P]gcode/rs274ngc/interp_read.cc
// Function: Interp::read_z(char*, int*, block_struct*, double*)
int Interp::read_z(char *line,   //!< string: line of RS274 code being processed    
                  int *counter, //!< pointer to a counter for position on the line 
                  block_pointer block,  //!< pointer to a block being filled from the line 
                  double *parameters)   //!< array of system parameters                    
{
  double value;

  CHKS((line[*counter] != 'z'), NCE_BUG_FUNCTION_SHOULD_NOT_HAVE_BEEN_CALLED);
  *counter = (*counter + 1);
  CHKS((block->z_flag != OFF), NCE_MULTIPLE_Z_WORDS_ON_ONE_LINE);
  CHP(read_real_value(line, counter, &value, parameters));
  block->z_flag = ON;
  block->z_number = value;
  return INTERP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movslq (%rdx), %rax
cmpb $0x7a, (%rsi,%rax)
jne 0x28602
movq %rcx, %r14
incl %eax
movl %eax, (%rdx)
cmpb $0x1, 0x290(%rcx)
jne 0x28658
leaq 0xd778(%rip), %rdi      # 0x35d78
jmp 0x28609
leaq 0xac46(%rip), %rdi      # 0x3324f
callq 0xb220
movq %rbx, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0xb8e0
movq 0x1493e(%rip), %rbx     # 0x3cf60
leaq 0xc6d0(%rbx), %rdi
leaq 0xc890(%rip), %rsi      # 0x34ec0
pushq $0x50
popq %rdx
callq 0xb940
andw $0x0, 0xc71f(%rbx)
movl $0x1, 0xd670(%rbx)
pushq $0x5
popq %rbx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq -0x18(%rbp), %rcx
movq %rbx, %rdi
callq 0xc040
testl %eax, %eax
je 0x286c4
movl %eax, %ebx
movq 0x148ef(%rip), %r14     # 0x3cf60
movslq 0xd670(%r14), %rax
cmpq $0x30, %rax
jg 0x2864d
imulq $0x50, %rax, %rax
leaq (%r14,%rax), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0xc82c(%rip), %rsi      # 0x34ec0
pushq $0x50
popq %rdx
callq 0xb940
movslq 0xd670(%r14), %rax
imulq $0x50, %rax, %rcx
xorl %edx, %edx
movb %dl, 0xc71f(%r14,%rcx)
incl %eax
movl %eax, 0xd670(%r14)
movb %dl, 0xc720(%r14,%rcx)
jmp 0x2864d
movb $0x1, 0x290(%r14)
movsd -0x18(%rbp), %xmm0
movsd %xmm0, 0x298(%r14)
xorl %ebx, %ebx
jmp 0x2864d
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/sundale[P]gcode/rs274ngc/interp_write.cc
// Function: Interp::write_m_codes(block_struct*, setup_struct*)
int Interp::write_m_codes(block_pointer block,   //!< pointer to a block of RS274/NGC instructions
                         setup_pointer settings)        //!< pointer to machine settings                 
{
  int *emz;

  emz = settings->active_m_codes;
  emz[0] = settings->sequence_number;   /* 0 seq number  */
  emz[1] = (block == NULL) ? -1 : block->m_modes[4];    /* 1 stopping    */
  emz[2] = (settings->spindle_turning == CANON_STOPPED) ? 5 :   /* 2 spindle     */
    (settings->spindle_turning == CANON_CLOCKWISE) ? 3 : 4;
  emz[3] =                      /* 3 tool change */
    (block == NULL) ? -1 : block->m_modes[6];
  emz[4] =                      /* 4 mist        */
    (settings->mist == ON) ? 7 : (settings->flood == ON) ? -1 : 9;
  emz[5] =                      /* 5 flood       */
    (settings->flood == ON) ? 8 : -1;
  if (settings->feed_override == ON) {
    if (settings->speed_override == ON) emz[6] =  48;
    else emz[6] = 50;
  } else if (settings->speed_override == ON) {
    emz[6] = 51;
  } else emz[6] = 49;
  
  emz[7] =                      /* 7 overrides   */
    (settings->adaptive_feed == ON) ? 52 : -1;

  emz[8] =                      /* 8 overrides   */
    (settings->feed_hold == ON) ? 53 : -1;

  return INTERP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0xc6b4(%rdx), %eax
movl %eax, 0xd0(%rdx)
testq %rsi, %rsi
je 0x28971
movl 0x1f0(%rsi), %eax
movl %eax, 0xd4(%rdx)
movl 0xc6cc(%rdx), %eax
xorl %ecx, %ecx
cmpl $0x2, %eax
setne %cl
addl $0x3, %ecx
cmpl $0x1, %eax
movl $0x5, %eax
cmovnel %ecx, %eax
movl %eax, 0xd8(%rdx)
movl 0x1f8(%rsi), %eax
jmp 0x2899f
orl $-0x1, 0xd4(%rdx)
movl 0xc6cc(%rdx), %eax
xorl %ecx, %ecx
cmpl $0x2, %eax
setne %cl
addl $0x3, %ecx
cmpl $0x1, %eax
movl $0x5, %eax
cmovnel %ecx, %eax
movl %eax, 0xd8(%rdx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0xdc(%rdx)
movzbl 0x1688(%rdx), %eax
andl $0x1, %eax
movl %eax, %ecx
negl %ecx
orl $0x9, %ecx
cmpb $0x0, 0x1797(%rdx)
movl $0x7, %esi
cmovel %ecx, %esi
movl %esi, 0xe0(%rdx)
decl %eax
orl $0x8, %eax
movl %eax, 0xe4(%rdx)
movzbl 0xc6c8(%rdx), %eax
leal 0x31(,%rax,2), %ecx
xorb $0x1, %al
movzbl %al, %eax
leal 0x30(,%rax,2), %eax
cmpb $0x0, 0x674(%rdx)
cmovnel %eax, %ecx
movl %ecx, 0xe8(%rdx)
movzbl 0x1b6b0(%rdx), %eax
decl %eax
orl $0x34, %eax
movl %eax, 0xec(%rdx)
movzbl 0x1b6b1(%rdx), %eax
decl %eax
orl $0x35, %eax
movl %eax, 0xf0(%rdx)
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sundale[P]gcode/rs274ngc/interp_o_word.cc
// Function: Interp::findFile(char*, char*, char*)
int Interp::findFile( // ARGUMENTS
		     char *direct,  // the directory to start looking in
		     char *target,  // the name of the file to find
		     char *foundFileDirect) // where to store the result
{
    FILE *file;
    DIR *aDir;
    struct dirent *aFile;
    char targetPath[PATH_MAX+1];

    snprintf(targetPath, PATH_MAX, "%s/%s", direct, target);

    file = fopen(targetPath, "r");

    if(file)
    {
        strncpy(foundFileDirect, direct, PATH_MAX);
        fclose(file);
        return INTERP_OK;
    }

    aDir = opendir(direct);

    if(!aDir)
    {
	ERS(NCE_FILE_NOT_OPEN);
    }

    while((aFile = readdir(aDir)))
    {
        if(aFile->d_type == DT_DIR &&
           (0 != strcmp(aFile->d_name, "..")) &&
           (0 != strcmp(aFile->d_name, ".")))
        {
            char path[PATH_MAX+1];
            snprintf(path, PATH_MAX, "%s/%s", direct, aFile->d_name);
            if(INTERP_OK == findFile(path, target, foundFileDirect))
            {
	        closedir(aDir);
                return INTERP_OK;
            }
        }
    }
    closedir(aDir);
    ERS(NCE_FILE_NOT_OPEN);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2028, %rsp           # imm = 0x2028
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, -0x30(%rbp)
leaq 0xd509(%rip), %rdx      # 0x35f91
xorl %ebx, %ebx
leaq -0x2050(%rbp), %r13
movl $0x1000, %esi           # imm = 0x1000
movq %r13, %rdi
movq %r15, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0xc280
leaq 0xc972(%rip), %rsi      # 0x3541f
movq %r13, %rdi
callq 0xbdd0
testq %rax, %rax
je 0x28ada
movq %rax, %r13
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rdi
movq %r15, %rsi
callq 0xb580
movq %r13, %rdi
callq 0xbb40
jmp 0x28bb2
movq %r15, %rdi
callq 0xc0d0
testq %rax, %rax
je 0x28b66
movq %rax, %r13
leaq -0x1040(%rbp), %rbx
movq %r13, %rdi
callq 0xc190
testq %rax, %rax
je 0x28b5e
cmpb $0x4, 0x12(%rax)
jne 0x28af1
cmpb $0x2e, 0x13(%rax)
jne 0x28b1c
cmpb $0x2e, 0x14(%rax)
jne 0x28b16
cmpb $0x0, 0x15(%rax)
je 0x28af1
cmpb $0x0, 0x14(%rax)
je 0x28af1
addq $0x13, %rax
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
leaq 0xd462(%rip), %rdx      # 0x35f91
movq %r15, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xc280
movq -0x30(%rbp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0xc560
testl %eax, %eax
jne 0x28af1
movq %r13, %rdi
callq 0xc2a0
xorl %ebx, %ebx
jmp 0x28bb2
movq %r13, %rdi
callq 0xc2a0
leaq 0xd42a(%rip), %rdi      # 0x35f97
callq 0xb220
movq -0x30(%rbp), %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0xb8e0
movq 0x143d9(%rip), %rbx     # 0x3cf60
leaq 0xc6d0(%rbx), %rdi
leaq 0xd267(%rip), %rsi      # 0x35dfc
pushq $0x50
popq %rdx
callq 0xb940
andw $0x0, 0xc71f(%rbx)
movl $0x1, 0xd670(%rbx)
pushq $0x5
popq %rbx
movl %ebx, %eax
addq $0x2028, %rsp           # imm = 0x2028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sundale[P]gcode/rs274ngc/interp_o_word.cc
// Function: Interp::control_find_oword(block_struct*, setup_struct*, int*)
int Interp::control_find_oword( /* ARGUMENTS                       */
  block_pointer block,      /* pointer to block */
  setup_pointer settings,   /* pointer to machine settings      */
  int *o_index)             /* the index of o-word (returned) */
{
  static char name[] = "control_find_oword";
  int i;

  logDebug("Entered:%s", name);
  for(i=0; i<settings->oword_labels; i++)
    {
      if(0 == strcmp(settings->oword_offset[i].o_word_name, block->o_name))
	{
	  *o_index = i;
	  logDebug("Found oword[%d]: |%s|", i, block->o_name);
	  return INTERP_OK;
	}
    }
  logDebug("Unknown oword name: |%s|", block->o_name);
  ERS(NCE_UNKNOWN_OWORD_NUMBER);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, -0x30(%rbp)
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
movq 0x141eb(%rip), %rax     # 0x3cf60
cmpl $0x0, 0x1b6b4(%rax)
jle 0x28db0
callq 0xc0b0
leaq 0x14f56(%rip), %rcx     # 0x3dce0
movq %rcx, (%rsp)
leaq 0xd2a6(%rip), %rsi      # 0x3603b
leaq 0xd237(%rip), %r8       # 0x35fd3
movq %rbx, %rdi
xorl %edx, %edx
movl %eax, %ecx
movl $0x8d, %r9d
xorl %eax, %eax
callq 0xc5e0
movl 0xfb28(%r12), %r15d
xorl %r13d, %r13d
testl %r15d, %r15d
cmovlel %r13d, %r15d
addq $0xfb38, %r12           # imm = 0xFB38
cmpq %r13, %r15
je 0x28def
movq (%r12), %rdi
movq 0x2d0(%r14), %rsi
callq 0xbfd0
testl %eax, %eax
je 0x28e7b
incq %r13
addq $0x30, %r12
jmp 0x28dc9
movq 0x1416a(%rip), %r15     # 0x3cf60
cmpl $0x0, 0x1b6b4(%r15)
jle 0x28e32
callq 0xc0b0
movq 0x2d0(%r14), %rcx
movq %rcx, (%rsp)
leaq 0xd26b(%rip), %rsi      # 0x36082
leaq 0xd1b5(%rip), %r8       # 0x35fd3
movq %rbx, %rdi
xorl %edx, %edx
movl %eax, %ecx
movl $0x97, %r9d
xorl %eax, %eax
callq 0xc5e0
leaq 0xd275(%rip), %rdi      # 0x360ae
callq 0xb220
movq %rbx, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0xb8e0
leaq 0xc6d0(%r15), %rdi
leaq 0xd045(%rip), %rsi      # 0x35e9e
pushq $0x50
popq %rdx
callq 0xb940
andw $0x0, 0xc71f(%r15)
movl $0x1, 0xd670(%r15)
pushq $0x5
popq %r14
jmp 0x28ed1
movq -0x30(%rbp), %rax
movl %r13d, (%rax)
movq 0x140d7(%rip), %rax     # 0x3cf60
cmpl $0x0, 0x1b6b4(%rax)
jle 0x28ece
callq 0xc0b0
movq 0x2d0(%r14), %rcx
movq %rcx, 0x8(%rsp)
movl %r13d, (%rsp)
leaq 0xd1ab(%rip), %rsi      # 0x36059
leaq 0xd11e(%rip), %r8       # 0x35fd3
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %edx, %edx
movl %eax, %ecx
movl $0x93, %r9d
xorl %eax, %eax
callq 0xc5e0
jmp 0x28ed1
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sundale[P]gcode/rs274ngc/nurbs_additional_functions.cc
// Function: knot_vector_creator(unsigned int, unsigned int)
std::vector<unsigned int> knot_vector_creator(unsigned int n, unsigned int k) {
    
    unsigned int i;
    std::vector<unsigned int> knot_vector;
    for (i=0; i<=n+k; i++) {
	if (i < k)  
            knot_vector.push_back(0);
        else if (i >= k && i <= n)
            knot_vector.push_back(i - k + 1);
        else
            knot_vector.push_back(n - k + 2);
    }
    return knot_vector;
 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %r14d
movl %esi, %r15d
movq %rdi, %rbx
andq $0x0, 0x10(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
leal (%r14,%r15), %r13d
movl %esi, %eax
subl %edx, %eax
addl $0x2, %eax
movl %eax, -0x2c(%rbp)
pushq $0x1
popq %rax
subl %edx, %eax
movq %rax, -0x40(%rbp)
xorl %r12d, %r12d
cmpl %r13d, %r12d
ja 0x2a91b
cmpl %r14d, %r12d
jae 0x2a8e7
andl $0x0, -0x38(%rbp)
movq %rbx, %rdi
leaq -0x38(%rbp), %rsi
callq 0xb7b0
jmp 0x2a916
cmpl %r15d, %r12d
jbe 0x2a900
movl -0x2c(%rbp), %eax
movl %eax, -0x30(%rbp)
movq %rbx, %rdi
leaq -0x30(%rbp), %rsi
callq 0xb7b0
jmp 0x2a916
movq -0x40(%rbp), %rax
addl %r12d, %eax
movl %eax, -0x34(%rbp)
movq %rbx, %rdi
leaq -0x34(%rbp), %rsi
callq 0xb7b0
incl %r12d
jmp 0x2a8cb
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2a931
jmp 0x2a931
movq %rax, %r14
movq %rbx, %rdi
callq 0xb560
movq %r14, %rdi
callq 0xc520
// File: /workspace/github_cpp_makefile_star2_O2/sundale[P]gcode/rs274ngc/nurbs_additional_functions.cc
// Function: Rden(double, unsigned int, std::vector<CONTROL_POINT, std::allocator<CONTROL_POINT>>, std::vector<unsigned int, std::allocator<unsigned int>>)
double Rden(double u, unsigned int k,
                  std::vector<CONTROL_POINT> nurbs_control_points,
                  std::vector<unsigned int> knot_vector) {

    unsigned int i;
    double d = 0.0;   
    for (i=0; i<(nurbs_control_points.size()); i++)
        d = d + Nmix(i,k,u,knot_vector)*nurbs_control_points[i].W;
    return d;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %r15d
movsd %xmm0, -0x38(%rbp)
xorl %eax, %eax
xorpd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
leaq -0x50(%rbp), %r12
movl %eax, %r13d
movq 0x8(%r14), %rax
subq (%r14), %rax
cqto
pushq $0x18
popq %rcx
idivq %rcx
cmpq %r13, %rax
jbe 0x2ac86
movq %r12, %rdi
movq %rbx, %rsi
callq 0xb270
movl %r13d, %edi
movl %r15d, %esi
movsd -0x38(%rbp), %xmm0
movq %r12, %rdx
callq 0xc760
movq (%r14), %rax
imulq $0x18, %r13, %rcx
mulsd 0x10(%rax,%rcx), %xmm0
movsd -0x30(%rbp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, -0x30(%rbp)
movq %r12, %rdi
callq 0xb560
leal 0x1(%r13), %eax
jmp 0x2ac28
movsd -0x30(%rbp), %xmm0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0xb560
movq %rbx, %rdi
callq 0xc520
// File: /workspace/github_cpp_makefile_star2_O2/sundale[P]gcode/rs274ngc/nurbs_additional_functions.cc
// Function: nurbs_tangent(double, unsigned int, std::vector<CONTROL_POINT, std::allocator<CONTROL_POINT>>, std::vector<unsigned int, std::allocator<unsigned int>>)
PLANE_POINT nurbs_tangent(double u, unsigned int k,
                  std::vector<CONTROL_POINT> nurbs_control_points,
                  std::vector<unsigned int> knot_vector) {
    unsigned int n = nurbs_control_points.size() - 1;
    double umax = n - k + 2;
    double ulo = std::max(0.0, u-DU), uhi = std::min(umax, u+DU);
    PLANE_POINT P1 = nurbs_point(ulo, k, nurbs_control_points, knot_vector);
    PLANE_POINT P3 = nurbs_point(uhi, k, nurbs_control_points, knot_vector);
    PLANE_POINT r = {(P3.X - P1.X) / (uhi-ulo), (P3.Y - P1.Y) / (uhi-ulo)};
    unit(r);
    return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdx, %r12
movq %rsi, %r13
movl %edi, %r14d
movsd %xmm0, -0x30(%rbp)
movq 0x8(%rsi), %rax
subq (%rsi), %rax
pushq $0x18
popq %rcx
cqto
idivq %rcx
movq %rax, %r15
leaq -0xb8(%rbp), %rbx
movq %rbx, %rdi
callq 0xb620
leaq -0x88(%rbp), %rdi
movq %r12, %rsi
callq 0xb270
movsd 0xba29(%rip), %xmm0     # 0x369a8
addsd -0x30(%rbp), %xmm0
xorpd %xmm1, %xmm1
maxsd %xmm1, %xmm0
leaq -0x88(%rbp), %rdx
movsd %xmm0, -0x58(%rbp)
movl %r14d, %edi
movq %rbx, %rsi
callq 0xbd90
movsd %xmm0, -0x48(%rbp)
movsd %xmm1, -0x50(%rbp)
leaq -0x88(%rbp), %rdi
callq 0xb560
leaq -0xb8(%rbp), %rdi
callq 0xb180
leaq -0xa0(%rbp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
callq 0xb620
leaq -0x70(%rbp), %rdi
movq %r12, %rsi
callq 0xb270
subl %r14d, %r15d
incl %r15d
cvtsi2sd %r15, %xmm1
movsd -0x30(%rbp), %xmm0
addsd 0xb9b5(%rip), %xmm0     # 0x369b0
minsd %xmm1, %xmm0
leaq -0x70(%rbp), %rdx
movsd %xmm0, -0x30(%rbp)
movl %r14d, %edi
movq %rbx, %rsi
callq 0xbd90
movsd %xmm0, -0x38(%rbp)
movsd %xmm1, -0x40(%rbp)
leaq -0x70(%rbp), %rdi
callq 0xb560
leaq -0xa0(%rbp), %rdi
callq 0xb180
movsd -0x38(%rbp), %xmm0
subsd -0x48(%rbp), %xmm0
movsd -0x30(%rbp), %xmm2
subsd -0x58(%rbp), %xmm2
divsd %xmm2, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x40(%rbp), %xmm1
subsd -0x50(%rbp), %xmm1
divsd %xmm2, %xmm1
movsd %xmm1, -0x40(%rbp)
callq 0xb2c0
movapd %xmm0, %xmm2
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm2
movsd -0x38(%rbp), %xmm1
movapd %xmm1, %xmm0
divsd %xmm2, %xmm0
jne 0x2b088
jp 0x2b088
movapd %xmm1, %xmm0
movsd -0x40(%rbp), %xmm3
movapd %xmm3, %xmm1
divsd %xmm2, %xmm1
jne 0x2b09d
jp 0x2b09d
movapd %xmm3, %xmm1
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq -0x70(%rbp), %rdi
jmp 0x2b0c4
jmp 0x2b0cb
movq %rax, %r14
leaq -0x88(%rbp), %rdi
callq 0xb560
jmp 0x2b0ce
movq %rax, %r14
movq %rbx, %rdi
callq 0xb180
movq %r14, %rdi
callq 0xc520
// File: /workspace/github_cpp_makefile_star2_O2/sundale[P]gcode/rs274ngc/rs274ngc_pre.cc
// Function: Interp::doLog(char*, ...)
void Interp::doLog(char *fmt, ...)
{
#ifdef LOG_FILE
    struct timeval tv;
    struct tm *tm;
    va_list ap;

    va_start(ap, fmt);

    if(log_file == NULL)
    {
       log_file = fopen(LOG_FILE, "a");
    }

    if(log_file == NULL)
    {
         fprintf(stderr, "(%d)Unable to open log file:%s\n",
                  getpid(), LOG_FILE);
    }

    gettimeofday(&tv, NULL);
    tm = localtime(&tv.tv_sec);

    fprintf(log_file, "%04d%02d%02d-%02d:%02d:%02d.%03ld ",
	    tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday,
	    tm->tm_hour, tm->tm_min, tm->tm_sec,
	    tv.tv_usec/1000);

    vfprintf(log_file, fmt, ap);
    fflush(log_file);

    va_end(ap);
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x100(%rbp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x2b3c4
movaps %xmm0, -0xd0(%rbp)
movaps %xmm1, -0xc0(%rbp)
movaps %xmm2, -0xb0(%rbp)
movaps %xmm3, -0xa0(%rbp)
movaps %xmm4, -0x90(%rbp)
movaps %xmm5, -0x80(%rbp)
movaps %xmm6, -0x70(%rbp)
movaps %xmm7, -0x60(%rbp)
movq %rsi, -0x30(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, -0x40(%rbp)
cmpq $0x0, (%rdi)
jne 0x2b40c
movl $0x1b6b8, %r15d         # imm = 0x1B6B8
addq 0x11b6f(%rip), %r15     # 0x3cf60
leaq 0x9f96(%rip), %rsi      # 0x3538e
movq %r15, %rdi
callq 0xbdd0
movq %rax, (%rbx)
testq %rax, %rax
je 0x2b49c
leaq -0x50(%rbp), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0xc2d0
movq %r15, %rdi
callq 0xb780
movq (%rbx), %rdi
movl $0x76c, %r10d           # imm = 0x76C
addl 0x14(%rax), %r10d
movl 0x10(%rax), %ecx
incl %ecx
movl 0xc(%rax), %r8d
movl 0x8(%rax), %r9d
movl (%rax), %r12d
movl 0x4(%rax), %r13d
movq 0x8(%r15), %rax
movl $0x3e8, %esi            # imm = 0x3E8
cqto
idivq %rsi
movq %rax, %r11
subq $0x8, %rsp
leaq 0xb591(%rip), %rsi      # 0x369f0
movl %r10d, %edx
xorl %eax, %eax
pushq %r11
pushq %r12
pushq %r13
callq 0xc030
addq $0x20, %rsp
movq (%rbx), %rdi
leaq -0x40(%rbp), %rdx
movq %r14, %rsi
callq 0xbee0
movq (%rbx), %rdi
callq 0xbdc0
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x11b1d(%rip), %rax     # 0x3cfc0
movq (%rax), %r12
callq 0xc0b0
leaq 0xb51e(%rip), %rsi      # 0x369d0
movq %r12, %rdi
movl %eax, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0xc030
jmp 0x2b40c
// File: /workspace/github_cpp_makefile_star2_O2/sundale[P]gcode/rs274ngc/rs274ngc_pre.cc
// Function: Interp::close()
int Interp::close()
{
  if(_setup.use_lazy_close)
    {
      _setup.lazy_closing = 1;
      return INTERP_OK;
    }

  if (_setup.file_pointer != NULL) {
    fclose(_setup.file_pointer);
    _setup.file_pointer = NULL;
    _setup.percent_flag = OFF;
  }
  reset();

  return INTERP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq 0x11a8d(%rip), %rbx     # 0x3cf60
cmpl $0x0, 0x1d6b8(%rbx)
je 0x2b4e8
movl $0x1, 0x1d6bc(%rbx)
jmp 0x2b50d
movq 0x1680(%rbx), %rdi
testq %rdi, %rdi
je 0x2b508
callq 0xbb40
andq $0x0, 0x1680(%rbx)
movb $0x0, 0xc678(%rbx)
callq 0xb6a0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sundale[P]gcode/rs274ngc/rs274ngc_pre.cc
// Function: Interp::exit()
int Interp::exit()
{
  char file_name[LINELEN];

  GET_EXTERNAL_PARAMETER_FILE_NAME(file_name, (LINELEN - 1));
  save_parameters(((file_name[0] ==
                             0) ?
                            RS274NGC_PARAMETER_FILE_NAME_DEFAULT :
                            file_name), _setup.parameters);
  reset();

  return INTERP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movq %rdi, %rbx
leaq -0x110(%rbp), %r14
movq %r14, %rdi
movl $0xfe, %esi
callq 0xb980
cmpb $0x0, (%r14)
leaq 0xae6d(%rip), %rsi      # 0x36b8b
cmovneq %r14, %rsi
movl $0x17c0, %edx           # imm = 0x17C0
addq 0x11232(%rip), %rdx     # 0x3cf60
movq %rbx, %rdi
callq 0xc780
callq 0xb6a0
xorl %eax, %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sundale[P]gcode/rs274ngc/rs274ngc_pre.cc
// Function: Interp::init_tool_parameters()
int Interp::init_tool_parameters()
{
  if (_setup.random_toolchanger) {
     // random_toolchanger: tool at startup expected
    _setup.parameters[5400] = _setup.tool_table[0].toolno;
    _setup.parameters[5401] = _setup.tool_table[0].offset.tran.x;
    _setup.parameters[5402] = _setup.tool_table[0].offset.tran.y;
    _setup.parameters[5403] = _setup.tool_table[0].offset.tran.z;
    _setup.parameters[5404] = _setup.tool_table[0].offset.a;
    _setup.parameters[5405] = _setup.tool_table[0].offset.b;
    _setup.parameters[5406] = _setup.tool_table[0].offset.c;
    _setup.parameters[5407] = _setup.tool_table[0].offset.u;
    _setup.parameters[5408] = _setup.tool_table[0].offset.v;
    _setup.parameters[5409] = _setup.tool_table[0].offset.w;
    _setup.parameters[5410] = _setup.tool_table[0].diameter;
    _setup.parameters[5411] = _setup.tool_table[0].frontangle;
    _setup.parameters[5412] = _setup.tool_table[0].backangle;
    _setup.parameters[5413] = _setup.tool_table[0].orientation;
  } else {
    // non random_toolchanger: no tool at startup, one-time init
    if (_setup.tool_table[0].toolno == -1) {
      default_tool_parameters();
    }
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0xf8d3(%rip), %rax      # 0x3cf60
cmpl $0x0, 0xc6ac(%rax)
movl 0xd6c8(%rax), %ecx
je 0x2d724
cvtsi2sd %ecx, %xmm0
movsd %xmm0, 0xc080(%rax)
movsd 0xd6d0(%rax), %xmm0
movsd %xmm0, 0xc088(%rax)
movups 0xd6d8(%rax), %xmm0
movups %xmm0, 0xc090(%rax)
movups 0xd6e8(%rax), %xmm0
movups %xmm0, 0xc0a0(%rax)
movups 0xd6f8(%rax), %xmm0
movups %xmm0, 0xc0b0(%rax)
movups 0xd708(%rax), %xmm0
movups %xmm0, 0xc0c0(%rax)
movups 0xd718(%rax), %xmm0
movups %xmm0, 0xc0d0(%rax)
movsd 0xd728(%rax), %xmm0
movsd %xmm0, 0xc0e0(%rax)
cvtsi2sdl 0xd730(%rax), %xmm0
movsd %xmm0, 0xc0e8(%rax)
jmp 0x2d765
cmpl $-0x1, %ecx
jne 0x2d765
xorpd %xmm0, %xmm0
movupd %xmm0, 0xc0e0(%rax)
movupd %xmm0, 0xc0d0(%rax)
movupd %xmm0, 0xc0c0(%rax)
movupd %xmm0, 0xc0b0(%rax)
movupd %xmm0, 0xc0a0(%rax)
movupd %xmm0, 0xc090(%rax)
movupd %xmm0, 0xc080(%rax)
xorl %eax, %eax
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sundale[P]gcode/rs274ngc/rs274ngc_pre.cc
// Function: Interp::load_tool_table()
int Interp::load_tool_table()
{
  int n;

  CHKS((_setup.pockets_max > CANON_POCKETS_MAX), NCE_POCKET_MAX_TOO_LARGE);
  for (n = 0; n < _setup.pockets_max; n++) {
    _setup.tool_table[n] = GET_EXTERNAL_TOOL_TABLE(n);
  }
  for (; n < CANON_POCKETS_MAX; n++) {
    _setup.tool_table[n].toolno = -1;
    ZERO_EMC_POSE(_setup.tool_table[n].offset);
    _setup.tool_table[n].diameter = 0;
    _setup.tool_table[n].orientation = 0;
    _setup.tool_table[n].frontangle = 0;
    _setup.tool_table[n].backangle = 0;
  }
  set_tool_parameters();
  return INTERP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq 0xf7de(%rip), %r12      # 0x3cf60
movl 0xd6c0(%r12), %eax
cmpl $0x38, %eax
jle 0x2d7da
leaq 0x9684(%rip), %rdi      # 0x36e1a
callq 0xb220
movq %rax, %rsi
xorl %eax, %eax
callq 0xb8e0
leaq 0xc6d0(%r12), %rdi
leaq 0x9a1d(%rip), %rsi      # 0x371d1
pushq $0x50
popq %rdx
callq 0xb940
andw $0x0, 0xc71f(%r12)
movl $0x1, 0xd670(%r12)
pushq $0x5
popq %rax
jmp 0x2d864
movl $0xd6d0, %r13d          # imm = 0xD6D0
addq 0xf779(%rip), %r13      # 0x3cf60
xorl %ebx, %ebx
leaq -0x98(%rbp), %r14
pushq $0xe
popq %r15
cltq
cmpq %rax, %rbx
jge 0x2d823
movq %r14, %rdi
movl %ebx, %esi
callq 0xc500
leaq -0x8(%r13), %rdi
movq %r15, %rcx
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
incq %rbx
movl 0xd6c0(%r12), %eax
addq $0x70, %r13
jmp 0x2d7f4
xorps %xmm0, %xmm0
cmpq $0x37, %rbx
ja 0x2d85d
orl $-0x1, -0x8(%r13)
incq %rbx
movups %xmm0, (%r13)
movups %xmm0, 0x10(%r13)
movups %xmm0, 0x20(%r13)
movups %xmm0, 0x30(%r13)
movups %xmm0, 0x40(%r13)
movups %xmm0, 0x50(%r13)
andl $0x0, 0x60(%r13)
addq $0x70, %r13
jmp 0x2d826
callq 0xc0c0
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sundale[P]gcode/rs274ngc/rs274ngc_pre.cc
// Function: Interp::set_tool_parameters()
int Interp::set_tool_parameters()
{
  // invoke to set tool parameters for current tool (pocket==0)
  // when a tool is absent, set default (zero offset) tool parameters

  if ((! _setup.random_toolchanger) && (_setup.tool_table[0].toolno <= 0)) {
    default_tool_parameters();
    return 0;
  }
  _setup.parameters[5400] = _setup.tool_table[0].toolno;
  _setup.parameters[5401] = _setup.tool_table[0].offset.tran.x;
  _setup.parameters[5402] = _setup.tool_table[0].offset.tran.y;
  _setup.parameters[5403] = _setup.tool_table[0].offset.tran.z;
  _setup.parameters[5404] = _setup.tool_table[0].offset.a;
  _setup.parameters[5405] = _setup.tool_table[0].offset.b;
  _setup.parameters[5406] = _setup.tool_table[0].offset.c;
  _setup.parameters[5407] = _setup.tool_table[0].offset.u;
  _setup.parameters[5408] = _setup.tool_table[0].offset.v;
  _setup.parameters[5409] = _setup.tool_table[0].offset.w;
  _setup.parameters[5410] = _setup.tool_table[0].diameter;
  _setup.parameters[5411] = _setup.tool_table[0].frontangle;
  _setup.parameters[5412] = _setup.tool_table[0].backangle;
  _setup.parameters[5413] = _setup.tool_table[0].orientation;

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0xf657(%rip), %rax      # 0x3cf60
cmpl $0x0, 0xc6ac(%rax)
sete %dl
movl 0xd6c8(%rax), %ecx
testl %ecx, %ecx
setle %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x2d969
xorpd %xmm0, %xmm0
movupd %xmm0, 0xc0e0(%rax)
movupd %xmm0, 0xc0d0(%rax)
movupd %xmm0, 0xc0c0(%rax)
movupd %xmm0, 0xc0b0(%rax)
movupd %xmm0, 0xc0a0(%rax)
movupd %xmm0, 0xc090(%rax)
movupd %xmm0, 0xc080(%rax)
jmp 0x2d9eb
cvtsi2sd %ecx, %xmm0
movsd %xmm0, 0xc080(%rax)
movsd 0xd6d0(%rax), %xmm0
movsd %xmm0, 0xc088(%rax)
movups 0xd6d8(%rax), %xmm0
movups %xmm0, 0xc090(%rax)
movups 0xd6e8(%rax), %xmm0
movups %xmm0, 0xc0a0(%rax)
movups 0xd6f8(%rax), %xmm0
movups %xmm0, 0xc0b0(%rax)
movups 0xd708(%rax), %xmm0
movups %xmm0, 0xc0c0(%rax)
movups 0xd718(%rax), %xmm0
movups %xmm0, 0xc0d0(%rax)
movsd 0xd728(%rax), %xmm0
movsd %xmm0, 0xc0e0(%rax)
cvtsi2sdl 0xd730(%rax), %xmm0
movsd %xmm0, 0xc0e8(%rax)
xorl %eax, %eax
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sundale[P]gcode/rs274ngc/rs274ngc_pre.cc
// Function: Interp::line_text(char*, int)
void Interp::line_text(char *line_text,        //!< string: to copy line into           
                        int max_size)   //!< maximum number of characters to copy
{
  int n;
  char *the_text;

  the_text = _setup.linetext;
  for (n = 0; n < (max_size - 1); n++) {
    if (the_text[n] != 0)
      line_text[n] = the_text[n];
    else
      break;
  }
  line_text[n] = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x2, %edx
movl $0x1, %eax
cmovgel %edx, %eax
decl %eax
xorl %ecx, %ecx
movq 0xf224(%rip), %rdx      # 0x3cf60
cmpq %rcx, %rax
je 0x2dd5a
movb 0x1698(%rdx,%rcx), %dil
testb %dil, %dil
je 0x2dd57
movb %dil, (%rsi,%rcx)
incq %rcx
jmp 0x2dd3c
movq %rcx, %rax
movb $0x0, (%rsi,%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sundale[P]gcode/rs274ngc/rs274ngc_pre.cc
// Function: Interp::stack_name(int, char*, int)
void Interp::stack_name(int stack_index,       //!< index into stack of function names  
                         char *function_name,   //!< string: to copy function name into
                         int max_size)  //!< maximum number of characters to copy
{
  int n;
  char *the_name;

  if ((stack_index > -1) && (stack_index < STACK_LEN)) {
    the_name = _setup.stack[stack_index];
    for (n = 0; n < (max_size - 1); n++) {
      if (the_name[n] != 0)
        function_name[n] = the_name[n];
      else
        break;
    }
    function_name[n] = 0;
  } else
    function_name[0] = 0;
}

// Assembly:
cmpl $0x31, %esi
ja 0x2ddbc
movl %esi, %esi
cmpl $0x2, %ecx
movl $0x1, %eax
cmovgel %ecx, %eax
decl %eax
imulq $0x50, %rsi, %rcx
movq 0xf1cd(%rip), %rsi      # 0x3cf60
addq %rcx, %rsi
addq $0xc6d0, %rsi           # imm = 0xC6D0
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x2ddb9
movb (%rsi,%rcx), %dil
testb %dil, %dil
je 0x2ddb6
movb %dil, (%rdx,%rcx)
incq %rcx
jmp 0x2dd9f
movq %rcx, %rax
addq %rax, %rdx
pushq %rbp
movq %rsp, %rbp
movb $0x0, (%rdx)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sundale[P]gcode/rs274ngc/rs274ngc_pre.cc
// Function: Interp::ini_load(char const*)
int Interp::ini_load(const char *filename)
{
    IniFile inifile;
    const char *inistring;

    // open it
    if (inifile.Open(filename) == false) {
        logDebug("Unable to open inifile:%s:", filename);
	return -1;
    }

    logDebug("Opened inifile:%s:", filename);


    if (NULL != (inistring = inifile.Find("PARAMETER_FILE", "RS274NGC"))) {
	// found it
	strncpy(_parameter_file_name, inistring, LINELEN);
        logDebug("found PARAMETER_FILE:%s:", _parameter_file_name);
    } else {
	// not found, leave RS274NGC_PARAMETER_FILE alone
        logDebug("did not find PARAMETER_FILE");
    }

    // close it
    inifile.Close();

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x88(%rbp), %r15
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xc4e0
movq %r15, %rdi
movq %r14, %rsi
callq 0xb690
movq 0xf162(%rip), %r15      # 0x3cf60
movl 0x1b6b4(%r15), %ecx
testb %al, %al
je 0x2dead
testl %ecx, %ecx
jle 0x2de3c
callq 0xc0b0
movq %r14, (%rsp)
leaq 0x918b(%rip), %rsi      # 0x36fac
leaq 0x8c0a(%rip), %r8       # 0x36a32
movq %rbx, %rdi
xorl %edx, %edx
movl %eax, %ecx
movl $0x5cf, %r9d            # imm = 0x5CF
xorl %eax, %eax
callq 0xc5e0
leaq 0x918f(%rip), %rsi      # 0x36fd2
leaq 0x8e38(%rip), %rdx      # 0x36c82
leaq -0x88(%rbp), %rdi
pushq $0x1
popq %rcx
callq 0xb670
testq %rax, %rax
je 0x2dee2
movq 0xf12f(%rip), %r14      # 0x3cf98
movl $0xff, %edx
movq %r14, %rdi
movq %rax, %rsi
callq 0xb580
cmpl $0x0, 0x1b6b4(%r15)
jle 0x2df13
callq 0xc0b0
movq %r14, (%rsp)
leaq 0x914a(%rip), %rsi      # 0x36fe1
leaq 0x8b94(%rip), %r8       # 0x36a32
movq %rbx, %rdi
xorl %edx, %edx
movl %eax, %ecx
movl $0x5d5, %r9d            # imm = 0x5D5
jmp 0x2df0c
pushq $-0x1
popq %r15
testl %ecx, %ecx
jle 0x2df22
callq 0xc0b0
movq %r14, (%rsp)
leaq 0x8d04(%rip), %rsi      # 0x36bc9
leaq 0x8b66(%rip), %r8       # 0x36a32
movq %rbx, %rdi
xorl %edx, %edx
movl %eax, %ecx
movl $0x5cb, %r9d            # imm = 0x5CB
xorl %eax, %eax
callq 0xc5e0
jmp 0x2df22
cmpl $0x0, 0x1b6b4(%r15)
jle 0x2df13
callq 0xc0b0
leaq 0x9115(%rip), %rsi      # 0x3700d
leaq 0x8b33(%rip), %r8       # 0x36a32
movq %rbx, %rdi
xorl %edx, %edx
movl %eax, %ecx
movl $0x5d8, %r9d            # imm = 0x5D8
xorl %eax, %eax
callq 0xc5e0
xorl %r15d, %r15d
leaq -0x88(%rbp), %rdi
callq 0xb4f0
leaq -0x88(%rbp), %rdi
callq 0xc010
movl %r15d, %eax
addq $0x78, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0xc010
movq %rbx, %rdi
callq 0xc520
nop
// File: /workspace/github_cpp_makefile_star2_O2/WbtLm[P]mempool/./mempool.h
// Function: myErrorOperate(char const*, int, int)
int myErrorOperate(char const * const error_str,int error_line,int error_exit=1)
{
    #include<stdio.h>
    printf("%d\n",error_line);
    if(error_exit==1)
        exit(1);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edx, %ebx
leaq 0x1c99(%rip), %rdi      # 0x3004
xorl %eax, %eax
callq 0x1030
cmpl $0x1, %ebx
je 0x1380
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
pushq $0x1
popq %rdi
callq 0x1130
// File: /workspace/github_cpp_makefile_star2_O2/WbtLm[P]mempool/./mempool.cpp
// Function: mpnsp::memPool::clean(long long)
int mpnsp::memPool::clean(long long size/*=-1*/)
{
    // cout<<"--------------AutoCleanSize="<<AutoCleanSize<<endl;
    if(size<0)
    {
        size=AutoCleanSize;
    }
    if(size>=maxNumInNode)
    {
        return -1;  //把最大的都删了就不合适了
    }
    int cnt=0;
    for(int i=1;i<=MaxNodeNum;i++)
    {
        if(nodeArr[i] && nodeArr[i]->size<=AutoCleanSize && !nodeArr[i]->deleted)
        {
            nodeArr[i]->deleted=1;
            cnt++;
        }
    }
    nodeNum-=cnt;
    deletedNum+=cnt;
    return cnt;
}

// Assembly:
movl 0x1c(%rdi), %eax
movl %eax, %ecx
shrl $0x4, %ecx
testq %rsi, %rsi
movq %rcx, %rdx
cmovnsq %rsi, %rdx
cmpq %rax, %rdx
jae 0x13de
pushq %rbp
movq %rsp, %rbp
movq 0x20(%rdi), %rdx
xorl %eax, %eax
movabsq $0x1, %rsi
cmpq $0x80, %rsi
je 0x13e4
movq (%rdx,%rsi,8), %r8
testq %r8, %r8
je 0x13d9
cmpl %ecx, 0x14(%r8)
ja 0x13d9
cmpb $0x0, 0x10(%r8)
jne 0x13d9
movb $0x1, 0x10(%r8)
incl %eax
incq %rsi
jmp 0x13b3
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
subl %eax, 0x10(%rdi)
addl %eax, 0x14(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/WbtLm[P]mempool/./mempool.cpp
// Function: mpnsp::memPool::freeMemNode(int)
void mpnsp::memPool::freeMemNode(int idx) //删除被标记为deleted的node
{
    if(__builtin_expect(MaxNodeNum<idx,0))
    {
        myErrorOperate("fatal error ! freeMemNode.nodeNumidx.",__LINE__,1);
        return;
    }
    if(__builtin_expect(!nodeArr[idx],0))
    {
        myErrorOperate("freeMemNode.node is already NULL.",__LINE__,0);
        return;
    }
    if(!__builtin_expect(nodeArr[idx]->deleted,1))
    {
        myErrorOperate("freeMemNode.deleted must be true.",__LINE__,0);
        return;
    }
    int fptr=nodeArr[idx]->fptr;
    int nptr=nodeArr[idx]->nptr;
    nodeArr[fptr]->nptr=nptr;
    if(nptr<=MaxNodeNum)
    {
        nodeArr[nptr]->fptr=fptr;
    }
    free(nodeArr[idx]->memory);
    free(nodeArr[idx]->ptrArr);
    free(nodeArr[idx]);
    nodeArr[idx]=NULL;
    deletedNum--;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
cmpl $0x80, %esi
jge 0x1467
movq %rdi, %rbx
movq 0x20(%rdi), %rcx
movslq %esi, %r14
movq (%rcx,%r14,8), %rax
testq %rax, %rax
je 0x1476
cmpb $0x0, 0x10(%rax)
je 0x1481
movslq 0x30(%rax), %rdx
movslq 0x2c(%rax), %rsi
movq (%rcx,%rdx,8), %rdi
movl %esi, 0x2c(%rdi)
cmpq $0x7f, %rsi
jg 0x1430
movq (%rcx,%rsi,8), %rcx
movl %edx, 0x30(%rcx)
movq (%rax), %rdi
callq 0x1120
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rax
movq 0x20(%rax), %rdi
callq 0x1120
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x1120
movq 0x20(%rbx), %rax
andq $0x0, (%rax,%r14,8)
decl 0x14(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x1e
popq %rsi
pushq $0x1
popq %rdx
popq %rbx
popq %r14
popq %rbp
jmp 0x135c
leaq 0x1b87(%rip), %rdi      # 0x3004
pushq $0x23
jmp 0x148a
leaq 0x1b7c(%rip), %rdi      # 0x3004
pushq $0x28
popq %rsi
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x1030
// File: /workspace/github_cpp_makefile_star2_O2/WbtLm[P]mempool/./mempool.cpp
// Function: mpnsp::memPool::createNewNode(unsigned int)
int mpnsp::memPool::createNewNode(uint num)//返回值是新开辟的位置
{
    if(__builtin_expect(nodeNum+deletedNum>=MaxNodeNum,0))
    {
        myErrorOperate("memPool.nodes are too many.",__LINE__,0);
        return -1;
    }
    if(num<=1)
    {
        myErrorOperate("createNewNode.num must >1",__LINE__,1);
    }
    int i;
    for(i=0;i<MaxNodeNum && nodeArr[i]!=NULL;i++);//ok 寻找一个空节点
    memNode *node=(memNode*)malloc(sizeof(memNode));
    if(__builtin_expect(node==NULL,0))
        return -1;
    nodeArr[i]=node;
    node->used=0;
    node->deleted=0;
    node->memory=(char*)malloc(unitSize*(num+1));
    if(__builtin_expect(node->memory==NULL,0))
        return -1;
    MaxAllocNum=std::max(num,MaxAllocNum);
    node->head=node->memory+unitSize-((long long)node->memory%unitSize);//内存对齐
    node->size=num;
    node->ptrArr=(uint*)malloc(num*sizeof(uint*));
    if(__builtin_expect(node->ptrArr==NULL,0))
        return -1;
    node->fptr=i-1;
    node->nptr=nodeArr[i-1]->nptr;
    nodeArr[i-1]->nptr=i;
    if(node->nptr < MaxNodeNum)
    {
        nodeArr[node->nptr]->fptr=i;
    }

    for(int j=1;j<=num;j++)//ok
    {
        node->ptrArr[j-1]=j;
    }
    node->top=0;
    nodeNum++;
    return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x14(%rdi), %eax
addl 0x10(%rdi), %eax
cmpl $0x7f, %eax
jae 0x15cd
movl %esi, %r14d
movq %rdi, %rbx
cmpl $0x1, %esi
ja 0x14c9
pushq $0x41
popq %rsi
pushq $0x1
popq %rdx
callq 0x135c
movq 0x20(%rbx), %r12
xorl %eax, %eax
pushq $0x7f
popq %r13
cmpq $0x7f, %rax
je 0x14e8
cmpq $0x0, (%r12,%rax,8)
je 0x14e5
incq %rax
jmp 0x14d3
movl %eax, %r13d
pushq $0x38
popq %rdi
callq 0x1140
pushq $-0x1
popq %rcx
testq %rax, %rax
je 0x15bc
movq %rax, %r15
movl %r13d, %eax
movq %r15, (%r12,%rax,8)
andl $0x0, 0x18(%r15)
movb $0x0, 0x10(%r15)
movslq (%rbx), %r12
leal 0x1(%r14), %eax
movl %r12d, %edi
movl %eax, -0x2c(%rbp)
imull %eax, %edi
callq 0x1140
movq %rax, (%r15)
testq %rax, %rax
je 0x15de
movl 0x18(%rbx), %ecx
cmpl %r14d, %ecx
cmovbel %r14d, %ecx
movl %ecx, 0x18(%rbx)
movq %rax, %rcx
addq %r12, %rcx
cqto
idivq %r12
subq %rdx, %rcx
movq %rcx, 0x8(%r15)
movl %r14d, 0x14(%r15)
movl %r14d, %edi
shlq $0x3, %rdi
callq 0x1140
movq %rax, 0x20(%r15)
testq %rax, %rax
pushq $-0x1
popq %rcx
je 0x15bc
leal -0x1(%r13), %ecx
movl %ecx, 0x30(%r15)
movq 0x20(%rbx), %rcx
movslq %r13d, %rdx
movq -0x8(%rcx,%rdx,8), %rdx
movl 0x2c(%rdx), %esi
movl %esi, 0x2c(%r15)
movl %r13d, 0x2c(%rdx)
movl 0x2c(%r15), %edx
cmpq $0x7e, %rdx
ja 0x159d
movq (%rcx,%rdx,8), %rcx
movl %r13d, 0x30(%rcx)
movl -0x2c(%rbp), %ecx
pushq $0x1
popq %rdx
cmpq %rdx, %rcx
je 0x15b1
movl %edx, -0x4(%rax,%rdx,4)
incq %rdx
jmp 0x15a3
andl $0x0, 0x28(%r15)
incl 0x10(%rbx)
movl %r13d, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1a30(%rip), %rdi      # 0x3004
pushq $0x3c
popq %rsi
xorl %eax, %eax
callq 0x1030
pushq $-0x1
popq %rcx
jmp 0x15bc
nop
// File: /workspace/github_cpp_makefile_star2_O2/WbtLm[P]mempool/./mempool.cpp
// Function: mpnsp::memPool::~memPool()
mpnsp::memPool::~memPool()
{
    for(int i=0;i<MaxNodeNum;i++)
    {
        if(nodeArr[i])
        {
            free(nodeArr[i]->memory);
            free(nodeArr[i]->ptrArr);
            free(nodeArr[i]);
        }
    }
    free(nodeArr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
movq 0x20(%rbx), %rdi
cmpq $0x7f, %r14
je 0x162f
movq (%rdi,%r14,8), %rax
testq %rax, %rax
je 0x162a
movq (%rax), %rdi
callq 0x1120
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rax
movq 0x20(%rax), %rdi
callq 0x1120
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x1120
incq %r14
jmp 0x15f1
popq %rbx
popq %r14
popq %rbp
jmp 0x1120
// File: /workspace/github_cpp_makefile_star2_O2/WbtLm[P]mempool/./mempool.cpp
// Function: mpnsp::memPool::memPoolInit()
void mpnsp::memPool::memPoolInit()
{
    int s=sizeof(memNode*)*(MaxNodeNum+1);
    nodeArr=(memNode**)malloc(s);
    if(__builtin_expect(nodeArr==NULL,0))
    {
        myErrorOperate("memPool.nodeArr.create fail",__LINE__,0);
        return;
    }
    memset(nodeArr,0,s);
    //初始化头结点
    memNode *node=(memNode*)malloc(sizeof(memNode));
    if(__builtin_expect(node==NULL,0))
    {
        myErrorOperate("memPool.create head node fail",0);
        return;
    }
    nodeArr[0]=node;
    node->used=0;
    node->deleted=0;
    node->memory=NULL;
    node->head=NULL;
    node->size=0;
    node->ptrArr=NULL;
    node->fptr=0;
    node->nptr=MaxNodeNum+1;
    node->top=-1;
        //创建第一个节点

    int ret=createNewNode(maxNumInNode);
    if(ret<0)
    {
        myErrorOperate("memPool.createNewNode.fail",__LINE__,1);
    }
    topPtr=ret<<OffsetBits;//指向新开辟的node
    status=1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
pushq $0x1
popq %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x1090
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x16c4
movq %rax, %r14
pushq $0x38
popq %rdi
callq 0x1140
testq %rax, %rax
je 0x16d9
andq $0x0, 0x14(%rax)
andq $0x0, 0x20(%rax)
andl $0x0, 0x30(%rax)
movq %rax, (%r14)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movb $0x0, 0x10(%rax)
movabsq $0x80ffffffff, %rcx     # imm = 0x80FFFFFFFF
movq %rcx, 0x28(%rax)
movl 0x1c(%rbx), %esi
movq %rbx, %rdi
callq 0x1496
movl %eax, %r14d
testl %eax, %eax
jns 0x16b0
pushq $0x1
popq %rdx
movl $0x91, %esi
callq 0x135c
shll $0x15, %r14d
movslq %r14d, %rax
movq %rax, 0x8(%rbx)
movb $0x1, 0x28(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x1939(%rip), %rdi      # 0x3004
pushq $0x77
popq %rsi
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x1030
pushq $0x1
popq %rdx
xorl %esi, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x135c
nop
// File: /workspace/github_cpp_makefile_star2_O2/WbtLm[P]mempool/./mempool.cpp
// Function: mpnsp::memPool::memPool(int, int)
mpnsp::memPool::memPool(int nodeSize,int initNum/*=InitNumInNode*/)
{
    status=0;
    unitSize=nodeSize;
    topPtr=-1;
    nodeNum=0;
    deletedNum=0;
    maxNumInNode=initNum;
    MaxAllocNum=MaxAllocMem/nodeSize;
    if(MaxAllocMem<16)
    {
        myErrorOperate("memPool.MaxAllocMem is too small.",__LINE__,1); //开发阶段就很容易找到的错误
        return;
    }
    if(maxNumInNode>MaxAllocNum)
    {
        maxNumInNode=MaxAllocNum;
    }
    memPoolInit();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
andq $0x0, 0x20(%rdi)
movb $0x0, 0x28(%rdi)
movl %esi, (%rdi)
orq $-0x1, 0x8(%rdi)
andq $0x0, 0x10(%rdi)
movl %edx, %ecx
movl %edx, 0x1c(%rdi)
movl $0x8000000, %eax        # imm = 0x8000000
xorl %edx, %edx
idivl %esi
movl %eax, 0x18(%rdi)
cmpl %ecx, %eax
jae 0x1719
movl %eax, 0x1c(%rdi)
popq %rbp
jmp 0x1638
nop
// File: /workspace/github_cpp_makefile_star2_O2/WbtLm[P]mempool/./mempool.cpp
// Function: mpnsp::memPool::freeMemToPool(void*)
void mpnsp::memPool::freeMemToPool(void *p)
{
    #define free_end(idx) (nodeArr[idx]->head+unitSize*nodeArr[idx]->size)
    #define free_head(idx) (nodeArr[idx]->head)
    int i;
    char *ptr=(char*)p;
    for(i=nodeArr[0]->nptr;i<=MaxNodeNum;)
    {
        if(__builtin_expect(nodeArr[i]==NULL,0))
            i++;
        else if(!(p>=free_head(i) && p<free_end(i)))
        {
            i=nodeArr[i]->nptr;
        }
        else
        {
            memNode *node=nodeArr[i];
            uint idx=(ptr-node->head)/unitSize;
            *alloc_ptr(idx)=node->top;
            node->top=idx;
            topPtr=i<<OffsetBits;
            topPtr|=node->top;
            node->used--;
            #if EnableAutoClean
            if(__builtin_expect(nodeArr[i]->deleted == 0 && nodeArr[i]->size <= AutoCleanSize,0))
            {
                nodeArr[i]->deleted=1;
                nodeNum--;
                deletedNum++;
            }
            #endif
            if(!nodeArr[i]->used && nodeArr[i]->deleted)
            {
                //如果打了deleted标记的node已经没有成员了，就删除
                freeMemNode(i);
            }
            return;
        }
    }
    myErrorOperate("freeMemToPool.mem.Release mem to OS instand of to pool.",__LINE__,0);
    free(p);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq 0x20(%rdi), %rax
movq (%rax), %rcx
movl 0x2c(%rcx), %esi
movslq (%rdi), %r8
cmpl $0x7f, %esi
jg 0x18d7
movslq %esi, %rcx
movq (%rax,%rcx,8), %rcx
testq %rcx, %rcx
je 0x18d3
movq 0x8(%rcx), %rdx
cmpq %rbx, %rdx
ja 0x18ce
movl 0x14(%rcx), %r9d
imull %r8d, %r9d
addq %rdx, %r9
cmpq %rbx, %r9
ja 0x18f8
movl 0x2c(%rcx), %esi
jmp 0x18a4
incl %esi
jmp 0x18a4
leaq 0x1726(%rip), %rdi      # 0x3004
movl $0x127, %esi            # imm = 0x127
xorl %eax, %eax
callq 0x1030
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1120
subq %rdx, %rbx
movq %rbx, %rax
cqto
idivq %r8
movl 0x28(%rcx), %edx
movq 0x20(%rcx), %r8
movl %eax, %r9d
movl %edx, (%r8,%r9,4)
movl %eax, 0x28(%rcx)
movl %esi, %eax
shll $0x15, %eax
cltq
orq %r9, %rax
movq %rax, 0x8(%rdi)
movl 0x18(%rcx), %eax
decl %eax
movl %eax, 0x18(%rcx)
cmpb $0x0, 0x10(%rcx)
je 0x1934
xorl %edx, %edx
jmp 0x1944
movl 0x1c(%rdi), %r8d
shrl $0x4, %r8d
movb $0x1, %dl
cmpl %r8d, 0x14(%rcx)
jbe 0x195b
testl %eax, %eax
setne %al
addq $0x8, %rsp
orb %dl, %al
je 0x1954
popq %rbx
popq %rbp
retq
popq %rbx
popq %rbp
jmp 0x13ec
movb $0x1, 0x10(%rcx)
decl 0x10(%rdi)
incl 0x14(%rdi)
jmp 0x1930
// File: /workspace/github_cpp_makefile_star2_O2/WbtLm[P]mempool/./mempool.cpp
// Function: mpnsp::do_createMemPool(int, int, std::map<int, mpnsp::memPool*, std::less<int>, std::allocator<std::pair<int const, mpnsp::memPool*>>>&)
int mpnsp::do_createMemPool(int nodeSize,int initNum,std::map<int,memPool*>&memPoolMap)//初始个数
{
 //   cout<<"do_create.初始化内存池:"<<"size="<<nodeSize<<endl;
    if(memPoolMap.count(nodeSize))//不允许重复建立
    {
        myErrorOperate("不允许重复建立",__LINE__,1);
        return 1;
    }
    memPool *pool=new memPool(nodeSize,initNum);
    memPoolMap[nodeSize]=pool;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %r14d
leaq -0x1c(%rbp), %rsi
movl %edi, (%rsi)
movq %rdx, %rdi
callq 0x1cc0
testq %rax, %rax
je 0x19a6
pushq $0x1
popq %rbx
movl $0x152, %esi            # imm = 0x152
movl %ebx, %edx
callq 0x135c
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x30
popq %rdi
callq 0x10f0
leaq -0x1c(%rbp), %r15
movl (%r15), %esi
movq %rax, %rdi
movl %r14d, %edx
callq 0x16e8
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1ce4
nop