#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 /*<<< orphan*/ integral_gen(int, int, double *);
int /*<<< orphan*/ integral_recur(int, int, double *);
int /*<<< orphan*/ printf(char *, int, double, double);
int main(void) {
  double vals1[100 + 1], vals2[100 + 1];
  int nmin = 10;
  int nmax = 100;
  int i;
  integral_recur(nmin, nmax, vals1);
  integral_gen(nmin, nmax, vals2);
  for (i = nmin; i <= nmax; i++) {
    printf("%5d      %24.6f   %24.6f\n", i, vals1[i], vals2[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x670,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x664(%rbp)
movl   $0x64,-0x668(%rbp)
mov    -0x664(%rbp),%edi
mov    -0x668(%rbp),%esi
lea    -0x330(%rbp),%rdx
call   1040 <integral_recur@plt>
mov    -0x664(%rbp),%edi
mov    -0x668(%rbp),%esi
lea    -0x660(%rbp),%rdx
call   1050 <integral_gen@plt>
mov    -0x664(%rbp),%eax
mov    %eax,-0x66c(%rbp)
mov    -0x66c(%rbp),%eax
cmp    -0x668(%rbp),%eax
jg     11ea <main+0xba>
mov    -0x66c(%rbp),%esi
movslq -0x66c(%rbp),%rax
movsd  -0x330(%rbp,%rax,8),%xmm0
ff ff
movslq -0x66c(%rbp),%rax
movsd  -0x660(%rbp,%rax,8),%xmm1
ff ff
lea    0xe2f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x66c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x66c(%rbp)
jmp    1192 <main+0x62>
xor    %eax,%eax
add    $0x670,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x658,%rsp
lea    0x330(%rsp),%rdx
mov    $0xa,%edi
mov    $0x64,%esi
call   1040 <integral_recur@plt>
mov    %rsp,%rdx
mov    $0xa,%edi
mov    $0x64,%esi
call   1050 <integral_gen@plt>
mov    $0xa,%ebx
lea    0xe91(%rip),%r14
nop
movsd  0x330(%rsp,%rbx,8),%xmm0
movsd  (%rsp,%rbx,8),%xmm1
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    $0x65,%rbx
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x658,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [26 x i8] c"%5d %24.6f %24.6f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [101 x double]
%3 = alloca [101 x double]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %4
store i32 100, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = getelementptr inbounds [101 x double], [101 x double]* %2, i64 0, i64 0
%10 = call i32 @integral_recur(i32 %7, i32 %8, double* %9)
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = getelementptr inbounds [101 x double], [101 x double]* %3, i64 0, i64 0
%14 = call i32 @integral_gen(i32 %11, i32 %12, double* %13)
%15 = load i32, i32* %4
store i32 %15, i32* %6
br label %16
16: ; preds = %31, %0
%17 = load i32, i32* %6
%18 = load i32, i32* %5
%19 = icmp sle i32 %17, %18
br i1 %19, label %20, label %34
20: ; preds = %16
%21 = load i32, i32* %6
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [101 x double], [101 x double]* %2, i64 0, i64 %23
%25 = load double, double* %24
%26 = load i32, i32* %6
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [101 x double], [101 x double]* %3, i64 0, i64 %27
%29 = load double, double* %28
%30 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %21, double %25, double %29)
br label %31
31: ; preds = %20
%32 = load i32, i32* %6
%33 = add nsw i32 %32, 1
store i32 %33, i32* %6
br label %16
34: ; preds = %16
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"%5d %24.6f %24.6f\0A\00"
define i32 @main() {
%1 = alloca [101 x double]
%2 = alloca [101 x double]
%3 = bitcast [101 x double]* %1 to i8*
%4 = bitcast [101 x double]* %2 to i8*
%5 = getelementptr inbounds [101 x double], [101 x double]* %1, i64 0, i64 0
%6 = call i32 @integral_recur(i32 10, i32 100, double* %5)
%7 = getelementptr inbounds [101 x double], [101 x double]* %2, i64 0, i64 0
%8 = call i32 @integral_gen(i32 10, i32 100, double* %7)
br label %9
9: ; preds = %0, %9
%10 = phi i64 [ 10, %0 ], [ %17, %9 ]
%11 = getelementptr inbounds [101 x double], [101 x double]* %1, i64 0, i64 %10
%12 = load double, double* %11
%13 = getelementptr inbounds [101 x double], [101 x double]* %2, i64 0, i64 %10
%14 = load double, double* %13
%15 = trunc i64 %10 to i32
%16 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %15, double %12, double %14)
%17 = add nuw nsw i64 %10, 1
%18 = icmp eq i64 %17, 101
br i1 %18, label %19, label %9
19: ; preds = %9
ret i32 0
}