#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(void) {
  int j, n = 1, number;
  scanf("%d", &number);
  for (; n <= number; n++) {
    for (j = 1; j <= n; j++) {
      printf("*");
    }
    printf("\n");
  }
  for (n = number; n >= 1; n--) {
    for (j = 1; j <= n; j++)
      printf("*");
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1199 <main+0x79>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     117f <main+0x5f>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1159 <main+0x39>
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <main+0x26>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jl     11f0 <main+0xd0>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11d6 <main+0xb6>
lea    0xe40(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11b0 <main+0x90>
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    119f <main+0x7f>
xor    %eax,%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    11c3 <main+0xa3>
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>
test   %ebx,%ebx
jle    11c3 <main+0xa3>
nopl   (%rax)
mov    %ebx,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    11a0 <main+0x80>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    -0x1(%rbx),%eax
cmp    $0x1,%ebx
mov    %eax,%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
store i32 1, i32* %3
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
br label %6
6: ; preds = %22, %0
%7 = load i32, i32* %3
%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* %2
br label %11
11: ; preds = %17, %10
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%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* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
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* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %6
25: ; preds = %6
%26 = load i32, i32* %4
store i32 %26, i32* %3
br label %27
27: ; preds = %42, %25
%28 = load i32, i32* %3
%29 = icmp sge i32 %28, 1
br i1 %29, label %30, label %45
30: ; preds = %27
store i32 1, i32* %2
br label %31
31: ; preds = %37, %30
%32 = load i32, i32* %2
%33 = load i32, i32* %3
%34 = icmp sle i32 %32, %33
br i1 %34, label %35, label %40
35: ; preds = %31
%36 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %37
37: ; preds = %35
%38 = load i32, i32* %2
%39 = add nsw i32 %38, 1
store i32 %39, i32* %2
br label %31
40: ; preds = %31
%41 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %42
42: ; preds = %40
%43 = load i32, i32* %3
%44 = add nsw i32 %43, -1
store i32 %44, i32* %3
br label %27
45: ; preds = %27
ret i32 0
}

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