user: Converte this assembly snippet into its equivalent C code:

```asm
<adaptive_step>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  lea    0x1(%rdi),%ebp
  push   %rbx
  movslq %ebp,%rbp
  mov    %edi,%ebx
  shl    $0x2,%rbp
  mov    %rbp,%rdi
  sub    $0x68,%rsp
  mov    %rcx,(%rsp)
  mov    %rdx,0x40(%rsp)
  mov    %r8,0x10(%rsp)
  movss  %xmm0,0xc(%rsp)
  movss  %xmm1,0x28(%rsp)
  movss  %xmm2,0x2c(%rsp)
  movss  %xmm3,0x4c(%rsp)
  movss  %xmm4,0x48(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  call   <malloc@plt>
  mov    %rbp,%rdi
  mov    %rax,%r13
  call   <malloc@plt>
  mov    %rbp,%rdi
  mov    %rax,0x18(%rsp)
  call   <malloc@plt>
  mov    (%rsp),%rcx
  mov    %rax,0x20(%rsp)
  movl   $0x0,(%rcx)
  test   %ebx,%ebx
  jle    L112
  lea    0x4(%r13),%rdx
  lea    0x8(%r12),%rdi
  mov    %rdx,%rsi
  lea    -0x1(%rbx),%ecx
  mov    %rdx,%rax
  sub    %rdi,%rsi
  cmp    $0x8,%rsi
  jbe    L134
  cmp    $0x2,%ecx
  jbe    L134
  mov    %ebx,%edx
  shr    $0x2,%edx
  sub    $0x1,%edx
  shl    $0x4,%rdx
  lea    0x14(%r13,%rdx,1),%rcx
  mov    %r12,%rdx
  sub    %r13,%rdx
  nopl   0x0(%rax,%rax,1)
L133:
  movups (%rax,%rdx,1),%xmm2
  add    $0x10,%rax
  movups %xmm2,-0x10(%rax)
  cmp    %rcx,%rax
  jne    L133
  mov    %ebx,%eax
  and    $0xfffffffc,%eax
  lea    0x1(%rax),%edx
  cmp    %eax,%ebx
  je     L112
  movslq %edx,%rdx
  movss  (%r12,%rdx,4),%xmm0
  lea    0x0(,%rdx,4),%rcx
  movss  %xmm0,0x0(%r13,%rdx,4)
  lea    0x2(%rax),%edx
  cmp    %edx,%ebx
  jl     L112
  movss  0x4(%r12,%rcx,1),%xmm0
  add    $0x3,%eax
  movss  %xmm0,0x4(%r13,%rcx,1)
  cmp    %eax,%ebx
  jl     L112
  movss  0x8(%r12,%rcx,1),%xmm0
  movss  %xmm0,0x8(%r13,%rcx,1)
L112:
  lea    0x54(%rsp),%rax
  mov    0x18(%rsp),%r12
  mov    0x20(%rsp),%rbp
  pxor   %xmm2,%xmm2
  mov    %rax,0x38(%rsp)
  lea    0x4c(%rsp),%rax
  mov    %rax,0x30(%rsp)
  sub    %r13,%r12
  sub    %r13,%rbp
  movss  %xmm2,0x8(%rsp)
  nopl   (%rax)
L226:
  movss  0x8(%rsp),%xmm0
  mov    0x18(%rsp),%rsi
  mov    %r13,%rdi
  addss  0x28(%rsp),%xmm0
  mov    0x10(%rsp),%rax
  call   *%rax
  test   %ebx,%ebx
  jle    L115
  lea    0x4(%r13),%r14
  mov    $0x1,%r15d
  nopl   0x0(%rax)
L198:
  movss  (%r14),%xmm0
  add    $0x1,%r15d
  call   <fabs@plt>
  movss  %xmm0,(%rsp)
  movss  (%r12,%r14,1),%xmm0
  mulss  0x4c(%rsp),%xmm0
  call   <fabs@plt>
  addss  (%rsp),%xmm0
  cvtss2sd %xmm0,%xmm0
  addsd  D7(%rip),%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,0x0(%rbp,%r14,1)
  add    $0x4,%r14
  cmp    %r15d,%ebx
  jge    L198
L115:
  movss  0x8(%rsp),%xmm7
  movss  0x4c(%rsp),%xmm0
  movss  0xc(%rsp),%xmm3
  addss  %xmm7,%xmm0
  comiss %xmm3,%xmm0
  jbe    L21
  movaps %xmm3,%xmm0
  mov    0x10(%rsp),%r9
  mov    0x20(%rsp),%r8
  mov    %r13,%rsi
  subss  %xmm7,%xmm0
  mov    0x38(%rsp),%rcx
  mov    0x30(%rsp),%rdx
  mov    %ebx,%edi
  movss  0x48(%rsp),%xmm2
  movss  0x2c(%rsp),%xmm1
  cvtss2sd %xmm0,%xmm0
  addsd  D7(%rip),%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,0x4c(%rsp)
  movaps %xmm7,%xmm0
  call   <adaptive_heun@plt>
  movss  0x8(%rsp),%xmm6
  addss  0x4c(%rsp),%xmm6
  comiss 0xc(%rsp),%xmm6
  movss  0x54(%rsp),%xmm0
  movss  %xmm6,0x8(%rsp)
  movss  %xmm0,0x4c(%rsp)
  jb     L226
L15:
  test   %ebx,%ebx
  jle    L2
  mov    0x40(%rsp),%rsi
  lea    -0x1(%rbx),%edx
  mov    %rsi,%rax
  sub    %r13,%rax
  sub    $0x4,%rax
  cmp    $0x8,%rax
  lea    0x4(%r13),%rax
  jbe    L136
  cmp    $0x2,%edx
  jbe    L136
  mov    %ebx,%edx
  sub    %r13,%rsi
  shr    $0x2,%edx
  sub    $0x1,%edx
  shl    $0x4,%rdx
  lea    0x14(%r13,%rdx,1),%rcx
  mov    %rsi,%rdx
  nopl   0x0(%rax,%rax,1)
L137:
  movups (%rax),%xmm7
  movups %xmm7,(%rdx,%rax,1)
  add    $0x10,%rax
  cmp    %rcx,%rax
  jne    L137
  mov    %ebx,%eax
  and    $0xfffffffc,%eax
  lea    0x1(%rax),%edx
  cmp    %eax,%ebx
  je     L2
  movslq %edx,%rdx
  mov    0x40(%rsp),%rdi
  movss  0x0(%r13,%rdx,4),%xmm0
  lea    0x0(,%rdx,4),%rcx
  movss  %xmm0,(%rdi,%rdx,4)
  lea    0x2(%rax),%edx
  cmp    %edx,%ebx
  jl     L2
  movss  0x4(%r13,%rcx,1),%xmm0
  add    $0x3,%eax
  movss  %xmm0,0x4(%rdi,%rcx,1)
  cmp    %ebx,%eax
  jg     L2
  movss  0x8(%r13,%rcx,1),%xmm0
  movss  %xmm0,0x8(%rdi,%rcx,1)
L2:
  mov    %r13,%rdi
  call   <free@plt>
  mov    0x18(%rsp),%rdi
  call   <free@plt>
  mov    0x20(%rsp),%rdi
  call   <free@plt>
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L55
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L21:
  mov    0x10(%rsp),%r9
  mov    0x20(%rsp),%r8
  movaps %xmm7,%xmm0
  mov    %r13,%rsi
  mov    0x38(%rsp),%rcx
  movss  0x48(%rsp),%xmm2
  mov    %ebx,%edi
  mov    0x30(%rsp),%rdx
  movss  0x2c(%rsp),%xmm1
  call   <adaptive_heun@plt>
  movss  0x8(%rsp),%xmm4
  addss  0x4c(%rsp),%xmm4
  comiss 0xc(%rsp),%xmm4
  movss  0x54(%rsp),%xmm0
  movss  %xmm4,0x8(%rsp)
  movss  %xmm0,0x4c(%rsp)
  jb     L226
  jmp    L15
L136:
  lea    0x8(%r13,%rdx,4),%rcx
  mov    0x40(%rsp),%rdx
  sub    %r13,%rdx
  nopl   0x0(%rax,%rax,1)
L28:
  movss  (%rax),%xmm0
  movss  %xmm0,(%rdx,%rax,1)
  add    $0x4,%rax
  cmp    %rcx,%rax
  jne    L28
  jmp    L2
L134:
  lea    0x8(%r13,%rcx,4),%rax
  sub    %r13,%r12
  nop
L237:
  movss  (%r12,%rdx,1),%xmm0
  add    $0x4,%rdx
  movss  %xmm0,-0x4(%rdx)
  cmp    %rax,%rdx
  jne    L237
  jmp    L112
L55:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D7
datatype: byte[8]

tool: {"D7": [0x23,0x42,0x92,0x0c,0xa1,0x9c,0xc7,0x3b]}

assistant: ```c
void adaptive_step(int n, float h, float t, float yin[], float yout[], float acc, float hh, float hhmin, int(*count), void (*function)(float, float[], float[])) {
  int i;
  float time = 0.0;
  float hhnext;
  float *y;
  float *f;
  float *yscal;
  y = (float *)malloc((size_t)(n + 1) * sizeof(float));
  f = (float *)malloc((size_t)(n + 1) * sizeof(float));
  yscal = (float *)malloc((size_t)(n + 1) * sizeof(float));
  (*count) = 0;
  for (i = 1; i <= n; i++)
    y[i] = yin[i];
  for (;;) {
    (*function)(t + time, y, f);
    for (i = 1; i <= n; i++)
      yscal[i] = fabs(y[i]) + fabs(f[i] * hh) + 1.0e-20;
    if (time + hh > h)
      hh = h - time + 1.0e-20;
    adaptive_heun(n, time, y, acc, &hh, hhmin, &hhnext, yscal, function);
    time += hh;
    hh = hhnext;
    (*count++);
    if (time >= h)
      break;
  }
  for (i = 1; i <= n; i++)
    yout[i] = y[i];
  free(y);
  free(f);
  free(yscal);
}
```