#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*/ ScrivereElemento(float **, int, int, float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
void InserimentoNumeroRigheEColonne(float matrice[][100], int n) {
  float valore = 0;
  int righe = 0;
  int colonne = 0;
  ScrivereElemento(matrice, righe, colonne, valore);
  ScrivereElemento(matrice, righe, colonne + 1, valore);
  printf("\n==================================================================="
         "========\n");
  printf("\n\t\tInserire le Righe e le Colonne della Matrice numero: %d \n", n);
  printf(
      "\tNotaBene: una matrice non può essere composta 1 riga ed 1 colonna\n");
  printf("\n==================================================================="
         "========\n");
  while (LetturaElemento(matrice, righe, colonne) <= 1.000000 &&
         LetturaElemento(matrice, righe, colonne + 1) <= 1.000000) {
    printf("Per Cortesia inserire almeno una Riga ");
    scanf("%f", &valore);
    ScrivereElemento(matrice, righe, colonne, valore);
    printf("Per Cortesia inserire almeno una Colonna ");
    scanf("%f", &valore);
    ScrivereElemento(matrice, righe, colonne + 1, valore);
  }
  return;
}


x86 assembly (clang, -O0):
<InserimentoNumeroRigheEColonne>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
movss  -0x10(%rbp),%xmm0
call   1030 <ScrivereElemento@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
add    $0x1,%edx
movss  -0x10(%rbp),%xmm0
call   1030 <ScrivereElemento@plt>
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1050 <LetturaElemento@plt>
movaps %xmm0,%xmm1
xor    %eax,%eax
movsd  0xe19(%rip),%xmm0
ucomisd %xmm1,%xmm0
mov    %al,-0x19(%rbp)
jb     121b <InserimentoNumeroRigheEColonne+0xdb>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
add    $0x1,%edx
call   1050 <LetturaElemento@plt>
movaps %xmm0,%xmm1
movsd  0xdef(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    122b <InserimentoNumeroRigheEColonne+0xeb>
jmp    1297 <InserimentoNumeroRigheEColonne+0x157>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
movss  -0x10(%rbp),%xmm0
call   1030 <ScrivereElemento@plt>
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe8d(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
add    $0x1,%edx
movss  -0x10(%rbp),%xmm0
call   1030 <ScrivereElemento@plt>
jmp    11cb <InserimentoNumeroRigheEColonne+0x8b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InserimentoNumeroRigheEColonne>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
movl   $0x0,0x4(%rsp)
xorpd  %xmm0,%xmm0
xor    %esi,%esi
xor    %edx,%edx
call   1040 <ScrivereElemento@plt>
xorpd  %xmm0,%xmm0
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <ScrivereElemento@plt>
lea    0xf4e(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xe6a(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeeb(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1060 <LetturaElemento@plt>
movsd  0xe31(%rip),%xmm1
ucomisd %xmm0,%xmm1
jb     128c <InserimentoNumeroRigheEColonne+0x13c>
lea    0xe65(%rip),%r14
lea    0xe85(%rip),%r15
lea    0x4(%rsp),%r12
lea    0xe7c(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1060 <LetturaElemento@plt>
movsd  0xde9(%rip),%xmm1
ucomisd %xmm0,%xmm1
jb     128c <InserimentoNumeroRigheEColonne+0x13c>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <scanf@plt>
movss  0x4(%rsp),%xmm0
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <ScrivereElemento@plt>
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <scanf@plt>
movss  0x4(%rsp),%xmm0
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <ScrivereElemento@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1060 <LetturaElemento@plt>
movsd  0xd7e(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1200 <InserimentoNumeroRigheEColonne+0xb0>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [78 x i8] c"\0A===========================================================================\0A\00"
@.str.1 = [61 x i8] c"\0A\09\09Inserire le Righe e le Colonne della Matrice numero: %d \0A\00"
@.str.2 = [69 x i8] c"\09NotaBene: una matrice non pu\C3\B2 essere composta 1 riga ed 1 colonna\0A\00"
@.str.3 = [39 x i8] c"Per Cortesia inserire almeno una Riga \00"
@.str.4 = [3 x i8] c"%f\00"
@.str.5 = [42 x i8] c"Per Cortesia inserire almeno una Colonna \00"
define void @InserimentoNumeroRigheEColonne([100 x float]* %0, i32 %1) {
%3 = alloca [100 x float]*
%4 = alloca i32
%5 = alloca float
%6 = alloca i32
%7 = alloca i32
store [100 x float]* %0, [100 x float]** %3
store i32 %1, i32* %4
store float 0.000000e+00, float* %5
store i32 0, i32* %6
store i32 0, i32* %7
%8 = load [100 x float]*, [100 x float]** %3
%9 = bitcast [100 x float]* %8 to float**
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load float, float* %5
%13 = call i32 @ScrivereElemento(float** %9, i32 %10, i32 %11, float %12)
%14 = load [100 x float]*, [100 x float]** %3
%15 = bitcast [100 x float]* %14 to float**
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = add nsw i32 %17, 1
%19 = load float, float* %5
%20 = call i32 @ScrivereElemento(float** %15, i32 %16, i32 %18, float %19)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
%22 = load i32, i32* %4
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0), i32 %22)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.2, i64 0, i64 0))
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
br label %26
26: ; preds = %43, %2
%27 = load [100 x float]*, [100 x float]** %3
%28 = bitcast [100 x float]* %27 to float**
%29 = load i32, i32* %6
%30 = load i32, i32* %7
%31 = call double @LetturaElemento(float** %28, i32 %29, i32 %30)
%32 = fcmp ole double %31, 1.000000e+00
br i1 %32, label %33, label %41
33: ; preds = %26
%34 = load [100 x float]*, [100 x float]** %3
%35 = bitcast [100 x float]* %34 to float**
%36 = load i32, i32* %6
%37 = load i32, i32* %7
%38 = add nsw i32 %37, 1
%39 = call double @LetturaElemento(float** %35, i32 %36, i32 %38)
%40 = fcmp ole double %39, 1.000000e+00
br label %41
41: ; preds = %33, %26
%42 = phi i1 [ false, %26 ], [ %40, %33 ]
br i1 %42, label %43, label %61
43: ; preds = %41
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
%45 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %5)
%46 = load [100 x float]*, [100 x float]** %3
%47 = bitcast [100 x float]* %46 to float**
%48 = load i32, i32* %6
%49 = load i32, i32* %7
%50 = load float, float* %5
%51 = call i32 @ScrivereElemento(float** %47, i32 %48, i32 %49, float %50)
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0))
%53 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %5)
%54 = load [100 x float]*, [100 x float]** %3
%55 = bitcast [100 x float]* %54 to float**
%56 = load i32, i32* %6
%57 = load i32, i32* %7
%58 = add nsw i32 %57, 1
%59 = load float, float* %5
%60 = call i32 @ScrivereElemento(float** %55, i32 %56, i32 %58, float %59)
br label %26
61: ; preds = %41
ret void
}

