#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 uint32_t;
typedef int /*<<< orphan*/ names;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
const char *pn_cmp2_get_name(uint32_t op) {
  const char *names[] = {
      "fcmp false", "fcmp oeq", "fcmp ogt", "fcmp oge",  "fcmp olt", "fcmp ole",
      "fcmp one",   "fcmp ord", "fcmp uno", "fcmp ueq",  "fcmp ugt", "fcmp uge",
      "fcmp ult",   "fcmp ule", "fcmp une", "fcmp true", NULL,       NULL,
      NULL,         NULL,       NULL,       NULL,        NULL,       NULL,
      NULL,         NULL,       NULL,       NULL,        NULL,       NULL,
      NULL,         NULL,       "icmp eq",  "icmp ne",   "icmp ugt", "icmp uge",
      "icmp ult",   "icmp ule", "icmp sgt", "icmp sge",  "icmp slt", "icmp sle",
  };
  if (op >= (sizeof(names) / sizeof((names)[0]))) {
    do {
      fprintf(stderr, "Invalid op: %u\n", op);
      exit(1);
    } while (0);
  }
  return names[op];
}


x86 assembly (clang, -O0):
<pn_cmp2_get_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x160(%rbp),%rdi
lea    0x2b74(%rip),%rsi
mov    $0x150,%edx
call   1040 <memcpy@plt>
movslq -0x4(%rbp),%rax
cmp    $0x2a,%rax
jb     118b <pn_cmp2_get_name+0x5b>
jmp    1169 <pn_cmp2_get_name+0x39>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xf6f(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
movslq -0x4(%rbp),%rax
mov    -0x160(%rbp,%rax,8),%rax
ff
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pn_cmp2_get_name>:
push   %rax
mov    %edi,%edx
cmp    $0x2a,%edi
jae    1137 <pn_cmp2_get_name+0x17>
mov    %edx,%eax
lea    0x2b8f(%rip),%rcx
mov    (%rcx,%rax,8),%rax
pop    %rcx
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xfa4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"fcmp false\00"
@.str.1 = [9 x i8] c"fcmp oeq\00"
@.str.2 = [9 x i8] c"fcmp ogt\00"
@.str.3 = [9 x i8] c"fcmp oge\00"
@.str.4 = [9 x i8] c"fcmp olt\00"
@.str.5 = [9 x i8] c"fcmp ole\00"
@.str.6 = [9 x i8] c"fcmp one\00"
@.str.7 = [9 x i8] c"fcmp ord\00"
@.str.8 = [9 x i8] c"fcmp uno\00"
@.str.9 = [9 x i8] c"fcmp ueq\00"
@.str.10 = [9 x i8] c"fcmp ugt\00"
@.str.11 = [9 x i8] c"fcmp uge\00"
@.str.12 = [9 x i8] c"fcmp ult\00"
@.str.13 = [9 x i8] c"fcmp ule\00"
@.str.14 = [9 x i8] c"fcmp une\00"
@.str.15 = [10 x i8] c"fcmp true\00"
@.str.16 = [8 x i8] c"icmp eq\00"
@.str.17 = [8 x i8] c"icmp ne\00"
@.str.18 = [9 x i8] c"icmp ugt\00"
@.str.19 = [9 x i8] c"icmp uge\00"
@.str.20 = [9 x i8] c"icmp ult\00"
@.str.21 = [9 x i8] c"icmp ule\00"
@.str.22 = [9 x i8] c"icmp sgt\00"
@.str.23 = [9 x i8] c"icmp sge\00"
@.str.24 = [9 x i8] c"icmp slt\00"
@.str.25 = [9 x i8] c"icmp sle\00"
@__const.pn_cmp2_get_name.names = [42 x i8*] [i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i32 0, i32 0), i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.25, i32 0, i32 0)]
@stderr = global i32 0
@.str.26 = [16 x i8] c"Invalid op: %u\0A\00"
define i8* @pn_cmp2_get_name(i32 %0) {
%2 = alloca i32
%3 = alloca [42 x i8*]
store i32 %0, i32* %2
%4 = bitcast [42 x i8*]* %3 to i8*
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = icmp uge i64 %6, 42
br i1 %7, label %8, label %15
8: ; preds = %1
br label %9
9: ; preds = %8
%10 = load i32, i32* @stderr
%11 = load i32, i32* %2
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.26, i64 0, i64 0), i32 %11)
%13 = call i32 @exit(i32 1)
unreachable
14: ; No predecessors!
br label %15
15: ; preds = %14, %1
%16 = load i32, i32* %2
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [42 x i8*], [42 x i8*]* %3, i64 0, i64 %17
%19 = load i8*, i8** %18
ret i8* %19
}

LLVM IR (-O2):
@.str = [11 x i8] c"fcmp false\00"
@.str.1 = [9 x i8] c"fcmp oeq\00"
@.str.2 = [9 x i8] c"fcmp ogt\00"
@.str.3 = [9 x i8] c"fcmp oge\00"
@.str.4 = [9 x i8] c"fcmp olt\00"
@.str.5 = [9 x i8] c"fcmp ole\00"
@.str.6 = [9 x i8] c"fcmp one\00"
@.str.7 = [9 x i8] c"fcmp ord\00"
@.str.8 = [9 x i8] c"fcmp uno\00"
@.str.9 = [9 x i8] c"fcmp ueq\00"
@.str.10 = [9 x i8] c"fcmp ugt\00"
@.str.11 = [9 x i8] c"fcmp uge\00"
@.str.12 = [9 x i8] c"fcmp ult\00"
@.str.13 = [9 x i8] c"fcmp ule\00"
@.str.14 = [9 x i8] c"fcmp une\00"
@.str.15 = [10 x i8] c"fcmp true\00"
@.str.16 = [8 x i8] c"icmp eq\00"
@.str.17 = [8 x i8] c"icmp ne\00"
@.str.18 = [9 x i8] c"icmp ugt\00"
@.str.19 = [9 x i8] c"icmp uge\00"
@.str.20 = [9 x i8] c"icmp ult\00"
@.str.21 = [9 x i8] c"icmp ule\00"
@.str.22 = [9 x i8] c"icmp sgt\00"
@.str.23 = [9 x i8] c"icmp sge\00"
@.str.24 = [9 x i8] c"icmp slt\00"
@.str.25 = [9 x i8] c"icmp sle\00"
@__const.pn_cmp2_get_name.names = [42 x i8*] [i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i32 0, i32 0), i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.25, i32 0, i32 0)]
@stderr = global i32 0
@.str.26 = [16 x i8] c"Invalid op: %u\0A\00"
define i8* @pn_cmp2_get_name(i32 %0) {
%2 = icmp ugt i32 %0, 41
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.26, i64 0, i64 0), i32 %0)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
%8 = zext i32 %0 to i64
%9 = getelementptr inbounds [42 x i8*], [42 x i8*]* @__const.pn_cmp2_get_name.names, i64 0, i64 %8
%10 = load i8*, i8** %9
ret i8* %10
}