#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 */
scalar_t__ abs(double);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
double function(double *, int, int, double);
double pow(double, int);
int /*<<< orphan*/ scanf(char *, long *);
int /*<<< orphan*/ stdout;
void integ_rect(double *param, int dimension, int functiontype,
                double *integ_first, double *integ_second, double *errorinteg,
                int conv, double extr_a, double extr_b) {
  int i;
  long int n;
  double base;
  fprintf(stdout, "Input The Number Of Intervals : ");
  scanf("%li", &n);
  double X[n];
  double Y[n];
  base = (extr_b - extr_a) / n;
  if (extr_b > extr_a) {
    X[0] = extr_a;
  }
  if (extr_b < extr_a) {
    X[0] = extr_b;
  }
  Y[0] = function(param, dimension, functiontype, X[0]);
  *integ_first = base * (Y[0]);
  *integ_second = 0;
  for (i = 1; i <= n; i++) {
    X[i] = X[i - 1] + base;
    Y[i] = function(param, dimension, functiontype, X[i]);
    if (i != n) {
      *integ_first += base * Y[i];
    }
    *integ_second += base * Y[i];
    fprintf(stdout, " [*] %i : integ_first = %lf\n", i, *integ_first);
    fprintf(stdout, "          integ_second = %lf\n", *integ_second);
  }
  if (conv >= 5) {
    int diff;
    diff = (int)(abs(extr_b - extr_a)) * 10000;
    double x[diff];
    double y[diff];
    double M;
    if (extr_a > extr_b) {
      x[0] = extr_a;
    }
    if (extr_b > extr_a) {
      x[0] = extr_b;
    }
    y[0] = function(param, dimension, functiontype, x[0]);
    M = y[0];
    for (i = 1; i <= diff; i++) {
      x[i] = x[i - 1] + 0.0001;
      y[i] = function(param, dimension, functiontype, x[i]);
      if (y[i] > M) {
        M = y[i];
      }
    }
    *errorinteg = ((pow((extr_b - extr_a), 2)) * M) / (2 * n);
  } else {
    *errorinteg = (integ_second - integ_first) / 2;
  }
}


