#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 */
long mat_Nint(double);
void mat_cast_matrix_3d_to_3l(long m[3][3], double a[3][3]) {
  m[0][0] = mat_Nint(a[0][0]);
  m[0][1] = mat_Nint(a[0][1]);
  m[0][2] = mat_Nint(a[0][2]);
  m[1][0] = mat_Nint(a[1][0]);
  m[1][1] = mat_Nint(a[1][1]);
  m[1][2] = mat_Nint(a[1][2]);
  m[2][0] = mat_Nint(a[2][0]);
  m[2][1] = mat_Nint(a[2][1]);
  m[2][2] = mat_Nint(a[2][2]);
}


x86 assembly (clang, -O0):
<mat_cast_matrix_3d_to_3l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <mat_Nint@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
call   1030 <mat_Nint@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
call   1030 <mat_Nint@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
call   1030 <mat_Nint@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x18(%rax)
mov    -0x10(%rbp),%rax
movsd  0x20(%rax),%xmm0
call   1030 <mat_Nint@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x20(%rax)
mov    -0x10(%rbp),%rax
movsd  0x28(%rax),%xmm0
call   1030 <mat_Nint@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x28(%rax)
mov    -0x10(%rbp),%rax
movsd  0x30(%rax),%xmm0
call   1030 <mat_Nint@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x30(%rax)
mov    -0x10(%rbp),%rax
movsd  0x38(%rax),%xmm0
call   1030 <mat_Nint@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x38(%rax)
mov    -0x10(%rbp),%rax
movsd  0x40(%rax),%xmm0
call   1030 <mat_Nint@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x40(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat_cast_matrix_3d_to_3l>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movsd  (%rsi),%xmm0
call   1030 <mat_Nint@plt>
mov    %rax,(%r14)
movsd  0x8(%rbx),%xmm0
call   1030 <mat_Nint@plt>
mov    %rax,0x8(%r14)
movsd  0x10(%rbx),%xmm0
call   1030 <mat_Nint@plt>
mov    %rax,0x10(%r14)
movsd  0x18(%rbx),%xmm0
call   1030 <mat_Nint@plt>
mov    %rax,0x18(%r14)
movsd  0x20(%rbx),%xmm0
call   1030 <mat_Nint@plt>
mov    %rax,0x20(%r14)
movsd  0x28(%rbx),%xmm0
call   1030 <mat_Nint@plt>
mov    %rax,0x28(%r14)
movsd  0x30(%rbx),%xmm0
call   1030 <mat_Nint@plt>
mov    %rax,0x30(%r14)
movsd  0x38(%rbx),%xmm0
call   1030 <mat_Nint@plt>
mov    %rax,0x38(%r14)
movsd  0x40(%rbx),%xmm0
call   1030 <mat_Nint@plt>
mov    %rax,0x40(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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