#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ free(double *);
double *initAminoAcidMass();
void computeFragmentIonsFixedVariableModification(int *n_, char **seq_,
                                                  double *pim_, double *b_,
                                                  double *y_, int *modified_,
                                                  double *modification_,
                                                  double *fixedMmodification) {
  int i;
  double b, y;
  double C_term;
  double N_term;
  double Electron;
  double Hydrogen;
  int letter;
  double *M;
  M = initAminoAcidMass();
  for (i = 0; i < 26; i++) {
    if (fixedMmodification[i] > 0.0) {
      M[i] = fixedMmodification[i];
    } else {
      fixedMmodification[i] = M[i];
    }
  }
  C_term = 17.002740;
  N_term = 1.007825;
  Electron = 0.000549;
  Hydrogen = 1.007825;
  b = N_term - Electron;
  y = *pim_;
  for (i = 0; i < *n_; i++) {
    letter = seq_[0][i];
    if (64 < letter && letter < 92) {
      b += M[letter - 65] + modification_[modified_[i]];
      b_[i] = b;
      y_[*n_ - i - 1] = y;
      y -= (M[letter - 65] + modification_[modified_[i]]);
    }
  }
  free(M);
}


x86 assembly (clang, -O0):
<computeFragmentIonsFixedVariableModification>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    $0x0,%al
call   1040 <initAminoAcidMass@plt>
mov    %rax,-0x78(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x1a,-0x34(%rbp)
jge    11cd <computeFragmentIonsFixedVariableModification+0xad>
mov    0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11a0 <computeFragmentIonsFixedVariableModification+0x80>
mov    0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x78(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    11ba <computeFragmentIonsFixedVariableModification+0x9a>
mov    -0x78(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    11bf <computeFragmentIonsFixedVariableModification+0x9f>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    115d <computeFragmentIonsFixedVariableModification+0x3d>
movsd  0xe3b(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe1e(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xe19(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xe04(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x58(%rbp),%xmm0
subsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%eax
jge    1305 <computeFragmentIonsFixedVariableModification+0x1e5>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movslq -0x34(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x6c(%rbp)
mov    $0x40,%eax
cmp    -0x6c(%rbp),%eax
jge    12f2 <computeFragmentIonsFixedVariableModification+0x1d2>
cmpl   $0x5c,-0x6c(%rbp)
jge    12f2 <computeFragmentIonsFixedVariableModification+0x1d2>
mov    -0x78(%rbp),%rax
mov    -0x6c(%rbp),%ecx
sub    $0x41,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    -0x30(%rbp),%rcx
movslq -0x34(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
addsd  (%rax,%rcx,8),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
sub    -0x34(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x78(%rbp),%rax
mov    -0x6c(%rbp),%ecx
sub    $0x41,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    0x10(%rbp),%rax
mov    -0x30(%rbp),%rcx
movslq -0x34(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
addsd  (%rax,%rcx,8),%xmm1
movsd  -0x48(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    12f7 <computeFragmentIonsFixedVariableModification+0x1d7>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1224 <computeFragmentIonsFixedVariableModification+0x104>
mov    -0x78(%rbp),%rdi
call   1030 <free@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<computeFragmentIonsFixedVariableModification>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,%rbx
mov    %r8,%r15
mov    %rcx,%r14
mov    %rdx,0x8(%rsp)
mov    %rsi,0x10(%rsp)
mov    %rdi,%rbp
mov    0x58(%rsp),%r13
mov    0x50(%rsp),%r12
xor    %eax,%eax
call   1040 <initAminoAcidMass@plt>
mov    $0x1,%ecx
xorpd  %xmm0,%xmm0
jmp    116f <computeFragmentIonsFixedVariableModification+0x4f>
movsd  %xmm1,(%rax,%rcx,8)
add    $0x2,%rcx
cmp    $0x1b,%rcx
je     11b8 <computeFragmentIonsFixedVariableModification+0x98>
movsd  -0x8(%r13,%rcx,8),%xmm1
ucomisd %xmm0,%xmm1
jbe    1190 <computeFragmentIonsFixedVariableModification+0x70>
movsd  %xmm1,-0x8(%rax,%rcx,8)
jmp    119d <computeFragmentIonsFixedVariableModification+0x7d>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  -0x8(%rax,%rcx,8),%xmm1
movsd  %xmm1,-0x8(%r13,%rcx,8)
movsd  0x0(%r13,%rcx,8),%xmm1
ucomisd %xmm0,%xmm1
ja     1160 <computeFragmentIonsFixedVariableModification+0x40>
movsd  (%rax,%rcx,8),%xmm1
movsd  %xmm1,0x0(%r13,%rcx,8)
jmp    1165 <computeFragmentIonsFixedVariableModification+0x45>
mov    0x0(%rbp),%r8d
test   %r8d,%r8d
jle    123e <computeFragmentIonsFixedVariableModification+0x11e>
mov    %rbx,%r9
mov    0x8(%rsp),%rcx
movsd  (%rcx),%xmm0
mov    0x10(%rsp),%rcx
mov    (%rcx),%rdx
lea    -0x1(%r8),%esi
movsd  0xe1f(%rip),%xmm1
xor    %edi,%edi
jmp    11fc <computeFragmentIonsFixedVariableModification+0xdc>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rdi
add    $0xffffffff,%esi
cmp    %rdi,%r8
je     123e <computeFragmentIonsFixedVariableModification+0x11e>
movzbl (%rdx,%rdi,1),%ebp
lea    -0x41(%rbp),%ebx
cmp    $0x1a,%bl
ja     11f0 <computeFragmentIonsFixedVariableModification+0xd0>
add    $0xffffffbf,%ebp
movsd  (%rax,%rbp,8),%xmm2
movslq (%r9,%rdi,4),%rbx
addsd  (%r12,%rbx,8),%xmm2
addsd  %xmm2,%xmm1
movsd  %xmm1,(%r14,%rdi,8)
movslq %esi,%rcx
movsd  %xmm0,(%r15,%rcx,8)
movsd  (%rax,%rbp,8),%xmm2
addsd  (%r12,%rbx,8),%xmm2
subsd  %xmm2,%xmm0
jmp    11f0 <computeFragmentIonsFixedVariableModification+0xd0>
mov    %rax,%rdi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @computeFragmentIonsFixedVariableModification(i32* %0, i8** %1, double* %2, double* %3, double* %4, i32* %5, double* %6, double* %7) {
%9 = alloca i32*
%10 = alloca i8**
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca i32*
%15 = alloca double*
%16 = alloca double*
%17 = alloca i32
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca i32
%25 = alloca double*
store i32* %0, i32** %9
store i8** %1, i8*** %10
store double* %2, double** %11
store double* %3, double** %12
store double* %4, double** %13
store i32* %5, i32** %14
store double* %6, double** %15
store double* %7, double** %16
%26 = call double* (...) @initAminoAcidMass()
store double* %26, double** %25
store i32 0, i32* %17
br label %27
27: ; preds = %58, %8
%28 = load i32, i32* %17
%29 = icmp slt i32 %28, 26
br i1 %29, label %30, label %61
30: ; preds = %27
%31 = load double*, double** %16
%32 = load i32, i32* %17
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds double, double* %31, i64 %33
%35 = load double, double* %34
%36 = fcmp ogt double %35, 0.000000e+00
br i1 %36, label %37, label %47
37: ; preds = %30
%38 = load double*, double** %16
%39 = load i32, i32* %17
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds double, double* %38, i64 %40
%42 = load double, double* %41
%43 = load double*, double** %25
%44 = load i32, i32* %17
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds double, double* %43, i64 %45
store double %42, double* %46
br label %57
47: ; preds = %30
%48 = load double*, double** %25
%49 = load i32, i32* %17
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds double, double* %48, i64 %50
%52 = load double, double* %51
%53 = load double*, double** %16
%54 = load i32, i32* %17
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds double, double* %53, i64 %55
store double %52, double* %56
br label %57
57: ; preds = %47, %37
br label %58
58: ; preds = %57
%59 = load i32, i32* %17
%60 = add nsw i32 %59, 1
store i32 %60, i32* %17
br label %27
61: ; preds = %27
store double 0x403100B39192641B, double* %20
store double 0x3FF0200D1B71758E, double* %21
store double 5.490000e-04, double* %22
store double 0x3FF0200D1B71758E, double* %23
%62 = load double, double* %21
%63 = load double, double* %22
%64 = fsub double %62, %63
store double %64, double* %18
%65 = load double*, double** %11
%66 = load double, double* %65
store double %66, double* %19
store i32 0, i32* %17
br label %67
67: ; preds = %138, %61
%68 = load i32, i32* %17
%69 = load i32*, i32** %9
%70 = load i32, i32* %69
%71 = icmp slt i32 %68, %70
br i1 %71, label %72, label %141
72: ; preds = %67
%73 = load i8**, i8*** %10
%74 = getelementptr inbounds i8*, i8** %73, i64 0
%75 = load i8*, i8** %74
%76 = load i32, i32* %17
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds i8, i8* %75, i64 %77
%79 = load i8, i8* %78
%80 = sext i8 %79 to i32
store i32 %80, i32* %24
%81 = load i32, i32* %24
%82 = icmp slt i32 64, %81
br i1 %82, label %83, label %137
83: ; preds = %72
%84 = load i32, i32* %24
%85 = icmp slt i32 %84, 92
br i1 %85, label %86, label %137
86: ; preds = %83
%87 = load double*, double** %25
%88 = load i32, i32* %24
%89 = sub nsw i32 %88, 65
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds double, double* %87, i64 %90
%92 = load double, double* %91
%93 = load double*, double** %15
%94 = load i32*, i32** %14
%95 = load i32, i32* %17
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds i32, i32* %94, i64 %96
%98 = load i32, i32* %97
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds double, double* %93, i64 %99
%101 = load double, double* %100
%102 = fadd double %92, %101
%103 = load double, double* %18
%104 = fadd double %103, %102
store double %104, double* %18
%105 = load double, double* %18
%106 = load double*, double** %12
%107 = load i32, i32* %17
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds double, double* %106, i64 %108
store double %105, double* %109
%110 = load double, double* %19
%111 = load double*, double** %13
%112 = load i32*, i32** %9
%113 = load i32, i32* %112
%114 = load i32, i32* %17
%115 = sub nsw i32 %113, %114
%116 = sub nsw i32 %115, 1
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds double, double* %111, i64 %117
store double %110, double* %118
%119 = load double*, double** %25
%120 = load i32, i32* %24
%121 = sub nsw i32 %120, 65
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds double, double* %119, i64 %122
%124 = load double, double* %123
%125 = load double*, double** %15
%126 = load i32*, i32** %14
%127 = load i32, i32* %17
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds i32, i32* %126, i64 %128
%130 = load i32, i32* %129
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds double, double* %125, i64 %131
%133 = load double, double* %132
%134 = fadd double %124, %133
%135 = load double, double* %19
%136 = fsub double %135, %134
store double %136, double* %19
br label %137
137: ; preds = %86, %83, %72
br label %138
138: ; preds = %137
%139 = load i32, i32* %17
%140 = add nsw i32 %139, 1
store i32 %140, i32* %17
br label %67
141: ; preds = %67
%142 = load double*, double** %25
%143 = call i32 @free(double* %142)
ret void
}

LLVM IR (-O2):
define void @computeFragmentIonsFixedVariableModification(i32* nocapture %0, i8** nocapture %1, double* nocapture %2, double* nocapture writeonly %3, double* nocapture writeonly %4, i32* nocapture %5, double* nocapture %6, double* nocapture %7) {
%9 = tail call double* (...) @initAminoAcidMass()
br label %10
10: ; preds = %28, %8
%11 = phi i64 [ 0, %8 ], [ %29, %28 ]
%12 = getelementptr inbounds double, double* %7, i64 %11
%13 = load double, double* %12
%14 = fcmp ogt double %13, 0.000000e+00
%15 = getelementptr inbounds double, double* %9, i64 %11
br i1 %14, label %16, label %17
16: ; preds = %10
store double %13, double* %15
br label %19
17: ; preds = %10
%18 = load double, double* %15
store double %18, double* %12
br label %19
19: ; preds = %16, %17
%20 = or i64 %11, 1
%21 = getelementptr inbounds double, double* %7, i64 %20
%22 = load double, double* %21
%23 = fcmp ogt double %22, 0.000000e+00
%24 = getelementptr inbounds double, double* %9, i64 %20
br i1 %23, label %27, label %25
25: ; preds = %19
%26 = load double, double* %24
store double %26, double* %21
br label %28
27: ; preds = %19
store double %22, double* %24
br label %28
28: ; preds = %27, %25
%29 = add nuw nsw i64 %11, 2
%30 = icmp eq i64 %29, 26
br i1 %30, label %31, label %10
31: ; preds = %28
%32 = load i32, i32* %0
%33 = icmp sgt i32 %32, 0
br i1 %33, label %34, label %74
34: ; preds = %31
%35 = load double, double* %2
%36 = load i8*, i8** %1
%37 = zext i32 %32 to i64
br label %38
38: ; preds = %34, %69
%39 = phi i64 [ 0, %34 ], [ %72, %69 ]
%40 = phi double [ 0x3FF01DCD7060BB2C, %34 ], [ %71, %69 ]
%41 = phi double [ %35, %34 ], [ %70, %69 ]
%42 = getelementptr inbounds i8, i8* %36, i64 %39
%43 = load i8, i8* %42
%44 = add i8 %43, -65
%45 = icmp ult i8 %44, 27
br i1 %45, label %46, label %69
46: ; preds = %38
%47 = zext i8 %43 to i64
%48 = add nuw nsw i64 %47, 4294967231
%49 = and i64 %48, 4294967295
%50 = getelementptr inbounds double, double* %9, i64 %49
%51 = load double, double* %50
%52 = getelementptr inbounds i32, i32* %5, i64 %39
%53 = load i32, i32* %52
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds double, double* %6, i64 %54
%56 = load double, double* %55
%57 = fadd double %51, %56
%58 = fadd double %40, %57
%59 = getelementptr inbounds double, double* %3, i64 %39
store double %58, double* %59
%60 = trunc i64 %39 to i32
%61 = xor i32 %60, -1
%62 = add i32 %32, %61
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds double, double* %4, i64 %63
store double %41, double* %64
%65 = load double, double* %50
%66 = load double, double* %55
%67 = fadd double %65, %66
%68 = fsub double %41, %67
br label %69
69: ; preds = %38, %46
%70 = phi double [ %68, %46 ], [ %41, %38 ]
%71 = phi double [ %58, %46 ], [ %40, %38 ]
%72 = add nuw nsw i64 %39, 1
%73 = icmp eq i64 %72, %37
br i1 %73, label %74, label %38
74: ; preds = %69, %31
%75 = tail call i32 @free(double* %9)
ret void
}