#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 mat_Nint(double);
void mat_cast_matrix_3d_to_3i(int 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_3i>:
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    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
call   1030 <mat_Nint@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
call   1030 <mat_Nint@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
call   1030 <mat_Nint@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x10(%rbp),%rax
movsd  0x20(%rax),%xmm0
call   1030 <mat_Nint@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0x10(%rbp),%rax
movsd  0x28(%rax),%xmm0
call   1030 <mat_Nint@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x14(%rax)
mov    -0x10(%rbp),%rax
movsd  0x30(%rax),%xmm0
call   1030 <mat_Nint@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x18(%rax)
mov    -0x10(%rbp),%rax
movsd  0x38(%rax),%xmm0
call   1030 <mat_Nint@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x1c(%rax)
mov    -0x10(%rbp),%rax
movsd  0x40(%rax),%xmm0
call   1030 <mat_Nint@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x20(%rax)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @mat_cast_matrix_3d_to_3i([3 x i32]* %0, [3 x double]* %1) {
%3 = alloca [3 x i32]*
%4 = alloca [3 x double]*
store [3 x i32]* %0, [3 x i32]** %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 i32 @mat_Nint(double %8)
%10 = load [3 x i32]*, [3 x i32]** %3
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0
%12 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0, i64 0
store i32 %9, i32* %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 i32 @mat_Nint(double %16)
%18 = load [3 x i32]*, [3 x i32]** %3
%19 = getelementptr inbounds [3 x i32], [3 x i32]* %18, i64 0
%20 = getelementptr inbounds [3 x i32], [3 x i32]* %19, i64 0, i64 1
store i32 %17, i32* %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 i32 @mat_Nint(double %24)
%26 = load [3 x i32]*, [3 x i32]** %3
%27 = getelementptr inbounds [3 x i32], [3 x i32]* %26, i64 0
%28 = getelementptr inbounds [3 x i32], [3 x i32]* %27, i64 0, i64 2
store i32 %25, i32* %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 i32 @mat_Nint(double %32)
%34 = load [3 x i32]*, [3 x i32]** %3
%35 = getelementptr inbounds [3 x i32], [3 x i32]* %34, i64 1
%36 = getelementptr inbounds [3 x i32], [3 x i32]* %35, i64 0, i64 0
store i32 %33, i32* %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 i32 @mat_Nint(double %40)
%42 = load [3 x i32]*, [3 x i32]** %3
%43 = getelementptr inbounds [3 x i32], [3 x i32]* %42, i64 1
%44 = getelementptr inbounds [3 x i32], [3 x i32]* %43, i64 0, i64 1
store i32 %41, i32* %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 i32 @mat_Nint(double %48)
%50 = load [3 x i32]*, [3 x i32]** %3
%51 = getelementptr inbounds [3 x i32], [3 x i32]* %50, i64 1
%52 = getelementptr inbounds [3 x i32], [3 x i32]* %51, i64 0, i64 2
store i32 %49, i32* %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 i32 @mat_Nint(double %56)
%58 = load [3 x i32]*, [3 x i32]** %3
%59 = getelementptr inbounds [3 x i32], [3 x i32]* %58, i64 2
%60 = getelementptr inbounds [3 x i32], [3 x i32]* %59, i64 0, i64 0
store i32 %57, i32* %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 i32 @mat_Nint(double %64)
%66 = load [3 x i32]*, [3 x i32]** %3
%67 = getelementptr inbounds [3 x i32], [3 x i32]* %66, i64 2
%68 = getelementptr inbounds [3 x i32], [3 x i32]* %67, i64 0, i64 1
store i32 %65, i32* %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 i32 @mat_Nint(double %72)
%74 = load [3 x i32]*, [3 x i32]** %3
%75 = getelementptr inbounds [3 x i32], [3 x i32]* %74, i64 2
%76 = getelementptr inbounds [3 x i32], [3 x i32]* %75, i64 0, i64 2
store i32 %73, i32* %76
ret void
}

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