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


x86 assembly (clang, -O0):
<ters_ucgen_ciz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     11b5 <ters_ucgen_ciz+0x95>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    -0x8(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jg     119b <ters_ucgen_ciz+0x7b>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116d <ters_ucgen_ciz+0x4d>
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115a <ters_ucgen_ciz+0x3a>
lea    0xe44(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ters_ucgen_ciz>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
lea    0xec0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    11c9 <ters_ucgen_ciz+0x99>
mov    $0x1,%r14d
jmp    119a <ters_ucgen_ciz+0x6a>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r14),%ecx
mov    0xc(%rsp),%eax
cmp    %eax,%r14d
mov    %ecx,%r14d
jge    11c9 <ters_ucgen_ciz+0x99>
mov    $0x1,%ebp
sub    %r14d,%ebp
add    %ebp,%eax
test   %eax,%eax
jle    1180 <ters_ucgen_ciz+0x50>
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%eax
add    %ebp,%eax
add    $0x1,%ebx
cmp    %eax,%ebx
jl     11b0 <ters_ucgen_ciz+0x80>
jmp    1180 <ters_ucgen_ciz+0x50>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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