user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  lea    -0xc3000(%rsp),%r11
L73:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L73
  sub    $0x540,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0xc3534(%rbp),%rax
  mov    %rax,%rsi
  lea    D32(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  jmp    L104
L108:
  lea    -0xc3530(%rbp),%rax
  mov    %rax,%rsi
  lea    D32(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  movl   $0x0,-0xc352c(%rbp)
  jmp    L223
L141:
  lea    -0xc3510(%rbp),%rdx
  mov    -0xc352c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    $0x4,%rax
  add    %rax,%rdx
  lea    -0xc3510(%rbp),%rcx
  mov    -0xc352c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rcx,%rax
  mov    %rax,%rsi
  lea    D25(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  addl   $0x1,-0xc352c(%rbp)
L223:
  mov    -0xc3530(%rbp),%eax
  cmp    %eax,-0xc352c(%rbp)
  jl     L141
  movl   $0x0,-0xc352c(%rbp)
  jmp    L151
L162:
  movl   $0x1,-0xc3528(%rbp)
  movl   $0x0,-0xc3524(%rbp)
  jmp    L109
L207:
  mov    -0xc3524(%rbp),%eax
  cltq
  mov    -0xc3510(%rbp,%rax,8),%edx
  mov    -0xc3524(%rbp),%eax
  add    $0x1,%eax
  cltq
  mov    -0xc3510(%rbp,%rax,8),%eax
  cmp    %eax,%edx
  jle    L58
  mov    -0xc3524(%rbp),%eax
  cltq
  mov    -0xc3510(%rbp,%rax,8),%eax
  mov    %eax,-0xc351c(%rbp)
  mov    -0xc3524(%rbp),%eax
  cltq
  mov    -0xc350c(%rbp,%rax,8),%eax
  mov    %eax,-0xc3518(%rbp)
  mov    -0xc3524(%rbp),%eax
  add    $0x1,%eax
  cltq
  mov    -0xc3510(%rbp,%rax,8),%edx
  mov    -0xc3524(%rbp),%eax
  cltq
  mov    %edx,-0xc3510(%rbp,%rax,8)
  mov    -0xc3524(%rbp),%eax
  add    $0x1,%eax
  cltq
  mov    -0xc350c(%rbp,%rax,8),%edx
  mov    -0xc3524(%rbp),%eax
  cltq
  mov    %edx,-0xc350c(%rbp,%rax,8)
  mov    -0xc3524(%rbp),%eax
  add    $0x1,%eax
  cltq
  mov    -0xc351c(%rbp),%edx
  mov    %edx,-0xc3510(%rbp,%rax,8)
  mov    -0xc3524(%rbp),%eax
  add    $0x1,%eax
  cltq
  mov    -0xc3518(%rbp),%edx
  mov    %edx,-0xc350c(%rbp,%rax,8)
  movl   $0x0,-0xc3528(%rbp)
L58:
  addl   $0x1,-0xc3524(%rbp)
L109:
  mov    -0xc3530(%rbp),%eax
  sub    -0xc352c(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0xc3524(%rbp)
  jl     L207
  cmpl   $0x0,-0xc3528(%rbp)
  jne    L231
  addl   $0x1,-0xc352c(%rbp)
L151:
  mov    -0xc3530(%rbp),%eax
  cmp    %eax,-0xc352c(%rbp)
  jl     L162
  jmp    L190
L231:
  nop
L190:
  movl   $0x0,-0xc352c(%rbp)
  jmp    L140
L155:
  mov    -0xc352c(%rbp),%eax
  mov    %eax,-0xc3514(%rbp)
  jmp    L217
L20:
  addl   $0x1,-0xc352c(%rbp)
L217:
  mov    -0xc352c(%rbp),%eax
  cltq
  mov    -0xc3510(%rbp,%rax,8),%edx
  mov    -0xc352c(%rbp),%eax
  add    $0x1,%eax
  cltq
  mov    -0xc3510(%rbp,%rax,8),%eax
  cmp    %eax,%edx
  jne    L156
  mov    -0xc352c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0xc3530(%rbp),%eax
  cmp    %eax,%edx
  jl     L20
L156:
  mov    -0xc352c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0xc3514(%rbp),%ecx
  lea    -0xc3510(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <sortj@plt>
  addl   $0x1,-0xc352c(%rbp)
L140:
  mov    -0xc3530(%rbp),%eax
  cmp    %eax,-0xc352c(%rbp)
  jl     L155
  movl   $0x0,-0xc3520(%rbp)
  movl   $0x0,-0xc352c(%rbp)
  jmp    L62
L145:
  mov    -0xc352c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0xc3524(%rbp)
  jmp    L143
L111:
  addl   $0x1,-0xc3524(%rbp)
  mov    -0xc352c(%rbp),%eax
  cltq
  mov    -0xc3510(%rbp,%rax,8),%edx
  mov    -0xc352c(%rbp),%eax
  add    $0x1,%eax
  cltq
  mov    -0xc3510(%rbp,%rax,8),%eax
  cmp    %eax,%edx
  jne    L143
  mov    -0xc352c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0xc3530(%rbp),%eax
  cmp    %eax,%edx
  jge    L143
  addl   $0x1,-0xc352c(%rbp)
L143:
  mov    -0xc352c(%rbp),%eax
  cltq
  mov    -0xc350c(%rbp,%rax,8),%edx
  mov    -0xc3524(%rbp),%eax
  cltq
  mov    -0xc3510(%rbp,%rax,8),%eax
  cmp    %eax,%edx
  jl     L232
  mov    -0xc3530(%rbp),%eax
  cmp    %eax,-0xc3524(%rbp)
  jl     L111
L232:
  mov    -0xc3524(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0xc352c(%rbp)
  addl   $0x1,-0xc3520(%rbp)
  addl   $0x1,-0xc352c(%rbp)
L62:
  mov    -0xc3530(%rbp),%eax
  cmp    %eax,-0xc352c(%rbp)
  jl     L145
  mov    -0xc3520(%rbp),%eax
  mov    %eax,%esi
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L104:
  mov    -0xc3534(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0xc3534(%rbp)
  test   %eax,%eax
  jne    L108
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L33
  call   <__stack_chk_fail@plt>
L33:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: label: D32
datatype: string
name: disassemble_data
arguments: label: D25
datatype: string
name: disassemble_data
arguments: label: D9
datatype: string

tool: D32: %d

tool: D25: %d %d

tool: D9: %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;
}
```