user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x660,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x658(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x4(%rsp)
  lea    0x4(%rsp),%rsi
  lea    D37(%rip),%rdi
  call   <scanf@plt>
  mov    0x4(%rsp),%edx
  test   %edx,%edx
  jle    L140
  mov    $0x0,%ebx
  lea    D49(%rip),%rbp
  jmp    L35
L53:
  mov    %edx,0x1a0(%rsp,%rbx,4)
  mov    %eax,0x10(%rsp,%rbx,4)
L134:
  mov    0x4(%rsp),%edx
  add    $0x1,%rbx
  cmp    %ebx,%edx
  jle    L140
L35:
  lea    0xc(%rsp),%rdx
  lea    0x8(%rsp),%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    0x8(%rsp),%eax
  mov    0xc(%rsp),%edx
  cmp    %edx,%eax
  jle    L53
  mov    %edx,0x10(%rsp,%rbx,4)
  mov    %eax,0x1a0(%rsp,%rbx,4)
  jmp    L134
L140:
  lea    0x1a0(%rsp),%rsi
  lea    0x10(%rsp),%rdi
  call   <sort@plt>
  mov    0x4(%rsp),%ecx
  test   %ecx,%ecx
  jle    L47
  mov    $0x0,%ebx
  mov    $0x0,%ebp
  lea    0x1a0(%rsp),%r12
  jmp    L44
L70:
  movslq %ebx,%rdx
  mov    0x10(%rsp,%rdx,4),%eax
  movslq %ebp,%rcx
  mov    %eax,0x330(%rsp,%rcx,4)
  mov    0x1a0(%rsp,%rdx,4),%edx
  mov    %edx,0x4c0(%rsp,%rcx,4)
  cmp    %edx,%eax
  jge    L43
  mov    0x4(%rsp),%ecx
  movslq %ebx,%rax
  lea    0x10(%rsp,%rax,4),%rax
L144:
  cmp    %ebx,%ecx
  jle    L43
  add    $0x1,%ebx
  add    $0x4,%rax
  cmp    (%rax),%edx
  jg     L144
L43:
  add    $0x1,%ebp
L146:
  mov    0x4(%rsp),%ecx
  cmp    %ecx,%ebx
  jge    L55
L44:
  lea    0x10(%rsp),%rdi
  mov    %ebx,%edx
  mov    %r12,%rsi
  call   <find_conflicts@plt>
  test   %eax,%eax
  je     L70
  add    $0x1,%ebx
  jmp    L146
L55:
  mov    %ebp,%esi
  lea    D32(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  test   %ebp,%ebp
  jle    L154
  mov    %ebp,%ebp
  mov    $0x0,%ebx
  lea    D17(%rip),%r12
L158:
  mov    0x4c0(%rsp,%rbx,4),%edx
  mov    0x330(%rsp,%rbx,4),%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%rbx
  cmp    %rbp,%rbx
  jne    L158
L154:
  mov    0x658(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L108
  mov    $0x0,%eax
  add    $0x660,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L47:
  mov    $0x0,%esi
  lea    D32(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L154
L108:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D37
type_infered: string
name: read_data
arguments: tag: D49
type_infered: string
name: read_data
arguments: tag: D32
type_infered: string
name: read_data
arguments: tag: D17
type_infered: string

tool: D37: %d

tool: D49: %d%d

tool: D32: %d


tool: D17: %d %d


assistant: ```c
int main() {
  int list_1[100], list_2[100], flist_1[100], flist_2[100];
  int num_segs = 0, i, num1, num2;
  int fcounter = 0, fpointer = 0;
  int conflicts;
  scanf("%d", &num_segs);
  for (i = 0; i < num_segs; i++) {
    scanf("%d%d", &num1, &num2);
    if (num1 > num2) {
      list_1[i] = num2;
      list_2[i] = num1;
    } else {
      list_2[i] = num2;
      list_1[i] = num1;
    }
  }
  sort(list_1, list_2, num_segs);
  while (fpointer < num_segs) {
    int conflicts = find_conflicts(list_1, list_2, fpointer, num_segs);
    if (conflicts != 0) {
      fpointer++;
      continue;
    }
    flist_1[fcounter] = list_1[fpointer];
    flist_2[fcounter] = list_2[fpointer];
    while ((flist_2[fcounter] > list_1[fpointer]) && (fpointer < num_segs))
      fpointer++;
    fcounter++;
  }
  printf("%d\n", fcounter);
  for (i = 0; i < fcounter; i++)
    printf("%d %d\n", flist_1[i], flist_2[i]);
  return 0;
}
```