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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x14(%rbp)
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb1(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf_s@plt>
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11d9 <main+0xa9>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    11b3 <main+0x83>
lea    0xe6f(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1188 <main+0x58>
lea    0xe57(%rip),%rdi
call   1040 <printf@plt>
lea    0xe47(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1175 <main+0x45>
lea    0xe2d(%rip),%rdi
call   1040 <printf@plt>
lea    0xe27(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%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    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0xc(%rsp)
jle    11c1 <main+0x81>
xor    %r14d,%r14d
mov    $0x1,%ebx
xchg   %ax,%ax
mov    %ebx,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1190 <main+0x50>
add    $0x1,%r14d
mov    $0x3e,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    0xc(%rsp),%r14d
jl     1180 <main+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe3b(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
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"\0A\00"
@.str.3 = [2 x i8] c"-\00"
@.str.4 = [2 x i8] c">\00"
@.str.5 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %5
%6 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %2
br label %9
9: ; preds = %27, %0
%10 = load i32, i32* %2
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %30
13: ; preds = %9
store i32 0, i32* %3
br label %14
14: ; preds = %21, %13
%15 = load i32, i32* %3
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
%18 = icmp slt i32 %15, %17
br i1 %18, label %19, label %24
19: ; preds = %14
%20 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, 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 %14
24: ; preds = %14
%25 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%26 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %27
27: ; preds = %24
%28 = load i32, i32* %2
%29 = add nsw i32 %28, 1
store i32 %29, i32* %2
br label %9
30: ; preds = %9
%31 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%32 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%33 = load i32, i32* %1
ret i32 %33
}

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