#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 */
#define LOG_ALERT 135
#define LOG_CRIT 134
#define LOG_DEBUG 133
#define LOG_EMERG 132
#define LOG_ERR 131
#define LOG_INFO 130
#define LOG_NOTICE 129
int LOG_PRI(int);
#define LOG_WARNING 128
const char *logging_level_prefix(int priority) {
  switch (LOG_PRI(priority)) {
  case LOG_DEBUG:
    return "DEBUG: ";
  case LOG_INFO:
    return "INFO: ";
  case LOG_NOTICE:
    return "NOTICE: ";
  case LOG_WARNING:
    return "WARNING: ";
  case LOG_ERR:
    return "ERR: ";
  case LOG_CRIT:
    return "CRIT: ";
  case LOG_ALERT:
    return "ALERT: ";
  case LOG_EMERG:
    return "EMERG: ";
  default:
    return "UNKNOWN: ";
  }
}


x86 assembly (clang, -O0):
<logging_level_prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <LOG_PRI@plt>
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x7,%eax
ja     11c9 <logging_level_prefix+0xb9>
mov    -0x18(%rbp),%rax
lea    0xec0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xed0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11d4 <logging_level_prefix+0xc4>
lea    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11d4 <logging_level_prefix+0xc4>
lea    0xebf(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11d4 <logging_level_prefix+0xc4>
lea    0xeb8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11d4 <logging_level_prefix+0xc4>
lea    0xeb2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11d4 <logging_level_prefix+0xc4>
lea    0xea8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11d4 <logging_level_prefix+0xc4>
lea    0xe9f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11d4 <logging_level_prefix+0xc4>
lea    0xe97(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11d4 <logging_level_prefix+0xc4>
lea    0xe8f(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logging_level_prefix>:
push   %rax
call   1030 <LOG_PRI@plt>
add    $0xffffff80,%eax
cmp    $0x7,%eax
ja     1130 <logging_level_prefix+0x20>
cltq
lea    0xf25(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
pop    %rcx
ret
lea    0xf08(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"DEBUG: \00"
@.str.1 = [7 x i8] c"INFO: \00"
@.str.2 = [9 x i8] c"NOTICE: \00"
@.str.3 = [10 x i8] c"WARNING: \00"
@.str.4 = [6 x i8] c"ERR: \00"
@.str.5 = [7 x i8] c"CRIT: \00"
@.str.6 = [8 x i8] c"ALERT: \00"
@.str.7 = [8 x i8] c"EMERG: \00"
@.str.8 = [10 x i8] c"UNKNOWN: \00"
define i8* @logging_level_prefix(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @LOG_PRI(i32 %4)
switch i32 %5, label %14 [
i32 133, label %6
i32 130, label %7
i32 129, label %8
i32 128, label %9
i32 131, label %10
i32 134, label %11
i32 135, label %12
i32 132, label %13
]
6: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %2
br label %15
7: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %15
8: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %15
9: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %15
10: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %15
11: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %15
12: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %15
13: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %15
14: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %15
15: ; preds = %14, %13, %12, %11, %10, %9, %8, %7, %6
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
@.str = [8 x i8] c"DEBUG: \00"
@.str.1 = [7 x i8] c"INFO: \00"
@.str.2 = [9 x i8] c"NOTICE: \00"
@.str.3 = [10 x i8] c"WARNING: \00"
@.str.4 = [6 x i8] c"ERR: \00"
@.str.5 = [7 x i8] c"CRIT: \00"
@.str.6 = [8 x i8] c"ALERT: \00"
@.str.7 = [8 x i8] c"EMERG: \00"
@.str.8 = [10 x i8] c"UNKNOWN: \00"
@reltable.logging_level_prefix = [8 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.3 to i64), i64 ptrtoint ([8 x i32]* @reltable.logging_level_prefix to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.2 to i64), i64 ptrtoint ([8 x i32]* @reltable.logging_level_prefix to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.1 to i64), i64 ptrtoint ([8 x i32]* @reltable.logging_level_prefix to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.4 to i64), i64 ptrtoint ([8 x i32]* @reltable.logging_level_prefix to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.7 to i64), i64 ptrtoint ([8 x i32]* @reltable.logging_level_prefix to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str to i64), i64 ptrtoint ([8 x i32]* @reltable.logging_level_prefix to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.5 to i64), i64 ptrtoint ([8 x i32]* @reltable.logging_level_prefix to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.6 to i64), i64 ptrtoint ([8 x i32]* @reltable.logging_level_prefix to i64)) to i32)]
define i8* @logging_level_prefix(i32 %0) {
%2 = tail call i32 @LOG_PRI(i32 %0)
%3 = add i32 %2, -128
%4 = icmp ult i32 %3, 8
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = shl i64 %6, 2
%8 = call i8* @llvm.load.relative.i64(i8* bitcast ([8 x i32]* @reltable.logging_level_prefix to i8*), i64 %7)
br label %9
9: ; preds = %1, %5
%10 = phi i8* [ %8, %5 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), %1 ]
ret i8* %10
}