#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 n = 0;
  int osn, i, k, osn2;
  printf("n = ");
  scanf("%d", &n);
  osn = (2 * n) - 1;
  osn2 = osn;
  for (k = 0; k < n; k++) {
    for (i = 0; i < osn; i++) {
      printf("*");
    }
    osn -= 2;
    printf("\n");
  }
  printf("osnovata e: %d\n", osn2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11cd <main+0xad>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11a8 <main+0x88>
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1180 <main+0x60>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0xc(%rbp)
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116d <main+0x4d>
mov    -0x18(%rbp),%esi
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xeba(%rip),%rdi
xor    %r15d,%r15d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeae(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
lea    (%rax,%rax,1),%r14d
add    $0xffffffff,%r14d
test   %eax,%eax
jle    11b3 <main+0x83>
mov    %r14d,%ebx
jmp    1198 <main+0x68>
cs nopw 0x0(%rax,%rax,1)
add    $0xfffffffe,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15d
cmp    0x4(%rsp),%r15d
jge    11b3 <main+0x83>
test   %ebx,%ebx
jle    1180 <main+0x50>
xor    %ebp,%ebp
xchg   %ax,%ax
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    11a0 <main+0x70>
jmp    1180 <main+0x50>
lea    0xe4e(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"n = \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c"*\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [16 x i8] c"osnovata e: %d\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
store i32 0, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 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
%12 = load i32, i32* %3
store i32 %12, i32* %6
store i32 0, i32* %5
br label %13
13: ; preds = %31, %0
%14 = load i32, i32* %5
%15 = load i32, i32* %2
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %34
17: ; preds = %13
store i32 0, i32* %4
br label %18
18: ; preds = %24, %17
%19 = load i32, i32* %4
%20 = load i32, i32* %3
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %27
22: ; preds = %18
%23 = call i32 (i8*, ...) @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* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %18
27: ; preds = %18
%28 = load i32, i32* %3
%29 = sub nsw i32 %28, 2
store i32 %29, i32* %3
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %31
31: ; preds = %27
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 1
store i32 %33, i32* %5
br label %13
34: ; preds = %13
%35 = load i32, i32* %6
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 %35)
ret i32 0
}

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