#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void printmat(float mat[4][4]) {
  int x, y;
  fprintf(stderr, "\n");
  for (y = 0; y < 4; y++) {
    for (x = 0; x < 4; x++)
      fprintf(stderr, "%f ", mat[y][x]);
    fprintf(stderr, "\n");
  }
  fprintf(stderr, "\n");
}


x86 assembly (clang, -O0):
<printmat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    11bb <printmat+0xab>
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1196 <printmat+0x86>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe81(%rip),%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114b <printmat+0x3b>
mov    0x2e43(%rip),%rax
mov    (%rax),%edi
lea    0xe5a(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113a <printmat+0x2a>
mov    0x2e1e(%rip),%rax
mov    (%rax),%edi
lea    0xe35(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printmat>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ebe(%rip),%r12
mov    (%r12),%edi
lea    0xed3(%rip),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r12),%edi
movss  (%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb8(%rip),%r15
mov    %r15,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    (%r12),%edi
movss  0x4(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    (%r12),%edi
movss  0x8(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    (%r12),%edi
movss  0xc(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    (%r12),%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r12),%edi
movss  0x10(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    (%r12),%edi
movss  0x14(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    (%r12),%edi
movss  0x18(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    (%r12),%edi
movss  0x1c(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    (%r12),%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r12),%edi
movss  0x20(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    (%r12),%edi
movss  0x24(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    (%r12),%edi
movss  0x28(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    (%r12),%edi
movss  0x2c(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    (%r12),%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r12),%edi
movss  0x30(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    (%r12),%edi
movss  0x34(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    (%r12),%edi
movss  0x38(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    (%r12),%edi
movss  0x3c(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    (%r12),%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r12),%edi
mov    %r14,%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <fprintf@plt>

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

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