#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void hungarian_print_matrix(int **C, int rows, int cols) {
  int i, j;
  fprintf(stderr, "\n");
  for (i = 0; i < rows; i++) {
    fprintf(stderr, " [");
    for (j = 0; j < cols; j++) {
      fprintf(stderr, "%5d ", C[i][j]);
    }
    fprintf(stderr, "]\n");
  }
  fprintf(stderr, "\n");
}


x86 assembly (clang, -O0):
<hungarian_print_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11d3 <hungarian_print_matrix+0xc3>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11ae <hungarian_print_matrix+0x9e>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xe6a(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    116a <hungarian_print_matrix+0x5a>
mov    0x2e2b(%rip),%rax
mov    (%rax),%edi
lea    0xe4a(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1140 <hungarian_print_matrix+0x30>
mov    0x2e06(%rip),%rax
mov    (%rax),%edi
lea    0xe26(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hungarian_print_matrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edx,0xc(%rsp)
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb2(%rip),%r13
mov    0x0(%r13),%edi
lea    0xed0(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
test   %ebp,%ebp
jle    11c1 <hungarian_print_matrix+0xb1>
mov    %ebp,%eax
mov    %rax,0x10(%rsp)
mov    0xc(%rsp),%r12d
lea    0xeac(%rip),%rbp
xor    %r15d,%r15d
jmp    117d <hungarian_print_matrix+0x6d>
nopl   0x0(%rax)
mov    0x0(%r13),%edi
lea    0xe9d(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
add    $0x1,%r15
cmp    0x10(%rsp),%r15
je     11c1 <hungarian_print_matrix+0xb1>
mov    0x0(%r13),%edi
lea    0xe78(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1160 <hungarian_print_matrix+0x50>
xor    %r14d,%r14d
nopl   0x0(%rax)
mov    0x0(%r13),%edi
mov    (%rbx,%r15,8),%rax
mov    (%rax,%r14,4),%edx
mov    %rbp,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
add    $0x1,%r14
cmp    %r14,%r12
jne    11a0 <hungarian_print_matrix+0x90>
jmp    1160 <hungarian_print_matrix+0x50>
mov    0x0(%r13),%edi
lea    0xe3d(%rip),%rsi
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fprintf@plt>

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

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