#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 M_LN2;
double frexp(double, int *);
double init_newton(double x, double exponent, double c0, double c1, double c2) {
  int iexp;
  double y = frexp(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_newton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0x2c(%rbp),%rdi
call   1030 <frexp@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x2c(%rbp),%eax
sub    $0x2,%eax
cvtsi2sd %eax,%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    0x2e79(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    0x2e5f(%rip),%rax
movsd  (%rax),%xmm0
mov    0x2e54(%rip),%rax
mulsd  (%rax),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_newton>:
sub    $0x28,%rsp
movsd  %xmm4,0x18(%rsp)
movsd  %xmm3,0x10(%rsp)
movsd  %xmm2,0x20(%rsp)
movsd  %xmm1,0x8(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <frexp@plt>
mov    0x4(%rsp),%eax
add    $0xfffffffe,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mov    0x2e8d(%rip),%rax
movsd  (%rax),%xmm1
movapd %xmm1,%xmm2
movsd  0x8(%rsp),%xmm3
mulsd  %xmm3,%xmm2
mulsd  0x10(%rsp),%xmm2
mulsd  %xmm1,%xmm1
mulsd  %xmm3,%xmm1
mulsd  %xmm3,%xmm1
mulsd  0x18(%rsp),%xmm1
mulsd  %xmm0,%xmm2
addsd  0x20(%rsp),%xmm2
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
add    $0x28,%rsp
ret

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

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