#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 main() {
  int n, i, p, o, t = 0, g = 1;
  char m;
  printf("\n Enter Symol to Use: \n");
  scanf("%c", &m);
  printf("\n Enter Triangle Height: \n");
  scanf("%d", &n);
  i = n;
  p = n;
  o = g;
  while (p >= 1) {
    while (i >= 1) {
      printf(" ");
      i--;
    }
    t++;
    i = n - t;
    while (g >= 1) {
      printf("%c", m);
      g--;
    }
    printf("\n");
    g = o + 2;
    o = o + 2;
    p--;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0x1d(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x10(%rbp)
jl     122e <main+0x10e>
jmp    119e <main+0x7e>
cmpl   $0x1,-0xc(%rbp)
jl     11c4 <main+0xa4>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    119e <main+0x7e>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jl     1200 <main+0xe0>
movsbl -0x1d(%rbp),%esi
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    11d6 <main+0xb6>
lea    0xe0f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    118f <main+0x6f>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xec3(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb1(%rip),%rdi
xor    %r15d,%r15d
lea    0xb(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xeb8(%rip),%rdi
call   1040 <puts@plt>
lea    0xe92(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0xc(%rsp),%r14d
test   %r14d,%r14d
jle    11ec <main+0xbc>
mov    $0x2,%r12d
mov    %r14d,%ebx
test   %ebx,%ebx
jle    11b2 <main+0x82>
add    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     11a0 <main+0x70>
mov    0xc(%rsp),%ebx
mov    %r12d,%ebp
nopl   0x0(%rax)
movsbl 0xb(%rsp),%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
jg     11c0 <main+0x90>
add    $0x1,%r15d
sub    %r15d,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x2,%r12d
cmp    %r14d,%r15d
jne    1190 <main+0x60>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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