user: 请从给定的汇编指令推导出C源代码：

```asm
<test_mink>:
  endbr64
  push   %rbp
  mov    $0x5,%ecx
  mov    $0xa,%edx
  mov    %rsp,%rbp
  push   %r13
  push   %r12
  lea    -0x80(%rbp),%rdi
  lea    -0x8c(%rbp),%r13
  push   %rbx
  lea    -0xa0(%rbp),%rbx
  lea    D137(%rip),%r12
  mov    %rbx,%rsi
  sub    $0x98,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  mov    D39(%rip),%rax
  movq   $0x0,-0x80(%rbp)
  mov    %rax,-0x78(%rbp)
  mov    D49(%rip),%rax
  mov    %rax,-0x70(%rbp)
  mov    D102(%rip),%rax
  mov    %rax,-0x68(%rbp)
  mov    D126(%rip),%rax
  mov    %rax,-0x60(%rbp)
  mov    D119(%rip),%rax
  mov    %rax,-0x58(%rbp)
  mov    D85(%rip),%rax
  mov    %rax,-0x50(%rbp)
  mov    D136(%rip),%rax
  mov    %rax,-0x48(%rbp)
  mov    D29(%rip),%rax
  mov    %rax,-0x40(%rbp)
  mov    D47(%rip),%rax
  mov    %rax,-0x38(%rbp)
  call   <mink@plt>
  lea    D7(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L47:
  mov    (%rbx),%esi
  mov    %r12,%rdi
  xor    %eax,%eax
  add    $0x4,%rbx
  call   <printf@plt>
  cmp    %r13,%rbx
  jne    L47
  lea    D45(%rip),%rdi
  call   <puts@plt>
  lea    -0xc3000(%rsp),%rax
  cmp    %rax,%rsp
  je     L19
L17:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L17
L19:
  sub    $0x500,%rsp
  orq    $0x0,0x4f8(%rsp)
  mov    %rsp,%r13
  mov    %r13,%rbx
  lea    0xc3500(%r13),%r12
  nopw   0x0(%rax,%rax,1)
L44:
  mov    $0x1,%esi
  xor    %edi,%edi
  add    $0x8,%rbx
  call   <normrand@plt>
  movsd  %xmm0,-0x8(%rbx)
  cmp    %rbx,%r12
  jne    L44
  lea    -0x61000(%rsp),%rax
  cmp    %rax,%rsp
  je     L37
L8:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L8
L37:
  sub    $0xa80,%rsp
  orq    $0x0,0xa78(%rsp)
  xor    %eax,%eax
  call   <get_time_ms@plt>
  mov    %rsp,%r12
  mov    $0x186a0,%edx
  mov    %r13,%rdi
  mov    %r12,%rsi
  movsd  %xmm0,-0xa8(%rbp)
  call   <sort_indices@plt>
  xor    %eax,%eax
  call   <get_time_ms@plt>
  mov    $0x186a0,%esi
  mov    $0x1,%eax
  subsd  -0xa8(%rbp),%xmm0
  lea    D104(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  call   <get_time_ms@plt>
  mov    %r12,%rsi
  mov    %r13,%rdi
  mov    $0x64,%ecx
  mov    $0x186a0,%edx
  movsd  %xmm0,-0xa8(%rbp)
  call   <mink@plt>
  xor    %eax,%eax
  call   <get_time_ms@plt>
  mov    $0x64,%esi
  mov    $0x1,%eax
  subsd  -0xa8(%rbp),%xmm0
  lea    D53(%rip),%rdi
  call   <printf@plt>
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L9
  lea    -0x18(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %rbp
  ret
L9:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D137
data_type: string
name: read_data
arguments: label: D39
data_type: byte[8]
name: read_data
arguments: label: D49
data_type: byte[8]
name: read_data
arguments: label: D102
data_type: byte[8]
name: read_data
arguments: label: D126
data_type: byte[8]
name: read_data
arguments: label: D119
data_type: byte[8]
name: read_data
arguments: label: D85
data_type: byte[8]
name: read_data
arguments: label: D136
data_type: byte[8]
name: read_data
arguments: label: D29
data_type: byte[8]
name: read_data
arguments: label: D47
data_type: byte[8]
name: read_data
arguments: label: D7
data_type: string
name: read_data
arguments: label: D45
data_type: string
name: read_data
arguments: label: D104
data_type: string
name: read_data
arguments: label: D53
data_type: string

tool: D137: %d 

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

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

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

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

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

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

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

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

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

tool: D7: idx = [ 

tool: D45: ]

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


tool: D53: 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);
}
```