#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 abs(double);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
double function(double *, int, int, double);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ system(char *);
double cords(double *param, int dimension, int functiontype, double precision,
             double *error, long int *inter, double extr_a, double extr_b,
             int mode) {
  double funz_extr_a;
  double funz_extr_b;
  int i;
  double X_intersec;
  double Y_intersec;
  double root;
  system("clear");
  fprintf(stdout, "Calculating ...\n");
  if (mode == 3) {
    do {
      funz_extr_a = function(param, dimension, functiontype, extr_a);
      funz_extr_b = function(param, dimension, functiontype, extr_b);
      X_intersec = ((extr_a * (funz_extr_b - funz_extr_a) -
                     extr_b * (extr_b - funz_extr_a)) /
                    (funz_extr_b - funz_extr_a));
      Y_intersec = function(param, dimension, functiontype, X_intersec);
      if ((funz_extr_a * Y_intersec) > 0) {
        extr_a = X_intersec;
      }
      if ((funz_extr_b * Y_intersec) > 0) {
        extr_b = X_intersec;
      }
    } while (abs(Y_intersec) > precision);
    root = X_intersec;
  }
  if (mode != 3) {
    int interations;
    system("clear");
    fprintf(stdout, "Inserisci Il Numero Di Interazioni Richiesto : ");
    scanf("%i", &interations);
    double X[interations];
    double funz[interations];
    if (mode == 1.) {
      X[0] = extr_b;
      funz[0] = function(param, dimension, functiontype, X[0]);
      funz_extr_a = function(param, dimension, functiontype, extr_a);
      for (i = 1; i <= interations; i++) {
        fprintf(stdout, "%i / %i", i, interations);
        funz[i] = function(param, dimension, functiontype, X[i]);
        X[i] = X[i - 1] -
               (extr_a - X[i - 1]) * funz[i - 1] / (funz_extr_a - funz[i]);
      }
      root = X[interations];
    }
    if (mode == 2.) {
      X[0] = extr_a;
      funz[0] = function(param, dimension, functiontype, X[0]);
      funz_extr_b = function(param, dimension, functiontype, extr_b);
      for (i = 1; i <= interations; i++) {
        fprintf(stdout, "%i / %i", i, interations);
        funz[i] = function(param, dimension, functiontype, X[i]);
        X[i] = X[i - 1] -
               (extr_b - X[i - 1]) * funz[i - 1] / (funz_extr_b - funz[i]);
      }
      root = X[interations];
      ;
    }
  }
  return root;
}


