user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0xf20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x2f20(%rbp),%rax
  mov    %rax,%rsi
  lea    D0(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  movl   $0x1,-0x2f1c(%rbp)
  jmp    L52
L25:
  mov    -0x2f1c(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  lea    -0x2f10(%rax),%rdx
  mov    -0x2f1c(%rbp),%eax
  mov    %eax,(%rdx)
  lea    -0x2f10(%rbp),%rcx
  mov    -0x2f1c(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    $0x8,%rax
  lea    (%rcx,%rax,1),%rdx
  lea    -0x2f10(%rbp),%rsi
  mov    -0x2f1c(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  add    %rax,%rax
  add    %rcx,%rax
  shl    $0x2,%rax
  add    $0x4,%rax
  add    %rsi,%rax
  mov    %rax,%rsi
  lea    D23(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  addl   $0x1,-0x2f1c(%rbp)
L52:
  mov    -0x2f20(%rbp),%eax
  cmp    %eax,-0x2f1c(%rbp)
  jle    L25
  movl   $0x1,-0x2f1c(%rbp)
  jmp    L117
L58:
  mov    -0x2f1c(%rbp),%eax
  mov    %eax,-0x2f18(%rbp)
  jmp    L14
L143:
  mov    -0x2f1c(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x2f0c,%rax
  mov    (%rax),%ecx
  mov    -0x2f18(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x2f0c,%rax
  mov    (%rax),%eax
  cmp    %eax,%ecx
  jg     L96
  mov    -0x2f1c(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x2f10,%rax
  mov    (%rax),%eax
  mov    %eax,-0x2f14(%rbp)
  mov    -0x2f18(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x2f10,%rax
  mov    (%rax),%edx
  mov    -0x2f1c(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  add    %rax,%rax
  add    %rcx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x2f10,%rax
  mov    %edx,(%rax)
  mov    -0x2f18(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  lea    -0x2f10(%rax),%rdx
  mov    -0x2f14(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x2f1c(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x2f0c,%rax
  mov    (%rax),%eax
  mov    %eax,-0x2f14(%rbp)
  mov    -0x2f18(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x2f0c,%rax
  mov    (%rax),%edx
  mov    -0x2f1c(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  add    %rax,%rax
  add    %rcx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x2f0c,%rax
  mov    %edx,(%rax)
  mov    -0x2f18(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  lea    -0x2f0c(%rax),%rdx
  mov    -0x2f14(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x2f1c(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x2f08,%rax
  mov    (%rax),%eax
  mov    %eax,-0x2f14(%rbp)
  mov    -0x2f18(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x2f08,%rax
  mov    (%rax),%edx
  mov    -0x2f1c(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  add    %rax,%rax
  add    %rcx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x2f08,%rax
  mov    %edx,(%rax)
  mov    -0x2f18(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  lea    -0x2f08(%rax),%rdx
  mov    -0x2f14(%rbp),%eax
  mov    %eax,(%rdx)
L96:
  addl   $0x1,-0x2f18(%rbp)
L14:
  mov    -0x2f20(%rbp),%eax
  cmp    %eax,-0x2f18(%rbp)
  jle    L143
  addl   $0x1,-0x2f1c(%rbp)
L117:
  mov    -0x2f20(%rbp),%eax
  cmp    %eax,-0x2f1c(%rbp)
  jle    L58
  movl   $0x1,-0x2f1c(%rbp)
  jmp    L132
L158:
  mov    -0x2f1c(%rbp),%eax
  mov    %eax,-0x2f18(%rbp)
  jmp    L29
L86:
  mov    -0x2f1c(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x2f0c,%rax
  mov    (%rax),%ecx
  mov    -0x2f18(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x2f0c,%rax
  mov    (%rax),%eax
  cmp    %eax,%ecx
  jne    L7
  mov    -0x2f1c(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x2f08,%rax
  mov    (%rax),%ecx
  mov    -0x2f18(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x2f08,%rax
  mov    (%rax),%eax
  cmp    %eax,%ecx
  jg     L7
  mov    -0x2f1c(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x2f10,%rax
  mov    (%rax),%eax
  mov    %eax,-0x2f14(%rbp)
  mov    -0x2f18(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x2f10,%rax
  mov    (%rax),%edx
  mov    -0x2f1c(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  add    %rax,%rax
  add    %rcx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x2f10,%rax
  mov    %edx,(%rax)
  mov    -0x2f18(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  lea    -0x2f10(%rax),%rdx
  mov    -0x2f14(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x2f1c(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x2f0c,%rax
  mov    (%rax),%eax
  mov    %eax,-0x2f14(%rbp)
  mov    -0x2f18(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x2f0c,%rax
  mov    (%rax),%edx
  mov    -0x2f1c(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  add    %rax,%rax
  add    %rcx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x2f0c,%rax
  mov    %edx,(%rax)
  mov    -0x2f18(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  lea    -0x2f0c(%rax),%rdx
  mov    -0x2f14(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x2f1c(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x2f08,%rax
  mov    (%rax),%eax
  mov    %eax,-0x2f14(%rbp)
  mov    -0x2f18(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x2f08,%rax
  mov    (%rax),%edx
  mov    -0x2f1c(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  add    %rax,%rax
  add    %rcx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x2f08,%rax
  mov    %edx,(%rax)
  mov    -0x2f18(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  lea    -0x2f08(%rax),%rdx
  mov    -0x2f14(%rbp),%eax
  mov    %eax,(%rdx)
L7:
  addl   $0x1,-0x2f18(%rbp)
L29:
  mov    -0x2f20(%rbp),%eax
  cmp    %eax,-0x2f18(%rbp)
  jle    L86
  addl   $0x1,-0x2f1c(%rbp)
L132:
  mov    -0x2f20(%rbp),%eax
  cmp    %eax,-0x2f1c(%rbp)
  jle    L158
  movl   $0x1,-0x2f1c(%rbp)
  jmp    L57
L101:
  mov    -0x2f1c(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x2f08,%rax
  mov    (%rax),%ecx
  mov    -0x2f1c(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x2f0c,%rax
  mov    (%rax),%edx
  mov    -0x2f1c(%rbp),%eax
  movslq %eax,%rsi
  mov    %rsi,%rax
  add    %rax,%rax
  add    %rsi,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x2f10,%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  addl   $0x1,-0x2f1c(%rbp)
L57:
  mov    -0x2f20(%rbp),%eax
  cmp    %eax,-0x2f1c(%rbp)
  jle    L101
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L72
  call   <__stack_chk_fail@plt>
L72:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D0
type_guessed: string
name: unpack_data
arguments: tag: D23
type_guessed: string
name: unpack_data
arguments: tag: D24
type_guessed: string

tool: D0: %d

tool: D23: %d %d

tool: D24: %d %d %d


assistant: ```c
int main() {
  int n, i, j, t;
  int score[1003][3];
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    score[i][0] = i;
    scanf("%d %d", &score[i][1], &score[i][2]);
  }
  for (i = 1; i <= n; i++) {
    for (j = i; j <= n; j++) {
      if (score[i][1] <= score[j][1]) {
        t = score[i][0];
        score[i][0] = score[j][0];
        score[j][0] = t;
        t = score[i][1];
        score[i][1] = score[j][1];
        score[j][1] = t;
        t = score[i][2];
        score[i][2] = score[j][2];
        score[j][2] = t;
      }
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = i; j <= n; j++) {
      if (score[i][1] == score[j][1] && score[i][2] <= score[j][2]) {
        t = score[i][0];
        score[i][0] = score[j][0];
        score[j][0] = t;
        t = score[i][1];
        score[i][1] = score[j][1];
        score[j][1] = t;
        t = score[i][2];
        score[i][2] = score[j][2];
        score[j][2] = t;
      }
    }
  }
  for (i = 1; i <= n; i++) {
    printf("%d %d %d\n", score[i][0], score[i][1], score[i][2]);
  }
}
```