#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*/ printf(char *, int, char const *);
void rxvm_print_err(int err) {
  const char *msg;
  switch (err) {
  case -1:
    msg = "Operator used incorrectly";
    break;
  case -2:
    msg = "Unexpected character class closing character";
    break;
  case -3:
    msg = "Unexpected closing repetition character";
    break;
  case -4:
    msg = "Unexpected parenthesis group closing character";
    break;
  case -5:
    msg = "Unterminated parenthesis group";
    break;
  case -6:
    msg = "Unterminated character class";
    break;
  case -7:
    msg = "Missing repetition closing character";
    break;
  case -8:
    msg = "Incomplete character range inside character class";
    break;
  case -9:
    msg = "Invalid extra comma inside repetition";
    break;
  case -10:
    msg = "Non-numerical character inside repetition";
    break;
  case -11:
    msg = "Empty repetition";
    break;
  case -12:
    msg = "Trailing escape character";
    break;
  case -13:
    msg = "Invalid symbol";
    break;
  case -14:
    msg = "Failed to allocate memory";
    break;
  case -15:
    msg = "Invalid parameter passed to library function";
    break;
  case -16:
    msg = "rxvm_fsearch can't read from supplied FILE pointer";
    break;
  default:
    msg = "Unrecognised error code";
  }
  printf("Error %d: %s\n", err, msg);
}


