#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*/ dgemm_(char *, char *, int *, int *, int *, double *,
                          double *, int *, double *, int *, double *, double *,
                          int *);
void premultiplyXL(int n, int wXL, double *Z, double *XL, double *ZtXL) {
  int ldZ, ldXL, ldZtXL;
  double ZERO = 0.0, ONE = 1.0;
  ldZ = ldXL = ldZtXL = n;
  dgemm_("T", "N", &n, &wXL, &n, &ONE, Z, &ldZ, XL, &ldXL, &ZERO, ZtXL,
         &ldZtXL);
}


x86 assembly (clang, -O0):
<premultiplyXL>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x80,%rsp
mov    %edi,-0x24(%rbp)
mov    %esi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x38(%rbp)
mov    %r8,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xebc(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    %eax,-0x48(%rbp)
mov    %eax,-0x44(%rbp)
mov    -0x30(%rbp),%r12
mov    -0x38(%rbp),%r14
mov    -0x40(%rbp),%r10
lea    0xea0(%rip),%rdi
lea    0xe9b(%rip),%rsi
lea    -0x24(%rbp),%r8
lea    -0x28(%rbp),%rcx
lea    -0x60(%rbp),%r9
lea    -0x44(%rbp),%r15
lea    -0x48(%rbp),%rbx
lea    -0x58(%rbp),%r11
lea    -0x4c(%rbp),%rax
mov    %r8,%rdx
mov    %r12,(%rsp)
mov    %r15,0x8(%rsp)
mov    %r14,0x10(%rsp)
mov    %rbx,0x18(%rsp)
mov    %r11,0x20(%rsp)
mov    %r10,0x28(%rsp)
mov    %rax,0x30(%rsp)
call   1030 <dgemm_@plt>
add    $0x80,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<premultiplyXL>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r8,%rax
mov    %rcx,%r11
mov    %rdx,%r10
mov    %edi,0x14(%rsp)
mov    %esi,0x10(%rsp)
movq   $0x0,0x20(%rsp)
movabs $0x3ff0000000000000,%rcx
mov    %rcx,0x18(%rsp)
mov    %edi,0x4(%rsp)
mov    %edi,0x8(%rsp)
mov    %edi,0xc(%rsp)
sub    $0x8,%rsp
lea    0xc(%rsp),%rbx
lea    0x28(%rsp),%r14
lea    0x10(%rsp),%r15
lea    0x14(%rsp),%r12
lea    0xe91(%rip),%rdi
lea    0xe8c(%rip),%rsi
lea    0x18(%rsp),%rcx
lea    0x1c(%rsp),%rdx
lea    0x20(%rsp),%r9
mov    %rdx,%r8
push   %rbx
push   %rax
push   %r14
push   %r15
push   %r11
push   %r12
push   %r10
call   1030 <dgemm_@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"T\00"
@.str.1 = [2 x i8] c"N\00"
define void @premultiplyXL(i32 %0, i32 %1, double* %2, double* %3, double* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca double
%15 = alloca double
store i32 %0, i32* %6
store i32 %1, i32* %7
store double* %2, double** %8
store double* %3, double** %9
store double* %4, double** %10
store double 0.000000e+00, double* %14
store double 1.000000e+00, double* %15
%16 = load i32, i32* %6
store i32 %16, i32* %13
store i32 %16, i32* %12
store i32 %16, i32* %11
%17 = load double*, double** %8
%18 = load double*, double** %9
%19 = load double*, double** %10
%20 = call i32 @dgemm_(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* %6, i32* %7, i32* %6, double* %15, double* %17, i32* %11, double* %18, i32* %12, double* %14, double* %19, i32* %13)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"T\00"
@.str.1 = [2 x i8] c"N\00"
define void @premultiplyXL(i32 %0, i32 %1, double* %2, double* %3, double* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca double
store i32 %0, i32* %6
store i32 %1, i32* %7
%13 = bitcast i32* %8 to i8*
%14 = bitcast i32* %9 to i8*
%15 = bitcast i32* %10 to i8*
%16 = bitcast double* %11 to i8*
store double 0.000000e+00, double* %11
%17 = bitcast double* %12 to i8*
store double 1.000000e+00, double* %12
store i32 %0, i32* %10
store i32 %0, i32* %9
store i32 %0, i32* %8
%18 = call i32 @dgemm_(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* %6, i32* %7, i32* %6, double* %12, double* %2, i32* %8, double* %3, i32* %9, double* %11, double* %4, i32* %10)
ret void
}