#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_dmxm_(double *, double *, double *);
void slaDmxm(double a[3][3], double b[3][3], double c[3][3]) {
  double A[9];
  double B[9];
  double C[9];
  int i;
  int j;
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      A[i + 3 * j] = a[i][j];
      B[i + 3 * j] = b[i][j];
    }
  }
  sla_dmxm_((double *)A, (double *)B, (double *)C);
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++)
      c[i][j] = C[i + 3 * j];
  }
}


x86 assembly (clang, -O0):
<slaDmxm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x104(%rbp)
cmpl   $0x3,-0x104(%rbp)
jge    11ef <slaDmxm+0xdf>
movl   $0x0,-0x108(%rbp)
cmpl   $0x3,-0x108(%rbp)
jge    11d6 <slaDmxm+0xc6>
mov    -0x8(%rbp),%rax
movslq -0x104(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x108(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x104(%rbp),%eax
imul   $0x3,-0x108(%rbp),%ecx
add    %ecx,%eax
cltq
movsd  %xmm0,-0x60(%rbp,%rax,8)
mov    -0x10(%rbp),%rax
movslq -0x104(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x108(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x104(%rbp),%eax
imul   $0x3,-0x108(%rbp),%ecx
add    %ecx,%eax
cltq
movsd  %xmm0,-0xb0(%rbp,%rax,8)
ff ff
mov    -0x108(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x108(%rbp)
jmp    1148 <slaDmxm+0x38>
jmp    11db <slaDmxm+0xcb>
mov    -0x104(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x104(%rbp)
jmp    1131 <slaDmxm+0x21>
lea    -0x60(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
lea    -0x100(%rbp),%rdx
call   1030 <sla_dmxm_@plt>
movl   $0x0,-0x104(%rbp)
cmpl   $0x3,-0x104(%rbp)
jge    1299 <slaDmxm+0x189>
movl   $0x0,-0x108(%rbp)
cmpl   $0x3,-0x108(%rbp)
jge    1280 <slaDmxm+0x170>
mov    -0x104(%rbp),%eax
imul   $0x3,-0x108(%rbp),%ecx
add    %ecx,%eax
cltq
movsd  -0x100(%rbp,%rax,8),%xmm0
ff ff
mov    -0x18(%rbp),%rax
movslq -0x104(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x108(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x108(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x108(%rbp)
jmp    1227 <slaDmxm+0x117>
jmp    1285 <slaDmxm+0x175>
mov    -0x104(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x104(%rbp)
jmp    1210 <slaDmxm+0x100>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slaDmxm>:
push   %rbx
sub    $0xf0,%rsp
mov    %rdx,%rbx
movsd  (%rdi),%xmm0
movsd  %xmm0,0xa0(%rsp)
movsd  (%rsi),%xmm0
movsd  %xmm0,0x50(%rsp)
movsd  0x8(%rdi),%xmm0
movsd  %xmm0,0xb8(%rsp)
movsd  0x8(%rsi),%xmm0
movsd  %xmm0,0x68(%rsp)
movsd  0x10(%rdi),%xmm0
movsd  %xmm0,0xd0(%rsp)
movsd  0x10(%rsi),%xmm0
movsd  %xmm0,0x80(%rsp)
movsd  0x18(%rdi),%xmm0
movsd  %xmm0,0xa8(%rsp)
movsd  0x18(%rsi),%xmm0
movsd  %xmm0,0x58(%rsp)
movsd  0x20(%rdi),%xmm0
movsd  %xmm0,0xc0(%rsp)
movsd  0x20(%rsi),%xmm0
movsd  %xmm0,0x70(%rsp)
movsd  0x28(%rdi),%xmm0
movsd  %xmm0,0xd8(%rsp)
movsd  0x28(%rsi),%xmm0
movsd  %xmm0,0x88(%rsp)
movsd  0x30(%rdi),%xmm0
movsd  %xmm0,0xb0(%rsp)
movsd  0x30(%rsi),%xmm0
movsd  %xmm0,0x60(%rsp)
movsd  0x38(%rdi),%xmm0
movsd  %xmm0,0xc8(%rsp)
movsd  0x38(%rsi),%xmm0
movsd  %xmm0,0x78(%rsp)
movsd  0x40(%rdi),%xmm0
movsd  %xmm0,0xe0(%rsp)
movsd  0x40(%rsi),%xmm0
movsd  %xmm0,0x90(%rsp)
lea    0xa0(%rsp),%rdi
lea    0x50(%rsp),%rsi
mov    %rsp,%rdx
call   1030 <sla_dmxm_@plt>
movsd  (%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x8(%rbx)
movsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x10(%rbx)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x18(%rbx)
movsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x20(%rbx)
movsd  0x38(%rsp),%xmm0
movsd  %xmm0,0x28(%rbx)
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x30(%rbx)
movsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x38(%rbx)
movsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x40(%rbx)
add    $0xf0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @slaDmxm([3 x double]* %0, [3 x double]* %1, [3 x double]* %2) {
%4 = alloca [3 x double]*
%5 = alloca [3 x double]*
%6 = alloca [3 x double]*
%7 = alloca [9 x double]
%8 = alloca [9 x double]
%9 = alloca [9 x double]
%10 = alloca i32
%11 = alloca i32
store [3 x double]* %0, [3 x double]** %4
store [3 x double]* %1, [3 x double]** %5
store [3 x double]* %2, [3 x double]** %6
store i32 0, i32* %10
br label %12
12: ; preds = %52, %3
%13 = load i32, i32* %10
%14 = icmp slt i32 %13, 3
br i1 %14, label %15, label %55
15: ; preds = %12
store i32 0, i32* %11
br label %16
16: ; preds = %48, %15
%17 = load i32, i32* %11
%18 = icmp slt i32 %17, 3
br i1 %18, label %19, label %51
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
%34 = load [3 x double]*, [3 x double]** %5
%35 = load i32, i32* %10
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [3 x double], [3 x double]* %34, i64 %36
%38 = load i32, i32* %11
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [3 x double], [3 x double]* %37, i64 0, i64 %39
%41 = load double, double* %40
%42 = load i32, i32* %10
%43 = load i32, i32* %11
%44 = mul nsw i32 3, %43
%45 = add nsw i32 %42, %44
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [9 x double], [9 x double]* %8, i64 0, i64 %46
store double %41, double* %47
br label %48
48: ; preds = %19
%49 = load i32, i32* %11
%50 = add nsw i32 %49, 1
store i32 %50, i32* %11
br label %16
51: ; preds = %16
br label %52
52: ; preds = %51
%53 = load i32, i32* %10
%54 = add nsw i32 %53, 1
store i32 %54, i32* %10
br label %12
55: ; preds = %12
%56 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 0
%57 = getelementptr inbounds [9 x double], [9 x double]* %8, i64 0, i64 0
%58 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 0
%59 = call i32 @sla_dmxm_(double* %56, double* %57, double* %58)
store i32 0, i32* %10
br label %60
60: ; preds = %86, %55
%61 = load i32, i32* %10
%62 = icmp slt i32 %61, 3
br i1 %62, label %63, label %89
63: ; preds = %60
store i32 0, i32* %11
br label %64
64: ; preds = %82, %63
%65 = load i32, i32* %11
%66 = icmp slt i32 %65, 3
br i1 %66, label %67, label %85
67: ; preds = %64
%68 = load i32, i32* %10
%69 = load i32, i32* %11
%70 = mul nsw i32 3, %69
%71 = add nsw i32 %68, %70
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 %72
%74 = load double, double* %73
%75 = load [3 x double]*, [3 x double]** %6
%76 = load i32, i32* %10
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [3 x double], [3 x double]* %75, i64 %77
%79 = load i32, i32* %11
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [3 x double], [3 x double]* %78, i64 0, i64 %80
store double %74, double* %81
br label %82
82: ; preds = %67
%83 = load i32, i32* %11
%84 = add nsw i32 %83, 1
store i32 %84, i32* %11
br label %64
85: ; preds = %64
br label %86
86: ; preds = %85
%87 = load i32, i32* %10
%88 = add nsw i32 %87, 1
store i32 %88, i32* %10
br label %60
89: ; preds = %60
ret void
}

LLVM IR (-O2):
define void @slaDmxm([3 x double]* nocapture %0, [3 x double]* nocapture %1, [3 x double]* nocapture writeonly %2) {
%4 = alloca [9 x double]
%5 = alloca [9 x double]
%6 = alloca [9 x double]
%7 = bitcast [9 x double]* %4 to i8*
%8 = bitcast [9 x double]* %5 to i8*
%9 = bitcast [9 x double]* %6 to i8*
%10 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 0
%11 = load double, double* %10
%12 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 0
store double %11, double* %12
%13 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 0
%14 = load double, double* %13
%15 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 0
store double %14, double* %15
%16 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 1
%17 = load double, double* %16
%18 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 3
store double %17, double* %18
%19 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 1
%20 = load double, double* %19
%21 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 3
store double %20, double* %21
%22 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 2
%23 = load double, double* %22
%24 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 6
store double %23, double* %24
%25 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 2
%26 = load double, double* %25
%27 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 6
store double %26, double* %27
%28 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 0
%29 = load double, double* %28
%30 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 1
store double %29, double* %30
%31 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 1, i64 0
%32 = load double, double* %31
%33 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 1
store double %32, double* %33
%34 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 1
%35 = load double, double* %34
%36 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 4
store double %35, double* %36
%37 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 1, i64 1
%38 = load double, double* %37
%39 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 4
store double %38, double* %39
%40 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 2
%41 = load double, double* %40
%42 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 7
store double %41, double* %42
%43 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 1, i64 2
%44 = load double, double* %43
%45 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 7
store double %44, double* %45
%46 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 0
%47 = load double, double* %46
%48 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 2
store double %47, double* %48
%49 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 2, i64 0
%50 = load double, double* %49
%51 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 2
store double %50, double* %51
%52 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 1
%53 = load double, double* %52
%54 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 5
store double %53, double* %54
%55 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 2, i64 1
%56 = load double, double* %55
%57 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 5
store double %56, double* %57
%58 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 2
%59 = load double, double* %58
%60 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 8
store double %59, double* %60
%61 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 2, i64 2
%62 = load double, double* %61
%63 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 8
store double %62, double* %63
%64 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 0
%65 = call i32 @sla_dmxm_(double* %12, double* %15, double* %64)
%66 = load double, double* %64
%67 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
store double %66, double* %67
%68 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 3
%69 = load double, double* %68
%70 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 1
store double %69, double* %70
%71 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 6
%72 = load double, double* %71
%73 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 2
store double %72, double* %73
%74 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 1
%75 = load double, double* %74
%76 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 1, i64 0
store double %75, double* %76
%77 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 4
%78 = load double, double* %77
%79 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 1, i64 1
store double %78, double* %79
%80 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 7
%81 = load double, double* %80
%82 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 1, i64 2
store double %81, double* %82
%83 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 2
%84 = load double, double* %83
%85 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 2, i64 0
store double %84, double* %85
%86 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 5
%87 = load double, double* %86
%88 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 2, i64 1
store double %87, double* %88
%89 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 8
%90 = load double, double* %89
%91 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 2, i64 2
store double %90, double* %91
ret void
}