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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %edi,%ebp
  mov    %rsi,%r12
  mov    $0x0,%edi
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  test   %ebp,%ebp
  jle    L173
  mov    %ebp,%ebp
  mov    $0x0,%ebx
  lea    D104(%rip),%r13
L246:
  mov    (%r12,%rbx,8),%rdx
  mov    %ebx,%esi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%rbx
  cmp    %rbp,%rbx
  jne    L246
L173:
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    D135(%rip),%rdi
  call   <puts@plt>
  mov    0x8(%r12),%rdi
  call   <atoi@plt>
  mov    %eax,%ebx
  mov    0x10(%r12),%rdi
  call   <atoi@plt>
  mov    %eax,%r14d
  mov    %eax,%edx
  mov    %ebx,%esi
  lea    D120(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %r14d,%edx
  mov    %ebx,%esi
  mov    $0xa,%edi
  call   <vrandr@plt>
  mov    %rax,%r13
  movslq %r14d,%rbx
  lea    0x0(,%r14,8),%eax
  mov    %eax,0x1c(%rsp)
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,0x10(%rsp)
  test   %rbx,%rbx
  je     L253
  mov    %rax,%rbp
  mov    %rax,%rdx
  mov    $0x0,%eax
L152:
  mov    %rax,(%rdx)
  add    $0x1,%rax
  add    $0x8,%rdx
  cmp    %rax,%rbx
  jne    L152
  lea    D51(%rip),%rdi
  call   <puts@plt>
  test   %r14d,%r14d
  jle    L90
  mov    %r13,%r12
  lea    -0x1(%r14),%eax
  shl    $0x3,%rax
  mov    %rax,0x8(%rsp)
  lea    0x8(%r13,%rax,1),%r15
  mov    %r13,%rbx
L150:
  movsd  (%rbx),%xmm0
  lea    D143(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  add    $0x8,%rbx
  cmp    %r15,%rbx
  jne    L150
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0x10(%rsp),%rbx
  mov    0x8(%rsp),%rax
  lea    0x8(%rbx,%rax,1),%rax
  mov    %rax,0x8(%rsp)
L196:
  mov    (%rbx),%rsi
  lea    D15(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x8,%rbx
  cmp    0x8(%rsp),%rbx
  jne    L196
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    %r14d,%edx
  mov    0x10(%rsp),%rsi
  mov    %r13,%rdi
  call   <fr_shellsort_double_i_@plt>
  lea    D55(%rip),%rdi
  call   <puts@plt>
  lea    D143(%rip),%rbx
L69:
  movsd  (%r12),%xmm0
  mov    %rbx,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  add    $0x8,%r12
  cmp    %r15,%r12
  jne    L69
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    D15(%rip),%rbx
L19:
  mov    0x0(%rbp),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x8,%rbp
  cmp    0x8(%rsp),%rbp
  jne    L19
L182:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0x1c(%rsp),%edi
  call   <malloc@plt>
  mov    %rax,%rbx
  mov    0x10(%rsp),%rcx
  mov    (%rcx),%rax
  movsd  0x0(%r13,%rax,8),%xmm0
  cmp    $0x1,%r14d
  jle    L57
  lea    0x8(%rcx),%r9
  mov    %r9,%rcx
  mov    $0x0,%edi
  mov    $0x1,%esi
  mov    $0x0,%eax
  movsd  D82(%rip),%xmm1
  jmp    L183
L74:
  lea    0x2(%rax,%rdi,1),%edx
  pxor   %xmm0,%xmm0
  cvtsi2sd %edx,%xmm0
  mulsd  %xmm1,%xmm0
  cmp    %esi,%eax
  jge    L92
  movslq %eax,%r10
  mov    0x10(%rsp),%rdx
  lea    (%rdx,%r10,8),%rdx
  mov    %esi,%r11d
  sub    %eax,%r11d
  lea    -0x1(%r11),%eax
  add    %r10,%rax
  lea    (%r9,%rax,8),%r10
L181:
  mov    (%rdx),%rax
  movsd  %xmm0,(%rbx,%rax,8)
  add    $0x8,%rdx
  cmp    %r10,%rdx
  jne    L181
L92:
  mov    (%r8),%rax
  movsd  0x0(%r13,%rax,8),%xmm0
  mov    %esi,%eax
L10:
  lea    0x1(%rsi),%edx
  add    $0x1,%rdi
  add    $0x8,%rcx
  cmp    %edx,%r14d
  je     L38
  mov    %edx,%esi
L183:
  mov    %rcx,%r8
  mov    (%rcx),%rdx
  ucomisd 0x0(%r13,%rdx,8),%xmm0
  jp     L1
  je     L10
L1:
  cmp    %edi,%eax
  jl     L74
  movslq %eax,%rdx
  mov    0x10(%rsp),%r11
  mov    (%r11,%rdx,8),%rdx
  add    $0x1,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,(%rbx,%rdx,8)
  jmp    L92
L38:
  cmp    %esi,%eax
  je     L228
  lea    0x2(%rax,%rsi,1),%ecx
  pxor   %xmm0,%xmm0
  cvtsi2sd %ecx,%xmm0
  mulsd  D82(%rip),%xmm0
  cmp    %edx,%eax
  jge    L64
  movslq %eax,%rdx
  mov    0x10(%rsp),%rcx
  lea    (%rcx,%rdx,8),%rdx
L202:
  mov    (%rdx),%rcx
  movsd  %xmm0,(%rbx,%rcx,8)
  mov    %eax,%ecx
  add    $0x1,%eax
  add    $0x8,%rdx
  cmp    %ecx,%esi
  jg     L202
L64:
  lea    D126(%rip),%rdi
  call   <puts@plt>
L233:
  mov    %r13,%rbp
  lea    -0x1(%r14),%r14d
  shl    $0x3,%r14
  lea    0x8(%r13,%r14,1),%r13
  lea    D14(%rip),%r12
L108:
  movsd  0x0(%rbp),%xmm0
  mov    %r12,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  add    $0x8,%rbp
  cmp    %rbp,%r13
  jne    L108
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    %rbx,%rbp
  lea    0x8(%rbx,%r14,1),%r12
  lea    D169(%rip),%rbx
L67:
  movsd  0x0(%rbp),%xmm0
  mov    %rbx,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  add    $0x8,%rbp
  cmp    %r12,%rbp
  jne    L67
L155:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0x0,%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L57:
  mov    $0x1,%edx
  mov    $0x0,%esi
L228:
  movslq %esi,%rsi
  mov    0x10(%rsp),%rax
  mov    (%rax,%rsi,8),%rax
  pxor   %xmm0,%xmm0
  cvtsi2sd %edx,%xmm0
  movsd  %xmm0,(%rbx,%rax,8)
  lea    D126(%rip),%rdi
  call   <puts@plt>
  test   %r14d,%r14d
  jg     L233
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L155
L253:
  lea    D51(%rip),%rdi
  call   <puts@plt>
L90:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    %r14d,%edx
  mov    0x10(%rsp),%rsi
  mov    %r13,%rdi
  call   <fr_shellsort_double_i_@plt>
  lea    D55(%rip),%rdi
  call   <puts@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L182
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D104
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D135
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D120
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D51
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D143
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D15
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D55
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D82
type_guessed: f32[2]
name: extract_symbolic_data
arguments: data_tag: D126
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D14
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D169
type_guessed: string

tool: D104: argv[%d]: %s   

tool: D135: breaking ties with average rank

tool: D120: random vector:  max: %d   n: %d


tool: D51: before fr_shellsort_double_i_: x[] and indx[]

tool: D143: %.0f   

tool: D15: %d    

tool: D55: after fr_shellsort_double_i_: x[] and indx[]

tool: {"D82": [0.0,1.75]}

tool: D126: after average ranking: x[] and indx[]

tool: D14:  %.0f  

tool: D169: %.1f  

assistant: ```c
int main(int argc, char *argv[]) {
  srand(time(NULL));
  for (int i = 0; i < argc; ++i)
    printf("argv[%d]: %s   ", i, argv[i]);
  putchar('\n');
  printf("breaking ties with average rank\n");
  int max = atoi(argv[1]);
  int n = atoi(argv[2]);
  printf("random vector:  max: %d   n: %d\n", max, n);
  double *x = vrandr(10, max, n);
  size_t *indx = (size_t *)malloc(n * sizeof(size_t));
  for (size_t i = 0; i < n; ++i)
    indx[i] = i;
  printf("before fr_shellsort_double_i_: x[] and indx[]\n");
  for (int i = 0; i < n; ++i)
    printf("%.0f   ", x[i]);
  putchar('\n');
  for (int i = 0; i < n; ++i)
    printf("%d    ", indx[i]);
  putchar('\n');
  fr_shellsort_double_i_(x, indx, n);
  printf("after fr_shellsort_double_i_: x[] and indx[]\n");
  for (int i = 0; i < n; ++i)
    printf("%.0f   ", x[i]);
  putchar('\n');
  for (int i = 0; i < n; ++i)
    printf("%d    ", indx[i]);
  putchar('\n');
  double *ranks = (double *)malloc(n * sizeof(double));
  double b = x[indx[0]];
  int ib = 0;
  int i;
  for (i = 1; i < n; ++i) {
    if (x[indx[i]] != b) {
      if (ib < i - 1) {
        double rnk = (i - 1 + ib + 2) / 2.0;
        for (int j = ib; j <= i - 1; ++j)
          ranks[indx[j]] = rnk;
      } else {
        ranks[indx[ib]] = ib + 1;
      }
      b = x[indx[i]];
      ib = i;
    }
  }
  if (ib == i - 1)
    ranks[indx[ib]] = i;
  else {
    double rnk = (i - 1 + ib + 2) / 2.0;
    for (int j = ib; j <= i - 1; ++j)
      ranks[indx[j]] = rnk;
  }
  printf("after average ranking: x[] and indx[]\n");
  for (int i = 0; i < n; ++i)
    printf(" %.0f  ", x[i]);
  putchar('\n');
  for (int i = 0; i < n; ++i)
    printf("%.1f  ", ranks[i]);
  putchar('\n');
}
```