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

```asm
<main>:
  endbr64
  push   %r15
  lea    D103(%rip),%rdi
  lea    D174(%rip),%r15
  push   %r14
  lea    D44(%rip),%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  call   <puts@plt>
  mov    $0x1f90,%edi
  call   <creer_serveur@plt>
  mov    %eax,0xc(%rsp)
  nopw   0x0(%rax,%rax,1)
L19:
  mov    0xc(%rsp),%edi
  xor    %edx,%edx
  xor    %esi,%esi
  call   <accept@plt>
  mov    %eax,%ebp
  cmp    $0xffffffff,%eax
  je     L137
  xor    %eax,%eax
  call   <fork@plt>
  test   %rax,%rax
  je     L130
  mov    %ebp,%edi
  call   <close@plt>
  cmp    $0xffffffff,%eax
  jne    L19
  lea    D72(%rip),%rdi
  call   <perror@plt>
L82:
  add    $0x18,%rsp
  mov    $0xffffffff,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L130:
  mov    $0x100,%edi
  xor    %r13d,%r13d
  xor    %r12d,%r12d
  call   <malloc@plt>
  mov    %ebp,%edi
  lea    D140(%rip),%rsi
  mov    %rax,%rbx
  call   <fdopen@plt>
  mov    $0x100,%esi
  mov    %rbx,%rdi
  mov    %rax,%rdx
  mov    %rax,%rbp
  call   <fgets_or_exit@plt>
  jmp    L16
  cs nopw 0x0(%rax,%rax,1)
L149:
  cmp    $0x1,%r12d
  je     L133
  mov    $0x2,%r12d
L154:
  mov    %rbp,%rdx
  mov    $0x100,%esi
  mov    %rbx,%rdi
  call   <fgets_or_exit@plt>
L16:
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L54
  mov    %r15,%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L54
  xor    %eax,%eax
  mov    %rbx,%rdi
  call   <printf@plt>
  test   %r12d,%r12d
  jne    L149
  mov    %rbx,%rdi
  call   <checkGet@plt>
  test   %rax,%rax
  jne    L154
  mov    %rbx,%rdi
  call   <checkURL@plt>
  test   %rax,%rax
  mov    $0x1,%eax
  cmovne %eax,%r13d
L133:
  mov    %rbx,%rdi
  mov    $0x1,%r12d
  call   <checkHost@plt>
  cmp    $0x1,%rax
  adc    $0x0,%r12d
  jmp    L154
  nopl   0x0(%rax)
L54:
  cmp    $0x2,%r12d
  jne    L68
  test   %r13d,%r13d
  jne    L22
  lea    D55(%rip),%rsi
  mov    %rbp,%rdi
  mov    $0xa,%r12d
  call   <fprintf@plt>
  mov    $0x1,%edi
  lea    D116(%rip),%r13
  call   <sleep@plt>
  nopl   0x0(%rax)
L118:
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  sub    $0x1,%r12d
  jne    L118
  xor    %eax,%eax
  lea    D115(%rip),%r12
  call   <getpid@plt>
  mov    %rbx,%rdx
  mov    %r12,%rdi
  mov    %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L86
  nopl   0x0(%rax,%rax,1)
L46:
  xor    %eax,%eax
  call   <getpid@plt>
  mov    %rbx,%rdx
  mov    %r12,%rdi
  mov    %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
L86:
  mov    %rbp,%rdx
  mov    $0x100,%esi
  mov    %rbx,%rdi
  call   <fgets_or_exit@plt>
  test   %rax,%rax
  jne    L46
  jmp    L19
L137:
  lea    D26(%rip),%rdi
  call   <perror@plt>
  jmp    L82
L22:
  mov    %rbp,%rdi
  lea    D167(%rip),%rsi
  call   <fprintf@plt>
  mov    %rbp,%rdi
  lea    D10(%rip),%rsi
  call   <fprintf@plt>
  mov    %rbp,%rdi
  lea    D188(%rip),%rsi
  call   <fprintf@plt>
  mov    %rbp,%rdi
  lea    D174(%rip),%rsi
  call   <fprintf@plt>
  lea    D138(%rip),%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  jmp    L82
L68:
  mov    %rbp,%rdi
  lea    D169(%rip),%rsi
  call   <fprintf@plt>
  mov    %rbp,%rdi
  lea    D10(%rip),%rsi
  call   <fprintf@plt>
  mov    %rbp,%rdi
  lea    D188(%rip),%rsi
  call   <fprintf@plt>
  mov    %rbp,%rdi
  lea    D174(%rip),%rsi
  call   <fprintf@plt>
  lea    D13(%rip),%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  jmp    L82
```

