#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*/ printf(char *, double);
double meltsM(double *const array) {
  for (int i = 0; i < 16; i++) {
    if (i == 0 || i == 2 || i == 5 || i == 7 || i == 10 || i == 11 || i == 12)
      printf("%.1f, ", array[i]);
  }
  double Si = array[0] / (28.0844 + 15.9994 * 2);
  double Ti = array[1] / (47.867 + 15.9994 * 2);
  double Al = array[2] / (26.9815 + 15.9994 * 1.5);
  double Fe =
      array[3] / (55.845 + 15.9994 * 1.5) + array[5] / (55.845 + 15.9994);
  double Cr = array[4] / (51.9961 + 15.9994 * 1.5);
  double Mn = array[6] / (54.9380 + 15.9994);
  double Mg = array[7] / (24.3050 + 15.9994);
  double Ni = array[8] / (58.6934 + 15.9994);
  double Co = array[9] / (58.9332 + 15.9994);
  double Ca = array[10] / (40.078 + 15.9994);
  double Na = array[11] / (22.9898 + 15.9994 / 2);
  double K = array[12] / (39.0983 + 15.9994 / 2);
  double P = array[13] / (30.9738 + 15.9994 * 2.5);
  double TotalMoles =
      Si + Ti + Al + Fe + Cr + Mn + Mg + Ni + Co + Ca + Na + K + P;
  double M = (Na + K + 2 * Ca) / (Al * Si) * TotalMoles;
  printf("\t\t\t\t%.2g", M);
  return M;
}


