void dd_split(double a, double *hi, double *lo) {
  const double QD_SPLITTER = 134217729.0;
  const double QD_SPLIT_THRESH = 6.69692879491417e+299;
  double temp;
  if (a > QD_SPLIT_THRESH || a < -QD_SPLIT_THRESH) {
    a *= 3.7252902984619140625e-09;
    temp = QD_SPLITTER * a;
    *hi = temp - (temp - a);
    *lo = a - *hi;
    *hi *= 268435456.0;
    *lo *= 268435456.0;
  } else {
    temp = QD_SPLITTER * a;
    *hi = temp - (temp - a);
    *lo = a - *hi;
  }
}


x86 assembly (clang, -O0):
<dd_split>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xeda(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xec8(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1155 <dd_split+0x55>
movsd  0xec6(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    11d6 <dd_split+0xd6>
movsd  0xec3(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xe99(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
subsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0xe63(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  0xe4f(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    1218 <dd_split+0x118>
movsd  0xe2a(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
subsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dd_split>:
ucomisd 0xef8(%rip),%xmm0
ja     113d <dd_split+0x3d>
movsd  0xef6(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     113d <dd_split+0x3d>
movsd  0xef0(%rip),%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
subsd  %xmm2,%xmm1
movsd  %xmm1,(%rdi)
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rsi)
ret
mulsd  0xed3(%rip),%xmm0
movsd  0xec3(%rip),%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
subsd  %xmm2,%xmm1
movsd  %xmm1,(%rdi)
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rsi)
movsd  0xeaf(%rip),%xmm0
movsd  (%rdi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rdi)
mulsd  (%rsi),%xmm0
movsd  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @dd_split(double %0, double* %1, double* %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %4
store double* %1, double** %5
store double* %2, double** %6
store double 0x41A0000002000000, double* %7
store double 0x7E2FFFFFFFFFFFFF, double* %8
%10 = load double, double* %4
%11 = fcmp ogt double %10, 0x7E2FFFFFFFFFFFFF
br i1 %11, label %15, label %12
12: ; preds = %3
%13 = load double, double* %4
%14 = fcmp olt double %13, 0xFE2FFFFFFFFFFFFF
br i1 %14, label %15, label %37
15: ; preds = %12, %3
%16 = load double, double* %4
%17 = fmul double %16, 0x3E30000000000000
store double %17, double* %4
%18 = load double, double* %4
%19 = fmul double 0x41A0000002000000, %18
store double %19, double* %9
%20 = load double, double* %9
%21 = load double, double* %9
%22 = load double, double* %4
%23 = fsub double %21, %22
%24 = fsub double %20, %23
%25 = load double*, double** %5
store double %24, double* %25
%26 = load double, double* %4
%27 = load double*, double** %5
%28 = load double, double* %27
%29 = fsub double %26, %28
%30 = load double*, double** %6
store double %29, double* %30
%31 = load double*, double** %5
%32 = load double, double* %31
%33 = fmul double %32, 0x41B0000000000000
store double %33, double* %31
%34 = load double*, double** %6
%35 = load double, double* %34
%36 = fmul double %35, 0x41B0000000000000
store double %36, double* %34
br label %51
37: ; preds = %12
%38 = load double, double* %4
%39 = fmul double 0x41A0000002000000, %38
store double %39, double* %9
%40 = load double, double* %9
%41 = load double, double* %9
%42 = load double, double* %4
%43 = fsub double %41, %42
%44 = fsub double %40, %43
%45 = load double*, double** %5
store double %44, double* %45
%46 = load double, double* %4
%47 = load double*, double** %5
%48 = load double, double* %47
%49 = fsub double %46, %48
%50 = load double*, double** %6
store double %49, double* %50
br label %51
51: ; preds = %37, %15
ret void
}

LLVM IR (-O2):
define void @dd_split(double %0, double* nocapture %1, double* nocapture %2) {
%4 = fcmp ogt double %0, 0x7E2FFFFFFFFFFFFF
%5 = fcmp olt double %0, 0xFE2FFFFFFFFFFFFF
%6 = or i1 %4, %5
br i1 %6, label %7, label %17
7: ; preds = %3
%8 = fmul double %0, 0x3E30000000000000
%9 = fmul double %8, 0x41A0000002000000
%10 = fsub double %9, %8
%11 = fsub double %9, %10
store double %11, double* %1
%12 = fsub double %8, %11
store double %12, double* %2
%13 = load double, double* %1
%14 = fmul double %13, 0x41B0000000000000
store double %14, double* %1
%15 = load double, double* %2
%16 = fmul double %15, 0x41B0000000000000
br label %22
17: ; preds = %3
%18 = fmul double %0, 0x41A0000002000000
%19 = fsub double %18, %0
%20 = fsub double %18, %19
store double %20, double* %1
%21 = fsub double %0, %20
br label %22
22: ; preds = %17, %7
%23 = phi double [ %21, %17 ], [ %16, %7 ]
store double %23, double* %2
ret void
}