#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 exp(int);
double fabs(float);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int flag;
  float h = 0.1, x = 0, y = 1;
  float x0, y0, y1_0, y1_1, temp_y1_0;
  printf("   X\t   Y_COMP\t Y_ACTUAL\tABS_ERROR\n");
  printf("%f  %f\t %f\t%f\n", x, y, (1.5 * exp(2 * x) - x * x - x - 0.5),
         fabs(y - (1.5 * exp(2 * x) - x * x - x - 0.5)));
  while (x < 1) {
    x0 = x;
    x += h;
    y0 = y;
    y1_0 = y0 + h * (2 * x0 * x0 + 2 * y0);
    do {
      y1_1 = y0 + h * ((2 * x0 * x0 + 2 * y0) + (2 * x * x + 2 * y1_0)) * 0.5;
      temp_y1_0 = y1_0;
      y1_0 = y1_1;
    } while (fabs(temp_y1_0 - y1_1) <= 0.000005);
    y = y1_1;
    printf("%f  %f\t %f\t%f\n", x, y, (1.5 * exp(2 * x) - x * x - x - 0.5),
           fabs(y - (1.5 * exp(2 * x) - x * x - x - 0.5)));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xec0(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
movss  0xe85(%rip),%xmm0
mulss  -0x10(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1050 <exp@plt>
movss  -0x10(%rbp),%xmm1
mulss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xe3a(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
subsd  %xmm1,%xmm0
movsd  0xe15(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
movss  0xe0e(%rip),%xmm0
mulss  -0x10(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1050 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
movss  -0x10(%rbp),%xmm2
mulss  -0x10(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
movsd  0xdbb(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movss  -0x10(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
subsd  %xmm2,%xmm1
movsd  0xd96(%rip),%xmm2
subsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1040 <fabs@plt>
movsd  -0x40(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x30(%rbp),%xmm0
lea    0xdb4(%rip),%rdi
mov    $0x4,%al
call   1030 <printf@plt>
movss  0xd79(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1502 <main+0x3d2>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  0xd36(%rip),%xmm2
mulss  -0x18(%rbp),%xmm2
movss  -0x18(%rbp),%xmm4
movss  0xd24(%rip),%xmm3
mulss  -0x1c(%rbp),%xmm3
mulss  %xmm4,%xmm2
addss  %xmm3,%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
movss  0xcf4(%rip),%xmm2
mulss  -0x18(%rbp),%xmm2
movss  -0x18(%rbp),%xmm4
movss  0xce2(%rip),%xmm3
mulss  -0x1c(%rbp),%xmm3
mulss  %xmm4,%xmm2
addss  %xmm3,%xmm2
movss  0xccd(%rip),%xmm3
mulss  -0x10(%rbp),%xmm3
movss  -0x10(%rbp),%xmm5
movss  0xcbb(%rip),%xmm4
mulss  -0x20(%rbp),%xmm4
mulss  %xmm5,%xmm3
addss  %xmm4,%xmm3
addss  %xmm3,%xmm2
mulss  %xmm2,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc82(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x28(%rbp),%xmm0
subss  -0x24(%rbp),%xmm0
call   1040 <fabs@plt>
movaps %xmm0,%xmm1
movsd  0xc53(%rip),%xmm0
ucomisd %xmm1,%xmm0
jae    130e <main+0x1de>
movss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
movss  0xc23(%rip),%xmm0
mulss  -0x10(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1050 <exp@plt>
movss  -0x10(%rbp),%xmm1
mulss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xbd8(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
subsd  %xmm1,%xmm0
movsd  0xbb3(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movss  0xbac(%rip),%xmm0
mulss  -0x10(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1050 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
movss  -0x10(%rbp),%xmm2
mulss  -0x10(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
movsd  0xb59(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movss  -0x10(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
subsd  %xmm2,%xmm1
movsd  0xb34(%rip),%xmm2
subsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1040 <fabs@plt>
movsd  -0x60(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x50(%rbp),%xmm0
lea    0xb52(%rip),%rdi
mov    $0x4,%al
call   1030 <printf@plt>
jmp    129b <main+0x16b>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x38,%rsp
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1060 <exp@plt>
mulsd  0xe9f(%rip),%xmm0
addsd  0xe9f(%rip),%xmm0
movsd  %xmm0,0x28(%rsp)
xor    %edi,%edi
call   1060 <exp@plt>
mulsd  0xe82(%rip),%xmm0
addsd  0xe82(%rip),%xmm0
movsd  0xe82(%rip),%xmm1
subsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
call   1050 <fabs@plt>
movaps %xmm0,%xmm3
lea    0xe88(%rip),%rbx
xorps  %xmm0,%xmm0
mov    %rbx,%rdi
movsd  0xe5a(%rip),%xmm1
movsd  0x28(%rsp),%xmm2
mov    $0x4,%al
call   1040 <printf@plt>
movss  0xe5d(%rip),%xmm4
xorps  %xmm1,%xmm1
movss  %xmm1,0xc(%rsp)
movss  0xe50(%rip),%xmm3
nopl   0x0(%rax)
movss  0xc(%rsp),%xmm2
movaps %xmm2,%xmm0
addss  %xmm3,%xmm2
movaps %xmm0,%xmm5
addss  %xmm0,%xmm5
movaps %xmm4,%xmm1
addss  %xmm4,%xmm1
mulss  %xmm0,%xmm5
addss  %xmm1,%xmm5
movss  %xmm5,0x10(%rsp)
movaps %xmm5,%xmm0
mulss  %xmm3,%xmm0
addss  %xmm4,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm4,%xmm1
movsd  %xmm1,0x18(%rsp)
movss  %xmm2,0xc(%rsp)
addss  %xmm2,%xmm2
movss  %xmm2,0x20(%rsp)
movaps %xmm0,%xmm1
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movaps %xmm1,%xmm0
addss  %xmm1,%xmm1
movss  0x20(%rsp),%xmm2
mulss  0xc(%rsp),%xmm2
addss  %xmm1,%xmm2
addss  0x10(%rsp),%xmm2
mulss  0xdc7(%rip),%xmm2
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
mulsd  0xda4(%rip),%xmm1
addsd  0x18(%rsp),%xmm1
cvtsd2ss %xmm1,%xmm1
movss  %xmm1,0x28(%rsp)
subss  %xmm1,%xmm0
call   1050 <fabs@plt>
movss  0x28(%rsp),%xmm1
movsd  0xd85(%rip),%xmm2
ucomisd %xmm0,%xmm2
jae    1240 <main+0x100>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
movsd  %xmm0,0x18(%rsp)
cvttss2si 0x20(%rsp),%ebp
mov    %ebp,%edi
call   1060 <exp@plt>
movaps %xmm0,%xmm1
movss  0xc(%rsp),%xmm0
mulss  %xmm0,%xmm0
xorps  %xmm2,%xmm2
cvtss2sd %xmm0,%xmm2
movsd  %xmm2,0x30(%rsp)
movsd  0xd13(%rip),%xmm0
mulsd  %xmm0,%xmm1
subsd  %xmm2,%xmm1
subsd  0x10(%rsp),%xmm1
movsd  0xd05(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  %xmm1,0x20(%rsp)
mov    %ebp,%edi
call   1060 <exp@plt>
mulsd  0xce4(%rip),%xmm0
subsd  0x30(%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
addsd  0xcd8(%rip),%xmm0
movsd  0x18(%rsp),%xmm1
subsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
call   1050 <fabs@plt>
movaps %xmm0,%xmm3
mov    %rbx,%rdi
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x20(%rsp),%xmm2
mov    $0x4,%al
call   1040 <printf@plt>
movss  0x28(%rsp),%xmm4
movss  0xcb5(%rip),%xmm0
ucomiss 0xc(%rsp),%xmm0
movss  0xcac(%rip),%xmm3
ja     11e0 <main+0xa0>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [36 x i8] c" X\09 Y_COMP\09 Y_ACTUAL\09ABS_ERROR\0A\00"
@.str.1 = [15 x i8] c"%f %f\09 %f\09%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store i32 0, i32* %1
store float 0x3FB99999A0000000, float* %3
store float 0.000000e+00, float* %4
store float 1.000000e+00, float* %5
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%12 = load float, float* %4
%13 = fpext float %12 to double
%14 = load float, float* %5
%15 = fpext float %14 to double
%16 = load float, float* %4
%17 = fmul float 2.000000e+00, %16
%18 = fptosi float %17 to i32
%19 = call double @exp(i32 %18)
%20 = load float, float* %4
%21 = load float, float* %4
%22 = fmul float %20, %21
%23 = fpext float %22 to double
%24 = fneg double %23
%25 = call double @llvm.fmuladd.f64(double 1.500000e+00, double %19, double %24)
%26 = load float, float* %4
%27 = fpext float %26 to double
%28 = fsub double %25, %27
%29 = fsub double %28, 5.000000e-01
%30 = load float, float* %5
%31 = fpext float %30 to double
%32 = load float, float* %4
%33 = fmul float 2.000000e+00, %32
%34 = fptosi float %33 to i32
%35 = call double @exp(i32 %34)
%36 = load float, float* %4
%37 = load float, float* %4
%38 = fmul float %36, %37
%39 = fpext float %38 to double
%40 = fneg double %39
%41 = call double @llvm.fmuladd.f64(double 1.500000e+00, double %35, double %40)
%42 = load float, float* %4
%43 = fpext float %42 to double
%44 = fsub double %41, %43
%45 = fsub double %44, 5.000000e-01
%46 = fsub double %31, %45
%47 = fptrunc double %46 to float
%48 = call double @fabs(float %47)
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %13, double %15, double %29, double %48)
br label %50
50: ; preds = %97, %0
%51 = load float, float* %4
%52 = fcmp olt float %51, 1.000000e+00
br i1 %52, label %53, label %137
53: ; preds = %50
%54 = load float, float* %4
store float %54, float* %6
%55 = load float, float* %3
%56 = load float, float* %4
%57 = fadd float %56, %55
store float %57, float* %4
%58 = load float, float* %5
store float %58, float* %7
%59 = load float, float* %7
%60 = load float, float* %3
%61 = load float, float* %6
%62 = fmul float 2.000000e+00, %61
%63 = load float, float* %6
%64 = load float, float* %7
%65 = fmul float 2.000000e+00, %64
%66 = call float @llvm.fmuladd.f32(float %62, float %63, float %65)
%67 = call float @llvm.fmuladd.f32(float %60, float %66, float %59)
store float %67, float* %8
br label %68
68: ; preds = %91, %53
%69 = load float, float* %7
%70 = fpext float %69 to double
%71 = load float, float* %3
%72 = load float, float* %6
%73 = fmul float 2.000000e+00, %72
%74 = load float, float* %6
%75 = load float, float* %7
%76 = fmul float 2.000000e+00, %75
%77 = call float @llvm.fmuladd.f32(float %73, float %74, float %76)
%78 = load float, float* %4
%79 = fmul float 2.000000e+00, %78
%80 = load float, float* %4
%81 = load float, float* %8
%82 = fmul float 2.000000e+00, %81
%83 = call float @llvm.fmuladd.f32(float %79, float %80, float %82)
%84 = fadd float %77, %83
%85 = fmul float %71, %84
%86 = fpext float %85 to double
%87 = call double @llvm.fmuladd.f64(double %86, double 5.000000e-01, double %70)
%88 = fptrunc double %87 to float
store float %88, float* %9
%89 = load float, float* %8
store float %89, float* %10
%90 = load float, float* %9
store float %90, float* %8
br label %91
91: ; preds = %68
%92 = load float, float* %10
%93 = load float, float* %9
%94 = fsub float %92, %93
%95 = call double @fabs(float %94)
%96 = fcmp ole double %95, 5.000000e-06
br i1 %96, label %68, label %97
97: ; preds = %91
%98 = load float, float* %9
store float %98, float* %5
%99 = load float, float* %4
%100 = fpext float %99 to double
%101 = load float, float* %5
%102 = fpext float %101 to double
%103 = load float, float* %4
%104 = fmul float 2.000000e+00, %103
%105 = fptosi float %104 to i32
%106 = call double @exp(i32 %105)
%107 = load float, float* %4
%108 = load float, float* %4
%109 = fmul float %107, %108
%110 = fpext float %109 to double
%111 = fneg double %110
%112 = call double @llvm.fmuladd.f64(double 1.500000e+00, double %106, double %111)
%113 = load float, float* %4
%114 = fpext float %113 to double
%115 = fsub double %112, %114
%116 = fsub double %115, 5.000000e-01
%117 = load float, float* %5
%118 = fpext float %117 to double
%119 = load float, float* %4
%120 = fmul float 2.000000e+00, %119
%121 = fptosi float %120 to i32
%122 = call double @exp(i32 %121)
%123 = load float, float* %4
%124 = load float, float* %4
%125 = fmul float %123, %124
%126 = fpext float %125 to double
%127 = fneg double %126
%128 = call double @llvm.fmuladd.f64(double 1.500000e+00, double %122, double %127)
%129 = load float, float* %4
%130 = fpext float %129 to double
%131 = fsub double %128, %130
%132 = fsub double %131, 5.000000e-01
%133 = fsub double %118, %132
%134 = fptrunc double %133 to float
%135 = call double @fabs(float %134)
%136 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %100, double %102, double %116, double %135)
br label %50
137: ; preds = %50
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [15 x i8] c"%f %f\09 %f\09%f\0A\00"
@str = [35 x i8] c" X\09 Y_COMP\09 Y_ACTUAL\09ABS_ERROR\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%2 = tail call double @exp(i32 0)
%3 = fmul double %2, 1.500000e+00
%4 = fadd double %3, -5.000000e-01
%5 = tail call double @exp(i32 0)
%6 = fmul double %5, 1.500000e+00
%7 = fadd double %6, -5.000000e-01
%8 = fsub double 1.000000e+00, %7
%9 = fptrunc double %8 to float
%10 = tail call double @fabs(float %9)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double 0.000000e+00, double 1.000000e+00, double %4, double %10)
br label %12
12: ; preds = %0, %34
%13 = phi float [ 0.000000e+00, %0 ], [ %15, %34 ]
%14 = phi float [ 1.000000e+00, %0 ], [ %30, %34 ]
%15 = fadd float %13, 0x3FB99999A0000000
%16 = fmul float %13, 2.000000e+00
%17 = fmul float %14, 2.000000e+00
%18 = tail call float @llvm.fmuladd.f32(float %16, float %13, float %17)
%19 = tail call float @llvm.fmuladd.f32(float %18, float 0x3FB99999A0000000, float %14)
%20 = fpext float %14 to double
%21 = fmul float %15, 2.000000e+00
br label %22
22: ; preds = %22, %12
%23 = phi float [ %19, %12 ], [ %30, %22 ]
%24 = fmul float %23, 2.000000e+00
%25 = tail call float @llvm.fmuladd.f32(float %21, float %15, float %24)
%26 = fadd float %18, %25
%27 = fmul float %26, 0x3FB99999A0000000
%28 = fpext float %27 to double
%29 = tail call double @llvm.fmuladd.f64(double %28, double 5.000000e-01, double %20)
%30 = fptrunc double %29 to float
%31 = fsub float %23, %30
%32 = tail call double @fabs(float %31)
%33 = fcmp ugt double %32, 5.000000e-06
br i1 %33, label %34, label %22
34: ; preds = %22
%35 = fpext float %15 to double
%36 = fpext float %30 to double
%37 = fptosi float %21 to i32
%38 = tail call double @exp(i32 %37)
%39 = fmul float %15, %15
%40 = fpext float %39 to double
%41 = fneg double %40
%42 = tail call double @llvm.fmuladd.f64(double %38, double 1.500000e+00, double %41)
%43 = fsub double %42, %35
%44 = fadd double %43, -5.000000e-01
%45 = tail call double @exp(i32 %37)
%46 = tail call double @llvm.fmuladd.f64(double %45, double 1.500000e+00, double %41)
%47 = fsub double %46, %35
%48 = fadd double %47, -5.000000e-01
%49 = fsub double %36, %48
%50 = fptrunc double %49 to float
%51 = tail call double @fabs(float %50)
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %35, double %36, double %44, double %51)
%53 = fcmp olt float %15, 1.000000e+00
br i1 %53, label %12, label %54
54: ; preds = %34
ret i32 0
}