#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 get_matrix(unsigned int **, int, int);
int /*<<< orphan*/ printf(char *, ...);
void print_M_con_i(unsigned int **M, int r, int c) {
  for (int i = 0; i < r; ++i) {
    printf("%d:  ", i);
    for (int j = 0; j < c; ++j)
      printf("%u, ", get_matrix(M, i, j));
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<print_M_con_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11b2 <print_M_con_i+0x92>
mov    -0x14(%rbp),%esi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1196 <print_M_con_i+0x76>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <get_matrix@plt>
mov    %eax,%esi
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    115d <print_M_con_i+0x3d>
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <print_M_con_i+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_M_con_i>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    11b4 <print_M_con_i+0x84>
mov    %edx,%ebx
mov    %esi,%r14d
mov    %rdi,%r13
lea    0xeb8(%rip),%r12
xor    %ebp,%ebp
jmp    1172 <print_M_con_i+0x42>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    %r14d,%ebp
je     11b4 <print_M_con_i+0x84>
lea    0xe87(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebx,%ebx
jle    1160 <print_M_con_i+0x30>
xor    %r15d,%r15d
nopl   0x0(%rax)
mov    %r13,%rdi
mov    %ebp,%esi
mov    %r15d,%edx
call   1040 <get_matrix@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r15d
cmp    %r15d,%ebx
jne    1190 <print_M_con_i+0x60>
jmp    1160 <print_M_con_i+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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