char dos_file_match_include_slash(const char *a, const char *b, char is_dir) {
  char matched = dos_file_match_ignore_case(a, b, is_dir);
  if (!matched) {
    char *lb = 0;
    if (b) {
      lb = dynprintf("%s/", b);
    }
    matched = dos_file_match_ignore_case(a, lb, is_dir);
    if (lb) {
      myfree_((lb),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/goblinhack/fatdisk/refs/heads/master/"
              "fat.c",
              __FUNCTION__, 2764);
    }
  }
  DBG2("Filter: File match [%s] [%s] matched %d", a, b, matched);
  if (!matched) {
    char *lb = 0;
    if (b) {
      lb = dynprintf("/%s", b);
    }
    matched = dos_file_match_ignore_case(a, lb, is_dir);
    if (lb) {
      myfree_((lb),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/goblinhack/fatdisk/refs/heads/master/"
              "fat.c",
              __FUNCTION__, 2783);
    }
    DBG2("Filter: File match [%s] [%s] matched %d", a, lb, matched);
  }
  return (matched);
}


x86 assembly (clang, -O0):
<dos_file_match_include_slash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movsbl -0x11(%rbp),%edx
mov    $0x0,%al
call   1040 <dos_file_match_ignore_case@plt>
mov    %al,-0x12(%rbp)
cmpb   $0x0,-0x12(%rbp)
jne    11e4 <dos_file_match_include_slash+0xa4>
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11a0 <dos_file_match_include_slash+0x60>
mov    -0x10(%rbp),%rsi
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1060 <dynprintf@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
movsbl -0x11(%rbp),%edx
mov    $0x0,%al
call   1040 <dos_file_match_ignore_case@plt>
mov    %al,-0x12(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     11df <dos_file_match_include_slash+0x9f>
mov    -0x20(%rbp),%rdi
lea    0xe38(%rip),%rsi
lea    0xeb6(%rip),%rdx
mov    $0xacc,%ecx
mov    $0x0,%al
call   1030 <myfree_@plt>
jmp    11e4 <dos_file_match_include_slash+0xa4>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
movsbl -0x12(%rbp),%ecx
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1050 <DBG2@plt>
cmpb   $0x0,-0x12(%rbp)
jne    128c <dos_file_match_include_slash+0x14c>
movq   $0x0,-0x28(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1233 <dos_file_match_include_slash+0xf3>
mov    -0x10(%rbp),%rsi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1060 <dynprintf@plt>
cltq
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
movsbl -0x11(%rbp),%edx
mov    $0x0,%al
call   1040 <dos_file_match_ignore_case@plt>
mov    %al,-0x12(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1272 <dos_file_match_include_slash+0x132>
mov    -0x28(%rbp),%rdi
lea    0xda5(%rip),%rsi
lea    0xe23(%rip),%rdx
mov    $0xadf,%ecx
mov    $0x0,%al
call   1030 <myfree_@plt>
mov    -0x8(%rbp),%rsi
mov    -0x28(%rbp),%rdx
movsbl -0x12(%rbp),%ecx
lea    0xe21(%rip),%rdi
mov    $0x0,%al
call   1050 <DBG2@plt>
movsbl -0x12(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dos_file_match_include_slash>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,%r15d
mov    %rsi,%r13
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <dos_file_match_ignore_case@plt>
mov    %eax,%ebp
test   %bpl,%bpl
je     117c <dos_file_match_include_slash+0x3c>
movsbl %bpl,%ecx
lea    0xf39(%rip),%rdi
mov    %r14,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1050 <DBG2@plt>
jmp    11fa <dos_file_match_include_slash+0xba>
test   %r13,%r13
je     11cb <dos_file_match_include_slash+0x8b>
lea    0xe78(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1060 <dynprintf@plt>
movslq %eax,%r12
mov    %r14,%rdi
mov    %r12,%rsi
mov    %r15d,%edx
xor    %eax,%eax
call   1040 <dos_file_match_ignore_case@plt>
mov    %eax,%ebp
test   %r12d,%r12d
je     11dc <dos_file_match_include_slash+0x9c>
lea    0xe51(%rip),%rsi
lea    0xecf(%rip),%rdx
mov    %r12,%rdi
mov    $0xacc,%ecx
xor    %eax,%eax
call   1030 <myfree_@plt>
jmp    11dc <dos_file_match_include_slash+0x9c>
mov    %r14,%rdi
xor    %esi,%esi
mov    %r15d,%edx
xor    %eax,%eax
call   1040 <dos_file_match_ignore_case@plt>
mov    %eax,%ebp
movsbl %bpl,%ebx
lea    0xebf(%rip),%rdi
mov    %r14,%rsi
mov    %r13,%rdx
mov    %ebx,%ecx
xor    %eax,%eax
call   1050 <DBG2@plt>
test   %bl,%bl
je     120b <dos_file_match_include_slash+0xcb>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
test   %r13,%r13
je     125d <dos_file_match_include_slash+0x11d>
lea    0xeb7(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1060 <dynprintf@plt>
movslq %eax,%r13
mov    %r14,%rdi
mov    %r13,%rsi
mov    %r15d,%edx
xor    %eax,%eax
call   1040 <dos_file_match_ignore_case@plt>
mov    %eax,%ebp
test   %r13d,%r13d
je     1276 <dos_file_match_include_slash+0x136>
lea    0xdc2(%rip),%rsi
lea    0xe40(%rip),%rdx
mov    %r13,%rdi
mov    $0xadf,%ecx
xor    %eax,%eax
call   1030 <myfree_@plt>
jmp    1162 <dos_file_match_include_slash+0x22>
xor    %r13d,%r13d
mov    %r14,%rdi
xor    %esi,%esi
mov    %r15d,%edx
xor    %eax,%eax
call   1040 <dos_file_match_ignore_case@plt>
mov    %eax,%ebp
jmp    1162 <dos_file_match_include_slash+0x22>
xor    %r13d,%r13d
jmp    1162 <dos_file_match_include_slash+0x22>

LLVM IR (-O0):
@.str = [4 x i8] c"%s/\00"
@.str.1 = [133 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/goblinhack/fatdisk/refs/heads/master/fat.c\00"
@__FUNCTION__.dos_file_match_include_slash = [29 x i8] c"dos_file_match_include_slash\00"
@.str.2 = [40 x i8] c"Filter: File match [%s] [%s] matched %d\00"
@.str.3 = [4 x i8] c"/%s\00"
define signext i8 @dos_file_match_include_slash(i8* %0, i8* %1, i8 signext %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8*
%9 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = load i8, i8* %6
%13 = sext i8 %12 to i32
%14 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @dos_file_match_ignore_case to i32 (i8*, i8*, i32, ...)*)(i8* %10, i8* %11, i32 %13)
%15 = trunc i32 %14 to i8
store i8 %15, i8* %7
%16 = load i8, i8* %7
%17 = icmp ne i8 %16, 0
br i1 %17, label %39, label %18
18: ; preds = %3
store i8* null, i8** %8
%19 = load i8*, i8** %5
%20 = icmp ne i8* %19, null
br i1 %20, label %21, label %26
21: ; preds = %18
%22 = load i8*, i8** %5
%23 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @dynprintf to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %22)
%24 = sext i32 %23 to i64
%25 = inttoptr i64 %24 to i8*
store i8* %25, i8** %8
br label %26
26: ; preds = %21, %18
%27 = load i8*, i8** %4
%28 = load i8*, i8** %8
%29 = load i8, i8* %6
%30 = sext i8 %29 to i32
%31 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @dos_file_match_ignore_case to i32 (i8*, i8*, i32, ...)*)(i8* %27, i8* %28, i32 %30)
%32 = trunc i32 %31 to i8
store i8 %32, i8* %7
%33 = load i8*, i8** %8
%34 = icmp ne i8* %33, null
br i1 %34, label %35, label %38
35: ; preds = %26
%36 = load i8*, i8** %8
%37 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @myfree_ to i32 (i8*, i8*, i8*, i32, ...)*)(i8* %36, i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @__FUNCTION__.dos_file_match_include_slash, i64 0, i64 0), i32 2764)
br label %38
38: ; preds = %35, %26
br label %39
39: ; preds = %38, %3
%40 = load i8*, i8** %4
%41 = load i8*, i8** %5
%42 = load i8, i8* %7
%43 = sext i8 %42 to i32
%44 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @DBG2 to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8* %40, i8* %41, i32 %43)
%45 = load i8, i8* %7
%46 = icmp ne i8 %45, 0
br i1 %46, label %73, label %47
47: ; preds = %39
store i8* null, i8** %9
%48 = load i8*, i8** %5
%49 = icmp ne i8* %48, null
br i1 %49, label %50, label %55
50: ; preds = %47
%51 = load i8*, i8** %5
%52 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @dynprintf to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %51)
%53 = sext i32 %52 to i64
%54 = inttoptr i64 %53 to i8*
store i8* %54, i8** %9
br label %55
55: ; preds = %50, %47
%56 = load i8*, i8** %4
%57 = load i8*, i8** %9
%58 = load i8, i8* %6
%59 = sext i8 %58 to i32
%60 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @dos_file_match_ignore_case to i32 (i8*, i8*, i32, ...)*)(i8* %56, i8* %57, i32 %59)
%61 = trunc i32 %60 to i8
store i8 %61, i8* %7
%62 = load i8*, i8** %9
%63 = icmp ne i8* %62, null
br i1 %63, label %64, label %67
64: ; preds = %55
%65 = load i8*, i8** %9
%66 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @myfree_ to i32 (i8*, i8*, i8*, i32, ...)*)(i8* %65, i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @__FUNCTION__.dos_file_match_include_slash, i64 0, i64 0), i32 2783)
br label %67
67: ; preds = %64, %55
%68 = load i8*, i8** %4
%69 = load i8*, i8** %9
%70 = load i8, i8* %7
%71 = sext i8 %70 to i32
%72 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @DBG2 to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8* %68, i8* %69, i32 %71)
br label %73
73: ; preds = %67, %39
%74 = load i8, i8* %7
ret i8 %74
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s/\00"
@.str.1 = [133 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/goblinhack/fatdisk/refs/heads/master/fat.c\00"
@__FUNCTION__.dos_file_match_include_slash = [29 x i8] c"dos_file_match_include_slash\00"
@.str.2 = [40 x i8] c"Filter: File match [%s] [%s] matched %d\00"
@.str.3 = [4 x i8] c"/%s\00"
define signext i8 @dos_file_match_include_slash(i8* %0, i8* %1, i8 signext %2) {
%4 = sext i8 %2 to i32
%5 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @dos_file_match_ignore_case to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* %1, i32 %4)
%6 = trunc i32 %5 to i8
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %42
8: ; preds = %3
%9 = icmp eq i8* %1, null
br i1 %9, label %10, label %12
10: ; preds = %8
%11 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @dos_file_match_ignore_case to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* null, i32 %4)
br label %20
12: ; preds = %8
%13 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @dynprintf to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
%16 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @dos_file_match_ignore_case to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* %15, i32 %4)
%17 = icmp eq i32 %13, 0
br i1 %17, label %20, label %18
18: ; preds = %12
%19 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @myfree_ to i32 (i8*, i8*, i8*, i32, ...)*)(i8* %15, i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @__FUNCTION__.dos_file_match_include_slash, i64 0, i64 0), i32 2764)
br label %20
20: ; preds = %10, %12, %18
%21 = phi i32 [ %16, %18 ], [ %16, %12 ], [ %11, %10 ]
%22 = trunc i32 %21 to i8
%23 = shl i32 %21, 24
%24 = ashr exact i32 %23, 24
%25 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @DBG2 to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8* %0, i8* %1, i32 %24)
%26 = icmp eq i8 %22, 0
br i1 %26, label %27, label %49
27: ; preds = %20
br i1 %9, label %28, label %30
28: ; preds = %27
%29 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @dos_file_match_ignore_case to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* null, i32 %4)
br label %38
30: ; preds = %27
%31 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @dynprintf to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %1)
%32 = sext i32 %31 to i64
%33 = inttoptr i64 %32 to i8*
%34 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @dos_file_match_ignore_case to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* %33, i32 %4)
%35 = icmp eq i32 %31, 0
br i1 %35, label %38, label %36
36: ; preds = %30
%37 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @myfree_ to i32 (i8*, i8*, i8*, i32, ...)*)(i8* %33, i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @__FUNCTION__.dos_file_match_include_slash, i64 0, i64 0), i32 2783)
br label %38
38: ; preds = %28, %36, %30
%39 = phi i32 [ %29, %28 ], [ %34, %36 ], [ %34, %30 ]
%40 = phi i8* [ null, %28 ], [ %33, %36 ], [ null, %30 ]
%41 = trunc i32 %39 to i8
br label %42
42: ; preds = %3, %38
%43 = phi i32 [ %39, %38 ], [ %5, %3 ]
%44 = phi i8* [ %40, %38 ], [ %1, %3 ]
%45 = phi i8 [ %41, %38 ], [ %6, %3 ]
%46 = shl i32 %43, 24
%47 = ashr exact i32 %46, 24
%48 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @DBG2 to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8* %0, i8* %44, i32 %47)
br label %49
49: ; preds = %42, %20
%50 = phi i8 [ %22, %20 ], [ %45, %42 ]
ret i8 %50
}