#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int accept(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ close(int);
int creer_serveur(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fdopen(int, char *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int fork();
int /*<<< orphan*/ initialiser_signaux();
char *malloc(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ strcat(char *, char *);
char *strchr(char *, char);
scalar_t__ strcmp(char *, char *);
scalar_t__ strncmp(char *, char *, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
int traitement_client(int socket_client) {
  sleep(1);
  char *message_bienvenue =
      "HTTP/1.1 200 OK\r\nConnection: close\r\nContent-Length: "
      "3027\r\n\n__________________________________________▓▓▓\n_______________"
      "__________________________▓▒▒▒▓▓\n____________________▄▄▄▄▄▄▄▄▄_________"
      "_▓▒▒▒▒▒▓\n___▓▓▓▓▓____▄█████▓▓▓▓▓▓░░███████▓▒▒▒▒▓▒▓\n____"
      "▓▒▓▒▓▓▓██▓█▓▓▓▓▓▓▓░░░▓▓▓▓▓▓▓▓▒▒▒▒▒▓▒▓\n______"
      "▓▒▒▒▓▒▒▓▓▓▓▓▓▓▓░░░▓▓▓▓▓▓▓▓█▒▒▒▒▒▒▓▒▓\n______"
      "█▓▓▒▒▓▒▒▓▒▒▓▓▓░░░▓▓▓▓▓▓▓▓█▒▒▒▒▒▒▒▓▒▓\n____"
      "▄█▓▓█▓▓▓▒▒▒▓▒▓▓░░░░▓▓▓▓▓▓▓▓█▒▒▒▒▒▒▓▒▒▓\n___"
      "█▓▓▓█▓▓█▓▓▒▓▒▓▓▓░░░░▓▓▓▓▓▓▓▓▓█▒▒▒▒▓▒▒▒▓\n__"
      "█▓▓▓█▓▓█▓▓▓▓▓▓▓▓▓░░░█████████████▒▒▒▒▒▒▓\n__█▓▓▓█▓▓█▓▓▓▓▓▓██████▒▌__▓█__"
      "___▓▓▒▒▒▒▒▒▒▓\n_▐█▓▓█▓▓▓█▓▓████▒▒▒▒▒▒▌__▓▓█▄____▓▓▒▒▒▒▒▒▓\n_"
      "▐█▓█▓▓▓▓███▒▒▒▒▒▒▒▒▒▒▌__▓▓█████▓▓▒▒▒▒▒▒▓\n__█▓█▓▓██_▅▄██▄▒▒▒▒▒▒▒▐___"
      "▓▓█▄_██▓▓▄▅▅▒▒▒▓\n__█▓▓██__▅▄▄▄▌__▀▄▒▒▒▒▒▐___▓▓▓████▓▅▅▄▒▒▒█\n__█▓█_____"
      "____▓▄___▀▒▒▒▒▒▐____▓▓▓▓▓▓▅▅▄▒▒▒██\n__██___________▓▓█▀█▄▒▒▒▒▒▌________"
      "▒▒▒▒▒▒█▓█▌\n_________________▓▓███▒▒▒▒▒▐____▒▒▒██▒▒██▓██▌\n_____________"
      "______▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒█▓▓██▓▓██▓▌\n____________________"
      "▓▒▒▄▒▒▌▒▒▒▒▒▒▒█▓▓▓▓██▓▓▓█\n___________________"
      "▓▒▒▒▒▒▐▒▒▒▒▒▒▒█▓███▓▓▓█▓▓█▌\n_____________________"
      "▓▓▓▄▀▒▒▒▒▓▓▓█▓▓▓▓▓▓█▓▓▓▓██\n_________________________▓▓▓▓▓▓____"
      "█▓▓██▀▀█▓▓▓▓░░█\n______________________________________▀▀__"
      "▄█▓▓▓▓▓░░▓█\n_______________________________________▄██▓▓▓▓▓▓░░▓▓█\n____"
      "_________________________________██▓▓▓▓▓▓▓▓░░▓▓█\n______________________"
      "________________█▓▓▓▓▓▓▓░░░▓▓█\n_______________________________________"
      "█▓▓▓▓▓░░░▓▓▓█\n________________________________________█▓▓▓░░░▓▓▓▓█\n___"
      "_______________________________________██░░░▓▓▓▓█\n_____________________"
      "________________________█░▓▓▓█\n________________________________________"
      "_______████\n";
  char *erreur = "HTTP/1.1 400 Bad Request\r\nConnection: "
                 "close\r\nContent-Length: 17\r\n\r\n400 Bad Request\r\n";
  FILE *file = fdopen(socket_client, "w+");
  char *requestBuffer = malloc(500 * sizeof(char));
  char GETRequest = 0;
  char CorrectHTMLVersion = 0;
  int wordCount = 0;
  int lineCount = 1;
  if (fgets(requestBuffer, 300, file) == NULL) {
    perror("Erreur lors de la lecture de la requête client");
  }
  while (lineCount < 4) {
    if (lineCount == 1) {
      char *wordsBuffer = malloc(500 * sizeof(char));
      strncpy(wordsBuffer, requestBuffer, 3);
      strcat(wordsBuffer, "\0");
      if (strcmp(wordsBuffer, "GET") == 0)
        GETRequest = 1;
      wordCount++;
      wordsBuffer = strchr(requestBuffer, ' ');
      while (wordsBuffer != NULL) {
        if (wordCount == 2)
          if (strncmp(wordsBuffer + 1, "HTTP/1.0", 8) == 0 ||
              strncmp(wordsBuffer + 1, "HTTP/1.1", 8) == 0)
            CorrectHTMLVersion = 1;
        wordCount++;
        wordsBuffer = wordsBuffer + 1;
        wordsBuffer = strchr(wordsBuffer, ' ');
      }
    }
    if (fgets(requestBuffer, 300, file) == NULL) {
      perror("Erreur lors de la lecture de la requête client");
    }
    lineCount++;
  }
  printf("%d %d %d %d\n", lineCount, wordCount, GETRequest, CorrectHTMLVersion);
  if (lineCount == 4 && wordCount == 3 && GETRequest && CorrectHTMLVersion)
    printf("%s\n", message_bienvenue);
  else
    printf("%s\n", erreur);
  fclose(file);
  return 0;
}
int main(int argc, char **argv) {
  if (argc > 1 && strcmp(argv[1], "-advice") == 0) {
    printf("Don ’t Panic !\n");
    return 42;
  }
  int socket_serveur = creer_serveur(8080);
  int socket_client;
  while (1) {
    socket_client = accept(socket_serveur, NULL, NULL);
    initialiser_signaux();
    if (socket_client == -1) {
      perror("accept");
      return -1;
    } else {
      printf("Client = %d\n", socket_client);
    }
    int pid = fork();
    if (pid == 0) {
      traitement_client(socket_client);
      close(socket_client);
    }
  }
  close(socket_serveur);
  return 0;
}


x86 assembly (clang, -O0):
<traitement_client>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1130 <sleep@plt>
lea    0xdc4(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0x19c8(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
lea    0x1a0f(%rip),%rsi
call   10f0 <fdopen@plt>
mov    %rax,-0x20(%rbp)
mov    $0x1f4,%edi
call   10e0 <malloc@plt>
mov    %rax,-0x28(%rbp)
movb   $0x0,-0x29(%rbp)
movb   $0x0,-0x2a(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x1,-0x34(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x12c,%esi
call   10c0 <fgets@plt>
cmp    $0x0,%rax
jne    12aa <traitement_client+0x8a>
lea    0x19c2(%rip),%rdi
call   1100 <perror@plt>
jmp    12af <traitement_client+0x8f>
cmpl   $0x4,-0x34(%rbp)
jge    13f7 <traitement_client+0x1d7>
cmpl   $0x1,-0x34(%rbp)
jne    13c1 <traitement_client+0x1a1>
mov    $0x1f4,%edi
call   10e0 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strncpy@plt>
mov    -0x40(%rbp),%rdi
lea    0x19fe(%rip),%rsi
call   1120 <strcat@plt>
mov    -0x40(%rbp),%rdi
lea    0x1999(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
jne    1311 <traitement_client+0xf1>
movb   $0x1,-0x29(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x20,%esi
call   1070 <strchr@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     13bc <traitement_client+0x19c>
cmpl   $0x2,-0x30(%rbp)
jne    1390 <traitement_client+0x170>
mov    -0x40(%rbp),%rdi
add    $0x1,%rdi
lea    0x194b(%rip),%rsi
mov    $0x8,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
je     1387 <traitement_client+0x167>
mov    -0x40(%rbp),%rdi
add    $0x1,%rdi
lea    0x1931(%rip),%rsi
mov    $0x8,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    138b <traitement_client+0x16b>
movb   $0x1,-0x2a(%rbp)
jmp    1390 <traitement_client+0x170>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
mov    $0x20,%esi
call   1070 <strchr@plt>
mov    %rax,-0x40(%rbp)
jmp    132c <traitement_client+0x10c>
jmp    13c1 <traitement_client+0x1a1>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x12c,%esi
call   10c0 <fgets@plt>
cmp    $0x0,%rax
jne    13e9 <traitement_client+0x1c9>
lea    0x1883(%rip),%rdi
call   1100 <perror@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    12af <traitement_client+0x8f>
mov    -0x34(%rbp),%esi
mov    -0x30(%rbp),%edx
movsbl -0x29(%rbp),%ecx
movsbl -0x2a(%rbp),%r8d
lea    0x18a0(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
cmpl   $0x4,-0x34(%rbp)
jne    1459 <traitement_client+0x239>
cmpl   $0x3,-0x30(%rbp)
jne    1459 <traitement_client+0x239>
movsbl -0x29(%rbp),%eax
cmp    $0x0,%eax
je     1459 <traitement_client+0x239>
movsbl -0x2a(%rbp),%eax
cmp    $0x0,%eax
je     1459 <traitement_client+0x239>
mov    -0x10(%rbp),%rsi
lea    0x186d(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    146b <traitement_client+0x24b>
mov    -0x18(%rbp),%rsi
lea    0x1856(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1060 <fclose@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret
nopl   0x0(%rax)

x86 assembly (clang, -O2):
<traitement_client>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebx
mov    $0x1,%edi
call   1140 <sleep@plt>
lea    0x1a13(%rip),%rsi
mov    %ebx,%edi
call   1100 <fdopen@plt>
mov    %rax,%r14
mov    $0x1f4,%edi
call   10f0 <malloc@plt>
mov    %rax,%r12
mov    %rax,%rdi
mov    $0x12c,%esi
mov    %r14,%rdx
call   10d0 <fgets@plt>
test   %rax,%rax
je     142a <traitement_client+0x1fa>
xor    %ebp,%ebp
mov    $0x1,%r13d
xor    %r15d,%r15d
movl   $0x0,0xc(%rsp)
mov    %r14,0x10(%rsp)
jmp    12cf <traitement_client+0x9f>
nopl   0x0(%rax,%rax,1)
mov    0x10(%rsp),%r14
mov    %rbx,%r12
mov    %r12,%rdi
mov    $0x12c,%esi
mov    %r14,%rdx
call   10d0 <fgets@plt>
test   %rax,%rax
je     13b1 <traitement_client+0x181>
add    $0x1,%r13d
cmp    $0x4,%r13d
je     13c2 <traitement_client+0x192>
cmp    $0x1,%r13d
jne    12a8 <traitement_client+0x78>
mov    $0x1f4,%edi
call   10f0 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
mov    $0x3,%edx
call   1030 <strncpy@plt>
mov    %rbx,%rdi
lea    0x19eb(%rip),%rsi
call   1130 <strcat@plt>
mov    %rbx,%rdi
lea    0x198c(%rip),%rsi
call   10e0 <strcmp@plt>
test   %rax,%rax
mov    0xc(%rsp),%ecx
movzbl %cl,%ecx
mov    $0x1,%eax
cmove  %eax,%ecx
mov    %ecx,0xc(%rsp)
mov    %r12,%rbx
mov    %r12,%rdi
mov    $0x20,%esi
call   1080 <strchr@plt>
add    $0x1,%ebp
test   %rax,%rax
je     12a5 <traitement_client+0x75>
mov    %rax,%r12
jmp    1373 <traitement_client+0x143>
nopw   0x0(%rax,%rax,1)
mov    $0x1,%r15b
add    $0x1,%r12
mov    %r12,%rdi
mov    $0x20,%esi
call   1080 <strchr@plt>
mov    %rax,%r12
add    $0x1,%ebp
test   %rax,%rax
je     12a0 <traitement_client+0x70>
cmp    $0x2,%ebp
jne    1353 <traitement_client+0x123>
lea    0x1(%r12),%r14
mov    %r14,%rdi
lea    0x1914(%rip),%rsi
mov    $0x8,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1350 <traitement_client+0x120>
mov    %r14,%rdi
lea    0x1904(%rip),%rsi
mov    $0x8,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
jne    1353 <traitement_client+0x123>
jmp    1350 <traitement_client+0x120>
lea    0x18af(%rip),%rdi
call   1110 <perror@plt>
jmp    12c1 <traitement_client+0x91>
mov    %r14,%r12
movzbl 0xc(%rsp),%r14d
movzbl %r15b,%ebx
lea    0x18d7(%rip),%rdi
mov    $0x4,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
mov    %ebx,%r8d
xor    %eax,%eax
call   1090 <printf@plt>
test   %bl,%bl
lea    0xc0d(%rip),%rdi
lea    0x1815(%rip),%rax
cmove  %rax,%rdi
test   %r14b,%r14b
cmove  %rax,%rdi
cmp    $0x3,%ebp
cmovne %rax,%rdi
call   1050 <puts@plt>
mov    %r12,%rdi
call   1070 <fclose@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x1836(%rip),%rdi
call   1110 <perror@plt>
jmp    1281 <traitement_client+0x51>
nopl   0x0(%rax,%rax,1)

LLVM IR (-O0):
@.str = [3087 x i8] c"HTTP/1.1 200 OK\0D\0AConnection: close\0D\0AContent-Length: 3027\0D\0A\0A__________________________________________\E2\96\93\E2\96\93\E2\96\93\0A_________________________________________\E2\96\93\E2\96\92\E2\96\92\E2\96\92\E2\96\93\E2\96\93\0A____________________\E2\96\84\E2\96\84\E2\96\84\E2\96\84\E2\96\84\E2\96\84\E2\96\84\E2\96\84\E2\96\84__________\E2\96\93\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\93\0A___\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93____\E2\96\84\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\91\E2\96\91\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\93\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\93\E2\96\92\E2\96\93\0A____\E2\96\93\E2\96\92\E2\96\93\E2\96\92\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\88\E2\96\93\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\91\E2\96\91\E2\96\91\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\93\E2\96\92\E2\96\93\0A______\E2\96\93\E2\96\92\E2\96\92\E2\96\92\E2\96\93\E2\96\92\E2\96\92\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\91\E2\96\91\E2\96\91\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\93\E2\96\92\E2\96\93\0A______\E2\96\88\E2\96\93\E2\96\93\E2\96\92\E2\96\92\E2\96\93\E2\96\92\E2\96\92\E2\96\93\E2\96\92\E2\96\92\E2\96\93\E2\96\93\E2\96\93\E2\96\91\E2\96\91\E2\96\91\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\93\E2\96\92\E2\96\93\0A____\E2\96\84\E2\96\88\E2\96\93\E2\96\93\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\92\E2\96\92\E2\96\92\E2\96\93\E2\96\92\E2\96\93\E2\96\93\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\93\E2\96\92\E2\96\92\E2\96\93\0A___\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\93\E2\96\93\E2\96\88\E2\96\93\E2\96\93\E2\96\92\E2\96\93\E2\96\92\E2\96\93\E2\96\93\E2\96\93\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\93\E2\96\92\E2\96\92\E2\96\92\E2\96\93\0A__\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\93\E2\96\93\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\91\E2\96\91\E2\96\91\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\93\0A__\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\93\E2\96\93\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\92\E2\96\8C__\E2\96\93\E2\96\88_____\E2\96\93\E2\96\93\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\93\0A_\E2\96\90\E2\96\88\E2\96\93\E2\96\93\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\93\E2\96\93\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\8C__\E2\96\93\E2\96\93\E2\96\88\E2\96\84____\E2\96\93\E2\96\93\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\93\0A_\E2\96\90\E2\96\88\E2\96\93\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\88\E2\96\88\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\8C__\E2\96\93\E2\96\93\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\93\E2\96\93\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\93\0A__\E2\96\88\E2\96\93\E2\96\88\E2\96\93\E2\96\93\E2\96\88\E2\96\88_\E2\96\85\E2\96\84\E2\96\88\E2\96\88\E2\96\84\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\90___\E2\96\93\E2\96\93\E2\96\88\E2\96\84_\E2\96\88\E2\96\88\E2\96\93\E2\96\93\E2\96\84\E2\96\85\E2\96\85\E2\96\92\E2\96\92\E2\96\92\E2\96\93\0A__\E2\96\88\E2\96\93\E2\96\93\E2\96\88\E2\96\88__\E2\96\85\E2\96\84\E2\96\84\E2\96\84\E2\96\8C__\E2\96\80\E2\96\84\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\90___\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\93\E2\96\85\E2\96\85\E2\96\84\E2\96\92\E2\96\92\E2\96\92\E2\96\88\0A__\E2\96\88\E2\96\93\E2\96\88_________\E2\96\93\E2\96\84___\E2\96\80\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\90____\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\85\E2\96\85\E2\96\84\E2\96\92\E2\96\92\E2\96\92\E2\96\88\E2\96\88\0A__\E2\96\88\E2\96\88___________\E2\96\93\E2\96\93\E2\96\88\E2\96\80\E2\96\88\E2\96\84\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\8C________\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\88\E2\96\93\E2\96\88\E2\96\8C\0A_________________\E2\96\93\E2\96\93\E2\96\88\E2\96\88\E2\96\88\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\90____\E2\96\92\E2\96\92\E2\96\92\E2\96\88\E2\96\88\E2\96\92\E2\96\92\E2\96\88\E2\96\88\E2\96\93\E2\96\88\E2\96\88\E2\96\8C\0A___________________\E2\96\93\E2\96\93\E2\96\93\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\88\E2\96\93\E2\96\93\E2\96\88\E2\96\88\E2\96\93\E2\96\93\E2\96\88\E2\96\88\E2\96\93\E2\96\8C\0A____________________\E2\96\93\E2\96\92\E2\96\92\E2\96\84\E2\96\92\E2\96\92\E2\96\8C\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\88\0A___________________\E2\96\93\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\90\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\88\E2\96\93\E2\96\88\E2\96\88\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\93\E2\96\93\E2\96\88\E2\96\8C\0A_____________________\E2\96\93\E2\96\93\E2\96\93\E2\96\84\E2\96\80\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\88\0A_________________________\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93____\E2\96\88\E2\96\93\E2\96\93\E2\96\88\E2\96\88\E2\96\80\E2\96\80\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\91\E2\96\91\E2\96\88\0A______________________________________\E2\96\80\E2\96\80__\E2\96\84\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\91\E2\96\91\E2\96\93\E2\96\88\0A_______________________________________\E2\96\84\E2\96\88\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\91\E2\96\91\E2\96\93\E2\96\93\E2\96\88\0A_____________________________________\E2\96\88\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\91\E2\96\91\E2\96\93\E2\96\93\E2\96\88\0A______________________________________\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\91\E2\96\91\E2\96\91\E2\96\93\E2\96\93\E2\96\88\0A_______________________________________\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\91\E2\96\91\E2\96\91\E2\96\93\E2\96\93\E2\96\93\E2\96\88\0A________________________________________\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\91\E2\96\91\E2\96\91\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\88\0A__________________________________________\E2\96\88\E2\96\88\E2\96\91\E2\96\91\E2\96\91\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\88\0A_____________________________________________\E2\96\88\E2\96\91\E2\96\93\E2\96\93\E2\96\93\E2\96\88\0A_______________________________________________\E2\96\88\E2\96\88\E2\96\88\E2\96\88\0A\00"
@.str.1 = [85 x i8] c"HTTP/1.1 400 Bad Request\0D\0AConnection: close\0D\0AContent-Length: 17\0D\0A\0D\0A400 Bad Request\0D\0A\00"
@.str.2 = [3 x i8] c"w+\00"
@.str.3 = [48 x i8] c"Erreur lors de la lecture de la requ\C3\AAte client\00"
@.str.4 = [2 x i8] zeroinitializer
@.str.5 = [4 x i8] c"GET\00"
@.str.6 = [9 x i8] c"HTTP/1.0\00"
@.str.7 = [9 x i8] c"HTTP/1.1\00"
@.str.8 = [13 x i8] c"%d %d %d %d\0A\00"
@.str.9 = [4 x i8] c"%s\0A\00"
@.str.10 = [8 x i8] c"-advice\00"
@.str.11 = [18 x i8] c"Don \E2\80\99t Panic !\0A\00"
@.str.12 = [7 x i8] c"accept\00"
@.str.13 = [13 x i8] c"Client = %d\0A\00"
define i32 @traitement_client(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8
%8 = alloca i8
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
store i32 %0, i32* %2
%12 = call i32 @sleep(i32 1)
store i8* getelementptr inbounds ([3087 x i8], [3087 x i8]* @.str, i64 0, i64 0), i8** %3
store i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.1, i64 0, i64 0), i8** %4
%13 = load i32, i32* %2
%14 = call i32* @fdopen(i32 %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %14, i32** %5
%15 = call i8* @malloc(i32 500)
store i8* %15, i8** %6
store i8 0, i8* %7
store i8 0, i8* %8
store i32 0, i32* %9
store i32 1, i32* %10
%16 = load i8*, i8** %6
%17 = load i32*, i32** %5
%18 = call i32* @fgets(i8* %16, i32 300, i32* %17)
%19 = icmp eq i32* %18, null
br i1 %19, label %20, label %22
20: ; preds = %1
%21 = call i32 @perror(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0))
br label %22
22: ; preds = %20, %1
br label %23
23: ; preds = %78, %22
%24 = load i32, i32* %10
%25 = icmp slt i32 %24, 4
br i1 %25, label %26, label %81
26: ; preds = %23
%27 = load i32, i32* %10
%28 = icmp eq i32 %27, 1
br i1 %28, label %29, label %71
29: ; preds = %26
%30 = call i8* @malloc(i32 500)
store i8* %30, i8** %11
%31 = load i8*, i8** %11
%32 = load i8*, i8** %6
%33 = call i32 @strncpy(i8* %31, i8* %32, i32 3)
%34 = load i8*, i8** %11
%35 = call i32 @strcat(i8* %34, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%36 = load i8*, i8** %11
%37 = call i64 @strcmp(i8* %36, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %40
39: ; preds = %29
store i8 1, i8* %7
br label %40
40: ; preds = %39, %29
%41 = load i32, i32* %9
%42 = add nsw i32 %41, 1
store i32 %42, i32* %9
%43 = load i8*, i8** %6
%44 = call i8* @strchr(i8* %43, i8 signext 32)
store i8* %44, i8** %11
br label %45
45: ; preds = %63, %40
%46 = load i8*, i8** %11
%47 = icmp ne i8* %46, null
br i1 %47, label %48, label %70
48: ; preds = %45
%49 = load i32, i32* %9
%50 = icmp eq i32 %49, 2
br i1 %50, label %51, label %63
51: ; preds = %48
%52 = load i8*, i8** %11
%53 = getelementptr inbounds i8, i8* %52, i64 1
%54 = call i64 @strncmp(i8* %53, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 8)
%55 = icmp eq i64 %54, 0
br i1 %55, label %61, label %56
56: ; preds = %51
%57 = load i8*, i8** %11
%58 = getelementptr inbounds i8, i8* %57, i64 1
%59 = call i64 @strncmp(i8* %58, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 8)
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %62
61: ; preds = %56, %51
store i8 1, i8* %8
br label %62
62: ; preds = %61, %56
br label %63
63: ; preds = %62, %48
%64 = load i32, i32* %9
%65 = add nsw i32 %64, 1
store i32 %65, i32* %9
%66 = load i8*, i8** %11
%67 = getelementptr inbounds i8, i8* %66, i64 1
store i8* %67, i8** %11
%68 = load i8*, i8** %11
%69 = call i8* @strchr(i8* %68, i8 signext 32)
store i8* %69, i8** %11
br label %45
70: ; preds = %45
br label %71
71: ; preds = %70, %26
%72 = load i8*, i8** %6
%73 = load i32*, i32** %5
%74 = call i32* @fgets(i8* %72, i32 300, i32* %73)
%75 = icmp eq i32* %74, null
br i1 %75, label %76, label %78
76: ; preds = %71
%77 = call i32 @perror(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0))
br label %78
78: ; preds = %76, %71
%79 = load i32, i32* %10
%80 = add nsw i32 %79, 1
store i32 %80, i32* %10
br label %23
81: ; preds = %23
%82 = load i32, i32* %10
%83 = load i32, i32* %9
%84 = load i8, i8* %7
%85 = sext i8 %84 to i32
%86 = load i8, i8* %8
%87 = sext i8 %86 to i32
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 %82, i32 %83, i32 %85, i32 %87)
%89 = load i32, i32* %10
%90 = icmp eq i32 %89, 4
br i1 %90, label %91, label %105
91: ; preds = %81
%92 = load i32, i32* %9
%93 = icmp eq i32 %92, 3
br i1 %93, label %94, label %105
94: ; preds = %91
%95 = load i8, i8* %7
%96 = sext i8 %95 to i32
%97 = icmp ne i32 %96, 0
br i1 %97, label %98, label %105
98: ; preds = %94
%99 = load i8, i8* %8
%100 = sext i8 %99 to i32
%101 = icmp ne i32 %100, 0
br i1 %101, label %102, label %105
102: ; preds = %98
%103 = load i8*, i8** %3
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* %103)
br label %108
105: ; preds = %98, %94, %91, %81
%106 = load i8*, i8** %4
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* %106)
br label %108
108: ; preds = %105, %102
%109 = load i32*, i32** %5
%110 = call i32 @fclose(i32* %109)
ret i32 0
}
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 1
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %11
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0))
store i32 42, i32* %3
br label %42
19: ; preds = %11, %2
%20 = call i32 @creer_serveur(i32 8080)
store i32 %20, i32* %6
br label %21
21: ; preds = %19, %41
%22 = load i32, i32* %6
%23 = call i32 @accept(i32 %22, i32* null, i32* null)
store i32 %23, i32* %7
%24 = call i32 (...) @initialiser_signaux()
%25 = load i32, i32* %7
%26 = icmp eq i32 %25, -1
br i1 %26, label %27, label %29
27: ; preds = %21
%28 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0))
store i32 -1, i32* %3
br label %42
29: ; preds = %21
%30 = load i32, i32* %7
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), i32 %30)
br label %32
32: ; preds = %29
%33 = call i32 (...) @fork()
store i32 %33, i32* %8
%34 = load i32, i32* %8
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %41
36: ; preds = %32
%37 = load i32, i32* %7
%38 = call i32 @traitement_client(i32 %37)
%39 = load i32, i32* %7
%40 = call i32 @close(i32 %39)
br label %41
41: ; preds = %36, %32
br label %21
42: ; preds = %27, %17
%43 = load i32, i32* %3
ret i32 %43
}

LLVM IR (-O2):
@.str = [3087 x i8] c"HTTP/1.1 200 OK\0D\0AConnection: close\0D\0AContent-Length: 3027\0D\0A\0A__________________________________________\E2\96\93\E2\96\93\E2\96\93\0A_________________________________________\E2\96\93\E2\96\92\E2\96\92\E2\96\92\E2\96\93\E2\96\93\0A____________________\E2\96\84\E2\96\84\E2\96\84\E2\96\84\E2\96\84\E2\96\84\E2\96\84\E2\96\84\E2\96\84__________\E2\96\93\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\93\0A___\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93____\E2\96\84\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\91\E2\96\91\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\93\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\93\E2\96\92\E2\96\93\0A____\E2\96\93\E2\96\92\E2\96\93\E2\96\92\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\88\E2\96\93\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\91\E2\96\91\E2\96\91\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\93\E2\96\92\E2\96\93\0A______\E2\96\93\E2\96\92\E2\96\92\E2\96\92\E2\96\93\E2\96\92\E2\96\92\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\91\E2\96\91\E2\96\91\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\93\E2\96\92\E2\96\93\0A______\E2\96\88\E2\96\93\E2\96\93\E2\96\92\E2\96\92\E2\96\93\E2\96\92\E2\96\92\E2\96\93\E2\96\92\E2\96\92\E2\96\93\E2\96\93\E2\96\93\E2\96\91\E2\96\91\E2\96\91\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\93\E2\96\92\E2\96\93\0A____\E2\96\84\E2\96\88\E2\96\93\E2\96\93\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\92\E2\96\92\E2\96\92\E2\96\93\E2\96\92\E2\96\93\E2\96\93\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\93\E2\96\92\E2\96\92\E2\96\93\0A___\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\93\E2\96\93\E2\96\88\E2\96\93\E2\96\93\E2\96\92\E2\96\93\E2\96\92\E2\96\93\E2\96\93\E2\96\93\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\93\E2\96\92\E2\96\92\E2\96\92\E2\96\93\0A__\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\93\E2\96\93\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\91\E2\96\91\E2\96\91\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\93\0A__\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\93\E2\96\93\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\92\E2\96\8C__\E2\96\93\E2\96\88_____\E2\96\93\E2\96\93\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\93\0A_\E2\96\90\E2\96\88\E2\96\93\E2\96\93\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\93\E2\96\93\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\8C__\E2\96\93\E2\96\93\E2\96\88\E2\96\84____\E2\96\93\E2\96\93\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\93\0A_\E2\96\90\E2\96\88\E2\96\93\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\88\E2\96\88\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\8C__\E2\96\93\E2\96\93\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\93\E2\96\93\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\93\0A__\E2\96\88\E2\96\93\E2\96\88\E2\96\93\E2\96\93\E2\96\88\E2\96\88_\E2\96\85\E2\96\84\E2\96\88\E2\96\88\E2\96\84\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\90___\E2\96\93\E2\96\93\E2\96\88\E2\96\84_\E2\96\88\E2\96\88\E2\96\93\E2\96\93\E2\96\84\E2\96\85\E2\96\85\E2\96\92\E2\96\92\E2\96\92\E2\96\93\0A__\E2\96\88\E2\96\93\E2\96\93\E2\96\88\E2\96\88__\E2\96\85\E2\96\84\E2\96\84\E2\96\84\E2\96\8C__\E2\96\80\E2\96\84\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\90___\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\88\E2\96\88\E2\96\88\E2\96\93\E2\96\85\E2\96\85\E2\96\84\E2\96\92\E2\96\92\E2\96\92\E2\96\88\0A__\E2\96\88\E2\96\93\E2\96\88_________\E2\96\93\E2\96\84___\E2\96\80\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\90____\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\85\E2\96\85\E2\96\84\E2\96\92\E2\96\92\E2\96\92\E2\96\88\E2\96\88\0A__\E2\96\88\E2\96\88___________\E2\96\93\E2\96\93\E2\96\88\E2\96\80\E2\96\88\E2\96\84\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\8C________\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\88\E2\96\93\E2\96\88\E2\96\8C\0A_________________\E2\96\93\E2\96\93\E2\96\88\E2\96\88\E2\96\88\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\90____\E2\96\92\E2\96\92\E2\96\92\E2\96\88\E2\96\88\E2\96\92\E2\96\92\E2\96\88\E2\96\88\E2\96\93\E2\96\88\E2\96\88\E2\96\8C\0A___________________\E2\96\93\E2\96\93\E2\96\93\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\88\E2\96\93\E2\96\93\E2\96\88\E2\96\88\E2\96\93\E2\96\93\E2\96\88\E2\96\88\E2\96\93\E2\96\8C\0A____________________\E2\96\93\E2\96\92\E2\96\92\E2\96\84\E2\96\92\E2\96\92\E2\96\8C\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\88\0A___________________\E2\96\93\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\90\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\88\E2\96\93\E2\96\88\E2\96\88\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\93\E2\96\93\E2\96\88\E2\96\8C\0A_____________________\E2\96\93\E2\96\93\E2\96\93\E2\96\84\E2\96\80\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\88\E2\96\88\0A_________________________\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93____\E2\96\88\E2\96\93\E2\96\93\E2\96\88\E2\96\88\E2\96\80\E2\96\80\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\91\E2\96\91\E2\96\88\0A______________________________________\E2\96\80\E2\96\80__\E2\96\84\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\91\E2\96\91\E2\96\93\E2\96\88\0A_______________________________________\E2\96\84\E2\96\88\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\91\E2\96\91\E2\96\93\E2\96\93\E2\96\88\0A_____________________________________\E2\96\88\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\91\E2\96\91\E2\96\93\E2\96\93\E2\96\88\0A______________________________________\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\91\E2\96\91\E2\96\91\E2\96\93\E2\96\93\E2\96\88\0A_______________________________________\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\91\E2\96\91\E2\96\91\E2\96\93\E2\96\93\E2\96\93\E2\96\88\0A________________________________________\E2\96\88\E2\96\93\E2\96\93\E2\96\93\E2\96\91\E2\96\91\E2\96\91\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\88\0A__________________________________________\E2\96\88\E2\96\88\E2\96\91\E2\96\91\E2\96\91\E2\96\93\E2\96\93\E2\96\93\E2\96\93\E2\96\88\0A_____________________________________________\E2\96\88\E2\96\91\E2\96\93\E2\96\93\E2\96\93\E2\96\88\0A_______________________________________________\E2\96\88\E2\96\88\E2\96\88\E2\96\88\0A\00"
@.str.1 = [85 x i8] c"HTTP/1.1 400 Bad Request\0D\0AConnection: close\0D\0AContent-Length: 17\0D\0A\0D\0A400 Bad Request\0D\0A\00"
@.str.2 = [3 x i8] c"w+\00"
@.str.3 = [48 x i8] c"Erreur lors de la lecture de la requ\C3\AAte client\00"
@.str.4 = [2 x i8] zeroinitializer
@.str.5 = [4 x i8] c"GET\00"
@.str.6 = [9 x i8] c"HTTP/1.0\00"
@.str.7 = [9 x i8] c"HTTP/1.1\00"
@.str.8 = [13 x i8] c"%d %d %d %d\0A\00"
@.str.10 = [8 x i8] c"-advice\00"
@.str.12 = [7 x i8] c"accept\00"
@.str.13 = [13 x i8] c"Client = %d\0A\00"
@str = [17 x i8] c"Don \E2\80\99t Panic !\00"
define i32 @traitement_client(i32 %0) {
%2 = tail call i32 @sleep(i32 1)
%3 = tail call i32* @fdopen(i32 %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call dereferenceable_or_null(500) i8* @malloc(i32 500)
%5 = tail call i32* @fgets(i8* %4, i32 300, i32* %3)
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @perror(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
br label %10
10: ; preds = %9, %53
%11 = phi i32 [ %54, %53 ], [ 1, %9 ]
%12 = phi i32 [ %48, %53 ], [ 0, %9 ]
%13 = phi i8 [ %47, %53 ], [ 0, %9 ]
%14 = phi i8 [ %46, %53 ], [ 0, %9 ]
%15 = icmp eq i32 %11, 1
br i1 %15, label %16, label %45
16: ; preds = %10
%17 = tail call dereferenceable_or_null(500) i8* @malloc(i32 500)
%18 = tail call i32 @strncpy(i8* %17, i8* %4, i32 3)
%19 = tail call i32 @strcat(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%20 = tail call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
%22 = select i1 %21, i8 1, i8 %14
%23 = tail call i8* @strchr(i8* dereferenceable(1) %4, i8 signext 32)
%24 = add nsw i32 %12, 1
%25 = icmp eq i8* %23, null
br i1 %25, label %45, label %26
26: ; preds = %16, %39
%27 = phi i32 [ %43, %39 ], [ %24, %16 ]
%28 = phi i8* [ %42, %39 ], [ %23, %16 ]
%29 = phi i8 [ %40, %39 ], [ %13, %16 ]
%30 = icmp eq i32 %27, 2
br i1 %30, label %31, label %39
31: ; preds = %26
%32 = getelementptr inbounds i8, i8* %28, i64 1
%33 = tail call i64 @strncmp(i8* %32, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 8)
%34 = icmp eq i64 %33, 0
br i1 %34, label %38, label %35
35: ; preds = %31
%36 = tail call i64 @strncmp(i8* %32, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 8)
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %39
38: ; preds = %35, %31
br label %39
39: ; preds = %35, %38, %26
%40 = phi i8 [ 1, %38 ], [ %29, %35 ], [ %29, %26 ]
%41 = getelementptr inbounds i8, i8* %28, i64 1
%42 = tail call i8* @strchr(i8* %41, i8 signext 32)
%43 = add nsw i32 %27, 1
%44 = icmp eq i8* %42, null
br i1 %44, label %45, label %26
45: ; preds = %39, %16, %10
%46 = phi i8 [ %14, %10 ], [ %22, %16 ], [ %22, %39 ]
%47 = phi i8 [ %13, %10 ], [ %13, %16 ], [ %40, %39 ]
%48 = phi i32 [ %12, %10 ], [ %24, %16 ], [ %43, %39 ]
%49 = tail call i32* @fgets(i8* %4, i32 300, i32* %3)
%50 = icmp eq i32* %49, null
br i1 %50, label %51, label %53
51: ; preds = %45
%52 = tail call i32 @perror(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0))
br label %53
53: ; preds = %51, %45
%54 = add nuw nsw i32 %11, 1
%55 = icmp eq i32 %54, 4
br i1 %55, label %56, label %10
56: ; preds = %53
%57 = zext i8 %46 to i32
%58 = zext i8 %47 to i32
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 4, i32 %48, i32 %57, i32 %58)
%60 = icmp eq i32 %48, 3
%61 = icmp ne i8 %46, 0
%62 = select i1 %60, i1 %61, i1 false
%63 = icmp ne i8 %47, 0
%64 = select i1 %62, i1 %63, i1 false
%65 = select i1 %64, i8* getelementptr inbounds ([3087 x i8], [3087 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.1, i64 0, i64 0)
%66 = tail call i32 @puts(i8* dereferenceable(1) %65)
%67 = tail call i32 @fclose(i32* %3)
ret i32 0
}
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
br label %30
11: ; preds = %4, %2
%12 = tail call i32 @creer_serveur(i32 8080)
%13 = tail call i32 @accept(i32 %12, i32* null, i32* null)
%14 = tail call i32 (...) @initialiser_signaux()
%15 = icmp eq i32 %13, -1
br i1 %15, label %16, label %18
16: ; preds = %26, %11
%17 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0))
br label %30
18: ; preds = %11, %26
%19 = phi i32 [ %27, %26 ], [ %13, %11 ]
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), i32 %19)
%21 = tail call i32 (...) @fork()
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %18
%24 = tail call i32 @traitement_client(i32 %19)
%25 = tail call i32 @close(i32 %19)
br label %26
26: ; preds = %23, %18
%27 = tail call i32 @accept(i32 %12, i32* null, i32* null)
%28 = tail call i32 (...) @initialiser_signaux()
%29 = icmp eq i32 %27, -1
br i1 %29, label %16, label %18
30: ; preds = %16, %9
%31 = phi i32 [ 42, %9 ], [ -1, %16 ]
ret i32 %31
}