user: What is the c source code of the assembly code below?

```asm
<h_util_path_join>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  cmpq   $0x0,-0x38(%rbp)
  jne    L32
  mov    $0x0,%eax
  jmp    L53
L32:
  cmpq   $0x0,-0x40(%rbp)
  jne    L14
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    $0x1,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x1c(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0x38(%rbp),%rcx
  mov    -0x8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x1c(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x8(%rbp),%rax
  jmp    L53
L14:
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x2c(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x28(%rbp)
  mov    -0x2c(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  je     L54
  mov    -0x40(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L11
L54:
  mov    -0x2c(%rbp),%edx
  mov    -0x28(%rbp),%eax
  add    %edx,%eax
  add    $0x1,%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x20(%rbp),%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x2c(%rbp),%edx
  mov    -0x38(%rbp),%rcx
  mov    -0x10(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x10(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x28(%rbp),%edx
  mov    -0x40(%rbp),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  mov    -0x20(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x10(%rbp),%rax
  jmp    L53
L11:
  mov    -0x2c(%rbp),%edx
  mov    -0x28(%rbp),%eax
  add    %edx,%eax
  add    $0x2,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x24(%rbp),%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x2c(%rbp),%edx
  mov    -0x38(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    $0x1,%edx
  lea    D1(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x28(%rbp),%edx
  mov    -0x40(%rbp),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  mov    -0x24(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x18(%rbp),%rax
L53:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D1
type: string

tool: D1: /

assistant: ```c
char *h_util_path_join(const char *p1, const char *p2) {
  if (p1 == NULL)
    return NULL;
  else if (p2 == NULL) {
    int len = strlen(p1) + 1;
    char *path = malloc(len);
    memcpy(path, p1, (len - 1) * sizeof(char));
    path[len - 1] = '\0';
    return path;
  }
  int len1 = strlen(p1);
  int len2 = strlen(p2);
  if (p1[len1 - 1] == '/' || p2[0] == '/') {
    int len = len1 + len2 + 1;
    char *path = malloc(len);
    memcpy(path, p1, len1);
    memcpy(path + len1, p2, len2);
    path[len - 1] = '\0';
    return path;
  } else {
    int len = len1 + len2 + 2;
    char *path = malloc(len);
    memcpy(path, p1, len1);
    memcpy(path + len1, "/", 1);
    memcpy(path + len1 + 1, p2, len2);
    path[len - 1] = '\0';
    return path;
  }
}
```