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

```asm
<quotaStrglob>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  movsbl (%rdi),%edx
  test   %edx,%edx
  je     L178
  mov    %rdi,%rax
  lea    0x1(%rdi),%rbx
  mov    %edx,%ecx
  mov    $0x1,%r10d
  jmp    L129
  nopl   (%rax)
L312:
  cmp    $0x5b,%edx
  je     L403
  cmp    %sil,%cl
  jne    L8
L187:
  mov    %rbx,%rax
  movsbl (%rax),%edx
  lea    0x1(%rax),%rbx
  mov    %edx,%ecx
  test   %edx,%edx
  je     L178
L129:
  cmp    $0x2a,%edx
  je     L84
  movzbl 0x0(%rbp),%esi
  add    $0x1,%rbp
  cmp    $0x3f,%edx
  jne    L312
  test   %sil,%sil
  jne    L187
  nopl   0x0(%rax)
L8:
  xor    %r8d,%r8d
L154:
  add    $0x8,%rsp
  mov    %r8d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L229:
  cmpb   $0x0,0x0(%rbp)
  lea    0x1(%rbp),%rax
  je     L8
  mov    %rax,%rbp
L89:
  mov    %r13,%rbx
L84:
  movsbl (%rbx),%r12d
  lea    0x1(%rbx),%r13
  cmp    $0x2a,%r12d
  je     L89
  cmp    $0x3f,%r12d
  je     L229
  mov    $0x1,%r8d
  test   %r12d,%r12d
  je     L154
  cmp    $0x5b,%r12d
  je     L231
L298:
  movsbl 0x0(%rbp),%r8d
  lea    0x1(%rbp),%rbx
  test   %r8d,%r8d
  jne    L309
  jmp    L154
  nopl   0x0(%rax)
L104:
  movsbl (%rbx),%r8d
  add    $0x1,%rbx
  test   %r8d,%r8d
  je     L154
L309:
  cmp    %r12d,%r8d
  jne    L104
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <quotaStrglob>
  test   %eax,%eax
  jne    L70
  mov    %rbx,%rbp
  jmp    L298
  nopw   0x0(%rax,%rax,1)
L403:
  movsbl %sil,%r8d
  test   %r8d,%r8d
  je     L154
  movsbl 0x1(%rax),%edx
  cmp    $0x5e,%edx
  je     L398
  add    $0x2,%rax
  xor    %r12d,%r12d
L244:
  xor    %esi,%esi
  cmp    $0x5d,%edx
  jne    L382
  xor    %esi,%esi
  cmp    $0x5d,%r8d
  movsbl (%rax),%edx
  sete   %sil
  add    $0x1,%rax
L382:
  test   %edx,%edx
  je     L8
  xor    %r9d,%r9d
  jmp    L100
  xchg   %ax,%ax
L299:
  cmp    %edx,%r8d
  mov    %edx,%r9d
  cmove  %r10d,%esi
L363:
  movsbl %cl,%edx
  mov    %rdi,%rax
  test   %edx,%edx
  je     L8
L100:
  cmp    $0x5d,%edx
  je     L175
  movsbl (%rax),%ecx
  lea    0x1(%rax),%rdi
  cmp    $0x2d,%edx
  jne    L299
  cmp    $0x5d,%cl
  setne  %bl
  test   %cl,%cl
  setne  %r11b
  test   %r11b,%bl
  je     L299
  test   %r9d,%r9d
  jle    L299
  cmp    %r9d,%r8d
  setge  %dil
  cmp    %ecx,%r8d
  movzbl 0x1(%rax),%ecx
  setle  %dl
  xor    %r9d,%r9d
  test   %dl,%dil
  je     L121
  mov    $0x1,%esi
  lea    0x2(%rax),%rdi
  jmp    L363
  nopl   0x0(%rax,%rax,1)
L175:
  test   %edx,%edx
  je     L8
  cmp    %esi,%r12d
  je     L8
  movsbl (%rax),%edx
  lea    0x1(%rax),%rbx
  mov    %edx,%ecx
  test   %edx,%edx
  jne    L129
L178:
  xor    %r8d,%r8d
  cmpb   $0x0,0x0(%rbp)
  sete   %r8b
  add    $0x8,%rsp
  pop    %rbx
  mov    %r8d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L398:
  movsbl 0x2(%rax),%edx
  mov    $0x1,%r12d
  add    $0x3,%rax
  jmp    L244
  nopl   0x0(%rax,%rax,1)
L121:
  lea    0x2(%rax),%rdi
  jmp    L363
L231:
  cmpb   $0x0,0x0(%rbp)
  je     L8
L357:
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <quotaStrglob>
  mov    %eax,%r8d
  test   %eax,%eax
  jne    L70
  add    $0x1,%rbp
  cmpb   $0x0,0x0(%rbp)
  jne    L357
  jmp    L154
L70:
  mov    $0x1,%r8d
  jmp    L154
```

assistant: ```c
int quotaStrglob(const char *zGlob, const char *z) {
  int c, c2;
  int invert;
  int seen;
  while ((c = (*(zGlob++))) != 0) {
    if (c == '*') {
      while ((c = (*(zGlob++))) == '*' || c == '?') {
        if (c == '?' && (*(z++)) == 0)
          return 0;
      }
      if (c == 0) {
        return 1;
      } else if (c == '[') {
        while (*z && quotaStrglob(zGlob - 1, z) == 0) {
          z++;
        }
        return (*z) != 0;
      }
      while ((c2 = (*(z++))) != 0) {
        while (c2 != c) {
          c2 = *(z++);
          if (c2 == 0)
            return 0;
        }
        if (quotaStrglob(zGlob, z))
          return 1;
      }
      return 0;
    } else if (c == '?') {
      if ((*(z++)) == 0)
        return 0;
    } else if (c == '[') {
      int prior_c = 0;
      seen = 0;
      invert = 0;
      c = *(z++);
      if (c == 0)
        return 0;
      c2 = *(zGlob++);
      if (c2 == '^') {
        invert = 1;
        c2 = *(zGlob++);
      }
      if (c2 == ']') {
        if (c == ']')
          seen = 1;
        c2 = *(zGlob++);
      }
      while (c2 && c2 != ']') {
        if (c2 == '-' && zGlob[0] != ']' && zGlob[0] != 0 && prior_c > 0) {
          c2 = *(zGlob++);
          if (c >= prior_c && c <= c2)
            seen = 1;
          prior_c = 0;
        } else {
          if (c == c2) {
            seen = 1;
          }
          prior_c = c2;
        }
        c2 = *(zGlob++);
      }
      if (c2 == 0 || (seen ^ invert) == 0)
        return 0;
    } else {
      if (c != (*(z++)))
        return 0;
    }
  }
  return *z == 0;
}
```