#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(double);
double sqrt(double);
double init_u(double dt, double mu, double r0, double r0v0, double beta) {
  double T, phi, psi, bp2;
  double a, b, c, d, k;
  T = sqrt(mu / (r0 * r0 * r0)) * dt;
  phi = r0v0 / sqrt(r0);
  psi = T - phi * T * T / 2 - (1 - beta - 3 * phi * phi * phi) * T * T * T / 6 +
        phi * (10 - 9 * beta - 15 * phi * phi) * T * T * T * T / 24;
  psi /= 4.0;
  bp2 = -beta * psi * psi;
  a = 1.0;
  b = c = psi;
  d = 1.0;
  k = 1.0;
  do {
    a = 1.0 / (1 + bp2 / (2 * k - 1) / (2 * k + 1) * a);
    b = (a - 1.0) * b;
    c = c + b;
    k++;
  } while (fabs(b / c) > 1e-10 && k < 6.0);
  return c;
}


x86 assembly (clang, -O0):
<init_u>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
movsd  0xe94(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  0xe44(%rip),%xmm2
subsd  -0x28(%rbp),%xmm2
movsd  0xe6f(%rip),%xmm1
mulsd  -0x38(%rbp),%xmm1
mulsd  -0x38(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm3
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
movsd  0xe22(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  -0x38(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm3
movsd  0xdf8(%rip),%xmm2
mulsd  %xmm2,%xmm3
movsd  0xdf4(%rip),%xmm2
addsd  %xmm2,%xmm3
movsd  0xdd8(%rip),%xmm2
mulsd  -0x38(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm4
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
movsd  0xd87(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  0xd65(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x40(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xd21(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  %xmm0,-0x58(%rbp)
movsd  0xd05(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xcf8(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x48(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm0
addsd  %xmm0,%xmm0
movsd  0xd25(%rip),%xmm2
addsd  %xmm2,%xmm0
divsd  %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
addsd  %xmm0,%xmm0
movsd  0xcc4(%rip),%xmm2
addsd  %xmm2,%xmm0
divsd  %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xcab(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xc9f(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  0xc89(%rip),%xmm1
subsd  %xmm1,%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x60(%rbp),%xmm0
addsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xc64(%rip),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x58(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm0
xor    %eax,%eax
movsd  0xc8d(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x79(%rbp)
jbe    13e3 <init_u+0x2c3>
movsd  0xc58(%rip),%xmm0
ucomisd -0x70(%rbp),%xmm0
seta   %al
mov    %al,-0x79(%rbp)
mov    -0x79(%rbp),%al
test   $0x1,%al
jne    130d <init_u+0x1ed>
movsd  -0x60(%rbp),%xmm0
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_u>:
sub    $0x48,%rsp
movapd %xmm0,%xmm5
movapd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm0
divsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
movaps %xmm4,0x30(%rsp)
movsd  %xmm3,(%rsp)
jb     1152 <init_u+0x32>
sqrtsd %xmm1,%xmm7
jmp    117b <init_u+0x5b>
movapd %xmm1,%xmm0
movsd  %xmm2,0x10(%rsp)
movsd  %xmm5,0x20(%rsp)
call   1040 <sqrt@plt>
movsd  0x20(%rsp),%xmm5
movsd  0x10(%rsp),%xmm2
movapd %xmm0,%xmm7
xorpd  %xmm0,%xmm0
mulsd  %xmm5,%xmm7
ucomisd %xmm0,%xmm2
jb     118e <init_u+0x6e>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    11a3 <init_u+0x83>
movapd %xmm2,%xmm0
movapd %xmm7,0x10(%rsp)
call   1040 <sqrt@plt>
movapd 0x10(%rsp),%xmm7
movapd 0x30(%rsp),%xmm3
movsd  (%rsp),%xmm6
divsd  %xmm0,%xmm6
movapd %xmm7,%xmm0
mulsd  %xmm6,%xmm0
mulsd  %xmm7,%xmm0
mulsd  0xe3a(%rip),%xmm0
addsd  %xmm7,%xmm0
movsd  0xe36(%rip),%xmm5
movapd %xmm5,%xmm1
subsd  %xmm3,%xmm1
movsd  0xe2e(%rip),%xmm4
mulsd  %xmm6,%xmm4
mulsd  %xmm6,%xmm4
mulsd  %xmm6,%xmm4
addsd  %xmm1,%xmm4
movsd  0xe1e(%rip),%xmm1
mulsd  %xmm3,%xmm1
addsd  0xe1a(%rip),%xmm1
movsd  0xe1a(%rip),%xmm2
mulsd  %xmm6,%xmm2
mulsd  %xmm6,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm6,%xmm2
mulsd  %xmm7,%xmm2
unpcklpd %xmm2,%xmm4
unpcklpd %xmm7,%xmm7
mulpd  %xmm7,%xmm4
mulpd  %xmm7,%xmm4
mulpd  %xmm7,%xmm4
divpd  0xe32(%rip),%xmm4
subsd  %xmm4,%xmm0
unpckhpd %xmm4,%xmm4
addsd  %xmm0,%xmm4
mulsd  0xdde(%rip),%xmm4
xorpd  0xe26(%rip),%xmm3
mulsd  %xmm4,%xmm3
mulsd  %xmm4,%xmm3
movapd %xmm3,0x30(%rsp)
movapd %xmm3,%xmm0
divsd  0xdc4(%rip),%xmm0
movapd %xmm0,0x20(%rsp)
addsd  %xmm5,%xmm0
divsd  %xmm0,%xmm5
movsd  0xdb6(%rip),%xmm0
movsd  %xmm5,0x40(%rsp)
addsd  %xmm5,%xmm0
mulsd  %xmm4,%xmm0
addsd  %xmm0,%xmm4
movsd  %xmm0,0x10(%rsp)
movapd %xmm4,(%rsp)
divsd  %xmm4,%xmm0
call   1030 <fabs@plt>
test   %eax,%eax
jle    1458 <init_u+0x338>
movapd 0x20(%rsp),%xmm1
divsd  0xd82(%rip),%xmm1
mulsd  0x40(%rsp),%xmm1
movsd  0xd34(%rip),%xmm0
addsd  %xmm0,%xmm1
movapd %xmm0,%xmm2
divsd  %xmm1,%xmm2
movsd  0xd58(%rip),%xmm0
movsd  %xmm2,0x20(%rsp)
addsd  %xmm2,%xmm0
movsd  0x10(%rsp),%xmm2
mulsd  %xmm0,%xmm2
movapd (%rsp),%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm2,0x10(%rsp)
movapd %xmm2,%xmm0
movapd %xmm1,(%rsp)
divsd  %xmm1,%xmm0
call   1030 <fabs@plt>
test   %eax,%eax
jle    1458 <init_u+0x338>
movapd 0x30(%rsp),%xmm0
divsd  0xd15(%rip),%xmm0
divsd  0xd15(%rip),%xmm0
mulsd  0x20(%rsp),%xmm0
movsd  0xcbf(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
movsd  0xce7(%rip),%xmm0
movsd  %xmm1,0x20(%rsp)
addsd  %xmm1,%xmm0
movsd  0x10(%rsp),%xmm2
mulsd  %xmm0,%xmm2
movapd (%rsp),%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm2,0x10(%rsp)
movapd %xmm2,%xmm0
movapd %xmm1,(%rsp)
divsd  %xmm1,%xmm0
call   1030 <fabs@plt>
test   %eax,%eax
jle    1458 <init_u+0x338>
movapd 0x30(%rsp),%xmm0
divsd  0xcac(%rip),%xmm0
divsd  0xcac(%rip),%xmm0
mulsd  0x20(%rsp),%xmm0
movsd  0xc4e(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
movsd  0xc76(%rip),%xmm0
movsd  %xmm1,0x20(%rsp)
addsd  %xmm1,%xmm0
movsd  0x10(%rsp),%xmm2
mulsd  %xmm0,%xmm2
movapd (%rsp),%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm2,0x10(%rsp)
movapd %xmm2,%xmm0
movapd %xmm1,(%rsp)
divsd  %xmm1,%xmm0
call   1030 <fabs@plt>
test   %eax,%eax
jle    1458 <init_u+0x338>
movapd 0x30(%rsp),%xmm2
divsd  0xc47(%rip),%xmm2
divsd  0xc47(%rip),%xmm2
mulsd  0x20(%rsp),%xmm2
movsd  0xbe1(%rip),%xmm1
addsd  %xmm1,%xmm2
divsd  %xmm2,%xmm1
addsd  0xc09(%rip),%xmm1
movsd  0x10(%rsp),%xmm0
mulsd  %xmm1,%xmm0
movapd (%rsp),%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,(%rsp)
divsd  %xmm1,%xmm0
call   1030 <fabs@plt>
movaps (%rsp),%xmm0
add    $0x48,%rsp
ret

LLVM IR (-O0):
define double @init_u(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 double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = 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
%20 = load double, double* %7
%21 = load double, double* %8
%22 = load double, double* %8
%23 = fmul double %21, %22
%24 = load double, double* %8
%25 = fmul double %23, %24
%26 = fdiv double %20, %25
%27 = call double @sqrt(double %26)
%28 = load double, double* %6
%29 = fmul double %27, %28
store double %29, double* %11
%30 = load double, double* %9
%31 = load double, double* %8
%32 = call double @sqrt(double %31)
%33 = fdiv double %30, %32
store double %33, double* %12
%34 = load double, double* %11
%35 = load double, double* %12
%36 = load double, double* %11
%37 = fmul double %35, %36
%38 = load double, double* %11
%39 = fmul double %37, %38
%40 = fdiv double %39, 2.000000e+00
%41 = fsub double %34, %40
%42 = load double, double* %10
%43 = fsub double 1.000000e+00, %42
%44 = load double, double* %12
%45 = fmul double 3.000000e+00, %44
%46 = load double, double* %12
%47 = fmul double %45, %46
%48 = load double, double* %12
%49 = fneg double %47
%50 = call double @llvm.fmuladd.f64(double %49, double %48, double %43)
%51 = load double, double* %11
%52 = fmul double %50, %51
%53 = load double, double* %11
%54 = fmul double %52, %53
%55 = load double, double* %11
%56 = fmul double %54, %55
%57 = fdiv double %56, 6.000000e+00
%58 = fsub double %41, %57
%59 = load double, double* %12
%60 = load double, double* %10
%61 = call double @llvm.fmuladd.f64(double -9.000000e+00, double %60, double 1.000000e+01)
%62 = load double, double* %12
%63 = fmul double 1.500000e+01, %62
%64 = load double, double* %12
%65 = fneg double %63
%66 = call double @llvm.fmuladd.f64(double %65, double %64, double %61)
%67 = fmul double %59, %66
%68 = load double, double* %11
%69 = fmul double %67, %68
%70 = load double, double* %11
%71 = fmul double %69, %70
%72 = load double, double* %11
%73 = fmul double %71, %72
%74 = load double, double* %11
%75 = fmul double %73, %74
%76 = fdiv double %75, 2.400000e+01
%77 = fadd double %58, %76
store double %77, double* %13
%78 = load double, double* %13
%79 = fdiv double %78, 4.000000e+00
store double %79, double* %13
%80 = load double, double* %10
%81 = fneg double %80
%82 = load double, double* %13
%83 = fmul double %81, %82
%84 = load double, double* %13
%85 = fmul double %83, %84
store double %85, double* %14
store double 1.000000e+00, double* %15
%86 = load double, double* %13
store double %86, double* %17
store double %86, double* %16
store double 1.000000e+00, double* %18
store double 1.000000e+00, double* %19
br label %87
87: ; preds = %117, %5
%88 = load double, double* %14
%89 = load double, double* %19
%90 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %89, double -1.000000e+00)
%91 = fdiv double %88, %90
%92 = load double, double* %19
%93 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %92, double 1.000000e+00)
%94 = fdiv double %91, %93
%95 = load double, double* %15
%96 = call double @llvm.fmuladd.f64(double %94, double %95, double 1.000000e+00)
%97 = fdiv double 1.000000e+00, %96
store double %97, double* %15
%98 = load double, double* %15
%99 = fsub double %98, 1.000000e+00
%100 = load double, double* %16
%101 = fmul double %99, %100
store double %101, double* %16
%102 = load double, double* %17
%103 = load double, double* %16
%104 = fadd double %102, %103
store double %104, double* %17
%105 = load double, double* %19
%106 = fadd double %105, 1.000000e+00
store double %106, double* %19
br label %107
107: ; preds = %87
%108 = load double, double* %16
%109 = load double, double* %17
%110 = fdiv double %108, %109
%111 = call i32 @fabs(double %110)
%112 = sitofp i32 %111 to double
%113 = fcmp ogt double %112, 1.000000e-10
br i1 %113, label %114, label %117
114: ; preds = %107
%115 = load double, double* %19
%116 = fcmp olt double %115, 6.000000e+00
br label %117
117: ; preds = %114, %107
%118 = phi i1 [ false, %107 ], [ %116, %114 ]
br i1 %118, label %87, label %119
119: ; preds = %117
%120 = load double, double* %17
ret double %120
}

LLVM IR (-O2):
define double @init_u(double %0, double %1, double %2, double %3, double %4) {
%6 = fmul double %2, %2
%7 = fmul double %6, %2
%8 = fdiv double %1, %7
%9 = tail call double @sqrt(double %8)
%10 = fmul double %9, %0
%11 = tail call double @sqrt(double %2)
%12 = fdiv double %3, %11
%13 = fmul double %10, %12
%14 = fmul double %10, %13
%15 = fmul double %14, 5.000000e-01
%16 = fsub double %10, %15
%17 = fsub double 1.000000e+00, %4
%18 = fmul double %12, -3.000000e+00
%19 = fmul double %12, %18
%20 = tail call double @llvm.fmuladd.f64(double %19, double %12, double %17)
%21 = tail call double @llvm.fmuladd.f64(double %4, double -9.000000e+00, double 1.000000e+01)
%22 = fmul double %12, -1.500000e+01
%23 = tail call double @llvm.fmuladd.f64(double %22, double %12, double %21)
%24 = fmul double %12, %23
%25 = fmul double %10, %24
%26 = insertelement <2 x double> poison, double %10, i64 0
%27 = shufflevector <2 x double> %26, <2 x double> poison, <2 x i32> zeroinitializer
%28 = insertelement <2 x double> poison, double %20, i64 0
%29 = insertelement <2 x double> %28, double %25, i64 1
%30 = fmul <2 x double> %27, %29
%31 = fmul <2 x double> %27, %30
%32 = fmul <2 x double> %27, %31
%33 = fdiv <2 x double> %32, <double 6.000000e+00, double 2.400000e+01>
%34 = extractelement <2 x double> %33, i64 0
%35 = fsub double %16, %34
%36 = extractelement <2 x double> %33, i64 1
%37 = fadd double %35, %36
%38 = fmul double %37, 2.500000e-01
%39 = fneg double %4
%40 = fmul double %38, %39
%41 = fmul double %38, %40
%42 = fdiv double %41, 3.000000e+00
%43 = fadd double %42, 1.000000e+00
%44 = fdiv double 1.000000e+00, %43
%45 = fadd double %44, -1.000000e+00
%46 = fmul double %38, %45
%47 = fadd double %38, %46
%48 = fdiv double %46, %47
%49 = tail call i32 @fabs(double %48)
%50 = icmp sgt i32 %49, 0
br i1 %50, label %51, label %94
51: ; preds = %5
%52 = fdiv double %41, 3.000000e+00
%53 = fdiv double %52, 5.000000e+00
%54 = tail call double @llvm.fmuladd.f64(double %53, double %44, double 1.000000e+00)
%55 = fdiv double 1.000000e+00, %54
%56 = fadd double %55, -1.000000e+00
%57 = fmul double %46, %56
%58 = fadd double %47, %57
%59 = fdiv double %57, %58
%60 = tail call i32 @fabs(double %59)
%61 = icmp sgt i32 %60, 0
br i1 %61, label %62, label %94
62: ; preds = %51
%63 = fdiv double %41, 5.000000e+00
%64 = fdiv double %63, 7.000000e+00
%65 = tail call double @llvm.fmuladd.f64(double %64, double %55, double 1.000000e+00)
%66 = fdiv double 1.000000e+00, %65
%67 = fadd double %66, -1.000000e+00
%68 = fmul double %57, %67
%69 = fadd double %58, %68
%70 = fdiv double %68, %69
%71 = tail call i32 @fabs(double %70)
%72 = icmp sgt i32 %71, 0
br i1 %72, label %73, label %94
73: ; preds = %62
%74 = fdiv double %41, 7.000000e+00
%75 = fdiv double %74, 9.000000e+00
%76 = tail call double @llvm.fmuladd.f64(double %75, double %66, double 1.000000e+00)
%77 = fdiv double 1.000000e+00, %76
%78 = fadd double %77, -1.000000e+00
%79 = fmul double %68, %78
%80 = fadd double %69, %79
%81 = fdiv double %79, %80
%82 = tail call i32 @fabs(double %81)
%83 = icmp sgt i32 %82, 0
br i1 %83, label %84, label %94
84: ; preds = %73
%85 = fdiv double %41, 9.000000e+00
%86 = fdiv double %85, 1.100000e+01
%87 = tail call double @llvm.fmuladd.f64(double %86, double %77, double 1.000000e+00)
%88 = fdiv double 1.000000e+00, %87
%89 = fadd double %88, -1.000000e+00
%90 = fmul double %79, %89
%91 = fadd double %80, %90
%92 = fdiv double %90, %91
%93 = tail call i32 @fabs(double %92)
br label %94
94: ; preds = %84, %73, %62, %51, %5
%95 = phi double [ %47, %5 ], [ %58, %51 ], [ %69, %62 ], [ %80, %73 ], [ %91, %84 ]
ret double %95
}