x86 assembly (clang, -O0):
<meltsM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    11a2 <meltsM+0x92>
cmpl   $0x0,-0xc(%rbp)
je     1176 <meltsM+0x66>
cmpl   $0x2,-0xc(%rbp)
je     1176 <meltsM+0x66>
cmpl   $0x5,-0xc(%rbp)
je     1176 <meltsM+0x66>
cmpl   $0x7,-0xc(%rbp)
je     1176 <meltsM+0x66>
cmpl   $0xa,-0xc(%rbp)
je     1176 <meltsM+0x66>
cmpl   $0xb,-0xc(%rbp)
je     1176 <meltsM+0x66>
cmpl   $0xc,-0xc(%rbp)
jne    118f <meltsM+0x7f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
jmp    1194 <meltsM+0x84>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1126 <meltsM+0x16>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xeb6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  0xe94(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  0xe72(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  0xe50(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm1
movsd  0xe33(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  0xe0d(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm0
movsd  0xdeb(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm0
movsd  0xdc9(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x40(%rax),%xmm0
movsd  0xda7(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x48(%rax),%xmm0
movsd  0xd85(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x50(%rax),%xmm0
movsd  0xd63(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x58(%rax),%xmm0
movsd  0xd41(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x60(%rax),%xmm0
movsd  0xd1f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x68(%rax),%xmm0
movsd  0xcfd(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
addsd  -0x48(%rbp),%xmm0
addsd  -0x50(%rbp),%xmm0
addsd  -0x58(%rbp),%xmm0
addsd  -0x60(%rbp),%xmm0
addsd  -0x68(%rbp),%xmm0
addsd  -0x70(%rbp),%xmm0
addsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x68(%rbp),%xmm1
addsd  -0x70(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
lea    0xce4(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x88(%rbp),%xmm0
ff
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<meltsM>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r15
xor    %ebx,%ebx
lea    0xf53(%rip),%r14
jmp    1148 <meltsM+0x38>
nopw   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    $0x10,%rbx
je     116c <meltsM+0x5c>
mov    %ebx,%eax
and    $0x7ffffffd,%eax
cmp    $0x5,%eax
je     1130 <meltsM+0x20>
test   %eax,%eax
je     1130 <meltsM+0x20>
cmp    $0xa,%rbx
je     1130 <meltsM+0x20>
cmp    $0xb,%rbx
je     1130 <meltsM+0x20>
cmp    $0xc,%rbx
jne    113e <meltsM+0x2e>
jmp    1130 <meltsM+0x20>
movsd  (%r15),%xmm0
movhpd 0x10(%r15),%xmm0
movsd  0x8(%r15),%xmm3
divpd  0xe7b(%rip),%xmm0
movsd  0x18(%r15),%xmm5
divsd  0xedd(%rip),%xmm5
movhpd 0x28(%r15),%xmm3
divpd  0xe6f(%rip),%xmm3
movsd  0x30(%r15),%xmm6
movhpd 0x20(%r15),%xmm6
divpd  0xe6b(%rip),%xmm6
movupd 0x38(%r15),%xmm1
divpd  0xe6d(%rip),%xmm1
movupd 0x48(%r15),%xmm2
divpd  0xe6f(%rip),%xmm2
movupd 0x58(%r15),%xmm4
divpd  0xe71(%rip),%xmm4
movapd %xmm0,%xmm7
unpcklpd %xmm5,%xmm7
addpd  %xmm3,%xmm7
movapd %xmm0,%xmm3
unpckhpd %xmm0,%xmm3
movapd %xmm7,%xmm5
addsd  %xmm3,%xmm5
unpckhpd %xmm7,%xmm7
addsd  %xmm5,%xmm7
movapd %xmm6,%xmm5
unpckhpd %xmm6,%xmm5
addsd  %xmm7,%xmm5
addsd  %xmm6,%xmm5
addsd  %xmm1,%xmm5
unpckhpd %xmm1,%xmm1
addsd  %xmm5,%xmm1
addsd  %xmm2,%xmm1
unpckhpd %xmm2,%xmm2
addsd  %xmm2,%xmm1
addsd  %xmm4,%xmm1
movapd %xmm4,%xmm5
unpckhpd %xmm4,%xmm5
addsd  %xmm5,%xmm1
addsd  %xmm4,%xmm5
addsd  %xmm2,%xmm2
addsd  %xmm5,%xmm2
mulsd  %xmm0,%xmm3
movhpd 0x68(%r15),%xmm2
shufpd $0x2,0xe06(%rip),%xmm3
divpd  %xmm3,%xmm2
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
movapd %xmm0,(%rsp)
lea    0xe05(%rip),%rdi
call   1030 <printf@plt>
movaps (%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%.1f, \00"
@.str.1 = [9 x i8] c"\09\09\09\09%.2g\00"
define double @meltsM(double* %0) {
%2 = alloca double*
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
store double* %0, double** %2
store i32 0, i32* %3
br label %19
19: ; preds = %51, %1
%20 = load i32, i32* %3
%21 = icmp slt i32 %20, 16
br i1 %21, label %22, label %54
22: ; preds = %19
%23 = load i32, i32* %3
%24 = icmp eq i32 %23, 0
br i1 %24, label %43, label %25
25: ; preds = %22
%26 = load i32, i32* %3
%27 = icmp eq i32 %26, 2
br i1 %27, label %43, label %28
28: ; preds = %25
%29 = load i32, i32* %3
%30 = icmp eq i32 %29, 5
br i1 %30, label %43, label %31
31: ; preds = %28
%32 = load i32, i32* %3
%33 = icmp eq i32 %32, 7
br i1 %33, label %43, label %34
34: ; preds = %31
%35 = load i32, i32* %3
%36 = icmp eq i32 %35, 10
br i1 %36, label %43, label %37
37: ; preds = %34
%38 = load i32, i32* %3
%39 = icmp eq i32 %38, 11
br i1 %39, label %43, label %40
40: ; preds = %37
%41 = load i32, i32* %3
%42 = icmp eq i32 %41, 12
br i1 %42, label %43, label %50
43: ; preds = %40, %37, %34, %31, %28, %25, %22
%44 = load double*, double** %2
%45 = load i32, i32* %3
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds double, double* %44, i64 %46
%48 = load double, double* %47
%49 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %48)
br label %50
50: ; preds = %43, %40
br label %51
51: ; preds = %50
%52 = load i32, i32* %3
%53 = add nsw i32 %52, 1
store i32 %53, i32* %3
br label %19
54: ; preds = %19
%55 = load double*, double** %2
%56 = getelementptr inbounds double, double* %55, i64 0
%57 = load double, double* %56
%58 = fdiv double %57, 0x404E0AA64C2F837B
store double %58, double* %4
%59 = load double*, double** %2
%60 = getelementptr inbounds double, double* %59, i64 1
%61 = load double, double* %60
%62 = fdiv double %61, 0x4053F7694467381D
store double %62, double* %5
%63 = load double*, double** %2
%64 = getelementptr inbounds double, double* %63, i64 2
%65 = load double, double* %64
%66 = fdiv double %65, 0x40497D844D013A92
store double %66, double* %6
%67 = load double*, double** %2
%68 = getelementptr inbounds double, double* %67, i64 3
%69 = load double, double* %68
%70 = fdiv double %69, 7.984410e+01
%71 = load double*, double** %2
%72 = getelementptr inbounds double, double* %71, i64 5
%73 = load double, double* %72
%74 = fdiv double %73, 7.184440e+01
%75 = fadd double %70, %74
store double %75, double* %7
%76 = load double*, double** %2
%77 = getelementptr inbounds double, double* %76, i64 4
%78 = load double, double* %77
%79 = fdiv double %78, 0x4052FFB15B573EAB
store double %79, double* %8
%80 = load double*, double** %2
%81 = getelementptr inbounds double, double* %80, i64 6
%82 = load double, double* %81
%83 = fdiv double %82, 7.093740e+01
store double %83, double* %9
%84 = load double*, double** %2
%85 = getelementptr inbounds double, double* %84, i64 7
%86 = load double, double* %85
%87 = fdiv double %86, 4.030440e+01
store double %87, double* %10
%88 = load double*, double** %2
%89 = getelementptr inbounds double, double* %88, i64 8
%90 = load double, double* %89
%91 = fdiv double %90, 0x4052AC56D5CFAACD
store double %91, double* %11
%92 = load double*, double** %2
%93 = getelementptr inbounds double, double* %92, i64 9
%94 = load double, double* %93
%95 = fdiv double %94, 0x4052BBAFB7E90FF9
store double %95, double* %12
%96 = load double*, double** %2
%97 = getelementptr inbounds double, double* %96, i64 10
%98 = load double, double* %97
%99 = fdiv double %98, 0x404C09E83E425AEF
store double %99, double* %13
%100 = load double*, double** %2
%101 = getelementptr inbounds double, double* %100, i64 11
%102 = load double, double* %101
%103 = fdiv double %102, 3.098950e+01
store double %103, double* %14
%104 = load double*, double** %2
%105 = getelementptr inbounds double, double* %104, i64 12
%106 = load double, double* %105
%107 = fdiv double %106, 4.709800e+01
store double %107, double* %15
%108 = load double*, double** %2
%109 = getelementptr inbounds double, double* %108, i64 13
%110 = load double, double* %109
%111 = fdiv double %110, 7.097230e+01
store double %111, double* %16
%112 = load double, double* %4
%113 = load double, double* %5
%114 = fadd double %112, %113
%115 = load double, double* %6
%116 = fadd double %114, %115
%117 = load double, double* %7
%118 = fadd double %116, %117
%119 = load double, double* %8
%120 = fadd double %118, %119
%121 = load double, double* %9
%122 = fadd double %120, %121
%123 = load double, double* %10
%124 = fadd double %122, %123
%125 = load double, double* %11
%126 = fadd double %124, %125
%127 = load double, double* %12
%128 = fadd double %126, %127
%129 = load double, double* %13
%130 = fadd double %128, %129
%131 = load double, double* %14
%132 = fadd double %130, %131
%133 = load double, double* %15
%134 = fadd double %132, %133
%135 = load double, double* %16
%136 = fadd double %134, %135
store double %136, double* %17
%137 = load double, double* %14
%138 = load double, double* %15
%139 = fadd double %137, %138
%140 = load double, double* %13
%141 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %140, double %139)
%142 = load double, double* %6
%143 = load double, double* %4
%144 = fmul double %142, %143
%145 = fdiv double %141, %144
%146 = load double, double* %17
%147 = fmul double %145, %146
store double %147, double* %18
%148 = load double, double* %18
%149 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double %148)
%150 = load double, double* %18
ret double %150
}

LLVM IR (-O2):
@.str = [7 x i8] c"%.1f, \00"
@.str.1 = [9 x i8] c"\09\09\09\09%.2g\00"
define double @meltsM(double* nocapture %0) {
br label %76
2: ; preds = %93
%3 = load double, double* %0
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = getelementptr inbounds double, double* %0, i64 2
%7 = load double, double* %6
%8 = insertelement <2 x double> poison, double %3, i64 0
%9 = insertelement <2 x double> %8, double %7, i64 1
%10 = fdiv <2 x double> %9, <double 0x404E0AA64C2F837B, double 0x40497D844D013A92>
%11 = getelementptr inbounds double, double* %0, i64 3
%12 = load double, double* %11
%13 = fdiv double %12, 7.984410e+01
%14 = getelementptr inbounds double, double* %0, i64 5
%15 = load double, double* %14
%16 = insertelement <2 x double> poison, double %5, i64 0
%17 = insertelement <2 x double> %16, double %15, i64 1
%18 = fdiv <2 x double> %17, <double 0x4053F7694467381D, double 7.184440e+01>
%19 = getelementptr inbounds double, double* %0, i64 4
%20 = load double, double* %19
%21 = getelementptr inbounds double, double* %0, i64 6
%22 = load double, double* %21
%23 = insertelement <2 x double> poison, double %22, i64 0
%24 = insertelement <2 x double> %23, double %20, i64 1
%25 = fdiv <2 x double> %24, <double 7.093740e+01, double 0x4052FFB15B573EAB>
%26 = getelementptr inbounds double, double* %0, i64 7
%27 = bitcast double* %26 to <2 x double>*
%28 = load <2 x double>, <2 x double>* %27
%29 = fdiv <2 x double> %28, <double 4.030440e+01, double 0x4052AC56D5CFAACD>
%30 = getelementptr inbounds double, double* %0, i64 9
%31 = bitcast double* %30 to <2 x double>*
%32 = load <2 x double>, <2 x double>* %31
%33 = fdiv <2 x double> %32, <double 0x4052BBAFB7E90FF9, double 0x404C09E83E425AEF>
%34 = getelementptr inbounds double, double* %0, i64 11
%35 = bitcast double* %34 to <2 x double>*
%36 = load <2 x double>, <2 x double>* %35
%37 = fdiv <2 x double> %36, <double 3.098950e+01, double 4.709800e+01>
%38 = getelementptr inbounds double, double* %0, i64 13
%39 = load double, double* %38
%40 = extractelement <2 x double> %10, i64 0
%41 = insertelement <2 x double> %10, double %13, i64 1
%42 = fadd <2 x double> %41, %18
%43 = extractelement <2 x double> %10, i64 1
%44 = extractelement <2 x double> %42, i64 0
%45 = fadd double %44, %43
%46 = extractelement <2 x double> %42, i64 1
%47 = fadd double %45, %46
%48 = extractelement <2 x double> %25, i64 1
%49 = fadd double %48, %47
%50 = extractelement <2 x double> %25, i64 0
%51 = fadd double %50, %49
%52 = extractelement <2 x double> %29, i64 0
%53 = fadd double %52, %51
%54 = extractelement <2 x double> %29, i64 1
%55 = fadd double %54, %53
%56 = extractelement <2 x double> %33, i64 0
%57 = fadd double %56, %55
%58 = extractelement <2 x double> %33, i64 1
%59 = fadd double %58, %57
%60 = extractelement <2 x double> %37, i64 0
%61 = fadd double %60, %59
%62 = extractelement <2 x double> %37, i64 1
%63 = fadd double %62, %61
%64 = fadd double %60, %62
%65 = tail call double @llvm.fmuladd.f64(double %58, double 2.000000e+00, double %64)
%66 = fmul double %40, %43
%67 = insertelement <2 x double> poison, double %65, i64 0
%68 = insertelement <2 x double> %67, double %39, i64 1
%69 = insertelement <2 x double> <double poison, double 7.097230e+01>, double %66, i64 0
%70 = fdiv <2 x double> %68, %69
%71 = extractelement <2 x double> %70, i64 1
%72 = fadd double %71, %63
%73 = extractelement <2 x double> %70, i64 0
%74 = fmul double %73, %72
%75 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double %74)
ret double %74
76: ; preds = %1, %93
%77 = phi i64 [ 0, %1 ], [ %94, %93 ]
%78 = trunc i64 %77 to i32
%79 = and i32 %78, 2147483645
%80 = icmp eq i32 %79, 0
%81 = icmp eq i32 %79, 5
%82 = or i1 %81, %80
%83 = icmp eq i64 %77, 10
%84 = select i1 %82, i1 true, i1 %83
%85 = icmp eq i64 %77, 11
%86 = select i1 %84, i1 true, i1 %85
%87 = icmp eq i64 %77, 12
%88 = select i1 %86, i1 true, i1 %87
br i1 %88, label %89, label %93
89: ; preds = %76
%90 = getelementptr inbounds double, double* %0, i64 %77
%91 = load double, double* %90
%92 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %91)
br label %93
93: ; preds = %89, %76
%94 = add nuw nsw i64 %77, 1
%95 = icmp eq i64 %94, 16
br i1 %95, label %2, label %76
}