// File: /workspace/github_c_makefile_star2_O1/ugobas[P]tnm/read.c
// Function: Read_ligand
int Read_ligand(char *pdb_name, int *nmr, struct residue *seq, atom *atoms,
	       char *chain_to_read, int *ANISOU)
{
  int N_res=0, n_exo=0, Compression=0, start=0;
  FILE *file_in;
  char string[200], command[200];
  atom *atom_ptr=atoms, *first_atom=NULL;

  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='#', chain=' ';
  char res_type[5], res_type_old[5], icode=' ', icode_old='U';
  float x, y, z;
  char file_name[500];
  int nchains=1, ic, ichain=0, ini_chain=0;
  n_atom=0;

  /* Open file */
  Compression=Get_compression(pdb_name);
  if(Compression){
    sprintf(command, "%s %s > %s\n", PDBCAT, pdb_name, PDBTMP);
    system(command); strcpy(file_name, PDBTMP);
  }else{
    sprintf(file_name, "%s", pdb_name);
  }
  file_in=fopen(file_name, "r");
  if(file_in==NULL){
    printf("\nERROR, %s not found\n", file_name); return(0);
  }

  // Count chains to read
  for(i=0; i<sizeof(chain_to_read); i++){
    nchains=i; if(chain_to_read[i]=='\0')break;
  }
  nchains++; if(nchains==0)nchains=1;

  *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(strncmp(string,"EXPDTA", 6)==0){
      if(strncmp(string+10, "NMR", 3)==0)*nmr=1;
      continue;
      /* NMR structure */

    }else if((strncmp(string,"TER",3)==0)&&(N_res>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);
      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;
      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_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:
    /* Read atom name */
    if((string[13]=='H')||(string[12]=='H') ||
       (string[13]=='D') ||(string[12]=='D'))continue;

    /* 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);

    /* 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;
    if(string[12]!=' '){ // Hydrogen atoms
      for(ic=0; ic<4; ic++)atom_ptr->name[ic]=string[12+ic];
    }else{
      for(ic=0; ic<3; ic++)atom_ptr->name[ic]=string[13+ic];
      atom_ptr->name[3]=' ';
    }
    sscanf(string+56, "%f", &atom_ptr->occupancy);
    sscanf(string+60, "%f", &atom_ptr->B_factor);
    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);
  if(Verbose)printf("%3d residues\n", N_res);
  if(Compression){
    sprintf(command, "rm -f %s\n", PDBTMP); system(command);
  }
  return(N_res);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x438, %rsp            # imm = 0x438
movq %r9, %r12
movq %r8, %r15
movq %rcx, 0x88(%rsp)
movq %rdx, 0x68(%rsp)
movq %rsi, %r13
movq %rdi, %rcx
xorl %eax, %eax
movl %eax, 0x34(%rsp)
movl %eax, 0x54(%rsp)
movw $0x0, 0x10(%rsp)
movl %eax, 0x50(%rsp)
movl $0x2710, 0x28(%rsp)     # imm = 0x2710
movb $0x23, 0xf(%rsp)
movb $0x55, 0xe(%rsp)
movl %eax, 0x5b9a4(%rip)     # 0x69f78
leaq 0x2(%rdi), %rax
movzbl -0x2(%rax), %edx
cmpl $0x2e, %edx
je 0xe5e7
testl %edx, %edx
jne 0xe5f2
jmp 0xe5f7
cmpb $0x67, -0x1(%rax)
jne 0xe5f2
cmpb $0x7a, (%rax)
je 0xe5fc
incq %rax
jmp 0xe5d8
movb $0x1, %bpl
jmp 0xe5fe
xorl %ebp, %ebp
testb %bpl, %bpl
je 0xe615
leaq 0x240(%rsp), %rdi
movq %rcx, %rsi
callq 0x2080
jmp 0xe656
leaq 0x477a3(%rip), %rsi     # 0x55dbf
leaq 0x477a8(%rip), %rdx     # 0x55dcb
leaq 0x477a6(%rip), %r8      # 0x55dd0
leaq 0x170(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2260
movq %rbx, %rdi
callq 0x20e0
movabsq $0x7461642e626470, %rax # imm = 0x7461642E626470
movq %rax, 0x240(%rsp)
leaq 0x4b87d(%rip), %rsi     # 0x59eda
leaq 0x240(%rsp), %rdi
callq 0x2210
movq %rax, 0x70(%rsp)
testq %rax, %rax
je 0xee05
xorl %eax, %eax
movq %rax, %r14
cmpb $0x0, (%r15,%rax)
je 0xe68e
leaq 0x1(%r14), %rax
cmpq $0x7, %r14
jb 0xe67a
movl %ebp, 0x7c(%rsp)
movl $0x0, (%r13)
movl $0x787878, 0x48(%rsp)   # imm = 0x787878
leaq 0xa0(%rsp), %rdi
movl $0xc8, %esi
movq 0x70(%rsp), %rdx
callq 0x2170
testq %rax, %rax
je 0xee22
movq %r13, 0x90(%rsp)
movq %r12, 0x80(%rsp)
movb $0x20, 0xd(%rsp)
movb $0x20, %r13b
leaq 0xa0(%rsp), %r12
movq $0x0, 0x38(%rsp)
movq 0x88(%rsp), %rbp
movl $0x0, 0x14(%rsp)
movq $0x0, 0x40(%rsp)
movb $0x20, %al
movl %eax, 0x58(%rsp)
xorl %eax, %eax
movq $0x0, 0x20(%rsp)
movl %eax, 0x2c(%rsp)
movl 0xa0(%rsp), %eax
movl $0x0, %ebx
cmpl $0x4d4f5441, %eax       # imm = 0x4D4F5441
jne 0xe774
movb 0xb5(%rsp), %r13b
movzbl (%r15), %ecx
testl %ecx, %ecx
je 0xe74a
cmpl $0x2a, %ecx
je 0xe851
cmpl $0x20, %ecx
jne 0xe74d
movb %r13b, (%r15)
movq $-0x1, %rcx
cmpb 0x1(%r15,%rcx), %r13b
je 0xe851
incq %rcx
cmpq %rcx, %r14
jne 0xe754
movl $0x1, 0x14(%rsp)
jmp 0xe971
movl 0xa0(%rsp), %ecx
movl $0x41544548, %edx       # imm = 0x41544548
xorl %edx, %ecx
movzwl 0xa4(%rsp), %edx
xorl $0x4d54, %edx           # imm = 0x4D54
orl %ecx, %edx
je 0xe97b
movl 0xa0(%rsp), %eax
movl $0x44505845, %ecx       # imm = 0x44505845
xorl %ecx, %eax
movzwl 0xa4(%rsp), %ecx
xorl $0x4154, %ecx           # imm = 0x4154
orl %eax, %ecx
je 0xe998
movl 0xa0(%rsp), %eax
movl $0x4554, %ecx           # imm = 0x4554
xorl %ecx, %eax
movzbl 0xa2(%rsp), %ecx
xorl $0x52, %ecx
orw %ax, %cx
jne 0xe9cc
cmpl $0x0, 0x34(%rsp)
jle 0xe9cc
movl 0x30(%rsp), %eax
movsbl %r13b, %r10d
movsbl 0xd(%rsp), %r11d
leaq 0x34(%rsp), %rdi
leaq 0x54(%rsp), %rsi
movq 0x68(%rsp), %rdx
movq 0x40(%rsp), %rcx
leaq 0x10(%rsp), %r8
leaq 0x48(%rsp), %r9
pushq 0x20(%rsp)
pushq %r10
pushq %r11
pushq %rax
leaq 0x3b(%rsp), %rax
pushq %rax
pushq 0x60(%rsp)
leaq 0x80(%rsp), %rax
pushq %rax
leaq 0x47(%rsp), %rax
pushq %rax
leaq 0x4e(%rsp), %rax
pushq %rax
leaq 0x70(%rsp), %rax
pushq %rax
callq 0xe2b3
addq $0x50, %rsp
jmp 0xe98b
movb 0xac(%rsp), %cl
movb 0xad(%rsp), %dl
cmpb $0x48, %dl
sete %sil
cmpb $0x48, %cl
sete %dil
orb %sil, %dil
cmpb $0x44, %dl
sete %dl
cmpb $0x44, %cl
sete %cl
orb %dl, %cl
orb %dil, %cl
movl $0x1, 0x14(%rsp)
jne 0xe971
movb 0xb1(%rsp), %cl
movb %cl, 0x1b(%rsp)
movzwl 0xb2(%rsp), %ecx
movw %cx, 0x1c(%rsp)
movb $0x0, 0x1e(%rsp)
cmpl $0x4d4f5441, %eax       # imm = 0x4D4F5441
je 0xe8f3
movzwl 0x1b(%rsp), %eax
xorl $0x4f48, %eax           # imm = 0x4F48
movzbl 0x1d(%rsp), %ecx
xorl $0x48, %ecx
movl $0x1, %edx
movq %rdx, 0x20(%rsp)
orw %ax, %cx
je 0xeb98
movzwl 0x1b(%rsp), %eax
xorl $0x4f44, %eax           # imm = 0x4F44
movzbl 0x1d(%rsp), %ecx
xorl $0x44, %ecx
orw %ax, %cx
je 0xeb98
movb 0xba(%rsp), %al
movb %al, 0xd(%rsp)
movb $0x20, 0xba(%rsp)
leaq 0xb6(%rsp), %rdi
leaq 0x4738e(%rip), %rsi     # 0x55ca3
leaq 0x30(%rsp), %rdx
leaq 0x64(%rsp), %rcx
leaq 0x60(%rsp), %r8
leaq 0x5c(%rsp), %r9
xorl %eax, %eax
callq 0x21f0
cmpb $0x41, 0xe8(%rsp)
jne 0xeae8
cmpb $0x4c, 0xe9(%rsp)
jne 0xeae8
cmpb $0x54, 0xea(%rsp)
jne 0xeae8
movb 0xeb(%rsp), %al
cmpb $0x31, %al
je 0xeae8
cmpb $0x20, %al
je 0xeae8
movq %rbx, 0x20(%rsp)
jmp 0xede4
movl $0x1, %ebx
cmpl $0x0, 0x14(%rsp)
jne 0xe72c
movl $0x0, 0x14(%rsp)
jmp 0xede4
movzwl 0xaa(%rsp), %eax
xorl $0x4d4e, %eax           # imm = 0x4D4E
movzbl 0xac(%rsp), %ecx
xorl $0x52, %ecx
orw %ax, %cx
jne 0xede4
movq 0x90(%rsp), %rax
movl $0x1, (%rax)
jmp 0xede4
movl 0xa0(%rsp), %eax
movl $0x52444f4d, %ecx       # imm = 0x52444F4D
xorl %ecx, %eax
movzwl 0xa4(%rsp), %ecx
xorl $0x5345, %ecx           # imm = 0x5345
orl %eax, %ecx
je 0xecc2
movl 0xa0(%rsp), %eax
movl $0x4d444e45, %ecx       # imm = 0x4D444E45
xorl %ecx, %eax
movzwl 0xa4(%rsp), %ecx
xorl $0x4c44, %ecx           # imm = 0x4C44
orl %eax, %ecx
je 0xee45
movl 0xa0(%rsp), %eax
movl $0x53494e41, %ecx       # imm = 0x53494E41
xorl %ecx, %eax
movzwl 0xa4(%rsp), %ecx
xorl $0x554f, %ecx           # imm = 0x554F
orl %eax, %ecx
jne 0xede4
movq 0x80(%rsp), %rax
cmpl $0x0, (%rax)
jne 0xea53
movq 0x80(%rsp), %rax
movl $0x1, (%rax)
leaq 0x20(%rbp), %rdx
leaq 0x30(%rbp), %rcx
leaq 0x40(%rbp), %r8
leaq 0x24(%rbp), %r9
leaq 0x28(%rbp), %r10
leaq 0x34(%rbp), %r11
leaq 0xbc(%rsp), %rdi
leaq 0x472d4(%rip), %rsi     # 0x55d4e
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x21f0
addq $0x10, %rsp
movl $0x20, %eax
xorl %ecx, %ecx
movsd 0x470e8(%rip), %xmm1    # 0x55b80
movl $0x3, %edx
movq %rax, %rsi
movq %rax, %rdi
xorps %xmm0, %xmm0
cvtss2sd (%rbp,%rdi), %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rbp,%rdi)
cmpq $0x3, %rdx
je 0xeac6
movss %xmm0, (%rbp,%rsi)
decq %rdx
addq $0x4, %rdi
addq $0xc, %rsi
cmpq %rdx, %rcx
jne 0xeaa3
incq %rcx
addq $0x10, %rax
cmpq $0x3, %rcx
jne 0xea98
jmp 0xede4
movb 0xb0(%rsp), %al
cmpb $0x20, %al
je 0xeb0f
movl 0x58(%rsp), %edx
cmpb $0x20, %dl
movzbl %al, %ecx
movzbl %dl, %edx
cmovel %ecx, %edx
movl %edx, 0x58(%rsp)
cmpb %dl, %al
jne 0xe971
movl 0x2c(%rsp), %edx
movb 0xe(%rsp), %al
cmpb %al, 0xd(%rsp)
je 0xeba5
movl 0x30(%rsp), %ecx
cmpl 0x28(%rsp), %ecx
jne 0xeba5
cmpw $0x1, %dx
je 0xe971
cvtss2sd 0x64(%rsp), %xmm0
movq 0x40(%rsp), %rcx
subsd (%rcx), %xmm0
cvtsd2ss %xmm0, %xmm0
cvtss2sd 0x60(%rsp), %xmm1
subsd 0x8(%rcx), %xmm1
cvtsd2ss %xmm1, %xmm1
cvtss2sd 0x5c(%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 0x46ffa(%rip), %xmm0    # 0x55b7c
ucomiss %xmm2, %xmm0
movl $0x1, %ecx
cmoval %ecx, %edx
movl %edx, 0x2c(%rsp)
jbe 0xeba5
movq %rbx, 0x20(%rsp)
movl $0x1, 0x14(%rsp)
jmp 0xede4
movl 0x30(%rsp), %r12d
cmpb %al, 0xd(%rsp)
jne 0xebcf
cmpl 0x28(%rsp), %r12d
jne 0xebcf
movl $0x3, %edx
leaq 0x1b(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x2070
testl %eax, %eax
je 0xec2b
movsbl %r13b, %eax
movsbl 0xd(%rsp), %r10d
leaq 0x34(%rsp), %rdi
leaq 0x54(%rsp), %rsi
movq 0x68(%rsp), %rdx
movq 0x40(%rsp), %rcx
leaq 0x10(%rsp), %r8
leaq 0x48(%rsp), %r9
pushq %rbx
pushq %rax
pushq %r10
pushq %r12
leaq 0x3b(%rsp), %rax
pushq %rax
pushq 0x60(%rsp)
leaq 0x80(%rsp), %rax
pushq %rax
leaq 0x47(%rsp), %rax
pushq %rax
leaq 0x4e(%rsp), %rax
pushq %rax
leaq 0x70(%rsp), %rax
pushq %rax
callq 0xe2b3
addq $0x50, %rsp
movslq 0x5b346(%rip), %rax     # 0x69f78
imulq $0x70, %rax, %rcx
movq 0x88(%rsp), %rsi
leaq (%rsi,%rcx), %rbp
movzwl 0x10(%rsp), %edx
testw %dx, %dx
movq 0x40(%rsp), %rdi
cmoveq %rbp, %rdi
movq %rdi, 0x40(%rsp)
incl %edx
movw %dx, 0x10(%rsp)
incl %eax
movl %eax, 0x5b311(%rip)     # 0x69f78
xorps %xmm0, %xmm0
cvtss2sd 0x64(%rsp), %xmm0
leaq 0x18(%rsi,%rcx), %rax
movsd %xmm0, -0x18(%rax)
xorps %xmm0, %xmm0
cvtss2sd 0x60(%rsp), %xmm0
movsd %xmm0, -0x10(%rax)
xorps %xmm0, %xmm0
cvtss2sd 0x5c(%rsp), %xmm0
movsd %xmm0, -0x8(%rax)
cmpb $0x20, 0xac(%rsp)
jne 0xed74
leaq 0xbc(%rsp), %rdx
movb -0xd(%rdx), %cl
movb %cl, 0x2(%rax)
movzwl -0xf(%rdx), %ecx
movw %cx, (%rax)
movb $0x20, 0x1b(%rbp)
jmp 0xed7d
movb 0xac(%rsp), %al
movq 0x38(%rsp), %rdx
movslq %edx, %rcx
leaq (%rcx,%rcx,4), %r8
leaq 0x5b2a4(%rip), %rbx     # 0x69f80
movb %al, (%rbx,%r8)
movb 0xb8(%rsp), %al
leaq 0x5ba62(%rip), %rsi     # 0x6a750
movb %al, (%rsi,%r8)
movb 0xad(%rsp), %al
movb %al, 0x1(%rbx,%r8)
movb 0xb9(%rsp), %al
movb %al, 0x1(%rsi,%r8)
movb 0xae(%rsp), %al
movb %al, 0x2(%rbx,%r8)
movb 0xba(%rsp), %al
movb %al, 0x2(%rsi,%r8)
testl %ecx, %ecx
jle 0xedbe
movb %r13b, 0x13(%rsp)
addq %rbx, %r8
movl %edx, %eax
movq %rax, 0x98(%rsp)
xorl %r12d, %r12d
movl $0x3, %edx
movq %rbx, %rdi
movq %r8, %r13
movq %r8, %rsi
callq 0x2070
testl %eax, %eax
je 0xedc3
incq %r12
addq $0x5, %rbx
cmpq %r12, 0x98(%rsp)
movq %r13, %r8
jne 0xed3f
movq 0x38(%rsp), %rdx
movl %edx, %r12d
jmp 0xedc8
movl 0xac(%rsp), %ecx
movl %ecx, (%rax)
leaq 0x44(%rbp), %rdx
leaq 0xd8(%rsp), %rdi
leaq 0x46f1c(%rip), %r12     # 0x55cac
movq %r12, %rsi
xorl %eax, %eax
callq 0x21f0
leaq 0x1c(%rbp), %rdx
leaq 0xdc(%rsp), %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x21f0
movl $0x0, 0x6c(%rbp)
movq %rbx, 0x20(%rsp)
jmp 0xeddc
xorl %r12d, %r12d
jmp 0xedcd
movq 0x38(%rsp), %rdx
movb 0x13(%rsp), %r13b
xorl %eax, %eax
cmpl %edx, %r12d
sete %al
addl %eax, %edx
movq %rdx, 0x38(%rsp)
leaq 0xa0(%rsp), %r12
movq %r12, %rdi
movl $0xc8, %esi
movq 0x70(%rsp), %rdx
callq 0x2170
testq %rax, %rax
movl 0x2c(%rsp), %eax
jne 0xe715
jmp 0xee45
leaq 0x46fcc(%rip), %rdi     # 0x55dd8
xorl %ebx, %ebx
leaq 0x240(%rsp), %rsi
xorl %eax, %eax
callq 0x20f0
jmp 0xef13
movb $0x20, %r13b
movq $0x0, 0x20(%rsp)
movb $0x20, 0xd(%rsp)
movq $0x0, 0x40(%rsp)
movq $0x0, 0x38(%rsp)
movl 0x30(%rsp), %r14d
movsbl %r13b, %r12d
movsbl 0xd(%rsp), %r13d
leaq 0x1b(%rsp), %rbp
leaq 0x50(%rsp), %rbx
leaq 0xf(%rsp), %r11
leaq 0xe(%rsp), %r10
leaq 0x28(%rsp), %rax
leaq 0x34(%rsp), %r15
leaq 0x54(%rsp), %rsi
leaq 0x10(%rsp), %r8
leaq 0x48(%rsp), %r9
movq %r15, %rdi
movq 0x68(%rsp), %rdx
movq 0x40(%rsp), %rcx
pushq 0x20(%rsp)
pushq %r12
pushq %r13
pushq %r14
pushq %rbp
pushq 0x60(%rsp)
pushq %rbx
pushq %r11
pushq %r10
pushq %rax
callq 0xe2b3
addq $0x50, %rsp
movl (%r15), %ebx
leaq 0x5afda(%rip), %rax     # 0x69e90
movl (%rax), %esi
cmpl %esi, %ebx
jg 0xef27
movq 0x70(%rsp), %rdi
callq 0x20c0
leaq 0x5a22b(%rip), %rax     # 0x690f8
cmpl $0x0, (%rax)
movl 0x7c(%rsp), %ebp
je 0xeee6
leaq 0x46dd2(%rip), %rdi     # 0x55caf
movl %ebx, %esi
xorl %eax, %eax
callq 0x20f0
testb %bpl, %bpl
jne 0xef13
leaq 0x46efc(%rip), %rsi     # 0x55dee
leaq 0x46ed7(%rip), %rdx     # 0x55dd0
leaq 0x170(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2260
movq %r14, %rdi
callq 0x20e0
movl %ebx, %eax
addq $0x438, %rsp            # imm = 0x438
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x46e44(%rip), %rdi     # 0x55d72
xorl %eax, %eax
callq 0x20f0
movl $0x8, %edi
callq 0x2270