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

```asm
<frac_to_cartesian>:
  endbr64
  push   %r13
  mov    %edx,%r13d
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  lea    (%rdx,%rdx,2),%edi
  shl    $0x3,%edi
  sub    $0x18,%rsp
  movsd  %xmm0,0x8(%rsp)
  call   <malloc@plt>
  movsd  0x8(%rsp),%xmm5
  test   %rax,%rax
  mov    %rax,%r12
  je     L2
L31:
  test   %r13d,%r13d
  jle    L61
  movslq %r13d,%rax
  lea    0x30(%rbp),%rsi
  lea    0x30(%r12),%rcx
  lea    (%rax,%rax,2),%rax
  lea    (%r12,%rax,8),%rax
  cmp    %rax,%rbx
  lea    0x48(%rbx),%rax
  setae  %dl
  cmp    %rax,%r12
  setae  %al
  or     %eax,%edx
  cmp    %rsi,%r12
  setae  %al
  cmp    %rcx,%rbp
  setae  %cl
  or     %ecx,%eax
  test   %al,%dl
  je     L77
  cmp    $0x1,%r13d
  je     L77
  mov    %r13d,%eax
  movsd  0x40(%rbx),%xmm3
  movsd  (%rbx),%xmm14
  mov    %r12,%r8
  shr    %eax
  movsd  0x18(%rbx),%xmm13
  movapd %xmm5,%xmm6
  movsd  0x30(%rbx),%xmm12
  sub    $0x1,%eax
  movsd  0x8(%rbx),%xmm11
  unpcklpd %xmm3,%xmm3
  movsd  0x20(%rbx),%xmm10
  lea    (%rax,%rax,2),%rcx
  movsd  0x38(%rbx),%xmm9
  movsd  0x10(%rbx),%xmm8
  mov    $0x10,%edi
  movsd  0x28(%rbx),%xmm7
  shl    $0x4,%rcx
  movsd  %xmm5,0x8(%rsp)
  unpcklpd %xmm14,%xmm14
  add    %rsi,%rcx
  mov    $0x20,%esi
  unpcklpd %xmm13,%xmm13
  mov    %rbp,%rax
  unpcklpd %xmm12,%xmm12
  unpcklpd %xmm6,%xmm6
  unpcklpd %xmm11,%xmm11
  sub    %rbp,%r8
  unpcklpd %xmm10,%xmm10
  unpcklpd %xmm9,%xmm9
  sub    %rbp,%rdi
  sub    %rbp,%rsi
  unpcklpd %xmm8,%xmm8
  unpcklpd %xmm7,%xmm7
  movapd %xmm3,%xmm5
  nopl   (%rax)
L20:
  movupd (%rax),%xmm2
  movupd 0x10(%rax),%xmm1
  lea    (%rax,%r12,1),%rdx
  movapd %xmm2,%xmm0
  movapd %xmm2,%xmm4
  movhps 0x18(%rax),%xmm0
  unpcklpd %xmm2,%xmm1
  shufpd $0x1,%xmm2,%xmm4
  movhpd 0x20(%rax),%xmm4
  movapd %xmm1,%xmm3
  movhps 0x28(%rax),%xmm3
  movapd %xmm0,%xmm2
  movapd %xmm4,%xmm1
  movapd %xmm0,%xmm15
  mulpd  %xmm13,%xmm1
  mulpd  %xmm14,%xmm2
  mulpd  %xmm11,%xmm15
  mulpd  %xmm8,%xmm0
  addpd  %xmm1,%xmm2
  movapd %xmm3,%xmm1
  mulpd  %xmm12,%xmm1
  addpd  %xmm1,%xmm2
  movapd %xmm4,%xmm1
  mulpd  %xmm10,%xmm1
  mulpd  %xmm7,%xmm4
  mulpd  %xmm6,%xmm2
  addpd  %xmm15,%xmm1
  movapd %xmm3,%xmm15
  mulpd  %xmm9,%xmm15
  addpd  %xmm4,%xmm0
  mulpd  %xmm5,%xmm3
  movapd %xmm2,%xmm4
  addpd  %xmm15,%xmm1
  addpd  %xmm3,%xmm0
  movapd %xmm2,%xmm3
  mulpd  %xmm6,%xmm1
  mulpd  %xmm6,%xmm0
  unpcklpd %xmm1,%xmm3
  shufpd $0x1,%xmm2,%xmm1
  movups %xmm3,(%r8,%rax,1)
  movsd  %xmm0,%xmm4
  add    $0x30,%rax
  movsd  %xmm1,%xmm0
  movups %xmm4,(%rdx,%rdi,1)
  movups %xmm0,(%rdx,%rsi,1)
  cmp    %rcx,%rax
  jne    L20
  mov    %r13d,%eax
  movsd  0x8(%rsp),%xmm5
  or     $0x1,%eax
  and    $0x1,%r13d
  je     L61
  lea    (%rax,%rax,2),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x18(%rbp,%rax,1),%rsi
  lea    -0x10(%rbp,%rax,1),%rcx
  movsd  (%rsi),%xmm0
  movsd  (%rcx),%xmm1
  lea    -0x8(%rbp,%rax,1),%rdx
  mulsd  0x18(%rbx),%xmm1
  mulsd  (%rbx),%xmm0
  addsd  %xmm1,%xmm0
  movsd  (%rdx),%xmm1
  mulsd  0x30(%rbx),%xmm1
  addsd  %xmm1,%xmm0
  mulsd  %xmm5,%xmm0
  movsd  %xmm0,-0x18(%r12,%rax,1)
  movsd  (%rsi),%xmm0
  movsd  (%rcx),%xmm1
  mulsd  0x8(%rbx),%xmm0
  mulsd  0x20(%rbx),%xmm1
  addsd  %xmm1,%xmm0
  movsd  (%rdx),%xmm1
  mulsd  0x38(%rbx),%xmm1
  addsd  %xmm1,%xmm0
  mulsd  %xmm5,%xmm0
  movsd  %xmm0,-0x10(%r12,%rax,1)
  movsd  (%rsi),%xmm0
  movsd  (%rcx),%xmm1
  mulsd  0x10(%rbx),%xmm0
  mulsd  0x28(%rbx),%xmm1
  addsd  %xmm1,%xmm0
  movsd  (%rdx),%xmm1
  mulsd  0x40(%rbx),%xmm1
  addsd  %xmm1,%xmm0
  mulsd  %xmm5,%xmm0
  movsd  %xmm0,-0x8(%r12,%rax,1)
L61:
  add    $0x18,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopw   0x0(%rax,%rax,1)
L2:
  mov    %r13d,%esi
  lea    D15(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D5(%rip),%rdi
  call   <puts@plt>
  mov    $0x8,%edi
  call   <exit@plt>
  movsd  0x8(%rsp),%xmm5
  jmp    L31
  nopw   0x0(%rax,%rax,1)
L77:
  lea    -0x1(%r13),%eax
  mov    %r12,%r8
  mov    $0x8,%esi
  mov    $0x10,%ecx
  lea    (%rax,%rax,2),%rax
  sub    %rbp,%r8
  sub    %rbp,%rsi
  sub    %rbp,%rcx
  lea    0x18(%rbp,%rax,8),%rdi
  mov    %rbp,%rax
  xchg   %ax,%ax
L39:
  movsd  0x18(%rbx),%xmm1
  movsd  (%rbx),%xmm0
  lea    (%r12,%rax,1),%rdx
  mulsd  (%rax),%xmm0
  mulsd  0x8(%rax),%xmm1
  addsd  %xmm0,%xmm1
  movsd  0x30(%rbx),%xmm0
  mulsd  0x10(%rax),%xmm0
  addsd  %xmm1,%xmm0
  mulsd  %xmm5,%xmm0
  movsd  %xmm0,(%r8,%rax,1)
  movsd  0x20(%rbx),%xmm1
  movsd  0x8(%rbx),%xmm0
  add    $0x18,%rax
  mulsd  -0x18(%rax),%xmm0
  mulsd  -0x10(%rax),%xmm1
  addsd  %xmm0,%xmm1
  movsd  0x38(%rbx),%xmm0
  mulsd  -0x8(%rax),%xmm0
  addsd  %xmm1,%xmm0
  mulsd  %xmm5,%xmm0
  movsd  %xmm0,(%rdx,%rsi,1)
  movsd  -0x18(%rax),%xmm1
  movsd  -0x10(%rax),%xmm0
  mulsd  0x10(%rbx),%xmm1
  mulsd  0x28(%rbx),%xmm0
  addsd  %xmm0,%xmm1
  movsd  -0x8(%rax),%xmm0
  mulsd  0x40(%rbx),%xmm0
  addsd  %xmm1,%xmm0
  mulsd  %xmm5,%xmm0
  movsd  %xmm0,(%rdx,%rcx,1)
  cmp    %rax,%rdi
  jne    L39
  add    $0x18,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D15
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D5
type_guessed: string

tool: D15: 
p_count = %i

tool: D5: 
Failed to create p_carte!

assistant: ```c
double *frac_to_cartesian(double latt_vec[], double pos_frac[], int p_count, double scale_factor) {
  int a;
  double *p_carte = NULL;
  p_carte = (double *)malloc(3 * p_count * sizeof(double));
  if (p_carte == NULL) {
    printf("\np_count = %i", p_count);
    printf("\nFailed to create p_carte!\n");
    exit(8);
  }
  for (a = 1; a <= p_count; a++) {
    p_carte[3 * a - 3] = scale_factor * ((pos_frac[3 * a - 3] * latt_vec[0]) + (pos_frac[3 * a - 2] * latt_vec[3]) + (pos_frac[3 * a - 1] * latt_vec[6]));
    p_carte[3 * a - 2] = scale_factor * ((pos_frac[3 * a - 3] * latt_vec[1]) + (pos_frac[3 * a - 2] * latt_vec[4]) + (pos_frac[3 * a - 1] * latt_vec[7]));
    p_carte[3 * a - 1] = scale_factor * ((pos_frac[3 * a - 3] * latt_vec[2]) + (pos_frac[3 * a - 2] * latt_vec[5]) + (pos_frac[3 * a - 1] * latt_vec[8]));
  }
  return p_carte;
}
```