user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<read_env>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  movl   $0x0,-0x1c(%rbp)
  jmp    L126
L65:
  mov    -0x1c(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%eax
  add    %edx,%eax
  sub    $0x30,%eax
  mov    %eax,-0x1c(%rbp)
L126:
  mov    D25(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <getc@plt>
  movsbl %al,%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x20(%rbp),%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L65
  cmpl   $0x3a,-0x20(%rbp)
  jne    L18
  cmpl   $0x3,-0x1c(%rbp)
  jg     L148
L18:
  mov    $0x0,%eax
  jmp    L117
L148:
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  mov    D25(%rip),%rax
  mov    (%rax),%ecx
  mov    -0x1c(%rbp),%edx
  mov    -0x10(%rbp),%rax
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <fread@plt>
  cmp    %eax,-0x1c(%rbp)
  jne    L81
  mov    D25(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <getc@plt>
  cmp    $0x2c,%al
  je     L69
L81:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  jmp    L117
L69:
  movl   $0x0,-0x20(%rbp)
  mov    -0x20(%rbp),%eax
  mov    %eax,-0x24(%rbp)
  jmp    L124
L2:
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L1
  addl   $0x1,-0x20(%rbp)
  mov    -0x20(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L1
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movb   $0x3d,(%rax)
L1:
  addl   $0x1,-0x24(%rbp)
L124:
  mov    -0x24(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L2
  mov    -0x20(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  add    $0x1,%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x20(%rbp),%eax
  cltq
  shl    $0x3,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x10(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  movl   $0x0,-0x20(%rbp)
  mov    -0x20(%rbp),%eax
  mov    %eax,-0x24(%rbp)
  jmp    L4
L109:
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L78
  mov    -0x20(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x20(%rbp)
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x18(%rbp),%rax
  mov    %rax,(%rdx)
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x18(%rbp)
L78:
  addl   $0x1,-0x24(%rbp)
L4:
  mov    -0x24(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L109
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movq   $0x0,(%rax)
  mov    -0x8(%rbp),%rax
L117:
  leave
  ret
```

assistant: ```c
char **read_env() {
  char **env;
  char *buf, *p;
  int i, k, len;
  for (len = 0; isdigit(k = getc(stdin));) {
    len = len * 10 + k - '0';
  }
  if (k != ':' || len < 4) {
    return 0;
  }
  buf = (char *)malloc(len);
  if (fread(buf, 1, len, stdin) != len || getc(stdin) != ',') {
    free(buf);
    return 0;
  }
  for (i = k = 0; i < len; i++) {
    if (buf[i] == 0 && (++k & 1)) {
      buf[i] = '=';
    }
  }
  k = k / 2 + 1;
  env = (char **)malloc(k * sizeof(*env));
  p = buf;
  for (i = k = 0; i < len; i++) {
    if (buf[i] == 0) {
      env[k++] = p;
      p = buf + i + 1;
    }
  }
  env[k] = 0;
  return env;
}
```