user: Please show me the C implementation that matches the assembly code listed below:

```asm
<getPathsAppendedWithCommand>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  lea    D2(%rip),%rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    (%rsi),%rdi
  test   %rdi,%rdi
  je     L34
L38:
  mov    $0x4,%edx
  mov    %rbp,%rsi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L94
  mov    (%r12),%rdi
  call   <strlen@plt>
  lea    -0x4(%rax),%edi
  call   <malloc@plt>
  mov    (%r12),%rsi
  mov    %rax,%rdi
  mov    %rax,%rbp
  add    $0x5,%rsi
  call   <strcpy@plt>
L108:
  mov    $0x400,%edi
  call   <malloc@plt>
  lea    0x8(%rax),%rdi
  mov    %rax,%rcx
  movq   $0x0,(%rax)
  mov    %rax,%r12
  movq   $0x0,0x3f8(%rax)
  and    $0xfffffffffffffff8,%rdi
  xor    %eax,%eax
  sub    %rdi,%rcx
  add    $0x400,%ecx
  shr    $0x3,%ecx
  rep stos %rax,%es:(%rdi)
  mov    $0x80,%edi
  call   <malloc@plt>
  mov    %rax,(%r12)
  movzbl 0x0(%rbp),%ecx
  test   %cl,%cl
  je     L111
  add    $0x1,%rbp
  xor    %esi,%esi
  xor    %r13d,%r13d
  jmp    L40
  nop
L14:
  add    $0x1,%rbp
  mov    %cl,(%rax)
  add    $0x1,%esi
  mov    (%r8),%rax
  movzbl -0x1(%rbp),%ecx
  movslq %esi,%rdx
  add    %rax,%rdx
  test   %cl,%cl
  je     L10
L40:
  movslq %r13d,%rdx
  movslq %esi,%rdi
  shl    $0x3,%rdx
  add    %rdi,%rax
  lea    (%r12,%rdx,1),%r8
  cmp    $0x3a,%cl
  jne    L14
  movb   $0x0,(%rax)
  mov    $0x80,%edi
  add    $0x1,%rbp
  add    $0x1,%r13d
  lea    0x8(%r12,%rdx,1),%r14
  call   <malloc@plt>
  xor    %esi,%esi
  mov    %rax,(%r14)
  movzbl -0x1(%rbp),%ecx
  mov    %rax,%rdx
  test   %cl,%cl
  jne    L40
L10:
  movb   $0x0,(%rdx)
  mov    (%r12),%rdi
  mov    %r12,%rbp
  lea    D15(%rip),%r13
  test   %rdi,%rdi
  je     L8
L27:
  mov    %r13,%rsi
  add    $0x8,%rbp
  call   <mystrcat@plt>
  mov    -0x8(%rbp),%rdi
  mov    %rbx,%rsi
  call   <mystrcat@plt>
  mov    0x0(%rbp),%rdi
  test   %rdi,%rdi
  jne    L27
L8:
  pop    %rbx
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L94:
  mov    0x8(%r12),%rdi
  add    $0x8,%r12
  test   %rdi,%rdi
  jne    L38
L34:
  xor    %ebp,%ebp
  jmp    L108
L111:
  mov    %rax,%rdx
  jmp    L10
```

tool_calls: name: retrieve_data
arguments: label: D2
type: string
name: retrieve_data
arguments: label: D15
type: string

tool: D2: PATH

tool: D15: /

assistant: ```c
char **getPathsAppendedWithCommand(char *command, char *envp[]) {
  int i, j = 0, k = 0;
  char *pathvar = NULL;
  char **paths = NULL;
  for (i = 0; envp[i]; i++) {
    if (strncmp(envp[i], "PATH", 4) == 0) {
      pathvar = malloc(strlen(envp[i]) - 4);
      strcpy(pathvar, envp[i] + 5);
      break;
    } else
      continue;
  }
  paths = malloc(sizeof(char *) * 128);
  for (i = 0; i < 128; i++) {
    paths[i] = NULL;
  }
  paths[0] = malloc(sizeof(char) * 128);
  for (i = 0; pathvar[i] != '\0'; i++) {
    if (pathvar[i] != ':') {
      paths[j][k] = pathvar[i];
      k++;
    } else {
      paths[j][k] = '\0';
      j++;
      paths[j] = malloc(sizeof(char) * 128);
      k = 0;
    }
  }
  paths[j][k] = '\0';
  for (i = 0; paths[i]; i++) {
    mystrcat(paths[i], "/");
    mystrcat(paths[i], command);
  }
  return paths;
}
```