// File: /workspace/github_c_makefile_star2_O0/ugobas[P]tnm/read.c
// Function: Get_amm
int Get_amm(char *amm, int *exo, char *res_type_old, int hetatm, int n_exo)
{
  /* Check amino acid type */
  Code_3_2(amm, res_type_old);
  int type=0, exo_check=0;

 find_type:
  if(amm[0] == ' '){
    // Standard amino acid residue
    if(hetatm==0 || exo_check){type=1;}
    else{type=-1;} // Standard res. and HETATM => ligand
  }else if(amm[0]=='D'){
    // deoxyribo-nucleotide
    if(hetatm==0 || exo_check){type=2;}
    else{type=-2;} // Standard nuc and HETATM => ligand
  }else if(amm[0]=='R'){
    // ribo-nucleotide
    if(hetatm==0 || exo_check){type=3;}
    else{type=-3;} // Standard nuc and HETATM => ligand
  }else if(exo_check==0){
    exo_check=1;
    // Non-standard residue
    for(int i=0; i<20; i++){
      for(int j=0; j<n_modres[i]; j++){
	if(strncmp(res_type_old, modres[i]+4*j, 3)==0){
	  Code_3_2(amm, stdres[i]); *exo=1; goto find_type;
	}
      }
    }
    if(n_exo){
      for(int i=n_exo-1; i>=0; i--){
	if(strncmp(res_type_old,res_exo[i],3)==0){
	  Code_3_2(amm, res_std[i]); *exo=1; goto find_type;
	}
      }
    }
  }
  //if(type<0)type=-type;
  return(type);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x12a10
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
jne 0x12873
cmpl $0x0, -0x1c(%rbp)
je 0x1285e
cmpl $0x0, -0x28(%rbp)
je 0x12867
movl $0x1, -0x24(%rbp)
jmp 0x1286e
movl $0xffffffff, -0x24(%rbp) # imm = 0xFFFFFFFF
jmp 0x129fb
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x44, %eax
jne 0x128a0
cmpl $0x0, -0x1c(%rbp)
je 0x1288b
cmpl $0x0, -0x28(%rbp)
je 0x12894
movl $0x2, -0x24(%rbp)
jmp 0x1289b
movl $0xfffffffe, -0x24(%rbp) # imm = 0xFFFFFFFE
jmp 0x129f9
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x52, %eax
jne 0x128cd
cmpl $0x0, -0x1c(%rbp)
je 0x128b8
cmpl $0x0, -0x28(%rbp)
je 0x128c1
movl $0x3, -0x24(%rbp)
jmp 0x128c8
movl $0xfffffffd, -0x24(%rbp) # imm = 0xFFFFFFFD
jmp 0x129f7
cmpl $0x0, -0x28(%rbp)
jne 0x129f5
movl $0x1, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
cmpl $0x14, -0x2c(%rbp)
jge 0x12980
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
movslq -0x2c(%rbp), %rdx
leaq 0x7b5dc(%rip), %rcx     # 0x8dee0
cmpl (%rcx,%rdx,4), %eax
jge 0x12970
movq -0x18(%rbp), %rdi
movslq -0x2c(%rbp), %rax
leaq 0x7b618(%rip), %rsi     # 0x8df30
imulq $0x64, %rax, %rax
addq %rax, %rsi
movl -0x30(%rbp), %eax
shll $0x2, %eax
cltq
addq %rax, %rsi
movl $0x3, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x12963
movq -0x8(%rbp), %rdi
movslq -0x2c(%rbp), %rax
leaq 0x7bdb8(%rip), %rsi     # 0x8e700
imulq $0x5, %rax, %rax
addq %rax, %rsi
callq 0x12a10
movq -0x10(%rbp), %rax
movl $0x1, (%rax)
jmp 0x12846
jmp 0x12965
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x128f6
jmp 0x12972
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x128e5
cmpl $0x0, -0x20(%rbp)
je 0x129f3
movl -0x20(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jl 0x129f1
movq -0x18(%rbp), %rdi
movslq -0x34(%rbp), %rax
leaq 0x7a59c(%rip), %rsi     # 0x8cf40
imulq $0x5, %rax, %rax
addq %rax, %rsi
movl $0x3, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x129e4
movq -0x8(%rbp), %rdi
movslq -0x34(%rbp), %rax
leaq 0x7ad47(%rip), %rsi     # 0x8d710
imulq $0x5, %rax, %rax
addq %rax, %rsi
callq 0x12a10
movq -0x10(%rbp), %rax
movl $0x1, (%rax)
jmp 0x12846
jmp 0x129e6
movl -0x34(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x1298f
jmp 0x129f3
jmp 0x129f5
jmp 0x129f7
jmp 0x129f9
jmp 0x129fb
movl -0x24(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)