#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*/ die(char *);
const char *nextelement(const char *s) {
  while (*s && !((*s) == ' ' || (*s) == '\t'))
    s++;
  if (!*s)
    die("nextelement: unexpected end of string(1).");
  while (*s && ((*s) == ' ' || (*s) == '\t'))
    s++;
  if (!*s)
    die("nextelement: unexpected end of string(2).");
  return s;
}


x86 assembly (clang, -O0):
<nextelement>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     115e <nextelement+0x4e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0xa(%rbp)
je     1156 <nextelement+0x46>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    116e <nextelement+0x5e>
jmp    117f <nextelement+0x6f>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <nextelement+0xc>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1198 <nextelement+0x88>
lea    0xe6d(%rip),%rdi
call   1030 <die@plt>
jmp    119d <nextelement+0x8d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xb(%rbp)
je     11dd <nextelement+0xcd>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0xc(%rbp)
je     11d7 <nextelement+0xc7>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0xc(%rbp)
mov    -0xc(%rbp),%al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
test   $0x1,%al
jne    11ed <nextelement+0xdd>
jmp    11fe <nextelement+0xee>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    119d <nextelement+0x8d>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1217 <nextelement+0x107>
lea    0xe18(%rip),%rdi
call   1030 <die@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextelement>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rbx),%eax
test   %al,%al
je     1135 <nextelement+0x25>
cmp    $0x9,%al
je     1154 <nextelement+0x44>
cmp    $0x20,%al
je     1154 <nextelement+0x44>
add    $0x1,%rbx
jmp    1120 <nextelement+0x10>
lea    0xec4(%rip),%rdi
call   1030 <die@plt>
jmp    1154 <nextelement+0x44>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0x9,%al
je     1150 <nextelement+0x40>
cmp    $0x20,%al
je     1150 <nextelement+0x40>
test   %al,%al
jne    116f <nextelement+0x5f>
lea    0xec0(%rip),%rdi
call   1030 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"nextelement: unexpected end of string(1).\00"
@.str.1 = [42 x i8] c"nextelement: unexpected end of string(2).\00"
define i8* @nextelement(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %23, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %21
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 32
br i1 %12, label %18, label %13
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 9
br label %18
18: ; preds = %13, %8
%19 = phi i1 [ true, %8 ], [ %17, %13 ]
%20 = xor i1 %19, true
br label %21
21: ; preds = %18, %3
%22 = phi i1 [ false, %3 ], [ %20, %18 ]
br i1 %22, label %23, label %26
23: ; preds = %21
%24 = load i8*, i8** %2
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %2
br label %3
26: ; preds = %21
%27 = load i8*, i8** %2
%28 = load i8, i8* %27
%29 = icmp ne i8 %28, 0
br i1 %29, label %32, label %30
30: ; preds = %26
%31 = call i32 @die(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %32
32: ; preds = %30, %26
br label %33
33: ; preds = %52, %32
%34 = load i8*, i8** %2
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp ne i32 %36, 0
br i1 %37, label %38, label %50
38: ; preds = %33
%39 = load i8*, i8** %2
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp eq i32 %41, 32
br i1 %42, label %48, label %43
43: ; preds = %38
%44 = load i8*, i8** %2
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = icmp eq i32 %46, 9
br label %48
48: ; preds = %43, %38
%49 = phi i1 [ true, %38 ], [ %47, %43 ]
br label %50
50: ; preds = %48, %33
%51 = phi i1 [ false, %33 ], [ %49, %48 ]
br i1 %51, label %52, label %55
52: ; preds = %50
%53 = load i8*, i8** %2
%54 = getelementptr inbounds i8, i8* %53, i32 1
store i8* %54, i8** %2
br label %33
55: ; preds = %50
%56 = load i8*, i8** %2
%57 = load i8, i8* %56
%58 = icmp ne i8 %57, 0
br i1 %58, label %61, label %59
59: ; preds = %55
%60 = call i32 @die(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
br label %61
61: ; preds = %59, %55
%62 = load i8*, i8** %2
ret i8* %62
}

LLVM IR (-O2):
@.str = [42 x i8] c"nextelement: unexpected end of string(1).\00"
@.str.1 = [42 x i8] c"nextelement: unexpected end of string(2).\00"
define i8* @nextelement(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 9, label %9
i8 32, label %9
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
%8 = tail call i32 @die(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %2, %2, %7
br label %10
10: ; preds = %9, %13
%11 = phi i8* [ %14, %13 ], [ %3, %9 ]
%12 = load i8, i8* %11
switch i8 %12, label %17 [
i8 9, label %13
i8 32, label %13
i8 0, label %15
]
13: ; preds = %10, %10
%14 = getelementptr inbounds i8, i8* %11, i64 1
br label %10
15: ; preds = %10
%16 = tail call i32 @die(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
br label %17
17: ; preds = %10, %15
ret i8* %11
}