// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x398, %rsp            # imm = 0x398
movq 0x10(%rbp), %rax
movq %rdi, -0x38(%rbp)
movq %rsi, -0x40(%rbp)
movq %rdx, -0x48(%rbp)
movq %rcx, -0x50(%rbp)
movq %r8, -0x58(%rbp)
movq %r9, -0x60(%rbp)
movq -0x38(%rbp), %rdi
leaq -0x64(%rbp), %rsi
callq 0x117a0
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x70(%rbp)
jne 0xfee4
movl $0x0, -0x2c(%rbp)
jmp 0x10fe3
movl $0x0, -0x74(%rbp)
movl $0x0, -0x78(%rbp)
movl $0x0, -0x7c(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x158(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x160(%rbp)
movw $0x0, -0x162(%rbp)
movw $0x0, -0x164(%rbp)
movl $0x0, -0x168(%rbp)
movl $0x0, -0x16c(%rbp)
movl $0x2710, -0x17c(%rbp)   # imm = 0x2710
movb $0x20, -0x17e(%rbp)
movb $0x0, -0x17f(%rbp)
movb $0x20, -0x180(%rbp)
movb $0x20, -0x18b(%rbp)
movb $0x55, -0x18c(%rbp)
movl $0x0, -0x19c(%rbp)
movl $0x0, -0x1a4(%rbp)
movl $0x0, -0x1a8(%rbp)
movq $0x0, -0x1b0(%rbp)
movl $0x0, -0x1b4(%rbp)
leaq 0x7ced4(%rip), %rax     # 0x8ce70
movq %rax, -0x1c0(%rbp)
movl $0x0, 0x7cf8b(%rip)     # 0x8cf38
leaq 0x7c06c(%rip), %rax     # 0x8c020
cmpl $0x0, (%rax)
je 0xffc7
leaq 0x6ae08(%rip), %rdi     # 0x7adc8
movb $0x0, %al
callq 0x10d0
movq -0x58(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2a, %eax
jne 0xfff0
movl $0x1, -0x1b4(%rbp)
leaq 0x6ae00(%rip), %rdi     # 0x7ade4
movb $0x0, %al
callq 0x10d0
jmp 0x100a7
movl $0x0, -0x170(%rbp)
movq -0x58(%rbp), %rax
movslq -0x170(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x1001f
movl -0x170(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x170(%rbp)
jmp 0xfffa
movl -0x170(%rbp), %eax
movl %eax, -0x19c(%rbp)
cmpl $0x0, -0x19c(%rbp)
jne 0x1003e
movl $0x1, -0x19c(%rbp)
movslq -0x19c(%rbp), %rdi
shlq $0x2, %rdi
callq 0x1180
movq %rax, -0x1b0(%rbp)
movl $0x0, -0x170(%rbp)
movl -0x170(%rbp), %eax
cmpl -0x19c(%rbp), %eax
jge 0x10093
movq -0x1b0(%rbp), %rax
movslq -0x170(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movl -0x170(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x170(%rbp)
jmp 0x1005f
movl -0x19c(%rbp), %esi
leaq 0x6ad61(%rip), %rdi     # 0x7ae01
movb $0x0, %al
callq 0x10d0
movq -0x40(%rbp), %rax
movl $0x0, (%rax)
leaq -0x18a(%rbp), %rdi
leaq 0x6ac87(%rip), %rsi     # 0x7ad46
callq 0x1060
leaq -0x150(%rbp), %rdi
movq -0x70(%rbp), %rdx
movl $0xc8, %esi
callq 0x1130
cmpq $0x0, %rax
je 0x10e98
leaq -0x150(%rbp), %rdi
leaq 0x6ac59(%rip), %rsi     # 0x7ad4a
movl $0x4, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x10122
movl $0x0, -0x168(%rbp)
cmpl $0x0, -0x1a8(%rbp)
jne 0x1011d
movl $0x1, -0x1a8(%rbp)
jmp 0x106f9
leaq -0x150(%rbp), %rdi
leaq 0x6ac1f(%rip), %rsi     # 0x7ad4f
movl $0x6, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x1015c
cmpl $0x0, -0x1a8(%rbp)
jne 0x1014d
jmp 0x100c4
movl $0x1, -0x168(%rbp)
jmp 0x106f7
cmpq $0x0, 0x10(%rbp)
je 0x10248
leaq -0x150(%rbp), %rdi
leaq 0x6ac9f(%rip), %rsi     # 0x7ae14
movl $0xa, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x10248
leaq -0x150(%rbp), %rdi
addq $0xc, %rdi
leaq -0x1f0(%rbp), %rdx
leaq -0x220(%rbp), %rcx
leaq -0x250(%rbp), %r8
leaq -0x280(%rbp), %r9
leaq 0x6ac69(%rip), %rsi     # 0x7ae1f
movb $0x0, %al
callq 0x11a0
leaq -0x1f0(%rbp), %rdi
leaq 0x6ac5d(%rip), %rsi     # 0x7ae28
movl $0xb, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x10243
leaq -0x280(%rbp), %rdi
leaq 0x6ac4c(%rip), %rsi     # 0x7ae34
movl $0x4, %edx
callq 0x1050
cmpl $0x0, %eax
je 0x10243
leaq -0x280(%rbp), %rdi
movq 0x10(%rbp), %rdx
leaq 0x6ab69(%rip), %rsi     # 0x7ad72
movb $0x0, %al
callq 0x11a0
leaq -0x220(%rbp), %rdi
leaq 0x6ac1b(%rip), %rsi     # 0x7ae39
movl $0x8, %edx
callq 0x1050
cmpl $0x0, %eax
je 0x10241
movq 0x10(%rbp), %rax
movss 0x6a9e7(%rip), %xmm0    # 0x7ac20
addss (%rax), %xmm0
movss %xmm0, (%rax)
jmp 0x10243
jmp 0x100c4
leaq -0x150(%rbp), %rdi
leaq 0x6abec(%rip), %rsi     # 0x7ae42
movl $0x6, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x102e3
leaq -0x150(%rbp), %rdi
addq $0x8, %rdi
leaq -0x2d0(%rbp), %rdx
leaq -0x320(%rbp), %rcx
leaq 0x6ab9e(%rip), %rsi     # 0x7ae23
movb $0x0, %al
callq 0x11a0
leaq -0x2d0(%rbp), %rdi
leaq 0x6abaf(%rip), %rsi     # 0x7ae49
movl $0x3, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x102b5
movq -0x40(%rbp), %rax
movl $0x1, (%rax)
jmp 0x102de
leaq -0x320(%rbp), %rdi
leaq 0x6ab86(%rip), %rsi     # 0x7ae49
movl $0x3, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x102dc
movq -0x40(%rbp), %rax
movl $0x1, (%rax)
jmp 0x102de
jmp 0x100c4
leaq -0x150(%rbp), %rdi
leaq 0x6aa65(%rip), %rsi     # 0x7ad56
movl $0x3, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x103e7
cmpl $0x0, -0x74(%rbp)
jle 0x103e7
movq -0x1c0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1c0(%rbp)
movq -0x48(%rbp), %rdx
movq -0x160(%rbp), %rcx
leaq -0x18a(%rbp), %r9
movl -0x78(%rbp), %r15d
leaq -0x185(%rbp), %r14
movl -0x178(%rbp), %ebx
movb -0x18b(%rbp), %r11b
movb -0x180(%rbp), %r10b
movl -0x168(%rbp), %eax
movl %eax, -0x348(%rbp)
leaq -0x74(%rbp), %rdi
leaq -0x7c(%rbp), %rsi
leaq -0x162(%rbp), %r8
leaq -0x17c(%rbp), %rax
leaq -0x18c(%rbp), %r12
movq %r12, -0x350(%rbp)
leaq -0x17f(%rbp), %r13
leaq -0x16c(%rbp), %r12
movq %rax, (%rsp)
movq -0x350(%rbp), %rax
movq %rax, 0x8(%rsp)
movl -0x348(%rbp), %eax
movq %r13, 0x10(%rsp)
movq %r12, 0x18(%rsp)
movl %r15d, 0x20(%rsp)
movq %r14, 0x28(%rsp)
movl %ebx, 0x30(%rsp)
movsbl %r11b, %r11d
movl %r11d, 0x38(%rsp)
movsbl %r10b, %r10d
movl %r10d, 0x40(%rsp)
movl %eax, 0x48(%rsp)
callq 0x11880
movl $0x0, -0x1a8(%rbp)
jmp 0x100c4
leaq -0x150(%rbp), %rdi
leaq 0x6aa58(%rip), %rsi     # 0x7ae4d
movl $0x6, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x10521
movb -0x144(%rbp), %cl
movslq -0x78(%rbp), %rdx
leaq 0x7cb27(%rip), %rax     # 0x8cf40
imulq $0x5, %rdx, %rdx
addq %rdx, %rax
movb %cl, (%rax)
movb -0x138(%rbp), %cl
movslq -0x78(%rbp), %rdx
leaq 0x7d2dd(%rip), %rax     # 0x8d710
imulq $0x5, %rdx, %rdx
addq %rdx, %rax
movb %cl, (%rax)
movb -0x143(%rbp), %cl
movslq -0x78(%rbp), %rdx
leaq 0x7caf3(%rip), %rax     # 0x8cf40
imulq $0x5, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0x1(%rax)
movb -0x137(%rbp), %cl
movslq -0x78(%rbp), %rdx
leaq 0x7d2a8(%rip), %rax     # 0x8d710
imulq $0x5, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0x1(%rax)
movb -0x142(%rbp), %cl
movslq -0x78(%rbp), %rdx
leaq 0x7cabd(%rip), %rax     # 0x8cf40
imulq $0x5, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0x2(%rax)
movb -0x136(%rbp), %cl
movslq -0x78(%rbp), %rdx
leaq 0x7d272(%rip), %rax     # 0x8d710
imulq $0x5, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0x2(%rax)
movl $0x0, -0x174(%rbp)
movl -0x174(%rbp), %eax
cmpl -0x78(%rbp), %eax
jge 0x10508
movslq -0x174(%rbp), %rax
leaq 0x7ca75(%rip), %rdi     # 0x8cf40
imulq $0x5, %rax, %rax
addq %rax, %rdi
movslq -0x78(%rbp), %rax
leaq 0x7ca63(%rip), %rsi     # 0x8cf40
imulq $0x5, %rax, %rax
addq %rax, %rsi
movl $0x3, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x104f5
jmp 0x10508
jmp 0x104f7
movl -0x174(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x174(%rbp)
jmp 0x104b2
movl -0x174(%rbp), %eax
cmpl -0x78(%rbp), %eax
jne 0x1051c
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0x100c4
leaq -0x150(%rbp), %rdi
leaq 0x6a82b(%rip), %rsi     # 0x7ad5a
movl $0x6, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x10543
jmp 0x10e98
leaq -0x150(%rbp), %rdi
leaq 0x6a903(%rip), %rsi     # 0x7ae54
movl $0x6, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x106f2
movq -0x60(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x10577
movq -0x60(%rbp), %rax
movl $0x1, (%rax)
leaq -0x150(%rbp), %rdi
addq $0x1c, %rdi
movq -0x158(%rbp), %rdx
addq $0x20, %rdx
movq -0x158(%rbp), %rcx
addq $0x20, %rcx
addq $0xc, %rcx
addq $0x4, %rcx
movq -0x158(%rbp), %r8
addq $0x20, %r8
addq $0x18, %r8
addq $0x8, %r8
movq -0x158(%rbp), %r9
addq $0x20, %r9
addq $0x4, %r9
movq -0x158(%rbp), %r10
addq $0x20, %r10
addq $0x8, %r10
movq -0x158(%rbp), %rax
addq $0x20, %rax
addq $0xc, %rax
addq $0x8, %rax
leaq 0x6a870(%rip), %rsi     # 0x7ae5b
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x11a0
movl $0x0, -0x324(%rbp)
cmpl $0x3, -0x324(%rbp)
jge 0x106ed
movl -0x324(%rbp), %eax
movl %eax, -0x328(%rbp)
cmpl $0x3, -0x328(%rbp)
jge 0x106d7
movq -0x158(%rbp), %rax
addq $0x20, %rax
movslq -0x324(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movslq -0x328(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x6a5bc(%rip), %xmm1    # 0x7ac18
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rax,%rcx,4)
movl -0x328(%rbp), %eax
cmpl -0x324(%rbp), %eax
je 0x106c1
movq -0x158(%rbp), %rax
addq $0x20, %rax
movslq -0x324(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movslq -0x328(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
movq -0x158(%rbp), %rax
addq $0x20, %rax
movslq -0x328(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movslq -0x324(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
jmp 0x106c3
movl -0x328(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x328(%rbp)
jmp 0x1061e
jmp 0x106d9
movl -0x324(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x324(%rbp)
jmp 0x10605
jmp 0x100c4
jmp 0x100c4
jmp 0x106f9
movb -0x13b(%rbp), %al
movb %al, -0x180(%rbp)
movsbl -0x180(%rbp), %eax
cmpl $0x20, %eax
jne 0x10720
movq -0x1c0(%rbp), %rax
movb (%rax), %al
movb %al, -0x180(%rbp)
cmpl $0x0, -0x1b4(%rbp)
je 0x10784
movsbl -0x180(%rbp), %eax
movsbl -0x17f(%rbp), %ecx
cmpl %ecx, %eax
je 0x1077f
movsbl -0x180(%rbp), %esi
leaq 0x6a724(%rip), %rdi     # 0x7ae6d
movb $0x0, %al
callq 0x10d0
movb -0x180(%rbp), %dl
movq -0x58(%rbp), %rax
movslq -0x19c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x19c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x19c(%rbp)
movb -0x180(%rbp), %al
movb %al, -0x17f(%rbp)
jmp 0x10811
movq -0x58(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
je 0x1079c
movq -0x58(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x107b0
movb -0x180(%rbp), %cl
movq -0x58(%rbp), %rax
movb %cl, (%rax)
movq -0x58(%rbp), %rax
movb $0x0, 0x1(%rax)
movl $0x0, -0x1a0(%rbp)
movl -0x1a0(%rbp), %eax
cmpl -0x19c(%rbp), %eax
jge 0x1080c
movsbl -0x180(%rbp), %eax
movq -0x58(%rbp), %rcx
movslq -0x1a0(%rbp), %rdx
movsbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jne 0x107f9
movq -0x1b0(%rbp), %rax
movslq -0x1a0(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
jmp 0x10813
jmp 0x107fb
movl -0x1a0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1a0(%rbp)
jmp 0x107ba
jmp 0x100c4
jmp 0x10813
movsbl -0x143(%rbp), %eax
cmpl $0x48, %eax
je 0x10847
movsbl -0x144(%rbp), %eax
cmpl $0x48, %eax
je 0x10847
movsbl -0x143(%rbp), %eax
cmpl $0x44, %eax
je 0x10847
movsbl -0x144(%rbp), %eax
cmpl $0x44, %eax
jne 0x108d1
leaq 0x7b7d2(%rip), %rax     # 0x8c020
cmpl $0x0, (%rax)
jne 0x10858
jmp 0x100c4
movsbl -0x143(%rbp), %eax
cmpl $0x48, %eax
jne 0x108cd
movsbl -0x144(%rbp), %eax
cmpl $0x20, %eax
je 0x108cd
movb -0x144(%rbp), %al
movb %al, -0x329(%rbp)
movsbl -0x329(%rbp), %eax
cmpl $0x31, %eax
je 0x108a0
movsbl -0x329(%rbp), %eax
cmpl $0x32, %eax
je 0x108a0
movsbl -0x329(%rbp), %eax
cmpl $0x33, %eax
jne 0x108cb
movb $0x48, -0x144(%rbp)
movb -0x142(%rbp), %al
movb %al, -0x143(%rbp)
movb -0x141(%rbp), %al
movb %al, -0x142(%rbp)
movb -0x329(%rbp), %al
movb %al, -0x141(%rbp)
jmp 0x108cd
jmp 0x108cf
jmp 0x108d1
movb -0x13f(%rbp), %al
movb %al, -0x185(%rbp)
movb -0x13e(%rbp), %al
movb %al, -0x184(%rbp)
movb -0x13d(%rbp), %al
movb %al, -0x183(%rbp)
movb $0x0, -0x182(%rbp)
cmpl $0x1, -0x168(%rbp)
jne 0x10944
leaq -0x185(%rbp), %rdi
leaq 0x6a44e(%rip), %rsi     # 0x7ad61
movl $0x3, %edx
callq 0x1050
cmpl $0x0, %eax
je 0x1093f
leaq -0x185(%rbp), %rdi
leaq 0x6a435(%rip), %rsi     # 0x7ad65
movl $0x3, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x10944
jmp 0x100c4
movb -0x136(%rbp), %al
movb %al, -0x18b(%rbp)
movb $0x20, -0x136(%rbp)
leaq -0x150(%rbp), %rdi
addq $0x16, %rdi
leaq 0x6a400(%rip), %rsi     # 0x7ad69
leaq -0x178(%rbp), %rdx
leaq -0x190(%rbp), %rcx
leaq -0x194(%rbp), %r8
leaq -0x198(%rbp), %r9
movb $0x0, %al
callq 0x11a0
movsbl -0x108(%rbp), %eax
cmpl $0x41, %eax
jne 0x109cd
movsbl -0x107(%rbp), %eax
cmpl $0x4c, %eax
jne 0x109cd
movsbl -0x106(%rbp), %eax
cmpl $0x54, %eax
jne 0x109cd
movsbl -0x105(%rbp), %eax
cmpl $0x31, %eax
je 0x109cd
movsbl -0x105(%rbp), %eax
cmpl $0x20, %eax
je 0x109cd
jmp 0x100c4
movb -0x140(%rbp), %al
movb %al, -0x17d(%rbp)
movsbl -0x17d(%rbp), %eax
cmpl $0x20, %eax
je 0x10a16
movsbl -0x17e(%rbp), %eax
cmpl $0x20, %eax
jne 0x109fd
movb -0x17d(%rbp), %al
movb %al, -0x17e(%rbp)
movsbl -0x17d(%rbp), %eax
movsbl -0x17e(%rbp), %ecx
cmpl %ecx, %eax
je 0x10a14
jmp 0x100c4
jmp 0x10a16
movsbl -0x18b(%rbp), %eax
movsbl -0x18c(%rbp), %ecx
cmpl %ecx, %eax
je 0x10b2c
movl -0x178(%rbp), %eax
cmpl -0x17c(%rbp), %eax
jne 0x10b2c
movswl -0x164(%rbp), %eax
cmpl $0x1, %eax
jne 0x10a4f
jmp 0x100c4
movq -0x160(%rbp), %rax
movq %rax, -0x338(%rbp)
movss -0x190(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x338(%rbp), %rax
subsd (%rax), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x33c(%rbp)
movss -0x194(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x338(%rbp), %rax
subsd 0x8(%rax), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x340(%rbp)
movss -0x198(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x338(%rbp), %rax
subsd 0x10(%rax), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x344(%rbp)
movss -0x33c(%rbp), %xmm1
movss -0x33c(%rbp), %xmm2
movss -0x340(%rbp), %xmm0
mulss -0x340(%rbp), %xmm0
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movss -0x344(%rbp), %xmm0
movss -0x344(%rbp), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x654f4(%rip), %xmm0    # 0x76008
ucomisd %xmm1, %xmm0
jbe 0x10b28
movw $0x1, -0x164(%rbp)
jmp 0x100c4
jmp 0x10b2a
jmp 0x10b2c
movl -0x178(%rbp), %eax
cmpl -0x17c(%rbp), %eax
jne 0x10b6d
movsbl -0x18b(%rbp), %eax
movsbl -0x18c(%rbp), %ecx
cmpl %ecx, %eax
jne 0x10b6d
leaq -0x185(%rbp), %rdi
leaq -0x18a(%rbp), %rsi
movl $0x3, %edx
callq 0x1050
cmpl $0x0, %eax
je 0x10c25
movq -0x48(%rbp), %rdx
movq -0x160(%rbp), %rcx
leaq -0x18a(%rbp), %r9
movl -0x78(%rbp), %r15d
leaq -0x185(%rbp), %r14
movl -0x178(%rbp), %ebx
movb -0x18b(%rbp), %r11b
movb -0x180(%rbp), %r10b
movl -0x168(%rbp), %eax
movl %eax, -0x354(%rbp)
leaq -0x74(%rbp), %rdi
leaq -0x7c(%rbp), %rsi
leaq -0x162(%rbp), %r8
leaq -0x17c(%rbp), %rax
leaq -0x18c(%rbp), %r12
movq %r12, -0x360(%rbp)
leaq -0x17f(%rbp), %r13
leaq -0x16c(%rbp), %r12
movq %rax, (%rsp)
movq -0x360(%rbp), %rax
movq %rax, 0x8(%rsp)
movl -0x354(%rbp), %eax
movq %r13, 0x10(%rsp)
movq %r12, 0x18(%rsp)
movl %r15d, 0x20(%rsp)
movq %r14, 0x28(%rsp)
movl %ebx, 0x30(%rsp)
movsbl %r11b, %r11d
movl %r11d, 0x38(%rsp)
movsbl %r10b, %r10d
movl %r10d, 0x40(%rsp)
movl %eax, 0x48(%rsp)
callq 0x11880
movq -0x50(%rbp), %rax
movslq 0x7c308(%rip), %rcx     # 0x8cf38
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x158(%rbp)
movswl -0x162(%rbp), %eax
cmpl $0x0, %eax
jne 0x10c58
movq -0x158(%rbp), %rax
movq %rax, -0x160(%rbp)
movw -0x162(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x162(%rbp)
movl 0x7c2c8(%rip), %eax     # 0x8cf38
addl $0x1, %eax
movl %eax, 0x7c2bf(%rip)     # 0x8cf38
movss -0x190(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x158(%rbp), %rax
movsd %xmm0, (%rax)
movss -0x194(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x158(%rbp), %rax
movsd %xmm0, 0x8(%rax)
movss -0x198(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x158(%rbp), %rax
movsd %xmm0, 0x10(%rax)
movsbl -0x144(%rbp), %eax
cmpl $0x20, %eax
je 0x10d41
leaq -0x150(%rbp), %rdi
addq $0xc, %rdi
leaq 0x6a1a1(%rip), %rsi     # 0x7ae7f
movl $0x2, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x10cf4
movb $0x44, -0x143(%rbp)
movl $0x0, -0x1a0(%rbp)
cmpl $0x3, -0x1a0(%rbp)
jge 0x10d3c
movl -0x1a0(%rbp), %eax
addl $0xc, %eax
cltq
movb -0x150(%rbp,%rax), %dl
movq -0x158(%rbp), %rax
movslq -0x1a0(%rbp), %rcx
movb %dl, 0x18(%rax,%rcx)
movl -0x1a0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1a0(%rbp)
jmp 0x10cfe
jmp 0x10de3
movsbl -0x143(%rbp), %eax
cmpl $0x20, %eax
je 0x10d97
movl $0x0, -0x1a0(%rbp)
cmpl $0x3, -0x1a0(%rbp)
jge 0x10d95
movl -0x1a0(%rbp), %eax
addl $0xd, %eax
cltq
movb -0x150(%rbp,%rax), %dl
movq -0x158(%rbp), %rax
movslq -0x1a0(%rbp), %rcx
movb %dl, 0x18(%rax,%rcx)
movl -0x1a0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1a0(%rbp)
jmp 0x10d57
jmp 0x10de1
movl $0x0, -0x1a0(%rbp)
cmpl $0x3, -0x1a0(%rbp)
jge 0x10ddf
movl -0x1a0(%rbp), %eax
addl $0xe, %eax
cltq
movb -0x150(%rbp,%rax), %dl
movq -0x158(%rbp), %rax
movslq -0x1a0(%rbp), %rcx
movb %dl, 0x18(%rax,%rcx)
movl -0x1a0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1a0(%rbp)
jmp 0x10da1
jmp 0x10de1
jmp 0x10de3
movq -0x158(%rbp), %rax
movb $0x0, 0x1b(%rax)
movsbl -0x112(%rbp), %eax
cmpl $0x20, %eax
je 0x10e20
leaq -0x150(%rbp), %rdi
addq $0x3c, %rdi
movq -0x158(%rbp), %rdx
addq $0x1c, %rdx
leaq 0x69f5b(%rip), %rsi     # 0x7ad72
movb $0x0, %al
callq 0x11a0
jmp 0x10e2f
movq -0x158(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x1c(%rax)
movsbl -0x114(%rbp), %eax
cmpl $0x20, %eax
je 0x10e42
movb $0x20, -0x114(%rbp)
movsbl -0x118(%rbp), %eax
cmpl $0x20, %eax
je 0x10e74
leaq -0x150(%rbp), %rdi
addq $0x36, %rdi
movq -0x158(%rbp), %rdx
addq $0x44, %rdx
leaq 0x69f07(%rip), %rsi     # 0x7ad72
movb $0x0, %al
callq 0x11a0
jmp 0x10e83
movq -0x158(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x44(%rax)
movl -0x1a4(%rbp), %ecx
movq -0x158(%rbp), %rax
movl %ecx, 0x6c(%rax)
jmp 0x100c4
movq -0x48(%rbp), %rdx
movq -0x160(%rbp), %rcx
leaq -0x18a(%rbp), %r9
movl -0x78(%rbp), %r15d
leaq -0x185(%rbp), %r14
movl -0x178(%rbp), %ebx
movb -0x18b(%rbp), %r11b
movb -0x180(%rbp), %r10b
movl -0x168(%rbp), %eax
movl %eax, -0x364(%rbp)
leaq -0x74(%rbp), %rdi
leaq -0x7c(%rbp), %rsi
leaq -0x162(%rbp), %r8
leaq -0x17c(%rbp), %rax
leaq -0x18c(%rbp), %r12
movq %r12, -0x370(%rbp)
leaq -0x17f(%rbp), %r13
leaq -0x16c(%rbp), %r12
movq %rax, (%rsp)
movq -0x370(%rbp), %rax
movq %rax, 0x8(%rsp)
movl -0x364(%rbp), %eax
movq %r13, 0x10(%rsp)
movq %r12, 0x18(%rsp)
movl %r15d, 0x20(%rsp)
movq %r14, 0x28(%rsp)
movl %ebx, 0x30(%rsp)
movsbl %r11b, %r11d
movl %r11d, 0x38(%rsp)
movsbl %r10b, %r10d
movl %r10d, 0x40(%rsp)
movl %eax, 0x48(%rsp)
callq 0x11880
movl -0x74(%rbp), %eax
leaq 0x7bef6(%rip), %rcx     # 0x8ce50
cmpl (%rcx), %eax
jle 0x10f7f
leaq 0x7beeb(%rip), %rax     # 0x8ce50
movl (%rax), %esi
leaq 0x69f14(%rip), %rdi     # 0x7ae82
movb $0x0, %al
callq 0x10d0
movl $0x8, %edi
callq 0x1210
movq -0x70(%rbp), %rdi
callq 0x10a0
movl -0x74(%rbp), %esi
movl -0x19c(%rbp), %edx
movq -0x58(%rbp), %rcx
leaq 0x69f0c(%rip), %rdi     # 0x7aea8
movb $0x0, %al
callq 0x10d0
movq -0x58(%rbp), %rax
movslq -0x19c(%rbp), %rcx
movb $0x0, (%rax,%rcx)
cmpl $0x0, -0x1b4(%rbp)
jne 0x10fd2
movq -0x1b0(%rbp), %rdi
callq 0x1040
movq $0x0, -0x1b0(%rbp)
cmpl $0x0, -0x64(%rbp)
je 0x10fdd
callq 0x13090
movl -0x74(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
addq $0x398, %rsp            # imm = 0x398
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax,%rax)