#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcmp(char const *, char const *);
int vexpect_decode(const char *expected, const char *text, int ty,
                   const char *str) {
  switch (ty) {
  case 0:
    if (strcmp(expected, str) != 0) {
      fprintf(stderr,
              "error: expected '%s', but got '%s', which "
              "is not equal. %s\n",
              expected, str, text);
      return -1;
    }
    break;
  case 1:
    if (strcmp(expected, str) > 0) {
      fprintf(stderr,
              "error: expected '%s', but got '%s'. "
              "Expected something greater or equal.  %s\n",
              expected, str, text);
      return -1;
    }
    break;
  case 2:
    if (strcmp(expected, str) >= 0) {
      fprintf(stderr,
              "error: expected '%s', but got '%s'. "
              "Expected something greater.  %s\n",
              expected, str, text);
      return -1;
    }
    break;
  case 3:
    if (strcmp(expected, str) < 0) {
      fprintf(stderr,
              "error: expected '%s', but got '%s'. "
              "Expected something less or equal.  %s\n",
              expected, str, text);
      return -1;
    }
    break;
  case 4:
    if (strcmp(expected, str) <= 0) {
      fprintf(stderr,
              "error: expected '%s', but got '%s'. "
              "Expected something less.  %s\n",
              expected, str, text);
      return -1;
    }
    break;
  case 5:
    if (strcmp(expected, str) == 0) {
      fprintf(stderr, "error: did not expect '%s': '%s'\n", expected, text);
      return -1;
    }
    break;
  default:
    fprintf(stderr, "runtime error: invalid type %d passed in: '%s'\n", ty,
            text);
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<vexpect_decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
mov    %rax,-0x30(%rbp)
sub    $0x5,%rax
ja     1314 <vexpect_decode+0x1f4>
mov    -0x30(%rbp),%rax
lea    0xead(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
je     11a1 <vexpect_decode+0x81>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xe8a(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1345 <vexpect_decode+0x225>
jmp    133e <vexpect_decode+0x21e>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jle    11eb <vexpect_decode+0xcb>
mov    0x2e1d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xe7c(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1345 <vexpect_decode+0x225>
jmp    133e <vexpect_decode+0x21e>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jl     1235 <vexpect_decode+0x115>
mov    0x2dd3(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xe80(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1345 <vexpect_decode+0x225>
jmp    133e <vexpect_decode+0x21e>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jge    127f <vexpect_decode+0x15f>
mov    0x2d89(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xe7b(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1345 <vexpect_decode+0x225>
jmp    133e <vexpect_decode+0x21e>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jg     12c9 <vexpect_decode+0x1a9>
mov    0x2d3f(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xe7c(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1345 <vexpect_decode+0x225>
jmp    133e <vexpect_decode+0x21e>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    130f <vexpect_decode+0x1ef>
mov    0x2cf5(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xe78(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1345 <vexpect_decode+0x225>
jmp    133e <vexpect_decode+0x21e>
mov    0x2cc5(%rip),%rax
mov    (%rax),%edi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xe6b(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1345 <vexpect_decode+0x225>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vexpect_decode>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
cmp    $0x5,%edx
ja     116d <vexpect_decode+0x4d>
mov    %rcx,%rbx
mov    %rdi,%r15
mov    %edx,%eax
lea    0xec4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     126f <vexpect_decode+0x14f>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
jmp    1222 <vexpect_decode+0x102>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
lea    0x1019(%rip),%rsi
mov    %r14,%rcx
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    1232 <vexpect_decode+0x112>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
jle    1237 <vexpect_decode+0x117>
mov    0x2e36(%rip),%rax
mov    (%rax),%edi
lea    0xea1(%rip),%rsi
jmp    1222 <vexpect_decode+0x102>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
js     1237 <vexpect_decode+0x117>
mov    0x2e11(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
jmp    1222 <vexpect_decode+0x102>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
jns    1237 <vexpect_decode+0x117>
mov    0x2dec(%rip),%rax
mov    (%rax),%edi
lea    0xeea(%rip),%rsi
jmp    1222 <vexpect_decode+0x102>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
jg     1237 <vexpect_decode+0x117>
mov    0x2dc7(%rip),%rax
mov    (%rax),%edi
lea    0xf10(%rip),%rsi
mov    %r15,%rdx
mov    %rbx,%rcx
mov    %r14,%r8
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
jne    1237 <vexpect_decode+0x117>
mov    0x2d89(%rip),%rax
mov    (%rax),%edi
lea    0xf14(%rip),%rsi
mov    %r15,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    1232 <vexpect_decode+0x112>
xor    %eax,%eax
jmp    1237 <vexpect_decode+0x117>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [60 x i8] c"error: expected '%s', but got '%s', which is not equal. %s\0A\00"
@.str.1 = [78 x i8] c"error: expected '%s', but got '%s'. Expected something greater or equal. %s\0A\00"
@.str.2 = [69 x i8] c"error: expected '%s', but got '%s'. Expected something greater. %s\0A\00"
@.str.3 = [75 x i8] c"error: expected '%s', but got '%s'. Expected something less or equal. %s\0A\00"
@.str.4 = [66 x i8] c"error: expected '%s', but got '%s'. Expected something less. %s\0A\00"
@.str.5 = [34 x i8] c"error: did not expect '%s': '%s'\0A\00"
@.str.6 = [48 x i8] c"runtime error: invalid type %d passed in: '%s'\0A\00"
define i32 @vexpect_decode(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
%10 = load i32, i32* %8
switch i32 %10, label %82 [
i32 0, label %11
i32 1, label %23
i32 2, label %35
i32 3, label %47
i32 4, label %59
i32 5, label %71
]
11: ; preds = %4
%12 = load i8*, i8** %6
%13 = load i8*, i8** %9
%14 = call i32 @strcmp(i8* %12, i8* %13)
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %22
16: ; preds = %11
%17 = load i32, i32* @stderr
%18 = load i8*, i8** %6
%19 = load i8*, i8** %9
%20 = load i8*, i8** %7
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* %18, i8* %19, i8* %20)
store i32 -1, i32* %5
br label %88
22: ; preds = %11
br label %87
23: ; preds = %4
%24 = load i8*, i8** %6
%25 = load i8*, i8** %9
%26 = call i32 @strcmp(i8* %24, i8* %25)
%27 = icmp sgt i32 %26, 0
br i1 %27, label %28, label %34
28: ; preds = %23
%29 = load i32, i32* @stderr
%30 = load i8*, i8** %6
%31 = load i8*, i8** %9
%32 = load i8*, i8** %7
%33 = call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0), i8* %30, i8* %31, i8* %32)
store i32 -1, i32* %5
br label %88
34: ; preds = %23
br label %87
35: ; preds = %4
%36 = load i8*, i8** %6
%37 = load i8*, i8** %9
%38 = call i32 @strcmp(i8* %36, i8* %37)
%39 = icmp sge i32 %38, 0
br i1 %39, label %40, label %46
40: ; preds = %35
%41 = load i32, i32* @stderr
%42 = load i8*, i8** %6
%43 = load i8*, i8** %9
%44 = load i8*, i8** %7
%45 = call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.2, i64 0, i64 0), i8* %42, i8* %43, i8* %44)
store i32 -1, i32* %5
br label %88
46: ; preds = %35
br label %87
47: ; preds = %4
%48 = load i8*, i8** %6
%49 = load i8*, i8** %9
%50 = call i32 @strcmp(i8* %48, i8* %49)
%51 = icmp slt i32 %50, 0
br i1 %51, label %52, label %58
52: ; preds = %47
%53 = load i32, i32* @stderr
%54 = load i8*, i8** %6
%55 = load i8*, i8** %9
%56 = load i8*, i8** %7
%57 = call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.3, i64 0, i64 0), i8* %54, i8* %55, i8* %56)
store i32 -1, i32* %5
br label %88
58: ; preds = %47
br label %87
59: ; preds = %4
%60 = load i8*, i8** %6
%61 = load i8*, i8** %9
%62 = call i32 @strcmp(i8* %60, i8* %61)
%63 = icmp sle i32 %62, 0
br i1 %63, label %64, label %70
64: ; preds = %59
%65 = load i32, i32* @stderr
%66 = load i8*, i8** %6
%67 = load i8*, i8** %9
%68 = load i8*, i8** %7
%69 = call i32 (i32, i8*, ...) @fprintf(i32 %65, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.4, i64 0, i64 0), i8* %66, i8* %67, i8* %68)
store i32 -1, i32* %5
br label %88
70: ; preds = %59
br label %87
71: ; preds = %4
%72 = load i8*, i8** %6
%73 = load i8*, i8** %9
%74 = call i32 @strcmp(i8* %72, i8* %73)
%75 = icmp eq i32 %74, 0
br i1 %75, label %76, label %81
76: ; preds = %71
%77 = load i32, i32* @stderr
%78 = load i8*, i8** %6
%79 = load i8*, i8** %7
%80 = call i32 (i32, i8*, ...) @fprintf(i32 %77, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), i8* %78, i8* %79)
store i32 -1, i32* %5
br label %88
81: ; preds = %71
br label %87
82: ; preds = %4
%83 = load i32, i32* @stderr
%84 = load i32, i32* %8
%85 = load i8*, i8** %7
%86 = call i32 (i32, i8*, ...) @fprintf(i32 %83, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.6, i64 0, i64 0), i32 %84, i8* %85)
store i32 -1, i32* %5
br label %88
87: ; preds = %81, %70, %58, %46, %34, %22
store i32 0, i32* %5
br label %88
88: ; preds = %87, %82, %76, %64, %52, %40, %28, %16
%89 = load i32, i32* %5
ret i32 %89
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [60 x i8] c"error: expected '%s', but got '%s', which is not equal. %s\0A\00"
@.str.1 = [78 x i8] c"error: expected '%s', but got '%s'. Expected something greater or equal. %s\0A\00"
@.str.2 = [69 x i8] c"error: expected '%s', but got '%s'. Expected something greater. %s\0A\00"
@.str.3 = [75 x i8] c"error: expected '%s', but got '%s'. Expected something less or equal. %s\0A\00"
@.str.4 = [66 x i8] c"error: expected '%s', but got '%s'. Expected something less. %s\0A\00"
@.str.5 = [34 x i8] c"error: did not expect '%s': '%s'\0A\00"
@.str.6 = [48 x i8] c"runtime error: invalid type %d passed in: '%s'\0A\00"
define i32 @vexpect_decode(i8* %0, i8* %1, i32 %2, i8* %3) {
switch i32 %2, label %41 [
i32 0, label %5
i32 1, label %11
i32 2, label %17
i32 3, label %23
i32 4, label %29
i32 5, label %35
]
5: ; preds = %4
%6 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %3)
%7 = icmp eq i32 %6, 0
br i1 %7, label %44, label %8
8: ; preds = %5
%9 = load i32, i32* @stderr
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3, i8* %1)
br label %44
11: ; preds = %4
%12 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %3)
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %44
14: ; preds = %11
%15 = load i32, i32* @stderr
%16 = tail call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %3, i8* %1)
br label %44
17: ; preds = %4
%18 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %3)
%19 = icmp sgt i32 %18, -1
br i1 %19, label %20, label %44
20: ; preds = %17
%21 = load i32, i32* @stderr
%22 = tail call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.2, i64 0, i64 0), i8* %0, i8* %3, i8* %1)
br label %44
23: ; preds = %4
%24 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %3)
%25 = icmp slt i32 %24, 0
br i1 %25, label %26, label %44
26: ; preds = %23
%27 = load i32, i32* @stderr
%28 = tail call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.3, i64 0, i64 0), i8* %0, i8* %3, i8* %1)
br label %44
29: ; preds = %4
%30 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %3)
%31 = icmp slt i32 %30, 1
br i1 %31, label %32, label %44
32: ; preds = %29
%33 = load i32, i32* @stderr
%34 = tail call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.4, i64 0, i64 0), i8* %0, i8* %3, i8* %1)
br label %44
35: ; preds = %4
%36 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %3)
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %44
38: ; preds = %35
%39 = load i32, i32* @stderr
%40 = tail call i32 (i32, i8*, ...) @fprintf(i32 %39, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), i8* %0, i8* %1)
br label %44
41: ; preds = %4
%42 = load i32, i32* @stderr
%43 = tail call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.6, i64 0, i64 0), i32 %2, i8* %1)
br label %44
44: ; preds = %5, %11, %17, %23, %29, %35, %41, %38, %32, %26, %20, %14, %8
%45 = phi i32 [ -1, %41 ], [ -1, %38 ], [ -1, %32 ], [ -1, %26 ], [ -1, %20 ], [ -1, %14 ], [ -1, %8 ], [ 0, %35 ], [ 0, %29 ], [ 0, %23 ], [ 0, %17 ], [ 0, %11 ], [ 0, %5 ]
ret i32 %45
}