user: Please show me the C implementation that matches the assembly code listed below:

```asm
<stringmatchlen>:
  endbr64
  push   %r15
  sub    $0x1,%ecx
  push   %r14
  push   %r13
  lea    0x1(%rdx),%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x18,%rsp
L189:
  lea    -0x1(%r13),%r14
  lea    0x1(%rcx),%r15d
  test   %ebx,%ebx
  je     L385
  movsbl (%r12),%edi
  cmp    $0x5b,%dil
  je     L99
  jg     L363
  cmp    $0x2a,%dil
  je     L195
  cmp    $0x3f,%dil
  jne    L156
  test   %r15d,%r15d
  je     L273
L283:
  mov    %ecx,%eax
  mov    %r12,%rbp
L432:
  lea    0x1(%rbp),%r12
  sub    $0x1,%ebx
  add    $0x1,%r13
  sub    $0x1,%ecx
  test   %eax,%eax
  jne    L189
  cmpb   $0x2a,0x1(%rbp)
  jne    L289
  mov    %r12,%rax
  lea    (%rbx,%r12,1),%edx
  nopl   0x0(%rax,%rax,1)
L218:
  add    $0x1,%rax
  mov    %edx,%r15d
  sub    %eax,%r15d
  cmpb   $0x2a,(%rax)
  je     L218
L385:
  test   %r15d,%r15d
  sete   %r15b
  movzbl %r15b,%r15d
L273:
  add    $0x18,%rsp
  mov    %r15d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L363:
  cmp    $0x5c,%dil
  jne    L156
  cmp    $0x1,%ebx
  jle    L156
  movsbl 0x1(%r12),%edi
  sub    $0x1,%ebx
  add    $0x1,%r12
L156:
  test   %r8d,%r8d
  jne    L309
  cmp    %dil,-0x1(%r13)
  je     L283
L100:
  xor    %r15d,%r15d
  jmp    L273
L195:
  cmpb   $0x2a,0x1(%r12)
  mov    %r12,%rax
  jne    L356
  lea    (%rbx,%r12,1),%edx
  nop
L40:
  add    $0x1,%rax
  mov    %edx,%ebx
  sub    %eax,%ebx
  cmpb   $0x2a,0x1(%rax)
  je     L40
L356:
  cmp    $0x1,%ebx
  je     L28
  test   %r15d,%r15d
  je     L273
  sub    $0x1,%ebx
  lea    0x1(%rax),%rbp
L77:
  mov    %r15d,%ecx
  mov    %r14,%rdx
  mov    %ebx,%esi
  mov    %rbp,%rdi
  mov    %r8d,(%rsp)
  call   <stringmatchlen>
  test   %eax,%eax
  jne    L28
  add    $0x1,%r14
  sub    $0x1,%r15d
  mov    (%rsp),%r8d
  jne    L77
  jmp    L273
  nopw   0x0(%rax,%rax,1)
L99:
  movzbl 0x1(%r12),%eax
  mov    %al,0xb(%rsp)
  cmp    $0x5e,%al
  je     L372
  lea    0x1(%r12),%rbp
  sub    $0x1,%ebx
L268:
  xor    %r15d,%r15d
  jmp    L179
  nopw   0x0(%rax,%rax,1)
L211:
  cmp    $0x5d,%al
  je     L308
  test   %ebx,%ebx
  je     L429
  movzbl 0x1(%rbp),%r14d
  cmp    $0x2d,%r14b
  jne    L351
  cmp    $0x2,%ebx
  jg     L105
L351:
  test   %r8d,%r8d
  jne    L381
  cmp    %al,-0x1(%r13)
  mov    %r14d,%eax
  je     L223
  cs nopw 0x0(%rax,%rax,1)
L235:
  add    $0x1,%rbp
  sub    $0x1,%ebx
L179:
  cmp    $0x5c,%al
  jne    L211
  movzbl 0x2(%rbp),%eax
  movzbl 0x1(%rbp),%esi
  sub    $0x1,%ebx
  add    $0x1,%rbp
  mov    $0x1,%edx
  cmp    -0x1(%r13),%sil
  cmove  %edx,%r15d
  jmp    L235
  nopl   0x0(%rax)
L381:
  movsbl %al,%edi
  mov    %r8d,0x4(%rsp)
  mov    %ecx,(%rsp)
  call   <tolower@plt>
  movsbl -0x1(%r13),%edi
  mov    %eax,%r12d
  call   <tolower@plt>
  mov    $0x1,%esi
  mov    (%rsp),%ecx
  mov    0x4(%rsp),%r8d
  mov    %eax,%r9d
  mov    %r14d,%eax
  cmp    %r9d,%r12d
  cmove  %esi,%r15d
  jmp    L235
  nopl   0x0(%rax)
L105:
  movsbl 0x2(%rbp),%r9d
  movsbl %al,%r12d
  movsbl -0x1(%r13),%r14d
  cmp    %r9d,%r12d
  jle    L311
  mov    %r12d,%eax
  mov    %r9d,%r12d
  mov    %eax,%r9d
L311:
  test   %r8d,%r8d
  je     L144
  mov    %r12d,%edi
  mov    %r8d,0xc(%rsp)
  mov    %r9d,(%rsp)
  mov    %ecx,0x4(%rsp)
  call   <tolower@plt>
  mov    (%rsp),%edi
  mov    %eax,%r12d
  call   <tolower@plt>
  mov    %r14d,%edi
  mov    %eax,(%rsp)
  call   <tolower@plt>
  mov    0xc(%rsp),%r8d
  mov    0x4(%rsp),%ecx
  mov    (%rsp),%r9d
  mov    %eax,%r14d
L144:
  lea    0x2(%rbp),%rsi
  movzbl 0x3(%rbp),%eax
  sub    $0x2,%ebx
  mov    %rsi,%rbp
  cmp    %r14d,%r12d
  jg     L235
  cmp    %r14d,%r9d
  jl     L235
L223:
  mov    $0x1,%r15d
  jmp    L235
  nopw   0x0(%rax,%rax,1)
L429:
  sub    $0x1,%rbp
  mov    $0x1,%ebx
L308:
  mov    %r15d,%eax
  xor    $0x1,%eax
  cmpb   $0x5e,0xb(%rsp)
  cmove  %eax,%r15d
  test   %r15d,%r15d
  je     L273
  mov    %ecx,%eax
  jmp    L432
  nopl   0x0(%rax,%rax,1)
L309:
  mov    %r8d,0x4(%rsp)
  mov    %ecx,(%rsp)
  call   <tolower@plt>
  movsbl -0x1(%r13),%edi
  mov    %eax,%ebp
  call   <tolower@plt>
  mov    (%rsp),%ecx
  mov    0x4(%rsp),%r8d
  cmp    %eax,%ebp
  je     L283
  jmp    L100
  xchg   %ax,%ax
L372:
  movzbl 0x2(%r12),%eax
  lea    0x2(%r12),%rbp
  sub    $0x2,%ebx
  jmp    L268
  nopl   0x0(%rax,%rax,1)
L28:
  mov    $0x1,%r15d
  jmp    L273
L289:
  mov    %ebx,%r15d
  jmp    L385
```

