// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4d8, %rsp            # imm = 0x4D8
movq %rdi, -0x38(%rbp)
movq %rsi, -0x40(%rbp)
movq %rdx, -0x48(%rbp)
movq %rcx, -0x50(%rbp)
movq %r8, -0x58(%rbp)
movq %r9, -0x60(%rbp)
movl $0x0, -0x64(%rbp)
movl $0x0, -0x68(%rbp)
movl $0x0, -0x6c(%rbp)
movl $0x0, -0x70(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x218(%rbp)
movq $0x0, -0x220(%rbp)
movw $0x0, -0x222(%rbp)
movw $0x0, -0x224(%rbp)
movl $0x0, -0x228(%rbp)
movl $0x0, -0x22c(%rbp)
movl $0x2710, -0x23c(%rbp)   # imm = 0x2710
movb $0x20, -0x23e(%rbp)
movb $0x23, -0x23f(%rbp)
movb $0x20, -0x240(%rbp)
movb $0x20, -0x24b(%rbp)
movb $0x55, -0x24c(%rbp)
movl $0x1, -0x454(%rbp)
movl $0x0, -0x45c(%rbp)
movl $0x0, -0x460(%rbp)
movl $0x0, 0x7b4cf(%rip)     # 0x8cf38
movq -0x38(%rbp), %rdi
callq 0x127a0
movl %eax, -0x6c(%rbp)
cmpl $0x0, -0x6c(%rbp)
je 0x11ac3
leaq -0x210(%rbp), %rdi
movq -0x38(%rbp), %rcx
leaq 0x69442(%rip), %rsi     # 0x7aecf
leaq 0x69447(%rip), %rdx     # 0x7aedb
leaq 0x69445(%rip), %r8      # 0x7aee0
movb $0x0, %al
callq 0x1200
leaq -0x210(%rbp), %rdi
callq 0x10c0
leaq -0x450(%rbp), %rdi
leaq 0x69424(%rip), %rsi     # 0x7aee0
callq 0x1060
jmp 0x11adc
leaq -0x450(%rbp), %rdi
movq -0x38(%rbp), %rdx
leaq 0x6a8c9(%rip), %rsi     # 0x7c39e
movb $0x0, %al
callq 0x1200
leaq -0x450(%rbp), %rdi
leaq 0x709f3(%rip), %rsi     # 0x824dd
callq 0x11b0
movq %rax, -0x78(%rbp)
cmpq $0x0, -0x78(%rbp)
jne 0x11b1b
leaq -0x450(%rbp), %rsi
leaq 0x693e0(%rip), %rdi     # 0x7aee8
movb $0x0, %al
callq 0x10d0
movl $0x0, -0x2c(%rbp)
jmp 0x12784
movl $0x0, -0x230(%rbp)
movslq -0x230(%rbp), %rax
cmpq $0x8, %rax
jae 0x11b67
movl -0x230(%rbp), %eax
movl %eax, -0x454(%rbp)
movq -0x58(%rbp), %rax
movslq -0x230(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x11b54
jmp 0x11b67
jmp 0x11b56
movl -0x230(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x230(%rbp)
jmp 0x11b25
movl -0x454(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x454(%rbp)
cmpl $0x0, -0x454(%rbp)
jne 0x11b89
movl $0x1, -0x454(%rbp)
movq -0x40(%rbp), %rax
movl $0x0, (%rax)
leaq -0x24a(%rbp), %rdi
leaq 0x691a5(%rip), %rsi     # 0x7ad46
callq 0x1060
leaq -0x140(%rbp), %rdi
movq -0x78(%rbp), %rdx
movl $0xc8, %esi
callq 0x1130
cmpq $0x0, %rax
je 0x12643
leaq -0x140(%rbp), %rdi
leaq 0x69177(%rip), %rsi     # 0x7ad4a
movl $0x4, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x11c04
movl $0x0, -0x228(%rbp)
cmpl $0x0, -0x460(%rbp)
jne 0x11bff
movl $0x1, -0x460(%rbp)
jmp 0x1208f
leaq -0x140(%rbp), %rdi
leaq 0x6913d(%rip), %rsi     # 0x7ad4f
movl $0x6, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x11c3e
cmpl $0x0, -0x460(%rbp)
jne 0x11c2f
jmp 0x11ba6
movl $0x1, -0x228(%rbp)
jmp 0x1208d
leaq -0x140(%rbp), %rdi
leaq 0x691f6(%rip), %rsi     # 0x7ae42
movl $0x6, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x11c8b
leaq -0x140(%rbp), %rdi
addq $0xa, %rdi
leaq 0x691dc(%rip), %rsi     # 0x7ae49
movl $0x3, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x11c86
movq -0x40(%rbp), %rax
movl $0x1, (%rax)
jmp 0x11ba6
leaq -0x140(%rbp), %rdi
leaq 0x690bd(%rip), %rsi     # 0x7ad56
movl $0x3, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x11d7d
cmpl $0x0, -0x64(%rbp)
jle 0x11d7d
movq -0x48(%rbp), %rdx
movq -0x220(%rbp), %rcx
leaq -0x24a(%rbp), %r9
movl -0x68(%rbp), %r15d
leaq -0x245(%rbp), %r14
movl -0x238(%rbp), %ebx
movb -0x24b(%rbp), %r11b
movb -0x240(%rbp), %r10b
movl -0x228(%rbp), %eax
movl %eax, -0x480(%rbp)
leaq -0x64(%rbp), %rdi
leaq -0x70(%rbp), %rsi
leaq -0x222(%rbp), %r8
leaq -0x23c(%rbp), %rax
leaq -0x24c(%rbp), %r12
movq %r12, -0x488(%rbp)
leaq -0x23f(%rbp), %r13
leaq -0x22c(%rbp), %r12
movq %rax, (%rsp)
movq -0x488(%rbp), %rax
movq %rax, 0x8(%rsp)
movl -0x480(%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, -0x460(%rbp)
jmp 0x11ba6
leaq -0x140(%rbp), %rdi
leaq 0x690c2(%rip), %rsi     # 0x7ae4d
movl $0x6, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x11eb7
movb -0x134(%rbp), %cl
movslq -0x68(%rbp), %rdx
leaq 0x7b191(%rip), %rax     # 0x8cf40
imulq $0x5, %rdx, %rdx
addq %rdx, %rax
movb %cl, (%rax)
movb -0x128(%rbp), %cl
movslq -0x68(%rbp), %rdx
leaq 0x7b947(%rip), %rax     # 0x8d710
imulq $0x5, %rdx, %rdx
addq %rdx, %rax
movb %cl, (%rax)
movb -0x133(%rbp), %cl
movslq -0x68(%rbp), %rdx
leaq 0x7b15d(%rip), %rax     # 0x8cf40
imulq $0x5, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0x1(%rax)
movb -0x127(%rbp), %cl
movslq -0x68(%rbp), %rdx
leaq 0x7b912(%rip), %rax     # 0x8d710
imulq $0x5, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0x1(%rax)
movb -0x132(%rbp), %cl
movslq -0x68(%rbp), %rdx
leaq 0x7b127(%rip), %rax     # 0x8cf40
imulq $0x5, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0x2(%rax)
movb -0x126(%rbp), %cl
movslq -0x68(%rbp), %rdx
leaq 0x7b8dc(%rip), %rax     # 0x8d710
imulq $0x5, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0x2(%rax)
movl $0x0, -0x234(%rbp)
movl -0x234(%rbp), %eax
cmpl -0x68(%rbp), %eax
jge 0x11e9e
movslq -0x234(%rbp), %rax
leaq 0x7b0df(%rip), %rdi     # 0x8cf40
imulq $0x5, %rax, %rax
addq %rax, %rdi
movslq -0x68(%rbp), %rax
leaq 0x7b0cd(%rip), %rsi     # 0x8cf40
imulq $0x5, %rax, %rax
addq %rax, %rsi
movl $0x3, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x11e8b
jmp 0x11e9e
jmp 0x11e8d
movl -0x234(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x234(%rbp)
jmp 0x11e48
movl -0x234(%rbp), %eax
cmpl -0x68(%rbp), %eax
jne 0x11eb2
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x11ba6
leaq -0x140(%rbp), %rdi
leaq 0x68e95(%rip), %rsi     # 0x7ad5a
movl $0x6, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x11ed9
jmp 0x12643
leaq -0x140(%rbp), %rdi
leaq 0x68f6d(%rip), %rsi     # 0x7ae54
movl $0x6, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x12088
movq -0x60(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x11f0d
movq -0x60(%rbp), %rax
movl $0x1, (%rax)
leaq -0x140(%rbp), %rdi
addq $0x1c, %rdi
movq -0x218(%rbp), %rdx
addq $0x20, %rdx
movq -0x218(%rbp), %rcx
addq $0x20, %rcx
addq $0xc, %rcx
addq $0x4, %rcx
movq -0x218(%rbp), %r8
addq $0x20, %r8
addq $0x18, %r8
addq $0x8, %r8
movq -0x218(%rbp), %r9
addq $0x20, %r9
addq $0x4, %r9
movq -0x218(%rbp), %r10
addq $0x20, %r10
addq $0x8, %r10
movq -0x218(%rbp), %rax
addq $0x20, %rax
addq $0xc, %rax
addq $0x8, %rax
leaq 0x68eda(%rip), %rsi     # 0x7ae5b
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x11a0
movl $0x0, -0x464(%rbp)
cmpl $0x3, -0x464(%rbp)
jge 0x12083
movl -0x464(%rbp), %eax
movl %eax, -0x468(%rbp)
cmpl $0x3, -0x468(%rbp)
jge 0x1206d
movq -0x218(%rbp), %rax
addq $0x20, %rax
movslq -0x464(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movslq -0x468(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x68c26(%rip), %xmm1    # 0x7ac18
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rax,%rcx,4)
movl -0x468(%rbp), %eax
cmpl -0x464(%rbp), %eax
je 0x12057
movq -0x218(%rbp), %rax
addq $0x20, %rax
movslq -0x464(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movslq -0x468(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
movq -0x218(%rbp), %rax
addq $0x20, %rax
movslq -0x468(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movslq -0x464(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
jmp 0x12059
movl -0x468(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x468(%rbp)
jmp 0x11fb4
jmp 0x1206f
movl -0x464(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x464(%rbp)
jmp 0x11f9b
jmp 0x11ba6
jmp 0x11ba6
jmp 0x1208f
movb -0x12b(%rbp), %al
movb %al, -0x240(%rbp)
movq -0x58(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2a, %eax
je 0x12117
movq -0x58(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
je 0x120bf
movq -0x58(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x120cb
movb -0x240(%rbp), %cl
movq -0x58(%rbp), %rax
movb %cl, (%rax)
movl $0x0, -0x458(%rbp)
movl -0x458(%rbp), %eax
cmpl -0x454(%rbp), %eax
jge 0x12112
movsbl -0x240(%rbp), %eax
movq -0x58(%rbp), %rcx
movslq -0x458(%rbp), %rdx
movsbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jne 0x120ff
jmp 0x12119
jmp 0x12101
movl -0x458(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x458(%rbp)
jmp 0x120d5
jmp 0x11ba6
jmp 0x12119
movsbl -0x133(%rbp), %eax
cmpl $0x48, %eax
je 0x12149
movsbl -0x134(%rbp), %eax
cmpl $0x48, %eax
je 0x12149
movsbl -0x133(%rbp), %eax
cmpl $0x44, %eax
je 0x12149
movsbl -0x134(%rbp), %eax
cmpl $0x44, %eax
jne 0x1214e
jmp 0x11ba6
movb -0x12f(%rbp), %al
movb %al, -0x245(%rbp)
movb -0x12e(%rbp), %al
movb %al, -0x244(%rbp)
movb -0x12d(%rbp), %al
movb %al, -0x243(%rbp)
movb $0x0, -0x242(%rbp)
cmpl $0x1, -0x228(%rbp)
jne 0x121c1
leaq -0x245(%rbp), %rdi
leaq 0x68bd1(%rip), %rsi     # 0x7ad61
movl $0x3, %edx
callq 0x1050
cmpl $0x0, %eax
je 0x121bc
leaq -0x245(%rbp), %rdi
leaq 0x68bb8(%rip), %rsi     # 0x7ad65
movl $0x3, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x121c1
jmp 0x11ba6
movb -0x126(%rbp), %al
movb %al, -0x24b(%rbp)
movb $0x20, -0x126(%rbp)
leaq -0x140(%rbp), %rdi
addq $0x16, %rdi
leaq 0x68b83(%rip), %rsi     # 0x7ad69
leaq -0x238(%rbp), %rdx
leaq -0x250(%rbp), %rcx
leaq -0x254(%rbp), %r8
leaq -0x258(%rbp), %r9
movb $0x0, %al
callq 0x11a0
movsbl -0xf8(%rbp), %eax
cmpl $0x41, %eax
jne 0x1224a
movsbl -0xf7(%rbp), %eax
cmpl $0x4c, %eax
jne 0x1224a
movsbl -0xf6(%rbp), %eax
cmpl $0x54, %eax
jne 0x1224a
movsbl -0xf5(%rbp), %eax
cmpl $0x31, %eax
je 0x1224a
movsbl -0xf5(%rbp), %eax
cmpl $0x20, %eax
je 0x1224a
jmp 0x11ba6
movb -0x130(%rbp), %al
movb %al, -0x23d(%rbp)
movsbl -0x23d(%rbp), %eax
cmpl $0x20, %eax
je 0x12293
movsbl -0x23e(%rbp), %eax
cmpl $0x20, %eax
jne 0x1227a
movb -0x23d(%rbp), %al
movb %al, -0x23e(%rbp)
movsbl -0x23d(%rbp), %eax
movsbl -0x23e(%rbp), %ecx
cmpl %ecx, %eax
je 0x12291
jmp 0x11ba6
jmp 0x12293
movsbl -0x24b(%rbp), %eax
movsbl -0x24c(%rbp), %ecx
cmpl %ecx, %eax
je 0x123a9
movl -0x238(%rbp), %eax
cmpl -0x23c(%rbp), %eax
jne 0x123a9
movswl -0x224(%rbp), %eax
cmpl $0x1, %eax
jne 0x122cc
jmp 0x11ba6
movq -0x220(%rbp), %rax
movq %rax, -0x470(%rbp)
movss -0x250(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x470(%rbp), %rax
subsd (%rax), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x474(%rbp)
movss -0x254(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x470(%rbp), %rax
subsd 0x8(%rax), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x478(%rbp)
movss -0x258(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x470(%rbp), %rax
subsd 0x10(%rax), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x47c(%rbp)
movss -0x474(%rbp), %xmm1
movss -0x474(%rbp), %xmm2
movss -0x478(%rbp), %xmm0
mulss -0x478(%rbp), %xmm0
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movss -0x47c(%rbp), %xmm0
movss -0x47c(%rbp), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x63c77(%rip), %xmm0    # 0x76008
ucomisd %xmm1, %xmm0
jbe 0x123a5
movw $0x1, -0x224(%rbp)
jmp 0x11ba6
jmp 0x123a7
jmp 0x123a9
movl -0x238(%rbp), %eax
cmpl -0x23c(%rbp), %eax
jne 0x123ea
movsbl -0x24b(%rbp), %eax
movsbl -0x24c(%rbp), %ecx
cmpl %ecx, %eax
jne 0x123ea
leaq -0x245(%rbp), %rdi
leaq -0x24a(%rbp), %rsi
movl $0x3, %edx
callq 0x1050
cmpl $0x0, %eax
je 0x124a2
movq -0x48(%rbp), %rdx
movq -0x220(%rbp), %rcx
leaq -0x24a(%rbp), %r9
movl -0x68(%rbp), %r15d
leaq -0x245(%rbp), %r14
movl -0x238(%rbp), %ebx
movb -0x24b(%rbp), %r11b
movb -0x240(%rbp), %r10b
movl -0x228(%rbp), %eax
movl %eax, -0x48c(%rbp)
leaq -0x64(%rbp), %rdi
leaq -0x70(%rbp), %rsi
leaq -0x222(%rbp), %r8
leaq -0x23c(%rbp), %rax
leaq -0x24c(%rbp), %r12
movq %r12, -0x498(%rbp)
leaq -0x23f(%rbp), %r13
leaq -0x22c(%rbp), %r12
movq %rax, (%rsp)
movq -0x498(%rbp), %rax
movq %rax, 0x8(%rsp)
movl -0x48c(%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 0x7aa8b(%rip), %rcx     # 0x8cf38
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x218(%rbp)
movswl -0x222(%rbp), %eax
cmpl $0x0, %eax
jne 0x124d5
movq -0x218(%rbp), %rax
movq %rax, -0x220(%rbp)
movw -0x222(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x222(%rbp)
movl 0x7aa4b(%rip), %eax     # 0x8cf38
addl $0x1, %eax
movl %eax, 0x7aa42(%rip)     # 0x8cf38
movss -0x250(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x218(%rbp), %rax
movsd %xmm0, (%rax)
movss -0x254(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x218(%rbp), %rax
movsd %xmm0, 0x8(%rax)
movss -0x258(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x218(%rbp), %rax
movsd %xmm0, 0x10(%rax)
movsbl -0x134(%rbp), %eax
cmpl $0x20, %eax
je 0x12593
movl $0x0, -0x458(%rbp)
cmpl $0x4, -0x458(%rbp)
jge 0x12591
movl -0x458(%rbp), %eax
addl $0xc, %eax
cltq
movb -0x140(%rbp,%rax), %dl
movq -0x218(%rbp), %rax
movslq -0x458(%rbp), %rcx
movb %dl, 0x18(%rax,%rcx)
movl -0x458(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x458(%rbp)
jmp 0x12553
jmp 0x125e6
movl $0x0, -0x458(%rbp)
cmpl $0x3, -0x458(%rbp)
jge 0x125db
movl -0x458(%rbp), %eax
addl $0xd, %eax
cltq
movb -0x140(%rbp,%rax), %dl
movq -0x218(%rbp), %rax
movslq -0x458(%rbp), %rcx
movb %dl, 0x18(%rax,%rcx)
movl -0x458(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x458(%rbp)
jmp 0x1259d
movq -0x218(%rbp), %rax
movb $0x20, 0x1b(%rax)
leaq -0x140(%rbp), %rdi
addq $0x38, %rdi
movq -0x218(%rbp), %rdx
addq $0x44, %rdx
leaq 0x6876f(%rip), %rsi     # 0x7ad72
movb $0x0, %al
callq 0x11a0
leaq -0x140(%rbp), %rdi
addq $0x3c, %rdi
movq -0x218(%rbp), %rdx
addq $0x1c, %rdx
leaq 0x6874b(%rip), %rsi     # 0x7ad72
movb $0x0, %al
callq 0x11a0
movl -0x45c(%rbp), %ecx
movq -0x218(%rbp), %rax
movl %ecx, 0x6c(%rax)
jmp 0x11ba6
movq -0x48(%rbp), %rdx
movq -0x220(%rbp), %rcx
leaq -0x24a(%rbp), %r9
movl -0x68(%rbp), %r15d
leaq -0x245(%rbp), %r14
movl -0x238(%rbp), %ebx
movb -0x24b(%rbp), %r11b
movb -0x240(%rbp), %r10b
movl -0x228(%rbp), %eax
movl %eax, -0x49c(%rbp)
leaq -0x64(%rbp), %rdi
leaq -0x70(%rbp), %rsi
leaq -0x222(%rbp), %r8
leaq -0x23c(%rbp), %rax
leaq -0x24c(%rbp), %r12
movq %r12, -0x4a8(%rbp)
leaq -0x23f(%rbp), %r13
leaq -0x22c(%rbp), %r12
movq %rax, (%rsp)
movq -0x4a8(%rbp), %rax
movq %rax, 0x8(%rsp)
movl -0x49c(%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 -0x64(%rbp), %eax
leaq 0x7a74b(%rip), %rcx     # 0x8ce50
cmpl (%rcx), %eax
jle 0x1272a
leaq 0x7a740(%rip), %rax     # 0x8ce50
movl (%rax), %esi
leaq 0x68769(%rip), %rdi     # 0x7ae82
movb $0x0, %al
callq 0x10d0
movl $0x8, %edi
callq 0x1210
movq -0x78(%rbp), %rdi
callq 0x10a0
leaq 0x7997e(%rip), %rax     # 0x8c0b8
cmpl $0x0, (%rax)
je 0x12750
movl -0x64(%rbp), %esi
leaq 0x6862c(%rip), %rdi     # 0x7ad75
movb $0x0, %al
callq 0x10d0
cmpl $0x0, -0x6c(%rbp)
je 0x1277e
leaq -0x210(%rbp), %rdi
leaq 0x6879a(%rip), %rsi     # 0x7aefe
leaq 0x68775(%rip), %rdx     # 0x7aee0
movb $0x0, %al
callq 0x1200
leaq -0x210(%rbp), %rdi
callq 0x10c0
movl -0x64(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
addq $0x4d8, %rsp            # imm = 0x4D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)