#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 */
typedef int uint8_t;

/* Variables and functions */
const char *ln_update_state_str(uint8_t state) {
  switch (state) {
  case (0):
    return "OFFERED_WAIT_SEND";
  case ((0) | (1 << 0)):
    return "OFFERED_UP_SEND";
  case (((0) | (1 << 0)) | (1 << 2)):
    return "OFFERED_CS_SEND";
  case ((((0) | (1 << 0)) | (1 << 2)) | (1 << 5)):
    return "OFFERED_RA_RECV";
  case (((((0) | (1 << 0)) | (1 << 2)) | (1 << 5)) | (1 << 3)):
    return "OFFERED_CS_RECV";
  case ((((((0) | (1 << 0)) | (1 << 2)) | (1 << 5)) | (1 << 3)) | (1 << 4)):
    return "OFFERED_RA_SEND";
  case ((1 << 1)):
    return "RECEIVED_UP_RECV";
  case (((1 << 1)) | (1 << 3)):
    return "RECEIVED_CS_RECV";
  case ((((1 << 1)) | (1 << 3)) | (1 << 4)):
    return "RECEIVED_RA_SEND";
  case (((((1 << 1)) | (1 << 3)) | (1 << 4)) | (1 << 2)):
    return "RECEIVED_CS_SEND";
  case ((((((1 << 1)) | (1 << 3)) | (1 << 4)) | (1 << 2)) | (1 << 5)):
    return "RECEIVED_RA_RECV";
  default:
    return "UNKNOWN";
  }
}


x86 assembly (clang, -O0):
<ln_update_state_str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x3e,%rax
ja     11dc <ln_update_state_str+0xdc>
mov    -0x18(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xfc9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e7 <ln_update_state_str+0xe7>
lea    0xfcb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e7 <ln_update_state_str+0xe7>
lea    0xfcb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e7 <ln_update_state_str+0xe7>
lea    0xfcb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e7 <ln_update_state_str+0xe7>
lea    0xfcb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e7 <ln_update_state_str+0xe7>
lea    0xfcb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e7 <ln_update_state_str+0xe7>
lea    0xfcb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e7 <ln_update_state_str+0xe7>
lea    0xfcc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e7 <ln_update_state_str+0xe7>
lea    0xfcd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e7 <ln_update_state_str+0xe7>
lea    0xfce(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e7 <ln_update_state_str+0xe7>
lea    0xfcf(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e7 <ln_update_state_str+0xe7>
lea    0xfd0(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_update_state_str>:
cmp    $0x3e,%edi
ja     112e <ln_update_state_str+0x2e>
lea    0xff0(%rip),%rax
mov    %edi,%ecx
lea    0xeeb(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
lea    0xfe9(%rip),%rax
ret
lea    0x1031(%rip),%rax
ret
lea    0x107e(%rip),%rax
ret
lea    0xfe1(%rip),%rax
ret
lea    0x102a(%rip),%rax
ret
lea    0x1033(%rip),%rax
ret
lea    0x103c(%rip),%rax
ret
lea    0xfd1(%rip),%rax
ret
lea    0xfd9(%rip),%rax
ret
lea    0xfe1(%rip),%rax
ret
lea    0x102d(%rip),%rax
ret

LLVM IR (-O0):
@.str = [18 x i8] c"OFFERED_WAIT_SEND\00"
@.str.1 = [16 x i8] c"OFFERED_UP_SEND\00"
@.str.2 = [16 x i8] c"OFFERED_CS_SEND\00"
@.str.3 = [16 x i8] c"OFFERED_RA_RECV\00"
@.str.4 = [16 x i8] c"OFFERED_CS_RECV\00"
@.str.5 = [16 x i8] c"OFFERED_RA_SEND\00"
@.str.6 = [17 x i8] c"RECEIVED_UP_RECV\00"
@.str.7 = [17 x i8] c"RECEIVED_CS_RECV\00"
@.str.8 = [17 x i8] c"RECEIVED_RA_SEND\00"
@.str.9 = [17 x i8] c"RECEIVED_CS_SEND\00"
@.str.10 = [17 x i8] c"RECEIVED_RA_RECV\00"
@.str.11 = [8 x i8] c"UNKNOWN\00"
define i8* @ln_update_state_str(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %16 [
i32 0, label %5
i32 1, label %6
i32 5, label %7
i32 37, label %8
i32 45, label %9
i32 61, label %10
i32 2, label %11
i32 10, label %12
i32 26, label %13
i32 30, label %14
i32 62, label %15
]
5: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8** %2
br label %17
6: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %17
7: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %17
8: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %17
9: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %17
10: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %17
11: ; preds = %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %17
12: ; preds = %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %17
13: ; preds = %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %17
14: ; preds = %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %17
15: ; preds = %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %17
16: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %17
17: ; preds = %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
@.str = [18 x i8] c"OFFERED_WAIT_SEND\00"
@.str.1 = [16 x i8] c"OFFERED_UP_SEND\00"
@.str.2 = [16 x i8] c"OFFERED_CS_SEND\00"
@.str.3 = [16 x i8] c"OFFERED_RA_RECV\00"
@.str.4 = [16 x i8] c"OFFERED_CS_RECV\00"
@.str.5 = [16 x i8] c"OFFERED_RA_SEND\00"
@.str.6 = [17 x i8] c"RECEIVED_UP_RECV\00"
@.str.7 = [17 x i8] c"RECEIVED_CS_RECV\00"
@.str.8 = [17 x i8] c"RECEIVED_RA_SEND\00"
@.str.9 = [17 x i8] c"RECEIVED_CS_SEND\00"
@.str.10 = [17 x i8] c"RECEIVED_RA_RECV\00"
@.str.11 = [8 x i8] c"UNKNOWN\00"
define i8* @ln_update_state_str(i32 %0) {
switch i32 %0, label %12 [
i32 0, label %13
i32 1, label %2
i32 5, label %3
i32 37, label %4
i32 45, label %5
i32 61, label %6
i32 2, label %7
i32 10, label %8
i32 26, label %9
i32 30, label %10
i32 62, label %11
]
2: ; preds = %1
br label %13
3: ; preds = %1
br label %13
4: ; preds = %1
br label %13
5: ; preds = %1
br label %13
6: ; preds = %1
br label %13
7: ; preds = %1
br label %13
8: ; preds = %1
br label %13
9: ; preds = %1
br label %13
10: ; preds = %1
br label %13
11: ; preds = %1
br label %13
12: ; preds = %1
br label %13
13: ; preds = %1, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%14 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), %12 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), %11 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), %10 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %14
}