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

```asm
<hpp_simulation>:
  endbr64
  push   %r15
  mov    %esi,%r15d
  push   %r14
  push   %r13
  push   %r12
  movslq %edi,%r12
  xor    %edi,%edi
  push   %rbp
  mov    %r12,%r14
  push   %rbx
  mov    %r12d,%ebx
  sub    $0x48,%rsp
  test   %r12d,%r12d
  setg   %dil
  movsd  %xmm0,0x18(%rsp)
  imul   %r12d,%ebx
  movsd  %xmm1,0x28(%rsp)
  call   <assert@plt>
  mov    %r15d,%edi
  not    %edi
  shr    $0x1f,%edi
  call   <assert@plt>
  mov    %ebx,%edi
  call   <malloc@plt>
  mov    %ebx,%edi
  mov    %rax,%rbp
  call   <malloc@plt>
  mov    %rax,%r13
  test   %rbp,%rbp
  je     L69
  test   %rax,%rax
  je     L69
L91:
  xor    %esi,%esi
  mov    %ebx,%edx
  mov    %rbp,%rdi
  call   <memset@plt>
  xor    %esi,%esi
  mov    %ebx,%edx
  mov    %r13,%rdi
  call   <memset@plt>
  movsd  0x28(%rsp),%xmm7
  comisd 0x18(%rsp),%xmm7
  jbe    L13
  mov    %r14d,%eax
  pxor   %xmm7,%xmm7
  shr    $0x1f,%eax
  add    %r14d,%eax
  sar    %eax
  cvtsi2sd %eax,%xmm7
  movsd  %xmm7,0x20(%rsp)
  nopw   0x0(%rax,%rax,1)
L101:
  mov    D25(%rip),%rax
  pxor   %xmm1,%xmm1
  mov    $0x1,%ebx
  movapd %xmm1,%xmm0
  movq   %rax,%xmm2
  jmp    L7
  nopl   0x0(%rax,%rax,1)
L22:
  lea    0x38(%rsp),%rdi
  lea    0x30(%rsp),%rsi
  movsd  %xmm0,(%rsp)
  call   <sincos@plt>
  movsd  0x30(%rsp),%xmm2
  movsd  0x38(%rsp),%xmm1
  movsd  (%rsp),%xmm0
L7:
  movsd  %xmm1,0x10(%rsp)
  movsd  %xmm2,0x8(%rsp)
  movsd  %xmm0,(%rsp)
  call   <conv_angle_to_direc@plt>
  movsd  0x18(%rsp),%xmm3
  movsd  (%rsp),%xmm0
  mov    %ebx,%edi
  movsd  0x10(%rsp),%xmm1
  movsd  0x20(%rsp),%xmm4
  mov    %eax,%ecx
  movsd  0x8(%rsp),%xmm2
  movsd  D32(%rip),%xmm5
  shl    %cl,%edi
  mulsd  %xmm3,%xmm1
  mulsd  %xmm3,%xmm2
  addsd  %xmm4,%xmm1
  addsd  %xmm4,%xmm2
  cvttsd2si %xmm1,%edx
  movsd  D20(%rip),%xmm1
  cvttsd2si %xmm2,%esi
  divsd  %xmm3,%xmm1
  movslq %edx,%rdx
  imul   %r12,%rdx
  movslq %esi,%rsi
  add    %rbp,%rdx
  or     %dil,(%rdx,%rsi,1)
  addsd  %xmm1,%xmm0
  comisd %xmm0,%xmm5
  ja     L22
  movsd  D20(%rip),%xmm6
  addsd  0x18(%rsp),%xmm6
  movsd  0x28(%rsp),%xmm7
  comisd %xmm6,%xmm7
  movsd  %xmm6,0x18(%rsp)
  ja     L101
L13:
  xor    %ebx,%ebx
  test   %r15d,%r15d
  jg     L47
  jmp    L24
  xchg   %ax,%ax
L70:
  mov    %rbp,%rax
  mov    %r13,%rbp
  mov    %rax,%r13
L47:
  mov    %r14d,%edx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  add    $0x1,%ebx
  call   <take_next_step@plt>
  cmp    %ebx,%r15d
  jne    L70
L5:
  mov    %rbp,%rdi
  call   <free@plt>
  add    $0x48,%rsp
  mov    %r13,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L69:
  lea    D24(%rip),%rdi
  call   <perror@plt>
  xor    %eax,%eax
  call   <abort@plt>
  jmp    L91
L24:
  mov    %r13,%rax
  mov    %rbp,%r13
  mov    %rax,%rbp
  jmp    L5
```

tool_calls: name: extract_symbolic_data
arguments: tag: D25
datatype: f64
name: extract_symbolic_data
arguments: tag: D32
datatype: byte[8]
name: extract_symbolic_data
arguments: tag: D20
datatype: f64
name: extract_symbolic_data
arguments: tag: D24
datatype: string

tool: D25: 1

tool: {"D32": [0x18,0x2d,0x44,0x54,0xfb,0x21,0x19,0x40]}

tool: D20: 0.5

tool: D24: malloc (lattice)

assistant: ```c
char *hpp_simulation(int dim, double r0, double r1, int nsteps) {
  assert(dim > 0);
  assert(nsteps >= 0);
  char(*oldlat)[dim] = (char(*)[dim])malloc(dim * dim * sizeof(char));
  char(*newlat)[dim] = (char(*)[dim])malloc(dim * dim * sizeof(char));
  if (oldlat == NULL || newlat == NULL) {
    perror("malloc (lattice)");
    abort();
  }
  double radius, angle;
  memset(oldlat, 0, dim * dim * sizeof(char));
  memset(newlat, 0, dim * dim * sizeof(char));
  for (radius = r0; radius < r1; radius += 0.5) {
    for (angle = 0; angle < 2 * (atan(1.0) * 4.0); angle += 0.5 / radius) {
      int direc = conv_angle_to_direc(angle);
      int x = radius * cos(angle) + dim / 2;
      int y = radius * sin(angle) + dim / 2;
      ((oldlat[y][x]) |= (1 << (direc)));
    }
  }
  int i;
  char(*tmp)[dim];
  for (i = 0; i < nsteps; i++) {
    take_next_step((char *)oldlat, (char *)newlat, dim);
    tmp = oldlat;
    oldlat = newlat;
    newlat = tmp;
  }
  free(newlat);
  return (char *)oldlat;
}
```