#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 cdflib_dstrem(double *);
double cdflib_fifdmax1(double const, double const);
double cdflib_fifdmin1(double const, double const);
double cdflib_dbetrm(const double *a, const double *b) {
  double dbetrm, T1, T2, T3;
  T1 = *a + *b;
  dbetrm = -cdflib_dstrem(&T1);
  T2 = cdflib_fifdmax1(*a, *b);
  dbetrm += cdflib_dstrem(&T2);
  T3 = cdflib_fifdmin1(*a, *b);
  dbetrm += cdflib_dstrem(&T3);
  return dbetrm;
}


x86 assembly (clang, -O0):
<cdflib_dbetrm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    -0x20(%rbp),%rdi
call   1050 <cdflib_dstrem@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
call   1040 <cdflib_fifdmax1@plt>
movsd  %xmm0,-0x28(%rbp)
lea    -0x28(%rbp),%rdi
call   1050 <cdflib_dstrem@plt>
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
call   1030 <cdflib_fifdmin1@plt>
movsd  %xmm0,-0x30(%rbp)
lea    -0x30(%rbp),%rdi
call   1050 <cdflib_dstrem@plt>
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdflib_dbetrm>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
addsd  (%rsi),%xmm0
movsd  %xmm0,0x20(%rsp)
lea    0x20(%rsp),%rdi
call   1050 <cdflib_dstrem@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rbx),%xmm0
movsd  (%r14),%xmm1
call   1040 <cdflib_fifdmax1@plt>
movsd  %xmm0,0x18(%rsp)
lea    0x18(%rsp),%rdi
call   1050 <cdflib_dstrem@plt>
subsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%rbx),%xmm0
movsd  (%r14),%xmm1
call   1030 <cdflib_fifdmin1@plt>
movsd  %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
call   1050 <cdflib_dstrem@plt>
addsd  0x8(%rsp),%xmm0
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double @cdflib_dbetrm(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%9 = load double*, double** %3
%10 = load double, double* %9
%11 = load double*, double** %4
%12 = load double, double* %11
%13 = fadd double %10, %12
store double %13, double* %6
%14 = call double @cdflib_dstrem(double* %6)
%15 = fneg double %14
store double %15, double* %5
%16 = load double*, double** %3
%17 = load double, double* %16
%18 = load double*, double** %4
%19 = load double, double* %18
%20 = call double @cdflib_fifdmax1(double %17, double %19)
store double %20, double* %7
%21 = call double @cdflib_dstrem(double* %7)
%22 = load double, double* %5
%23 = fadd double %22, %21
store double %23, double* %5
%24 = load double*, double** %3
%25 = load double, double* %24
%26 = load double*, double** %4
%27 = load double, double* %26
%28 = call double @cdflib_fifdmin1(double %25, double %27)
store double %28, double* %8
%29 = call double @cdflib_dstrem(double* %8)
%30 = load double, double* %5
%31 = fadd double %30, %29
store double %31, double* %5
%32 = load double, double* %5
ret double %32
}

LLVM IR (-O2):
define double @cdflib_dbetrm(double* nocapture %0, double* nocapture %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = bitcast double* %3 to i8*
%7 = bitcast double* %4 to i8*
%8 = bitcast double* %5 to i8*
%9 = load double, double* %0
%10 = load double, double* %1
%11 = fadd double %9, %10
store double %11, double* %3
%12 = call double @cdflib_dstrem(double* %3)
%13 = load double, double* %0
%14 = load double, double* %1
%15 = call double @cdflib_fifdmax1(double %13, double %14)
store double %15, double* %4
%16 = call double @cdflib_dstrem(double* %4)
%17 = fsub double %16, %12
%18 = load double, double* %0
%19 = load double, double* %1
%20 = call double @cdflib_fifdmin1(double %18, double %19)
store double %20, double* %5
%21 = call double @cdflib_dstrem(double* %5)
%22 = fadd double %17, %21
ret double %22
}