#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 f(int);
double intervalo_inferior();
double intervalo_superior();
double pol_taylor(int);
int /*<<< orphan*/ printf(char *, double, ...);
int main() {
  printf("f(1) = %f; p(1) = %f;\nf(0) = %f; p(0) = %f\n", f(1), pol_taylor(1),
         f(0), pol_taylor(0));
  printf("intervalo superior menor que 10^-5: %f\n", intervalo_superior());
  printf("intervalo inferior maior que 10^-5: %f\n", intervalo_inferior());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x1,%edi
call   1030 <f@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x1,%edi
call   1050 <pol_taylor@plt>
movsd  %xmm0,-0x18(%rbp)
xor    %edi,%edi
call   1030 <f@plt>
movsd  %xmm0,-0x10(%rbp)
xor    %edi,%edi
call   1050 <pol_taylor@plt>
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x8(%rbp),%xmm0
lea    0xe5e(%rip),%rdi
mov    $0x4,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <intervalo_superior@plt>
lea    0xe75(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <intervalo_inferior@plt>
lea    0xe88(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    $0x1,%edi
call   1030 <f@plt>
movsd  %xmm0,0x10(%rsp)
mov    $0x1,%edi
call   1050 <pol_taylor@plt>
movsd  %xmm0,0x8(%rsp)
xor    %edi,%edi
call   1030 <f@plt>
movsd  %xmm0,(%rsp)
xor    %edi,%edi
call   1050 <pol_taylor@plt>
movaps %xmm0,%xmm3
lea    0xe6f(%rip),%rdi
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm2
mov    $0x4,%al
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <intervalo_superior@plt>
lea    0xe75(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
call   1070 <intervalo_inferior@plt>
lea    0xe88(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [44 x i8] c"f(1) = %f; p(1) = %f;\0Af(0) = %f; p(0) = %f\0A\00"
@.str.1 = [40 x i8] c"intervalo superior menor que 10^-5: %f\0A\00"
@.str.2 = [40 x i8] c"intervalo inferior maior que 10^-5: %f\0A\00"
define i32 @main() {
%1 = call double @f(i32 1)
%2 = call double @pol_taylor(i32 1)
%3 = call double @f(i32 0)
%4 = call double @pol_taylor(i32 0)
%5 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), double %1, double %2, double %3, double %4)
%6 = call double (...) @intervalo_superior()
%7 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), double %6)
%8 = call double (...) @intervalo_inferior()
%9 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), double %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [44 x i8] c"f(1) = %f; p(1) = %f;\0Af(0) = %f; p(0) = %f\0A\00"
@.str.1 = [40 x i8] c"intervalo superior menor que 10^-5: %f\0A\00"
@.str.2 = [40 x i8] c"intervalo inferior maior que 10^-5: %f\0A\00"
define i32 @main() {
%1 = tail call double @f(i32 1)
%2 = tail call double @pol_taylor(i32 1)
%3 = tail call double @f(i32 0)
%4 = tail call double @pol_taylor(i32 0)
%5 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), double %1, double %2, double %3, double %4)
%6 = tail call double (...) @intervalo_superior()
%7 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), double %6)
%8 = tail call double (...) @intervalo_inferior()
%9 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), double %8)
ret i32 0
}