#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 */
double LetturaElemento(float *, int, int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
void StampaMatriceRisulta(float *matrice) {
  int i = 0;
  int j = 0;
  int righe = 0;
  int colonne = 0;
  printf("\n==================================================================="
         "========\n");
  printf("La matrice di risulta e' :\n");
  i = 0;
  while (i < LetturaElemento(matrice, righe, colonne)) {
    j = 0;
    while (j < LetturaElemento(matrice, righe, colonne + 1)) {
      printf("%.2f\t", LetturaElemento(matrice, i, j + 2));
      j++;
    }
    printf("\n");
    i++;
  }
  printf("\n==================================================================="
         "========\n");
  getchar();
  getchar();
  return;
}


x86 assembly (clang, -O0):
<StampaMatriceRisulta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1050 <LetturaElemento@plt>
movsd  -0x20(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jbe    121f <StampaMatriceRisulta+0xef>
movl   $0x0,-0x10(%rbp)
cvtsi2sdl -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
add    $0x1,%edx
call   1050 <LetturaElemento@plt>
movsd  -0x28(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jbe    1203 <StampaMatriceRisulta+0xd3>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
add    $0x2,%edx
call   1050 <LetturaElemento@plt>
lea    0xe7c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11aa <StampaMatriceRisulta+0x7a>
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    117b <StampaMatriceRisulta+0x4b>
lea    0xdda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StampaMatriceRisulta>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
lea    0xea1(%rip),%rdi
call   1040 <puts@plt>
xor    %r15d,%r15d
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <LetturaElemento@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1234 <StampaMatriceRisulta+0xe4>
lea    0xe72(%rip),%r14
jmp    11ce <StampaMatriceRisulta+0x7e>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15d
xorps  %xmm0,%xmm0
cvtsi2sd %r15d,%xmm0
movsd  %xmm0,(%rsp)
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <LetturaElemento@plt>
ucomisd (%rsp),%xmm0
jbe    1234 <StampaMatriceRisulta+0xe4>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1070 <LetturaElemento@plt>
ucomisd 0xe1b(%rip),%xmm0
jbe    11a0 <StampaMatriceRisulta+0x50>
mov    $0x2,%ebp
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %ebp,%edx
call   1070 <LetturaElemento@plt>
mov    %r14,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    -0x1(%rbp),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%rsp)
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1070 <LetturaElemento@plt>
add    $0x1,%ebp
ucomisd (%rsp),%xmm0
ja     11f0 <StampaMatriceRisulta+0xa0>
jmp    11a0 <StampaMatriceRisulta+0x50>
lea    0xdee(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <getchar@plt>

LLVM IR (-O0):
@.str = [78 x i8] c"\0A===========================================================================\0A\00"
@.str.1 = [28 x i8] c"La matrice di risulta e' :\0A\00"
@.str.2 = [6 x i8] c"%.2f\09\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @StampaMatriceRisulta(float* %0) {
%2 = alloca float*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store float* %0, float** %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %9
9: ; preds = %36, %1
%10 = load i32, i32* %3
%11 = sitofp i32 %10 to double
%12 = load float*, float** %2
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call double @LetturaElemento(float* %12, i32 %13, i32 %14)
%16 = fcmp olt double %11, %15
br i1 %16, label %17, label %40
17: ; preds = %9
store i32 0, i32* %4
br label %18
18: ; preds = %27, %17
%19 = load i32, i32* %4
%20 = sitofp i32 %19 to double
%21 = load float*, float** %2
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = add nsw i32 %23, 1
%25 = call double @LetturaElemento(float* %21, i32 %22, i32 %24)
%26 = fcmp olt double %20, %25
br i1 %26, label %27, label %36
27: ; preds = %18
%28 = load float*, float** %2
%29 = load i32, i32* %3
%30 = load i32, i32* %4
%31 = add nsw i32 %30, 2
%32 = call double @LetturaElemento(float* %28, i32 %29, i32 %31)
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %32)
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
store i32 %35, i32* %4
br label %18
36: ; preds = %18
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%38 = load i32, i32* %3
%39 = add nsw i32 %38, 1
store i32 %39, i32* %3
br label %9
40: ; preds = %9
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
%42 = call i32 (...) @getchar()
%43 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@.str.2 = [6 x i8] c"%.2f\09\00"
@str.4 = [27 x i8] c"La matrice di risulta e' :\00"
@str.5 = [77 x i8] c"\0A===========================================================================\00"
define void @StampaMatriceRisulta(float* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.4, i64 0, i64 0))
%4 = tail call double @LetturaElemento(float* %0, i32 0, i32 0)
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %25
6: ; preds = %1, %19
%7 = phi i32 [ %21, %19 ], [ 0, %1 ]
%8 = tail call double @LetturaElemento(float* %0, i32 0, i32 1)
%9 = fcmp ogt double %8, 0.000000e+00
br i1 %9, label %10, label %19
10: ; preds = %6, %10
%11 = phi i32 [ %15, %10 ], [ 0, %6 ]
%12 = add nuw nsw i32 %11, 2
%13 = tail call double @LetturaElemento(float* %0, i32 %7, i32 %12)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %13)
%15 = add nuw nsw i32 %11, 1
%16 = sitofp i32 %15 to double
%17 = tail call double @LetturaElemento(float* %0, i32 0, i32 1)
%18 = fcmp ogt double %17, %16
br i1 %18, label %10, label %19
19: ; preds = %10, %6
%20 = tail call i32 @putchar(i32 10)
%21 = add nuw nsw i32 %7, 1
%22 = sitofp i32 %21 to double
%23 = tail call double @LetturaElemento(float* %0, i32 0, i32 0)
%24 = fcmp ogt double %23, %22
br i1 %24, label %6, label %25
25: ; preds = %19, %1
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str.5, i64 0, i64 0))
%27 = tail call i32 (...) @getchar()
%28 = tail call i32 (...) @getchar()
ret void
}