#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*/ vec1;

/* Variables and functions */
int /*<<< orphan*/ memset(double *, int /*<<< orphan*/, int);
scalar_t__ rint(double const);
int /*<<< orphan*/ rk4(double *, double *, double *, double *, unsigned int *);
int main(int argc, char *argv[]) {
  double const tmax = 1e6;
  double const dt = 1e2;
  double time = 0;
  unsigned const niter = (unsigned)rint(tmax / dt);
  unsigned iter = 0;
  unsigned i = 0;
  unsigned upar[2];
  upar[0] = 100;
  upar[1] = (unsigned)rint(dt / 1e-2);
  double rpar[3];
  rpar[0] = 1;
  rpar[1] = 1e-2;
  rpar[2] = 0x00;
  double vec1[100 * 2];
  double vec2[100 * 2];
  memset(vec1, 0, sizeof(vec1));
  memset(vec2, 0, sizeof(vec1));
  for (iter = 0; iter < niter; ++iter) {
    rk4(&time, vec1, vec2, rpar, upar);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xce0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xecf(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeba(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe9d(%rip),%xmm0
call   1050 <rint@plt>
mov    %eax,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x64,-0x3c(%rbp)
movsd  0xe78(%rip),%xmm0
call   1050 <rint@plt>
mov    %eax,-0x38(%rbp)
movsd  0xe60(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xe4b(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
lea    -0x6a0(%rbp),%rdi
xor    %esi,%esi
mov    $0x640,%edx
call   1030 <memset@plt>
lea    -0xce0(%rbp),%rdi
xor    %esi,%esi
mov    $0x640,%edx
call   1030 <memset@plt>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jae    1228 <main+0xf8>
lea    -0x6a0(%rbp),%rsi
lea    -0xce0(%rbp),%rdx
lea    -0x60(%rbp),%rcx
lea    -0x3c(%rbp),%r8
lea    -0x28(%rbp),%rdi
call   1040 <rk4@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11ef <main+0xbf>
xor    %eax,%eax
add    $0xce0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xcb8,%rsp
movq   $0x0,0x8(%rsp)
movsd  0xeae(%rip),%xmm0
call   1050 <rint@plt>
mov    %rax,%rbx
movl   $0x64,(%rsp)
movsd  0xe97(%rip),%xmm0
call   1050 <rint@plt>
mov    %eax,0x4(%rsp)
movaps 0xe97(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x20(%rsp)
lea    0x670(%rsp),%rdi
xor    %esi,%esi
mov    $0x640,%edx
call   1030 <memset@plt>
lea    0x30(%rsp),%rdi
xor    %esi,%esi
mov    $0x640,%edx
call   1030 <memset@plt>
test   %ebx,%ebx
je     11e9 <main+0xb9>
lea    0x8(%rsp),%r14
lea    0x670(%rsp),%r15
lea    0x30(%rsp),%r12
lea    0x10(%rsp),%r13
mov    %rsp,%rbp
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbp,%r8
call   1040 <rk4@plt>
add    $0xffffffff,%ebx
jne    11d0 <main+0xa0>
xor    %eax,%eax
add    $0xcb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca [2 x i32]
%13 = alloca [3 x double]
%14 = alloca [200 x double]
%15 = alloca [200 x double]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 1.000000e+06, double* %6
store double 1.000000e+02, double* %7
store double 0.000000e+00, double* %8
%16 = call i64 @rint(double 1.000000e+04)
%17 = trunc i64 %16 to i32
store i32 %17, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
%18 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 0
store i32 100, i32* %18
%19 = call i64 @rint(double 1.000000e+04)
%20 = trunc i64 %19 to i32
%21 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 1
store i32 %20, i32* %21
%22 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 0
store double 1.000000e+00, double* %22
%23 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 1
store double 1.000000e-02, double* %23
%24 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 2
store double 0.000000e+00, double* %24
%25 = getelementptr inbounds [200 x double], [200 x double]* %14, i64 0, i64 0
%26 = call i32 @memset(double* %25, i32 0, i32 1600)
%27 = getelementptr inbounds [200 x double], [200 x double]* %15, i64 0, i64 0
%28 = call i32 @memset(double* %27, i32 0, i32 1600)
store i32 0, i32* %10
br label %29
29: ; preds = %39, %2
%30 = load i32, i32* %10
%31 = load i32, i32* %9
%32 = icmp ult i32 %30, %31
br i1 %32, label %33, label %42
33: ; preds = %29
%34 = getelementptr inbounds [200 x double], [200 x double]* %14, i64 0, i64 0
%35 = getelementptr inbounds [200 x double], [200 x double]* %15, i64 0, i64 0
%36 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 0
%37 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 0
%38 = call i32 @rk4(double* %8, double* %34, double* %35, double* %36, i32* %37)
br label %39
39: ; preds = %33
%40 = load i32, i32* %10
%41 = add i32 %40, 1
store i32 %41, i32* %10
br label %29
42: ; preds = %29
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca double
%4 = alloca [2 x i32]
%5 = alloca [3 x double]
%6 = alloca [200 x double]
%7 = alloca [200 x double]
%8 = bitcast double* %3 to i8*
store double 0.000000e+00, double* %3
%9 = tail call i64 @rint(double 1.000000e+04)
%10 = trunc i64 %9 to i32
%11 = bitcast [2 x i32]* %4 to i8*
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 100, i32* %12
%13 = tail call i64 @rint(double 1.000000e+04)
%14 = trunc i64 %13 to i32
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 %14, i32* %15
%16 = bitcast [3 x double]* %5 to i8*
%17 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%18 = bitcast [3 x double]* %5 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e-02>, <2 x double>* %18
%19 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 2
store double 0.000000e+00, double* %19
%20 = bitcast [200 x double]* %6 to i8*
%21 = bitcast [200 x double]* %7 to i8*
%22 = getelementptr inbounds [200 x double], [200 x double]* %6, i64 0, i64 0
%23 = call i32 @memset(double* %22, i32 0, i32 1600)
%24 = getelementptr inbounds [200 x double], [200 x double]* %7, i64 0, i64 0
%25 = call i32 @memset(double* %24, i32 0, i32 1600)
%26 = icmp eq i32 %10, 0
br i1 %26, label %32, label %27
27: ; preds = %2, %27
%28 = phi i32 [ %30, %27 ], [ 0, %2 ]
%29 = call i32 @rk4(double* %3, double* %22, double* %24, double* %17, i32* %12)
%30 = add nuw i32 %28, 1
%31 = icmp eq i32 %30, %10
br i1 %31, label %32, label %27
32: ; preds = %27, %2
ret i32 0
}