#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 BisectionMethod();
double FalsePosition();
double FixedPoint();
double NewtonRaphson();
double Secant();
int /*<<< orphan*/ printf(char *, double);
int main() {
  double root;
  root = BisectionMethod();
  printf("Using Bisection Method the root is: %lf \n\n", root);
  root = FalsePosition();
  printf("Using False Position Method the root is: %lf \n\n", root);
  root = NewtonRaphson();
  printf("Using Newton-Raphson Method the root is: %lf \n\n", root);
  root = FixedPoint();
  printf("Using Fixed Point Method the root is: %lf \n\n", root);
  root = Secant();
  printf("Using Secant Method the root is: %lf \n\n", root);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <BisectionMethod@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xe79(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <FalsePosition@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xe87(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <NewtonRaphson@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xe9a(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <FixedPoint@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xead(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1080 <Secant@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xebd(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <BisectionMethod@plt>
lea    0xe91(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1070 <FalsePosition@plt>
lea    0xea9(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <NewtonRaphson@plt>
lea    0xec6(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <FixedPoint@plt>
lea    0xee3(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1080 <Secant@plt>
lea    0xefd(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"Using Bisection Method the root is: %lf \0A\0A\00"
@.str.1 = [48 x i8] c"Using False Position Method the root is: %lf \0A\0A\00"
@.str.2 = [48 x i8] c"Using Newton-Raphson Method the root is: %lf \0A\0A\00"
@.str.3 = [45 x i8] c"Using Fixed Point Method the root is: %lf \0A\0A\00"
@.str.4 = [40 x i8] c"Using Secant Method the root is: %lf \0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call double (...) @BisectionMethod()
store double %3, double* %2
%4 = load double, double* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), double %4)
%6 = call double (...) @FalsePosition()
store double %6, double* %2
%7 = load double, double* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), double %7)
%9 = call double (...) @NewtonRaphson()
store double %9, double* %2
%10 = load double, double* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0), double %10)
%12 = call double (...) @FixedPoint()
store double %12, double* %2
%13 = load double, double* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), double %13)
%15 = call double (...) @Secant()
store double %15, double* %2
%16 = load double, double* %2
%17 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), double %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [43 x i8] c"Using Bisection Method the root is: %lf \0A\0A\00"
@.str.1 = [48 x i8] c"Using False Position Method the root is: %lf \0A\0A\00"
@.str.2 = [48 x i8] c"Using Newton-Raphson Method the root is: %lf \0A\0A\00"
@.str.3 = [45 x i8] c"Using Fixed Point Method the root is: %lf \0A\0A\00"
@.str.4 = [40 x i8] c"Using Secant Method the root is: %lf \0A\0A\00"
define i32 @main() {
%1 = tail call double (...) @BisectionMethod()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), double %1)
%3 = tail call double (...) @FalsePosition()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), double %3)
%5 = tail call double (...) @NewtonRaphson()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0), double %5)
%7 = tail call double (...) @FixedPoint()
%8 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), double %7)
%9 = tail call double (...) @Secant()
%10 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), double %9)
ret i32 0
}