#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 *);
void progressChar(int count) {
  switch (count) {
  case 10: {
    printf("\x08|");
    break;
  }
  case 20: {
    printf("\x08/");
    break;
  }
  case 30: {
    printf("\x08-");
    break;
  }
  case 40: {
    printf("\x08\\");
    break;
  }
  }
}


x86 assembly (clang, -O0):
<progressChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xfffffff6,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x1e,%eax
ja     1183 <progressChar+0x73>
mov    -0x10(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf31(%rip),%rdi
call   1030 <printf@plt>
jmp    1183 <progressChar+0x73>
lea    0xf23(%rip),%rdi
call   1030 <printf@plt>
jmp    1183 <progressChar+0x73>
lea    0xf15(%rip),%rdi
call   1030 <printf@plt>
jmp    1183 <progressChar+0x73>
lea    0xf07(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<progressChar>:
mov    %edi,%eax
add    $0xfffffff6,%eax
cmp    $0x1e,%eax
ja     113d <progressChar+0x2d>
lea    0xf5b(%rip),%rdi
lea    0xed8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf47(%rip),%rdi
jmp    1030 <printf@plt>
ret
lea    0xf3d(%rip),%rdi
jmp    1030 <printf@plt>
lea    0xf34(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\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"
define void @progressChar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %12 [
i32 10, label %4
i32 20, label %6
i32 30, label %8
i32 40, label %10
]
4: ; preds = %1
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %12
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %12
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %12
10: ; preds = %1
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %1, %10, %8, %6, %4
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\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"
define void @progressChar(i32 %0) {
switch i32 %0, label %8 [
i32 10, label %5
i32 20, label %2
i32 30, label %3
i32 40, label %4
]
2: ; preds = %1
br label %5
3: ; preds = %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %2, %3, %4
%6 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %1 ]
%7 = tail call i32 @printf(i8* dereferenceable(1) %6)
br label %8
8: ; preds = %5, %1
ret void
}