#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 *, ...);
void PrintMatr(int size, int **x) {
  int i, j;
  for (i = 0; i < size; i++) {
    printf("\n");
    for (j = 0; j < size; j++)
      printf("%4d ", x[i][j]);
  }
}


x86 assembly (clang, -O0):
<PrintMatr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1195 <PrintMatr+0x85>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1182 <PrintMatr+0x72>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1147 <PrintMatr+0x37>
jmp    1187 <PrintMatr+0x77>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <PrintMatr+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintMatr>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %edi,%edi
jle    1173 <PrintMatr+0x53>
mov    %rsi,%r15
mov    %edi,%r12d
lea    0xec6(%rip),%r14
xor    %r13d,%r13d
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r15,%r13,8),%rax
mov    (%rax,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1150 <PrintMatr+0x30>
add    $0x1,%r13
cmp    %r12,%r13
jne    1140 <PrintMatr+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

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