#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*/ Util_caseInsensitiveCompare(char const, char);
char *Util_bufferStartsWith(const char *token, char *buffer) {
  for (; *token; ++buffer, ++token) {
    if (!(*buffer))
      return NULL;
    if (!Util_caseInsensitiveCompare(*token, *buffer))
      return NULL;
  }
  for (; *buffer && (*buffer == ' ' || *buffer == '\t'); ++buffer) {
  }
  return buffer;
}


x86 assembly (clang, -O0):
<Util_bufferStartsWith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1194 <Util_bufferStartsWith+0x84>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1147 <Util_bufferStartsWith+0x37>
movq   $0x0,-0x8(%rbp)
jmp    1207 <Util_bufferStartsWith+0xf7>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
movsbl %cl,%edi
movsbl (%rax),%esi
call   1030 <Util_caseInsensitiveCompare@plt>
cmp    $0x0,%eax
jne    1172 <Util_bufferStartsWith+0x62>
movq   $0x0,-0x8(%rbp)
jmp    1207 <Util_bufferStartsWith+0xf7>
jmp    1177 <Util_bufferStartsWith+0x67>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <Util_bufferStartsWith+0x10>
jmp    1199 <Util_bufferStartsWith+0x89>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     11d9 <Util_bufferStartsWith+0xc9>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x1a(%rbp)
je     11d3 <Util_bufferStartsWith+0xc3>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x1a(%rbp)
mov    -0x1a(%rbp),%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    11e9 <Util_bufferStartsWith+0xd9>
jmp    11ff <Util_bufferStartsWith+0xef>
jmp    11ee <Util_bufferStartsWith+0xde>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1199 <Util_bufferStartsWith+0x89>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Util_bufferStartsWith>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1164 <Util_bufferStartsWith+0x54>
mov    %rdi,%r14
add    $0x1,%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rbx),%ecx
test   %cl,%cl
je     1171 <Util_bufferStartsWith+0x61>
movsbl %al,%edi
movsbl %cl,%esi
call   1030 <Util_caseInsensitiveCompare@plt>
test   %eax,%eax
je     1171 <Util_bufferStartsWith+0x61>
add    $0x1,%rbx
movzbl (%r14),%eax
add    $0x1,%r14
test   %al,%al
jne    1130 <Util_bufferStartsWith+0x20>
jmp    1164 <Util_bufferStartsWith+0x54>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0x20,%al
je     1160 <Util_bufferStartsWith+0x50>
cmp    $0x9,%al
je     1160 <Util_bufferStartsWith+0x50>
jmp    1173 <Util_bufferStartsWith+0x63>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @Util_bufferStartsWith(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
br label %6
6: ; preds = %24, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %29
10: ; preds = %6
%11 = load i8*, i8** %5
%12 = load i8, i8* %11
%13 = icmp ne i8 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %10
store i8* null, i8** %3
br label %55
15: ; preds = %10
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = load i8*, i8** %5
%19 = load i8, i8* %18
%20 = call i32 @Util_caseInsensitiveCompare(i8 signext %17, i8 signext %19)
%21 = icmp ne i32 %20, 0
br i1 %21, label %23, label %22
22: ; preds = %15
store i8* null, i8** %3
br label %55
23: ; preds = %15
br label %24
24: ; preds = %23
%25 = load i8*, i8** %5
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %5
%27 = load i8*, i8** %4
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %4
br label %6
29: ; preds = %6
br label %30
30: ; preds = %50, %29
%31 = load i8*, i8** %5
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %47
35: ; preds = %30
%36 = load i8*, i8** %5
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp eq i32 %38, 32
br i1 %39, label %45, label %40
40: ; preds = %35
%41 = load i8*, i8** %5
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 9
br label %45
45: ; preds = %40, %35
%46 = phi i1 [ true, %35 ], [ %44, %40 ]
br label %47
47: ; preds = %45, %30
%48 = phi i1 [ false, %30 ], [ %46, %45 ]
br i1 %48, label %49, label %53
49: ; preds = %47
br label %50
50: ; preds = %49
%51 = load i8*, i8** %5
%52 = getelementptr inbounds i8, i8* %51, i32 1
store i8* %52, i8** %5
br label %30
53: ; preds = %47
%54 = load i8*, i8** %5
store i8* %54, i8** %3
br label %55
55: ; preds = %53, %22, %14
%56 = load i8*, i8** %3
ret i8* %56
}

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