#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, double, double);
void printmatrix(double M[3][3]) {
  printf("%g %g %g\n", M[0][0], M[0][1], M[0][2]);
  printf("%g %g %g\n", M[1][0], M[1][1], M[1][2]);
  printf("%g %g %g\n", M[2][0], M[2][1], M[2][2]);
}


x86 assembly (clang, -O0):
<printmatrix>:
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
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm2
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x40(%rax),%xmm2
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printmatrix>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
movsd  0x10(%rdi),%xmm2
lea    0xed4(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
movsd  0x18(%rbx),%xmm0
movsd  0x20(%rbx),%xmm1
movsd  0x28(%rbx),%xmm2
mov    %r14,%rdi
call   1030 <printf@plt>
movsd  0x30(%rbx),%xmm0
movsd  0x38(%rbx),%xmm1
movsd  0x40(%rbx),%xmm2
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"%g %g %g\0A\00"
define void @printmatrix([3 x double]* nocapture %0) {
%2 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 0
%3 = load double, double* %2
%4 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 1
%5 = load double, double* %4
%6 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 2
%7 = load double, double* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %3, double %5, double %7)
%9 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 0
%10 = load double, double* %9
%11 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 1
%12 = load double, double* %11
%13 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 2
%14 = load double, double* %13
%15 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %10, double %12, double %14)
%16 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 0
%17 = load double, double* %16
%18 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 1
%19 = load double, double* %18
%20 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 2
%21 = load double, double* %20
%22 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %17, double %19, double %21)
ret void
}