user: Translate the below assembly code into C programming language:

```asm
<glob>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x148,%rsp
  mov    %edx,0x10(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x138(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  sete   %al
  test   %rsi,%rsi
  sete   %dl
  or     %dl,%al
  jne    L366
  movzbl (%rdi),%eax
  mov    %rdi,%rbx
  mov    %rsi,%r13
  lea    0x1(%rdi),%rbp
  test   %al,%al
  je     L211
  lea    0x1(%rsi),%r14
L288:
  lea    -0x1(%r14),%r12
  cmp    $0x5b,%al
  je     L46
  jg     L287
  cmp    $0x2a,%al
  je     L336
  cmp    $0x3f,%al
  jne    L572
  movzbl -0x1(%r14),%eax
  mov    %r14,0x8(%rsp)
  test   %al,%al
  je     L366
  cmp    %r12,%r13
  sete   %dl
  cmp    $0x2e,%al
  sete   %al
  test   %al,%dl
  je     L21
  mov    0x10(%rsp),%edx
  test   %edx,%edx
  jne    L366
  nopl   0x0(%rax,%rax,1)
L21:
  movzbl 0x0(%rbp),%eax
  mov    %rbp,%rbx
L3:
  lea    0x1(%rbx),%rbp
  add    $0x1,%r14
  test   %al,%al
  jne    L288
L367:
  mov    0x8(%rsp),%rax
  cmpb   $0x0,(%rax)
  sete   %al
  movzbl %al,%eax
  jmp    L686
  nopl   0x0(%rax,%rax,1)
L287:
  cmp    $0x5c,%al
  jne    L572
  movzbl 0x1(%rbx),%eax
  lea    0x2(%rbx),%rbp
L572:
  mov    %r14,0x8(%rsp)
  cmp    %al,-0x1(%r14)
  je     L21
  nop
L366:
  xor    %eax,%eax
L686:
  mov    0x138(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L710
  add    $0x148,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L336:
  mov    0x10(%rsp),%eax
  test   %eax,%eax
  je     L224
  cmp    %r12,%r13
  jne    L224
  cmpb   $0x2e,(%r12)
  je     L366
  nopl   0x0(%rax)
L224:
  movzbl 0x0(%rbp),%ebx
  add    $0x1,%rbp
  cmp    $0x2a,%bl
  je     L224
  cmp    $0x3f,%bl
  jne    L419
L294:
  cmpb   $0x0,(%r12)
  lea    0x1(%r12),%rax
  je     L366
  movzbl 0x0(%rbp),%ebx
  add    $0x1,%rbp
  mov    %rax,%r12
  cmp    $0x2a,%bl
  je     L224
  cmp    $0x3f,%bl
  je     L294
L419:
  test   %bl,%bl
  je     L424
  cmp    $0x5c,%bl
  je     L797
  cmp    $0x5b,%bl
  jne    L206
  jmp    L179
  cs nopw 0x0(%rax,%rax,1)
L543:
  add    $0x1,%r12
  test   %al,%al
  je     L366
L206:
  movzbl (%r12),%eax
  cmp    %al,%bl
  jne    L543
  sub    $0x1,%rbp
  xor    %edx,%edx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <glob>
  test   %eax,%eax
  jne    L424
  movzbl (%r12),%eax
  jmp    L543
  nopl   (%rax)
L46:
  movzbl -0x1(%r14),%r15d
  mov    %r14,0x8(%rsp)
  test   %r15b,%r15b
  je     L366
  lea    0x30(%rsp),%rax
  cmpb   $0x21,0x1(%rbx)
  mov    $0x0,%edx
  mov    %rax,0x18(%rsp)
  je     L484
  xor    %esi,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    $0x1,%r11d
  mov    $0xffffffff,%r9d
L360:
  movzbl 0x0(%rbp),%eax
  lea    0x1(%rbp),%rbx
  cmp    $0x5d,%al
  je     L52
  test   %al,%al
  je     L52
  xor    %r12d,%r12d
  xor    %ebp,%ebp
  jmp    L766
  nopl   0x0(%rax)
L536:
  cmp    %al,%r15b
  jne    L141
  test   %r11b,%r11b
  jne    L255
L141:
  movslq %ebp,%rdx
  mov    %r9b,0x30(%rsp,%rax,1)
  xor    %r12d,%r12d
  cmp    $0x1,%ebp
  mov    %al,0x2e(%rsp,%rdx,1)
  mov    $0x2,%eax
  cmove  %eax,%ebp
L251:
  movzbl (%rbx),%eax
  add    $0x1,%rbx
  cmp    $0x5d,%al
  je     L52
L194:
  test   %al,%al
  je     L52
L766:
  test   %r12d,%r12d
  jne    L536
  cmp    $0x2d,%al
  je     L45
  cmp    $0x5c,%al
  je     L467
  cmp    %al,%r15b
  jne    L793
  test   %r11b,%r11b
  jne    L255
L793:
  movslq %ebp,%rdx
  mov    %r9b,0x30(%rsp,%rax,1)
  mov    %al,0x2e(%rsp,%rdx,1)
  cmp    $0x1,%ebp
  je     L457
  cmp    $0x2,%ebp
  jne    L251
L457:
  movzbl 0x2e(%rsp),%edi
  movzbl 0x2f(%rsp),%eax
  cmp    %al,%dil
  jbe    L157
  mov    %edi,%edx
  movzbl %al,%edi
  mov    %edx,%eax
L157:
  test   %r9b,%r9b
  je     L760
  cmp    %r15b,%dil
  ja     L760
  cmp    %r15b,%al
  jae    L255
L760:
  movzbl %al,%edx
  movzbl %dil,%esi
  xor    %ebp,%ebp
  sub    %esi,%edx
  cmp    $0x1,%edx
  jle    L251
  sub    $0x1,%eax
  movzbl %r9b,%esi
  add    $0x1,%rbx
  mov    %r11b,0x17(%rsp)
  sub    %edi,%eax
  mov    %r9b,0x16(%rsp)
  movzbl %al,%edx
  mov    0x18(%rsp),%rax
  lea    0x1(%rax,%rdi,1),%rdi
  call   <memset@plt>
  movzbl -0x1(%rbx),%eax
  movzbl 0x16(%rsp),%r9d
  movzbl 0x17(%rsp),%r11d
  cmp    $0x5d,%al
  jne    L194
  cs nopw 0x0(%rax,%rax,1)
L52:
  movzbl (%rbx),%eax
  test   %al,%al
  je     L362
  movzbl %r15b,%r8d
  cmpb   $0x0,0x30(%rsp,%r8,1)
  jne    L3
  jmp    L366
L604:
  movzbl (%rsi),%eax
  lea    0x1(%rsi),%rbx
  test   %al,%al
  je     L694
  cmp    $0x5d,%al
  je     L694
L255:
  movzbl (%rbx),%eax
  lea    0x1(%rbx),%rsi
  test   %al,%al
  je     L88
  cmp    $0x5d,%al
  je     L88
  add    $0x2,%rbx
  cmp    $0x5c,%al
  je     L604
  movzbl -0x1(%rbx),%edx
  lea    -0x1(%rbx),%rdi
  mov    %rbx,%rsi
  cmp    $0x2d,%al
  je     L234
L189:
  mov    %edx,%eax
  test   %dl,%dl
  je     L557
  cmp    $0x5d,%dl
  je     L557
L782:
  add    $0x1,%rbx
  cmp    $0x5c,%dl
  je     L604
  movzbl -0x1(%rbx),%edx
  lea    -0x1(%rbx),%rdi
  mov    %rbx,%rsi
  cmp    $0x2d,%al
  jne    L189
L234:
  cmp    $0x2d,%dl
  je     L362
  mov    %edx,%eax
  cmp    $0x5d,%dl
  je     L557
  test   %dl,%dl
  jne    L782
L557:
  movzbl 0x1(%rdi),%eax
  jmp    L3
  nopl   (%rax)
L467:
  mov    $0x1,%r12d
  jmp    L251
  nopl   0x0(%rax,%rax,1)
L45:
  cmp    $0x1,%ebp
  je     L362
  mov    $0x1,%ebp
  jmp    L251
  nopw   0x0(%rax,%rax,1)
L484:
  mov    $0xff,%esi
  mov    %rax,%rdi
  lea    0x2(%rbx),%rbp
  call   <memset@plt>
  movb   $0x0,0x30(%rsp)
  xor    %r11d,%r11d
  xor    %r9d,%r9d
  jmp    L360
  nopl   0x0(%rax)
L326:
  movzbl (%r12),%eax
  add    $0x1,%r12
  test   %al,%al
  je     L366
L179:
  sub    $0x1,%rbp
  xor    %edx,%edx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <glob>
  test   %eax,%eax
  je     L326
  xchg   %ax,%ax
L424:
  mov    $0x1,%eax
  jmp    L686
L797:
  movzbl 0x0(%rbp),%ebx
  jmp    L206
L694:
  movzbl 0x1(%rsi),%eax
  jmp    L3
L362:
  mov    $0xffffffff,%eax
  jmp    L686
L88:
  movzbl 0x1(%rbx),%eax
  mov    %rsi,%rbx
  jmp    L3
L211:
  mov    %rsi,0x8(%rsp)
  jmp    L367
L710:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int glob(const char *pat, const char *str, int isdotspecial) {
  char c, cnext;
  const char *str0;
  if (!pat || !str)
    return (0);
  str0 = str;
  while ((c = *pat++)) {
    switch (c) {
    case '\\':
      c = *pat++;
    default:
      if (c != *str++)
        return (0);
      break;
    case '?':
      if (!(*str) || (isdotspecial && str == str0 && *str == '.'))
        return (0);
      str++;
      break;
    case '*':
      if (isdotspecial && str == str0 && *str == '.')
        return (0);
      while ((c = *pat++) == '*' || c == '?')
        if (c == '?' && !(*str++))
          return (0);
      if (c == '\0')
        return (1);
      cnext = (c == '\\') ? *pat : c;
      while (1) {
        if ((c == '[' || *str == cnext) && glob(--pat, str, 0))
          return (1);
        if (!(*str++))
          return (0);
      }
      break;
    case '[':
      if (!(*str))
        return (0);
      else {
        unsigned char c_endpoints[2], mark, targets[256], uc, us;
        int flip_flop, isliteral;
        us = (unsigned char)(*str++);
        if (*pat != '!') {
          mark = 0xff;
          memset(targets, 0x00, sizeof(targets));
        } else {
          mark = 0x00;
          memset(targets, 0xff, sizeof(targets));
          targets[0] = 0x00;
          pat++;
        }
        flip_flop = 0;
        isliteral = 0;
        while ((uc = *pat++) && uc != ']') {
          if (isliteral) {
            isliteral = 0;
            if (mark && uc == us)
              goto hyperspace_bypass;
            c_endpoints[flip_flop] = uc;
            targets[uc] = mark;
            if (flip_flop == 1)
              flip_flop = 2;
          } else {
            switch (uc) {
            default:
              if (mark && uc == us)
                goto hyperspace_bypass;
              c_endpoints[flip_flop] = uc;
              targets[uc] = mark;
              if (flip_flop == 1)
                flip_flop = 2;
              break;
            case '\\':
              isliteral = 1;
              break;
            case '-':
              if (flip_flop == 1)
                return (-1);
              flip_flop = 1;
              break;
            }
            if (flip_flop == 2 && !isliteral) {
              unsigned char c1, c2;
              flip_flop = 0;
              c1 = c_endpoints[0];
              c2 = c_endpoints[1];
              if (c1 > c2) {
                c1 = c2;
                c2 = c_endpoints[0];
              }
              if (mark && (c1 <= us && us <= c2))
                goto hyperspace_bypass;
              if ((c2 - c1) > 1)
                memset(targets + c1 + 1, mark, (c2 - c1) - 1);
            }
          }
        }
        if (!(*pat))
          return (-1);
        if (!targets[us])
          return (0);
        break;
      hyperspace_bypass:
        isliteral = 0;
        while ((uc = *pat++) && uc != ']') {
          if (isliteral)
            isliteral = 0;
          else if (uc == '\\')
            isliteral = 1;
          else if (uc == '-' && *pat == '-')
            return (-1);
        }
        break;
      }
      break;
    }
  }
  return (!(*str) ? 1 : 0);
}
```