#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 displayMatrix(float mat[4][4]) {
  int j, k;
  for (j = 0; j < 4; j++) {
    for (k = 0; k < 4; k++) {
      printf("%.4f", mat[j][k]);
      printf("\t");
    }
    printf("\n");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<displayMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    11a0 <displayMatrix+0x90>
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    1184 <displayMatrix+0x74>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <displayMatrix+0x24>
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <displayMatrix+0x13>
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayMatrix>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movss  (%rdi),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeca(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
movss  0x4(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
movss  0x8(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
movss  0xc(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movss  0x10(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
movss  0x14(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
movss  0x18(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
movss  0x1c(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movss  0x20(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
movss  0x24(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
movss  0x28(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
movss  0x2c(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movss  0x30(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
movss  0x34(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
movss  0x38(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
movss  0x3c(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%.4f\00"
define void @displayMatrix([4 x float]* nocapture %0) {
%2 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 0, i64 0
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %4)
%6 = tail call i32 @putchar(i32 9)
%7 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 0, i64 1
%8 = load float, float* %7
%9 = fpext float %8 to double
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %9)
%11 = tail call i32 @putchar(i32 9)
%12 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 0, i64 2
%13 = load float, float* %12
%14 = fpext float %13 to double
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %14)
%16 = tail call i32 @putchar(i32 9)
%17 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 0, i64 3
%18 = load float, float* %17
%19 = fpext float %18 to double
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %19)
%21 = tail call i32 @putchar(i32 9)
%22 = tail call i32 @putchar(i32 10)
%23 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 1, i64 0
%24 = load float, float* %23
%25 = fpext float %24 to double
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %25)
%27 = tail call i32 @putchar(i32 9)
%28 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 1, i64 1
%29 = load float, float* %28
%30 = fpext float %29 to double
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %30)
%32 = tail call i32 @putchar(i32 9)
%33 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 1, i64 2
%34 = load float, float* %33
%35 = fpext float %34 to double
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %35)
%37 = tail call i32 @putchar(i32 9)
%38 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 1, i64 3
%39 = load float, float* %38
%40 = fpext float %39 to double
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %40)
%42 = tail call i32 @putchar(i32 9)
%43 = tail call i32 @putchar(i32 10)
%44 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 2, i64 0
%45 = load float, float* %44
%46 = fpext float %45 to double
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %46)
%48 = tail call i32 @putchar(i32 9)
%49 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 2, i64 1
%50 = load float, float* %49
%51 = fpext float %50 to double
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %51)
%53 = tail call i32 @putchar(i32 9)
%54 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 2, i64 2
%55 = load float, float* %54
%56 = fpext float %55 to double
%57 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %56)
%58 = tail call i32 @putchar(i32 9)
%59 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 2, i64 3
%60 = load float, float* %59
%61 = fpext float %60 to double
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %61)
%63 = tail call i32 @putchar(i32 9)
%64 = tail call i32 @putchar(i32 10)
%65 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 3, i64 0
%66 = load float, float* %65
%67 = fpext float %66 to double
%68 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %67)
%69 = tail call i32 @putchar(i32 9)
%70 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 3, i64 1
%71 = load float, float* %70
%72 = fpext float %71 to double
%73 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %72)
%74 = tail call i32 @putchar(i32 9)
%75 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 3, i64 2
%76 = load float, float* %75
%77 = fpext float %76 to double
%78 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %77)
%79 = tail call i32 @putchar(i32 9)
%80 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 3, i64 3
%81 = load float, float* %80
%82 = fpext float %81 to double
%83 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %82)
%84 = tail call i32 @putchar(i32 9)
%85 = tail call i32 @putchar(i32 10)
%86 = tail call i32 @putchar(i32 10)
ret void
}