#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*/ scanf(char *, int *);
int main(void) {
  int side = 0;
  int flag = 1;
  unsigned int internalCounter = 1;
  unsigned int externalCounter = 1;
  printf("%s", "Enter the square's side(1-20): ");
  scanf("%d", &side);
  while (flag != -1) {
    if (side >= 1) {
      if (side <= 20) {
        while (externalCounter <= side) {
          while (internalCounter <= side) {
            printf("%s", "*");
            internalCounter++;
          }
          printf("\n");
          externalCounter++;
          internalCounter = 1;
        }
        flag = -1;
      } else {
        printf("%s\n", "You have enter a side that is out of bounds!!! Please "
                       "re-enter!!!!");
        printf("%s", "Enter the square's side(1-20): ");
        scanf("%d", &side);
        flag = 1;
      }
    } else {
      printf(
          "%s\n",
          "You have enter a side that is out of bounds!!! Please re-enter!!!!");
      printf("%s", "Enter the square's side(1-20): ");
      scanf("%d", &side);
      flag = 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   $0x1,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
lea    0xeae(%rip),%rdi
lea    0xeaa(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0xffffffff,-0xc(%rbp)
je     128e <main+0x16e>
cmpl   $0x1,-0x8(%rbp)
jl     1248 <main+0x128>
cmpl   $0x14,-0x8(%rbp)
jg     1202 <main+0xe2>
jmp    1193 <main+0x73>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
ja     11f6 <main+0xd6>
jmp    11a4 <main+0x84>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
ja     11d3 <main+0xb3>
lea    0xe49(%rip),%rdi
lea    0xe68(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11a4 <main+0x84>
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movl   $0x1,-0x10(%rbp)
jmp    1193 <main+0x73>
movl   $0xffffffff,-0xc(%rbp)
jmp    1243 <main+0x123>
lea    0xe1f(%rip),%rdi
lea    0xe1c(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xde2(%rip),%rdi
lea    0xdde(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdf0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0xc(%rbp)
jmp    1289 <main+0x169>
lea    0xdd9(%rip),%rdi
lea    0xdd6(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd9c(%rip),%rdi
lea    0xd98(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0xc(%rbp)
jmp    1170 <main+0x50>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xea6(%rip),%rdi
lea    0xea2(%rip),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
lea    -0x1(%rax),%ecx
cmp    $0x14,%ecx
jb     11dc <main+0x9c>
lea    0xe9a(%rip),%r14
lea    0xe6d(%rip),%r15
lea    0xe69(%rip),%r12
lea    0xe82(%rip),%r13
lea    0x4(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
lea    -0x1(%rax),%ecx
cmp    $0x14,%ecx
jae    11b0 <main+0x70>
test   %eax,%eax
je     1225 <main+0xe5>
mov    $0x1,%eax
mov    $0x1,%ebx
jmp    1205 <main+0xc5>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
mov    0x4(%rsp),%eax
cmp    %eax,%ebx
ja     1225 <main+0xe5>
test   %eax,%eax
je     11f0 <main+0xb0>
mov    $0x1,%ebp
xchg   %ax,%ax
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    0x4(%rsp),%ebp
jbe    1210 <main+0xd0>
jmp    11f0 <main+0xb0>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [32 x i8] c"Enter the square's side(1-20): \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [2 x i8] c"*\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [4 x i8] c"%s\0A\00"
@.str.6 = [67 x i8] c"You have enter a side that is out of bounds!!! Please re-enter!!!!\00"
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 1, i32* %3
store i32 1, i32* %4
store i32 1, i32* %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
br label %8
8: ; preds = %45, %0
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, -1
br i1 %10, label %11, label %46
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sge i32 %12, 1
br i1 %13, label %14, label %41
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp sle i32 %15, 20
br i1 %16, label %17, label %36
17: ; preds = %14
br label %18
18: ; preds = %31, %17
%19 = load i32, i32* %5
%20 = load i32, i32* %2
%21 = icmp ule i32 %19, %20
br i1 %21, label %22, label %35
22: ; preds = %18
br label %23
23: ; preds = %27, %22
%24 = load i32, i32* %4
%25 = load i32, i32* %2
%26 = icmp ule i32 %24, %25
br i1 %26, label %27, label %31
27: ; preds = %23
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%29 = load i32, i32* %4
%30 = add i32 %29, 1
store i32 %30, i32* %4
br label %23
31: ; preds = %23
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%33 = load i32, i32* %5
%34 = add i32 %33, 1
store i32 %34, i32* %5
store i32 1, i32* %4
br label %18
35: ; preds = %18
store i32 -1, i32* %3
br label %40
36: ; preds = %14
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.6, i64 0, i64 0))
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%39 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
store i32 1, i32* %3
br label %40
40: ; preds = %36, %35
br label %45
41: ; preds = %11
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.6, i64 0, i64 0))
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%44 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
store i32 1, i32* %3
br label %45
45: ; preds = %41, %40
br label %8
46: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [32 x i8] c"Enter the square's side(1-20): \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.6 = [67 x i8] c"You have enter a side that is out of bounds!!! Please re-enter!!!!\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = add i32 %5, -1
%7 = icmp ult i32 %6, 20
br i1 %7, label %8, label %26
8: ; preds = %26, %0
%9 = phi i32 [ %5, %0 ], [ %30, %26 ]
%10 = icmp eq i32 %9, 0
br i1 %10, label %33, label %11
11: ; preds = %8, %21
%12 = phi i32 [ %24, %21 ], [ 1, %8 ]
%13 = phi i32 [ %23, %21 ], [ 1, %8 ]
%14 = icmp eq i32 %12, 0
br i1 %14, label %21, label %15
15: ; preds = %11, %15
%16 = phi i32 [ %18, %15 ], [ 1, %11 ]
%17 = call i32 @putchar(i32 42)
%18 = add i32 %16, 1
%19 = load i32, i32* %1
%20 = icmp ugt i32 %18, %19
br i1 %20, label %21, label %15
21: ; preds = %15, %11
%22 = call i32 @putchar(i32 10)
%23 = add i32 %13, 1
%24 = load i32, i32* %1
%25 = icmp ugt i32 %23, %24
br i1 %25, label %33, label %11
26: ; preds = %0, %26
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @.str.6, i64 0, i64 0))
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%30 = load i32, i32* %1
%31 = add i32 %30, -1
%32 = icmp ult i32 %31, 20
br i1 %32, label %8, label %26
33: ; preds = %21, %8
ret i32 0
}