#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 *, ...);
void MatrixPrint(float mat[3][3]) {
  int i;
  printf("_______________________________\n");
  for (i = 0; i < 3; i++) {
    printf("| %.4f | %.4f | %.4f |\n", (double)mat[i][0], (double)mat[i][1],
           (double)mat[i][2]);
    printf("-------------------------------\n");
  }
}


x86 assembly (clang, -O0):
<MatrixPrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    11ac <MatrixPrint+0x9c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movss  0x4(%rax),%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movss  0x8(%rax),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xe98(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1131 <MatrixPrint+0x21>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MatrixPrint>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
movss  (%rbx),%xmm0
movss  0x4(%rbx),%xmm1
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
movss  0x8(%rbx),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xeab(%rip),%r14
mov    %r14,%rdi
mov    $0x3,%al
call   1040 <printf@plt>
lea    0xed2(%rip),%r15
mov    %r15,%rdi
call   1030 <puts@plt>
movss  0xc(%rbx),%xmm0
movss  0x10(%rbx),%xmm1
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
movss  0x14(%rbx),%xmm2
cvtss2sd %xmm2,%xmm2
mov    %r14,%rdi
mov    $0x3,%al
call   1040 <printf@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
movss  0x18(%rbx),%xmm0
movss  0x1c(%rbx),%xmm1
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
movss  0x20(%rbx),%xmm2
cvtss2sd %xmm2,%xmm2
mov    %r14,%rdi
mov    $0x3,%al
call   1040 <printf@plt>
mov    %r15,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@.str.1 = [24 x i8] c"| %.4f | %.4f | %.4f |\0A\00"
@str = [32 x i8] c"_______________________________\00"
@str.3 = [32 x i8] c"-------------------------------\00"
define void @MatrixPrint([3 x float]* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%3 = getelementptr inbounds [3 x float], [3 x float]* %0, i64 0, i64 0
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = getelementptr inbounds [3 x float], [3 x float]* %0, i64 0, i64 1
%7 = load float, float* %6
%8 = fpext float %7 to double
%9 = getelementptr inbounds [3 x float], [3 x float]* %0, i64 0, i64 2
%10 = load float, float* %9
%11 = fpext float %10 to double
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), double %5, double %8, double %11)
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.3, i64 0, i64 0))
%14 = getelementptr inbounds [3 x float], [3 x float]* %0, i64 1, i64 0
%15 = load float, float* %14
%16 = fpext float %15 to double
%17 = getelementptr inbounds [3 x float], [3 x float]* %0, i64 1, i64 1
%18 = load float, float* %17
%19 = fpext float %18 to double
%20 = getelementptr inbounds [3 x float], [3 x float]* %0, i64 1, i64 2
%21 = load float, float* %20
%22 = fpext float %21 to double
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), double %16, double %19, double %22)
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.3, i64 0, i64 0))
%25 = getelementptr inbounds [3 x float], [3 x float]* %0, i64 2, i64 0
%26 = load float, float* %25
%27 = fpext float %26 to double
%28 = getelementptr inbounds [3 x float], [3 x float]* %0, i64 2, i64 1
%29 = load float, float* %28
%30 = fpext float %29 to double
%31 = getelementptr inbounds [3 x float], [3 x float]* %0, i64 2, i64 2
%32 = load float, float* %31
%33 = fpext float %32 to double
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), double %27, double %30, double %33)
%35 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.3, i64 0, i64 0))
ret void
}