// File: Luthaf[P]zeopp/area_and_volume.cc
// Function: getLocalSubstructures(char*, double, double, TRIPLET, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, VORONOI_NETWORK*, ATOM_NETWORK*, bool, bool)
void getLocalSubstructures(char* name, double probeRad, double local_substructure_radius, TRIPLET supercell_steps_local_substructure, string element, VORONOI_NETWORK* vornet, ATOM_NETWORK* atmnet, bool radial, bool usingElementOnly) {
  vector<bool> accessInfo;
  vector<CHANNEL> channels;
  CHANNEL::findChannels(vornet, probeRad, &accessInfo, &channels);
  ATOM_NETWORK simplified_atmnet;
  atmnet->copy(&simplified_atmnet);
  VORONOI_NETWORK simplified_vornet;
  vornet->copy(&simplified_vornet);
  vector<bool> isAccessible;
  int num_accessible = 0;
  //if not simplifying, avoid the calculation and just copy the data
  if(!usingElementOnly) {
    isAccessible = accessInfo;
  } else {
    //create the simplified atmnet, ready to calculate simplified vornet etc.
    simplified_vornet.edges.clear();
    simplified_vornet.nodes.clear();
    simplified_atmnet.atoms.clear();
    simplified_atmnet.numAtoms = 0;
    for(int i=0; i<atmnet->numAtoms; i++){
      if(atmnet->atoms.at(i).type.compare(element)==0) {
        ATOM newAtom;
        newAtom.type = atmnet->atoms.at(i).type;
        newAtom.a_coord = atmnet->atoms.at(i).a_coord;
        newAtom.b_coord = atmnet->atoms.at(i).b_coord;
        newAtom.c_coord = atmnet->atoms.at(i).c_coord;
        newAtom.x = atmnet->atoms.at(i).x;
        newAtom.y = atmnet->atoms.at(i).y;
        newAtom.z = atmnet->atoms.at(i).z;
        newAtom.radius = lookupRadius(newAtom.type, radial);
        simplified_atmnet.atoms.push_back(newAtom);
        simplified_atmnet.numAtoms++;
      }
    }
    cout << "Starting simplified Voronoi decomposition" << "\n";
    vector< VOR_CELL> simplified_cells;
    vector< BASIC_VCELL> simplified_bvcells;
    if(radial) {
      container_periodic_poly *rad_con = (container_periodic_poly *)performVoronoiDecomp(true, &simplified_atmnet, &simplified_vornet, simplified_cells, false, simplified_bvcells);
      delete rad_con;
    } else {
      container_periodic *no_rad_con = (container_periodic *)performVoronoiDecomp (false, &simplified_atmnet, &simplified_vornet, simplified_cells, false, simplified_bvcells); 
      delete no_rad_con;
    }
    cout << "Finished simplified Voronoi decomposition" << "\n";
    printf("*** Original voronoi network on %d atoms contains %d nodes and %d edges ***\n", atmnet->numAtoms, (int)(vornet->nodes.size()), (int)(vornet->edges.size()));
    printf("*** Simplified voronoi network on %d atoms contains %d nodes and %d edges ***\n", simplified_atmnet.numAtoms, (int)(simplified_vornet.nodes.size()), (int)(simplified_vornet.edges.size()));
    //now check which of these nodes of the simplified network lie in accessible space w.r.t. atmnet
    float chan_radius = probeRad;
    determineAccessibility(atmnet, chan_radius, probeRad, true, &isAccessible, &simplified_vornet); //where probeRad is the smaller, used to probe the channels accessible to chan_radius, the larger
  }
  for(int i=0; i<(int)(simplified_vornet.nodes.size()); i++) {
    if(simplified_vornet.nodes.at(i).rad_stat_sphere<=0) isAccessible.at(i)=false;
    if(isAccessible.at(i)==true) num_accessible++;
  }
  printf("*** %d of these %d nodes lie in accessible space ***\n", num_accessible, (int)(simplified_vornet.nodes.size()));
  //now try and remove redundant nodes
  int malloc_num_accessible = num_accessible;
  double **distance_between_nodes_array = new double*[malloc_num_accessible];
  for(int i=0; i<malloc_num_accessible; i++) distance_between_nodes_array[i] = new double[malloc_num_accessible];
  int *node_reference = new int[malloc_num_accessible];
  double *node_density = new double[malloc_num_accessible];
  int iter = 0;
  for(int i=0; i<(int)(simplified_vornet.nodes.size()); i++) {
    if(isAccessible.at(i)==true) {
      node_reference[iter] = i; //now we can iterate over this array for simplicity
      iter++;
    }
  }
  double minimum_node_distance = 1.0; //two nodes closer than this probably don't tell us anything different about the structure
  char some_distance_too_low_exists = 0;
  for(int i=0; i<malloc_num_accessible; i++) {
    node_density[i] = 0.0;
  }
  for(int i=0; i<malloc_num_accessible; i++) {
    distance_between_nodes_array[i][i] = 0.0;
    for(int j=i+1; j<malloc_num_accessible; j++) {
      int node_i = node_reference[i];
      int node_j = node_reference[j];
      Point abcCoord_i = atmnet->xyz_to_abc(simplified_vornet.nodes.at(node_i).x, simplified_vornet.nodes.at(node_i).y, simplified_vornet.nodes.at(node_i).z);
      Point abcCoord_j = atmnet->xyz_to_abc(simplified_vornet.nodes.at(node_j).x, simplified_vornet.nodes.at(node_j).y, simplified_vornet.nodes.at(node_j).z);
      double distance = atmnet->getDistCalc().minimum_periodic_distance(abcCoord_i.vals[0], abcCoord_i.vals[1], abcCoord_i.vals[2], abcCoord_j.vals[0], abcCoord_j.vals[1], abcCoord_j.vals[2]);
      if(distance<minimum_node_distance) some_distance_too_low_exists = 1;
      distance_between_nodes_array[i][j] = distance;
      distance_between_nodes_array[j][i] = distance;
      node_density[i] += exp(-1*distance*distance);
      node_density[j] += exp(-1*distance*distance);
    }
  }
  if(some_distance_too_low_exists>0) {
    //now we have the distance array, iterate over the nodes, removing the most dense, while there are some accessible ones closer than some distance
    while(some_distance_too_low_exists==1) {
      int accessibility_index_of_max_density_node = -1;
      double max_density = -1;
      for(int i=0; i<malloc_num_accessible; i++) {
        if(isAccessible.at(node_reference[i])==true) {
          if(node_density[i]>max_density) {
            max_density = node_density[i];
            accessibility_index_of_max_density_node = i;
          }
        }
      }
      if(max_density<0 || accessibility_index_of_max_density_node<0) {
        printf("ERROR: no node found in max density search\n");
        exit(EXIT_FAILURE);
      }
      //remove this most dense node
      isAccessible.at(node_reference[accessibility_index_of_max_density_node])=false;
      num_accessible--;
      //we need to recalculate densities and check if any remaining accessible node triggers the too-close test!
      some_distance_too_low_exists = 0;
      for(int i=0; i<malloc_num_accessible; i++) {
        node_density[i] = 0.0;
      }
      for(int i=0; i<malloc_num_accessible; i++) {
        int node_i = node_reference[i];
        if(isAccessible.at(node_i)==true) {
          for(int j=i+1; j<malloc_num_accessible; j++) {
            int node_j = node_reference[j];
            if(isAccessible.at(node_j)==true) {
              double distance = distance_between_nodes_array[i][j];
              if(distance<minimum_node_distance) some_distance_too_low_exists = 1;
              node_density[i] += exp(-1*distance*distance);
              node_density[j] += exp(-1*distance*distance);
            }
          }
        }
      }
    }
    printf("STATUS: %d nodes were removed, leaving %d, none of which are within %.3fA of any other\n", malloc_num_accessible-num_accessible, num_accessible, minimum_node_distance);
  }
  //free memory
  for(int i=0; i<malloc_num_accessible; i++) delete[] distance_between_nodes_array[i];
  delete[] distance_between_nodes_array;
  delete[] node_reference;
  delete[] node_density;

  //construct the supercell_atmnet for extracting spheres
  ATOM_NETWORK supercell_atmnet;
  atmnet->copy(&supercell_atmnet);
  for(int a_step=-1*supercell_steps_local_substructure[0]; a_step<=supercell_steps_local_substructure[0]; a_step++) {
    for(int b_step=-1*supercell_steps_local_substructure[1]; b_step<=supercell_steps_local_substructure[1]; b_step++) {
      for(int c_step=-1*supercell_steps_local_substructure[2]; c_step<=supercell_steps_local_substructure[2]; c_step++) {
        if(a_step!=0 || b_step!=0 || c_step!=0) { //don't make copies within the unit cell!
          for(int i=0; i<atmnet->numAtoms; i++){
            ATOM newAtom;
            newAtom.type = atmnet->atoms.at(i).type;
            newAtom.a_coord = atmnet->atoms.at(i).a_coord+a_step;
            newAtom.b_coord = atmnet->atoms.at(i).b_coord+b_step;
            newAtom.c_coord = atmnet->atoms.at(i).c_coord+c_step;
            Point xyz = atmnet->abc_to_xyz(newAtom.a_coord, newAtom.b_coord, newAtom.c_coord);
            newAtom.x = xyz.vals[0];
            newAtom.y = xyz.vals[1];
            newAtom.z = xyz.vals[2];
            newAtom.radius = lookupRadius(newAtom.type, radial);
            supercell_atmnet.atoms.push_back(newAtom);
            supercell_atmnet.numAtoms++;
          }
        }
      }
    }
  }
  printf("*** Unit cell contains %d atoms; supercell contains %d atoms ***\n", atmnet->numAtoms, supercell_atmnet.numAtoms);
  int node_index = 0;
  for(int i=0; i<(int)(simplified_vornet.nodes.size()); i++) {
    vector<ATOM> vector_of_local_atoms; //all those visible atoms within some distance, i.e. those which comprise the local surface
    if(isAccessible.at(i)==true) {
      for(int j=0; j<supercell_atmnet.numAtoms; j++) {
        float distance = calcEuclideanDistance(simplified_vornet.nodes.at(i).x, simplified_vornet.nodes.at(i).y, simplified_vornet.nodes.at(i).z, supercell_atmnet.atoms.at(j).x, supercell_atmnet.atoms.at(j).y, supercell_atmnet.atoms.at(j).z);
        if(distance<=local_substructure_radius) vector_of_local_atoms.push_back(supercell_atmnet.atoms.at(j));
      }
      //now finished putting local atoms in the vector, write them to file for now
      string number = intAsString(node_index);
      string filename_xyz = string(name).append("_local_substructure_");
      filename_xyz.append(number);
      filename_xyz.append(".xyz");
      FILE *local_xyz; local_xyz = fopen(filename_xyz.c_str(), "w");
      fprintf(local_xyz, "%d\nxyz header\n", (int)vector_of_local_atoms.size()+1);
      for(int j=0; j<(int)vector_of_local_atoms.size(); j++) {
        fprintf(local_xyz, "%s %.3f %.3f %.3f\n", vector_of_local_atoms.at(j).type.c_str(), vector_of_local_atoms.at(j).x, vector_of_local_atoms.at(j).y, vector_of_local_atoms.at(j).z);
      }
      fprintf(local_xyz, "X %.3f %.3f %.3f\n", simplified_vornet.nodes.at(i).x, simplified_vornet.nodes.at(i).y, simplified_vornet.nodes.at(i).z);
      fclose(local_xyz);
      node_index++;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x11c0, %rsp           # imm = 0x11C0
movl %r8d, -0xe64(%rbp)
movq %rcx, %rax
movl -0xe64(%rbp), %ecx
movq %rax, -0xe60(%rbp)
movq %rdx, %rax
movq -0xe60(%rbp), %rdx
movq %rax, -0xe58(%rbp)
movq %rsi, %rax
movq -0xe58(%rbp), %rsi
movq %rax, -0xe50(%rbp)
movq %rdi, %r8
movq -0xe50(%rbp), %rdi
movb %r9b, %al
leaq 0x10(%rbp), %r9
movq %r9, -0xe48(%rbp)
movq %r8, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movsd %xmm1, -0x18(%rbp)
movq %rdi, -0x20(%rbp)
movq %rsi, -0x28(%rbp)
movq %rdx, -0x30(%rbp)
andb $0x1, %cl
movb %cl, -0x31(%rbp)
andb $0x1, %al
movb %al, -0x32(%rbp)
leaq -0x60(%rbp), %rdi
movq %rdi, -0xe40(%rbp)
callq 0xf670
leaq -0x78(%rbp), %rdi
movq %rdi, -0xe38(%rbp)
callq 0x84dd0
movq -0xe40(%rbp), %rsi
movq -0xe38(%rbp), %rdx
movq -0x28(%rbp), %rdi
movsd -0x10(%rbp), %xmm0
callq 0xc9cc0
jmp 0x7ea1f
leaq -0x4e8(%rbp), %rdi
callq 0x95350
jmp 0x7ea2d
movq -0x30(%rbp), %rdi
leaq -0x4e8(%rbp), %rsi
callq 0x96980
jmp 0x7ea3f
leaq -0x560(%rbp), %rdi
callq 0x99ba0
jmp 0x7ea4d
movq -0x28(%rbp), %rdi
leaq -0x560(%rbp), %rsi
callq 0x99d70
jmp 0x7ea5f
leaq -0x588(%rbp), %rdi
callq 0xf670
movl $0x0, -0x58c(%rbp)
testb $0x1, -0x32(%rbp)
jne 0x7eae2
leaq -0x588(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x84f40
jmp 0x7ea8d
jmp 0x7f063
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x8079a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x8078e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x80782
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x80776
leaq -0x560(%rbp), %rdi
addq $0x60, %rdi
callq 0xf370
leaq -0x560(%rbp), %rdi
addq $0x48, %rdi
callq 0xf350
leaq -0x4e8(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
callq 0xf040
movl $0x0, -0x3d8(%rbp)
movl $0x0, -0x590(%rbp)
movl -0x590(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpl 0x110(%rcx), %eax
jge 0x7edde
movq -0x30(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x590(%rbp), %rsi
callq 0xf090
movq %rax, -0xe70(%rbp)
jmp 0x7eb5f
movq -0xe50(%rbp), %rsi
movq -0xe70(%rbp), %rdi
addq $0x40, %rdi
callq 0x5050
movl %eax, -0xe74(%rbp)
jmp 0x7eb7e
movl -0xe74(%rbp), %eax
cmpl $0x0, %eax
jne 0x7edc8
leaq -0x628(%rbp), %rdi
callq 0x954b0
jmp 0x7eb9b
movq -0x30(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x590(%rbp), %rsi
callq 0xf090
movq %rax, -0xe80(%rbp)
jmp 0x7ebbb
movq -0xe80(%rbp), %rsi
addq $0x40, %rsi
leaq -0x5e8(%rbp), %rdi
callq 0x5060
jmp 0x7ebd4
movq -0x30(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x590(%rbp), %rsi
callq 0xf090
movq %rax, -0xe88(%rbp)
jmp 0x7ebf4
movq -0xe88(%rbp), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, -0x610(%rbp)
movq -0x30(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x590(%rbp), %rsi
callq 0xf090
movq %rax, -0xe90(%rbp)
jmp 0x7ec28
movq -0xe90(%rbp), %rax
movsd 0x20(%rax), %xmm0
movsd %xmm0, -0x608(%rbp)
movq -0x30(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x590(%rbp), %rsi
callq 0xf090
movq %rax, -0xe98(%rbp)
jmp 0x7ec5c
movq -0xe98(%rbp), %rax
movsd 0x28(%rax), %xmm0
movsd %xmm0, -0x600(%rbp)
movq -0x30(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x590(%rbp), %rsi
callq 0xf090
movq %rax, -0xea0(%rbp)
jmp 0x7ec90
movq -0xea0(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x628(%rbp)
movq -0x30(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x590(%rbp), %rsi
callq 0xf090
movq %rax, -0xea8(%rbp)
jmp 0x7ecc3
movq -0xea8(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x620(%rbp)
movq -0x30(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x590(%rbp), %rsi
callq 0xf090
movq %rax, -0xeb0(%rbp)
jmp 0x7ecf7
movq -0xeb0(%rbp), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0x618(%rbp)
leaq -0x5e8(%rbp), %rsi
leaq -0x648(%rbp), %rdi
callq 0x5220
jmp 0x7ed20
movzbl -0x31(%rbp), %esi
andl $0x1, %esi
leaq -0x648(%rbp), %rdi
callq 0x466e0
movsd %xmm0, -0xeb8(%rbp)
jmp 0x7ed3d
movsd -0xeb8(%rbp), %xmm0
movsd %xmm0, -0x5f8(%rbp)
leaq -0x648(%rbp), %rdi
callq 0x5300
leaq -0x1f8(%rbp), %rdi
leaq -0x628(%rbp), %rsi
callq 0xf190
jmp 0x7ed6e
movl -0x3d8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3d8(%rbp)
leaq -0x628(%rbp), %rdi
callq 0xf200
jmp 0x7edc8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x7edb7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x648(%rbp), %rdi
callq 0x5300
leaq -0x628(%rbp), %rdi
callq 0xf200
jmp 0x80776
jmp 0x7edca
movl -0x590(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x590(%rbp)
jmp 0x7eb29
movq 0x1f41db(%rip), %rdi    # 0x272fc0
leaq 0x177fc8(%rip), %rsi    # 0x1f6db4
callq 0x5540
movq %rax, -0xec0(%rbp)
jmp 0x7edfa
movq -0xec0(%rbp), %rdi
leaq 0x17a81d(%rip), %rsi    # 0x1f9625
callq 0x5540
jmp 0x7ee0f
leaq -0x660(%rbp), %rdi
callq 0xfd00
leaq -0x678(%rbp), %rdi
callq 0xfce0
testb $0x1, -0x31(%rbp)
je 0x7eed3
movl $0x1, %edi
leaq -0x4e8(%rbp), %rsi
leaq -0x560(%rbp), %rdx
leaq -0x660(%rbp), %rcx
xorl %r8d, %r8d
leaq -0x678(%rbp), %r9
callq 0x6950
movq %rax, -0xec8(%rbp)
jmp 0x7ee63
movq -0xec8(%rbp), %rax
movq %rax, -0x680(%rbp)
movq -0x680(%rbp), %rax
movq %rax, -0xed0(%rbp)
cmpq $0x0, %rax
je 0x7eea2
movq -0xed0(%rbp), %rdi
callq 0xece0
movq -0xed0(%rbp), %rdi
movl $0x298, %esi            # imm = 0x298
callq 0x5570
jmp 0x7ef44
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x678(%rbp), %rdi
callq 0xfd80
leaq -0x660(%rbp), %rdi
callq 0xfd20
jmp 0x80776
leaq -0x4e8(%rbp), %rsi
leaq -0x560(%rbp), %rdx
leaq -0x660(%rbp), %rcx
xorl %r8d, %r8d
leaq -0x678(%rbp), %r9
movl %r8d, %edi
callq 0x6950
movq %rax, -0xed8(%rbp)
jmp 0x7ef03
movq -0xed8(%rbp), %rax
movq %rax, -0x688(%rbp)
movq -0x688(%rbp), %rax
movq %rax, -0xee0(%rbp)
cmpq $0x0, %rax
je 0x7ef42
movq -0xee0(%rbp), %rdi
callq 0xed10
movq -0xee0(%rbp), %rdi
movl $0x270, %esi            # imm = 0x270
callq 0x5570
jmp 0x7ef44
movq 0x1f4075(%rip), %rdi    # 0x272fc0
leaq 0x177e8c(%rip), %rsi    # 0x1f6dde
callq 0x5540
movq %rax, -0xee8(%rbp)
jmp 0x7ef60
movq -0xee8(%rbp), %rdi
leaq 0x17a6b7(%rip), %rsi    # 0x1f9625
callq 0x5540
jmp 0x7ef75
movq -0x30(%rbp), %rax
movl 0x110(%rax), %eax
movl %eax, -0xef0(%rbp)
movq -0x28(%rbp), %rdi
addq $0x48, %rdi
callq 0xf270
movl %eax, -0xeec(%rbp)
movq -0x28(%rbp), %rdi
addq $0x60, %rdi
callq 0xf290
movl -0xef0(%rbp), %esi
movl -0xeec(%rbp), %edx
movl %eax, %ecx
leaq 0x177e4e(%rip), %rdi    # 0x1f6e08
xorl %eax, %eax
callq 0x5070
jmp 0x7efc3
movl -0x3d8(%rbp), %eax
movl %eax, -0xef8(%rbp)
leaq -0x518(%rbp), %rdi
callq 0xf270
movl %eax, -0xef4(%rbp)
leaq -0x500(%rbp), %rdi
callq 0xf290
movl -0xef8(%rbp), %esi
movl -0xef4(%rbp), %edx
movl %eax, %ecx
leaq 0x177e53(%rip), %rdi    # 0x1f6e55
xorl %eax, %eax
callq 0x5070
jmp 0x7f00b
movsd -0x10(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x68c(%rbp)
movq -0x30(%rbp), %rdi
movss -0x68c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd -0x10(%rbp), %xmm1
movl $0x1, %esi
leaq -0x588(%rbp), %rdx
leaq -0x560(%rbp), %rcx
callq 0x7b0b0
jmp 0x7f04b
leaq -0x678(%rbp), %rdi
callq 0xfd80
leaq -0x660(%rbp), %rdi
callq 0xfd20
movl $0x0, -0x690(%rbp)
movl -0x690(%rbp), %eax
movl %eax, -0xefc(%rbp)
leaq -0x560(%rbp), %rdi
addq $0x48, %rdi
callq 0xf270
movq %rax, %rcx
movl -0xefc(%rbp), %eax
cmpl %ecx, %eax
jge 0x7f18e
leaq -0x518(%rbp), %rdi
movslq -0x690(%rbp), %rsi
callq 0xf390
movq %rax, -0xf08(%rbp)
jmp 0x7f0b6
movq -0xf08(%rbp), %rax
xorps %xmm0, %xmm0
ucomisd 0x18(%rax), %xmm0
jb 0x7f114
movslq -0x690(%rbp), %rsi
leaq -0x588(%rbp), %rdi
callq 0xfff0
movq %rdx, -0xf18(%rbp)
movq %rax, -0xf10(%rbp)
jmp 0x7f0ea
movq -0xf18(%rbp), %rax
movq -0xf10(%rbp), %rcx
movq %rcx, -0x6a0(%rbp)
movq %rax, -0x698(%rbp)
leaq -0x6a0(%rbp), %rdi
xorl %esi, %esi
callq 0x10040
movslq -0x690(%rbp), %rsi
leaq -0x588(%rbp), %rdi
callq 0xfff0
movq %rdx, -0xf28(%rbp)
movq %rax, -0xf20(%rbp)
jmp 0x7f137
movq -0xf28(%rbp), %rax
movq -0xf20(%rbp), %rcx
movq %rcx, -0x6b0(%rbp)
movq %rax, -0x6a8(%rbp)
leaq -0x6b0(%rbp), %rdi
callq 0x101a0
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x7f178
movl -0x58c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58c(%rbp)
jmp 0x7f17a
movl -0x690(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x690(%rbp)
jmp 0x7f06d
movl -0x58c(%rbp), %eax
movl %eax, -0xf2c(%rbp)
leaq -0x518(%rbp), %rdi
callq 0xf270
movl -0xf2c(%rbp), %esi
movl %eax, %edx
leaq 0x177cef(%rip), %rdi    # 0x1f6ea4
xorl %eax, %eax
callq 0x5070
jmp 0x7f1be
movl -0x58c(%rbp), %eax
movl %eax, -0x6b4(%rbp)
movslq -0x6b4(%rbp), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x5030
movq %rax, -0xf38(%rbp)
jmp 0x7f1f5
movq -0xf38(%rbp), %rax
movq %rax, -0x6c0(%rbp)
movl $0x0, -0x6c4(%rbp)
movl -0x6c4(%rbp), %eax
cmpl -0x6b4(%rbp), %eax
jge 0x7f270
movslq -0x6b4(%rbp), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x5030
movq %rax, -0xf40(%rbp)
jmp 0x7f246
movq -0xf40(%rbp), %rdx
movq -0x6c0(%rbp), %rax
movslq -0x6c4(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x6c4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c4(%rbp)
jmp 0x7f20d
movslq -0x6b4(%rbp), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x5030
movq %rax, -0xf48(%rbp)
jmp 0x7f29b
movq -0xf48(%rbp), %rax
movq %rax, -0x6d0(%rbp)
movslq -0x6b4(%rbp), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x5030
movq %rax, -0xf50(%rbp)
jmp 0x7f2d4
movq -0xf50(%rbp), %rax
movq %rax, -0x6d8(%rbp)
movl $0x0, -0x6dc(%rbp)
movl $0x0, -0x6e0(%rbp)
movl -0x6e0(%rbp), %eax
movl %eax, -0xf54(%rbp)
leaq -0x560(%rbp), %rdi
addq $0x48, %rdi
callq 0xf270
movq %rax, %rcx
movl -0xf54(%rbp), %eax
cmpl %ecx, %eax
jge 0x7f3b4
movslq -0x6e0(%rbp), %rsi
leaq -0x588(%rbp), %rdi
callq 0xfff0
movq %rdx, -0xf68(%rbp)
movq %rax, -0xf60(%rbp)
jmp 0x7f346
movq -0xf68(%rbp), %rax
movq -0xf60(%rbp), %rcx
movq %rcx, -0x6f0(%rbp)
movq %rax, -0x6e8(%rbp)
leaq -0x6f0(%rbp), %rdi
callq 0x101a0
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x7f39e
movl -0x6e0(%rbp), %edx
movq -0x6d0(%rbp), %rax
movslq -0x6dc(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x6dc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6dc(%rbp)
jmp 0x7f3a0
movl -0x6e0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6e0(%rbp)
jmp 0x7f2f6
movsd 0x172c94(%rip), %xmm0   # 0x1f2050
movsd %xmm0, -0x6f8(%rbp)
movb $0x0, -0x6f9(%rbp)
movl $0x0, -0x700(%rbp)
movl -0x700(%rbp), %eax
cmpl -0x6b4(%rbp), %eax
jge 0x7f40a
movq -0x6d8(%rbp), %rax
movslq -0x700(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x700(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x700(%rbp)
jmp 0x7f3d5
movl $0x0, -0x704(%rbp)
movl -0x704(%rbp), %eax
cmpl -0x6b4(%rbp), %eax
jge 0x7f797
movq -0x6c0(%rbp), %rax
movslq -0x704(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x704(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x704(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x708(%rbp)
movl -0x708(%rbp), %eax
cmpl -0x6b4(%rbp), %eax
jge 0x7f781
movq -0x6d0(%rbp), %rax
movslq -0x704(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x70c(%rbp)
movq -0x6d0(%rbp), %rax
movslq -0x708(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x710(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0xf78(%rbp)
leaq -0x518(%rbp), %rdi
movslq -0x70c(%rbp), %rsi
callq 0xf390
movq %rax, -0xf70(%rbp)
jmp 0x7f4bd
movq -0xf70(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0xf88(%rbp)
leaq -0x518(%rbp), %rdi
movslq -0x70c(%rbp), %rsi
callq 0xf390
movq %rax, -0xf80(%rbp)
jmp 0x7f4ec
movq -0xf80(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0xf98(%rbp)
leaq -0x518(%rbp), %rdi
movslq -0x70c(%rbp), %rsi
callq 0xf390
movq %rax, -0xf90(%rbp)
jmp 0x7f51c
movsd -0xf98(%rbp), %xmm1
movsd -0xf88(%rbp), %xmm0
movq -0xf78(%rbp), %rsi
movq -0xf90(%rbp), %rax
movsd 0x10(%rax), %xmm2
leaq -0x728(%rbp), %rdi
callq 0x97360
jmp 0x7f54d
movq -0x30(%rbp), %rax
movq %rax, -0xfa8(%rbp)
leaq -0x518(%rbp), %rdi
movslq -0x710(%rbp), %rsi
callq 0xf390
movq %rax, -0xfa0(%rbp)
jmp 0x7f574
movq -0xfa0(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0xfb8(%rbp)
leaq -0x518(%rbp), %rdi
movslq -0x710(%rbp), %rsi
callq 0xf390
movq %rax, -0xfb0(%rbp)
jmp 0x7f5a3
movq -0xfb0(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0xfc8(%rbp)
leaq -0x518(%rbp), %rdi
movslq -0x710(%rbp), %rsi
callq 0xf390
movq %rax, -0xfc0(%rbp)
jmp 0x7f5d3
movsd -0xfc8(%rbp), %xmm1
movsd -0xfb8(%rbp), %xmm0
movq -0xfa8(%rbp), %rsi
movq -0xfc0(%rbp), %rax
movsd 0x10(%rax), %xmm2
leaq -0x740(%rbp), %rdi
callq 0x97360
jmp 0x7f604
movq -0x30(%rbp), %rsi
leaq -0x7c0(%rbp), %rdi
callq 0x96bf0
jmp 0x7f616
movsd -0x728(%rbp), %xmm0
movsd -0x720(%rbp), %xmm1
movsd -0x718(%rbp), %xmm2
movsd -0x740(%rbp), %xmm3
movsd -0x738(%rbp), %xmm4
movsd -0x730(%rbp), %xmm5
leaq -0x7c0(%rbp), %rdi
callq 0xd7d80
movsd %xmm0, -0xfd0(%rbp)
jmp 0x7f65c
leaq -0x7c0(%rbp), %rdi
callq 0x122d0
movsd -0xfd0(%rbp), %xmm0
movsd %xmm0, -0x748(%rbp)
movsd -0x748(%rbp), %xmm1
movsd -0x6f8(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x7f6b7
movb $0x1, -0x6f9(%rbp)
jmp 0x7f6b7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x7c0(%rbp), %rdi
callq 0x122d0
jmp 0x80776
movsd -0x748(%rbp), %xmm0
movq -0x6c0(%rbp), %rax
movslq -0x704(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x708(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd -0x748(%rbp), %xmm0
movq -0x6c0(%rbp), %rax
movslq -0x708(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x704(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd 0x17306d(%rip), %xmm0   # 0x1f2778
mulsd -0x748(%rbp), %xmm0
mulsd -0x748(%rbp), %xmm0
callq 0x5930
movq -0x6d8(%rbp), %rax
movslq -0x704(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movsd 0x173038(%rip), %xmm0   # 0x1f2778
mulsd -0x748(%rbp), %xmm0
mulsd -0x748(%rbp), %xmm0
callq 0x5930
movq -0x6d8(%rbp), %rax
movslq -0x708(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x708(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x708(%rbp)
jmp 0x7f456
jmp 0x7f783
movl -0x704(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x704(%rbp)
jmp 0x7f414
movsbl -0x6f9(%rbp), %eax
cmpl $0x0, %eax
jle 0x7fbad
jmp 0x7f7a9
movsbl -0x6f9(%rbp), %eax
cmpl $0x1, %eax
jne 0x7fb85
movl $0xffffffff, -0x7c4(%rbp) # imm = 0xFFFFFFFF
movsd 0x172fad(%rip), %xmm0   # 0x1f2778
movsd %xmm0, -0x7d0(%rbp)
movl $0x0, -0x7d4(%rbp)
movl -0x7d4(%rbp), %eax
cmpl -0x6b4(%rbp), %eax
jge 0x7f8ab
movq -0x6d0(%rbp), %rax
movslq -0x7d4(%rbp), %rcx
movslq (%rax,%rcx,4), %rsi
leaq -0x588(%rbp), %rdi
callq 0xfff0
movq %rdx, -0xfe0(%rbp)
movq %rax, -0xfd8(%rbp)
jmp 0x7f81d
movq -0xfe0(%rbp), %rax
movq -0xfd8(%rbp), %rcx
movq %rcx, -0x7e8(%rbp)
movq %rax, -0x7e0(%rbp)
leaq -0x7e8(%rbp), %rdi
callq 0x101a0
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x7f895
movq -0x6d8(%rbp), %rax
movslq -0x7d4(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd -0x7d0(%rbp), %xmm0
jbe 0x7f893
movq -0x6d8(%rbp), %rax
movslq -0x7d4(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x7d0(%rbp)
movl -0x7d4(%rbp), %eax
movl %eax, -0x7c4(%rbp)
jmp 0x7f895
jmp 0x7f897
movl -0x7d4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7d4(%rbp)
jmp 0x7f7dd
xorps %xmm0, %xmm0
ucomisd -0x7d0(%rbp), %xmm0
ja 0x7f8c1
cmpl $0x0, -0x7c4(%rbp)
jge 0x7f8db
leaq 0x177612(%rip), %rdi    # 0x1f6eda
xorl %eax, %eax
callq 0x5070
jmp 0x7f8d1
movl $0x1, %edi
callq 0x67c0
movq -0x6d0(%rbp), %rax
movslq -0x7c4(%rbp), %rcx
movslq (%rax,%rcx,4), %rsi
leaq -0x588(%rbp), %rdi
callq 0xfff0
movq %rdx, -0xff0(%rbp)
movq %rax, -0xfe8(%rbp)
jmp 0x7f909
movq -0xff0(%rbp), %rax
movq -0xfe8(%rbp), %rcx
movq %rcx, -0x7f8(%rbp)
movq %rax, -0x7f0(%rbp)
leaq -0x7f8(%rbp), %rdi
xorl %esi, %esi
callq 0x10040
movl -0x58c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x58c(%rbp)
movb $0x0, -0x6f9(%rbp)
movl $0x0, -0x7fc(%rbp)
movl -0x7fc(%rbp), %eax
cmpl -0x6b4(%rbp), %eax
jge 0x7f988
movq -0x6d8(%rbp), %rax
movslq -0x7fc(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x7fc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7fc(%rbp)
jmp 0x7f953
movl $0x0, -0x800(%rbp)
movl -0x800(%rbp), %eax
cmpl -0x6b4(%rbp), %eax
jge 0x7fb80
movq -0x6d0(%rbp), %rax
movslq -0x800(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x804(%rbp)
movslq -0x804(%rbp), %rsi
leaq -0x588(%rbp), %rdi
callq 0xfff0
movq %rdx, -0x1000(%rbp)
movq %rax, -0xff8(%rbp)
jmp 0x7f9de
movq -0x1000(%rbp), %rax
movq -0xff8(%rbp), %rcx
movq %rcx, -0x818(%rbp)
movq %rax, -0x810(%rbp)
leaq -0x818(%rbp), %rdi
callq 0x101a0
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x7fb6a
movl -0x800(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x81c(%rbp)
movl -0x81c(%rbp), %eax
cmpl -0x6b4(%rbp), %eax
jge 0x7fb68
movq -0x6d0(%rbp), %rax
movslq -0x81c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x820(%rbp)
movslq -0x820(%rbp), %rsi
leaq -0x588(%rbp), %rdi
callq 0xfff0
movq %rdx, -0x1010(%rbp)
movq %rax, -0x1008(%rbp)
jmp 0x7fa6f
movq -0x1010(%rbp), %rax
movq -0x1008(%rbp), %rcx
movq %rcx, -0x830(%rbp)
movq %rax, -0x828(%rbp)
leaq -0x830(%rbp), %rdi
callq 0x101a0
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x7fb52
movq -0x6c0(%rbp), %rax
movslq -0x800(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x81c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x838(%rbp)
movsd -0x838(%rbp), %xmm1
movsd -0x6f8(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x7fae8
movb $0x1, -0x6f9(%rbp)
movsd 0x172c88(%rip), %xmm0   # 0x1f2778
mulsd -0x838(%rbp), %xmm0
mulsd -0x838(%rbp), %xmm0
callq 0x5930
movq -0x6d8(%rbp), %rax
movslq -0x800(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movsd 0x172c53(%rip), %xmm0   # 0x1f2778
mulsd -0x838(%rbp), %xmm0
mulsd -0x838(%rbp), %xmm0
callq 0x5930
movq -0x6d8(%rbp), %rax
movslq -0x81c(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
jmp 0x7fb54
movl -0x81c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x81c(%rbp)
jmp 0x7fa23
jmp 0x7fb6a
jmp 0x7fb6c
movl -0x800(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x800(%rbp)
jmp 0x7f992
jmp 0x7f7a9
movl -0x6b4(%rbp), %esi
movl -0x58c(%rbp), %edx
subl %edx, %esi
movsd -0x6f8(%rbp), %xmm0
leaq 0x177364(%rip), %rdi    # 0x1f6f06
movb $0x1, %al
callq 0x5070
jmp 0x7fbab
jmp 0x7fbad
movl $0x0, -0x83c(%rbp)
movl -0x83c(%rbp), %eax
cmpl -0x6b4(%rbp), %eax
jge 0x7fc03
movq -0x6c0(%rbp), %rax
movslq -0x83c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x1018(%rbp)
cmpq $0x0, %rax
je 0x7fbf0
movq -0x1018(%rbp), %rdi
callq 0x56c0
jmp 0x7fbf2
movl -0x83c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x83c(%rbp)
jmp 0x7fbb7
movq -0x6c0(%rbp), %rax
movq %rax, -0x1020(%rbp)
cmpq $0x0, %rax
je 0x7fc23
movq -0x1020(%rbp), %rdi
callq 0x56c0
movq -0x6d0(%rbp), %rax
movq %rax, -0x1028(%rbp)
cmpq $0x0, %rax
je 0x7fc43
movq -0x1028(%rbp), %rdi
callq 0x56c0
movq -0x6d8(%rbp), %rax
movq %rax, -0x1030(%rbp)
cmpq $0x0, %rax
je 0x7fc63
movq -0x1030(%rbp), %rdi
callq 0x56c0
leaq -0xca0(%rbp), %rdi
callq 0x95350
jmp 0x7fc71
movq -0x30(%rbp), %rdi
leaq -0xca0(%rbp), %rsi
callq 0x96980
jmp 0x7fc83
movq -0xe48(%rbp), %rdi
xorl %esi, %esi
callq 0xea800
movq %rax, -0x1038(%rbp)
jmp 0x7fc9a
movq -0x1038(%rbp), %rax
imull $0xffffffff, (%rax), %eax # imm = 0xFFFFFFFF
movl %eax, -0xca4(%rbp)
movq -0xe48(%rbp), %rdi
movl -0xca4(%rbp), %eax
movl %eax, -0x1044(%rbp)
xorl %esi, %esi
callq 0xea800
movq %rax, -0x1040(%rbp)
jmp 0x7fcd0
movl -0x1044(%rbp), %eax
movq -0x1040(%rbp), %rcx
cmpl (%rcx), %eax
jg 0x8007c
movq -0xe48(%rbp), %rdi
movl $0x1, %esi
callq 0xea800
movq %rax, -0x1050(%rbp)
jmp 0x7fcff
movq -0x1050(%rbp), %rax
imull $0xffffffff, (%rax), %eax # imm = 0xFFFFFFFF
movl %eax, -0xca8(%rbp)
movq -0xe48(%rbp), %rdi
movl -0xca8(%rbp), %eax
movl %eax, -0x105c(%rbp)
movl $0x1, %esi
callq 0xea800
movq %rax, -0x1058(%rbp)
jmp 0x7fd38
movl -0x105c(%rbp), %eax
movq -0x1058(%rbp), %rcx
cmpl (%rcx), %eax
jg 0x80066
movq -0xe48(%rbp), %rdi
movl $0x2, %esi
callq 0xea800
movq %rax, -0x1068(%rbp)
jmp 0x7fd67
movq -0x1068(%rbp), %rax
imull $0xffffffff, (%rax), %eax # imm = 0xFFFFFFFF
movl %eax, -0xcac(%rbp)
movq -0xe48(%rbp), %rdi
movl -0xcac(%rbp), %eax
movl %eax, -0x1074(%rbp)
movl $0x2, %esi
callq 0xea800
movq %rax, -0x1070(%rbp)
jmp 0x7fda0
movl -0x1074(%rbp), %eax
movq -0x1070(%rbp), %rcx
cmpl (%rcx), %eax
jg 0x80050
cmpl $0x0, -0xca4(%rbp)
jne 0x7fdd4
cmpl $0x0, -0xca8(%rbp)
jne 0x7fdd4
cmpl $0x0, -0xcac(%rbp)
je 0x8003a
movl $0x0, -0xcb0(%rbp)
movl -0xcb0(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpl 0x110(%rcx), %eax
jge 0x80038
leaq -0xd48(%rbp), %rdi
callq 0x954b0
jmp 0x7fe02
movq -0x30(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0xcb0(%rbp), %rsi
callq 0xf090
movq %rax, -0x1080(%rbp)
jmp 0x7fe22
movq -0x1080(%rbp), %rsi
addq $0x40, %rsi
leaq -0xd08(%rbp), %rdi
callq 0x5060
jmp 0x7fe3b
movq -0x30(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0xcb0(%rbp), %rsi
callq 0xf090
movq %rax, -0x1088(%rbp)
jmp 0x7fe5b
movq -0x1088(%rbp), %rax
movsd 0x18(%rax), %xmm0
cvtsi2sdl -0xca4(%rbp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0xd30(%rbp)
movq -0x30(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0xcb0(%rbp), %rsi
callq 0xf090
movq %rax, -0x1090(%rbp)
jmp 0x7fe9b
movq -0x1090(%rbp), %rax
movsd 0x20(%rax), %xmm0
cvtsi2sdl -0xca8(%rbp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0xd28(%rbp)
movq -0x30(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0xcb0(%rbp), %rsi
callq 0xf090
movq %rax, -0x1098(%rbp)
jmp 0x7fedb
movq -0x1098(%rbp), %rax
movsd 0x28(%rax), %xmm0
cvtsi2sdl -0xcac(%rbp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0xd20(%rbp)
movq -0x30(%rbp), %rsi
movsd -0xd30(%rbp), %xmm0
movsd -0xd28(%rbp), %xmm1
movsd -0xd20(%rbp), %xmm2
leaq -0xd60(%rbp), %rdi
callq 0x97170
jmp 0x7ff25
movsd -0xd60(%rbp), %xmm0
movsd %xmm0, -0xd48(%rbp)
movsd -0xd58(%rbp), %xmm0
movsd %xmm0, -0xd40(%rbp)
movsd -0xd50(%rbp), %xmm0
movsd %xmm0, -0xd38(%rbp)
leaq -0xd08(%rbp), %rsi
leaq -0xd80(%rbp), %rdi
callq 0x5220
jmp 0x7ff6a
movzbl -0x31(%rbp), %esi
andl $0x1, %esi
leaq -0xd80(%rbp), %rdi
callq 0x466e0
movsd %xmm0, -0x10a0(%rbp)
jmp 0x7ff87
movsd -0x10a0(%rbp), %xmm0
movsd %xmm0, -0xd18(%rbp)
leaq -0xd80(%rbp), %rdi
callq 0x5300
leaq -0x9b0(%rbp), %rdi
leaq -0xd48(%rbp), %rsi
callq 0xf190
jmp 0x7ffb8
movl -0xb90(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb90(%rbp)
leaq -0xd48(%rbp), %rdi
callq 0xf200
movl -0xcb0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xcb0(%rbp)
jmp 0x7fdde
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x8076a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x80027
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0xd80(%rbp), %rdi
callq 0x5300
leaq -0xd48(%rbp), %rdi
callq 0xf200
jmp 0x8076a
jmp 0x8003a
jmp 0x8003c
movl -0xcac(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xcac(%rbp)
jmp 0x7fd7a
jmp 0x80052
movl -0xca8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xca8(%rbp)
jmp 0x7fd12
jmp 0x80068
movl -0xca4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xca4(%rbp)
jmp 0x7fcad
movq -0x30(%rbp), %rax
movl 0x110(%rax), %esi
movl -0xb90(%rbp), %edx
leaq 0x176ecb(%rip), %rdi    # 0x1f6f5e
xorl %eax, %eax
callq 0x5070
jmp 0x8009c
movl $0x0, -0xd84(%rbp)
movl $0x0, -0xd88(%rbp)
movl -0xd88(%rbp), %eax
movl %eax, -0x10a4(%rbp)
leaq -0x560(%rbp), %rdi
addq $0x48, %rdi
callq 0xf270
movq %rax, %rcx
movl -0x10a4(%rbp), %eax
cmpl %ecx, %eax
jge 0x8071f
leaq -0xda0(%rbp), %rdi
callq 0x59bd0
movslq -0xd88(%rbp), %rsi
leaq -0x588(%rbp), %rdi
callq 0xfff0
movq %rdx, -0x10b8(%rbp)
movq %rax, -0x10b0(%rbp)
jmp 0x8010c
movq -0x10b8(%rbp), %rax
movq -0x10b0(%rbp), %rcx
movq %rcx, -0xdb0(%rbp)
movq %rax, -0xda8(%rbp)
leaq -0xdb0(%rbp), %rdi
callq 0x101a0
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x806f1
movl $0x0, -0xdb4(%rbp)
movl -0xdb4(%rbp), %eax
cmpl -0xb90(%rbp), %eax
jge 0x80333
leaq -0x518(%rbp), %rdi
movslq -0xd88(%rbp), %rsi
callq 0xf390
movq %rax, -0x10c0(%rbp)
jmp 0x8017a
movq -0x10c0(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x10d0(%rbp)
leaq -0x518(%rbp), %rdi
movslq -0xd88(%rbp), %rsi
callq 0xf390
movq %rax, -0x10c8(%rbp)
jmp 0x801a9
movq -0x10c8(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x10e0(%rbp)
leaq -0x518(%rbp), %rdi
movslq -0xd88(%rbp), %rsi
callq 0xf390
movq %rax, -0x10d8(%rbp)
jmp 0x801d9
movq -0x10d8(%rbp), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0x10f0(%rbp)
leaq -0x9b0(%rbp), %rdi
movslq -0xdb4(%rbp), %rsi
callq 0xf090
movq %rax, -0x10e8(%rbp)
jmp 0x80209
movq -0x10e8(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x1100(%rbp)
leaq -0x9b0(%rbp), %rdi
movslq -0xdb4(%rbp), %rsi
callq 0xf090
movq %rax, -0x10f8(%rbp)
jmp 0x80238
movq -0x10f8(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x1110(%rbp)
leaq -0x9b0(%rbp), %rdi
movslq -0xdb4(%rbp), %rsi
callq 0xf090
movq %rax, -0x1108(%rbp)
jmp 0x80268
movsd -0x1110(%rbp), %xmm4
movsd -0x1100(%rbp), %xmm3
movsd -0x10f0(%rbp), %xmm2
movsd -0x10e0(%rbp), %xmm1
movsd -0x10d0(%rbp), %xmm0
movq -0x1108(%rbp), %rax
movsd 0x10(%rax), %xmm5
callq 0xebaf0
movsd %xmm0, -0x1118(%rbp)
jmp 0x802ab
movsd -0x1118(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0xdb8(%rbp)
movss -0xdb8(%rbp), %xmm0
cvtss2sd %xmm0, %xmm1
movsd -0x18(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x8031d
leaq -0x9b0(%rbp), %rdi
movslq -0xdb4(%rbp), %rsi
callq 0xf090
movq %rax, -0x1120(%rbp)
jmp 0x802f2
movq -0x1120(%rbp), %rsi
leaq -0xda0(%rbp), %rdi
callq 0xf190
jmp 0x80307
jmp 0x8031d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x80711
jmp 0x8031f
movl -0xdb4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xdb4(%rbp)
jmp 0x8014c
movl -0xd84(%rbp), %esi
leaq -0xdd8(%rbp), %rdi
callq 0x8abd0
jmp 0x80347
movq -0x8(%rbp), %rax
movq %rax, -0x1130(%rbp)
leaq -0xe19(%rbp), %rdi
movq %rdi, -0x1128(%rbp)
callq 0x5900
movq -0x1130(%rbp), %rsi
movq -0x1128(%rbp), %rdx
leaq -0xe18(%rbp), %rdi
callq 0x47530
jmp 0x80381
leaq 0x176c18(%rip), %rsi    # 0x1f6fa0
leaq -0xe18(%rbp), %rdi
callq 0x5990
movq %rax, -0x1138(%rbp)
jmp 0x8039d
movq -0x1138(%rbp), %rsi
leaq -0xdf8(%rbp), %rdi
callq 0x5220
jmp 0x803b2
leaq -0xe18(%rbp), %rdi
callq 0x5300
leaq -0xe19(%rbp), %rdi
callq 0x55d0
leaq -0xdf8(%rbp), %rdi
leaq -0xdd8(%rbp), %rsi
callq 0x59d0
jmp 0x803df
leaq 0x176fa6(%rip), %rsi    # 0x1f738c
leaq -0xdf8(%rbp), %rdi
callq 0x5990
jmp 0x803f4
leaq -0xdf8(%rbp), %rdi
callq 0x5200
movq %rax, %rdi
leaq 0x17680a(%rip), %rsi    # 0x1f6c14
callq 0x5650
movq %rax, -0x1140(%rbp)
jmp 0x80418
movq -0x1140(%rbp), %rax
movq %rax, -0xe28(%rbp)
movq -0xe28(%rbp), %rax
movq %rax, -0x1148(%rbp)
leaq -0xda0(%rbp), %rdi
callq 0xf060
movq -0x1148(%rbp), %rdi
movl %eax, %edx
addl $0x1, %edx
leaq 0x176b62(%rip), %rsi    # 0x1f6fb5
movb $0x0, %al
callq 0x5750
movl $0x0, -0xe2c(%rbp)
movl -0xe2c(%rbp), %eax
movl %eax, -0x114c(%rbp)
leaq -0xda0(%rbp), %rdi
callq 0xf060
movq %rax, %rcx
movl -0x114c(%rbp), %eax
cmpl %ecx, %eax
jge 0x805f2
movq -0xe28(%rbp), %rax
movq %rax, -0x1160(%rbp)
movslq -0xe2c(%rbp), %rsi
leaq -0xda0(%rbp), %rdi
callq 0xf090
movq %rax, -0x1158(%rbp)
jmp 0x804b7
movq -0x1158(%rbp), %rdi
addq $0x40, %rdi
callq 0x5200
movq %rax, -0x1170(%rbp)
movslq -0xe2c(%rbp), %rsi
leaq -0xda0(%rbp), %rdi
callq 0xf090
movq %rax, -0x1168(%rbp)
jmp 0x804ea
movq -0x1168(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x1180(%rbp)
movslq -0xe2c(%rbp), %rsi
leaq -0xda0(%rbp), %rdi
callq 0xf090
movq %rax, -0x1178(%rbp)
jmp 0x80519
movq -0x1178(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x1190(%rbp)
movslq -0xe2c(%rbp), %rsi
leaq -0xda0(%rbp), %rdi
callq 0xf090
movq %rax, -0x1188(%rbp)
jmp 0x80549
movsd -0x1190(%rbp), %xmm1
movsd -0x1180(%rbp), %xmm0
movq -0x1170(%rbp), %rdx
movq -0x1160(%rbp), %rdi
movq -0x1188(%rbp), %rax
movsd 0x10(%rax), %xmm2
leaq 0x176a4a(%rip), %rsi    # 0x1f6fc4
movb $0x3, %al
callq 0x5750
movl -0xe2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe2c(%rbp)
jmp 0x80464
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x805c1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0xe18(%rbp), %rdi
callq 0x5300
leaq -0xe19(%rbp), %rdi
callq 0x55d0
jmp 0x806e3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0xdf8(%rbp), %rdi
callq 0x5300
jmp 0x806e3
movq -0xe28(%rbp), %rax
movq %rax, -0x11a0(%rbp)
leaq -0x518(%rbp), %rdi
movslq -0xd88(%rbp), %rsi
callq 0xf390
movq %rax, -0x1198(%rbp)
jmp 0x8061c
movq -0x1198(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x11b0(%rbp)
leaq -0x518(%rbp), %rdi
movslq -0xd88(%rbp), %rsi
callq 0xf390
movq %rax, -0x11a8(%rbp)
jmp 0x8064b
movq -0x11a8(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x11c0(%rbp)
leaq -0x518(%rbp), %rdi
movslq -0xd88(%rbp), %rsi
callq 0xf390
movq %rax, -0x11b8(%rbp)
jmp 0x8067b
movsd -0x11c0(%rbp), %xmm1
movsd -0x11b0(%rbp), %xmm0
movq -0x11a0(%rbp), %rdi
movq -0x11b8(%rbp), %rax
movsd 0x10(%rax), %xmm2
leaq 0x176932(%rip), %rsi    # 0x1f6fd7
movb $0x3, %al
callq 0x5750
movq -0xe28(%rbp), %rdi
callq 0x5550
jmp 0x806ba
movl -0xd84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd84(%rbp)
leaq -0xdf8(%rbp), %rdi
callq 0x5300
leaq -0xdd8(%rbp), %rdi
callq 0x5300
jmp 0x806f1
leaq -0xdd8(%rbp), %rdi
callq 0x5300
jmp 0x80711
leaq -0xda0(%rbp), %rdi
callq 0x12310
movl -0xd88(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd88(%rbp)
jmp 0x800b0
leaq -0xda0(%rbp), %rdi
callq 0x12310
jmp 0x8076a
leaq -0xca0(%rbp), %rdi
callq 0xfde0
leaq -0x588(%rbp), %rdi
callq 0xf9b0
leaq -0x560(%rbp), %rdi
callq 0xf8a0
leaq -0x4e8(%rbp), %rdi
callq 0xfde0
leaq -0x78(%rbp), %rdi
callq 0x84ee0
leaq -0x60(%rbp), %rdi
callq 0xf9b0
addq $0x11c0, %rsp           # imm = 0x11C0
popq %rbp
retq
leaq -0xca0(%rbp), %rdi
callq 0xfde0
leaq -0x588(%rbp), %rdi
callq 0xf9b0
leaq -0x560(%rbp), %rdi
callq 0xf8a0
leaq -0x4e8(%rbp), %rdi
callq 0xfde0
leaq -0x78(%rbp), %rdi
callq 0x84ee0
leaq -0x60(%rbp), %rdi
callq 0xf9b0
movq -0x80(%rbp), %rdi
callq 0x58f0
nopw %cs:(%rax,%rax)