#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 *, ...);
void kare(int girilen_boyut, char girilen_desen) {
  int satir_sayisi = 0;
  int sutun_sayisi = 0;
  while (satir_sayisi < girilen_boyut) {
    sutun_sayisi = 0;
    while (sutun_sayisi < girilen_boyut) {
      printf("%c ", girilen_desen);
      sutun_sayisi++;
    }
    printf("\n");
    satir_sayisi++;
  }
}


x86 assembly (clang, -O0):
<kare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    118a <kare+0x7a>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    116e <kare+0x5e>
movsbl -0x5(%rbp),%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1142 <kare+0x32>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112f <kare+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kare>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %edi,%edi
jle    1174 <kare+0x54>
mov    %edi,%r14d
movsbl %sil,%ebp
lea    0xec6(%rip),%r12
xor    %r15d,%r15d
nopl   (%rax)
mov    %r14d,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r12,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebx
jne    1150 <kare+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15d
cmp    %r14d,%r15d
jne    1140 <kare+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%c \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @kare(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 0, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %22, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %26
11: ; preds = %7
store i32 0, i32* %6
br label %12
12: ; preds = %16, %11
%13 = load i32, i32* %6
%14 = load i32, i32* %3
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %22
16: ; preds = %12
%17 = load i8, i8* %4
%18 = sext i8 %17 to i32
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %18)
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %12
22: ; preds = %12
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %7
26: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%c \00"
define void @kare(i32 %0, i8 signext %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %17
4: ; preds = %2
%5 = sext i8 %1 to i32
br label %6
6: ; preds = %13, %4
%7 = phi i32 [ 0, %4 ], [ %15, %13 ]
br label %8
8: ; preds = %6, %8
%9 = phi i32 [ %11, %8 ], [ 0, %6 ]
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%11 = add nuw nsw i32 %9, 1
%12 = icmp eq i32 %11, %0
br i1 %12, label %13, label %8
13: ; preds = %8
%14 = tail call i32 @putchar(i32 10)
%15 = add nuw nsw i32 %7, 1
%16 = icmp eq i32 %15, %0
br i1 %16, label %17, label %6
17: ; preds = %13, %2
ret void
}