#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 ellipseintegral2(double, double);
int /*<<< orphan*/ getch();
int /*<<< orphan*/ printf(char *, double, double);
main() {
  int n;
  for (n = 1; n < 6; n++) {
    printf("\nellipseintegral2(0.5,%3.1f)=%5.2f", 3.1415926 * n / 6,
           ellipseintegral2(0.5, 3.1415926 * n / 6));
  }
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    11be <main+0x8e>
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xeb3(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe9f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xe91(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xe7d(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xe69(%rip),%xmm0
call   1040 <ellipseintegral2@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
lea    0xe6d(%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
movsd  0xec7(%rip),%xmm0
movsd  0xec7(%rip),%xmm1
call   1040 <ellipseintegral2@plt>
movaps %xmm0,%xmm1
lea    0xee0(%rip),%rbx
mov    %rbx,%rdi
movsd  0xead(%rip),%xmm0
call   1030 <printf@plt>
movsd  0xea8(%rip),%xmm1
movsd  0xe90(%rip),%xmm0
call   1040 <ellipseintegral2@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movsd  0xe8d(%rip),%xmm0
call   1030 <printf@plt>
movsd  0xe88(%rip),%xmm1
movsd  0xe68(%rip),%xmm0
call   1040 <ellipseintegral2@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movsd  0xe6d(%rip),%xmm0
call   1030 <printf@plt>
movsd  0xe68(%rip),%xmm1
movsd  0xe40(%rip),%xmm0
call   1040 <ellipseintegral2@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movsd  0xe4d(%rip),%xmm0
call   1030 <printf@plt>
movsd  0xe48(%rip),%xmm1
movsd  0xe18(%rip),%xmm0
call   1040 <ellipseintegral2@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movsd  0xe2d(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <getch@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"\0Aellipseintegral2(0.5,%3.1f)=%5.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %17, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 6
br i1 %5, label %6, label %20
6: ; preds = %3
%7 = load i32, i32* %2
%8 = sitofp i32 %7 to double
%9 = fmul double 0x400921FB4D12D84A, %8
%10 = fdiv double %9, 6.000000e+00
%11 = load i32, i32* %2
%12 = sitofp i32 %11 to double
%13 = fmul double 0x400921FB4D12D84A, %12
%14 = fdiv double %13, 6.000000e+00
%15 = call double @ellipseintegral2(double 5.000000e-01, double %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), double %10, double %15)
br label %17
17: ; preds = %6
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
br label %3
20: ; preds = %3
%21 = call i32 (...) @getch()
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
@.str = [35 x i8] c"\0Aellipseintegral2(0.5,%3.1f)=%5.2f\00"
define i32 @main() {
%1 = tail call double @ellipseintegral2(double 5.000000e-01, double 0x3FE0C1523361E587)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), double 0x3FE0C1523361E587, double %1)
%3 = tail call double @ellipseintegral2(double 5.000000e-01, double 0x3FF0C1523361E587)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), double 0x3FF0C1523361E587, double %3)
%5 = tail call double @ellipseintegral2(double 5.000000e-01, double 0x3FF921FB4D12D84B)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), double 0x3FF921FB4D12D84B, double %5)
%7 = tail call double @ellipseintegral2(double 5.000000e-01, double 0x4000C1523361E587)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), double 0x4000C1523361E587, double %7)
%9 = tail call double @ellipseintegral2(double 5.000000e-01, double 0x4004F1A6C03A5EE8)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), double 0x4004F1A6C03A5EE8, double %9)
%11 = tail call i32 (...) @getch()
ret i32 0
}