#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__ isspace(unsigned char);
char tolower(unsigned char);
int match(const char *line, const char *sender) {
  char ch, pch, first;
  const char *p, *t;
  for (first = *sender++;;) {
    if (isspace((unsigned char)(ch = *line)))
      return (0);
    ++line;
    ch = tolower((unsigned char)ch);
    if (ch != first)
      continue;
    for (p = sender, t = line;;) {
      if (!(pch = *p++))
        return (1);
      ch = tolower((unsigned char)*t++);
      if (ch != pch)
        break;
    }
  }
}


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%al
mov    %al,-0x1b(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
movzbl %al,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     116b <match+0x4b>
movl   $0x0,-0x4(%rbp)
jmp    1209 <match+0xe9>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
movzbl -0x19(%rbp),%edi
call   1040 <tolower@plt>
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
movsbl -0x1b(%rbp),%ecx
cmp    %ecx,%eax
je     1198 <match+0x78>
jmp    1144 <match+0x24>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
mov    (%rax),%al
mov    %al,-0x1a(%rbp)
cmp    $0x0,%al
jne    11d0 <match+0xb0>
movl   $0x1,-0x4(%rbp)
jmp    1209 <match+0xe9>
mov    -0x30(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x30(%rbp)
movzbl (%rax),%edi
call   1040 <tolower@plt>
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
movsbl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
je     11ff <match+0xdf>
jmp    1204 <match+0xe4>
jmp    11a8 <match+0x88>
jmp    1144 <match+0x24>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r13
mov    %rdi,%rbp
mov    (%rsi),%r15b
mov    (%rdi),%r12b
movzbl %r12b,%edi
call   1030 <isspace@plt>
xor    %r14d,%r14d
test   %rax,%rax
jne    119c <match+0x7c>
movzbl %r12b,%edi
call   1040 <tolower@plt>
cmp    %r15b,%al
jne    117e <match+0x5e>
mov    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
movzbl 0x0(%r13,%rbx,1),%r12d
test   %r12b,%r12b
je     1196 <match+0x76>
movzbl 0x0(%rbp,%rbx,1),%edi
call   1040 <tolower@plt>
add    $0x1,%rbx
cmp    %r12b,%al
je     1160 <match+0x40>
add    $0x1,%rbp
mov    0x0(%rbp),%r12b
movzbl %r12b,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1148 <match+0x28>
jmp    119c <match+0x7c>
mov    $0x1,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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