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

```asm
<rangematch>:
  endbr64
  push   %r15
  mov    %edx,%r15d
  push   %r14
  mov    %esi,%r14d
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x28,%rsp
  movzbl (%rdi),%eax
  mov    %rcx,0x10(%rsp)
  cmp    $0x21,%al
  sete   %r13b
  cmp    $0x5e,%al
  sete   %al
  or     %eax,%r13d
  mov    %edx,%eax
  cmp    $0x1,%r13b
  mov    %r13b,0xf(%rsp)
  sbb    $0xffffffffffffffff,%rbp
  and    $0x10,%eax
  mov    %eax,0x8(%rsp)
  jne    L274
L36:
  mov    %r15d,%r13d
  movzbl 0x0(%rbp),%eax
  and    $0x2,%r15d
  lea    0x1(%rbp),%rbx
  mov    %r15d,%r8d
  and    $0x1,%r13d
  xor    %r12d,%r12d
  mov    %r14d,%r15d
  nopl   0x0(%rax)
L497:
  cmp    $0x5c,%al
  je     L71
  test   %al,%al
  je     L608
L586:
  cmp    $0x2f,%al
  je     L255
L647:
  mov    %eax,%ebp
  movzbl (%rbx),%eax
  mov    %rbx,%r14
  cmp    $0x2d,%al
  je     L44
L640:
  lea    0x1(%r14),%rbx
  cmp    $0x5b,%bpl
  jne    L652
L454:
  cmp    $0x3a,%al
  jne    L652
  cmpb   $0x0,0x1(%r14)
  jne    L251
  cmp    $0x5b,%r15b
  je     L568
  movzbl (%rbx),%eax
  mov    $0x3a,%ebp
  mov    %rbx,%r14
  cmp    $0x2d,%al
  jne    L640
  xchg   %ax,%ax
L44:
  movzbl 0x1(%rbx),%edx
  cmp    $0x5d,%dl
  je     L156
  test   %dl,%dl
  je     L156
  lea    0x2(%rbx),%r14
  cmp    $0x5c,%dl
  je     L325
L385:
  mov    0x8(%rsp),%ecx
  test   %ecx,%ecx
  jne    L362
L643:
  cmp    %dl,%bpl
  jle    L179
  mov    %ebp,%eax
  mov    %edx,%ebp
  mov    %eax,%edx
L179:
  movzbl (%r14),%eax
  cmp    %bpl,%r15b
  jl     L640
  cmp    %dl,%r15b
  mov    $0x1,%edx
  lea    0x1(%r14),%rbx
  cmovle %edx,%r12d
  cmp    $0x5b,%bpl
  je     L454
  nopl   0x0(%rax)
L652:
  cmp    %bpl,%r15b
  mov    $0x1,%edx
  cmove  %edx,%r12d
L201:
  cmp    $0x5d,%al
  jne    L497
  mov    0x10(%rsp),%rax
  mov    %rbx,(%rax)
  movzbl 0xf(%rsp),%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  xor    %r12d,%eax
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L71:
  movzbl (%rbx),%eax
  test   %r13d,%r13d
  je     L29
  cmp    $0x2d,%al
  je     L664
  add    $0x1,%rbx
  mov    $0x5c,%ebp
  jmp    L652
  nopl   0x0(%rax,%rax,1)
L255:
  test   %r8d,%r8d
  jne    L249
  movzbl (%rbx),%eax
  cmp    $0x2d,%al
  je     L181
  add    $0x1,%rbx
  mov    $0x2f,%ebp
  jmp    L652
  nopl   0x0(%rax,%rax,1)
L29:
  add    $0x1,%rbx
  test   %al,%al
  jne    L586
L608:
  add    $0x28,%rsp
  mov    $0xffffffff,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L181:
  movzbl 0x1(%rbx),%edx
  cmp    $0x5d,%dl
  je     L526
  test   %dl,%dl
  je     L526
  mov    $0x2f,%ebp
  lea    0x2(%rbx),%r14
  cmp    $0x5c,%dl
  jne    L385
L325:
  test   %r13d,%r13d
  jne    L385
  movzbl 0x2(%rbx),%edx
  lea    0x3(%rbx),%r14
  test   %dl,%dl
  je     L608
  mov    0x8(%rsp),%ecx
  test   %ecx,%ecx
  je     L643
  nopl   0x0(%rax,%rax,1)
L362:
  movzbl %bpl,%edi
  mov    %r8d,0x1c(%rsp)
  mov    %dl,0x18(%rsp)
  call   <tolower@plt>
  movzbl 0x18(%rsp),%edi
  mov    %eax,%ebp
  call   <tolower@plt>
  mov    0x1c(%rsp),%r8d
  mov    %eax,%edx
  jmp    L643
  nopw   0x0(%rax,%rax,1)
L156:
  add    $0x1,%rbx
L409:
  cmp    %bpl,%r15b
  mov    $0x1,%edx
  mov    $0x2d,%eax
  cmove  %edx,%r12d
  jmp    L647
  nopw   0x0(%rax,%rax,1)
L526:
  add    $0x1,%rbx
  mov    $0x2f,%ebp
  jmp    L409
  nopl   0x0(%rax,%rax,1)
L664:
  movzbl 0x1(%rbx),%edx
  cmp    $0x5d,%dl
  je     L211
  test   %dl,%dl
  jne    L590
L211:
  add    $0x1,%rbx
  cmp    $0x5c,%r15b
  mov    $0x2d,%eax
  cmove  %r13d,%r12d
  jmp    L647
  nopl   0x0(%rax,%rax,1)
L251:
  mov    $0x2,%edx
  lea    D19(%rip),%rsi
  mov    %rbx,%rdi
  mov    %r8d,0x18(%rsp)
  call   <strncmp@plt>
  mov    0x18(%rsp),%r8d
  test   %eax,%eax
  jne    L67
  movzbl (%r14),%eax
  jmp    L201
  nopl   0x0(%rax,%rax,1)
L590:
  lea    0x2(%rbx),%r14
  mov    $0x5c,%ebp
  jmp    L385
  cs nopw 0x0(%rax,%rax,1)
L67:
  mov    $0x7,%edx
  lea    D44(%rip),%rsi
  mov    %rbx,%rdi
  mov    %r8d,0x18(%rsp)
  call   <strncmp@plt>
  mov    0x18(%rsp),%r8d
  test   %eax,%eax
  je     L223
  mov    $0x7,%edx
  lea    D88(%rip),%rsi
  mov    %rbx,%rdi
  mov    %r8d,0x18(%rsp)
  call   <strncmp@plt>
  mov    0x18(%rsp),%r8d
  test   %eax,%eax
  je     L214
  mov    $0x7,%edx
  lea    D85(%rip),%rsi
  mov    %rbx,%rdi
  mov    %r8d,0x18(%rsp)
  call   <strncmp@plt>
  mov    0x18(%rsp),%r8d
  test   %eax,%eax
  je     L572
  mov    $0x7,%edx
  lea    D4(%rip),%rsi
  mov    %rbx,%rdi
  mov    %r8d,0x18(%rsp)
  call   <strncmp@plt>
  mov    0x18(%rsp),%r8d
  test   %eax,%eax
  je     L50
  mov    $0x7,%edx
  lea    D0(%rip),%rsi
  mov    %rbx,%rdi
  mov    %r8d,0x18(%rsp)
  call   <strncmp@plt>
  mov    0x18(%rsp),%r8d
  test   %eax,%eax
  je     L58
  mov    $0x7,%edx
  lea    D60(%rip),%rsi
  mov    %rbx,%rdi
  mov    %r8d,0x18(%rsp)
  call   <strncmp@plt>
  mov    0x18(%rsp),%r8d
  test   %eax,%eax
  je     L437
  mov    $0x7,%edx
  lea    D26(%rip),%rsi
  mov    %rbx,%rdi
  mov    %r8d,0x18(%rsp)
  call   <strncmp@plt>
  mov    0x18(%rsp),%r8d
  test   %eax,%eax
  je     L615
  mov    $0x7,%edx
  lea    D76(%rip),%rsi
  mov    %rbx,%rdi
  mov    %r8d,0x18(%rsp)
  call   <strncmp@plt>
  mov    0x18(%rsp),%r8d
  test   %eax,%eax
  je     L419
  mov    $0x7,%edx
  lea    D54(%rip),%rsi
  mov    %rbx,%rdi
  mov    %r8d,0x18(%rsp)
  call   <strncmp@plt>
  mov    0x18(%rsp),%r8d
  test   %eax,%eax
  je     L516
  mov    $0x7,%edx
  lea    D23(%rip),%rsi
  mov    %rbx,%rdi
  mov    %r8d,0x18(%rsp)
  call   <strncmp@plt>
  mov    0x18(%rsp),%r8d
  test   %eax,%eax
  je     L285
  mov    $0x8,%edx
  lea    D11(%rip),%rsi
  mov    %rbx,%rdi
  mov    %r8d,0x18(%rsp)
  call   <strncmp@plt>
  mov    0x18(%rsp),%r8d
  test   %eax,%eax
  je     L233
  mov    0x8(%rsp),%eax
  mov    %r15d,%r9d
  test   %eax,%eax
  jne    L134
L82:
  mov    $0x7,%edx
  lea    D22(%rip),%rsi
  mov    %rbx,%rdi
  mov    %r8d,0x1c(%rsp)
  mov    %r9b,0x18(%rsp)
  call   <strncmp@plt>
  movzbl 0x18(%rsp),%r9d
  mov    0x1c(%rsp),%r8d
  test   %eax,%eax
  je     L112
  movzbl (%r14),%eax
  jmp    L652
  nopl   0x0(%rax,%rax,1)
L568:
  mov    $0x1,%r12d
  jmp    L647
  nopl   0x0(%rax,%rax,1)
L274:
  movzbl %sil,%edi
  call   <tolower@plt>
  mov    %eax,%r14d
  jmp    L36
L223:
  movsbl %r15b,%edi
  call   <isalnum@plt>
L310:
  test   %rax,%rax
  mov    $0x1,%eax
  mov    0x18(%rsp),%r8d
  lea    0x9(%r14),%rbx
  cmovne %eax,%r12d
  movzbl 0x8(%r14),%eax
  jmp    L201
L249:
  add    $0x28,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L214:
  movsbl %r15b,%edi
  call   <isalpha@plt>
  jmp    L310
L58:
  movsbl %r15b,%edi
  call   <isdigit@plt>
  jmp    L310
L572:
  movsbl %r15b,%edi
  call   <isblank@plt>
  jmp    L310
L50:
  movsbl %r15b,%edi
  call   <iscntrl@plt>
  jmp    L310
L437:
  movsbl %r15b,%edi
  call   <isgraph@plt>
  jmp    L310
L615:
  movsbl %r15b,%edi
  call   <islower@plt>
  jmp    L310
L419:
  movsbl %r15b,%edi
  call   <isprint@plt>
  jmp    L310
L516:
  movsbl %r15b,%edi
  call   <ispunct@plt>
  jmp    L310
L285:
  movsbl %r15b,%edi
  call   <isspace@plt>
  jmp    L310
L233:
  movsbl %r15b,%edi
  lea    0xa(%r14),%rbx
  call   <isxdigit@plt>
  mov    0x18(%rsp),%r8d
  test   %rax,%rax
  mov    $0x1,%eax
  cmovne %eax,%r12d
  movzbl 0x9(%r14),%eax
  jmp    L201
L112:
  movsbl %r9b,%edi
  mov    %r8d,0x18(%rsp)
  call   <isupper@plt>
  jmp    L310
L134:
  movsbl %r15b,%edi
  mov    %r8d,0x18(%rsp)
  call   <toupper@plt>
  mov    0x18(%rsp),%r8d
  mov    %eax,%r9d
  jmp    L82
```

