#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 printmatrix(double a[3][3]) {
  int i, j;
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      fprintf(stderr, "%16.14f ", a[i][j]);
    }
    fprintf(stderr, "\n");
  }
}


x86 assembly (clang, -O0):
<printmatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    11a0 <printmatrix+0x90>
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    117b <printmatrix+0x6b>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe9a(%rip),%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <printmatrix+0x24>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
lea    0xe7e(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <printmatrix+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printmatrix>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ebe(%rip),%r12
mov    (%r12),%edi
movsd  (%rbx),%xmm0
lea    0xecf(%rip),%r14
mov    %r14,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    (%r12),%edi
movsd  0x8(%rbx),%xmm0
mov    %r14,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    (%r12),%edi
movsd  0x10(%rbx),%xmm0
mov    %r14,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    (%r12),%edi
lea    0xe9d(%rip),%r15
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r12),%edi
movsd  0x18(%rbx),%xmm0
mov    %r14,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    (%r12),%edi
movsd  0x20(%rbx),%xmm0
mov    %r14,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    (%r12),%edi
movsd  0x28(%rbx),%xmm0
mov    %r14,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    (%r12),%edi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r12),%edi
movsd  0x30(%rbx),%xmm0
mov    %r14,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    (%r12),%edi
movsd  0x38(%rbx),%xmm0
mov    %r14,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    (%r12),%edi
movsd  0x40(%rbx),%xmm0
mov    %r14,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    (%r12),%edi
mov    %r15,%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 = [9 x i8] c"%16.14f \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printmatrix([3 x double]* %0) {
%2 = alloca [3 x double]*
%3 = alloca i32
%4 = alloca i32
store [3 x double]* %0, [3 x double]** %2
store i32 0, i32* %3
br label %5
5: ; preds = %29, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %32
8: ; preds = %5
store i32 0, i32* %4
br label %9
9: ; preds = %23, %8
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 3
br i1 %11, label %12, label %26
12: ; preds = %9
%13 = load i32, i32* @stderr
%14 = load [3 x double]*, [3 x double]** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [3 x double], [3 x double]* %14, i64 %16
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [3 x double], [3 x double]* %17, i64 0, i64 %19
%21 = load double, double* %20
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %21)
br label %23
23: ; preds = %12
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %9
26: ; preds = %9
%27 = load i32, i32* @stderr
%28 = call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %29
29: ; preds = %26
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %5
32: ; preds = %5
ret void
}

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