#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() {
  int sayi, m;
  printf("Sayi giriniz = ");
  scanf("%d", &sayi);
  int i;
  for (i = 1; i <= sayi; i++) {
    for (m = 1; m <= i; m++) {
      printf("*");
    }
    printf("\n");
  }
  for (int c = sayi; c > 1; c--) {
    for (int k = sayi; k > 1; k--) {
      printf("*");
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11a5 <main+0x85>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     118b <main+0x6b>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1165 <main+0x45>
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1152 <main+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jle    11f9 <main+0xd9>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x1,-0x18(%rbp)
jle    11df <main+0xbf>
lea    0xe47(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    11bb <main+0x9b>
lea    0xe2f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    11ab <main+0x8b>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    11ef <main+0xbf>
mov    $0x1,%ebp
mov    %ebp,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1170 <main+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbp),%eax
mov    0x4(%rsp),%ebx
cmp    %ebx,%ebp
mov    %eax,%ebp
jl     1160 <main+0x30>
cmp    $0x2,%ebx
jl     11ef <main+0xbf>
mov    %ebx,%ebp
cmp    $0x2,%ebx
jl     11d2 <main+0xa2>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x2,%ebx
ja     11c0 <main+0x90>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x3,%ebp
jl     11ef <main+0xbf>
add    $0xffffffff,%ebp
mov    0x4(%rsp),%ebx
cmp    $0x2,%ebx
jge    11b0 <main+0x80>
jmp    11d2 <main+0xa2>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Sayi giriniz = \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c"*\00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
store i32 1, i32* %4
br label %9
9: ; preds = %25, %0
%10 = load i32, i32* %4
%11 = load i32, i32* %2
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %28
13: ; preds = %9
store i32 1, i32* %3
br label %14
14: ; preds = %20, %13
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = icmp sle i32 %15, %16
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %20
20: ; preds = %18
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %14
23: ; preds = %14
%24 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %25
25: ; preds = %23
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %9
28: ; preds = %9
%29 = load i32, i32* %2
store i32 %29, i32* %5
br label %30
30: ; preds = %45, %28
%31 = load i32, i32* %5
%32 = icmp sgt i32 %31, 1
br i1 %32, label %33, label %48
33: ; preds = %30
%34 = load i32, i32* %2
store i32 %34, i32* %6
br label %35
35: ; preds = %40, %33
%36 = load i32, i32* %6
%37 = icmp sgt i32 %36, 1
br i1 %37, label %38, label %43
38: ; preds = %35
%39 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %40
40: ; preds = %38
%41 = load i32, i32* %6
%42 = add nsw i32 %41, -1
store i32 %42, i32* %6
br label %35
43: ; preds = %35
%44 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %45
45: ; preds = %43
%46 = load i32, i32* %5
%47 = add nsw i32 %46, -1
store i32 %47, i32* %5
br label %30
48: ; preds = %30
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Sayi giriniz = \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 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* %1)
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 1
br i1 %6, label %23, label %7
7: ; preds = %0, %17
%8 = phi i32 [ %22, %17 ], [ 2, %0 ]
%9 = phi i32 [ %19, %17 ], [ 1, %0 ]
br label %12
10: ; preds = %17
%11 = icmp sgt i32 %20, 1
br i1 %11, label %24, label %23
12: ; preds = %7, %12
%13 = phi i32 [ 1, %7 ], [ %15, %12 ]
%14 = call i32 @putchar(i32 42)
%15 = add nuw i32 %13, 1
%16 = icmp eq i32 %15, %8
br i1 %16, label %17, label %12
17: ; preds = %12
%18 = call i32 @putchar(i32 10)
%19 = add nuw nsw i32 %9, 1
%20 = load i32, i32* %1
%21 = icmp slt i32 %9, %20
%22 = add nuw i32 %8, 1
br i1 %21, label %7, label %10
23: ; preds = %28, %0, %10
ret i32 0
24: ; preds = %10, %31
%25 = phi i32 [ %33, %31 ], [ %20, %10 ]
%26 = phi i32 [ %32, %31 ], [ %20, %10 ]
%27 = icmp sgt i32 %25, 1
br i1 %27, label %34, label %28
28: ; preds = %34, %24
%29 = call i32 @putchar(i32 10)
%30 = icmp sgt i32 %26, 2
br i1 %30, label %31, label %23
31: ; preds = %28
%32 = add nsw i32 %26, -1
%33 = load i32, i32* %1
br label %24
34: ; preds = %24, %34
%35 = phi i32 [ %37, %34 ], [ %25, %24 ]
%36 = call i32 @putchar(i32 42)
%37 = add nsw i32 %35, -1
%38 = icmp ugt i32 %35, 2
br i1 %38, label %34, label %28
}