#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 x, y, n;
  scanf("%d", &n);
  for (y = n; y >= 1; y--, printf("\n"))
    for (x = 0; x < y; x++, printf("*"))
      ;
  for (y = 1; y <= n; y++, printf("\n"))
    for (x = 0; 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    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jl     11a0 <main+0x80>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1181 <main+0x61>
jmp    1167 <main+0x47>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
jmp    1156 <main+0x36>
jmp    1186 <main+0x66>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
jmp    1145 <main+0x25>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1204 <main+0xe4>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11e5 <main+0xc5>
jmp    11cb <main+0xab>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
jmp    11ba <main+0x9a>
jmp    11ea <main+0xca>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    0xe0b(%rip),%rdi
call   1030 <printf@plt>
jmp    11a7 <main+0x87>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xed6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
test   %ebx,%ebx
jle    11b4 <main+0x94>
nopl   0x0(%rax)
mov    %ebx,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1150 <main+0x30>
lea    -0x1(%rbx),%ebp
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x1,%ebx
mov    %ebp,%ebx
jg     1140 <main+0x20>
cmpl   $0x0,0x4(%rsp)
jle    11b4 <main+0x94>
mov    $0x1,%ebx
nop
mov    %ebx,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1190 <main+0x70>
lea    0x1(%rbx),%ebp
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    0x4(%rsp),%ebx
mov    %ebp,%ebx
jl     1180 <main+0x60>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
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)
%6 = load i32, i32* %4
store i32 %6, i32* %3
br label %7
7: ; preds = %21, %0
%8 = load i32, i32* %3
%9 = icmp sge i32 %8, 1
br i1 %9, label %10, label %25
10: ; preds = %7
store i32 0, i32* %2
br label %11
11: ; preds = %16, %10
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%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* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
%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* %3
%23 = add nsw i32 %22, -1
store i32 %23, i32* %3
%24 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %7
25: ; preds = %7
store i32 1, i32* %3
br label %26
26: ; preds = %41, %25
%27 = load i32, i32* %3
%28 = load i32, i32* %4
%29 = icmp sle i32 %27, %28
br i1 %29, label %30, label %45
30: ; preds = %26
store i32 0, i32* %2
br label %31
31: ; preds = %36, %30
%32 = load i32, i32* %2
%33 = load i32, i32* %3
%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* %2
%38 = add nsw i32 %37, 1
store i32 %38, i32* %2
%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* %3
%43 = add nsw i32 %42, 1
store i32 %43, i32* %3
%44 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %26
45: ; preds = %26
%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 sgt i32 %4, 0
br i1 %5, label %6, label %32
6: ; preds = %0, %16
%7 = phi i32 [ %17, %16 ], [ %4, %0 ]
br label %11
8: ; preds = %16
%9 = load i32, i32* %1
%10 = icmp slt i32 %9, 1
br i1 %10, label %32, label %20
11: ; preds = %6, %11
%12 = phi i32 [ %13, %11 ], [ 0, %6 ]
%13 = add nuw nsw i32 %12, 1
%14 = call i32 @putchar(i32 42)
%15 = icmp eq i32 %13, %7
br i1 %15, label %16, label %11
16: ; preds = %11
%17 = add nsw i32 %7, -1
%18 = call i32 @putchar(i32 10)
%19 = icmp sgt i32 %7, 1
br i1 %19, label %6, label %8
20: ; preds = %8, %27
%21 = phi i32 [ %28, %27 ], [ 1, %8 ]
br label %22
22: ; preds = %20, %22
%23 = phi i32 [ 0, %20 ], [ %24, %22 ]
%24 = add nuw nsw i32 %23, 1
%25 = call i32 @putchar(i32 42)
%26 = icmp eq i32 %24, %21
br i1 %26, label %27, label %22
27: ; preds = %22
%28 = add nuw nsw i32 %21, 1
%29 = call i32 @putchar(i32 10)
%30 = load i32, i32* %1
%31 = icmp slt i32 %21, %30
br i1 %31, label %20, label %32
32: ; preds = %27, %0, %8
ret i32 0
}