#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 main(void) {
  int i = 1, s = 1, h, k = 0;
  printf("vuvedi viso4ina:");
  scanf("%d", &h);
  for (; h > 0; h--) {
    for (; s <= h - 1; s++) {
      printf(" ");
    }
    s = 1;
    while (k != 2 * i - 1) {
      printf("*");
      k++;
    }
    k = 0;
    i++;
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0xc(%rbp)
jle    11f2 <main+0xd2>
jmp    1168 <main+0x48>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1193 <main+0x73>
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1168 <main+0x48>
movl   $0x1,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     11c8 <main+0xa8>
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    119a <main+0x7a>
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
lea    0xe39(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1159 <main+0x39>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    11bc <main+0x8c>
mov    $0x1,%ebx
nopl   (%rax)
mov    %ebx,%ebp
cmp    $0x2,%eax
jb     1190 <main+0x60>
mov    $0x1,%ebp
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    0x4(%rsp),%ebp
jl     1170 <main+0x40>
mov    %ebx,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1190 <main+0x60>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%ecx
lea    -0x1(%rcx),%eax
mov    %eax,0x4(%rsp)
add    $0x2,%ebx
cmp    $0x1,%ecx
jg     1160 <main+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"vuvedi viso4ina:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [2 x i8] c"*\00"
@.str.4 = [2 x i8] c"\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 1, i32* %1
store i32 1, i32* %2
store i32 0, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 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* %3)
br label %7
7: ; preds = %36, %0
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %39
10: ; preds = %7
br label %11
11: ; preds = %18, %10
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 1
%15 = icmp sle i32 %12, %14
br i1 %15, label %16, label %21
16: ; preds = %11
%17 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %18
18: ; preds = %16
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %11
21: ; preds = %11
store i32 1, i32* %2
br label %22
22: ; preds = %28, %21
%23 = load i32, i32* %4
%24 = load i32, i32* %1
%25 = mul nsw i32 2, %24
%26 = sub nsw i32 %25, 1
%27 = icmp ne i32 %23, %26
br i1 %27, label %28, label %32
28: ; preds = %22
%29 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%30 = load i32, i32* %4
%31 = add nsw i32 %30, 1
store i32 %31, i32* %4
br label %22
32: ; preds = %22
store i32 0, i32* %4
%33 = load i32, i32* %1
%34 = add nsw i32 %33, 1
store i32 %34, i32* %1
%35 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %36
36: ; preds = %32
%37 = load i32, i32* %3
%38 = add nsw i32 %37, -1
store i32 %38, i32* %3
br label %7
39: ; preds = %7
ret void
}

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