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

```asm
<printTopK>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  mov    %edx,-0x40(%rbp)
  cmpl   $0x0,-0x40(%rbp)
  jle    L119
  mov    -0x3c(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jl     L119
  mov    -0x3c(%rbp),%eax
  cltq
  shl    $0x4,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L110
L36:
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x24(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x4,%rax
  mov    %rax,%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,0x8(%rax)
  addl   $0x1,-0x24(%rbp)
L110:
  mov    -0x24(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L36
  movl   $0x0,-0x24(%rbp)
  jmp    L52
L113:
  mov    -0x24(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x24(%rbp),%eax
  mov    %eax,-0x20(%rbp)
  jmp    L23
L104:
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  0x8(%rax),%xmm1
  mov    -0x20(%rbp),%eax
  cltq
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  0x8(%rax),%xmm0
  comisd %xmm1,%xmm0
  jbe    L93
  mov    -0x20(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
L93:
  addl   $0x1,-0x20(%rbp)
L23:
  mov    -0x20(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L104
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    0x8(%rax),%rdx
  mov    (%rax),%rax
  mov    %rax,-0x10(%rbp)
  mov    %rdx,-0x8(%rbp)
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x24(%rbp),%edx
  movslq %edx,%rdx
  mov    %rdx,%rcx
  shl    $0x4,%rcx
  mov    -0x18(%rbp),%rdx
  add    %rdx,%rcx
  mov    0x8(%rax),%rdx
  mov    (%rax),%rax
  mov    %rax,(%rcx)
  mov    %rdx,0x8(%rcx)
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x10(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  mov    %rax,(%rcx)
  mov    %rdx,0x8(%rcx)
  addl   $0x1,-0x24(%rbp)
L52:
  mov    -0x24(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L113
  mov    -0x40(%rbp),%eax
  mov    %eax,%esi
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x24(%rbp)
  jmp    L45
L35:
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    0x8(%rax),%rdx
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x4,%rax
  mov    %rax,%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  movq   %rdx,%xmm0
  mov    %eax,%esi
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  addl   $0x1,-0x24(%rbp)
L45:
  mov    -0x24(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jl     L35
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  jmp    L32
L119:
  nop
L32:
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D3
type_guessed: string
name: parse_data
arguments: label: D13
type_guessed: string

tool: D3: Top-%d [pageID: score]


tool: D13: %4d: %f


assistant: ```c
void printTopK(double *vector, int n, int topK) {
  typedef struct _ID_SCORE {
    int pageID;
    double score;
  } ID_SCORE;
  int i, j;
  ID_SCORE *rank;
  int index;
  ID_SCORE temp;
  if ((topK <= 0) || (n < topK))
    return;
  rank = (ID_SCORE *)malloc(sizeof(ID_SCORE) * n);
  for (i = 0; i < n; i++) {
    rank[i].pageID = i;
    rank[i].score = vector[i];
  }
  for (i = 0; i < n; i++) {
    index = i;
    for (j = i; j < n; j++) {
      if (rank[index].score < rank[j].score)
        index = j;
    }
    temp = rank[i];
    rank[i] = rank[index];
    rank[index] = temp;
  }
  printf("Top-%d [pageID: score]\n", topK);
  for (i = 0; i < topK; i++) {
    printf("%4d: %f\n", rank[i].pageID, rank[i].score);
  }
  free(rank);
}
```