#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_dav2m_(double *, double *);
void slaDav2m(double axvec[3], double rmat[3][3]) {
  double AXVEC[3];
  double RMAT[9];
  int i;
  int j;
  for (i = 0; i < 3; i++)
    AXVEC[i] = axvec[i];
  sla_dav2m_((double *)AXVEC, (double *)RMAT);
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++)
      rmat[i][j] = RMAT[i + 3 * j];
  }
}


x86 assembly (clang, -O0):
<slaDav2m>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x84(%rbp)
cmpl   $0x3,-0x84(%rbp)
jge    116b <slaDav2m+0x5b>
mov    -0x8(%rbp),%rax
movslq -0x84(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0x84(%rbp),%rax
movsd  %xmm0,-0x30(%rbp,%rax,8)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    112d <slaDav2m+0x1d>
lea    -0x30(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1030 <sla_dav2m_@plt>
movl   $0x0,-0x84(%rbp)
cmpl   $0x3,-0x84(%rbp)
jge    1208 <slaDav2m+0xf8>
movl   $0x0,-0x88(%rbp)
cmpl   $0x3,-0x88(%rbp)
jge    11ef <slaDav2m+0xdf>
mov    -0x84(%rbp),%eax
imul   $0x3,-0x88(%rbp),%ecx
add    %ecx,%eax
cltq
movsd  -0x80(%rbp,%rax,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x84(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x88(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    1199 <slaDav2m+0x89>
jmp    11f4 <slaDav2m+0xe4>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    1182 <slaDav2m+0x72>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slaDav2m>:
push   %rbx
sub    $0x70,%rsp
mov    %rsi,%rbx
movups (%rdi),%xmm0
movaps %xmm0,0x50(%rsp)
mov    0x10(%rdi),%rax
mov    %rax,0x60(%rsp)
lea    0x50(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <sla_dav2m_@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    $0x70,%rsp
pop    %rbx
ret

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

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