#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*/ delay(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int i = 0;
  for (; i < 50; i++) {
    int j;
    for (j = 0; j < i; j++)
      printf("=");
    printf(">");
    for (j = 0; j < 80 - i; j++)
      printf(" ");
    if ((i + 1) % 3 == 1)
      printf("| ");
    else if ((i + 1) % 3 == 2)
      printf("/ ");
    else if ((i + 1) % 3 == 0)
      printf("\\ ");
    printf("%d%%", (i + 1) * 2);
    printf("\r");
    delay(100);
  }
  printf("\n");
  for (i = 0; i < 31; i++)
    printf(" ");
  printf("---Task Complete---");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x32,-0x8(%rbp)
jge    1273 <main+0x153>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    116f <main+0x4f>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1147 <main+0x27>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x50,%ecx
sub    -0x8(%rbp),%ecx
cmp    %ecx,%eax
jge    11b3 <main+0x93>
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1184 <main+0x64>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    11dd <main+0xbd>
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1236 <main+0x116>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x2,%edx
jne    1207 <main+0xe7>
lea    0xe0c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1231 <main+0x111>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    122c <main+0x10c>
lea    0xde5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1231 <main+0x111>
jmp    1236 <main+0x116>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
shl    $0x1,%esi
lea    0xdc7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdbe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x64,%edi
call   1040 <delay@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
lea    0xd9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x1f,-0x8(%rbp)
jge    12ae <main+0x18e>
lea    0xd6f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1288 <main+0x168>
lea    0xd61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x50,%r13d
mov    $0xaaaaaaab,%r14d
lea    0xed6(%rip),%r12
lea    0xeb4(%rip),%r15
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
test   %ebp,%ebp
je     117f <main+0x4f>
mov    %ebp,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x3d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1170 <main+0x40>
mov    $0x3e,%edi
call   1030 <putchar@plt>
mov    %r13d,%ebx
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1190 <main+0x60>
lea    0x1(%rbp),%ebx
mov    %rbx,%rax
imul   %r14,%rax
shr    $0x21,%rax
lea    (%rax,%rax,2),%eax
mov    %ebx,%ecx
sub    %eax,%ecx
movslq (%r12,%rcx,4),%rdi
add    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x2(%rbp,%rbp,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xd,%edi
call   1030 <putchar@plt>
mov    $0x64,%edi
call   1050 <delay@plt>
add    $0xffffffff,%r13d
mov    %ebx,%ebp
cmp    $0x32,%ebx
jne    1160 <main+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
lea    0xcd4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"=\00"
@.str.1 = [2 x i8] c">\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [3 x i8] c"| \00"
@.str.4 = [3 x i8] c"/ \00"
@.str.5 = [3 x i8] c"\\ \00"
@.str.6 = [5 x i8] c"%d%%\00"
@.str.7 = [2 x i8] c"\0D\00"
@.str.8 = [2 x i8] c"\0A\00"
@.str.9 = [20 x i8] c"---Task Complete---\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %59, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 50
br i1 %6, label %7, label %62
7: ; preds = %4
store i32 0, i32* %3
br label %8
8: ; preds = %14, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %8
17: ; preds = %8
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %19
19: ; preds = %26, %17
%20 = load i32, i32* %3
%21 = load i32, i32* %2
%22 = sub nsw i32 80, %21
%23 = icmp slt i32 %20, %22
br i1 %23, label %24, label %29
24: ; preds = %19
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %26
26: ; preds = %24
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
store i32 %28, i32* %3
br label %19
29: ; preds = %19
%30 = load i32, i32* %2
%31 = add nsw i32 %30, 1
%32 = srem i32 %31, 3
%33 = icmp eq i32 %32, 1
br i1 %33, label %34, label %36
34: ; preds = %29
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %52
36: ; preds = %29
%37 = load i32, i32* %2
%38 = add nsw i32 %37, 1
%39 = srem i32 %38, 3
%40 = icmp eq i32 %39, 2
br i1 %40, label %41, label %43
41: ; preds = %36
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %51
43: ; preds = %36
%44 = load i32, i32* %2
%45 = add nsw i32 %44, 1
%46 = srem i32 %45, 3
%47 = icmp eq i32 %46, 0
br i1 %47, label %48, label %50
48: ; preds = %43
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %50
50: ; preds = %48, %43
br label %51
51: ; preds = %50, %41
br label %52
52: ; preds = %51, %34
%53 = load i32, i32* %2
%54 = add nsw i32 %53, 1
%55 = mul nsw i32 %54, 2
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %55)
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%58 = call i32 @delay(i32 100)
br label %59
59: ; preds = %52
%60 = load i32, i32* %2
%61 = add nsw i32 %60, 1
store i32 %61, i32* %2
br label %4
62: ; preds = %4
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %2
br label %64
64: ; preds = %69, %62
%65 = load i32, i32* %2
%66 = icmp slt i32 %65, 31
br i1 %66, label %67, label %72
67: ; preds = %64
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %69
69: ; preds = %67
%70 = load i32, i32* %2
%71 = add nsw i32 %70, 1
store i32 %71, i32* %2
br label %64
72: ; preds = %64
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0))
%74 = load i32, i32* %1
ret i32 %74
}

