// File: Luthaf[P]zeopp/net.cc
// Function: molecule_alignment_chemistry_is_unique(MOLECULE*, std::vector<MOLECULE, std::allocator<MOLECULE>>*)
bool molecule_alignment_chemistry_is_unique(MOLECULE *mol, vector<MOLECULE> *existing) {
  bool verbose = false;
  bool unique = true;
  int num_existing = existing->size();
  int num_atoms = mol->atoms_xyz.size();
  int num_sites_no_dummy = mol->sites.size();
  int num_sites_dummy = mol->dummy_sites.size();
  int num_sites = num_sites_no_dummy + num_sites_dummy;
  //1) we first check if the sites are aligned
  vector<XYZ> mol_site_positions;
  for(int i=0; i<num_sites; i++) {
    if(i<num_sites_no_dummy)
      mol_site_positions.push_back(mol->atoms_xyz.at(mol->sites.at(i)));
    else
      mol_site_positions.push_back(mol->dummy_sites.at(i-num_sites_no_dummy));
  }
if(verbose) {
  printf("DEBUG: mol sites are positioned as follows:\n");
  for(int i=0; i<num_sites; i++) printf("\t(%.3f,%.3f,%.3f)\n", mol_site_positions.at(i).x, mol_site_positions.at(i).y, mol_site_positions.at(i).z);
}
  for(int i=0; i<num_existing && unique; i++) {
    vector<XYZ> existing_site_positions;
    for(int j=0; j<num_sites; j++) {
      if(j<num_sites_no_dummy) {
        existing_site_positions.push_back(existing->at(i).atoms_xyz.at(existing->at(i).sites.at(j)));
      } else {
        existing_site_positions.push_back(existing->at(i).dummy_sites.at(j-num_sites_no_dummy));
      }
    }
if(verbose) {
  printf("DEBUG: comparing against stored mol sites as follows:\n");
  for(int d=0; d<num_sites; d++) printf("\t(%.3f,%.3f,%.3f)\n", existing_site_positions.at(d).x, existing_site_positions.at(d).y, existing_site_positions.at(d).z);
}
    vector<bool> existing_site_partner_found;
    for(int j=0; j<num_sites; j++) existing_site_partner_found.push_back(false);
    double furthest_site_match = -1;
    for(int m=0; m<num_sites; m++) {
      //for each site in the molecule, find the closest site in the existing one, that has not already been assigned
      double closest_distance = -1;
      int closest_id = -1;
      for(int e=0; e<num_sites; e++) {
        if(!existing_site_partner_found.at(e)) {
          double distance = get_vector_from_to(mol_site_positions.at(m), existing_site_positions.at(e)).magnitude();
          if(distance<closest_distance || closest_distance<0) {
            closest_distance = distance;
            closest_id = e;
          }
        }
      }
      existing_site_partner_found.at(closest_id) = true;
      if(closest_distance>furthest_site_match) furthest_site_match = closest_distance;
    }
    //now we have matched all sites in the molecule to the existing one - if the furthest distance we stored is shorter than the threshold, these are equivalent
if(verbose) printf("DEBUG: furthest site match distance was %.3f\n", furthest_site_match);
    if(furthest_site_match<SAME_POSITION_DISTANCE) unique = false;
    //1b) now for the chemistry bit - if the sites are not uniquely oriented between these two specific molecules, we might still have unique chemistry (because of functional groups or other asymmetry)
    if(!unique) {
      unique = true; //we again assume that the molecule is unique until proven to be otherwise
      vector<bool> existing_atom_partner_found;
      for(int j=0; j<num_atoms; j++) existing_atom_partner_found.push_back(false);
      double furthest_atom_match = -1;
      for(int m=0; m<num_atoms; m++) {
        //for each atom in the molecule, find the closest atom of the same type in the existing one, that has not already been assigned
        double closest_distance = -1;
        int closest_id = -1;
        for(int e=0; e<num_atoms; e++) {
          if(!existing_atom_partner_found.at(e) && existing->at(i).atoms_type.at(e)==mol->atoms_type.at(m)) {
            double distance = get_vector_from_to(mol->atoms_xyz.at(m), existing->at(i).atoms_xyz.at(e)).magnitude();
            if(distance<closest_distance || closest_distance<0) {
              closest_distance = distance;
              closest_id = e;
            }
          }
        }
        existing_atom_partner_found.at(closest_id) = true;
        if(closest_distance>furthest_site_match) furthest_atom_match = closest_distance;
      }
      //now we have matched all atoms in the molecule to the existing one - if the furthest distance we stored is shorter than the threshold, these are equivalent
if(verbose) printf("DEBUG: furthest atom match distance was %.3f\n", furthest_atom_match);
      if(furthest_atom_match<SAME_POSITION_DISTANCE) unique = false;
    }
  }
if(verbose) {
  if(unique) printf("DEBUG: returning unique\n"); else printf("DEBUG: returning NOT unique\n");
}
  return unique;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3d0, %rsp            # imm = 0x3D0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
movb $0x1, -0x12(%rbp)
movq -0x10(%rbp), %rdi
callq 0xaf3f0
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0xae590
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
addq $0x48, %rdi
callq 0x10090
movl %eax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
addq $0x60, %rdi
callq 0x10090
movl %eax, -0x24(%rbp)
movl -0x20(%rbp), %eax
addl -0x24(%rbp), %eax
movl %eax, -0x28(%rbp)
leaq -0x40(%rbp), %rdi
callq 0xada60
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x1143c3
movl -0x44(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x114365
movq -0x8(%rbp), %rdi
movq %rdi, -0x260(%rbp)
addq $0x48, %rdi
movslq -0x44(%rbp), %rsi
callq 0x101d0
movq %rax, -0x258(%rbp)
jmp 0x114321
movq -0x260(%rbp), %rdi
movq -0x258(%rbp), %rax
movslq (%rax), %rsi
callq 0xae5c0
movq %rax, -0x268(%rbp)
jmp 0x114340
movq -0x268(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0xafc20
jmp 0x114352
jmp 0x1143b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x114e3f
movq -0x8(%rbp), %rdi
addq $0x60, %rdi
movl -0x44(%rbp), %eax
movl -0x20(%rbp), %ecx
subl %ecx, %eax
movslq %eax, %rsi
callq 0x101d0
movq %rax, -0x270(%rbp)
jmp 0x114386
movq -0x270(%rbp), %rax
cvtsi2sdl (%rax), %xmm0
leaq -0x70(%rbp), %rdi
xorps %xmm2, %xmm2
movaps %xmm2, %xmm1
callq 0xea8e0
jmp 0x1143a2
leaq -0x40(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x10cbd0
jmp 0x1143b1
jmp 0x1143b3
jmp 0x1143b5
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x1142ec
testb $0x1, -0x11(%rbp)
je 0x114497
leaq 0xe9170(%rip), %rdi     # 0x1fd544
xorl %eax, %eax
callq 0x5070
jmp 0x1143dd
movl $0x0, -0x74(%rbp)
movl -0x74(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x114495
movslq -0x74(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0xae5c0
movq %rax, -0x278(%rbp)
jmp 0x114406
movq -0x278(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x288(%rbp)
movslq -0x74(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0xae5c0
movq %rax, -0x280(%rbp)
jmp 0x11442f
movq -0x280(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x298(%rbp)
movslq -0x74(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0xae5c0
movq %rax, -0x290(%rbp)
jmp 0x114459
movsd -0x298(%rbp), %xmm1
movsd -0x288(%rbp), %xmm0
movq -0x290(%rbp), %rax
movsd 0x10(%rax), %xmm2
leaq 0xe90f5(%rip), %rdi     # 0x1fd571
movb $0x3, %al
callq 0x5070
jmp 0x114485
jmp 0x114487
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x1143e4
jmp 0x114497
movl $0x0, -0x78(%rbp)
movl -0x78(%rbp), %ecx
xorl %eax, %eax
cmpl -0x18(%rbp), %ecx
movb %al, -0x299(%rbp)
jge 0x1144b7
movb -0x12(%rbp), %al
movb %al, -0x299(%rbp)
movb -0x299(%rbp), %al
testb $0x1, %al
jne 0x1144c6
jmp 0x114dea
leaq -0x90(%rbp), %rdi
callq 0xada60
movl $0x0, -0x94(%rbp)
movl -0x94(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x114627
movl -0x94(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x11459e
movq -0x10(%rbp), %rdi
movslq -0x78(%rbp), %rsi
callq 0xaf120
movq %rax, -0x2a8(%rbp)
jmp 0x114510
movq -0x2a8(%rbp), %rax
movq %rax, -0x2b8(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x78(%rbp), %rsi
callq 0xaf120
movq %rax, -0x2b0(%rbp)
jmp 0x114534
movq -0x2b0(%rbp), %rdi
addq $0x48, %rdi
movslq -0x94(%rbp), %rsi
callq 0x101d0
movq %rax, -0x2c0(%rbp)
jmp 0x114554
movq -0x2b8(%rbp), %rdi
movq -0x2c0(%rbp), %rax
movslq (%rax), %rsi
callq 0xae5c0
movq %rax, -0x2c8(%rbp)
jmp 0x114573
movq -0x2c8(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0xafc20
jmp 0x114588
jmp 0x114611
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x114ddc
movq -0x10(%rbp), %rdi
movslq -0x78(%rbp), %rsi
callq 0xaf120
movq %rax, -0x2d0(%rbp)
jmp 0x1145b4
movq -0x2d0(%rbp), %rdi
addq $0x60, %rdi
movl -0x94(%rbp), %eax
movl -0x20(%rbp), %ecx
subl %ecx, %eax
movslq %eax, %rsi
callq 0x101d0
movq %rax, -0x2d8(%rbp)
jmp 0x1145db
movq -0x2d8(%rbp), %rax
cvtsi2sdl (%rax), %xmm0
leaq -0xb0(%rbp), %rdi
xorps %xmm2, %xmm2
movaps %xmm2, %xmm1
callq 0xea8e0
jmp 0x1145fa
leaq -0x90(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x10cbd0
jmp 0x11460f
jmp 0x114611
jmp 0x114613
movl -0x94(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x94(%rbp)
jmp 0x1144dc
testb $0x1, -0x11(%rbp)
je 0x114719
leaq 0xe8f4c(%rip), %rdi     # 0x1fd584
xorl %eax, %eax
callq 0x5070
jmp 0x114641
movl $0x0, -0xb4(%rbp)
movl -0xb4(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x114717
movslq -0xb4(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0xae5c0
movq %rax, -0x2e0(%rbp)
jmp 0x114676
movq -0x2e0(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x2f0(%rbp)
movslq -0xb4(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0xae5c0
movq %rax, -0x2e8(%rbp)
jmp 0x1146a5
movq -0x2e8(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x300(%rbp)
movslq -0xb4(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0xae5c0
movq %rax, -0x2f8(%rbp)
jmp 0x1146d5
movsd -0x300(%rbp), %xmm1
movsd -0x2f0(%rbp), %xmm0
movq -0x2f8(%rbp), %rax
movsd 0x10(%rax), %xmm2
leaq 0xe8e79(%rip), %rdi     # 0x1fd571
movb $0x3, %al
callq 0x5070
jmp 0x114701
jmp 0x114703
movl -0xb4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb4(%rbp)
jmp 0x11464b
jmp 0x114719
leaq -0xe0(%rbp), %rdi
callq 0xf670
movl $0x0, -0xe4(%rbp)
movl -0xe4(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x11476e
leaq -0xe0(%rbp), %rdi
xorl %esi, %esi
callq 0xf700
jmp 0x11474a
jmp 0x11474c
movl -0xe4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe4(%rbp)
jmp 0x11472f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x114dd0
movsd 0xde002(%rip), %xmm0    # 0x1f2778
movsd %xmm0, -0xf0(%rbp)
movl $0x0, -0xf4(%rbp)
movl -0xf4(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x1149ce
movsd 0xddfd9(%rip), %xmm0    # 0x1f2778
movsd %xmm0, -0x100(%rbp)
movl $0xffffffff, -0x104(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x108(%rbp)
movl -0x108(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x114946
movslq -0x108(%rbp), %rsi
leaq -0xe0(%rbp), %rdi
callq 0xfff0
movq %rdx, -0x310(%rbp)
movq %rax, -0x308(%rbp)
jmp 0x1147ed
movq -0x310(%rbp), %rax
movq -0x308(%rbp), %rcx
movq %rcx, -0x118(%rbp)
movq %rax, -0x110(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x101a0
xorb $-0x1, %al
testb $0x1, %al
jne 0x114820
jmp 0x114930
movslq -0xf4(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0xae5c0
movq %rax, -0x318(%rbp)
jmp 0x114839
movq -0x318(%rbp), %rax
movq 0x10(%rax), %rcx
movq %rcx, -0x140(%rbp)
movups (%rax), %xmm0
movaps %xmm0, -0x150(%rbp)
movslq -0x108(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0xae5c0
movq %rax, -0x320(%rbp)
jmp 0x114871
movq -0x320(%rbp), %rax
movq 0x10(%rax), %rcx
movq %rcx, -0x160(%rbp)
movups (%rax), %xmm0
movaps %xmm0, -0x170(%rbp)
movq -0x160(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x28(%rax)
movaps -0x170(%rbp), %xmm0
movups %xmm0, 0x18(%rax)
movq -0x140(%rbp), %rcx
movq %rcx, 0x10(%rax)
movaps -0x150(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x138(%rbp), %rdi
callq 0xeaf90
jmp 0x1148c9
leaq -0x138(%rbp), %rdi
callq 0xe9240
movsd %xmm0, -0x328(%rbp)
jmp 0x1148df
movsd -0x328(%rbp), %xmm0
movsd %xmm0, -0x120(%rbp)
movsd -0x120(%rbp), %xmm1
movsd -0x100(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0x114912
xorps %xmm0, %xmm0
ucomisd -0x100(%rbp), %xmm0
jbe 0x11492e
movsd -0x120(%rbp), %xmm0
movsd %xmm0, -0x100(%rbp)
movl -0x108(%rbp), %eax
movl %eax, -0x104(%rbp)
jmp 0x114930
jmp 0x114932
movl -0x108(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x108(%rbp)
jmp 0x1147bb
movslq -0x104(%rbp), %rsi
leaq -0xe0(%rbp), %rdi
callq 0xfff0
movq %rdx, -0x338(%rbp)
movq %rax, -0x330(%rbp)
jmp 0x114969
movq -0x338(%rbp), %rax
movq -0x330(%rbp), %rcx
movq %rcx, -0x180(%rbp)
movq %rax, -0x178(%rbp)
leaq -0x180(%rbp), %rdi
movl $0x1, %esi
callq 0x10040
movsd -0x100(%rbp), %xmm0
ucomisd -0xf0(%rbp), %xmm0
jbe 0x1149b8
movsd -0x100(%rbp), %xmm0
movsd %xmm0, -0xf0(%rbp)
jmp 0x1149ba
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
jmp 0x114788
testb $0x1, -0x11(%rbp)
je 0x1149ee
movsd -0xf0(%rbp), %xmm0
leaq 0xe8bd8(%rip), %rdi     # 0x1fd5bb
movb $0x1, %al
callq 0x5070
jmp 0x1149ec
jmp 0x1149ee
movsd 0xdd672(%rip), %xmm0    # 0x1f2068
ucomisd -0xf0(%rbp), %xmm0
jbe 0x114a04
movb $0x0, -0x12(%rbp)
testb $0x1, -0x12(%rbp)
jne 0x114daa
movb $0x1, -0x12(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0xf670
movl $0x0, -0x1ac(%rbp)
movl -0x1ac(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x114a73
leaq -0x1a8(%rbp), %rdi
xorl %esi, %esi
callq 0xf700
jmp 0x114a43
jmp 0x114a45
movl -0x1ac(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1ac(%rbp)
jmp 0x114a28
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0xf9b0
jmp 0x114dd0
movsd 0xddcfd(%rip), %xmm0    # 0x1f2778
movsd %xmm0, -0x1b8(%rbp)
movl $0x0, -0x1bc(%rbp)
movl -0x1bc(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x114d68
movsd 0xddcd4(%rip), %xmm0    # 0x1f2778
movsd %xmm0, -0x1c8(%rbp)
movl $0xffffffff, -0x1cc(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x1d0(%rbp)
movl -0x1d0(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x114ce0
movslq -0x1d0(%rbp), %rsi
leaq -0x1a8(%rbp), %rdi
callq 0xfff0
movq %rdx, -0x348(%rbp)
movq %rax, -0x340(%rbp)
jmp 0x114af2
movq -0x348(%rbp), %rax
movq -0x340(%rbp), %rcx
movq %rcx, -0x1e0(%rbp)
movq %rax, -0x1d8(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0x101a0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x349(%rbp)
jne 0x114b95
movq -0x10(%rbp), %rdi
movslq -0x78(%rbp), %rsi
callq 0xaf120
movq %rax, -0x358(%rbp)
jmp 0x114b3f
movq -0x358(%rbp), %rdi
addq $0x18, %rdi
movslq -0x1d0(%rbp), %rsi
callq 0xaf450
movq %rax, -0x360(%rbp)
jmp 0x114b5f
movq -0x8(%rbp), %rdi
addq $0x18, %rdi
movslq -0x1bc(%rbp), %rsi
callq 0xaf450
movq %rax, -0x368(%rbp)
jmp 0x114b7c
movq -0x368(%rbp), %rsi
movq -0x360(%rbp), %rdi
callq 0x5b450
movb %al, -0x349(%rbp)
movb -0x349(%rbp), %al
testb $0x1, %al
jne 0x114ba4
jmp 0x114cca
movq -0x8(%rbp), %rdi
movslq -0x1bc(%rbp), %rsi
callq 0xae5c0
movq %rax, -0x370(%rbp)
jmp 0x114bbd
movq -0x370(%rbp), %rax
movq 0x10(%rax), %rcx
movq %rcx, -0x210(%rbp)
movups (%rax), %xmm0
movaps %xmm0, -0x220(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x78(%rbp), %rsi
callq 0xaf120
movq %rax, -0x378(%rbp)
jmp 0x114bef
movq -0x378(%rbp), %rdi
movslq -0x1d0(%rbp), %rsi
callq 0xae5c0
movq %rax, -0x380(%rbp)
jmp 0x114c0b
movq -0x380(%rbp), %rax
movq 0x10(%rax), %rcx
movq %rcx, -0x230(%rbp)
movups (%rax), %xmm0
movaps %xmm0, -0x240(%rbp)
movq -0x230(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x28(%rax)
movaps -0x240(%rbp), %xmm0
movups %xmm0, 0x18(%rax)
movq -0x210(%rbp), %rcx
movq %rcx, 0x10(%rax)
movaps -0x220(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x200(%rbp), %rdi
callq 0xeaf90
jmp 0x114c63
leaq -0x200(%rbp), %rdi
callq 0xe9240
movsd %xmm0, -0x388(%rbp)
jmp 0x114c79
movsd -0x388(%rbp), %xmm0
movsd %xmm0, -0x1e8(%rbp)
movsd -0x1e8(%rbp), %xmm1
movsd -0x1c8(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0x114cac
xorps %xmm0, %xmm0
ucomisd -0x1c8(%rbp), %xmm0
jbe 0x114cc8
movsd -0x1e8(%rbp), %xmm0
movsd %xmm0, -0x1c8(%rbp)
movl -0x1d0(%rbp), %eax
movl %eax, -0x1cc(%rbp)
jmp 0x114cca
jmp 0x114ccc
movl -0x1d0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1d0(%rbp)
jmp 0x114ac0
movslq -0x1cc(%rbp), %rsi
leaq -0x1a8(%rbp), %rdi
callq 0xfff0
movq %rdx, -0x398(%rbp)
movq %rax, -0x390(%rbp)
jmp 0x114d03
movq -0x398(%rbp), %rax
movq -0x390(%rbp), %rcx
movq %rcx, -0x250(%rbp)
movq %rax, -0x248(%rbp)
leaq -0x250(%rbp), %rdi
movl $0x1, %esi
callq 0x10040
movsd -0x1c8(%rbp), %xmm0
ucomisd -0xf0(%rbp), %xmm0
jbe 0x114d52
movsd -0x1c8(%rbp), %xmm0
movsd %xmm0, -0x1b8(%rbp)
jmp 0x114d54
movl -0x1bc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1bc(%rbp)
jmp 0x114a8d
testb $0x1, -0x11(%rbp)
je 0x114d88
movsd -0x1b8(%rbp), %xmm0
leaq 0xe886c(%rip), %rdi     # 0x1fd5e9
movb $0x1, %al
callq 0x5070
jmp 0x114d86
jmp 0x114d88
movsd 0xdd2d8(%rip), %xmm0    # 0x1f2068
ucomisd -0x1b8(%rbp), %xmm0
jbe 0x114d9e
movb $0x0, -0x12(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0xf9b0
leaq -0xe0(%rbp), %rdi
callq 0xf9b0
leaq -0x90(%rbp), %rdi
callq 0x12210
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0x11449e
leaq -0xe0(%rbp), %rdi
callq 0xf9b0
leaq -0x90(%rbp), %rdi
callq 0x12210
jmp 0x114e3f
testb $0x1, -0x11(%rbp)
je 0x114e1c
testb $0x1, -0x12(%rbp)
je 0x114e08
leaq 0xe881a(%rip), %rdi     # 0x1fd617
xorl %eax, %eax
callq 0x5070
jmp 0x114e06
jmp 0x114e1a
leaq 0xe8821(%rip), %rdi     # 0x1fd630
xorl %eax, %eax
callq 0x5070
jmp 0x114e18
jmp 0x114e1a
jmp 0x114e1c
movb -0x12(%rbp), %al
movb %al, -0x399(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x12210
movb -0x399(%rbp), %al
andb $0x1, %al
addq $0x3d0, %rsp            # imm = 0x3D0
popq %rbp
retq
leaq -0x40(%rbp), %rdi
callq 0x12210
movq -0x50(%rbp), %rdi
callq 0x58f0
nopw %cs:(%rax,%rax)