#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 d2f(double, double, double);
scalar_t__ d3(int, double *, double *, double *, double *, double);
double d3f(double, double, double);
double f(double, double, double);
scalar_t__ malloc(int);
double normainf(int, double *);
int /*<<< orphan*/ printf(char *, ...);
int newton(double a, double b, double alfa, double beta, int n, double prec) {
  int i, j, k;
  double h, l0, l1, ratio, temp, dtemp, norma;
  double *x, *y, *e, *inf, *mid, *sup;
  const int kmax = 10;
  h = (b - a) / (n + 1);
  x = (double *)malloc((n + 2) * sizeof(double));
  y = (double *)malloc((n + 2) * sizeof(double));
  e = (double *)malloc(n * sizeof(double));
  inf = (double *)malloc(n * sizeof(double));
  mid = (double *)malloc(n * sizeof(double));
  sup = (double *)malloc(n * sizeof(double));
  x[0] = a;
  for (i = 1; i < n + 1; i++) {
    x[i] = x[i - 1] + h;
  }
  x[n + 1] = b;
  l0 = b - a;
  l1 = beta - alfa;
  ratio = l1 / l0;
  y[0] = alfa;
  for (i = 1; i < n + 1; i++) {
    y[i] = alfa + ratio * (x[i] - a);
  }
  y[n + 1] = beta;
  k = 0;
  do {
    for (i = 0; i < n; i++) {
      j = i + 1;
      temp = (y[j + 1] - y[j - 1]) / (2 * h);
      inf[i] = -1 - (h / 2) * d3f(x[j], y[j], temp);
      mid[i] = 2 + h * h * d2f(x[j], y[j], temp);
      sup[i] = -1 + (h / 2) * d3f(x[j], y[j], temp);
      e[i] =
          y[j - 1] - 2 * y[j] + y[j + 1] - h * h * f(x[i + 1], y[i + 1], temp);
    }
    if (d3(n, inf, mid, sup, e, prec))
      return 1;
    norma = normainf(n, e);
    printf("Iteracio nº %d\nnorma = %25.16lf\n", k + 1, norma);
    for (i = 0; i < n; i++) {
      y[i] += e[i];
    }
    k++;
  } while (k < kmax && norma > prec);
  printf("Resultat:\nx\ty\n");
  for (i = 0; i < n + 2; i++) {
    printf("%25.16lf %25.16lf\n", x[i], y[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<newton>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
mov    %edi,-0x2c(%rbp)
movsd  %xmm4,-0x38(%rbp)
movl   $0xa,-0xb4(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x2,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x88(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x2,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x90(%rbp)
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x98(%rbp)
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0xa0(%rbp)
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0xa8(%rbp)
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0xb0(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x88(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    12aa <newton+0x13a>
mov    -0x88(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x50(%rbp),%xmm0
mov    -0x88(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1261 <newton+0xf1>
movsd  -0x18(%rbp),%xmm0
mov    -0x88(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
divsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x90(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    135e <newton+0x1ee>
movsd  -0x20(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm0
mov    -0x88(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
subsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x90(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1308 <newton+0x198>
movsd  -0x28(%rbp),%xmm0
mov    -0x90(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1615 <newton+0x4a5>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
mov    -0x90(%rbp),%rax
mov    -0x40(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x90(%rbp),%rax
mov    -0x40(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  0xc3b(%rip),%xmm1
mulsd  -0x50(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  0xc20(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
mov    -0x88(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x90(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x70(%rbp),%xmm2
call   1060 <d3f@plt>
movaps %xmm0,%xmm1
movsd  -0xe0(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xbb4(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0xa0(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
mov    -0x88(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x90(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x70(%rbp),%xmm2
call   1080 <d2f@plt>
movaps %xmm0,%xmm1
movsd  -0xd8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  0xb55(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0xa8(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm0
movsd  0xb34(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
mov    -0x88(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x90(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x70(%rbp),%xmm2
call   1060 <d3f@plt>
movaps %xmm0,%xmm1
movsd  -0xd0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  0xadf(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0xb0(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x90(%rbp),%rax
mov    -0x40(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x90(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
mov    -0x90(%rbp),%rax
mov    -0x40(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
mov    -0x88(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x90(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x70(%rbp),%xmm2
call   1030 <f@plt>
movsd  -0xc8(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xc0(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x98(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1386 <newton+0x216>
mov    -0x2c(%rbp),%edi
mov    -0xa0(%rbp),%rsi
mov    -0xa8(%rbp),%rdx
mov    -0xb0(%rbp),%rcx
mov    -0x98(%rbp),%r8
movsd  -0x38(%rbp),%xmm0
call   1050 <d3@plt>
cmp    $0x0,%rax
je     1654 <newton+0x4e4>
movl   $0x1,-0x4(%rbp)
jmp    176c <newton+0x5fc>
mov    -0x2c(%rbp),%edi
mov    -0x98(%rbp),%rsi
call   1090 <normainf@plt>
movsd  %xmm0,-0x80(%rbp)
mov    -0x44(%rbp),%esi
add    $0x1,%esi
movsd  -0x80(%rbp),%xmm0
lea    0x996(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    16c7 <newton+0x557>
mov    -0x98(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x90(%rbp),%rax
movslq -0x3c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1688 <newton+0x518>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0x44(%rbp)
mov    %al,-0xe1(%rbp)
jge    16f5 <newton+0x585>
movsd  -0x80(%rbp),%xmm0
ucomisd -0x38(%rbp),%xmm0
seta   %al
mov    %al,-0xe1(%rbp)
mov    -0xe1(%rbp),%al
test   $0x1,%al
jne    137f <newton+0x20f>
lea    0x928(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x2c(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
jge    1765 <newton+0x5f5>
mov    -0x88(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x90(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
lea    0x8f1(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1718 <newton+0x5a8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newton>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe8,%rsp
movsd  %xmm4,0x58(%rsp)
mov    %edi,%ebp
movsd  %xmm3,0x18(%rsp)
movapd %xmm2,0x40(%rsp)
movapd %xmm0,0x20(%rsp)
movabs $0x7ffffffffffffffe,%rax
ff ff 7f
mov    %rax,0x50(%rsp)
movsd  %xmm1,0x70(%rsp)
subsd  %xmm0,%xmm1
lea    0x1(%rbp),%r13d
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
movsd  %xmm1,0x90(%rsp)
divsd  %xmm0,%xmm1
movapd %xmm1,0x80(%rsp)
lea    0x10(,%rbp,8),%ebx
mov    %ebx,%edi
call   1080 <malloc@plt>
mov    %rax,%r14
mov    %ebx,%edi
call   1080 <malloc@plt>
mov    %rax,%rbx
lea    0x0(,%rbp,8),%r15d
mov    %r15d,%edi
call   1080 <malloc@plt>
mov    %rax,%r12
mov    %r15d,%edi
call   1080 <malloc@plt>
mov    %rax,0xc8(%rsp)
mov    %r15d,%edi
call   1080 <malloc@plt>
mov    %rax,0x68(%rsp)
mov    %r15d,%edi
call   1080 <malloc@plt>
movapd 0x20(%rsp),%xmm7
mov    %rax,%r9
movsd  %xmm7,(%r14)
test   %ebp,%ebp
mov    %rbp,0x10(%rsp)
jle    14dd <newton+0x35d>
mov    %r13d,%eax
lea    -0x1(%rax),%rdx
lea    -0x2(%rax),%rcx
mov    %edx,%esi
and    $0x3,%esi
mov    $0x1,%edi
movapd %xmm7,%xmm0
cmp    $0x3,%rcx
movapd 0x80(%rsp),%xmm6
movsd  0x18(%rsp),%xmm8
movapd 0x40(%rsp),%xmm9
movsd  0x70(%rsp),%xmm1
jb     12d9 <newton+0x159>
mov    %rdx,%rcx
and    $0xfffffffffffffffc,%rcx
xor    %edi,%edi
movapd %xmm7,%xmm0
nopl   (%rax)
addsd  %xmm6,%xmm0
movsd  %xmm0,0x8(%r14,%rdi,8)
addsd  %xmm6,%xmm0
movsd  %xmm0,0x10(%r14,%rdi,8)
addsd  %xmm6,%xmm0
movsd  %xmm0,0x18(%r14,%rdi,8)
addsd  %xmm6,%xmm0
movsd  %xmm0,0x20(%r14,%rdi,8)
add    $0x4,%rdi
cmp    %rdi,%rcx
jne    12a0 <newton+0x120>
add    $0x1,%rdi
movslq %r13d,%rcx
test   %rsi,%rsi
je     1302 <newton+0x182>
lea    (%r14,%rdi,8),%rdi
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
addsd  %xmm6,%xmm0
movsd  %xmm0,(%rdi,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%rsi
jne    12f0 <newton+0x170>
movsd  %xmm1,(%r14,%rcx,8)
movsd  %xmm9,(%rbx)
mov    0x10(%rsp),%rbp
test   %ebp,%ebp
mov    %r12,%r13
jle    1509 <newton+0x389>
movapd %xmm8,%xmm0
subsd  %xmm9,%xmm0
divsd  0x90(%rsp),%xmm0
mov    $0x1,%esi
cmp    $0x4,%rdx
jb     1474 <newton+0x2f4>
lea    0x8(%rbx),%rdi
lea    (%r14,%rax,8),%rbp
cmp    %rbp,%rdi
jae    1365 <newton+0x1e5>
lea    (%rbx,%rax,8),%rdi
mov    %r14,%rbp
add    $0x8,%rbp
cmp    %rdi,%rbp
mov    0x10(%rsp),%rbp
jb     1474 <newton+0x2f4>
mov    %rdx,%rsi
and    $0xfffffffffffffffc,%rsi
movapd %xmm7,%xmm3
unpcklpd %xmm7,%xmm3
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
movapd %xmm9,%xmm2
unpcklpd %xmm9,%xmm2
lea    -0x4(%rsi),%rdi
mov    %rdi,%r8
shr    $0x2,%r8
add    $0x1,%r8
test   %rdi,%rdi
je     19b3 <newton+0x833>
mov    %r8,%rbp
movabs $0x7ffffffffffffffe,%rdi
ff ff 7f
and    %rdi,%rbp
mov    $0x1,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movupd (%r14,%rdi,8),%xmm4
movupd 0x10(%r14,%rdi,8),%xmm5
subpd  %xmm3,%xmm4
subpd  %xmm3,%xmm5
mulpd  %xmm1,%xmm4
addpd  %xmm2,%xmm4
mulpd  %xmm1,%xmm5
addpd  %xmm2,%xmm5
movupd %xmm4,(%rbx,%rdi,8)
movupd %xmm5,0x10(%rbx,%rdi,8)
movupd 0x20(%r14,%rdi,8),%xmm4
movupd 0x30(%r14,%rdi,8),%xmm5
subpd  %xmm3,%xmm4
subpd  %xmm3,%xmm5
mulpd  %xmm1,%xmm4
addpd  %xmm2,%xmm4
mulpd  %xmm1,%xmm5
addpd  %xmm2,%xmm5
movupd %xmm4,0x20(%rbx,%rdi,8)
movupd %xmm5,0x30(%rbx,%rdi,8)
add    $0x8,%rdi
add    $0xfffffffffffffffe,%rbp
jne    13c0 <newton+0x240>
test   $0x1,%r8b
je     1462 <newton+0x2e2>
movupd (%r14,%rdi,8),%xmm4
movupd 0x10(%r14,%rdi,8),%xmm5
subpd  %xmm3,%xmm4
subpd  %xmm3,%xmm5
mulpd  %xmm1,%xmm4
addpd  %xmm2,%xmm4
mulpd  %xmm1,%xmm5
addpd  %xmm2,%xmm5
movupd %xmm4,(%rbx,%rdi,8)
movupd %xmm5,0x10(%rbx,%rdi,8)
cmp    %rsi,%rdx
mov    0x10(%rsp),%rbp
je     1509 <newton+0x389>
or     $0x1,%rsi
mov    %rsi,%rdx
not    %rdx
test   $0x1,%al
jne    149a <newton+0x31a>
movsd  (%r14,%rsi,8),%xmm1
subsd  %xmm7,%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm9,%xmm1
movsd  %xmm1,(%rbx,%rsi,8)
add    $0x1,%rsi
add    %rax,%rdx
je     1509 <newton+0x389>
nop
movsd  (%r14,%rsi,8),%xmm1
subsd  %xmm7,%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm9,%xmm1
movsd  %xmm1,(%rbx,%rsi,8)
movsd  0x8(%r14,%rsi,8),%xmm1
subsd  %xmm7,%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm9,%xmm1
movsd  %xmm1,0x8(%rbx,%rsi,8)
add    $0x2,%rsi
cmp    %rsi,%rax
jne    14a0 <newton+0x320>
jmp    1509 <newton+0x389>
movslq %r13d,%rcx
movsd  0x70(%rsp),%xmm0
movsd  %xmm0,(%r14,%rcx,8)
movapd 0x40(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movapd 0x80(%rsp),%xmm6
mov    %r12,%r13
movsd  0x18(%rsp),%xmm8
lea    0x2(%rbp),%eax
mov    %eax,0x3c(%rsp)
movsd  %xmm8,(%rbx,%rcx,8)
movapd %xmm6,%xmm8
addsd  %xmm6,%xmm8
movsd  0xad7(%rip),%xmm10
mulsd  %xmm6,%xmm10
movapd 0xaea(%rip),%xmm7
movapd %xmm10,%xmm9
xorpd  %xmm7,%xmm9
mulsd  %xmm6,%xmm6
xorpd  %xmm6,%xmm7
mov    %ebp,%esi
lea    (%rbx,%rsi,8),%rax
lea    0x0(,%rsi,8),%rcx
add    %r13,%rcx
mov    %esi,%edx
and    $0xfffffffc,%edx
mov    %rdx,0xb0(%rsp)
add    $0xfffffffffffffffc,%rdx
mov    %rdx,0xa8(%rsp)
shr    $0x2,%rdx
add    $0x1,%rdx
cmp    %rcx,%rbx
setb   %cl
cmp    %rax,%r13
setb   %al
and    %cl,%al
mov    %al,0xf(%rsp)
mov    %rdx,%rax
mov    %rdx,0xa0(%rsp)
and    %rdx,0x50(%rsp)
mov    %esi,%edi
and    $0x3,%edi
lea    0x0(,%rsi,8),%r12
xor    %eax,%eax
mov    %rax,0x30(%rsp)
movapd %xmm6,0x80(%rsp)
movsd  %xmm8,0x40(%rsp)
movapd %xmm10,0x70(%rsp)
movapd %xmm7,0x90(%rsp)
movapd %xmm9,0xd0(%rsp)
mov    %rsi,0xc0(%rsp)
mov    %rdi,0xb8(%rsp)
mov    %r9,0x60(%rsp)
nop
test   %ebp,%ebp
mov    0xc8(%rsp),%r15
jle    1719 <newton+0x599>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  0x8(%rbx,%rbp,1),%xmm1
movsd  0x10(%rbx,%rbp,1),%xmm2
subsd  (%rbx,%rbp,1),%xmm2
divsd  %xmm8,%xmm2
movsd  %xmm2,0x20(%rsp)
movsd  0x8(%r14,%rbp,1),%xmm0
call   1070 <d3f@plt>
mulsd  0xd0(%rsp),%xmm0
movsd  0x9bf(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,(%r15,%rbp,1)
movsd  0x8(%r14,%rbp,1),%xmm0
movsd  0x8(%rbx,%rbp,1),%xmm1
movsd  0x20(%rsp),%xmm2
call   1090 <d2f@plt>
mulsd  0x80(%rsp),%xmm0
addsd  0x994(%rip),%xmm0
mov    0x68(%rsp),%rax
movsd  %xmm0,(%rax,%rbp,1)
movsd  0x8(%r14,%rbp,1),%xmm0
movsd  0x8(%rbx,%rbp,1),%xmm1
movsd  0x20(%rsp),%xmm2
call   1070 <d3f@plt>
mulsd  0x70(%rsp),%xmm0
addsd  0x95c(%rip),%xmm0
mov    0x60(%rsp),%rax
movsd  %xmm0,(%rax,%rbp,1)
movsd  (%rbx,%rbp,1),%xmm2
movsd  0x8(%rbx,%rbp,1),%xmm1
movapd %xmm1,%xmm0
addsd  %xmm1,%xmm0
subsd  %xmm0,%xmm2
addsd  0x10(%rbx,%rbp,1),%xmm2
movsd  %xmm2,0x18(%rsp)
movsd  0x8(%r14,%rbp,1),%xmm0
movsd  0x20(%rsp),%xmm2
call   1040 <f@plt>
movapd 0x90(%rsp),%xmm7
movsd  0x40(%rsp),%xmm8
mulsd  %xmm7,%xmm0
addsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x0(%r13,%rbp,1)
add    $0x8,%rbp
cmp    %rbp,%r12
jne    1610 <newton+0x490>
mov    0x10(%rsp),%rbp
mov    %ebp,%edi
mov    %r15,%rsi
mov    0x68(%rsp),%rdx
mov    0x60(%rsp),%rcx
mov    %r13,%r8
movsd  0x58(%rsp),%xmm0
call   1060 <d3@plt>
test   %rax,%rax
jne    193b <newton+0x7bb>
mov    %ebp,%edi
mov    %r13,%rsi
call   10a0 <normainf@plt>
mov    0x30(%rsp),%rax
lea    0x1(%rax),%esi
lea    0x8d3(%rip),%rdi
mov    %esi,%r15d
movsd  %xmm0,0x20(%rsp)
mov    $0x1,%al
call   1050 <printf@plt>
test   %ebp,%ebp
movsd  0x40(%rsp),%xmm8
mov    0xc0(%rsp),%rsi
mov    0xb8(%rsp),%rdi
jle    1903 <newton+0x783>
cmp    $0x4,%ebp
setb   %al
or     0xf(%rsp),%al
je     17a0 <newton+0x620>
xor    %eax,%eax
jmp    186e <newton+0x6ee>
nop
cmpq   $0x0,0xa8(%rsp)
je     1926 <newton+0x7a6>
mov    0x50(%rsp),%rcx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
movupd 0x0(%r13,%rax,8),%xmm0
movupd 0x10(%r13,%rax,8),%xmm1
movupd (%rbx,%rax,8),%xmm2
addpd  %xmm0,%xmm2
movupd 0x10(%rbx,%rax,8),%xmm0
addpd  %xmm1,%xmm0
movupd 0x20(%rbx,%rax,8),%xmm1
movupd 0x30(%rbx,%rax,8),%xmm3
movupd %xmm2,(%rbx,%rax,8)
movupd %xmm0,0x10(%rbx,%rax,8)
movupd 0x20(%r13,%rax,8),%xmm0
addpd  %xmm1,%xmm0
movupd 0x30(%r13,%rax,8),%xmm1
addpd  %xmm3,%xmm1
movupd %xmm0,0x20(%rbx,%rax,8)
movupd %xmm1,0x30(%rbx,%rax,8)
add    $0x8,%rax
add    $0xfffffffffffffffe,%rcx
jne    17c0 <newton+0x640>
testb  $0x1,0xa0(%rsp)
01
je     185a <newton+0x6da>
movupd 0x0(%r13,%rax,8),%xmm0
movupd 0x10(%r13,%rax,8),%xmm1
movupd (%rbx,%rax,8),%xmm2
addpd  %xmm0,%xmm2
movupd 0x10(%rbx,%rax,8),%xmm0
addpd  %xmm1,%xmm0
movupd %xmm2,(%rbx,%rax,8)
movupd %xmm0,0x10(%rbx,%rax,8)
mov    0xb0(%rsp),%rcx
mov    %rcx,%rax
cmp    %rsi,%rcx
je     1903 <newton+0x783>
mov    %rax,%rcx
not    %rcx
add    %rsi,%rcx
test   %rdi,%rdi
je     189b <newton+0x71b>
mov    %rdi,%rdx
nop
movsd  0x0(%r13,%rax,8),%xmm0
addsd  (%rbx,%rax,8),%xmm0
movsd  %xmm0,(%rbx,%rax,8)
add    $0x1,%rax
add    $0xffffffffffffffff,%rdx
jne    1880 <newton+0x700>
cmp    $0x3,%rcx
jb     1903 <newton+0x783>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  0x0(%r13,%rax,8),%xmm0
addsd  (%rbx,%rax,8),%xmm0
movsd  %xmm0,(%rbx,%rax,8)
movsd  0x8(%r13,%rax,8),%xmm0
addsd  0x8(%rbx,%rax,8),%xmm0
movsd  %xmm0,0x8(%rbx,%rax,8)
movsd  0x10(%r13,%rax,8),%xmm0
addsd  0x10(%rbx,%rax,8),%xmm0
movsd  %xmm0,0x10(%rbx,%rax,8)
movsd  0x18(%r13,%rax,8),%xmm0
addsd  0x18(%rbx,%rax,8),%xmm0
movsd  %xmm0,0x18(%rbx,%rax,8)
add    $0x4,%rax
cmp    %rax,%rsi
jne    18b0 <newton+0x730>
cmpl   $0x8,0x30(%rsp)
ja     1943 <newton+0x7c3>
movsd  0x20(%rsp),%xmm0
ucomisd 0x58(%rsp),%xmm0
mov    %r15d,%eax
mov    %rax,0x30(%rsp)
ja     15f0 <newton+0x470>
jmp    1943 <newton+0x7c3>
xor    %eax,%eax
testb  $0x1,0xa0(%rsp)
01
jne    182e <newton+0x6ae>
jmp    185a <newton+0x6da>
mov    $0x1,%r15d
jmp    199e <newton+0x81e>
lea    0x71b(%rip),%rdi
call   1030 <puts@plt>
xor    %r15d,%r15d
cmp    $0xffffffff,%ebp
jl     199e <newton+0x81e>
mov    0x3c(%rsp),%eax
cmp    $0x2,%eax
mov    $0x1,%r13d
cmovge %eax,%r13d
xor    %r15d,%r15d
lea    0x6e0(%rip),%r12
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  (%r14,%rbp,8),%xmm0
movsd  (%rbx,%rbp,8),%xmm1
mov    %r12,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r13
jne    1980 <newton+0x800>
mov    %r15d,%eax
add    $0xe8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%edi
test   $0x1,%r8b
jne    1432 <newton+0x2b2>
jmp    1462 <newton+0x2e2>

LLVM IR (-O0):
@.str = [34 x i8] c"Iteracio n\C2\BA %d\0Anorma = %25.16lf\0A\00"
@.str.1 = [15 x i8] c"Resultat:\0Ax\09y\0A\00"
@.str.2 = [19 x i8] c"%25.16lf %25.16lf\0A\00"
define i32 @newton(double %0, double %1, double %2, double %3, i32 %4, double %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca i32
%13 = alloca double
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double*
%25 = alloca double*
%26 = alloca double*
%27 = alloca double*
%28 = alloca double*
%29 = alloca double*
%30 = alloca i32
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store double %3, double* %11
store i32 %4, i32* %12
store double %5, double* %13
store i32 10, i32* %30
%31 = load double, double* %9
%32 = load double, double* %8
%33 = fsub double %31, %32
%34 = load i32, i32* %12
%35 = add nsw i32 %34, 1
%36 = sitofp i32 %35 to double
%37 = fdiv double %33, %36
store double %37, double* %17
%38 = load i32, i32* %12
%39 = add nsw i32 %38, 2
%40 = sext i32 %39 to i64
%41 = mul i64 %40, 8
%42 = trunc i64 %41 to i32
%43 = call i64 @malloc(i32 %42)
%44 = inttoptr i64 %43 to double*
store double* %44, double** %24
%45 = load i32, i32* %12
%46 = add nsw i32 %45, 2
%47 = sext i32 %46 to i64
%48 = mul i64 %47, 8
%49 = trunc i64 %48 to i32
%50 = call i64 @malloc(i32 %49)
%51 = inttoptr i64 %50 to double*
store double* %51, double** %25
%52 = load i32, i32* %12
%53 = sext i32 %52 to i64
%54 = mul i64 %53, 8
%55 = trunc i64 %54 to i32
%56 = call i64 @malloc(i32 %55)
%57 = inttoptr i64 %56 to double*
store double* %57, double** %26
%58 = load i32, i32* %12
%59 = sext i32 %58 to i64
%60 = mul i64 %59, 8
%61 = trunc i64 %60 to i32
%62 = call i64 @malloc(i32 %61)
%63 = inttoptr i64 %62 to double*
store double* %63, double** %27
%64 = load i32, i32* %12
%65 = sext i32 %64 to i64
%66 = mul i64 %65, 8
%67 = trunc i64 %66 to i32
%68 = call i64 @malloc(i32 %67)
%69 = inttoptr i64 %68 to double*
store double* %69, double** %28
%70 = load i32, i32* %12
%71 = sext i32 %70 to i64
%72 = mul i64 %71, 8
%73 = trunc i64 %72 to i32
%74 = call i64 @malloc(i32 %73)
%75 = inttoptr i64 %74 to double*
store double* %75, double** %29
%76 = load double, double* %8
%77 = load double*, double** %24
%78 = getelementptr inbounds double, double* %77, i64 0
store double %76, double* %78
store i32 1, i32* %14
br label %79
79: ; preds = %97, %6
%80 = load i32, i32* %14
%81 = load i32, i32* %12
%82 = add nsw i32 %81, 1
%83 = icmp slt i32 %80, %82
br i1 %83, label %84, label %100
84: ; preds = %79
%85 = load double*, double** %24
%86 = load i32, i32* %14
%87 = sub nsw i32 %86, 1
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds double, double* %85, i64 %88
%90 = load double, double* %89
%91 = load double, double* %17
%92 = fadd double %90, %91
%93 = load double*, double** %24
%94 = load i32, i32* %14
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds double, double* %93, i64 %95
store double %92, double* %96
br label %97
97: ; preds = %84
%98 = load i32, i32* %14
%99 = add nsw i32 %98, 1
store i32 %99, i32* %14
br label %79
100: ; preds = %79
%101 = load double, double* %9
%102 = load double*, double** %24
%103 = load i32, i32* %12
%104 = add nsw i32 %103, 1
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds double, double* %102, i64 %105
store double %101, double* %106
%107 = load double, double* %9
%108 = load double, double* %8
%109 = fsub double %107, %108
store double %109, double* %18
%110 = load double, double* %11
%111 = load double, double* %10
%112 = fsub double %110, %111
store double %112, double* %19
%113 = load double, double* %19
%114 = load double, double* %18
%115 = fdiv double %113, %114
store double %115, double* %20
%116 = load double, double* %10
%117 = load double*, double** %25
%118 = getelementptr inbounds double, double* %117, i64 0
store double %116, double* %118
store i32 1, i32* %14
br label %119
119: ; preds = %139, %100
%120 = load i32, i32* %14
%121 = load i32, i32* %12
%122 = add nsw i32 %121, 1
%123 = icmp slt i32 %120, %122
br i1 %123, label %124, label %142
124: ; preds = %119
%125 = load double, double* %10
%126 = load double, double* %20
%127 = load double*, double** %24
%128 = load i32, i32* %14
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds double, double* %127, i64 %129
%131 = load double, double* %130
%132 = load double, double* %8
%133 = fsub double %131, %132
%134 = call double @llvm.fmuladd.f64(double %126, double %133, double %125)
%135 = load double*, double** %25
%136 = load i32, i32* %14
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds double, double* %135, i64 %137
store double %134, double* %138
br label %139
139: ; preds = %124
%140 = load i32, i32* %14
%141 = add nsw i32 %140, 1
store i32 %141, i32* %14
br label %119
142: ; preds = %119
%143 = load double, double* %11
%144 = load double*, double** %25
%145 = load i32, i32* %12
%146 = add nsw i32 %145, 1
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds double, double* %144, i64 %147
store double %143, double* %148
store i32 0, i32* %16
br label %149
149: ; preds = %324, %142
store i32 0, i32* %14
br label %150
150: ; preds = %274, %149
%151 = load i32, i32* %14
%152 = load i32, i32* %12
%153 = icmp slt i32 %151, %152
br i1 %153, label %154, label %277
154: ; preds = %150
%155 = load i32, i32* %14
%156 = add nsw i32 %155, 1
store i32 %156, i32* %15
%157 = load double*, double** %25
%158 = load i32, i32* %15
%159 = add nsw i32 %158, 1
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds double, double* %157, i64 %160
%162 = load double, double* %161
%163 = load double*, double** %25
%164 = load i32, i32* %15
%165 = sub nsw i32 %164, 1
%166 = sext i32 %165 to i64
%167 = getelementptr inbounds double, double* %163, i64 %166
%168 = load double, double* %167
%169 = fsub double %162, %168
%170 = load double, double* %17
%171 = fmul double 2.000000e+00, %170
%172 = fdiv double %169, %171
store double %172, double* %21
%173 = load double, double* %17
%174 = fdiv double %173, 2.000000e+00
%175 = load double*, double** %24
%176 = load i32, i32* %15
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds double, double* %175, i64 %177
%179 = load double, double* %178
%180 = load double*, double** %25
%181 = load i32, i32* %15
%182 = sext i32 %181 to i64
%183 = getelementptr inbounds double, double* %180, i64 %182
%184 = load double, double* %183
%185 = load double, double* %21
%186 = call double @d3f(double %179, double %184, double %185)
%187 = fneg double %174
%188 = call double @llvm.fmuladd.f64(double %187, double %186, double -1.000000e+00)
%189 = load double*, double** %27
%190 = load i32, i32* %14
%191 = sext i32 %190 to i64
%192 = getelementptr inbounds double, double* %189, i64 %191
store double %188, double* %192
%193 = load double, double* %17
%194 = load double, double* %17
%195 = fmul double %193, %194
%196 = load double*, double** %24
%197 = load i32, i32* %15
%198 = sext i32 %197 to i64
%199 = getelementptr inbounds double, double* %196, i64 %198
%200 = load double, double* %199
%201 = load double*, double** %25
%202 = load i32, i32* %15
%203 = sext i32 %202 to i64
%204 = getelementptr inbounds double, double* %201, i64 %203
%205 = load double, double* %204
%206 = load double, double* %21
%207 = call double @d2f(double %200, double %205, double %206)
%208 = call double @llvm.fmuladd.f64(double %195, double %207, double 2.000000e+00)
%209 = load double*, double** %28
%210 = load i32, i32* %14
%211 = sext i32 %210 to i64
%212 = getelementptr inbounds double, double* %209, i64 %211
store double %208, double* %212
%213 = load double, double* %17
%214 = fdiv double %213, 2.000000e+00
%215 = load double*, double** %24
%216 = load i32, i32* %15
%217 = sext i32 %216 to i64
%218 = getelementptr inbounds double, double* %215, i64 %217
%219 = load double, double* %218
%220 = load double*, double** %25
%221 = load i32, i32* %15
%222 = sext i32 %221 to i64
%223 = getelementptr inbounds double, double* %220, i64 %222
%224 = load double, double* %223
%225 = load double, double* %21
%226 = call double @d3f(double %219, double %224, double %225)
%227 = call double @llvm.fmuladd.f64(double %214, double %226, double -1.000000e+00)
%228 = load double*, double** %29
%229 = load i32, i32* %14
%230 = sext i32 %229 to i64
%231 = getelementptr inbounds double, double* %228, i64 %230
store double %227, double* %231
%232 = load double*, double** %25
%233 = load i32, i32* %15
%234 = sub nsw i32 %233, 1
%235 = sext i32 %234 to i64
%236 = getelementptr inbounds double, double* %232, i64 %235
%237 = load double, double* %236
%238 = load double*, double** %25
%239 = load i32, i32* %15
%240 = sext i32 %239 to i64
%241 = getelementptr inbounds double, double* %238, i64 %240
%242 = load double, double* %241
%243 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %242, double %237)
%244 = load double*, double** %25
%245 = load i32, i32* %15
%246 = add nsw i32 %245, 1
%247 = sext i32 %246 to i64
%248 = getelementptr inbounds double, double* %244, i64 %247
%249 = load double, double* %248
%250 = fadd double %243, %249
%251 = load double, double* %17
%252 = load double, double* %17
%253 = fmul double %251, %252
%254 = load double*, double** %24
%255 = load i32, i32* %14
%256 = add nsw i32 %255, 1
%257 = sext i32 %256 to i64
%258 = getelementptr inbounds double, double* %254, i64 %257
%259 = load double, double* %258
%260 = load double*, double** %25
%261 = load i32, i32* %14
%262 = add nsw i32 %261, 1
%263 = sext i32 %262 to i64
%264 = getelementptr inbounds double, double* %260, i64 %263
%265 = load double, double* %264
%266 = load double, double* %21
%267 = call double @f(double %259, double %265, double %266)
%268 = fneg double %253
%269 = call double @llvm.fmuladd.f64(double %268, double %267, double %250)
%270 = load double*, double** %26
%271 = load i32, i32* %14
%272 = sext i32 %271 to i64
%273 = getelementptr inbounds double, double* %270, i64 %272
store double %269, double* %273
br label %274
274: ; preds = %154
%275 = load i32, i32* %14
%276 = add nsw i32 %275, 1
store i32 %276, i32* %14
br label %150
277: ; preds = %150
%278 = load i32, i32* %12
%279 = load double*, double** %27
%280 = load double*, double** %28
%281 = load double*, double** %29
%282 = load double*, double** %26
%283 = load double, double* %13
%284 = call i64 @d3(i32 %278, double* %279, double* %280, double* %281, double* %282, double %283)
%285 = icmp ne i64 %284, 0
br i1 %285, label %286, label %287
286: ; preds = %277
store i32 1, i32* %7
br label %349
287: ; preds = %277
%288 = load i32, i32* %12
%289 = load double*, double** %26
%290 = call double @normainf(i32 %288, double* %289)
store double %290, double* %23
%291 = load i32, i32* %16
%292 = add nsw i32 %291, 1
%293 = load double, double* %23
%294 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %292, double %293)
store i32 0, i32* %14
br label %295
295: ; preds = %311, %287
%296 = load i32, i32* %14
%297 = load i32, i32* %12
%298 = icmp slt i32 %296, %297
br i1 %298, label %299, label %314
299: ; preds = %295
%300 = load double*, double** %26
%301 = load i32, i32* %14
%302 = sext i32 %301 to i64
%303 = getelementptr inbounds double, double* %300, i64 %302
%304 = load double, double* %303
%305 = load double*, double** %25
%306 = load i32, i32* %14
%307 = sext i32 %306 to i64
%308 = getelementptr inbounds double, double* %305, i64 %307
%309 = load double, double* %308
%310 = fadd double %309, %304
store double %310, double* %308
br label %311
311: ; preds = %299
%312 = load i32, i32* %14
%313 = add nsw i32 %312, 1
store i32 %313, i32* %14
br label %295
314: ; preds = %295
%315 = load i32, i32* %16
%316 = add nsw i32 %315, 1
store i32 %316, i32* %16
br label %317
317: ; preds = %314
%318 = load i32, i32* %16
%319 = icmp slt i32 %318, 10
br i1 %319, label %320, label %324
320: ; preds = %317
%321 = load double, double* %23
%322 = load double, double* %13
%323 = fcmp ogt double %321, %322
br label %324
324: ; preds = %320, %317
%325 = phi i1 [ false, %317 ], [ %323, %320 ]
br i1 %325, label %149, label %326
326: ; preds = %324
%327 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %14
br label %328
328: ; preds = %345, %326
%329 = load i32, i32* %14
%330 = load i32, i32* %12
%331 = add nsw i32 %330, 2
%332 = icmp slt i32 %329, %331
br i1 %332, label %333, label %348
333: ; preds = %328
%334 = load double*, double** %24
%335 = load i32, i32* %14
%336 = sext i32 %335 to i64
%337 = getelementptr inbounds double, double* %334, i64 %336
%338 = load double, double* %337
%339 = load double*, double** %25
%340 = load i32, i32* %14
%341 = sext i32 %340 to i64
%342 = getelementptr inbounds double, double* %339, i64 %341
%343 = load double, double* %342
%344 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), double %338, double %343)
br label %345
345: ; preds = %333
%346 = load i32, i32* %14
%347 = add nsw i32 %346, 1
store i32 %347, i32* %14
br label %328
348: ; preds = %328
store i32 0, i32* %7
br label %349
349: ; preds = %348, %286
%350 = load i32, i32* %7
ret i32 %350
}

LLVM IR (-O2):
@.str = [34 x i8] c"Iteracio n\C2\BA %d\0Anorma = %25.16lf\0A\00"
@.str.2 = [19 x i8] c"%25.16lf %25.16lf\0A\00"
@str = [14 x i8] c"Resultat:\0Ax\09y\00"
define i32 @newton(double %0, double %1, double %2, double %3, i32 %4, double %5) {
%7 = fsub double %1, %0
%8 = add i32 %4, 1
%9 = sitofp i32 %8 to double
%10 = fdiv double %7, %9
%11 = add nsw i32 %4, 2
%12 = shl i32 %11, 3
%13 = tail call i64 @malloc(i32 %12)
%14 = inttoptr i64 %13 to double*
%15 = tail call i64 @malloc(i32 %12)
%16 = inttoptr i64 %15 to double*
%17 = inttoptr i64 %15 to i8*
%18 = shl i32 %4, 3
%19 = tail call i64 @malloc(i32 %18)
%20 = inttoptr i64 %19 to double*
%21 = inttoptr i64 %19 to i8*
%22 = tail call i64 @malloc(i32 %18)
%23 = inttoptr i64 %22 to double*
%24 = tail call i64 @malloc(i32 %18)
%25 = inttoptr i64 %24 to double*
%26 = tail call i64 @malloc(i32 %18)
%27 = inttoptr i64 %26 to double*
store double %0, double* %14
%28 = icmp slt i32 %4, 1
br i1 %28, label %29, label %32
29: ; preds = %6
%30 = sext i32 %8 to i64
%31 = getelementptr inbounds double, double* %14, i64 %30
store double %1, double* %31
store double %2, double* %16
br label %199
32: ; preds = %6
%33 = zext i32 %8 to i64
%34 = add nsw i64 %33, -1
%35 = add nsw i64 %33, -2
%36 = and i64 %34, 3
%37 = icmp ult i64 %35, 3
br i1 %37, label %58, label %38
38: ; preds = %32
%39 = and i64 %34, -4
br label %40
40: ; preds = %40, %38
%41 = phi double [ %0, %38 ], [ %53, %40 ]
%42 = phi i64 [ 1, %38 ], [ %55, %40 ]
%43 = phi i64 [ 0, %38 ], [ %56, %40 ]
%44 = fadd double %10, %41
%45 = getelementptr inbounds double, double* %14, i64 %42
store double %44, double* %45
%46 = add nuw nsw i64 %42, 1
%47 = fadd double %10, %44
%48 = getelementptr inbounds double, double* %14, i64 %46
store double %47, double* %48
%49 = add nuw nsw i64 %42, 2
%50 = fadd double %10, %47
%51 = getelementptr inbounds double, double* %14, i64 %49
store double %50, double* %51
%52 = add nuw nsw i64 %42, 3
%53 = fadd double %10, %50
%54 = getelementptr inbounds double, double* %14, i64 %52
store double %53, double* %54
%55 = add nuw nsw i64 %42, 4
%56 = add i64 %43, 4
%57 = icmp eq i64 %56, %39
br i1 %57, label %58, label %40
58: ; preds = %40, %32
%59 = phi double [ %0, %32 ], [ %53, %40 ]
%60 = phi i64 [ 1, %32 ], [ %55, %40 ]
%61 = icmp eq i64 %36, 0
br i1 %61, label %71, label %62
62: ; preds = %58, %62
%63 = phi double [ %66, %62 ], [ %59, %58 ]
%64 = phi i64 [ %68, %62 ], [ %60, %58 ]
%65 = phi i64 [ %69, %62 ], [ 0, %58 ]
%66 = fadd double %10, %63
%67 = getelementptr inbounds double, double* %14, i64 %64
store double %66, double* %67
%68 = add nuw nsw i64 %64, 1
%69 = add i64 %65, 1
%70 = icmp eq i64 %69, %36
br i1 %70, label %71, label %62
71: ; preds = %62, %58
%72 = sext i32 %8 to i64
%73 = getelementptr inbounds double, double* %14, i64 %72
store double %1, double* %73
%74 = fsub double %3, %2
%75 = fdiv double %74, %7
store double %2, double* %16
br i1 %28, label %199, label %76
76: ; preds = %71
%77 = zext i32 %8 to i64
%78 = add nsw i64 %33, -1
%79 = icmp ult i64 %78, 4
br i1 %79, label %168, label %80
80: ; preds = %76
%81 = getelementptr double, double* %16, i64 1
%82 = getelementptr double, double* %16, i64 %33
%83 = getelementptr double, double* %14, i64 1
%84 = getelementptr double, double* %14, i64 %33
%85 = icmp ult double* %81, %84
%86 = icmp ult double* %83, %82
%87 = and i1 %85, %86
br i1 %87, label %168, label %88
88: ; preds = %80
%89 = and i64 %78, -4
%90 = or i64 %89, 1
%91 = insertelement <2 x double> poison, double %0, i64 0
%92 = shufflevector <2 x double> %91, <2 x double> poison, <2 x i32> zeroinitializer
%93 = insertelement <2 x double> poison, double %0, i64 0
%94 = shufflevector <2 x double> %93, <2 x double> poison, <2 x i32> zeroinitializer
%95 = insertelement <2 x double> poison, double %75, i64 0
%96 = shufflevector <2 x double> %95, <2 x double> poison, <2 x i32> zeroinitializer
%97 = insertelement <2 x double> poison, double %2, i64 0
%98 = shufflevector <2 x double> %97, <2 x double> poison, <2 x i32> zeroinitializer
%99 = insertelement <2 x double> poison, double %75, i64 0
%100 = shufflevector <2 x double> %99, <2 x double> poison, <2 x i32> zeroinitializer
%101 = insertelement <2 x double> poison, double %2, i64 0
%102 = shufflevector <2 x double> %101, <2 x double> poison, <2 x i32> zeroinitializer
%103 = add nsw i64 %89, -4
%104 = lshr exact i64 %103, 2
%105 = add nuw nsw i64 %104, 1
%106 = and i64 %105, 1
%107 = icmp eq i64 %103, 0
br i1 %107, label %148, label %108
108: ; preds = %88
%109 = and i64 %105, 9223372036854775806
br label %110
110: ; preds = %110, %108
%111 = phi i64 [ 0, %108 ], [ %143, %110 ]
%112 = phi i64 [ 0, %108 ], [ %144, %110 ]
%113 = or i64 %111, 1
%114 = getelementptr inbounds double, double* %14, i64 %113
%115 = bitcast double* %114 to <2 x double>*
%116 = load <2 x double>, <2 x double>* %115
%117 = getelementptr inbounds double, double* %114, i64 2
%118 = bitcast double* %117 to <2 x double>*
%119 = load <2 x double>, <2 x double>* %118
%120 = fsub <2 x double> %116, %92
%121 = fsub <2 x double> %119, %94
%122 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %96, <2 x double> %120, <2 x double> %98)
%123 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %100, <2 x double> %121, <2 x double> %102)
%124 = getelementptr inbounds double, double* %16, i64 %113
%125 = bitcast double* %124 to <2 x double>*
store <2 x double> %122, <2 x double>* %125
%126 = getelementptr inbounds double, double* %124, i64 2
%127 = bitcast double* %126 to <2 x double>*
store <2 x double> %123, <2 x double>* %127
%128 = or i64 %111, 5
%129 = getelementptr inbounds double, double* %14, i64 %128
%130 = bitcast double* %129 to <2 x double>*
%131 = load <2 x double>, <2 x double>* %130
%132 = getelementptr inbounds double, double* %129, i64 2
%133 = bitcast double* %132 to <2 x double>*
%134 = load <2 x double>, <2 x double>* %133
%135 = fsub <2 x double> %131, %92
%136 = fsub <2 x double> %134, %94
%137 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %96, <2 x double> %135, <2 x double> %98)
%138 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %100, <2 x double> %136, <2 x double> %102)
%139 = getelementptr inbounds double, double* %16, i64 %128
%140 = bitcast double* %139 to <2 x double>*
store <2 x double> %137, <2 x double>* %140
%141 = getelementptr inbounds double, double* %139, i64 2
%142 = bitcast double* %141 to <2 x double>*
store <2 x double> %138, <2 x double>* %142
%143 = add nuw i64 %111, 8
%144 = add i64 %112, 2
%145 = icmp eq i64 %144, %109
br i1 %145, label %146, label %110
146: ; preds = %110
%147 = or i64 %143, 1
br label %148
148: ; preds = %146, %88
%149 = phi i64 [ 1, %88 ], [ %147, %146 ]
%150 = icmp eq i64 %106, 0
br i1 %150, label %166, label %151
151: ; preds = %148
%152 = getelementptr inbounds double, double* %14, i64 %149
%153 = bitcast double* %152 to <2 x double>*
%154 = load <2 x double>, <2 x double>* %153
%155 = getelementptr inbounds double, double* %152, i64 2
%156 = bitcast double* %155 to <2 x double>*
%157 = load <2 x double>, <2 x double>* %156
%158 = fsub <2 x double> %154, %92
%159 = fsub <2 x double> %157, %94
%160 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %96, <2 x double> %158, <2 x double> %98)
%161 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %100, <2 x double> %159, <2 x double> %102)
%162 = getelementptr inbounds double, double* %16, i64 %149
%163 = bitcast double* %162 to <2 x double>*
store <2 x double> %160, <2 x double>* %163
%164 = getelementptr inbounds double, double* %162, i64 2
%165 = bitcast double* %164 to <2 x double>*
store <2 x double> %161, <2 x double>* %165
br label %166
166: ; preds = %148, %151
%167 = icmp eq i64 %78, %89
br i1 %167, label %199, label %168
168: ; preds = %80, %76, %166
%169 = phi i64 [ 1, %80 ], [ 1, %76 ], [ %90, %166 ]
%170 = xor i64 %169, -1
%171 = and i64 %33, 1
%172 = icmp eq i64 %171, 0
br i1 %172, label %173, label %180
173: ; preds = %168
%174 = getelementptr inbounds double, double* %14, i64 %169
%175 = load double, double* %174
%176 = fsub double %175, %0
%177 = tail call double @llvm.fmuladd.f64(double %75, double %176, double %2)
%178 = getelementptr inbounds double, double* %16, i64 %169
store double %177, double* %178
%179 = add nuw nsw i64 %169, 1
br label %180
180: ; preds = %173, %168
%181 = phi i64 [ %169, %168 ], [ %179, %173 ]
%182 = sub nsw i64 0, %33
%183 = icmp eq i64 %170, %182
br i1 %183, label %199, label %184
184: ; preds = %180, %184
%185 = phi i64 [ %197, %184 ], [ %181, %180 ]
%186 = getelementptr inbounds double, double* %14, i64 %185
%187 = load double, double* %186
%188 = fsub double %187, %0
%189 = tail call double @llvm.fmuladd.f64(double %75, double %188, double %2)
%190 = getelementptr inbounds double, double* %16, i64 %185
store double %189, double* %190
%191 = add nuw nsw i64 %185, 1
%192 = getelementptr inbounds double, double* %14, i64 %191
%193 = load double, double* %192
%194 = fsub double %193, %0
%195 = tail call double @llvm.fmuladd.f64(double %75, double %194, double %2)
%196 = getelementptr inbounds double, double* %16, i64 %191
store double %195, double* %196
%197 = add nuw nsw i64 %185, 2
%198 = icmp eq i64 %197, %77
br i1 %198, label %199, label %184
199: ; preds = %180, %184, %166, %29, %71
%200 = phi i64 [ %30, %29 ], [ %72, %71 ], [ %72, %166 ], [ %72, %184 ], [ %72, %180 ]
%201 = getelementptr inbounds double, double* %16, i64 %200
store double %3, double* %201
%202 = icmp sgt i32 %4, 0
%203 = fmul double %10, 2.000000e+00
%204 = fmul double %10, 5.000000e-01
%205 = fneg double %204
%206 = fmul double %10, %10
%207 = fneg double %206
%208 = zext i32 %4 to i64
%209 = zext i32 %4 to i64
%210 = getelementptr double, double* %16, i64 %208
%211 = bitcast double* %210 to i8*
%212 = getelementptr double, double* %20, i64 %208
%213 = bitcast double* %212 to i8*
%214 = and i64 %208, 4294967292
%215 = add nsw i64 %214, -4
%216 = lshr exact i64 %215, 2
%217 = add nuw nsw i64 %216, 1
%218 = icmp ult i32 %4, 4
%219 = icmp ult i8* %17, %213
%220 = icmp ult i8* %21, %211
%221 = and i1 %219, %220
%222 = and i64 %208, 4294967292
%223 = and i64 %217, 1
%224 = icmp eq i64 %215, 0
%225 = and i64 %217, 9223372036854775806
%226 = icmp eq i64 %223, 0
%227 = icmp eq i64 %222, %208
%228 = and i64 %208, 3
%229 = icmp eq i64 %228, 0
br label %230
230: ; preds = %383, %199
%231 = phi i32 [ 0, %199 ], [ %274, %383 ]
br i1 %202, label %232, label %269
232: ; preds = %230, %232
%233 = phi i64 [ %234, %232 ], [ 0, %230 ]
%234 = add nuw nsw i64 %233, 1
%235 = add nuw nsw i64 %233, 2
%236 = getelementptr inbounds double, double* %16, i64 %235
%237 = load double, double* %236
%238 = getelementptr inbounds double, double* %16, i64 %233
%239 = load double, double* %238
%240 = fsub double %237, %239
%241 = fdiv double %240, %203
%242 = getelementptr inbounds double, double* %14, i64 %234
%243 = load double, double* %242
%244 = getelementptr inbounds double, double* %16, i64 %234
%245 = load double, double* %244
%246 = tail call double @d3f(double %243, double %245, double %241)
%247 = tail call double @llvm.fmuladd.f64(double %205, double %246, double -1.000000e+00)
%248 = getelementptr inbounds double, double* %23, i64 %233
store double %247, double* %248
%249 = load double, double* %242
%250 = load double, double* %244
%251 = tail call double @d2f(double %249, double %250, double %241)
%252 = tail call double @llvm.fmuladd.f64(double %206, double %251, double 2.000000e+00)
%253 = getelementptr inbounds double, double* %25, i64 %233
store double %252, double* %253
%254 = load double, double* %242
%255 = load double, double* %244
%256 = tail call double @d3f(double %254, double %255, double %241)
%257 = tail call double @llvm.fmuladd.f64(double %204, double %256, double -1.000000e+00)
%258 = getelementptr inbounds double, double* %27, i64 %233
store double %257, double* %258
%259 = load double, double* %238
%260 = load double, double* %244
%261 = tail call double @llvm.fmuladd.f64(double %260, double -2.000000e+00, double %259)
%262 = load double, double* %236
%263 = fadd double %261, %262
%264 = load double, double* %242
%265 = tail call double @f(double %264, double %260, double %241)
%266 = tail call double @llvm.fmuladd.f64(double %207, double %265, double %263)
%267 = getelementptr inbounds double, double* %20, i64 %233
store double %266, double* %267
%268 = icmp eq i64 %234, %208
br i1 %268, label %269, label %232
269: ; preds = %232, %230
%270 = tail call i64 @d3(i32 %4, double* %23, double* %25, double* %27, double* %20, double %5)
%271 = icmp eq i64 %270, 0
br i1 %271, label %272, label %402
272: ; preds = %269
%273 = tail call double @normainf(i32 %4, double* %20)
%274 = add nuw nsw i32 %231, 1
%275 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %274, double %273)
br i1 %202, label %276, label %383
276: ; preds = %272
%277 = select i1 %218, i1 true, i1 %221
br i1 %277, label %338, label %278
278: ; preds = %276
br i1 %224, label %318, label %279
279: ; preds = %278, %279
%280 = phi i64 [ %315, %279 ], [ 0, %278 ]
%281 = phi i64 [ %316, %279 ], [ 0, %278 ]
%282 = getelementptr inbounds double, double* %20, i64 %280
%283 = bitcast double* %282 to <2 x double>*
%284 = load <2 x double>, <2 x double>* %283
%285 = getelementptr inbounds double, double* %282, i64 2
%286 = bitcast double* %285 to <2 x double>*
%287 = load <2 x double>, <2 x double>* %286
%288 = getelementptr inbounds double, double* %16, i64 %280
%289 = bitcast double* %288 to <2 x double>*
%290 = load <2 x double>, <2 x double>* %289
%291 = getelementptr inbounds double, double* %288, i64 2
%292 = bitcast double* %291 to <2 x double>*
%293 = load <2 x double>, <2 x double>* %292
%294 = fadd <2 x double> %284, %290
%295 = fadd <2 x double> %287, %293
%296 = bitcast double* %288 to <2 x double>*
store <2 x double> %294, <2 x double>* %296
%297 = bitcast double* %291 to <2 x double>*
store <2 x double> %295, <2 x double>* %297
%298 = or i64 %280, 4
%299 = getelementptr inbounds double, double* %20, i64 %298
%300 = bitcast double* %299 to <2 x double>*
%301 = load <2 x double>, <2 x double>* %300
%302 = getelementptr inbounds double, double* %299, i64 2
%303 = bitcast double* %302 to <2 x double>*
%304 = load <2 x double>, <2 x double>* %303
%305 = getelementptr inbounds double, double* %16, i64 %298
%306 = bitcast double* %305 to <2 x double>*
%307 = load <2 x double>, <2 x double>* %306
%308 = getelementptr inbounds double, double* %305, i64 2
%309 = bitcast double* %308 to <2 x double>*
%310 = load <2 x double>, <2 x double>* %309
%311 = fadd <2 x double> %301, %307
%312 = fadd <2 x double> %304, %310
%313 = bitcast double* %305 to <2 x double>*
store <2 x double> %311, <2 x double>* %313
%314 = bitcast double* %308 to <2 x double>*
store <2 x double> %312, <2 x double>* %314
%315 = add nuw i64 %280, 8
%316 = add i64 %281, 2
%317 = icmp eq i64 %316, %225
br i1 %317, label %318, label %279
318: ; preds = %279, %278
%319 = phi i64 [ 0, %278 ], [ %315, %279 ]
br i1 %226, label %337, label %320
320: ; preds = %318
%321 = getelementptr inbounds double, double* %20, i64 %319
%322 = bitcast double* %321 to <2 x double>*
%323 = load <2 x double>, <2 x double>* %322
%324 = getelementptr inbounds double, double* %321, i64 2
%325 = bitcast double* %324 to <2 x double>*
%326 = load <2 x double>, <2 x double>* %325
%327 = getelementptr inbounds double, double* %16, i64 %319
%328 = bitcast double* %327 to <2 x double>*
%329 = load <2 x double>, <2 x double>* %328
%330 = getelementptr inbounds double, double* %327, i64 2
%331 = bitcast double* %330 to <2 x double>*
%332 = load <2 x double>, <2 x double>* %331
%333 = fadd <2 x double> %323, %329
%334 = fadd <2 x double> %326, %332
%335 = bitcast double* %327 to <2 x double>*
store <2 x double> %333, <2 x double>* %335
%336 = bitcast double* %330 to <2 x double>*
store <2 x double> %334, <2 x double>* %336
br label %337
337: ; preds = %318, %320
br i1 %227, label %383, label %338
338: ; preds = %276, %337
%339 = phi i64 [ 0, %276 ], [ %222, %337 ]
%340 = xor i64 %339, -1
%341 = add nsw i64 %340, %208
br i1 %229, label %353, label %342
342: ; preds = %338, %342
%343 = phi i64 [ %350, %342 ], [ %339, %338 ]
%344 = phi i64 [ %351, %342 ], [ 0, %338 ]
%345 = getelementptr inbounds double, double* %20, i64 %343
%346 = load double, double* %345
%347 = getelementptr inbounds double, double* %16, i64 %343
%348 = load double, double* %347
%349 = fadd double %346, %348
store double %349, double* %347
%350 = add nuw nsw i64 %343, 1
%351 = add i64 %344, 1
%352 = icmp eq i64 %351, %228
br i1 %352, label %353, label %342
353: ; preds = %342, %338
%354 = phi i64 [ %339, %338 ], [ %350, %342 ]
%355 = icmp ult i64 %341, 3
br i1 %355, label %383, label %356
356: ; preds = %353, %356
%357 = phi i64 [ %381, %356 ], [ %354, %353 ]
%358 = getelementptr inbounds double, double* %20, i64 %357
%359 = load double, double* %358
%360 = getelementptr inbounds double, double* %16, i64 %357
%361 = load double, double* %360
%362 = fadd double %359, %361
store double %362, double* %360
%363 = add nuw nsw i64 %357, 1
%364 = getelementptr inbounds double, double* %20, i64 %363
%365 = load double, double* %364
%366 = getelementptr inbounds double, double* %16, i64 %363
%367 = load double, double* %366
%368 = fadd double %365, %367
store double %368, double* %366
%369 = add nuw nsw i64 %357, 2
%370 = getelementptr inbounds double, double* %20, i64 %369
%371 = load double, double* %370
%372 = getelementptr inbounds double, double* %16, i64 %369
%373 = load double, double* %372
%374 = fadd double %371, %373
store double %374, double* %372
%375 = add nuw nsw i64 %357, 3
%376 = getelementptr inbounds double, double* %20, i64 %375
%377 = load double, double* %376
%378 = getelementptr inbounds double, double* %16, i64 %375
%379 = load double, double* %378
%380 = fadd double %377, %379
store double %380, double* %378
%381 = add nuw nsw i64 %357, 4
%382 = icmp eq i64 %381, %209
br i1 %382, label %383, label %356
383: ; preds = %353, %356, %337, %272
%384 = icmp ult i32 %231, 9
%385 = fcmp ogt double %273, %5
%386 = and i1 %384, %385
br i1 %386, label %230, label %387
387: ; preds = %383
%388 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%389 = icmp sgt i32 %4, -2
br i1 %389, label %390, label %402
390: ; preds = %387
%391 = call i32 @llvm.smax.i32(i32 %11, i32 1)
%392 = zext i32 %391 to i64
br label %393
393: ; preds = %390, %393
%394 = phi i64 [ 0, %390 ], [ %400, %393 ]
%395 = getelementptr inbounds double, double* %14, i64 %394
%396 = load double, double* %395
%397 = getelementptr inbounds double, double* %16, i64 %394
%398 = load double, double* %397
%399 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), double %396, double %398)
%400 = add nuw nsw i64 %394, 1
%401 = icmp eq i64 %400, %392
br i1 %401, label %402, label %393
402: ; preds = %269, %393, %387
%403 = phi i32 [ 0, %387 ], [ 0, %393 ], [ 1, %269 ]
ret i32 %403
}