#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_ecmat_(double *, double *);
void slaEcmat(double date, double rmat[3][3]) {
  double DATE;
  double RMAT[9];
  int i;
  int j;
  DATE = date;
  sla_ecmat_(&DATE, (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):
<slaEcmat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    -0x60(%rbp),%rsi
lea    -0x18(%rbp),%rdi
call   1030 <sla_ecmat_@plt>
movl   $0x0,-0x64(%rbp)
cmpl   $0x3,-0x64(%rbp)
jge    11a4 <slaEcmat+0x94>
movl   $0x0,-0x68(%rbp)
cmpl   $0x3,-0x68(%rbp)
jge    1191 <slaEcmat+0x81>
mov    -0x64(%rbp),%eax
imul   $0x3,-0x68(%rbp),%ecx
add    %ecx,%eax
cltq
movsd  -0x60(%rbp,%rax,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x68(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    1150 <slaEcmat+0x40>
jmp    1196 <slaEcmat+0x86>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    113f <slaEcmat+0x2f>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slaEcmat>:
push   %rbx
sub    $0x60,%rsp
mov    %rdi,%rbx
movsd  %xmm0,0x8(%rsp)
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <sla_ecmat_@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 @slaEcmat(double %0, [3 x double]* %1) {
%3 = alloca double
%4 = alloca [3 x double]*
%5 = alloca 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
%9 = load double, double* %3
store double %9, double* %5
%10 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 0
%11 = call i32 @sla_ecmat_(double* %5, double* %10)
store i32 0, i32* %7
br label %12
12: ; preds = %38, %2
%13 = load i32, i32* %7
%14 = icmp slt i32 %13, 3
br i1 %14, label %15, label %41
15: ; preds = %12
store i32 0, i32* %8
br label %16
16: ; preds = %34, %15
%17 = load i32, i32* %8
%18 = icmp slt i32 %17, 3
br i1 %18, label %19, label %37
19: ; preds = %16
%20 = load i32, i32* %7
%21 = load i32, i32* %8
%22 = mul nsw i32 3, %21
%23 = add nsw i32 %20, %22
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 %24
%26 = load double, double* %25
%27 = load [3 x double]*, [3 x double]** %4
%28 = load i32, i32* %7
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [3 x double], [3 x double]* %27, i64 %29
%31 = load i32, i32* %8
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [3 x double], [3 x double]* %30, i64 0, i64 %32
store double %26, double* %33
br label %34
34: ; preds = %19
%35 = load i32, i32* %8
%36 = add nsw i32 %35, 1
store i32 %36, i32* %8
br label %16
37: ; preds = %16
br label %38
38: ; preds = %37
%39 = load i32, i32* %7
%40 = add nsw i32 %39, 1
store i32 %40, i32* %7
br label %12
41: ; preds = %12
ret void
}

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