#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 char *skip_space(unsigned char *);
unsigned char *skip_expected_word(unsigned char *ptr, unsigned char *pword,
                                  unsigned int *presult) {
  *presult = 0;
  ptr = skip_space(ptr);
  while (1) {
    unsigned char c1, c2;
    c2 = *pword;
    if (c2 == 0) {
      *presult = 1;
      return ptr;
    }
    c1 = *ptr;
    if (c1 == c2) {
      ptr++;
      pword++;
      continue;
    } else
      break;
  }
  return ptr;
}


x86 assembly (clang, -O0):
<skip_expected_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <skip_space@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x22(%rbp)
movzbl -0x22(%rbp),%eax
cmp    $0x0,%eax
jne    1168 <skip_expected_word+0x58>
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11ab <skip_expected_word+0x9b>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x21(%rbp)
movzbl -0x21(%rbp),%eax
movzbl -0x22(%rbp),%ecx
cmp    %ecx,%eax
jne    119e <skip_expected_word+0x8e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    113b <skip_expected_word+0x2b>
jmp    11a3 <skip_expected_word+0x93>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_expected_word>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
movl   $0x0,(%rdx)
call   1030 <skip_space@plt>
mov    (%rbx),%cl
test   %cl,%cl
je     1143 <skip_expected_word+0x33>
add    $0x1,%rbx
nop
cmp    %cl,(%rax)
jne    114a <skip_expected_word+0x3a>
add    $0x1,%rax
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
jne    1130 <skip_expected_word+0x20>
movl   $0x1,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @skip_expected_word(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32* %2, i32** %7
%10 = load i32*, i32** %7
store i32 0, i32* %10
%11 = load i8*, i8** %5
%12 = call i8* @skip_space(i8* %11)
store i8* %12, i8** %5
br label %13
13: ; preds = %3, %30
%14 = load i8*, i8** %6
%15 = load i8, i8* %14
store i8 %15, i8* %9
%16 = load i8, i8* %9
%17 = zext i8 %16 to i32
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %13
%20 = load i32*, i32** %7
store i32 1, i32* %20
%21 = load i8*, i8** %5
store i8* %21, i8** %4
br label %38
22: ; preds = %13
%23 = load i8*, i8** %5
%24 = load i8, i8* %23
store i8 %24, i8* %8
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = load i8, i8* %9
%28 = zext i8 %27 to i32
%29 = icmp eq i32 %26, %28
br i1 %29, label %30, label %35
30: ; preds = %22
%31 = load i8*, i8** %5
%32 = getelementptr inbounds i8, i8* %31, i32 1
store i8* %32, i8** %5
%33 = load i8*, i8** %6
%34 = getelementptr inbounds i8, i8* %33, i32 1
store i8* %34, i8** %6
br label %13
35: ; preds = %22
br label %36
36: ; preds = %35
%37 = load i8*, i8** %5
store i8* %37, i8** %4
br label %38
38: ; preds = %36, %19
%39 = load i8*, i8** %4
ret i8* %39
}

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