// File: /workspace/github_c_makefile_star2_O3/ugobas[P]tnm/simulation.c
// Function: Make_conformations
int Make_conformations(char type, int N_frames, double *d_phi, float *d_Cart,
		       float factor, float coeff, float rmsd0,
		       float *coord_all_f, float *coord_opt_f,
		       float *coord_ref, float *coord_ref2,
		       int PRINT_SIMUL_PDB, FILE *file_out, FILE *file_pdb,
		       float *coord_str1, float *coord_str2,
		       struct Para_simul Para_simul,
		       atom *atoms, int natoms,
		       struct axe *axe, int naxes,
		       struct bond *bonds,
		       struct residue *seq, int nres,
		       int N_diso, struct Normal_Mode NM,
		       struct Jacobian J, struct Reference Ref,
		       struct interaction *Int_list, int N_int,
		       char *INT_TYPE, float s0, char *nameout,
		       int anhar)
{
  /* type: C= Cartesian interpolation T= torsional interpolation R= random */
  float *sigma2;
  if(anhar){sigma2=NM.sigma2_anhar;}
  else{sigma2=NM.sigma2;}

  float Ene=Energy_clashes(coord_str1, Ref.N_ref), Ene_thr=40*Ene;

  // Initialization

  char summary3[400]; sprintf(summary3, "Summary_%s_simul.dat", nameout);
  int k, i; 
  Set_bonds_measure(bonds, natoms, atoms);
  Put_coord(coord_all_f, bonds, natoms);
  Write_ref_coord(coord_ref2, Ref.N_ref, coord_all_f, Ref.atom_num);

  float *sigma=NULL;
  if(type=='R'){
    if(Ini_ch){
      Allocate_tors(&Diff_s, naxes, NM.N_Cart, NM.N);
      ali_sim.alignres=malloc(nres*sizeof(int));
      Ini_ch=0;
      ali_sim.seq_id=100; ali_sim.mammoth=0;
      for(i=0; i<nres; i++)ali_sim.alignres[i]=i;
      idum=IDUM;
    }
    sigma=malloc(NM.N*sizeof(float));
    for(k=0; k<NM.N; k++){
      if(sigma2[k]>0){sigma[k]=sqrt(sigma2[k]);}
      else{sigma[k]=0;}
    }
  }else if(type=='T'){
    float d_thr=0.01, d_max=0;
    for(i=0; i<naxes; i++)if(fabs(d_phi[i])>d_max)d_max=fabs(d_phi[i]);
    if(d_max>d_thr){
      float f=d_thr/d_max; for(i=0; i<naxes; i++)d_phi[i]*=f;
      printf("Reducing angular changes by a factor %.3f\n", f);
    }
  }


  int k_opt=0, nn=N_frames; if(type!='R')nn=1000;
  float rmsd_sim=0, rmsd1=0, rmsd2=rmsd0, rmsd_min=1000, rmsd1_min=0;

  for(k=0; k<=nn; k++){

    if(k==0)goto Print;
    if(type=='C'){
      float ck=k*coeff;
      for(i=0; i<Ref.N_Cart; i++)coord_ref[i]=coord_str1[i]+ck*d_Cart[i];
    }else{
      if(type=='R'){ // Random simulation starting from PDB
	Extract_dphi(d_phi, NM.Tors, sigma, NM.N, naxes, factor, &idum);
      }
      Build_up(bonds, natoms, d_phi, naxes);
      Put_coord(coord_all_f, bonds, natoms);
      Write_ref_coord(coord_ref, Ref.N_ref, coord_all_f, Ref.atom_num);
    }
    Ene=Energy_clashes(coord_ref, Ref.N_ref);

    // RMSD computation
    rmsd_sim=rmsd_mclachlan_f(coord_ref2, coord_ref, Ref.mass_atom, Ref.N_ref);
    for(i=0; i<Ref.N_Cart; i++)coord_ref2[i]=coord_ref[i];
    rmsd1=rmsd_mclachlan_f(coord_str1, coord_ref, Ref.mass_atom, Ref.N_ref);
    if(coord_str2){
      rmsd2=rmsd_mclachlan_f(coord_str2, coord_ref, Ref.mass_atom, Ref.N_ref);
      if(rmsd2<rmsd_min){
	Put_coord(coord_opt_f, bonds, natoms); 
	rmsd_min=rmsd2; rmsd1_min=rmsd1; k_opt=k;
      }
    }

    /*if(type=='R'){     // Projection of conformation change on normal modes
      atom atoms_sim[natoms]; int cc;
      for(i=0; i<natoms; i++)atoms_sim[i]=atoms[i];
      Examine_confchange(&Diff_s, bonds, axe, NULL, 0, summary3, nameout, "", 
			 atoms, coord_str1, seq, nres, N_diso, natoms,
			 atoms_sim, coord_ref, seq, nres, N_diso, natoms,
			 Int_list, N_int, INT_TYPE, s0, NM.N, Ref, NM, //&J, 
			 k, ali_sim, Para_simul, k, 
			 NULL, NULL, NULL, 0, anhar);
			 }*/

  Print:
    fprintf(file_out, "%d %.3f %.3f %.4f %.3g\n",
	    k, rmsd_sim, rmsd1, rmsd2, Ene);
    if((PRINT_SIMUL_PDB)&&((type=='R')||((k==0)&&(type=='T')))){
      if(Ene < Ene_thr){
	Print_PDB(file_pdb, atoms, natoms, coord_all_f, seq, k, rmsd_sim);
      }
    }
    if((type!='R')&&(rmsd2>rmsd_min))break;
  }
  char str[1000];
  sprintf(str, "# Min.RMSD= %.2f Starting_RMSD= %.2f"
	  " Opt_coeff=%.3f factor= %.3f type=%c\n",
	  rmsd_min, rmsd0, coeff*k_opt, factor, type);
  fprintf(file_out, "%s", str); printf("%s", str);
  fprintf(file_out, "&\n");
  if((PRINT_SIMUL_PDB)&&(type!='R')&&(k_opt>=0)){
    if(type=='C'){
      fprintf(file_pdb, "REMARK: predicted Cartesian mutation\n");
    }else{
      fprintf(file_pdb, "REMARK: predicted Torsional mutation\n");
    }
    Print_PDB(file_pdb, atoms, natoms, coord_opt_f, seq, k, rmsd1_min);
  }
  if(sigma)free(sigma);
  return(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x628, %rsp            # imm = 0x628
movq %r9, 0x70(%rsp)
movq %r8, %r13
movd %xmm2, 0x44(%rsp)
movd %xmm1, 0x4c(%rsp)
movss %xmm0, 0x48(%rsp)
movq %rcx, 0x38(%rsp)
movq %rdx, 0x60(%rsp)
movl %esi, 0x8(%rsp)
movl %edi, 0x2c(%rsp)
leaq 0x830(%rsp), %rbx
movq 0x6f8(%rsp), %r15
movl 0x6e0(%rsp), %ebp
movq 0x6d8(%rsp), %r12
movq 0x688(%rsp), %rdi
cmpl $0x0, 0x880(%rsp)
leaq 0x740(%rsp), %rax
leaq 0x7a0(%rsp), %rcx
cmoveq %rax, %rcx
movq (%rcx), %r14
movl (%rbx), %esi
movq %rsi, 0x18(%rsp)
callq 0x3273e
movss %xmm0, 0x28(%rsp)
leaq 0x23736(%rip), %rsi     # 0x5b5dd
leaq 0xb0(%rsp), %rdi
movq 0x878(%rsp), %rdx
xorl %eax, %eax
callq 0x2270
movq %r15, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0x14cf3
movq %r13, %rdi
movl %ebp, %r8d
testl %ebp, %ebp
jle 0x37f18
leaq 0x8(%r15), %rax
xorl %ecx, %ecx
movq %rdi, %rdx
leaq (%rcx,%rcx,2), %rsi
shlq $0x6, %rsi
cmpl $0x0, 0x20(%r15,%rsi)
js 0x37f18
xorl %esi, %esi
xorps %xmm0, %xmm0
cvtsd2ss (%rax,%rsi,2), %xmm0
movss %xmm0, (%rdx,%rsi)
addq $0x4, %rsi
cmpq $0xc, %rsi
jne 0x37ef0
incq %rcx
addq $0xc0, %rax
addq %rsi, %rdx
cmpq %r8, %rcx
jne 0x37ede
movq %r8, 0x80(%rsp)
movq 0x28(%rbx), %r13
movq 0x18(%rsp), %rsi
testl %esi, %esi
movl 0x2c(%rsp), %r12d
movq 0x38(%rsp), %r8
jle 0x37f71
xorl %eax, %eax
movq 0x668(%rsp), %rcx
movl (%r13,%rax,4), %edx
leal (%rdx,%rdx,2), %edx
movslq %edx, %rdx
leaq (%rdi,%rdx,4), %r9
xorl %edx, %edx
movss (%r9,%rdx), %xmm0
movss %xmm0, (%rcx,%rdx)
addq $0x4, %rdx
cmpl $0xc, %edx
jne 0x37f52
incq %rax
addq %rdx, %rcx
cmpq %rsi, %rax
jne 0x37f41
leaq 0x718(%rsp), %r15
movsbl %r12b, %eax
cmpb $0x52, %al
movq %rdi, 0x88(%rsp)
movl %eax, 0x24(%rsp)
jne 0x38113
cmpl $0x0, 0x30f28(%rip)     # 0x68ec0
movslq (%r15), %rbp
je 0x3809d
movq %r15, %rax
movl 0x708(%rsp), %r15d
movl 0xc(%rax), %edx
leaq 0x4155a(%rip), %rdi     # 0x79510
movl 0x6f0(%rsp), %esi
movl %ebp, %ecx
callq 0x10f90
movslq %r15d, %rbx
leaq (,%rbx,4), %rdi
callq 0x21e0
movq %rax, 0x4158d(%rip)     # 0x79568
xorl %ecx, %ecx
movl %ecx, 0x30edd(%rip)     # 0x68ec0
movl $0x42c80000, 0x41563(%rip) # imm = 0x42C80000
movl %ecx, 0x4157d(%rip)     # 0x79570
testl %ebx, %ebx
jle 0x3808a
movl %r15d, %ecx
incl %r15d
andl $-0x2, %r15d
decq %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa 0x19006(%rip), %xmm1    # 0x51020
xorl %ecx, %ecx
movdqa 0x1900c(%rip), %xmm2    # 0x51030
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movdqa 0x1900c(%rip), %xmm4    # 0x51040
movdqa %xmm1, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
movd %xmm5, %edx
notl %edx
testb $0x1, %dl
je 0x38068
movl %ecx, (%rax,%rcx,4)
pxor %xmm3, %xmm5
pextrw $0x4, %xmm5, %edx
testb $0x1, %dl
je 0x3807d
leal 0x1(%rcx), %edx
movl %edx, 0x4(%rax,%rcx,4)
addq $0x2, %rcx
paddq %xmm4, %xmm1
cmpq %rcx, %r15
jne 0x38034
movq $-0xb2a3, 0x41473(%rip) # imm = 0xFFFF4D5D
leaq 0x718(%rsp), %r15
leaq (,%rbp,4), %rdi
callq 0x21e0
movq %rax, %rbx
testl %ebp, %ebp
jle 0x381e6
xorl %r15d, %r15d
pxor %xmm2, %xmm2
movq 0x38(%rsp), %r8
movq 0x18(%rsp), %rsi
movss (%r14,%r15,4), %xmm1
ucomiss %xmm2, %xmm1
xorps %xmm0, %xmm0
jbe 0x380f4
jb 0x380df
xorps %xmm0, %xmm0
sqrtss %xmm1, %xmm0
jmp 0x380f4
movaps %xmm1, %xmm0
callq 0x21d0
xorps %xmm2, %xmm2
movq 0x18(%rsp), %rsi
movq 0x38(%rsp), %r8
movss %xmm0, (%rbx,%r15,4)
incq %r15
cmpq %r15, %rbp
jne 0x380c6
movl 0x8(%rsp), %ebp
leaq 0x718(%rsp), %r15
jmp 0x381f8
movb $0x1, 0x7(%rsp)
movl $0x3e8, %ecx            # imm = 0x3E8
cmpb $0x54, %r12b
jne 0x381db
movl 0x6f0(%rsp), %eax
testl %eax, %eax
jle 0x381db
movl %eax, %eax
xorps %xmm0, %xmm0
xorl %ecx, %ecx
movapd 0x1f1ab(%rip), %xmm1    # 0x572f0
movaps 0x1f194(%rip), %xmm2    # 0x572e0
movq 0x60(%rsp), %rdx
movl 0x8(%rsp), %ebp
movsd (%rdx,%rcx,8), %xmm3
movapd %xmm3, %xmm4
andpd %xmm1, %xmm4
xorps %xmm5, %xmm5
cvtss2sd %xmm0, %xmm5
ucomisd %xmm5, %xmm4
jbe 0x38179
xorps %xmm0, %xmm0
cvtsd2ss %xmm3, %xmm0
andps %xmm2, %xmm0
incq %rcx
cmpq %rcx, %rax
jne 0x38155
ucomiss 0x1f128(%rip), %xmm0    # 0x572b0
jbe 0x381f6
movss 0x1f11e(%rip), %xmm1    # 0x572b0
divss %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
cmpl $0x0, 0x6f0(%rsp)
jle 0x381bf
xorl %ecx, %ecx
movsd (%rdx,%rcx,8), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, (%rdx,%rcx,8)
incq %rcx
cmpq %rcx, %rax
jne 0x381a9
leaq 0x2342c(%rip), %rdi     # 0x5b5f2
movb $0x1, %al
callq 0x20f0
xorl %ebx, %ebx
movq 0x38(%rsp), %r8
movq 0x18(%rsp), %rsi
jmp 0x381f8
movq $0x0, 0x58(%rsp)
jmp 0x38220
movq 0x38(%rsp), %r8
movq 0x18(%rsp), %rsi
movl 0x8(%rsp), %ebp
jmp 0x381f8
xorl %ebx, %ebx
cmpb $0x52, %r12b
setne 0x7(%rsp)
movl $0x3e8, %eax            # imm = 0x3E8
cmovnel %eax, %ebp
testl %ebp, %ebp
movq %rbx, 0x58(%rsp)
js 0x38657
movl %ebp, %ecx
leaq 0x830(%rsp), %rbx
movq %rcx, 0xa8(%rsp)
movss 0x28(%rsp), %xmm0
movss %xmm0, 0x34(%rsp)
mulss 0x22b50(%rip), %xmm0    # 0x5ad8c
movss %xmm0, 0x28(%rsp)
movq 0x660(%rsp), %rbp
movq 0x40(%r15), %rax
movq %rax, 0x98(%rsp)
movl (%r15), %eax
movl %eax, 0x6c(%rsp)
movl 0x4(%rbx), %r15d
movq 0x10(%rbx), %rax
movq %rax, 0x90(%rsp)
leal 0x1(%rcx), %eax
movl %eax, 0x68(%rsp)
movq 0x6f8(%rsp), %rax
leaq 0x8(%rax), %rax
movq %rax, 0x78(%rsp)
movq $0x0, 0x50(%rsp)
movss 0x1f00a(%rip), %xmm0    # 0x572a0
movss %xmm0, 0xc(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x10(%rsp)
movss 0x44(%rsp), %xmm0
movss %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x14(%rsp)
movss %xmm0, 0x30(%rsp)
xorl %r14d, %r14d
movq %r13, 0xa0(%rsp)
movq 0x688(%rsp), %rbx
testl %r14d, %r14d
je 0x38566
cmpb $0x43, %r12b
jne 0x3831d
testl %r15d, %r15d
jle 0x38427
xorps %xmm0, %xmm0
cvtsi2ss %r14d, %xmm0
mulss 0x4c(%rsp), %xmm0
xorl %eax, %eax
movss (%r8,%rax,4), %xmm1
mulss %xmm0, %xmm1
addss (%rbx,%rax,4), %xmm1
movss %xmm1, (%rbp,%rax,4)
incq %rax
cmpq %rax, %r15
jne 0x382fb
jmp 0x38427
cmpb $0x52, %r12b
movl 0x6f0(%rsp), %r8d
movq 0x58(%rsp), %rdx
jne 0x3835b
movq 0x60(%rsp), %rdi
movq 0x98(%rsp), %rsi
movl 0x6c(%rsp), %ecx
movss 0x48(%rsp), %xmm0
leaq 0x411ba(%rip), %r9      # 0x79508
callq 0x32a5b
movl 0x6f0(%rsp), %r8d
movq 0x6f8(%rsp), %r13
movq %r13, %rdi
movl 0x6e0(%rsp), %r12d
movl %r12d, %esi
movq 0x60(%rsp), %rdx
movl %r8d, %ecx
callq 0x15083
testl %r12d, %r12d
movq 0x88(%rsp), %rdi
movq 0x80(%rsp), %r8
movq 0x18(%rsp), %rsi
jle 0x383df
movq 0x78(%rsp), %rax
xorl %ecx, %ecx
movq %rdi, %rdx
leaq (%rcx,%rcx,2), %r9
shlq $0x6, %r9
cmpl $0x0, 0x20(%r13,%r9)
js 0x383df
xorl %r9d, %r9d
xorps %xmm0, %xmm0
cvtsd2ss (%rax,%r9,2), %xmm0
movss %xmm0, (%rdx,%r9)
addq $0x4, %r9
cmpq $0xc, %r9
jne 0x383b5
incq %rcx
addq $0xc0, %rax
addq %r9, %rdx
cmpq %r8, %rcx
jne 0x383a2
testl %esi, %esi
movq 0x688(%rsp), %rbx
movq 0xa0(%rsp), %r8
jle 0x38427
xorl %eax, %eax
movq %rbp, %rcx
movl (%r8,%rax,4), %edx
leal (%rdx,%rdx,2), %edx
movslq %edx, %rdx
leaq (%rdi,%rdx,4), %r9
xorl %edx, %edx
movss (%r9,%rdx), %xmm0
movss %xmm0, (%rcx,%rdx)
addq $0x4, %rdx
cmpl $0xc, %edx
jne 0x38408
incq %rax
addq %rdx, %rcx
cmpq %rsi, %rax
jne 0x383f8
movq %rbp, %rdi
movq %rsi, %r13
callq 0x3273e
movss %xmm0, 0x34(%rsp)
movq 0x668(%rsp), %r12
movq %r12, %rdi
movq %rbp, %rsi
movq 0x90(%rsp), %rdx
movl %r13d, %ecx
callq 0x4dfa0
testl %r15d, %r15d
jle 0x38471
xorl %eax, %eax
movd (%rbp,%rax,4), %xmm1
movd %xmm1, (%r12,%rax,4)
incq %rax
cmpq %rax, %r15
jne 0x3845d
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x30(%rsp)
movq %rbx, %rdi
movq %rbp, %rsi
movq 0x90(%rsp), %r13
movq %r13, %rdx
movq 0x18(%rsp), %r12
movl %r12d, %ecx
callq 0x4dfa0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x14(%rsp)
movq 0x690(%rsp), %rdi
testq %rdi, %rdi
je 0x38561
movq %rbp, %rsi
movq %r13, %rdx
movl %r12d, %ecx
callq 0x4dfa0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x8(%rsp)
movss 0xc(%rsp), %xmm1
ucomiss %xmm0, %xmm1
movl 0x2c(%rsp), %r12d
jbe 0x38566
cmpl $0x0, 0x6e0(%rsp)
movq 0x6f8(%rsp), %rdi
movq 0x80(%rsp), %r8
jle 0x3853f
movq 0x78(%rsp), %rax
xorl %ecx, %ecx
movq 0x70(%rsp), %rdx
leaq (%rcx,%rcx,2), %rsi
shlq $0x6, %rsi
cmpl $0x0, 0x20(%rdi,%rsi)
js 0x3853f
xorl %esi, %esi
xorps %xmm0, %xmm0
cvtsd2ss (%rax,%rsi,2), %xmm0
movss %xmm0, (%rdx,%rsi)
addq $0x4, %rsi
cmpq $0xc, %rsi
jne 0x38517
incq %rcx
addq $0xc0, %rax
addq %rsi, %rdx
cmpq %r8, %rcx
jne 0x38506
movl %r14d, %eax
movq %rax, 0x50(%rsp)
movss 0x8(%rsp), %xmm0
movss %xmm0, 0xc(%rsp)
movss 0x14(%rsp), %xmm0
movss %xmm0, 0x10(%rsp)
jmp 0x38566
movl 0x2c(%rsp), %r12d
xorps %xmm0, %xmm0
cvtss2sd 0x30(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x14(%rsp), %xmm1
xorps %xmm2, %xmm2
cvtss2sd 0x8(%rsp), %xmm2
xorps %xmm3, %xmm3
cvtss2sd 0x34(%rsp), %xmm3
movq 0x678(%rsp), %rdi
leaq 0x23084(%rip), %rsi     # 0x5b61d
movl %r14d, %edx
movb $0x4, %al
callq 0x21a0
cmpl $0x0, 0x670(%rsp)
je 0x38609
testl %r14d, %r14d
setne %al
cmpb $0x54, %r12b
setne %cl
cmpb $0x52, %r12b
setne %dl
orb %al, %cl
testb %cl, %dl
jne 0x38609
movss 0x28(%rsp), %xmm0
ucomiss 0x34(%rsp), %xmm0
jbe 0x38609
movq 0x680(%rsp), %rdi
movq 0x6d8(%rsp), %rsi
movl 0x6e0(%rsp), %edx
movq 0x88(%rsp), %rcx
movq 0x700(%rsp), %r8
movl %r14d, %r9d
movss 0x30(%rsp), %xmm0
callq 0x3285f
movss 0x8(%rsp), %xmm0
ucomiss 0xc(%rsp), %xmm0
seta %al
testb %al, 0x7(%rsp)
jne 0x38643
leal 0x1(%r14), %eax
cmpl 0xa8(%rsp), %r14d
movl %eax, %r14d
movq 0x38(%rsp), %r8
movq 0x18(%rsp), %rsi
jne 0x382d3
movl 0x68(%rsp), %eax
movl %eax, %r14d
movl 0x24(%rsp), %edx
xorps %xmm0, %xmm0
cvtss2sd 0xc(%rsp), %xmm0
movq 0x50(%rsp), %r13
jmp 0x38672
xorps %xmm0, %xmm0
movss %xmm0, 0x10(%rsp)
movsd 0x226f8(%rip), %xmm0    # 0x5ad60
xorl %r14d, %r14d
xorl %r13d, %r13d
movl 0x24(%rsp), %edx
xorps %xmm2, %xmm2
cvtsi2ss %r13d, %xmm2
xorps %xmm1, %xmm1
cvtss2sd 0x44(%rsp), %xmm1
mulss 0x4c(%rsp), %xmm2
cvtss2sd %xmm2, %xmm2
xorps %xmm3, %xmm3
cvtss2sd 0x48(%rsp), %xmm3
leaq 0x22f98(%rip), %rsi     # 0x5b635
leaq 0x240(%rsp), %rbx
movq %rbx, %rdi
movb $0x4, %al
callq 0x2270
movq %rbx, %rdi
movq 0x678(%rsp), %r15
movq %r15, %rsi
callq 0x2100
leaq 0x1eb63(%rip), %rdi     # 0x5722c
movq %rbx, %rsi
xorl %eax, %eax
callq 0x20f0
leaq 0x1fa11(%rip), %rdi     # 0x580eb
movl $0x2, %esi
movl $0x1, %edx
movq %r15, %rcx
callq 0x2290
cmpb $0x0, 0x7(%rsp)
je 0x3875f
cmpl $0x0, 0x670(%rsp)
je 0x3875f
testl %r13d, %r13d
js 0x3875f
cmpb $0x43, %r12b
leaq 0x22f72(%rip), %rax     # 0x5b67f
leaq 0x22f91(%rip), %rdi     # 0x5b6a5
cmoveq %rax, %rdi
movl $0x25, %esi
movl $0x1, %edx
movq 0x680(%rsp), %rbx
movq %rbx, %rcx
callq 0x2290
movq %rbx, %rdi
movq 0x6d8(%rsp), %rsi
movl 0x6e0(%rsp), %edx
movq 0x70(%rsp), %rcx
movq 0x700(%rsp), %r8
movl %r14d, %r9d
movss 0x10(%rsp), %xmm0
callq 0x3285f
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x3876e
callq 0x2050
xorl %eax, %eax
addq $0x628, %rsp            # imm = 0x628
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq