#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 SECCOMP_RET_ALLOW 132
#define SECCOMP_RET_ERRNO 131
#define SECCOMP_RET_KILL 130
#define SECCOMP_RET_TRACE 129
#define SECCOMP_RET_TRAP 128
const char *action_to_string(int action) {
  switch (action) {
  case 0x80000000U:
    return "SECCOMP_RET_KILL_PROCESS";
  case SECCOMP_RET_KILL:
    return "SECCOMP_RET_KILL";
  case SECCOMP_RET_TRAP:
    return "SECCOMP_RET_TRAP";
  case SECCOMP_RET_ERRNO:
    return "SECCOMP_RET_ERRNO";
  case 0x7fc00000U:
    return "SECCOMP_RET_USER_NOTIF";
  case SECCOMP_RET_TRACE:
    return "SECCOMP_RET_TRACE";
  case 0x7ffc0000U:
    return "SECCOMP_RET_LOG";
  case SECCOMP_RET_ALLOW:
    return "SECCOMP_RET_ALLOW";
  }
  return NULL;
}


x86 assembly (clang, -O0):
<action_to_string>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x80000000,%eax
je     11a2 <action_to_string+0xa2>
jmp    111d <action_to_string+0x1d>
mov    -0x10(%rbp),%eax
sub    $0x80,%eax
je     11c2 <action_to_string+0xc2>
jmp    1130 <action_to_string+0x30>
mov    -0x10(%rbp),%eax
sub    $0x81,%eax
je     11f2 <action_to_string+0xf2>
jmp    1143 <action_to_string+0x43>
mov    -0x10(%rbp),%eax
sub    $0x82,%eax
je     11b2 <action_to_string+0xb2>
jmp    1156 <action_to_string+0x56>
mov    -0x10(%rbp),%eax
sub    $0x83,%eax
je     11d2 <action_to_string+0xd2>
jmp    1169 <action_to_string+0x69>
mov    -0x10(%rbp),%eax
sub    $0x84,%eax
je     1212 <action_to_string+0x112>
jmp    117c <action_to_string+0x7c>
mov    -0x10(%rbp),%eax
sub    $0x7fc00000,%eax
je     11e2 <action_to_string+0xe2>
jmp    118f <action_to_string+0x8f>
mov    -0x10(%rbp),%eax
sub    $0x7ffc0000,%eax
je     1202 <action_to_string+0x102>
jmp    1222 <action_to_string+0x122>
lea    0xe57(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122a <action_to_string+0x12a>
lea    0xe60(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122a <action_to_string+0x12a>
lea    0xe61(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122a <action_to_string+0x12a>
lea    0xe62(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122a <action_to_string+0x12a>
lea    0xe64(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122a <action_to_string+0x12a>
lea    0xe6b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122a <action_to_string+0x12a>
lea    0xe6d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122a <action_to_string+0x12a>
lea    0xe6d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122a <action_to_string+0x12a>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<action_to_string>:
cmp    $0x7fbfffff,%edi
jg     1128 <action_to_string+0x28>
lea    -0x80(%rdi),%eax
cmp    $0x4,%eax
ja     1140 <action_to_string+0x40>
lea    0xee9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf17(%rip),%rax
ret
cmp    $0x7fc00000,%edi
je     1170 <action_to_string+0x70>
cmp    $0x7ffc0000,%edi
jne    1178 <action_to_string+0x78>
lea    0xf4b(%rip),%rax
ret
cmp    $0x80000000,%edi
jne    1178 <action_to_string+0x78>
lea    0xec5(%rip),%rax
ret
lea    0xf21(%rip),%rax
ret
lea    0xece(%rip),%rax
ret
lea    0xee8(%rip),%rax
ret
lea    0xf2b(%rip),%rax
ret
lea    0xeea(%rip),%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [25 x i8] c"SECCOMP_RET_KILL_PROCESS\00"
@.str.1 = [17 x i8] c"SECCOMP_RET_KILL\00"
@.str.2 = [17 x i8] c"SECCOMP_RET_TRAP\00"
@.str.3 = [18 x i8] c"SECCOMP_RET_ERRNO\00"
@.str.4 = [23 x i8] c"SECCOMP_RET_USER_NOTIF\00"
@.str.5 = [18 x i8] c"SECCOMP_RET_TRACE\00"
@.str.6 = [16 x i8] c"SECCOMP_RET_LOG\00"
@.str.7 = [18 x i8] c"SECCOMP_RET_ALLOW\00"
define i8* @action_to_string(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %13 [
i32 -2147483648, label %5
i32 130, label %6
i32 128, label %7
i32 131, label %8
i32 2143289344, label %9
i32 129, label %10
i32 2147221504, label %11
i32 132, label %12
]
5: ; preds = %1
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8** %2
br label %14
6: ; preds = %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %14
7: ; preds = %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %14
8: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %14
9: ; preds = %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %14
10: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %14
11: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %14
12: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %14
13: ; preds = %1
store i8* null, i8** %2
br label %14
14: ; preds = %13, %12, %11, %10, %9, %8, %7, %6, %5
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
@.str = [25 x i8] c"SECCOMP_RET_KILL_PROCESS\00"
@.str.1 = [17 x i8] c"SECCOMP_RET_KILL\00"
@.str.2 = [17 x i8] c"SECCOMP_RET_TRAP\00"
@.str.3 = [18 x i8] c"SECCOMP_RET_ERRNO\00"
@.str.4 = [23 x i8] c"SECCOMP_RET_USER_NOTIF\00"
@.str.5 = [18 x i8] c"SECCOMP_RET_TRACE\00"
@.str.6 = [16 x i8] c"SECCOMP_RET_LOG\00"
@.str.7 = [18 x i8] c"SECCOMP_RET_ALLOW\00"
define i8* @action_to_string(i32 %0) {
switch i32 %0, label %9 [
i32 -2147483648, label %10
i32 130, label %2
i32 128, label %3
i32 131, label %4
i32 2143289344, label %5
i32 129, label %6
i32 2147221504, label %7
i32 132, label %8
]
2: ; preds = %1
br label %10
3: ; preds = %1
br label %10
4: ; preds = %1
br label %10
5: ; preds = %1
br label %10
6: ; preds = %1
br label %10
7: ; preds = %1
br label %10
8: ; preds = %1
br label %10
9: ; preds = %1
br label %10
10: ; preds = %1, %9, %8, %7, %6, %5, %4, %3, %2
%11 = phi i8* [ null, %9 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %11
}