x86 assembly (clang, -O0):
<cords>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
movsd  %xmm1,-0x30(%rbp)
movsd  %xmm2,-0x38(%rbp)
mov    %r9d,-0x3c(%rbp)
lea    0xe89(%rip),%rdi
call   1040 <system@plt>
mov    0x2e4d(%rip),%rax
mov    (%rax),%edi
lea    0xe7a(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
cmpl   $0x3,-0x3c(%rbp)
jne    12b7 <cords+0x167>
jmp    11b2 <cords+0x62>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movsd  -0x30(%rbp),%xmm0
call   1070 <function@plt>
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movsd  -0x38(%rbp),%xmm0
call   1070 <function@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
subsd  -0x48(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm3
subsd  -0x48(%rbp),%xmm3
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x50(%rbp),%xmm1
subsd  -0x48(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movsd  -0x60(%rbp),%xmm0
call   1070 <function@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1272 <cords+0x122>
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1293 <cords+0x143>
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1298 <cords+0x148>
movsd  -0x68(%rbp),%xmm0
call   1030 <abs@plt>
ucomisd -0x18(%rbp),%xmm0
ja     11b2 <cords+0x62>
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
cmpl   $0x3,-0x3c(%rbp)
je     15c4 <cords+0x474>
lea    0xd48(%rip),%rdi
call   1040 <system@plt>
mov    0x2d0c(%rip),%rax
mov    (%rax),%edi
lea    0xd4a(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xd71(%rip),%rdi
lea    -0x74(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x74(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x80(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xa0(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x88(%rbp)
mov    -0x74(%rbp),%eax
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x98(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x90(%rbp)
cvtsi2sdl -0x3c(%rbp),%xmm0
movsd  0xcac(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1482 <cords+0x332>
jp     1482 <cords+0x332>
mov    -0xa0(%rbp),%rax
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movsd  (%rax),%xmm0
call   1070 <function@plt>
mov    -0x98(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movsd  -0x30(%rbp),%xmm0
call   1070 <function@plt>
movsd  %xmm0,-0x48(%rbp)
movl   $0x1,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x74(%rbp),%eax
jg     146d <cords+0x31d>
mov    0x2c1b(%rip),%rax
mov    (%rax),%edi
mov    -0x54(%rbp),%edx
mov    -0x74(%rbp),%ecx
lea    0xc83(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0xa0(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1070 <function@plt>
mov    -0x98(%rbp),%rcx
mov    -0xa0(%rbp),%rax
movslq -0x54(%rbp),%rdx
movsd  %xmm0,(%rcx,%rdx,8)
mov    -0x54(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
movsd  (%rax,%rdx,8),%xmm0
movsd  -0x30(%rbp),%xmm1
mov    -0x54(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
subsd  (%rax,%rdx,8),%xmm1
mov    -0x54(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mulsd  (%rcx,%rdx,8),%xmm1
movsd  -0x48(%rbp),%xmm2
movslq -0x54(%rbp),%rdx
subsd  (%rcx,%rdx,8),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movslq -0x54(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    13b2 <cords+0x262>
mov    -0xa0(%rbp),%rax
movslq -0x74(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
cvtsi2sdl -0x3c(%rbp),%xmm0
movsd  0xb79(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    15bd <cords+0x46d>
jp     15bd <cords+0x46d>
mov    -0xa0(%rbp),%rax
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movsd  (%rax),%xmm0
call   1070 <function@plt>
mov    -0x98(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movsd  -0x38(%rbp),%xmm0
call   1070 <function@plt>
movsd  %xmm0,-0x50(%rbp)
movl   $0x1,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x74(%rbp),%eax
jg     15a8 <cords+0x458>
mov    0x2ae0(%rip),%rax
mov    (%rax),%edi
mov    -0x54(%rbp),%edx
mov    -0x74(%rbp),%ecx
lea    0xb48(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0xa0(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1070 <function@plt>
mov    -0x98(%rbp),%rcx
mov    -0xa0(%rbp),%rax
movslq -0x54(%rbp),%rdx
movsd  %xmm0,(%rcx,%rdx,8)
mov    -0x54(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
movsd  (%rax,%rdx,8),%xmm0
movsd  -0x38(%rbp),%xmm1
mov    -0x54(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
subsd  (%rax,%rdx,8),%xmm1
mov    -0x54(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mulsd  (%rcx,%rdx,8),%xmm1
movsd  -0x50(%rbp),%xmm2
movslq -0x54(%rbp),%rdx
subsd  (%rcx,%rdx,8),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movslq -0x54(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    14ed <cords+0x39d>
mov    -0xa0(%rbp),%rax
movslq -0x74(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x80(%rbp),%rax
mov    %rax,%rsp
movsd  -0x70(%rbp),%xmm0
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cords>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %r9d,%ebx
movapd %xmm2,-0x60(%rbp)
movapd %xmm1,-0x50(%rbp)
movsd  %xmm0,-0x78(%rbp)
mov    %edx,%r14d
mov    %esi,%r15d
mov    %rdi,%r13
lea    0xe7d(%rip),%rdi
call   1040 <system@plt>
mov    0x2e51(%rip),%r12
mov    (%r12),%edi
lea    0xe6c(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
cmp    $0x3,%ebx
jne    12a9 <cords+0x159>
movapd -0x60(%rbp),%xmm1
movaps -0x50(%rbp),%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movapd %xmm1,-0x60(%rbp)
mov    %r13,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
movaps %xmm0,-0x50(%rbp)
call   1070 <function@plt>
movsd  %xmm0,-0x38(%rbp)
mov    %r13,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
movapd -0x60(%rbp),%xmm0
call   1070 <function@plt>
movsd  %xmm0,-0x40(%rbp)
movapd %xmm0,%xmm3
movsd  -0x38(%rbp),%xmm2
subsd  %xmm2,%xmm3
movapd -0x60(%rbp),%xmm0
movapd %xmm0,%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm1
movapd -0x50(%rbp),%xmm0
mulsd  %xmm3,%xmm0
subsd  %xmm1,%xmm0
divsd  %xmm3,%xmm0
movapd %xmm0,-0x70(%rbp)
mov    %r13,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
call   1070 <function@plt>
movsd  -0x38(%rbp),%xmm1
mulsd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm1,%xmm2
movapd %xmm2,%xmm1
movapd -0x70(%rbp),%xmm3
andpd  %xmm3,%xmm1
andnpd -0x50(%rbp),%xmm2
orpd   %xmm1,%xmm2
movapd %xmm2,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm0,%xmm1
xorpd  %xmm4,%xmm4
cmpltsd %xmm1,%xmm4
movapd %xmm4,%xmm1
andpd  %xmm3,%xmm1
andnpd -0x60(%rbp),%xmm4
orpd   %xmm1,%xmm4
movapd %xmm4,-0x60(%rbp)
call   1030 <abs@plt>
ucomisd -0x78(%rbp),%xmm0
movapd -0x60(%rbp),%xmm1
movaps -0x50(%rbp),%xmm0
ja     11c0 <cords+0x70>
jmp    14d8 <cords+0x388>
lea    0xd50(%rip),%rdi
call   1040 <system@plt>
mov    (%r12),%edi
lea    0xd57(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xd7e(%rip),%rdi
lea    -0x2c(%rbp),%rsi
call   1060 <scanf@plt>
mov    %rsp,-0x78(%rbp)
mov    -0x2c(%rbp),%eax
mov    %rsp,%rcx
lea    0xf(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,%rsp
cmp    $0x1,%ebx
jne    13e1 <cords+0x291>
mov    %ebx,-0x7c(%rbp)
movaps -0x60(%rbp),%xmm0
mov    %rcx,%rbx
movsd  %xmm0,(%rcx)
mov    %r13,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
call   1070 <function@plt>
movsd  %xmm0,-0x38(%rbp)
mov    %r13,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
movapd -0x50(%rbp),%xmm0
call   1070 <function@plt>
mov    -0x2c(%rbp),%ecx
test   %ecx,%ecx
jle    13d3 <cords+0x283>
movapd %xmm0,%xmm3
mov    $0x1,%r12d
movapd -0x60(%rbp),%xmm4
movsd  -0x38(%rbp),%xmm0
movsd  %xmm3,-0x40(%rbp)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  %xmm0,-0x38(%rbp)
movsd  %xmm4,-0x70(%rbp)
mov    0x2c6f(%rip),%rax
mov    (%rax),%edi
lea    0xccd(%rip),%rsi
mov    %r12d,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
movsd  (%rbx,%r12,8),%xmm0
mov    %r13,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
call   1070 <function@plt>
movsd  -0x70(%rbp),%xmm4
movsd  -0x40(%rbp),%xmm2
movapd -0x50(%rbp),%xmm1
subsd  %xmm4,%xmm1
mulsd  -0x38(%rbp),%xmm1
subsd  %xmm0,%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm4
movsd  %xmm4,(%rbx,%r12,8)
lea    0x1(%r12),%rax
movslq -0x2c(%rbp),%rcx
cmp    %rcx,%r12
mov    %rax,%r12
jl     1360 <cords+0x210>
movslq %ecx,%rax
movsd  (%rbx,%rax,8),%xmm0
mov    %rbx,%rcx
mov    -0x7c(%rbp),%ebx
cmp    $0x2,%ebx
jne    14d0 <cords+0x380>
movaps -0x50(%rbp),%xmm0
mov    %rcx,-0x40(%rbp)
movsd  %xmm0,(%rcx)
mov    %r13,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
call   1070 <function@plt>
movsd  %xmm0,-0x38(%rbp)
mov    %r13,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
movapd -0x60(%rbp),%xmm0
call   1070 <function@plt>
mov    -0x2c(%rbp),%ecx
test   %ecx,%ecx
jle    14c3 <cords+0x373>
movapd %xmm0,%xmm3
mov    $0x1,%ebx
movapd -0x50(%rbp),%xmm4
mov    -0x40(%rbp),%r12
movsd  -0x38(%rbp),%xmm0
movsd  %xmm3,-0x70(%rbp)
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  %xmm0,-0x38(%rbp)
movapd %xmm4,-0x50(%rbp)
mov    0x2b7f(%rip),%rax
mov    (%rax),%edi
lea    0xbdd(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
movsd  (%r12,%rbx,8),%xmm0
mov    %r13,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
call   1070 <function@plt>
movapd -0x50(%rbp),%xmm4
movsd  -0x70(%rbp),%xmm2
movapd -0x60(%rbp),%xmm1
subsd  %xmm4,%xmm1
mulsd  -0x38(%rbp),%xmm1
subsd  %xmm0,%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm4
movsd  %xmm4,(%r12,%rbx,8)
lea    0x1(%rbx),%rax
movslq -0x2c(%rbp),%rcx
cmp    %rcx,%rbx
mov    %rax,%rbx
jl     1450 <cords+0x300>
jmp    14c7 <cords+0x377>
mov    -0x40(%rbp),%r12
movslq %ecx,%rax
movsd  (%r12,%rax,8),%xmm0
movaps %xmm0,-0x70(%rbp)
mov    -0x78(%rbp),%rsp
movaps -0x70(%rbp),%xmm0
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@stdout = global i32 0
@.str.1 = [17 x i8] c"Calculating ...\0A\00"
@.str.2 = [48 x i8] c"Inserisci Il Numero Di Interazioni Richiesto : \00"
@.str.3 = [3 x i8] c"%i\00"
@.str.4 = [8 x i8] c"%i / %i\00"
define double @cords(double* %0, i32 %1, i32 %2, double %3, double* nocapture readnone %4, i64* nocapture readnone %5, double %6, double %7, i32 %8) {
%10 = alloca i32
%11 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @stdout
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i32 %8, 3
br i1 %14, label %15, label %35
15: ; preds = %9, %15
%16 = phi double [ %32, %15 ], [ %7, %9 ]
%17 = phi double [ %29, %15 ], [ %6, %9 ]
%18 = tail call double @function(double* %0, i32 %1, i32 %2, double %17)
%19 = tail call double @function(double* %0, i32 %1, i32 %2, double %16)
%20 = fsub double %19, %18
%21 = fsub double %16, %18
%22 = fneg double %16
%23 = fmul double %21, %22
%24 = tail call double @llvm.fmuladd.f64(double %17, double %20, double %23)
%25 = fdiv double %24, %20
%26 = tail call double @function(double* %0, i32 %1, i32 %2, double %25)
%27 = fmul double %18, %26
%28 = fcmp ogt double %27, 0.000000e+00
%29 = select i1 %28, double %25, double %17
%30 = fmul double %19, %26
%31 = fcmp ogt double %30, 0.000000e+00
%32 = select i1 %31, double %25, double %16
%33 = tail call double @abs(double %26)
%34 = fcmp ogt double %33, %3
br i1 %34, label %15, label %111
35: ; preds = %9
%36 = bitcast i32* %10 to i8*
%37 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%38 = load i32, i32* @stdout
%39 = tail call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
%40 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %10)
%41 = load i32, i32* %10
%42 = zext i32 %41 to i64
%43 = call i8* @llvm.stacksave()
%44 = alloca double, i64 %42
%45 = icmp eq i32 %8, 1
br i1 %45, label %46, label %76
46: ; preds = %35
store double %7, double* %44
%47 = call double @function(double* %0, i32 %1, i32 %2, double %7)
%48 = call double @function(double* %0, i32 %1, i32 %2, double %6)
%49 = load i32, i32* %10
%50 = icmp slt i32 %49, 1
br i1 %50, label %71, label %51
51: ; preds = %46, %51
%52 = phi double [ %61, %51 ], [ %47, %46 ]
%53 = phi double [ %66, %51 ], [ %7, %46 ]
%54 = phi i64 [ %67, %51 ], [ 1, %46 ]
%55 = phi i32 [ %68, %51 ], [ %49, %46 ]
%56 = load i32, i32* @stdout
%57 = trunc i64 %54 to i32
%58 = call i32 (i32, i8*, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %57, i32 %55)
%59 = getelementptr inbounds double, double* %44, i64 %54
%60 = load double, double* %59
%61 = call double @function(double* %0, i32 %1, i32 %2, double %60)
%62 = fsub double %6, %53
%63 = fmul double %62, %52
%64 = fsub double %48, %61
%65 = fdiv double %63, %64
%66 = fsub double %53, %65
store double %66, double* %59
%67 = add nuw nsw i64 %54, 1
%68 = load i32, i32* %10
%69 = sext i32 %68 to i64
%70 = icmp slt i64 %54, %69
br i1 %70, label %51, label %71
71: ; preds = %51, %46
%72 = phi i32 [ %49, %46 ], [ %68, %51 ]
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds double, double* %44, i64 %73
%75 = load double, double* %74
br label %76
76: ; preds = %71, %35
%77 = phi double [ %75, %71 ], [ undef, %35 ]
%78 = icmp eq i32 %8, 2
br i1 %78, label %79, label %109
79: ; preds = %76
store double %6, double* %44
%80 = call double @function(double* %0, i32 %1, i32 %2, double %6)
%81 = call double @function(double* %0, i32 %1, i32 %2, double %7)
%82 = load i32, i32* %10
%83 = icmp slt i32 %82, 1
br i1 %83, label %104, label %84
84: ; preds = %79, %84
%85 = phi double [ %94, %84 ], [ %80, %79 ]
%86 = phi double [ %99, %84 ], [ %6, %79 ]
%87 = phi i64 [ %100, %84 ], [ 1, %79 ]
%88 = phi i32 [ %101, %84 ], [ %82, %79 ]
%89 = load i32, i32* @stdout
%90 = trunc i64 %87 to i32
%91 = call i32 (i32, i8*, ...) @fprintf(i32 %89, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %90, i32 %88)
%92 = getelementptr inbounds double, double* %44, i64 %87
%93 = load double, double* %92
%94 = call double @function(double* %0, i32 %1, i32 %2, double %93)
%95 = fsub double %7, %86
%96 = fmul double %95, %85
%97 = fsub double %81, %94
%98 = fdiv double %96, %97
%99 = fsub double %86, %98
store double %99, double* %92
%100 = add nuw nsw i64 %87, 1
%101 = load i32, i32* %10
%102 = sext i32 %101 to i64
%103 = icmp slt i64 %87, %102
br i1 %103, label %84, label %104
104: ; preds = %84, %79
%105 = phi i32 [ %82, %79 ], [ %101, %84 ]
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds double, double* %44, i64 %106
%108 = load double, double* %107
br label %109
109: ; preds = %104, %76
%110 = phi double [ %108, %104 ], [ %77, %76 ]
br label %111
111: ; preds = %15, %109
%112 = phi double [ %110, %109 ], [ %25, %15 ]
ret double %112
}