user: Please show me the C implementation that matches the assembly code listed below:

```asm
<match>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x50(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  jmp    L233
L216:
  movsbl -0x31(%rbp),%eax
  cmp    $0x3f,%eax
  je     L166
  cmp    $0x5c,%eax
  jne    L16
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x3f,%al
  je     L116
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2a,%al
  jne    L16
L116:
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  movzbl (%rax),%eax
  mov    %al,-0x31(%rbp)
L16:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  mov    %eax,%ebx
  movsbl -0x31(%rbp),%eax
  mov    %eax,%edi
  call   <tolower@plt>
  cmp    %al,%bl
  je     L166
  mov    $0x1,%eax
  jmp    L428
L166:
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x28(%rbp)
  movzbl (%rax),%eax
  test   %al,%al
  jne    L233
  mov    $0x1,%eax
  jmp    L428
L233:
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  movzbl (%rax),%eax
  mov    %al,-0x31(%rbp)
  cmpb   $0x0,-0x31(%rbp)
  je     L237
  cmpb   $0x2a,-0x31(%rbp)
  jne    L216
L237:
  cmpb   $0x0,-0x31(%rbp)
  jne    L243
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  jmp    L428
L243:
  nop
L391:
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  jmp    L372
L426:
  movsbl -0x31(%rbp),%eax
  cmp    $0x5c,%eax
  je     L48
  cmp    $0x5c,%eax
  jg     L193
  cmp    $0x2a,%eax
  je     L94
  cmp    $0x3f,%eax
  jne    L193
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x28(%rbp)
  movzbl (%rax),%eax
  test   %al,%al
  jne    L94
  mov    $0x1,%eax
  jmp    L428
L94:
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  jmp    L372
L48:
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x3f,%al
  je     L103
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2a,%al
  jne    L193
L103:
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  movzbl (%rax),%eax
  mov    %al,-0x31(%rbp)
  jmp    L193
L372:
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  movzbl (%rax),%eax
  mov    %al,-0x31(%rbp)
  cmpb   $0x0,-0x31(%rbp)
  jne    L426
  jmp    L93
L193:
  nop
L93:
  cmpb   $0x0,-0x31(%rbp)
  jne    L21
  mov    $0x0,%eax
  jmp    L428
L21:
  movsbl -0x31(%rbp),%eax
  mov    %eax,%edi
  call   <tolower@plt>
  mov    %al,-0x31(%rbp)
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L364
  mov    $0x1,%eax
  jmp    L428
L73:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L364
  mov    $0x1,%eax
  jmp    L428
L364:
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x28(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  cmp    %al,-0x31(%rbp)
  jne    L73
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  jmp    L57
L107:
  movsbl -0x31(%rbp),%eax
  cmp    $0x5c,%eax
  je     L487
  cmp    $0x5c,%eax
  jg     L384
  cmp    $0x2a,%eax
  je     L391
  cmp    $0x3f,%eax
  je     L456
  jmp    L384
L487:
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x3f,%al
  je     L309
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2a,%al
  jne    L384
L309:
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  movzbl (%rax),%eax
  mov    %al,-0x31(%rbp)
L384:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  mov    %eax,%ebx
  movsbl -0x31(%rbp),%eax
  mov    %eax,%edi
  call   <tolower@plt>
  cmp    %al,%bl
  je     L456
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L220
  mov    $0x1,%eax
  jmp    L428
L220:
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  jmp    L391
L456:
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x28(%rbp)
  movzbl (%rax),%eax
  test   %al,%al
  jne    L57
  mov    $0x1,%eax
  jmp    L428
L57:
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  movzbl (%rax),%eax
  mov    %al,-0x31(%rbp)
  cmpb   $0x0,-0x31(%rbp)
  jne    L107
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L347
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  jmp    L391
L347:
  mov    $0x0,%eax
L428:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

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;
}
```