#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 M_PI;
scalar_t__ csp1d(double *, double *, int, double, double, double *);
int /*<<< orphan*/ free(double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, double, double, ...);
double sin(double);
int sqrt(double);
int testmain1d(void) {
  double *x, *f, *s, xx, yy, r, spl, e;
  int i, j, k, n;
  double dx, a, b, c, d, g;
  n = 12;
  x = (double *)malloc(n * sizeof(double));
  f = (double *)malloc(n * sizeof(double));
  s = (double *)malloc(n * sizeof(double));
  x[0] = 0.;
  x[1] = 0.1;
  for (i = 2; i < n; i++) {
    x[i] = i - 1.;
  }
  for (i = 0; i < n; i++) {
    r = M_PI * sqrt(x[i] * x[i]) / 2.;
    yy = (r != 0.) ? sin(r) / r : 1.;
    f[i] = yy;
    printf("%8.5f %9.6f\n", r, yy);
  }
  if (csp1d(x, f, n, 1.e30, 1.e30, s) != 0)
    return 1;
  k = 0;
  for (j = 0; j < 101; j++) {
    xx = j / 10.;
    while (k > 0 && xx < x[k])
      k--;
    while (k < n - 2 && xx > x[k + 1])
      k++;
    dx = x[k + 1] - x[k];
    b = (xx - x[k]) / dx;
    a = 1. - b;
    g = dx * dx / 6.;
    c = g * (a * a * a - a);
    d = g * (b * b * b - b);
    spl = a * f[k] + b * f[k + 1] + c * s[k] + d * s[k + 1];
    r = M_PI * sqrt(xx * xx) / 2.;
    e = (r != 0.) ? sin(r) / r : 1.;
    printf("%8.5f %9.6f %9.6f\n", r, spl, e);
  }
  free(f);
  free(s);
  free(x);
  return 0;
}


