#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);
double fabs(double);
int /*<<< orphan*/ printf(char *, ...);
double sol(double);
int main() {
  double y0 = 1, x0 = 0;
  double h = 0.1;
  printf("x\t      y(computed)\ty(actual)\tabs_error");
  do {
    double yact = sol(x0);
    double error = fabs(yact - y0);
    printf("\n%lf\t%lf\t%lf\t%lf", x0, y0, yact, error);
    y0 = y0 + (h * f(x0, y0));
    x0 = x0 + h;
  } while (x0 < 1);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xea4(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsd  -0x18(%rbp),%xmm0
call   1050 <sol@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movaps 0xe81(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
lea    0xe95(%rip),%rdi
mov    $0x4,%al
call   1040 <printf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <f@plt>
movsd  -0x40(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xdfa(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
ja     116f <main+0x3f>
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xf24(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xorpd  %xmm0,%xmm0
call   1060 <sol@plt>
movapd %xmm0,%xmm2
movsd  0xe98(%rip),%xmm3
addsd  %xmm0,%xmm3
andpd  0xeec(%rip),%xmm3
lea    0xf1d(%rip),%rbx
movsd  0xe85(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
xorpd  %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x4,%al
call   1050 <printf@plt>
xorpd  %xmm0,%xmm0
movsd  0xe65(%rip),%xmm1
call   1040 <f@plt>
movsd  0xe60(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x8(%rsp),%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,0x8(%rsp)
movapd %xmm1,%xmm0
call   1060 <sol@plt>
movapd %xmm0,%xmm2
movapd %xmm0,%xmm3
movsd  0x8(%rsp),%xmm1
subsd  %xmm1,%xmm3
andpd  0xe79(%rip),%xmm3
mov    %rbx,%rdi
movsd  0xe1e(%rip),%xmm0
mov    $0x4,%al
call   1050 <printf@plt>
movsd  0xe0f(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <f@plt>
mulsd  0xdfc(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xdec(%rip),%xmm0
call   1060 <sol@plt>
movapd %xmm0,%xmm2
movapd %xmm0,%xmm3
movsd  0x8(%rsp),%xmm1
subsd  %xmm1,%xmm3
andpd  0xe15(%rip),%xmm3
mov    %rbx,%rdi
movsd  0xdc2(%rip),%xmm0
mov    $0x4,%al
call   1050 <printf@plt>
movsd  0xdb3(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <f@plt>
mulsd  0xd98(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xd90(%rip),%xmm0
call   1060 <sol@plt>
movapd %xmm0,%xmm2
movapd %xmm0,%xmm3
movsd  0x8(%rsp),%xmm1
subsd  %xmm1,%xmm3
andpd  0xdb1(%rip),%xmm3
mov    %rbx,%rdi
movsd  0xd66(%rip),%xmm0
mov    $0x4,%al
call   1050 <printf@plt>
movsd  0xd57(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <f@plt>
mulsd  0xd34(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xd34(%rip),%xmm0
call   1060 <sol@plt>
movapd %xmm0,%xmm2
movapd %xmm0,%xmm3
movsd  0x8(%rsp),%xmm1
subsd  %xmm1,%xmm3
andpd  0xd4d(%rip),%xmm3
mov    %rbx,%rdi
movsd  0xd0a(%rip),%xmm0
mov    $0x4,%al
call   1050 <printf@plt>
movsd  0xcfb(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <f@plt>
mulsd  0xcd0(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xcd8(%rip),%xmm0
call   1060 <sol@plt>
movapd %xmm0,%xmm2
movapd %xmm0,%xmm3
movsd  0x8(%rsp),%xmm1
subsd  %xmm1,%xmm3
andpd  0xce9(%rip),%xmm3
mov    %rbx,%rdi
movsd  0xcae(%rip),%xmm0
mov    $0x4,%al
call   1050 <printf@plt>
movsd  0xc9f(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <f@plt>
mulsd  0xc6c(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xc7c(%rip),%xmm0
call   1060 <sol@plt>
movapd %xmm0,%xmm2
movapd %xmm0,%xmm3
movsd  0x8(%rsp),%xmm1
subsd  %xmm1,%xmm3
andpd  0xc85(%rip),%xmm3
mov    %rbx,%rdi
movsd  0xc52(%rip),%xmm0
mov    $0x4,%al
call   1050 <printf@plt>
movsd  0xc43(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <f@plt>
mulsd  0xc08(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xc20(%rip),%xmm0
call   1060 <sol@plt>
movapd %xmm0,%xmm2
movapd %xmm0,%xmm3
movsd  0x8(%rsp),%xmm1
subsd  %xmm1,%xmm3
andpd  0xc21(%rip),%xmm3
mov    %rbx,%rdi
movsd  0xbf6(%rip),%xmm0
mov    $0x4,%al
call   1050 <printf@plt>
movsd  0xbe7(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <f@plt>
mulsd  0xba4(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xbc4(%rip),%xmm0
call   1060 <sol@plt>
movapd %xmm0,%xmm2
movapd %xmm0,%xmm3
movsd  0x8(%rsp),%xmm1
subsd  %xmm1,%xmm3
andpd  0xbbd(%rip),%xmm3
mov    %rbx,%rdi
movsd  0xb9a(%rip),%xmm0
mov    $0x4,%al
call   1050 <printf@plt>
movsd  0xb8b(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <f@plt>
mulsd  0xb40(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xb68(%rip),%xmm0
call   1060 <sol@plt>
movapd %xmm0,%xmm2
movapd %xmm0,%xmm3
movsd  0x8(%rsp),%xmm1
subsd  %xmm1,%xmm3
andpd  0xb59(%rip),%xmm3
mov    %rbx,%rdi
movsd  0xb3e(%rip),%xmm0
mov    $0x4,%al
call   1050 <printf@plt>
movsd  0xb2f(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <f@plt>
movsd  0xadc(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x8(%rsp),%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xb0c(%rip),%xmm0
call   1060 <sol@plt>
movapd %xmm0,%xmm2
movapd %xmm0,%xmm3
movsd  0x8(%rsp),%xmm1
subsd  %xmm1,%xmm3
andpd  0xaf5(%rip),%xmm3
mov    %rbx,%rdi
movsd  0xae2(%rip),%xmm0
mov    $0x4,%al
call   1050 <printf@plt>
movsd  0xad3(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <f@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"x\09 y(computed)\09y(actual)\09abs_error\00"
@.str.1 = [17 x i8] c"\0A%lf\09%lf\09%lf\09%lf\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store i32 0, i32* %1
store double 1.000000e+00, double* %2
store double 0.000000e+00, double* %3
store double 1.000000e-01, double* %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %29, %0
%9 = load double, double* %3
%10 = call double @sol(double %9)
store double %10, double* %5
%11 = load double, double* %5
%12 = load double, double* %2
%13 = fsub double %11, %12
%14 = call double @llvm.fabs.f64(double %13)
store double %14, double* %6
%15 = load double, double* %3
%16 = load double, double* %2
%17 = load double, double* %5
%18 = load double, double* %6
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double %15, double %16, double %17, double %18)
%20 = load double, double* %2
%21 = load double, double* %4
%22 = load double, double* %3
%23 = load double, double* %2
%24 = call double @f(double %22, double %23)
%25 = call double @llvm.fmuladd.f64(double %21, double %24, double %20)
store double %25, double* %2
%26 = load double, double* %3
%27 = load double, double* %4
%28 = fadd double %26, %27
store double %28, double* %3
br label %29
29: ; preds = %8
%30 = load double, double* %3
%31 = fcmp olt double %30, 1.000000e+00
br i1 %31, label %8, label %32
32: ; preds = %29
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"x\09 y(computed)\09y(actual)\09abs_error\00"
@.str.1 = [17 x i8] c"\0A%lf\09%lf\09%lf\09%lf\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = tail call double @sol(double 0.000000e+00)
%3 = fadd double %2, -1.000000e+00
%4 = tail call double @llvm.fabs.f64(double %3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double 0.000000e+00, double 1.000000e+00, double %2, double %4)
%6 = tail call double @f(double 0.000000e+00, double 1.000000e+00)
%7 = tail call double @llvm.fmuladd.f64(double %6, double 1.000000e-01, double 1.000000e+00)
%8 = tail call double @sol(double 1.000000e-01)
%9 = fsub double %8, %7
%10 = tail call double @llvm.fabs.f64(double %9)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double 1.000000e-01, double %7, double %8, double %10)
%12 = tail call double @f(double 1.000000e-01, double %7)
%13 = tail call double @llvm.fmuladd.f64(double %12, double 1.000000e-01, double %7)
%14 = tail call double @sol(double 2.000000e-01)
%15 = fsub double %14, %13
%16 = tail call double @llvm.fabs.f64(double %15)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double 2.000000e-01, double %13, double %14, double %16)
%18 = tail call double @f(double 2.000000e-01, double %13)
%19 = tail call double @llvm.fmuladd.f64(double %18, double 1.000000e-01, double %13)
%20 = tail call double @sol(double 0x3FD3333333333334)
%21 = fsub double %20, %19
%22 = tail call double @llvm.fabs.f64(double %21)
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double 0x3FD3333333333334, double %19, double %20, double %22)
%24 = tail call double @f(double 0x3FD3333333333334, double %19)
%25 = tail call double @llvm.fmuladd.f64(double %24, double 1.000000e-01, double %19)
%26 = tail call double @sol(double 4.000000e-01)
%27 = fsub double %26, %25
%28 = tail call double @llvm.fabs.f64(double %27)
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double 4.000000e-01, double %25, double %26, double %28)
%30 = tail call double @f(double 4.000000e-01, double %25)
%31 = tail call double @llvm.fmuladd.f64(double %30, double 1.000000e-01, double %25)
%32 = tail call double @sol(double 5.000000e-01)
%33 = fsub double %32, %31
%34 = tail call double @llvm.fabs.f64(double %33)
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double 5.000000e-01, double %31, double %32, double %34)
%36 = tail call double @f(double 5.000000e-01, double %31)
%37 = tail call double @llvm.fmuladd.f64(double %36, double 1.000000e-01, double %31)
%38 = tail call double @sol(double 6.000000e-01)
%39 = fsub double %38, %37
%40 = tail call double @llvm.fabs.f64(double %39)
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double 6.000000e-01, double %37, double %38, double %40)
%42 = tail call double @f(double 6.000000e-01, double %37)
%43 = tail call double @llvm.fmuladd.f64(double %42, double 1.000000e-01, double %37)
%44 = tail call double @sol(double 0x3FE6666666666666)
%45 = fsub double %44, %43
%46 = tail call double @llvm.fabs.f64(double %45)
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double 0x3FE6666666666666, double %43, double %44, double %46)
%48 = tail call double @f(double 0x3FE6666666666666, double %43)
%49 = tail call double @llvm.fmuladd.f64(double %48, double 1.000000e-01, double %43)
%50 = tail call double @sol(double 0x3FE9999999999999)
%51 = fsub double %50, %49
%52 = tail call double @llvm.fabs.f64(double %51)
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double 0x3FE9999999999999, double %49, double %50, double %52)
%54 = tail call double @f(double 0x3FE9999999999999, double %49)
%55 = tail call double @llvm.fmuladd.f64(double %54, double 1.000000e-01, double %49)
%56 = tail call double @sol(double 0x3FECCCCCCCCCCCCC)
%57 = fsub double %56, %55
%58 = tail call double @llvm.fabs.f64(double %57)
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double 0x3FECCCCCCCCCCCCC, double %55, double %56, double %58)
%60 = tail call double @f(double 0x3FECCCCCCCCCCCCC, double %55)
%61 = tail call double @llvm.fmuladd.f64(double %60, double 1.000000e-01, double %55)
%62 = tail call double @sol(double 0x3FEFFFFFFFFFFFFF)
%63 = fsub double %62, %61
%64 = tail call double @llvm.fabs.f64(double %63)
%65 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double 0x3FEFFFFFFFFFFFFF, double %61, double %62, double %64)
%66 = tail call double @f(double 0x3FEFFFFFFFFFFFFF, double %61)
%67 = tail call i32 @putchar(i32 10)
ret i32 0
}