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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb8(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf_s@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11c6 <main+0x96>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    -0x8(%rbp),%ecx
cmp    %ecx,%eax
jge    11a0 <main+0x70>
lea    0xe80(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1175 <main+0x45>
lea    0xe68(%rip),%rdi
call   1040 <printf@plt>
lea    0xe5e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1162 <main+0x32>
lea    0xe46(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xeb6(%rip),%rdi
call   1050 <printf@plt>
lea    0xeb4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf_s@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    11b9 <main+0x79>
xor    %ebx,%ebx
jmp    118f <main+0x4f>
nopl   0x0(%rax)
mov    $0x3e,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
mov    0x4(%rsp),%eax
cmp    %eax,%ebx
jge    11b9 <main+0x79>
cmp    %ebx,%eax
jle    1170 <main+0x30>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
mov    0x4(%rsp),%eax
sub    %ebx,%eax
cmp    %eax,%ebp
jl     11a0 <main+0x60>
jmp    1170 <main+0x30>
lea    0xe4d(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
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 i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
store i32 0, i32* %2
br label %7
7: ; preds = %26, %0
%8 = load i32, i32* %2
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %29
11: ; preds = %7
store i32 0, i32* %3
br label %12
12: ; preds = %20, %11
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = load i32, i32* %2
%16 = sub nsw i32 %14, %15
%17 = icmp slt i32 %13, %16
br i1 %17, label %18, label %23
18: ; preds = %12
%19 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %20
20: ; preds = %18
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %12
23: ; preds = %12
%24 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%25 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %26
26: ; preds = %23
%27 = load i32, i32* %2
%28 = add nsw i32 %27, 1
store i32 %28, i32* %2
br label %7
29: ; preds = %7
%30 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%31 = load i32, i32* %1
ret i32 %31
}

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 i32 @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 %24
7: ; preds = %0, %18
%8 = phi i32 [ %22, %18 ], [ %5, %0 ]
%9 = phi i32 [ %21, %18 ], [ 0, %0 ]
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %18
11: ; preds = %7, %11
%12 = phi i32 [ %14, %11 ], [ 0, %7 ]
%13 = call i32 @putchar(i32 45)
%14 = add nuw nsw i32 %12, 1
%15 = load i32, i32* %1
%16 = sub nsw i32 %15, %9
%17 = icmp slt i32 %14, %16
br i1 %17, label %11, label %18
18: ; preds = %11, %7
%19 = call i32 @putchar(i32 62)
%20 = call i32 @putchar(i32 10)
%21 = add nuw nsw i32 %9, 1
%22 = load i32, i32* %1
%23 = icmp slt i32 %21, %22
br i1 %23, label %7, label %24
24: ; preds = %18, %0
%25 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}