#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 a, b, c, i, d;
  printf("visochina: ");
  scanf("%d", &a);
  b = (2 * a) - 1;
  d = 1;
  for (a; a > 0; a--) {
    for (i = 1; i <= (a - 1); i++) {
      printf(" ");
    }
    for (c = 1; c <= d; c++) {
      printf("*");
    }
    if (d < b)
      d += 2;
    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    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
movl   $0x1,-0x18(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    11f6 <main+0xd6>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     119a <main+0x7a>
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116f <main+0x4f>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     11c7 <main+0xa7>
lea    0xe5b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11a1 <main+0x81>
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11dc <main+0xbc>
mov    -0x18(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x18(%rbp)
lea    0xe2e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    115e <main+0x3e>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    11d1 <main+0xa1>
lea    (%rax,%rax,1),%r14d
add    $0xffffffff,%r14d
mov    $0x1,%ebx
jmp    1195 <main+0x65>
nopl   0x0(%rax)
lea    0x2(%rbx),%ebp
cmp    %r14d,%ebx
cmovge %ebx,%ebp
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%ecx
lea    -0x1(%rcx),%eax
mov    %eax,0xc(%rsp)
mov    %ebp,%ebx
cmp    $0x1,%ecx
jle    11d1 <main+0xa1>
cmp    $0x2,%eax
jb     11b3 <main+0x83>
mov    $0x1,%ebp
nop
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    0xc(%rsp),%ebp
jl     11a0 <main+0x70>
mov    %ebx,%ebp
test   %ebx,%ebx
jle    1170 <main+0x40>
nopl   0x0(%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    11c0 <main+0x90>
jmp    1170 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"visochina: \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 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 ([12 x i8], [12 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)
%9 = load i32, i32* %2
%10 = mul nsw i32 2, %9
%11 = sub nsw i32 %10, 1
store i32 %11, i32* %3
store i32 1, i32* %6
%12 = load i32, i32* %2
br label %13
13: ; preds = %46, %0
%14 = load i32, i32* %2
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %49
16: ; preds = %13
store i32 1, i32* %5
br label %17
17: ; preds = %24, %16
%18 = load i32, i32* %5
%19 = load i32, i32* %2
%20 = sub nsw i32 %19, 1
%21 = icmp sle i32 %18, %20
br i1 %21, label %22, label %27
22: ; preds = %17
%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* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %17
27: ; preds = %17
store i32 1, i32* %4
br label %28
28: ; preds = %34, %27
%29 = load i32, i32* %4
%30 = load i32, i32* %6
%31 = icmp sle i32 %29, %30
br i1 %31, label %32, label %37
32: ; preds = %28
%33 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %34
34: ; preds = %32
%35 = load i32, i32* %4
%36 = add nsw i32 %35, 1
store i32 %36, i32* %4
br label %28
37: ; preds = %28
%38 = load i32, i32* %6
%39 = load i32, i32* %3
%40 = icmp slt i32 %38, %39
br i1 %40, label %41, label %44
41: ; preds = %37
%42 = load i32, i32* %6
%43 = add nsw i32 %42, 2
store i32 %43, i32* %6
br label %44
44: ; preds = %41, %37
%45 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %46
46: ; preds = %44
%47 = load i32, i32* %2
%48 = add nsw i32 %47, -1
store i32 %48, i32* %2
br label %13
49: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"visochina: \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 ([12 x i8], [12 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 = shl nsw i32 %5, 1
%7 = add nsw i32 %6, -1
%8 = icmp sgt i32 %5, 0
br i1 %8, label %9, label %34
9: ; preds = %0, %26
%10 = phi i32 [ %32, %26 ], [ %5, %0 ]
%11 = phi i32 [ %29, %26 ], [ 1, %0 ]
%12 = icmp ugt i32 %10, 1
br i1 %12, label %15, label %13
13: ; preds = %15, %9
%14 = icmp slt i32 %11, 1
br i1 %14, label %26, label %21
15: ; preds = %9, %15
%16 = phi i32 [ %18, %15 ], [ 1, %9 ]
%17 = call i32 @putchar(i32 32)
%18 = add nuw nsw i32 %16, 1
%19 = load i32, i32* %1
%20 = icmp slt i32 %18, %19
br i1 %20, label %15, label %13
21: ; preds = %13, %21
%22 = phi i32 [ %24, %21 ], [ 1, %13 ]
%23 = call i32 @putchar(i32 42)
%24 = add nuw i32 %22, 1
%25 = icmp eq i32 %22, %11
br i1 %25, label %26, label %21
26: ; preds = %21, %13
%27 = icmp slt i32 %11, %7
%28 = add nsw i32 %11, 2
%29 = select i1 %27, i32 %28, i32 %11
%30 = call i32 @putchar(i32 10)
%31 = load i32, i32* %1
%32 = add nsw i32 %31, -1
store i32 %32, i32* %1
%33 = icmp sgt i32 %31, 1
br i1 %33, label %9, label %34
34: ; preds = %26, %0
ret i32 0
}