#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 *, char *);
int even(int side) {
  unsigned int contatoreRighe;
  unsigned int contatoreColonne;
  contatoreRighe = 1;
  while (contatoreRighe++ <= side) {
    contatoreColonne = 1;
    while (contatoreColonne++ <= side) {
      printf("%s", "*");
    }
    printf("%s", "\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<even>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    -0x4(%rbp),%eax
ja     1181 <even+0x71>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    -0x4(%rbp),%eax
ja     1169 <even+0x59>
lea    0xea8(%rip),%rdi
lea    0xea4(%rip),%rsi
call   1030 <printf@plt>
jmp    113d <even+0x2d>
lea    0xe90(%rip),%rdi
lea    0xe8e(%rip),%rsi
call   1030 <printf@plt>
jmp    1122 <even+0x12>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<even>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
je     1179 <even+0x69>
mov    %edi,%ebx
mov    $0x2,%r13d
lea    0xed2(%rip),%r14
lea    0xece(%rip),%r15
lea    0xec9(%rip),%r12
nopl   0x0(%rax)
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebp
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
cmp    %ebx,%ebp
jbe    1150 <even+0x40>
mov    %r14,%rdi
mov    %r12,%rsi
call   1030 <printf@plt>
lea    0x1(%r13),%eax
cmp    %ebx,%r13d
mov    %eax,%r13d
jbe    1140 <even+0x30>
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 = [2 x i8] c"*\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @even(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %5
5: ; preds = %18, %1
%6 = load i32, i32* %3
%7 = add i32 %6, 1
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = icmp ule i32 %6, %8
br i1 %9, label %10, label %20
10: ; preds = %5
store i32 1, i32* %4
br label %11
11: ; preds = %16, %10
%12 = load i32, i32* %4
%13 = add i32 %12, 1
store i32 %13, i32* %4
%14 = load i32, i32* %2
%15 = icmp ule i32 %12, %14
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = call i32 @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.1, i64 0, i64 0))
br label %11
18: ; preds = %11
%19 = call i32 @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.2, i64 0, i64 0))
br label %5
20: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [2 x i8] c"*\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @even(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1, %10
%4 = phi i32 [ %12, %10 ], [ 2, %1 ]
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ %7, %5 ], [ 1, %3 ]
%7 = add i32 %6, 1
%8 = tail call i32 @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.1, i64 0, i64 0))
%9 = icmp ugt i32 %7, %0
br i1 %9, label %10, label %5
10: ; preds = %5
%11 = tail call i32 @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.2, i64 0, i64 0))
%12 = add i32 %4, 1
%13 = icmp ugt i32 %4, %0
br i1 %13, label %14, label %3
14: ; preds = %10, %1
ret i32 0
}