user: 请从给定的汇编指令推导出C源代码：

```asm
<glob_match>:
  endbr64
  push   %r14
  mov    %rdi,%rcx
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  lea    0x1(%rdi),%rbp
  push   %rbx
  movsbl (%rdi),%edi
  test   %dil,%dil
  je     L104
  mov    %edx,%r13d
  lea    0x1(%rsi),%rbx
L124:
  lea    -0x1(%rbx),%rsi
  cmp    $0x5b,%dil
  je     L68
  jg     L135
  cmp    $0x2a,%dil
  je     L257
  cmp    $0x3f,%dil
  jne    L93
  cmpb   $0x0,-0x1(%rbx)
  mov    %rbx,%r12
  je     L205
L232:
  mov    %rbp,%rcx
L53:
  movsbl (%rcx),%edi
  lea    0x1(%rcx),%rbp
  add    $0x1,%rbx
  test   %dil,%dil
  jne    L124
L104:
  xor    %eax,%eax
  cmpb   $0x0,(%r12)
  sete   %al
  jmp    L201
  nopl   0x0(%rax)
L135:
  cmp    $0x5c,%dil
  jne    L93
  movzbl -0x1(%rbx),%esi
  lea    0x2(%rcx),%rax
  mov    %rbx,%r12
  cmp    %sil,0x1(%rcx)
  jne    L205
  mov    %rax,%rcx
  jmp    L53
  nopl   0x0(%rax)
L68:
  movzbl -0x1(%rbx),%r8d
  mov    %rbx,%r12
  test   %r8b,%r8b
  je     L205
  movzbl 0x1(%rcx),%edx
  cmp    $0x21,%dl
  sete   %al
  cmp    $0x5e,%dl
  sete   %dl
  add    $0x2,%rcx
  or     %dl,%al
  cmovne %rcx,%rbp
  mov    %eax,%r9d
  lea    0x1(%rbp),%rcx
  movzbl 0x0(%rbp),%eax
  jmp    L56
  nopl   0x0(%rax,%rax,1)
L315:
  test   %al,%al
  je     L205
L224:
  mov    %eax,%edx
  mov    %rcx,%rsi
L286:
  movzbl (%rsi),%eax
  add    $0x1,%rcx
  cmp    $0x2d,%al
  je     L100
  mov    %edx,%edi
L3:
  cmp    %dl,%r8b
  jl     L163
  cmp    %r8b,%dil
  jge    L283
L163:
  cmp    $0x5d,%al
  je     L358
L56:
  cmp    $0x5c,%al
  jne    L315
  movzbl (%rcx),%eax
  add    $0x1,%rcx
  jmp    L224
L12:
  add    $0x2,%rcx
  nopl   0x0(%rax)
L81:
  test   %al,%al
  je     L205
  movzbl (%rcx),%eax
  lea    0x1(%rcx),%rdx
  test   %al,%al
  je     L205
  cmp    $0x5c,%al
  je     L12
  mov    %rdx,%rcx
L283:
  cmp    $0x5d,%al
  jne    L81
  test   %r9b,%r9b
  je     L53
  nopl   0x0(%rax,%rax,1)
L205:
  xor    %eax,%eax
L201:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L100:
  movzbl 0x1(%rsi),%edi
  cmp    $0x5d,%dil
  je     L282
  lea    0x2(%rsi),%rax
  cmp    $0x5c,%dil
  jne    L307
  movzbl 0x2(%rsi),%edi
  lea    0x3(%rsi),%rax
L307:
  test   %dil,%dil
  je     L205
  lea    0x1(%rax),%rcx
  movzbl (%rax),%eax
  jmp    L3
  nopl   (%rax)
L282:
  cmp    %dl,%r8b
  je     L283
  mov    $0x2d,%edx
  mov    %rcx,%rsi
  jmp    L286
  nopw   0x0(%rax,%rax,1)
L93:
  test   %r13d,%r13d
  je     L215
  mov    %rbx,%r12
  cmp    %dil,-0x1(%rbx)
  je     L232
  jmp    L205
  nopl   0x0(%rax)
L257:
  pop    %rbx
  mov    %r13d,%edx
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1060 <glob_match_after_star@plt>
  nopl   0x0(%rax,%rax,1)
L215:
  call   <tolower@plt>
  movsbl -0x1(%rbx),%edi
  mov    %rbx,%r12
  mov    %eax,%r14d
  call   <tolower@plt>
  cmp    %eax,%r14d
  je     L232
  jmp    L205
  nopw   0x0(%rax,%rax,1)
L358:
  test   %r9b,%r9b
  jne    L53
  jmp    L205
```

assistant: ```c
int glob_match(const char *pattern, const char *text, const int casecmp) {
  register const char *p = pattern, *t = text;
  register char c;
  while ((c = *p++) != '\0')
    switch (c) {
    case '?':
      if (*t == '\0')
        return 0;
      else
        ++t;
      break;
    case '\\':
      if (*p++ != *t++)
        return 0;
      break;
    case '*':
      return glob_match_after_star(p, t, casecmp);
    case '[': {
      register char c1 = *t++;
      int invert;
      if (!c1)
        return (0);
      invert = ((*p == '!') || (*p == '^'));
      if (invert)
        p++;
      c = *p++;
      while (1) {
        register char cstart = c, cend = c;
        if (c == '\\') {
          cstart = *p++;
          cend = cstart;
        }
        if (c == '\0')
          return 0;
        c = *p++;
        if (c == '-' && *p != ']') {
          cend = *p++;
          if (cend == '\\')
            cend = *p++;
          if (cend == '\0')
            return 0;
          c = *p++;
        }
        if (c1 >= cstart && c1 <= cend)
          goto match;
        if (c == ']')
          break;
      }
      if (!invert)
        return 0;
      break;
    match:
      while (c != ']') {
        if (c == '\0')
          return 0;
        c = *p++;
        if (c == '\0')
          return 0;
        else if (c == '\\')
          ++p;
      }
      if (invert)
        return 0;
      break;
    }
    default:
      if (casecmp) {
        if (c != *t++)
          return 0;
      } else {
        if (tolower(c) != tolower(*t))
          return 0;
        t++;
      }
    }
  return *t == '\0';
}
```