#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ sprintf(char *, char *, char const *);
scalar_t__ strcasecmp(char const *, char *);
int /*<<< orphan*/ system(char *);
void runmeltsmajors(const char prefix[], double sc[], const char version[],
                    const char mode[], const char fo2Path[], double fo2Delta,
                    char batchString[], const char saveAll[],
                    const char fractionateSolids[], double Ti, double Pi,
                    double dT, double dP, double massin) {
  char fractionateWater[2] = "!", celciusOutput[2] = "", ptpath[2] = "!";
  if (strcasecmp(mode, "ptpath") == 0)
    ptpath[0] = '\0';
  double Pmax = 90000, Pmin = 1, Tmax = 3000, Tmin = 600;
  FILE *fp;
  char path_string[100];
  double normconst = 0;
  int i;
  for (i = 0; i < 16; i++) {
    normconst = normconst + sc[i];
  }
  for (i = 0; i < 16; i++) {
    sc[i] = sc[i] * 100 / normconst;
  }
  sprintf(path_string, "%ssc.melts", prefix);
  fp = fopen(path_string, "w");
  fprintf(fp,
          "Title: dummy			\nInitial Composition: SiO2 "
          "%.4f			\nInitial Composition: TiO2 %.4f	"
          "		\nInitial Composition: Al2O3 %.4f		"
          "	\nInitial Composition: Fe2O3 %.4f			"
          "\nInitial Composition: FeO %.4f			\nInitial "
          "Composition: MgO %.4f			\nInitial Composition: "
          "CaO %.4f			\nInitial Composition: Na2O "
          "%.4f			\nInitial Composition: K2O %.4f		"
          "	\nInitial Composition: H2O %.4f\n",
          sc[0], sc[1], sc[2], sc[3], sc[5], sc[7], sc[10], sc[11], sc[12],
          sc[15]);
  fprintf(fp,
          "Initial Temperature: %.2f			\nInitial Pressure: "
          "%.2f			\nlog fo2 Path: %s\n",
          Ti, Pi, fo2Path);
  if (fo2Delta != 0) {
    fprintf(fp, "log fo2 Delta: %.2f\n", fo2Delta);
  }
  fclose(fp);
  sprintf(path_string, "%smelts_env", prefix);
  fp = fopen(path_string, "w");
  fprintf(fp,
          "\nALPHAMELTS_VERSION\t\t%s			"
          "\nALPHAMELTS_MODE\t\t\t%s			"
          "\n%sALPHAMELTS_PTPATH_FILE\t\tptpath			"
          "\nALPHAMELTS_DELTAP\t\t%.0f			"
          "\nALPHAMELTS_DELTAT\t\t%.0f			"
          "\nALPHAMELTS_MAXP\t\t\t%.0f			"
          "\nALPHAMELTS_MINP\t\t\t%.0f			"
          "\nALPHAMELTS_MAXT\t\t\t%.0f			"
          "\nALPHAMELTS_MINT\t\t\t%.0f			"
          "\n%sALPHAMELTS_FRACTIONATE_SOLIDS\ttrue			"
          "\n%sALPHAMELTS_MASSIN\t\t%g			"
          "\n%sALPHAMELTS_FRACTIONATE_WATER\ttrue			"
          "\n%sALPHAMELTS_MINW\t\t\t0.005			"
          "\n%sALPHAMELTS_SAVE_ALL\t\ttrue			"
          "\n%sALPHAMELTS_CELSIUS_OUTPUT\ttrue\n",
          version, mode, ptpath, dP, dT, Pmax, Pmin, Tmax, Tmin,
          fractionateSolids, fractionateSolids, massin, fractionateWater,
          fractionateWater, saveAll, celciusOutput);
  fclose(fp);
  sprintf(path_string, "%sbatch", prefix);
  fp = fopen(path_string, "w");
  fputs(batchString, fp);
  fclose(fp);
  char cmd_string[200];
  sprintf(cmd_string,
          "cd %s; run_alphamelts_v1.41.pl -f melts_env -b batch > /dev/null",
          prefix);
  system(cmd_string);
}


