user: 请将以下的汇编代码转换成C语言代码:

```asm
<expand_envars>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x68,%rsp
  mov    %rdi,-0x88(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    -0x88(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x70(%rbp)
  mov    -0x70(%rbp),%eax
  add    %eax,%eax
  mov    %eax,-0x80(%rbp)
  movl   $0x0,-0x7c(%rbp)
  mov    -0x80(%rbp),%eax
  mov    %eax,%esi
  mov    $0x1,%edi
  call   <calloc@plt>
  mov    %rax,-0x68(%rbp)
  jmp    L21
L224:
  mov    -0x88(%rbp),%rax
  mov    %rax,-0x60(%rbp)
  mov    -0x88(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x24,%al
  jne    L189
  movl   $0x0,-0x78(%rbp)
  movl   $0x0,-0x74(%rbp)
  addq   $0x1,-0x88(%rbp)
  mov    -0x88(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x7b,%al
  jne    L122
  addq   $0x1,-0x88(%rbp)
  movl   $0x1,-0x78(%rbp)
L122:
  mov    -0x88(%rbp),%rax
  mov    %rax,-0x58(%rbp)
  jmp    L100
L133:
  addl   $0x1,-0x74(%rbp)
L100:
  mov    -0x74(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L191
  mov    -0x74(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isalnum@plt>
  test   %rax,%rax
  jne    L133
  mov    -0x74(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x5f,%al
  je     L133
L191:
  cmpl   $0x0,-0x78(%rbp)
  je     L131
  mov    -0x74(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x7d,%al
  je     L131
  mov    -0x60(%rbp),%rax
  mov    %rax,-0x88(%rbp)
  jmp    L189
L131:
  mov    %rsp,%rax
  mov    %rax,%rbx
  mov    -0x74(%rbp),%eax
  add    $0x1,%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x50(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r12
  mov    $0x0,%r13d
  movslq %eax,%rdx
  mov    %rdx,%r14
  mov    $0x0,%r15d
  cltq
  mov    $0x10,%edx
  sub    $0x1,%rdx
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L165:
  cmp    %rdx,%rsp
  je     L137
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L165
L137:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L115
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L115:
  mov    %rsp,%rax
  add    $0x0,%rax
  mov    %rax,-0x48(%rbp)
  mov    -0x74(%rbp),%edx
  mov    -0x58(%rbp),%rcx
  mov    -0x48(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    -0x48(%rbp),%rdx
  mov    -0x74(%rbp),%eax
  cltq
  movb   $0x0,(%rdx,%rax,1)
  mov    -0x48(%rbp),%rax
  lea    D6(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L206
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L193
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L206
L193:
  mov    -0x60(%rbp),%rax
  mov    %rax,-0x88(%rbp)
  jmp    L163
L206:
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <getenv@plt>
  mov    %rax,-0x40(%rbp)
  cmpq   $0x0,-0x40(%rbp)
  je     L91
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x6c(%rbp)
  mov    -0x7c(%rbp),%edx
  mov    -0x6c(%rbp),%eax
  add    %edx,%eax
  cmp    %eax,-0x80(%rbp)
  jg     L217
  mov    -0x80(%rbp),%eax
  lea    (%rax,%rax,1),%edx
  mov    -0x6c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x80(%rbp)
  mov    -0x80(%rbp),%edx
  mov    -0x68(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <realloc@plt>
  mov    %rax,-0x68(%rbp)
L217:
  mov    -0x40(%rbp),%rdx
  mov    -0x68(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  mov    -0x6c(%rbp),%eax
  add    %eax,-0x7c(%rbp)
  mov    -0x74(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x78(%rbp),%eax
  add    %eax,%eax
  cltq
  add    %rdx,%rax
  lea    0x1(%rax),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x88(%rbp)
  nop
  mov    %rbx,%rsp
  jmp    L21
L91:
  mov    -0x60(%rbp),%rax
  mov    %rax,-0x88(%rbp)
  mov    -0x7c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
L163:
  mov    %rbx,%rsp
L189:
  mov    -0x7c(%rbp),%eax
  add    $0x1,%eax
  cmp    %eax,-0x80(%rbp)
  jg     L111
  shll   -0x80(%rbp)
  mov    -0x80(%rbp),%edx
  mov    -0x68(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <realloc@plt>
  mov    %rax,-0x68(%rbp)
L111:
  mov    -0x88(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x88(%rbp)
  mov    -0x7c(%rbp),%edx
  lea    0x1(%rdx),%ecx
  mov    %ecx,-0x7c(%rbp)
  movslq %edx,%rcx
  mov    -0x68(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  mov    -0x7c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
L21:
  mov    -0x88(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L224
  mov    -0x7c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x68(%rbp),%rax
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L77
  call   <__stack_chk_fail@plt>
L77:
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D6
type_guessed: string

tool: D6: ONDIRWD

assistant: ```c
char *expand_envars(const char *in) {
  int inlen = strlen(in), outmax = inlen * 2, outlen = 0;
  char *out = calloc(1, outmax);
  while (*in) {
    const char *mark = in;
    if (*in == '$') {
      int bracketed = 0, varlen = 0;
      const char *varstart;
      ++in;
      if (*in == '{') {
        ++in;
        bracketed = 1;
      }
      varstart = in;
      while (in[varlen] && (isalnum(in[varlen]) || in[varlen] == '_'))
        ++varlen;
      if (bracketed && in[varlen] != '}')
        in = mark;
      else {
        char var[varlen + 1];
        const char *val;
        strncpy(var, varstart, varlen);
        var[varlen] = 0;
        if (strcmp(var, "ONDIRWD") && (var[0] < '0' || var[0] > '9')) {
          in = mark;
        } else {
          val = getenv(var);
          if (val) {
            int vallen = strlen(val);
            if (outlen + vallen >= outmax) {
              outmax = outmax * 2 + vallen;
              out = realloc(out, outmax);
            }
            strcat(out, val);
            outlen += vallen;
            in = mark + varlen + bracketed * 2 + 1;
            continue;
          } else {
            in = mark;
            out[outlen] = 0;
          }
        }
      }
    }
    if (outlen + 1 >= outmax) {
      outmax *= 2;
      out = realloc(out, outmax);
    }
    out[outlen++] = *in++;
    out[outlen] = 0;
  }
  out[outlen] = 0;
  return out;
}
```