user: 请从给定的汇编指令推导出C源代码:

```asm
<openvpn_envp_to_json>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  test   %rdi,%rdi
  je     L44
  mov    %rdi,%r12
  mov    (%rdi),%rdi
  mov    %rsi,%r13
  test   %rdi,%rdi
  je     L86
  lea    0x8(%r12),%rbx
  xor    %r14d,%r14d
  nopl   (%rax)
L4:
  call   <strlen@plt>
  mov    (%rbx),%rdi
  add    $0x8,%rbx
  lea    0xf(%r14,%rax,1),%r14
  test   %rdi,%rdi
  jne    L4
  mov    %r14d,%edi
L32:
  call   <malloc@plt>
  mov    %r14,%rdx
  xor    %esi,%esi
  mov    $0x1,%r14d
  mov    %rax,%r15
  mov    %rax,%rdi
  call   <memset@plt>
  movb   $0x7b,(%r15)
  mov    (%r12),%rdi
  test   %rdi,%rdi
  je     L123
  nopl   (%rax)
L57:
  movzbl (%rdi),%edx
  lea    0x1(%rdi),%rbp
  test   %dl,%dl
  jne    L18
  jmp    L5
L61:
  movzbl 0x0(%rbp),%edx
  add    $0x1,%rbp
  test   %dl,%dl
  je     L5
L18:
  mov    %rbp,%rax
  sub    %rdi,%rax
  lea    -0x1(%rax),%rbx
  cmp    $0x3d,%dl
  jne    L61
  mov    %r13,%rdx
  mov    %rbx,%rsi
  call   <is_in_list@plt>
  test   %rax,%rax
  jne    L5
  mov    $0x2,%ecx
  cmp    $0x1,%r14
  je     L129
  movb   $0x2c,(%r15,%r14,1)
  lea    0x3(%r14),%rcx
  movb   $0x20,0x1(%r15,%r14,1)
  add    $0x2,%r14
L129:
  movb   $0x22,(%r15,%r14,1)
  mov    (%r12),%rsi
  lea    (%r15,%rcx,1),%rdi
  mov    %rbx,%rdx
  mov    %rcx,0x8(%rsp)
  call   <memcpy@plt>
  mov    0x8(%rsp),%rcx
  mov    %rbp,%rdi
  lea    (%rbx,%rcx,1),%rax
  movb   $0x22,(%r15,%rax,1)
  lea    0x3(%rax),%r14
  movb   $0x3a,0x1(%r15,%rax,1)
  movb   $0x22,0x2(%r15,%rax,1)
  call   <strlen@plt>
  lea    (%r15,%r14,1),%rdi
  mov    %rbp,%rsi
  mov    %rax,%rdx
  call   <memcpy@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  add    %rax,%r14
  movb   $0x22,(%r15,%r14,1)
  add    $0x1,%r14
L5:
  mov    0x8(%r12),%rdi
  add    $0x8,%r12
  test   %rdi,%rdi
  jne    L57
L123:
  movb   $0x7d,(%r15,%r14,1)
L14:
  add    $0x18,%rsp
  mov    %r15,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L86:
  xor    %edi,%edi
  xor    %r14d,%r14d
  jmp    L32
L44:
  xor    %r15d,%r15d
  jmp    L14
```

assistant: ```c
char *openvpn_envp_to_json(const char *envp[], const char *exclude[]) {
  size_t i, j;
  size_t buffer_size = 0;
  size_t buffer_pos = 0;
  const size_t str_space = 15;
  char *json_str;
  const char *value_pos;
  if (!envp)
    return NULL;
  for (i = 0; envp[i]; i++)
    buffer_size += strlen(envp[i]) + str_space;
  json_str = (char *)malloc(sizeof(char) * buffer_size);
  memset(json_str, 0, buffer_size);
  json_str[buffer_pos] = '{';
  buffer_pos++;
  for (i = 0; envp[i]; i++) {
    value_pos = NULL;
    for (j = 0; envp[i][j]; j++) {
      if (envp[i][j] == '=') {
        value_pos = envp[i] + j + 1;
        break;
      }
    }
    if (!value_pos)
      continue;
    if (is_in_list(envp[i], j, exclude))
      continue;
    if (buffer_pos != 1) {
      json_str[buffer_pos] = ',';
      buffer_pos++;
      json_str[buffer_pos] = ' ';
      buffer_pos++;
    }
    json_str[buffer_pos] = '\"';
    buffer_pos++;
    memcpy(json_str + buffer_pos, envp[i], j);
    buffer_pos += j;
    json_str[buffer_pos] = '\"';
    buffer_pos++;
    json_str[buffer_pos] = ':';
    buffer_pos++;
    json_str[buffer_pos] = '\"';
    buffer_pos++;
    memcpy(json_str + buffer_pos, value_pos, strlen(value_pos));
    buffer_pos += strlen(value_pos);
    json_str[buffer_pos] = '\"';
    buffer_pos++;
  }
  json_str[buffer_pos] = '}';
  buffer_pos++;
  return json_str;
}
```