user: Translate the below assembly code into C programming language:

```asm
<openvpn_envp_to_json>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  movq   $0x0,-0x28(%rbp)
  movq   $0x0,-0x20(%rbp)
  movq   $0xf,-0x10(%rbp)
  cmpq   $0x0,-0x48(%rbp)
  jne    L140
  mov    $0x0,%eax
  jmp    L33
L140:
  movq   $0x0,-0x38(%rbp)
  jmp    L102
L100:
  mov    -0x38(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    -0x10(%rbp),%rdx
  add    %rdx,%rax
  add    %rax,-0x28(%rbp)
  addq   $0x1,-0x38(%rbp)
L102:
  mov    -0x38(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L100
  mov    -0x28(%rbp),%rax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x28(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x8(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movb   $0x7b,(%rax)
  addq   $0x1,-0x20(%rbp)
  movq   $0x0,-0x38(%rbp)
  jmp    L23
L112:
  movq   $0x0,-0x18(%rbp)
  movq   $0x0,-0x30(%rbp)
  jmp    L124
L123:
  mov    -0x38(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x3d,%al
  jne    L78
  mov    -0x38(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    $0x1,%rax
  add    %rdx,%rax
  mov    %rax,-0x18(%rbp)
  jmp    L149
L78:
  addq   $0x1,-0x30(%rbp)
L124:
  mov    -0x38(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L123
L149:
  cmpq   $0x0,-0x18(%rbp)
  je     L128
  mov    -0x38(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x50(%rbp),%rdx
  mov    -0x30(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <is_in_list@plt>
  test   %rax,%rax
  jne    L114
  cmpq   $0x1,-0x20(%rbp)
  je     L136
  mov    -0x8(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movb   $0x2c,(%rax)
  addq   $0x1,-0x20(%rbp)
  mov    -0x8(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movb   $0x20,(%rax)
  addq   $0x1,-0x20(%rbp)
L136:
  mov    -0x8(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movb   $0x22,(%rax)
  addq   $0x1,-0x20(%rbp)
  mov    -0x38(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x8(%rbp),%rcx
  mov    -0x20(%rbp),%rdx
  add    %rdx,%rcx
  mov    -0x30(%rbp),%rdx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  mov    -0x30(%rbp),%rax
  add    %rax,-0x20(%rbp)
  mov    -0x8(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movb   $0x22,(%rax)
  addq   $0x1,-0x20(%rbp)
  mov    -0x8(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movb   $0x3a,(%rax)
  addq   $0x1,-0x20(%rbp)
  mov    -0x8(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movb   $0x22,(%rax)
  addq   $0x1,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,%rdx
  mov    -0x8(%rbp),%rcx
  mov    -0x20(%rbp),%rax
  add    %rax,%rcx
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    %rax,-0x20(%rbp)
  mov    -0x8(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movb   $0x22,(%rax)
  addq   $0x1,-0x20(%rbp)
  jmp    L109
L128:
  nop
  jmp    L109
L114:
  nop
L109:
  addq   $0x1,-0x38(%rbp)
L23:
  mov    -0x38(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L112
  mov    -0x8(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movb   $0x7d,(%rax)
  addq   $0x1,-0x20(%rbp)
  mov    -0x8(%rbp),%rax
L33:
  leave
  ret
```

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;
}
```