#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, x, y;
  scanf("%d", &n);
  for (y = 1; y <= n; y++, printf("\n"))
    for (x = 0; x < y; x++, printf("*"))
      ;
  for (y = n; y >= 1; y--, printf("\n"))
    for (x = 1; x < y; x++, printf("*"))
      ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11a3 <main+0x83>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1184 <main+0x64>
jmp    116a <main+0x4a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
jmp    1159 <main+0x39>
jmp    1189 <main+0x69>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
lea    0xe6c(%rip),%rdi
call   1030 <printf@plt>
jmp    1146 <main+0x26>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jl     1204 <main+0xe4>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11e5 <main+0xc5>
jmp    11cb <main+0xab>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
jmp    11ba <main+0x9a>
jmp    11ea <main+0xca>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
lea    0xe0b(%rip),%rdi
call   1030 <printf@plt>
jmp    11a9 <main+0x89>
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    11d1 <main+0xb1>
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>
lea    0x1(%r14),%ebp
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%ebx
cmp    %ebx,%r14d
mov    %ebp,%r14d
jl     1150 <main+0x30>
test   %ebx,%ebx
jle    11d1 <main+0xb1>
nopl   (%rax)
cmp    $0x2,%ebx
jb     11c7 <main+0xa7>
mov    $0x1,%ebp
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebp
mov    $0x2a,%edi
call   1030 <putchar@plt>
cmp    %ebp,%ebx
jne    11a0 <main+0x80>
lea    -0x1(%rbx),%ebp
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x1,%ebx
mov    %ebp,%ebx
ja     1190 <main+0x70>
jmp    11d1 <main+0xb1>
mov    $0xa,%edi
call   1030 <putchar@plt>
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* %2)
store i32 1, i32* %4
br label %6
6: ; preds = %21, %0
%7 = load i32, i32* %4
%8 = load i32, i32* %2
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %25
10: ; preds = %6
store i32 0, i32* %3
br label %11
11: ; preds = %16, %10
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %20
15: ; preds = %11
br label %16
16: ; preds = %15
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
%19 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %11
20: ; preds = %11
br label %21
21: ; preds = %20
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
%24 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %6
25: ; preds = %6
%26 = load i32, i32* %2
store i32 %26, i32* %4
br label %27
27: ; preds = %41, %25
%28 = load i32, i32* %4
%29 = icmp sge i32 %28, 1
br i1 %29, label %30, label %45
30: ; preds = %27
store i32 1, i32* %3
br label %31
31: ; preds = %36, %30
%32 = load i32, i32* %3
%33 = load i32, i32* %4
%34 = icmp slt i32 %32, %33
br i1 %34, label %35, label %40
35: ; preds = %31
br label %36
36: ; preds = %35
%37 = load i32, i32* %3
%38 = add nsw i32 %37, 1
store i32 %38, i32* %3
%39 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %31
40: ; preds = %31
br label %41
41: ; preds = %40
%42 = load i32, i32* %4
%43 = add nsw i32 %42, -1
store i32 %43, i32* %4
%44 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %27
45: ; preds = %27
%46 = load i32, i32* %1
ret i32 %46
}

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