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


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

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

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

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