#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 */
scalar_t__ startsWith(char *, char *);
int startsWithWord(char *, char *);
size_t strlen(char *);
int startsWithWordByDelimiter(char *firstWord, char delimit, char *line) {
  if (delimit == ' ')
    return startsWithWord(firstWord, line);
  return (startsWith(firstWord, line) && line[strlen(firstWord)] == delimit);
}


x86 assembly (clang, -O0):
<startsWithWordByDelimiter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %rdx,-0x20(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x20,%eax
jne    1168 <startsWithWordByDelimiter+0x38>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <startsWithWord@plt>
mov    %eax,-0x4(%rbp)
jmp    11ba <startsWithWordByDelimiter+0x8a>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <startsWith@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x21(%rbp)
je     11af <startsWithWordByDelimiter+0x7f>
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startsWithWordByDelimiter>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
cmp    $0x20,%bpl
jne    1151 <startsWithWordByDelimiter+0x21>
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <startsWithWord@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <startsWith@plt>
test   %rax,%rax
je     1177 <startsWithWordByDelimiter+0x47>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %bpl,(%r14,%rcx,1)
sete   %al
jmp    1179 <startsWithWordByDelimiter+0x49>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @startsWithWordByDelimiter(i8* %0, i8 signext %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i8*
store i8* %0, i8** %5
store i8 %1, i8* %6
store i8* %2, i8** %7
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 32
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = load i8*, i8** %5
%13 = load i8*, i8** %7
%14 = call i32 @startsWithWord(i8* %12, i8* %13)
store i32 %14, i32* %4
br label %33
15: ; preds = %3
%16 = load i8*, i8** %5
%17 = load i8*, i8** %7
%18 = call i64 @startsWith(i8* %16, i8* %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %30
20: ; preds = %15
%21 = load i8*, i8** %7
%22 = load i8*, i8** %5
%23 = call i64 @strlen(i8* %22)
%24 = getelementptr inbounds i8, i8* %21, i64 %23
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = load i8, i8* %6
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %26, %28
br label %30
30: ; preds = %20, %15
%31 = phi i1 [ false, %15 ], [ %29, %20 ]
%32 = zext i1 %31 to i32
store i32 %32, i32* %4
br label %33
33: ; preds = %30, %11
%34 = load i32, i32* %4
ret i32 %34
}

LLVM IR (-O2):
define i32 @startsWithWordByDelimiter(i8* %0, i8 signext %1, i8* %2) {
%4 = icmp eq i8 %1, 32
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @startsWithWord(i8* %0, i8* %2)
br label %16
7: ; preds = %3
%8 = tail call i64 @startsWith(i8* %0, i8* %2)
%9 = icmp eq i64 %8, 0
br i1 %9, label %16, label %10
10: ; preds = %7
%11 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%12 = getelementptr inbounds i8, i8* %2, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, %1
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %7, %10, %5
%17 = phi i32 [ %6, %5 ], [ 0, %7 ], [ %15, %10 ]
ret i32 %17
}