#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*/ qd_renorm5(double *, double *, double *, double *, double *);
int /*<<< orphan*/ qd_three_sum(double *, double *, double *);
int /*<<< orphan*/ qd_three_sum2(double *, double *, double *);
void qd_mul_dd(const double *a, const double *b, double *c) {
  double p0, p1, p2, p3, p4;
  double q0, q1, q2, q3, q4;
  double s0, s1, s2;
  double t0, t1;
  p0 = dd_two_prod(a[0], b[0], &q0);
  p1 = dd_two_prod(a[0], b[1], &q1);
  p2 = dd_two_prod(a[1], b[0], &q2);
  p3 = dd_two_prod(a[1], b[1], &q3);
  p4 = dd_two_prod(a[2], b[0], &q4);
  qd_three_sum(&p1, &p2, &q0);
  qd_three_sum(&p2, &p3, &p4);
  q1 = dd_two_sum(q1, q2, &q2);
  s0 = dd_two_sum(p2, q1, &t0);
  s1 = dd_two_sum(p3, q2, &t1);
  s1 = dd_two_sum(s1, t0, &t0);
  s2 = t0 + t1 + p4;
  p2 = s0;
  p3 = a[2] * b[0] + a[3] * b[1] + q3 + q4;
  qd_three_sum2(&p3, &q0, &s1);
  p4 = q0 + s2;
  qd_renorm5(&p0, &p1, &p2, &p3, &p4);
  c[0] = p0;
  c[1] = p1;
  c[2] = p2;
  c[3] = p3;
}


