#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*/ mpfr_t;

/* Variables and functions */
int /*<<< orphan*/ mpfr_printf(char *, ...);
int /*<<< orphan*/ printf(char *);
void printMatrix(const size_t m, const size_t n, mpfr_t array[m][n]) {
  printf("\t");
  for (int j = 0; j < n; ++j) {
    mpfr_printf("j=%d%5s\t", j, "");
  }
  printf("\n");
  for (int i = 0; i < m; ++i) {
    mpfr_printf("i=%d\t", i);
    for (int j = 0; j < n; ++j) {
      mpfr_printf("%f\t", array[i][j]);
    }
    mpfr_printf("\n");
  }
}


x86 assembly (clang, -O0):
<printMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1183 <printMatrix+0x63>
mov    -0x1c(%rbp),%esi
lea    0xe99(%rip),%rdi
lea    0xea2(%rip),%rdx
mov    $0x0,%al
call   1040 <mpfr_printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114f <printMatrix+0x2f>
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x20(%rbp)
movslq -0x20(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1220 <printMatrix+0x100>
mov    -0x20(%rbp),%esi
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1040 <mpfr_printf@plt>
movl   $0x0,-0x24(%rbp)
movslq -0x24(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1204 <printMatrix+0xe4>
mov    -0x30(%rbp),%rdx
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe22(%rip),%rdi
mov    $0x0,%al
call   1040 <mpfr_printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11bc <printMatrix+0x9c>
lea    0xdfe(%rip),%rdi
mov    $0x0,%al
call   1040 <mpfr_printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1196 <printMatrix+0x76>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printMatrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,(%rsp)
mov    $0x9,%edi
call   1030 <putchar@plt>
test   %r14,%r14
je     1178 <printMatrix+0x58>
lea    0xeb5(%rip),%r12
lea    0xebe(%rip),%r13
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r12,%rdi
mov    %ebp,%esi
mov    %r13,%rdx
xor    %eax,%eax
call   1040 <mpfr_printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r14
jne    1160 <printMatrix+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpq   $0x0,(%rsp)
je     11f9 <printMatrix+0xd9>
lea    0x0(,%r14,4),%r13
lea    0xe79(%rip),%rbp
xor    %r12d,%r12d
jmp    11bb <printMatrix+0x9b>
nopl   (%rax)
lea    0xe62(%rip),%rdi
xor    %eax,%eax
call   1040 <mpfr_printf@plt>
add    $0x1,%r12
add    %r13,%rbx
cmp    (%rsp),%r12
je     11f9 <printMatrix+0xd9>
lea    0xe49(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <mpfr_printf@plt>
test   %r14,%r14
je     11a0 <printMatrix+0x80>
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rbx,%r15,4),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <mpfr_printf@plt>
add    $0x1,%r15
cmp    %r15,%r14
jne    11e0 <printMatrix+0xc0>
jmp    11a0 <printMatrix+0x80>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\09\00"
@.str.1 = [9 x i8] c"j=%d%5s\09\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [6 x i8] c"i=%d\09\00"
@.str.5 = [4 x i8] c"%f\09\00"
define void @printMatrix(i64 %0, i64 %1, i32* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i64 %0, i64* %4
store i64 %1, i64* %5
store i32* %2, i32** %6
%10 = load i64, i64* %4
%11 = load i64, i64* %5
%12 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %7
br label %13
13: ; preds = %21, %3
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %18, label %24
18: ; preds = %13
%19 = load i32, i32* %7
%20 = call i32 (i8*, ...) @mpfr_printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %19, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
br label %21
21: ; preds = %18
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
store i32 %23, i32* %7
br label %13
24: ; preds = %13
%25 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %8
br label %26
26: ; preds = %55, %24
%27 = load i32, i32* %8
%28 = sext i32 %27 to i64
%29 = load i64, i64* %4
%30 = icmp ult i64 %28, %29
br i1 %30, label %31, label %58
31: ; preds = %26
%32 = load i32, i32* %8
%33 = call i32 (i8*, ...) @mpfr_printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %32)
store i32 0, i32* %9
br label %34
34: ; preds = %50, %31
%35 = load i32, i32* %9
%36 = sext i32 %35 to i64
%37 = load i64, i64* %5
%38 = icmp ult i64 %36, %37
br i1 %38, label %39, label %53
39: ; preds = %34
%40 = load i32*, i32** %6
%41 = load i32, i32* %8
%42 = sext i32 %41 to i64
%43 = mul nsw i64 %42, %11
%44 = getelementptr inbounds i32, i32* %40, i64 %43
%45 = load i32, i32* %9
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i32, i32* %44, i64 %46
%48 = load i32, i32* %47
%49 = call i32 (i8*, ...) @mpfr_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %48)
br label %50
50: ; preds = %39
%51 = load i32, i32* %9
%52 = add nsw i32 %51, 1
store i32 %52, i32* %9
br label %34
53: ; preds = %34
%54 = call i32 (i8*, ...) @mpfr_printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %55
55: ; preds = %53
%56 = load i32, i32* %8
%57 = add nsw i32 %56, 1
store i32 %57, i32* %8
br label %26
58: ; preds = %26
ret void
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"j=%d%5s\09\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [6 x i8] c"i=%d\09\00"
@.str.5 = [4 x i8] c"%f\09\00"
define void @printMatrix(i64 %0, i64 %1, i32* nocapture %2) {
%4 = tail call i32 @putchar(i32 9)
%5 = icmp eq i64 %1, 0
br i1 %5, label %6, label %9
6: ; preds = %9, %3
%7 = tail call i32 @putchar(i32 10)
%8 = icmp eq i64 %0, 0
br i1 %8, label %15, label %16
9: ; preds = %3, %9
%10 = phi i64 [ %13, %9 ], [ 0, %3 ]
%11 = trunc i64 %10 to i32
%12 = tail call i32 (i8*, ...) @mpfr_printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %11, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%13 = add nuw i64 %10, 1
%14 = icmp eq i64 %13, %1
br i1 %14, label %6, label %9
15: ; preds = %23, %6
ret void
16: ; preds = %6, %23
%17 = phi i64 [ %25, %23 ], [ 0, %6 ]
%18 = trunc i64 %17 to i32
%19 = tail call i32 (i8*, ...) @mpfr_printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %18)
br i1 %5, label %23, label %20
20: ; preds = %16
%21 = mul nsw i64 %17, %1
%22 = getelementptr inbounds i32, i32* %2, i64 %21
br label %27
23: ; preds = %27, %16
%24 = tail call i32 (i8*, ...) @mpfr_printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%25 = add nuw i64 %17, 1
%26 = icmp eq i64 %25, %0
br i1 %26, label %15, label %16
27: ; preds = %20, %27
%28 = phi i64 [ 0, %20 ], [ %32, %27 ]
%29 = getelementptr inbounds i32, i32* %22, i64 %28
%30 = load i32, i32* %29
%31 = tail call i32 (i8*, ...) @mpfr_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %30)
%32 = add nuw i64 %28, 1
%33 = icmp eq i64 %32, %1
br i1 %33, label %23, label %27
}