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

```asm
<expand>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L5
L32:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0xa(%rbp)
  cmpb   $0x2d,-0xa(%rbp)
  jne    L119
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x2(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x9(%rbp)
  movsbl -0xb(%rbp),%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L51
  movsbl -0x9(%rbp),%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L23
L51:
  movsbl -0xb(%rbp),%eax
  mov    %eax,%edi
  call   <isupper@plt>
  test   %rax,%rax
  je     L60
  movsbl -0x9(%rbp),%eax
  mov    %eax,%edi
  call   <isupper@plt>
  test   %rax,%rax
  jne    L23
L60:
  movsbl -0xb(%rbp),%eax
  mov    %eax,%edi
  call   <islower@plt>
  test   %rax,%rax
  je     L120
  movsbl -0x9(%rbp),%eax
  mov    %eax,%edi
  call   <islower@plt>
  test   %rax,%rax
  je     L120
L23:
  movzbl -0xb(%rbp),%eax
  cmp    -0x9(%rbp),%al
  jge    L55
  jmp    L30
L47:
  mov    -0x4(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x4(%rbp)
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  movzbl -0xb(%rbp),%eax
  mov    %al,(%rdx)
  movzbl -0xb(%rbp),%eax
  add    $0x1,%eax
  mov    %al,-0xb(%rbp)
L30:
  movzbl -0xb(%rbp),%eax
  cmp    -0x9(%rbp),%al
  jle    L47
  jmp    L97
L21:
  mov    -0x4(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x4(%rbp)
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  movzbl -0xb(%rbp),%eax
  mov    %al,(%rdx)
  movzbl -0xb(%rbp),%eax
  sub    $0x1,%eax
  mov    %al,-0xb(%rbp)
L55:
  movzbl -0xb(%rbp),%eax
  cmp    -0x9(%rbp),%al
  jge    L21
L97:
  addl   $0x3,-0x8(%rbp)
  jmp    L5
L120:
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x4(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x4(%rbp)
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  movzbl (%rcx),%eax
  mov    %al,(%rdx)
  jmp    L5
L119:
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x4(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x4(%rbp)
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  movzbl (%rcx),%eax
  mov    %al,(%rdx)
L5:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0xb(%rbp)
  cmpb   $0x0,-0xb(%rbp)
  jne    L32
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  nop
  leave
  ret
```

assistant: ```c
void expand(char s1[], char s2[]) {
  char c;
  int i = 0;
  int j = 0;
  while ((c = s1[i]) != '\0') {
    char nextc = s1[i + 1];
    if (nextc == '-') {
      char thirdc = s1[i + 2];
      if (isdigit(c) && isdigit(thirdc) || isupper(c) && isupper(thirdc) || islower(c) && islower(thirdc)) {
        if (c < thirdc) {
          while (c <= thirdc) {
            s2[j++] = c;
            c++;
          }
        } else {
          while (c >= thirdc) {
            s2[j++] = c;
            c--;
          }
        }
        i += 3;
      } else {
        s2[j++] = s1[i++];
      }
    } else {
      s2[j++] = s1[i++];
    }
  }
  s2[j] = '\0';
}
```