LLVM IR (-O2):
@.str.3 = [3 x i8] c"| \00"
@.str.4 = [3 x i8] c"/ \00"
@.str.5 = [3 x i8] c"\\ \00"
@.str.6 = [5 x i8] c"%d%%\00"
@.str.9 = [20 x i8] c"---Task Complete---\00"
@reltable.main = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.5 to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.3 to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.4 to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
br label %1
1: ; preds = %0, %17
%2 = phi i32 [ 80, %0 ], [ %28, %17 ]
%3 = phi i32 [ 0, %0 ], [ %18, %17 ]
%4 = icmp eq i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ 0, %1 ]
%7 = tail call i32 @putchar(i32 61)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %3
br i1 %9, label %10, label %5
10: ; preds = %5, %1
%11 = tail call i32 @putchar(i32 62)
br label %12
12: ; preds = %10, %12
%13 = phi i32 [ %15, %12 ], [ 0, %10 ]
%14 = tail call i32 @putchar(i32 32)
%15 = add nuw nsw i32 %13, 1
%16 = icmp eq i32 %15, %2
br i1 %16, label %17, label %12
17: ; preds = %12
%18 = add nuw nsw i32 %3, 1
%19 = urem i32 %18, 3
%20 = zext i32 %19 to i64
%21 = shl i64 %20, 2
%22 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.main to i8*), i64 %21)
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %22)
%24 = shl nuw nsw i32 %18, 1
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %24)
%26 = tail call i32 @putchar(i32 13)
%27 = tail call i32 @delay(i32 100)
%28 = add nsw i32 %2, -1
%29 = icmp eq i32 %18, 50
br i1 %29, label %30, label %1
30: ; preds = %17
%31 = tail call i32 @putchar(i32 10)
%32 = tail call i32 @putchar(i32 32)
%33 = tail call i32 @putchar(i32 32)
%34 = tail call i32 @putchar(i32 32)
%35 = tail call i32 @putchar(i32 32)
%36 = tail call i32 @putchar(i32 32)
%37 = tail call i32 @putchar(i32 32)
%38 = tail call i32 @putchar(i32 32)
%39 = tail call i32 @putchar(i32 32)
%40 = tail call i32 @putchar(i32 32)
%41 = tail call i32 @putchar(i32 32)
%42 = tail call i32 @putchar(i32 32)
%43 = tail call i32 @putchar(i32 32)
%44 = tail call i32 @putchar(i32 32)
%45 = tail call i32 @putchar(i32 32)
%46 = tail call i32 @putchar(i32 32)
%47 = tail call i32 @putchar(i32 32)
%48 = tail call i32 @putchar(i32 32)
%49 = tail call i32 @putchar(i32 32)
%50 = tail call i32 @putchar(i32 32)
%51 = tail call i32 @putchar(i32 32)
%52 = tail call i32 @putchar(i32 32)
%53 = tail call i32 @putchar(i32 32)
%54 = tail call i32 @putchar(i32 32)
%55 = tail call i32 @putchar(i32 32)
%56 = tail call i32 @putchar(i32 32)
%57 = tail call i32 @putchar(i32 32)
%58 = tail call i32 @putchar(i32 32)
%59 = tail call i32 @putchar(i32 32)
%60 = tail call i32 @putchar(i32 32)
%61 = tail call i32 @putchar(i32 32)
%62 = tail call i32 @putchar(i32 32)
%63 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0))
ret i32 0
}