#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*/ bisect(double, double, double, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int iter;
  double a, b, err;
  printf("Introduzca puntoA\n");
  scanf("%lf", &a);
  printf("Introduzca puntoB\n");
  scanf("%lf", &b);
  printf("Introduzca error\n");
  scanf("%lf", &err);
  printf("Introduzca iteraciones\n");
  scanf("%d", &iter);
  printf("%lf", bisect(a, b, err, iter));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea6(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe86(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
mov    -0x4(%rbp),%edi
call   1050 <bisect@plt>
mov    %eax,%esi
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
lea    0xea8(%rip),%rbx
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xea2(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xe98(%rip),%rdi
call   1030 <puts@plt>
lea    0xe54(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
mov    0x4(%rsp),%edi
call   1060 <bisect@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Introduzca puntoA\0A\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [19 x i8] c"Introduzca puntoB\0A\00"
@.str.3 = [18 x i8] c"Introduzca error\0A\00"
@.str.4 = [24 x i8] c"Introduzca iteraciones\0A\00"
@.str.5 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %3)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %4)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %1)
%13 = load double, double* %2
%14 = load double, double* %3
%15 = load double, double* %4
%16 = load i32, i32* %1
%17 = call i32 @bisect(double %13, double %14, double %15, i32 %16)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%lf\00"
@.str.5 = [3 x i8] c"%d\00"
@str = [18 x i8] c"Introduzca puntoA\00"
@str.6 = [18 x i8] c"Introduzca puntoB\00"
@str.7 = [17 x i8] c"Introduzca error\00"
@str.8 = [23 x i8] c"Introduzca iteraciones\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = bitcast i32* %1 to i8*
%6 = bitcast double* %2 to i8*
%7 = bitcast double* %3 to i8*
%8 = bitcast double* %4 to i8*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.6, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %3)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.7, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %4)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.8, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %1)
%17 = load double, double* %2
%18 = load double, double* %3
%19 = load double, double* %4
%20 = load i32, i32* %1
%21 = call i32 @bisect(double %17, double %18, double %19, i32 %20)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %21)
ret i32 0
}