LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/WolfgangLechner[P]StructureAnalysis/molecular_system.cpp
// Function: CMolecularSystem::writeQ4Q6Histograms()
void CMolecularSystem::writeQ4Q6Histograms()
{
  FILE *ofBCC,*ofFCC,*ofHCP,*ofLIQ;
  
  char IntStr[80];
  sprintf( IntStr, "./output/QBCC.dat") ;
  ofBCC = fopen(IntStr,"w");
  sprintf( IntStr, "./output/QFCC.dat") ;
  ofFCC = fopen(IntStr,"w");
  sprintf( IntStr, "./output/QHCP.dat") ;
  ofHCP = fopen(IntStr,"w");
  sprintf( IntStr, "./output/QLIQ.dat") ;
  ofLIQ = fopen(IntStr,"w");
  
  for (int j = 0;j<Q6SIZE;j++)
  {
    for (int i = 0;i<Q4SIZE;i++)
    {
      fprintf(ofBCC,"%d %d %.18lf\n",i ,j ,QBCC[i][j]);
      fprintf(ofFCC,"%d %d %.18lf\n",i ,j ,QFCC[i][j]);
      fprintf(ofHCP,"%d %d %.18lf\n",i ,j ,QHCP[i][j]);
      fprintf(ofLIQ,"%d %d %.18lf\n",i ,j ,QLIQ[i][j]);
    }
    fprintf(ofBCC,"\n");
    fprintf(ofFCC,"\n");
    fprintf(ofHCP,"\n");
    fprintf(ofLIQ,"\n");
  }
  fclose(ofBCC);
  fclose(ofFCC);
  fclose(ofHCP);
  fclose(ofLIQ);
 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, %r12
movups 0x2663(%rip), %xmm0     # 0x82b0
leaq -0xa0(%rbp), %rbx
movaps %xmm0, (%rbx)
movw $0x74, %r15w
movw %r15w, 0x10(%rbx)
leaq 0x265a(%rip), %r14      # 0x82c2
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2200
movq %rax, -0x38(%rbp)
movw %r15w, 0x10(%rbx)
movups 0x2641(%rip), %xmm0     # 0x82c4
movaps %xmm0, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2200
movq %rax, %r13
movw %r15w, 0x10(%rbx)
movups 0x2636(%rip), %xmm0     # 0x82d6
movaps %xmm0, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2200
movq %rax, -0x30(%rbp)
movw %r15w, 0x10(%rbx)
movups 0x262a(%rip), %xmm0     # 0x82e8
movaps %xmm0, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2200
addq $0x7a50b8, %r12         # imm = 0x7A50B8
xorl %ebx, %ebx
leaq 0x261e(%rip), %r14      # 0x82fa
movq %rax, -0x48(%rbp)
movq %r13, -0x40(%rbp)
movq %r12, -0x50(%rbp)
xorl %r15d, %r15d
movq -0x38(%rbp), %r13
movsd (%r12), %xmm0
movq %r13, %rdi
movq %r14, %rsi
movl %r15d, %edx
movl %ebx, %ecx
movb $0x1, %al
callq 0x2280
movsd 0xea600(%r12), %xmm0
movq -0x40(%rbp), %rdi
movq %r14, %rsi
movl %r15d, %edx
movl %ebx, %ecx
movb $0x1, %al
callq 0x2280
movsd 0x1d4c00(%r12), %xmm0
movq -0x30(%rbp), %rdi
movq %r14, %rsi
movl %r15d, %edx
movl %ebx, %ecx
movb $0x1, %al
callq 0x2280
movsd 0x2bf200(%r12), %xmm0
movq -0x48(%rbp), %rdi
movq %r14, %rsi
movl %r15d, %edx
movl %ebx, %ecx
movb $0x1, %al
callq 0x2280
incq %r15
addq $0x12c0, %r12           # imm = 0x12C0
cmpq $0xc8, %r15
jne 0x5cef
movl $0xa, %edi
movq %r13, %rsi
callq 0x2230
movl $0xa, %edi
movq -0x40(%rbp), %r13
movq %r13, %rsi
callq 0x2230
movl $0xa, %edi
movq -0x30(%rbp), %rsi
callq 0x2230
movl $0xa, %edi
movq -0x48(%rbp), %r15
movq %r15, %rsi
callq 0x2230
incq %rbx
movq -0x50(%rbp), %r12
addq $0x8, %r12
cmpq $0x258, %rbx            # imm = 0x258
jne 0x5ce4
movq -0x38(%rbp), %rdi
callq 0x21a0
movq %r13, %rdi
callq 0x21a0
movq -0x30(%rbp), %rdi
callq 0x21a0
movq %r15, %rdi
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21a0
// File: /workspace/github_cpp_makefile_star2_O3/WolfgangLechner[P]StructureAnalysis/molecular_system.cpp
// Function: CMolecularSystem::norm_Q4Q6Histograms()
void CMolecularSystem::norm_Q4Q6Histograms()
{
  double normBCC, normHCP, normFCC, normLIQ;
  normBCC = 0.0;
  normHCP = 0.0;
  normFCC = 0.0;
  normLIQ = 0.0;
  for (int ti = 0;ti<Q4SIZE;ti++)
  {
    for (int tj = 0;tj<Q6SIZE;tj++)
    {
      normBCC += QBCC[ti][tj];
      normFCC += QFCC[ti][tj];
      normHCP += QHCP[ti][tj];
      normLIQ += QLIQ[ti][tj];
    }
  }
  for (int ti = 0;ti<Q4SIZE;ti++)
  {
    for (int tj = 0;tj<Q6SIZE;tj++)
    {
      QBCC[ti][tj] /= normBCC;
      QFCC[ti][tj] /= normFCC;
      QHCP[ti][tj] /= normHCP;
      QLIQ[ti][tj] /= normLIQ;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
addq $0xa642b8, %rdi         # imm = 0xA642B8
xorpd %xmm0, %xmm0
xorl %eax, %eax
movq %rdi, %rcx
xorpd %xmm1, %xmm1
xorpd %xmm2, %xmm2
xorpd %xmm3, %xmm3
xorl %edx, %edx
addsd -0x2bf200(%rcx,%rdx,8), %xmm3
addsd -0x1d4c00(%rcx,%rdx,8), %xmm1
addsd -0xea600(%rcx,%rdx,8), %xmm2
addsd (%rcx,%rdx,8), %xmm0
incq %rdx
cmpq $0x258, %rdx            # imm = 0x258
jne 0x5e1c
incq %rax
addq $0x12c0, %rcx           # imm = 0x12C0
cmpq $0xc8, %rax
jne 0x5e1a
xorl %eax, %eax
xorl %ecx, %ecx
movsd -0x2bf200(%rdi,%rcx,8), %xmm4
divsd %xmm3, %xmm4
movsd %xmm4, -0x2bf200(%rdi,%rcx,8)
movsd -0x1d4c00(%rdi,%rcx,8), %xmm4
divsd %xmm1, %xmm4
movsd %xmm4, -0x1d4c00(%rdi,%rcx,8)
movsd -0xea600(%rdi,%rcx,8), %xmm4
divsd %xmm2, %xmm4
movsd %xmm4, -0xea600(%rdi,%rcx,8)
movsd (%rdi,%rcx,8), %xmm4
divsd %xmm0, %xmm4
movsd %xmm4, (%rdi,%rcx,8)
incq %rcx
cmpq $0x258, %rcx            # imm = 0x258
jne 0x5e5e
incq %rax
addq $0x12c0, %rdi           # imm = 0x12C0
cmpq $0xc8, %rax
jne 0x5e5c
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/WolfgangLechner[P]StructureAnalysis/molecular_system.cpp
// Function: CMolecularSystem::sample_Q4Q6Histograms()
void CMolecularSystem::sample_Q4Q6Histograms()
{
  int q4box,q6box;
  for (int ti= 0;ti<this->parameter->nop;ti++)
  {
    q4box = int(this->molecules[ti].AQ4 * Q4FACTOR);
    q6box = int(this->molecules[ti].AQ6 * Q4FACTOR);
    this->QBCC[q4box][q6box] += 1.0;
    this->QFCC[q4box][q6box] += 1.0;
    this->QHCP[q4box][q6box] += 1.0;
    this->QLIQ[q4box][q6box] += 1.0;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
movq 0xb4e8c0(%rdi), %rax
movslq 0x3208(%rax), %r8
testq %r8, %r8
jle 0x5fb9
movq 0xb4e8b8(%rdi), %rax
leaq 0x7a50b8(%rdi), %rcx
leaq 0x88f6b8(%rdi), %rdx
leaq 0x979cb8(%rdi), %rsi
addq $0xa642b8, %rdi         # imm = 0xA642B8
imulq $0x870, %r8, %r8        # imm = 0x870
xorl %r9d, %r9d
movsd 0x2171(%rip), %xmm0     # 0x8090
movsd 0x20e1(%rip), %xmm1     # 0x8008
movsd 0x840(%rax,%r9), %xmm2
mulsd %xmm0, %xmm2
movsd 0x838(%rax,%r9), %xmm3
cvttsd2si %xmm2, %r10d
mulsd %xmm0, %xmm3
cvttsd2si %xmm3, %r11d
movslq %r10d, %r10
movslq %r11d, %r11
imulq $0x12c0, %r10, %r10     # imm = 0x12C0
leaq (%rcx,%r10), %rbx
movsd (%rbx,%r11,8), %xmm2
addsd %xmm1, %xmm2
movsd %xmm2, (%rbx,%r11,8)
leaq (%rdx,%r10), %rbx
movsd (%rbx,%r11,8), %xmm2
addsd %xmm1, %xmm2
movsd %xmm2, (%rbx,%r11,8)
leaq (%rsi,%r10), %rbx
movsd (%rbx,%r11,8), %xmm2
addsd %xmm1, %xmm2
movsd %xmm2, (%rbx,%r11,8)
addq %rdi, %r10
movsd (%r10,%r11,8), %xmm2
addsd %xmm1, %xmm2
movsd %xmm2, (%r10,%r11,8)
addq $0x870, %r9             # imm = 0x870
cmpq %r9, %r8
jne 0x5f27
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/WolfgangLechner[P]StructureAnalysis/molecular_system.cpp
// Function: CMolecularSystem::get_HistoBox(double, double, double, int)
int CMolecularSystem::get_HistoBox(double value,double a, double b, int n)
{
  int box;
  box = 0;
  if ((value < a) || (value > b))
  {
   cerr << "value out of Histogram bound, check OrderParameterHistoStart and OrderParameterHistoStop\n";
  } else {
    box = int((value - a)/(b - a)*n);
  }
  return box;
}

// Assembly:
ucomisd %xmm0, %xmm1
ja 0x5fe4
ucomisd %xmm2, %xmm0
ja 0x5fe4
subsd %xmm1, %xmm0
subsd %xmm1, %xmm2
xorps %xmm1, %xmm1
cvtsi2sd %esi, %xmm1
divsd %xmm2, %xmm0
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
retq
pushq %rbp
movq %rsp, %rbp
movq 0x5001(%rip), %rdi      # 0xaff0
leaq 0x2312(%rip), %rsi      # 0x8308
movl $0x59, %edx
callq 0x21f0
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/WolfgangLechner[P]StructureAnalysis/molecular_system.cpp
// Function: CMolecularSystem::calculate_bondOrderParameter()
void CMolecularSystem::calculate_bondOrderParameter()
{
  //Find all particles within a radius of neighbordistance
  this->get_AllNeighbors();
  //Calculate q_lm vector
  this->calculate_complexQLM();
  //Calculate averaged version of q_lm as in J. Chem. Phys. 129, 114707 (2008)
  this->calculate_averageComplexQLM();
  //From these vectors calculate the q_4 and q_4
  this->calculate_qFromComplexVector();
  //and also aq_4 and aq_6
  this->calculate_averagedqFromComplexVector();
  //and Q_6 and Q_4
  this->calculate_globalqFromComplexVector();
  //and the number of bonds to find the largest cluster
  this->calculate_frenkelNumbers();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x4a1c
movq %rbx, %rdi
callq 0x524c
movq %rbx, %rdi
callq 0x543e
movq %rbx, %rdi
callq 0x5578
movq %rbx, %rdi
callq 0x5690
movq %rbx, %rdi
callq 0x57d4
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5b58
// File: /workspace/github_cpp_makefile_star2_O3/WolfgangLechner[P]StructureAnalysis/molecular_system.cpp
// Function: CMolecularSystem::clusterCriterium(int, int)
int CMolecularSystem::clusterCriterium(int ti,int criterium)
{
  int value;
  value = 0;
  if (criterium == 0)
  {
    if (this->molecules[ti].frenkelnumber > parameter->minfrenkel)
    { value = 1; } else {value = 0;}
  }
  return value;
}

// Assembly:
xorl %eax, %eax
testl %edx, %edx
je 0x645d
retq
pushq %rbp
movq %rsp, %rbp
movslq %esi, %rax
imulq $0x870, %rax, %rax      # imm = 0x870
movq 0xb4e8b8(%rdi), %rcx
movq 0xb4e8c0(%rdi), %rdx
movsd 0x858(%rcx,%rax), %xmm0
cvtsi2sdl 0x3210(%rdx), %xmm1
xorl %eax, %eax
ucomisd %xmm1, %xmm0
seta %al
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/WolfgangLechner[P]StructureAnalysis/molecular_system.cpp
// Function: CMolecularSystem::harvestCluster(int, int, int)
void CMolecularSystem::harvestCluster(int ti,int numberofCluster,int criterium)
{
  int c;
  int neighbor;
  c = 0;
  do
  {
    neighbor =  this->molecules[ti].neighbors[c];
    if ((this->molecules[neighbor].belongsto == nilvalue) && (clusterCriterium(neighbor,criterium)))
    {
      this->molecules[neighbor].belongsto = numberofCluster;
      harvestCluster(neighbor,numberofCluster,criterium);
    }
    c += 1;
    } while (this->molecules[ti].neighbors[c] != nilvalue);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebx
movl %edx, %r14d
movq %rdi, %r15
movslq %esi, %rcx
movq 0xb4e8b8(%rdi), %rax
imulq $0x870, %rcx, %r12      # imm = 0x870
movl 0xa0(%rax,%r12), %esi
addq $0xa4, %r12
testl %ebx, %ebx
jne 0x6525
movslq %esi, %rcx
imulq $0x870, %rcx, %rcx      # imm = 0x870
cmpl $0x1fca055, 0x860(%rax,%rcx) # imm = 0x1FCA055
jne 0x6525
movsd 0x858(%rax,%rcx), %xmm0
movq 0xb4e8c0(%r15), %rdx
xorps %xmm1, %xmm1
cvtsi2sdl 0x3210(%rdx), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x6525
addq %rcx, %rax
addq $0x860, %rax            # imm = 0x860
movl %r14d, (%rax)
movq %r15, %rdi
movl %r14d, %edx
xorl %ecx, %ecx
callq 0x6496
movq 0xb4e8b8(%r15), %rax
movl (%rax,%r12), %esi
addq $0x4, %r12
cmpl $0x1fca055, %esi        # imm = 0x1FCA055
jne 0x64c9
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/WolfgangLechner[P]StructureAnalysis/molecular_system.cpp
// Function: CMolecularSystem::buildClusters(int)
int CMolecularSystem::buildClusters(int criterium)
{
  int numberofCluster;
  int nop;
  nop = parameter->nop;
  numberofCluster = 0;
  for (int ti= 0;ti<nop;ti++)
  {
    this->molecules[ti].belongsto = nilvalue;
  }
  for (int ti= 0;ti<nop;ti++)
  {
    if ((this->molecules[ti].belongsto == nilvalue) && (clusterCriterium(ti,criterium)))
    {
      numberofCluster += 1;
      this->molecules[ti].belongsto = numberofCluster;
      harvestCluster(ti,numberofCluster,criterium);
    }
  }
  return numberofCluster;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0xb4e8c0(%rdi), %rax
movslq 0x3208(%rax), %r8
testq %r8, %r8
jle 0x6603
movl %esi, %r15d
movq %rdi, %r13
movq 0xb4e8b8(%rdi), %rax
imulq $0x870, %r8, %rcx       # imm = 0x870
xorl %edx, %edx
movl $0x1fca055, 0x860(%rax,%rdx) # imm = 0x1FCA055
addq $0x870, %rdx            # imm = 0x870
cmpq %rdx, %rcx
jne 0x6579
testl %r8d, %r8d
jle 0x6603
xorl %r12d, %r12d
movl $0x860, %ebx            # imm = 0x860
xorl %r14d, %r14d
movq %r8, -0x30(%rbp)
testl %r15d, %r15d
jne 0x65f2
movq 0xb4e8b8(%r13), %rdx
cmpl $0x1fca055, (%rdx,%rbx) # imm = 0x1FCA055
jne 0x65f2
movsd -0x8(%rdx,%rbx), %xmm0
movq 0xb4e8c0(%r13), %rcx
xorps %xmm1, %xmm1
cvtsi2sdl 0x3210(%rcx), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x65f2
incl %r14d
movl %r14d, (%rdx,%rbx)
movq %r13, %rdi
movl %r12d, %esi
movl %r14d, %edx
xorl %ecx, %ecx
callq 0x6496
movq -0x30(%rbp), %r8
incq %r12
addq $0x870, %rbx            # imm = 0x870
cmpq %r12, %r8
jne 0x65a4
jmp 0x6606
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/WolfgangLechner[P]StructureAnalysis/molecular_system.cpp
// Function: CMolecularSystem::get_greatestCluster(int, int&)
int CMolecularSystem::get_greatestCluster(int criterium,int &greatestbelongsto)
{
  int nop;
  nop = parameter->nop;
  int clusterhisto[nop];
  int greatestcluster ;
  greatestcluster = 0;

  this->buildClusters(criterium);

  for (int ti= 0;ti<nop;ti++)
  {
    clusterhisto[ti] = 0;
  }
  //Builds an histo of clustersizes
  for (int ti= 0;ti<nop;ti++)
  {
    if (this->molecules[ti].belongsto != nilvalue) clusterhisto[this->molecules[ti].belongsto] += 1;
  }
  //From the clustersize histo we can find the largest one.
  for (int ti= 0;ti<nop;ti++)
  {
    if (clusterhisto[ti] > greatestcluster)
    {
      greatestcluster = clusterhisto[ti];
      greatestbelongsto = ti;
    }
  }
  //return the size of the greatest cluster. To investigate the cluster use the variable
  //greatestbelongs to.
  return greatestcluster;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r15
movq 0xb4e8c0(%rdi), %rax
movl 0x3208(%rax), %r12d
movq %rsp, %r14
leaq 0xf(,%r12,4), %rax
andq $-0x10, %rax
subq %rax, %r14
movq %r14, %rsp
callq 0x653e
testl %r12d, %r12d
jle 0x66bc
leaq (,%r12,4), %rdx
xorl %r13d, %r13d
movq %r14, %rdi
xorl %esi, %esi
callq 0x2120
movq 0xb4e8b8(%r15), %rax
imulq $0x870, %r12, %rcx      # imm = 0x870
movslq 0x860(%rax,%r13), %rdx
cmpq $0x1fca055, %rdx        # imm = 0x1FCA055
je 0x6691
incl (%r14,%rdx,4)
addq $0x870, %r13            # imm = 0x870
cmpq %r13, %rcx
jne 0x667c
testl %r12d, %r12d
jle 0x66bc
xorl %ecx, %ecx
xorl %eax, %eax
movl (%r14,%rcx,4), %edx
cmpl %eax, %edx
jle 0x66b2
movl %ecx, (%rbx)
movl %edx, %eax
incq %rcx
cmpq %rcx, %r12
jne 0x66a6
jmp 0x66be
xorl %eax, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/WolfgangLechner[P]StructureAnalysis/molecular_system.cpp
// Function: CMolecularSystem::makeperiodic(int)
void CMolecularSystem::makeperiodic(int ti)
{ 
  double boxx,boxy,boxz;
  boxx = this->parameter->boxx;
  boxy = this->parameter->boxy;
  boxz = this->parameter->boxz;
  
  if (this->molecules[ti].posx >=  boxx) {this->molecules[ti].posx -=boxx;}
  if (this->molecules[ti].posx <   0.0)  {this->molecules[ti].posx +=boxx;}
  if (this->molecules[ti].posy >=  boxy) {this->molecules[ti].posy -=boxy;}
  if (this->molecules[ti].posy <   0.0)  {this->molecules[ti].posy +=boxy;}
  if (this->molecules[ti].posz >=  boxz) {this->molecules[ti].posz -=boxz;}
  if (this->molecules[ti].posz <   0.0)  {this->molecules[ti].posz +=boxz;}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0xb4e8b8(%rdi), %rax
movq 0xb4e8c0(%rdi), %rdx
movsd 0x3218(%rdx), %xmm2
movsd 0x3220(%rdx), %xmm1
movslq %esi, %rcx
imulq $0x870, %rcx, %rcx      # imm = 0x870
movsd 0x8(%rax,%rcx), %xmm4
ucomisd %xmm2, %xmm4
movsd 0x3228(%rdx), %xmm0
movapd %xmm4, %xmm5
subsd %xmm2, %xmm5
movapd %xmm2, %xmm3
cmplesd %xmm4, %xmm3
andpd %xmm3, %xmm5
andnpd %xmm4, %xmm3
orpd %xmm5, %xmm3
jae 0x6735
xorpd %xmm4, %xmm4
ucomisd %xmm3, %xmm4
jbe 0x675e
leaq (%rax,%rcx), %rdx
addq $0x8, %rdx
addsd %xmm3, %xmm2
xorpd %xmm4, %xmm4
movapd %xmm3, %xmm5
cmpltsd %xmm4, %xmm5
andpd %xmm5, %xmm2
andnpd %xmm3, %xmm5
orpd %xmm2, %xmm5
movlpd %xmm5, (%rdx)
movsd 0x10(%rax,%rcx), %xmm3
ucomisd %xmm1, %xmm3
movapd %xmm3, %xmm4
subsd %xmm1, %xmm4
movapd %xmm1, %xmm2
cmplesd %xmm3, %xmm2
andpd %xmm2, %xmm4
andnpd %xmm3, %xmm2
orpd %xmm4, %xmm2
jae 0x6791
xorpd %xmm3, %xmm3
ucomisd %xmm2, %xmm3
jbe 0x67ba
leaq (%rax,%rcx), %rdx
addq $0x10, %rdx
addsd %xmm2, %xmm1
xorpd %xmm3, %xmm3
movapd %xmm2, %xmm4
cmpltsd %xmm3, %xmm4
andpd %xmm4, %xmm1
andnpd %xmm2, %xmm4
orpd %xmm1, %xmm4
movlpd %xmm4, (%rdx)
movsd 0x18(%rax,%rcx), %xmm2
ucomisd %xmm0, %xmm2
movapd %xmm2, %xmm3
subsd %xmm0, %xmm3
movapd %xmm0, %xmm1
cmplesd %xmm2, %xmm1
andpd %xmm1, %xmm3
andnpd %xmm2, %xmm1
orpd %xmm3, %xmm1
jae 0x67ed
xorpd %xmm2, %xmm2
ucomisd %xmm1, %xmm2
jbe 0x6815
addq %rcx, %rax
addq $0x18, %rax
addsd %xmm1, %xmm0
xorpd %xmm2, %xmm2
movapd %xmm1, %xmm3
cmpltsd %xmm2, %xmm3
andpd %xmm3, %xmm0
andnpd %xmm1, %xmm3
orpd %xmm0, %xmm3
movlpd %xmm3, (%rax)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/WolfgangLechner[P]StructureAnalysis/molecular_system.cpp
// Function: CMolecularSystem::get_distancePosition(int, double, double, double, double&, double&, double&)
void CMolecularSystem::get_distancePosition(int ti ,double posx, double posy,double posz ,double &diffx,double &diffy,double &diffz)
{
  diffx = posx - this->molecules[ti].posx;
  diffy = posy - this->molecules[ti].posy;
  diffz = posz - this->molecules[ti].posz;

  //nearest image
  if (diffx >  this->parameter->boxx/2.0) {diffx = diffx - this->parameter->boxx;};
  if (diffx < -this->parameter->boxx/2.0) {diffx = diffx + this->parameter->boxx;};
  if (diffy >  this->parameter->boxy/2.0) {diffy = diffy - this->parameter->boxy;};
  if (diffy < -this->parameter->boxy/2.0) {diffy = diffy + this->parameter->boxy;};
  if (diffz >  this->parameter->boxz/2.0) {diffz = diffz - this->parameter->boxz;};
  if (diffz < -this->parameter->boxz/2.0) {diffz = diffz + this->parameter->boxz;};
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0xb4e8b8(%rdi), %rax
movslq %esi, %rsi
imulq $0x870, %rsi, %rsi      # imm = 0x870
subsd 0x8(%rax,%rsi), %xmm0
movsd %xmm0, (%rdx)
subsd 0x10(%rax,%rsi), %xmm1
movsd %xmm1, (%rcx)
subsd 0x18(%rax,%rsi), %xmm2
movsd %xmm2, (%r8)
movsd (%rdx), %xmm0
movq 0xb4e8c0(%rdi), %rax
movsd 0x3218(%rax), %xmm1
movsd 0x17b1(%rip), %xmm2     # 0x8018
mulsd %xmm1, %xmm2
ucomisd %xmm2, %xmm0
jbe 0x6881
subsd %xmm1, %xmm0
movsd %xmm0, (%rdx)
movsd 0x3218(%rax), %xmm1
movsd 0x17af(%rip), %xmm2     # 0x8038
mulsd %xmm1, %xmm2
ucomisd %xmm0, %xmm2
jbe 0x689b
addsd %xmm1, %xmm0
movsd %xmm0, (%rdx)
movsd (%rcx), %xmm0
movsd 0x3220(%rax), %xmm1
movsd 0x1769(%rip), %xmm2     # 0x8018
mulsd %xmm1, %xmm2
ucomisd %xmm2, %xmm0
jbe 0x68c9
subsd %xmm1, %xmm0
movsd %xmm0, (%rcx)
movsd 0x3220(%rax), %xmm1
movsd 0x1767(%rip), %xmm2     # 0x8038
mulsd %xmm1, %xmm2
ucomisd %xmm0, %xmm2
jbe 0x68e3
addsd %xmm1, %xmm0
movsd %xmm0, (%rcx)
movsd (%r8), %xmm0
movsd 0x3228(%rax), %xmm1
movsd 0x1720(%rip), %xmm2     # 0x8018
mulsd %xmm1, %xmm2
ucomisd %xmm2, %xmm0
jbe 0x6913
subsd %xmm1, %xmm0
movsd %xmm0, (%r8)
movsd 0x3228(%rax), %xmm1
movsd 0x171d(%rip), %xmm2     # 0x8038
mulsd %xmm1, %xmm2
ucomisd %xmm0, %xmm2
jbe 0x692e
addsd %xmm1, %xmm0
movsd %xmm0, (%r8)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/WolfgangLechner[P]StructureAnalysis/molecular_system.cpp
// Function: CMolecularSystem::outputSimpleVMDXYZFile(int)
void CMolecularSystem::outputSimpleVMDXYZFile(int number)
{
  char IntStr[80];
  ofstream of;
  sprintf( IntStr, "./output/simple.%d.xyz", number);
  of.open (IntStr, ofstream::out | ofstream::app);
  if (of.is_open())
  {
    of << this->parameter->nop << "\n\n"; 
    for (int ti=0;ti<this->parameter->nop;ti++)
    {
      of << "h " << this->molecules[ti].posx  << " " << this->molecules[ti].posy  << " " <<this->molecules[ti].posz  << "\n";
    }
  }
  of.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x258, %rsp            # imm = 0x258
movl %esi, %r14d
movq %rdi, %rbx
leaq -0x228(%rbp), %r15
movq %r15, %rdi
callq 0x2310
leaq 0x1a02(%rip), %rsi      # 0x8362
leaq -0x280(%rbp), %r12
movq %r12, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x2070
movq %r15, %rdi
movq %r12, %rsi
movl $0x11, %edx
callq 0x2050
leaq -0x1b8(%rbp), %rdi
callq 0x2090
testb %al, %al
je 0x6a9f
movq 0xb4e8c0(%rbx), %rax
movl 0x3208(%rax), %esi
leaq -0x228(%rbp), %rdi
callq 0x2330
leaq 0x19c1(%rip), %rsi      # 0x8379
movl $0x2, %edx
movq %rax, %rdi
callq 0x21f0
movq 0xb4e8c0(%rbx), %rax
cmpl $0x0, 0x3208(%rax)
jle 0x6a9f
xorl %r13d, %r13d
leaq 0x1784(%rip), %r12      # 0x8167
xorl %r15d, %r15d
movl $0x2, %edx
leaq -0x228(%rbp), %rdi
leaq 0x1983(%rip), %rsi      # 0x837c
callq 0x21f0
movq 0xb4e8b8(%rbx), %rax
movsd 0x8(%rax,%r13), %xmm0
leaq -0x228(%rbp), %rdi
callq 0x22e0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x21f0
movq 0xb4e8b8(%rbx), %rax
movsd 0x10(%rax,%r13), %xmm0
movq %r14, %rdi
callq 0x22e0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x21f0
movq 0xb4e8b8(%rbx), %rax
movsd 0x18(%rax,%r13), %xmm0
movq %r14, %rdi
callq 0x22e0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x1901(%rip), %rsi      # 0x837a
callq 0x21f0
incq %r15
movq 0xb4e8c0(%rbx), %rax
movslq 0x3208(%rax), %rax
addq $0x870, %r13            # imm = 0x870
cmpq %rax, %r15
jl 0x69e6
leaq -0x228(%rbp), %rdi
callq 0x2270
movq 0x450e(%rip), %rax      # 0xafc0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x220(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x228(%rbp,%rcx)
callq 0x2160
leaq -0x130(%rbp), %rdi
callq 0x20d0
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6af5
movq %rax, %rbx
leaq -0x228(%rbp), %rdi
callq 0x2290
movq %rbx, %rdi
callq 0x2350
// File: /workspace/github_cpp_makefile_star2_O3/WolfgangLechner[P]StructureAnalysis/parameter.cpp
// Function: CParameter::CParameter()
CParameter::CParameter()
{
  this->nop = -1;
  this->boxx = -1.0;
  this->boxy = -1.0;
  this->boxz = -1.0;
  this->xyzFile = "notset";
  this->baseunit = -1;
  this->noc = -1;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x37f3(%rip), %rax      # 0xad78
movq %rax, (%rdi)
leaq 0x38(%rdi), %rax
movl $0x3200, %ecx           # imm = 0x3200
xorl %edx, %edx
leaq -0x20(%rax), %rsi
movq %rsi, -0x30(%rax)
movq %rdx, -0x28(%rax)
movb %dl, -0x20(%rax)
movq %rax, -0x10(%rax)
movq %rdx, -0x8(%rax)
movb %dl, (%rax)
addq $0x40, %rax
addq $-0x40, %rcx
jne 0x7593
leaq 0x3230(%rbx), %r15
leaq 0x3240(%rbx), %r12
movq %r12, 0x3230(%rbx)
movq $0x0, 0x3238(%rbx)
movb $0x0, 0x3240(%rbx)
movl $0xffffffff, 0x3208(%rbx) # imm = 0xFFFFFFFF
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, 0x3218(%rbx)
movq %rax, 0x3220(%rbx)
movq %rax, 0x3228(%rbx)
leaq 0xad1(%rip), %rcx       # 0x80de
movl $0x6, %r8d
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x22b0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x320c(%rbx)
movl %eax, 0x3214(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq (%r15), %rdi
cmpq %r12, %rdi
je 0x7650
movq (%r12), %rsi
incq %rsi
callq 0x21c0
movl $0x31c8, %r15d          # imm = 0x31C8
leaq (%rbx,%r15), %rdi
callq 0x7bd8
addq $-0x40, %r15
cmpq $-0x38, %r15
jne 0x7656
movq %r14, %rdi
callq 0x2350
nop
// File: /workspace/github_cpp_makefile_star2_O3/WolfgangLechner[P]StructureAnalysis/parameter.cpp
// Function: CParameter::checkParameter()
void CParameter::checkParameter()
{
  double minnd;
  minnd = double(this->boxx)/double(this->baseunit)*sqrt(2.0)/2.0;
  if (this->neighbordistance < minnd)
  {
    cerr << "The minimal neighbor distance is " << minnd << "in parameter.txt it is set to " << this->neighbordistance << "\n";
    cerr << "I now set the neighbordistance to reach the first shell " <<"\n";
    this->neighbordistance = minnd + 0.2;
  }


}

// Assembly:
movsd 0x3218(%rdi), %xmm1
cvtsi2sdl 0x320c(%rdi), %xmm0
divsd %xmm0, %xmm1
mulsd 0x51a(%rip), %xmm1      # 0x8020
mulsd 0x50a(%rip), %xmm1      # 0x8018
ucomisd 0x3250(%rdi), %xmm1
jbe 0x7bd7
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x34c0(%rip), %r14      # 0xaff0
leaq 0xa6c(%rip), %rsi       # 0x85a3
movl $0x21, %edx
movq %r14, %rdi
movsd %xmm1, -0x20(%rbp)
callq 0x21f0
movq %r14, %rdi
movsd -0x20(%rbp), %xmm0
callq 0x22e0
movq %rax, %r15
leaq 0xa65(%rip), %rsi       # 0x85c5
movl $0x1e, %edx
movq %rax, %rdi
callq 0x21f0
movsd 0x3250(%rbx), %xmm0
movq %r15, %rdi
callq 0x22e0
leaq 0x7f6(%rip), %r15       # 0x837a
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x21f0
leaq 0xa49(%rip), %rsi       # 0x85e4
movl $0x38, %edx
movq %r14, %rdi
callq 0x21f0
movl $0x1, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x21f0
movsd -0x20(%rbp), %xmm0
addsd 0x953(%rip), %xmm0      # 0x8518
movsd %xmm0, 0x3250(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/gilecheverria[P]UP_Battle_Project/Character.cpp
// Function: Character::validatePositiveInt(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int Character::validatePositiveInt(std::string value_name)
{
    int value = 0;
    while (value < 1)
    {
        std::cout << "Enter " << value_name << " (integer) : ";
        std::cin >> value;

        if (value < 1)
            std::cout << "Can't be a negative value. Try again\n";
    }
    return value; 
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
leaq 0x4(%rsp), %r14
movl $0x0, (%r14)
movq 0x55f7(%rip), %r15      # 0x7fc8
leaq 0x26a2(%rip), %r13      # 0x507a
movq 0x55f9(%rip), %rbp      # 0x7fd8
leaq 0x26a2(%rip), %r12      # 0x5088
movl $0x6, %edx
movq %r15, %rdi
leaq 0x267e(%rip), %rsi      # 0x5073
callq 0x2180
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r15, %rdi
callq 0x2180
movl $0xd, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2180
movq %rbp, %rdi
movq %r14, %rsi
callq 0x20a0
movl 0x4(%rsp), %eax
testl %eax, %eax
jg 0x2a44
movl $0x25, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x2180
movl 0x4(%rsp), %eax
testl %eax, %eax
jle 0x29e6
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/gilecheverria[P]UP_Battle_Project/Character.cpp
// Function: Character::validatePercent(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
float Character::validatePercent(std::string value_name)
{
    float value = -1;
    while (value < 0 || value > 1)
    {
        std::cout << "Enter " << value_name << " (float) : ";
        std::cin >> value;

        if (value < 0 || value > 1)
            std::cout << "Can't only be decimal number between 0 and 1. Try again\n";
    }
    return value; 
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
leaq 0x4(%rsp), %r14
movl $0xbf800000, (%r14)     # imm = 0xBF800000
movq 0x5553(%rip), %r15      # 0x7fc8
leaq 0x25f7(%rip), %r12      # 0x5073
leaq 0x262b(%rip), %r13      # 0x50ae
movq 0x554e(%rip), %rbp      # 0x7fd8
movl $0x6, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x2180
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r15, %rdi
callq 0x2180
movl $0xb, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2180
movq %rbp, %rdi
movq %r14, %rsi
callq 0x2260
movss 0x4(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
ja 0x2adb
ucomiss 0x252b(%rip), %xmm0     # 0x5004
jbe 0x2af5
movl $0x38, %edx
movq %r15, %rdi
leaq 0x25d0(%rip), %rsi      # 0x50ba
callq 0x2180
movss 0x4(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
ja 0x2a8a
ucomiss 0x2500(%rip), %xmm0     # 0x5004
ja 0x2a8a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/gilecheverria[P]UP_Battle_Project/Character.cpp
// Function: Character::print(int)
void Character::print(int line)
{
    switch (line)
    {
        case 1:
            std::cout << "HP: " << std::setw(4) << current_HP << " / " << std::setw(4) << HP;
            break;
        case 2:
            std::cout << "MP: " << std::setw(4) << current_MP << " / " << std::setw(4) << MP;
            break;
        case 3:
            std::cout << "Status: " << std::setw(7) << status;
            break;
        default:
            // Don't do anything
            break;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x3, %esi
je 0x2d30
cmpl $0x2, %esi
je 0x2ccf
cmpl $0x1, %esi
jne 0x2d6e
movq 0x5352(%rip), %r14      # 0x7fc8
leaq 0x2476(%rip), %rsi      # 0x50f3
movl $0x4, %r15d
movl $0x4, %edx
movq %r14, %rdi
callq 0x2180
movq (%r14), %rax
movq -0x18(%rax), %rax
movq %r15, 0x10(%r14,%rax)
movl 0x4(%rbx), %esi
movq %r14, %rdi
callq 0x2220
movq %rax, %r14
leaq 0x2447(%rip), %rsi      # 0x50f8
movl $0x3, %edx
movq %rax, %rdi
callq 0x2180
movq (%r14), %rax
movq -0x18(%rax), %rax
movq %r15, 0x10(%r14,%rax)
jmp 0x2d5f
movq 0x52f2(%rip), %r14      # 0x7fc8
leaq 0x241f(%rip), %rsi      # 0x50fc
movl $0x4, %r15d
movl $0x4, %edx
movq %r14, %rdi
callq 0x2180
movq (%r14), %rax
movq -0x18(%rax), %rax
movq %r15, 0x10(%r14,%rax)
movl 0xc(%rbx), %esi
movq %r14, %rdi
callq 0x2220
movq %rax, %r14
leaq 0x23e7(%rip), %rsi      # 0x50f8
movl $0x3, %edx
movq %rax, %rdi
callq 0x2180
movq (%r14), %rax
movq -0x18(%rax), %rax
movq %r15, 0x10(%r14,%rax)
addq $0x8, %rbx
jmp 0x2d5f
movq 0x5291(%rip), %r14      # 0x7fc8
leaq 0x23c3(%rip), %rsi      # 0x5101
movl $0x8, %edx
movq %r14, %rdi
callq 0x2180
movq (%r14), %rax
movq -0x18(%rax), %rax
movq $0x7, 0x10(%r14,%rax)
addq $0x48, %rbx
movl (%rbx), %esi
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2220
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/gilecheverria[P]UP_Battle_Project/Character.cpp
// Function: Character::receiveDamage(int)
void Character::receiveDamage(int base_damage)
{
    // Do not allow negative damage. The std::max function will return
    //  the highest value from 0 or the damage minus the defense
    current_HP -= std::max( (base_damage - defense), 0 );
    if (current_HP <= 0)
    {
        current_HP = 0;
        status = DEAD;
    }
}

// Assembly:
subl 0x20(%rdi), %esi
xorl %eax, %eax
testl %esi, %esi
cmovgl %esi, %eax
subl %eax, 0x4(%rdi)
jle 0x2d96
retq
movl $0x0, 0x4(%rdi)
movl $0x1, 0x48(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/gilecheverria[P]UP_Battle_Project/Hero.cpp
// Function: Hero::print(int)
void Hero::print(int line)
{
    if (line == 0)
        std::cout << "== " << std::setw(NAME_LENGTH) << name << " ==";
    else
        Character::print(line);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %esi, %esi
je 0x2f2c
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2c50
movq 0x5095(%rip), %r14      # 0x7fc8
leaq 0x2205(%rip), %rsi      # 0x513f
movl $0x3, %edx
movq %r14, %rdi
callq 0x2180
movq (%r14), %rax
movq -0x18(%rax), %rax
movq $0x9, 0x10(%r14,%rax)
addq $0x54, %rbx
movq %rbx, %rdi
callq 0x2080
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x2180
leaq 0x21cb(%rip), %rsi      # 0x5143
movl $0x3, %edx
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2180
// File: /workspace/github_cpp_makefile_star2_O3/gilecheverria[P]UP_Battle_Project/Hero.cpp
// Function: Hero::inputData()
void Hero::inputData()
{
    std::cout << "== Hero creation module ==\n";

    std::cout << "Enter the name: ";
    std::cin >> name;

    Character::inputData();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x502e(%rip), %r14      # 0x7fc8
leaq 0x21a6(%rip), %rsi      # 0x5147
movl $0x1b, %edx
movq %r14, %rdi
callq 0x2180
leaq 0x21ae(%rip), %rsi      # 0x5163
movl $0x10, %edx
movq %r14, %rdi
callq 0x2180
leaq 0x54(%rbx), %rsi
movq 0x500b(%rip), %rdi      # 0x7fd8
movabsq $0x7fffffffffffffff, %rdx # imm = 0x7FFFFFFFFFFFFFFF
callq 0x2210
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x25e6
nop
// File: /workspace/github_cpp_makefile_star2_O3/gilecheverria[P]UP_Battle_Project/Monster.cpp
// Function: Monster::Monster(monster_t)
Monster::Monster(monster_t _type)
{
    // Set the type of the monster
    type = _type;

    action_percent[ATTACK] = 50;
    action_percent[DEFEND] = 40;
    action_percent[HEAL] = 10;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
xorl %eax, %eax
movsd 0x2179(%rip), %xmm0     # 0x5178
movsd 0x2179(%rip), %xmm1     # 0x5180
movsd 0x2179(%rip), %xmm3     # 0x5188
movl $0x64, %esi
movl $0x14, %edx
movl $0x5, %ecx
xorl %r8d, %r8d
movl $0x1, %r9d
movaps %xmm1, %xmm2
pushq %rax
pushq %rax
callq 0x259c
addq $0x10, %rsp
movl %ebx, 0x4c(%r14)
movsd 0x214f(%rip), %xmm0     # 0x5190
movsd %xmm0, 0x50(%r14)
movl $0x41200000, 0x58(%r14) # imm = 0x41200000
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/gilecheverria[P]UP_Battle_Project/Monster.cpp
// Function: Monster::selectAction()
action_t Monster::selectAction()
{
    int selection = Randomizer::randomRange(1, 100);
    int accum = 0;

    // Loop over the possible actions
    for (int i=0; i<NUM_ACTIONS; i++)
    {
        // Compute the accumulated percentages
        accum += action_percent[i];
        if (selection <= accum)
        {
            // Cast the integer into an action_t variable
            return (action_t)i;
        }
    }
    // A default action
    // if the percents are correctly filled this should never happen
    return ATTACK;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x1, %edi
movl $0x64, %esi
callq 0x3eb4
movl %eax, %ecx
xorl %eax, %eax
xorl %edx, %edx
xorps %xmm0, %xmm0
cvtsi2ss %edx, %xmm0
addss 0x50(%rbx,%rax,4), %xmm0
cvttss2si %xmm0, %edx
cmpl %edx, %ecx
jle 0x3091
incq %rax
cmpq $0x3, %rax
jne 0x3071
xorl %eax, %eax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/gilecheverria[P]UP_Battle_Project/Monster.cpp
// Function: Monster::inputData()
void Monster::inputData()
{
    std::cout << "== Monster creation module ==\n";

    // Ask for a correct monster type
    type = (monster_t)validateMonsterType();

    // Ask for the behaviour percents of the monster
    std::cout << "Enter the following percentages as integers between 0 and 100\n";
    std::cout << "It is up to you to make the percentages add up to 100\n";
    std::cout << "Attack percent: ";
    std::cin >> action_percent[ATTACK];
    std::cout << "Defend percent: ";
    std::cin >> action_percent[DEFEND];
    std::cout << "Heal percent: ";
    std::cin >> action_percent[HEAL];

    // Call the input data method from the parent class
    Character::inputData();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x4f25(%rip), %r14      # 0x7fc8
leaq 0x2110(%rip), %rsi      # 0x51ba
movl $0x1e, %edx
movq %r14, %rdi
callq 0x2180
callq 0x315c
movl %eax, 0x4c(%rbx)
leaq 0x2113(%rip), %rsi      # 0x51d9
movl $0x3e, %edx
movq %r14, %rdi
callq 0x2180
leaq 0x213e(%rip), %rsi      # 0x5218
movl $0x36, %edx
movq %r14, %rdi
callq 0x2180
leaq 0x2161(%rip), %rsi      # 0x524f
movl $0x10, %edx
movq %r14, %rdi
callq 0x2180
leaq 0x50(%rbx), %rsi
movq 0x4ed2(%rip), %r15      # 0x7fd8
movq %r15, %rdi
callq 0x2260
leaq 0x214b(%rip), %rsi      # 0x5260
movl $0x10, %edx
movq %r14, %rdi
callq 0x2180
leaq 0x54(%rbx), %rsi
movq %r15, %rdi
callq 0x2260
leaq 0x213c(%rip), %rsi      # 0x5271
movl $0xe, %edx
movq %r14, %rdi
callq 0x2180
leaq 0x58(%rbx), %rsi
movq %r15, %rdi
callq 0x2260
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x25e6
nop
// File: /workspace/github_cpp_makefile_star2_O3/gilecheverria[P]UP_Battle_Project/Monster.cpp
// Function: Monster::validateMonsterType()
int Monster::validateMonsterType()
{
    int the_type;
    bool valid = false;

    while (!valid)
    {
        std::cout << "Monster types:\n";
        for (int i=0; i<NUM_TYPES; i++)
        {
            std::cout << "\t" << i << ". " << text_names[i] << "\n";
        }
        std::cout << "Select type: ";
        std::cin >> the_type;

        // Check that the type entered is valid
        if (the_type >= 0 and the_type < NUM_TYPES)
            valid = true;
        else
            std::cout << "Incorrect type. Try again ...\n";
    }
    return the_type;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x4e5a(%rip), %rbx      # 0x7fc8
leaq 0x2126(%rip), %rbp      # 0x529b
leaq 0x21f7(%rip), %r13      # 0x5373
movl $0xf, %edx
movq %rbx, %rdi
leaq 0x2100(%rip), %rsi      # 0x528b
callq 0x2180
leaq 0x4fe1(%rip), %r15      # 0x8178
xorl %r14d, %r14d
movl $0x1, %edx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x2180
movq %rbx, %rdi
movl %r14d, %esi
callq 0x2220
movq %rbp, %r12
movq %rax, %rbp
movl $0x2, %edx
movq %rax, %rdi
leaq 0x20d3(%rip), %rsi      # 0x529d
callq 0x2180
movq -0x8(%r15), %rsi
movq (%r15), %rdx
movq %rbp, %rdi
movq %r12, %rbp
callq 0x2180
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2180
incq %r14
addq $0x20, %r15
cmpq $0x4, %r14
jne 0x319a
movl $0xd, %edx
movq %rbx, %rdi
leaq 0x2093(%rip), %rsi      # 0x52a0
callq 0x2180
movq 0x4dbf(%rip), %rdi      # 0x7fd8
leaq 0x4(%rsp), %rsi
callq 0x20a0
cmpl $0x4, 0x4(%rsp)
jb 0x3243
movl $0x1e, %edx
movq %rbx, %rdi
leaq 0x2075(%rip), %rsi      # 0x52ae
callq 0x2180
jmp 0x317c
movl 0x4(%rsp), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/gilecheverria[P]UP_Battle_Project/Monster.cpp
// Function: Monster::print(int)
void Monster::print(int line)
{
    if (line == 0)
        std::cout << "== " << std::setw(9) << getName() << " ==";
    else
        Character::print(line);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %r14
testl %esi, %esi
je 0x339b
movq %r14, %rdi
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2c50
movq 0x4c26(%rip), %rbx      # 0x7fc8
leaq 0x1d96(%rip), %rsi      # 0x513f
movl $0x3, %edx
movq %rbx, %rdi
callq 0x2180
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq $0x9, 0x10(%rbx,%rax)
movl 0x4c(%r14), %eax
shlq $0x5, %rax
leaq 0x4d9b(%rip), %rcx      # 0x8170
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
addq %rsi, %rdx
movq %rsp, %r14
movq %r14, %rdi
callq 0x345a
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x2180
leaq 0x1d38(%rip), %rsi      # 0x5143
movl $0x3, %edx
movq %rax, %rdi
callq 0x2180
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x342e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2170
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x3451
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2170
movq %rbx, %rdi
callq 0x2230
nop
// File: /workspace/github_cpp_makefile_star2_O3/gilecheverria[P]UP_Battle_Project/Party.cpp
// Function: Party::Party(int, party_t)
Party::Party(int _size, party_t _type)
{
    size = _size;
    type = _type;
    // Using 'new' calls malloc and calls the constructor for the class
    members = new Character*[size];
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq $0x0, 0x8(%rdi)
movl %esi, (%rdi)
movl %edx, 0x4(%rdi)
movl %esi, %eax
shlq $0x3, %rax
testl %esi, %esi
movq $-0x1, %rdi
cmovnsq %rax, %rdi
callq 0x2030
movq %rax, 0x8(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/gilecheverria[P]UP_Battle_Project/Party.cpp
// Function: Party::getMember(int)
Character * Party::getMember(int index)
{
    if (index >= 0 && index < size)
        return members[index];
    else
        // Do something
        throw std::runtime_error("Invalid index!");
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testl %esi, %esi
js 0x354c
cmpl %esi, (%rdi)
jle 0x354c
movq 0x8(%rdi), %rax
movl %esi, %ecx
movq (%rax,%rcx,8), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x10, %edi
callq 0x2090
movq %rax, %rbx
leaq 0x1d6d(%rip), %rsi      # 0x52cd
movq %rax, %rdi
callq 0x2070
movq 0x4a81(%rip), %rsi      # 0x7ff0
movq 0x4a4a(%rip), %rdx      # 0x7fc0
movq %rbx, %rdi
callq 0x2200
movq %rax, %r14
movq %rbx, %rdi
callq 0x20d0
movq %r14, %rdi
callq 0x2230
nop
// File: /workspace/github_cpp_makefile_star2_O3/gilecheverria[P]UP_Battle_Project/Party.cpp
// Function: Party::print()
void Party::print()
{
    // Print all the members of a party horizontally
    for (int line=0; line<PRINT_LINES; line++)
    {
        for (int i=0; i<size; i++)
        {
            std::cout << " | ";
            // The first line is the name of the character
            if (line == 0)
            {
                // Cast the type of character to be able to call the correct methods
                if (type == HERO)
                {
                    static_cast<Hero*>(members[i])->print(line);
                }
                if (type == MONSTER)
                {
                    static_cast<Monster*>(members[i])->print(line);
                }
            }
            // All other lines are generic Character data
            else
            {
                members[i]->print(line);
            }
        }
        std::cout << " |" << std::endl;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movq 0x4a0a(%rip), %r15      # 0x7fc8
leaq 0x1d17(%rip), %r12      # 0x52dc
leaq 0x1d14(%rip), %r13      # 0x52e0
cmpl $0x0, (%rbx)
jle 0x3632
xorl %ebp, %ebp
movl $0x3, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x2180
testl %r14d, %r14d
je 0x35fa
movq 0x8(%rbx), %rax
movq (%rax,%rbp,8), %rdi
movl %r14d, %esi
callq 0x2c50
jmp 0x3627
movl 0x4(%rbx), %eax
testl %eax, %eax
jne 0x3613
movq 0x8(%rbx), %rax
movq (%rax,%rbp,8), %rdi
xorl %esi, %esi
callq 0x2f12
movl 0x4(%rbx), %eax
cmpl $0x1, %eax
jne 0x3627
movq 0x8(%rbx), %rax
movq (%rax,%rbp,8), %rdi
xorl %esi, %esi
callq 0x337a
incq %rbp
movslq (%rbx), %rax
cmpq %rax, %rbp
jl 0x35d3
movl $0x2, %edx
movq %r15, %rdi
movq %r13, %rsi
callq 0x2180
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20b0
incl %r14d
cmpl $0x4, %r14d
jne 0x35cc
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/gilecheverria[P]UP_Battle_Project/Battle.cpp
// Function: Battle::Battle(Party&, Party&)
Battle::Battle(Party & _hero_party, Party & _enemy_party)
{
    // Start the random seed
    Randomizer::init();
    // Call the method to set the battle parameters
    initialize(_hero_party, _enemy_party);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movl $0x2, %esi
movl $0x1, %edx
callq 0x34f0
leaq 0x10(%rbx), %r12
movq %r12, %rdi
movl $0x2, %esi
movl $0x1, %edx
callq 0x34f0
callq 0x3ea4
movups (%r15), %xmm0
movups %xmm0, (%rbx)
movups (%r14), %xmm0
movups %xmm0, (%r12)
movl (%rbx), %eax
movl 0x10(%rbx), %ecx
movl %eax, 0x24(%rbx)
movl %ecx, 0x28(%rbx)
movl $0x0, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
movq %r12, %rdi
callq 0x3520
jmp 0x3701
movq %rax, %r14
movq %rbx, %rdi
callq 0x3520
movq %r14, %rdi
callq 0x2230
nop
// File: /workspace/github_cpp_makefile_star2_O3/gilecheverria[P]UP_Battle_Project/Battle.cpp
// Function: Battle::battleLoop()
void Battle::battleLoop()
{
    int turn = 1;

    while (state == FIGHTING)
    {
        std::cout << "---- TURN # " << turn++ << " ----" << std::endl;
        // Print the current values for the parties
        std::cout << "HEROES:" << std::endl;
        hero_party.print();
        std::cout << "MONSTERS:" << std::endl;
        enemy_party.print();

        // Select the actions for the heroes
        for (int i=0; i<num_heroes; i++)
        {
            playerAction(i);
        }
        // Select the actions for the enemies
        for (int i=0; i<num_enemies; i++)
        {
            enemyAction(i);
        }

        // Check if any of the parties has been defeated
        updateBattleState();
    }

    if (state == HERO_WON)
    {
        std::cout << "The heros have won!! Congratulations!" << std::endl;
    }
    else
    {
        std::cout << "Your heroes have been defeated. Game over!" << std::endl;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x10(%rdi), %r15
movl $0x1, %ebp
movq 0x4878(%rip), %rbx      # 0x7fc8
leaq 0x1ba7(%rip), %r13      # 0x52fe
movl 0x20(%r14), %eax
testl %eax, %eax
jne 0x388d
movl $0xc, %edx
movq %rbx, %rdi
leaq 0x1b71(%rip), %rsi      # 0x52e3
callq 0x2180
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2220
movq %rax, %r12
movl $0x5, %edx
movq %rax, %rdi
leaq 0x1b5d(%rip), %rsi      # 0x52f0
callq 0x2180
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r12, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20b0
movl $0x7, %edx
movq %rbx, %rdi
leaq 0x1b27(%rip), %rsi      # 0x52f6
callq 0x2180
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20b0
movq %r14, %rdi
callq 0x35a6
movl $0x9, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2180
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20b0
movq %r15, %rdi
callq 0x35a6
cmpl $0x0, 0x24(%r14)
jle 0x3860
xorl %r12d, %r12d
movq %r14, %rdi
movl %r12d, %esi
callq 0x38ee
incl %r12d
cmpl 0x24(%r14), %r12d
jl 0x384c
cmpl $0x0, 0x28(%r14)
jle 0x387e
xorl %r12d, %r12d
movq %r14, %rdi
movl %r12d, %esi
callq 0x3ac2
incl %r12d
cmpl 0x28(%r14), %r12d
jl 0x386a
incl %ebp
movq %r14, %rdi
callq 0x3ca6
jmp 0x3757
movq 0x4734(%rip), %rdi      # 0x7fc8
cmpl $0x1, %eax
jne 0x38a7
leaq 0x1a68(%rip), %rsi      # 0x5308
movl $0x25, %edx
jmp 0x38b3
leaq 0x1a80(%rip), %rsi      # 0x532e
movl $0x2a, %edx
callq 0x2180
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/gilecheverria[P]UP_Battle_Project/Battle.cpp
// Function: Battle::updateBattleState()
void Battle::updateBattleState()
{
    bool alive = false;

    // Check if there are enemies alive
    for (int i=0; i<num_enemies; i++)
    {
        if (enemy_party.getMember(i)->getStatus() != DEAD)
            alive = true;
    }
    // If all enemies have been defeated, the heroes won
    if (!alive)
    {
        state = HERO_WON;
        return;
    }

    alive = false;
    // Check if there are heroes alive
    for (int i=0; i<num_heroes; i++)
    {
        if (hero_party.getMember(i)->getStatus() != DEAD)
            alive = true;
    }
    // If all heroes have been defeated, the monsters won
    if (!alive)
    {
        state = ENEMY_WON;
        return;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl $0x1, %r15d
cmpl $0x0, 0x28(%rdi)
jle 0x3d19
leaq 0x10(%rbx), %r14
xorl %ebp, %ebp
xorl %r12d, %r12d
movq %r14, %rdi
movl %ebp, %esi
callq 0x352e
cmpl $0x1, 0x48(%rax)
setne %al
orb %al, %r12b
incl %ebp
cmpl 0x28(%rbx), %ebp
jl 0x3cc6
testb $0x1, %r12b
je 0x3d19
movl $0x2, %r15d
cmpl $0x0, 0x24(%rbx)
jle 0x3d19
xorl %ebp, %ebp
xorl %r14d, %r14d
movq %rbx, %rdi
movl %ebp, %esi
callq 0x352e
cmpl $0x1, 0x48(%rax)
setne %al
orb %al, %r14b
incl %ebp
cmpl 0x24(%rbx), %ebp
jl 0x3cf8
testb $0x1, %r14b
jne 0x3d1d
movl %r15d, 0x20(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq