#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*/ OPM_LogWLn();
int /*<<< orphan*/ OPM_LogWNum(int, long long);
int /*<<< orphan*/ OPM_LogWStr(unsigned char *, long long);
int /*<<< orphan*/ OPM_Write(char);
int /*<<< orphan*/ OPM_WriteHex(long long);
int /*<<< orphan*/ OPM_WriteInt(long long);
int /*<<< orphan*/ OPM_WriteString(unsigned char *, long long);
void OPC_Case(long long caseVal, int form) {
  unsigned char ch;
  OPM_WriteString((unsigned char *)"case ", (long long)6);
  switch (form) {
  case 3:
    ch = (unsigned char)caseVal;
    if ((ch >= ' ' && ch <= '~')) {
      OPM_Write('\'');
      if (((ch == '\\' || ch == '\?') || ch == '\'') || ch == '\"') {
        OPM_Write('\\');
        OPM_Write(ch);
      } else {
        OPM_Write(ch);
      }
      OPM_Write('\'');
    } else {
      OPM_WriteString((unsigned char *)"0x", (long long)3);
      OPM_WriteHex(caseVal);
    }
    break;
  case 4:
  case 5:
  case 6:
    OPM_WriteInt(caseVal);
    break;
  default:
    OPM_LogWStr((unsigned char *)"unhandled case in OPC.Case, form = ",
                (long long)36);
    OPM_LogWNum(form, ((long long)(0)));
    OPM_LogWLn();
    break;
  }
  OPM_WriteString((unsigned char *)": ", (long long)3);
}