x86 assembly (clang, -O0):
<rxvm_print_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0xf,%eax
ja     1244 <rxvm_print_err+0x134>
mov    -0x18(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xef5(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    124f <rxvm_print_err+0x13f>
lea    0xeff(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    124f <rxvm_print_err+0x13f>
lea    0xf1c(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    124f <rxvm_print_err+0x13f>
lea    0xf34(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    124f <rxvm_print_err+0x13f>
lea    0xf53(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    124f <rxvm_print_err+0x13f>
lea    0xf62(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    124f <rxvm_print_err+0x13f>
lea    0xf6f(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    124f <rxvm_print_err+0x13f>
lea    0xf84(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    124f <rxvm_print_err+0x13f>
lea    0xfa6(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    124f <rxvm_print_err+0x13f>
lea    0xfbc(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    124f <rxvm_print_err+0x13f>
lea    0xfd6(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    124f <rxvm_print_err+0x13f>
lea    0xfd7(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    124f <rxvm_print_err+0x13f>
lea    0xfe1(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    124f <rxvm_print_err+0x13f>
lea    0xfe0(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    124f <rxvm_print_err+0x13f>
lea    0xfea(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    124f <rxvm_print_err+0x13f>
lea    0x1007(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    124f <rxvm_print_err+0x13f>
lea    0x102a(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0x1030(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rxvm_print_err>:
mov    %edi,%esi
cmp    $0xfffffff0,%edi
jb     1136 <rxvm_print_err+0x26>
lea    0x10(%rsi),%eax
cltq
lea    0x1139(%rip),%rcx
movslq (%rcx,%rax,4),%rdx
add    %rcx,%rdx
lea    0x111c(%rip),%rdi
jmp    1030 <printf@plt>
lea    0x10f8(%rip),%rdx
lea    0x1109(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Operator used incorrectly\00"
@.str.1 = [45 x i8] c"Unexpected character class closing character\00"
@.str.2 = [40 x i8] c"Unexpected closing repetition character\00"
@.str.3 = [47 x i8] c"Unexpected parenthesis group closing character\00"
@.str.4 = [31 x i8] c"Unterminated parenthesis group\00"
@.str.5 = [29 x i8] c"Unterminated character class\00"
@.str.6 = [37 x i8] c"Missing repetition closing character\00"
@.str.7 = [50 x i8] c"Incomplete character range inside character class\00"
@.str.8 = [38 x i8] c"Invalid extra comma inside repetition\00"
@.str.9 = [42 x i8] c"Non-numerical character inside repetition\00"
@.str.10 = [17 x i8] c"Empty repetition\00"
@.str.11 = [26 x i8] c"Trailing escape character\00"
@.str.12 = [15 x i8] c"Invalid symbol\00"
@.str.13 = [26 x i8] c"Failed to allocate memory\00"
@.str.14 = [45 x i8] c"Invalid parameter passed to library function\00"
@.str.15 = [51 x i8] c"rxvm_fsearch can't read from supplied FILE pointer\00"
@.str.16 = [24 x i8] c"Unrecognised error code\00"
@.str.17 = [14 x i8] c"Error %d: %s\0A\00"
define void @rxvm_print_err(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %21 [
i32 -1, label %5
i32 -2, label %6
i32 -3, label %7
i32 -4, label %8
i32 -5, label %9
i32 -6, label %10
i32 -7, label %11
i32 -8, label %12
i32 -9, label %13
i32 -10, label %14
i32 -11, label %15
i32 -12, label %16
i32 -13, label %17
i32 -14, label %18
i32 -15, label %19
i32 -16, label %20
]
5: ; preds = %1
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8** %3
br label %22
6: ; preds = %1
store i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %22
7: ; preds = %1
store i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %22
8: ; preds = %1
store i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0), i8** %3
br label %22
9: ; preds = %1
store i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8** %3
br label %22
10: ; preds = %1
store i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i8** %3
br label %22
11: ; preds = %1
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i8** %3
br label %22
12: ; preds = %1
store i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.7, i64 0, i64 0), i8** %3
br label %22
13: ; preds = %1
store i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.8, i64 0, i64 0), i8** %3
br label %22
14: ; preds = %1
store i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.9, i64 0, i64 0), i8** %3
br label %22
15: ; preds = %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i8** %3
br label %22
16: ; preds = %1
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0), i8** %3
br label %22
17: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0), i8** %3
br label %22
18: ; preds = %1
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.13, i64 0, i64 0), i8** %3
br label %22
19: ; preds = %1
store i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.14, i64 0, i64 0), i8** %3
br label %22
20: ; preds = %1
store i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.15, i64 0, i64 0), i8** %3
br label %22
21: ; preds = %1
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.16, i64 0, i64 0), i8** %3
br label %22
22: ; preds = %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%23 = load i32, i32* %2
%24 = load i8*, i8** %3
%25 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.17, i64 0, i64 0), i32 %23, i8* %24)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Operator used incorrectly\00"
@.str.1 = [45 x i8] c"Unexpected character class closing character\00"
@.str.2 = [40 x i8] c"Unexpected closing repetition character\00"
@.str.3 = [47 x i8] c"Unexpected parenthesis group closing character\00"
@.str.4 = [31 x i8] c"Unterminated parenthesis group\00"
@.str.5 = [29 x i8] c"Unterminated character class\00"
@.str.6 = [37 x i8] c"Missing repetition closing character\00"
@.str.7 = [50 x i8] c"Incomplete character range inside character class\00"
@.str.8 = [38 x i8] c"Invalid extra comma inside repetition\00"
@.str.9 = [42 x i8] c"Non-numerical character inside repetition\00"
@.str.10 = [17 x i8] c"Empty repetition\00"
@.str.11 = [26 x i8] c"Trailing escape character\00"
@.str.12 = [15 x i8] c"Invalid symbol\00"
@.str.13 = [26 x i8] c"Failed to allocate memory\00"
@.str.14 = [45 x i8] c"Invalid parameter passed to library function\00"
@.str.15 = [51 x i8] c"rxvm_fsearch can't read from supplied FILE pointer\00"
@.str.16 = [24 x i8] c"Unrecognised error code\00"
@.str.17 = [14 x i8] c"Error %d: %s\0A\00"
@reltable.rxvm_print_err = [16 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([51 x i8]* @.str.15 to i64), i64 ptrtoint ([16 x i32]* @reltable.rxvm_print_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([45 x i8]* @.str.14 to i64), i64 ptrtoint ([16 x i32]* @reltable.rxvm_print_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([26 x i8]* @.str.13 to i64), i64 ptrtoint ([16 x i32]* @reltable.rxvm_print_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str.12 to i64), i64 ptrtoint ([16 x i32]* @reltable.rxvm_print_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([26 x i8]* @.str.11 to i64), i64 ptrtoint ([16 x i32]* @reltable.rxvm_print_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @.str.10 to i64), i64 ptrtoint ([16 x i32]* @reltable.rxvm_print_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([42 x i8]* @.str.9 to i64), i64 ptrtoint ([16 x i32]* @reltable.rxvm_print_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([38 x i8]* @.str.8 to i64), i64 ptrtoint ([16 x i32]* @reltable.rxvm_print_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([50 x i8]* @.str.7 to i64), i64 ptrtoint ([16 x i32]* @reltable.rxvm_print_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([37 x i8]* @.str.6 to i64), i64 ptrtoint ([16 x i32]* @reltable.rxvm_print_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([29 x i8]* @.str.5 to i64), i64 ptrtoint ([16 x i32]* @reltable.rxvm_print_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([31 x i8]* @.str.4 to i64), i64 ptrtoint ([16 x i32]* @reltable.rxvm_print_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([47 x i8]* @.str.3 to i64), i64 ptrtoint ([16 x i32]* @reltable.rxvm_print_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([40 x i8]* @.str.2 to i64), i64 ptrtoint ([16 x i32]* @reltable.rxvm_print_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([45 x i8]* @.str.1 to i64), i64 ptrtoint ([16 x i32]* @reltable.rxvm_print_err to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([26 x i8]* @.str to i64), i64 ptrtoint ([16 x i32]* @reltable.rxvm_print_err to i64)) to i32)]
define void @rxvm_print_err(i32 %0) {
%2 = icmp ugt i32 %0, -17
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = add i32 %0, 16
%5 = sext i32 %4 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([16 x i32]* @reltable.rxvm_print_err to i8*), i64 %6)
br label %8
8: ; preds = %1, %3
%9 = phi i8* [ %7, %3 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.16, i64 0, i64 0), %1 ]
%10 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.17, i64 0, i64 0), i32 %0, i8* %9)
ret void
}