#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*/ sla_prebn_(double *, double *, double *);
void slaPrebn(double bep0, double bep1, double rmatp[3][3]) {
  double BEP0;
  double BEP1;
  double RMATP[9];
  int i;
  int j;
  BEP0 = bep0;
  BEP1 = bep1;
  sla_prebn_(&BEP0, &BEP1, (double *)RMATP);
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++)
      rmatp[i][j] = RMATP[i + 3 * j];
  }
}


x86 assembly (clang, -O0):
<slaPrebn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
lea    -0x70(%rbp),%rdx
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <sla_prebn_@plt>
movl   $0x0,-0x74(%rbp)
cmpl   $0x3,-0x74(%rbp)
jge    11ba <slaPrebn+0xaa>
movl   $0x0,-0x78(%rbp)
cmpl   $0x3,-0x78(%rbp)
jge    11a7 <slaPrebn+0x97>
mov    -0x74(%rbp),%eax
imul   $0x3,-0x78(%rbp),%ecx
add    %ecx,%eax
cltq
movsd  -0x70(%rbp,%rax,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x74(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x78(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    1166 <slaPrebn+0x56>
jmp    11ac <slaPrebn+0x9c>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1155 <slaPrebn+0x45>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slaPrebn>:
push   %rbx
sub    $0x60,%rsp
mov    %rdi,%rbx
movsd  %xmm0,0x8(%rsp)
movsd  %xmm1,(%rsp)
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
lea    0x10(%rsp),%rdx
call   1030 <sla_prebn_@plt>
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x8(%rbx)
movsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x10(%rbx)
movsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x18(%rbx)
movsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x20(%rbx)
movsd  0x48(%rsp),%xmm0
movsd  %xmm0,0x28(%rbx)
movsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x30(%rbx)
movsd  0x38(%rsp),%xmm0
movsd  %xmm0,0x38(%rbx)
movsd  0x50(%rsp),%xmm0
movsd  %xmm0,0x40(%rbx)
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @slaPrebn(double %0, double %1, [3 x double]* %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca [3 x double]*
%7 = alloca double
%8 = alloca double
%9 = alloca [9 x double]
%10 = alloca i32
%11 = alloca i32
store double %0, double* %4
store double %1, double* %5
store [3 x double]* %2, [3 x double]** %6
%12 = load double, double* %4
store double %12, double* %7
%13 = load double, double* %5
store double %13, double* %8
%14 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 0
%15 = call i32 @sla_prebn_(double* %7, double* %8, double* %14)
store i32 0, i32* %10
br label %16
16: ; preds = %42, %3
%17 = load i32, i32* %10
%18 = icmp slt i32 %17, 3
br i1 %18, label %19, label %45
19: ; preds = %16
store i32 0, i32* %11
br label %20
20: ; preds = %38, %19
%21 = load i32, i32* %11
%22 = icmp slt i32 %21, 3
br i1 %22, label %23, label %41
23: ; preds = %20
%24 = load i32, i32* %10
%25 = load i32, i32* %11
%26 = mul nsw i32 3, %25
%27 = add nsw i32 %24, %26
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 %28
%30 = load double, double* %29
%31 = load [3 x double]*, [3 x double]** %6
%32 = load i32, i32* %10
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [3 x double], [3 x double]* %31, i64 %33
%35 = load i32, i32* %11
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [3 x double], [3 x double]* %34, i64 0, i64 %36
store double %30, double* %37
br label %38
38: ; preds = %23
%39 = load i32, i32* %11
%40 = add nsw i32 %39, 1
store i32 %40, i32* %11
br label %20
41: ; preds = %20
br label %42
42: ; preds = %41
%43 = load i32, i32* %10
%44 = add nsw i32 %43, 1
store i32 %44, i32* %10
br label %16
45: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @slaPrebn(double %0, double %1, [3 x double]* nocapture writeonly %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca [9 x double]
%7 = bitcast double* %4 to i8*
%8 = bitcast double* %5 to i8*
%9 = bitcast [9 x double]* %6 to i8*
store double %0, double* %4
store double %1, double* %5
%10 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 0
%11 = call i32 @sla_prebn_(double* %4, double* %5, double* %10)
%12 = load double, double* %10
%13 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
store double %12, double* %13
%14 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 3
%15 = load double, double* %14
%16 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 1
store double %15, double* %16
%17 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 6
%18 = load double, double* %17
%19 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 2
store double %18, double* %19
%20 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 1
%21 = load double, double* %20
%22 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 1, i64 0
store double %21, double* %22
%23 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 4
%24 = load double, double* %23
%25 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 1, i64 1
store double %24, double* %25
%26 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 7
%27 = load double, double* %26
%28 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 1, i64 2
store double %27, double* %28
%29 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 2
%30 = load double, double* %29
%31 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 2, i64 0
store double %30, double* %31
%32 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 5
%33 = load double, double* %32
%34 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 2, i64 1
store double %33, double* %34
%35 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 8
%36 = load double, double* %35
%37 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 2, i64 2
store double %36, double* %37
ret void
}