#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 */
long double pow(long double, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, long double *);
int main(int argc, char const *argv[]) {
  long double dx = 0.000000001, x = 0, a, b, integral = 0;
  printf("Digite o inicio do intervalo: ");
  scanf(" %Lf", &a);
  printf("Digite o final do intervalo: ");
  scanf(" %Lf", &b);
  x = a;
  while (x <= b) {
    x += dx;
    integral += dx * 2 * pow(x, 3);
  }
  printf("int: %Lf\n", integral);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
fldl   0xeb1(%rip)
fstpt  -0x20(%rbp)
fldz
fld    %st(0)
fstpt  -0x30(%rbp)
fstpt  -0x60(%rbp)
lea    0xea5(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x69(%rbp)
call   1030 <printf@plt>
lea    0xeb3(%rip),%rdi
mov    %rdi,-0x68(%rbp)
lea    -0x40(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x69(%rbp),%al
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x68(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1040 <scanf@plt>
fldt   -0x40(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
fldt   -0x50(%rbp)
fucomip %st(1),%st
fstp   %st(0)
jb     11f1 <main+0xc1>
jmp    11b8 <main+0x88>
fldt   -0x20(%rbp)
fldt   -0x30(%rbp)
faddp  %st,%st(1)
fstpt  -0x30(%rbp)
fldt   -0x20(%rbp)
fadd   %st,%st(0)
fstpt  -0x74(%rbp)
fldt   -0x30(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
mov    $0x3,%edi
call   1050 <pow@plt>
fldt   -0x74(%rbp)
fldt   -0x60(%rbp)
fxch   %st(1)
fmulp  %st,%st(2)
faddp  %st,%st(1)
fstpt  -0x60(%rbp)
jmp    11a3 <main+0x73>
fldt   -0x60(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
lea    0xe4a(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee5(%rip),%rbx
lea    0x40(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x30(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
fldt   0x40(%rsp)
fldt   0x30(%rsp)
fldz
fxch   %st(1)
fucomip %st(2),%st
jb     11c9 <main+0x99>
fstp   %st(0)
fldz
cs nopw 0x0(%rax,%rax,1)
fstpt  0x24(%rsp)
faddl  0xe66(%rip)
fld    %st(0)
fstpt  0x18(%rsp)
fstpt  (%rsp)
mov    $0x3,%edi
call   1050 <pow@plt>
fldt   0x18(%rsp)
fldt   0x24(%rsp)
fxch   %st(2)
fmull  0xe4b(%rip)
faddp  %st,%st(2)
fldt   0x30(%rsp)
fucomip %st(1),%st
fxch   %st(1)
jae    1190 <main+0x60>
fstp   %st(1)
fstpt  (%rsp)
lea    0xe7d(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Digite o inicio do intervalo: \00"
@.str.1 = [5 x i8] c" %Lf\00"
@.str.2 = [30 x i8] c"Digite o final do intervalo: \00"
@.str.3 = [10 x i8] c"int: %Lf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca x86_fp80
%7 = alloca x86_fp80
%8 = alloca x86_fp80
%9 = alloca x86_fp80
%10 = alloca x86_fp80
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store x86_fp80 0xK3FE189705F4136B4A800, x86_fp80* %6
store x86_fp80 0xK00000000000000000000, x86_fp80* %7
store x86_fp80 0xK00000000000000000000, x86_fp80* %10
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), x86_fp80* %8)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), x86_fp80* %9)
%15 = load x86_fp80, x86_fp80* %8
store x86_fp80 %15, x86_fp80* %7
br label %16
16: ; preds = %20, %2
%17 = load x86_fp80, x86_fp80* %7
%18 = load x86_fp80, x86_fp80* %9
%19 = fcmp ole x86_fp80 %17, %18
br i1 %19, label %20, label %30
20: ; preds = %16
%21 = load x86_fp80, x86_fp80* %6
%22 = load x86_fp80, x86_fp80* %7
%23 = fadd x86_fp80 %22, %21
store x86_fp80 %23, x86_fp80* %7
%24 = load x86_fp80, x86_fp80* %6
%25 = fmul x86_fp80 %24, 0xK40008000000000000000
%26 = load x86_fp80, x86_fp80* %7
%27 = call x86_fp80 @pow(x86_fp80 %26, i32 3)
%28 = load x86_fp80, x86_fp80* %10
%29 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %25, x86_fp80 %27, x86_fp80 %28)
store x86_fp80 %29, x86_fp80* %10
br label %16
30: ; preds = %16
%31 = load x86_fp80, x86_fp80* %10
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), x86_fp80 %31)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"Digite o inicio do intervalo: \00"
@.str.1 = [5 x i8] c" %Lf\00"
@.str.2 = [30 x i8] c"Digite o final do intervalo: \00"
@.str.3 = [10 x i8] c"int: %Lf\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
%5 = bitcast x86_fp80* %3 to i8*
%6 = bitcast x86_fp80* %4 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), x86_fp80* %3)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), x86_fp80* %4)
%11 = load x86_fp80, x86_fp80* %3
%12 = load x86_fp80, x86_fp80* %4
%13 = fcmp ugt x86_fp80 %11, %12
br i1 %13, label %22, label %14
14: ; preds = %2, %14
%15 = phi x86_fp80 [ %19, %14 ], [ 0xK00000000000000000000, %2 ]
%16 = phi x86_fp80 [ %17, %14 ], [ %11, %2 ]
%17 = fadd x86_fp80 %16, 0xK3FE189705F4136B4A800
%18 = call x86_fp80 @pow(x86_fp80 %17, i32 3)
%19 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %18, x86_fp80 0xK3FE289705F4136B4A800, x86_fp80 %15)
%20 = load x86_fp80, x86_fp80* %4
%21 = fcmp ugt x86_fp80 %17, %20
br i1 %21, label %22, label %14
22: ; preds = %14, %2
%23 = phi x86_fp80 [ 0xK00000000000000000000, %2 ], [ %19, %14 ]
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), x86_fp80 %23)
ret i32 0
}