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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xe0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0xa,-0xb0(%rbp)
  movq   $0x32,-0xa8(%rbp)
  movq   $0x64,-0xa0(%rbp)
  movq   $0xc8,-0x98(%rbp)
  movq   $0x12c,-0x90(%rbp)
  movq   $0x190,-0x88(%rbp)
  movq   $0x1f4,-0x80(%rbp)
  movq   $0x2bc,-0x78(%rbp)
  movq   $0x320,-0x70(%rbp)
  movq   $0x3e8,-0x68(%rbp)
  lea    D33(%rip),%rax
  mov    %rax,-0xc8(%rbp)
  lea    D46(%rip),%rax
  mov    %rax,-0xc0(%rbp)
  movq   $0x0,-0xe0(%rbp)
  jmp    L45
L41:
  mov    -0xe0(%rbp),%rax
  mov    -0xb0(%rbp,%rax,8),%rax
  mov    $0x8,%esi
  mov    %rax,%rdi
  call   <calloc@plt>
  mov    %rax,-0xb8(%rbp)
  movq   $0x0,-0xd8(%rbp)
  jmp    L31
L12:
  mov    $0x0,%eax
  call   <rand@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  mov    -0xd8(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0xb8(%rbp),%rax
  add    %rdx,%rax
  movsd  D9(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addq   $0x1,-0xd8(%rbp)
L31:
  mov    -0xe0(%rbp),%rax
  mov    -0xb0(%rbp,%rax,8),%rax
  cmp    %rax,-0xd8(%rbp)
  jl     L12
  mov    -0xe0(%rbp),%rax
  mov    -0xb0(%rbp,%rax,8),%rdx
  mov    -0xb8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <CSPL_Sort_gnomesort@plt>
  mov    -0xe0(%rbp),%rdx
  mov    %rax,-0x60(%rbp,%rdx,8)
  mov    -0xe0(%rbp),%rax
  mov    -0x60(%rbp,%rax,8),%rdx
  mov    -0xe0(%rbp),%rax
  mov    -0xb0(%rbp,%rax,8),%rax
  mov    %rax,%rsi
  lea    D47(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0xc0(%rbp),%rax
  mov    %rax,-0xd0(%rbp)
  mov    -0xe0(%rbp),%rax
  mov    -0xb0(%rbp,%rax,8),%rdx
  mov    -0xe0(%rbp),%rax
  mov    -0xb0(%rbp,%rax,8),%rax
  imul   %rax,%rdx
  mov    -0xe0(%rbp),%rax
  mov    -0x60(%rbp,%rax,8),%rax
  cmp    %rax,%rdx
  jle    L50
  mov    -0xc8(%rbp),%rax
  mov    %rax,-0xd0(%rbp)
L50:
  mov    -0xd0(%rbp),%rax
  mov    %rax,%rsi
  lea    D39(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0xb8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  addq   $0x1,-0xe0(%rbp)
L45:
  cmpq   $0x9,-0xe0(%rbp)
  jle    L41
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L30
  call   <__stack_chk_fail@plt>
L30:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D33
data_type: string
name: extract_symbolic_data
arguments: data_tag: D46
data_type: string
name: extract_symbolic_data
arguments: data_tag: D9
data_type: f64
name: extract_symbolic_data
arguments: data_tag: D47
data_type: string
name: extract_symbolic_data
arguments: data_tag: D39
data_type: string

tool: D33: Better

tool: D46: Worse

tool: D9: 12.34

tool: D47: Random array gnomesorted, %ld elements, %ld swaps


tool: D39: 	Expected is n**2 performance: it was %s


assistant: ```c
int main(void) {
  double *dat1;
  long i, j;
  long lengths[10] = {10, 50, 100, 200, 300, 400, 500, 700, 800, 1000};
  long nswaps[10];
  char *msg1 = "Better";
  char *msg2 = "Worse";
  char *msg;
  for (i = 0; i < 10; i++) {
    dat1 = (double *)calloc(lengths[i], sizeof(double));
    for (j = 0; j < lengths[i]; j++) {
      dat1[j] = ((double)rand()) / 12.34;
    }
    nswaps[i] = CSPL_Sort_gnomesort(dat1, lengths[i]);
    printf("Random array gnomesorted, %ld elements, %ld swaps\n", lengths[i], nswaps[i]);
    msg = msg2;
    if (lengths[i] * lengths[i] > nswaps[i])
      msg = msg1;
    printf("\tExpected is n**2 performance: it was %s\n", msg);
    free(dat1);
  }
  return (0);
}
```