#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 */
typedef scalar_t__ GLdouble;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_matrix(GLdouble *matrix) {
  for (int i = 0; i < 16; i = i + 4) {
    printf("%g\t", (double)matrix[i]);
  }
  printf("\n");
  for (int i = 1; i < 16; i = i + 4) {
    printf("%g\t", (double)matrix[i]);
  }
  printf("\n");
  for (int i = 2; i < 16; i = i + 4) {
    printf("%g\t", (double)matrix[i]);
  }
  printf("\n");
  for (int i = 3; i < 16; i = i + 4) {
    printf("%g\t", (double)matrix[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    1157 <print_matrix+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cvtsi2sdq (%rax,%rcx,8),%xmm0
lea    0xebe(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print_matrix+0x13>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x10(%rbp)
cmpl   $0x10,-0x10(%rbp)
jge    11a0 <print_matrix+0x90>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cvtsi2sdq (%rax,%rcx,8),%xmm0
lea    0xe75(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x10(%rbp)
jmp    116c <print_matrix+0x5c>
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x2,-0x14(%rbp)
cmpl   $0x10,-0x14(%rbp)
jge    11e9 <print_matrix+0xd9>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cvtsi2sdq (%rax,%rcx,8),%xmm0
lea    0xe2c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x14(%rbp)
jmp    11b5 <print_matrix+0xa5>
lea    0xe14(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x3,-0x18(%rbp)
cmpl   $0x10,-0x18(%rbp)
jge    1232 <print_matrix+0x122>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
cvtsi2sdq (%rax,%rcx,8),%xmm0
lea    0xde3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x18(%rbp)
jmp    11fe <print_matrix+0xee>
lea    0xdcb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_matrix>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
cvtsi2sdq (%rdi),%xmm0
lea    0xecd(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdq 0x20(%rbx),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdq 0x40(%rbx),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdq 0x60(%rbx),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xorps  %xmm0,%xmm0
cvtsi2sdq 0x8(%rbx),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdq 0x28(%rbx),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdq 0x48(%rbx),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdq 0x68(%rbx),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xorps  %xmm0,%xmm0
cvtsi2sdq 0x10(%rbx),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdq 0x30(%rbx),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdq 0x50(%rbx),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdq 0x70(%rbx),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xorps  %xmm0,%xmm0
cvtsi2sdq 0x18(%rbx),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdq 0x38(%rbx),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdq 0x58(%rbx),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdq 0x78(%rbx),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%g\09\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_matrix(i64* %0) {
%2 = alloca i64*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i64* %0, i64** %2
store i32 0, i32* %3
br label %7
7: ; preds = %18, %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 16
br i1 %9, label %10, label %21
10: ; preds = %7
%11 = load i64*, i64** %2
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i64, i64* %11, i64 %13
%15 = load i64, i64* %14
%16 = sitofp i64 %15 to double
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 4
store i32 %20, i32* %3
br label %7
21: ; preds = %7
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %4
br label %23
23: ; preds = %34, %21
%24 = load i32, i32* %4
%25 = icmp slt i32 %24, 16
br i1 %25, label %26, label %37
26: ; preds = %23
%27 = load i64*, i64** %2
%28 = load i32, i32* %4
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i64, i64* %27, i64 %29
%31 = load i64, i64* %30
%32 = sitofp i64 %31 to double
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %32)
br label %34
34: ; preds = %26
%35 = load i32, i32* %4
%36 = add nsw i32 %35, 4
store i32 %36, i32* %4
br label %23
37: ; preds = %23
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 2, i32* %5
br label %39
39: ; preds = %50, %37
%40 = load i32, i32* %5
%41 = icmp slt i32 %40, 16
br i1 %41, label %42, label %53
42: ; preds = %39
%43 = load i64*, i64** %2
%44 = load i32, i32* %5
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i64, i64* %43, i64 %45
%47 = load i64, i64* %46
%48 = sitofp i64 %47 to double
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %48)
br label %50
50: ; preds = %42
%51 = load i32, i32* %5
%52 = add nsw i32 %51, 4
store i32 %52, i32* %5
br label %39
53: ; preds = %39
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 3, i32* %6
br label %55
55: ; preds = %66, %53
%56 = load i32, i32* %6
%57 = icmp slt i32 %56, 16
br i1 %57, label %58, label %69
58: ; preds = %55
%59 = load i64*, i64** %2
%60 = load i32, i32* %6
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds i64, i64* %59, i64 %61
%63 = load i64, i64* %62
%64 = sitofp i64 %63 to double
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %64)
br label %66
66: ; preds = %58
%67 = load i32, i32* %6
%68 = add nsw i32 %67, 4
store i32 %68, i32* %6
br label %55
69: ; preds = %55
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

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