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

```asm
<fpattern_submatch>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  movzbl (%rdi),%r12d
  mov    %rsi,0x8(%rsp)
  mov    %edx,0x14(%rsp)
  test   %r12b,%r12b
  je     L46
  mov    %rdi,%rbx
  mov    %ecx,%r15d
L328:
  mov    0x8(%rsp),%rax
  movsbl (%rax),%r14d
  lea    0x1(%rbx),%rax
  mov    %rax,(%rsp)
  cmp    $0x5b,%r12b
  je     L133
  jg     L370
  cmp    $0x2a,%r12b
  je     L716
  cmp    $0x3f,%r12b
  jne    L590
  mov    0x14(%rsp),%eax
  test   %eax,%eax
  je     L636
  mov    (%rsp),%rbx
  sub    $0x1,%eax
  addq   $0x1,0x8(%rsp)
  mov    %eax,0x14(%rsp)
  movzbl (%rbx),%r12d
  test   %r12b,%r12b
  jne    L328
L46:
  mov    0x14(%rsp),%edx
  xor    %eax,%eax
  test   %edx,%edx
  sete   %al
  jmp    L74
  cs nopw 0x0(%rax,%rax,1)
L590:
  cmp    $0x21,%r12b
  jne    L737
  cmpb   $0x0,0x1(%rbx)
  jne    L595
  nopl   0x0(%rax)
L636:
  xor    %eax,%eax
L74:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L370:
  cmp    $0x5c,%r12b
  je     L418
  cmp    $0x7b,%r12b
  jne    L737
  movzbl 0x1(%rbx),%eax
  movl   $0x0,0x18(%rsp)
  movl   $0x1,0x1c(%rsp)
  cmp    $0x21,%al
  je     L28
L150:
  test   %al,%al
  je     L230
  cmp    $0x7d,%al
  je     L230
  mov    (%rsp),%r13
  jmp    L621
  cs nopw 0x0(%rax,%rax,1)
L417:
  add    $0x1,%r13
  mov    %ebp,%r12d
L115:
  test   %al,%al
  je     L636
  mov    %r15d,%esi
  mov    %r14d,%edi
  call   <lowercase@plt>
  mov    %r15d,%esi
  mov    %ebp,%edi
  mov    %eax,%ebx
  call   <lowercase@plt>
  cmp    %eax,%ebx
  jge    L244
  movzbl 0x0(%r13),%eax
  cmp    $0x7d,%al
  je     L455
L2:
  test   %al,%al
  je     L455
L621:
  cmp    $0x5c,%al
  jne    L373
  movzbl 0x1(%r13),%eax
  add    $0x1,%r13
L373:
  test   %al,%al
  je     L636
  movsbl %al,%ebp
  movzbl 0x1(%r13),%eax
  cmp    $0x2d,%al
  jne    L417
  movsbl 0x2(%r13),%r12d
  lea    0x2(%r13),%rax
  cmp    $0x5c,%r12b
  jne    L686
  movsbl 0x3(%r13),%r12d
  lea    0x3(%r13),%rax
L686:
  test   %r12b,%r12b
  je     L636
  lea    0x1(%rax),%r13
  movzbl 0x1(%rax),%eax
  jmp    L115
  nop
L244:
  mov    %r15d,%esi
  mov    %r14d,%edi
  call   <lowercase@plt>
  mov    %r15d,%esi
  mov    %r12d,%edi
  mov    %eax,%ebx
  call   <lowercase@plt>
  cmp    %eax,%ebx
  jle    L738
  movzbl 0x0(%r13),%eax
  cmp    $0x7d,%al
  jne    L2
  nopl   (%rax)
L455:
  mov    0x18(%rsp),%esi
L637:
  test   %al,%al
  je     L636
  test   %esi,%esi
  jne    L109
L588:
  movzbl 0x1(%r13),%r12d
  lea    0x1(%r13),%rbx
  test   %r12b,%r12b
  jne    L328
  jmp    L46
  nop
L355:
  test   %al,%al
  je     L606
  add    $0x1,%r13
L738:
  movzbl 0x0(%r13),%eax
  cmp    $0x7d,%al
  jne    L355
L606:
  mov    0x1c(%rsp),%esi
  jmp    L637
  nopw   0x0(%rax,%rax,1)
L109:
  subl   $0x1,0x14(%rsp)
  mov    0x14(%rsp),%eax
  addq   $0x1,0x8(%rsp)
  mov    0x8(%rsp),%rdx
  test   %eax,%eax
  jle    L588
  mov    (%rsp),%rax
  movsbl (%rdx),%r14d
  movzbl (%rax),%eax
  jmp    L150
L133:
  movzbl 0x1(%rbx),%r12d
  cmp    $0x21,%r12b
  je     L86
  test   %r12b,%r12b
  je     L636
  cmp    $0x5d,%r12b
  je     L636
  movl   $0x1,0x18(%rsp)
  xor    %r13d,%r13d
  jmp    L474
  nopw   0x0(%rax,%rax,1)
L591:
  add    $0x1,%rcx
  mov    %ebp,%r12d
  mov    %rcx,(%rsp)
L208:
  test   %al,%al
  je     L636
  mov    %r15d,%esi
  mov    %r14d,%edi
  call   <lowercase@plt>
  mov    %r15d,%esi
  mov    %ebp,%edi
  mov    %eax,%ebx
  call   <lowercase@plt>
  cmp    %eax,%ebx
  jge    L127
L222:
  mov    (%rsp),%rax
  movzbl (%rax),%r12d
  cmp    $0x5d,%r12b
  je     L30
  test   %r12b,%r12b
  je     L30
L474:
  xor    %eax,%eax
  cmp    $0x5c,%r12b
  sete   %al
  add    %rax,(%rsp)
  mov    (%rsp),%rcx
  movzbl (%rcx),%eax
  test   %al,%al
  je     L636
  movsbl %al,%ebp
  movzbl 0x1(%rcx),%eax
  cmp    $0x2d,%al
  jne    L591
  movsbl 0x2(%rcx),%r12d
  mov    %rcx,%rax
  cmp    $0x5c,%r12b
  je     L721
  add    $0x2,%rax
L731:
  test   %r12b,%r12b
  je     L377
  lea    0x1(%rax),%rdx
  movzbl 0x1(%rax),%eax
  mov    %rdx,(%rsp)
  jmp    L208
  nopl   0x0(%rax)
L127:
  mov    %r15d,%esi
  mov    %r14d,%edi
  call   <lowercase@plt>
  mov    %r15d,%esi
  mov    %r12d,%edi
  mov    %eax,%ebx
  call   <lowercase@plt>
  cmp    %eax,%ebx
  cmovle 0x18(%rsp),%r13d
  jmp    L222
  nopl   (%rax)
L721:
  movsbl 0x3(%rcx),%r12d
  lea    0x3(%rcx),%rax
  jmp    L731
  nopl   0x0(%rax,%rax,1)
L418:
  movsbl 0x1(%rbx),%ebp
  mov    %r15d,%esi
  mov    %r14d,%edi
  call   <lowercase@plt>
  mov    %r15d,%esi
  mov    %ebp,%edi
  mov    %eax,%r12d
  call   <lowercase@plt>
  test   %ebp,%ebp
  je     L636
  cmp    %eax,%r12d
  jne    L636
  movzbl 0x2(%rbx),%r12d
  add    $0x2,%rbx
  addq   $0x1,0x8(%rsp)
  subl   $0x1,0x14(%rsp)
  test   %r12b,%r12b
  jne    L328
  jmp    L46
  nopw   0x0(%rax,%rax,1)
L716:
  movslq 0x14(%rsp),%r12
  mov    0x8(%rsp),%r13
  xor    %ebx,%ebx
  add    %r12,%r13
  test   %r12d,%r12d
  jns    L405
  jmp    L636
  nopl   0x0(%rax)
L380:
  mov    %rax,%rbx
L405:
  mov    %r13,%rsi
  mov    (%rsp),%rdi
  mov    %r15d,%ecx
  mov    %ebx,%edx
  sub    %rbx,%rsi
  call   <fpattern_submatch>
  test   %eax,%eax
  jne    L429
  lea    0x1(%rbx),%rax
  cmp    %rbx,%r12
  jne    L380
  jmp    L636
  nopl   (%rax)
L737:
  mov    %r15d,%esi
  mov    %r14d,%edi
  call   <lowercase@plt>
  movsbl %r12b,%edi
  mov    %r15d,%esi
  mov    %eax,%ebx
  call   <lowercase@plt>
  cmp    %eax,%ebx
  jne    L636
  mov    (%rsp),%rbx
  addq   $0x1,0x8(%rsp)
  subl   $0x1,0x14(%rsp)
  movzbl (%rbx),%r12d
  test   %r12b,%r12b
  jne    L328
  jmp    L46
  nopw   0x0(%rax,%rax,1)
L595:
  mov    0x14(%rsp),%edx
  mov    0x8(%rsp),%rsi
  mov    %r15d,%ecx
  mov    %rax,%rdi
  call   <fpattern_submatch>
  test   %eax,%eax
  sete   %al
  add    $0x28,%rsp
  pop    %rbx
  movzbl %al,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L28:
  lea    0x2(%rbx),%rax
  movl   $0x1,0x18(%rsp)
  mov    %rax,(%rsp)
  movzbl 0x2(%rbx),%eax
  movl   $0x0,0x1c(%rsp)
  jmp    L150
L377:
  mov    %rax,(%rsp)
L30:
  test   %r13d,%r13d
  je     L636
L250:
  test   %r12b,%r12b
  je     L636
  mov    (%rsp),%rbx
  addq   $0x1,0x8(%rsp)
  subl   $0x1,0x14(%rsp)
  movzbl 0x1(%rbx),%r12d
  add    $0x1,%rbx
  test   %r12b,%r12b
  jne    L328
  jmp    L46
L86:
  movzbl 0x2(%rbx),%r12d
  lea    0x2(%rbx),%rax
  mov    %rax,(%rsp)
  cmp    $0x5d,%r12b
  je     L250
  test   %r12b,%r12b
  je     L636
  movl   $0x0,0x18(%rsp)
  mov    $0x1,%r13d
  jmp    L474
L429:
  mov    $0x1,%eax
  jmp    L74
L230:
  mov    0x18(%rsp),%esi
  mov    (%rsp),%r13
  jmp    L637
```

