user: Demonstrate the C code that generates the assembly output below:

```asm
<scan_env>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    (%rdi),%rdi
  movq   $0xffffffffffffffff,(%r9)
  mov    %rcx,0x8(%rsp)
  movq   $0xffffffffffffffff,(%r8)
  movq   $0xffffffffffffffff,(%rcx)
  movq   $0xffffffffffffffff,(%rdx)
  movq   $0xffffffffffffffff,(%rsi)
  test   %rdi,%rdi
  je     L152
  mov    %rsi,%rbx
  mov    %rdx,%r13
  mov    %r8,%rbp
  mov    %r9,%r12
  mov    $0xffffffffffffffff,%rax
  xor    %r14d,%r14d
  jmp    L48
  nopl   0x0(%rax)
L83:
  mov    $0xc,%edx
  lea    D23(%rip),%rsi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L64
  mov    %r14,(%rbx)
L71:
  add    $0x1,%r14
  mov    (%r15,%r14,8),%rdi
  test   %rdi,%rdi
  je     L112
L10:
  mov    (%rbx),%rax
L48:
  cmp    $0xffffffffffffffff,%rax
  jne    L83
L64:
  cmpq   $0xffffffffffffffff,0x0(%rbp)
  je     L115
  mov    (%r15,%r14,8),%rdi
  mov    $0x12,%edx
  lea    D22(%rip),%rsi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L115
  mov    %r14,0x0(%rbp)
  add    $0x1,%r14
  mov    (%r15,%r14,8),%rdi
  test   %rdi,%rdi
  jne    L10
L112:
  add    $0x18,%rsp
  mov    %r14,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L115:
  cmpq   $0xffffffffffffffff,(%r12)
  je     L167
  mov    (%r15,%r14,8),%rdi
  mov    $0x11,%edx
  lea    D24(%rip),%rsi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L167
  mov    %r14,(%r12)
  jmp    L71
  nopl   0x0(%rax)
L167:
  cmpq   $0xffffffffffffffff,0x0(%r13)
  je     L5
  mov    (%r15,%r14,8),%rdi
  mov    $0x17,%edx
  lea    D16(%rip),%rsi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L5
  mov    %r14,0x0(%r13)
  jmp    L71
  nopl   0x0(%rax)
L5:
  mov    0x8(%rsp),%rax
  cmpq   $0xffffffffffffffff,(%rax)
  je     L71
  mov    (%r15,%r14,8),%rdi
  mov    $0x1b,%edx
  lea    D45(%rip),%rsi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L71
  mov    0x8(%rsp),%rax
  mov    %r14,(%rax)
  jmp    L71
  nopl   0x0(%rax)
L152:
  xor    %r14d,%r14d
  jmp    L112
```

tool_calls: name: parse_data
arguments: data_label: D23
type_guessed: string
name: parse_data
arguments: data_label: D22
type_guessed: string
name: parse_data
arguments: data_label: D24
type_guessed: string
name: parse_data
arguments: data_label: D16
type_guessed: string
name: parse_data
arguments: data_label: D45
type_guessed: string

tool: D23: LD_PRELOAD=

tool: D22: BUILDSH_TEMPFILE=

tool: D24: BUILDSH_PRELOAD=

tool: D16: DYLD_INSERT_LIBRARIES=

tool: D45: DYLD_FORCE_FLAT_NAMESPACE=

assistant: ```c
size_t scan_env(char *const *env, size_t *ldp_pos, size_t *dil_pos, size_t *dffns_pos, size_t *lmtf_pos, size_t *lmpl_pos) {
  size_t n = 0;
  *ldp_pos = *dil_pos = *dffns_pos = *lmtf_pos = *lmpl_pos = -1;
  while (env[n] != NULL) {
    if (*ldp_pos != (size_t)-1 && !strncmp(env[n], "LD_PRELOAD=", sizeof("LD_PRELOAD=")))
      *ldp_pos = n;
    else if (*lmtf_pos != (size_t)-1 && !strncmp(env[n], "BUILDSH_TEMPFILE=", sizeof("BUILDSH_TEMPFILE=")))
      *lmtf_pos = n;
    else if (*lmpl_pos != (size_t)-1 && !strncmp(env[n], "BUILDSH_PRELOAD=", sizeof("BUILDSH_PRELOAD=")))
      *lmpl_pos = n;
    else if (*dil_pos != (size_t)-1 && !strncmp(env[n], "DYLD_INSERT_LIBRARIES=", sizeof("DYLD_INSERT_LIBRARIES=")))
      *dil_pos = n;
    else if (*dffns_pos != (size_t)-1 && !strncmp(env[n], "DYLD_FORCE_FLAT_NAMESPACE=", sizeof("DYLD_FORCE_FLAT_NAMESPACE=")))
      *dffns_pos = n;
    ++n;
  }
  return n;
}
```