#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*/ bc_log_debug(char const *);
int /*<<< orphan*/ bc_log_error(char const *);
int /*<<< orphan*/ bc_log_info(char const *);
int /*<<< orphan*/ bc_log_trace(char const *);
int /*<<< orphan*/ bc_log_warning(char const *);
void bc_log(int priority, const char *msg) {
  switch (priority) {
  case 1:
    bc_log_trace(msg);
    break;
  case 2:
    bc_log_debug(msg);
    break;
  case 3:
    bc_log_info(msg);
    break;
  case 5:
    bc_log_warning(msg);
    break;
  case 6:
    bc_log_error(msg);
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<bc_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x5,%eax
ja     11ce <bc_log+0x7e>
mov    -0x18(%rbp),%rax
lea    0xe81(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rdi
call   1050 <bc_log_trace@plt>
jmp    11d3 <bc_log+0x83>
mov    -0x10(%rbp),%rdi
call   1070 <bc_log_debug@plt>
jmp    11d3 <bc_log+0x83>
mov    -0x10(%rbp),%rdi
call   1060 <bc_log_info@plt>
jmp    11d3 <bc_log+0x83>
mov    -0x10(%rbp),%rdi
call   1040 <bc_log_warning@plt>
jmp    11d3 <bc_log+0x83>
mov    -0x10(%rbp),%rdi
call   1030 <bc_log_error@plt>
jmp    11d3 <bc_log+0x83>
jmp    11d3 <bc_log+0x83>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bc_log>:
add    $0xffffffff,%edi
cmp    $0x5,%edi
ja     1180 <bc_log+0x30>
lea    0xea1(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
mov    %rsi,%rdi
jmp    1050 <bc_log_trace@plt>
mov    %rsi,%rdi
jmp    1070 <bc_log_debug@plt>
mov    %rsi,%rdi
jmp    1060 <bc_log_info@plt>
ret
mov    %rsi,%rdi
jmp    1040 <bc_log_warning@plt>
mov    %rsi,%rdi
jmp    1030 <bc_log_error@plt>

LLVM IR (-O0):
define void @bc_log(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
switch i32 %5, label %21 [
i32 1, label %6
i32 2, label %9
i32 3, label %12
i32 5, label %15
i32 6, label %18
]
6: ; preds = %2
%7 = load i8*, i8** %4
%8 = call i32 @bc_log_trace(i8* %7)
br label %22
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = call i32 @bc_log_debug(i8* %10)
br label %22
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = call i32 @bc_log_info(i8* %13)
br label %22
15: ; preds = %2
%16 = load i8*, i8** %4
%17 = call i32 @bc_log_warning(i8* %16)
br label %22
18: ; preds = %2
%19 = load i8*, i8** %4
%20 = call i32 @bc_log_error(i8* %19)
br label %22
21: ; preds = %2
br label %22
22: ; preds = %21, %18, %15, %12, %9, %6
ret void
}

LLVM IR (-O2):
define void @bc_log(i32 %0, i8* %1) {
switch i32 %0, label %13 [
i32 1, label %3
i32 2, label %5
i32 3, label %7
i32 5, label %9
i32 6, label %11
]
3: ; preds = %2
%4 = tail call i32 @bc_log_trace(i8* %1)
br label %13
5: ; preds = %2
%6 = tail call i32 @bc_log_debug(i8* %1)
br label %13
7: ; preds = %2
%8 = tail call i32 @bc_log_info(i8* %1)
br label %13
9: ; preds = %2
%10 = tail call i32 @bc_log_warning(i8* %1)
br label %13
11: ; preds = %2
%12 = tail call i32 @bc_log_error(i8* %1)
br label %13
13: ; preds = %2, %11, %9, %7, %5, %3
ret void
}