user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<pattern_match_length>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdx,%r13
  mov    %ecx,%ebx
  mov    %r8d,(%rsp)
  lea    0x1(%rdi),%r14
  lea    -0x1(%rsi),%r15d
  jmp    L13
L221:
  cmp    $0x5c,%al
  jne    L243
  cmp    $0x1,%ebx
  jle    L243
  add    $0x1,%r13
  sub    $0x1,%ebx
L243:
  cmpl   $0x0,(%rsp)
  jne    L39
  movzbl -0x1(%r14),%eax
  cmp    %al,0x0(%r13)
  jne    L274
L473:
  mov    %r15d,%r12d
  mov    %r13,%rbp
L271:
  lea    0x1(%rbp),%r13
  sub    $0x1,%ebx
  add    $0x1,%r14
  sub    $0x1,%r15d
  test   %r12d,%r12d
  je     L450
L13:
  lea    -0x1(%r14),%rbp
  lea    0x1(%r15),%r12d
  test   %ebx,%ebx
  je     L368
  movzbl 0x0(%r13),%eax
  cmp    $0x5b,%al
  je     L37
  jg     L221
  cmp    $0x2a,%al
  je     L295
  cmp    $0x3f,%al
  jne    L243
  test   %r12d,%r12d
  je     L22
  mov    %r15d,%r12d
  mov    %r13,%rbp
  jmp    L271
L295:
  cmpb   $0x2a,0x1(%r13)
  jne    L356
  mov    %r13,%r14
  add    %ebx,%r13d
L151:
  add    $0x1,%r14
  mov    %r13d,%ebx
  sub    %r14d,%ebx
  cmpb   $0x2a,0x1(%r14)
  je     L151
L138:
  cmp    $0x1,%ebx
  je     L208
  test   %r12d,%r12d
  je     L22
  sub    $0x1,%ebx
  jmp    L407
L356:
  mov    %r13,%r14
  jmp    L138
L310:
  add    $0x1,%rbp
  sub    $0x1,%r12d
  je     L22
L407:
  lea    0x1(%r14),%rdi
  mov    (%rsp),%r8d
  mov    %r12d,%ecx
  mov    %rbp,%rdx
  mov    %ebx,%esi
  call   <pattern_match_length>
  test   %eax,%eax
  je     L310
  mov    $0x1,%r12d
  jmp    L22
L37:
  movzbl 0x1(%r13),%eax
  mov    %al,0xf(%rsp)
  cmp    $0x5e,%al
  je     L165
  lea    0x1(%r13),%rbp
  sub    $0x1,%ebx
L413:
  mov    $0x0,%r12d
  jmp    L456
L165:
  lea    0x2(%r13),%rbp
  sub    $0x2,%ebx
  jmp    L413
L260:
  sub    $0x1,%ebx
  movzbl 0x1(%rbp),%eax
  lea    0x1(%rbp),%rbp
  cmp    -0x1(%r14),%al
  mov    $0x1,%eax
  cmove  %eax,%r12d
L185:
  add    $0x1,%rbp
  sub    $0x1,%ebx
L456:
  movzbl 0x0(%rbp),%r13d
  cmp    $0x5c,%r13b
  je     L260
  cmp    $0x5d,%r13b
  je     L17
  test   %ebx,%ebx
  je     L409
  cmpb   $0x2d,0x1(%rbp)
  jne    L234
  cmp    $0x2,%ebx
  jg     L80
L234:
  cmpl   $0x0,(%rsp)
  jne    L294
  cmp    -0x1(%r14),%r13b
  mov    $0x1,%eax
  cmove  %eax,%r12d
  jmp    L185
L409:
  sub    $0x1,%rbp
  mov    $0x1,%ebx
L17:
  cmpb   $0x5e,0xf(%rsp)
  je     L249
  test   %r12d,%r12d
  je     L22
L190:
  mov    %r15d,%r12d
  jmp    L271
