// File: Luthaf[P]zeopp/networkstorage.cc
// Function: place_molecule(std::vector<MOLECULE, std::allocator<MOLECULE>>*, std::vector<CONNECTION, std::allocator<CONNECTION>>*, ATOM_NETWORK*, std::vector<bool, std::allocator<bool>>*, std::vector<bool, std::allocator<bool>>*, std::vector<MOLECULE, std::allocator<MOLECULE>>*, int, double*)
int place_molecule(vector<MOLECULE> *molecules, vector<CONNECTION> *two_way_connections, ATOM_NETWORK *cell, vector<bool> *placed, vector<bool> *connected, vector<MOLECULE> *framework, int num_placed, double *sum_edge_lengths) {
  bool verbose = false;
  //1) if no molecules have been placed yet, just fix the first one in position with its first edge at the origin
  if(num_placed==0) {
if(verbose) printf("DEBUG: detected that no molecules have yet been placed - positioning first molecule with first edge at the origin\n");
    int v_index = two_way_connections->at(0).v1;
    int e_index = two_way_connections->at(0).e1;
    MOLECULE placing = molecules->at(v_index);
    int site_index = placing.permutation.at(e_index);
    int atom_index = placing.sites.at(site_index);
    XYZ site = placing.atoms_xyz.at(atom_index);
    XYZ shift = site.scale(-1);
if(verbose) printf("DEBUG: v=%d, e=%d; site=%.3f %.3f %.3f; shift=%.3f %.3f %.3f\n", v_index, e_index, site.x, site.y, site.z, shift.x, shift.y, shift.z);
    framework->at(v_index) = (translate(placing, shift));
    placed->at(v_index) = true;
    return num_placed+1;
  }
  //2) otherwise, need to find a new molecule to place
if(verbose) printf("DEBUG: detected that %d molecules have already been placed\n", num_placed);
  int num_molecules = molecules->size();
  int num_connections = two_way_connections->size();
  int molecule_index = -1;
  for(int i=0; i<num_molecules && molecule_index==-1; i++) {
    if(!placed->at(i)) { //if this molecule has not yet been placed - it is a candidate for placement, but we must have an adjacent molecule already placed which we can attach it to
      int connection_index = -1;
      for(int j=0; j<num_connections && connection_index==-1; j++) { //is there any two way connection which connects this new molecule and any previously placed one?
        if(!connected->at(j)) { //if this connection was already made, we don't need to check it again
          CONNECTION c = two_way_connections->at(j);
          int placing_edge_index = -1, fixed_edge_index = -1;
          int placing_vertex_index = -1, fixed_vertex_index = -1;
          if(c.v1==i) { //vertex 1 in this connection is the molecule we are placing
            if(placed->at(c.v2)) { //vertex 2 in this connection is a molecule which has already been placed
              placing_edge_index = c.e1;
              fixed_edge_index = c.e2;
              placing_vertex_index = c.v1;
              fixed_vertex_index = c.v2;
            }
          } else if(c.v2==i) { //vertex 2 in this connection is the molecule we are placing
            if(placed->at(c.v1)) { //vertex 1 in this connection is a molecule which has already been placed
              placing_edge_index = c.e2;
              fixed_edge_index = c.e1;
              placing_vertex_index = c.v2;
              fixed_vertex_index = c.v1;
            }
          }
          if(fixed_edge_index!=-1 && placing_edge_index!=-1 && fixed_vertex_index!=-1 && placing_vertex_index!=-1) { //this connection connects this molecule and a fixed molecule, and we have stored the relevant edge and vertex indices - we can proceed to place this molecule!
if(verbose) printf("DEBUG: found that new vertex %d edge %d is connected to fixed vertex %d edge %d\n", placing_vertex_index, placing_edge_index, fixed_vertex_index, fixed_edge_index);
            MOLECULE placing = molecules->at(placing_vertex_index);
            int placing_site_index = placing.permutation.at(placing_edge_index);
            int placing_atom_index = placing.sites.at(placing_site_index);
            MOLECULE fixed = framework->at(fixed_vertex_index);
            int fixed_site_index = fixed.permutation.at(fixed_edge_index);
            int fixed_atom_index = fixed.sites.at(fixed_site_index);
if(verbose) printf("DEBUG: %s in placing connecting to %s in fixed\n", placing.atoms_type.at(placing_atom_index).c_str(), fixed.atoms_type.at(fixed_atom_index).c_str());
            if(placing.atoms_type.at(placing_atom_index)!=fixed.atoms_type.at(fixed_atom_index)) {//only make the connection if the sites are the same type!
if(verbose) printf("DEBUG: trying to connect conflicting connection sites - aborting construction attempt\n");
              return num_placed;
            }
//if(1) exit(1);
            XYZ placing_site = placing.atoms_xyz.at(placing_atom_index);
            XYZ fixed_site = fixed.atoms_xyz.at(fixed_atom_index);
            XYZ shift = fixed_site-placing_site;
if(verbose) printf("DEBUG: site index in fixed = %d, site_index in placing = %d\n", fixed_site_index, placing_site_index);
if(verbose) printf("DEBUG: fixed_site=%.3f %.3f %.3f; placing_site=%.3f %.3f %.3f; shift=%.3f %.3f %.3f\n", fixed_site.x, fixed_site.y, fixed_site.z, placing_site.x, placing_site.y, placing_site.z, shift.x, shift.y, shift.z);
            framework->at(placing_vertex_index) = (translate(placing, shift));
            placed->at(placing_vertex_index) = true; //record this new vertex as now being fixed in place
            connected->at(j) = true; //record that this connection was used
            double com_dist = (fixed.com - framework->at(placing_vertex_index).com).magnitude();
if(verbose) printf("DEBUG: made a connection indicating a topological edge length of %.3f\n", com_dist);
            XYZ start_abc = cell->vertices.at(fixed_vertex_index).abc;
            XYZ end_abc = cell->vertices.at(fixed_vertex_index).edges.at(fixed_edge_index);
if(verbose) printf("\tDEBUG: this edge in the underlying net goes from fractional %.3f %.3f %.3f to fractional %.3f %.3f %.3f\n", start_abc.x, start_abc.y, start_abc.z, end_abc.x, end_abc.y, end_abc.z);
            XYZ shift_abc = end_abc-start_abc;
            XYZ shift_xyz = framework->at(placing_vertex_index).com-fixed.com;
if(verbose) printf("\tDEBUG: this edge in the underlying net had a fractional shift %.3f %.3f %.3f; here we observe a cartesian shift %.3f %.3f %.3f\n", shift_abc.x, shift_abc.y, shift_abc.z, shift_xyz.x, shift_xyz.y, shift_xyz.z);
            XYZ unit_cell_parameter_suggestion(shift_xyz.x/shift_abc.x, shift_xyz.y/shift_abc.y, shift_xyz.z/shift_abc.z);
if(verbose) printf("\tDEBUG: suggests unit cell dimensions %.3f %.3f %.3f\n", unit_cell_parameter_suggestion.x, unit_cell_parameter_suggestion.y, unit_cell_parameter_suggestion.z);
            (*sum_edge_lengths)+=com_dist;
            return num_placed+1;
          }
        }
      }
      if(connection_index==-1) {
if(verbose) printf("DEBUG: could not find any connection between vertex %d and any fixed vertex\n", i);
      }
    }
  }
  printf("WARNING: could not find a molecule which has not been placed and which is adjacent to an already placed molecule - this may happen if the net is interpenetrated (not currently handled with the connection-based alignment method)\n");
  return num_placed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x850, %rsp            # imm = 0x850
movq 0x18(%rbp), %rax
movl 0x10(%rbp), %eax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movb $0x0, -0x39(%rbp)
cmpl $0x0, 0x10(%rbp)
jne 0x9fcfa
testb $0x1, -0x39(%rbp)
je 0x9fa4c
leaq 0x15891a(%rip), %rdi    # 0x1f835f
movb $0x0, %al
callq 0x5070
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movq %rsi, -0x730(%rbp)
callq 0xaf0e0
movq -0x730(%rbp), %rsi
movl (%rax), %eax
movl %eax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
callq 0xaf0e0
movl 0x8(%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x40(%rbp), %rsi
callq 0xaf120
movq %rax, %rsi
leaq -0xf0(%rbp), %rdi
callq 0xaf160
leaq -0x78(%rbp), %rdi
movslq -0x44(%rbp), %rsi
callq 0x101d0
movq %rax, -0x728(%rbp)
jmp 0x9faad
movq -0x728(%rbp), %rax
movl (%rax), %eax
movl %eax, -0xf4(%rbp)
leaq -0xa8(%rbp), %rdi
movslq -0xf4(%rbp), %rsi
callq 0x101d0
movq %rax, -0x738(%rbp)
jmp 0x9fad8
movq -0x738(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x108(%rbp)
movslq -0x108(%rbp), %rsi
leaq -0xf0(%rbp), %rdi
callq 0xae5c0
movq %rax, -0x740(%rbp)
jmp 0x9fb03
movq -0x740(%rbp), %rax
movq 0x10(%rax), %rcx
movq %rcx, -0x110(%rbp)
movups (%rax), %xmm0
movaps %xmm0, -0x120(%rbp)
leaq -0x138(%rbp), %rdi
leaq -0x120(%rbp), %rsi
movsd 0x152c43(%rip), %xmm0   # 0x1f2778
callq 0xea9f0
jmp 0x9fb3c
testb $0x1, -0x39(%rbp)
je 0x9fba1
movl -0x40(%rbp), %esi
movl -0x44(%rbp), %edx
movsd -0x120(%rbp), %xmm0
movsd -0x118(%rbp), %xmm1
movsd -0x110(%rbp), %xmm2
movsd -0x138(%rbp), %xmm3
movsd -0x130(%rbp), %xmm4
movsd -0x128(%rbp), %xmm5
leaq 0x158853(%rip), %rdi    # 0x1f83d2
movb $0x6, %al
callq 0x5070
jmp 0x9fb88
jmp 0x9fba1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x9fce9
leaq -0x288(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0xaf160
jmp 0x9fbb6
movq -0x128(%rbp), %rax
movq %rax, -0x290(%rbp)
movups -0x138(%rbp), %xmm0
movaps %xmm0, -0x2a0(%rbp)
movq -0x290(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movaps -0x2a0(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x1e0(%rbp), %rdi
leaq -0x288(%rbp), %rsi
callq 0x110ee0
jmp 0x9fbff
movq -0x38(%rbp), %rdi
movslq -0x40(%rbp), %rsi
callq 0xaf120
movq %rax, -0x748(%rbp)
jmp 0x9fc15
movq -0x748(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
movq %rsi, -0x760(%rbp)
callq 0xaf2c0
movq -0x760(%rbp), %rdi
callq 0xaf390
leaq -0x288(%rbp), %rdi
callq 0xaf390
movq -0x28(%rbp), %rdi
movslq -0x40(%rbp), %rsi
callq 0xfff0
movq %rdx, -0x758(%rbp)
movq %rax, -0x750(%rbp)
jmp 0x9fc64
movq -0x758(%rbp), %rax
movq -0x750(%rbp), %rcx
movq %rcx, -0x2b0(%rbp)
movq %rax, -0x2a8(%rbp)
leaq -0x2b0(%rbp), %rdi
movl $0x1, %esi
callq 0x10040
movl 0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0xaf390
jmp 0xa07ec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x9fcdd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0xaf390
leaq -0x288(%rbp), %rdi
callq 0xaf390
leaq -0xf0(%rbp), %rdi
callq 0xaf390
jmp 0xa07f8
testb $0x1, -0x39(%rbp)
je 0x9fd11
movl 0x10(%rbp), %esi
leaq 0x158706(%rip), %rdi    # 0x1f8410
movb $0x0, %al
callq 0x5070
movq -0x10(%rbp), %rdi
callq 0xaf3f0
movl %eax, -0x2b4(%rbp)
movq -0x18(%rbp), %rdi
callq 0xaf420
movl %eax, -0x2b8(%rbp)
movl $0xffffffff, -0x2bc(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x2c0(%rbp)
movl -0x2c0(%rbp), %ecx
xorl %eax, %eax
cmpl -0x2b4(%rbp), %ecx
movb %al, -0x761(%rbp)
jge 0x9fd69
cmpl $-0x1, -0x2bc(%rbp)
sete %al
movb %al, -0x761(%rbp)
movb -0x761(%rbp), %al
testb $0x1, %al
jne 0x9fd78
jmp 0xa07d8
movq -0x28(%rbp), %rdi
movslq -0x2c0(%rbp), %rsi
callq 0xfff0
movq %rax, -0x2d0(%rbp)
movq %rdx, -0x2c8(%rbp)
leaq -0x2d0(%rbp), %rdi
callq 0x101a0
xorb $-0x1, %al
testb $0x1, %al
jne 0x9fdad
jmp 0xa07c2
movl $0xffffffff, -0x2d4(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x2d8(%rbp)
movl -0x2d8(%rbp), %ecx
xorl %eax, %eax
cmpl -0x2b8(%rbp), %ecx
movb %al, -0x762(%rbp)
jge 0x9fde7
cmpl $-0x1, -0x2d4(%rbp)
sete %al
movb %al, -0x762(%rbp)
movb -0x762(%rbp), %al
testb $0x1, %al
jne 0x9fdf6
jmp 0xa079b
movq -0x30(%rbp), %rdi
movslq -0x2d8(%rbp), %rsi
callq 0xfff0
movq %rax, -0x2e8(%rbp)
movq %rdx, -0x2e0(%rbp)
leaq -0x2e8(%rbp), %rdi
callq 0x101a0
xorb $-0x1, %al
testb $0x1, %al
jne 0x9fe2b
jmp 0xa0785
movq -0x18(%rbp), %rdi
movslq -0x2d8(%rbp), %rsi
callq 0xaf0e0
movq (%rax), %rcx
movq %rcx, -0x304(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x2fc(%rbp)
movq 0x10(%rax), %rcx
movq %rcx, -0x2f4(%rbp)
movl 0x18(%rax), %eax
movl %eax, -0x2ec(%rbp)
movl $0xffffffff, -0x308(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x30c(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x310(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x314(%rbp) # imm = 0xFFFFFFFF
movl -0x304(%rbp), %eax
cmpl -0x2c0(%rbp), %eax
jne 0x9fefc
movq -0x28(%rbp), %rdi
movslq -0x300(%rbp), %rsi
callq 0xfff0
movq %rax, -0x328(%rbp)
movq %rdx, -0x320(%rbp)
leaq -0x328(%rbp), %rdi
callq 0x101a0
testb $0x1, %al
jne 0x9feca
jmp 0x9fefa
movl -0x2fc(%rbp), %eax
movl %eax, -0x308(%rbp)
movl -0x2f8(%rbp), %eax
movl %eax, -0x30c(%rbp)
movl -0x304(%rbp), %eax
movl %eax, -0x310(%rbp)
movl -0x300(%rbp), %eax
movl %eax, -0x314(%rbp)
jmp 0x9ff6e
movl -0x300(%rbp), %eax
cmpl -0x2c0(%rbp), %eax
jne 0x9ff6c
movq -0x28(%rbp), %rdi
movslq -0x304(%rbp), %rsi
callq 0xfff0
movq %rax, -0x338(%rbp)
movq %rdx, -0x330(%rbp)
leaq -0x338(%rbp), %rdi
callq 0x101a0
testb $0x1, %al
jne 0x9ff3a
jmp 0x9ff6a
movl -0x2f8(%rbp), %eax
movl %eax, -0x308(%rbp)
movl -0x2fc(%rbp), %eax
movl %eax, -0x30c(%rbp)
movl -0x300(%rbp), %eax
movl %eax, -0x310(%rbp)
movl -0x304(%rbp), %eax
movl %eax, -0x314(%rbp)
jmp 0x9ff6c
jmp 0x9ff6e
cmpl $-0x1, -0x30c(%rbp)
je 0xa0783
cmpl $-0x1, -0x308(%rbp)
je 0xa0783
cmpl $-0x1, -0x314(%rbp)
je 0xa0783
cmpl $-0x1, -0x310(%rbp)
je 0xa0783
testb $0x1, -0x39(%rbp)
je 0x9ffcf
movl -0x310(%rbp), %esi
movl -0x308(%rbp), %edx
movl -0x314(%rbp), %ecx
movl -0x30c(%rbp), %r8d
leaq 0x158484(%rip), %rdi    # 0x1f844c
movb $0x0, %al
callq 0x5070
movq -0x10(%rbp), %rdi
movslq -0x310(%rbp), %rsi
callq 0xaf120
movq %rax, %rsi
leaq -0x3e0(%rbp), %rdi
callq 0xaf160
leaq -0x368(%rbp), %rdi
movslq -0x308(%rbp), %rsi
callq 0x101d0
movq %rax, -0x770(%rbp)
jmp 0xa000a
movq -0x770(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x3e4(%rbp)
leaq -0x398(%rbp), %rdi
movslq -0x3e4(%rbp), %rsi
callq 0x101d0
movq %rax, -0x778(%rbp)
jmp 0xa0035
movq -0x778(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x3e8(%rbp)
movq -0x38(%rbp), %rdi
movslq -0x314(%rbp), %rsi
callq 0xaf120
movq %rax, -0x780(%rbp)
jmp 0xa005d
movq -0x780(%rbp), %rsi
leaq -0x490(%rbp), %rdi
callq 0xaf160
jmp 0xa0072
leaq -0x418(%rbp), %rdi
movslq -0x30c(%rbp), %rsi
callq 0x101d0
movq %rax, -0x788(%rbp)
jmp 0xa008e
movq -0x788(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x494(%rbp)
leaq -0x448(%rbp), %rdi
movslq -0x494(%rbp), %rsi
callq 0x101d0
movq %rax, -0x790(%rbp)
jmp 0xa00b9
movq -0x790(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x498(%rbp)
testb $0x1, -0x39(%rbp)
je 0xa0173
leaq -0x3c8(%rbp), %rdi
movslq -0x3e8(%rbp), %rsi
callq 0xaf450
movq %rax, -0x798(%rbp)
jmp 0xa00ee
movq -0x798(%rbp), %rdi
callq 0x5200
movq %rax, -0x7a8(%rbp)
leaq -0x478(%rbp), %rdi
movslq -0x498(%rbp), %rsi
callq 0xaf450
movq %rax, -0x7a0(%rbp)
jmp 0xa011d
movq -0x7a0(%rbp), %rdi
callq 0x5200
movq -0x7a8(%rbp), %rsi
movq %rax, %rdx
leaq 0x158363(%rip), %rdi    # 0x1f849d
xorl %eax, %eax
callq 0x5070
jmp 0xa0143
jmp 0xa0173
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0xa0775
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0xa0769
leaq -0x3c8(%rbp), %rdi
movslq -0x3e8(%rbp), %rsi
callq 0xaf450
movq %rax, -0x7b0(%rbp)
jmp 0xa018f
leaq -0x478(%rbp), %rdi
movslq -0x498(%rbp), %rsi
callq 0xaf450
movq %rax, -0x7b8(%rbp)
jmp 0xa01ab
movq -0x7b8(%rbp), %rsi
movq -0x7b0(%rbp), %rdi
callq 0xaf490
testb $0x1, %al
jne 0xa01c4
jmp 0xa01f1
testb $0x1, -0x39(%rbp)
je 0xa01dc
leaq 0x1582fc(%rip), %rdi    # 0x1f84cd
xorl %eax, %eax
callq 0x5070
jmp 0xa01da
jmp 0xa01dc
movl 0x10(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x49c(%rbp)
jmp 0xa074c
movslq -0x3e8(%rbp), %rsi
leaq -0x3e0(%rbp), %rdi
callq 0xae5c0
movq %rax, -0x7c0(%rbp)
jmp 0xa020d
movq -0x7c0(%rbp), %rax
movq 0x10(%rax), %rcx
movq %rcx, -0x4b0(%rbp)
movups (%rax), %xmm0
movaps %xmm0, -0x4c0(%rbp)
movslq -0x498(%rbp), %rsi
leaq -0x490(%rbp), %rdi
callq 0xae5c0
movq %rax, -0x7c8(%rbp)
jmp 0xa0245
movq -0x7c8(%rbp), %rax
movq 0x10(%rax), %rcx
movq %rcx, -0x4d0(%rbp)
movups (%rax), %xmm0
movaps %xmm0, -0x4e0(%rbp)
leaq -0x4f8(%rbp), %rdi
leaq -0x4e0(%rbp), %rsi
leaq -0x4c0(%rbp), %rdx
callq 0xeadf0
jmp 0xa027d
testb $0x1, -0x39(%rbp)
je 0xa02a1
movl -0x494(%rbp), %esi
movl -0x3e4(%rbp), %edx
leaq 0x15828e(%rip), %rdi    # 0x1f8524
xorl %eax, %eax
callq 0x5070
jmp 0xa029f
jmp 0xa02a1
testb $0x1, -0x39(%rbp)
je 0xa030a
movsd -0x4e0(%rbp), %xmm0
movsd -0x4d8(%rbp), %xmm1
movsd -0x4d0(%rbp), %xmm2
movsd -0x4c0(%rbp), %xmm3
movsd -0x4b8(%rbp), %xmm4
movsd -0x4b0(%rbp), %xmm5
movsd -0x4f8(%rbp), %xmm6
movsd -0x4f0(%rbp), %xmm7
movsd -0x4e8(%rbp), %xmm8
movq %rsp, %rax
movsd %xmm8, (%rax)
leaq 0x158262(%rip), %rdi    # 0x1f8561
movb $0x8, %al
callq 0x5070
jmp 0xa0308
jmp 0xa030a
leaq -0x648(%rbp), %rdi
leaq -0x3e0(%rbp), %rsi
callq 0xaf160
jmp 0xa031f
movq -0x4e8(%rbp), %rax
movq %rax, -0x650(%rbp)
movups -0x4f8(%rbp), %xmm0
movaps %xmm0, -0x660(%rbp)
movq -0x650(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movaps -0x660(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x5a0(%rbp), %rdi
leaq -0x648(%rbp), %rsi
callq 0x110ee0
jmp 0xa0368
movq -0x38(%rbp), %rdi
movslq -0x310(%rbp), %rsi
callq 0xaf120
movq %rax, -0x7d0(%rbp)
jmp 0xa0381
movq -0x7d0(%rbp), %rdi
leaq -0x5a0(%rbp), %rsi
movq %rsi, -0x7e8(%rbp)
callq 0xaf2c0
movq -0x7e8(%rbp), %rdi
callq 0xaf390
leaq -0x648(%rbp), %rdi
callq 0xaf390
movq -0x28(%rbp), %rdi
movslq -0x310(%rbp), %rsi
callq 0xfff0
movq %rdx, -0x7e0(%rbp)
movq %rax, -0x7d8(%rbp)
jmp 0xa03d3
movq -0x7e0(%rbp), %rax
movq -0x7d8(%rbp), %rcx
movq %rcx, -0x670(%rbp)
movq %rax, -0x668(%rbp)
leaq -0x670(%rbp), %rdi
movl $0x1, %esi
callq 0x10040
movq -0x30(%rbp), %rdi
movslq -0x2d8(%rbp), %rsi
callq 0xfff0
movq %rdx, -0x7f8(%rbp)
movq %rax, -0x7f0(%rbp)
jmp 0xa0420
movq -0x7f8(%rbp), %rax
movq -0x7f0(%rbp), %rcx
movq %rcx, -0x680(%rbp)
movq %rax, -0x678(%rbp)
leaq -0x680(%rbp), %rdi
movl $0x1, %esi
callq 0x10040
leaq -0x400(%rbp), %rax
movq %rax, -0x808(%rbp)
movq -0x38(%rbp), %rdi
movslq -0x310(%rbp), %rsi
callq 0xaf120
movq %rax, -0x800(%rbp)
jmp 0xa0474
movq -0x808(%rbp), %rsi
movq -0x800(%rbp), %rdx
addq $0x90, %rdx
leaq -0x6a0(%rbp), %rdi
callq 0xeadf0
jmp 0xa0497
leaq -0x6a0(%rbp), %rdi
callq 0xe9240
movsd %xmm0, -0x810(%rbp)
jmp 0xa04ad
movsd -0x810(%rbp), %xmm0
movsd %xmm0, -0x688(%rbp)
testb $0x1, -0x39(%rbp)
je 0xa0520
movsd -0x688(%rbp), %xmm0
leaq 0x1580e4(%rip), %rdi    # 0x1f85b6
movb $0x1, %al
callq 0x5070
jmp 0xa04db
jmp 0xa0520
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0xa050f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x5a0(%rbp), %rdi
callq 0xaf390
leaq -0x648(%rbp), %rdi
callq 0xaf390
jmp 0xa0769
movq -0x20(%rbp), %rdi
addq $0x3c0, %rdi            # imm = 0x3C0
movslq -0x314(%rbp), %rsi
callq 0xae4a0
movq %rax, -0x818(%rbp)
jmp 0xa0540
movq -0x818(%rbp), %rax
movq 0x10(%rax), %rcx
movq %rcx, -0x6b0(%rbp)
movups (%rax), %xmm0
movaps %xmm0, -0x6c0(%rbp)
movq -0x20(%rbp), %rdi
addq $0x3c0, %rdi            # imm = 0x3C0
movslq -0x314(%rbp), %rsi
callq 0xae4a0
movq %rax, -0x820(%rbp)
jmp 0xa057c
movq -0x820(%rbp), %rdi
addq $0x20, %rdi
movslq -0x30c(%rbp), %rsi
callq 0xae5c0
movq %rax, -0x828(%rbp)
jmp 0xa059c
movq -0x828(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x6d8(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x6d0(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x6c8(%rbp)
testb $0x1, -0x39(%rbp)
je 0xa060b
movsd -0x6c0(%rbp), %xmm0
movsd -0x6b8(%rbp), %xmm1
movsd -0x6b0(%rbp), %xmm2
movsd -0x6d8(%rbp), %xmm3
movsd -0x6d0(%rbp), %xmm4
movsd -0x6c8(%rbp), %xmm5
leaq 0x157ffd(%rip), %rdi    # 0x1f85fd
movb $0x6, %al
callq 0x5070
jmp 0xa0609
jmp 0xa060b
leaq -0x6f0(%rbp), %rdi
leaq -0x6d8(%rbp), %rsi
leaq -0x6c0(%rbp), %rdx
callq 0xeadf0
jmp 0xa0627
movq -0x38(%rbp), %rdi
movslq -0x310(%rbp), %rsi
callq 0xaf120
movq %rax, -0x830(%rbp)
jmp 0xa0640
movq -0x830(%rbp), %rsi
addq $0x90, %rsi
leaq -0x400(%rbp), %rdx
leaq -0x708(%rbp), %rdi
callq 0xeadf0
jmp 0xa0663
testb $0x1, -0x39(%rbp)
je 0xa06ab
movsd -0x6f0(%rbp), %xmm0
movsd -0x6e8(%rbp), %xmm1
movsd -0x6e0(%rbp), %xmm2
movsd -0x708(%rbp), %xmm3
movsd -0x700(%rbp), %xmm4
movsd -0x6f8(%rbp), %xmm5
leaq 0x157fc7(%rip), %rdi    # 0x1f8667
movb $0x6, %al
callq 0x5070
jmp 0xa06a9
jmp 0xa06ab
movsd -0x708(%rbp), %xmm0
movsd -0x700(%rbp), %xmm1
movsd -0x6f0(%rbp), %xmm3
movsd -0x6e8(%rbp), %xmm2
divsd %xmm3, %xmm0
divsd %xmm2, %xmm1
movsd -0x6f8(%rbp), %xmm2
movsd -0x6e0(%rbp), %xmm3
divsd %xmm3, %xmm2
leaq -0x720(%rbp), %rdi
callq 0xea8e0
jmp 0xa06f5
testb $0x1, -0x39(%rbp)
je 0xa0725
movsd -0x720(%rbp), %xmm0
movsd -0x718(%rbp), %xmm1
movsd -0x710(%rbp), %xmm2
leaq 0x157fce(%rip), %rdi    # 0x1f86e8
movb $0x3, %al
callq 0x5070
jmp 0xa0723
jmp 0xa0725
movsd -0x688(%rbp), %xmm0
movq 0x18(%rbp), %rax
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movl 0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x49c(%rbp)
leaq -0x490(%rbp), %rdi
callq 0xaf390
leaq -0x3e0(%rbp), %rdi
callq 0xaf390
jmp 0xa07ec
leaq -0x490(%rbp), %rdi
callq 0xaf390
leaq -0x3e0(%rbp), %rdi
callq 0xaf390
jmp 0xa07f8
jmp 0xa0785
jmp 0xa0787
movl -0x2d8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2d8(%rbp)
jmp 0x9fdc1
cmpl $-0x1, -0x2d4(%rbp)
jne 0xa07c0
testb $0x1, -0x39(%rbp)
je 0xa07be
movl -0x2c0(%rbp), %esi
leaq 0x157f67(%rip), %rdi    # 0x1f871e
movb $0x0, %al
callq 0x5070
jmp 0xa07c0
jmp 0xa07c2
jmp 0xa07c4
movl -0x2c0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c0(%rbp)
jmp 0x9fd43
leaq 0x157f8c(%rip), %rdi    # 0x1f876b
movb $0x0, %al
callq 0x5070
movl 0x10(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x850, %rsp            # imm = 0x850
popq %rbp
retq
movq -0x100(%rbp), %rdi
callq 0x58f0
nopw %cs:(%rax,%rax)