#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 i, b, h, j;
  printf("Enter the height\n");
  scanf("%d", &h);
  for (i = 1; i <= h; i++) {
    for (b = 1; b <= h - i; b++) {
      printf(" ");
    }
    for (j = 1; j <= i; j++) {
      printf("* ");
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11d7 <main+0xb7>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    -0x8(%rbp),%ecx
cmp    %ecx,%eax
jg     1190 <main+0x70>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1165 <main+0x45>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11bd <main+0x9d>
lea    0xe6b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1197 <main+0x77>
lea    0xe4c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1152 <main+0x32>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xeb7(%rip),%rdi
call   1040 <puts@plt>
lea    0xea5(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    11d4 <main+0x94>
mov    $0x1,%ebx
lea    0xe8a(%rip),%r14
nopl   0x0(%rax)
cmp    %ebx,%eax
jle    11a7 <main+0x67>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%eax
sub    %ebx,%eax
add    $0x1,%ebp
cmp    %eax,%ebp
jl     1190 <main+0x50>
mov    %ebx,%ebp
nopl   0x0(%rax)
mov    %r14,%rdi
call   1050 <printf@plt>
add    $0xffffffff,%ebp
jne    11b0 <main+0x70>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbx),%ecx
mov    0xc(%rsp),%eax
cmp    %eax,%ebx
mov    %ecx,%ebx
jl     1180 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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