L80:
  movsbl %r13b,%r13d
  movsbl 0x2(%rbp),%edx
  mov    %edx,0x4(%rsp)
  movsbl -0x1(%r14),%eax
  mov    %eax,0x8(%rsp)
  cmp    %edx,%r13d
  jle    L406
  mov    %r13d,%eax
  mov    %edx,%r13d
  mov    %eax,0x4(%rsp)
L406:
  cmpl   $0x0,(%rsp)
  je     L459
  mov    %r13d,%edi
  call   <tolower@plt>
  mov    %eax,%r13d
  mov    0x4(%rsp),%edi
  call   <tolower@plt>
  mov    %eax,0x4(%rsp)
  mov    0x8(%rsp),%edi
  call   <tolower@plt>
  mov    %eax,0x8(%rsp)
L459:
  add    $0x2,%rbp
  sub    $0x2,%ebx
  mov    0x8(%rsp),%eax
  cmp    %eax,%r13d
  jg     L185
  cmp    %eax,0x4(%rsp)
  mov    $0x1,%eax
  cmovge %eax,%r12d
  jmp    L185
L294:
  movsbl %r13b,%edi
  call   <tolower@plt>
  mov    %eax,%r13d
  movsbl -0x1(%r14),%edi
  call   <tolower@plt>
  cmp    %eax,%r13d
  mov    $0x1,%eax
  cmove  %eax,%r12d
  jmp    L185
L249:
  test   %r12d,%r12d
  je     L190
  mov    $0x0,%r12d
  jmp    L22
L39:
  movsbl 0x0(%r13),%edi
  call   <tolower@plt>
  mov    %eax,%ebp
  movsbl -0x1(%r14),%edi
  call   <tolower@plt>
  cmp    %eax,%ebp
  je     L473
  mov    $0x0,%r12d
  jmp    L22
L450:
  cmpb   $0x2a,0x1(%rbp)
  jne    L368
  mov    %r13,%rax
  add    %ebx,%r13d
L239:
  add    $0x1,%rax
  mov    %r13d,%ebx
  sub    %eax,%ebx
  cmpb   $0x2a,(%rax)
  je     L239
L368:
  or     %ebx,%r12d
  sete   %r12b
  movzbl %r12b,%r12d
  jmp    L22
L208:
  mov    %ebx,%r12d
L22:
  mov    %r12d,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L274:
  mov    (%rsp),%r12d
  jmp    L22
```

assistant: ```c
int pattern_match_length(const char *string, int slength, const char *pattern, int plength, int nocase) {
  while (plength) {
    switch (pattern[0]) {
    case '*':
      while (pattern[1] == '*') {
        pattern++;
        plength--;
      }
      if (plength == 1)
        return 1;
      while (slength) {
        if (pattern_match_length(pattern + 1, plength - 1, string, slength, nocase))
          return 1;
        string++;
        slength--;
      }
      return 0;
      break;
    case '?':
      if (slength == 0)
        return 0;
      string++;
      slength--;
      break;
    case '[': {
      int not, match;
      pattern++;
      plength--;
      not = pattern[0] == '^';
      if (not ) {
        pattern++;
        plength--;
      }
      match = 0;
      while (1) {
        if (pattern[0] == '\\') {
          pattern++;
          plength--;
          if (pattern[0] == string[0])
            match = 1;
        } else if (pattern[0] == ']') {
          break;
        } else if (plength == 0) {
          pattern--;
          plength++;
          break;
        } else if (pattern[1] == '-' && plength >= 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;
          plength -= 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++;
        plength--;
      }
      if (not )
        match = !match;
      if (!match)
        return 0;
      string++;
      slength--;
      break;
    }
    case '\\':
      if (plength >= 2) {
        pattern++;
        plength--;
      }
    default:
      if (!nocase) {
        if (pattern[0] != string[0])
          return 0;
      } else {
        if (tolower((int)pattern[0]) != tolower((int)string[0]))
          return 0;
      }
      string++;
      slength--;
      break;
    }
    pattern++;
    plength--;
    if (slength == 0) {
      while (*pattern == '*') {
        pattern++;
        plength--;
      }
      break;
    }
  }
  if (plength == 0 && slength == 0)
    return 1;
  return 0;
}
```