#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 const, double *);
double dd_two_sum(double, double, double *);
int /*<<< orphan*/ td_fast_renorm(double, double, double, double, double *,
                                  double *, double *);
void td_mul(const double *a, const double *b, double *c) {
  double f0, f1, f2, f3, p, e;
  f3 = a[1] * b[2] + a[2] * b[1];
  f2 = dd_two_prod(a[0], b[2], &e);
  f3 += e;
  p = dd_two_prod(a[1], b[1], &e);
  f3 += e;
  f2 = dd_two_sum(f2, p, &e);
  f3 += e;
  p = dd_two_prod(a[2], b[0], &e);
  f3 += e;
  f2 = dd_two_sum(f2, p, &e);
  f3 += e;
  f1 = dd_two_prod(a[0], b[1], &e);
  f2 = dd_two_sum(f2, e, &e);
  f3 += e;
  p = dd_two_prod(a[1], b[0], &e);
  f2 = dd_two_sum(f2, e, &e);
  f3 += e;
  f1 = dd_two_sum(f1, p, &e);
  f2 = dd_two_sum(f2, e, &e);
  f3 += e;
  f0 = dd_two_prod(a[0], b[0], &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>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm1
lea    -0x48(%rbp),%rdi
call   1040 <dd_two_prod@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x48(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
lea    -0x48(%rbp),%rdi
call   1040 <dd_two_prod@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x48(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
lea    -0x48(%rbp),%rdi
call   1050 <dd_two_sum@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x48(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
lea    -0x48(%rbp),%rdi
call   1040 <dd_two_prod@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x48(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
lea    -0x48(%rbp),%rdi
call   1050 <dd_two_sum@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x48(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
lea    -0x48(%rbp),%rdi
call   1040 <dd_two_prod@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
lea    -0x48(%rbp),%rdi
call   1050 <dd_two_sum@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x48(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
lea    -0x48(%rbp),%rdi
call   1040 <dd_two_prod@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
lea    -0x48(%rbp),%rdi
call   1050 <dd_two_sum@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x48(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
lea    -0x48(%rbp),%rdi
call   1050 <dd_two_sum@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
lea    -0x48(%rbp),%rdi
call   1050 <dd_two_sum@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x48(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
lea    -0x48(%rbp),%rdi
call   1040 <dd_two_prod@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
lea    -0x48(%rbp),%rdi
call   1050 <dd_two_sum@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
lea    -0x48(%rbp),%rdi
call   1050 <dd_two_sum@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x48(%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    $0x50,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @td_mul(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
%12 = alloca double
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%13 = load double*, double** %4
%14 = getelementptr inbounds double, double* %13, i64 1
%15 = load double, double* %14
%16 = load double*, double** %5
%17 = getelementptr inbounds double, double* %16, i64 2
%18 = load double, double* %17
%19 = load double*, double** %4
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = load double*, double** %5
%23 = getelementptr inbounds double, double* %22, i64 1
%24 = load double, double* %23
%25 = fmul double %21, %24
%26 = call double @llvm.fmuladd.f64(double %15, double %18, double %25)
store double %26, double* %10
%27 = load double*, double** %4
%28 = getelementptr inbounds double, double* %27, i64 0
%29 = load double, double* %28
%30 = load double*, double** %5
%31 = getelementptr inbounds double, double* %30, i64 2
%32 = load double, double* %31
%33 = call double @dd_two_prod(double %29, double %32, double* %12)
store double %33, double* %9
%34 = load double, double* %12
%35 = load double, double* %10
%36 = fadd double %35, %34
store double %36, double* %10
%37 = load double*, double** %4
%38 = getelementptr inbounds double, double* %37, i64 1
%39 = load double, double* %38
%40 = load double*, double** %5
%41 = getelementptr inbounds double, double* %40, i64 1
%42 = load double, double* %41
%43 = call double @dd_two_prod(double %39, double %42, double* %12)
store double %43, double* %11
%44 = load double, double* %12
%45 = load double, double* %10
%46 = fadd double %45, %44
store double %46, double* %10
%47 = load double, double* %9
%48 = load double, double* %11
%49 = call double @dd_two_sum(double %47, double %48, double* %12)
store double %49, double* %9
%50 = load double, double* %12
%51 = load double, double* %10
%52 = fadd double %51, %50
store double %52, double* %10
%53 = load double*, double** %4
%54 = getelementptr inbounds double, double* %53, i64 2
%55 = load double, double* %54
%56 = load double*, double** %5
%57 = getelementptr inbounds double, double* %56, i64 0
%58 = load double, double* %57
%59 = call double @dd_two_prod(double %55, double %58, double* %12)
store double %59, double* %11
%60 = load double, double* %12
%61 = load double, double* %10
%62 = fadd double %61, %60
store double %62, double* %10
%63 = load double, double* %9
%64 = load double, double* %11
%65 = call double @dd_two_sum(double %63, double %64, double* %12)
store double %65, double* %9
%66 = load double, double* %12
%67 = load double, double* %10
%68 = fadd double %67, %66
store double %68, double* %10
%69 = load double*, double** %4
%70 = getelementptr inbounds double, double* %69, i64 0
%71 = load double, double* %70
%72 = load double*, double** %5
%73 = getelementptr inbounds double, double* %72, i64 1
%74 = load double, double* %73
%75 = call double @dd_two_prod(double %71, double %74, double* %12)
store double %75, double* %8
%76 = load double, double* %9
%77 = load double, double* %12
%78 = call double @dd_two_sum(double %76, double %77, double* %12)
store double %78, double* %9
%79 = load double, double* %12
%80 = load double, double* %10
%81 = fadd double %80, %79
store double %81, double* %10
%82 = load double*, double** %4
%83 = getelementptr inbounds double, double* %82, i64 1
%84 = load double, double* %83
%85 = load double*, double** %5
%86 = getelementptr inbounds double, double* %85, i64 0
%87 = load double, double* %86
%88 = call double @dd_two_prod(double %84, double %87, double* %12)
store double %88, double* %11
%89 = load double, double* %9
%90 = load double, double* %12
%91 = call double @dd_two_sum(double %89, double %90, double* %12)
store double %91, double* %9
%92 = load double, double* %12
%93 = load double, double* %10
%94 = fadd double %93, %92
store double %94, double* %10
%95 = load double, double* %8
%96 = load double, double* %11
%97 = call double @dd_two_sum(double %95, double %96, double* %12)
store double %97, double* %8
%98 = load double, double* %9
%99 = load double, double* %12
%100 = call double @dd_two_sum(double %98, double %99, double* %12)
store double %100, double* %9
%101 = load double, double* %12
%102 = load double, double* %10
%103 = fadd double %102, %101
store double %103, double* %10
%104 = load double*, double** %4
%105 = getelementptr inbounds double, double* %104, i64 0
%106 = load double, double* %105
%107 = load double*, double** %5
%108 = getelementptr inbounds double, double* %107, i64 0
%109 = load double, double* %108
%110 = call double @dd_two_prod(double %106, double %109, double* %12)
store double %110, double* %7
%111 = load double, double* %8
%112 = load double, double* %12
%113 = call double @dd_two_sum(double %111, double %112, double* %12)
store double %113, double* %8
%114 = load double, double* %9
%115 = load double, double* %12
%116 = call double @dd_two_sum(double %114, double %115, double* %12)
store double %116, double* %9
%117 = load double, double* %12
%118 = load double, double* %10
%119 = fadd double %118, %117
store double %119, double* %10
%120 = load double, double* %7
%121 = load double, double* %8
%122 = load double, double* %9
%123 = load double, double* %10
%124 = load double*, double** %6
%125 = getelementptr inbounds double, double* %124, i64 0
%126 = load double*, double** %6
%127 = getelementptr inbounds double, double* %126, i64 1
%128 = load double*, double** %6
%129 = getelementptr inbounds double, double* %128, i64 2
%130 = call i32 @td_fast_renorm(double %120, double %121, double %122, double %123, double* %125, double* %127, double* %129)
ret void
}

LLVM IR (-O2):
define void @td_mul(double* nocapture %0, double* nocapture %1, double* %2) {
%4 = alloca double
%5 = bitcast double* %4 to i8*
%6 = getelementptr inbounds double, double* %0, i64 1
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %1, i64 2
%9 = load double, double* %8
%10 = getelementptr inbounds double, double* %0, i64 2
%11 = load double, double* %10
%12 = getelementptr inbounds double, double* %1, i64 1
%13 = load double, double* %12
%14 = fmul double %11, %13
%15 = tail call double @llvm.fmuladd.f64(double %7, double %9, double %14)
%16 = load double, double* %0
%17 = call double @dd_two_prod(double %16, double %9, double* %4)
%18 = load double, double* %4
%19 = fadd double %15, %18
%20 = load double, double* %6
%21 = load double, double* %12
%22 = call double @dd_two_prod(double %20, double %21, double* %4)
%23 = load double, double* %4
%24 = fadd double %19, %23
%25 = call double @dd_two_sum(double %17, double %22, double* %4)
%26 = load double, double* %4
%27 = fadd double %24, %26
%28 = load double, double* %10
%29 = load double, double* %1
%30 = call double @dd_two_prod(double %28, double %29, double* %4)
%31 = load double, double* %4
%32 = fadd double %27, %31
%33 = call double @dd_two_sum(double %25, double %30, double* %4)
%34 = load double, double* %4
%35 = fadd double %32, %34
%36 = load double, double* %0
%37 = load double, double* %12
%38 = call double @dd_two_prod(double %36, double %37, double* %4)
%39 = load double, double* %4
%40 = call double @dd_two_sum(double %33, double %39, double* %4)
%41 = load double, double* %4
%42 = fadd double %35, %41
%43 = load double, double* %6
%44 = load double, double* %1
%45 = call double @dd_two_prod(double %43, double %44, double* %4)
%46 = load double, double* %4
%47 = call double @dd_two_sum(double %40, double %46, double* %4)
%48 = load double, double* %4
%49 = fadd double %42, %48
%50 = call double @dd_two_sum(double %38, double %45, double* %4)
%51 = load double, double* %4
%52 = call double @dd_two_sum(double %47, double %51, double* %4)
%53 = load double, double* %4
%54 = fadd double %49, %53
%55 = load double, double* %0
%56 = load double, double* %1
%57 = call double @dd_two_prod(double %55, double %56, double* %4)
%58 = load double, double* %4
%59 = call double @dd_two_sum(double %50, double %58, double* %4)
%60 = load double, double* %4
%61 = call double @dd_two_sum(double %52, double %60, double* %4)
%62 = load double, double* %4
%63 = fadd double %54, %62
%64 = getelementptr inbounds double, double* %2, i64 1
%65 = getelementptr inbounds double, double* %2, i64 2
%66 = call i32 @td_fast_renorm(double %57, double %59, double %61, double %63, double* %2, double* %64, double* %65)
ret void
}