#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 */
int fabs(float);
float solut(float a, float b, float c, float d) {
  float x = 1, x0, f, f1;
  do {
    x0 = x;
    f = ((a * x0 + b) * x0 + c) * x0 + d;
    f1 = (3 * a * x0 + 2 * b) * x0 + c;
    x = x0 - f / f1;
  } while (fabs(x - x0) >= 1e-3);
  return (x);
}


x86 assembly (clang, -O0):
<solut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  0xecc(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x18(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  -0x18(%rbp),%xmm2
movss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  -0x18(%rbp),%xmm2
movss  -0x10(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xe7d(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0x18(%rbp),%xmm2
movss  0xe67(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  -0x18(%rbp),%xmm2
movss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x18(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm1
divss  -0x20(%rbp),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
subss  -0x18(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe1c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jae    1139 <solut+0x29>
movss  -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solut>:
sub    $0x58,%rsp
movss  0xee4(%rip),%xmm4
movss  %xmm0,0x8(%rsp)
mulss  %xmm0,%xmm4
movss  %xmm1,0xc(%rsp)
movaps %xmm1,%xmm0
addss  %xmm1,%xmm0
shufps $0x0,%xmm4,%xmm4
movaps %xmm4,0x10(%rsp)
unpcklps %xmm2,%xmm3
movaps %xmm3,0x30(%rsp)
unpcklps %xmm0,%xmm2
movaps %xmm2,0x20(%rsp)
movss  0xeb0(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movaps %xmm0,%xmm1
movss  0x8(%rsp),%xmm3
mulss  %xmm0,%xmm3
addss  0xc(%rsp),%xmm3
movaps 0x10(%rsp),%xmm2
movss  %xmm3,%xmm2
movaps %xmm0,%xmm3
shufps $0x0,%xmm0,%xmm3
mulps  %xmm3,%xmm2
addps  0x20(%rsp),%xmm2
mulps  %xmm3,%xmm2
addps  0x30(%rsp),%xmm2
movaps %xmm2,%xmm3
shufps $0x55,%xmm2,%xmm3
divss  %xmm3,%xmm2
subss  %xmm2,%xmm0
movaps %xmm0,0x40(%rsp)
subss  %xmm1,%xmm0
call   1030 <fabs@plt>
movaps 0x40(%rsp),%xmm0
test   %eax,%eax
jg     1160 <solut+0x50>
add    $0x58,%rsp
ret

LLVM IR (-O0):
define float @solut(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
store float 1.000000e+00, float* %9
br label %13
13: ; preds = %39, %4
%14 = load float, float* %9
store float %14, float* %10
%15 = load float, float* %5
%16 = load float, float* %10
%17 = load float, float* %6
%18 = call float @llvm.fmuladd.f32(float %15, float %16, float %17)
%19 = load float, float* %10
%20 = load float, float* %7
%21 = call float @llvm.fmuladd.f32(float %18, float %19, float %20)
%22 = load float, float* %10
%23 = load float, float* %8
%24 = call float @llvm.fmuladd.f32(float %21, float %22, float %23)
store float %24, float* %11
%25 = load float, float* %5
%26 = fmul float 3.000000e+00, %25
%27 = load float, float* %10
%28 = load float, float* %6
%29 = fmul float 2.000000e+00, %28
%30 = call float @llvm.fmuladd.f32(float %26, float %27, float %29)
%31 = load float, float* %10
%32 = load float, float* %7
%33 = call float @llvm.fmuladd.f32(float %30, float %31, float %32)
store float %33, float* %12
%34 = load float, float* %10
%35 = load float, float* %11
%36 = load float, float* %12
%37 = fdiv float %35, %36
%38 = fsub float %34, %37
store float %38, float* %9
br label %39
39: ; preds = %13
%40 = load float, float* %9
%41 = load float, float* %10
%42 = fsub float %40, %41
%43 = call i32 @fabs(float %42)
%44 = sitofp i32 %43 to double
%45 = fcmp oge double %44, 1.000000e-03
br i1 %45, label %13, label %46
46: ; preds = %39
%47 = load float, float* %9
ret float %47
}

LLVM IR (-O2):
define float @solut(float %0, float %1, float %2, float %3) {
%5 = fmul float %0, 3.000000e+00
%6 = fmul float %1, 2.000000e+00
%7 = insertelement <2 x float> poison, float %5, i64 1
%8 = insertelement <2 x float> poison, float %2, i64 0
%9 = insertelement <2 x float> %8, float %6, i64 1
%10 = insertelement <2 x float> poison, float %3, i64 0
%11 = insertelement <2 x float> %10, float %2, i64 1
br label %12
12: ; preds = %12, %4
%13 = phi float [ 1.000000e+00, %4 ], [ %23, %12 ]
%14 = tail call float @llvm.fmuladd.f32(float %0, float %13, float %1)
%15 = insertelement <2 x float> %7, float %14, i64 0
%16 = insertelement <2 x float> poison, float %13, i64 0
%17 = shufflevector <2 x float> %16, <2 x float> poison, <2 x i32> zeroinitializer
%18 = call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %15, <2 x float> %17, <2 x float> %9)
%19 = call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %18, <2 x float> %17, <2 x float> %11)
%20 = extractelement <2 x float> %19, i64 0
%21 = extractelement <2 x float> %19, i64 1
%22 = fdiv float %20, %21
%23 = fsub float %13, %22
%24 = fsub float %23, %13
%25 = tail call i32 @fabs(float %24)
%26 = icmp sgt i32 %25, 0
br i1 %26, label %12, label %27
27: ; preds = %12
ret float %23
}