#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 dd_quick_two_sum(double, double, double *);
void qd_quick_renorm(double *c0, double *c1, double *c2, double *c3,
                     double *c4) {
  double s, t0, t1, t2, t3;
  s = dd_quick_two_sum(*c3, *c4, &t3);
  s = dd_quick_two_sum(*c2, s, &t2);
  s = dd_quick_two_sum(*c1, s, &t1);
  *c0 = dd_quick_two_sum(*c0, s, &t0);
  s = dd_quick_two_sum(t2, t3, &t2);
  s = dd_quick_two_sum(t1, s, &t1);
  *c1 = dd_quick_two_sum(t0, s, &t0);
  s = dd_quick_two_sum(t1, t2, &t1);
  *c2 = dd_quick_two_sum(t0, s, &t0);
  *c3 = t0 + t1;
}


x86 assembly (clang, -O0):
<qd_quick_renorm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm1
lea    -0x50(%rbp),%rdi
call   1030 <dd_quick_two_sum@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x30(%rbp),%xmm1
lea    -0x48(%rbp),%rdi
call   1030 <dd_quick_two_sum@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x30(%rbp),%xmm1
lea    -0x40(%rbp),%rdi
call   1030 <dd_quick_two_sum@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x30(%rbp),%xmm1
lea    -0x38(%rbp),%rdi
call   1030 <dd_quick_two_sum@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x48(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
lea    -0x48(%rbp),%rdi
call   1030 <dd_quick_two_sum@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
lea    -0x40(%rbp),%rdi
call   1030 <dd_quick_two_sum@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
lea    -0x38(%rbp),%rdi
call   1030 <dd_quick_two_sum@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
lea    -0x40(%rbp),%rdi
call   1030 <dd_quick_two_sum@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
lea    -0x38(%rbp),%rdi
call   1030 <dd_quick_two_sum@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x38(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qd_quick_renorm>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rcx,0x18(%rsp)
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%rbp
movsd  (%rcx),%xmm0
movsd  (%r8),%xmm1
lea    0x20(%rsp),%rdi
call   1030 <dd_quick_two_sum@plt>
movaps %xmm0,%xmm1
movsd  (%r15),%xmm0
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1030 <dd_quick_two_sum@plt>
movaps %xmm0,%xmm1
movsd  (%rbx),%xmm0
mov    %rsp,%r12
mov    %r12,%rdi
call   1030 <dd_quick_two_sum@plt>
movaps %xmm0,%xmm1
movsd  0x0(%rbp),%xmm0
lea    0x8(%rsp),%r13
mov    %r13,%rdi
call   1030 <dd_quick_two_sum@plt>
movsd  %xmm0,0x0(%rbp)
movsd  0x10(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
mov    %r14,%rdi
call   1030 <dd_quick_two_sum@plt>
movaps %xmm0,%xmm1
movsd  (%rsp),%xmm0
mov    %r12,%rdi
call   1030 <dd_quick_two_sum@plt>
movaps %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
mov    %r13,%rdi
call   1030 <dd_quick_two_sum@plt>
movsd  %xmm0,(%rbx)
movsd  (%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    %r12,%rdi
call   1030 <dd_quick_two_sum@plt>
movaps %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
mov    %r13,%rdi
call   1030 <dd_quick_two_sum@plt>
movsd  %xmm0,(%r15)
movsd  0x8(%rsp),%xmm0
addsd  (%rsp),%xmm0
mov    0x18(%rsp),%rax
movsd  %xmm0,(%rax)
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @qd_quick_renorm(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
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
%16 = load double*, double** %9
%17 = load double, double* %16
%18 = load double*, double** %10
%19 = load double, double* %18
%20 = call double @dd_quick_two_sum(double %17, double %19, double* %15)
store double %20, double* %11
%21 = load double*, double** %8
%22 = load double, double* %21
%23 = load double, double* %11
%24 = call double @dd_quick_two_sum(double %22, double %23, double* %14)
store double %24, double* %11
%25 = load double*, double** %7
%26 = load double, double* %25
%27 = load double, double* %11
%28 = call double @dd_quick_two_sum(double %26, double %27, double* %13)
store double %28, double* %11
%29 = load double*, double** %6
%30 = load double, double* %29
%31 = load double, double* %11
%32 = call double @dd_quick_two_sum(double %30, double %31, double* %12)
%33 = load double*, double** %6
store double %32, double* %33
%34 = load double, double* %14
%35 = load double, double* %15
%36 = call double @dd_quick_two_sum(double %34, double %35, double* %14)
store double %36, double* %11
%37 = load double, double* %13
%38 = load double, double* %11
%39 = call double @dd_quick_two_sum(double %37, double %38, double* %13)
store double %39, double* %11
%40 = load double, double* %12
%41 = load double, double* %11
%42 = call double @dd_quick_two_sum(double %40, double %41, double* %12)
%43 = load double*, double** %7
store double %42, double* %43
%44 = load double, double* %13
%45 = load double, double* %14
%46 = call double @dd_quick_two_sum(double %44, double %45, double* %13)
store double %46, double* %11
%47 = load double, double* %12
%48 = load double, double* %11
%49 = call double @dd_quick_two_sum(double %47, double %48, double* %12)
%50 = load double*, double** %8
store double %49, double* %50
%51 = load double, double* %12
%52 = load double, double* %13
%53 = fadd double %51, %52
%54 = load double*, double** %9
store double %53, double* %54
ret void
}

LLVM IR (-O2):
define void @qd_quick_renorm(double* nocapture %0, double* nocapture %1, double* nocapture %2, double* nocapture %3, double* nocapture %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = bitcast double* %6 to i8*
%11 = bitcast double* %7 to i8*
%12 = bitcast double* %8 to i8*
%13 = bitcast double* %9 to i8*
%14 = load double, double* %3
%15 = load double, double* %4
%16 = call double @dd_quick_two_sum(double %14, double %15, double* %9)
%17 = load double, double* %2
%18 = call double @dd_quick_two_sum(double %17, double %16, double* %8)
%19 = load double, double* %1
%20 = call double @dd_quick_two_sum(double %19, double %18, double* %7)
%21 = load double, double* %0
%22 = call double @dd_quick_two_sum(double %21, double %20, double* %6)
store double %22, double* %0
%23 = load double, double* %8
%24 = load double, double* %9
%25 = call double @dd_quick_two_sum(double %23, double %24, double* %8)
%26 = load double, double* %7
%27 = call double @dd_quick_two_sum(double %26, double %25, double* %7)
%28 = load double, double* %6
%29 = call double @dd_quick_two_sum(double %28, double %27, double* %6)
store double %29, double* %1
%30 = load double, double* %7
%31 = load double, double* %8
%32 = call double @dd_quick_two_sum(double %30, double %31, double* %7)
%33 = load double, double* %6
%34 = call double @dd_quick_two_sum(double %33, double %32, double* %6)
store double %34, double* %2
%35 = load double, double* %6
%36 = load double, double* %7
%37 = fadd double %35, %36
store double %37, double* %3
ret void
}