#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, c, b;
  scanf("%d", &b);
  for (a = 1; a <= b; a++) {
    for (c = 1; c <= a; c++)
      printf("*");
    printf("\n");
  }
  for (a = b - 1; a >= 1; a--) {
    for (c = a; c >= 1; c--)
      printf("*");
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1199 <main+0x79>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     117f <main+0x5f>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1159 <main+0x39>
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x26>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     11f0 <main+0xd0>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jl     11d6 <main+0xb6>
lea    0xe40(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    11b2 <main+0x92>
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    11a2 <main+0x82>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11c4 <main+0xa4>
mov    $0x1,%r14d
nopw   0x0(%rax,%rax,1)
mov    %r14d,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1160 <main+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r14),%eax
mov    0xc(%rsp),%ebx
cmp    %ebx,%r14d
mov    %eax,%r14d
jl     1150 <main+0x30>
cmp    $0x2,%ebx
jl     11c4 <main+0xa4>
xchg   %ax,%ax
lea    -0x1(%rbx),%r14d
mov    %ebx,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     11a0 <main+0x80>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x2,%ebx
mov    %r14d,%ebx
jg     1190 <main+0x70>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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