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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpl   $0x3,-0x24(%rbp)
  je     L91
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <perror@plt>
  mov    $0xffffffff,%eax
  jmp    L99
L91:
  call   <fork@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0xffffffff,-0xc(%rbp)
  je     L120
  cmpl   $0x0,-0xc(%rbp)
  je     L131
  jmp    L113
L120:
  lea    D47(%rip),%rax
  mov    %rax,%rdi
  call   <perror@plt>
  mov    $0xffffffff,%eax
  jmp    L99
L131:
  mov    -0x30(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rcx
  mov    -0x30(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rdx
  lea    -0x18(%rbp),%rsi
  lea    -0x1c(%rbp),%rax
  mov    %rax,%rdi
  call   <clientProcessing@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  jmp    L99
L113:
  lea    -0x14(%rbp),%rax
  mov    %rax,%rdi
  call   <wait@plt>
  test   %eax,%eax
  jns    L88
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <perror@plt>
L88:
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <WIFEXITED@plt>
  test   %eax,%eax
  je     L107
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <WEXITSTATUS@plt>
  mov    %eax,-0x10(%rbp)
L107:
  nop
  cmpl   $0xfffffffe,-0x10(%rbp)
  jne    L70
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  test   %rax,%rax
  jns    L58
  lea    D21(%rip),%rax
  mov    %rax,%rdi
  call   <perror@plt>
L58:
  mov    -0x18(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  test   %rax,%rax
  jns    L70
  lea    D14(%rip),%rax
  mov    %rax,%rdi
  call   <perror@plt>
L70:
  cmpl   $0xffffffff,-0x10(%rbp)
  jne    L30
  mov    -0x18(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  test   %rax,%rax
  jns    L30
  lea    D14(%rip),%rax
  mov    %rax,%rdi
  call   <perror@plt>
L30:
  mov    $0x0,%eax
L99:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L122
  call   <__stack_chk_fail@plt>
L122:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D2
data_type: string
name: retrieve_data
arguments: data_label: D47
data_type: string
name: retrieve_data
arguments: data_label: D17
data_type: string
name: retrieve_data
arguments: data_label: D21
data_type: string
name: retrieve_data
arguments: data_label: D14
data_type: string

tool: D2: invalid command-line arguments

tool: D47: fork

tool: D17: wait

tool: D21: close workSock parent

tool: D14: close listenSock

assistant: ```c
int main(int argc, char *argv[]) {
  if (argc != 3) {
    perror("invalid command-line arguments");
    return -1;
  }
  int workSock, listenSock;
  int childPid, status, retChild;
  switch ((childPid = fork())) {
  case -1: {
    perror("fork");
    return -1;
  }
  case 0: {
    status = clientProcessing(&workSock, &listenSock, argv[1], argv[2]);
    return status;
  }
  default: {
    if (wait(&status) < 0)
      perror("wait");
    if (WIFEXITED(status))
      retChild = WEXITSTATUS(status);
    break;
  }
  }
  if (retChild == -2) {
    if (close(workSock) < 0)
      perror("close workSock parent");
    if (close(listenSock) < 0)
      perror("close listenSock");
  }
  if (retChild == -1) {
    if (close(listenSock) < 0)
      perror("close listenSock");
  }
  return 0;
}
```