user: Converte this assembly snippet into its equivalent C code:

```asm
<match>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rsi,%rbp
  jmp    L227
L445:
  lea    0x2(%rdi),%r13
  mov    %eax,%ebx
L353:
  movsbl 0x0(%rbp),%edi
  call   <tolower@plt>
  mov    %eax,%r12d
  movsbl %bl,%edi
  call   <tolower@plt>
  cmp    %al,%r12b
  jne    L273
  mov    %r13,%rdi
L447:
  add    $0x1,%rbp
  cmpb   $0x0,-0x1(%rbp)
  je     L135
L227:
  lea    0x1(%rdi),%r13
  movzbl (%rdi),%ebx
  test   %bl,%bl
  je     L346
  cmp    $0x2a,%bl
  je     L346
  cmp    $0x3f,%bl
  je     L51
  cmp    $0x5c,%bl
  jne    L353
  movzbl 0x1(%rdi),%eax
  cmp    $0x3f,%al
  je     L445
  cmp    $0x2a,%al
  jne    L353
  jmp    L445
L51:
  mov    %r13,%rdi
  jmp    L447
L346:
  test   %bl,%bl
  je     L377
L219:
  lea    0x1(%r13),%rbx
  movzbl 0x0(%r13),%edi
  test   %dil,%dil
  je     L404
L186:
  lea    -0x1(%rbx),%r12
  cmp    $0x3f,%dil
  je     L405
  cmp    $0x5c,%dil
  je     L485
  cmp    $0x2a,%dil
  je     L65
L469:
  test   %dil,%dil
  je     L52
L89:
  movsbl %dil,%edi
  call   <tolower@plt>
  mov    %eax,%r13d
  cmpb   $0x0,0x0(%rbp)
  je     L462
L116:
  add    $0x1,%rbp
  movsbl -0x1(%rbp),%edi
  call   <tolower@plt>
  cmp    %r13b,%al
  je     L44
  cmpb   $0x0,0x0(%rbp)
  jne    L116
  mov    $0x1,%eax
  jmp    L177
L377:
  movsbl 0x0(%rbp),%eax
  jmp    L177
L405:
  cmpb   $0x0,0x0(%rbp)
  jne    L129
  mov    $0x1,%eax
  jmp    L177
L129:
  add    $0x1,%rbp
L65:
  add    $0x1,%rbx
  movzbl -0x1(%rbx),%edi
  test   %dil,%dil
  jne    L186
  mov    $0x0,%eax
  jmp    L177
L485:
  movzbl (%rbx),%eax
  cmp    $0x3f,%al
  je     L155
  cmp    $0x2a,%al
  jne    L89
L155:
  lea    0x2(%r12),%rbx
  mov    %eax,%edi
  jmp    L469
L44:
  mov    %rbp,%r15
  jmp    L279
L337:
  movzbl 0x1(%rbx),%eax
  cmp    $0x3f,%al
  je     L325
  cmp    $0x2a,%al
  jne    L456
L325:
  lea    0x2(%rbx),%r13
  mov    %eax,%r14d
  jmp    L456
L85:
  cmpb   $0x0,0x0(%rbp)
  je     L147
  mov    %rbp,%r15
  mov    %r12,%r13
  jmp    L504
L406:
  mov    %r13,%rbx
L263:
  add    $0x1,%r15
  cmpb   $0x0,-0x1(%r15)
  je     L124
L279:
  lea    0x1(%rbx),%r13
  movzbl (%rbx),%r14d
  test   %r14b,%r14b
  je     L117
  cmp    $0x3f,%r14b
  je     L406
  cmp    $0x5c,%r14b
  je     L337
  cmp    $0x2a,%r14b
  je     L504
L456:
  movsbl (%r15),%edi
  call   <tolower@plt>
  mov    %eax,%ebx
  movsbl %r14b,%edi
  call   <tolower@plt>
  cmp    %al,%bl
  jne    L85
  mov    %r13,%rbx
  jmp    L263
L117:
  cmpb   $0x0,(%r15)
  je     L200
  mov    %rbp,%r15
  mov    %r12,%r13
L504:
  mov    %r15,%rbp
  jmp    L219
L200:
  mov    $0x0,%eax
  jmp    L177
L273:
  mov    $0x1,%eax
  jmp    L177
L135:
  mov    $0x1,%eax
L177:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L404:
  mov    $0x0,%eax
  jmp    L177
L52:
  mov    $0x0,%eax
  jmp    L177
L462:
  mov    $0x1,%eax
  jmp    L177
L147:
  mov    $0x1,%eax
  jmp    L177
L124:
  mov    $0x1,%eax
  jmp    L177
```

assistant: ```c
int match(const char *mask, const char *string) {
  const char *m = mask, *s = string;
  char ch;
  const char *bm, *bs;
  while ((ch = *m++) && (ch != '*'))
    switch (ch) {
    case '\\':
      if (*m == '?' || *m == '*')
        ch = *m++;
    default:
      if (tolower(*s) != tolower(ch))
        return 1;
    case '?':
      if (!*s++)
        return 1;
    };
  if (!ch)
    return *s;
got_star:
  bm = m;
  while ((ch = *m++))
    switch (ch) {
    case '?':
      if (!*s++)
        return 1;
    case '*':
      bm = m;
      continue;
    case '\\':
      if (*m == '?' || *m == '*')
        ch = *m++;
    default:
      goto break_while;
    };
break_while:
  if (!ch)
    return 0;
  ch = tolower(ch);
  if (!*s)
    return 1;
  while (tolower(*s++) != ch)
    if (!*s)
      return 1;
  bs = s;
  while ((ch = *m++)) {
    switch (ch) {
    case '*':
      goto got_star;
    case '\\':
      if (*m == '?' || *m == '*')
        ch = *m++;
    default:
      if (tolower(*s) != tolower(ch)) {
        if (!*bs)
          return 1;
        m = bm;
        s = bs;
        goto got_star;
      };
    case '?':
      if (!*s++)
        return 1;
    };
  };
  if (*s) {
    m = bm;
    s = bs;
    goto got_star;
  };
  return 0;
}
```