user: What would the C source look like for the assembly code provided here?

```asm
<glob>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x148,%rsp
  mov    %rsi,0x10(%rsp)
  mov    %edx,0x1c(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x138(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  je     L9
  mov    %rdi,%rbx
  test   %rsi,%rsi
  je     L9
  lea    0x1(%rdi),%rbp
  movzbl (%rdi),%eax
  test   %al,%al
  je     L565
  lea    0x1(%rsi),%r13
  mov    $0x0,%r14d
  jmp    L734
L203:
  mov    %rbp,%rbx
  jmp    L621
L315:
  cmp    $0x5c,%al
  jne    L576
  movzbl 0x1(%rbx),%eax
  lea    0x2(%rbx),%rbx
  jmp    L621
L576:
  mov    %rbp,%rbx
L621:
  mov    %r13,0x8(%rsp)
  cmp    %al,-0x1(%r13)
  jne    L29
L816:
  lea    0x1(%rbx),%rbp
  movzbl (%rbx),%eax
  add    $0x1,%r13
  test   %al,%al
  je     L570
L734:
  lea    -0x1(%r13),%r12
  cmp    $0x5b,%al
  je     L705
  jg     L315
  cmp    $0x2a,%al
  je     L206
  cmp    $0x3f,%al
  jne    L203
  mov    %r13,0x8(%rsp)
  movzbl -0x1(%r13),%eax
  test   %al,%al
  je     L120
  cmp    0x10(%rsp),%r12
  sete   %dl
  cmp    $0x2e,%al
  sete   %al
  test   %al,%dl
  je     L168
  cmpl   $0x0,0x1c(%rsp)
  jne    L810
L168:
  mov    %rbp,%rbx
  jmp    L816
L206:
  cmpl   $0x0,0x1c(%rsp)
  je     L217
  cmp    0x10(%rsp),%r12
  jne    L217
  mov    $0x0,%eax
  cmpb   $0x2e,(%r12)
  je     L347
L217:
  lea    0x1(%rbp),%r13
  movzbl 0x0(%rbp),%ebx
  cmp    $0x3f,%bl
  je     L489
  cmp    $0x2a,%bl
  jne    L267
L489:
  cmp    $0x3f,%bl
  je     L188
L83:
  add    $0x1,%r13
  movzbl -0x1(%r13),%ebx
  cmp    $0x2a,%bl
  je     L489
  cmp    $0x3f,%bl
  je     L489
L267:
  mov    $0x1,%eax
  test   %bl,%bl
  je     L347
  mov    %ebx,%ebp
  cmp    $0x5c,%bl
  jne    L615
  movzbl 0x0(%r13),%ebp
  jmp    L615
L188:
  lea    0x1(%r12),%rax
  cmpb   $0x0,(%r12)
  je     L819
  mov    %rax,%r12
  jmp    L83
L155:
  sub    $0x1,%r13
  mov    $0x0,%edx
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <glob>
  test   %eax,%eax
  jne    L360
L97:
  add    $0x1,%r12
  cmpb   $0x0,-0x1(%r12)
  je     L765
L615:
  cmp    $0x5b,%bl
  je     L155
  cmp    %bpl,(%r12)
  jne    L97
  jmp    L155
L705:
  mov    %r13,0x8(%rsp)
  movzbl -0x1(%r13),%r15d
  test   %r15b,%r15b
  je     L669
  cmpb   $0x21,0x1(%rbx)
  je     L232
  lea    0x30(%rsp),%rdi
  mov    %r14d,%edx
  mov    %r14d,%esi
  call   <memset@plt>
  mov    $0xffffffff,%r12d
L779:
  lea    0x1(%rbp),%rbx
  movzbl 0x0(%rbp),%eax
  mov    %eax,%edx
  cmp    $0x5d,%al
  je     L3
  test   %al,%al
  je     L3
  mov    %r14d,%ebp
  mov    %r14d,%ecx
  jmp    L33
L232:
  lea    0x30(%rsp),%rdi
  mov    %r14d,%edx
  mov    $0xff,%esi
  call   <memset@plt>
  movb   $0x0,0x30(%rsp)
  lea    0x2(%rbx),%rbp
  mov    $0x0,%r12d
  jmp    L779
L250:
  movslq %ecx,%rax
  mov    %dl,0x2e(%rsp,%rax,1)
  movzbl %dl,%edx
  mov    %r12b,0x30(%rsp,%rdx,1)
  mov    %r14d,%ebp
  cmp    $0x1,%ecx
  je     L272
L540:
  add    $0x1,%rbx
  movzbl -0x1(%rbx),%eax
  mov    %eax,%edx
  cmp    $0x5d,%al
  je     L3
  test   %al,%al
  je     L3
L33:
  test   %ebp,%ebp
  je     L723
  test   %r12b,%r12b
  je     L250
  cmp    %dl,%r15b
  jne    L250
L279:
  lea    0x1(%rbx),%rdx
  movzbl (%rbx),%eax
  cmp    $0x5d,%al
  je     L894
  test   %al,%al
  je     L894
  mov    %r14d,%ecx
  jmp    L580
L272:
  mov    $0x2,%ecx
  jmp    L540
L723:
  cmp    $0x2d,%al
  je     L74
  cmp    $0x5c,%al
  je     L288
  test   %r12b,%r12b
  je     L365
  cmp    %dl,%r15b
  je     L279
L365:
  movslq %ecx,%rax
  mov    %dl,0x2e(%rsp,%rax,1)
  movzbl %dl,%edx
  mov    %r12b,0x30(%rsp,%rdx,1)
  cmp    $0x1,%ecx
  je     L204
  cmp    $0x2,%ecx
  jne    L540
L204:
  movzbl 0x2e(%rsp),%edi
  movzbl 0x2f(%rsp),%eax
  cmp    %al,%dil
  jbe    L798
  mov    %edi,%edx
  mov    %eax,%edi
  mov    %edx,%eax
L798:
  test   %r12b,%r12b
  je     L176
  cmp    %r15b,%dil
  ja     L176
  cmp    %r15b,%al
  jae    L279
L176:
  movzbl %al,%edx
  movzbl %dil,%ecx
  sub    %ecx,%edx
  mov    %ebp,%ecx
  cmp    $0x1,%edx
  jle    L540
  lea    -0x1(%rax),%edx
  mov    %edx,%eax
  sub    %edi,%eax
  movzbl %al,%edx
  movzbl %r12b,%esi
  movzbl %dil,%edi
  lea    0x31(%rsp,%rdi,1),%rdi
  call   <memset@plt>
  mov    %ebp,%ecx
  jmp    L540
L74:
  cmp    $0x1,%ecx
  je     L123
  mov    $0x1,%ecx
  jmp    L540
L288:
  mov    $0x1,%ebp
  jmp    L540
L3:
  cmpb   $0x0,(%rbx)
  je     L561
  movzbl %r15b,%r15d
  cmpb   $0x0,0x30(%rsp,%r15,1)
  jne    L816
  mov    $0x0,%eax
  jmp    L347
L353:
  mov    %r14d,%ecx
L704:
  add    $0x1,%rdx
  movzbl -0x1(%rdx),%eax
  cmp    $0x5d,%al
  je     L840
  test   %al,%al
  je     L840
L580:
  test   %ecx,%ecx
  jne    L353
  cmp    $0x5c,%al
  je     L869
  cmp    $0x2d,%al
  jne    L704
  cmpb   $0x2d,(%rdx)
  jne    L704
  mov    $0xffffffff,%eax
  jmp    L347
L869:
  mov    $0x1,%ecx
  jmp    L704
L840:
  mov    %rdx,%rbx
  jmp    L816
L123:
  mov    $0xffffffff,%eax
  jmp    L347
L561:
  mov    $0xffffffff,%eax
  jmp    L347
L894:
  mov    %rdx,%rbx
  jmp    L816
L565:
  mov    0x10(%rsp),%rax
  mov    %rax,0x8(%rsp)
L570:
  mov    0x8(%rsp),%rax
  cmpb   $0x0,(%rax)
  sete   %al
  movzbl %al,%eax
  jmp    L347
L9:
  mov    $0x0,%eax
L347:
  mov    0x138(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L253
  add    $0x148,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L29:
  mov    $0x0,%eax
  jmp    L347
L120:
  mov    $0x0,%eax
  jmp    L347
L810:
  mov    $0x0,%eax
  jmp    L347
L819:
  mov    $0x0,%eax
  jmp    L347
L360:
  mov    $0x1,%eax
  jmp    L347
L765:
  mov    $0x0,%eax
  jmp    L347
L669:
  mov    $0x0,%eax
  jmp    L347
L253:
  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);
}
```