#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__ match_here(char const *, char const *);
int match_star(const char *re, const char *s) {
  int c = re[0];
  do {
    if (match_here(re + 2, s))
      return 1;
  } while (*s && (c == *s++ || c == '.'));
  return 0;
}


x86 assembly (clang, -O0):
<match_star>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x2,%rdi
mov    -0x18(%rbp),%rsi
call   1030 <match_here@plt>
cmp    $0x0,%rax
je     1151 <match_star+0x41>
movl   $0x1,-0x4(%rbp)
jmp    11af <match_star+0x9f>
jmp    1156 <match_star+0x46>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x1d(%rbp)
je     119d <match_star+0x8d>
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rax),%edx
mov    $0x1,%al
cmp    %edx,%ecx
mov    %al,-0x1e(%rbp)
je     1197 <match_star+0x87>
cmpl   $0x2e,-0x1c(%rbp)
sete   %al
mov    %al,-0x1e(%rbp)
mov    -0x1e(%rbp),%al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    112a <match_star+0x1a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match_star>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rdi),%bpl
add    $0x2,%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <match_here@plt>
test   %rax,%rax
jne    1161 <match_star+0x51>
cmp    $0x2e,%bpl
sete   %cl
movzbl (%rbx),%esi
cmp    %sil,%bpl
sete   %dl
xor    %eax,%eax
test   %sil,%sil
je     1166 <match_star+0x56>
add    $0x1,%rbx
or     %dl,%cl
jne    1130 <match_star+0x20>
jmp    1166 <match_star+0x56>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @match_star(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = getelementptr inbounds i8, i8* %0, i64 2
%5 = icmp eq i8 %3, 46
br label %6
6: ; preds = %10, %2
%7 = phi i8* [ %1, %2 ], [ %13, %10 ]
%8 = tail call i64 @match_here(i8* %4, i8* %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load i8, i8* %7
%12 = icmp ne i8 %11, 0
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = icmp eq i8 %3, %11
%15 = or i1 %5, %14
%16 = select i1 %12, i1 %15, i1 false
br i1 %16, label %6, label %17
17: ; preds = %10, %6
%18 = phi i32 [ 1, %6 ], [ 0, %10 ]
ret i32 %18
}