#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, double, double);
void mat33Print(double m[3][3]) {
  for (int i = 0; i < 3; i++) {
    printf("%f %f %f\n", m[i][0], m[i][1], m[i][2]);
  }
}


x86 assembly (clang, -O0):
<mat33Print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1182 <mat33Print+0x72>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  0x10(%rax),%xmm2
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <mat33Print+0x13>
add    $0x10,%rsp
pop    %rbp
ret

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

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

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