#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_two_prod(double const, double, double *);
double dd_two_sum(double, double, double *);
int /*<<< orphan*/ td_fast_renorm(double, double, double, double, double *,
                                  double *, double *);
void td_mul_td_d(const double *a, double b, double *c) {
  double f0, f1, f2, f3, e;
  f3 = 0.0;
  f2 = dd_two_prod(a[2], b, &e);
  f3 += e;
  f1 = dd_two_prod(a[1], b, &e);
  f2 = dd_two_sum(f2, e, &e);
  f3 += e;
  f0 = dd_two_prod(a[0], b, &e);
  f1 = dd_two_sum(f1, e, &e);
  f2 = dd_two_sum(f2, e, &e);
  f3 += e;
  td_fast_renorm(f0, f1, f2, f3, &c[0], &c[1], &c[2]);
}


x86 assembly (clang, -O0):
<td_mul_td_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    -0x40(%rbp),%rdi
call   1040 <dd_two_prod@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x40(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    -0x40(%rbp),%rdi
call   1040 <dd_two_prod@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
lea    -0x40(%rbp),%rdi
call   1050 <dd_two_sum@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x40(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    -0x40(%rbp),%rdi
call   1040 <dd_two_prod@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
lea    -0x40(%rbp),%rdi
call   1050 <dd_two_sum@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
lea    -0x40(%rbp),%rdi
call   1050 <dd_two_sum@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x40(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm3
mov    -0x18(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x8,%rsi
mov    -0x18(%rbp),%rdx
add    $0x10,%rdx
call   1030 <td_fast_renorm@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<td_mul_td_d>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %rsi,%r14
movaps %xmm0,%xmm1
movsd  %xmm0,0x10(%rsp)
mov    %rdi,%rbx
movsd  0x10(%rdi),%xmm0
lea    0x8(%rsp),%r15
mov    %r15,%rdi
call   1040 <dd_two_prod@plt>
movsd  %xmm0,0x18(%rsp)
xorpd  %xmm0,%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x8(%rbx),%xmm0
movsd  0x10(%rsp),%xmm1
mov    %r15,%rdi
call   1040 <dd_two_prod@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm1
movsd  0x18(%rsp),%xmm0
mov    %r15,%rdi
call   1050 <dd_two_sum@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x28(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  (%rbx),%xmm0
movsd  0x10(%rsp),%xmm1
mov    %r15,%rdi
call   1040 <dd_two_prod@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm1
movsd  0x20(%rsp),%xmm0
mov    %r15,%rdi
call   1050 <dd_two_sum@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm1
movsd  0x18(%rsp),%xmm0
mov    %r15,%rdi
call   1050 <dd_two_sum@plt>
movaps %xmm0,%xmm2
movsd  0x28(%rsp),%xmm3
addsd  0x8(%rsp),%xmm3
lea    0x8(%r14),%rsi
lea    0x10(%r14),%rdx
movsd  0x10(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
mov    %r14,%rdi
call   1030 <td_fast_renorm@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @td_mul_td_d(double* %0, double %1, double* %2) {
%4 = alloca double*
%5 = alloca double
%6 = alloca double*
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store double* %0, double** %4
store double %1, double* %5
store double* %2, double** %6
store double 0.000000e+00, double* %10
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 2
%14 = load double, double* %13
%15 = load double, double* %5
%16 = call double @dd_two_prod(double %14, double %15, double* %11)
store double %16, double* %9
%17 = load double, double* %11
%18 = load double, double* %10
%19 = fadd double %18, %17
store double %19, double* %10
%20 = load double*, double** %4
%21 = getelementptr inbounds double, double* %20, i64 1
%22 = load double, double* %21
%23 = load double, double* %5
%24 = call double @dd_two_prod(double %22, double %23, double* %11)
store double %24, double* %8
%25 = load double, double* %9
%26 = load double, double* %11
%27 = call double @dd_two_sum(double %25, double %26, double* %11)
store double %27, double* %9
%28 = load double, double* %11
%29 = load double, double* %10
%30 = fadd double %29, %28
store double %30, double* %10
%31 = load double*, double** %4
%32 = getelementptr inbounds double, double* %31, i64 0
%33 = load double, double* %32
%34 = load double, double* %5
%35 = call double @dd_two_prod(double %33, double %34, double* %11)
store double %35, double* %7
%36 = load double, double* %8
%37 = load double, double* %11
%38 = call double @dd_two_sum(double %36, double %37, double* %11)
store double %38, double* %8
%39 = load double, double* %9
%40 = load double, double* %11
%41 = call double @dd_two_sum(double %39, double %40, double* %11)
store double %41, double* %9
%42 = load double, double* %11
%43 = load double, double* %10
%44 = fadd double %43, %42
store double %44, double* %10
%45 = load double, double* %7
%46 = load double, double* %8
%47 = load double, double* %9
%48 = load double, double* %10
%49 = load double*, double** %6
%50 = getelementptr inbounds double, double* %49, i64 0
%51 = load double*, double** %6
%52 = getelementptr inbounds double, double* %51, i64 1
%53 = load double*, double** %6
%54 = getelementptr inbounds double, double* %53, i64 2
%55 = call i32 @td_fast_renorm(double %45, double %46, double %47, double %48, double* %50, double* %52, double* %54)
ret void
}

LLVM IR (-O2):
define void @td_mul_td_d(double* nocapture %0, double %1, double* %2) {
%4 = alloca double
%5 = bitcast double* %4 to i8*
%6 = getelementptr inbounds double, double* %0, i64 2
%7 = load double, double* %6
%8 = call double @dd_two_prod(double %7, double %1, double* %4)
%9 = load double, double* %4
%10 = fadd double %9, 0.000000e+00
%11 = getelementptr inbounds double, double* %0, i64 1
%12 = load double, double* %11
%13 = call double @dd_two_prod(double %12, double %1, double* %4)
%14 = load double, double* %4
%15 = call double @dd_two_sum(double %8, double %14, double* %4)
%16 = load double, double* %4
%17 = fadd double %10, %16
%18 = load double, double* %0
%19 = call double @dd_two_prod(double %18, double %1, double* %4)
%20 = load double, double* %4
%21 = call double @dd_two_sum(double %13, double %20, double* %4)
%22 = load double, double* %4
%23 = call double @dd_two_sum(double %15, double %22, double* %4)
%24 = load double, double* %4
%25 = fadd double %17, %24
%26 = getelementptr inbounds double, double* %2, i64 1
%27 = getelementptr inbounds double, double* %2, i64 2
%28 = call i32 @td_fast_renorm(double %19, double %21, double %23, double %25, double* %2, double* %26, double* %27)
ret void
}