user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  lea    D57(%rip),%rdi
  call   <puts@plt>
  mov    $0x1f90,%edi
  call   <creer_serveur@plt>
  mov    %eax,0xc(%rsp)
  lea    D167(%rip),%r13
  lea    D75(%rip),%r14
  jmp    L195
L153:
  lea    D86(%rip),%rdi
  call   <perror@plt>
L147:
  mov    $0xffffffff,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L168:
  mov    $0x100,%edi
  call   <malloc@plt>
  mov    %rax,%rbx
  lea    D23(%rip),%rsi
  mov    %ebp,%edi
  call   <fdopen@plt>
  mov    %rax,%rbp
  mov    %rax,%rdx
  mov    $0x100,%esi
  mov    %rbx,%rdi
  call   <fgets_or_exit@plt>
  mov    $0x0,%r15d
  mov    $0x0,%r12d
  jmp    L177
L105:
  mov    %rbx,%rdi
  call   <checkGet@plt>
  test   %rax,%rax
  je     L136
L145:
  mov    %rbp,%rdx
  mov    $0x100,%esi
  mov    %rbx,%rdi
  call   <fgets_or_exit@plt>
L177:
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L58
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L58
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  test   %r12d,%r12d
  je     L105
  cmp    $0x1,%r12d
  jne    L145
  jmp    L6
L136:
  mov    %rbx,%rdi
  call   <checkURL@plt>
  test   %rax,%rax
  mov    $0x1,%eax
  cmovne %eax,%r15d
L6:
  mov    %rbx,%rdi
  call   <checkHost@plt>
  cmp    $0x1,%rax
  mov    $0x1,%r12d
  adc    $0x0,%r12d
  jmp    L145
L58:
  cmp    $0x2,%r12d
  jne    L130
  test   %r15d,%r15d
  jne    L120
  lea    D161(%rip),%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  mov    $0x1,%edi
  call   <sleep@plt>
  mov    $0xa,%r12d
  lea    D102(%rip),%r15
L88:
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  sub    $0x1,%r12d
  jne    L88
  mov    $0x0,%eax
  call   <getpid@plt>
  mov    %eax,%esi
  mov    %rbx,%rdx
  lea    D52(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D52(%rip),%r12
  jmp    L165
L130:
  lea    D129(%rip),%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  lea    D45(%rip),%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  lea    D121(%rip),%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  lea    D75(%rip),%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  lea    D191(%rip),%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  jmp    L147
L120:
  lea    D163(%rip),%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  lea    D45(%rip),%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  lea    D121(%rip),%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  lea    D75(%rip),%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  lea    D63(%rip),%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  jmp    L147
L61:
  mov    $0x0,%eax
  call   <getpid@plt>
  mov    %eax,%esi
  mov    %rbx,%rdx
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L165:
  mov    %rbp,%rdx
  mov    $0x100,%esi
  mov    %rbx,%rdi
  call   <fgets_or_exit@plt>
  test   %rax,%rax
  jne    L61
L195:
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    0xc(%rsp),%edi
  call   <accept@plt>
  mov    %eax,%ebp
  cmp    $0xffffffff,%eax
  je     L153
  mov    $0x0,%eax
  call   <fork@plt>
  test   %rax,%rax
  je     L168
  mov    %ebp,%edi
  call   <close@plt>
  cmp    $0xffffffff,%eax
  jne    L195
  lea    D147(%rip),%rdi
  call   <perror@plt>
  jmp    L147
```

tool_calls: name: unpack_data
arguments: data_tag: D57
type_guessed: string
name: unpack_data
arguments: data_tag: D167
type_guessed: string
name: unpack_data
arguments: data_tag: D75
type_guessed: string
name: unpack_data
arguments: data_tag: D86
type_guessed: string
name: unpack_data
arguments: data_tag: D23
type_guessed: string
name: unpack_data
arguments: data_tag: D161
type_guessed: string
name: unpack_data
arguments: data_tag: D102
type_guessed: string
name: unpack_data
arguments: data_tag: D52
type_guessed: string
name: unpack_data
arguments: data_tag: D129
type_guessed: string
name: unpack_data
arguments: data_tag: D45
type_guessed: string
name: unpack_data
arguments: data_tag: D121
type_guessed: string
name: unpack_data
arguments: data_tag: D191
type_guessed: string
name: unpack_data
arguments: data_tag: D163
type_guessed: string
name: unpack_data
arguments: data_tag: D63
type_guessed: string
name: unpack_data
arguments: data_tag: D147
type_guessed: string

tool: D57: Lancement de Swanson

tool: D167: 


tool: D75: 


tool: D86: accept socket_serveur

tool: D23: w+

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


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


tool: D52: <%d> %s

tool: D129: HTTP/1.1 400 Bad Request


tool: D45: Connection: close


tool: D121: Content-Length: 17


tool: D191: 400 Bad request


tool: D163: HTTP/1.1 404 URL Not Found


tool: D63: 404 URL Not Found


tool: D147: close socket_client

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;
}
```