#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*/ getchar();
int /*<<< orphan*/ printf(char *);
int main() {
  int i, j, n = 1, m = 0;
  printf("ÔØÈëÊý¾ÝÖÐ-\b");
  while (1) {
    m++;
    for (i = 0; i < 5000; i++)
      for (j = 0; j < 5000; j++)
        ;
    if (n > 4)
      n = 1;
    switch (n) {
    case 1:
      printf("\\\b");
      break;
    case 2:
      printf("|\b");
      break;
    case 3:
      printf("/\b");
      break;
    case 4:
      printf("-\b");
      break;
    }
    n++;
    if (m % 7 == 0) {
      printf("=");
      m = 1;
    }
  }
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1388,-0x8(%rbp)
jge    1190 <main+0x80>
movl   $0x0,-0xc(%rbp)
cmpl   $0x1388,-0xc(%rbp)
jge    117d <main+0x6d>
jmp    116f <main+0x5f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115d <main+0x4d>
jmp    1182 <main+0x72>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1149 <main+0x39>
cmpl   $0x4,-0x10(%rbp)
jle    11a1 <main+0x91>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x3,%eax
ja     1209 <main+0xf9>
mov    -0x20(%rbp),%rax
lea    0xe3f(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe56(%rip),%rdi
call   1030 <printf@plt>
jmp    1209 <main+0xf9>
lea    0xe48(%rip),%rdi
call   1030 <printf@plt>
jmp    1209 <main+0xf9>
lea    0xe3a(%rip),%rdi
call   1030 <printf@plt>
jmp    1209 <main+0xf9>
lea    0xe20(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1239 <main+0x129>
lea    0xe03(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    1139 <main+0x29>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xed2(%rip),%rdi
call   1040 <printf@plt>
xor    %ebx,%ebx
mov    $0x1,%r14d
lea    0xede(%rip),%r15
mov    $0x1,%ebp
jmp    1168 <main+0x48>
nopl   0x0(%rax)
add    $0x1,%ebx
add    $0x1,%ebp
imul   $0xb6db6db7,%ebx,%eax
add    $0x12492492,%eax
cmp    $0x24924924,%eax
jbe    1190 <main+0x70>
cmp    $0x5,%ebp
cmovge %r14d,%ebp
lea    -0x1(%rbp),%eax
cmp    $0x3,%eax
ja     1150 <main+0x30>
cltq
movslq (%r15,%rax,4),%rdi
add    %r15,%rdi
call   1040 <printf@plt>
jmp    1150 <main+0x30>
nopw   0x0(%rax,%rax,1)
mov    $0x3d,%edi
call   1030 <putchar@plt>
mov    $0x1,%ebx
jmp    1168 <main+0x48>

LLVM IR (-O0):
@.str = [23 x i8] c"\C3\94\C3\98\C3\88\C3\AB\C3\8A\C3\BD\C2\BE\C3\9D\C3\96\C3\90-\08\00"
@.str.1 = [3 x i8] c"\\\08\00"
@.str.2 = [3 x i8] c"|\08\00"
@.str.3 = [3 x i8] c"/\08\00"
@.str.4 = [3 x i8] c"-\08\00"
@.str.5 = [2 x i8] c"=\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* %4
store i32 0, i32* %5
%6 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %0, %47
%8 = load i32, i32* %5
%9 = add nsw i32 %8, 1
store i32 %9, i32* %5
store i32 0, i32* %2
br label %10
10: ; preds = %22, %7
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 5000
br i1 %12, label %13, label %25
13: ; preds = %10
store i32 0, i32* %3
br label %14
14: ; preds = %18, %13
%15 = load i32, i32* %3
%16 = icmp slt i32 %15, 5000
br i1 %16, label %17, label %21
17: ; preds = %14
br label %18
18: ; preds = %17
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %14
21: ; preds = %14
br label %22
22: ; preds = %21
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 1
store i32 %24, i32* %2
br label %10
25: ; preds = %10
%26 = load i32, i32* %4
%27 = icmp sgt i32 %26, 4
br i1 %27, label %28, label %29
28: ; preds = %25
store i32 1, i32* %4
br label %29
29: ; preds = %28, %25
%30 = load i32, i32* %4
switch i32 %30, label %39 [
i32 1, label %31
i32 2, label %33
i32 3, label %35
i32 4, label %37
]
31: ; preds = %29
%32 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %39
33: ; preds = %29
%34 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %39
35: ; preds = %29
%36 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %39
37: ; preds = %29
%38 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %39
39: ; preds = %29, %37, %35, %33, %31
%40 = load i32, i32* %4
%41 = add nsw i32 %40, 1
store i32 %41, i32* %4
%42 = load i32, i32* %5
%43 = srem i32 %42, 7
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %39
%46 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %5
br label %47
47: ; preds = %45, %39
br label %7
}

LLVM IR (-O2):
@.str = [23 x i8] c"\C3\94\C3\98\C3\88\C3\AB\C3\8A\C3\BD\C2\BE\C3\9D\C3\96\C3\90-\08\00"
@.str.1 = [3 x i8] c"\\\08\00"
@.str.2 = [3 x i8] c"|\08\00"
@.str.3 = [3 x i8] c"/\08\00"
@.str.4 = [3 x i8] c"-\08\00"
@reltable.main = [4 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.1 to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.2 to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.3 to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.4 to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %21, %0
%3 = phi i32 [ 1, %0 ], [ %16, %21 ]
%4 = phi i32 [ 0, %0 ], [ %22, %21 ]
%5 = add nsw i32 %4, 1
%6 = icmp sgt i32 %3, 4
%7 = select i1 %6, i32 1, i32 %3
%8 = add i32 %7, -1
%9 = icmp ult i32 %8, 4
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = sext i32 %8 to i64
%12 = shl i64 %11, 2
%13 = call i8* @llvm.load.relative.i64(i8* bitcast ([4 x i32]* @reltable.main to i8*), i64 %12)
%14 = tail call i32 @printf(i8* dereferenceable(1) %13)
br label %15
15: ; preds = %2, %10
%16 = add nsw i32 %7, 1
%17 = srem i32 %5, 7
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = tail call i32 @putchar(i32 61)
br label %21
21: ; preds = %19, %15
%22 = phi i32 [ 1, %19 ], [ %5, %15 ]
br label %2
}