#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_dmxv_(double *, double *, double *);
void slaDmxv(double dm[3][3], double va[3], double vb[3]) {
  double DM[9];
  double VA[3];
  double VB[3];
  int i;
  int j;
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++)
      DM[i + 3 * j] = dm[i][j];
    VA[i] = va[i];
  }
  sla_dmxv_((double *)DM, (double *)VA, (double *)VB);
  for (i = 0; i < 3; i++)
    vb[i] = VB[i];
}


x86 assembly (clang, -O0):
<slaDmxv>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0xa4(%rbp)
cmpl   $0x3,-0xa4(%rbp)
jge    11cf <slaDmxv+0xbf>
movl   $0x0,-0xa8(%rbp)
cmpl   $0x3,-0xa8(%rbp)
jge    119e <slaDmxv+0x8e>
mov    -0x8(%rbp),%rax
movslq -0xa4(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0xa8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0xa4(%rbp),%eax
imul   $0x3,-0xa8(%rbp),%ecx
add    %ecx,%eax
cltq
movsd  %xmm0,-0x60(%rbp,%rax,8)
mov    -0xa8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa8(%rbp)
jmp    1148 <slaDmxv+0x38>
mov    -0x10(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0xa4(%rbp),%rax
movsd  %xmm0,-0x80(%rbp,%rax,8)
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    1131 <slaDmxv+0x21>
lea    -0x60(%rbp),%rdi
lea    -0x80(%rbp),%rsi
lea    -0xa0(%rbp),%rdx
call   1030 <sla_dmxv_@plt>
movl   $0x0,-0xa4(%rbp)
cmpl   $0x3,-0xa4(%rbp)
jge    122e <slaDmxv+0x11e>
movslq -0xa4(%rbp),%rax
movsd  -0xa0(%rbp,%rax,8),%xmm0
ff ff
mov    -0x18(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    11ed <slaDmxv+0xdd>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slaDmxv>:
push   %rbx
sub    $0x90,%rsp
mov    %rdx,%rbx
movups (%rsi),%xmm0
movaps %xmm0,0x70(%rsp)
mov    0x10(%rsi),%rax
mov    %rax,0x80(%rsp)
movsd  (%rdi),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rdi),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x10(%rdi),%xmm0
movsd  %xmm0,0x30(%rsp)
movsd  0x18(%rdi),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x20(%rdi),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x28(%rdi),%xmm0
movsd  %xmm0,0x38(%rsp)
movsd  0x30(%rdi),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x38(%rdi),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x40(%rdi),%xmm0
movsd  %xmm0,0x40(%rsp)
mov    %rsp,%rdi
lea    0x70(%rsp),%rsi
lea    0x50(%rsp),%rdx
call   1030 <sla_dmxv_@plt>
movaps 0x50(%rsp),%xmm0
movups %xmm0,(%rbx)
mov    0x60(%rsp),%rax
mov    %rax,0x10(%rbx)
add    $0x90,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @slaDmxv([3 x double]* %0, double* %1, double* %2) {
%4 = alloca [3 x double]*
%5 = alloca double*
%6 = alloca double*
%7 = alloca [9 x double]
%8 = alloca [3 x double]
%9 = alloca [3 x double]
%10 = alloca i32
%11 = alloca i32
store [3 x double]* %0, [3 x double]** %4
store double* %1, double** %5
store double* %2, double** %6
store i32 0, i32* %10
br label %12
12: ; preds = %46, %3
%13 = load i32, i32* %10
%14 = icmp slt i32 %13, 3
br i1 %14, label %15, label %49
15: ; preds = %12
store i32 0, i32* %11
br label %16
16: ; preds = %34, %15
%17 = load i32, i32* %11
%18 = icmp slt i32 %17, 3
br i1 %18, label %19, label %37
19: ; preds = %16
%20 = load [3 x double]*, [3 x double]** %4
%21 = load i32, i32* %10
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [3 x double], [3 x double]* %20, i64 %22
%24 = load i32, i32* %11
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [3 x double], [3 x double]* %23, i64 0, i64 %25
%27 = load double, double* %26
%28 = load i32, i32* %10
%29 = load i32, i32* %11
%30 = mul nsw i32 3, %29
%31 = add nsw i32 %28, %30
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 %32
store double %27, double* %33
br label %34
34: ; preds = %19
%35 = load i32, i32* %11
%36 = add nsw i32 %35, 1
store i32 %36, i32* %11
br label %16
37: ; preds = %16
%38 = load double*, double** %5
%39 = load i32, i32* %10
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds double, double* %38, i64 %40
%42 = load double, double* %41
%43 = load i32, i32* %10
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 %44
store double %42, double* %45
br label %46
46: ; preds = %37
%47 = load i32, i32* %10
%48 = add nsw i32 %47, 1
store i32 %48, i32* %10
br label %12
49: ; preds = %12
%50 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 0
%51 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 0
%52 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 0
%53 = call i32 @sla_dmxv_(double* %50, double* %51, double* %52)
store i32 0, i32* %10
br label %54
54: ; preds = %66, %49
%55 = load i32, i32* %10
%56 = icmp slt i32 %55, 3
br i1 %56, label %57, label %69
57: ; preds = %54
%58 = load i32, i32* %10
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 %59
%61 = load double, double* %60
%62 = load double*, double** %6
%63 = load i32, i32* %10
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds double, double* %62, i64 %64
store double %61, double* %65
br label %66
66: ; preds = %57
%67 = load i32, i32* %10
%68 = add nsw i32 %67, 1
store i32 %68, i32* %10
br label %54
69: ; preds = %54
ret void
}

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