#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 *);
void kare_ciz(int x) {
  int i, j;
  printf("Taban sayisini giriniz: ");
  scanf("%d", &x);
  printf("\n");
  for (i = 1; i <= x; i++) {
    for (j = 1; j <= x; j++) {
      printf("*");
    }
    printf("\n");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<kare_ciz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     11ad <kare_ciz+0x8d>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1193 <kare_ciz+0x73>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116d <kare_ciz+0x4d>
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115a <kare_ciz+0x3a>
lea    0xe68(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kare_ciz>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,0x4(%rsp)
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
lea    0xecf(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    11a5 <kare_ciz+0x75>
mov    $0x1,%ebx
jmp    1187 <kare_ciz+0x57>
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbx),%ecx
mov    0x4(%rsp),%eax
cmp    %eax,%ebx
mov    %ecx,%ebx
jge    11a5 <kare_ciz+0x75>
test   %eax,%eax
jle    1170 <kare_ciz+0x40>
xor    %ebp,%ebp
nopl   (%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    0x4(%rsp),%ebp
jl     1190 <kare_ciz+0x60>
jmp    1170 <kare_ciz+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Taban sayisini giriniz: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [2 x i8] c"*\00"
define void @kare_ciz(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
br label %8
8: ; preds = %24, %1
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %27
12: ; preds = %8
store i32 1, i32* %4
br label %13
13: ; preds = %19, %12
%14 = load i32, i32* %4
%15 = load i32, i32* %2
%16 = icmp sle i32 %14, %15
br i1 %16, label %17, label %22
17: ; preds = %13
%18 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %19
19: ; preds = %17
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %13
22: ; preds = %13
%23 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %24
24: ; preds = %22
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
br label %8
27: ; preds = %8
%28 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Taban sayisini giriniz: \00"
@.str.1 = [3 x i8] c"%d\00"
define void @kare_ciz(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = call i32 @putchar(i32 10)
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 1
br i1 %7, label %23, label %8
8: ; preds = %1, %18
%9 = phi i32 [ %21, %18 ], [ %6, %1 ]
%10 = phi i32 [ %20, %18 ], [ 1, %1 ]
%11 = icmp slt i32 %9, 1
br i1 %11, label %18, label %12
12: ; preds = %8, %12
%13 = phi i32 [ %15, %12 ], [ 1, %8 ]
%14 = call i32 @putchar(i32 42)
%15 = add nuw nsw i32 %13, 1
%16 = load i32, i32* %2
%17 = icmp slt i32 %13, %16
br i1 %17, label %12, label %18
18: ; preds = %12, %8
%19 = call i32 @putchar(i32 10)
%20 = add nuw nsw i32 %10, 1
%21 = load i32, i32* %2
%22 = icmp slt i32 %10, %21
br i1 %22, label %8, label %23
23: ; preds = %18, %1
%24 = call i32 @putchar(i32 10)
ret void
}