#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 */
float M_LN2;
float frexpf(float, int *);
float init_newtonf(float x, float exponent, float c0, float c1, float c2) {
  int iexp;
  float y = frexpf(x, &iexp);
  y = 2 * y + (iexp - 2);
  c1 *= M_LN2 * exponent;
  c2 *= M_LN2 * M_LN2 * exponent * exponent;
  return y = c0 + c1 * y + c2 * y * y;
}


x86 assembly (clang, -O0):
<init_newtonf>:
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  %xmm4,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
lea    -0x18(%rbp),%rdi
call   1030 <frexpf@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
mov    -0x18(%rbp),%eax
sub    $0x2,%eax
cvtsi2ss %eax,%xmm1
addss  %xmm0,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    0x2e79(%rip),%rax
movss  (%rax),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    0x2e5f(%rip),%rax
movss  (%rax),%xmm0
mov    0x2e54(%rip),%rax
mulss  (%rax),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
mulss  -0x1c(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_newtonf>:
sub    $0x18,%rsp
movss  %xmm4,0xc(%rsp)
movss  %xmm3,0x8(%rsp)
movss  %xmm2,0x10(%rsp)
movss  %xmm1,0x4(%rsp)
lea    0x14(%rsp),%rdi
call   1030 <frexpf@plt>
mov    0x14(%rsp),%eax
add    $0xfffffffe,%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
addss  %xmm0,%xmm0
addss  %xmm1,%xmm0
mov    0x2e8d(%rip),%rax
movss  (%rax),%xmm1
movaps %xmm1,%xmm2
movss  0x4(%rsp),%xmm3
mulss  %xmm3,%xmm2
mulss  0x8(%rsp),%xmm2
mulss  %xmm1,%xmm1
mulss  %xmm3,%xmm1
mulss  %xmm3,%xmm1
mulss  0xc(%rsp),%xmm1
mulss  %xmm0,%xmm2
addss  0x10(%rsp),%xmm2
mulss  %xmm0,%xmm1
mulss  %xmm1,%xmm0
addss  %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@M_LN2 = global float 0.000000e+00
define float @init_newtonf(float %0, float %1, float %2, float %3, float %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca i32
%12 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%13 = load float, float* %6
%14 = call float @frexpf(float %13, i32* %11)
store float %14, float* %12
%15 = load float, float* %12
%16 = load i32, i32* %11
%17 = sub nsw i32 %16, 2
%18 = sitofp i32 %17 to float
%19 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %15, float %18)
store float %19, float* %12
%20 = load float, float* @M_LN2
%21 = load float, float* %7
%22 = fmul float %20, %21
%23 = load float, float* %9
%24 = fmul float %23, %22
store float %24, float* %9
%25 = load float, float* @M_LN2
%26 = load float, float* @M_LN2
%27 = fmul float %25, %26
%28 = load float, float* %7
%29 = fmul float %27, %28
%30 = load float, float* %7
%31 = fmul float %29, %30
%32 = load float, float* %10
%33 = fmul float %32, %31
store float %33, float* %10
%34 = load float, float* %8
%35 = load float, float* %9
%36 = load float, float* %12
%37 = call float @llvm.fmuladd.f32(float %35, float %36, float %34)
%38 = load float, float* %10
%39 = load float, float* %12
%40 = fmul float %38, %39
%41 = load float, float* %12
%42 = call float @llvm.fmuladd.f32(float %40, float %41, float %37)
store float %42, float* %12
ret float %42
}

LLVM IR (-O2):
@M_LN2 = global float 0.000000e+00
define float @init_newtonf(float %0, float %1, float %2, float %3, float %4) {
%6 = alloca i32
%7 = bitcast i32* %6 to i8*
%8 = call float @frexpf(float %0, i32* %6)
%9 = load i32, i32* %6
%10 = add nsw i32 %9, -2
%11 = sitofp i32 %10 to float
%12 = tail call float @llvm.fmuladd.f32(float %8, float 2.000000e+00, float %11)
%13 = load float, float* @M_LN2
%14 = fmul float %13, %1
%15 = fmul float %14, %3
%16 = fmul float %13, %13
%17 = fmul float %16, %1
%18 = fmul float %17, %1
%19 = fmul float %18, %4
%20 = tail call float @llvm.fmuladd.f32(float %15, float %12, float %2)
%21 = fmul float %12, %19
%22 = tail call float @llvm.fmuladd.f32(float %21, float %12, float %20)
ret float %22
}