#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*/
runga_kutta_step(float, int, float const *, float const *, float const *,
                 unsigned int, int, float **, float *, float *, float,
                 float const *, void *,
                 void (*)(void *, float *, float, float const *));
float vec_norm(unsigned int, float *);
int /*<<< orphan*/ vec_saxpy(unsigned int, float *, float *, int, float *);
float dormand_prince_step2(float h, unsigned int N, float ynp[N], float tn,
                           const float yn[N], float k[6][N], void *data,
                           void (*f)(void *data, float *out, float t,
                                     const float *yn)) {
  const float c[6] = {1. / 5., 3. / 10., 4. / 5., 8. / 9., 1., 1.};
  const float a[(7 * (7 + 1) / 2)] = {
      1. / 5.,
      3. / 40.,
      9. / 40.,
      44. / 45.,
      -56. / 15.,
      32. / 9.,
      19372. / 6561.,
      -25360. / 2187.,
      64448. / 6561.,
      -212. / 729.,
      9017. / 3168.,
      -355. / 33.,
      46732. / 5247.,
      49. / 176.,
      -5103. / 18656.,
      35. / 384.,
      0.,
      500. / 1113.,
      125. / 192.,
      -2187. / 6784.,
      11. / 84.,
  };
  const float b[7] = {
      5179. / 57600.,    0.,           7571. / 16695., 393. / 640.,
      -92097. / 339200., 187. / 2100., 1. / 40.};
  float tmp[N];
  runga_kutta_step(h, 7, a, b, c, N, 6, k, ynp, tmp, tn, yn, data, f);
  vec_saxpy(N, tmp, tmp, -1., ynp);
  return vec_norm(N, tmp);
}


