user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0xc3000(%rsp),%r11
L71:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L71
  sub    $0x538,%rsp
  lea    D24(%rip),%r12
  mov    %r12,%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0xc3528(%rsp)
  xor    %eax,%eax
  lea    0x18(%rsp),%rsi
  lea    0x1c(%rsp),%rbx
  lea    0x20(%rsp),%r15
  lea    0x28(%rsp),%rbp
  call   <scanf@plt>
  mov    0x18(%rsp),%eax
  mov    %rbx,0x8(%rsp)
  lea    D20(%rip),%rbx
  lea    -0x1(%rax),%edx
  mov    %edx,0x18(%rsp)
  test   %eax,%eax
  je     L36
  nopl   0x0(%rax,%rax,1)
L43:
  mov    0x8(%rsp),%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x1c(%rsp),%eax
  test   %eax,%eax
  jle    L27
  mov    %r15,%r14
  xor    %r13d,%r13d
  nopl   0x0(%rax)
L74:
  lea    0x4(%r14),%rdx
  mov    %r14,%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x1c(%rsp),%ecx
  add    $0x1,%r13d
  add    $0x8,%r14
  cmp    %r13d,%ecx
  jg     L74
  test   %ecx,%ecx
  jle    L27
  lea    -0x2(%rcx),%r9d
  cmp    $0xffffffff,%r9d
  je     L56
  nopl   0x0(%rax)
L99:
  mov    %r9d,%eax
  mov    $0x1,%r8d
  lea    0x0(%rbp,%rax,8),%rdi
  mov    %r15,%rax
  nopl   0x0(%rax)
L8:
  mov    (%rax),%esi
  mov    0x8(%rax),%edx
  cmp    %edx,%esi
  jle    L175
  movd   0x4(%rax),%xmm2
  movd   %esi,%xmm1
  movd   %edx,%xmm0
  xor    %r8d,%r8d
  movd   0xc(%rax),%xmm3
  punpckldq %xmm2,%xmm1
  punpckldq %xmm3,%xmm0
  punpcklqdq %xmm1,%xmm0
  movups %xmm0,(%rax)
L175:
  add    $0x8,%rax
  cmp    %rax,%rdi
  jne    L8
  test   %r8d,%r8d
  jne    L56
  sub    $0x1,%r9d
  cmp    $0xffffffff,%r9d
  jne    L99
L56:
  xor    %r9d,%r9d
  nopl   0x0(%rax,%rax,1)
L126:
  movslq %r9d,%rax
  mov    0x20(%rsp,%rax,8),%edx
  lea    0x1(%r9),%eax
  cltq
  nopl   (%rax)
L19:
  mov    %edx,%esi
  mov    (%r15,%rax,8),%edx
  cmp    %eax,%ecx
  mov    %eax,%r13d
  setg   %dil
  cmp    %esi,%edx
  sete   %sil
  add    $0x1,%rax
  test   %sil,%dil
  jne    L19
  mov    %r13d,%edx
  mov    %r9d,%esi
  mov    %r15,%rdi
  call   <sortj@plt>
  mov    0x1c(%rsp),%ecx
  cmp    %ecx,%r13d
  jge    L249
  mov    %r13d,%r9d
  jmp    L126
  nopw   0x0(%rax,%rax,1)
L249:
  test   %ecx,%ecx
  jle    L27
  xor    %r11d,%r11d
  xor    %r9d,%r9d
  xchg   %ax,%ax
L204:
  lea    0x1(%r9),%edx
  movslq %r9d,%rax
  movslq %edx,%rsi
  mov    0x24(%rsp,%rax,8),%edi
  mov    0x20(%rsp,%rsi,8),%esi
  cmp    %edi,%esi
  jg     L191
  cmp    %edx,%ecx
  jle    L191
  mov    0x20(%rsp,%rax,8),%r10d
  lea    0x2(%r9),%eax
  mov    %r9d,%r8d
  cltq
  jmp    L157
  nopw   0x0(%rax,%rax,1)
L134:
  lea    0x1(%r8),%edx
  movslq %edx,%rsi
  mov    0x20(%rsp,%rsi,8),%esi
L157:
  mov    %eax,%r9d
  cmp    %r10d,%esi
  jne    L132
  cmp    %edx,%ecx
  jle    L132
  movslq %edx,%rsi
  mov    %edx,%r8d
  mov    0x24(%rsp,%rsi,8),%edi
L132:
  cmp    %edi,(%r15,%rax,8)
  setle  %sil
  cmp    %eax,%ecx
  setg   %dl
  add    $0x1,%rax
  test   %dl,%sil
  jne    L134
  add    $0x1,%r11d
  cmp    %r9d,%ecx
  jg     L204
L226:
  mov    %r11d,%esi
  lea    D4(%rip),%rdi
  call   <printf@plt>
  mov    0x18(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x18(%rsp)
  test   %eax,%eax
  jne    L43
L36:
  mov    0xc3528(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L217
  add    $0xc3538,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L191:
  mov    %edx,%r9d
  add    $0x1,%r11d
  cmp    %r9d,%ecx
  jg     L204
  jmp    L226
L27:
  xor    %r11d,%r11d
  jmp    L226
L217:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D24
type_guessed: string
name: retrieve_data
arguments: label: D20
type_guessed: string
name: retrieve_data
arguments: label: D4
type_guessed: string

tool: D24: %d

tool: D20: %d %d

tool: D4: %d


assistant: ```c
int main() {
  int t, max, min, i, rare, j, N, count, a, b, temp1, temp2;
  scanf("%d", &t);
  int arr[100001][2];
  while (t--) {
    scanf("%d", &N);
    for (i = 0; i < N; i++) {
      scanf("%d %d", &arr[i][0], &arr[i][1]);
    }
    for (i = 0; i < N; i++) {
      rare = 1;
      for (j = 0; j < N - i - 1; j++)
        if (arr[j][0] > arr[j + 1][0]) {
          temp1 = arr[j][0];
          temp2 = arr[j][1];
          arr[j][0] = arr[j + 1][0];
          arr[j][1] = arr[j + 1][1];
          arr[j + 1][0] = temp1;
          arr[j + 1][1] = temp2;
          rare = 0;
        }
      if (rare)
        break;
    }
    int temp;
    for (i = 0; i < N; i++) {
      temp = i;
      while (arr[i][0] == arr[i + 1][0] && i + 1 < N)
        i++;
      sortj(arr, temp, i + 1);
    }
    count = 0;
    for (i = 0; i < N; i++) {
      j = i + 1;
      while ((arr[i][1] >= arr[j][0]) && (j < N)) {
        j++;
        if (arr[i][0] == arr[i + 1][0] && (i + 1) < N)
          i++;
      }
      i = j - 1;
      count++;
    }
    printf("%d\n", count);
  }
  return 0;
}
```