x86 assembly (clang, -O0):
<integ_rect>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movsd  %xmm0,-0x30(%rbp)
movsd  %xmm1,-0x38(%rbp)
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
lea    0xe7a(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xe8d(%rip),%rdi
lea    -0x48(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x48(%rbp),%rax
mov    %rsp,%rcx
mov    %rcx,-0x58(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xa0(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x60(%rbp)
mov    -0x48(%rbp),%rax
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x98(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x68(%rbp)
movsd  -0x38(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
cvtsi2sdq -0x48(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm0
ucomisd -0x30(%rbp),%xmm0
jbe    122d <integ_rect+0xdd>
mov    -0xa0(%rbp),%rax
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,(%rax)
movsd  -0x38(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1251 <integ_rect+0x101>
mov    -0xa0(%rbp),%rax
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,(%rax)
mov    -0xa0(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movsd  (%rax),%xmm0
call   1060 <function@plt>
mov    -0x98(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x50(%rbp),%xmm0
mulsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movl   $0x1,-0x3c(%rbp)
movslq -0x3c(%rbp),%rax
cmp    -0x48(%rbp),%rax
jg     13a1 <integ_rect+0x251>
mov    -0xa0(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x50(%rbp),%xmm0
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1060 <function@plt>
mov    -0x98(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movslq -0x3c(%rbp),%rax
cmp    -0x48(%rbp),%rax
je     1329 <integ_rect+0x1d9>
mov    -0x98(%rbp),%rax
movsd  -0x50(%rbp),%xmm0
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    -0x98(%rbp),%rax
movsd  -0x50(%rbp),%xmm0
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    0x2c87(%rip),%rax
mov    (%rax),%edi
mov    -0x3c(%rbp),%edx
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xcc0(%rip),%rsi
mov    $0x1,%al
call   1040 <fprintf@plt>
mov    0x2c65(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xcbe(%rip),%rsi
mov    $0x1,%al
call   1040 <fprintf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1299 <integ_rect+0x149>
cmpl   $0x5,0x10(%rbp)
jl     156c <integ_rect+0x41c>
movsd  -0x38(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
subsd  %xmm1,%xmm0
call   1030 <abs@plt>
imul   $0x2710,%eax,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x78(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xb0(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x80(%rbp)
mov    -0x6c(%rbp),%eax
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xa8(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x88(%rbp)
movsd  -0x30(%rbp),%xmm0
ucomisd -0x38(%rbp),%xmm0
jbe    1437 <integ_rect+0x2e7>
mov    -0xb0(%rbp),%rax
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,(%rax)
movsd  -0x38(%rbp),%xmm0
ucomisd -0x30(%rbp),%xmm0
jbe    1457 <integ_rect+0x307>
mov    -0xb0(%rbp),%rax
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,(%rax)
mov    -0xb0(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movsd  (%rax),%xmm0
call   1060 <function@plt>
mov    -0xa8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  (%rax),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x6c(%rbp),%eax
jg     152b <integ_rect+0x3db>
mov    -0xb0(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xb4d(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1060 <function@plt>
mov    -0xa8(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd -0x90(%rbp),%xmm0
ff
jbe    1518 <integ_rect+0x3c8>
mov    -0xa8(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
jmp    151d <integ_rect+0x3cd>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    148f <integ_rect+0x33f>
movsd  -0x38(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
mov    $0x2,%edi
call   1070 <pow@plt>
mulsd  -0x90(%rbp),%xmm0
ff
mov    -0x48(%rbp),%rax
shl    $0x1,%rax
cvtsi2sd %rax,%xmm1
divsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x78(%rbp),%rax
mov    %rax,%rsp
jmp    1592 <integ_rect+0x442>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
sar    $0x3,%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cvtsi2sd %rax,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x58(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<integ_rect>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x38(%rsp)
mov    %r9,0x30(%rsp)
mov    %r8,%r14
mov    %rcx,%rbx
mov    %edx,%r15d
mov    %esi,%r13d
mov    %rdi,%rbp
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
lea    0xe7a(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xe8d(%rip),%rdi
lea    0x18(%rsp),%rsi
call   1050 <scanf@plt>
mov    %rsp,0x50(%rsp)
movsd  0x10(%rsp),%xmm2
movapd %xmm2,%xmm1
movsd  0x38(%rsp),%xmm3
subsd  %xmm3,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sdq 0x18(%rsp),%xmm0
movsd  %xmm1,0x28(%rsp)
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movapd %xmm2,%xmm0
minsd  %xmm3,%xmm0
mov    %rbp,%rdi
mov    %r13d,%esi
mov    %r15d,%edx
movsd  %xmm0,0x48(%rsp)
call   1060 <function@plt>
movsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm0
mov    %rbx,0x20(%rsp)
movsd  %xmm0,(%rbx)
mov    %r14,0x40(%rsp)
movq   $0x0,(%r14)
cmpq   $0x0,0x18(%rsp)
jle    12e9 <integ_rect+0x199>
mov    $0x1,%r14d
jmp    1297 <integ_rect+0x147>
nopl   0x0(%rax,%rax,1)
mulsd  %xmm2,%xmm0
mov    0x40(%rsp),%rbp
addsd  0x0(%rbp),%xmm0
movsd  %xmm0,0x0(%rbp)
mov    0x2d96(%rip),%r15
mov    (%r15),%edi
mov    0x20(%rsp),%rax
movsd  (%rax),%xmm0
lea    0xdd0(%rip),%rsi
mov    %r14d,%edx
mov    $0x1,%al
call   1040 <fprintf@plt>
mov    (%r15),%edi
movsd  0x0(%rbp),%xmm0
lea    0xdd4(%rip),%rsi
mov    $0x1,%al
call   1040 <fprintf@plt>
movsd  0x8(%rsp),%xmm1
add    $0x1,%r14
cmp    %r14,0x18(%rsp)
mov    %r13d,%r15d
mov    %r12d,%r13d
mov    %rbx,%rbp
jl     12e9 <integ_rect+0x199>
movsd  0x48(%rsp),%xmm0
addsd  %xmm1,%xmm0
mov    %rbp,%rbx
mov    %rbp,%rdi
mov    %r13d,%r12d
mov    %r13d,%esi
mov    %r15d,%r13d
mov    %r15d,%edx
movsd  %xmm0,0x48(%rsp)
call   1060 <function@plt>
movsd  0x8(%rsp),%xmm2
cmp    0x18(%rsp),%r14
je     1230 <integ_rect+0xe0>
movapd %xmm2,%xmm1
mulsd  %xmm0,%xmm1
mov    0x20(%rsp),%rax
addsd  (%rax),%xmm1
movsd  %xmm1,(%rax)
jmp    1230 <integ_rect+0xe0>
cmpl   $0x5,0x90(%rsp)
05
jl     1392 <integ_rect+0x242>
movsd  0x28(%rsp),%xmm0
call   1030 <abs@plt>
mov    %rax,%rbx
mov    %rsp,%r14
movsd  0x10(%rsp),%xmm0
maxsd  0x38(%rsp),%xmm0
mov    %rbp,%rdi
mov    %r13d,%esi
mov    %r15d,%edx
movsd  %xmm0,0x10(%rsp)
call   1060 <function@plt>
test   %ebx,%ebx
jle    13c0 <integ_rect+0x270>
imul   $0x2710,%ebx,%eax
cmp    $0x2,%eax
mov    $0x1,%ebx
cmovge %eax,%ebx
movsd  0x10(%rsp),%xmm1
nopw   0x0(%rax,%rax,1)
movsd  %xmm0,0x8(%rsp)
addsd  0xca2(%rip),%xmm1
movsd  %xmm1,0x10(%rsp)
mov    %rbp,%rdi
mov    %r13d,%esi
mov    %r15d,%edx
movapd %xmm1,%xmm0
call   1060 <function@plt>
movsd  0x10(%rsp),%xmm1
movapd %xmm0,%xmm2
maxsd  0x8(%rsp),%xmm2
movapd %xmm2,%xmm0
add    $0xffffffffffffffff,%rbx
jne    1350 <integ_rect+0x200>
jmp    13c4 <integ_rect+0x274>
mov    0x40(%rsp),%rcx
sub    0x20(%rsp),%rcx
mov    %rcx,%rax
sar    $0x3,%rax
shr    $0x3f,%rcx
add    %rax,%rcx
sar    %rcx
xorps  %xmm0,%xmm0
cvtsi2sd %rcx,%xmm0
mov    0x30(%rsp),%rax
movsd  %xmm0,(%rax)
jmp    1400 <integ_rect+0x2b0>
movapd %xmm0,%xmm2
movsd  %xmm2,0x8(%rsp)
movsd  0x28(%rsp),%xmm0
mov    $0x2,%edi
call   1070 <pow@plt>
mulsd  0x8(%rsp),%xmm0
mov    0x18(%rsp),%rax
add    %rax,%rax
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
divsd  %xmm1,%xmm0
mov    0x30(%rsp),%rax
movsd  %xmm0,(%rax)
mov    %r14,%rsp
mov    0x50(%rsp),%rsp
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [33 x i8] c"Input The Number Of Intervals : \00"
@.str.1 = [4 x i8] c"%li\00"
@.str.2 = [29 x i8] c" [*] %i : integ_first = %lf\0A\00"
@.str.3 = [30 x i8] c" integ_second = %lf\0A\00"
define void @integ_rect(double* %0, i32 %1, i32 %2, double* %3, double* %4, double* nocapture writeonly %5, i32 %6, double %7, double %8) {
%10 = alloca i64
%11 = bitcast i64* %10 to i8*
%12 = load i32, i32* @stdout
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %10)
%15 = call i8* @llvm.stacksave()
%16 = load i64, i64* %10
%17 = fsub double %8, %7
%18 = sitofp i64 %16 to double
%19 = fdiv double %17, %18
%20 = fcmp ogt double %8, %7
%21 = fcmp olt double %8, %7
%22 = select i1 %21, double %8, double %7
%23 = call double @function(double* %0, i32 %1, i32 %2, double %22)
%24 = fmul double %19, %23
store double %24, double* %3
store double 0.000000e+00, double* %4
%25 = load i64, i64* %10
%26 = icmp slt i64 %25, 1
br i1 %26, label %50, label %27
27: ; preds = %9, %37
%28 = phi double [ %30, %37 ], [ %22, %9 ]
%29 = phi i64 [ %47, %37 ], [ 1, %9 ]
%30 = fadd double %19, %28
%31 = call double @function(double* %0, i32 %1, i32 %2, double %30)
%32 = load i64, i64* %10
%33 = icmp eq i64 %32, %29
br i1 %33, label %37, label %34
34: ; preds = %27
%35 = load double, double* %3
%36 = call double @llvm.fmuladd.f64(double %19, double %31, double %35)
store double %36, double* %3
br label %37
37: ; preds = %34, %27
%38 = load double, double* %4
%39 = call double @llvm.fmuladd.f64(double %19, double %31, double %38)
store double %39, double* %4
%40 = load i32, i32* @stdout
%41 = load double, double* %3
%42 = trunc i64 %29 to i32
%43 = call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %42, double %41)
%44 = load i32, i32* @stdout
%45 = load double, double* %4
%46 = call i32 (i32, i8*, ...) @fprintf(i32 %44, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), double %45)
%47 = add nuw i64 %29, 1
%48 = load i64, i64* %10
%49 = icmp slt i64 %48, %47
br i1 %49, label %50, label %27
50: ; preds = %37, %9
%51 = icmp sgt i32 %6, 4
br i1 %51, label %52, label %82
52: ; preds = %50
%53 = call i64 @abs(double %17)
%54 = trunc i64 %53 to i32
%55 = call i8* @llvm.stacksave()
%56 = select i1 %20, double %8, double %7
%57 = call double @function(double* %0, i32 %1, i32 %2, double %56)
%58 = icmp slt i32 %54, 1
br i1 %58, label %74, label %59
59: ; preds = %52
%60 = mul i32 %54, 10000
%61 = call i32 @llvm.smax.i32(i32 %60, i32 1)
%62 = add nuw nsw i32 %61, 1
%63 = zext i32 %62 to i64
br label %64
64: ; preds = %59, %64
%65 = phi double [ %56, %59 ], [ %68, %64 ]
%66 = phi i64 [ 1, %59 ], [ %72, %64 ]
%67 = phi double [ %57, %59 ], [ %71, %64 ]
%68 = fadd double %65, 1.000000e-04
%69 = call double @function(double* %0, i32 %1, i32 %2, double %68)
%70 = fcmp ogt double %69, %67
%71 = select i1 %70, double %69, double %67
%72 = add nuw nsw i64 %66, 1
%73 = icmp eq i64 %72, %63
br i1 %73, label %74, label %64
74: ; preds = %64, %52
%75 = phi double [ %57, %52 ], [ %71, %64 ]
%76 = call double @pow(double %17, i32 2)
%77 = fmul double %75, %76
%78 = load i64, i64* %10
%79 = shl nsw i64 %78, 1
%80 = sitofp i64 %79 to double
%81 = fdiv double %77, %80
store double %81, double* %5
br label %89
82: ; preds = %50
%83 = ptrtoint double* %4 to i64
%84 = ptrtoint double* %3 to i64
%85 = sub i64 %83, %84
%86 = ashr exact i64 %85, 3
%87 = sdiv i64 %86, 2
%88 = sitofp i64 %87 to double
store double %88, double* %5
br label %89
89: ; preds = %82, %74
ret void
}