#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 getValue(char *, char **, char **, unsigned char *);
unsigned int readNextValue(char *start, char **first, char **last,
                           unsigned char *type) {
  unsigned char state = 3;
  ++start;
  while (start[0] != '\0') {
    switch (state) {
    case 3:
      if (start[0] == ':') {
        state = 4;
      } else if (!(start[0] == ' ' || start[0] == '\t' || start[0] == '\n' ||
                   start[0] == '\t')) {
        return 104;
      }
      break;
    case 4:
      return getValue(start, first, last, type);
    }
    ++start;
  }
  return 104;
}


x86 assembly (clang, -O0):
<readNextValue>:
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   $0x3,-0x29(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     120b <readNextValue+0xfb>
movzbl -0x29(%rbp),%eax
mov    %eax,-0x30(%rbp)
sub    $0x3,%eax
je     116e <readNextValue+0x5e>
jmp    115d <readNextValue+0x4d>
mov    -0x30(%rbp),%eax
sub    $0x4,%eax
je     11dd <readNextValue+0xcd>
jmp    11fa <readNextValue+0xea>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
jne    1187 <readNextValue+0x77>
movb   $0x4,-0x29(%rbp)
jmp    11d8 <readNextValue+0xc8>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     11d3 <readNextValue+0xc3>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
je     11d3 <readNextValue+0xc3>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     11d3 <readNextValue+0xc3>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
je     11d3 <readNextValue+0xc3>
movl   $0x68,-0x4(%rbp)
jmp    1212 <readNextValue+0x102>
jmp    11d8 <readNextValue+0xc8>
jmp    11fa <readNextValue+0xea>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1030 <getValue@plt>
mov    %eax,-0x4(%rbp)
jmp    1212 <readNextValue+0x102>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1138 <readNextValue+0x28>
movl   $0x68,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readNextValue>:
mov    0x1(%rdi),%al
test   %al,%al
je     1165 <readNextValue+0x55>
add    $0x1,%rdi
mov    $0x3,%r8b
jmp    1132 <readNextValue+0x22>
cmp    $0x4,%r8b
je     116b <readNextValue+0x5b>
movzbl 0x1(%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1165 <readNextValue+0x55>
cmp    $0x3,%r8b
jne    1120 <readNextValue+0x10>
cmp    $0x1f,%al
jg     1150 <readNextValue+0x40>
cmp    $0x9,%al
je     1160 <readNextValue+0x50>
cmp    $0xa,%al
je     1160 <readNextValue+0x50>
jmp    1165 <readNextValue+0x55>
cs nopw 0x0(%rax,%rax,1)
cmp    $0x20,%al
je     1160 <readNextValue+0x50>
mov    $0x4,%r8b
cmp    $0x3a,%al
je     1126 <readNextValue+0x16>
jmp    1165 <readNextValue+0x55>
nopl   (%rax)
mov    $0x3,%r8b
jmp    1126 <readNextValue+0x16>
mov    $0x68,%eax
ret
jmp    1030 <getValue@plt>

LLVM IR (-O0):
define i32 @readNextValue(i8* %0, i8** %1, i8** %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i8**
%9 = alloca i8*
%10 = alloca i8
store i8* %0, i8** %6
store i8** %1, i8*** %7
store i8** %2, i8*** %8
store i8* %3, i8** %9
store i8 3, i8* %10
%11 = load i8*, i8** %6
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %6
br label %13
13: ; preds = %62, %4
%14 = load i8*, i8** %6
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %65
19: ; preds = %13
%20 = load i8, i8* %10
%21 = zext i8 %20 to i32
switch i32 %21, label %62 [
i32 3, label %22
i32 4, label %56
]
22: ; preds = %19
%23 = load i8*, i8** %6
%24 = getelementptr inbounds i8, i8* %23, i64 0
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 58
br i1 %27, label %28, label %29
28: ; preds = %22
store i8 4, i8* %10
br label %55
29: ; preds = %22
%30 = load i8*, i8** %6
%31 = getelementptr inbounds i8, i8* %30, i64 0
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 32
br i1 %34, label %54, label %35
35: ; preds = %29
%36 = load i8*, i8** %6
%37 = getelementptr inbounds i8, i8* %36, i64 0
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 9
br i1 %40, label %54, label %41
41: ; preds = %35
%42 = load i8*, i8** %6
%43 = getelementptr inbounds i8, i8* %42, i64 0
%44 = load i8, i8* %43
%45 = sext i8 %44 to i32
%46 = icmp eq i32 %45, 10
br i1 %46, label %54, label %47
47: ; preds = %41
%48 = load i8*, i8** %6
%49 = getelementptr inbounds i8, i8* %48, i64 0
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = icmp eq i32 %51, 9
br i1 %52, label %54, label %53
53: ; preds = %47
store i32 104, i32* %5
br label %66
54: ; preds = %47, %41, %35, %29
br label %55
55: ; preds = %54, %28
br label %62
56: ; preds = %19
%57 = load i8*, i8** %6
%58 = load i8**, i8*** %7
%59 = load i8**, i8*** %8
%60 = load i8*, i8** %9
%61 = call i32 @getValue(i8* %57, i8** %58, i8** %59, i8* %60)
store i32 %61, i32* %5
br label %66
62: ; preds = %19, %55
%63 = load i8*, i8** %6
%64 = getelementptr inbounds i8, i8* %63, i32 1
store i8* %64, i8** %6
br label %13
65: ; preds = %13
store i32 104, i32* %5
br label %66
66: ; preds = %65, %56, %53
%67 = load i32, i32* %5
ret i32 %67
}

LLVM IR (-O2):
define i32 @readNextValue(i8* %0, i8** %1, i8** %2, i8* %3) {
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %23, label %8
8: ; preds = %4, %18
%9 = phi i8 [ %21, %18 ], [ %6, %4 ]
%10 = phi i8* [ %20, %18 ], [ %5, %4 ]
%11 = phi i8 [ %19, %18 ], [ 3, %4 ]
switch i8 %11, label %18 [
i8 3, label %12
i8 4, label %13
]
12: ; preds = %8
switch i8 %9, label %23 [
i8 58, label %18
i8 32, label %15
i8 9, label %16
i8 10, label %17
]
13: ; preds = %8
%14 = tail call i32 @getValue(i8* %10, i8** %1, i8** %2, i8* %3)
br label %23
15: ; preds = %12
br label %18
16: ; preds = %12
br label %18
17: ; preds = %12
br label %18
18: ; preds = %12, %17, %16, %15, %8
%19 = phi i8 [ %11, %8 ], [ 4, %12 ], [ 3, %15 ], [ 3, %16 ], [ 3, %17 ]
%20 = getelementptr inbounds i8, i8* %10, i64 1
%21 = load i8, i8* %20
%22 = icmp eq i8 %21, 0
br i1 %22, label %23, label %8
23: ; preds = %12, %18, %4, %13
%24 = phi i32 [ %14, %13 ], [ 104, %4 ], [ 104, %18 ], [ 104, %12 ]
ret i32 %24
}