LLVM IR (-O2):
@.str.1 = [61 x i8] c"\0A\09\09Inserire le Righe e le Colonne della Matrice numero: %d \0A\00"
@.str.3 = [39 x i8] c"Per Cortesia inserire almeno una Riga \00"
@.str.4 = [3 x i8] c"%f\00"
@.str.5 = [42 x i8] c"Per Cortesia inserire almeno una Colonna \00"
@str.6 = [68 x i8] c"\09NotaBene: una matrice non pu\C3\B2 essere composta 1 riga ed 1 colonna\00"
@str.7 = [77 x i8] c"\0A===========================================================================\00"
define void @InserimentoNumeroRigheEColonne([100 x float]* %0, i32 %1) {
%3 = alloca float
%4 = bitcast float* %3 to i8*
store float 0.000000e+00, float* %3
%5 = bitcast [100 x float]* %0 to float**
%6 = tail call i32 @ScrivereElemento(float** %5, i32 0, i32 0, float 0.000000e+00)
%7 = tail call i32 @ScrivereElemento(float** %5, i32 0, i32 1, float 0.000000e+00)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str.7, i64 0, i64 0))
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str.6, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str.7, i64 0, i64 0))
%12 = call double @LetturaElemento(float** %5, i32 0, i32 0)
%13 = fcmp ugt double %12, 1.000000e+00
br i1 %13, label %28, label %14
14: ; preds = %2, %17
%15 = call double @LetturaElemento(float** %5, i32 0, i32 1)
%16 = fcmp ugt double %15, 1.000000e+00
br i1 %16, label %28, label %17
17: ; preds = %14
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %3)
%20 = load float, float* %3
%21 = call i32 @ScrivereElemento(float** %5, i32 0, i32 0, float %20)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0))
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %3)
%24 = load float, float* %3
%25 = call i32 @ScrivereElemento(float** %5, i32 0, i32 1, float %24)
%26 = call double @LetturaElemento(float** %5, i32 0, i32 0)
%27 = fcmp ugt double %26, 1.000000e+00
br i1 %27, label %28, label %14
28: ; preds = %14, %17, %2
ret void
}