// File: /workspace/github_c_makefile_star2_O2/ugobas[P]tnm/read.c
// Function: Read_coord
int Read_coord(char *pdb_name, int *nmr,
	       struct residue *seq, atom *atoms,
	       char *chain_to_read, int *ANISOU, float *TEMP)
{
  /* Open file */
  int Compression;
  FILE *file_in=Open_compressed_file(pdb_name, &Compression);
  if(file_in==NULL)return(0);

  int N_res=0, n_exo=0, start=0;
  char string[200];
  atom *atom_ptr=atoms, *first_atom=atoms;

  short i_atom=0, alternative=0;
  int hetatm=0, hetatm_old=0;
  int i, j, res_num, res_num_old=10000;
  char altloc, altloc_sel=' ';
  char chain_old='\0', chain=' ';
  char res_type[5], res_type_old[5], icode=' ', icode_old='U';
  float x, y, z;
  int nchains=0, ic, ichain=0, ini_chain=0, *rchain=NULL, readall=0;
  char *chain_pdb=CHAIN_CODE;

  n_atom=0;
  if(HYD)printf("Considering hydrogen atoms\n");

  // Count chains to read
  if(chain_to_read[0]=='*'){
    readall=1;
     printf("Reading atoms in all chains\n");
  }else{
    i=0;
    while(chain_to_read[i]!='\0')i++;
    nchains=i; 
    if(nchains==0)nchains=1;
    rchain=(int *)malloc(nchains*sizeof(int));
    for(i=0; i<nchains; i++)rchain[i]=0;
    printf("%d chains to read\n", nchains);
  }
  
  *nmr=0;
  strcpy(res_type_old,"xxx");
  while(fgets(string, sizeof(string), file_in)!=NULL){
    if(strncmp(string,"ATOM", 4)==0){
      /* Standard residue or DNA basis */
      hetatm=0;
      if(ini_chain==0)ini_chain=1; 	 
    }else if(strncmp(string,"HETATM", 6)==0){
      if(ini_chain==0)continue;
      hetatm=1;
      /* Cofactor or exotic residue */
      }else if(TEMP && strncmp(string,"REMARK 200", 10)==0){
      char word1[40], word2[40], word3[40], word4[40];
      sscanf(string+12, "%s%s%s%s", word1, word2, word3, word4);
      if((strncmp(word1,"TEMPERATURE", 11)==0)&&
	 (strncmp(word4,"NULL", 4)!=0)){
	sscanf(word4, "%f", TEMP);
	if(strncmp(word2,"(KELVIN)", 8)!=0){*TEMP+=273;}
	}
      continue;
    }else if(strncmp(string,"EXPDTA", 6)==0){
      char word1[80], word2[80];
      sscanf(string+8, "%s%s", word1, word2);
      if(strncmp(word1, "NMR", 3)==0){*nmr=1;}
      else if(strncmp(word2, "NMR", 3)==0){*nmr=1;}
      continue;
      /* NMR structure */
    }else if((strncmp(string,"TER",3)==0)&&(N_res>0)){
      chain_pdb++;
      //printf("-NR- |%3d|%c|%c|\n",N_res,chain_old,chain);
      Next_residue(&N_res, &start, seq, first_atom, &i_atom,
		   res_type_old, &res_num_old, &icode_old,
		   &chain_old, &hetatm_old, n_exo,
		   res_type, res_num, icode, chain, hetatm);
      ini_chain=0;
      continue;
    }else if(strncmp(string,"MODRES", 6)==0){
      res_exo[n_exo][0]=string[12]; res_std[n_exo][0]=string[24];
      res_exo[n_exo][1]=string[13]; res_std[n_exo][1]=string[25];
      res_exo[n_exo][2]=string[14]; res_std[n_exo][2]=string[26];
      for(j=0; j<n_exo; j++){
	if(strncmp(res_exo[j],res_exo[n_exo],3)==0)break;
      }
      if(j==n_exo)n_exo++;
      continue;
    }else if(strncmp(string,"ENDMDL", 6)==0){
      break;                                    /* end model */
    }else if(strncmp(string,"ANISOU", 6)==0){
      // Anisotropic structure factor
      int i, j;
      if(*ANISOU==0)*ANISOU=1;
      //for(i=0; i<3; i++)atom_ptr->anisou[i]=malloc(3*sizeof(float));
      sscanf(string+28, "%f %f %f %f %f %f",
	     &(atom_ptr->anisou[0][0]), &(atom_ptr->anisou[1][1]),
	     &(atom_ptr->anisou[2][2]), &(atom_ptr->anisou[0][1]),
	     &(atom_ptr->anisou[0][2]), &(atom_ptr->anisou[1][2]));
      for(i=0; i<3; i++)
	{for(j=i; j<3; j++)
	    {atom_ptr->anisou[i][j]*=0.0001;
	      if(j!=i)atom_ptr->anisou[j][i]=atom_ptr->anisou[i][j];
	    }
	}
      // Check
      //for(i=0; i<3; i++)B+=aniso[i][i]; B*=26.319; // 8pi^2/2
      //printf("B= %.2f %.2f %d\n", atom_ptr->B_factor, B, n_atom);
      continue;
      /* }else if(strncmp(string,"HELIX ", 6)==0){
	 Read_sec_str(string, chain, 'H'); continue;
	 }else if(strncmp(string,"SHEET ", 6)==0){
	 Read_sec_str(string, chain, 'E'); continue;
	 }else if(strncmp(string,"TURN ", 5)==0){
	 Read_sec_str(string, chain, 'T'); continue;
	 }*/
    }else{
      continue;
    }

    chain=string[21];
    if(chain==' ')chain=*chain_pdb;
    if(readall)
    	{if(chain!=chain_old)
	    {printf("Reading chain %c\n", chain);
	      chain_to_read[nchains]=chain; nchains++; chain_old=chain;
	    }
    	}
    else
      {if((chain_to_read[0]==' ')||(chain_to_read[0]=='\0'))
	  {chain_to_read[0]=chain; chain_to_read[1]='\0';
	  }
	for(ic=0; ic<nchains; ic++)
	  {if(chain==chain_to_read[ic])
	      {rchain[ic]=1; goto read;}
	  }
	continue;
      }
    
    /*if(*chain_to_read!='*'){
      if((*chain_to_read==' ')||(*chain_to_read=='\0'))*chain_to_read=chain;
      for(ic=0; ic<nchains; ic++)if(chain==chain_to_read[ic])goto read;
      continue;
      }*/
    
   
  read:
    // Hydrogen atoms
    if((string[13]=='H')||(string[12]=='H') || (string[13]=='D') ||(string[12]=='D'))
    	{if(HYD==0){continue;}   // Omit hydrogen
      	 else if((string[13]=='H')&&(string[12]!=' '))
      	 	{// if name 1HB1 change to HB11
		  	 char c=string[12];
			 if((c=='1')||(c=='2')||(c=='3'))
			 	{string[12]='H'; string[13]=string[14];
	  			 string[14]=string[15]; string[15]=c; 
				}
      		}
    	}
  
    /* Read residue; check if water molecule */
    res_type[0]=string[17]; res_type[1]=string[18]; res_type[2]=string[19];
    res_type[3]='\0';
    if((hetatm==1)&&((strncmp(res_type,"HOH",3)==0)||(strncmp(res_type,"DOD",3)==0)))continue;

    icode=string[26]; string[26]=' ';

    /* Read coordinates */
    sscanf(&string[22],"%d %f %f %f", &res_num, &x, &y, &z); //modyves

    /* Check if alternative conformation */
    if((string[72]=='A')&&(string[73]=='L')&&(string[74]=='T')&&(string[75]!='1')&&(string[75]!=' '))continue;

    altloc=string[16];
    if(altloc!=' '){
      if(altloc_sel==' ')altloc_sel=altloc;
      if(altloc!=altloc_sel)continue;
    }

    if((icode!=icode_old)&&(res_num==res_num_old)){
      if(alternative==1){
	continue;
      }else{
	atom *atom_old=first_atom;
	float dx, dy, dz;
	dx=x-atom_old->r[0]; dy=y-atom_old->r[1]; dz=z-atom_old->r[2];
	if((dx*dx+dy*dy+dz*dz)<.5){alternative=1; continue;}
      }
    }

    /* New residue */
    if((res_num!=res_num_old)||(icode!=icode_old)||
       (strncmp(res_type, res_type_old, 3)!=0)){
      Next_residue(&N_res, &start, seq, first_atom, &i_atom,
		   res_type_old, &res_num_old, &icode_old,
		   &chain_old, &hetatm_old, n_exo,
		   res_type, res_num, icode, chain, hetatm);
    }
    atom_ptr=atoms+n_atom;

    if(i_atom==0)first_atom=atom_ptr;
    i_atom++;
    n_atom++;
    atom_ptr->r[0] = x;
    atom_ptr->r[1] = y;
    atom_ptr->r[2] = z;
    
    // Copy name
    if(string[12]!=' ')
    	{ // Hydrogen atoms
      	 if(strncmp(string+12, "SE", 2)==0)
      	 	{// Selenium in Seleniomethionine is at delta position
			 string[13]='D';
      		}
      	 for(ic=0; ic<3; ic++)atom_ptr->name[ic]=string[12+ic];
    	}
    else if(string[13]!=' ')
     	{for(ic=0; ic<3; ic++)atom_ptr->name[ic]=string[13+ic];
   		}
    else
    	{for(ic=0; ic<3; ic++)atom_ptr->name[ic]=string[14+ic];
    	}
    atom_ptr->name[3]='\0';
    
    if(string[62]!=' ')
    	{sscanf(string+60, "%f", &atom_ptr->B_factor);
     	}
     else
     	{atom_ptr->B_factor=0;
    	}
    if(string[60]!=' ')string[60]=' ';
    if(string[56]!=' ')
    	{sscanf(string+54, "%f", &atom_ptr->occupancy);
    	}
    else
    	{atom_ptr->occupancy=0;
    	}

    atom_ptr->chain=ichain;
  }
  Next_residue(&N_res, &start, seq, first_atom, &i_atom,
	       res_type_old, &res_num_old, &icode_old,
	       &chain_old, &hetatm_old, n_exo,
	       res_type, res_num, icode, chain, hetatm);
	       
  if(N_res > L_MAX)
  	{printf("\n ERROR, more than %d residues found\n", L_MAX); exit(8);
  	}
  fclose(file_in);
  printf("Reading %3d residues in %d chains: %s\n",N_res, nchains, chain_to_read);
  chain_to_read[nchains]='\0';
  
  
  if(readall==0){free(rchain);rchain=NULL;} //modyves: this was never freed
  if(Compression)Delete_tmp_file();
  return(N_res);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
movq %r9, 0x90(%rsp)
movq %r8, %rbx
movq %rcx, 0xa8(%rsp)
movq %rdx, 0x80(%rsp)
movq %rsi, 0xa0(%rsp)
leaq 0x8c(%rsp), %rsi
callq 0xd804
movq %rax, 0xb8(%rsp)
testq %rax, %rax
je 0xc80d
andl $0x0, 0x2c(%rsp)
andl $0x0, 0x4c(%rsp)
andw $0x0, 0x14(%rsp)
andl $0x0, 0x48(%rsp)
movl $0x2710, 0x28(%rsp)     # imm = 0x2710
movb $0x0, 0xd(%rsp)
movb $0x55, 0xf(%rsp)
andl $0x0, 0x587ae(%rip)     # 0x64f78
leaq 0x5788f(%rip), %rcx     # 0x64060
xorl %eax, %eax
cmpl %eax, (%rcx)
je 0xc7e3
leaq 0x43719(%rip), %rdi     # 0x4fef7
callq 0x2090
movb (%rbx), %al
movb %al, 0x16(%rsp)
cmpb $0x2a, %al
jne 0xc815
leaq 0x4371e(%rip), %rdi     # 0x4ff12
callq 0x2090
movq $0x0, 0x30(%rsp)
movq $0x0, 0x78(%rsp)
jmp 0xc872
xorl %r15d, %r15d
jmp 0xd33b
pushq $-0x1
popq %r14
cmpb $0x0, 0x1(%rbx,%r14)
leaq 0x1(%r14), %r14
jne 0xc819
cmpl $0x2, %r14d
pushq $0x1
popq %rax
cmovael %r14d, %eax
movq %rax, 0x30(%rsp)
leaq (,%rax,4), %rdi
callq 0x21d0
cmpq $0x1, %r14
adcq $0x0, %r14
xorl %ecx, %ecx
cmpq %rcx, %r14
je 0xc85a
andl $0x0, (%rax,%rcx,4)
incq %rcx
jmp 0xc84c
movq %rax, 0x78(%rsp)
leaq 0x43434(%rip), %rdi     # 0x4fc9a
movq 0x30(%rsp), %rsi
xorl %eax, %eax
callq 0x20f0
movq 0xa0(%rsp), %rax
andl $0x0, (%rax)
leaq 0x3c(%rsp), %rax
movl $0x787878, (%rax)       # imm = 0x787878
leaq 0x58621(%rip), %rax     # 0x64eb0
movq %rax, 0xb0(%rsp)
movb $0x20, %al
movl %eax, 0x1c(%rsp)
movb $0x20, %r15b
movb $0x20, 0xe(%rsp)
movq $0x0, 0x20(%rsp)
xorl %ecx, %ecx
movl $0x0, 0x10(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0x58(%rsp)
movq %rax, 0x98(%rsp)
movq $0x0, 0x50(%rsp)
movw %cx, 0xa(%rsp)
leaq 0xc0(%rsp), %rdi
movl $0xc8, %esi
movq 0xb8(%rsp), %rdx
callq 0x2170
movsbl %r15b, %r14d
movsbl 0xe(%rsp), %r12d
movslq 0x30(%rsp), %r13
testq %rax, %rax
je 0xd283
movl 0xc0(%rsp), %ebp
xorl %r8d, %r8d
cmpl $0x4d4f5441, %ebp       # imm = 0x4D4F5441
jne 0xc985
movb 0xd5(%rsp), %r15b
cmpb $0x20, %r15b
jne 0xc938
movq 0xb0(%rsp), %rax
movb (%rax), %r15b
movsbl %r15b, %esi
cmpb $0x2a, 0x16(%rsp)
movq %r8, %r12
jne 0xca7e
cmpb 0xd(%rsp), %r15b
movq %rsi, 0x70(%rsp)
je 0xcac5
leaq 0x43397(%rip), %rdi     # 0x4fcf8
xorl %eax, %eax
callq 0x20f0
movq %r12, %r8
movb %r15b, (%rbx,%r13)
movq 0x30(%rsp), %rax
incl %eax
movq %rax, 0x30(%rsp)
movb %r15b, 0xd(%rsp)
jmp 0xcac5
leaq 0xc0(%rsp), %rdi
leaq 0x4328d(%rip), %rsi     # 0x4fc21
pushq $0x6
popq %rdx
callq 0x2200
testl %eax, %eax
je 0xcc78
cmpq $0x0, 0x2c0(%rsp)
leaq 0xc0(%rsp), %rbp
je 0xc9d1
movq %rbp, %rdi
leaq 0x432ec(%rip), %rsi     # 0x4fcad
pushq $0xa
popq %rdx
callq 0x2200
testl %eax, %eax
je 0xce21
movq %rbp, %rdi
leaq 0x432f2(%rip), %rsi     # 0x4fccd
pushq $0x6
popq %rdx
callq 0x2200
testl %eax, %eax
je 0xccaa
movq %rbp, %rdi
leaq 0x43233(%rip), %rsi     # 0x4fc28
pushq $0x3
popq %rdx
callq 0x2200
testl %eax, %eax
jne 0xcd1b
cmpl $0x0, 0x2c(%rsp)
jle 0xcd1b
incq 0xb0(%rsp)
movl 0x44(%rsp), %eax
leaq 0x2c(%rsp), %rdi
leaq 0x4c(%rsp), %rsi
movq 0x80(%rsp), %rdx
movq 0x58(%rsp), %rcx
leaq 0x14(%rsp), %r8
leaq 0x3c(%rsp), %r9
pushq 0x20(%rsp)
pushq %r14
pushq %r12
pushq %rax
leaq 0x37(%rsp), %rax
pushq %rax
pushq 0x78(%rsp)
leaq 0x78(%rsp), %rax
pushq %rax
leaq 0x45(%rsp), %rax
pushq %rax
leaq 0x4f(%rsp), %rax
pushq %rax
leaq 0x70(%rsp), %rax
pushq %rax
callq 0xd8aa
addq $0x50, %rsp
movl $0x0, 0x10(%rsp)
jmp 0xcec7
movzbl (%rbx), %eax
testb $-0x21, %al
jne 0xca8c
movb %r15b, (%rbx)
movb $0x0, 0x1(%rbx)
movq 0x30(%rsp), %rcx
testl %ecx, %ecx
movl $0x0, %eax
cmovgl %ecx, %eax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0xcc9d
leaq 0x1(%rcx), %rdx
cmpb (%rbx,%rcx), %r15b
movq %rdx, %rcx
jne 0xca9d
movq %rsi, 0x70(%rsp)
movq 0x78(%rsp), %rax
movl $0x1, -0x4(%rax,%rdx,4)
movb 0xcc(%rsp), %al
movb 0xcd(%rsp), %dl
cmpb $0x48, %dl
sete %cl
cmpb $0x48, %al
sete %sil
orb %cl, %sil
cmpb $0x44, %dl
sete %cl
cmpb $0x44, %al
sete %dil
orb %cl, %dil
orb %sil, %dil
cmpb $0x1, %dil
jne 0xcb53
leaq 0x5755f(%rip), %rcx     # 0x64060
cmpl $0x0, (%rcx)
movl %r8d, %ecx
movq %rcx, 0x20(%rsp)
movzwl 0xa(%rsp), %ecx
pushq $0x1
popq %rsi
movl %esi, 0x10(%rsp)
je 0xc8d6
cmpb $0x48, %dl
sete %cl
leal -0x31(%rax), %edx
cmpb $0x3, %dl
setb %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0xcb53
movb $0x48, 0xcc(%rsp)
movzwl 0xce(%rsp), %ecx
movw %cx, 0xcd(%rsp)
movb %al, 0xcf(%rsp)
movb 0xd1(%rsp), %al
movb %al, 0x17(%rsp)
movzwl 0xd2(%rsp), %eax
movw %ax, 0x18(%rsp)
movb $0x0, 0x1a(%rsp)
cmpl $0x4d4f5441, %ebp       # imm = 0x4D4F5441
je 0xcbd6
leaq 0x17(%rsp), %rdi
leaq 0x430af(%rip), %rsi     # 0x4fc33
pushq $0x3
popq %rdx
callq 0x2200
pushq $0x1
popq %rdx
movl %edx, %ecx
movq %rcx, 0x20(%rsp)
movzwl 0xa(%rsp), %ecx
movl %edx, 0x10(%rsp)
testl %eax, %eax
je 0xc8d6
leaq 0x17(%rsp), %rdi
leaq 0x43084(%rip), %rsi     # 0x4fc37
pushq $0x3
popq %rdx
callq 0x2200
pushq $0x1
popq %rdx
movl %edx, %ecx
movq %rcx, 0x20(%rsp)
movzwl 0xa(%rsp), %ecx
movl %edx, 0x10(%rsp)
testl %eax, %eax
je 0xc8d6
movb 0xda(%rsp), %al
movb %al, 0xe(%rsp)
movb $0x20, 0xda(%rsp)
leaq 0xd6(%rsp), %rdi
leaq 0x43043(%rip), %rsi     # 0x4fc3b
leaq 0x44(%rsp), %rdx
leaq 0x6c(%rsp), %rcx
leaq 0x68(%rsp), %r8
leaq 0x64(%rsp), %r9
xorl %eax, %eax
callq 0x21f0
movq %r12, %r10
cmpb $0x41, 0x108(%rsp)
jne 0xcc5b
cmpb $0x4c, 0x109(%rsp)
jne 0xcc5b
cmpb $0x54, 0x10a(%rsp)
jne 0xcc5b
movb 0x10b(%rsp), %al
cmpb $0x31, %al
je 0xcc5b
movl %r10d, %ecx
movq %rcx, 0x20(%rsp)
movzwl 0xa(%rsp), %ecx
pushq $0x1
popq %rdx
movl %edx, 0x10(%rsp)
cmpb $0x20, %al
jne 0xc8d6
movb 0xd0(%rsp), %bpl
cmpb $0x20, %bpl
jne 0xced3
movl 0x1c(%rsp), %eax
movl %eax, %ebp
jmp 0xcf07
movzwl 0xa(%rsp), %eax
movl %eax, %ecx
pushq $0x1
popq %rax
movl %eax, %r8d
cmpl $0x0, 0x10(%rsp)
movl $0x0, 0x10(%rsp)
jne 0xc91f
jmp 0xc8d6
movl %r8d, %eax
movq %rax, 0x20(%rsp)
jmp 0xd24b
leaq 0xc8(%rsp), %rdi
leaq 0x43003(%rip), %rsi     # 0x4fcbc
leaq 0x210(%rsp), %r14
movq %r14, %rdx
leaq 0x1c0(%rsp), %rcx
xorl %eax, %eax
callq 0x21f0
movq %r14, %rdi
leaq 0x42ff7(%rip), %rsi     # 0x4fcd4
pushq $0x3
popq %rdx
callq 0x2200
testl %eax, %eax
je 0xcd08
leaq 0x1c0(%rsp), %rdi
leaq 0x42fdc(%rip), %rsi     # 0x4fcd4
pushq $0x3
popq %rdx
callq 0x2200
testl %eax, %eax
jne 0xcec7
movq 0xa0(%rsp), %rax
movl $0x1, (%rax)
jmp 0xcec7
movq %rbp, %rdi
leaq 0x42fb3(%rip), %rsi     # 0x4fcd8
pushq $0x6
popq %rdx
callq 0x2200
testl %eax, %eax
je 0xd108
movq %rbp, %rdi
leaq 0x42eed(%rip), %rsi     # 0x4fc2c
pushq $0x6
popq %rdx
callq 0x2200
testl %eax, %eax
je 0xd283
movq %rbp, %rdi
leaq 0x42f86(%rip), %rsi     # 0x4fcdf
pushq $0x6
popq %rdx
callq 0x2200
movzwl 0xa(%rsp), %ecx
testl %eax, %eax
jne 0xc8d6
movq 0x90(%rsp), %rax
cmpl $0x0, (%rax)
jne 0xcd89
movq 0x90(%rsp), %rax
movl $0x1, (%rax)
movq 0x98(%rsp), %r14
leaq 0x20(%r14), %rdx
leaq 0x30(%r14), %rcx
leaq 0x40(%r14), %r8
leaq 0x24(%r14), %r9
leaq 0x28(%r14), %r10
leaq 0x34(%r14), %r11
leaq 0xdc(%rsp), %rdi
leaq 0x42f2e(%rip), %rsi     # 0x4fce6
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x21f0
addq $0x10, %rsp
movq %r14, %rax
xorl %ecx, %ecx
movsd 0x42d44(%rip), %xmm1    # 0x4fb18
pushq $0x8
popq %r8
cmpq $0x3, %rcx
je 0xcec7
movq %r8, %rdx
movq %r8, %rsi
leaq (%rcx,%rsi), %rdi
cmpq $0xb, %rdi
je 0xce18
cvtss2sd (%rax,%rsi,4), %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rax,%rsi,4)
cmpq $0x8, %rdx
je 0xce0f
movss %xmm0, (%rax,%rdx,4)
incq %rsi
addq $0x3, %rdx
jmp 0xcde8
incq %rcx
addq $0x10, %rax
jmp 0xcdd8
leaq 0xcc(%rsp), %rdi
leaq 0x42e88(%rip), %rsi     # 0x4fcb8
leaq 0x210(%rsp), %r14
movq %r14, %rdx
leaq 0x1c0(%rsp), %rcx
leaq 0x260(%rsp), %r8
leaq 0x190(%rsp), %r9
xorl %eax, %eax
callq 0x21f0
movq %r14, %rdi
leaq 0x42e5d(%rip), %rsi     # 0x4fcc1
pushq $0xb
popq %rdx
callq 0x2200
testl %eax, %eax
jne 0xcec7
cmpl $0x4c4c554e, 0x190(%rsp) # imm = 0x4C4C554E
je 0xcec7
leaq 0x190(%rsp), %rdi
leaq 0x42db8(%rip), %rsi     # 0x4fc44
movq 0x2c0(%rsp), %rdx
xorl %eax, %eax
callq 0x21f0
movabsq $0x294e49564c454b28, %rax # imm = 0x294E49564C454B28
cmpq %rax, 0x1c0(%rsp)
je 0xcec7
movq 0x2c0(%rsp), %rax
movss (%rax), %xmm0
addss 0x42c4d(%rip), %xmm0    # 0x4fb10
movss %xmm0, (%rax)
movzwl 0xa(%rsp), %eax
movl %eax, %ecx
jmp 0xc8d6
movl 0x1c(%rsp), %edx
cmpb $0x20, %dl
movzbl %bpl, %eax
movzbl %dl, %edx
cmovel %eax, %edx
movl %r10d, %eax
movq %rax, 0x20(%rsp)
movzwl 0xa(%rsp), %eax
movl %eax, %ecx
pushq $0x1
popq %rax
movl %eax, 0x10(%rsp)
movl %edx, 0x1c(%rsp)
cmpb %dl, %bpl
jne 0xc8d6
movb 0xf(%rsp), %al
movl 0x44(%rsp), %r14d
movl 0x28(%rsp), %ecx
movb 0xe(%rsp), %dl
cmpb %al, %dl
jne 0xcf51
cmpl %ecx, %r14d
setne %cl
cmpb %al, %dl
setne %al
orb %cl, %al
jne 0xcfea
leaq 0x17(%rsp), %rdi
leaq 0x3c(%rsp), %rsi
pushq $0x3
popq %rdx
callq 0x2070
movq %r12, %r10
testl %eax, %eax
jne 0xcfea
jmp 0xd044
cmpl %ecx, %r14d
jne 0xcfea
movw $0x1, %cx
movl %r10d, %eax
movq %rax, 0x20(%rsp)
movl %ebp, %eax
movl %eax, 0x1c(%rsp)
pushq $0x1
popq %rax
movl %eax, 0x10(%rsp)
cmpw $0x0, 0xa(%rsp)
jne 0xc8d6
cvtss2sd 0x6c(%rsp), %xmm0
movq 0x58(%rsp), %rax
subsd (%rax), %xmm0
cvtsd2ss %xmm0, %xmm0
cvtss2sd 0x68(%rsp), %xmm1
subsd 0x8(%rax), %xmm1
cvtsd2ss %xmm1, %xmm1
cvtss2sd 0x64(%rsp), %xmm2
subsd 0x10(%rax), %xmm2
cvtsd2ss %xmm2, %xmm2
mulss %xmm1, %xmm1
mulss %xmm0, %xmm0
addss %xmm1, %xmm0
mulss %xmm2, %xmm2
addss %xmm0, %xmm2
movss 0x42b48(%rip), %xmm0    # 0x4fb14
ucomiss %xmm2, %xmm0
movl %r10d, %eax
movq %rax, 0x20(%rsp)
movl %ebp, %eax
movl %eax, 0x1c(%rsp)
pushq $0x1
popq %rax
movl %eax, 0x10(%rsp)
ja 0xc8d6
movsbl 0xe(%rsp), %eax
leaq 0x2c(%rsp), %rdi
leaq 0x4c(%rsp), %rsi
movq 0x80(%rsp), %rdx
movq 0x58(%rsp), %rcx
leaq 0x14(%rsp), %r8
leaq 0x3c(%rsp), %r9
pushq %r10
pushq 0x78(%rsp)
pushq %rax
pushq %r14
leaq 0x37(%rsp), %rax
pushq %rax
pushq 0x78(%rsp)
leaq 0x78(%rsp), %rax
pushq %rax
leaq 0x45(%rsp), %rax
pushq %rax
leaq 0x4f(%rsp), %rax
pushq %rax
leaq 0x70(%rsp), %rax
pushq %rax
callq 0xd8aa
addq $0x50, %rsp
movslq 0x57f2d(%rip), %rax     # 0x64f78
imulq $0x70, %rax, %rcx
movq 0xa8(%rsp), %rsi
leaq (%rsi,%rcx), %r14
movzwl 0x14(%rsp), %edx
testw %dx, %dx
movq 0x58(%rsp), %rdi
cmoveq %r14, %rdi
movq %rdi, 0x58(%rsp)
incl %edx
movw %dx, 0x14(%rsp)
incl %eax
movss 0x68(%rsp), %xmm0
movss 0x6c(%rsp), %xmm1
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
cvtps2pd %xmm1, %xmm0
movl %eax, 0x57ee6(%rip)     # 0x64f78
movups %xmm0, (%rsi,%rcx)
cvtss2sd 0x64(%rsp), %xmm0
movsd %xmm0, 0x10(%rsi,%rcx)
cmpb $0x20, 0xcc(%rsp)
jne 0xd0d7
cmpb $0x20, 0xcd(%rsp)
jne 0xd1ae
xorl %eax, %eax
cmpq $0x3, %rax
je 0xd1c7
movb 0xce(%rsp,%rax), %cl
movb %cl, 0x18(%r14,%rax)
incq %rax
jmp 0xd0bc
cmpw $0x4553, 0xcc(%rsp)     # imm = 0x4553
jne 0xd0eb
movb $0x44, 0xcd(%rsp)
xorl %eax, %eax
cmpq $0x3, %rax
je 0xd1c7
movb 0xcc(%rsp,%rax), %cl
movb %cl, 0x18(%r14,%rax)
incq %rax
jmp 0xd0ed
movb 0xcc(%rsp), %al
movq 0x50(%rsp), %rsi
movslq %esi, %r14
leaq (%r14,%r14,4), %rcx
leaq 0x57e5e(%rip), %r12     # 0x64f80
leaq (%r12,%rcx), %r13
movb %al, (%r12,%rcx)
movb 0xd8(%rsp), %al
leaq 0x58618(%rip), %rdx     # 0x65750
movb %al, (%rdx,%rcx)
movb 0xcd(%rsp), %al
movb %al, 0x1(%r12,%rcx)
movb 0xd9(%rsp), %al
movb %al, 0x1(%rdx,%rcx)
movb 0xce(%rsp), %al
movb %al, 0x2(%r12,%rcx)
movb 0xda(%rsp), %al
movb %al, 0x2(%rdx,%rcx)
testl %r14d, %r14d
movl $0x0, %eax
cmovgl %esi, %eax
movl %eax, 0x70(%rsp)
testq %r14, %r14
movl $0x0, %eax
cmovleq %rax, %r14
xorl %ebp, %ebp
cmpq %rbp, %r14
je 0xd25e
movq %r12, %rdi
movq %r13, %rsi
pushq $0x3
popq %rdx
callq 0x2070
testl %eax, %eax
je 0xd264
incq %rbp
addq $0x5, %r12
jmp 0xd186
xorl %eax, %eax
cmpq $0x3, %rax
je 0xd1c7
movb 0xcd(%rsp,%rax), %cl
movb %cl, 0x18(%r14,%rax)
incq %rax
jmp 0xd1b0
movb $0x0, 0x1b(%r14)
leaq 0x1c(%r14), %rdx
cmpb $0x20, 0xfe(%rsp)
jne 0xd1df
andl $0x0, (%rdx)
jmp 0xd1f5
leaq 0xfc(%rsp), %rdi
leaq 0x42a56(%rip), %rsi     # 0x4fc44
xorl %eax, %eax
callq 0x21f0
cmpb $0x20, 0xfc(%rsp)
je 0xd207
movb $0x20, 0xfc(%rsp)
leaq 0x44(%r14), %rdx
cmpb $0x20, 0xf8(%rsp)
jne 0xd21a
andl $0x0, (%rdx)
jmp 0xd230
leaq 0xf6(%rsp), %rdi
leaq 0x42a1b(%rip), %rsi     # 0x4fc44
xorl %eax, %eax
callq 0x21f0
movq %r12, %rax
movq %r14, 0x98(%rsp)
andl $0x0, 0x6c(%r14)
movq %rax, 0x20(%rsp)
movl %ebp, %eax
movl %eax, 0x1c(%rsp)
movzwl 0xa(%rsp), %eax
movl %eax, %ecx
pushq $0x1
popq %rax
movl %eax, 0x10(%rsp)
jmp 0xc8d6
movl 0x70(%rsp), %edx
jmp 0xd266
movl %ebp, %edx
xorl %eax, %eax
movq 0x50(%rsp), %rcx
cmpl %ecx, %edx
sete %al
addl %ecx, %eax
movzwl 0xa(%rsp), %ecx
movq %rax, 0x50(%rsp)
jmp 0xc8d6
movl 0x44(%rsp), %eax
leaq 0x2c(%rsp), %r15
leaq 0x4c(%rsp), %rsi
leaq 0x14(%rsp), %r8
leaq 0x3c(%rsp), %r9
movq %r15, %rdi
movq 0x80(%rsp), %rdx
movq 0x58(%rsp), %rcx
pushq 0x20(%rsp)
pushq %r14
pushq %r12
pushq %rax
leaq 0x37(%rsp), %rax
pushq %rax
pushq 0x78(%rsp)
leaq 0x78(%rsp), %rax
pushq %rax
leaq 0x45(%rsp), %rax
pushq %rax
leaq 0x4f(%rsp), %rax
pushq %rax
leaq 0x70(%rsp), %rax
pushq %rax
callq 0xd8aa
addq $0x50, %rsp
movl (%r15), %r15d
leaq 0x57ba7(%rip), %rax     # 0x64e90
movl (%rax), %esi
cmpl %esi, %r15d
jg 0xd350
movq 0xb8(%rsp), %rdi
callq 0x20c0
leaq 0x42a2c(%rip), %rdi     # 0x4fd30
movl %r15d, %esi
movq 0x30(%rsp), %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x20f0
movb $0x0, (%rbx,%r13)
cmpb $0x2a, 0x16(%rsp)
je 0xd32c
movq 0x78(%rsp), %rdi
callq 0x2050
cmpl $0x0, 0x8c(%rsp)
je 0xd33b
callq 0xea57
movl %r15d, %eax
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x429b3(%rip), %rdi     # 0x4fd0a
xorl %eax, %eax
callq 0x20f0
pushq $0x8
popq %rdi
callq 0x2270