#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 */
double atof(char *);
double atoi(char *);
int /*<<< orphan*/ init(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ run(double, double);
int main(int argc, char **argv) {
  if (argc < 4) {
    printf("./sphc <init file> <steps> <dt>\n");
    return 1;
  }
  init(argv[1]);
  double steps = atoi(argv[2]);
  double dt = atof(argv[3]);
  run(steps, dt);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    1188 <main+0x38>
lea    0xe89(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11cf <main+0x7f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <init@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1070 <atoi@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1040 <run@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
cmp    $0x3,%edi
jg     116d <main+0x1d>
lea    0xe9f(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
jmp    11a1 <main+0x51>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1060 <init@plt>
mov    0x10(%rbx),%rdi
call   1070 <atoi@plt>
movsd  %xmm0,0x8(%rsp)
mov    0x18(%rbx),%rdi
call   1040 <atof@plt>
movaps %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
call   1050 <run@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"./sphc <init file> <steps> <dt>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 4
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %28
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @init(i8* %15)
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 2
%19 = load i8*, i8** %18
%20 = call double @atoi(i8* %19)
store double %20, double* %6
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 3
%23 = load i8*, i8** %22
%24 = call double @atof(i8* %23)
store double %24, double* %7
%25 = load double, double* %6
%26 = load double, double* %7
%27 = call i32 @run(double %25, double %26)
store i32 0, i32* %3
br label %28
28: ; preds = %12, %10
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
@str = [32 x i8] c"./sphc <init file> <steps> <dt>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 4
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
br label %17
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @init(i8* %8)
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call double @atoi(i8* %11)
%13 = getelementptr inbounds i8*, i8** %1, i64 3
%14 = load i8*, i8** %13
%15 = tail call double @atof(i8* %14)
%16 = tail call i32 @run(double %12, double %15)
br label %17
17: ; preds = %6, %4
%18 = phi i32 [ 1, %4 ], [ 0, %6 ]
ret i32 %18
}