x86 assembly (clang, -O0):
<dormand_prince_step2>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
sub    $0x108,%rsp
movss  %xmm0,-0x1c(%rbp)
mov    %edi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
movss  %xmm1,-0x2c(%rbp)
mov    %rdx,-0x38(%rbp)
mov    %rcx,-0x40(%rbp)
mov    %r8,-0x48(%rbp)
mov    %r9,-0x50(%rbp)
mov    0xea8(%rip),%rax
mov    %rax,-0x60(%rbp)
movaps 0xe8d(%rip),%xmm0
movaps %xmm0,-0x70(%rbp)
movaps 0xf02(%rip),%xmm0
movaps %xmm0,-0x80(%rbp)
movaps 0xee7(%rip),%xmm0
movaps %xmm0,-0x90(%rbp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,-0xa0(%rbp)
movaps 0xeab(%rip),%xmm0
movaps %xmm0,-0xb0(%rbp)
movaps 0xe8d(%rip),%xmm0
movaps %xmm0,-0xc0(%rbp)
movaps 0xe6f(%rip),%xmm0
movaps %xmm0,-0xd0(%rbp)
movaps 0xe51(%rip),%xmm0
movaps %xmm0,-0xe0(%rbp)
movups 0xebf(%rip),%xmm0
movups %xmm0,-0xf4(%rbp)
movaps 0xea5(%rip),%xmm0
movaps %xmm0,-0x100(%rbp)
mov    -0x20(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x108(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rbx
sub    %rcx,%rbx
mov    %rbx,-0x118(%rbp)
mov    %rbx,%rsp
mov    %rax,-0x110(%rbp)
movss  -0x1c(%rbp),%xmm0
lea    -0xe0(%rbp),%rsi
lea    -0x100(%rbp),%rdx
lea    -0x70(%rbp),%rcx
mov    -0x20(%rbp),%r8d
mov    -0x40(%rbp),%r15
mov    -0x28(%rbp),%r14
movss  -0x2c(%rbp),%xmm1
mov    -0x38(%rbp),%r11
mov    -0x48(%rbp),%r10
mov    -0x50(%rbp),%rax
mov    $0x7,%edi
mov    $0x6,%r9d
sub    $0x30,%rsp
mov    %r15,(%rsp)
mov    %r14,0x8(%rsp)
mov    %rbx,0x10(%rsp)
mov    %r11,0x18(%rsp)
mov    %r10,0x20(%rsp)
mov    %rax,0x28(%rsp)
call   1030 <runga_kutta_step@plt>
mov    -0x118(%rbp),%rdx
add    $0x30,%rsp
mov    -0x20(%rbp),%edi
mov    -0x28(%rbp),%r8
mov    $0xffffffff,%ecx
mov    %rdx,%rsi
call   1050 <vec_saxpy@plt>
mov    -0x118(%rbp),%rsi
mov    -0x20(%rbp),%edi
call   1040 <vec_norm@plt>
mov    -0x108(%rbp),%rax
mov    %rax,%rsp
lea    -0x18(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<dormand_prince_step2>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
mov    %r9,%r11
mov    %r8,%r15
mov    %rcx,%r10
mov    %rdx,%rax
mov    %rsi,%r14
mov    %edi,%r12d
mov    %rsp,%r13
mov    0xeb0(%rip),%rcx
mov    %rcx,-0x30(%rbp)
movaps 0xe95(%rip),%xmm2
movaps %xmm2,-0x40(%rbp)
movaps 0xf0a(%rip),%xmm2
movaps %xmm2,-0x70(%rbp)
movaps 0xeef(%rip),%xmm2
movaps %xmm2,-0x80(%rbp)
movaps 0xed4(%rip),%xmm2
movaps %xmm2,-0x90(%rbp)
movaps 0xeb6(%rip),%xmm2
movaps %xmm2,-0xa0(%rbp)
movaps 0xe98(%rip),%xmm2
movaps %xmm2,-0xb0(%rbp)
movaps 0xe7a(%rip),%xmm2
movaps %xmm2,-0xc0(%rbp)
movaps 0xe5c(%rip),%xmm2
movaps %xmm2,-0xd0(%rbp)
movups 0xeca(%rip),%xmm2
movups %xmm2,-0x54(%rbp)
movaps 0xeb3(%rip),%xmm2
movaps %xmm2,-0x60(%rbp)
mov    %edi,%ecx
mov    %rsp,%rbx
lea    0xf(,%rcx,4),%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%rbx
mov    %rbx,%rsp
lea    -0xd0(%rbp),%rsi
lea    -0x60(%rbp),%rdx
lea    -0x40(%rbp),%rcx
mov    $0x7,%edi
mov    %r12d,%r8d
mov    $0x6,%r9d
push   %r11
push   %r15
push   %rax
push   %rbx
push   %r14
push   %r10
call   1030 <runga_kutta_step@plt>
add    $0x30,%rsp
mov    %r12d,%edi
mov    %rbx,%rsi
mov    %rbx,%rdx
mov    $0xffffffff,%ecx
mov    %r14,%r8
call   1050 <vec_saxpy@plt>
mov    %r12d,%edi
mov    %rbx,%rsi
call   1040 <vec_norm@plt>
mov    %r13,%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.dormand_prince_step2.c = [6 x float] [float 0x3FC99999A0000000, float 0x3FD3333340000000, float 0x3FE99999A0000000, float 0x3FEC71C720000000, float 1.000000e+00, float 1.000000e+00]
@__const.dormand_prince_step2.a = [28 x float] [float 0x3FC99999A0000000, float 0x3FB3333340000000, float 0x3FCCCCCCC0000000, float 0x3FEF49F4A0000000, float 0xC00DDDDDE0000000, float 0x400C71C720000000, float 0x40079EEC00000000, float 0xC027310BE0000000, float 0x4023A55240000000, float 0xBFD29C9EC0000000, float 0x4006C52C00000000, float 0xC02583E100000000, float 0x4021D016A0000000, float 0x3FD1D17460000000, float 0xBFD1818980000000, float 0x3FB7555560000000, float 0.000000e+00, float 0x3FDCC049A0000000, float 0x3FE4D55560000000, float 0xBFD4A1CFC0000000, float 0x3FC0C30C40000000, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00]
@__const.dormand_prince_step2.b = [7 x float] [float 0x3FB7048D20000000, float 0.000000e+00, float 0x3FDD05F700000000, float 0x3FE3A66660000000, float 0xBFD1607580000000, float 0x3FB6CBD320000000, float 0x3F999999A0000000]
define float @dormand_prince_step2(float %0, i32 %1, float* %2, float %3, float* %4, float* %5, i8* %6, void (i8*, float*, float, float*)* %7) {
%9 = alloca float
%10 = alloca i32
%11 = alloca float*
%12 = alloca float
%13 = alloca float*
%14 = alloca float*
%15 = alloca i8*
%16 = alloca void (i8*, float*, float, float*)*
%17 = alloca [6 x float]
%18 = alloca [28 x float]
%19 = alloca [7 x float]
%20 = alloca i8*
%21 = alloca i64
store float %0, float* %9
store i32 %1, i32* %10
store float* %2, float** %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
%22 = load i32, i32* %10
%23 = zext i32 %22 to i64
%24 = load i32, i32* %10
%25 = zext i32 %24 to i64
%26 = load i32, i32* %10
%27 = zext i32 %26 to i64
%28 = bitcast [6 x float]* %17 to i8*
%29 = bitcast [28 x float]* %18 to i8*
%30 = bitcast [7 x float]* %19 to i8*
%31 = load i32, i32* %10
%32 = zext i32 %31 to i64
%33 = call i8* @llvm.stacksave()
store i8* %33, i8** %20
%34 = alloca float, i64 %32
store i64 %32, i64* %21
%35 = load float, float* %9
%36 = getelementptr inbounds [28 x float], [28 x float]* %18, i64 0, i64 0
%37 = getelementptr inbounds [7 x float], [7 x float]* %19, i64 0, i64 0
%38 = getelementptr inbounds [6 x float], [6 x float]* %17, i64 0, i64 0
%39 = load i32, i32* %10
%40 = load float*, float** %14
%41 = bitcast float* %40 to float**
%42 = load float*, float** %11
%43 = load float, float* %12
%44 = load float*, float** %13
%45 = load i8*, i8** %15
%46 = load void (i8*, float*, float, float*)*, void (i8*, float*, float, float*)** %16
%47 = call i32 @runga_kutta_step(float %35, i32 7, float* %36, float* %37, float* %38, i32 %39, i32 6, float** %41, float* %42, float* %34, float %43, float* %44, i8* %45, void (i8*, float*, float, float*)* %46)
%48 = load i32, i32* %10
%49 = load float*, float** %11
%50 = call i32 @vec_saxpy(i32 %48, float* %34, float* %34, i32 -1, float* %49)
%51 = load i32, i32* %10
%52 = call float @vec_norm(i32 %51, float* %34)
%53 = load i8*, i8** %20
ret float %52
}

LLVM IR (-O2):
@__const.dormand_prince_step2.c = [6 x float] [float 0x3FC99999A0000000, float 0x3FD3333340000000, float 0x3FE99999A0000000, float 0x3FEC71C720000000, float 1.000000e+00, float 1.000000e+00]
@__const.dormand_prince_step2.a = [28 x float] [float 0x3FC99999A0000000, float 0x3FB3333340000000, float 0x3FCCCCCCC0000000, float 0x3FEF49F4A0000000, float 0xC00DDDDDE0000000, float 0x400C71C720000000, float 0x40079EEC00000000, float 0xC027310BE0000000, float 0x4023A55240000000, float 0xBFD29C9EC0000000, float 0x4006C52C00000000, float 0xC02583E100000000, float 0x4021D016A0000000, float 0x3FD1D17460000000, float 0xBFD1818980000000, float 0x3FB7555560000000, float 0.000000e+00, float 0x3FDCC049A0000000, float 0x3FE4D55560000000, float 0xBFD4A1CFC0000000, float 0x3FC0C30C40000000, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00]
@__const.dormand_prince_step2.b = [7 x float] [float 0x3FB7048D20000000, float 0.000000e+00, float 0x3FDD05F700000000, float 0x3FE3A66660000000, float 0xBFD1607580000000, float 0x3FB6CBD320000000, float 0x3F999999A0000000]
define float @dormand_prince_step2(float %0, i32 %1, float* %2, float %3, float* %4, float* %5, i8* %6, void (i8*, float*, float, float*)* %7) {
%9 = alloca [6 x float]
%10 = alloca [28 x float]
%11 = alloca [7 x float]
%12 = bitcast [6 x float]* %9 to i8*
%13 = bitcast [28 x float]* %10 to i8*
%14 = bitcast [7 x float]* %11 to i8*
%15 = zext i32 %1 to i64
%16 = tail call i8* @llvm.stacksave()
%17 = alloca float, i64 %15
%18 = getelementptr inbounds [28 x float], [28 x float]* %10, i64 0, i64 0
%19 = getelementptr inbounds [7 x float], [7 x float]* %11, i64 0, i64 0
%20 = getelementptr inbounds [6 x float], [6 x float]* %9, i64 0, i64 0
%21 = bitcast float* %5 to float**
%22 = call i32 @runga_kutta_step(float %0, i32 7, float* %18, float* %19, float* %20, i32 %1, i32 6, float** %21, float* %2, float* %17, float %3, float* %4, i8* %6, void (i8*, float*, float, float*)* %7)
%23 = call i32 @vec_saxpy(i32 %1, float* %17, float* %17, i32 -1, float* %2)
%24 = call float @vec_norm(i32 %1, float* %17)
ret float %24
}