#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 cos(double);
int /*<<< orphan*/ radialRecurrence(double, double *, int);
double sin(double);
void sphNeumann(double x, double *y, int n) {
  if (y == 0)
    return;
  if (n >= 0)
    y[0] = -cos(x) / x;
  if (n >= 1)
    y[1] = ((x < 1e-10) ? 1.0 : sin(x) / x) - y[0] / x;
  radialRecurrence(x, y, n);
}


x86 assembly (clang, -O0):
<sphNeumann>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <sphNeumann+0x24>
jmp    11ff <sphNeumann+0xcf>
cmpl   $0x0,-0x14(%rbp)
jl     118c <sphNeumann+0x5c>
movsd  -0x8(%rbp),%xmm0
call   1050 <cos@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
cmpl   $0x1,-0x14(%rbp)
jl     11ee <sphNeumann+0xbe>
movsd  0xe62(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    11bb <sphNeumann+0x8b>
movsd  0xe57(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11cf <sphNeumann+0x9f>
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
divsd  -0x8(%rbp),%xmm1
subsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <radialRecurrence@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sphNeumann>:
test   %rdi,%rdi
je     1184 <sphNeumann+0x54>
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
movapd %xmm0,%xmm2
test   %esi,%esi
js     11ac <sphNeumann+0x7c>
movapd %xmm2,%xmm0
movsd  %xmm2,(%rsp)
call   1050 <cos@plt>
movsd  (%rsp),%xmm2
xorpd  0xea0(%rip),%xmm0
divsd  %xmm2,%xmm0
movsd  %xmm0,(%rbx)
test   %ebp,%ebp
je     11ac <sphNeumann+0x7c>
movsd  0xea4(%rip),%xmm1
ucomisd %xmm2,%xmm1
jbe    1185 <sphNeumann+0x55>
movsd  0xe8e(%rip),%xmm1
jmp    119f <sphNeumann+0x6f>
ret
movapd %xmm2,%xmm0
call   1030 <sin@plt>
movsd  (%rsp),%xmm2
movapd %xmm0,%xmm1
divsd  %xmm2,%xmm1
movsd  (%rbx),%xmm0
divsd  %xmm2,%xmm0
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rbx)
movapd %xmm2,%xmm0
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <radialRecurrence@plt>

LLVM IR (-O0):
define void @sphNeumann(double %0, double* %1, i32 %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca i32
store double %0, double* %4
store double* %1, double** %5
store i32 %2, i32* %6
%7 = load double*, double** %5
%8 = icmp eq double* %7, null
br i1 %8, label %9, label %10
9: ; preds = %3
br label %48
10: ; preds = %3
%11 = load i32, i32* %6
%12 = icmp sge i32 %11, 0
br i1 %12, label %13, label %21
13: ; preds = %10
%14 = load double, double* %4
%15 = call double @cos(double %14)
%16 = fneg double %15
%17 = load double, double* %4
%18 = fdiv double %16, %17
%19 = load double*, double** %5
%20 = getelementptr inbounds double, double* %19, i64 0
store double %18, double* %20
br label %21
21: ; preds = %13, %10
%22 = load i32, i32* %6
%23 = icmp sge i32 %22, 1
br i1 %23, label %24, label %43
24: ; preds = %21
%25 = load double, double* %4
%26 = fcmp olt double %25, 1.000000e-10
br i1 %26, label %27, label %28
27: ; preds = %24
br label %33
28: ; preds = %24
%29 = load double, double* %4
%30 = call double @sin(double %29)
%31 = load double, double* %4
%32 = fdiv double %30, %31
br label %33
33: ; preds = %28, %27
%34 = phi double [ 1.000000e+00, %27 ], [ %32, %28 ]
%35 = load double*, double** %5
%36 = getelementptr inbounds double, double* %35, i64 0
%37 = load double, double* %36
%38 = load double, double* %4
%39 = fdiv double %37, %38
%40 = fsub double %34, %39
%41 = load double*, double** %5
%42 = getelementptr inbounds double, double* %41, i64 1
store double %40, double* %42
br label %43
43: ; preds = %33, %21
%44 = load double, double* %4
%45 = load double*, double** %5
%46 = load i32, i32* %6
%47 = call i32 @radialRecurrence(double %44, double* %45, i32 %46)
br label %48
48: ; preds = %43, %9
ret void
}

LLVM IR (-O2):
define void @sphNeumann(double %0, double* %1, i32 %2) {
%4 = icmp eq double* %1, null
br i1 %4, label %26, label %5
5: ; preds = %3
%6 = icmp sgt i32 %2, -1
br i1 %6, label %7, label %24
7: ; preds = %5
%8 = tail call double @cos(double %0)
%9 = fneg double %8
%10 = fdiv double %9, %0
store double %10, double* %1
%11 = icmp eq i32 %2, 0
br i1 %11, label %24, label %12
12: ; preds = %7
%13 = fcmp olt double %0, 1.000000e-10
br i1 %13, label %18, label %14
14: ; preds = %12
%15 = tail call double @sin(double %0)
%16 = fdiv double %15, %0
%17 = load double, double* %1
br label %18
18: ; preds = %12, %14
%19 = phi double [ %17, %14 ], [ %10, %12 ]
%20 = phi double [ %16, %14 ], [ 1.000000e+00, %12 ]
%21 = fdiv double %19, %0
%22 = fsub double %20, %21
%23 = getelementptr inbounds double, double* %1, i64 1
store double %22, double* %23
br label %24
24: ; preds = %5, %18, %7
%25 = tail call i32 @radialRecurrence(double %0, double* %1, i32 %2)
br label %26
26: ; preds = %3, %24
ret void
}