#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 bessj(int, float);
float bessj0(float);
float bessj1(float);
int /*<<< orphan*/ derivs(float, float *, float *);
float exp(double);
int /*<<< orphan*/ free_vector(float *, int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ rkqs(float *, float *, int, float *, float, float, float *,
                        float *, float *,
                        int /*<<< orphan*/ (*)(float, float *, float *));
float *vector(int, int);
int main(void) {
  int i, j;
  float eps, hdid, hnext, htry, x = 1.0, *y, *dydx, *dysav, *ysav, *yscal;
  y = vector(1, 4);
  dydx = vector(1, 4);
  dysav = vector(1, 4);
  ysav = vector(1, 4);
  yscal = vector(1, 4);
  ysav[1] = bessj0(x);
  ysav[2] = bessj1(x);
  ysav[3] = bessj(2, x);
  ysav[4] = bessj(3, x);
  derivs(x, ysav, dysav);
  for (i = 1; i <= 4; i++)
    yscal[i] = 1.0;
  htry = 0.6;
  printf("%10s %11s %12s %13s\n", "eps", "htry", "hdid", "hnext");
  for (i = 1; i <= 15; i++) {
    eps = exp((double)-i);
    x = 1.0;
    for (j = 1; j <= 4; j++) {
      y[j] = ysav[j];
      dydx[j] = dysav[j];
    }
    rkqs(y, dydx, 4, &x, htry, eps, yscal, &hdid, &hnext, derivs);
    printf("%13f %8.2f %14.6f %12.6f \n", eps, htry, hdid, hnext);
  }
  free_vector(yscal, 1, 4);
  free_vector(ysav, 1, 4);
  free_vector(dysav, 1, 4);
  free_vector(dydx, 1, 4);
  free_vector(y, 1, 4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xe69(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
mov    $0x1,%edi
mov    $0x4,%esi
call   1060 <vector@plt>
mov    %rax,-0x28(%rbp)
mov    $0x1,%edi
mov    $0x4,%esi
call   1060 <vector@plt>
mov    %rax,-0x30(%rbp)
mov    $0x1,%edi
mov    $0x4,%esi
call   1060 <vector@plt>
mov    %rax,-0x38(%rbp)
mov    $0x1,%edi
mov    $0x4,%esi
call   1060 <vector@plt>
mov    %rax,-0x40(%rbp)
mov    $0x1,%edi
mov    $0x4,%esi
call   1060 <vector@plt>
mov    %rax,-0x48(%rbp)
movss  -0x20(%rbp),%xmm0
call   1080 <bessj0@plt>
mov    -0x40(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x20(%rbp),%xmm0
call   1030 <bessj1@plt>
mov    -0x40(%rbp),%rax
movss  %xmm0,0x8(%rax)
movss  -0x20(%rbp),%xmm0
mov    $0x2,%edi
call   10a0 <bessj@plt>
mov    -0x40(%rbp),%rax
movss  %xmm0,0xc(%rax)
movss  -0x20(%rbp),%xmm0
mov    $0x3,%edi
call   10a0 <bessj@plt>
mov    -0x40(%rbp),%rax
movss  %xmm0,0x10(%rax)
movss  -0x20(%rbp),%xmm0
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   10b0 <derivs@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jg     1297 <main+0x117>
mov    -0x48(%rbp),%rax
movslq -0x8(%rbp),%rcx
movss  0xd7c(%rip),%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    126a <main+0xea>
movss  0xd65(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
lea    0xd5d(%rip),%rdi
lea    0xd6b(%rip),%rsi
lea    0xd68(%rip),%rdx
lea    0xd66(%rip),%rcx
lea    0xd64(%rip),%r8
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0xf,-0x8(%rbp)
jg     13ce <main+0x24e>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
call   1070 <exp@plt>
movss  %xmm0,-0x10(%rbp)
movss  0xd06(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jg     1352 <main+0x1d2>
mov    -0x40(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x28(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x38(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1306 <main+0x186>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
movss  -0x1c(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
mov    -0x48(%rbp),%r8
mov    $0x4,%edx
lea    -0x20(%rbp),%rcx
lea    -0x14(%rbp),%r9
lea    -0x18(%rbp),%r10
mov    0x2c68(%rip),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1090 <rkqs@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x1c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x14(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movss  -0x18(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
lea    0xc78(%rip),%rdi
mov    $0x4,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12d5 <main+0x155>
mov    -0x48(%rbp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1050 <free_vector@plt>
mov    -0x40(%rbp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1050 <free_vector@plt>
mov    -0x38(%rbp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1050 <free_vector@plt>
mov    -0x30(%rbp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1050 <free_vector@plt>
mov    -0x28(%rbp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1050 <free_vector@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movl   $0x3f800000,0x8(%rsp)
3f
mov    $0x1,%edi
mov    $0x4,%esi
call   1060 <vector@plt>
mov    %rax,%r14
mov    $0x1,%edi
mov    $0x4,%esi
call   1060 <vector@plt>
mov    %rax,%rbx
mov    $0x1,%edi
mov    $0x4,%esi
call   1060 <vector@plt>
mov    %rax,%r15
mov    $0x1,%edi
mov    $0x4,%esi
call   1060 <vector@plt>
mov    %rax,%r12
mov    $0x1,%edi
mov    $0x4,%esi
call   1060 <vector@plt>
mov    %rax,%r13
movss  0xe08(%rip),%xmm0
call   1080 <bessj0@plt>
movss  %xmm0,0x4(%r12)
movss  0xdf4(%rip),%xmm0
call   1030 <bessj1@plt>
movss  %xmm0,0x8(%r12)
mov    $0x2,%edi
movss  0xddb(%rip),%xmm0
call   10a0 <bessj@plt>
movss  %xmm0,0xc(%r12)
mov    $0x3,%edi
movss  0xdc2(%rip),%xmm0
call   10a0 <bessj@plt>
movss  %xmm0,0x10(%r12)
movss  0xdae(%rip),%xmm0
mov    %r12,%rdi
mov    %r15,%rsi
call   10b0 <derivs@plt>
movaps 0xdac(%rip),%xmm0
movups %xmm0,0x4(%r13)
lea    0xdb8(%rip),%rdi
lea    0xdc6(%rip),%rsi
lea    0xdc3(%rip),%rdx
lea    0xdc1(%rip),%rcx
lea    0xdbf(%rip),%r8
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xffffffff,%ebp
nopl   0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
call   1070 <exp@plt>
movapd %xmm0,%xmm1
movss  %xmm0,0xc(%rsp)
movl   $0x3f800000,0x8(%rsp)
3f
movss  0x4(%r12),%xmm0
movss  %xmm0,0x4(%r14)
movss  0x4(%r15),%xmm0
movss  %xmm0,0x4(%rbx)
movss  0x8(%r12),%xmm0
movss  %xmm0,0x8(%r14)
movss  0x8(%r15),%xmm0
movss  %xmm0,0x8(%rbx)
movss  0xc(%r12),%xmm0
movss  %xmm0,0xc(%r14)
movss  0xc(%r15),%xmm0
movss  %xmm0,0xc(%rbx)
movss  0x10(%r12),%xmm0
movss  %xmm0,0x10(%r14)
movss  0x10(%r15),%xmm0
movss  %xmm0,0x10(%rbx)
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
lea    0x8(%rsp),%rcx
movss  0xcce(%rip),%xmm0
mov    %r13,%r8
lea    0x14(%rsp),%r9
push   0x2ca4(%rip)
lea    0x18(%rsp),%rax
push   %rax
call   1090 <rkqs@plt>
add    $0x10,%rsp
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x14(%rsp),%xmm1
xorps  %xmm2,%xmm2
cvtss2sd %xmm1,%xmm2
movss  0x10(%rsp),%xmm1
xorps  %xmm3,%xmm3
cvtss2sd %xmm1,%xmm3
lea    0xcd3(%rip),%rdi
movsd  0xc9a(%rip),%xmm1
mov    $0x4,%al
call   1040 <printf@plt>
add    $0xffffffff,%ebp
cmp    $0xfffffff0,%ebp
jne    12a0 <main+0x120>
mov    %r13,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1050 <free_vector@plt>
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1050 <free_vector@plt>
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1050 <free_vector@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1050 <free_vector@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1050 <free_vector@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"%10s %11s %12s %13s\0A\00"
@.str.1 = [4 x i8] c"eps\00"
@.str.2 = [5 x i8] c"htry\00"
@.str.3 = [5 x i8] c"hdid\00"
@.str.4 = [6 x i8] c"hnext\00"
@.str.5 = [27 x i8] c"%13f %8.2f %14.6f %12.6f \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float*
%10 = alloca float*
%11 = alloca float*
%12 = alloca float*
%13 = alloca float*
store i32 0, i32* %1
store float 1.000000e+00, float* %8
%14 = call float* @vector(i32 1, i32 4)
store float* %14, float** %9
%15 = call float* @vector(i32 1, i32 4)
store float* %15, float** %10
%16 = call float* @vector(i32 1, i32 4)
store float* %16, float** %11
%17 = call float* @vector(i32 1, i32 4)
store float* %17, float** %12
%18 = call float* @vector(i32 1, i32 4)
store float* %18, float** %13
%19 = load float, float* %8
%20 = call float @bessj0(float %19)
%21 = load float*, float** %12
%22 = getelementptr inbounds float, float* %21, i64 1
store float %20, float* %22
%23 = load float, float* %8
%24 = call float @bessj1(float %23)
%25 = load float*, float** %12
%26 = getelementptr inbounds float, float* %25, i64 2
store float %24, float* %26
%27 = load float, float* %8
%28 = call float @bessj(i32 2, float %27)
%29 = load float*, float** %12
%30 = getelementptr inbounds float, float* %29, i64 3
store float %28, float* %30
%31 = load float, float* %8
%32 = call float @bessj(i32 3, float %31)
%33 = load float*, float** %12
%34 = getelementptr inbounds float, float* %33, i64 4
store float %32, float* %34
%35 = load float, float* %8
%36 = load float*, float** %12
%37 = load float*, float** %11
%38 = call i32 @derivs(float %35, float* %36, float* %37)
store i32 1, i32* %2
br label %39
39: ; preds = %47, %0
%40 = load i32, i32* %2
%41 = icmp sle i32 %40, 4
br i1 %41, label %42, label %50
42: ; preds = %39
%43 = load float*, float** %13
%44 = load i32, i32* %2
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds float, float* %43, i64 %45
store float 1.000000e+00, float* %46
br label %47
47: ; preds = %42
%48 = load i32, i32* %2
%49 = add nsw i32 %48, 1
store i32 %49, i32* %2
br label %39
50: ; preds = %39
store float 0x3FE3333340000000, float* %7
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %2
br label %52
52: ; preds = %101, %50
%53 = load i32, i32* %2
%54 = icmp sle i32 %53, 15
br i1 %54, label %55, label %104
55: ; preds = %52
%56 = load i32, i32* %2
%57 = sub nsw i32 0, %56
%58 = sitofp i32 %57 to double
%59 = call float @exp(double %58)
store float %59, float* %4
store float 1.000000e+00, float* %8
store i32 1, i32* %3
br label %60
60: ; preds = %82, %55
%61 = load i32, i32* %3
%62 = icmp sle i32 %61, 4
br i1 %62, label %63, label %85
63: ; preds = %60
%64 = load float*, float** %12
%65 = load i32, i32* %3
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds float, float* %64, i64 %66
%68 = load float, float* %67
%69 = load float*, float** %9
%70 = load i32, i32* %3
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds float, float* %69, i64 %71
store float %68, float* %72
%73 = load float*, float** %11
%74 = load i32, i32* %3
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds float, float* %73, i64 %75
%77 = load float, float* %76
%78 = load float*, float** %10
%79 = load i32, i32* %3
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds float, float* %78, i64 %80
store float %77, float* %81
br label %82
82: ; preds = %63
%83 = load i32, i32* %3
%84 = add nsw i32 %83, 1
store i32 %84, i32* %3
br label %60
85: ; preds = %60
%86 = load float*, float** %9
%87 = load float*, float** %10
%88 = load float, float* %7
%89 = load float, float* %4
%90 = load float*, float** %13
%91 = call i32 @rkqs(float* %86, float* %87, i32 4, float* %8, float %88, float %89, float* %90, float* %5, float* %6, i32 (float, float*, float*)* @derivs)
%92 = load float, float* %4
%93 = fpext float %92 to double
%94 = load float, float* %7
%95 = fpext float %94 to double
%96 = load float, float* %5
%97 = fpext float %96 to double
%98 = load float, float* %6
%99 = fpext float %98 to double
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), double %93, double %95, double %97, double %99)
br label %101
101: ; preds = %85
%102 = load i32, i32* %2
%103 = add nsw i32 %102, 1
store i32 %103, i32* %2
br label %52
104: ; preds = %52
%105 = load float*, float** %13
%106 = call i32 @free_vector(float* %105, i32 1, i32 4)
%107 = load float*, float** %12
%108 = call i32 @free_vector(float* %107, i32 1, i32 4)
%109 = load float*, float** %11
%110 = call i32 @free_vector(float* %109, i32 1, i32 4)
%111 = load float*, float** %10
%112 = call i32 @free_vector(float* %111, i32 1, i32 4)
%113 = load float*, float** %9
%114 = call i32 @free_vector(float* %113, i32 1, i32 4)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"%10s %11s %12s %13s\0A\00"
@.str.1 = [4 x i8] c"eps\00"
@.str.2 = [5 x i8] c"htry\00"
@.str.3 = [5 x i8] c"hdid\00"
@.str.4 = [6 x i8] c"hnext\00"
@.str.5 = [27 x i8] c"%13f %8.2f %14.6f %12.6f \0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
store float 1.000000e+00, float* %3
%7 = tail call float* @vector(i32 1, i32 4)
%8 = tail call float* @vector(i32 1, i32 4)
%9 = tail call float* @vector(i32 1, i32 4)
%10 = tail call float* @vector(i32 1, i32 4)
%11 = tail call float* @vector(i32 1, i32 4)
%12 = tail call float @bessj0(float 1.000000e+00)
%13 = getelementptr inbounds float, float* %10, i64 1
store float %12, float* %13
%14 = tail call float @bessj1(float 1.000000e+00)
%15 = getelementptr inbounds float, float* %10, i64 2
store float %14, float* %15
%16 = tail call float @bessj(i32 2, float 1.000000e+00)
%17 = getelementptr inbounds float, float* %10, i64 3
store float %16, float* %17
%18 = tail call float @bessj(i32 3, float 1.000000e+00)
%19 = getelementptr inbounds float, float* %10, i64 4
store float %18, float* %19
%20 = tail call i32 @derivs(float 1.000000e+00, float* %10, float* %9)
%21 = getelementptr inbounds float, float* %11, i64 1
%22 = bitcast float* %21 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %22
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%24 = getelementptr inbounds float, float* %7, i64 1
%25 = getelementptr inbounds float, float* %9, i64 1
%26 = getelementptr inbounds float, float* %8, i64 1
%27 = getelementptr inbounds float, float* %7, i64 2
%28 = getelementptr inbounds float, float* %9, i64 2
%29 = getelementptr inbounds float, float* %8, i64 2
%30 = getelementptr inbounds float, float* %7, i64 3
%31 = getelementptr inbounds float, float* %9, i64 3
%32 = getelementptr inbounds float, float* %8, i64 3
%33 = getelementptr inbounds float, float* %7, i64 4
%34 = getelementptr inbounds float, float* %9, i64 4
%35 = getelementptr inbounds float, float* %8, i64 4
br label %36
36: ; preds = %0, %36
%37 = phi i32 [ 1, %0 ], [ %56, %36 ]
%38 = sub nsw i32 0, %37
%39 = sitofp i32 %38 to double
%40 = call float @exp(double %39)
store float 1.000000e+00, float* %3
%41 = load float, float* %13
store float %41, float* %24
%42 = load float, float* %25
store float %42, float* %26
%43 = load float, float* %15
store float %43, float* %27
%44 = load float, float* %28
store float %44, float* %29
%45 = load float, float* %17
store float %45, float* %30
%46 = load float, float* %31
store float %46, float* %32
%47 = load float, float* %19
store float %47, float* %33
%48 = load float, float* %34
store float %48, float* %35
%49 = call i32 @rkqs(float* %7, float* %8, i32 4, float* %3, float 0x3FE3333340000000, float %40, float* %11, float* %1, float* %2, i32 (float, float*, float*)* @derivs)
%50 = fpext float %40 to double
%51 = load float, float* %1
%52 = fpext float %51 to double
%53 = load float, float* %2
%54 = fpext float %53 to double
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), double %50, double 0x3FE3333340000000, double %52, double %54)
%56 = add nuw nsw i32 %37, 1
%57 = icmp eq i32 %56, 16
br i1 %57, label %58, label %36
58: ; preds = %36
%59 = call i32 @free_vector(float* %11, i32 1, i32 4)
%60 = call i32 @free_vector(float* %10, i32 1, i32 4)
%61 = call i32 @free_vector(float* %9, i32 1, i32 4)
%62 = call i32 @free_vector(float* %8, i32 1, i32 4)
%63 = call i32 @free_vector(float* %7, i32 1, i32 4)
ret i32 0
}