#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__ tolower(char const);
int isAbbreviatedPhrase(const char *actual, const char *supplied) {
  while (1) {
    if (!*supplied)
      return 1;
    if (*supplied == '-') {
      while (*actual != '-') {
        if (!*actual)
          return 0;
        actual += 1;
      }
    } else if (tolower(*supplied) != tolower(*actual)) {
      return 0;
    }
    actual += 1;
    supplied += 1;
  }
}


x86 assembly (clang, -O0):
<isAbbreviatedPhrase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1139 <isAbbreviatedPhrase+0x29>
movl   $0x1,-0x4(%rbp)
jmp    11e7 <isAbbreviatedPhrase+0xd7>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    118d <isAbbreviatedPhrase+0x7d>
jmp    114e <isAbbreviatedPhrase+0x3e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     1188 <isAbbreviatedPhrase+0x78>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1177 <isAbbreviatedPhrase+0x67>
movl   $0x0,-0x4(%rbp)
jmp    11e7 <isAbbreviatedPhrase+0xd7>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    114e <isAbbreviatedPhrase+0x3e>
jmp    11ca <isAbbreviatedPhrase+0xba>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
je     11c5 <isAbbreviatedPhrase+0xb5>
movl   $0x0,-0x4(%rbp)
jmp    11e7 <isAbbreviatedPhrase+0xd7>
jmp    11ca <isAbbreviatedPhrase+0xba>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1120 <isAbbreviatedPhrase+0x10>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isAbbreviatedPhrase>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%r14),%al
cmp    $0x2d,%al
je     1144 <isAbbreviatedPhrase+0x34>
test   %al,%al
je     1161 <isAbbreviatedPhrase+0x51>
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %rax,%r15
movsbl (%rbx),%edi
call   1030 <tolower@plt>
cmp    %rax,%r15
je     114f <isAbbreviatedPhrase+0x3f>
jmp    1159 <isAbbreviatedPhrase+0x49>
add    $0x1,%rbx
movzbl (%rbx),%eax
test   %al,%al
je     1159 <isAbbreviatedPhrase+0x49>
cmp    $0x2d,%al
jne    1140 <isAbbreviatedPhrase+0x30>
add    $0x1,%rbx
add    $0x1,%r14
jmp    111b <isAbbreviatedPhrase+0xb>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
mov    $0x1,%eax
jmp    115b <isAbbreviatedPhrase+0x4b>

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

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