user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<test_mink>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x88,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x80(%rbp)
  mov    D111(%rip),%rax
  mov    %rax,-0x78(%rbp)
  mov    D117(%rip),%rax
  mov    %rax,-0x70(%rbp)
  mov    D24(%rip),%rax
  mov    %rax,-0x68(%rbp)
  mov    D126(%rip),%rax
  mov    %rax,-0x60(%rbp)
  mov    D6(%rip),%rax
  mov    %rax,-0x58(%rbp)
  mov    D7(%rip),%rax
  mov    %rax,-0x50(%rbp)
  mov    D110(%rip),%rax
  mov    %rax,-0x48(%rbp)
  mov    D58(%rip),%rax
  mov    %rax,-0x40(%rbp)
  mov    D17(%rip),%rax
  mov    %rax,-0x38(%rbp)
  lea    -0xa0(%rbp),%rbx
  lea    -0x80(%rbp),%rdi
  mov    $0x5,%ecx
  mov    $0xa,%edx
  mov    %rbx,%rsi
  call   <mink@plt>
  lea    D69(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0x8c(%rbp),%r13
  lea    D22(%rip),%r12
L28:
  mov    (%rbx),%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x4,%rbx
  cmp    %r13,%rbx
  jne    L28
  lea    D13(%rip),%rdi
  call   <puts@plt>
  lea    -0xc3000(%rsp),%rax
L17:
  cmp    %rax,%rsp
  je     L46
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L17
L46:
  sub    $0x500,%rsp
  orq    $0x0,0x4f8(%rsp)
  mov    %rsp,%r13
  mov    %r13,%rbx
  lea    0xc3500(%r13),%r12
L40:
  mov    $0x1,%esi
  mov    $0x0,%edi
  call   <normrand@plt>
  movsd  %xmm0,(%rbx)
  add    $0x8,%rbx
  cmp    %r12,%rbx
  jne    L40
  lea    -0x61000(%rsp),%rax
L49:
  cmp    %rax,%rsp
  je     L67
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L49
L67:
  sub    $0xa80,%rsp
  orq    $0x0,0xa78(%rsp)
  mov    %rsp,%r12
  mov    $0x0,%eax
  call   <get_time_ms@plt>
  movq   %xmm0,%rbx
  mov    $0x186a0,%edx
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <sort_indices@plt>
  mov    $0x0,%eax
  call   <get_time_ms@plt>
  movq   %rbx,%xmm1
  subsd  %xmm1,%xmm0
  mov    $0x186a0,%esi
  lea    D8(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  call   <get_time_ms@plt>
  movq   %xmm0,%rbx
  mov    $0x64,%ecx
  mov    $0x186a0,%edx
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <mink@plt>
  mov    $0x0,%eax
  call   <get_time_ms@plt>
  movq   %rbx,%xmm2
  subsd  %xmm2,%xmm0
  mov    $0x64,%esi
  lea    D37(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L22
  lea    -0x18(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %rbp
  ret
L22:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D111
datatype: byte[8]
name: retrieve_data
arguments: label: D117
datatype: byte[8]
name: retrieve_data
arguments: label: D24
datatype: byte[8]
name: retrieve_data
arguments: label: D126
datatype: byte[8]
name: retrieve_data
arguments: label: D6
datatype: byte[8]
name: retrieve_data
arguments: label: D7
datatype: byte[8]
name: retrieve_data
arguments: label: D110
datatype: byte[8]
name: retrieve_data
arguments: label: D58
datatype: byte[8]
name: retrieve_data
arguments: label: D17
datatype: byte[8]
name: retrieve_data
arguments: label: D69
datatype: string
name: retrieve_data
arguments: label: D22
datatype: string
name: retrieve_data
arguments: label: D13
datatype: string
name: retrieve_data
arguments: label: D8
datatype: string
name: retrieve_data
arguments: label: D37
datatype: string

tool: {"D111": [0x00,0x00,0x00,0x00,0x00,0x80,0x56,0x40]}

tool: {"D117": [0x00,0x00,0x00,0x00,0x00,0x80,0x51,0x40]}

tool: {"D24": [0x00,0x00,0x00,0x00,0x00,0x00,0x44,0x40]}

tool: {"D126": [0x00,0x00,0x00,0x00,0x00,0x00,0x34,0x40]}

tool: {"D6": [0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x40]}

tool: {"D7": [0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x40]}

tool: {"D110": [0x00,0x00,0x00,0x00,0x00,0x00,0x54,0x40]}

tool: {"D58": [0x00,0x00,0x00,0x00,0x00,0x00,0x49,0x40]}

tool: {"D17": [0x00,0x00,0x00,0x00,0x00,0x00,0x4e,0x40]}

tool: D69: idx = [ 

tool: D22: %d 

tool: D13: ]

tool: D8: sorted %d numbers in %f ms


tool: D37: got the min %d numbers in %f ms


assistant: ```c
void test_mink() {
  double x[10] = {0, 90, 70, 40, 20, 10, 30, 80, 50, 60};
  int idx[5];
  mink(x, idx, 10, 5);
  printf("idx = [ ");
  int i;
  for (i = 0; i < 5; i++)
    printf("%d ", idx[i]);
  printf("]\n");
  int n = 100000;
  double y[n];
  for (i = 0; i < n; i++)
    y[i] = normrand(0, 1);
  int yi[n];
  double t = get_time_ms();
  sort_indices(y, yi, n);
  printf("sorted %d numbers in %f ms\n", n, get_time_ms() - t);
  t = get_time_ms();
  mink(y, yi, n, 100);
  printf("got the min %d numbers in %f ms\n", 100, get_time_ms() - t);
}
```