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


x86 assembly (clang, -O0):
<printmat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    119b <printmat+0x8b>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm1
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm2
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm3
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <printmat+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printmat>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
movss  0x8(%rdi),%xmm2
movss  0xc(%rdi),%xmm3
lea    0xecf(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
movss  0x10(%rbx),%xmm0
movss  0x14(%rbx),%xmm1
movss  0x18(%rbx),%xmm2
movss  0x1c(%rbx),%xmm3
mov    %r14,%rdi
call   1030 <printf@plt>
movss  0x20(%rbx),%xmm0
movss  0x24(%rbx),%xmm1
movss  0x28(%rbx),%xmm2
movss  0x2c(%rbx),%xmm3
mov    %r14,%rdi
call   1030 <printf@plt>
movss  0x30(%rbx),%xmm0
movss  0x34(%rbx),%xmm1
movss  0x38(%rbx),%xmm2
movss  0x3c(%rbx),%xmm3
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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

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