#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 */
int /*<<< orphan*/ mid2(double *, double *, double const *);
int /*<<< orphan*/ mid4(double *, double const *, double const *,
                        double const *, double const *);
void quincunx(double *q, const double *v) {
  mid4(q + 12, v + 0, v + 3, v + 6, v + 9);
  mid2(q + 9, q + 12, v + 9);
  mid2(q + 6, q + 12, v + 6);
  mid2(q + 3, q + 12, v + 3);
  mid2(q + 0, q + 12, v + 0);
}


x86 assembly (clang, -O0):
<quincunx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x60,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
add    $0x18,%rdx
mov    -0x10(%rbp),%rcx
add    $0x30,%rcx
mov    -0x10(%rbp),%r8
add    $0x48,%r8
call   1030 <mid4@plt>
mov    -0x8(%rbp),%rdi
add    $0x48,%rdi
mov    -0x8(%rbp),%rsi
add    $0x60,%rsi
mov    -0x10(%rbp),%rdx
add    $0x48,%rdx
call   1040 <mid2@plt>
mov    -0x8(%rbp),%rdi
add    $0x30,%rdi
mov    -0x8(%rbp),%rsi
add    $0x60,%rsi
mov    -0x10(%rbp),%rdx
add    $0x30,%rdx
call   1040 <mid2@plt>
mov    -0x8(%rbp),%rdi
add    $0x18,%rdi
mov    -0x8(%rbp),%rsi
add    $0x60,%rsi
mov    -0x10(%rbp),%rdx
add    $0x18,%rdx
call   1040 <mid2@plt>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x60,%rsi
mov    -0x10(%rbp),%rdx
call   1040 <mid2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quincunx>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x60(%rdi),%r15
lea    0x18(%rsi),%r12
lea    0x30(%rsi),%r13
lea    0x48(%rsi),%rbp
mov    %r15,%rdi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbp,%r8
call   1030 <mid4@plt>
lea    0x48(%rbx),%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
call   1040 <mid2@plt>
lea    0x30(%rbx),%rdi
mov    %r15,%rsi
mov    %r13,%rdx
call   1040 <mid2@plt>
lea    0x18(%rbx),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1040 <mid2@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <mid2@plt>

LLVM IR (-O0):
define void @quincunx(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 12
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double*, double** %4
%10 = getelementptr inbounds double, double* %9, i64 3
%11 = load double*, double** %4
%12 = getelementptr inbounds double, double* %11, i64 6
%13 = load double*, double** %4
%14 = getelementptr inbounds double, double* %13, i64 9
%15 = call i32 @mid4(double* %6, double* %8, double* %10, double* %12, double* %14)
%16 = load double*, double** %3
%17 = getelementptr inbounds double, double* %16, i64 9
%18 = load double*, double** %3
%19 = getelementptr inbounds double, double* %18, i64 12
%20 = load double*, double** %4
%21 = getelementptr inbounds double, double* %20, i64 9
%22 = call i32 @mid2(double* %17, double* %19, double* %21)
%23 = load double*, double** %3
%24 = getelementptr inbounds double, double* %23, i64 6
%25 = load double*, double** %3
%26 = getelementptr inbounds double, double* %25, i64 12
%27 = load double*, double** %4
%28 = getelementptr inbounds double, double* %27, i64 6
%29 = call i32 @mid2(double* %24, double* %26, double* %28)
%30 = load double*, double** %3
%31 = getelementptr inbounds double, double* %30, i64 3
%32 = load double*, double** %3
%33 = getelementptr inbounds double, double* %32, i64 12
%34 = load double*, double** %4
%35 = getelementptr inbounds double, double* %34, i64 3
%36 = call i32 @mid2(double* %31, double* %33, double* %35)
%37 = load double*, double** %3
%38 = getelementptr inbounds double, double* %37, i64 0
%39 = load double*, double** %3
%40 = getelementptr inbounds double, double* %39, i64 12
%41 = load double*, double** %4
%42 = getelementptr inbounds double, double* %41, i64 0
%43 = call i32 @mid2(double* %38, double* %40, double* %42)
ret void
}

LLVM IR (-O2):
define void @quincunx(double* %0, double* %1) {
%3 = getelementptr inbounds double, double* %0, i64 12
%4 = getelementptr inbounds double, double* %1, i64 3
%5 = getelementptr inbounds double, double* %1, i64 6
%6 = getelementptr inbounds double, double* %1, i64 9
%7 = tail call i32 @mid4(double* %3, double* %1, double* %4, double* %5, double* %6)
%8 = getelementptr inbounds double, double* %0, i64 9
%9 = tail call i32 @mid2(double* %8, double* %3, double* %6)
%10 = getelementptr inbounds double, double* %0, i64 6
%11 = tail call i32 @mid2(double* %10, double* %3, double* %5)
%12 = getelementptr inbounds double, double* %0, i64 3
%13 = tail call i32 @mid2(double* %12, double* %3, double* %4)
%14 = tail call i32 @mid2(double* %0, double* %3, double* %1)
ret void
}