#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 dp1(double);
void solve1RK(double *q1, double *p1, double dt, double Nsteps) {
  double k1, k2, k3, k4;
  double l1, l2, l3, l4;
  int i;
  for (i = 0; i < Nsteps - 1; i++) {
    k1 = p1[i];
    l1 = dp1(q1[i]);
    k2 = p1[i] + 0.5 * l1 * dt;
    l2 = dp1(q1[i] + 0.5 * p1[i] * dt);
    k3 = p1[i] + 0.5 * l2 * dt;
    l3 = dp1(q1[i] + 0.5 * p1[i] * dt);
    k4 = p1[i] + l3 * dt;
    l4 = dp1(q1[i] + p1[i] * dt);
    q1[i + 1] = q1[i] + (k1 / 6.0 + k2 / 3.0 + k3 / 3.0 + k4 / 6.0) * dt;
    p1[i + 1] = p1[i] + (l1 / 6.0 + l2 / 3.0 + l3 / 3.0 + l4 / 6.0) * dt;
  }
}


x86 assembly (clang, -O0):
<solve1RK>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movl   $0x0,-0x64(%rbp)
cvtsi2sdl -0x64(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  0xebd(%rip),%xmm2
subsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    139f <solve1RK+0x28f>
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1030 <dp1@plt>
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  0xe89(%rip),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  0xe55(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <dp1@plt>
movsd  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  0xe24(%rip),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  0xdf0(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <dp1@plt>
movsd  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x58(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <dp1@plt>
movsd  %xmm0,-0x60(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  0xd55(%rip),%xmm2
divsd  %xmm2,%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  0xd4c(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  0xd37(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  0xd1a(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mov    -0x64(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  0xcd9(%rip),%xmm2
divsd  %xmm2,%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  0xcd0(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  0xcbb(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  0xc9e(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
mov    -0x64(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1131 <solve1RK+0x21>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve1RK>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
addsd  0xedc(%rip),%xmm1
movapd %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jbe    12fc <solve1RK+0x1ec>
mov    %rsi,%r14
mov    %rdi,%r15
movsd  (%rsi),%xmm0
mov    $0x1,%ebx
movsd  %xmm1,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  %xmm0,0x18(%rsp)
movsd  -0x8(%r15,%rbx,8),%xmm0
call   1030 <dp1@plt>
movapd %xmm0,%xmm1
movapd %xmm0,0x70(%rsp)
movsd  -0x8(%r14,%rbx,8),%xmm0
movapd %xmm1,%xmm2
movsd  0xe79(%rip),%xmm1
mulsd  %xmm1,%xmm2
mulsd  0x8(%rsp),%xmm2
addsd  %xmm0,%xmm2
movapd %xmm2,0x50(%rsp)
mulsd  %xmm1,%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  -0x8(%r15,%rbx,8),%xmm0
call   1030 <dp1@plt>
movapd %xmm0,%xmm1
movapd %xmm0,0x60(%rsp)
movsd  -0x8(%r14,%rbx,8),%xmm0
movsd  0xe36(%rip),%xmm2
mulsd  %xmm2,%xmm1
mulsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,0x30(%rsp)
mulsd  %xmm2,%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  -0x8(%r15,%rbx,8),%xmm0
call   1030 <dp1@plt>
movapd %xmm0,%xmm1
movapd %xmm0,0x40(%rsp)
movsd  -0x8(%r14,%rbx,8),%xmm0
mulsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,0x20(%rsp)
mulsd  0x8(%rsp),%xmm0
addsd  -0x8(%r15,%rbx,8),%xmm0
call   1030 <dp1@plt>
movsd  0x8(%rsp),%xmm2
movsd  0x10(%rsp),%xmm1
movsd  0xdcd(%rip),%xmm3
movsd  0x18(%rsp),%xmm5
divsd  %xmm3,%xmm5
movsd  0xdc3(%rip),%xmm4
movapd 0x50(%rsp),%xmm6
divsd  %xmm4,%xmm6
addsd  %xmm5,%xmm6
movapd 0x30(%rsp),%xmm5
divsd  %xmm4,%xmm5
addsd  %xmm6,%xmm5
movapd 0x20(%rsp),%xmm4
divsd  %xmm3,%xmm4
addsd  %xmm5,%xmm4
mulsd  %xmm2,%xmm4
addsd  -0x8(%r15,%rbx,8),%xmm4
movsd  %xmm4,(%r15,%rbx,8)
movapd 0x70(%rsp),%xmm3
unpcklpd 0x60(%rsp),%xmm3
divpd  0xd7c(%rip),%xmm3
movapd 0x40(%rsp),%xmm4
unpcklpd %xmm0,%xmm4
divpd  0xd7a(%rip),%xmm4
movapd %xmm3,%xmm0
unpckhpd %xmm3,%xmm0
addsd  %xmm3,%xmm0
addsd  %xmm4,%xmm0
unpckhpd %xmm4,%xmm4
addsd  %xmm0,%xmm4
mulsd  %xmm2,%xmm4
addsd  -0x8(%r14,%rbx,8),%xmm4
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
movsd  %xmm4,(%r14,%rbx,8)
movapd %xmm4,%xmm3
add    $0x1,%rbx
ucomisd %xmm0,%xmm1
movapd %xmm4,%xmm0
ja     1160 <solve1RK+0x50>
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

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