#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 print_confusion_matrix(int *confusion_matrix, int n) {
  int i, j;
  int *p = confusion_matrix;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      printf("%d ", *p);
      p++;
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<print_confusion_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1197 <print_confusion_matrix+0x87>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    117b <print_confusion_matrix+0x6b>
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <print_confusion_matrix+0x31>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112e <print_confusion_matrix+0x1e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_confusion_matrix>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %esi,%esi
jle    1178 <print_confusion_matrix+0x58>
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0xec7(%rip),%r12
xor    %r15d,%r15d
nopl   0x0(%rax)
mov    %r14d,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rbx),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x4,%rbx
add    $0xffffffff,%ebp
jne    1150 <print_confusion_matrix+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15d
cmp    %r14d,%r15d
jne    1140 <print_confusion_matrix+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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