#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 */
struct jx_parser {
  int dummy;
};

/* Variables and functions */
int EOF;
int jx_getchar(struct jx_parser *);
int jx_scan_unicode(struct jx_parser *);
int jx_scan_string_char(struct jx_parser *s) {
  int c = jx_getchar(s);
  if (c == EOF) {
    return EOF;
  } else if (c == '\"') {
    return 0;
  } else if (c == '\\') {
    c = jx_getchar(s);
    switch (c) {
    case 'b':
      return '\b';
    case 'f':
      return '\f';
    case 'n':
      return '\n';
    case 'r':
      return '\r';
    case 't':
      return '\t';
    case 'u':
      return jx_scan_unicode(s);
    default:
      return c;
    }
  } else {
    return c;
  }
}


x86 assembly (clang, -O0):
<jx_scan_string_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <jx_getchar@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2ea6(%rip),%rcx
cmp    (%rcx),%eax
jne    115b <jx_scan_string_char+0x3b>
mov    0x2e97(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    120e <jx_scan_string_char+0xee>
cmpl   $0x22,-0x14(%rbp)
jne    1171 <jx_scan_string_char+0x51>
movl   $0x0,-0x4(%rbp)
jmp    120e <jx_scan_string_char+0xee>
cmpl   $0x5c,-0x14(%rbp)
jne    1208 <jx_scan_string_char+0xe8>
mov    -0x10(%rbp),%rdi
call   1040 <jx_getchar@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffff9e,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x13,%eax
ja     11fd <jx_scan_string_char+0xdd>
mov    -0x20(%rbp),%rax
lea    0xe59(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x8,-0x4(%rbp)
jmp    120e <jx_scan_string_char+0xee>
movl   $0xc,-0x4(%rbp)
jmp    120e <jx_scan_string_char+0xee>
movl   $0xa,-0x4(%rbp)
jmp    120e <jx_scan_string_char+0xee>
movl   $0xd,-0x4(%rbp)
jmp    120e <jx_scan_string_char+0xee>
movl   $0x9,-0x4(%rbp)
jmp    120e <jx_scan_string_char+0xee>
mov    -0x10(%rbp),%rdi
call   1030 <jx_scan_unicode@plt>
mov    %eax,-0x4(%rbp)
jmp    120e <jx_scan_string_char+0xee>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    120e <jx_scan_string_char+0xee>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jx_scan_string_char>:
push   %rbx
mov    %rdi,%rbx
call   1040 <jx_getchar@plt>
mov    0x2eb8(%rip),%rcx
cmp    (%rcx),%eax
je     1174 <jx_scan_string_char+0x54>
cmp    $0x22,%eax
je     116e <jx_scan_string_char+0x4e>
cmp    $0x5c,%eax
jne    1174 <jx_scan_string_char+0x54>
mov    %rbx,%rdi
call   1040 <jx_getchar@plt>
mov    %eax,%ecx
mov    %eax,%edx
add    $0xffffff9e,%edx
cmp    $0x13,%edx
ja     1172 <jx_scan_string_char+0x52>
mov    $0x8,%eax
lea    0xea2(%rip),%rsi
movslq (%rsi,%rdx,4),%rdx
add    %rsi,%rdx
jmp    *%rdx
mov    $0xc,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret
mov    %ecx,%eax
pop    %rbx
ret
mov    $0xa,%eax
pop    %rbx
ret
mov    $0xd,%eax
pop    %rbx
ret
mov    $0x9,%eax
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <jx_scan_unicode@plt>

LLVM IR (-O0):
%struct.jx_parser = type { i32 }
@EOF = global i32 0
define i32 @jx_scan_string_char(%struct.jx_parser* %0) {
%2 = alloca i32
%3 = alloca %struct.jx_parser*
%4 = alloca i32
store %struct.jx_parser* %0, %struct.jx_parser** %3
%5 = load %struct.jx_parser*, %struct.jx_parser** %3
%6 = call i32 @jx_getchar(%struct.jx_parser* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i32, i32* @EOF
store i32 %11, i32* %2
br label %35
12: ; preds = %1
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 34
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 0, i32* %2
br label %35
16: ; preds = %12
%17 = load i32, i32* %4
%18 = icmp eq i32 %17, 92
br i1 %18, label %19, label %33
19: ; preds = %16
%20 = load %struct.jx_parser*, %struct.jx_parser** %3
%21 = call i32 @jx_getchar(%struct.jx_parser* %20)
store i32 %21, i32* %4
%22 = load i32, i32* %4
switch i32 %22, label %31 [
i32 98, label %23
i32 102, label %24
i32 110, label %25
i32 114, label %26
i32 116, label %27
i32 117, label %28
]
23: ; preds = %19
store i32 8, i32* %2
br label %35
24: ; preds = %19
store i32 12, i32* %2
br label %35
25: ; preds = %19
store i32 10, i32* %2
br label %35
26: ; preds = %19
store i32 13, i32* %2
br label %35
27: ; preds = %19
store i32 9, i32* %2
br label %35
28: ; preds = %19
%29 = load %struct.jx_parser*, %struct.jx_parser** %3
%30 = call i32 @jx_scan_unicode(%struct.jx_parser* %29)
store i32 %30, i32* %2
br label %35
31: ; preds = %19
%32 = load i32, i32* %4
store i32 %32, i32* %2
br label %35
33: ; preds = %16
%34 = load i32, i32* %4
store i32 %34, i32* %2
br label %35
35: ; preds = %33, %31, %28, %27, %26, %25, %24, %23, %15, %10
%36 = load i32, i32* %2
ret i32 %36
}

LLVM IR (-O2):
%struct.jx_parser = type { i32 }
@EOF = global i32 0
define i32 @jx_scan_string_char(%struct.jx_parser* %0) {
%2 = tail call i32 @jx_getchar(%struct.jx_parser* %0)
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %16, label %5
5: ; preds = %1
switch i32 %2, label %15 [
i32 34, label %16
i32 92, label %6
]
6: ; preds = %5
%7 = tail call i32 @jx_getchar(%struct.jx_parser* %0)
switch i32 %7, label %14 [
i32 98, label %16
i32 102, label %8
i32 110, label %9
i32 114, label %10
i32 116, label %11
i32 117, label %12
]
8: ; preds = %6
br label %16
9: ; preds = %6
br label %16
10: ; preds = %6
br label %16
11: ; preds = %6
br label %16
12: ; preds = %6
%13 = tail call i32 @jx_scan_unicode(%struct.jx_parser* %0)
br label %16
14: ; preds = %6
br label %16
15: ; preds = %5
br label %16
16: ; preds = %6, %5, %1, %15, %14, %12, %11, %10, %9, %8
%17 = phi i32 [ %7, %14 ], [ %13, %12 ], [ 9, %11 ], [ 13, %10 ], [ 10, %9 ], [ 12, %8 ], [ %2, %15 ], [ %2, %1 ], [ 0, %5 ], [ 8, %6 ]
ret i32 %17
}