#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*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void error_handle(char *s) {
  switch (*s) {
  case '?':
  case '\\':
  case '@':
  case '$':
  case '`':
  case '!':
    printf("(ERROR \"unknown char: '%c'\")\n", *s);
    break;
  default:
    printf("(ERROR \"unterminated string literal at EOF\")\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<error_handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
sub    $0x21,%eax
je     118b <error_handle+0x6b>
jmp    1144 <error_handle+0x24>
mov    -0xc(%rbp),%eax
sub    $0x24,%eax
je     118b <error_handle+0x6b>
jmp    1155 <error_handle+0x35>
mov    -0xc(%rbp),%eax
add    $0xffffffc1,%eax
sub    $0x2,%eax
jb     118b <error_handle+0x6b>
jmp    1169 <error_handle+0x49>
mov    -0xc(%rbp),%eax
sub    $0x5c,%eax
je     118b <error_handle+0x6b>
jmp    117a <error_handle+0x5a>
mov    -0xc(%rbp),%eax
sub    $0x60,%eax
jne    11a5 <error_handle+0x85>
jmp    118b <error_handle+0x6b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%esi
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11bd <error_handle+0x9d>
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_handle>:
push   %rax
movsbl (%rdi),%esi
lea    -0x21(%rsi),%eax
cmp    $0x3f,%eax
ja     115b <error_handle+0x2b>
movabs $0x88000000c0000009,%rcx
bt     %rax,%rcx
jae    115b <error_handle+0x2b>
lea    0xead(%rip),%rdi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"(ERROR \22unknown char: '%c'\22)\0A\00"
@.str.1 = [46 x i8] c"(ERROR \22unterminated string literal at EOF\22)\0A\00"
define void @error_handle(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %11 [
i32 63, label %6
i32 92, label %6
i32 64, label %6
i32 36, label %6
i32 96, label %6
i32 33, label %6
]
6: ; preds = %1, %1, %1, %1, %1, %1
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %14
11: ; preds = %1
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"(ERROR \22unknown char: '%c'\22)\0A\00"
@str = [45 x i8] c"(ERROR \22unterminated string literal at EOF\22)\00"
define void @error_handle(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
switch i32 %3, label %6 [
i32 63, label %4
i32 92, label %4
i32 64, label %4
i32 36, label %4
i32 96, label %4
i32 33, label %4
]
4: ; preds = %1, %1, %1, %1, %1, %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
}