#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 high, i, j;
  char ch = '*';
  scanf("%d", &high);
  for (i = 0; i <= high; i++) {
    printf("\n");
    for (j = 0; j < i * 2 - 1; j++)
      printf("%c", ch);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x2a,-0x11(%rbp)
lea    0xec6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11b2 <main+0x92>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    119f <main+0x7f>
movsbl -0x11(%rbp),%esi
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    116b <main+0x4b>
jmp    11a4 <main+0x84>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114a <main+0x2a>
xor    %eax,%eax
add    $0x20,%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)
js     1191 <main+0x71>
xor    %r14d,%r14d
mov    $0xffffffff,%ebx
jmp    1161 <main+0x41>
nopw   0x0(%rax,%rax,1)
lea    0x1(%r14),%eax
add    $0x2,%ebx
cmp    0xc(%rsp),%r14d
mov    %eax,%r14d
jge    1191 <main+0x71>
cmp    $0x2,%ebx
mov    $0x1,%ebp
cmovge %ebx,%ebp
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %r14d,%r14d
je     1150 <main+0x30>
nopl   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1180 <main+0x60>
jmp    1150 <main+0x30>
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"\0A\00"
@.str.2 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 0, i32* %1
store i8 42, i8* %5
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %3
br label %7
7: ; preds = %27, %0
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %30
11: ; preds = %7
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %4
br label %13
13: ; preds = %23, %11
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = mul nsw i32 %15, 2
%17 = sub nsw i32 %16, 1
%18 = icmp slt i32 %14, %17
br i1 %18, label %19, label %26
19: ; preds = %13
%20 = load i8, i8* %5
%21 = sext i8 %20 to i32
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %21)
br label %23
23: ; preds = %19
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %13
26: ; preds = %13
br label %27
27: ; preds = %26
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %7
30: ; preds = %7
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, 0
br i1 %5, label %22, label %6
6: ; preds = %0, %17
%7 = phi i32 [ %21, %17 ], [ -1, %0 ]
%8 = phi i32 [ %18, %17 ], [ 0, %0 ]
%9 = call i32 @llvm.smax.i32(i32 %7, i32 1)
%10 = call i32 @putchar(i32 10)
%11 = icmp eq i32 %8, 0
br i1 %11, label %17, label %12
12: ; preds = %6, %12
%13 = phi i32 [ %15, %12 ], [ 0, %6 ]
%14 = call i32 @putchar(i32 42)
%15 = add nuw nsw i32 %13, 1
%16 = icmp eq i32 %15, %9
br i1 %16, label %17, label %12
17: ; preds = %12, %6
%18 = add nuw nsw i32 %8, 1
%19 = load i32, i32* %1
%20 = icmp slt i32 %8, %19
%21 = add i32 %7, 2
br i1 %20, label %6, label %22
22: ; preds = %17, %0
ret i32 0
}