#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*/ derivs_one(double *, double *, double const *);
void integrate_one_rk4_nosave(double *y, const double *params, const double dt,
                              const unsigned N) {
  unsigned i, j, k;
  double dt2, dt6;
  double y1[2], y2[2], k1[2], k2[2], k3[2], k4[2];
  dt2 = dt / 2.;
  dt6 = dt / 6.;
  for (i = 0; i < N; i++) {
    derivs_one(y, k1, params);
    for (k = 0; k < 2; k++)
      y1[k] = y[k] + k1[k] * dt2;
    derivs_one(y1, k2, params);
    for (k = 0; k < 2; k++)
      y2[k] = y[k] + k2[k] * dt2;
    derivs_one(y2, k3, params);
    for (k = 0; k < 2; k++)
      y2[k] = y[k] + k3[k] * dt;
    derivs_one(y2, k4, params);
    for (k = 0; k < 2; k++)
      y[k] += dt6 * (k1[k] + 2. * (k2[k] + k3[k]) + k4[k]);
  }
}


x86 assembly (clang, -O0):
<integrate_one_rk4_nosave>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xed0(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xeb2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jae    1317 <integrate_one_rk4_nosave+0x207>
mov    -0x8(%rbp),%rdi
lea    -0x70(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <derivs_one@plt>
movl   $0x0,-0x28(%rbp)
cmpl   $0x2,-0x28(%rbp)
jae    11c5 <integrate_one_rk4_nosave+0xb5>
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%ecx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x28(%rbp),%eax
movsd  -0x70(%rbp,%rax,8),%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%eax
movsd  %xmm0,-0x50(%rbp,%rax,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1182 <integrate_one_rk4_nosave+0x72>
lea    -0x50(%rbp),%rdi
lea    -0x80(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <derivs_one@plt>
movl   $0x0,-0x28(%rbp)
cmpl   $0x2,-0x28(%rbp)
jae    1220 <integrate_one_rk4_nosave+0x110>
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%ecx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x28(%rbp),%eax
movsd  -0x80(%rbp,%rax,8),%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%eax
movsd  %xmm0,-0x60(%rbp,%rax,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11dd <integrate_one_rk4_nosave+0xcd>
lea    -0x60(%rbp),%rdi
lea    -0x90(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <derivs_one@plt>
movl   $0x0,-0x28(%rbp)
cmpl   $0x2,-0x28(%rbp)
jae    1281 <integrate_one_rk4_nosave+0x171>
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%ecx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x28(%rbp),%eax
movsd  -0x90(%rbp,%rax,8),%xmm0
ff ff
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%eax
movsd  %xmm0,-0x60(%rbp,%rax,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    123b <integrate_one_rk4_nosave+0x12b>
lea    -0x60(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <derivs_one@plt>
movl   $0x0,-0x28(%rbp)
cmpl   $0x2,-0x28(%rbp)
jae    1304 <integrate_one_rk4_nosave+0x1f4>
movsd  -0x38(%rbp),%xmm0
mov    -0x28(%rbp),%eax
movsd  -0x70(%rbp,%rax,8),%xmm1
mov    -0x28(%rbp),%eax
movsd  -0x80(%rbp,%rax,8),%xmm2
mov    -0x28(%rbp),%eax
addsd  -0x90(%rbp,%rax,8),%xmm2
ff ff
addsd  %xmm2,%xmm2
addsd  %xmm1,%xmm2
mov    -0x28(%rbp),%eax
addsd  -0xa0(%rbp,%rax,8),%xmm2
ff ff
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%ecx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    129c <integrate_one_rk4_nosave+0x18c>
jmp    1309 <integrate_one_rk4_nosave+0x1f9>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    115e <integrate_one_rk4_nosave+0x4e>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<integrate_one_rk4_nosave>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
test   %edx,%edx
je     1247 <integrate_one_rk4_nosave+0x137>
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  0xec7(%rip),%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm0,%xmm2
divsd  0xebf(%rip),%xmm2
unpcklpd %xmm1,%xmm1
movapd %xmm1,(%rsp)
unpcklpd %xmm0,%xmm0
movapd %xmm0,0x60(%rsp)
unpcklpd %xmm2,%xmm2
movapd %xmm2,0x50(%rsp)
lea    0x40(%rsp),%r15
lea    0x10(%rsp),%r12
lea    0x70(%rsp),%r13
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
lea    0x30(%rsp),%rsi
mov    %r14,%rdx
call   1030 <derivs_one@plt>
movupd (%rbx),%xmm0
movapd 0x30(%rsp),%xmm1
mulpd  (%rsp),%xmm1
addpd  %xmm0,%xmm1
movapd %xmm1,0x80(%rsp)
lea    0x80(%rsp),%rdi
lea    0x20(%rsp),%rsi
mov    %r14,%rdx
call   1030 <derivs_one@plt>
movupd (%rbx),%xmm0
movapd 0x20(%rsp),%xmm1
mulpd  (%rsp),%xmm1
addpd  %xmm0,%xmm1
movapd %xmm1,0x40(%rsp)
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r14,%rdx
call   1030 <derivs_one@plt>
movupd (%rbx),%xmm0
movapd 0x10(%rsp),%xmm1
mulpd  0x60(%rsp),%xmm1
addpd  %xmm0,%xmm1
movapd %xmm1,0x40(%rsp)
mov    %r15,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
call   1030 <derivs_one@plt>
movapd 0x20(%rsp),%xmm0
addpd  0x10(%rsp),%xmm0
addpd  %xmm0,%xmm0
addpd  0x30(%rsp),%xmm0
addpd  0x70(%rsp),%xmm0
mulpd  0x50(%rsp),%xmm0
movupd (%rbx),%xmm1
addpd  %xmm0,%xmm1
movupd %xmm1,(%rbx)
add    $0xffffffff,%ebp
jne    1180 <integrate_one_rk4_nosave+0x70>
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @integrate_one_rk4_nosave(double* %0, double* %1, double %2, i32 %3) {
%5 = alloca <2 x double>
%6 = alloca <2 x double>
%7 = alloca <2 x double>
%8 = alloca <2 x double>
%9 = alloca <2 x double>
%10 = alloca <2 x double>
%11 = bitcast <2 x double>* %5 to i8*
%12 = bitcast <2 x double>* %6 to i8*
%13 = bitcast <2 x double>* %7 to i8*
%14 = bitcast <2 x double>* %8 to i8*
%15 = bitcast <2 x double>* %9 to i8*
%16 = bitcast <2 x double>* %10 to i8*
%17 = fmul double %2, 5.000000e-01
%18 = icmp eq i32 %3, 0
br i1 %18, label %66, label %19
19: ; preds = %4
%20 = fdiv double %2, 6.000000e+00
%21 = getelementptr inbounds <2 x double>, <2 x double>* %7, i64 0, i64 0
%22 = getelementptr inbounds <2 x double>, <2 x double>* %5, i64 0, i64 0
%23 = getelementptr inbounds <2 x double>, <2 x double>* %8, i64 0, i64 0
%24 = getelementptr inbounds <2 x double>, <2 x double>* %6, i64 0, i64 0
%25 = getelementptr inbounds <2 x double>, <2 x double>* %9, i64 0, i64 0
%26 = getelementptr inbounds <2 x double>, <2 x double>* %10, i64 0, i64 0
%27 = insertelement <2 x double> poison, double %17, i64 0
%28 = shufflevector <2 x double> %27, <2 x double> poison, <2 x i32> zeroinitializer
%29 = insertelement <2 x double> poison, double %2, i64 0
%30 = shufflevector <2 x double> %29, <2 x double> poison, <2 x i32> zeroinitializer
%31 = insertelement <2 x double> poison, double %17, i64 0
%32 = shufflevector <2 x double> %31, <2 x double> poison, <2 x i32> zeroinitializer
%33 = insertelement <2 x double> poison, double %20, i64 0
%34 = shufflevector <2 x double> %33, <2 x double> poison, <2 x i32> zeroinitializer
%35 = bitcast double* %0 to <2 x double>*
%36 = bitcast double* %0 to <2 x double>*
%37 = bitcast double* %0 to <2 x double>*
%38 = bitcast double* %0 to <2 x double>*
%39 = bitcast double* %0 to <2 x double>*
br label %40
40: ; preds = %19, %40
%41 = phi i32 [ 0, %19 ], [ %64, %40 ]
%42 = call i32 @derivs_one(double* %0, double* %21, double* %1)
%43 = load <2 x double>, <2 x double>* %35
%44 = load <2 x double>, <2 x double>* %7
%45 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %44, <2 x double> %28, <2 x double> %43)
store <2 x double> %45, <2 x double>* %5
%46 = call i32 @derivs_one(double* %22, double* %23, double* %1)
%47 = load <2 x double>, <2 x double>* %36
%48 = load <2 x double>, <2 x double>* %8
%49 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %48, <2 x double> %32, <2 x double> %47)
store <2 x double> %49, <2 x double>* %6
%50 = call i32 @derivs_one(double* %24, double* %25, double* %1)
%51 = load <2 x double>, <2 x double>* %37
%52 = load <2 x double>, <2 x double>* %9
%53 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %52, <2 x double> %30, <2 x double> %51)
store <2 x double> %53, <2 x double>* %6
%54 = call i32 @derivs_one(double* %24, double* %26, double* %1)
%55 = load <2 x double>, <2 x double>* %7
%56 = load <2 x double>, <2 x double>* %8
%57 = load <2 x double>, <2 x double>* %9
%58 = fadd <2 x double> %56, %57
%59 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %58, <2 x double> <double 2.000000e+00, double 2.000000e+00>, <2 x double> %55)
%60 = load <2 x double>, <2 x double>* %10
%61 = fadd <2 x double> %60, %59
%62 = load <2 x double>, <2 x double>* %38
%63 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %34, <2 x double> %61, <2 x double> %62)
store <2 x double> %63, <2 x double>* %39
%64 = add nuw i32 %41, 1
%65 = icmp eq i32 %64, %3
br i1 %65, label %66, label %40
66: ; preds = %40, %4
ret void
}