#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 */
size_t strlen(char const *);
char *strstr(char const *, char const *);
bool mu__match(const char *list, const char *name) {
  const char *m = strstr(list, name);
  size_t n = strlen(name);
  return m && (m == list || m[-1] == ':') && (m[n] == '\0' || m[n] == ':');
}


x86 assembly (clang, -O0):
<mu__match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x21(%rbp)
je     11b7 <mu__match+0x97>
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     1182 <mu__match+0x62>
mov    -0x18(%rbp),%rax
movsbl -0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x3a,%ecx
mov    %al,-0x21(%rbp)
jne    11b7 <mu__match+0x97>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x22(%rbp)
je     11b1 <mu__match+0x91>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
sete   %al
mov    %al,-0x22(%rbp)
mov    -0x22(%rbp),%al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mu__match>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <strstr@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %r15,%r15
je     1168 <mu__match+0x48>
cmp    %r14,%r15
je     1151 <mu__match+0x31>
cmpb   $0x3a,-0x1(%r15)
jne    1168 <mu__match+0x48>
mov    (%r15,%rcx,1),%cl
test   %cl,%cl
je     1163 <mu__match+0x43>
xor    %eax,%eax
cmp    $0x3a,%cl
sete   %al
jmp    1168 <mu__match+0x48>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

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