#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 lettura_matrice(int **, unsigned int, unsigned int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
void stampa_matrice(int **matrice, int numero_righe, int numero_colonne) {
  unsigned int indice_righe;
  unsigned int indice_colonne;
  puts("La matrice da esaminare e' la seguente:\n");
  indice_righe = 0;
  while (indice_righe < numero_righe) {
    indice_colonne = 0;
    while (indice_colonne < numero_colonne) {
      printf("%2d ", lettura_matrice(matrice, indice_righe, indice_colonne));
      indice_colonne++;
    }
    puts("");
    indice_righe++;
  }
  return;
}


x86 assembly (clang, -O0):
<stampa_matrice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    11b9 <stampa_matrice+0x89>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jae    119f <stampa_matrice+0x6f>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1040 <lettura_matrice@plt>
mov    %eax,%esi
lea    0xe9d(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1168 <stampa_matrice+0x38>
lea    0xe82(%rip),%rdi
call   1030 <puts@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1155 <stampa_matrice+0x25>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stampa_matrice>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,%r13d
mov    %esi,%r14d
mov    %rdi,%r15
lea    0xea5(%rip),%rdi
call   1040 <puts@plt>
test   %r14d,%r14d
je     11b0 <stampa_matrice+0x70>
xor    %ebp,%ebp
lea    0xebb(%rip),%r12
jmp    1182 <stampa_matrice+0x42>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    %r14d,%ebp
je     11b0 <stampa_matrice+0x70>
test   %r13d,%r13d
je     1170 <stampa_matrice+0x30>
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1050 <lettura_matrice@plt>
mov    %r12,%rdi
mov    %eax,%esi
call   1060 <printf@plt>
add    $0x1,%ebx
cmp    %ebx,%r13d
jne    1190 <stampa_matrice+0x50>
jmp    1170 <stampa_matrice+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [41 x i8] c"La matrice da esaminare e' la seguente:\0A\00"
@.str.1 = [5 x i8] c"%2d \00"
@.str.2 = [1 x i8] zeroinitializer
define void @stampa_matrice(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 = call i32 @puts(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %7
br label %10
10: ; preds = %27, %3
%11 = load i32, i32* %7
%12 = load i32, i32* %5
%13 = icmp ult i32 %11, %12
br i1 %13, label %14, label %31
14: ; preds = %10
store i32 0, i32* %8
br label %15
15: ; preds = %19, %14
%16 = load i32, i32* %8
%17 = load i32, i32* %6
%18 = icmp ult i32 %16, %17
br i1 %18, label %19, label %27
19: ; preds = %15
%20 = load i32**, i32*** %4
%21 = load i32, i32* %7
%22 = load i32, i32* %8
%23 = call i32 @lettura_matrice(i32** %20, i32 %21, i32 %22)
%24 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %23)
%25 = load i32, i32* %8
%26 = add i32 %25, 1
store i32 %26, i32* %8
br label %15
27: ; preds = %15
%28 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%29 = load i32, i32* %7
%30 = add i32 %29, 1
store i32 %30, i32* %7
br label %10
31: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"La matrice da esaminare e' la seguente:\0A\00"
@.str.1 = [5 x i8] c"%2d \00"
define void @stampa_matrice(i32** %0, i32 %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %1, 0
br i1 %5, label %20, label %6
6: ; preds = %3
%7 = icmp eq i32 %2, 0
br label %8
8: ; preds = %6, %16
%9 = phi i32 [ 0, %6 ], [ %18, %16 ]
br i1 %7, label %16, label %10
10: ; preds = %8, %10
%11 = phi i32 [ %14, %10 ], [ 0, %8 ]
%12 = tail call i32 @lettura_matrice(i32** %0, i32 %9, i32 %11)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = add nuw i32 %11, 1
%15 = icmp eq i32 %14, %2
br i1 %15, label %16, label %10
16: ; preds = %10, %8
%17 = tail call i32 @putchar(i32 10)
%18 = add nuw i32 %9, 1
%19 = icmp eq i32 %18, %1
br i1 %19, label %20, label %8
20: ; preds = %16, %3
ret void
}