assistant: ```c
int fpattern_submatch(const char *pat, const char *fname, int flength, int keepcase) {
  int fch;
  int pch;
  int i;
  int yes, match;
  int lo, hi;
  while (*pat != '\0') {
    fch = *fname;
    pch = *pat;
    pat++;
    switch (pch) {
    case '?':
      if (flength == 0)
        return (0);
      fname++;
      flength--;
      break;
    case '*':
      i = flength;
      while (i >= 0) {
        if (fpattern_submatch(pat, fname + i, flength - i, keepcase))
          return (1);
        i--;
      }
      return (0);
    case '\\':
      pch = *pat;
      if (lowercase(fch, keepcase) != lowercase(pch, keepcase) || pch == '\0')
        return (0);
      fname++;
      flength--;
      pat++;
      break;
    case '[':
      yes = 1;
      if (*pat == '!') {
        pat++;
        yes = 0;
      }
      match = !yes;
      while (*pat != ']' && *pat != '\0') {
        if (*pat == '\\')
          pat++;
        if (*pat == '\0')
          break;
        lo = *pat++;
        hi = lo;
        if (*pat == '-') {
          pat++;
          if (*pat == '\\')
            pat++;
          if (*pat == '\0')
            break;
          hi = *pat++;
        }
        if (*pat == '\0')
          break;
        if (lowercase(fch, keepcase) >= lowercase(lo, keepcase) && lowercase(fch, keepcase) <= lowercase(hi, keepcase))
          match = yes;
      }
      if (!match)
        return (0);
      if (*pat == '\0')
        return (0);
      fname++;
      flength--;
      pat++;
      break;
    case '{':
      yes = 1;
      if (*pat == '!') {
        pat++;
        yes = 0;
      }
      do {
        const char *org_pat = pat;
        match = !yes;
        while (*pat != '}' && *pat != '\0') {
          if (*pat == '\\')
            pat++;
          if (*pat == '\0')
            break;
          lo = *pat++;
          hi = lo;
          if (*pat == '-') {
            pat++;
            if (*pat == '\\')
              pat++;
            if (*pat == '\0')
              break;
            hi = *pat++;
          }
          if (*pat == '\0')
            break;
          if (lowercase(fch, keepcase) >= lowercase(lo, keepcase) && lowercase(fch, keepcase) <= lowercase(hi, keepcase)) {
            match = yes;
            while (*pat != '}' && *pat != '\0')
              pat++;
            break;
          }
        }
        if (*pat == '\0')
          return (0);
        if (match) {
          fname++;
          flength--;
          fch = *fname;
          if (flength > 0)
            pat = org_pat;
        }
      } while (match && flength > 0);
      pat++;
      break;
    case '!':
      if (*pat == '\0')
        return (0);
      i = fpattern_submatch(pat, fname, flength, keepcase);
      return !i;
    default:
      if (lowercase(fch, keepcase) != lowercase(pch, keepcase))
        return (0);
      fname++;
      flength--;
      break;
    }
  }
  if (flength != 0)
    return (0);
  return (1);
}
```