assistant: ```c
int stringmatchlen(const char *pattern, int patternLen, const char *string, int stringLen, int nocase) {
  while (patternLen) {
    switch (pattern[0]) {
    case '*':
      while (pattern[1] == '*') {
        pattern++;
        patternLen--;
      }
      if (patternLen == 1) {
        return 1;
      }
      while (stringLen) {
        if (stringmatchlen(pattern + 1, patternLen - 1, string, stringLen, nocase))
          return 1;
        string++;
        stringLen--;
      }
      return 0;
      break;
    case '?':
      if (stringLen == 0)
        return 0;
      string++;
      stringLen--;
      break;
    case '[': {
      int not, match;
      pattern++;
      patternLen--;
      not = pattern[0] == '^';
      if (not ) {
        pattern++;
        patternLen--;
      }
      match = 0;
      while (1) {
        if (pattern[0] == '\\') {
          pattern++;
          patternLen--;
          if (pattern[0] == string[0])
            match = 1;
        } else if (pattern[0] == ']') {
          break;
        } else if (patternLen == 0) {
          pattern--;
          patternLen++;
          break;
        } else if (pattern[1] == '-' && patternLen >= 3) {
          int start = pattern[0];
          int end = pattern[2];
          int c = string[0];
          if (start > end) {
            int t = start;
            start = end;
            end = t;
          }
          if (nocase) {
            start = tolower(start);
            end = tolower(end);
            c = tolower(c);
          }
          pattern += 2;
          patternLen -= 2;
          if (c >= start && c <= end)
            match = 1;
        } else {
          if (!nocase) {
            if (pattern[0] == string[0])
              match = 1;
          } else {
            if (tolower((int)pattern[0]) == tolower((int)string[0]))
              match = 1;
          }
        }
        pattern++;
        patternLen--;
      }
      if (not )
        match = !match;
      if (!match)
        return 0;
      string++;
      stringLen--;
      break;
    }
    case '\\':
      if (patternLen >= 2) {
        pattern++;
        patternLen--;
      }
    default:
      if (!nocase) {
        if (pattern[0] != string[0])
          return 0;
      } else {
        if (tolower((int)pattern[0]) != tolower((int)string[0]))
          return 0;
      }
      string++;
      stringLen--;
      break;
    }
    pattern++;
    patternLen--;
    if (stringLen == 0) {
      while (*pattern == '*') {
        pattern++;
        patternLen--;
      }
      break;
    }
  }
  if (patternLen == 0 && stringLen == 0) {
    return 1;
  }
  return 0;
}
```