#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*/ printf(char *, double const, double const, double const);
void glmPrintMatrix3d(const double m[9]) {
  printf("[ %f %f %f ]\n", m[0], m[3], m[6]);
  printf("[ %f %f %f ]\n", m[1], m[4], m[7]);
  printf("[ %f %f %f ]\n\n", m[2], m[5], m[8]);
}


x86 assembly (clang, -O0):
<glmPrintMatrix3d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm2
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm2
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x40(%rax),%xmm2
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmPrintMatrix3d>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
movsd  0x18(%rdi),%xmm1
movsd  0x30(%rdi),%xmm2
lea    0xed4(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
movsd  0x8(%rbx),%xmm0
movsd  0x20(%rbx),%xmm1
movsd  0x38(%rbx),%xmm2
mov    %r14,%rdi
call   1030 <printf@plt>
movsd  0x10(%rbx),%xmm0
movsd  0x28(%rbx),%xmm1
movsd  0x40(%rbx),%xmm2
lea    0xead(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"[ %f %f %f ]\0A\00"
@.str.1 = [15 x i8] c"[ %f %f %f ]\0A\0A\00"
define void @glmPrintMatrix3d(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 3
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 6
%11 = load double, double* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %5, double %8, double %11)
%13 = load double*, double** %2
%14 = getelementptr inbounds double, double* %13, i64 1
%15 = load double, double* %14
%16 = load double*, double** %2
%17 = getelementptr inbounds double, double* %16, i64 4
%18 = load double, double* %17
%19 = load double*, double** %2
%20 = getelementptr inbounds double, double* %19, i64 7
%21 = load double, double* %20
%22 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %15, double %18, double %21)
%23 = load double*, double** %2
%24 = getelementptr inbounds double, double* %23, i64 2
%25 = load double, double* %24
%26 = load double*, double** %2
%27 = getelementptr inbounds double, double* %26, i64 5
%28 = load double, double* %27
%29 = load double*, double** %2
%30 = getelementptr inbounds double, double* %29, i64 8
%31 = load double, double* %30
%32 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %25, double %28, double %31)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"[ %f %f %f ]\0A\00"
@.str.1 = [15 x i8] c"[ %f %f %f ]\0A\0A\00"
define void @glmPrintMatrix3d(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 3
%4 = load double, double* %3
%5 = getelementptr inbounds double, double* %0, i64 6
%6 = load double, double* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %2, double %4, double %6)
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = load double, double* %8
%10 = getelementptr inbounds double, double* %0, i64 4
%11 = load double, double* %10
%12 = getelementptr inbounds double, double* %0, i64 7
%13 = load double, double* %12
%14 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %9, double %11, double %13)
%15 = getelementptr inbounds double, double* %0, i64 2
%16 = load double, double* %15
%17 = getelementptr inbounds double, double* %0, i64 5
%18 = load double, double* %17
%19 = getelementptr inbounds double, double* %0, i64 8
%20 = load double, double* %19
%21 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %16, double %18, double %20)
ret void
}