#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*/ PMatUVRoot(double *, double, int, double *, double *,
                              double *);
int /*<<< orphan*/ eigenQREV(double *, double *, int, double *, double *,
                             double *, double *);
int PMatQRev(double Q[], double pi[], double t, int n, double space[]) {
  double *U = space, *V = U + n * n, *Root = V + n * n, *spacesqrtpi = Root + n;
  eigenQREV(Q, pi, n, Root, U, V, spacesqrtpi);
  PMatUVRoot(Q, t, n, U, V, Root);
  return (0);
}


x86 assembly (clang, -O0):
<PMatQRev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x1c(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    -0x1c(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
movslq -0x1c(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x40(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
mov    -0x48(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <eigenQREV@plt>
mov    -0x8(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%esi
mov    -0x30(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x40(%rbp),%r8
call   1030 <PMatUVRoot@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PMatQRev>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rcx,%r15
movsd  %xmm0,0x8(%rsp)
mov    %rdi,%r14
movslq %edx,%r12
imul   %edx,%edx
lea    (%rcx,%rdx,8),%rbx
lea    (%rbx,%rdx,8),%r13
lea    0x0(,%r12,8),%rax
add    %r13,%rax
mov    %rax,(%rsp)
mov    %r12d,%edx
mov    %r13,%rcx
mov    %r15,%r8
mov    %rbx,%r9
call   1040 <eigenQREV@plt>
mov    %r14,%rdi
movsd  0x8(%rsp),%xmm0
mov    %r12d,%esi
mov    %r15,%rdx
mov    %rbx,%rcx
mov    %r13,%r8
call   1030 <PMatUVRoot@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @PMatQRev(double* %0, double* %1, double %2, i32 %3, double* %4) {
%6 = mul nsw i32 %3, %3
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds double, double* %4, i64 %7
%9 = getelementptr inbounds double, double* %8, i64 %7
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds double, double* %9, i64 %10
%12 = tail call i32 @eigenQREV(double* %0, double* %1, i32 %3, double* %9, double* %4, double* %8, double* %11)
%13 = tail call i32 @PMatUVRoot(double* %0, double %2, i32 %3, double* %4, double* %8, double* %9)
ret i32 0
}