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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0xf6000(%rsp),%r11
L39:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L39
  sub    $0x1e8,%rsp
  lea    D6(%rip),%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0xf61d8(%rsp)
  xor    %eax,%eax
  lea    0x24(%rsp),%rax
  lea    0xff0(%rsp),%r14
  mov    %rax,0x18(%rsp)
  lea    0x20(%rsp),%rax
  lea    0xff4(%rsp),%r13
  mov    %rax,0x10(%rsp)
  nopl   0x0(%rax)
L98:
  mov    0x18(%rsp),%rdx
  mov    0x10(%rsp),%rsi
  mov    %rbx,%rdi
  call   <scanf@plt>
  movslq 0x20(%rsp),%rax
  mov    0x24(%rsp),%r8d
  test   %eax,%eax
  jne    L77
  test   %r8d,%r8d
  je     L15
L150:
  xor    %r15d,%r15d
  lea    0x2c(%rsp),%r12
  lea    0x28(%rsp),%rbp
  test   %r8d,%r8d
  jle    L119
  nop
L138:
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  add    $0x1,%r15d
  call   <scanf@plt>
  movslq 0x28(%rsp),%rsi
  movslq 0x2c(%rsp),%rax
  imul   $0x1f5,%rsi,%rdi
  movslq 0x30(%rsp,%rsi,4),%r9
  mov    %r9,%rdx
  add    %r9,%rdi
  movslq 0x30(%rsp,%rax,4),%r9
  add    $0x1,%edx
  mov    %eax,0xff0(%rsp,%rdi,4)
  imul   $0x1f5,%rax,%rdi
  mov    %edx,0x30(%rsp,%rsi,4)
  addl   $0x1,0x30(%rsp,%rax,4)
  add    %r9,%rdi
  mov    %esi,0xff0(%rsp,%rdi,4)
  cmp    %r15d,0x24(%rsp)
  jg     L138
L119:
  movl   $0x1,0x814(%rsp)
  mov    0x34(%rsp),%esi
  test   %esi,%esi
  jle    L79
  lea    -0x1(%rsi),%eax
  lea    0x17c4(%rsp),%rdi
  lea    0x17c8(%rsp,%rax,4),%r8
  mov    %rdi,%rax
  nopl   0x0(%rax,%rax,1)
L149:
  movslq (%rax),%rdx
  add    $0x4,%rax
  movl   $0x1,0x810(%rsp,%rdx,4)
  cmp    %r8,%rax
  jne    L149
  nopw   0x0(%rax,%rax,1)
L128:
  movslq (%rdi),%rdx
  mov    0x30(%rsp,%rdx,4),%ecx
  test   %ecx,%ecx
  jle    L122
  imul   $0x7d4,%rdx,%rax
  sub    $0x1,%ecx
  imul   $0x1f5,%rdx,%rdx
  add    %r14,%rax
  add    %rcx,%rdx
  lea    0x0(%r13,%rdx,4),%rcx
  nopw   0x0(%rax,%rax,1)
L6:
  movslq (%rax),%rdx
  mov    0x810(%rsp,%rdx,4),%r9d
  test   %r9d,%r9d
  jne    L123
  movl   $0x1,0x810(%rsp,%rdx,4)
  add    $0x1,%esi
L123:
  add    $0x4,%rax
  cmp    %rax,%rcx
  jne    L6
L122:
  add    $0x4,%rdi
  cmp    %r8,%rdi
  jne    L128
  lea    D19(%rip),%rdi
  call   <printf@plt>
  jmp    L98
L77:
  jle    L150
  lea    0x0(,%rax,4),%r12
  lea    0x34(%rsp),%rdi
  xor    %esi,%esi
  mov    %r8d,0xc(%rsp)
  mov    %r12,%rdx
  call   <memset@plt>
  lea    0x814(%rsp),%rdi
  mov    %r12,%rdx
  xor    %esi,%esi
  call   <memset@plt>
  mov    0xc(%rsp),%r8d
  jmp    L150
L79:
  xor    %esi,%esi
  lea    D19(%rip),%rdi
  call   <printf@plt>
  jmp    L98
L15:
  mov    0xf61d8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L158
  add    $0xf61e8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L158:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D6
type_infered: string
name: disassemble_data
arguments: data_label: D19
type_infered: string

tool: D6: %d %d

tool: D19: %d


assistant: ```c
int main(void) {
  int n, m, student[501][501], i, j, t1, t2, lp[501], check[501], count;
  while (1) {
    scanf("%d %d", &n, &m);
    if (n == 0 && m == 0)
      break;
    count = 0;
    for (i = 1; i <= n; i++)
      lp[i] = 0, check[i] = 0;
    for (i = 0; i < m; i++) {
      scanf("%d %d", &t1, &t2);
      student[t1][lp[t1]] = t2;
      student[t2][lp[t2]] = t1;
      lp[t1]++;
      lp[t2]++;
    }
    check[1] = 1;
    for (i = 0; i < lp[1]; i++) {
      count++;
      check[student[1][i]] = 1;
    }
    for (i = 0; i < lp[1]; i++) {
      for (j = 0; j < lp[student[1][i]]; j++) {
        if (check[student[student[1][i]][j]] == 0) {
          check[student[student[1][i]][j]] = 1;
          count++;
        }
      }
    }
    printf("%d\n", count);
  }
  return 0;
}
```