// File: Luthaf[P]zeopp/networkio.cc
// Function: readARCFile(char*, ATOM_NETWORK*, bool)
bool readARCFile(char *filename, ATOM_NETWORK *cell, bool radial){
  FILE * input;
  input = fopen(filename, "r");
  int numAtoms=0;

  if(input==NULL){
    cout << "\n" << "Failed to open .arc input file " << filename << "\n";
    cout << "Exiting ..." << "\n";
//    exit(1);
    return false;
  }
  else{
    cout << "Reading input file " << filename << "\n";

    // Parse down to the FINAL GEOMETRY OBTAINED line
    char this_line[500];
    char found_final = 0;
    while(found_final == 0) {
      if(fgets(this_line, 500, input)!=NULL) {
        char str1[100], str2[100], str3[100];
        int status = sscanf(this_line, "%s %s %s", str1, str2, str3);
        if(status!=-1) {
          if(strcmp(str1,"FINAL")==0 && strcmp(str2,"GEOMETRY")==0 && strcmp(str3,"OBTAINED")==0) {
            found_final = 1;
          }
        }
      } else {
        printf("ERROR: finished parsing ARC file before finding geometry section\n");
//        exit(EXIT_FAILURE);
        fclose(input);
        return false;
      }
    }

    // Now parse following lines, trying to extract atom info
    int found_atoms = 0;
    double x, y, z, charge;
    char element[100], str1[100], str2[100], str3[100];
    while(found_atoms==0) {
      if(fgets(this_line, 500, input)!=NULL) {
        int status = sscanf(this_line, "%s %lf %s %lf %s %lf %s %lf", element, &x, str1, &y, str2, &z, str3, &charge);
        if(status==8) { //i.e. exactly 8 fields are required to be read
          found_atoms = 1;
        }
      } else {
        printf("ERROR: finished parsing ARC file before finding individual atom information\n");
//        exit(EXIT_FAILURE);
        fclose(input);
        return false;
      }
    }

    // At this point, we have the first atom info in memory
    ATOM newAtom;
    while(found_atoms==1) {
      //save previously discovered atom data - just xyz data for now
      newAtom.x = x;
      newAtom.y = y;
      newAtom.z = z;
      newAtom.type = string(element);
      newAtom.radius = lookupRadius(newAtom.type, radial);
      newAtom.charge = charge;
      cell->atoms.push_back(newAtom);
      numAtoms++;
      //try to find next atom data
      if(fgets(this_line, 500, input)!=NULL) {
        int status = sscanf(this_line, "%s %lf %s %lf %s %lf %s %lf", element, &x, str1, &y, str2, &z, str3, &charge);
        if(status!=8) found_atoms = 0; //if we can't read all 8 fields, we have, presumably, reached the unit cell params
      } else {
        printf("ERROR: finished parsing ARC file before finding unit cell info\n");
//        exit(EXIT_FAILURE);
        fclose(input);
        return false;
      }
    }

    // Now we have read all the atoms, we read the unit cell vectors
    XYZ v_a, v_b, v_c;
    for(int i=0; i<3; i++) {
      if(i==0) {
        v_a.x = x; v_a.y = y; v_a.z = z;
      } else if(i==1) {
        v_b.x = x; v_b.y = y; v_b.z = z;
      } else if(i==2) {
        v_c.x = x; v_c.y = y; v_c.z = z;
      }
      if(i!=2) {
        if(fgets(this_line, 500, input)!=NULL) {
          int status = sscanf(this_line, "%s %lf %s %lf %s %lf %s", element, &x, str1, &y, str2, &z, str3);
          if(status!=7) { //didn't read exactly 7 fields
            printf("ERROR: could not read exactly three unit cell vectors\n");
//            exit(EXIT_FAILURE);
            fclose(input);
            return false;
          }
        }
      }
    }
    cell->numAtoms = numAtoms;
    fclose(input);

    // Set up cell
    cell->v_a = v_a;
    cell->v_b = v_b;
    cell->v_c = v_c;
    double alpha = v_b.angle_between(v_c);
    double beta = v_a.angle_between(v_c);
    double gamma = v_a.angle_between(v_b);
    cell->alpha = alpha*360.0/(2.0*PI);
    cell->beta = beta*360.0/(2.0*PI);
    cell->gamma = gamma*360.0/(2.0*PI); //required since it expects to store degrees
    cell->a = v_a.magnitude();
    cell->b = v_b.magnitude();
    cell->c = v_c.magnitude();
    cell->initMatrices();
    cell->name = filename;
    cell->name.erase(cell->name.end()-4, cell->name.end());

//   cout << "number of atoms read " << numAtoms << "\n";

    // Convert atom coords to abc and update the xyz values to be within the UC
    for(int i=0; i<numAtoms; i++) {
      Point newCoords = cell->xyz_to_abc(cell->atoms.at(i).x,cell->atoms.at(i).y,cell->atoms.at(i).z);
      cell->atoms.at(i).a_coord = trans_to_origuc(newCoords[0]); cell->atoms.at(i).b_coord = trans_to_origuc(newCoords[1]); cell->atoms.at(i).c_coord = trans_to_origuc(newCoords[2]);
      newCoords = cell->abc_to_xyz(cell->atoms.at(i).a_coord,cell->atoms.at(i).b_coord,cell->atoms.at(i).c_coord);
      cell->atoms.at(i).x = newCoords[0]; cell->atoms.at(i).y = newCoords[1]; cell->atoms.at(i).z = newCoords[2];
      //cout << i << "  " << cell->atoms.at(i).type << "  " << newCoords[0] << "  " << newCoords[1] << "  " << newCoords[2] <<"\n";
    }
  }
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x8b8, %rsp            # imm = 0x8B8
movb %dl, %al
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
andb $0x1, %al
movb %al, -0x21(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x1ba400(%rip), %rsi    # 0x208e96
callq 0x5650
movq %rax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x4eb15
movq 0x22450c(%rip), %rdi    # 0x272fc0
leaq 0x1aab6a(%rip), %rsi    # 0x1f9625
callq 0x5540
movq %rax, %rdi
leaq 0x1a46ae(%rip), %rsi    # 0x1f3178
callq 0x5540
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x5540
movq %rax, %rdi
leaq 0x1aab40(%rip), %rsi    # 0x1f9625
callq 0x5540
movq 0x2244cf(%rip), %rdi    # 0x272fc0
leaq 0x1a410b(%rip), %rsi    # 0x1f2c03
callq 0x5540
movq %rax, %rdi
leaq 0x1aab1e(%rip), %rsi    # 0x1f9625
callq 0x5540
movb $0x0, -0x9(%rbp)
jmp 0x4f834
movq 0x2244a4(%rip), %rdi    # 0x272fc0
leaq 0x1a4675(%rip), %rsi    # 0x1f3198
callq 0x5540
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x5540
movq %rax, %rdi
leaq 0x1aaae7(%rip), %rsi    # 0x1f9625
callq 0x5540
movb $0x0, -0x231(%rbp)
movsbl -0x231(%rbp), %eax
cmpl $0x0, %eax
jne 0x4ec2a
leaq -0x230(%rbp), %rdi
movq -0x30(%rbp), %rdx
movl $0x1f4, %esi            # imm = 0x1F4
callq 0x57e0
cmpq $0x0, %rax
je 0x4ec05
leaq -0x230(%rbp), %rdi
leaq -0x2a0(%rbp), %rdx
leaq -0x310(%rbp), %rcx
leaq -0x380(%rbp), %r8
leaq 0x1a4610(%rip), %rsi    # 0x1f31ac
movb $0x0, %al
callq 0x5520
movl %eax, -0x384(%rbp)
cmpl $-0x1, -0x384(%rbp)
je 0x4ec03
leaq -0x2a0(%rbp), %rdi
leaq 0x1a45f5(%rip), %rsi    # 0x1f31b5
callq 0x5730
cmpl $0x0, %eax
jne 0x4ec01
leaq -0x310(%rbp), %rdi
leaq 0x1a45e3(%rip), %rsi    # 0x1f31bb
callq 0x5730
cmpl $0x0, %eax
jne 0x4ec01
leaq -0x380(%rbp), %rdi
leaq 0x1a45d4(%rip), %rsi    # 0x1f31c4
callq 0x5730
cmpl $0x0, %eax
jne 0x4ec01
movb $0x1, -0x231(%rbp)
jmp 0x4ec03
jmp 0x4ec25
leaq 0x1a45c1(%rip), %rdi    # 0x1f31cd
movb $0x0, %al
callq 0x5070
movq -0x30(%rbp), %rdi
callq 0x5550
movb $0x0, -0x9(%rbp)
jmp 0x4f834
jmp 0x4eb4a
movl $0x0, -0x388(%rbp)
cmpl $0x0, -0x388(%rbp)
jne 0x4ecfc
leaq -0x230(%rbp), %rdi
movq -0x30(%rbp), %rdx
movl $0x1f4, %esi            # imm = 0x1F4
callq 0x57e0
cmpq $0x0, %rax
je 0x4ecd7
leaq -0x230(%rbp), %rdi
leaq -0x410(%rbp), %rdx
leaq -0x480(%rbp), %r8
leaq -0x4f0(%rbp), %rbx
leaq -0x560(%rbp), %r10
leaq 0x1a4589(%rip), %rsi    # 0x1f320f
leaq -0x390(%rbp), %rcx
leaq -0x398(%rbp), %r9
leaq -0x3a0(%rbp), %r11
leaq -0x3a8(%rbp), %rax
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movb $0x0, %al
callq 0x5520
movl %eax, -0x564(%rbp)
cmpl $0x8, -0x564(%rbp)
jne 0x4ecd5
movl $0x1, -0x388(%rbp)
jmp 0x4ecf7
leaq 0x1a454d(%rip), %rdi    # 0x1f322b
movb $0x0, %al
callq 0x5070
movq -0x30(%rbp), %rdi
callq 0x5550
movb $0x0, -0x9(%rbp)
jmp 0x4f834
jmp 0x4ec34
leaq -0x600(%rbp), %rdi
callq 0x954b0
cmpl $0x1, -0x388(%rbp)
jne 0x4ef68
movsd -0x390(%rbp), %xmm0
movsd %xmm0, -0x600(%rbp)
movsd -0x398(%rbp), %xmm0
movsd %xmm0, -0x5f8(%rbp)
movsd -0x3a0(%rbp), %xmm0
movsd %xmm0, -0x5f0(%rbp)
leaq -0x621(%rbp), %rdi
movq %rdi, -0x740(%rbp)
callq 0x5900
movq -0x740(%rbp), %rdx
leaq -0x620(%rbp), %rdi
leaq -0x410(%rbp), %rsi
callq 0x47530
jmp 0x4ed74
leaq -0x5c0(%rbp), %rdi
movq %rdi, -0x748(%rbp)
leaq -0x620(%rbp), %rsi
movq %rsi, -0x750(%rbp)
callq 0x5680
movq -0x750(%rbp), %rdi
callq 0x5300
leaq -0x621(%rbp), %rdi
callq 0x55d0
movq -0x748(%rbp), %rsi
leaq -0x658(%rbp), %rdi
callq 0x5220
jmp 0x4edc2
movzbl -0x21(%rbp), %esi
andl $0x1, %esi
leaq -0x658(%rbp), %rdi
callq 0x466e0
movsd %xmm0, -0x758(%rbp)
jmp 0x4eddf
movsd -0x758(%rbp), %xmm0
movsd %xmm0, -0x5d0(%rbp)
leaq -0x658(%rbp), %rdi
callq 0x5300
movsd -0x3a8(%rbp), %xmm0
movsd %xmm0, -0x578(%rbp)
movq -0x20(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
leaq -0x600(%rbp), %rsi
callq 0xf190
jmp 0x4ee24
movl -0x34(%rbp), %eax
incl %eax
movl %eax, -0x34(%rbp)
movq -0x30(%rbp), %rdx
leaq -0x230(%rbp), %rdi
movl $0x1f4, %esi            # imm = 0x1F4
callq 0x57e0
movq %rax, -0x760(%rbp)
jmp 0x4ee4a
movq -0x760(%rbp), %rax
cmpq $0x0, %rax
je 0x4ef35
leaq -0x230(%rbp), %rdi
leaq -0x410(%rbp), %rdx
leaq -0x480(%rbp), %r8
leaq -0x4f0(%rbp), %rbx
leaq -0x560(%rbp), %r10
leaq 0x1a438a(%rip), %rsi    # 0x1f320f
leaq -0x390(%rbp), %rcx
leaq -0x398(%rbp), %r9
leaq -0x3a0(%rbp), %r11
leaq -0x3a8(%rbp), %rax
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movb $0x0, %al
callq 0x5520
movl %eax, -0x65c(%rbp)
cmpl $0x8, -0x65c(%rbp)
je 0x4ef33
movl $0x0, -0x388(%rbp)
jmp 0x4ef33
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x630(%rbp)
movl %eax, -0x634(%rbp)
leaq -0x621(%rbp), %rdi
callq 0x55d0
jmp 0x4f822
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x630(%rbp)
movl %eax, -0x634(%rbp)
jmp 0x4f822
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x630(%rbp)
movl %eax, -0x634(%rbp)
leaq -0x658(%rbp), %rdi
callq 0x5300
jmp 0x4f822
jmp 0x4ef63
leaq 0x1a433c(%rip), %rdi    # 0x1f3278
xorl %eax, %eax
callq 0x5070
jmp 0x4ef45
movq -0x30(%rbp), %rdi
callq 0x5550
jmp 0x4ef50
movb $0x0, -0x9(%rbp)
movl $0x1, -0x660(%rbp)
jmp 0x4f806
jmp 0x4ed08
leaq -0x678(%rbp), %rdi
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0xea8e0
jmp 0x4ef7f
leaq -0x690(%rbp), %rdi
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0xea8e0
jmp 0x4ef96
leaq -0x6a8(%rbp), %rdi
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0xea8e0
jmp 0x4efad
movl $0x0, -0x6ac(%rbp)
cmpl $0x3, -0x6ac(%rbp)
jge 0x4f15e
cmpl $0x0, -0x6ac(%rbp)
jne 0x4efff
movsd -0x390(%rbp), %xmm0
movsd %xmm0, -0x678(%rbp)
movsd -0x398(%rbp), %xmm0
movsd %xmm0, -0x670(%rbp)
movsd -0x3a0(%rbp), %xmm0
movsd %xmm0, -0x668(%rbp)
jmp 0x4f077
cmpl $0x1, -0x6ac(%rbp)
jne 0x4f03a
movsd -0x390(%rbp), %xmm0
movsd %xmm0, -0x690(%rbp)
movsd -0x398(%rbp), %xmm0
movsd %xmm0, -0x688(%rbp)
movsd -0x3a0(%rbp), %xmm0
movsd %xmm0, -0x680(%rbp)
jmp 0x4f075
cmpl $0x2, -0x6ac(%rbp)
jne 0x4f073
movsd -0x390(%rbp), %xmm0
movsd %xmm0, -0x6a8(%rbp)
movsd -0x398(%rbp), %xmm0
movsd %xmm0, -0x6a0(%rbp)
movsd -0x3a0(%rbp), %xmm0
movsd %xmm0, -0x698(%rbp)
jmp 0x4f075
jmp 0x4f077
cmpl $0x2, -0x6ac(%rbp)
je 0x4f148
movq -0x30(%rbp), %rdx
leaq -0x230(%rbp), %rdi
movl $0x1f4, %esi            # imm = 0x1F4
callq 0x57e0
movq %rax, -0x768(%rbp)
jmp 0x4f0a2
movq -0x768(%rbp), %rax
cmpq $0x0, %rax
je 0x4f146
leaq -0x230(%rbp), %rdi
leaq -0x410(%rbp), %rdx
leaq -0x480(%rbp), %r8
leaq -0x4f0(%rbp), %r11
leaq -0x560(%rbp), %rax
leaq 0x1a41db(%rip), %rsi    # 0x1f32b8
leaq -0x390(%rbp), %rcx
leaq -0x398(%rbp), %r9
leaq -0x3a0(%rbp), %r10
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movb $0x0, %al
callq 0x5520
movl %eax, -0x6b0(%rbp)
cmpl $0x7, -0x6b0(%rbp)
je 0x4f144
leaq 0x1a41b3(%rip), %rdi    # 0x1f32d0
xorl %eax, %eax
callq 0x5070
jmp 0x4f126
movq -0x30(%rbp), %rdi
callq 0x5550
jmp 0x4f131
movb $0x0, -0x9(%rbp)
movl $0x1, -0x660(%rbp)
jmp 0x4f806
jmp 0x4f146
jmp 0x4f148
jmp 0x4f14a
movl -0x6ac(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6ac(%rbp)
jmp 0x4efb7
movl -0x34(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x110(%rax)
movq -0x30(%rbp), %rdi
callq 0x5550
jmp 0x4f176
movq -0x20(%rbp), %rax
movq -0x668(%rbp), %rcx
movq %rcx, 0x48(%rax)
movups -0x678(%rbp), %xmm0
movups %xmm0, 0x38(%rax)
movq -0x20(%rbp), %rax
movq -0x680(%rbp), %rcx
movq %rcx, 0x60(%rax)
movups -0x690(%rbp), %xmm0
movups %xmm0, 0x50(%rax)
movq -0x20(%rbp), %rax
movq -0x698(%rbp), %rcx
movq %rcx, 0x78(%rax)
movups -0x6a8(%rbp), %xmm0
movups %xmm0, 0x68(%rax)
leaq -0x690(%rbp), %rdi
leaq -0x6a8(%rbp), %rsi
callq 0xeac60
movsd %xmm0, -0x770(%rbp)
jmp 0x4f1e1
movsd -0x770(%rbp), %xmm0
movsd %xmm0, -0x6b8(%rbp)
leaq -0x678(%rbp), %rdi
leaq -0x6a8(%rbp), %rsi
callq 0xeac60
movsd %xmm0, -0x778(%rbp)
jmp 0x4f20e
movsd -0x778(%rbp), %xmm0
movsd %xmm0, -0x6c0(%rbp)
leaq -0x678(%rbp), %rdi
leaq -0x690(%rbp), %rsi
callq 0xeac60
movsd %xmm0, -0x780(%rbp)
jmp 0x4f23b
movsd -0x780(%rbp), %xmm0
movsd %xmm0, -0x6c8(%rbp)
movsd -0x6b8(%rbp), %xmm0
movsd 0x1a383d(%rip), %xmm2   # 0x1f2a98
mulsd %xmm2, %xmm0
movsd 0x1a3839(%rip), %xmm1   # 0x1f2aa0
divsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0x20(%rax)
movsd -0x6c0(%rbp), %xmm0
mulsd %xmm2, %xmm0
divsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0x28(%rax)
movsd -0x6c8(%rbp), %xmm0
mulsd %xmm2, %xmm0
divsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0x30(%rax)
leaq -0x678(%rbp), %rdi
callq 0xe9240
movsd %xmm0, -0x788(%rbp)
jmp 0x4f2bc
movsd -0x788(%rbp), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0x8(%rax)
leaq -0x690(%rbp), %rdi
callq 0xe9240
movsd %xmm0, -0x790(%rbp)
jmp 0x4f2e3
movsd -0x790(%rbp), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0x10(%rax)
leaq -0x6a8(%rbp), %rdi
callq 0xe9240
movsd %xmm0, -0x798(%rbp)
jmp 0x4f30a
movsd -0x798(%rbp), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0x18(%rax)
movq -0x20(%rbp), %rdi
callq 0x966b0
jmp 0x4f326
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdi
addq $0x320, %rdi            # imm = 0x320
callq 0x5710
jmp 0x4f33c
movq -0x20(%rbp), %rdi
addq $0x320, %rdi            # imm = 0x320
movq %rdi, -0x7a8(%rbp)
callq 0x52d0
movq %rax, -0x6e0(%rbp)
leaq -0x6e0(%rbp), %rdi
movl $0x4, %esi
callq 0x594e0
movq %rax, -0x6d8(%rbp)
leaq -0x6d0(%rbp), %rdi
leaq -0x6d8(%rbp), %rsi
callq 0x59520
movq -0x20(%rbp), %rdi
addq $0x320, %rdi            # imm = 0x320
callq 0x52d0
movq %rax, -0x6f0(%rbp)
leaq -0x6e8(%rbp), %rdi
leaq -0x6f0(%rbp), %rsi
callq 0x59520
movq -0x7a8(%rbp), %rdi
movq -0x6d0(%rbp), %rsi
movq -0x6e8(%rbp), %rdx
callq 0x5130
movq %rax, -0x7a0(%rbp)
jmp 0x4f3d2
movq -0x7a0(%rbp), %rax
movq %rax, -0x6f8(%rbp)
movl $0x0, -0x6fc(%rbp)
movl -0x6fc(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0x4f7fc
movq -0x20(%rbp), %rdi
movq %rdi, -0x7b8(%rbp)
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x6fc(%rbp), %rsi
callq 0xf090
movq %rax, -0x7b0(%rbp)
jmp 0x4f420
movq -0x7b0(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x7c8(%rbp)
movq -0x20(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x6fc(%rbp), %rsi
callq 0xf090
movq %rax, -0x7c0(%rbp)
jmp 0x4f453
movq -0x7c0(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x7d8(%rbp)
movq -0x20(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x6fc(%rbp), %rsi
callq 0xf090
movq %rax, -0x7d0(%rbp)
jmp 0x4f487
movsd -0x7d8(%rbp), %xmm1
movsd -0x7c8(%rbp), %xmm0
movq -0x7b8(%rbp), %rsi
movq -0x7d0(%rbp), %rax
movsd 0x10(%rax), %xmm2
leaq -0x720(%rbp), %rdi
callq 0x97360
jmp 0x4f4b8
leaq -0x720(%rbp), %rdi
xorl %esi, %esi
callq 0xe9d70
movq %rax, -0x7e0(%rbp)
jmp 0x4f4cf
movq -0x7e0(%rbp), %rax
movsd (%rax), %xmm0
callq 0xe9290
movsd %xmm0, -0x7e8(%rbp)
jmp 0x4f4e9
movq -0x20(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x6fc(%rbp), %rsi
callq 0xf090
movq %rax, -0x7f0(%rbp)
jmp 0x4f509
movq -0x7f0(%rbp), %rax
movsd -0x7e8(%rbp), %xmm0
movsd %xmm0, 0x18(%rax)
leaq -0x720(%rbp), %rdi
movl $0x1, %esi
callq 0xe9d70
movq %rax, -0x7f8(%rbp)
jmp 0x4f537
movq -0x7f8(%rbp), %rax
movsd (%rax), %xmm0
callq 0xe9290
movsd %xmm0, -0x800(%rbp)
jmp 0x4f551
movq -0x20(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x6fc(%rbp), %rsi
callq 0xf090
movq %rax, -0x808(%rbp)
jmp 0x4f571
movq -0x808(%rbp), %rax
movsd -0x800(%rbp), %xmm0
movsd %xmm0, 0x20(%rax)
leaq -0x720(%rbp), %rdi
movl $0x2, %esi
callq 0xe9d70
movq %rax, -0x810(%rbp)
jmp 0x4f59f
movq -0x810(%rbp), %rax
movsd (%rax), %xmm0
callq 0xe9290
movsd %xmm0, -0x818(%rbp)
jmp 0x4f5b9
movq -0x20(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x6fc(%rbp), %rsi
callq 0xf090
movq %rax, -0x820(%rbp)
jmp 0x4f5d9
movq -0x820(%rbp), %rax
movsd -0x818(%rbp), %xmm0
movsd %xmm0, 0x28(%rax)
movq -0x20(%rbp), %rdi
movq %rdi, -0x830(%rbp)
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x6fc(%rbp), %rsi
callq 0xf090
movq %rax, -0x828(%rbp)
jmp 0x4f614
movq -0x828(%rbp), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, -0x840(%rbp)
movq -0x20(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x6fc(%rbp), %rsi
callq 0xf090
movq %rax, -0x838(%rbp)
jmp 0x4f648
movq -0x838(%rbp), %rax
movsd 0x20(%rax), %xmm0
movsd %xmm0, -0x850(%rbp)
movq -0x20(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x6fc(%rbp), %rsi
callq 0xf090
movq %rax, -0x848(%rbp)
jmp 0x4f67c
movsd -0x850(%rbp), %xmm1
movsd -0x840(%rbp), %xmm0
movq -0x830(%rbp), %rsi
movq -0x848(%rbp), %rax
movsd 0x28(%rax), %xmm2
leaq -0x738(%rbp), %rdi
callq 0x97170
jmp 0x4f6ad
movq -0x728(%rbp), %rax
movq %rax, -0x710(%rbp)
movups -0x738(%rbp), %xmm0
movaps %xmm0, -0x720(%rbp)
leaq -0x720(%rbp), %rdi
xorl %esi, %esi
callq 0xe9d70
movq %rax, -0x858(%rbp)
jmp 0x4f6e0
movq -0x858(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x868(%rbp)
movq -0x20(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x6fc(%rbp), %rsi
callq 0xf090
movq %rax, -0x860(%rbp)
jmp 0x4f713
movq -0x860(%rbp), %rax
movsd -0x868(%rbp), %xmm0
movsd %xmm0, (%rax)
leaq -0x720(%rbp), %rdi
movl $0x1, %esi
callq 0xe9d70
movq %rax, -0x870(%rbp)
jmp 0x4f740
movq -0x870(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x880(%rbp)
movq -0x20(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x6fc(%rbp), %rsi
callq 0xf090
movq %rax, -0x878(%rbp)
jmp 0x4f773
movq -0x878(%rbp), %rax
movsd -0x880(%rbp), %xmm0
movsd %xmm0, 0x8(%rax)
leaq -0x720(%rbp), %rdi
movl $0x2, %esi
callq 0xe9d70
movq %rax, -0x888(%rbp)
jmp 0x4f7a1
movq -0x888(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x898(%rbp)
movq -0x20(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movslq -0x6fc(%rbp), %rsi
callq 0xf090
movq %rax, -0x890(%rbp)
jmp 0x4f7d4
movq -0x890(%rbp), %rax
movsd -0x898(%rbp), %xmm0
movsd %xmm0, 0x10(%rax)
movl -0x6fc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6fc(%rbp)
jmp 0x4f3ea
movl $0x0, -0x660(%rbp)
leaq -0x600(%rbp), %rdi
callq 0xf200
movl -0x660(%rbp), %eax
testl %eax, %eax
je 0x4f820
jmp 0x4f81e
jmp 0x4f834
jmp 0x4f830
leaq -0x600(%rbp), %rdi
callq 0xf200
jmp 0x4f843
movb $0x1, -0x9(%rbp)
movb -0x9(%rbp), %al
andb $0x1, %al
addq $0x8b8, %rsp            # imm = 0x8B8
popq %rbx
popq %rbp
retq
movq -0x630(%rbp), %rdi
callq 0x58f0
nop