// File: /workspace/github_c_makefile_star2_O1/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 0x273f8
movzbl 0x68(%rsi), %eax
leaq 0x318b6(%rip), %rdx     # 0x58c70
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movzbl 0x19(%rsi), %ecx
movss 0x3190d(%rip), %xmm1    # 0x58cdc
cmpl $0x20, %ecx
je 0x275d7
cmpl $0x42, %ecx
je 0x27485
cmpl $0x41, %ecx
jne 0x2749d
cmpl $0x47, %eax
jne 0x27494
jmp 0x274d9
pushq %rax
addq $0x18, %rsi
leaq 0x31a7c(%rip), %rdi     # 0x58e80
xorl %eax, %eax
callq 0x20f0
movss 0x318d5(%rip), %xmm0    # 0x58ce8
addq $0x8, %rsp
retq
movss 0x318c0(%rip), %xmm0    # 0x58ce0
retq
movss 0x318c3(%rip), %xmm0    # 0x58cec
retq
movss 0x318be(%rip), %xmm0    # 0x58cf0
retq
movss 0x29bd5(%rip), %xmm0    # 0x51010
retq
movzbl 0x19(%rsi), %ecx
cmpl $0x45, %ecx
je 0x274e2
cmpl $0x44, %ecx
je 0x274d4
cmpl $0x20, %ecx
jne 0x274fe
xorl %ecx, %ecx
cmpl $0x50, %eax
sete %cl
leaq 0x31716(%rip), %rax     # 0x58b80
jmp 0x274f8
movb 0x19(%rsi), %al
addb $-0x47, %al
cmpb $0x1, %al
ja 0x2750b
movss 0x31870(%rip), %xmm0    # 0x58cf4
retq
cmpl $0x41, %eax
je 0x27552
andb $-0x3, %al
cmpb $0x54, %al
jne 0x274d9
movss 0x31860(%rip), %xmm0    # 0x58cfc
retq
leal -0x46(%rax), %edx
cmpl $0x13, %edx
ja 0x27514
movl $0xa0005, %edi          # imm = 0xA0005
btl %edx, %edi
jae 0x27514
movaps %xmm1, %xmm0
cmpl $0x47, %ecx
je 0x27417
xorb $0x59, %al
xorb $0x5a, %cl
xorl %edx, %edx
orb %al, %cl
sete %dl
leaq 0x316ba(%rip), %rax     # 0x58b88
movss (%rax,%rdx,4), %xmm0
retq
cmpl $0x48, %eax
jne 0x2750b
movss 0x31807(%rip), %xmm0    # 0x58ce8
retq
xorl %ecx, %ecx
cmpl $0x48, %eax
sete %dl
cmpl $0x52, %eax
je 0x27552
movb %dl, %cl
leaq 0x31680(%rip), %rax     # 0x58b78
movss (%rax,%rcx,4), %xmm0
retq
xorb $0x5a, %cl
xorb $0x4b, %al
orb %cl, %al
je 0x2747c
movss 0x317d1(%rip), %xmm0    # 0x58ce4
retq
cmpl $0x44, %ecx
je 0x2755b
cmpl $0x45, %ecx
je 0x2754d
cmpl $0x47, %ecx
jne 0x2757b
movss 0x317cd(%rip), %xmm0    # 0x58cf8
cmpl $0x4b, %eax
jle 0x275a3
cmpl $0x4c, %eax
je 0x27494
cmpl $0x4e, %eax
je 0x275d7
cmpl $0x56, %eax
je 0x27417
jmp 0x274d9
cmpl $0x4d, %eax
jne 0x274d9
movss 0x3179e(%rip), %xmm0    # 0x58cf8
retq
movss 0x31795(%rip), %xmm0    # 0x58cf8
cmpl $0x4b, %eax
jg 0x27590
cmpl $0x45, %eax
je 0x275d7
cmpl $0x49, %eax
je 0x27417
jmp 0x274d9
xorb $0x5a, %cl
xorb $0x52, %al
orb %cl, %al
movaps %xmm1, %xmm0
je 0x27417
jmp 0x274d9
cmpl $0x4c, %eax
je 0x27417
cmpl $0x51, %eax
je 0x275d7
jmp 0x274d9
cmpl $0x44, %eax
je 0x275d7
cmpl $0x49, %eax
jne 0x274d9
cmpb $0x32, 0x1a(%rsi)
je 0x27417
addb $-0x44, %al
rorb %al
cmpb $0xa, %al
jae 0x274d9
movzbl %al, %eax
leaq 0x316e3(%rip), %rcx     # 0x58cb4
movss (%rcx,%rax,4), %xmm0
retq
movaps %xmm1, %xmm0
retq