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

```asm
<reset_LD_PRELOAD>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,-0x58(%rbp)
  lea    D34(%rip),%rax
  mov    %rax,%rdi
  call   <getenv@plt>
  mov    %rax,-0x30(%rbp)
  movq   $0x0,-0x38(%rbp)
  cmpq   $0x0,-0x58(%rbp)
  je     L68
  movl   $0x0,-0x3c(%rbp)
  jmp    L54
L32:
  addl   $0x1,-0x3c(%rbp)
L54:
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L32
  mov    -0x3c(%rbp),%eax
  mov    %eax,-0x40(%rbp)
  mov    -0x3c(%rbp),%eax
  add    $0x1,%eax
  cltq
  shl    $0x3,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x38(%rbp)
  movl   $0x0,-0x44(%rbp)
  movl   $0x0,-0x40(%rbp)
  jmp    L95
L78:
  mov    -0x44(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x40(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x38(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  mov    %rax,%rdi
  call   <strdup@plt>
  mov    %rax,(%rbx)
  mov    -0x44(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  lea    D10(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  mov    -0x44(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x58(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rdx
  cmp    %rdx,%rax
  jne    L9
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    $0x3d,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  add    $0x1,%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x30(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  lea    D9(%rip),%rdx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strdel@plt>
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L9
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <free@plt>
  subl   $0x1,-0x40(%rbp)
L9:
  addl   $0x1,-0x44(%rbp)
  addl   $0x1,-0x40(%rbp)
L95:
  mov    -0x44(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L78
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movq   $0x0,(%rax)
  jmp    L59
L68:
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  call   <getenv@plt>
  mov    %rax,-0x28(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  je     L59
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  mov    %rax,%rcx
  mov    -0x30(%rbp),%rax
  lea    D9(%rip),%rdx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <strdel@plt>
  mov    %rax,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L85
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  call   <unsetenv@plt>
  jmp    L59
L85:
  mov    -0x20(%rbp),%rax
  mov    $0x1,%edx
  mov    %rax,%rsi
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  call   <setenv@plt>
L59:
  mov    -0x38(%rbp),%rax
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: read_data
arguments: data_tag: D34
datatype: string
name: read_data
arguments: data_tag: D10
datatype: string
name: read_data
arguments: data_tag: D9
datatype: string
name: read_data
arguments: data_tag: D12
datatype: string

tool: D34: OBSERVE_CAPTURE_SO

tool: D10: LD_PRELOAD=

tool: D9:  

tool: D12: LD_PRELOAD

assistant: ```c
char *const *reset_LD_PRELOAD(char *const envp[]) {
  const char *capturepath = getenv("OBSERVE_CAPTURE_SO");
  char **newenvp = NULL;
  if (envp != NULL) {
    int i;
    int j;
    int len;
    for (len = 0; envp[len] != NULL; len++)
      ;
    j = len;
    newenvp = (char **)malloc((len + 1) * sizeof(char *));
    for (i = 0, j = 0; i < len; i++, j++) {
      newenvp[j] = strdup(envp[i]);
      if (strstr(envp[i], "LD_PRELOAD"
                          "=") == envp[i]) {
        char *newpreload = strchr(newenvp[j], '=') + 1;
        strdel(newpreload, capturepath, " ");
        if (*newpreload == '\0') {
          free(newenvp[j]);
          j--;
        }
      }
    }
    newenvp[j] = NULL;
  } else {
    char *preload = getenv("LD_PRELOAD");
    if (preload != NULL) {
      char *newpreload = strdel(strdup(preload), capturepath, " ");
      if (*newpreload == '\0')
        unsetenv("LD_PRELOAD");
      else
        setenv("LD_PRELOAD", newpreload, 1);
    }
  }
  return newenvp;
}
```