#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 const, double const, double const,
                          double const);
void matrix_print(const double *matrix) {
  printf("[%f %f %f %f]\n", matrix[0], matrix[1], matrix[2], matrix[3]);
  printf("[%f %f %f %f]\n", matrix[4], matrix[5], matrix[6], matrix[7]);
  printf("[%f %f %f %f]\n", matrix[8], matrix[9], matrix[10], matrix[11]);
  printf("[%f %f %f %f]\n", matrix[12], matrix[13], matrix[14], matrix[15]);
}


x86 assembly (clang, -O0):
<matrix_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm3
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm3
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movsd  0x40(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x48(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x50(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x58(%rax),%xmm3
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movsd  0x60(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x68(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x70(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x78(%rax),%xmm3
lea    0xe2a(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix_print>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
movsd  0x10(%rdi),%xmm2
movsd  0x18(%rdi),%xmm3
lea    0xecf(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
movsd  0x20(%rbx),%xmm0
movsd  0x28(%rbx),%xmm1
movsd  0x30(%rbx),%xmm2
movsd  0x38(%rbx),%xmm3
mov    %r14,%rdi
call   1030 <printf@plt>
movsd  0x40(%rbx),%xmm0
movsd  0x48(%rbx),%xmm1
movsd  0x50(%rbx),%xmm2
movsd  0x58(%rbx),%xmm3
mov    %r14,%rdi
call   1030 <printf@plt>
movsd  0x60(%rbx),%xmm0
movsd  0x68(%rbx),%xmm1
movsd  0x70(%rbx),%xmm2
movsd  0x78(%rbx),%xmm3
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"[%f %f %f %f]\0A\00"
define void @matrix_print(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 1
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 2
%11 = load double, double* %10
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 3
%14 = load double, double* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %5, double %8, double %11, double %14)
%16 = load double*, double** %2
%17 = getelementptr inbounds double, double* %16, i64 4
%18 = load double, double* %17
%19 = load double*, double** %2
%20 = getelementptr inbounds double, double* %19, i64 5
%21 = load double, double* %20
%22 = load double*, double** %2
%23 = getelementptr inbounds double, double* %22, i64 6
%24 = load double, double* %23
%25 = load double*, double** %2
%26 = getelementptr inbounds double, double* %25, i64 7
%27 = load double, double* %26
%28 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %18, double %21, double %24, double %27)
%29 = load double*, double** %2
%30 = getelementptr inbounds double, double* %29, i64 8
%31 = load double, double* %30
%32 = load double*, double** %2
%33 = getelementptr inbounds double, double* %32, i64 9
%34 = load double, double* %33
%35 = load double*, double** %2
%36 = getelementptr inbounds double, double* %35, i64 10
%37 = load double, double* %36
%38 = load double*, double** %2
%39 = getelementptr inbounds double, double* %38, i64 11
%40 = load double, double* %39
%41 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %31, double %34, double %37, double %40)
%42 = load double*, double** %2
%43 = getelementptr inbounds double, double* %42, i64 12
%44 = load double, double* %43
%45 = load double*, double** %2
%46 = getelementptr inbounds double, double* %45, i64 13
%47 = load double, double* %46
%48 = load double*, double** %2
%49 = getelementptr inbounds double, double* %48, i64 14
%50 = load double, double* %49
%51 = load double*, double** %2
%52 = getelementptr inbounds double, double* %51, i64 15
%53 = load double, double* %52
%54 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %44, double %47, double %50, double %53)
ret void
}

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