#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 */
char const *Nerror(char *);
const char *get_char_literal(const char *ip, unsigned int *lval) {
  if (*ip == '\0')
    return Nerror("Unterminated character constant");
  *lval = *ip;
  if (*ip++ == '\\') {
    switch (*ip++) {
    case '\0':
      return Nerror("Unterminated character constant");
    case '\\':
      *lval = '\\';
      break;
    case '\'':
      *lval = '\'';
      break;
    case 'b':
      *lval = '\b';
      break;
    case 'n':
      *lval = '\n';
      break;
    case 'r':
      *lval = '\r';
      break;
    case 't':
      *lval = '\t';
      break;
    case 'v':
      *lval = '\v';
      break;
    case '0':
      *lval = '\0';
      break;
    default:
      return Nerror("Unrecognized escape in character constant");
    }
  }
  return ip;
}


x86 assembly (clang, -O0):
<get_char_literal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1145 <get_char_literal+0x35>
lea    0xec9(%rip),%rdi
call   1030 <Nerror@plt>
mov    %rax,-0x8(%rbp)
jmp    12c6 <get_char_literal+0x1b6>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    12be <get_char_literal+0x1ae>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
test   %eax,%eax
je     1217 <get_char_literal+0x107>
jmp    118f <get_char_literal+0x7f>
mov    -0x1c(%rbp),%eax
sub    $0x27,%eax
je     123b <get_char_literal+0x12b>
jmp    11a0 <get_char_literal+0x90>
mov    -0x1c(%rbp),%eax
sub    $0x30,%eax
je     1295 <get_char_literal+0x185>
jmp    11b1 <get_char_literal+0xa1>
mov    -0x1c(%rbp),%eax
sub    $0x5c,%eax
je     122c <get_char_literal+0x11c>
jmp    11c2 <get_char_literal+0xb2>
mov    -0x1c(%rbp),%eax
sub    $0x62,%eax
je     124a <get_char_literal+0x13a>
jmp    11d3 <get_char_literal+0xc3>
mov    -0x1c(%rbp),%eax
sub    $0x6e,%eax
je     1259 <get_char_literal+0x149>
jmp    11e4 <get_char_literal+0xd4>
mov    -0x1c(%rbp),%eax
sub    $0x72,%eax
je     1268 <get_char_literal+0x158>
jmp    11f5 <get_char_literal+0xe5>
mov    -0x1c(%rbp),%eax
sub    $0x74,%eax
je     1277 <get_char_literal+0x167>
jmp    1206 <get_char_literal+0xf6>
mov    -0x1c(%rbp),%eax
sub    $0x76,%eax
je     1286 <get_char_literal+0x176>
jmp    12a4 <get_char_literal+0x194>
lea    0xde2(%rip),%rdi
call   1030 <Nerror@plt>
mov    %rax,-0x8(%rbp)
jmp    12c6 <get_char_literal+0x1b6>
mov    -0x18(%rbp),%rax
movl   $0x5c,(%rax)
jmp    12b9 <get_char_literal+0x1a9>
mov    -0x18(%rbp),%rax
movl   $0x27,(%rax)
jmp    12b9 <get_char_literal+0x1a9>
mov    -0x18(%rbp),%rax
movl   $0x8,(%rax)
jmp    12b9 <get_char_literal+0x1a9>
mov    -0x18(%rbp),%rax
movl   $0xa,(%rax)
jmp    12b9 <get_char_literal+0x1a9>
mov    -0x18(%rbp),%rax
movl   $0xd,(%rax)
jmp    12b9 <get_char_literal+0x1a9>
mov    -0x18(%rbp),%rax
movl   $0x9,(%rax)
jmp    12b9 <get_char_literal+0x1a9>
mov    -0x18(%rbp),%rax
movl   $0xb,(%rax)
jmp    12b9 <get_char_literal+0x1a9>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
jmp    12b9 <get_char_literal+0x1a9>
lea    0xd75(%rip),%rdi
call   1030 <Nerror@plt>
mov    %rax,-0x8(%rbp)
jmp    12c6 <get_char_literal+0x1b6>
jmp    12be <get_char_literal+0x1ae>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_char_literal>:
movsbl (%rdi),%eax
test   %eax,%eax
je     1154 <get_char_literal+0x44>
mov    %eax,(%rsi)
cmpb   $0x5c,(%rdi)
jne    1148 <get_char_literal+0x38>
movsbl 0x1(%rdi),%ecx
lea    -0x27(%rcx),%eax
cmp    $0x4f,%eax
ja     1150 <get_char_literal+0x40>
add    $0x2,%rdi
lea    0xecb(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x27,(%rsi)
mov    %rdi,%rax
ret
add    $0x1,%rdi
mov    %rdi,%rax
ret
test   %ecx,%ecx
jne    1160 <get_char_literal+0x50>
lea    0xfe5(%rip),%rdi
jmp    1030 <Nerror@plt>
lea    0xff9(%rip),%rdi
jmp    1030 <Nerror@plt>
movl   $0x0,(%rsi)
mov    %rdi,%rax
ret
movl   $0x5c,(%rsi)
mov    %rdi,%rax
ret
movl   $0x8,(%rsi)
mov    %rdi,%rax
ret
movl   $0xa,(%rsi)
mov    %rdi,%rax
ret
movl   $0xd,(%rsi)
mov    %rdi,%rax
ret
movl   $0x9,(%rsi)
mov    %rdi,%rax
ret
movl   $0xb,(%rsi)
mov    %rdi,%rax
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Unterminated character constant\00"
@.str.1 = [42 x i8] c"Unrecognized escape in character constant\00"
define i8* @get_char_literal(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %4
store i32* %1, i32** %5
%6 = load i8*, i8** %4
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i8* @Nerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
store i8* %11, i8** %3
br label %50
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = load i32*, i32** %5
store i32 %15, i32* %16
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %4
%19 = load i8, i8* %17
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 92
br i1 %21, label %22, label %48
22: ; preds = %12
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %4
%25 = load i8, i8* %23
%26 = sext i8 %25 to i32
switch i32 %26, label %45 [
i32 0, label %27
i32 92, label %29
i32 39, label %31
i32 98, label %33
i32 110, label %35
i32 114, label %37
i32 116, label %39
i32 118, label %41
i32 48, label %43
]
27: ; preds = %22
%28 = call i8* @Nerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
store i8* %28, i8** %3
br label %50
29: ; preds = %22
%30 = load i32*, i32** %5
store i32 92, i32* %30
br label %47
31: ; preds = %22
%32 = load i32*, i32** %5
store i32 39, i32* %32
br label %47
33: ; preds = %22
%34 = load i32*, i32** %5
store i32 8, i32* %34
br label %47
35: ; preds = %22
%36 = load i32*, i32** %5
store i32 10, i32* %36
br label %47
37: ; preds = %22
%38 = load i32*, i32** %5
store i32 13, i32* %38
br label %47
39: ; preds = %22
%40 = load i32*, i32** %5
store i32 9, i32* %40
br label %47
41: ; preds = %22
%42 = load i32*, i32** %5
store i32 11, i32* %42
br label %47
43: ; preds = %22
%44 = load i32*, i32** %5
store i32 0, i32* %44
br label %47
45: ; preds = %22
%46 = call i8* @Nerror(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
store i8* %46, i8** %3
br label %50
47: ; preds = %43, %41, %39, %37, %35, %33, %31, %29
br label %48
48: ; preds = %47, %12
%49 = load i8*, i8** %4
store i8* %49, i8** %3
br label %50
50: ; preds = %48, %45, %27, %10
%51 = load i8*, i8** %3
ret i8* %51
}

LLVM IR (-O2):
@.str = [32 x i8] c"Unterminated character constant\00"
@.str.1 = [42 x i8] c"Unrecognized escape in character constant\00"
define i8* @get_char_literal(i8* %0, i32* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i8* @Nerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %28
7: ; preds = %2
%8 = sext i8 %3 to i32
store i32 %8, i32* %1
%9 = getelementptr inbounds i8, i8* %0, i64 1
%10 = load i8, i8* %0
%11 = icmp eq i8 %10, 92
br i1 %11, label %12, label %28
12: ; preds = %7
%13 = getelementptr inbounds i8, i8* %0, i64 2
%14 = load i8, i8* %9
%15 = sext i8 %14 to i32
switch i32 %15, label %26 [
i32 0, label %16
i32 92, label %18
i32 39, label %19
i32 98, label %20
i32 110, label %21
i32 114, label %22
i32 116, label %23
i32 118, label %24
i32 48, label %25
]
16: ; preds = %12
%17 = tail call i8* @Nerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %28
18: ; preds = %12
store i32 92, i32* %1
br label %28
19: ; preds = %12
store i32 39, i32* %1
br label %28
20: ; preds = %12
store i32 8, i32* %1
br label %28
21: ; preds = %12
store i32 10, i32* %1
br label %28
22: ; preds = %12
store i32 13, i32* %1
br label %28
23: ; preds = %12
store i32 9, i32* %1
br label %28
24: ; preds = %12
store i32 11, i32* %1
br label %28
25: ; preds = %12
store i32 0, i32* %1
br label %28
26: ; preds = %12
%27 = tail call i8* @Nerror(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
br label %28
28: ; preds = %7, %25, %24, %23, %22, %21, %20, %19, %18, %26, %16, %5
%29 = phi i8* [ %6, %5 ], [ %27, %26 ], [ %17, %16 ], [ %13, %25 ], [ %13, %24 ], [ %13, %23 ], [ %13, %22 ], [ %13, %21 ], [ %13, %20 ], [ %13, %19 ], [ %13, %18 ], [ %9, %7 ]
ret i8* %29
}