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


x86 assembly (clang, -O0):
<even>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    -0x4(%rbp),%eax
ja     1188 <even+0x78>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x10(%rbp)
cmp    -0x4(%rbp),%eax
ja     116e <even+0x5e>
movsbl -0x5(%rbp),%esi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1143 <even+0x33>
lea    0xe8e(%rip),%rdi
lea    0xe8a(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1128 <even+0x18>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<even>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
je     1165 <even+0x55>
mov    %edi,%r15d
movsbl %sil,%ebp
mov    $0x2,%r14d
nopl   0x0(%rax,%rax,1)
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebx
mov    %ebp,%edi
call   1030 <putchar@plt>
cmp    %r15d,%ebx
jbe    1140 <even+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r14),%eax
cmp    %r15d,%r14d
mov    %eax,%r14d
jbe    1130 <even+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @even(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i8 %1, i8* %4
store i32 1, i32* %5
br label %7
7: ; preds = %22, %2
%8 = load i32, i32* %5
%9 = add i32 %8, 1
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = icmp ule i32 %8, %10
br i1 %11, label %12, label %24
12: ; preds = %7
store i32 1, i32* %6
br label %13
13: ; preds = %18, %12
%14 = load i32, i32* %6
%15 = add i32 %14, 1
store i32 %15, i32* %6
%16 = load i32, i32* %3
%17 = icmp ule i32 %14, %16
br i1 %17, label %18, label %22
18: ; preds = %13
%19 = load i8, i8* %4
%20 = sext i8 %19 to i32
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %20)
br label %13
22: ; preds = %13
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %7
24: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @even(i32 %0, i8 signext %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %17, label %4
4: ; preds = %2
%5 = sext i8 %1 to i32
br label %6
6: ; preds = %13, %4
%7 = phi i32 [ 2, %4 ], [ %15, %13 ]
br label %8
8: ; preds = %6, %8
%9 = phi i32 [ %10, %8 ], [ 1, %6 ]
%10 = add i32 %9, 1
%11 = tail call i32 @putchar(i32 %5)
%12 = icmp ugt i32 %10, %0
br i1 %12, label %13, label %8
13: ; preds = %8
%14 = tail call i32 @putchar(i32 10)
%15 = add i32 %7, 1
%16 = icmp ugt i32 %7, %0
br i1 %16, label %17, label %6
17: ; preds = %13, %2
ret i32 0
}