#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 row = 0;
  int coloum = 0;
  int height = 0;
  printf("Enter the Height of the triangle:");
  scanf("%d", &height);
  for (row = 1; row < height + 1; row++) {
    for (coloum = height; coloum > 0; coloum--) {
      if (row < coloum) {
        printf(" ");
      } else {
        printf("*");
      }
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    11de <main+0xbe>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    11c4 <main+0xa4>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11a5 <main+0x85>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
jmp    11b1 <main+0x91>
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
jmp    11b6 <main+0x96>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    117e <main+0x5e>
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1167 <main+0x47>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
lea    0xecf(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebp
test   %ebp,%ebp
jle    11bc <main+0x8c>
mov    $0x1,%ebx
mov    $0x20,%r14d
jmp    1197 <main+0x67>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbx),%eax
mov    0xc(%rsp),%ebp
cmp    %ebp,%ebx
mov    %eax,%ebx
jge    11bc <main+0x8c>
test   %ebp,%ebp
jle    1180 <main+0x50>
nopl   0x0(%rax,%rax,1)
cmp    %ebp,%ebx
mov    $0x2a,%edi
cmovl  %r14d,%edi
call   1030 <putchar@plt>
lea    -0x1(%rbp),%eax
cmp    $0x1,%ebp
mov    %eax,%ebp
jg     11a0 <main+0x70>
jmp    1180 <main+0x50>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Enter the Height of the triangle:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [2 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
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%6 = 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 %7
7: ; preds = %31, %0
%8 = load i32, i32* %2
%9 = load i32, i32* %4
%10 = add nsw i32 %9, 1
%11 = icmp slt i32 %8, %10
br i1 %11, label %12, label %34
12: ; preds = %7
%13 = load i32, i32* %4
store i32 %13, i32* %3
br label %14
14: ; preds = %26, %12
%15 = load i32, i32* %3
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %29
17: ; preds = %14
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %25
23: ; preds = %17
%24 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %25
25: ; preds = %23, %21
br label %26
26: ; preds = %25
%27 = load i32, i32* %3
%28 = add nsw i32 %27, -1
store i32 %28, i32* %3
br label %14
29: ; preds = %14
%30 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %31
31: ; preds = %29
%32 = load i32, i32* %2
%33 = add nsw i32 %32, 1
store i32 %33, i32* %2
br label %7
34: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"Enter the Height of the triangle:\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 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 %23, label %7
7: ; preds = %0, %18
%8 = phi i32 [ %21, %18 ], [ %5, %0 ]
%9 = phi i32 [ %20, %18 ], [ 1, %0 ]
%10 = icmp sgt i32 %8, 0
br i1 %10, label %11, label %18
11: ; preds = %7, %11
%12 = phi i32 [ %16, %11 ], [ %8, %7 ]
%13 = icmp slt i32 %9, %12
%14 = select i1 %13, i32 32, i32 42
%15 = call i32 @putchar(i32 %14)
%16 = add nsw i32 %12, -1
%17 = icmp sgt i32 %12, 1
br i1 %17, label %11, label %18
18: ; preds = %11, %7
%19 = call i32 @putchar(i32 10)
%20 = add nuw nsw i32 %9, 1
%21 = load i32, i32* %1
%22 = icmp slt i32 %9, %21
br i1 %22, label %7, label %23
23: ; preds = %18, %0
ret i32 0
}