#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 */
float dormand_prince_scale(float, float);
float dormand_prince_step2(float, unsigned int, float *, float, float *,
                           float **, void *,
                           void (*)(void *, float *, float, float const *));
void ode_interval(float h, float tol, unsigned int N, float x[N], float st,
                  float end, void *data,
                  void (*f)(void *data, float *out, float t, const float *yn)) {
  float k[6][N];
  f(data, k[0], st, x);
  if (h > end - st)
    h = end - st;
  for (float t = st; t < end;) {
    float ynp[N];
  repeat:;
    float err = dormand_prince_step2(h, N, ynp, t, x, k, data, f);
    float h_new = h * dormand_prince_scale(tol, err);
    if (err > tol) {
      h = h_new;
      f(data, k[0], t, x);
      goto repeat;
    }
    t += h;
    h = h_new;
    if (t + h > end)
      h = end - t;
    for (unsigned int i = 0; i < N; i++)
      x[i] = ynp[i];
  }
}


x86 assembly (clang, -O0):
<ode_interval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
movss  %xmm2,-0x1c(%rbp)
movss  %xmm3,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
mov    %rcx,-0x78(%rbp)
mov    %rsp,%rax
mov    %rax,-0x38(%rbp)
lea    (%rcx,%rcx,2),%rax
lea    0xf(,%rax,8),%rax
movabs $0x3ffffffff0,%rdx
and    %rdx,%rax
mov    %rsp,%rsi
sub    %rax,%rsi
mov    %rsi,-0x70(%rbp)
mov    %rsi,%rsp
mov    %rcx,-0x40(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rdi
imul   $0x0,%rcx,%rcx
shl    $0x2,%rcx
add    %rcx,%rsi
movss  -0x1c(%rbp),%xmm0
mov    -0x18(%rbp),%rdx
call   *%rax
movss  -0x4(%rbp),%xmm0
movss  -0x20(%rbp),%xmm1
subss  -0x1c(%rbp),%xmm1
ucomiss %xmm1,%xmm0
jbe    11cd <ode_interval+0xad>
movss  -0x20(%rbp),%xmm0
subss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x44(%rbp),%xmm1
movss  -0x20(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1331 <ode_interval+0x211>
mov    -0xc(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x50(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x80(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x58(%rbp)
mov    -0x80(%rbp),%rsi
mov    -0x70(%rbp),%rcx
movss  -0x4(%rbp),%xmm0
mov    -0xc(%rbp),%edi
movss  -0x44(%rbp),%xmm1
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1040 <dormand_prince_step2@plt>
movss  %xmm0,-0x5c(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x84(%rbp)
ff
movss  -0x8(%rbp),%xmm0
movss  -0x5c(%rbp),%xmm1
call   1030 <dormand_prince_scale@plt>
movaps %xmm0,%xmm1
movss  -0x84(%rbp),%xmm0
ff
mulss  %xmm1,%xmm0
movss  %xmm0,-0x60(%rbp)
movss  -0x5c(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    12b0 <ode_interval+0x190>
mov    -0x70(%rbp),%rsi
mov    -0x78(%rbp),%rcx
movss  -0x60(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rdi
imul   $0x0,%rcx,%rcx
shl    $0x2,%rcx
add    %rcx,%rsi
movss  -0x44(%rbp),%xmm0
mov    -0x18(%rbp),%rdx
call   *%rax
jmp    1211 <ode_interval+0xf1>
movss  -0x4(%rbp),%xmm0
addss  -0x44(%rbp),%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x60(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x44(%rbp),%xmm0
addss  -0x4(%rbp),%xmm0
ucomiss -0x20(%rbp),%xmm0
jbe    12ec <ode_interval+0x1cc>
movss  -0x20(%rbp),%xmm0
subss  -0x44(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1325 <ode_interval+0x205>
mov    -0x80(%rbp),%rax
mov    -0x64(%rbp),%ecx
movss  (%rax,%rcx,4),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x64(%rbp),%ecx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    12f3 <ode_interval+0x1d3>
mov    -0x50(%rbp),%rax
mov    %rax,%rsp
jmp    11d7 <ode_interval+0xb7>
mov    -0x38(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ode_interval>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rdx,%r15
movss  %xmm3,-0x34(%rbp)
movss  %xmm2,-0x2c(%rbp)
mov    %rsi,%r13
mov    %edi,%r14d
movss  %xmm1,-0x30(%rbp)
movss  %xmm0,-0x50(%rbp)
mov    %edi,%eax
mov    %rax,%r12
lea    (%rax,%rax,2),%rax
lea    0xf(,%rax,8),%rax
movabs $0x3ffffffff0,%rdx
and    %rax,%rdx
mov    %rsp,%rbx
sub    %rdx,%rbx
mov    %rbx,%rsp
mov    %r15,%rdi
mov    %rbx,%rsi
movaps %xmm2,%xmm0
mov    %r13,%rdx
mov    %rcx,-0x80(%rbp)
call   *%rcx
movss  -0x2c(%rbp),%xmm1
movss  -0x34(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1322 <ode_interval+0x1f2>
movss  -0x34(%rbp),%xmm0
subss  %xmm1,%xmm0
minss  -0x50(%rbp),%xmm0
lea    0xf(,%r12,4),%rax
shl    $0x2,%r12
mov    %r12,-0x70(%rbp)
and    $0xfffffffffffffff0,%rax
mov    %rax,-0x78(%rbp)
mov    %r14d,-0x38(%rbp)
mov    %r15,-0x68(%rbp)
jmp    1221 <ode_interval+0xf1>
nopw   0x0(%rax,%rax,1)
mov    -0x88(%rbp),%rsp
movss  -0x2c(%rbp),%xmm1
addss  %xmm2,%xmm1
movaps %xmm1,%xmm4
addss  %xmm5,%xmm4
movss  -0x34(%rbp),%xmm2
movaps %xmm2,%xmm3
subss  %xmm1,%xmm3
movaps %xmm2,%xmm0
cmpltss %xmm4,%xmm0
andps  %xmm0,%xmm3
andnps %xmm5,%xmm0
orps   %xmm3,%xmm0
ucomiss %xmm1,%xmm2
mov    -0x68(%rbp),%r15
jbe    1322 <ode_interval+0x1f2>
movaps %xmm0,-0x50(%rbp)
mov    %rsp,%r12
mov    %rsp,%rax
sub    -0x78(%rbp),%rax
mov    %rax,%rsp
mov    %r14d,%edi
mov    %rax,%r14
mov    %rax,%rsi
movss  %xmm1,-0x2c(%rbp)
mov    %r13,%rdx
mov    %rbx,%rcx
mov    %r15,%r8
mov    -0x80(%rbp),%r15
mov    %r15,%r9
call   1050 <dormand_prince_step2@plt>
movaps %xmm0,%xmm1
movss  %xmm0,-0x60(%rbp)
movss  -0x30(%rbp),%xmm0
call   1040 <dormand_prince_scale@plt>
movaps -0x50(%rbp),%xmm2
movaps %xmm0,%xmm5
movss  -0x30(%rbp),%xmm0
mulss  %xmm2,%xmm5
movss  -0x60(%rbp),%xmm1
ucomiss %xmm0,%xmm1
mov    %r12,-0x88(%rbp)
jbe    12ed <ode_interval+0x1bd>
mov    -0x68(%rbp),%r12
nopl   0x0(%rax)
movaps %xmm5,-0x50(%rbp)
mov    %r12,%rdi
mov    %rbx,%rsi
movss  -0x2c(%rbp),%xmm0
mov    %r13,%rdx
call   *%r15
movaps -0x50(%rbp),%xmm0
mov    -0x38(%rbp),%edi
mov    %r14,%rsi
movss  -0x2c(%rbp),%xmm1
mov    %r13,%rdx
mov    %rbx,%rcx
mov    %r12,%r8
mov    %r15,%r9
call   1050 <dormand_prince_step2@plt>
movaps %xmm0,%xmm1
movss  %xmm0,-0x60(%rbp)
movss  -0x30(%rbp),%xmm0
call   1040 <dormand_prince_scale@plt>
movaps -0x50(%rbp),%xmm2
movaps %xmm0,%xmm5
mulss  %xmm2,%xmm5
movss  -0x60(%rbp),%xmm0
ucomiss -0x30(%rbp),%xmm0
ja     1290 <ode_interval+0x160>
mov    %r14,%rsi
mov    -0x38(%rbp),%r14d
test   %r14d,%r14d
je     11e0 <ode_interval+0xb0>
mov    %r13,%rdi
mov    -0x70(%rbp),%rdx
movaps %xmm2,-0x50(%rbp)
movaps %xmm5,-0x60(%rbp)
call   1030 <memcpy@plt>
movaps -0x60(%rbp),%xmm5
movaps -0x50(%rbp),%xmm2
mov    -0x38(%rbp),%r14d
jmp    11e0 <ode_interval+0xb0>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @ode_interval(float %0, float %1, i32 %2, float* %3, float %4, float %5, i8* %6, void (i8*, float*, float, float*)* %7) {
%9 = alloca float
%10 = alloca float
%11 = alloca i32
%12 = alloca float*
%13 = alloca float
%14 = alloca float
%15 = alloca i8*
%16 = alloca void (i8*, float*, float, float*)*
%17 = alloca i8*
%18 = alloca i64
%19 = alloca float
%20 = alloca i8*
%21 = alloca i64
%22 = alloca float
%23 = alloca float
%24 = alloca i32
store float %0, float* %9
store float %1, float* %10
store i32 %2, i32* %11
store float* %3, float** %12
store float %4, float* %13
store float %5, float* %14
store i8* %6, i8** %15
store void (i8*, float*, float, float*)* %7, void (i8*, float*, float, float*)** %16
%25 = load i32, i32* %11
%26 = zext i32 %25 to i64
%27 = load i32, i32* %11
%28 = zext i32 %27 to i64
%29 = call i8* @llvm.stacksave()
store i8* %29, i8** %17
%30 = mul nuw i64 6, %28
%31 = alloca float, i64 %30
store i64 %28, i64* %18
%32 = load void (i8*, float*, float, float*)*, void (i8*, float*, float, float*)** %16
%33 = load i8*, i8** %15
%34 = mul nsw i64 0, %28
%35 = getelementptr inbounds float, float* %31, i64 %34
%36 = load float, float* %13
%37 = load float*, float** %12
%38 = load float, float* %9
%39 = load float, float* %14
%40 = load float, float* %13
%41 = fsub float %39, %40
%42 = fcmp ogt float %38, %41
br i1 %42, label %43, label %47
43: ; preds = %8
%44 = load float, float* %14
%45 = load float, float* %13
%46 = fsub float %44, %45
store float %46, float* %9
br label %47
47: ; preds = %43, %8
%48 = load float, float* %13
store float %48, float* %19
br label %49
49: ; preds = %114, %47
%50 = load float, float* %19
%51 = load float, float* %14
%52 = fcmp olt float %50, %51
br i1 %52, label %53, label %116
53: ; preds = %49
%54 = load i32, i32* %11
%55 = zext i32 %54 to i64
%56 = call i8* @llvm.stacksave()
store i8* %56, i8** %20
%57 = alloca float, i64 %55
store i64 %55, i64* %21
br label %58
58: ; preds = %75, %53
%59 = load float, float* %9
%60 = load i32, i32* %11
%61 = load float, float* %19
%62 = load float*, float** %12
%63 = bitcast float* %31 to float**
%64 = load i8*, i8** %15
%65 = load void (i8*, float*, float, float*)*, void (i8*, float*, float, float*)** %16
%66 = call float @dormand_prince_step2(float %59, i32 %60, float* %57, float %61, float* %62, float** %63, i8* %64, void (i8*, float*, float, float*)* %65)
store float %66, float* %22
%67 = load float, float* %9
%68 = load float, float* %10
%69 = load float, float* %22
%70 = call float @dormand_prince_scale(float %68, float %69)
%71 = fmul float %67, %70
store float %71, float* %23
%72 = load float, float* %22
%73 = load float, float* %10
%74 = fcmp ogt float %72, %73
br i1 %74, label %75, label %83
75: ; preds = %58
%76 = load float, float* %23
store float %76, float* %9
%77 = load void (i8*, float*, float, float*)*, void (i8*, float*, float, float*)** %16
%78 = load i8*, i8** %15
%79 = mul nsw i64 0, %28
%80 = getelementptr inbounds float, float* %31, i64 %79
%81 = load float, float* %19
%82 = load float*, float** %12
br label %58
83: ; preds = %58
%84 = load float, float* %9
%85 = load float, float* %19
%86 = fadd float %85, %84
store float %86, float* %19
%87 = load float, float* %23
store float %87, float* %9
%88 = load float, float* %19
%89 = load float, float* %9
%90 = fadd float %88, %89
%91 = load float, float* %14
%92 = fcmp ogt float %90, %91
br i1 %92, label %93, label %97
93: ; preds = %83
%94 = load float, float* %14
%95 = load float, float* %19
%96 = fsub float %94, %95
store float %96, float* %9
br label %97
97: ; preds = %93, %83
store i32 0, i32* %24
br label %98
98: ; preds = %111, %97
%99 = load i32, i32* %24
%100 = load i32, i32* %11
%101 = icmp ult i32 %99, %100
br i1 %101, label %102, label %114
102: ; preds = %98
%103 = load i32, i32* %24
%104 = zext i32 %103 to i64
%105 = getelementptr inbounds float, float* %57, i64 %104
%106 = load float, float* %105
%107 = load float*, float** %12
%108 = load i32, i32* %24
%109 = zext i32 %108 to i64
%110 = getelementptr inbounds float, float* %107, i64 %109
store float %106, float* %110
br label %111
111: ; preds = %102
%112 = load i32, i32* %24
%113 = add i32 %112, 1
store i32 %113, i32* %24
br label %98
114: ; preds = %98
%115 = load i8*, i8** %20
br label %49
116: ; preds = %49
%117 = load i8*, i8** %17
ret void
}

LLVM IR (-O2):
define void @ode_interval(float %0, float %1, i32 %2, float* %3, float %4, float %5, i8* %6, void (i8*, float*, float, float*)* %7) {
%9 = bitcast float* %3 to i8*
%10 = zext i32 %2 to i64
%11 = mul nuw nsw i64 %10, 3
%12 = alloca float*, i64 %11
%13 = bitcast float** %12 to float*
%14 = fsub float %5, %4
%15 = fcmp olt float %4, %5
br i1 %15, label %16, label %21
16: ; preds = %8
%17 = fcmp olt float %14, %0
%18 = select i1 %17, float %14, float %0
%19 = icmp eq i32 %2, 0
%20 = shl nuw nsw i64 %10, 2
br label %22
21: ; preds = %47, %8
ret void
22: ; preds = %16, %47
%23 = phi float [ %18, %16 ], [ %45, %47 ]
%24 = phi float [ %4, %16 ], [ %41, %47 ]
%25 = call i8* @llvm.stacksave()
%26 = alloca float, i64 %10
%27 = bitcast float* %26 to i8*
%28 = call float @dormand_prince_step2(float %23, i32 %2, float* %26, float %24, float* %3, float** %12, i8* %6, void (i8*, float*, float, float*)* %7)
%29 = call float @dormand_prince_scale(float %1, float %28)
%30 = fmul float %23, %29
%31 = fcmp ogt float %28, %1
br i1 %31, label %32, label %38
32: ; preds = %22, %32
%33 = phi float [ %36, %32 ], [ %30, %22 ]
%34 = call float @dormand_prince_step2(float %33, i32 %2, float* %26, float %24, float* %3, float** %12, i8* %6, void (i8*, float*, float, float*)* %7)
%35 = call float @dormand_prince_scale(float %1, float %34)
%36 = fmul float %33, %35
%37 = fcmp ogt float %34, %1
br i1 %37, label %32, label %38
38: ; preds = %32, %22
%39 = phi float [ %23, %22 ], [ %33, %32 ]
%40 = phi float [ %30, %22 ], [ %36, %32 ]
%41 = fadd float %24, %39
%42 = fadd float %41, %40
%43 = fcmp ogt float %42, %5
%44 = fsub float %5, %41
%45 = select i1 %43, float %44, float %40
br i1 %19, label %47, label %46
46: ; preds = %38
br label %47
47: ; preds = %46, %38
%48 = fcmp olt float %41, %5
br i1 %48, label %22, label %21
}