#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 bessel2(int, int);
int /*<<< orphan*/ getch();
int /*<<< orphan*/ printf(char *, int, int, double);
main() {
  int n;
  for (n = 0; n < 5; n++) {
    printf("\nbessel2(%d,%4.2f)=%e", n, (n + 1) * 0.05,
           bessel2(n, (n + 1) * 0.05));
  }
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    11b5 <main+0x85>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  0xe98(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  0xe78(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
call   1040 <bessel2@plt>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x16>
mov    $0x0,%al
call   1050 <getch@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
xor    %esi,%esi
call   1040 <bessel2@plt>
lea    0xebf(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <printf@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <bessel2@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <printf@plt>
mov    $0x2,%edi
xor    %esi,%esi
call   1040 <bessel2@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %edx,%edx
call   1030 <printf@plt>
mov    $0x3,%edi
xor    %esi,%esi
call   1040 <bessel2@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %edx,%edx
call   1030 <printf@plt>
mov    $0x4,%edi
xor    %esi,%esi
call   1040 <bessel2@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %edx,%edx
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <getch@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"\0Abessel2(%d,%4.2f)=%e\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %21, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 5
br i1 %5, label %6, label %24
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
%10 = sitofp i32 %9 to double
%11 = fmul double %10, 5.000000e-02
%12 = fptosi double %11 to i32
%13 = load i32, i32* %2
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
%16 = sitofp i32 %15 to double
%17 = fmul double %16, 5.000000e-02
%18 = fptosi double %17 to i32
%19 = call double @bessel2(i32 %13, i32 %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %12, double %19)
br label %21
21: ; preds = %6
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 1
store i32 %23, i32* %2
br label %3
24: ; preds = %3
%25 = call i32 (...) @getch()
%26 = load i32, i32* %1
ret i32 %26
}

LLVM IR (-O2):
@.str = [22 x i8] c"\0Abessel2(%d,%4.2f)=%e\00"
define i32 @main() {
%1 = tail call double @bessel2(i32 0, i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, double %1)
%3 = tail call double @bessel2(i32 1, i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 1, i32 0, double %3)
%5 = tail call double @bessel2(i32 2, i32 0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 2, i32 0, double %5)
%7 = tail call double @bessel2(i32 3, i32 0)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 3, i32 0, double %7)
%9 = tail call double @bessel2(i32 4, i32 0)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 4, i32 0, double %9)
%11 = tail call i32 (...) @getch()
ret i32 0
}