// File: /workspace/github_cpp_makefile_star2_O2/Luthaf[P]zeopp/networkstorage.cc
// Function: add_2c_dummy_edges(ATOM_NETWORK*, ATOM_NETWORK*, std::vector<CONNECTION, std::allocator<CONNECTION>>*)
void add_2c_dummy_edges(ATOM_NETWORK *basic_cell, ATOM_NETWORK *full_cell, vector<CONNECTION> *two_way_connections) { //the vertices are already in place - now we must add the dummy edges
  bool verbose = false;
  if(verbose) printf("DEBUG: adding dummy edges to 2-c vertices to represent orthogonal point of reference for molecular alignment\n");
  vector<int> basic_IDs_examined;
  int num_two_way_connections = two_way_connections->size();
  int num_full_v = full_cell->vertices.size();
  for(int i=0; i<num_full_v; i++) {
    VERTEX v = full_cell->vertices.at(i);
    XYZ v_xyz = full_cell->abc_to_xyz_returning_XYZ(v.abc);
    int num_e = v.edges.size();
    if(num_e==2) { //i.e. if a 2-c vertex, we need to add a dummy orthogonal edge
      int basic_ID = full_cell->vertex_basic_indices.at(i);
      bool examined_already = false;
      int num_examined_already = basic_IDs_examined.size();
      int sym_op = full_cell->vertex_symmetry_operators.at(i);
      for(int ex=0; ex<num_examined_already && !examined_already; ex++) {
        if(basic_IDs_examined.at(ex)==basic_ID) examined_already = true;
      }
      if(!examined_already) { //only need to find the direction if this vertex is not a symmetry image of another
        basic_IDs_examined.push_back(basic_ID);
        if(sym_op!=0) { //double check that the symmetry operator is zero (no sym operator), as it should be
          printf("ERROR: found a 2-c vertex ID %d based on underlying 2-c vertex ID %d, which has not already been examined, but the symmetry operator is non-zero (%d)\n", i, basic_ID, sym_op);
          exit(EXIT_FAILURE);
        }
        //we need to know which two vertices (in the full cell) this 2-c vertex is connected to, so that we can look at their other edges and decide a direction
        int v1 = -1, v2 = -1;
        int e1 = -1, e2 = -1;
        for(int j=0; j<num_two_way_connections && (v1==-1 || v2==-1); j++) {
          CONNECTION c = two_way_connections->at(j);
          if(i==c.v1) {
            //this connection links i with something
            if(v1==-1) {v1 = c.v2; e1 = c.e2;} else if(v2==-1) {v2 = c.v2; e2 = c.e2;}
          } else if(i==c.v2) {
            //this connection links something with i
            if(v1==-1) {v1 = c.v1; e1 = c.e1;} else if(v2==-1) {v2 = c.v1; e2 = c.e1;}
          }
        }
        if(v1==-1 || v2==-1) { //failed to identify the two adjacent full cell vertices
          printf("ERROR: could not identify the two full cell vertices connected to 2-c vertex %d\n", i);
          exit(EXIT_FAILURE);
        }
        XYZ v1_xyz = full_cell->abc_to_xyz_returning_XYZ(full_cell->vertices.at(v1).abc);
        XYZ v2_xyz = full_cell->abc_to_xyz_returning_XYZ(full_cell->vertices.at(v2).abc);
if(verbose) printf("DEBUG: the two full vertices which define this 2c vertex are v1, id %d at %.3f %.3f %.3f, and v2, id %d at %.3f %.3f %.3f\n", v1, v1_xyz.x, v1_xyz.y, v1_xyz.z, v2, v2_xyz.x, v2_xyz.y, v2_xyz.z);
if(verbose) printf("DEBUG: v_xyz (2c vertex position) = %.3f %.3f %.3f\n", v_xyz.x, v_xyz.y, v_xyz.z);
        XYZ this_edge_vector = get_vector_from_to(v_xyz, v1_xyz);
        double this_edge_length = this_edge_vector.magnitude(); //already half of the original net's edge length
        //now, look at the edges of these two adjacent vertices until we find a pair that are neither parallel to the edges of this vertex, nor mutually parallel, and use them to identify an appropriate orthogonal direction
        bool non_parallel_direction_found = false;
        bool parallel_direction_found = false;
        XYZ dummy_edge_abc; dummy_edge_abc.x = 1001; dummy_edge_abc.y = 1001; dummy_edge_abc.z = 1001; //dummy data
        int num_edges_v1 = full_cell->vertices.at(v1).edges.size();
        int num_edges_v2 = full_cell->vertices.at(v2).edges.size();
        for(int j=0; j<num_edges_v1 && !non_parallel_direction_found; j++) {
          if(j!=e1) { //don't select the edge that connects to the 2-c vertex in question ...
            XYZ other_edge_1_end_abc = full_cell->vertices.at(v1).edges.at(j);
            XYZ other_edge_1_end_xyz = full_cell->abc_to_xyz_returning_XYZ(other_edge_1_end_abc);
            XYZ other_edge_1_vector = get_vector_from_to(v1_xyz, other_edge_1_end_xyz);
            //determine whether this edge points in a different direction, if it does, we can project the end point and use that direction as the reference
            double angle_between_degrees = 360.0*this_edge_vector.angle_between(other_edge_1_vector)/(2.0*PI);
            double acute_angle_between_degrees = min(angle_between_degrees, 180.0-angle_between_degrees);
if(verbose) printf("DEBUG: considering edge id %d of v1 which points to position %.3f %.3f %.3f (%.3f degrees angular difference)\n", j, other_edge_1_end_xyz.x, other_edge_1_end_xyz.y, other_edge_1_end_xyz.z, acute_angle_between_degrees);
            if(acute_angle_between_degrees>15.0) { //acceptable angle deviation
              XYZ other_edge_1_projection_xyz = project_onto_line(other_edge_1_end_xyz, v_xyz, v1_xyz);
              XYZ projection_1_vector_norm = get_vector_from_to(other_edge_1_end_xyz, other_edge_1_projection_xyz).unit();
if(verbose) printf("DEBUG: projection vector is from %.3f %.3f %.3f and norm is %.3f %.3f %.3f\n", other_edge_1_projection_xyz.x, other_edge_1_projection_xyz.y, other_edge_1_projection_xyz.z, projection_1_vector_norm.x, projection_1_vector_norm.y, projection_1_vector_norm.z);
              for(int k=0; k<num_edges_v2 && !non_parallel_direction_found; k++) {
                if(k!=e2) { //don't select the edge that connects to the 2-c vertex in question ...
                  XYZ other_edge_2_end_abc = full_cell->vertices.at(v2).edges.at(k);
                  XYZ other_edge_2_end_xyz = full_cell->abc_to_xyz_returning_XYZ(other_edge_2_end_abc);
                  XYZ other_edge_2_vector = get_vector_from_to(v2_xyz, other_edge_2_end_xyz);
                  //determine whether this edge points in a different direction, if it does, we can project the end point and use that direction as the reference
                  double angle_between_degrees = 360.0*this_edge_vector.angle_between(other_edge_2_vector)/(2.0*PI);
                  double acute_angle_between_degrees = min(angle_between_degrees, 180.0-angle_between_degrees);
if(verbose) printf("DEBUG: considering edge id %d of v2 which points to position %.3f %.3f %.3f (%.3f degrees angular difference)\n", k, other_edge_2_end_xyz.x, other_edge_2_end_xyz.y, other_edge_2_end_xyz.z, acute_angle_between_degrees);
                  if(acute_angle_between_degrees>15.0) { //acceptable angle deviation
                    //NOTE: need to set new v_xyz, and project using this and v2_xyz, otherwise we project onto the wrong line (this line may, by periodic boundary conditions, differ)
                    XYZ new_v_xyz = full_cell->abc_to_xyz_returning_XYZ(full_cell->vertices.at(v2).edges.at(e2));
if(verbose) printf("DEBUG: new_v_xyz (image of 'basic' 2c vertex) = %.3f %.3f %.3f\n", new_v_xyz.x, new_v_xyz.y, new_v_xyz.z);
                    XYZ other_edge_2_projection_xyz = project_onto_line(other_edge_2_end_xyz, new_v_xyz, v2_xyz);
                    XYZ projection_2_vector_norm = get_vector_from_to(other_edge_2_end_xyz, other_edge_2_projection_xyz).unit();
if(verbose) printf("DEBUG: projection vector is from %.3f %.3f %.3f and norm is %.3f %.3f %.3f\n", other_edge_2_projection_xyz.x, other_edge_2_projection_xyz.y, other_edge_2_projection_xyz.z, projection_2_vector_norm.x, projection_2_vector_norm.y, projection_2_vector_norm.z);
                    //at this point, we now have two normalised directions that are not parallel with the 2-c vertex's edges - but are they parallel with each other?
                    angle_between_degrees = 360.0*projection_1_vector_norm.angle_between(projection_2_vector_norm)/(2.0*PI);
                    acute_angle_between_degrees = min(angle_between_degrees, 180.0-angle_between_degrees);
                    if(acute_angle_between_degrees>15.0) { //acceptable angle deviation
                      //not parallel! easy case - find the midpoint vector, and reverse it
                      XYZ dummy_vector_norm = (projection_1_vector_norm+projection_2_vector_norm).unit();
                      XYZ dummy_edge_xyz = v_xyz+dummy_vector_norm.scale(this_edge_length);
                      dummy_edge_abc = full_cell->xyz_to_abc_returning_XYZ(dummy_edge_xyz);
if(verbose) printf("DEBUG: non-parallel combo found: %.3f %.3f %.3f and %.3f %.3f %.3f leading to %.3f %.3f %.3f - with edge length of %.3f and a vector position %.3f %.3f %.3f, the edge ends at %.3f %.3f %.3f (in abc, %.3f %.3f %.3f)\n", projection_1_vector_norm.x, projection_1_vector_norm.y, projection_1_vector_norm.z, projection_2_vector_norm.x, projection_2_vector_norm.y, projection_2_vector_norm.z, dummy_vector_norm.x, dummy_vector_norm.y, dummy_vector_norm.z, this_edge_length, v_xyz.x, v_xyz.y, v_xyz.z, dummy_edge_xyz.x, dummy_edge_xyz.y, dummy_edge_xyz.z, dummy_edge_abc.x, dummy_edge_abc.y, dummy_edge_abc.z);
                      non_parallel_direction_found = true;
                    } else if(!parallel_direction_found) {
                      //else parallel; harder case - take the cross product of either, say 1; save one of these only, in case we do not find a parallel one
                      XYZ dummy_vector_norm = (this_edge_vector.unit().cross(projection_1_vector_norm)).unit();
                      XYZ dummy_edge_xyz = v_xyz+dummy_vector_norm.scale(this_edge_length);
                      dummy_edge_abc = full_cell->xyz_to_abc_returning_XYZ(dummy_edge_xyz);
if(verbose) printf("DEBUG: parallel combo found: %.3f %.3f %.3f and %.3f %.3f %.3f leading to %.3f %.3f %.3f - with edge length of %.3f and a vector position %.3f %.3f %.3f, the edge ends at %.3f %.3f %.3f (in abc, %.3f %.3f %.3f)\n", projection_1_vector_norm.x, projection_1_vector_norm.y, projection_1_vector_norm.z, projection_2_vector_norm.x, projection_2_vector_norm.y, projection_2_vector_norm.z, dummy_vector_norm.x, dummy_vector_norm.y, dummy_vector_norm.z, this_edge_length, v_xyz.x, v_xyz.y, v_xyz.z, dummy_edge_xyz.x, dummy_edge_xyz.y, dummy_edge_xyz.z, dummy_edge_abc.x, dummy_edge_abc.y, dummy_edge_abc.z);
                      parallel_direction_found = true;
                    }
                  }
                }
              }
            }
          }
        }
        //at this point we know the selected direction, and can implement it
        if(dummy_edge_abc.x>1000 && dummy_edge_abc.y>1000 && dummy_edge_abc.z>1000) {
          printf("ERROR: could not find a candidate orthogonal direction with which to orient full cell 2-c vertex %d's dummy edge\n", i);
          exit(EXIT_FAILURE);
        } else if(verbose) {
          printf("DEBUG: orthogonal position abc chosen to be %.3f %.3f %.3f\n", dummy_edge_abc.x, dummy_edge_abc.y, dummy_edge_abc.z);
        }
        //so update the full cell vertex with the new data, and store the basic vertex info locally only
        full_cell->vertices.at(i).dummy_edges.push_back(dummy_edge_abc);
        basic_cell->vertices.at(basic_ID).dummy_edges.push_back(dummy_edge_abc);
      } else { //else this vertex is a symmetry image of another - in that case we can use this info to assign the orientation based on that of the underlying vertex
        XYZ test_dummy_e = basic_cell->vertices.at(basic_ID).dummy_edges.at(0);
        vector<XYZ> equiv_dummy_e = GetEquivalentPositions(basic_cell->sym_ID,&test_dummy_e);
/*
        XYZ here_uc = trans_to_origuc(v.abc);
        XYZ shift = here_uc - v.abc;
        full_cell->vertices.at(i).dummy_edges.push_back(equiv_dummy_e.at(sym_op)+shift); //this is nice - we know that we are working on symmetric vertex image with index j - so we can just keep the corresponding edge image - shifting it to unit cell by the same amount that we used for the vertex!
*/
        full_cell->vertices.at(i).dummy_edges.push_back(equiv_dummy_e.at(sym_op)); //this is nice - we know that we are working on symmetric vertex image with index j - so we can just keep the corresponding edge image - shifting it to unit cell by the same amount that we used for the vertex!
      }
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x348, %rsp            # imm = 0x348
movq %rdx, %r13
xorpd %xmm0, %xmm0
leaq 0x140(%rsp), %r12
andq $0x0, 0x10(%r12)
movapd %xmm0, (%r12)
movq 0x8(%rdx), %rax
subq (%rdx), %rax
pushq $0x1c
popq %rcx
cqto
idivq %rcx
movq %rax, %r8
movl $0x3c0, %r9d            # imm = 0x3C0
leaq (%rsi,%r9), %rax
movq %rax, 0x60(%rsp)
movq 0x3c8(%rsi), %rax
subq 0x3c0(%rsi), %rax
pushq $0x70
popq %rcx
cqto
idivq %rcx
movq %rax, %r14
leaq 0x408(%rsi), %rax
movq %rax, 0x170(%rsp)
movq %rsi, 0x58(%rsp)
leaq 0x420(%rsi), %rax
movq %rax, 0x168(%rsp)
movq %rdi, 0x160(%rsp)
addq %rdi, %r9
movq %r9, 0xc8(%rsp)
xorl %ebp, %ebp
testl %r8d, %r8d
cmovlel %ebp, %r8d
movq %r8, 0x178(%rsp)
testl %r14d, %r14d
cmovlel %ebp, %r14d
movq %r13, 0x158(%rsp)
movq %r14, 0xc0(%rsp)
cmpq %r14, %rbp
je 0x49f04
movq 0x60(%rsp), %rdi
movq %rbp, %rsi
callq 0x4b63c
leaq 0x2a8(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4b65a
leaq 0x128(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq %rbx, %rdx
callq 0x3f1b2
movq 0x2d0(%rsp), %rax
subq 0x2c8(%rsp), %rax
cqto
pushq $0x18
popq %rcx
idivq %rcx
cmpl $0x2, %eax
jne 0x49eef
movq 0x170(%rsp), %rdi
movq %rbp, %rsi
callq 0xac00
movl (%rax), %eax
movl %eax, 0x54(%rsp)
movq 0x140(%rsp), %rbx
movq 0x148(%rsp), %r14
movq 0x168(%rsp), %rdi
movq %rbp, %rsi
callq 0xac00
subq %rbx, %r14
movslq (%rax), %rbx
shrq $0x2, %r14
movslq %r14d, %r14
xorl %r15d, %r15d
xorl %eax, %eax
cmpq %r14, %r15
jge 0x49646
testb $0x1, %al
jne 0x49646
movq %r12, %rdi
movq %r15, %rsi
callq 0xac00
movl (%rax), %eax
cmpl 0x54(%rsp), %eax
sete %al
incq %r15
jmp 0x49624
testb $0x1, %al
je 0x496f3
movslq 0x54(%rsp), %rsi
movq 0xc8(%rsp), %rdi
callq 0x4b63c
movq 0xc0(%rsp), %r14
addq $0x38, %rax
movq %rax, %rdi
xorl %esi, %esi
callq 0x4b6d6
movq 0x10(%rax), %rcx
movq %rcx, 0xb0(%rsp)
movupd (%rax), %xmm0
movapd %xmm0, 0xa0(%rsp)
movq 0x160(%rsp), %rax
movl 0x438(%rax), %esi
leaq 0xe0(%rsp), %rdi
leaq 0xa0(%rsp), %rdx
callq 0x7a2a1
movq 0x60(%rsp), %rdi
movq %rbp, %rsi
callq 0x4b63c
movq %rax, %r15
leaq 0xe0(%rsp), %rdi
movq %rbx, %rsi
callq 0x4b6d6
addq $0x38, %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x4beaa
leaq 0xe0(%rsp), %rdi
callq 0xb132
jmp 0x49eef
movq %r12, %rdi
leaq 0x54(%rsp), %rsi
callq 0x9434
movq %rbp, 0x68(%rsp)
testl %ebx, %ebx
jne 0x49f23
xorl %ebx, %ebx
pushq $-0x1
popq %r12
movl %r12d, %r14d
movl %r12d, %r15d
movl %r12d, %ebp
cmpq %rbx, 0x178(%rsp)
je 0x49791
cmpl $-0x1, %r12d
je 0x49731
cmpl $-0x1, %ebp
jne 0x49791
movq %r13, %rdi
movq %rbx, %rsi
callq 0x4b9ca
movl (%rax), %ecx
movl 0x4(%rax), %edx
movq 0x68(%rsp), %rsi
cmpq %rcx, %rsi
jne 0x49762
movl 0xc(%rax), %eax
cmpl $-0x1, %r12d
je 0x4977e
cmpl $-0x1, %ebp
cmovel %eax, %r15d
cmovnel %ebp, %edx
movl %edx, %ebp
jmp 0x4978c
cmpq %rdx, %rsi
jne 0x4978c
movl 0x8(%rax), %eax
cmpl $-0x1, %r12d
je 0x49786
cmpl $-0x1, %ebp
cmovel %eax, %r15d
cmovnel %ebp, %ecx
movl %ecx, %ebp
jmp 0x4978c
movl %eax, %r14d
movl %edx, %r12d
jmp 0x4978c
movl %eax, %r14d
movl %ecx, %r12d
incq %rbx
jmp 0x4971c
cmpl $-0x1, %r12d
je 0x49f3e
cmpl $-0x1, %ebp
je 0x49f3e
movslq %r12d, %rsi
movq 0x60(%rsp), %rbx
movq %rbx, %rdi
movq %rsi, 0xd0(%rsp)
callq 0x4b63c
leaq 0xa0(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq %rax, %rdx
callq 0x3f1b2
movslq %ebp, %rsi
movq %rbx, %rdi
movq %rsi, 0x98(%rsp)
callq 0x4b63c
leaq 0x218(%rsp), %r12
leaq 0xe0(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq %rax, %rdx
callq 0x3f1b2
movq 0xb0(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0xa0(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x138(%rsp), %rax
movq %rax, 0x10(%rsp)
movupd 0x128(%rsp), %xmm0
movupd %xmm0, (%rsp)
movq %r12, %rdi
callq 0x64351
movq %r12, %rdi
callq 0x63758
movsd %xmm0, 0xd8(%rsp)
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
xorps %xmm2, %xmm2
leaq 0x70(%rsp), %rdi
callq 0x6402e
movapd 0xb7ef4(%rip), %xmm0    # 0x101760
movapd %xmm0, 0x70(%rsp)
movabsq $0x408f480000000000, %rax # imm = 0x408F480000000000
movq %rax, 0x80(%rsp)
movq %rbx, %rdi
movq 0xd0(%rsp), %rsi
callq 0x4b63c
movq %rbx, %rdi
movq 0x20(%rax), %r12
movq 0x28(%rax), %rbx
movq 0x98(%rsp), %rsi
callq 0x4b63c
movq %rax, %rcx
subq %r12, %rbx
movq %rbx, %rax
cqto
pushq $0x18
popq %rdi
idivq %rdi
movq %rax, %rsi
movq 0x28(%rcx), %rax
subq 0x20(%rcx), %rax
cqto
idivq %rdi
movslq %r15d, %rcx
movslq %eax, %rbx
movq %rcx, 0x190(%rsp)
movl %ecx, %r12d
movslq %esi, %rax
movq %rax, 0x188(%rsp)
movl %r14d, %eax
movq %rax, 0x180(%rsp)
xorl %eax, %eax
xorl %r14d, %r14d
movq $0x0, 0x88(%rsp)
movq %rax, 0x90(%rsp)
cmpq 0x188(%rsp), %rax
jge 0x49e5c
testb $0x1, %r14b
jne 0x49e5c
movq 0x90(%rsp), %rax
cmpq 0x180(%rsp), %rax
je 0x49e4c
movq 0x60(%rsp), %rdi
movq 0xd0(%rsp), %rsi
callq 0x4b63c
addq $0x20, %rax
movq %rax, %rdi
movq 0x90(%rsp), %rsi
callq 0x4b6d6
movq 0x10(%rax), %rcx
movq %rcx, 0x240(%rsp)
movupd (%rax), %xmm0
movapd %xmm0, 0x230(%rsp)
leaq 0x110(%rsp), %rdi
movq 0x58(%rsp), %rsi
leaq 0x230(%rsp), %rdx
callq 0x3f1b2
movq 0x120(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0x110(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x10(%rsp)
movupd 0xa0(%rsp), %xmm0
movupd %xmm0, (%rsp)
leaq 0x330(%rsp), %r15
movq %r15, %rdi
callq 0x64351
leaq 0x218(%rsp), %rdi
movq %r15, %rsi
callq 0x641b2
mulsd 0xb30ff(%rip), %xmm0    # 0xfcaf0
divsd 0xb30ff(%rip), %xmm0    # 0xfcaf8
movsd 0xb7d07(%rip), %xmm1    # 0x101708
subsd %xmm0, %xmm1
minsd %xmm0, %xmm1
ucomisd 0xb7cc7(%rip), %xmm1    # 0x1016d8
jbe 0x49e4c
movq 0xb0(%rsp), %rax
movq %rax, 0x40(%rsp)
movups 0xa0(%rsp), %xmm0
movups %xmm0, 0x30(%rsp)
movq 0x138(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0x128(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x120(%rsp), %rax
movq %rax, 0x10(%rsp)
movupd 0x110(%rsp), %xmm0
movupd %xmm0, (%rsp)
leaq 0x278(%rsp), %rdi
callq 0x6439e
movq 0x288(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0x278(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x120(%rsp), %rax
movq %rax, 0x10(%rsp)
movupd 0x110(%rsp), %xmm0
movupd %xmm0, (%rsp)
leaq 0x1b0(%rsp), %r15
movq %r15, %rdi
callq 0x64351
leaq 0x200(%rsp), %rdi
movq %r15, %rsi
callq 0x640fc
xorl %r15d, %r15d
cmpq %rbx, %r15
jge 0x49e4c
testb $0x1, %r14b
jne 0x49e4c
cmpq %r15, %r12
je 0x49e44
movq 0x60(%rsp), %rdi
movq 0x98(%rsp), %rsi
callq 0x4b63c
addq $0x20, %rax
movq %rax, %rdi
movq %r15, %rsi
callq 0x4b6d6
movq 0x10(%rax), %rcx
movq %rcx, 0x1c0(%rsp)
movupd (%rax), %xmm0
movapd %xmm0, 0x1b0(%rsp)
leaq 0xf8(%rsp), %rdi
movq 0x58(%rsp), %rsi
leaq 0x1b0(%rsp), %rdx
callq 0x3f1b2
movq 0x108(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0xf8(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0xf0(%rsp), %rax
movq %rax, 0x10(%rsp)
movupd 0xe0(%rsp), %xmm0
movupd %xmm0, (%rsp)
leaq 0x318(%rsp), %r13
movq %r13, %rdi
callq 0x64351
leaq 0x218(%rsp), %rdi
movq %r13, %rsi
callq 0x641b2
mulsd 0xb2f58(%rip), %xmm0    # 0xfcaf0
divsd 0xb2f58(%rip), %xmm0    # 0xfcaf8
movsd 0xb7b60(%rip), %xmm1    # 0x101708
subsd %xmm0, %xmm1
minsd %xmm0, %xmm1
ucomisd 0xb7b20(%rip), %xmm1    # 0x1016d8
jbe 0x49e44
movq 0x60(%rsp), %rdi
movq 0x98(%rsp), %rsi
callq 0x4b63c
addq $0x20, %rax
movq %rax, %rdi
movq 0x190(%rsp), %rsi
callq 0x4b6d6
leaq 0x260(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq %rax, %rdx
callq 0x3f1b2
movq 0xf0(%rsp), %rax
movq %rax, 0x40(%rsp)
movups 0xe0(%rsp), %xmm0
movups %xmm0, 0x30(%rsp)
movq 0x270(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0x260(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x108(%rsp), %rax
movq %rax, 0x10(%rsp)
movupd 0xf8(%rsp), %xmm0
movupd %xmm0, (%rsp)
leaq 0x248(%rsp), %rdi
callq 0x6439e
movq 0x258(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0x248(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x108(%rsp), %rax
movq %rax, 0x10(%rsp)
movupd 0xf8(%rsp), %xmm0
movupd %xmm0, (%rsp)
leaq 0x1e8(%rsp), %r13
movq %r13, %rdi
callq 0x64351
leaq 0x290(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
callq 0x640fc
leaq 0x200(%rsp), %rdi
movq %rbp, %rsi
callq 0x641b2
mulsd 0xb2e2b(%rip), %xmm0    # 0xfcaf0
divsd 0xb2e2b(%rip), %xmm0    # 0xfcaf8
movsd 0xb7a33(%rip), %xmm1    # 0x101708
subsd %xmm0, %xmm1
minsd %xmm0, %xmm1
ucomisd 0xb79f3(%rip), %xmm1    # 0x1016d8
jbe 0x49d84
leaq 0x1d0(%rsp), %r13
movq %r13, %rdi
leaq 0x200(%rsp), %rsi
leaq 0x290(%rsp), %rdx
callq 0x642d2
leaq 0x1e8(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0x640fc
leaq 0x198(%rsp), %rdi
movq %r14, %rsi
movq %rdi, %r14
movsd 0xd8(%rsp), %xmm0
callq 0x640ba
movq %r13, %rdi
leaq 0x128(%rsp), %rsi
movq %r14, %rdx
callq 0x642d2
movq %r14, %rdi
movq 0x58(%rsp), %rsi
movq %r13, %rdx
callq 0x3e082
movq 0x1a8(%rsp), %rax
movq %rax, 0x80(%rsp)
movupd 0x198(%rsp), %xmm0
movapd %xmm0, 0x70(%rsp)
movb $0x1, %r14b
jmp 0x49e44
testb $0x1, 0x88(%rsp)
jne 0x49e3a
leaq 0x198(%rsp), %rbp
movq %rbp, %rdi
leaq 0x218(%rsp), %rsi
callq 0x640fc
leaq 0x1d0(%rsp), %rdi
movq %rbp, %rsi
leaq 0x200(%rsp), %rdx
callq 0x64146
leaq 0x1e8(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x640fc
movq %rbp, %rdi
leaq 0x1e8(%rsp), %rsi
movsd 0xd8(%rsp), %xmm0
callq 0x640ba
leaq 0x1d0(%rsp), %r13
movq %r13, %rdi
leaq 0x128(%rsp), %rsi
movq %rbp, %rdx
callq 0x642d2
movq %rbp, %rdi
movq 0x58(%rsp), %rsi
movq %r13, %rdx
callq 0x3e082
movq 0x1a8(%rsp), %rax
movq %rax, 0x80(%rsp)
movupd 0x198(%rsp), %xmm0
movapd %xmm0, 0x70(%rsp)
movb $0x1, %al
movq %rax, 0x88(%rsp)
incq %r15
jmp 0x49acb
movq 0x90(%rsp), %rax
incq %rax
jmp 0x49905
movsd 0x70(%rsp), %xmm0
movsd 0xb78a6(%rip), %xmm1    # 0x101710
ucomisd %xmm1, %xmm0
jbe 0x49e8f
movsd 0x78(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x49e8f
movsd 0x80(%rsp), %xmm0
ucomisd %xmm1, %xmm0
ja 0x49f47
movq 0x60(%rsp), %rdi
movq 0x68(%rsp), %rsi
callq 0x4b63c
movq 0x158(%rsp), %r13
addq $0x38, %rax
movq %rax, %rdi
leaq 0x70(%rsp), %rsi
callq 0x4beaa
movslq 0x54(%rsp), %rsi
movq 0xc8(%rsp), %rdi
callq 0x4b63c
addq $0x38, %rax
movq %rax, %rdi
leaq 0x70(%rsp), %rsi
callq 0x4beaa
leaq 0x140(%rsp), %r12
movq 0x68(%rsp), %rbp
movq 0xc0(%rsp), %r14
leaq 0x2a8(%rsp), %rdi
callq 0xb1ba
incq %rbp
jmp 0x4957d
leaq 0x140(%rsp), %rdi
callq 0xb290
addq $0x348, %rsp            # imm = 0x348
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x54(%rsp), %edx
leaq 0xb893f(%rip), %rdi     # 0x10286d
movq 0x68(%rsp), %rsi
movl %ebx, %ecx
xorl %eax, %eax
callq 0x4050
jmp 0x49f5a
leaq 0xb89bf(%rip), %rdi     # 0x102904
jmp 0x49f4e
leaq 0xb8a07(%rip), %rdi     # 0x102955
movq 0x68(%rsp), %rsi
xorl %eax, %eax
callq 0x4050
pushq $0x1
popq %rdi
callq 0x524c
jmp 0x49fbb
jmp 0x49fbb
jmp 0x49fbb
jmp 0x49fbb
jmp 0x49fbb
jmp 0x49fbb
jmp 0x49fbb
jmp 0x49fbb
jmp 0x49fbb
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0xb132
jmp 0x49fbe
jmp 0x49fbb
jmp 0x49fbb
jmp 0x49fbb
jmp 0x49fbb
movq %rax, %rbx
jmp 0x49fcb
jmp 0x49fbb
jmp 0x49fbb
jmp 0x49fbb
jmp 0x49fbb
jmp 0x49fbb
jmp 0x49fbb
jmp 0x49fbb
jmp 0x49fbb
jmp 0x49fbb
jmp 0x49fbb
jmp 0x49fbb
jmp 0x49fbb
jmp 0x49fbb
jmp 0x49fbb
jmp 0x49fbb
jmp 0x49fbb
jmp 0x49fbb
jmp 0x49fbb
jmp 0x49fbb
jmp 0x49fbb
movq %rax, %rbx
leaq 0x2a8(%rsp), %rdi
callq 0xb1ba
leaq 0x140(%rsp), %rdi
callq 0xb290
movq %rbx, %rdi
callq 0x4780