x86 assembly (clang, -O0):
<testmain1d>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0xc,-0x58(%rbp)
movslq -0x58(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x10(%rbp)
movslq -0x58(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x18(%rbp)
movslq -0x58(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0xe3e(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
movl   $0x2,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x58(%rbp),%eax
jge    1206 <testmain1d+0xa6>
cvtsi2sdl -0x4c(%rbp),%xmm0
movsd  0xe41(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    11ce <testmain1d+0x6e>
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x58(%rbp),%eax
jge    12fa <testmain1d+0x19a>
mov    0x2dc8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
call   1080 <sqrt@plt>
mov    %eax,%ecx
mov    -0x8c(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  0xdba(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1284 <testmain1d+0x124>
jp     1284 <testmain1d+0x124>
jmp    12a0 <testmain1d+0x140>
movsd  -0x38(%rbp),%xmm0
call   1050 <sin@plt>
divsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
jmp    12b5 <testmain1d+0x155>
movsd  0xd80(%rip),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
jmp    12b5 <testmain1d+0x155>
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x38(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
lea    0xd4b(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    120d <testmain1d+0xad>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x58(%rbp),%edx
mov    -0x20(%rbp),%rcx
movsd  0xcf7(%rip),%xmm1
movaps %xmm1,%xmm0
call   1060 <csp1d@plt>
cmp    $0x0,%rax
je     132f <testmain1d+0x1cf>
movl   $0x1,-0x4(%rbp)
jmp    165b <testmain1d+0x4fb>
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x50(%rbp)
cmpl   $0x65,-0x50(%rbp)
jge    1639 <testmain1d+0x4d9>
cvtsi2sdl -0x50(%rbp),%xmm0
movsd  0xcbc(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x54(%rbp)
mov    %al,-0x99(%rbp)
jle    138e <testmain1d+0x22e>
movsd  -0x28(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x99(%rbp)
mov    -0x99(%rbp),%al
test   $0x1,%al
jne    13a1 <testmain1d+0x241>
jmp    13af <testmain1d+0x24f>
mov    -0x54(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x54(%rbp)
jmp    135d <testmain1d+0x1fd>
jmp    13b4 <testmain1d+0x254>
mov    -0x54(%rbp),%ecx
mov    -0x58(%rbp),%edx
sub    $0x2,%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x9a(%rbp)
jge    13ed <testmain1d+0x28d>
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
ucomisd (%rax,%rcx,8),%xmm0
seta   %al
mov    %al,-0x9a(%rbp)
mov    -0x9a(%rbp),%al
test   $0x1,%al
jne    1400 <testmain1d+0x2a0>
jmp    140e <testmain1d+0x2ae>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    13b4 <testmain1d+0x254>
mov    -0x10(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
divsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xbd2(%rip),%xmm0
subsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x60(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  0xbae(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x68(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm3
movsd  -0x68(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x70(%rbp),%xmm1
mulsd  -0x70(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm3
movsd  -0x70(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x68(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x70(%rbp),%xmm1
mov    -0x18(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x78(%rbp),%xmm1
mov    -0x20(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    0x2a6c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xa0(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1080 <sqrt@plt>
mov    %eax,%ecx
mov    -0xa0(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  0xa6e(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    15d0 <testmain1d+0x470>
jp     15d0 <testmain1d+0x470>
jmp    15ec <testmain1d+0x48c>
movsd  -0x38(%rbp),%xmm0
call   1050 <sin@plt>
divsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
jmp    1601 <testmain1d+0x4a1>
movsd  0xa34(%rip),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
jmp    1601 <testmain1d+0x4a1>
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
lea    0xa19(%rip),%rdi
mov    $0x3,%al
call   1040 <printf@plt>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    133d <testmain1d+0x1dd>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testmain1d>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    $0x60,%edi
call   1070 <malloc@plt>
mov    %rax,%rbx
mov    $0x60,%edi
call   1070 <malloc@plt>
mov    %rax,%r14
mov    $0x60,%edi
call   1070 <malloc@plt>
mov    %rax,%r15
xorps  %xmm0,%xmm0
movhps 0xe61(%rip),%xmm0
movups %xmm0,(%rbx)
movaps 0xe97(%rip),%xmm0
movups %xmm0,0x10(%rbx)
movaps 0xe9c(%rip),%xmm0
movups %xmm0,0x20(%rbx)
movaps 0xea1(%rip),%xmm0
movups %xmm0,0x30(%rbx)
movaps 0xea6(%rip),%xmm0
movups %xmm0,0x40(%rbx)
movapd 0xeaa(%rip),%xmm0
movupd %xmm0,0x50(%rbx)
mov    $0x1,%ebp
lea    0xea9(%rip),%r12
xorpd  %xmm0,%xmm0
nopl   0x0(%rax,%rax,1)
mov    0x2df1(%rip),%rax
mov    (%rax),%r13d
mulsd  %xmm0,%xmm0
call   1080 <sqrt@plt>
imul   %r13d,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xdf2(%rip),%xmm0
ucomisd 0xe12(%rip),%xmm0
movsd  0xdea(%rip),%xmm1
jne    122a <testmain1d+0xca>
jnp    1249 <testmain1d+0xe9>
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <sin@plt>
movapd %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
divsd  %xmm0,%xmm1
movsd  %xmm1,-0x8(%r14,%rbp,8)
mov    %r12,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
cmp    $0xc,%rbp
je     126b <testmain1d+0x10b>
movsd  (%rbx,%rbp,8),%xmm0
add    $0x1,%rbp
jmp    11f0 <testmain1d+0x90>
movsd  0xda5(%rip),%xmm0
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xc,%edx
movapd %xmm0,%xmm1
mov    %r15,%rcx
call   1060 <csp1d@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    147b <testmain1d+0x31b>
xor    %r13d,%r13d
xorpd  %xmm0,%xmm0
xor    %r12d,%r12d
jmp    12fe <testmain1d+0x19e>
nopw   0x0(%rax,%rax,1)
movsd  0x28(%rsp),%xmm0
addsd  0x30(%rsp),%xmm0
movsd  0x20(%rsp),%xmm3
addsd  %xmm0,%xmm3
movsd  0x18(%rsp),%xmm1
addsd  %xmm3,%xmm1
lea    0xdc6(%rip),%rdi
movapd %xmm4,%xmm0
mov    $0x3,%al
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xd20(%rip),%xmm0
add    $0x1,%r13d
cmp    $0x65,%r13d
je     1461 <testmain1d+0x301>
movsd  %xmm0,0x8(%rsp)
divsd  0xd14(%rip),%xmm0
test   %r12d,%r12d
jle    133d <testmain1d+0x1dd>
mov    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  (%rbx,%r12,8),%xmm1
ucomisd %xmm0,%xmm1
jbe    133d <testmain1d+0x1dd>
lea    -0x1(%r12),%rax
cmp    $0x1,%r12
mov    %rax,%r12
jg     1320 <testmain1d+0x1c0>
xor    %r12d,%r12d
movslq %r12d,%rax
cmp    $0xb,%eax
mov    $0xa,%ecx
cmovge %eax,%ecx
lea    -0x1(%rax),%r12d
nop
cmp    $0x9,%rax
jg     1370 <testmain1d+0x210>
add    $0x1,%r12d
ucomisd 0x8(%rbx,%rax,8),%xmm0
lea    0x1(%rax),%rax
ja     1350 <testmain1d+0x1f0>
jmp    1373 <testmain1d+0x213>
nopl   0x0(%rax,%rax,1)
mov    %ecx,%r12d
movslq %r12d,%rax
movsd  (%rbx,%rax,8),%xmm1
movsd  0x8(%rbx,%rax,8),%xmm2
subsd  %xmm1,%xmm2
movapd %xmm0,%xmm3
subsd  %xmm1,%xmm3
divsd  %xmm2,%xmm3
movsd  0xc77(%rip),%xmm1
subsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm2
divsd  0xc7f(%rip),%xmm2
movapd %xmm1,%xmm4
mulsd  %xmm1,%xmm4
mulsd  %xmm1,%xmm4
subsd  %xmm1,%xmm4
mulsd  %xmm2,%xmm4
movapd %xmm3,%xmm5
mulsd  %xmm3,%xmm5
mulsd  %xmm3,%xmm5
subsd  %xmm3,%xmm5
mulsd  %xmm2,%xmm5
mulsd  0x8(%r14,%rax,8),%xmm3
movsd  %xmm3,0x30(%rsp)
mulsd  (%r14,%rax,8),%xmm1
movsd  %xmm1,0x28(%rsp)
mulsd  (%r15,%rax,8),%xmm4
movsd  %xmm4,0x20(%rsp)
mulsd  0x8(%r15,%rax,8),%xmm5
movsd  %xmm5,0x18(%rsp)
mov    0x2bde(%rip),%rax
mov    (%rax),%ebp
mulsd  %xmm0,%xmm0
call   1080 <sqrt@plt>
imul   %ebp,%eax
xorps  %xmm4,%xmm4
cvtsi2sd %eax,%xmm4
mulsd  0xbe1(%rip),%xmm4
ucomisd 0xc01(%rip),%xmm4
movsd  0xbd9(%rip),%xmm2
jne    143f <testmain1d+0x2df>
jnp    12b0 <testmain1d+0x150>
movapd %xmm4,%xmm0
movsd  %xmm4,0x10(%rsp)
call   1050 <sin@plt>
movsd  0x10(%rsp),%xmm4
movapd %xmm0,%xmm2
divsd  %xmm4,%xmm2
jmp    12b0 <testmain1d+0x150>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@M_PI = global i32 0
@.str = [13 x i8] c"%8.5f %9.6f\0A\00"
@.str.1 = [19 x i8] c"%8.5f %9.6f %9.6f\0A\00"
define i32 @testmain1d() {
%1 = alloca i32
%2 = alloca double*
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
store i32 12, i32* %13
%20 = load i32, i32* %13
%21 = sext i32 %20 to i64
%22 = mul i64 %21, 8
%23 = trunc i64 %22 to i32
%24 = call i64 @malloc(i32 %23)
%25 = inttoptr i64 %24 to double*
store double* %25, double** %2
%26 = load i32, i32* %13
%27 = sext i32 %26 to i64
%28 = mul i64 %27, 8
%29 = trunc i64 %28 to i32
%30 = call i64 @malloc(i32 %29)
%31 = inttoptr i64 %30 to double*
store double* %31, double** %3
%32 = load i32, i32* %13
%33 = sext i32 %32 to i64
%34 = mul i64 %33, 8
%35 = trunc i64 %34 to i32
%36 = call i64 @malloc(i32 %35)
%37 = inttoptr i64 %36 to double*
store double* %37, double** %4
%38 = load double*, double** %2
%39 = getelementptr inbounds double, double* %38, i64 0
store double 0.000000e+00, double* %39
%40 = load double*, double** %2
%41 = getelementptr inbounds double, double* %40, i64 1
store double 1.000000e-01, double* %41
store i32 2, i32* %10
br label %42
42: ; preds = %54, %0
%43 = load i32, i32* %10
%44 = load i32, i32* %13
%45 = icmp slt i32 %43, %44
br i1 %45, label %46, label %57
46: ; preds = %42
%47 = load i32, i32* %10
%48 = sitofp i32 %47 to double
%49 = fsub double %48, 1.000000e+00
%50 = load double*, double** %2
%51 = load i32, i32* %10
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds double, double* %50, i64 %52
store double %49, double* %53
br label %54
54: ; preds = %46
%55 = load i32, i32* %10
%56 = add nsw i32 %55, 1
store i32 %56, i32* %10
br label %42
57: ; preds = %42
store i32 0, i32* %10
br label %58
58: ; preds = %97, %57
%59 = load i32, i32* %10
%60 = load i32, i32* %13
%61 = icmp slt i32 %59, %60
br i1 %61, label %62, label %100
62: ; preds = %58
%63 = load i32, i32* @M_PI
%64 = load double*, double** %2
%65 = load i32, i32* %10
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds double, double* %64, i64 %66
%68 = load double, double* %67
%69 = load double*, double** %2
%70 = load i32, i32* %10
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds double, double* %69, i64 %71
%73 = load double, double* %72
%74 = fmul double %68, %73
%75 = call i32 @sqrt(double %74)
%76 = mul nsw i32 %63, %75
%77 = sitofp i32 %76 to double
%78 = fdiv double %77, 2.000000e+00
store double %78, double* %7
%79 = load double, double* %7
%80 = fcmp une double %79, 0.000000e+00
br i1 %80, label %81, label %86
81: ; preds = %62
%82 = load double, double* %7
%83 = call double @sin(double %82)
%84 = load double, double* %7
%85 = fdiv double %83, %84
br label %87
86: ; preds = %62
br label %87
87: ; preds = %86, %81
%88 = phi double [ %85, %81 ], [ 1.000000e+00, %86 ]
store double %88, double* %6
%89 = load double, double* %6
%90 = load double*, double** %3
%91 = load i32, i32* %10
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds double, double* %90, i64 %92
store double %89, double* %93
%94 = load double, double* %7
%95 = load double, double* %6
%96 = call i32 (i8*, double, double, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %94, double %95)
br label %97
97: ; preds = %87
%98 = load i32, i32* %10
%99 = add nsw i32 %98, 1
store i32 %99, i32* %10
br label %58
100: ; preds = %58
%101 = load double*, double** %2
%102 = load double*, double** %3
%103 = load i32, i32* %13
%104 = load double*, double** %4
%105 = call i64 @csp1d(double* %101, double* %102, i32 %103, double 1.000000e+30, double 1.000000e+30, double* %104)
%106 = icmp ne i64 %105, 0
br i1 %106, label %107, label %108
107: ; preds = %100
store i32 1, i32* %1
br label %260
108: ; preds = %100
store i32 0, i32* %12
store i32 0, i32* %11
br label %109
109: ; preds = %250, %108
%110 = load i32, i32* %11
%111 = icmp slt i32 %110, 101
br i1 %111, label %112, label %253
112: ; preds = %109
%113 = load i32, i32* %11
%114 = sitofp i32 %113 to double
%115 = fdiv double %114, 1.000000e+01
store double %115, double* %5
br label %116
116: ; preds = %129, %112
%117 = load i32, i32* %12
%118 = icmp sgt i32 %117, 0
br i1 %118, label %119, label %127
119: ; preds = %116
%120 = load double, double* %5
%121 = load double*, double** %2
%122 = load i32, i32* %12
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds double, double* %121, i64 %123
%125 = load double, double* %124
%126 = fcmp olt double %120, %125
br label %127
127: ; preds = %119, %116
%128 = phi i1 [ false, %116 ], [ %126, %119 ]
br i1 %128, label %129, label %132
129: ; preds = %127
%130 = load i32, i32* %12
%131 = add nsw i32 %130, -1
store i32 %131, i32* %12
br label %116
132: ; preds = %127
br label %133
133: ; preds = %149, %132
%134 = load i32, i32* %12
%135 = load i32, i32* %13
%136 = sub nsw i32 %135, 2
%137 = icmp slt i32 %134, %136
br i1 %137, label %138, label %147
138: ; preds = %133
%139 = load double, double* %5
%140 = load double*, double** %2
%141 = load i32, i32* %12
%142 = add nsw i32 %141, 1
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds double, double* %140, i64 %143
%145 = load double, double* %144
%146 = fcmp ogt double %139, %145
br label %147
147: ; preds = %138, %133
%148 = phi i1 [ false, %133 ], [ %146, %138 ]
br i1 %148, label %149, label %152
149: ; preds = %147
%150 = load i32, i32* %12
%151 = add nsw i32 %150, 1
store i32 %151, i32* %12
br label %133
152: ; preds = %147
%153 = load double*, double** %2
%154 = load i32, i32* %12
%155 = add nsw i32 %154, 1
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds double, double* %153, i64 %156
%158 = load double, double* %157
%159 = load double*, double** %2
%160 = load i32, i32* %12
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds double, double* %159, i64 %161
%163 = load double, double* %162
%164 = fsub double %158, %163
store double %164, double* %14
%165 = load double, double* %5
%166 = load double*, double** %2
%167 = load i32, i32* %12
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds double, double* %166, i64 %168
%170 = load double, double* %169
%171 = fsub double %165, %170
%172 = load double, double* %14
%173 = fdiv double %171, %172
store double %173, double* %16
%174 = load double, double* %16
%175 = fsub double 1.000000e+00, %174
store double %175, double* %15
%176 = load double, double* %14
%177 = load double, double* %14
%178 = fmul double %176, %177
%179 = fdiv double %178, 6.000000e+00
store double %179, double* %19
%180 = load double, double* %19
%181 = load double, double* %15
%182 = load double, double* %15
%183 = fmul double %181, %182
%184 = load double, double* %15
%185 = load double, double* %15
%186 = fneg double %185
%187 = call double @llvm.fmuladd.f64(double %183, double %184, double %186)
%188 = fmul double %180, %187
store double %188, double* %17
%189 = load double, double* %19
%190 = load double, double* %16
%191 = load double, double* %16
%192 = fmul double %190, %191
%193 = load double, double* %16
%194 = load double, double* %16
%195 = fneg double %194
%196 = call double @llvm.fmuladd.f64(double %192, double %193, double %195)
%197 = fmul double %189, %196
store double %197, double* %18
%198 = load double, double* %15
%199 = load double*, double** %3
%200 = load i32, i32* %12
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds double, double* %199, i64 %201
%203 = load double, double* %202
%204 = load double, double* %16
%205 = load double*, double** %3
%206 = load i32, i32* %12
%207 = add nsw i32 %206, 1
%208 = sext i32 %207 to i64
%209 = getelementptr inbounds double, double* %205, i64 %208
%210 = load double, double* %209
%211 = fmul double %204, %210
%212 = call double @llvm.fmuladd.f64(double %198, double %203, double %211)
%213 = load double, double* %17
%214 = load double*, double** %4
%215 = load i32, i32* %12
%216 = sext i32 %215 to i64
%217 = getelementptr inbounds double, double* %214, i64 %216
%218 = load double, double* %217
%219 = call double @llvm.fmuladd.f64(double %213, double %218, double %212)
%220 = load double, double* %18
%221 = load double*, double** %4
%222 = load i32, i32* %12
%223 = add nsw i32 %222, 1
%224 = sext i32 %223 to i64
%225 = getelementptr inbounds double, double* %221, i64 %224
%226 = load double, double* %225
%227 = call double @llvm.fmuladd.f64(double %220, double %226, double %219)
store double %227, double* %8
%228 = load i32, i32* @M_PI
%229 = load double, double* %5
%230 = load double, double* %5
%231 = fmul double %229, %230
%232 = call i32 @sqrt(double %231)
%233 = mul nsw i32 %228, %232
%234 = sitofp i32 %233 to double
%235 = fdiv double %234, 2.000000e+00
store double %235, double* %7
%236 = load double, double* %7
%237 = fcmp une double %236, 0.000000e+00
br i1 %237, label %238, label %243
238: ; preds = %152
%239 = load double, double* %7
%240 = call double @sin(double %239)
%241 = load double, double* %7
%242 = fdiv double %240, %241
br label %244
243: ; preds = %152
br label %244
244: ; preds = %243, %238
%245 = phi double [ %242, %238 ], [ 1.000000e+00, %243 ]
store double %245, double* %9
%246 = load double, double* %7
%247 = load double, double* %8
%248 = load double, double* %9
%249 = call i32 (i8*, double, double, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), double %246, double %247, double %248)
br label %250
250: ; preds = %244
%251 = load i32, i32* %11
%252 = add nsw i32 %251, 1
store i32 %252, i32* %11
br label %109
253: ; preds = %109
%254 = load double*, double** %3
%255 = call i32 @free(double* %254)
%256 = load double*, double** %4
%257 = call i32 @free(double* %256)
%258 = load double*, double** %2
%259 = call i32 @free(double* %258)
store i32 0, i32* %1
br label %260
260: ; preds = %253, %107
%261 = load i32, i32* %1
ret i32 %261
}

LLVM IR (-O2):
@M_PI = global i32 0
@.str = [13 x i8] c"%8.5f %9.6f\0A\00"
@.str.1 = [19 x i8] c"%8.5f %9.6f %9.6f\0A\00"
define i32 @testmain1d() {
%1 = tail call i64 @malloc(i32 96)
%2 = inttoptr i64 %1 to double*
%3 = tail call i64 @malloc(i32 96)
%4 = tail call i64 @malloc(i32 96)
%5 = inttoptr i64 %1 to <2 x double>*
store <2 x double> <double 0.000000e+00, double 1.000000e-01>, <2 x double>* %5
%6 = getelementptr inbounds double, double* %2, i64 2
%7 = bitcast double* %6 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 2.000000e+00>, <2 x double>* %7
%8 = getelementptr inbounds double, double* %2, i64 4
%9 = bitcast double* %8 to <2 x double>*
store <2 x double> <double 3.000000e+00, double 4.000000e+00>, <2 x double>* %9
%10 = getelementptr inbounds double, double* %2, i64 6
%11 = bitcast double* %10 to <2 x double>*
store <2 x double> <double 5.000000e+00, double 6.000000e+00>, <2 x double>* %11
%12 = getelementptr inbounds double, double* %2, i64 8
%13 = bitcast double* %12 to <2 x double>*
store <2 x double> <double 7.000000e+00, double 8.000000e+00>, <2 x double>* %13
%14 = getelementptr inbounds double, double* %2, i64 10
%15 = bitcast double* %14 to <2 x double>*
store <2 x double> <double 9.000000e+00, double 1.000000e+01>, <2 x double>* %15
%16 = inttoptr i64 %3 to double*
br label %17
17: ; preds = %36, %0
%18 = phi double [ 0.000000e+00, %0 ], [ %38, %36 ]
%19 = phi i64 [ 0, %0 ], [ %34, %36 ]
%20 = load i32, i32* @M_PI
%21 = fmul double %18, %18
%22 = tail call i32 @sqrt(double %21)
%23 = mul nsw i32 %22, %20
%24 = sitofp i32 %23 to double
%25 = fmul double %24, 5.000000e-01
%26 = fcmp une double %25, 0.000000e+00
br i1 %26, label %27, label %30
27: ; preds = %17
%28 = tail call double @sin(double %25)
%29 = fdiv double %28, %25
br label %30
30: ; preds = %17, %27
%31 = phi double [ %29, %27 ], [ 1.000000e+00, %17 ]
%32 = getelementptr inbounds double, double* %16, i64 %19
store double %31, double* %32
%33 = tail call i32 (i8*, double, double, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %25, double %31)
%34 = add nuw nsw i64 %19, 1
%35 = icmp eq i64 %34, 12
br i1 %35, label %39, label %36
36: ; preds = %30
%37 = getelementptr inbounds double, double* %2, i64 %34
%38 = load double, double* %37
br label %17
39: ; preds = %30
%40 = inttoptr i64 %4 to double*
%41 = tail call i64 @csp1d(double* %2, double* %16, i32 12, double 1.000000e+30, double 1.000000e+30, double* %40)
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %129
43: ; preds = %39, %120
%44 = phi i32 [ %123, %120 ], [ 0, %39 ]
%45 = phi i32 [ %76, %120 ], [ 0, %39 ]
%46 = sitofp i32 %44 to double
%47 = fdiv double %46, 1.000000e+01
%48 = icmp sgt i32 %45, 0
br i1 %48, label %49, label %61
49: ; preds = %43
%50 = zext i32 %45 to i64
br label %51
51: ; preds = %49, %56
%52 = phi i64 [ %50, %49 ], [ %57, %56 ]
%53 = getelementptr inbounds double, double* %2, i64 %52
%54 = load double, double* %53
%55 = fcmp olt double %47, %54
br i1 %55, label %56, label %59
56: ; preds = %51
%57 = add nsw i64 %52, -1
%58 = icmp sgt i64 %52, 1
br i1 %58, label %51, label %61
59: ; preds = %51
%60 = trunc i64 %52 to i32
br label %61
61: ; preds = %56, %59, %43
%62 = phi i32 [ %45, %43 ], [ %60, %59 ], [ 0, %56 ]
%63 = sext i32 %62 to i64
%64 = call i32 @llvm.smax.i32(i32 %62, i32 10)
br label %65
65: ; preds = %68, %61
%66 = phi i64 [ %69, %68 ], [ %63, %61 ]
%67 = icmp slt i64 %66, 10
br i1 %67, label %68, label %75
68: ; preds = %65
%69 = add nsw i64 %66, 1
%70 = getelementptr inbounds double, double* %2, i64 %69
%71 = load double, double* %70
%72 = fcmp ogt double %47, %71
br i1 %72, label %65, label %73
73: ; preds = %68
%74 = trunc i64 %66 to i32
br label %75
75: ; preds = %65, %73
%76 = phi i32 [ %74, %73 ], [ %64, %65 ]
%77 = add nsw i32 %76, 1
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds double, double* %2, i64 %78
%80 = load double, double* %79
%81 = sext i32 %76 to i64
%82 = getelementptr inbounds double, double* %2, i64 %81
%83 = load double, double* %82
%84 = fsub double %80, %83
%85 = fsub double %47, %83
%86 = fdiv double %85, %84
%87 = fsub double 1.000000e+00, %86
%88 = fmul double %84, %84
%89 = fdiv double %88, 6.000000e+00
%90 = fmul double %87, %87
%91 = fneg double %87
%92 = tail call double @llvm.fmuladd.f64(double %90, double %87, double %91)
%93 = fmul double %89, %92
%94 = fmul double %86, %86
%95 = fneg double %86
%96 = tail call double @llvm.fmuladd.f64(double %94, double %86, double %95)
%97 = fmul double %89, %96
%98 = getelementptr inbounds double, double* %16, i64 %81
%99 = load double, double* %98
%100 = getelementptr inbounds double, double* %16, i64 %78
%101 = load double, double* %100
%102 = fmul double %86, %101
%103 = tail call double @llvm.fmuladd.f64(double %87, double %99, double %102)
%104 = getelementptr inbounds double, double* %40, i64 %81
%105 = load double, double* %104
%106 = tail call double @llvm.fmuladd.f64(double %93, double %105, double %103)
%107 = getelementptr inbounds double, double* %40, i64 %78
%108 = load double, double* %107
%109 = tail call double @llvm.fmuladd.f64(double %97, double %108, double %106)
%110 = load i32, i32* @M_PI
%111 = fmul double %47, %47
%112 = tail call i32 @sqrt(double %111)
%113 = mul nsw i32 %112, %110
%114 = sitofp i32 %113 to double
%115 = fmul double %114, 5.000000e-01
%116 = fcmp une double %115, 0.000000e+00
br i1 %116, label %117, label %120
117: ; preds = %75
%118 = tail call double @sin(double %115)
%119 = fdiv double %118, %115
br label %120
120: ; preds = %75, %117
%121 = phi double [ %119, %117 ], [ 1.000000e+00, %75 ]
%122 = tail call i32 (i8*, double, double, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), double %115, double %109, double %121)
%123 = add nuw nsw i32 %44, 1
%124 = icmp eq i32 %123, 101
br i1 %124, label %125, label %43
125: ; preds = %120
%126 = tail call i32 @free(double* %16)
%127 = tail call i32 @free(double* %40)
%128 = tail call i32 @free(double* %2)
br label %129
129: ; preds = %39, %125
%130 = phi i32 [ 0, %125 ], [ 1, %39 ]
ret i32 %130
}