x86 assembly (clang, -O0):
<runmeltsmajors>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x210,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    %r8,-0x38(%rbp)
movsd  %xmm0,-0x40(%rbp)
mov    %r9,-0x48(%rbp)
movsd  %xmm1,-0x50(%rbp)
movsd  %xmm2,-0x58(%rbp)
movsd  %xmm3,-0x60(%rbp)
movsd  %xmm4,-0x68(%rbp)
movsd  %xmm5,-0x70(%rbp)
mov    0xe55(%rip),%ax
mov    %ax,-0x72(%rbp)
lea    -0x74(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1070 <memset@plt>
mov    0xe3a(%rip),%ax
mov    %ax,-0x76(%rbp)
mov    -0x30(%rbp),%rdi
lea    0xe2d(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1210 <runmeltsmajors+0x90>
movb   $0x0,-0x76(%rbp)
movsd  0xe00(%rip),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xdeb(%rip),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xdd3(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  0xdbb(%rip),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
movl   $0x0,-0x11c(%rbp)
cmpl   $0x10,-0x11c(%rbp)
jge    12a3 <runmeltsmajors+0x123>
movsd  -0x118(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
movslq -0x11c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
mov    -0x11c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x11c(%rbp)
jmp    1262 <runmeltsmajors+0xe2>
movl   $0x0,-0x11c(%rbp)
cmpl   $0x10,-0x11c(%rbp)
jge    12fe <runmeltsmajors+0x17e>
mov    -0x20(%rbp),%rax
movslq -0x11c(%rbp),%rcx
movsd  0xd53(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
divsd  -0x118(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
movslq -0x11c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x11c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x11c(%rbp)
jmp    12ad <runmeltsmajors+0x12d>
lea    -0x110(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xd21(%rip),%rsi
call   10a0 <sprintf@plt>
lea    -0x110(%rbp),%rdi
lea    0xd19(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0xa0(%rbp)
mov    -0xa0(%rbp),%rdi
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    -0x20(%rbp),%rax
movsd  0x18(%rax),%xmm3
mov    -0x20(%rbp),%rax
movsd  0x28(%rax),%xmm4
mov    -0x20(%rbp),%rax
movsd  0x38(%rax),%xmm5
mov    -0x20(%rbp),%rax
movsd  0x50(%rax),%xmm6
mov    -0x20(%rbp),%rax
movsd  0x58(%rax),%xmm7
mov    -0x20(%rbp),%rax
movsd  0x60(%rax),%xmm9
mov    -0x20(%rbp),%rax
movsd  0x78(%rax),%xmm8
lea    0xca6(%rip),%rsi
movsd  %xmm9,(%rsp)
movsd  %xmm8,0x8(%rsp)
mov    $0x8,%al
call   1080 <fprintf@plt>
mov    -0xa0(%rbp),%rdi
movsd  -0x50(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
mov    -0x38(%rbp),%rdx
lea    0xdd5(%rip),%rsi
mov    $0x2,%al
call   1080 <fprintf@plt>
movsd  -0x40(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    13ec <runmeltsmajors+0x26c>
jp     13ec <runmeltsmajors+0x26c>
jmp    1406 <runmeltsmajors+0x286>
mov    -0xa0(%rbp),%rdi
movsd  -0x40(%rbp),%xmm0
lea    0xde7(%rip),%rsi
mov    $0x1,%al
call   1080 <fprintf@plt>
mov    -0xa0(%rbp),%rdi
call   1040 <fclose@plt>
lea    -0x110(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xdd7(%rip),%rsi
call   10a0 <sprintf@plt>
lea    -0x110(%rbp),%rdi
lea    0xc05(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0xa0(%rbp)
mov    -0xa0(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
lea    -0x76(%rbp),%r8
movsd  -0x68(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm2
movsd  -0x88(%rbp),%xmm3
ff
movsd  -0x90(%rbp),%xmm4
ff
movsd  -0x98(%rbp),%xmm5
ff
mov    0x18(%rbp),%r9
mov    0x18(%rbp),%r14
movsd  -0x70(%rbp),%xmm6
lea    -0x72(%rbp),%rbx
lea    -0x72(%rbp),%r11
mov    0x10(%rbp),%r10
lea    -0x74(%rbp),%rax
lea    0xd66(%rip),%rsi
mov    %r14,(%rsp)
mov    %rbx,0x8(%rsp)
mov    %r11,0x10(%rsp)
mov    %r10,0x18(%rsp)
mov    %rax,0x20(%rsp)
mov    $0x7,%al
call   1080 <fprintf@plt>
mov    -0xa0(%rbp),%rdi
call   1040 <fclose@plt>
lea    -0x110(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xee6(%rip),%rsi
call   10a0 <sprintf@plt>
lea    -0x110(%rbp),%rdi
lea    0xb4b(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0xa0(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0xa0(%rbp),%rsi
call   1060 <fputs@plt>
mov    -0xa0(%rbp),%rdi
call   1040 <fclose@plt>
lea    -0x1f0(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xea1(%rip),%rsi
call   10a0 <sprintf@plt>
lea    -0x1f0(%rbp),%rdi
call   1050 <system@plt>
add    $0x210,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<runmeltsmajors>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x188,%rsp
movsd  %xmm5,0x40(%rsp)
movsd  %xmm4,0x30(%rsp)
movsd  %xmm3,0x38(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
mov    %r9,0x48(%rsp)
movsd  %xmm0,0x20(%rsp)
mov    %r8,%rbp
mov    %rcx,%r15
mov    %rdx,0x28(%rsp)
mov    %rsi,%r12
mov    %rdi,%r13
movw   $0x21,0xe(%rsp)
movw   $0x0,0xc(%rsp)
movw   $0x21,0xa(%rsp)
lea    0xe61(%rip),%rsi
mov    %rcx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
jne    11e9 <runmeltsmajors+0x79>
movb   $0x0,0xa(%rsp)
movupd (%r12),%xmm3
movupd 0x10(%r12),%xmm2
movupd 0x20(%r12),%xmm10
movupd 0x30(%r12),%xmm8
xorpd  %xmm1,%xmm1
movapd %xmm3,%xmm0
addsd  %xmm1,%xmm0
movapd %xmm3,%xmm4
unpckhpd %xmm3,%xmm4
addsd  %xmm0,%xmm4
addsd  %xmm2,%xmm4
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
addsd  %xmm4,%xmm0
addsd  %xmm10,%xmm0
movapd %xmm10,%xmm4
unpckhpd %xmm10,%xmm4
addsd  %xmm0,%xmm4
addsd  %xmm8,%xmm4
movapd %xmm8,%xmm0
unpckhpd %xmm8,%xmm0
addsd  %xmm4,%xmm0
movupd 0x40(%r12),%xmm4
addsd  %xmm4,%xmm0
movapd %xmm4,%xmm6
unpckhpd %xmm4,%xmm6
addsd  %xmm0,%xmm6
movupd 0x50(%r12),%xmm5
addsd  %xmm5,%xmm6
movapd %xmm5,%xmm0
unpckhpd %xmm5,%xmm0
addsd  %xmm6,%xmm0
movupd 0x60(%r12),%xmm1
addsd  %xmm1,%xmm0
movapd %xmm1,%xmm6
unpckhpd %xmm1,%xmm6
addsd  %xmm0,%xmm6
movupd 0x70(%r12),%xmm0
addsd  %xmm0,%xmm6
movapd %xmm0,%xmm7
unpckhpd %xmm0,%xmm7
addsd  %xmm6,%xmm7
movapd 0xd49(%rip),%xmm9
mulpd  %xmm9,%xmm3
unpcklpd %xmm7,%xmm7
divpd  %xmm7,%xmm3
movupd %xmm3,(%r12)
mulpd  %xmm9,%xmm2
divpd  %xmm7,%xmm2
movupd %xmm2,0x10(%r12)
mulpd  %xmm9,%xmm10
divpd  %xmm7,%xmm10
movupd %xmm10,0x20(%r12)
mulpd  %xmm9,%xmm8
divpd  %xmm7,%xmm8
movupd %xmm8,0x30(%r12)
mulpd  %xmm9,%xmm4
divpd  %xmm7,%xmm4
movupd %xmm4,0x40(%r12)
mulpd  %xmm9,%xmm5
divpd  %xmm7,%xmm5
movupd %xmm5,0x50(%r12)
mulpd  %xmm9,%xmm1
divpd  %xmm7,%xmm1
movupd %xmm1,0x60(%r12)
mulpd  %xmm9,%xmm0
divpd  %xmm7,%xmm0
movupd %xmm0,0x70(%r12)
lea    0xcfc(%rip),%rsi
lea    0x50(%rsp),%rbx
mov    %rbx,%rdi
mov    %r13,%rdx
call   1090 <sprintf@plt>
lea    0xcf0(%rip),%rsi
mov    %rbx,%rdi
call   1080 <fopen@plt>
mov    %rax,%r14
movsd  (%r12),%xmm0
movsd  0x8(%r12),%xmm1
movsd  0x10(%r12),%xmm2
movsd  0x18(%r12),%xmm3
movsd  0x28(%r12),%xmm4
movsd  0x38(%r12),%xmm5
movsd  0x50(%r12),%xmm6
movsd  0x58(%r12),%xmm7
movsd  0x60(%r12),%xmm8
movsd  0x78(%r12),%xmm9
sub    $0x10,%rsp
movsd  %xmm9,0x8(%rsp)
movsd  %xmm8,(%rsp)
lea    0xc8a(%rip),%rsi
mov    %rax,%rdi
mov    $0x8,%al
call   1070 <fprintf@plt>
add    $0x10,%rsp
lea    0xdd4(%rip),%rsi
mov    %r14,%rdi
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
mov    %rbp,%rdx
mov    $0x2,%al
call   1070 <fprintf@plt>
movsd  0x20(%rsp),%xmm0
ucomisd 0xc32(%rip),%xmm0
jne    1402 <runmeltsmajors+0x292>
jnp    1413 <runmeltsmajors+0x2a3>
lea    0xdeb(%rip),%rsi
mov    %r14,%rdi
mov    $0x1,%al
call   1070 <fprintf@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
lea    0xde7(%rip),%rsi
lea    0x50(%rsp),%rbp
mov    %rbp,%rdi
mov    %r13,%rdx
call   1090 <sprintf@plt>
lea    0xc11(%rip),%r14
mov    %rbp,%rdi
mov    %r14,%rsi
call   1080 <fopen@plt>
mov    %rax,%rbx
sub    $0x8,%rsp
lea    0x14(%rsp),%r10
lea    0x16(%rsp),%r11
lea    0xdb9(%rip),%rsi
lea    0x12(%rsp),%r8
movsd  0xba7(%rip),%xmm2
movsd  0xba7(%rip),%xmm3
movsd  0xba7(%rip),%xmm4
movsd  0xba7(%rip),%xmm5
mov    %rax,%rdi
mov    0x30(%rsp),%rdx
mov    %r15,%rcx
movsd  0x38(%rsp),%xmm0
movsd  0x40(%rsp),%xmm1
mov    0x1d0(%rsp),%r9
movsd  0x48(%rsp),%xmm6
mov    $0x7,%al
push   %r10
push   0x1d0(%rsp)
push   %r11
push   %r11
push   %r9
call   1070 <fprintf@plt>
add    $0x30,%rsp
mov    %rbx,%rdi
call   1040 <fclose@plt>
lea    0xf03(%rip),%rsi
mov    %rbp,%rdi
mov    %r13,%rdx
call   1090 <sprintf@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
call   1080 <fopen@plt>
mov    %rax,%rbx
mov    0x48(%rsp),%rdi
mov    %rax,%rsi
call   1060 <fputs@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
lea    0xed6(%rip),%rsi
lea    0xc0(%rsp),%rbx
mov    %rbx,%rdi
mov    %r13,%rdx
call   1090 <sprintf@plt>
mov    %rbx,%rdi
call   1050 <system@plt>
add    $0x188,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.runmeltsmajors.fractionateWater = [2 x i8] c"!\00"
@__const.runmeltsmajors.ptpath = [2 x i8] c"!\00"
@.str = [7 x i8] c"ptpath\00"
@.str.1 = [11 x i8] c"%ssc.melts\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [351 x i8] c"Title: dummy\09\09\09\0AInitial Composition: SiO2 %.4f\09\09\09\0AInitial Composition: TiO2 %.4f\09\09\09\0AInitial Composition: Al2O3 %.4f\09\09\09\0AInitial Composition: Fe2O3 %.4f\09\09\09\0AInitial Composition: FeO %.4f\09\09\09\0AInitial Composition: MgO %.4f\09\09\09\0AInitial Composition: CaO %.4f\09\09\09\0AInitial Composition: Na2O %.4f\09\09\09\0AInitial Composition: K2O %.4f\09\09\09\0AInitial Composition: H2O %.4f\0A\00"
@.str.4 = [73 x i8] c"Initial Temperature: %.2f\09\09\09\0AInitial Pressure: %.2f\09\09\09\0Alog fo2 Path: %s\0A\00"
@.str.5 = [21 x i8] c"log fo2 Delta: %.2f\0A\00"
@.str.6 = [12 x i8] c"%smelts_env\00"
@.str.7 = [445 x i8] c"\0AALPHAMELTS_VERSION\09\09%s\09\09\09\0AALPHAMELTS_MODE\09\09\09%s\09\09\09\0A%sALPHAMELTS_PTPATH_FILE\09\09ptpath\09\09\09\0AALPHAMELTS_DELTAP\09\09%.0f\09\09\09\0AALPHAMELTS_DELTAT\09\09%.0f\09\09\09\0AALPHAMELTS_MAXP\09\09\09%.0f\09\09\09\0AALPHAMELTS_MINP\09\09\09%.0f\09\09\09\0AALPHAMELTS_MAXT\09\09\09%.0f\09\09\09\0AALPHAMELTS_MINT\09\09\09%.0f\09\09\09\0A%sALPHAMELTS_FRACTIONATE_SOLIDS\09true\09\09\09\0A%sALPHAMELTS_MASSIN\09\09%g\09\09\09\0A%sALPHAMELTS_FRACTIONATE_WATER\09true\09\09\09\0A%sALPHAMELTS_MINW\09\09\090.005\09\09\09\0A%sALPHAMELTS_SAVE_ALL\09\09true\09\09\09\0A%sALPHAMELTS_CELSIUS_OUTPUT\09true\0A\00"
@.str.8 = [8 x i8] c"%sbatch\00"
@.str.9 = [65 x i8] c"cd %s; run_alphamelts_v1.41.pl -f melts_env -b batch > /dev/null\00"
define void @runmeltsmajors(i8* %0, double* %1, i8* %2, i8* %3, i8* %4, double %5, i8* %6, i8* %7, i8* %8, double %9, double %10, double %11, double %12, double %13) {
%15 = alloca i8*
%16 = alloca double*
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i8*
%20 = alloca double
%21 = alloca i8*
%22 = alloca i8*
%23 = alloca i8*
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca [2 x i8]
%30 = alloca [2 x i8]
%31 = alloca [2 x i8]
%32 = alloca double
%33 = alloca double
%34 = alloca double
%35 = alloca double
%36 = alloca i32*
%37 = alloca [100 x i8]
%38 = alloca double
%39 = alloca i32
%40 = alloca [200 x i8]
store i8* %0, i8** %15
store double* %1, double** %16
store i8* %2, i8** %17
store i8* %3, i8** %18
store i8* %4, i8** %19
store double %5, double* %20
store i8* %6, i8** %21
store i8* %7, i8** %22
store i8* %8, i8** %23
store double %9, double* %24
store double %10, double* %25
store double %11, double* %26
store double %12, double* %27
store double %13, double* %28
%41 = bitcast [2 x i8]* %29 to i8*
%42 = bitcast [2 x i8]* %30 to i8*
%43 = bitcast [2 x i8]* %31 to i8*
%44 = load i8*, i8** %18
%45 = call i64 @strcasecmp(i8* %44, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %49
47: ; preds = %14
%48 = getelementptr inbounds [2 x i8], [2 x i8]* %31, i64 0, i64 0
store i8 0, i8* %48
br label %49
49: ; preds = %47, %14
store double 9.000000e+04, double* %32
store double 1.000000e+00, double* %33
store double 3.000000e+03, double* %34
store double 6.000000e+02, double* %35
store double 0.000000e+00, double* %38
store i32 0, i32* %39
br label %50
50: ; preds = %61, %49
%51 = load i32, i32* %39
%52 = icmp slt i32 %51, 16
br i1 %52, label %53, label %64
53: ; preds = %50
%54 = load double, double* %38
%55 = load double*, double** %16
%56 = load i32, i32* %39
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds double, double* %55, i64 %57
%59 = load double, double* %58
%60 = fadd double %54, %59
store double %60, double* %38
br label %61
61: ; preds = %53
%62 = load i32, i32* %39
%63 = add nsw i32 %62, 1
store i32 %63, i32* %39
br label %50
64: ; preds = %50
store i32 0, i32* %39
br label %65
65: ; preds = %81, %64
%66 = load i32, i32* %39
%67 = icmp slt i32 %66, 16
br i1 %67, label %68, label %84
68: ; preds = %65
%69 = load double*, double** %16
%70 = load i32, i32* %39
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds double, double* %69, i64 %71
%73 = load double, double* %72
%74 = fmul double %73, 1.000000e+02
%75 = load double, double* %38
%76 = fdiv double %74, %75
%77 = load double*, double** %16
%78 = load i32, i32* %39
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds double, double* %77, i64 %79
store double %76, double* %80
br label %81
81: ; preds = %68
%82 = load i32, i32* %39
%83 = add nsw i32 %82, 1
store i32 %83, i32* %39
br label %65
84: ; preds = %65
%85 = getelementptr inbounds [100 x i8], [100 x i8]* %37, i64 0, i64 0
%86 = load i8*, i8** %15
%87 = call i32 @sprintf(i8* %85, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %86)
%88 = getelementptr inbounds [100 x i8], [100 x i8]* %37, i64 0, i64 0
%89 = call i32* @fopen(i8* %88, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %89, i32** %36
%90 = load i32*, i32** %36
%91 = load double*, double** %16
%92 = getelementptr inbounds double, double* %91, i64 0
%93 = load double, double* %92
%94 = load double*, double** %16
%95 = getelementptr inbounds double, double* %94, i64 1
%96 = load double, double* %95
%97 = load double*, double** %16
%98 = getelementptr inbounds double, double* %97, i64 2
%99 = load double, double* %98
%100 = load double*, double** %16
%101 = getelementptr inbounds double, double* %100, i64 3
%102 = load double, double* %101
%103 = load double*, double** %16
%104 = getelementptr inbounds double, double* %103, i64 5
%105 = load double, double* %104
%106 = load double*, double** %16
%107 = getelementptr inbounds double, double* %106, i64 7
%108 = load double, double* %107
%109 = load double*, double** %16
%110 = getelementptr inbounds double, double* %109, i64 10
%111 = load double, double* %110
%112 = load double*, double** %16
%113 = getelementptr inbounds double, double* %112, i64 11
%114 = load double, double* %113
%115 = load double*, double** %16
%116 = getelementptr inbounds double, double* %115, i64 12
%117 = load double, double* %116
%118 = load double*, double** %16
%119 = getelementptr inbounds double, double* %118, i64 15
%120 = load double, double* %119
%121 = call i32 (i32*, i8*, ...) @fprintf(i32* %90, i8* getelementptr inbounds ([351 x i8], [351 x i8]* @.str.3, i64 0, i64 0), double %93, double %96, double %99, double %102, double %105, double %108, double %111, double %114, double %117, double %120)
%122 = load i32*, i32** %36
%123 = load double, double* %24
%124 = load double, double* %25
%125 = load i8*, i8** %19
%126 = call i32 (i32*, i8*, ...) @fprintf(i32* %122, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.4, i64 0, i64 0), double %123, double %124, i8* %125)
%127 = load double, double* %20
%128 = fcmp une double %127, 0.000000e+00
br i1 %128, label %129, label %133
129: ; preds = %84
%130 = load i32*, i32** %36
%131 = load double, double* %20
%132 = call i32 (i32*, i8*, ...) @fprintf(i32* %130, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), double %131)
br label %133
133: ; preds = %129, %84
%134 = load i32*, i32** %36
%135 = call i32 @fclose(i32* %134)
%136 = getelementptr inbounds [100 x i8], [100 x i8]* %37, i64 0, i64 0
%137 = load i8*, i8** %15
%138 = call i32 @sprintf(i8* %136, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* %137)
%139 = getelementptr inbounds [100 x i8], [100 x i8]* %37, i64 0, i64 0
%140 = call i32* @fopen(i8* %139, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %140, i32** %36
%141 = load i32*, i32** %36
%142 = load i8*, i8** %17
%143 = load i8*, i8** %18
%144 = getelementptr inbounds [2 x i8], [2 x i8]* %31, i64 0, i64 0
%145 = load double, double* %27
%146 = load double, double* %26
%147 = load double, double* %32
%148 = load double, double* %33
%149 = load double, double* %34
%150 = load double, double* %35
%151 = load i8*, i8** %23
%152 = load i8*, i8** %23
%153 = load double, double* %28
%154 = getelementptr inbounds [2 x i8], [2 x i8]* %29, i64 0, i64 0
%155 = getelementptr inbounds [2 x i8], [2 x i8]* %29, i64 0, i64 0
%156 = load i8*, i8** %22
%157 = getelementptr inbounds [2 x i8], [2 x i8]* %30, i64 0, i64 0
%158 = call i32 (i32*, i8*, ...) @fprintf(i32* %141, i8* getelementptr inbounds ([445 x i8], [445 x i8]* @.str.7, i64 0, i64 0), i8* %142, i8* %143, i8* %144, double %145, double %146, double %147, double %148, double %149, double %150, i8* %151, i8* %152, double %153, i8* %154, i8* %155, i8* %156, i8* %157)
%159 = load i32*, i32** %36
%160 = call i32 @fclose(i32* %159)
%161 = getelementptr inbounds [100 x i8], [100 x i8]* %37, i64 0, i64 0
%162 = load i8*, i8** %15
%163 = call i32 @sprintf(i8* %161, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i8* %162)
%164 = getelementptr inbounds [100 x i8], [100 x i8]* %37, i64 0, i64 0
%165 = call i32* @fopen(i8* %164, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %165, i32** %36
%166 = load i8*, i8** %21
%167 = load i32*, i32** %36
%168 = call i32 @fputs(i8* %166, i32* %167)
%169 = load i32*, i32** %36
%170 = call i32 @fclose(i32* %169)
%171 = getelementptr inbounds [200 x i8], [200 x i8]* %40, i64 0, i64 0
%172 = load i8*, i8** %15
%173 = call i32 @sprintf(i8* %171, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.9, i64 0, i64 0), i8* %172)
%174 = getelementptr inbounds [200 x i8], [200 x i8]* %40, i64 0, i64 0
%175 = call i32 @system(i8* %174)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"ptpath\00"
@.str.1 = [11 x i8] c"%ssc.melts\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [351 x i8] c"Title: dummy\09\09\09\0AInitial Composition: SiO2 %.4f\09\09\09\0AInitial Composition: TiO2 %.4f\09\09\09\0AInitial Composition: Al2O3 %.4f\09\09\09\0AInitial Composition: Fe2O3 %.4f\09\09\09\0AInitial Composition: FeO %.4f\09\09\09\0AInitial Composition: MgO %.4f\09\09\09\0AInitial Composition: CaO %.4f\09\09\09\0AInitial Composition: Na2O %.4f\09\09\09\0AInitial Composition: K2O %.4f\09\09\09\0AInitial Composition: H2O %.4f\0A\00"
@.str.4 = [73 x i8] c"Initial Temperature: %.2f\09\09\09\0AInitial Pressure: %.2f\09\09\09\0Alog fo2 Path: %s\0A\00"
@.str.5 = [21 x i8] c"log fo2 Delta: %.2f\0A\00"
@.str.6 = [12 x i8] c"%smelts_env\00"
@.str.7 = [445 x i8] c"\0AALPHAMELTS_VERSION\09\09%s\09\09\09\0AALPHAMELTS_MODE\09\09\09%s\09\09\09\0A%sALPHAMELTS_PTPATH_FILE\09\09ptpath\09\09\09\0AALPHAMELTS_DELTAP\09\09%.0f\09\09\09\0AALPHAMELTS_DELTAT\09\09%.0f\09\09\09\0AALPHAMELTS_MAXP\09\09\09%.0f\09\09\09\0AALPHAMELTS_MINP\09\09\09%.0f\09\09\09\0AALPHAMELTS_MAXT\09\09\09%.0f\09\09\09\0AALPHAMELTS_MINT\09\09\09%.0f\09\09\09\0A%sALPHAMELTS_FRACTIONATE_SOLIDS\09true\09\09\09\0A%sALPHAMELTS_MASSIN\09\09%g\09\09\09\0A%sALPHAMELTS_FRACTIONATE_WATER\09true\09\09\09\0A%sALPHAMELTS_MINW\09\09\090.005\09\09\09\0A%sALPHAMELTS_SAVE_ALL\09\09true\09\09\09\0A%sALPHAMELTS_CELSIUS_OUTPUT\09true\0A\00"
@.str.8 = [8 x i8] c"%sbatch\00"
@.str.9 = [65 x i8] c"cd %s; run_alphamelts_v1.41.pl -f melts_env -b batch > /dev/null\00"
define void @runmeltsmajors(i8* %0, double* nocapture %1, i8* %2, i8* %3, i8* %4, double %5, i8* nocapture %6, i8* %7, i8* %8, double %9, double %10, double %11, double %12, double %13) {
%15 = alloca i16
%16 = alloca i16
%17 = alloca i16
%18 = alloca [100 x i8]
%19 = alloca [200 x i8]
%20 = bitcast i16* %15 to i8*
store i16 33, i16* %15
%21 = bitcast i16* %16 to i8*
store i16 0, i16* %16
%22 = bitcast i16* %17 to i8*
store i16 33, i16* %17
%23 = tail call i64 @strcasecmp(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %14
store i8 0, i8* %22
br label %26
26: ; preds = %25, %14
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %18, i64 0, i64 0
%28 = getelementptr inbounds double, double* %1, i64 1
%29 = bitcast double* %1 to <2 x double>*
%30 = load <2 x double>, <2 x double>* %29
%31 = extractelement <2 x double> %30, i64 0
%32 = fadd double %31, 0.000000e+00
%33 = extractelement <2 x double> %30, i64 1
%34 = fadd double %32, %33
%35 = getelementptr inbounds double, double* %1, i64 2
%36 = getelementptr inbounds double, double* %1, i64 3
%37 = bitcast double* %35 to <2 x double>*
%38 = load <2 x double>, <2 x double>* %37
%39 = extractelement <2 x double> %38, i64 0
%40 = fadd double %34, %39
%41 = extractelement <2 x double> %38, i64 1
%42 = fadd double %40, %41
%43 = getelementptr inbounds double, double* %1, i64 4
%44 = getelementptr inbounds double, double* %1, i64 5
%45 = bitcast double* %43 to <2 x double>*
%46 = load <2 x double>, <2 x double>* %45
%47 = extractelement <2 x double> %46, i64 0
%48 = fadd double %42, %47
%49 = extractelement <2 x double> %46, i64 1
%50 = fadd double %48, %49
%51 = getelementptr inbounds double, double* %1, i64 6
%52 = getelementptr inbounds double, double* %1, i64 7
%53 = bitcast double* %51 to <2 x double>*
%54 = load <2 x double>, <2 x double>* %53
%55 = extractelement <2 x double> %54, i64 0
%56 = fadd double %50, %55
%57 = extractelement <2 x double> %54, i64 1
%58 = fadd double %56, %57
%59 = getelementptr inbounds double, double* %1, i64 8
%60 = bitcast double* %59 to <2 x double>*
%61 = load <2 x double>, <2 x double>* %60
%62 = extractelement <2 x double> %61, i64 0
%63 = fadd double %58, %62
%64 = extractelement <2 x double> %61, i64 1
%65 = fadd double %63, %64
%66 = getelementptr inbounds double, double* %1, i64 10
%67 = getelementptr inbounds double, double* %1, i64 11
%68 = bitcast double* %66 to <2 x double>*
%69 = load <2 x double>, <2 x double>* %68
%70 = extractelement <2 x double> %69, i64 0
%71 = fadd double %65, %70
%72 = extractelement <2 x double> %69, i64 1
%73 = fadd double %71, %72
%74 = getelementptr inbounds double, double* %1, i64 12
%75 = bitcast double* %74 to <2 x double>*
%76 = load <2 x double>, <2 x double>* %75
%77 = extractelement <2 x double> %76, i64 0
%78 = fadd double %73, %77
%79 = extractelement <2 x double> %76, i64 1
%80 = fadd double %78, %79
%81 = getelementptr inbounds double, double* %1, i64 14
%82 = getelementptr inbounds double, double* %1, i64 15
%83 = bitcast double* %81 to <2 x double>*
%84 = load <2 x double>, <2 x double>* %83
%85 = extractelement <2 x double> %84, i64 0
%86 = fadd double %80, %85
%87 = extractelement <2 x double> %84, i64 1
%88 = fadd double %86, %87
%89 = fmul <2 x double> %30, <double 1.000000e+02, double 1.000000e+02>
%90 = insertelement <2 x double> poison, double %88, i64 0
%91 = shufflevector <2 x double> %90, <2 x double> poison, <2 x i32> zeroinitializer
%92 = fdiv <2 x double> %89, %91
%93 = bitcast double* %1 to <2 x double>*
store <2 x double> %92, <2 x double>* %93
%94 = fmul <2 x double> %38, <double 1.000000e+02, double 1.000000e+02>
%95 = fdiv <2 x double> %94, %91
%96 = bitcast double* %35 to <2 x double>*
store <2 x double> %95, <2 x double>* %96
%97 = fmul <2 x double> %46, <double 1.000000e+02, double 1.000000e+02>
%98 = fdiv <2 x double> %97, %91
%99 = bitcast double* %43 to <2 x double>*
store <2 x double> %98, <2 x double>* %99
%100 = fmul <2 x double> %54, <double 1.000000e+02, double 1.000000e+02>
%101 = fdiv <2 x double> %100, %91
%102 = bitcast double* %51 to <2 x double>*
store <2 x double> %101, <2 x double>* %102
%103 = fmul <2 x double> %61, <double 1.000000e+02, double 1.000000e+02>
%104 = fdiv <2 x double> %103, %91
%105 = bitcast double* %59 to <2 x double>*
store <2 x double> %104, <2 x double>* %105
%106 = fmul <2 x double> %69, <double 1.000000e+02, double 1.000000e+02>
%107 = fdiv <2 x double> %106, %91
%108 = bitcast double* %66 to <2 x double>*
store <2 x double> %107, <2 x double>* %108
%109 = fmul <2 x double> %76, <double 1.000000e+02, double 1.000000e+02>
%110 = fdiv <2 x double> %109, %91
%111 = bitcast double* %74 to <2 x double>*
store <2 x double> %110, <2 x double>* %111
%112 = fmul <2 x double> %84, <double 1.000000e+02, double 1.000000e+02>
%113 = fdiv <2 x double> %112, %91
%114 = bitcast double* %81 to <2 x double>*
store <2 x double> %113, <2 x double>* %114
%115 = call i32 @sprintf(i8* %27, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%116 = call i32* @fopen(i8* %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%117 = load double, double* %1
%118 = load double, double* %28
%119 = load double, double* %35
%120 = load double, double* %36
%121 = load double, double* %44
%122 = load double, double* %52
%123 = load double, double* %66
%124 = load double, double* %67
%125 = load double, double* %74
%126 = load double, double* %82
%127 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %116, i8* getelementptr inbounds ([351 x i8], [351 x i8]* @.str.3, i64 0, i64 0), double %117, double %118, double %119, double %120, double %121, double %122, double %123, double %124, double %125, double %126)
%128 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %116, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.4, i64 0, i64 0), double %9, double %10, i8* %4)
%129 = fcmp une double %5, 0.000000e+00
br i1 %129, label %130, label %132
130: ; preds = %26
%131 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %116, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), double %5)
br label %132
132: ; preds = %130, %26
%133 = tail call i32 @fclose(i32* %116)
%134 = call i32 @sprintf(i8* %27, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* %0)
%135 = call i32* @fopen(i8* %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%136 = call i32 (i32*, i8*, ...) @fprintf(i32* %135, i8* getelementptr inbounds ([445 x i8], [445 x i8]* @.str.7, i64 0, i64 0), i8* %2, i8* %3, i16* %17, double %12, double %11, double 9.000000e+04, double 1.000000e+00, double 3.000000e+03, double 6.000000e+02, i8* %8, i8* %8, double %13, i16* %15, i16* %15, i8* %7, i16* %16)
%137 = call i32 @fclose(i32* %135)
%138 = call i32 @sprintf(i8* %27, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i8* %0)
%139 = call i32* @fopen(i8* %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%140 = call i32 @fputs(i8* %6, i32* %139)
%141 = call i32 @fclose(i32* %139)
%142 = getelementptr inbounds [200 x i8], [200 x i8]* %19, i64 0, i64 0
%143 = call i32 @sprintf(i8* %142, i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str.9, i64 0, i64 0), i8* %0)
%144 = call i32 @system(i8* %142)
ret void
}