tool_calls: name: read_data
arguments: tag: D19
type: string
name: read_data
arguments: tag: D44
type: string
name: read_data
arguments: tag: D88
type: string
name: read_data
arguments: tag: D85
type: string
name: read_data
arguments: tag: D4
type: string
name: read_data
arguments: tag: D0
type: string
name: read_data
arguments: tag: D60
type: string
name: read_data
arguments: tag: D26
type: string
name: read_data
arguments: tag: D76
type: string
name: read_data
arguments: tag: D54
type: string
name: read_data
arguments: tag: D23
type: string
name: read_data
arguments: tag: D11
type: string
name: read_data
arguments: tag: D22
type: string

tool: D19: :]

tool: D44: alnum:]

tool: D88: alpha:]

tool: D85: blank:]

tool: D4: cntrl:]

tool: D0: digit:]

tool: D60: graph:]

tool: D26: lower:]

tool: D76: print:]

tool: D54: punct:]

tool: D23: space:]

tool: D11: xdigit:]

tool: D22: upper:]

assistant: ```c
int rangematch(const char *pattern, char test, int flags, const char **newp) {
  int negate, ok;
  char c, c2;
  char tmp;
  if ((negate = (*pattern == '!' || *pattern == '^')))
    ++pattern;
  if (((flags) & (0x10)))
    test = tolower((unsigned char)test);
  ok = 0;
  c = *pattern++;
  do {
    if (c == '\\' && !((flags) & (0x01)))
      c = *pattern++;
    if (c == '\0')
      return -1;
    if (c == '/' && ((flags) & (0x02)))
      return 0;
    if (*pattern == '-' && (c2 = *(pattern + 1)) != '\0' && c2 != ']') {
      pattern += 2;
      if (c2 == '\\' && !((flags) & (0x01)))
        c2 = *pattern++;
      if (c2 == '\0')
        return -1;
      if (((flags) & (0x10))) {
        c = tolower((unsigned char)c);
        c2 = tolower((unsigned char)c2);
      }
      if (c > c2) {
        tmp = c2;
        c2 = c;
        c = tmp;
      }
      if (c <= test && test <= c2) {
        ok = 1;
      }
    }
    if (c == '[' && *pattern == ':' && *(pattern + 1) != '\0') {
      if (!strncmp(pattern + 1, ":]", sizeof(":]") - 1)) {
        continue;
      }
      {{if (!strncmp(pattern + 1,
                     "alnum"
                     ":]",
                     sizeof("alnum"
                            ":]") -
                         1)){if (isalnum(test)){ok = 1;
    }
    pattern += sizeof("alnum"
                      ":]");
    continue;
  }
}
}
;
{{if (!strncmp(pattern + 1,
               "alpha"
               ":]",
               sizeof("alpha"
                      ":]") -
                   1)){if (isalpha(test)){ok = 1;
}
pattern += sizeof("alpha"
                  ":]");
continue;
}
}
}
;
{{if (!strncmp(pattern + 1,
               "blank"
               ":]",
               sizeof("blank"
                      ":]") -
                   1)){if (isblank(test)){ok = 1;
}
pattern += sizeof("blank"
                  ":]");
continue;
}
}
}
;
{{if (!strncmp(pattern + 1,
               "cntrl"
               ":]",
               sizeof("cntrl"
                      ":]") -
                   1)){if (iscntrl(test)){ok = 1;
}
pattern += sizeof("cntrl"
                  ":]");
continue;
}
}
}
;
{{if (!strncmp(pattern + 1,
               "digit"
               ":]",
               sizeof("digit"
                      ":]") -
                   1)){if (isdigit(test)){ok = 1;
}
pattern += sizeof("digit"
                  ":]");
continue;
}
}
}
;
{{if (!strncmp(pattern + 1,
               "graph"
               ":]",
               sizeof("graph"
                      ":]") -
                   1)){if (isgraph(test)){ok = 1;
}
pattern += sizeof("graph"
                  ":]");
continue;
}
}
}
;
{{if (!strncmp(pattern + 1,
               "lower"
               ":]",
               sizeof("lower"
                      ":]") -
                   1)){if (islower(test)){ok = 1;
}
pattern += sizeof("lower"
                  ":]");
continue;
}
}
}
;
{{if (!strncmp(pattern + 1,
               "print"
               ":]",
               sizeof("print"
                      ":]") -
                   1)){if (isprint(test)){ok = 1;
}
pattern += sizeof("print"
                  ":]");
continue;
}
}
}
;
{{if (!strncmp(pattern + 1,
               "punct"
               ":]",
               sizeof("punct"
                      ":]") -
                   1)){if (ispunct(test)){ok = 1;
}
pattern += sizeof("punct"
                  ":]");
continue;
}
}
}
;
{{if (!strncmp(pattern + 1,
               "space"
               ":]",
               sizeof("space"
                      ":]") -
                   1)){if (isspace(test)){ok = 1;
}
pattern += sizeof("space"
                  ":]");
continue;
}
}
}
;
{{if (!strncmp(pattern + 1,
               "xdigit"
               ":]",
               sizeof("xdigit"
                      ":]") -
                   1)){if (isxdigit(test)){ok = 1;
}
pattern += sizeof("xdigit"
                  ":]");
continue;
}
}
}
;
c2 = ((flags) & (0x10)) ? toupper(test) : test;
{{if (!strncmp(pattern + 1,
               "upper"
               ":]",
               sizeof("upper"
                      ":]") -
                   1)){if (isupper(c2)){ok = 1;
}
pattern += sizeof("upper"
                  ":]");
continue;
}
}
}
;
}
if (c == test) {
  ok = 1;
}
}
while ((c = *pattern++) != ']')
  ;
*newp = (const char *)pattern;
return (ok == negate) ? 0 : 1;
}
```