tool_calls: name: retrieve_data
arguments: data_label: D103
type: string
name: retrieve_data
arguments: data_label: D174
type: string
name: retrieve_data
arguments: data_label: D44
type: string
name: retrieve_data
arguments: data_label: D72
type: string
name: retrieve_data
arguments: data_label: D140
type: string
name: retrieve_data
arguments: data_label: D55
type: string
name: retrieve_data
arguments: data_label: D116
type: string
name: retrieve_data
arguments: data_label: D115
type: string
name: retrieve_data
arguments: data_label: D26
type: string
name: retrieve_data
arguments: data_label: D167
type: string
name: retrieve_data
arguments: data_label: D10
type: string
name: retrieve_data
arguments: data_label: D188
type: string
name: retrieve_data
arguments: data_label: D138
type: string
name: retrieve_data
arguments: data_label: D169
type: string
name: retrieve_data
arguments: data_label: D13
type: string

tool: D103: Lancement de Swanson

tool: D174: 


tool: D44: 


tool: D72: close socket_client

tool: D140: w+

tool: D55: HTTP/1.1 200 OK
Connection: close
Content-Length: 2

Ok


tool: D116: She's here. I can smell it


tool: D115: <%d> %s

tool: D26: accept socket_serveur

tool: D167: HTTP/1.1 404 URL Not Found


tool: D10: Connection: close


tool: D188: Content-Length: 17


tool: D138: 404 URL Not Found


tool: D169: HTTP/1.1 400 Bad Request


tool: D13: 400 Bad request


assistant: ```c
int main(void) {
  printf("%s\n", "Lancement de Swanson");
  int socket_serveur = creer_serveur(8080);
  while (1) {
    int socket_client;
    socket_client = accept(socket_serveur, NULL, NULL);
    if (socket_client == -1) {
      perror("accept socket_serveur");
      return -1;
    }
    const char *message_bienvenue = "She's here. I can smell it\n";
    if (fork() == 0) {
      int taille = 256 * sizeof(char);
      char *buffer = malloc(taille);
      FILE *socket_client_file = fdopen(socket_client, "w+");
      fgets_or_exit(buffer, taille, socket_client_file);
      int lignesPresentes = 0;
      int wrongURL = 0;
      while (strcmp(buffer, "\n") != 0 && strcmp(buffer, "\r\n") != 0) {
        printf(buffer);
        if (lignesPresentes == 0 && checkGet(buffer) == 0) {
          if (checkURL(buffer) != 0) {
            wrongURL = 1;
          }
          lignesPresentes++;
        }
        if (lignesPresentes == 1 && checkHost(buffer) == 0) {
          lignesPresentes++;
        }
        fgets_or_exit(buffer, taille, socket_client_file);
      }
      if (lignesPresentes != 2) {
        fprintf(socket_client_file, "HTTP/1.1 400 Bad Request\r\n");
        fprintf(socket_client_file, "Connection: close\r\n");
        fprintf(socket_client_file, "Content-Length: 17\r\n");
        fprintf(socket_client_file, "\r\n");
        fprintf(socket_client_file, "400 Bad request\r\n");
        return -1;
      }
      if (wrongURL != 0) {
        fprintf(socket_client_file, "HTTP/1.1 404 URL Not Found\r\n");
        fprintf(socket_client_file, "Connection: close\r\n");
        fprintf(socket_client_file, "Content-Length: 17\r\n");
        fprintf(socket_client_file, "\r\n");
        fprintf(socket_client_file, "404 URL Not Found\r\n");
        return -1;
      }
      fprintf(socket_client_file, "HTTP/1.1 200 OK\r\nConnection: close\r\nContent-Length: 2\r\n\r\nOk\r\n");
      sleep(1);
      int i;
      for (i = 0; i < 10; i++) {
        fprintf(socket_client_file, message_bienvenue);
      }
      printf("<%d> %s", getpid(), buffer);
      while (fgets_or_exit(buffer, taille, socket_client_file) != NULL) {
        printf("<%d> %s", getpid(), buffer);
      }
    } else {
      if (close(socket_client) == -1) {
        perror("close socket_client");
        return -1;
      }
    }
  }
  if (close(socket_serveur) == -1) {
    perror("close socket_serveur");
    return -1;
  }
  return 0;
}
```