#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 int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, float);
int printmat(float **R, float *V, int n, FILE *OUTPUT) {
  int i, j;
  for (i = 0; i < n; ++i) {
    for (j = 0; j < n; ++j)
      fprintf(OUTPUT, "%10.5f ", R[i][j]);
    fprintf(OUTPUT, "         %10.5f \n", V[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<printmat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11ab <printmat+0x9b>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1180 <printmat+0x70>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
lea    0xe93(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1141 <printmat+0x31>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
lea    0xe70(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    112e <printmat+0x1e>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printmat>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,(%rsp)
test   %edx,%edx
jle    1190 <printmat+0x80>
mov    %rcx,%r15
mov    %rdi,%rbx
mov    %edx,%ebp
xor    %r13d,%r13d
lea    0xecb(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nop
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rbx,%r13,8),%rax
movss  (%rax,%r14,4),%xmm0
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <fprintf@plt>
add    $0x1,%r14
cmp    %r14,%rbp
jne    1150 <printmat+0x40>
mov    (%rsp),%rax
movss  (%rax,%r13,4),%xmm0
mov    %r15,%rdi
lea    0xe86(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x1,%r13
cmp    %rbp,%r13
jne    1140 <printmat+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%10.5f \00"
@.str.1 = [18 x i8] c" %10.5f \0A\00"
define i32 @printmat(float** nocapture %0, float* nocapture %1, i32 %2, i32* nocapture %3) {
%5 = icmp sgt i32 %2, 0
br i1 %5, label %6, label %25
6: ; preds = %4
%7 = zext i32 %2 to i64
br label %8
8: ; preds = %19, %6
%9 = phi i64 [ 0, %6 ], [ %23, %19 ]
%10 = getelementptr inbounds float*, float** %0, i64 %9
br label %11
11: ; preds = %8, %11
%12 = phi i64 [ 0, %8 ], [ %17, %11 ]
%13 = load float*, float** %10
%14 = getelementptr inbounds float, float* %13, i64 %12
%15 = load float, float* %14
%16 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float %15)
%17 = add nuw nsw i64 %12, 1
%18 = icmp eq i64 %17, %7
br i1 %18, label %19, label %11
19: ; preds = %11
%20 = getelementptr inbounds float, float* %1, i64 %9
%21 = load float, float* %20
%22 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), float %21)
%23 = add nuw nsw i64 %9, 1
%24 = icmp eq i64 %23, %7
br i1 %24, label %25, label %8
25: ; preds = %19, %4
ret i32 0
}