user: 请将以下的汇编代码转换成C语言代码：

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  movslq %edi,%rbp
  xor    %edi,%edi
  push   %rbx
  sub    $0x18,%rsp
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  test   %ebp,%ebp
  jle    L185
  xor    %ebx,%ebx
  lea    D60(%rip),%r13
  nopl   0x0(%rax,%rax,1)
L99:
  mov    (%r12,%rbx,8),%rdx
  mov    %ebx,%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  add    $0x1,%rbx
  call   <printf@plt>
  cmp    %rbp,%rbx
  jne    L99
L185:
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    D13(%rip),%rdi
  call   <puts@plt>
  mov    0x8(%r12),%rdi
  call   <atoi@plt>
  mov    0x10(%r12),%rdi
  mov    %eax,%ebp
  call   <atoi@plt>
  mov    %ebp,%esi
  lea    D96(%rip),%rdi
  mov    %eax,%edx
  mov    %eax,%ebx
  xor    %eax,%eax
  call   <printf@plt>
  mov    %ebp,%esi
  mov    %ebx,%edx
  mov    $0xa,%edi
  call   <vrandi@plt>
  mov    %rax,%rbp
  test   %ebx,%ebx
  jle    L23
  mov    %rax,%r13
  lea    -0x1(%rbx),%eax
  lea    D76(%rip),%r14
  mov    %rax,%r12
  lea    0x4(%rbp,%rax,4),%r15
  nop
L170:
  mov    0x0(%r13),%esi
  mov    %r14,%rdi
  xor    %eax,%eax
  add    $0x4,%r13
  call   <printf@plt>
  cmp    %r15,%r13
  jne    L170
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    0x0(,%rbx,4),%edi
  call   <malloc@plt>
  mov    %rax,%r14
  mov    %rax,%rdx
  xor    %eax,%eax
  nopl   (%rax)
L167:
  mov    %eax,(%rdx)
  add    $0x1,%eax
  add    $0x4,%rdx
  cmp    %eax,%ebx
  jne    L167
  mov    %ebx,%edx
  mov    %r14,%rsi
  lea    0x0(,%rbx,8),%r15d
  mov    %rbp,%rdi
  call   <iquicksort_I@plt>
  mov    %r15d,%edi
  call   <malloc@plt>
  mov    %r15d,%edi
  mov    %rax,%r13
  call   <malloc@plt>
  mov    0x0(%rbp),%edx
  mov    %rax,%rsi
  cmp    $0x1,%ebx
  je     L76
  lea    0x8(%rsi),%r11
  movsd  D40(%rip),%xmm1
  xor    %edi,%edi
  xor    %eax,%eax
  mov    %r11,0x8(%rsp)
  movslq %ebx,%r10
  mov    $0x1,%ecx
  jmp    L51
  nopl   0x0(%rax,%rax,1)
L166:
  movslq %eax,%rdx
  pxor   %xmm0,%xmm0
  add    $0x1,%eax
  cvtsi2sd %eax,%xmm0
  mov    %ecx,%eax
  movsd  %xmm0,(%rsi,%rdx,8)
  mov    %r8d,%edx
L42:
  add    $0x1,%rcx
  add    $0x1,%edi
  cmp    %r10,%rcx
  je     L147
L51:
  mov    0x0(%rbp,%rcx,4),%r8d
  mov    %ecx,%r9d
  cmp    %edx,%r8d
  je     L42
  cmp    %eax,%edi
  jle    L166
  lea    0x2(%rax,%rdi,1),%edx
  pxor   %xmm0,%xmm0
  cvtsi2sd %edx,%xmm0
  mulsd  %xmm1,%xmm0
  cmp    %ecx,%eax
  jge    L194
  mov    %ecx,%r15d
  movslq %eax,%r11
  sub    %eax,%r15d
  lea    (%rsi,%r11,8),%rdx
  lea    -0x1(%r15),%eax
  add    %r11,%rax
  mov    0x8(%rsp),%r11
  lea    (%r11,%rax,8),%rax
  nopw   0x0(%rax,%rax,1)
L171:
  movsd  %xmm0,(%rdx)
  add    $0x8,%rdx
  cmp    %rax,%rdx
  jne    L171
  add    $0x1,%rcx
  mov    %r9d,%eax
  mov    %r8d,%edx
  add    $0x1,%edi
  cmp    %r10,%rcx
  jne    L51
  nop
