#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double f(double);
double fd(double);
int /*<<< orphan*/ printf(char *, double);
int main() {
  double x = 0;
  int i;
  for (i = 0; i < 10; i++) {
    printf("%16.16f\n", x);
    x = x - f(x) / fd(x);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    11b4 <main+0x84>
movsd  -0x10(%rbp),%xmm0
lea    0xe9c(%rip),%rdi
call   1050 <printf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <f@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <fd@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114e <main+0x1e>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
xorpd  %xmm0,%xmm0
mov    %rbx,%rdi
call   1050 <printf@plt>
xorpd  %xmm0,%xmm0
call   1040 <f@plt>
movsd  %xmm0,(%rsp)
xorpd  %xmm0,%xmm0
call   1030 <fd@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
mov    %rbx,%rdi
call   1050 <printf@plt>
movsd  (%rsp),%xmm0
call   1040 <f@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1030 <fd@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  (%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
mov    %rbx,%rdi
call   1050 <printf@plt>
movsd  (%rsp),%xmm0
call   1040 <f@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1030 <fd@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  (%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
mov    %rbx,%rdi
call   1050 <printf@plt>
movsd  (%rsp),%xmm0
call   1040 <f@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1030 <fd@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  (%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
mov    %rbx,%rdi
call   1050 <printf@plt>
movsd  (%rsp),%xmm0
call   1040 <f@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1030 <fd@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  (%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
mov    %rbx,%rdi
call   1050 <printf@plt>
movsd  (%rsp),%xmm0
call   1040 <f@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1030 <fd@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  (%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
mov    %rbx,%rdi
call   1050 <printf@plt>
movsd  (%rsp),%xmm0
call   1040 <f@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1030 <fd@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  (%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
mov    %rbx,%rdi
call   1050 <printf@plt>
movsd  (%rsp),%xmm0
call   1040 <f@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1030 <fd@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  (%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
mov    %rbx,%rdi
call   1050 <printf@plt>
movsd  (%rsp),%xmm0
call   1040 <f@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1030 <fd@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  (%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
mov    %rbx,%rdi
call   1050 <printf@plt>
movsd  (%rsp),%xmm0
call   1040 <f@plt>
movsd  (%rsp),%xmm0
call   1030 <fd@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%16.16f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i32
store i32 0, i32* %1
store double 0.000000e+00, double* %2
store i32 0, i32* %3
br label %4
4: ; preds = %17, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %20
7: ; preds = %4
%8 = load double, double* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %8)
%10 = load double, double* %2
%11 = load double, double* %2
%12 = call double @f(double %11)
%13 = load double, double* %2
%14 = call double @fd(double %13)
%15 = fdiv double %12, %14
%16 = fsub double %10, %15
store double %16, double* %2
br label %17
17: ; preds = %7
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %4
20: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%16.16f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double 0.000000e+00)
%2 = tail call double @f(double 0.000000e+00)
%3 = tail call double @fd(double 0.000000e+00)
%4 = fdiv double %2, %3
%5 = fsub double 0.000000e+00, %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %5)
%7 = tail call double @f(double %5)
%8 = tail call double @fd(double %5)
%9 = fdiv double %7, %8
%10 = fsub double %5, %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %10)
%12 = tail call double @f(double %10)
%13 = tail call double @fd(double %10)
%14 = fdiv double %12, %13
%15 = fsub double %10, %14
%16 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %15)
%17 = tail call double @f(double %15)
%18 = tail call double @fd(double %15)
%19 = fdiv double %17, %18
%20 = fsub double %15, %19
%21 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %20)
%22 = tail call double @f(double %20)
%23 = tail call double @fd(double %20)
%24 = fdiv double %22, %23
%25 = fsub double %20, %24
%26 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %25)
%27 = tail call double @f(double %25)
%28 = tail call double @fd(double %25)
%29 = fdiv double %27, %28
%30 = fsub double %25, %29
%31 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %30)
%32 = tail call double @f(double %30)
%33 = tail call double @fd(double %30)
%34 = fdiv double %32, %33
%35 = fsub double %30, %34
%36 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %35)
%37 = tail call double @f(double %35)
%38 = tail call double @fd(double %35)
%39 = fdiv double %37, %38
%40 = fsub double %35, %39
%41 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %40)
%42 = tail call double @f(double %40)
%43 = tail call double @fd(double %40)
%44 = fdiv double %42, %43
%45 = fsub double %40, %44
%46 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %45)
%47 = tail call double @f(double %45)
%48 = tail call double @fd(double %45)
ret i32 0
}