#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 */
unsigned int getStringAndHash(char *, char **, char **, unsigned int *);
unsigned int readNextName(char *start, char **first, char **last,
                          unsigned int *hash) {
  unsigned char state = 0;
  while (start[0] != '\0') {
    switch (state) {
    case 0:
      if (start[0] == '{') {
        state = 2;
      } else if (!(start[0] == ' ' || start[0] == '\t' || start[0] == '\n' ||
                   start[0] == '\t')) {
        state = 1;
      }
      break;
    case 1:
      if (start[0] == ',') {
        state = 2;
      } else if (start[0] == '}') {
        *first = start;
        *last = start;
        return 100;
      } else if (!(start[0] == ' ' || start[0] == '\t' || start[0] == '\n' ||
                   start[0] == '\t')) {
        return 104;
      }
      break;
    case 2:
      if (!(start[0] == ' ' || start[0] == '\t' || start[0] == '\n' ||
            start[0] == '\t')) {
        return getStringAndHash(start, first, last, hash);
      }
      break;
    }
    ++start;
  }
  return 104;
}


x86 assembly (clang, -O0):
<readNextName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movb   $0x0,-0x29(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     12f2 <readNextName+0x1e2>
movzbl -0x29(%rbp),%eax
mov    %eax,-0x30(%rbp)
test   %eax,%eax
je     1172 <readNextName+0x62>
jmp    1150 <readNextName+0x40>
mov    -0x30(%rbp),%eax
sub    $0x1,%eax
je     11d9 <readNextName+0xc9>
jmp    1161 <readNextName+0x51>
mov    -0x30(%rbp),%eax
sub    $0x2,%eax
je     127f <readNextName+0x16f>
jmp    12e1 <readNextName+0x1d1>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7b,%eax
jne    118b <readNextName+0x7b>
movb   $0x2,-0x29(%rbp)
jmp    11d4 <readNextName+0xc4>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     11cf <readNextName+0xbf>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
je     11cf <readNextName+0xbf>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     11cf <readNextName+0xbf>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
je     11cf <readNextName+0xbf>
movb   $0x1,-0x29(%rbp)
jmp    11d4 <readNextName+0xc4>
jmp    12e1 <readNextName+0x1d1>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
jne    11f2 <readNextName+0xe2>
movb   $0x2,-0x29(%rbp)
jmp    127a <readNextName+0x16a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7d,%eax
jne    1224 <readNextName+0x114>
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x64,-0x4(%rbp)
jmp    12f9 <readNextName+0x1e9>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1270 <readNextName+0x160>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
je     1270 <readNextName+0x160>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1270 <readNextName+0x160>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
je     1270 <readNextName+0x160>
movl   $0x68,-0x4(%rbp)
jmp    12f9 <readNextName+0x1e9>
jmp    1275 <readNextName+0x165>
jmp    127a <readNextName+0x16a>
jmp    12e1 <readNextName+0x1d1>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     12dc <readNextName+0x1cc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
je     12dc <readNextName+0x1cc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     12dc <readNextName+0x1cc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
je     12dc <readNextName+0x1cc>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1030 <getStringAndHash@plt>
mov    %eax,-0x4(%rbp)
jmp    12f9 <readNextName+0x1e9>
jmp    12e1 <readNextName+0x1d1>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112c <readNextName+0x1c>
movl   $0x68,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readNextName>:
push   %rbx
mov    (%rdi),%r11b
mov    $0x68,%eax
test   %r11b,%r11b
je     11e7 <readNextName+0xd7>
xor    %r10d,%r10d
movabs $0x100000600,%r8
lea    0xeca(%rip),%r9
jmp    1152 <readNextName+0x42>
xor    %r10d,%r10d
nopl   0x0(%rax,%rax,1)
movzbl 0x1(%rdi),%r11d
add    $0x1,%rdi
test   %r11b,%r11b
je     11e7 <readNextName+0xd7>
cmp    $0x2,%r10b
je     1180 <readNextName+0x70>
cmp    $0x1,%r10b
je     11a0 <readNextName+0x90>
test   %r10b,%r10b
jne    1140 <readNextName+0x30>
cmp    $0x1f,%r11b
jg     11bd <readNextName+0xad>
cmp    $0x9,%r11b
je     1138 <readNextName+0x28>
cmp    $0xa,%r11b
je     1138 <readNextName+0x28>
jmp    11b8 <readNextName+0xa8>
nopw   0x0(%rax,%rax,1)
cmp    $0x20,%r11b
ja     11e9 <readNextName+0xd9>
mov    $0x2,%r10b
movzbl %r11b,%ebx
bt     %rbx,%r8
jb     1140 <readNextName+0x30>
jmp    11e9 <readNextName+0xd9>
cs nopw 0x0(%rax,%rax,1)
nop
lea    -0x9(%r11),%ebx
cmp    $0x23,%bl
ja     11d6 <readNextName+0xc6>
mov    $0x2,%r10b
movzbl %bl,%ebx
movslq (%r9,%rbx,4),%rbx
add    %r9,%rbx
jmp    *%rbx
mov    $0x1,%r10b
jmp    1140 <readNextName+0x30>
cmp    $0x20,%r11b
je     1138 <readNextName+0x28>
mov    $0x2,%r10b
cmp    $0x7b,%r11b
je     1140 <readNextName+0x30>
jmp    11b8 <readNextName+0xa8>
cmp    $0x7d,%r11b
jne    11e7 <readNextName+0xd7>
mov    %rdi,(%rsi)
mov    %rdi,(%rdx)
mov    $0x64,%eax
pop    %rbx
ret
pop    %rbx
jmp    1030 <getStringAndHash@plt>

LLVM IR (-O0):
define i32 @readNextName(i8* %0, i8** %1, i8** %2, i32* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i8**
%9 = alloca i32*
%10 = alloca i8
store i8* %0, i8** %6
store i8** %1, i8*** %7
store i8** %2, i8*** %8
store i32* %3, i32** %9
store i8 0, i8* %10
br label %11
11: ; preds = %131, %4
%12 = load i8*, i8** %6
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %134
17: ; preds = %11
%18 = load i8, i8* %10
%19 = zext i8 %18 to i32
switch i32 %19, label %131 [
i32 0, label %20
i32 1, label %54
i32 2, label %100
]
20: ; preds = %17
%21 = load i8*, i8** %6
%22 = getelementptr inbounds i8, i8* %21, i64 0
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 123
br i1 %25, label %26, label %27
26: ; preds = %20
store i8 2, i8* %10
br label %53
27: ; preds = %20
%28 = load i8*, i8** %6
%29 = getelementptr inbounds i8, i8* %28, i64 0
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 32
br i1 %32, label %52, label %33
33: ; preds = %27
%34 = load i8*, i8** %6
%35 = getelementptr inbounds i8, i8* %34, i64 0
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 9
br i1 %38, label %52, label %39
39: ; preds = %33
%40 = load i8*, i8** %6
%41 = getelementptr inbounds i8, i8* %40, i64 0
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 10
br i1 %44, label %52, label %45
45: ; preds = %39
%46 = load i8*, i8** %6
%47 = getelementptr inbounds i8, i8* %46, i64 0
%48 = load i8, i8* %47
%49 = sext i8 %48 to i32
%50 = icmp eq i32 %49, 9
br i1 %50, label %52, label %51
51: ; preds = %45
store i8 1, i8* %10
br label %52
52: ; preds = %51, %45, %39, %33, %27
br label %53
53: ; preds = %52, %26
br label %131
54: ; preds = %17
%55 = load i8*, i8** %6
%56 = getelementptr inbounds i8, i8* %55, i64 0
%57 = load i8, i8* %56
%58 = sext i8 %57 to i32
%59 = icmp eq i32 %58, 44
br i1 %59, label %60, label %61
60: ; preds = %54
store i8 2, i8* %10
br label %99
61: ; preds = %54
%62 = load i8*, i8** %6
%63 = getelementptr inbounds i8, i8* %62, i64 0
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = icmp eq i32 %65, 125
br i1 %66, label %67, label %72
67: ; preds = %61
%68 = load i8*, i8** %6
%69 = load i8**, i8*** %7
store i8* %68, i8** %69
%70 = load i8*, i8** %6
%71 = load i8**, i8*** %8
store i8* %70, i8** %71
store i32 100, i32* %5
br label %135
72: ; preds = %61
%73 = load i8*, i8** %6
%74 = getelementptr inbounds i8, i8* %73, i64 0
%75 = load i8, i8* %74
%76 = sext i8 %75 to i32
%77 = icmp eq i32 %76, 32
br i1 %77, label %97, label %78
78: ; preds = %72
%79 = load i8*, i8** %6
%80 = getelementptr inbounds i8, i8* %79, i64 0
%81 = load i8, i8* %80
%82 = sext i8 %81 to i32
%83 = icmp eq i32 %82, 9
br i1 %83, label %97, label %84
84: ; preds = %78
%85 = load i8*, i8** %6
%86 = getelementptr inbounds i8, i8* %85, i64 0
%87 = load i8, i8* %86
%88 = sext i8 %87 to i32
%89 = icmp eq i32 %88, 10
br i1 %89, label %97, label %90
90: ; preds = %84
%91 = load i8*, i8** %6
%92 = getelementptr inbounds i8, i8* %91, i64 0
%93 = load i8, i8* %92
%94 = sext i8 %93 to i32
%95 = icmp eq i32 %94, 9
br i1 %95, label %97, label %96
96: ; preds = %90
store i32 104, i32* %5
br label %135
97: ; preds = %90, %84, %78, %72
br label %98
98: ; preds = %97
br label %99
99: ; preds = %98, %60
br label %131
100: ; preds = %17
%101 = load i8*, i8** %6
%102 = getelementptr inbounds i8, i8* %101, i64 0
%103 = load i8, i8* %102
%104 = sext i8 %103 to i32
%105 = icmp eq i32 %104, 32
br i1 %105, label %130, label %106
106: ; preds = %100
%107 = load i8*, i8** %6
%108 = getelementptr inbounds i8, i8* %107, i64 0
%109 = load i8, i8* %108
%110 = sext i8 %109 to i32
%111 = icmp eq i32 %110, 9
br i1 %111, label %130, label %112
112: ; preds = %106
%113 = load i8*, i8** %6
%114 = getelementptr inbounds i8, i8* %113, i64 0
%115 = load i8, i8* %114
%116 = sext i8 %115 to i32
%117 = icmp eq i32 %116, 10
br i1 %117, label %130, label %118
118: ; preds = %112
%119 = load i8*, i8** %6
%120 = getelementptr inbounds i8, i8* %119, i64 0
%121 = load i8, i8* %120
%122 = sext i8 %121 to i32
%123 = icmp eq i32 %122, 9
br i1 %123, label %130, label %124
124: ; preds = %118
%125 = load i8*, i8** %6
%126 = load i8**, i8*** %7
%127 = load i8**, i8*** %8
%128 = load i32*, i32** %9
%129 = call i32 @getStringAndHash(i8* %125, i8** %126, i8** %127, i32* %128)
store i32 %129, i32* %5
br label %135
130: ; preds = %118, %112, %106, %100
br label %131
131: ; preds = %17, %130, %99, %53
%132 = load i8*, i8** %6
%133 = getelementptr inbounds i8, i8* %132, i32 1
store i8* %133, i8** %6
br label %11
134: ; preds = %11
store i32 104, i32* %5
br label %135
135: ; preds = %134, %124, %96, %67
%136 = load i32, i32* %5
ret i32 %136
}

LLVM IR (-O2):
define i32 @readNextName(i8* %0, i8** %1, i8** %2, i32* %3) {
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %29, label %7
7: ; preds = %4, %24
%8 = phi i8 [ %27, %24 ], [ %5, %4 ]
%9 = phi i8 [ %25, %24 ], [ 0, %4 ]
%10 = phi i8* [ %26, %24 ], [ %0, %4 ]
switch i8 %9, label %24 [
i8 0, label %11
i8 1, label %13
i8 2, label %15
]
11: ; preds = %7
switch i8 %8, label %12 [
i8 123, label %24
i8 32, label %18
i8 9, label %19
i8 10, label %20
]
12: ; preds = %11
br label %24
13: ; preds = %7
switch i8 %8, label %29 [
i8 44, label %24
i8 125, label %14
i8 32, label %21
i8 9, label %22
i8 10, label %23
]
14: ; preds = %13
store i8* %10, i8** %1
store i8* %10, i8** %2
br label %29
15: ; preds = %7
switch i8 %8, label %16 [
i8 32, label %24
i8 9, label %24
i8 10, label %24
]
16: ; preds = %15
%17 = tail call i32 @getStringAndHash(i8* %10, i8** %1, i8** %2, i32* %3)
br label %29
18: ; preds = %11
br label %24
19: ; preds = %11
br label %24
20: ; preds = %11
br label %24
21: ; preds = %13
br label %24
22: ; preds = %13
br label %24
23: ; preds = %13
br label %24
24: ; preds = %15, %15, %15, %13, %23, %22, %21, %11, %20, %19, %18, %12, %7
%25 = phi i8 [ %9, %7 ], [ 2, %15 ], [ 1, %12 ], [ 2, %11 ], [ 0, %18 ], [ 0, %19 ], [ 0, %20 ], [ 2, %13 ], [ 1, %21 ], [ 1, %22 ], [ 1, %23 ], [ 2, %15 ], [ 2, %15 ]
%26 = getelementptr inbounds i8, i8* %10, i64 1
%27 = load i8, i8* %26
%28 = icmp eq i8 %27, 0
br i1 %28, label %29, label %7
29: ; preds = %13, %24, %4, %16, %14
%30 = phi i32 [ %17, %16 ], [ 100, %14 ], [ 104, %4 ], [ 104, %24 ], [ 104, %13 ]
ret i32 %30
}