x86 assembly (clang, -O0):
<qd_mul_dd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
lea    -0x48(%rbp),%rdi
call   1030 <dd_two_prod@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
lea    -0x50(%rbp),%rdi
call   1030 <dd_two_prod@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
lea    -0x58(%rbp),%rdi
call   1030 <dd_two_prod@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
lea    -0x60(%rbp),%rdi
call   1030 <dd_two_prod@plt>
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
lea    -0x68(%rbp),%rdi
call   1030 <dd_two_prod@plt>
movsd  %xmm0,-0x40(%rbp)
lea    -0x28(%rbp),%rdi
lea    -0x30(%rbp),%rsi
lea    -0x48(%rbp),%rdx
call   1070 <qd_three_sum@plt>
lea    -0x30(%rbp),%rdi
lea    -0x38(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   1070 <qd_three_sum@plt>
movsd  -0x50(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
lea    -0x58(%rbp),%rdi
call   1050 <dd_two_sum@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
lea    -0x88(%rbp),%rdi
call   1050 <dd_two_sum@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
lea    -0x90(%rbp),%rdi
call   1050 <dd_two_sum@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  -0x88(%rbp),%xmm1
ff
lea    -0x88(%rbp),%rdi
call   1050 <dd_two_sum@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
addsd  -0x90(%rbp),%xmm0
ff
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x60(%rbp),%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
lea    -0x38(%rbp),%rdi
lea    -0x48(%rbp),%rsi
lea    -0x78(%rbp),%rdx
call   1040 <qd_three_sum2@plt>
movsd  -0x48(%rbp),%xmm0
addsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
lea    -0x30(%rbp),%rdx
lea    -0x38(%rbp),%rcx
lea    -0x40(%rbp),%r8
call   1060 <qd_renorm5@plt>
movsd  -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x30(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x18(%rax)
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qd_mul_dd>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
lea    0x38(%rsp),%r14
mov    %r14,%rdi
call   1030 <dd_two_prod@plt>
movsd  %xmm0,0x40(%rsp)
movsd  (%rbx),%xmm0
movsd  0x8(%r12),%xmm1
lea    0x30(%rsp),%rdi
call   1030 <dd_two_prod@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rbx),%xmm0
movsd  (%r12),%xmm1
lea    0x28(%rsp),%r13
mov    %r13,%rdi
call   1030 <dd_two_prod@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rbx),%xmm0
movsd  0x8(%r12),%xmm1
lea    0x70(%rsp),%rdi
call   1030 <dd_two_prod@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x10(%rbx),%xmm0
movsd  (%r12),%xmm1
lea    0x68(%rsp),%rdi
call   1030 <dd_two_prod@plt>
movsd  %xmm0,0x8(%rsp)
lea    0x18(%rsp),%rdi
mov    %rsp,%rbp
mov    %rbp,%rsi
mov    %r14,%rdx
call   1070 <qd_three_sum@plt>
lea    0x10(%rsp),%r14
lea    0x8(%rsp),%rdx
mov    %rbp,%rdi
mov    %r14,%rsi
call   1070 <qd_three_sum@plt>
movsd  0x30(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
mov    %r13,%rdi
call   1050 <dd_two_sum@plt>
movaps %xmm0,%xmm1
movsd  %xmm0,0x30(%rsp)
movsd  (%rsp),%xmm0
lea    0x20(%rsp),%rbp
mov    %rbp,%rdi
call   1050 <dd_two_sum@plt>
movsd  %xmm0,0x50(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
lea    0x58(%rsp),%rdi
call   1050 <dd_two_sum@plt>
movsd  0x20(%rsp),%xmm1
mov    %rbp,%rdi
call   1050 <dd_two_sum@plt>
movsd  0x20(%rsp),%xmm1
addsd  0x58(%rsp),%xmm1
addsd  0x8(%rsp),%xmm1
movsd  %xmm1,0x48(%rsp)
movsd  %xmm0,0x60(%rsp)
movsd  0x50(%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rbx),%xmm0
movsd  0x18(%rbx),%xmm1
mulsd  0x8(%r12),%xmm1
mulsd  (%r12),%xmm0
addsd  %xmm1,%xmm0
addsd  0x70(%rsp),%xmm0
addsd  0x68(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
lea    0x60(%rsp),%rdx
mov    %r14,%rdi
lea    0x38(%rsp),%rsi
call   1040 <qd_three_sum2@plt>
movsd  0x48(%rsp),%xmm0
addsd  0x38(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x40(%rsp),%rdi
lea    0x18(%rsp),%rsi
mov    %rsp,%rdx
mov    %r14,%rcx
lea    0x8(%rsp),%r8
call   1060 <qd_renorm5@plt>
movsd  0x40(%rsp),%xmm0
movsd  %xmm0,(%r15)
movsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x8(%r15)
movsd  (%rsp),%xmm0
movsd  %xmm0,0x10(%r15)
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x18(%r15)
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @qd_mul_dd(double* nocapture %0, double* nocapture %1, double* nocapture writeonly %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
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = bitcast double* %4 to i8*
%18 = bitcast double* %5 to i8*
%19 = bitcast double* %6 to i8*
%20 = bitcast double* %7 to i8*
%21 = bitcast double* %8 to i8*
%22 = bitcast double* %9 to i8*
%23 = bitcast double* %10 to i8*
%24 = bitcast double* %11 to i8*
%25 = bitcast double* %12 to i8*
%26 = bitcast double* %13 to i8*
%27 = bitcast double* %14 to i8*
%28 = bitcast double* %15 to i8*
%29 = bitcast double* %16 to i8*
%30 = load double, double* %0
%31 = load double, double* %1
%32 = call double @dd_two_prod(double %30, double %31, double* %9)
store double %32, double* %4
%33 = load double, double* %0
%34 = getelementptr inbounds double, double* %1, i64 1
%35 = load double, double* %34
%36 = call double @dd_two_prod(double %33, double %35, double* %10)
store double %36, double* %5
%37 = getelementptr inbounds double, double* %0, i64 1
%38 = load double, double* %37
%39 = load double, double* %1
%40 = call double @dd_two_prod(double %38, double %39, double* %11)
store double %40, double* %6
%41 = load double, double* %37
%42 = load double, double* %34
%43 = call double @dd_two_prod(double %41, double %42, double* %12)
store double %43, double* %7
%44 = getelementptr inbounds double, double* %0, i64 2
%45 = load double, double* %44
%46 = load double, double* %1
%47 = call double @dd_two_prod(double %45, double %46, double* %13)
store double %47, double* %8
%48 = call i32 @qd_three_sum(double* %5, double* %6, double* %9)
%49 = call i32 @qd_three_sum(double* %6, double* %7, double* %8)
%50 = load double, double* %10
%51 = load double, double* %11
%52 = call double @dd_two_sum(double %50, double %51, double* %11)
store double %52, double* %10
%53 = load double, double* %6
%54 = call double @dd_two_sum(double %53, double %52, double* %15)
%55 = load double, double* %7
%56 = load double, double* %11
%57 = call double @dd_two_sum(double %55, double %56, double* %16)
%58 = load double, double* %15
%59 = call double @dd_two_sum(double %57, double %58, double* %15)
store double %59, double* %14
%60 = load double, double* %15
%61 = load double, double* %16
%62 = fadd double %60, %61
%63 = load double, double* %8
%64 = fadd double %62, %63
store double %54, double* %6
%65 = load double, double* %44
%66 = load double, double* %1
%67 = getelementptr inbounds double, double* %0, i64 3
%68 = load double, double* %67
%69 = load double, double* %34
%70 = fmul double %68, %69
%71 = call double @llvm.fmuladd.f64(double %65, double %66, double %70)
%72 = load double, double* %12
%73 = fadd double %72, %71
%74 = load double, double* %13
%75 = fadd double %74, %73
store double %75, double* %7
%76 = call i32 @qd_three_sum2(double* %7, double* %9, double* %14)
%77 = load double, double* %9
%78 = fadd double %64, %77
store double %78, double* %8
%79 = call i32 @qd_renorm5(double* %4, double* %5, double* %6, double* %7, double* %8)
%80 = load double, double* %4
store double %80, double* %2
%81 = load double, double* %5
%82 = getelementptr inbounds double, double* %2, i64 1
store double %81, double* %82
%83 = load double, double* %6
%84 = getelementptr inbounds double, double* %2, i64 2
store double %83, double* %84
%85 = load double, double* %7
%86 = getelementptr inbounds double, double* %2, i64 3
store double %85, double* %86
ret void
}