#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*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, unsigned int *);
int main(void) {
  unsigned int lato = 0;
  unsigned int righe;
  unsigned int colonne;
  unsigned int valoreSentinella = 0;
  do {
    printf("Inserire il lato del quadrtato: ");
    scanf("%u", &lato);
    if (lato >= (unsigned int)1) {
      if (lato <= (unsigned int)20) {
        valoreSentinella = 1;
        righe = 0;
        while (righe < lato) {
          colonne = 0;
          while (colonne < lato) {
            printf("*");
            colonne++;
          }
          puts("");
          righe++;
        }
      }
    }
  } while (valoreSentinella != 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jb     11e8 <main+0xb8>
cmpl   $0x14,-0x8(%rbp)
ja     11e3 <main+0xb3>
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    11de <main+0xae>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    11c4 <main+0x94>
lea    0xe73(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    119e <main+0x6e>
lea    0xe55(%rip),%rdi
call   1030 <puts@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    118b <main+0x5b>
jmp    11e3 <main+0xb3>
jmp    11e8 <main+0xb8>
jmp    11ed <main+0xbd>
cmpl   $0x1,-0x14(%rbp)
jne    114d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xeba(%rip),%r14
lea    0xed4(%rip),%r15
lea    0x4(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x13,%eax
ja     1160 <main+0x30>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    0x4(%rsp),%ebp
jb     11a0 <main+0x70>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    0x4(%rsp),%ebx
jb     1190 <main+0x60>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Inserire il lato del quadrtato: \00"
@.str.1 = [3 x i8] c"%u\00"
@.str.2 = [2 x i8] c"*\00"
@.str.3 = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %5
br label %6
6: ; preds = %35, %0
%7 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = icmp uge i32 %9, 1
br i1 %10, label %11, label %34
11: ; preds = %6
%12 = load i32, i32* %2
%13 = icmp ule i32 %12, 20
br i1 %13, label %14, label %33
14: ; preds = %11
store i32 1, i32* %5
store i32 0, i32* %3
br label %15
15: ; preds = %28, %14
%16 = load i32, i32* %3
%17 = load i32, i32* %2
%18 = icmp ult i32 %16, %17
br i1 %18, label %19, label %32
19: ; preds = %15
store i32 0, i32* %4
br label %20
20: ; preds = %24, %19
%21 = load i32, i32* %4
%22 = load i32, i32* %2
%23 = icmp ult i32 %21, %22
br i1 %23, label %24, label %28
24: ; preds = %20
%25 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%26 = load i32, i32* %4
%27 = add i32 %26, 1
store i32 %27, i32* %4
br label %20
28: ; preds = %20
%29 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%30 = load i32, i32* %3
%31 = add i32 %30, 1
store i32 %31, i32* %3
br label %15
32: ; preds = %15
br label %33
33: ; preds = %32, %11
br label %34
34: ; preds = %33, %6
br label %35
35: ; preds = %34
%36 = load i32, i32* %5
%37 = icmp ne i32 %36, 1
br i1 %37, label %6, label %38
38: ; preds = %35
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Inserire il lato del quadrtato: \00"
@.str.1 = [3 x i8] c"%u\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
br label %3
3: ; preds = %3, %0
%4 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = add i32 %6, -1
%8 = icmp ult i32 %7, 20
br i1 %8, label %9, label %3
9: ; preds = %3, %17
%10 = phi i32 [ %19, %17 ], [ 0, %3 ]
br label %11
11: ; preds = %9, %11
%12 = phi i32 [ %14, %11 ], [ 0, %9 ]
%13 = call i32 @putchar(i32 42)
%14 = add nuw i32 %12, 1
%15 = load i32, i32* %1
%16 = icmp ult i32 %14, %15
br i1 %16, label %11, label %17
17: ; preds = %11
%18 = call i32 @putchar(i32 10)
%19 = add nuw i32 %10, 1
%20 = load i32, i32* %1
%21 = icmp ult i32 %19, %20
br i1 %21, label %9, label %22
22: ; preds = %17
ret i32 0
}