// File: /workspace/github_c_makefile_star2_O2/ugobas[P]tnm/nma.c
// Function: Mass_residue
float Mass_residue(atom *atom){
  char *atom_name=atom->name, aa=atom->aa;

  //modyves: removed some double parentheses below, which gave me some warnings
  if(atom_name[0]=='C'){
    if(atom_name[1]==' '){
      return(12); // 0H
    }else if(atom_name[1]=='A'){
      if(aa!='G')return(13); // Adding 1H mass
    }else if(atom_name[1]=='B'){
      if(aa=='A')return(15);              // Adding 3H mass
      if((aa=='V')||(aa=='T'))return(13); // Adding 1H mass
    }else if((aa=='W')||(aa=='F')||(aa=='Y')||(aa=='H')){
      if(atom_name[1]=='G')return(12); // 0H
      if((atom_name[1]=='Z')&&(aa=='Y'))return(12); // 0H
      return(13); // Adding 1H mass
    }else if(atom_name[1]=='G'){
      if((aa=='I')&&(atom_name[2]=='2'))return(15);  // Adding 3H mass
      if(aa=='V')return(15);      // Adding 3H mass
      if(aa=='L')return(13);      // Adding 1H mass
      if((aa=='N')||(aa=='D'))return(12);  // 0H
    }else if(atom_name[1]=='D'){
      if((aa=='L')||(aa=='I'))return(15);    // Adding 3H mass
      if((aa=='Q')||(aa=='E'))return(12);    // 0H
    }else if(atom_name[1]=='E'){
      if(aa=='M')return(15);      // Adding 3H mass
    }else if(atom_name[1]=='Z'){
      if(aa=='R')return(12);      // 0H mass
    }
    return(14);                 // Adding 2H mass
  }

  if(atom_name[0]=='N'){
    if(atom_name[1]==' '){
      if(aa=='P')return(14);           // 0H
      return(15);                      // Adding 1H
    }else if(atom_name[1]=='D'){
      if(aa=='H')return(14);           // 0H
    }else if(atom_name[1]=='E'){
      if((aa=='H')||(aa=='R'))return(15); // Adding 1H
    }else if(atom_name[1]=='Z'){
      if(aa=='K')return(17); // Adding 3H
    }
    return(16);  // Adding 2H mass
  }

  if(atom_name[0]=='O'){
    if(atom_name[1]==' ')return(16); // 0H
    if((atom_name[1]=='G')||(atom_name[1]=='H'))return(17); // 1H
    return(16); // 0H
  }

  if(atom_name[0]=='S')return(32);  // Adding H mass
  if(atom_name[0]=='H')return(1);
  if(atom_name[0]=='P')return(31);
  if(atom_name[0]=='E')return(79); // Selenium
  printf("WARNING, unusual atom %s\n", atom_name);
  return(14);
}

// Assembly:
movq %rdi, %rsi
movzbl 0x18(%rdi), %ecx
addl $-0x43, %ecx
cmpl $0x10, %ecx
ja 0x24777
movzbl 0x68(%rsi), %eax
leaq 0x2e473(%rip), %rdx     # 0x52bac
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movzbl 0x19(%rsi), %ecx
movss 0x2e4a2(%rip), %xmm1    # 0x52bf0
cmpl $0x20, %ecx
je 0x24911
cmpl $0x42, %ecx
je 0x24804
cmpl $0x41, %ecx
jne 0x2481c
cmpl $0x47, %eax
jne 0x24813
jmp 0x24858
pushq %rax
addq $0x18, %rsi
leaq 0x2e611(%rip), %rdi     # 0x52d94
xorl %eax, %eax
callq 0x20f0
movss 0x2e472(%rip), %xmm0    # 0x52c04
addq $0x8, %rsp
retq
movss 0x2e45d(%rip), %xmm0    # 0x52bfc
retq
movss 0x2e44c(%rip), %xmm0    # 0x52bf4
retq
movss 0x2e447(%rip), %xmm0    # 0x52bf8
retq
movss 0x26856(%rip), %xmm0    # 0x4b010
retq
movzbl 0x19(%rsi), %ecx
cmpl $0x45, %ecx
je 0x24861
cmpl $0x44, %ecx
je 0x24853
cmpl $0x20, %ecx
jne 0x2487d
xorl %ecx, %ecx
cmpl $0x50, %eax
sete %cl
leaq 0x2e2c7(%rip), %rax     # 0x52ab0
jmp 0x24877
movb 0x19(%rsi), %al
addb $-0x47, %al
cmpb $0x1, %al
ja 0x2488a
movss 0x2e405(%rip), %xmm0    # 0x52c08
retq
cmpl $0x41, %eax
je 0x248e0
andb $-0x3, %al
cmpb $0x54, %al
jne 0x24858
movss 0x2e3f5(%rip), %xmm0    # 0x52c10
retq
leal -0x46(%rax), %edx
cmpl $0x13, %edx
ja 0x24893
movl $0xa0005, %edi          # imm = 0xA0005
btl %edx, %edi
jae 0x24893
movaps %xmm1, %xmm0
cmpl $0x47, %ecx
je 0x24796
xorb $0x59, %al
xorb $0x5a, %cl
xorl %edx, %edx
orb %al, %cl
sete %dl
leaq 0x2e26b(%rip), %rax     # 0x52ab8
movss (%rax,%rdx,4), %xmm0
retq
cmpl $0x48, %eax
jne 0x2488a
movss 0x2e3a4(%rip), %xmm0    # 0x52c04
retq
xorl %ecx, %ecx
cmpl $0x48, %eax
sete %dl
cmpl $0x52, %eax
je 0x248e0
movb %dl, %cl
leaq 0x2e231(%rip), %rax     # 0x52aa8
movss (%rax,%rcx,4), %xmm0
retq
xorb $0x5a, %cl
xorb $0x4b, %al
orb %cl, %al
je 0x247fb
movss 0x2e36e(%rip), %xmm0    # 0x52c00
retq
cmpl $0x44, %ecx
je 0x248e9
cmpl $0x45, %ecx
je 0x248d7
cmpl $0x47, %ecx
jne 0x24915
cmpl $0x44, %eax
je 0x24911
movss 0x2e35d(%rip), %xmm0    # 0x52c0c
cmpl $0x56, %eax
je 0x24796
cmpl $0x4c, %eax
je 0x24813
cmpl $0x4e, %eax
je 0x24911
cmpl $0x49, %eax
jne 0x24858
cmpb $0x32, 0x1a(%rsi)
je 0x24796
jmp 0x24858
cmpl $0x4d, %eax
jne 0x24858
movss 0x2e324(%rip), %xmm0    # 0x52c0c
retq
cmpl $0x45, %eax
je 0x24911
movss 0x2e316(%rip), %xmm0    # 0x52c0c
cmpl $0x49, %eax
je 0x24796
cmpl $0x4c, %eax
je 0x24796
cmpl $0x51, %eax
jne 0x24858
movaps %xmm1, %xmm0
retq
xorb $0x5a, %cl
xorb $0x52, %al
orb %cl, %al
movaps %xmm1, %xmm0
je 0x24796
jmp 0x24858