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

```asm
<main>:
  endbr64
  push   %r14
  lea    D27(%rip),%r14
  push   %r13
  lea    D22(%rip),%r13
  push   %r12
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  sub    $0x40,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rbx
  mov    %rbx,%r12
  nopl   0x0(%rax,%rax,1)
L20:
  mov    %ebp,%esi
  mov    %r14,%rdi
  add    $0x1,%ebp
  call   <printf@plt>
  mov    %r12,%rsi
  mov    %r13,%rdi
  add    $0x4,%r12
  call   <scanf@plt>
  cmp    $0xa,%ebp
  jne    L20
  lea    0x8(%rsp),%rdi
  lea    0x28(%rbx),%r12
  mov    %rbx,%rbp
  call   <pipe@plt>
  cmp    $0xffffffff,%eax
  je     L17
  nopl   0x0(%rax,%rax,1)
L15:
  mov    0xc(%rsp),%edi
  mov    %rbp,%rsi
  mov    $0x4,%edx
  add    $0x4,%rbp
  call   <write@plt>
  cmp    %rbp,%r12
  jne    L15
  call   <fork@plt>
  mov    %eax,0x4(%rsp)
  cmp    $0xffffffff,%eax
  je     L75
  test   %eax,%eax
  je     L30
  lea    0x4(%rsp),%rdi
  lea    D12(%rip),%rbp
  call   <wait@plt>
  nopl   (%rax)
L14:
  mov    0x8(%rsp),%edi
  mov    %rbx,%rsi
  mov    $0x4,%edx
  add    $0x4,%rbx
  call   <read@plt>
  mov    -0x4(%rbx),%esi
  mov    %rbp,%rdi
  call   <printf@plt>
  cmp    %rbx,%r12
  jne    L14
  xor    %edi,%edi
  call   <exit@plt>
L5:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L58
  add    $0x40,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L75:
  lea    D9(%rip),%rdi
  call   <perror@plt>
  xor    %edi,%edi
  call   <exit@plt>
  xchg   %ax,%ax
L30:
  mov    0x8(%rsp),%edi
  mov    %rbx,%rsi
  mov    $0x4,%edx
  add    $0x4,%rbx
  call   <read@plt>
  jmp    L30
L17:
  lea    D20(%rip),%rdi
  call   <perror@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L5
L58:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D27
type_guessed: string
name: extract_symbolic_data
arguments: label: D22
type_guessed: string
name: extract_symbolic_data
arguments: label: D12
type_guessed: string
name: extract_symbolic_data
arguments: label: D9
type_guessed: string
name: extract_symbolic_data
arguments: label: D20
type_guessed: string

tool: D27: Enter value for a[%d]


tool: D22: %d

tool: D12: --> %d


tool: D9: Error in fork()

tool: D20: Error in pipe()

assistant: ```c
int main() {
  int p[2], a[9], i, k, v, pid;
  for (i = 0; i <= 9; i++) {
    printf("Enter value for a[%d]\n", i);
    scanf("%d", &a[i]);
  }
  if (pipe(p) == -1) {
    perror("Error in pipe()");
    exit(1);
  } else {
    for (i = 0; i <= 9; i++) {
      write(p[1], &a[i], 4);
    }
    pid = fork();
    switch (pid) {
    case -1:
      perror("Error in fork()");
      exit(0);
    case 0:
      for (i = 0; i <= 9; i++) {
        read(p[0], &a[i], 4);
      }
      i = 0;
      do {
        k = i + 1;
        do {
          if (a[i] > a[k]) {
            v = a[i];
            a[i] = a[k];
            a[k] = v;
          }
          k++;
        } while (k <= 9);
        i++;
      } while (i <= 9);
      for (i = 0; i <= 9; i++) {
        write(p[1], &a[i], 4);
      }
      exit(0);
    default:
      wait(&pid);
      for (i = 0; i <= 9; i++) {
        read(p[0], &a[i], 4);
        printf("--> %d\n", a[i]);
      }
      exit(0);
    }
  }
}
```