#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__ llib_led_edit_match_word(unsigned char *, unsigned char *);
unsigned char *llib_led_edit_next_word(unsigned char *);
int llib_led_edit_is_in_any_group(unsigned char *group, unsigned char *s) {
  while (*group && *group != ':') {
    if (llib_led_edit_match_word(group, s))
      return 1;
    else {
      group = llib_led_edit_next_word(group);
      if (*group == '=')
        ++group;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<llib_led_edit_is_in_any_group>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1155 <llib_led_edit_is_in_any_group+0x35>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x3a,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1165 <llib_led_edit_is_in_any_group+0x45>
jmp    11bb <llib_led_edit_is_in_any_group+0x9b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <llib_led_edit_match_word@plt>
cmp    $0x0,%rax
je     1188 <llib_led_edit_is_in_any_group+0x68>
movl   $0x1,-0x4(%rbp)
jmp    11c2 <llib_led_edit_is_in_any_group+0xa2>
mov    -0x10(%rbp),%rdi
call   1040 <llib_led_edit_next_word@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x3d,%eax
jne    11b1 <llib_led_edit_is_in_any_group+0x91>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    11b6 <llib_led_edit_is_in_any_group+0x96>
jmp    1130 <llib_led_edit_is_in_any_group+0x10>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llib_led_edit_is_in_any_group>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
movzbl (%rbx),%ecx
xor    %eax,%eax
test   %cl,%cl
je     1168 <llib_led_edit_is_in_any_group+0x48>
cmp    $0x3a,%cl
je     1168 <llib_led_edit_is_in_any_group+0x48>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <llib_led_edit_match_word@plt>
test   %rax,%rax
jne    1163 <llib_led_edit_is_in_any_group+0x43>
mov    %rbx,%rdi
call   1040 <llib_led_edit_next_word@plt>
xor    %ebx,%ebx
cmpb   $0x3d,(%rax)
sete   %bl
add    %rax,%rbx
jmp    1130 <llib_led_edit_is_in_any_group+0x10>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @llib_led_edit_is_in_any_group(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 = %35, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %6
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = icmp ne i32 %14, 58
br label %16
16: ; preds = %11, %6
%17 = phi i1 [ false, %6 ], [ %15, %11 ]
br i1 %17, label %18, label %36
18: ; preds = %16
%19 = load i8*, i8** %4
%20 = load i8*, i8** %5
%21 = call i64 @llib_led_edit_match_word(i8* %19, i8* %20)
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %18
store i32 1, i32* %3
br label %37
24: ; preds = %18
%25 = load i8*, i8** %4
%26 = call i8* @llib_led_edit_next_word(i8* %25)
store i8* %26, i8** %4
%27 = load i8*, i8** %4
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
%30 = icmp eq i32 %29, 61
br i1 %30, label %31, label %34
31: ; preds = %24
%32 = load i8*, i8** %4
%33 = getelementptr inbounds i8, i8* %32, i32 1
store i8* %33, i8** %4
br label %34
34: ; preds = %31, %24
br label %35
35: ; preds = %34
br label %6
36: ; preds = %16
store i32 0, i32* %3
br label %37
37: ; preds = %36, %23
%38 = load i32, i32* %3
ret i32 %38
}

LLVM IR (-O2):
define i32 @llib_led_edit_is_in_any_group(i8* %0, i8* %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i8* [ %0, %2 ], [ %14, %9 ]
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %15
i8 58, label %15
]
6: ; preds = %3
%7 = tail call i64 @llib_led_edit_match_word(i8* %4, i8* %1)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = tail call i8* @llib_led_edit_next_word(i8* %4)
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 61
%13 = zext i1 %12 to i64
%14 = getelementptr i8, i8* %10, i64 %13
br label %3
15: ; preds = %3, %3, %6
%16 = phi i32 [ 1, %6 ], [ 0, %3 ], [ 0, %3 ]
ret i32 %16
}