x86 assembly (clang, -O0):
<OPC_Case>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xe7a(%rip),%rdi
mov    $0x6,%esi
call   1090 <OPM_WriteString@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x3,%eax
je     11b8 <OPC_Case+0x48>
jmp    11a4 <OPC_Case+0x34>
mov    -0x14(%rbp),%eax
add    $0xfffffffc,%eax
sub    $0x3,%eax
jb     1266 <OPC_Case+0xf6>
jmp    1274 <OPC_Case+0x104>
mov    -0x8(%rbp),%rax
mov    %al,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
cmp    $0x20,%eax
jl     1247 <OPC_Case+0xd7>
movzbl -0xd(%rbp),%eax
cmp    $0x7e,%eax
jg     1247 <OPC_Case+0xd7>
mov    $0x27,%edi
call   1070 <OPM_Write@plt>
movzbl -0xd(%rbp),%eax
cmp    $0x5c,%eax
je     1217 <OPC_Case+0xa7>
movzbl -0xd(%rbp),%eax
cmp    $0x3f,%eax
je     1217 <OPC_Case+0xa7>
movzbl -0xd(%rbp),%eax
cmp    $0x27,%eax
je     1217 <OPC_Case+0xa7>
movzbl -0xd(%rbp),%eax
cmp    $0x22,%eax
jne    122f <OPC_Case+0xbf>
mov    $0x5c,%edi
call   1070 <OPM_Write@plt>
movsbl -0xd(%rbp),%edi
call   1070 <OPM_Write@plt>
jmp    1238 <OPC_Case+0xc8>
movsbl -0xd(%rbp),%edi
call   1070 <OPM_Write@plt>
mov    $0x27,%edi
call   1070 <OPM_Write@plt>
jmp    1261 <OPC_Case+0xf1>
lea    0xdb8(%rip),%rdi
mov    $0x3,%esi
call   1090 <OPM_WriteString@plt>
mov    -0x8(%rbp),%rdi
call   1060 <OPM_WriteHex@plt>
jmp    1298 <OPC_Case+0x128>
mov    -0x8(%rbp),%rdi
call   1040 <OPM_WriteInt@plt>
jmp    1298 <OPC_Case+0x128>
lea    0xd8e(%rip),%rdi
mov    $0x24,%esi
call   1030 <OPM_LogWStr@plt>
mov    -0xc(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1080 <OPM_LogWNum@plt>
mov    $0x0,%al
call   1050 <OPM_LogWLn@plt>
lea    0xd8e(%rip),%rdi
mov    $0x3,%esi
call   1090 <OPM_WriteString@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OPC_Case>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xe80(%rip),%rdi
mov    $0x6,%esi
call   1090 <OPM_WriteString@plt>
lea    -0x4(%rbx),%eax
cmp    $0x3,%eax
jae    119f <OPC_Case+0x2f>
mov    %r14,%rdi
call   1040 <OPM_WriteInt@plt>
jmp    1230 <OPC_Case+0xc0>
cmp    $0x3,%ebx
jne    11f4 <OPC_Case+0x84>
movzbl %r14b,%eax
add    $0xffffffe0,%eax
cmp    $0x5e,%eax
ja     1217 <OPC_Case+0xa7>
mov    $0x27,%edi
call   1070 <OPM_Write@plt>
lea    -0x22(%r14),%eax
cmp    $0x3a,%al
ja     11df <OPC_Case+0x6f>
movzbl %al,%eax
movabs $0x400000020000021,%rcx
bt     %rax,%rcx
jae    11df <OPC_Case+0x6f>
mov    $0x5c,%edi
call   1070 <OPM_Write@plt>
movsbl %r14b,%edi
call   1070 <OPM_Write@plt>
mov    $0x27,%edi
call   1070 <OPM_Write@plt>
jmp    1230 <OPC_Case+0xc0>
lea    0xe0e(%rip),%rdi
mov    $0x24,%esi
call   1030 <OPM_LogWStr@plt>
mov    %ebx,%edi
xor    %esi,%esi
call   1080 <OPM_LogWNum@plt>
xor    %eax,%eax
call   1050 <OPM_LogWLn@plt>
jmp    1230 <OPC_Case+0xc0>
lea    0xde8(%rip),%rdi
mov    $0x3,%esi
call   1090 <OPM_WriteString@plt>
mov    %r14,%rdi
call   1060 <OPM_WriteHex@plt>
lea    0xdf6(%rip),%rdi
mov    $0x3,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1090 <OPM_WriteString@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"case \00"
@.str.1 = [3 x i8] c"0x\00"
@.str.2 = [36 x i8] c"unhandled case in OPC.Case, form = \00"
@.str.3 = [3 x i8] c": \00"
define void @OPC_Case(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i8
store i64 %0, i64* %3
store i32 %1, i32* %4
%6 = call i32 @OPM_WriteString(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 6)
%7 = load i32, i32* %4
switch i32 %7, label %52 [
i32 3, label %8
i32 4, label %49
i32 5, label %49
i32 6, label %49
]
8: ; preds = %2
%9 = load i64, i64* %3
%10 = trunc i64 %9 to i8
store i8 %10, i8* %5
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = icmp sge i32 %12, 32
br i1 %13, label %14, label %44
14: ; preds = %8
%15 = load i8, i8* %5
%16 = zext i8 %15 to i32
%17 = icmp sle i32 %16, 126
br i1 %17, label %18, label %44
18: ; preds = %14
%19 = call i32 @OPM_Write(i8 signext 39)
%20 = load i8, i8* %5
%21 = zext i8 %20 to i32
%22 = icmp eq i32 %21, 92
br i1 %22, label %35, label %23
23: ; preds = %18
%24 = load i8, i8* %5
%25 = zext i8 %24 to i32
%26 = icmp eq i32 %25, 63
br i1 %26, label %35, label %27
27: ; preds = %23
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = icmp eq i32 %29, 39
br i1 %30, label %35, label %31
31: ; preds = %27
%32 = load i8, i8* %5
%33 = zext i8 %32 to i32
%34 = icmp eq i32 %33, 34
br i1 %34, label %35, label %39
35: ; preds = %31, %27, %23, %18
%36 = call i32 @OPM_Write(i8 signext 92)
%37 = load i8, i8* %5
%38 = call i32 @OPM_Write(i8 signext %37)
br label %42
39: ; preds = %31
%40 = load i8, i8* %5
%41 = call i32 @OPM_Write(i8 signext %40)
br label %42
42: ; preds = %39, %35
%43 = call i32 @OPM_Write(i8 signext 39)
br label %48
44: ; preds = %14, %8
%45 = call i32 @OPM_WriteString(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64 3)
%46 = load i64, i64* %3
%47 = call i32 @OPM_WriteHex(i64 %46)
br label %48
48: ; preds = %44, %42
br label %57
49: ; preds = %2, %2, %2
%50 = load i64, i64* %3
%51 = call i32 @OPM_WriteInt(i64 %50)
br label %57
52: ; preds = %2
%53 = call i32 @OPM_LogWStr(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i64 36)
%54 = load i32, i32* %4
%55 = call i32 @OPM_LogWNum(i32 %54, i64 0)
%56 = call i32 (...) @OPM_LogWLn()
br label %57
57: ; preds = %52, %49, %48
%58 = call i32 @OPM_WriteString(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i64 3)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"case \00"
@.str.1 = [3 x i8] c"0x\00"
@.str.2 = [36 x i8] c"unhandled case in OPC.Case, form = \00"
@.str.3 = [3 x i8] c": \00"
define void @OPC_Case(i64 %0, i32 %1) {
%3 = tail call i32 @OPM_WriteString(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 6)
switch i32 %1, label %22 [
i32 3, label %4
i32 4, label %20
i32 5, label %20
i32 6, label %20
]
4: ; preds = %2
%5 = trunc i64 %0 to i8
%6 = trunc i64 %0 to i32
%7 = and i32 %6, 255
%8 = add nsw i32 %7, -32
%9 = icmp ult i32 %8, 95
br i1 %9, label %10, label %17
10: ; preds = %4
%11 = tail call i32 @OPM_Write(i8 signext 39)
switch i8 %5, label %14 [
i8 92, label %12
i8 63, label %12
i8 39, label %12
i8 34, label %12
]
12: ; preds = %10, %10, %10, %10
%13 = tail call i32 @OPM_Write(i8 signext 92)
br label %14
14: ; preds = %10, %12
%15 = tail call i32 @OPM_Write(i8 signext %5)
%16 = tail call i32 @OPM_Write(i8 signext 39)
br label %26
17: ; preds = %4
%18 = tail call i32 @OPM_WriteString(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64 3)
%19 = tail call i32 @OPM_WriteHex(i64 %0)
br label %26
20: ; preds = %2, %2, %2
%21 = tail call i32 @OPM_WriteInt(i64 %0)
br label %26
22: ; preds = %2
%23 = tail call i32 @OPM_LogWStr(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i64 36)
%24 = tail call i32 @OPM_LogWNum(i32 %1, i64 0)
%25 = tail call i32 (...) @OPM_LogWLn()
br label %26
26: ; preds = %14, %17, %22, %20
%27 = tail call i32 @OPM_WriteString(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i64 3)
ret void
}