#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 status(int value) {
  if (value % 10 == 0) {
    printf(" ~~~ ");
  } else if (value % 10 == 3) {
    printf(" ~*~ ");
  } else if (value % 10 == 4) {
    printf(" /O/ ");
  } else if (value % 10 == 1) {
    printf(" /#/ ");
  } else {
    printf("error");
  }
}


x86 assembly (clang, -O0):
<status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1140 <status+0x30>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
jmp    11ca <status+0xba>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x3,%edx
jne    1165 <status+0x55>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
jmp    11c5 <status+0xb5>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x4,%edx
jne    118a <status+0x7a>
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
jmp    11c0 <status+0xb0>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    11af <status+0x9f>
lea    0xe6d(%rip),%rdi
call   1030 <printf@plt>
jmp    11bb <status+0xab>
lea    0xe62(%rip),%rdi
call   1030 <printf@plt>
jmp    11c0 <status+0xb0>
jmp    11c5 <status+0xb5>
jmp    11ca <status+0xba>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<status>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
cmp    $0x4,%eax
ja     1148 <status+0x38>
cltq
lea    0xee4(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    1030 <printf@plt>
lea    0xec9(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c" ~~~ \00"
@.str.1 = [6 x i8] c" ~*~ \00"
@.str.2 = [6 x i8] c" /O/ \00"
@.str.3 = [6 x i8] c" /#/ \00"
@.str.4 = [6 x i8] c"error\00"
define void @status(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 10
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %31
8: ; preds = %1
%9 = load i32, i32* %2
%10 = srem i32 %9, 10
%11 = icmp eq i32 %10, 3
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %30
14: ; preds = %8
%15 = load i32, i32* %2
%16 = srem i32 %15, 10
%17 = icmp eq i32 %16, 4
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %29
20: ; preds = %14
%21 = load i32, i32* %2
%22 = srem i32 %21, 10
%23 = icmp eq i32 %22, 1
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %28
26: ; preds = %20
%27 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %28
28: ; preds = %26, %24
br label %29
29: ; preds = %28, %18
br label %30
30: ; preds = %29, %12
br label %31
31: ; preds = %30, %6
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c" ~~~ \00"
@.str.1 = [6 x i8] c" ~*~ \00"
@.str.2 = [6 x i8] c" /O/ \00"
@.str.3 = [6 x i8] c" /#/ \00"
@.str.4 = [6 x i8] c"error\00"
@reltable.status = [5 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str to i64), i64 ptrtoint ([5 x i32]* @reltable.status to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.3 to i64), i64 ptrtoint ([5 x i32]* @reltable.status to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.4 to i64), i64 ptrtoint ([5 x i32]* @reltable.status to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.1 to i64), i64 ptrtoint ([5 x i32]* @reltable.status to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.2 to i64), i64 ptrtoint ([5 x i32]* @reltable.status to i64)) to i32)]
define void @status(i32 %0) {
%2 = srem i32 %0, 10
%3 = icmp ult i32 %2, 5
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([5 x i32]* @reltable.status to i8*), i64 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), %1 ]
%10 = tail call i32 @printf(i8* dereferenceable(1) %9)
ret void
}