L147:
  movslq %r12d,%rdx
  cmp    %r12d,%eax
  je     L6
  lea    0x2(%rax,%r12,1),%edx
  pxor   %xmm0,%xmm0
  cvtsi2sd %edx,%xmm0
  mulsd  D40(%rip),%xmm0
  cmp    %ebx,%eax
  jge    L34
  movslq %eax,%rdx
  lea    (%rsi,%rdx,8),%rdx
  nopl   0x0(%rax)
L180:
  mov    %eax,%ecx
  movsd  %xmm0,(%rdx)
  add    $0x1,%eax
  add    $0x8,%rdx
  cmp    %r12d,%ecx
  jl     L180
L34:
  mov    %ebx,%ebx
  shl    $0x3,%rbx
  lea    (%rsi,%rbx,1),%rdx
  nopl   0x0(%rax)
L156:
  movsd  (%rsi),%xmm0
  movslq (%r14),%rax
  add    $0x8,%rsi
  add    $0x4,%r14
  movsd  %xmm0,0x0(%r13,%rax,8)
  cmp    %rsi,%rdx
  jne    L156
  lea    D49(%rip),%rdi
  add    %r13,%rbx
  lea    D68(%rip),%rbp
  call   <puts@plt>
  nopl   0x0(%rax)
L66:
  movsd  0x0(%r13),%xmm0
  mov    %rbp,%rdi
  mov    $0x1,%eax
  add    $0x8,%r13
  call   <printf@plt>
  cmp    %rbx,%r13
  jne    L66
L152:
  mov    $0xa,%edi
  call   <putchar@plt>
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L6:
  mov    %ebx,%eax
L219:
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,(%rsi,%rdx,8)
  jmp    L34
L194:
  mov    %ecx,%eax
  mov    %r8d,%edx
  jmp    L42
L23:
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    0x0(,%rbx,4),%edi
  call   <malloc@plt>
  mov    %ebx,%edx
  mov    %rbp,%rdi
  lea    0x0(,%rbx,8),%ebp
  mov    %rax,%rsi
  call   <iquicksort_I@plt>
  mov    %ebp,%edi
  call   <malloc@plt>
  mov    %ebp,%edi
  call   <malloc@plt>
  mov    D10(%rip),%rcx
  lea    D49(%rip),%rdi
  mov    %rcx,(%rax)
  call   <puts@plt>
  jmp    L152
L76:
  mov    $0x1,%eax
  xor    %edx,%edx
  jmp    L219
```

tool_calls: name: retrieve_data
arguments: tag: D60
type_infered: string
name: retrieve_data
arguments: tag: D13
type_infered: string
name: retrieve_data
arguments: tag: D96
type_infered: string
name: retrieve_data
arguments: tag: D76
type_infered: string
name: retrieve_data
arguments: tag: D40
type_infered: byte[8]
name: retrieve_data
arguments: tag: D49
type_infered: string
name: retrieve_data
arguments: tag: D68
type_infered: string
name: retrieve_data
arguments: tag: D10
type_infered: f64

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

tool: D13: breaking ties with average rank

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


tool: D76: %d    

tool: {"D40": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x3f]}

tool: D49: reorder ranks into original order of vector:

tool: D68: %.1f   

tool: D10: 1

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);
  int *x = vrandi(10, max, n);
  for (int i = 0; i < n; ++i)
    printf("%d    ", x[i]);
  putchar('\n');
  int *indx = (int *)malloc(n * sizeof(int));
  for (int i = 0; i < n; ++i)
    indx[i] = i;
  iquicksort_I(x, indx, n);
  double *result = (double *)malloc(n * sizeof(double));
  double *ranks = (double *)malloc(n * sizeof(double));
  int b = x[0];
  int ib = 0;
  int i;
  for (i = 1; i < n; ++i) {
    if (x[i] != b) {
      if (ib < i - 1) {
        double rnk = (i - 1 + ib + 2) / 2.0;
        for (int j = ib; j <= i - 1; ++j)
          ranks[j] = rnk;
      } else {
        ranks[ib] = ib + 1;
      }
      b = x[i];
      ib = i;
    }
  }
  if (ib == i - 1)
    ranks[ib] = i;
  else {
    double rnk = (i - 1 + ib + 2) / 2.0;
    for (int j = ib; j <= i - 1; ++j)
      ranks[j] = rnk;
  }
  for (int i = 0; i < n; ++i)
    result[indx[i]] = ranks[i];
  printf("reorder ranks into original order of vector:\n");
  for (int i = 0; i < n; ++i)
    printf("%.1f   ", result[i]);
  putchar('\n');
}
```