// File: /workspace/github_c_makefile_star2_O1/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 $0x2f8, %rsp            # imm = 0x2F8
movq %r9, 0x98(%rsp)
movq %r8, %rbx
movq %rcx, 0x80(%rsp)
movq %rdx, 0x88(%rsp)
movq %rsi, 0xa0(%rsp)
leaq 0x94(%rsp), %rsi
callq 0xe1e8
testq %rax, %rax
je 0xd0c4
movq %rax, %r14
xorl %eax, %eax
movl %eax, 0x34(%rsp)
movl %eax, 0x54(%rsp)
movw $0x0, 0x10(%rsp)
movl %eax, 0x50(%rsp)
movl $0x2710, 0x2c(%rsp)     # imm = 0x2710
movb $0x0, 0xd(%rsp)
movb $0x55, 0xf(%rsp)
movl %eax, 0x5cef5(%rip)     # 0x69f78
leaq 0x5bfd6(%rip), %rcx     # 0x69060
cmpl %eax, (%rcx)
je 0xd09a
leaq 0x48f37(%rip), %rdi     # 0x55fcc
callq 0x2090
movb (%rbx), %al
movb %al, 0x12(%rsp)
cmpb $0x2a, %al
jne 0xd0cb
leaq 0x48f3c(%rip), %rdi     # 0x55fe7
callq 0x2090
movq $0x0, 0x58(%rsp)
movq $0x0, 0x78(%rsp)
jmp 0xd12d
xorl %ebp, %ebp
jmp 0xdc5e
movq $-0x1, %r15
cmpb $0x0, 0x1(%rbx,%r15)
leaq 0x1(%r15), %r15
jne 0xd0d2
cmpl $0x2, %r15d
movl $0x1, %r12d
cmovael %r15d, %r12d
leaq (,%r12,4), %rdi
callq 0x21d0
cmpq $0x1, %r15
adcq $0x0, %r15
shlq $0x2, %r15
movq %rax, 0x78(%rsp)
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x2110
leaq 0x48be4(%rip), %rdi     # 0x55d02
movq %r12, 0x58(%rsp)
movl %r12d, %esi
xorl %eax, %eax
callq 0x20f0
movq 0xa0(%rsp), %rax
movl $0x0, (%rax)
movl $0x787878, 0x48(%rsp)   # imm = 0x787878
leaq 0xb0(%rsp), %rdi
movl $0xc8, %esi
movq %r14, %rdx
callq 0x2170
testq %rax, %rax
movq %rbx, 0x70(%rsp)
je 0xdb4a
movb $0x20, 0xc(%rsp)
leaq 0x5cd3e(%rip), %rax     # 0x69eb0
movq %rax, 0xa8(%rsp)
movb $0x20, %dl
movq $0x0, 0x38(%rsp)
movq 0x80(%rsp), %rax
movq %rax, %r12
movq %rax, 0x40(%rsp)
xorl %r13d, %r13d
xorl %ebp, %ebp
movb $0x20, %al
movl %eax, 0x60(%rsp)
movq $0x0, 0x18(%rsp)
movl %ebp, %r15d
movl 0xb0(%rsp), %ebp
movl $0x0, %ecx
cmpl $0x4d4f5441, %ebp       # imm = 0x4D4F5441
jne 0xd234
movb 0xc5(%rsp), %r8b
cmpb $0x20, %r8b
jne 0xd1d9
movq 0xa8(%rsp), %rax
movb (%rax), %r8b
cmpb $0x2a, 0x12(%rsp)
movb %r8b, 0xe(%rsp)
jne 0xd35e
cmpb 0xd(%rsp), %r8b
movq %rcx, 0x20(%rsp)
je 0xd3c4
movsbl %r8b, %esi
leaq 0x48b5c(%rip), %rdi     # 0x55d60
xorl %eax, %eax
movq %r14, %r13
movl %r8d, %r14d
callq 0x20f0
movl %r14d, %r8d
movq %r13, %r14
movq 0x58(%rsp), %rcx
movslq %ecx, %rax
movb %r8b, (%rbx,%rax)
incl %ecx
movq %rcx, 0x58(%rsp)
movb %r8b, 0xd(%rsp)
jmp 0xd3c4
movl 0xb0(%rsp), %eax
movl $0x41544548, %ecx       # imm = 0x41544548
xorl %ecx, %eax
movzwl 0xb4(%rsp), %ecx
xorl $0x4d54, %ecx           # imm = 0x4D54
orl %eax, %ecx
je 0xd397
cmpq $0x0, 0x330(%rsp)
movb %dl, 0xe(%rsp)
je 0xd294
movq 0xb0(%rsp), %rax
movabsq $0x32204b52414d4552, %rcx # imm = 0x32204B52414D4552
xorq %rcx, %rax
movzwl 0xb8(%rsp), %ecx
xorq $0x3030, %rcx           # imm = 0x3030
orq %rax, %rcx
je 0xd8a6
movl 0xb0(%rsp), %eax
movl $0x44505845, %ecx       # imm = 0x44505845
xorl %ecx, %eax
movzwl 0xb4(%rsp), %ecx
xorl $0x4154, %ecx           # imm = 0x4154
orl %eax, %ecx
movl %r15d, %ebp
je 0xd6f3
movl 0xb0(%rsp), %eax
movl $0x4554, %ecx           # imm = 0x4554
xorl %ecx, %eax
movzbl 0xb2(%rsp), %ecx
xorl $0x52, %ecx
orw %ax, %cx
jne 0xd784
cmpl $0x0, 0x34(%rsp)
jle 0xd784
incq 0xa8(%rsp)
movl 0x30(%rsp), %eax
movsbl %dl, %r10d
movsbl 0xc(%rsp), %r11d
leaq 0x34(%rsp), %rdi
leaq 0x54(%rsp), %rsi
movq 0x88(%rsp), %rdx
movq 0x40(%rsp), %rcx
leaq 0x10(%rsp), %r8
leaq 0x48(%rsp), %r9
pushq 0x18(%rsp)
pushq %r10
pushq %r11
pushq %rax
leaq 0x33(%rsp), %rax
pushq %rax
pushq 0x60(%rsp)
leaq 0x80(%rsp), %rax
pushq %rax
leaq 0x45(%rsp), %rax
pushq %rax
leaq 0x4f(%rsp), %rax
pushq %rax
leaq 0x74(%rsp), %rax
pushq %rax
callq 0xe2b3
addq $0x50, %rsp
xorl %r13d, %r13d
jmp 0xdaf6
movzbl (%rbx), %eax
testb $-0x21, %al
jne 0xd36c
movb %r8b, (%rbx)
movb $0x0, 0x1(%rbx)
movl $0x1, %r13d
movq 0x58(%rsp), %rax
testl %eax, %eax
jle 0xd3b1
movq %rcx, 0x20(%rsp)
movl %eax, %eax
xorl %ecx, %ecx
cmpb (%rbx,%rcx), %r8b
je 0xd3b8
incq %rcx
cmpq %rcx, %rax
jne 0xd384
jmp 0xd772
movl $0x1, %ecx
testl %r13d, %r13d
jne 0xd1c0
movb %dl, 0xe(%rsp)
xorl %r13d, %r13d
jmp 0xd77c
movl %ecx, %eax
jmp 0xd777
movq 0x78(%rsp), %rax
movl $0x1, (%rax,%rcx,4)
movb 0xbc(%rsp), %al
movb 0xbd(%rsp), %cl
cmpb $0x48, %cl
sete %dl
cmpb $0x48, %al
sete %sil
orb %dl, %sil
cmpb $0x44, %cl
sete %dl
cmpb $0x44, %al
sete %dil
orb %dl, %dil
orb %sil, %dil
cmpb $0x1, %dil
jne 0xd43e
leaq 0x5bc60(%rip), %rdx     # 0x69060
cmpl $0x0, (%rdx)
je 0xd76c
cmpb $0x48, %cl
sete %cl
leal -0x31(%rax), %edx
cmpb $0x3, %dl
setb %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0xd43e
movb $0x48, 0xbc(%rsp)
movzwl 0xbe(%rsp), %ecx
movw %cx, 0xbd(%rsp)
movb %al, 0xbf(%rsp)
movb 0xc1(%rsp), %al
movb %al, 0x13(%rsp)
movzwl 0xc2(%rsp), %eax
movw %ax, 0x14(%rsp)
movb $0x0, 0x16(%rsp)
cmpl $0x4d4f5441, %ebp       # imm = 0x4D4F5441
movl %r15d, %ebp
je 0xd4a6
movzwl 0x13(%rsp), %eax
xorl $0x4f48, %eax           # imm = 0x4F48
movzbl 0x15(%rsp), %ecx
xorl $0x48, %ecx
movl $0x1, %edx
movq %rdx, 0x18(%rsp)
orw %ax, %cx
je 0xd6e8
movzwl 0x13(%rsp), %eax
xorl $0x4f44, %eax           # imm = 0x4F44
movzbl 0x15(%rsp), %ecx
xorl $0x44, %ecx
orw %ax, %cx
je 0xd6e8
movb 0xca(%rsp), %al
movb %al, 0xc(%rsp)
movb $0x20, 0xca(%rsp)
leaq 0xc6(%rsp), %rdi
leaq 0x487db(%rip), %rsi     # 0x55ca3
leaq 0x30(%rsp), %rdx
leaq 0x6c(%rsp), %rcx
leaq 0x68(%rsp), %r8
leaq 0x64(%rsp), %r9
xorl %eax, %eax
callq 0x21f0
cmpb $0x41, 0xf8(%rsp)
movl $0x1, %r13d
jne 0xd520
cmpb $0x4c, 0xf9(%rsp)
jne 0xd520
cmpb $0x54, 0xfa(%rsp)
jne 0xd520
movb 0xfb(%rsp), %al
cmpb $0x31, %al
je 0xd520
cmpb $0x20, %al
je 0xd520
movq 0x20(%rsp), %rax
jmp 0xdaf1
movb 0xc0(%rsp), %al
cmpb $0x20, %al
je 0xd543
movl 0x60(%rsp), %edx
cmpb $0x20, %dl
movzbl %al, %ecx
movzbl %dl, %edx
cmovel %ecx, %edx
movl %edx, 0x60(%rsp)
cmpb %dl, %al
jne 0xd516
movb 0xf(%rsp), %al
cmpb %al, 0xc(%rsp)
je 0xd5bb
movl 0x30(%rsp), %ecx
cmpl 0x2c(%rsp), %ecx
jne 0xd5bb
cmpw $0x1, %bp
je 0xd516
cvtss2sd 0x6c(%rsp), %xmm0
movq 0x40(%rsp), %rcx
subsd (%rcx), %xmm0
cvtsd2ss %xmm0, %xmm0
cvtss2sd 0x68(%rsp), %xmm1
subsd 0x8(%rcx), %xmm1
cvtsd2ss %xmm1, %xmm1
cvtss2sd 0x64(%rsp), %xmm2
subsd 0x10(%rcx), %xmm2
cvtsd2ss %xmm2, %xmm2
mulss %xmm1, %xmm1
mulss %xmm0, %xmm0
addss %xmm1, %xmm0
mulss %xmm2, %xmm2
addss %xmm0, %xmm2
movss 0x485d2(%rip), %xmm0    # 0x55b7c
ucomiss %xmm2, %xmm0
movl $0x1, %ecx
cmoval %ecx, %ebp
ja 0xd516
movl 0x30(%rsp), %r12d
cmpb %al, 0xc(%rsp)
jne 0xd5e5
cmpl 0x2c(%rsp), %r12d
jne 0xd5e5
movl $0x3, %edx
leaq 0x13(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x2070
testl %eax, %eax
je 0xd648
movsbl 0xe(%rsp), %eax
movsbl 0xc(%rsp), %r10d
leaq 0x34(%rsp), %rdi
leaq 0x54(%rsp), %rsi
movq 0x88(%rsp), %rdx
movq 0x40(%rsp), %rcx
leaq 0x10(%rsp), %r8
leaq 0x48(%rsp), %r9
pushq 0x20(%rsp)
pushq %rax
pushq %r10
pushq %r12
leaq 0x33(%rsp), %rax
pushq %rax
pushq 0x60(%rsp)
leaq 0x80(%rsp), %rax
pushq %rax
leaq 0x45(%rsp), %rax
pushq %rax
leaq 0x4f(%rsp), %rax
pushq %rax
leaq 0x74(%rsp), %rax
pushq %rax
callq 0xe2b3
addq $0x50, %rsp
movslq 0x5c929(%rip), %rax     # 0x69f78
imulq $0x70, %rax, %rcx
movq 0x80(%rsp), %rsi
leaq (%rsi,%rcx), %r12
movzwl 0x10(%rsp), %edx
testw %dx, %dx
movq 0x40(%rsp), %rdi
cmoveq %r12, %rdi
movq %rdi, 0x40(%rsp)
incl %edx
movw %dx, 0x10(%rsp)
incl %eax
xorps %xmm0, %xmm0
cvtss2sd 0x6c(%rsp), %xmm0
movl %eax, 0x5c8eb(%rip)     # 0x69f78
movsd %xmm0, (%rsi,%rcx)
xorps %xmm0, %xmm0
cvtss2sd 0x68(%rsp), %xmm0
movsd %xmm0, 0x8(%rsi,%rcx)
xorps %xmm0, %xmm0
cvtss2sd 0x64(%rsp), %xmm0
movsd %xmm0, 0x10(%rsi,%rcx)
cmpb $0x20, 0xbc(%rsp)
jne 0xd976
leaq 0x18(%r12), %rax
cmpb $0x20, 0xbd(%rsp)
jne 0xda5c
leaq 0xbc(%rsp), %rdx
movb 0x4(%rdx), %cl
movb %cl, 0x2(%rax)
movzwl 0x2(%rdx), %ecx
jmp 0xda6e
movl $0x1, %r13d
jmp 0xdaf6
leaq 0xb8(%rsp), %rdi
leaq 0x48622(%rip), %rsi     # 0x55d24
leaq 0x200(%rsp), %rdx
leaq 0x1b0(%rsp), %rcx
xorl %eax, %eax
callq 0x21f0
movl 0x200(%rsp), %eax
movl $0x4d4e, %ecx           # imm = 0x4D4E
xorl %ecx, %eax
movzbl 0x202(%rsp), %ecx
xorl $0x52, %ecx
orw %ax, %cx
je 0xd759
movl 0x1b0(%rsp), %eax
movl $0x4d4e, %ecx           # imm = 0x4D4E
xorl %ecx, %eax
movzbl 0x1b2(%rsp), %ecx
xorl $0x52, %ecx
orw %ax, %cx
jne 0xdaf6
movq 0xa0(%rsp), %rax
movl $0x1, (%rax)
jmp 0xdaf6
movl $0x1, %r13d
movq 0x20(%rsp), %rax
movq %rax, 0x18(%rsp)
movl %r15d, %ebp
jmp 0xdaf6
movl 0xb0(%rsp), %eax
movl $0x52444f4d, %ecx       # imm = 0x52444F4D
xorl %ecx, %eax
movzwl 0xb4(%rsp), %ecx
xorl $0x5345, %ecx           # imm = 0x5345
orl %eax, %ecx
je 0xd9a8
movl 0xb0(%rsp), %eax
movl $0x4d444e45, %ecx       # imm = 0x4D444E45
xorl %ecx, %eax
movzwl 0xb4(%rsp), %ecx
xorl $0x4c44, %ecx           # imm = 0x4C44
orl %eax, %ecx
je 0xdb70
movl 0xb0(%rsp), %eax
movl $0x53494e41, %ecx       # imm = 0x53494E41
xorl %ecx, %eax
movzwl 0xb4(%rsp), %ecx
xorl $0x554f, %ecx           # imm = 0x554F
orl %eax, %ecx
jne 0xdaf6
movq 0x98(%rsp), %rax
cmpl $0x0, (%rax)
jne 0xd80b
movq 0x98(%rsp), %rax
movl $0x1, (%rax)
leaq 0x20(%r12), %rdx
leaq 0x30(%r12), %rcx
leaq 0x40(%r12), %r8
leaq 0x24(%r12), %r9
leaq 0x28(%r12), %r10
leaq 0x34(%r12), %r11
leaq 0xcc(%rsp), %rdi
leaq 0x48516(%rip), %rsi     # 0x55d4e
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x21f0
addq $0x10, %rsp
movl $0x20, %eax
xorl %ecx, %ecx
movsd 0x4832a(%rip), %xmm1    # 0x55b80
movl $0x3, %edx
movq %rax, %rsi
movq %rax, %rdi
xorps %xmm0, %xmm0
cvtss2sd (%r12,%rdi), %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%r12,%rdi)
cmpq $0x3, %rdx
je 0xd884
movss %xmm0, (%r12,%rsi)
decq %rdx
addq $0x4, %rdi
addq $0xc, %rsi
cmpq %rdx, %rcx
jne 0xd861
incq %rcx
addq $0x10, %rax
cmpq $0x3, %rcx
jne 0xd856
jmp 0xdaf6
leaq 0xbc(%rsp), %rdi
leaq 0x4846b(%rip), %rsi     # 0x55d20
leaq 0x200(%rsp), %rdx
leaq 0x1b0(%rsp), %rcx
leaq 0x2d0(%rsp), %r8
leaq 0x180(%rsp), %r9
xorl %eax, %eax
callq 0x21f0
movq 0x200(%rsp), %rax
movabsq $0x54415245504d4554, %rcx # imm = 0x54415245504D4554
xorq %rcx, %rax
movq 0x203(%rsp), %rcx
movabsq $0x4552555441524550, %rdx # imm = 0x4552555441524550
xorq %rdx, %rcx
orq %rax, %rcx
movl %r15d, %ebp
jne 0xdaf6
cmpl $0x4c4c554e, 0x180(%rsp) # imm = 0x4C4C554E
je 0xdaf6
leaq 0x180(%rsp), %rdi
leaq 0x4837a(%rip), %rsi     # 0x55cac
movq 0x330(%rsp), %rdx
xorl %eax, %eax
callq 0x21f0
movabsq $0x294e49564c454b28, %rax # imm = 0x294E49564C454B28
cmpq %rax, 0x1b0(%rsp)
je 0xdaf6
movq 0x330(%rsp), %rax
movss (%rax), %xmm0
addss 0x4820b(%rip), %xmm0    # 0x55b78
movss %xmm0, (%rax)
jmp 0xdaf6
cmpw $0x4553, 0xbc(%rsp)     # imm = 0x4553
jne 0xd98a
movb $0x44, 0xbd(%rsp)
leaq 0xbc(%rsp), %rcx
movb 0x2(%rcx), %al
movb %al, 0x1a(%r12)
movzwl (%rcx), %eax
movw %ax, 0x18(%r12)
jmp 0xda71
movl %r13d, 0x90(%rsp)
movq %r14, 0x20(%rsp)
movb 0xbc(%rsp), %al
movq 0x38(%rsp), %rdx
movslq %edx, %rcx
leaq (%rcx,%rcx,4), %r13
leaq 0x5c5b1(%rip), %rbp     # 0x69f80
movb %al, (%rbp,%r13)
movb 0xc8(%rsp), %al
leaq 0x5cd6e(%rip), %rsi     # 0x6a750
movb %al, (%rsi,%r13)
movb 0xbd(%rsp), %al
movb %al, 0x1(%rbp,%r13)
movb 0xc9(%rsp), %al
movb %al, 0x1(%rsi,%r13)
movb 0xbe(%rsp), %al
movb %al, 0x2(%rbp,%r13)
movb 0xca(%rsp), %al
movb %al, 0x2(%rsi,%r13)
testl %ecx, %ecx
jle 0xdb1a
addq %rbp, %r13
movl %edx, %ebx
xorl %r14d, %r14d
movl $0x3, %edx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x2070
testl %eax, %eax
je 0xdb1f
incq %r14
addq $0x5, %rbp
cmpq %r14, %rbx
jne 0xda26
movq 0x38(%rsp), %rdx
movl %edx, %r14d
movq 0x70(%rsp), %rbx
jmp 0xdb29
leaq 0xbc(%rsp), %rdx
movb 0x3(%rdx), %cl
movb %cl, 0x2(%rax)
movzwl 0x1(%rdx), %ecx
movw %cx, (%rax)
movb $0x0, 0x1b(%r12)
leaq 0x1c(%r12), %rdx
cmpb $0x20, 0xee(%rsp)
jne 0xda8e
movl $0x0, (%rdx)
jmp 0xdaa4
leaq 0xec(%rsp), %rdi
leaq 0x4820f(%rip), %rsi     # 0x55cac
xorl %eax, %eax
callq 0x21f0
cmpb $0x20, 0xec(%rsp)
je 0xdab6
movb $0x20, 0xec(%rsp)
leaq 0x44(%r12), %rdx
cmpb $0x20, 0xe8(%rsp)
jne 0xdacd
movl $0x0, (%rdx)
jmp 0xdae3
leaq 0xe6(%rsp), %rdi
leaq 0x481d0(%rip), %rsi     # 0x55cac
xorl %eax, %eax
callq 0x21f0
movq 0x20(%rsp), %rax
movl $0x0, 0x6c(%r12)
movq %rax, 0x18(%rsp)
leaq 0xb0(%rsp), %rdi
movl $0xc8, %esi
movq %r14, %rdx
callq 0x2170
testq %rax, %rax
movb 0xe(%rsp), %dl
jne 0xd1a9
jmp 0xdb70
xorl %r14d, %r14d
jmp 0xdb29
movq 0x70(%rsp), %rbx
movq 0x38(%rsp), %rdx
xorl %eax, %eax
cmpl %edx, %r14d
sete %al
addl %eax, %edx
movq %rdx, 0x38(%rsp)
movq 0x20(%rsp), %r14
movl %r15d, %ebp
movl 0x90(%rsp), %r13d
jmp 0xdaf6
movb $0x20, %dl
movq $0x0, 0x18(%rsp)
movb $0x20, 0xc(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x40(%rsp)
movq $0x0, 0x38(%rsp)
movl 0x30(%rsp), %ebx
movsbl %dl, %r12d
movsbl 0xc(%rsp), %r13d
leaq 0x13(%rsp), %rbp
leaq 0x50(%rsp), %rax
leaq 0xd(%rsp), %r11
leaq 0xf(%rsp), %r10
leaq 0x34(%rsp), %r15
leaq 0x54(%rsp), %rsi
leaq 0x10(%rsp), %r8
leaq 0x48(%rsp), %r9
movq %r15, %rdi
movq 0x88(%rsp), %rdx
movq 0x40(%rsp), %rcx
pushq 0x18(%rsp)
pushq %r12
pushq %r13
pushq %rbx
pushq %rbp
pushq 0x60(%rsp)
pushq %rax
pushq %r11
pushq %r10
leaq 0x74(%rsp), %rax
pushq %rax
callq 0xe2b3
addq $0x50, %rsp
movl (%r15), %ebp
leaq 0x5c2ae(%rip), %rax     # 0x69e90
movl (%rax), %esi
cmpl %esi, %ebp
jg 0xdc72
movq %r14, %rdi
callq 0x20c0
leaq 0x4819d(%rip), %rdi     # 0x55d98
movl %ebp, %esi
movq 0x58(%rsp), %r14
movl %r14d, %edx
movq 0x70(%rsp), %rbx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x20f0
movslq %r14d, %rax
movb $0x0, (%rbx,%rax)
cmpb $0x2a, 0x12(%rsp)
je 0xdc2c
movq 0x78(%rsp), %rdi
callq 0x2050
cmpl $0x0, 0x94(%rsp)
je 0xdc5e
leaq 0x481b1(%rip), %rsi     # 0x55dee
leaq 0x4818c(%rip), %rdx     # 0x55dd0
leaq 0x200(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2260
movq %rbx, %rdi
callq 0x20e0
movl %ebp, %eax
addq $0x2f8, %rsp            # imm = 0x2F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x480f9(%rip), %rdi     # 0x55d72
xorl %eax, %eax
callq 0x20f0
movl $0x8, %edi
callq 0x2270