#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_s(char *, int *);
int /*<<< orphan*/ system(char *);
void main() {
  int i, j, x;
  printf("Enter X: ");
  scanf_s("%d", &x);
  for (i = 0; i < x; i++) {
    for (j = x - i; j > 0; j--) {
      printf("-");
    }
    printf(">");
    printf("\n");
  }
  system("pause");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf_s@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11ba <main+0x8a>
mov    -0xc(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1194 <main+0x64>
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1170 <main+0x40>
lea    0xe74(%rip),%rdi
call   1040 <printf@plt>
lea    0xe6a(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    115b <main+0x2b>
lea    0xe52(%rip),%rdi
call   1030 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1050 <printf@plt>
lea    0xeaf(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf_s@plt>
mov    0xc(%rsp),%ebp
test   %ebp,%ebp
jle    11c4 <main+0x84>
xor    %ebx,%ebx
mov    $0x1,%r14d
jmp    11a3 <main+0x63>
nopw   0x0(%rax,%rax,1)
mov    $0x3e,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
mov    0xc(%rsp),%ebp
add    $0xffffffff,%r14d
cmp    %ebx,%ebp
jle    11c4 <main+0x84>
cmp    %ebx,%ebp
jle    1180 <main+0x40>
add    %r14d,%ebp
nopw   0x0(%rax,%rax,1)
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     11b0 <main+0x70>
jmp    1180 <main+0x40>
lea    0xe42(%rip),%rdi
call   1040 <system@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Enter X: \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"
@.str.5 = [6 x i8] c"pause\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
store i32 0, i32* %1
br label %6
6: ; preds = %25, %0
%7 = load i32, i32* %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %28
10: ; preds = %6
%11 = load i32, i32* %3
%12 = load i32, i32* %1
%13 = sub nsw i32 %11, %12
store i32 %13, i32* %2
br label %14
14: ; preds = %19, %10
%15 = load i32, i32* %2
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %22
17: ; preds = %14
%18 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %19
19: ; preds = %17
%20 = load i32, i32* %2
%21 = add nsw i32 %20, -1
store i32 %21, i32* %2
br label %14
22: ; preds = %14
%23 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%24 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %25
25: ; preds = %22
%26 = load i32, i32* %1
%27 = add nsw i32 %26, 1
store i32 %27, i32* %1
br label %6
28: ; preds = %6
%29 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Enter X: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.5 = [6 x i8] c"pause\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %23
7: ; preds = %0, %17
%8 = phi i32 [ %21, %17 ], [ %5, %0 ]
%9 = phi i32 [ %20, %17 ], [ 0, %0 ]
%10 = sub nsw i32 %8, %9
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %7, %12
%13 = phi i32 [ %15, %12 ], [ %10, %7 ]
%14 = call i32 @putchar(i32 45)
%15 = add nsw i32 %13, -1
%16 = icmp ugt i32 %13, 1
br i1 %16, label %12, label %17
17: ; preds = %12, %7
%18 = call i32 @putchar(i32 62)
%19 = call i32 @putchar(i32 10)
%20 = add nuw nsw i32 %9, 1
%21 = load i32, i32* %1
%22 = icmp sgt i32 %21, %20
br i1 %22, label %7, label %23
23: ; preds = %17, %0
%24 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret void
}