#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*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int next_blank(char *buf, unsigned int start) {
  while (buf[start]) {
    if (buf[start] == ' ' || buf[start] == '\t') {
      return start;
    }
    start++;
  }
  printf("Can't parse %s", buf);
  assert(0);
  return -1;
}


x86 assembly (clang, -O0):
<next_blank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
cmpb   $0x0,(%rax,%rcx,1)
je     1181 <next_blank+0x61>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
je     1168 <next_blank+0x48>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x9,%eax
jne    1173 <next_blank+0x53>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    119f <next_blank+0x7f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112f <next_blank+0xf>
mov    -0x10(%rbp),%rsi
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <assert@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_blank>:
push   %rax
mov    %esi,%eax
mov    %rdi,%rsi
cs nopw 0x0(%rax,%rax,1)
mov    %eax,%ecx
movzbl (%rsi,%rcx,1),%ecx
test   %cl,%cl
je     1149 <next_blank+0x29>
cmp    $0x9,%cl
je     1161 <next_blank+0x41>
cmp    $0x20,%cl
je     1161 <next_blank+0x41>
add    $0x1,%eax
jmp    1130 <next_blank+0x10>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <assert@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Can't parse %s\00"
define i32 @next_blank(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
br label %6
6: ; preds = %31, %2
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 0
br i1 %12, label %13, label %34
13: ; preds = %6
%14 = load i8*, i8** %4
%15 = load i32, i32* %5
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 32
br i1 %20, label %29, label %21
21: ; preds = %13
%22 = load i8*, i8** %4
%23 = load i32, i32* %5
%24 = zext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 9
br i1 %28, label %29, label %31
29: ; preds = %21, %13
%30 = load i32, i32* %5
store i32 %30, i32* %3
br label %38
31: ; preds = %21
%32 = load i32, i32* %5
%33 = add i32 %32, 1
store i32 %33, i32* %5
br label %6
34: ; preds = %6
%35 = load i8*, i8** %4
%36 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %35)
%37 = call i32 @assert(i32 0)
store i32 -1, i32* %3
br label %38
38: ; preds = %34, %29
%39 = load i32, i32* %3
ret i32 %39
}

LLVM IR (-O2):
@.str = [15 x i8] c"Can't parse %s\00"
define i32 @next_blank(i8* %0, i32 %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i32 [ %1, %2 ], [ %9, %8 ]
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
switch i8 %7, label %8 [
i8 0, label %10
i8 32, label %13
i8 9, label %13
]
8: ; preds = %3
%9 = add i32 %4, 1
br label %3
10: ; preds = %3
%11 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
%12 = tail call i32 @assert(i32 0)
br label %13
13: ; preds = %3, %3, %10
%14 = phi i32 [ -1, %10 ], [ %4, %3 ], [ %4, %3 ]
ret i32 %14
}