#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 sqrt(double);
void coulomb_frame_parameters(double Z, double A, double mass, double kinetic,
                              double *kinetic0, double *parameters) {
  const double Ma = Z * 0.938272 + (A - Z) * 0.939565;
  double M2 = mass + Ma;
  M2 *= M2;
  const double sCM12i = 1. / sqrt(M2 + 2. * Ma * kinetic);
  parameters[0] = (kinetic + mass + Ma) * sCM12i;
  *kinetic0 = (kinetic * Ma + mass * (mass + Ma)) * sCM12i - mass;
  if (*kinetic0 < 1E-09)
    *kinetic0 = 1E-09;
  const double etot = kinetic + mass + Ma;
  const double betaCM2 = kinetic * (kinetic + 2. * mass) / (etot * etot);
  double rM2 = mass / Ma;
  rM2 *= rM2;
  parameters[1] = sqrt(rM2 * (1. - betaCM2) + betaCM2);
}


x86 assembly (clang, -O0):
<coulomb_frame_parameters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    %rdi,-0x28(%rbp)
mov    %rsi,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
movsd  0xed5(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xec1(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm1
movsd  0xe81(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe56(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x20(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm3
addsd  -0x38(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movsd  0xdc7(%rip),%xmm0
ucomisd (%rax),%xmm0
jbe    1253 <coulomb_frame_parameters+0x143>
mov    -0x28(%rbp),%rax
movsd  0xdb1(%rip),%xmm0
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
addsd  %xmm1,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x50(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x18(%rbp),%xmm0
divsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  0xd48(%rip),%xmm2
subsd  -0x58(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
cvtsi2sd %eax,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,0x8(%rax)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coulomb_frame_parameters>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
movsd  %xmm3,0x8(%rsp)
movsd  %xmm2,0x10(%rsp)
subsd  %xmm0,%xmm1
mulsd  0xecb(%rip),%xmm1
mulsd  0xecb(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x18(%rsp)
movapd %xmm0,%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm1,0x20(%rsp)
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm0
mulsd  %xmm3,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0xe97(%rip),%xmm0
movapd %xmm0,%xmm2
divsd  %xmm1,%xmm2
movsd  0x10(%rsp),%xmm4
movapd %xmm4,%xmm1
movsd  0x8(%rsp),%xmm5
addsd  %xmm5,%xmm1
movsd  0x18(%rsp),%xmm6
addsd  %xmm6,%xmm1
movapd %xmm1,%xmm3
mulsd  %xmm2,%xmm3
movsd  %xmm3,(%rbx)
movsd  0x20(%rsp),%xmm7
mulsd  %xmm4,%xmm7
movapd %xmm5,%xmm3
mulsd  %xmm6,%xmm3
addsd  %xmm7,%xmm3
mulsd  %xmm2,%xmm3
subsd  %xmm4,%xmm3
movsd  0xe47(%rip),%xmm2
maxsd  %xmm3,%xmm2
movsd  %xmm2,(%r14)
movapd %xmm4,%xmm2
addsd  %xmm4,%xmm2
addsd  %xmm5,%xmm2
mulsd  %xmm5,%xmm2
mulsd  %xmm1,%xmm1
divsd  %xmm1,%xmm2
movapd %xmm4,%xmm1
divsd  %xmm6,%xmm1
mulsd  %xmm1,%xmm1
subsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%rbx)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @coulomb_frame_parameters(double %0, double %1, double %2, double %3, double* %4, double* %5) {
%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
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double* %4, double** %11
store double* %5, double** %12
%19 = load double, double* %7
%20 = load double, double* %8
%21 = load double, double* %7
%22 = fsub double %20, %21
%23 = fmul double %22, 0x3FEE10EA9E6EEB70
%24 = call double @llvm.fmuladd.f64(double %19, double 0x3FEE065300581494, double %23)
store double %24, double* %13
%25 = load double, double* %9
%26 = load double, double* %13
%27 = fadd double %25, %26
store double %27, double* %14
%28 = load double, double* %14
%29 = load double, double* %14
%30 = fmul double %29, %28
store double %30, double* %14
%31 = load double, double* %14
%32 = load double, double* %13
%33 = fmul double 2.000000e+00, %32
%34 = load double, double* %10
%35 = call double @llvm.fmuladd.f64(double %33, double %34, double %31)
%36 = call i32 @sqrt(double %35)
%37 = sitofp i32 %36 to double
%38 = fdiv double 1.000000e+00, %37
store double %38, double* %15
%39 = load double, double* %10
%40 = load double, double* %9
%41 = fadd double %39, %40
%42 = load double, double* %13
%43 = fadd double %41, %42
%44 = load double, double* %15
%45 = fmul double %43, %44
%46 = load double*, double** %12
%47 = getelementptr inbounds double, double* %46, i64 0
store double %45, double* %47
%48 = load double, double* %10
%49 = load double, double* %13
%50 = load double, double* %9
%51 = load double, double* %9
%52 = load double, double* %13
%53 = fadd double %51, %52
%54 = fmul double %50, %53
%55 = call double @llvm.fmuladd.f64(double %48, double %49, double %54)
%56 = load double, double* %15
%57 = load double, double* %9
%58 = fneg double %57
%59 = call double @llvm.fmuladd.f64(double %55, double %56, double %58)
%60 = load double*, double** %11
store double %59, double* %60
%61 = load double*, double** %11
%62 = load double, double* %61
%63 = fcmp olt double %62, 1.000000e-09
br i1 %63, label %64, label %66
64: ; preds = %6
%65 = load double*, double** %11
store double 1.000000e-09, double* %65
br label %66
66: ; preds = %64, %6
%67 = load double, double* %10
%68 = load double, double* %9
%69 = fadd double %67, %68
%70 = load double, double* %13
%71 = fadd double %69, %70
store double %71, double* %16
%72 = load double, double* %10
%73 = load double, double* %10
%74 = load double, double* %9
%75 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %74, double %73)
%76 = fmul double %72, %75
%77 = load double, double* %16
%78 = load double, double* %16
%79 = fmul double %77, %78
%80 = fdiv double %76, %79
store double %80, double* %17
%81 = load double, double* %9
%82 = load double, double* %13
%83 = fdiv double %81, %82
store double %83, double* %18
%84 = load double, double* %18
%85 = load double, double* %18
%86 = fmul double %85, %84
store double %86, double* %18
%87 = load double, double* %18
%88 = load double, double* %17
%89 = fsub double 1.000000e+00, %88
%90 = load double, double* %17
%91 = call double @llvm.fmuladd.f64(double %87, double %89, double %90)
%92 = call i32 @sqrt(double %91)
%93 = sitofp i32 %92 to double
%94 = load double*, double** %12
%95 = getelementptr inbounds double, double* %94, i64 1
store double %93, double* %95
ret void
}

LLVM IR (-O2):
define void @coulomb_frame_parameters(double %0, double %1, double %2, double %3, double* nocapture writeonly %4, double* nocapture writeonly %5) {
%7 = fsub double %1, %0
%8 = fmul double %7, 0x3FEE10EA9E6EEB70
%9 = tail call double @llvm.fmuladd.f64(double %0, double 0x3FEE065300581494, double %8)
%10 = fadd double %9, %2
%11 = fmul double %10, %10
%12 = fmul double %9, 2.000000e+00
%13 = tail call double @llvm.fmuladd.f64(double %12, double %3, double %11)
%14 = tail call i32 @sqrt(double %13)
%15 = sitofp i32 %14 to double
%16 = fdiv double 1.000000e+00, %15
%17 = fadd double %2, %3
%18 = fadd double %17, %9
%19 = fmul double %18, %16
store double %19, double* %5
%20 = fmul double %10, %2
%21 = tail call double @llvm.fmuladd.f64(double %3, double %9, double %20)
%22 = fneg double %2
%23 = tail call double @llvm.fmuladd.f64(double %21, double %16, double %22)
%24 = fcmp olt double %23, 1.000000e-09
%25 = select i1 %24, double 1.000000e-09, double %23
store double %25, double* %4
%26 = tail call double @llvm.fmuladd.f64(double %2, double 2.000000e+00, double %3)
%27 = fmul double %26, %3
%28 = fmul double %18, %18
%29 = fdiv double %27, %28
%30 = fdiv double %2, %9
%31 = fmul double %30, %30
%32 = fsub double 1.000000e+00, %29
%33 = tail call double @llvm.fmuladd.f64(double %31, double %32, double %29)
%34 = tail call i32 @sqrt(double %33)
%35 = sitofp i32 %34 to double
%36 = getelementptr inbounds double, double* %5, i64 1
store double %35, double* %36
ret void
}