#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*/ pid_t;
typedef int /*<<< orphan*/ buf;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int accept(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ close(int);
int creer_serveur(int);
int /*<<< orphan*/ *fdopen(int, char *);
int /*<<< orphan*/ *fgets_or_exit(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ initialiser_signaux();
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sleep(int);
int strlen(char *);
scalar_t__ strncmp(char *, int /*<<< orphan*/ *, int);
int main(void) {
  const char *message_bienvenue =
      "Bienvenue sur le serveur de Ludovic et Clément ! Bienvenue sur le "
      "serveur de Ludovic et Clément ! Bienvenue sur le serveur de Ludovic et "
      "Clément ! Bienvenue sur le serveur de Ludovic et Clément ! Bienvenue "
      "sur le serveur de Ludovic et Clément ! Bienvenue sur le serveur de "
      "Ludovic et Clément ! Bienvenue sur le serveur de Ludovic et Clément ! "
      "Bienvenue sur le serveur de Ludovic et Clément ! Bienvenue sur le "
      "serveur de Ludovic et Clément ! Bienvenue sur le serveur de Ludovic et "
      "Clément ! Bienvenue sur le serveur de Ludovic et Clément ! Bienvenue "
      "sur le serveur de Ludovic et Clément ! Bienvenue sur le serveur de "
      "Ludovic et Clément ! Bienvenue sur le serveur de Ludovic et Clément ! "
      "Bienvenue sur le serveur de Ludovic et Clément ! Bienvenue sur le "
      "serveur de Ludovic et Clément ! Bienvenue sur le serveur de Ludovic et "
      "Clément ! Bienvenue sur le serveur de Ludovic et Clément ! Bienvenue "
      "sur le serveur de Ludovic et Clément ! Bienvenue sur le serveur de "
      "Ludovic et Clément !\r\n";
  int socket_serveur = creer_serveur(8080);
  initialiser_signaux();
  while (1) {
    int socket_client;
    socket_client = accept(socket_serveur, NULL, 0);
    if (socket_client == -1) {
      perror("accept");
      return -1;
    }
    FILE *truc = fdopen(socket_client, "w+");
    if (truc == NULL) {
      perror("Error opening socket");
      return (-1);
    }
    pid_t pid = 0;
    if ((pid = fork()) == 0) {
      int requeteValable = 0;
      while (requeteValable == 0) {
        char tmp[500] = "";
        int tmp2 = 0;
        int indiceDeuxiemeMot = 0;
        int indiceTroisiemeMot = 0;
        if (fgets_or_exit(tmp, 500, truc) != NULL) {
          char buf[256];
          while (strncmp("\r\n", fgets_or_exit(buf, sizeof(buf), truc), 2) != 0)
            ;
          if (tmp[0] == 'G' && tmp[1] == 'E' && tmp[2] == 'T') {
            int i = 0;
            int tmp3 = strlen(tmp);
            for (i = 0; i < tmp3; i++) {
              if (tmp[i] == ' ') {
                if (indiceDeuxiemeMot == 0 && indiceTroisiemeMot == 0) {
                  indiceDeuxiemeMot = i + 1;
                } else {
                  indiceTroisiemeMot = i + 1;
                }
                tmp2++;
              }
            }
            if (tmp2 == 2) {
              if (tmp[indiceTroisiemeMot] == 'H' &&
                  tmp[indiceTroisiemeMot + 1] == 'T' &&
                  tmp[indiceTroisiemeMot + 2] == 'T' &&
                  tmp[indiceTroisiemeMot + 3] == 'P' &&
                  tmp[indiceTroisiemeMot + 4] == '/' &&
                  tmp[indiceTroisiemeMot + 5] == '1' &&
                  tmp[indiceTroisiemeMot + 6] == '.' &&
                  (tmp[indiceTroisiemeMot + 7] == '0' ||
                   tmp[indiceTroisiemeMot + 7] == '1')) {
                if (tmp[indiceDeuxiemeMot] == '/' &&
                    tmp[indiceDeuxiemeMot + 1] == ' ') {
                  requeteValable = 1;
                  fprintf(truc, "HTTP/1.1 200 OK\r\n");
                  fprintf(truc, "Connection: close\r\n");
                  fprintf(truc, "Content-Length: 1000 \r\n");
                  fprintf(truc, "\r\n");
                } else {
                  fprintf(truc, "HTTP/1.1 400 Bad Request\r\n");
                  fprintf(truc, "Connection: close\r\n");
                  fprintf(truc, "Content-Length: 17\r\n");
                  fprintf(truc, "\r\n");
                  fprintf(truc, "400 Bad Request\r\n");
                }
              }
            } else {
              fprintf(truc, "HTTP/1.1 400 Bad Request\r\n");
              fprintf(truc, "Connection: close\r\n");
              fprintf(truc, "Content-Length: 17\r\n");
              fprintf(truc, "\r\n");
              fprintf(truc, "400 Bad Request\r\n");
            }
          } else {
            fprintf(truc, "HTTP/1.1 400 Bad Request\r\n");
            fprintf(truc, "Connection: close\r\n");
            fprintf(truc, "Content-Length: 17\r\n");
            fprintf(truc, "\r\n");
            fprintf(truc, "400 Bad Request\r\n");
          }
        }
      }
      sleep(1);
      fprintf(truc, "%s", message_bienvenue);
      while (1) {
        char tmp[500] = "";
        fprintf(truc, "<me> ");
        if (fgets_or_exit(tmp, 500, truc) != NULL) {
          printf("%s", tmp);
        }
      }
    } else {
    }
  }
  close(socket_serveur);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x530,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe17(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    $0x1f90,%edi
call   1090 <creer_serveur@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <initialiser_signaux@plt>
mov    -0x14(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   10d0 <accept@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    1234 <main+0x64>
lea    0x11c7(%rip),%rdi
call   10c0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1741 <main+0x571>
mov    -0x18(%rbp),%edi
lea    0x11b3(%rip),%rsi
call   10b0 <fdopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    126a <main+0x9a>
lea    0x119b(%rip),%rdi
call   10c0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1741 <main+0x571>
movl   $0x0,-0x24(%rbp)
mov    $0x0,%al
call   10f0 <fork@plt>
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
jne    1737 <main+0x567>
movl   $0x0,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jne    16bb <main+0x4eb>
lea    -0x220(%rbp),%rdi
xor    %esi,%esi
mov    $0x1f4,%edx
call   1080 <memset@plt>
movl   $0x0,-0x224(%rbp)
movl   $0x0,-0x228(%rbp)
movl   $0x0,-0x22c(%rbp)
lea    -0x220(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x1f4,%esi
call   1030 <fgets_or_exit@plt>
cmp    $0x0,%rax
je     16b6 <main+0x4e6>
jmp    12ea <main+0x11a>
lea    -0x330(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x100,%esi
call   1030 <fgets_or_exit@plt>
mov    %rax,%rsi
lea    0x113b(%rip),%rdi
mov    $0x2,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
je     1322 <main+0x152>
jmp    12ea <main+0x11a>
movsbl -0x220(%rbp),%eax
cmp    $0x47,%eax
jne    1657 <main+0x487>
movsbl -0x21f(%rbp),%eax
cmp    $0x45,%eax
jne    1657 <main+0x487>
movsbl -0x21e(%rbp),%eax
cmp    $0x54,%eax
jne    1657 <main+0x487>
movl   $0x0,-0x334(%rbp)
lea    -0x220(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x338(%rbp)
movl   $0x0,-0x334(%rbp)
mov    -0x334(%rbp),%eax
cmp    -0x338(%rbp),%eax
jge    1407 <main+0x237>
movslq -0x334(%rbp),%rax
movsbl -0x220(%rbp,%rax,1),%eax
ff
cmp    $0x20,%eax
jne    13ee <main+0x21e>
cmpl   $0x0,-0x228(%rbp)
jne    13d0 <main+0x200>
cmpl   $0x0,-0x22c(%rbp)
jne    13d0 <main+0x200>
mov    -0x334(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x228(%rbp)
jmp    13df <main+0x20f>
mov    -0x334(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x22c(%rbp)
mov    -0x224(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x224(%rbp)
jmp    13f3 <main+0x223>
mov    -0x334(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x334(%rbp)
jmp    1378 <main+0x1a8>
cmpl   $0x2,-0x224(%rbp)
jne    15f8 <main+0x428>
movslq -0x22c(%rbp),%rax
movsbl -0x220(%rbp,%rax,1),%eax
ff
cmp    $0x48,%eax
jne    15f3 <main+0x423>
mov    -0x22c(%rbp),%eax
add    $0x1,%eax
cltq
movsbl -0x220(%rbp,%rax,1),%eax
ff
cmp    $0x54,%eax
jne    15f3 <main+0x423>
mov    -0x22c(%rbp),%eax
add    $0x2,%eax
cltq
movsbl -0x220(%rbp,%rax,1),%eax
ff
cmp    $0x54,%eax
jne    15f3 <main+0x423>
mov    -0x22c(%rbp),%eax
add    $0x3,%eax
cltq
movsbl -0x220(%rbp,%rax,1),%eax
ff
cmp    $0x50,%eax
jne    15f3 <main+0x423>
mov    -0x22c(%rbp),%eax
add    $0x4,%eax
cltq
movsbl -0x220(%rbp,%rax,1),%eax
ff
cmp    $0x2f,%eax
jne    15f3 <main+0x423>
mov    -0x22c(%rbp),%eax
add    $0x5,%eax
cltq
movsbl -0x220(%rbp,%rax,1),%eax
ff
cmp    $0x31,%eax
jne    15f3 <main+0x423>
mov    -0x22c(%rbp),%eax
add    $0x6,%eax
cltq
movsbl -0x220(%rbp,%rax,1),%eax
ff
cmp    $0x2e,%eax
jne    15f3 <main+0x423>
mov    -0x22c(%rbp),%eax
add    $0x7,%eax
cltq
movsbl -0x220(%rbp,%rax,1),%eax
ff
cmp    $0x30,%eax
je     150c <main+0x33c>
mov    -0x22c(%rbp),%eax
add    $0x7,%eax
cltq
movsbl -0x220(%rbp,%rax,1),%eax
ff
cmp    $0x31,%eax
jne    15f3 <main+0x423>
movslq -0x228(%rbp),%rax
movsbl -0x220(%rbp,%rax,1),%eax
ff
cmp    $0x2f,%eax
jne    1594 <main+0x3c4>
mov    -0x228(%rbp),%eax
add    $0x1,%eax
cltq
movsbl -0x220(%rbp,%rax,1),%eax
ff
cmp    $0x20,%eax
jne    1594 <main+0x3c4>
movl   $0x1,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xeb7(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xeb7(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xeb9(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xebc(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    15ee <main+0x41e>
mov    -0x20(%rbp),%rdi
lea    0xea8(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe6a(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe9f(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe6f(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe69(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    15f3 <main+0x423>
jmp    1652 <main+0x482>
mov    -0x20(%rbp),%rdi
lea    0xe44(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe06(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe3b(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe0b(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe05(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    16b1 <main+0x4e1>
mov    -0x20(%rbp),%rdi
lea    0xde5(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xda7(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xddc(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xdac(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xda6(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    16b6 <main+0x4e6>
jmp    128b <main+0xbb>
mov    $0x1,%edi
call   10e0 <sleep@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xda3(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
lea    -0x530(%rbp),%rdi
xor    %esi,%esi
mov    $0x1f4,%edx
call   1080 <memset@plt>
mov    -0x20(%rbp),%rdi
lea    0xd81(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
lea    -0x530(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x1f4,%esi
call   1030 <fgets_or_exit@plt>
cmp    $0x0,%rax
je     1732 <main+0x562>
lea    -0x530(%rbp),%rsi
lea    0xd4a(%rip),%rdi
call   1070 <printf@plt>
jmp    16db <main+0x50b>
jmp    173c <main+0x56c>
jmp    1201 <main+0x31>
mov    -0x4(%rbp),%eax
add    $0x530,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x308,%rsp
mov    $0x1f90,%edi
call   1090 <creer_serveur@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <initialiser_signaux@plt>
lea    0x11ef(%rip),%r14
lea    0x11ef(%rip),%rbx
lea    0x11eb(%rip),%r15
nopl   0x0(%rax)
mov    %ebp,%edi
xor    %esi,%esi
xor    %edx,%edx
call   10c0 <accept@plt>
cmp    $0xffffffff,%eax
je     1599 <main+0x3c9>
mov    %eax,%edi
mov    %rbx,%rsi
call   10a0 <fdopen@plt>
test   %rax,%rax
je     1596 <main+0x3c6>
mov    %rax,%r13
xor    %eax,%eax
call   10f0 <fork@plt>
test   %eax,%eax
jne    1210 <main+0x40>
mov    %rsp,%r14
lea    0x200(%rsp),%r15
lea    0x11ed(%rip),%r12
xor    %ebp,%ebp
jmp    12e3 <main+0x113>
xchg   %ax,%ax
mov    $0x1a,%esi
mov    $0x1,%edx
lea    0x11d6(%rip),%rdi
mov    %r13,%rcx
call   10d0 <fwrite@plt>
mov    $0x13,%esi
mov    $0x1,%edx
lea    0x1191(%rip),%rdi
mov    %r13,%rcx
call   10d0 <fwrite@plt>
mov    $0x14,%esi
mov    $0x1,%edx
lea    0x11bf(%rip),%rdi
mov    %r13,%rcx
call   10d0 <fwrite@plt>
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r12,%rdi
mov    %r13,%rcx
call   10d0 <fwrite@plt>
mov    $0x11,%esi
mov    $0x1,%edx
lea    0x117f(%rip),%rdi
mov    %r13,%rcx
call   10d0 <fwrite@plt>
xor    %ebx,%ebx
test   %ebx,%ebx
jne    150e <main+0x33e>
mov    $0x1f4,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1080 <memset@plt>
mov    %r14,%rdi
mov    $0x1f4,%esi
mov    %r13,%rdx
call   1030 <fgets_or_exit@plt>
mov    $0x0,%ebx
test   %rax,%rax
je     12db <main+0x10b>
nopl   0x0(%rax)
mov    %r15,%rdi
mov    $0x100,%esi
mov    %r13,%rdx
call   1030 <fgets_or_exit@plt>
mov    %r12,%rdi
mov    %rax,%rsi
mov    $0x2,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
jne    1310 <main+0x140>
cmpb   $0x47,(%rsp)
jne    1260 <main+0x90>
cmpb   $0x45,0x1(%rsp)
jne    1260 <main+0x90>
cmpb   $0x54,0x2(%rsp)
jne    1260 <main+0x90>
mov    %r14,%rdi
call   1060 <strlen@plt>
test   %eax,%eax
jle    1260 <main+0x90>
mov    %eax,%ecx
xor    %edx,%edx
xor    %esi,%esi
xor    %eax,%eax
xor    %edi,%edi
jmp    1396 <main+0x1c6>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rdx
or     %eax,%esi
cmove  %edx,%eax
mov    %edx,%esi
cmove  %ebp,%esi
add    $0x1,%edi
cmp    %rcx,%rdx
je     13a5 <main+0x1d5>
cmpb   $0x20,(%rsp,%rdx,1)
je     1380 <main+0x1b0>
add    $0x1,%rdx
cmp    %rcx,%rdx
jne    1396 <main+0x1c6>
cmp    $0x2,%edi
jne    1260 <main+0x90>
movslq %esi,%rcx
xor    %ebx,%ebx
cmpb   $0x48,(%rsp,%rcx,1)
jne    12db <main+0x10b>
cmpb   $0x54,0x1(%rcx,%r14,1)
jne    12db <main+0x10b>
cmpb   $0x54,0x2(%rcx,%r14,1)
jne    12db <main+0x10b>
cmpb   $0x50,0x3(%rcx,%r14,1)
jne    12db <main+0x10b>
cmpb   $0x2f,0x4(%rcx,%r14,1)
jne    12db <main+0x10b>
cmpb   $0x31,0x5(%rcx,%r14,1)
jne    12db <main+0x10b>
cmpb   $0x2e,0x6(%rcx,%r14,1)
jne    12db <main+0x10b>
mov    0x7(%rcx,%r14,1),%cl
and    $0xfe,%cl
cmp    $0x30,%cl
jne    12db <main+0x10b>
cltq
cmpb   $0x2f,(%rsp,%rax,1)
jne    1490 <main+0x2c0>
cmpb   $0x20,0x1(%rax,%r14,1)
jne    1490 <main+0x2c0>
mov    $0x11,%esi
mov    $0x1,%edx
lea    0xfd2(%rip),%rdi
mov    %r13,%rcx
call   10d0 <fwrite@plt>
mov    $0x13,%esi
mov    $0x1,%edx
lea    0xfcb(%rip),%rdi
mov    %r13,%rcx
call   10d0 <fwrite@plt>
mov    $0x17,%esi
mov    $0x1,%edx
lea    0xfc6(%rip),%rdi
mov    %r13,%rcx
call   10d0 <fwrite@plt>
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r12,%rdi
mov    %r13,%rcx
call   10d0 <fwrite@plt>
mov    $0x1,%ebx
jmp    12db <main+0x10b>
mov    $0x1a,%esi
mov    $0x1,%edx
lea    0xfa6(%rip),%rdi
mov    %r13,%rcx
call   10d0 <fwrite@plt>
mov    $0x13,%esi
mov    $0x1,%edx
lea    0xf61(%rip),%rdi
mov    %r13,%rcx
call   10d0 <fwrite@plt>
mov    $0x14,%esi
mov    $0x1,%edx
lea    0xf8f(%rip),%rdi
mov    %r13,%rcx
call   10d0 <fwrite@plt>
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r12,%rdi
mov    %r13,%rcx
call   10d0 <fwrite@plt>
mov    $0x11,%esi
mov    $0x1,%edx
lea    0xf4f(%rip),%rdi
mov    %r13,%rcx
call   10d0 <fwrite@plt>
jmp    12db <main+0x10b>
mov    $0x1,%edi
call   10e0 <sleep@plt>
lea    0xae1(%rip),%rdi
mov    $0x3e9,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   10d0 <fwrite@plt>
mov    %rsp,%rbp
lea    0xf3f(%rip),%rbx
lea    0xf35(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x1f4,%edx
mov    %rbp,%rdi
xor    %esi,%esi
call   1080 <memset@plt>
mov    $0x5,%esi
mov    $0x1,%edx
mov    %rbx,%rdi
mov    %r13,%rcx
call   10d0 <fwrite@plt>
mov    %rbp,%rdi
mov    $0x1f4,%esi
mov    %r13,%rdx
call   1030 <fgets_or_exit@plt>
test   %rax,%rax
je     1550 <main+0x380>
mov    %r14,%rdi
mov    %rbp,%rsi
call   1070 <printf@plt>
jmp    1550 <main+0x380>
mov    %r15,%r14
mov    %r14,%rdi
call   10b0 <perror@plt>
mov    $0xffffffff,%eax
add    $0x308,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1002 x i8] c"Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment !\0D\0A\00"
@.str.1 = [7 x i8] c"accept\00"
@.str.2 = [3 x i8] c"w+\00"
@.str.3 = [21 x i8] c"Error opening socket\00"
@.str.4 = [3 x i8] c"\0D\0A\00"
@.str.5 = [18 x i8] c"HTTP/1.1 200 OK\0D\0A\00"
@.str.6 = [20 x i8] c"Connection: close\0D\0A\00"
@.str.7 = [24 x i8] c"Content-Length: 1000 \0D\0A\00"
@.str.8 = [27 x i8] c"HTTP/1.1 400 Bad Request\0D\0A\00"
@.str.9 = [21 x i8] c"Content-Length: 17\0D\0A\00"
@.str.10 = [18 x i8] c"400 Bad Request\0D\0A\00"
@.str.11 = [3 x i8] c"%s\00"
@.str.12 = [6 x i8] c"<me> \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca [500 x i8]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca [256 x i8]
%13 = alloca i32
%14 = alloca i32
%15 = alloca [500 x i8]
store i32 0, i32* %1
store i8* getelementptr inbounds ([1002 x i8], [1002 x i8]* @.str, i64 0, i64 0), i8** %2
%16 = call i32 @creer_serveur(i32 8080)
store i32 %16, i32* %3
%17 = call i32 (...) @initialiser_signaux()
br label %18
18: ; preds = %0, %255
%19 = load i32, i32* %3
%20 = call i32 @accept(i32 %19, i32* null, i32 0)
store i32 %20, i32* %4
%21 = load i32, i32* %4
%22 = icmp eq i32 %21, -1
br i1 %22, label %23, label %25
23: ; preds = %18
%24 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %1
br label %256
25: ; preds = %18
%26 = load i32, i32* %4
%27 = call i32* @fdopen(i32 %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %27, i32** %5
%28 = load i32*, i32** %5
%29 = icmp eq i32* %28, null
br i1 %29, label %30, label %32
30: ; preds = %25
%31 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
store i32 -1, i32* %1
br label %256
32: ; preds = %25
store i32 0, i32* %6
%33 = call i32 (...) @fork()
store i32 %33, i32* %6
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %254
35: ; preds = %32
store i32 0, i32* %7
br label %36
36: ; preds = %236, %35
%37 = load i32, i32* %7
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %237
39: ; preds = %36
%40 = bitcast [500 x i8]* %8 to i8*
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
%41 = getelementptr inbounds [500 x i8], [500 x i8]* %8, i64 0, i64 0
%42 = load i32*, i32** %5
%43 = call i32* @fgets_or_exit(i8* %41, i32 500, i32* %42)
%44 = icmp ne i32* %43, null
br i1 %44, label %45, label %236
45: ; preds = %39
br label %46
46: ; preds = %52, %45
%47 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%48 = load i32*, i32** %5
%49 = call i32* @fgets_or_exit(i8* %47, i32 256, i32* %48)
%50 = call i64 @strncmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %49, i32 2)
%51 = icmp ne i64 %50, 0
br i1 %51, label %52, label %53
52: ; preds = %46
br label %46
53: ; preds = %46
%54 = getelementptr inbounds [500 x i8], [500 x i8]* %8, i64 0, i64 0
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = icmp eq i32 %56, 71
br i1 %57, label %58, label %224
58: ; preds = %53
%59 = getelementptr inbounds [500 x i8], [500 x i8]* %8, i64 0, i64 1
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = icmp eq i32 %61, 69
br i1 %62, label %63, label %224
63: ; preds = %58
%64 = getelementptr inbounds [500 x i8], [500 x i8]* %8, i64 0, i64 2
%65 = load i8, i8* %64
%66 = sext i8 %65 to i32
%67 = icmp eq i32 %66, 84
br i1 %67, label %68, label %224
68: ; preds = %63
store i32 0, i32* %13
%69 = getelementptr inbounds [500 x i8], [500 x i8]* %8, i64 0, i64 0
%70 = call i32 @strlen(i8* %69)
store i32 %70, i32* %14
store i32 0, i32* %13
br label %71
71: ; preds = %98, %68
%72 = load i32, i32* %13
%73 = load i32, i32* %14
%74 = icmp slt i32 %72, %73
br i1 %74, label %75, label %101
75: ; preds = %71
%76 = load i32, i32* %13
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [500 x i8], [500 x i8]* %8, i64 0, i64 %77
%79 = load i8, i8* %78
%80 = sext i8 %79 to i32
%81 = icmp eq i32 %80, 32
br i1 %81, label %82, label %97
82: ; preds = %75
%83 = load i32, i32* %10
%84 = icmp eq i32 %83, 0
br i1 %84, label %85, label %91
85: ; preds = %82
%86 = load i32, i32* %11
%87 = icmp eq i32 %86, 0
br i1 %87, label %88, label %91
88: ; preds = %85
%89 = load i32, i32* %13
%90 = add nsw i32 %89, 1
store i32 %90, i32* %10
br label %94
91: ; preds = %85, %82
%92 = load i32, i32* %13
%93 = add nsw i32 %92, 1
store i32 %93, i32* %11
br label %94
94: ; preds = %91, %88
%95 = load i32, i32* %9
%96 = add nsw i32 %95, 1
store i32 %96, i32* %9
br label %97
97: ; preds = %94, %75
br label %98
98: ; preds = %97
%99 = load i32, i32* %13
%100 = add nsw i32 %99, 1
store i32 %100, i32* %13
br label %71
101: ; preds = %71
%102 = load i32, i32* %9
%103 = icmp eq i32 %102, 2
br i1 %103, label %104, label %212
104: ; preds = %101
%105 = load i32, i32* %11
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds [500 x i8], [500 x i8]* %8, i64 0, i64 %106
%108 = load i8, i8* %107
%109 = sext i8 %108 to i32
%110 = icmp eq i32 %109, 72
br i1 %110, label %111, label %211
111: ; preds = %104
%112 = load i32, i32* %11
%113 = add nsw i32 %112, 1
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds [500 x i8], [500 x i8]* %8, i64 0, i64 %114
%116 = load i8, i8* %115
%117 = sext i8 %116 to i32
%118 = icmp eq i32 %117, 84
br i1 %118, label %119, label %211
119: ; preds = %111
%120 = load i32, i32* %11
%121 = add nsw i32 %120, 2
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds [500 x i8], [500 x i8]* %8, i64 0, i64 %122
%124 = load i8, i8* %123
%125 = sext i8 %124 to i32
%126 = icmp eq i32 %125, 84
br i1 %126, label %127, label %211
127: ; preds = %119
%128 = load i32, i32* %11
%129 = add nsw i32 %128, 3
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds [500 x i8], [500 x i8]* %8, i64 0, i64 %130
%132 = load i8, i8* %131
%133 = sext i8 %132 to i32
%134 = icmp eq i32 %133, 80
br i1 %134, label %135, label %211
135: ; preds = %127
%136 = load i32, i32* %11
%137 = add nsw i32 %136, 4
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds [500 x i8], [500 x i8]* %8, i64 0, i64 %138
%140 = load i8, i8* %139
%141 = sext i8 %140 to i32
%142 = icmp eq i32 %141, 47
br i1 %142, label %143, label %211
143: ; preds = %135
%144 = load i32, i32* %11
%145 = add nsw i32 %144, 5
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds [500 x i8], [500 x i8]* %8, i64 0, i64 %146
%148 = load i8, i8* %147
%149 = sext i8 %148 to i32
%150 = icmp eq i32 %149, 49
br i1 %150, label %151, label %211
151: ; preds = %143
%152 = load i32, i32* %11
%153 = add nsw i32 %152, 6
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds [500 x i8], [500 x i8]* %8, i64 0, i64 %154
%156 = load i8, i8* %155
%157 = sext i8 %156 to i32
%158 = icmp eq i32 %157, 46
br i1 %158, label %159, label %211
159: ; preds = %151
%160 = load i32, i32* %11
%161 = add nsw i32 %160, 7
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds [500 x i8], [500 x i8]* %8, i64 0, i64 %162
%164 = load i8, i8* %163
%165 = sext i8 %164 to i32
%166 = icmp eq i32 %165, 48
br i1 %166, label %175, label %167
167: ; preds = %159
%168 = load i32, i32* %11
%169 = add nsw i32 %168, 7
%170 = sext i32 %169 to i64
%171 = getelementptr inbounds [500 x i8], [500 x i8]* %8, i64 0, i64 %170
%172 = load i8, i8* %171
%173 = sext i8 %172 to i32
%174 = icmp eq i32 %173, 49
br i1 %174, label %175, label %211
175: ; preds = %167, %159
%176 = load i32, i32* %10
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds [500 x i8], [500 x i8]* %8, i64 0, i64 %177
%179 = load i8, i8* %178
%180 = sext i8 %179 to i32
%181 = icmp eq i32 %180, 47
br i1 %181, label %182, label %199
182: ; preds = %175
%183 = load i32, i32* %10
%184 = add nsw i32 %183, 1
%185 = sext i32 %184 to i64
%186 = getelementptr inbounds [500 x i8], [500 x i8]* %8, i64 0, i64 %185
%187 = load i8, i8* %186
%188 = sext i8 %187 to i32
%189 = icmp eq i32 %188, 32
br i1 %189, label %190, label %199
190: ; preds = %182
store i32 1, i32* %7
%191 = load i32*, i32** %5
%192 = call i32 (i32*, i8*, ...) @fprintf(i32* %191, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%193 = load i32*, i32** %5
%194 = call i32 (i32*, i8*, ...) @fprintf(i32* %193, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
%195 = load i32*, i32** %5
%196 = call i32 (i32*, i8*, ...) @fprintf(i32* %195, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
%197 = load i32*, i32** %5
%198 = call i32 (i32*, i8*, ...) @fprintf(i32* %197, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %210
199: ; preds = %182, %175
%200 = load i32*, i32** %5
%201 = call i32 (i32*, i8*, ...) @fprintf(i32* %200, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0))
%202 = load i32*, i32** %5
%203 = call i32 (i32*, i8*, ...) @fprintf(i32* %202, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
%204 = load i32*, i32** %5
%205 = call i32 (i32*, i8*, ...) @fprintf(i32* %204, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0))
%206 = load i32*, i32** %5
%207 = call i32 (i32*, i8*, ...) @fprintf(i32* %206, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%208 = load i32*, i32** %5
%209 = call i32 (i32*, i8*, ...) @fprintf(i32* %208, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0))
br label %210
210: ; preds = %199, %190
br label %211
211: ; preds = %210, %167, %151, %143, %135, %127, %119, %111, %104
br label %223
212: ; preds = %101
%213 = load i32*, i32** %5
%214 = call i32 (i32*, i8*, ...) @fprintf(i32* %213, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0))
%215 = load i32*, i32** %5
%216 = call i32 (i32*, i8*, ...) @fprintf(i32* %215, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
%217 = load i32*, i32** %5
%218 = call i32 (i32*, i8*, ...) @fprintf(i32* %217, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0))
%219 = load i32*, i32** %5
%220 = call i32 (i32*, i8*, ...) @fprintf(i32* %219, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%221 = load i32*, i32** %5
%222 = call i32 (i32*, i8*, ...) @fprintf(i32* %221, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0))
br label %223
223: ; preds = %212, %211
br label %235
224: ; preds = %63, %58, %53
%225 = load i32*, i32** %5
%226 = call i32 (i32*, i8*, ...) @fprintf(i32* %225, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0))
%227 = load i32*, i32** %5
%228 = call i32 (i32*, i8*, ...) @fprintf(i32* %227, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
%229 = load i32*, i32** %5
%230 = call i32 (i32*, i8*, ...) @fprintf(i32* %229, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0))
%231 = load i32*, i32** %5
%232 = call i32 (i32*, i8*, ...) @fprintf(i32* %231, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%233 = load i32*, i32** %5
%234 = call i32 (i32*, i8*, ...) @fprintf(i32* %233, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0))
br label %235
235: ; preds = %224, %223
br label %236
236: ; preds = %235, %39
br label %36
237: ; preds = %36
%238 = call i32 @sleep(i32 1)
%239 = load i32*, i32** %5
%240 = load i8*, i8** %2
%241 = call i32 (i32*, i8*, ...) @fprintf(i32* %239, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* %240)
br label %242
242: ; preds = %237, %253
%243 = bitcast [500 x i8]* %15 to i8*
%244 = load i32*, i32** %5
%245 = call i32 (i32*, i8*, ...) @fprintf(i32* %244, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0))
%246 = getelementptr inbounds [500 x i8], [500 x i8]* %15, i64 0, i64 0
%247 = load i32*, i32** %5
%248 = call i32* @fgets_or_exit(i8* %246, i32 500, i32* %247)
%249 = icmp ne i32* %248, null
br i1 %249, label %250, label %253
250: ; preds = %242
%251 = getelementptr inbounds [500 x i8], [500 x i8]* %15, i64 0, i64 0
%252 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* %251)
br label %253
253: ; preds = %250, %242
br label %242
254: ; preds = %32
br label %255
255: ; preds = %254
br label %18
256: ; preds = %30, %23
%257 = load i32, i32* %1
ret i32 %257
}

LLVM IR (-O2):
@.str = [1002 x i8] c"Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment ! Bienvenue sur le serveur de Ludovic et Cl\C3\A9ment !\0D\0A\00"
@.str.1 = [7 x i8] c"accept\00"
@.str.2 = [3 x i8] c"w+\00"
@.str.3 = [21 x i8] c"Error opening socket\00"
@.str.4 = [3 x i8] c"\0D\0A\00"
@.str.5 = [18 x i8] c"HTTP/1.1 200 OK\0D\0A\00"
@.str.6 = [20 x i8] c"Connection: close\0D\0A\00"
@.str.7 = [24 x i8] c"Content-Length: 1000 \0D\0A\00"
@.str.8 = [27 x i8] c"HTTP/1.1 400 Bad Request\0D\0A\00"
@.str.9 = [21 x i8] c"Content-Length: 17\0D\0A\00"
@.str.10 = [18 x i8] c"400 Bad Request\0D\0A\00"
@.str.11 = [3 x i8] c"%s\00"
@.str.12 = [6 x i8] c"<me> \00"
define i32 @main() {
%1 = alloca [500 x i8]
%2 = alloca [256 x i8]
%3 = alloca [500 x i8]
%4 = tail call i32 @creer_serveur(i32 8080)
%5 = tail call i32 (...) @initialiser_signaux()
br label %6
6: ; preds = %12, %0
%7 = tail call i32 @accept(i32 %4, i32* null, i32 0)
%8 = icmp eq i32 %7, -1
br i1 %8, label %167, label %9
9: ; preds = %6
%10 = tail call i32* @fdopen(i32 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp eq i32* %10, null
br i1 %11, label %167, label %12
12: ; preds = %9
%13 = tail call i32 (...) @fork()
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %12
%16 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 0
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%18 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 1
%19 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 2
br label %20
20: ; preds = %15, %153
%21 = call i32* @fgets_or_exit(i8* %16, i32 500, i32* %10)
%22 = icmp eq i32* %21, null
br i1 %22, label %153, label %23
23: ; preds = %20
br label %24
24: ; preds = %24, %23
%25 = call i32* @fgets_or_exit(i8* %17, i32 256, i32* %10)
%26 = call i64 @strncmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %25, i32 2)
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %24
28: ; preds = %24
%29 = load i8, i8* %16
%30 = icmp eq i8 %29, 71
%31 = load i8, i8* %18
%32 = icmp eq i8 %31, 69
%33 = select i1 %30, i1 %32, i1 false
%34 = load i8, i8* %19
%35 = icmp eq i8 %34, 84
%36 = select i1 %33, i1 %35, i1 false
br i1 %36, label %37, label %145
37: ; preds = %28
%38 = call i32 @strlen(i8* %16)
%39 = icmp sgt i32 %38, 0
br i1 %39, label %40, label %139
40: ; preds = %37
%41 = zext i32 %38 to i64
br label %42
42: ; preds = %40, %61
%43 = phi i64 [ 0, %40 ], [ %62, %61 ]
%44 = phi i32 [ 0, %40 ], [ %65, %61 ]
%45 = phi i32 [ 0, %40 ], [ %64, %61 ]
%46 = phi i32 [ 0, %40 ], [ %63, %61 ]
%47 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 %43
%48 = load i8, i8* %47
%49 = icmp eq i8 %48, 32
br i1 %49, label %52, label %50
50: ; preds = %42
%51 = add nuw nsw i64 %43, 1
br label %61
52: ; preds = %42
%53 = icmp eq i32 %45, 0
%54 = icmp eq i32 %44, 0
%55 = select i1 %53, i1 %54, i1 false
%56 = add nuw nsw i64 %43, 1
%57 = trunc i64 %56 to i32
%58 = select i1 %55, i32 %57, i32 %45
%59 = select i1 %55, i32 0, i32 %57
%60 = add nsw i32 %46, 1
br label %61
61: ; preds = %50, %52
%62 = phi i64 [ %51, %50 ], [ %56, %52 ]
%63 = phi i32 [ %46, %50 ], [ %60, %52 ]
%64 = phi i32 [ %45, %50 ], [ %58, %52 ]
%65 = phi i32 [ %44, %50 ], [ %59, %52 ]
%66 = icmp eq i64 %62, %41
br i1 %66, label %67, label %42
67: ; preds = %61
%68 = icmp eq i32 %63, 2
br i1 %68, label %69, label %139
69: ; preds = %67
%70 = sext i32 %65 to i64
%71 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 %70
%72 = load i8, i8* %71
%73 = icmp eq i8 %72, 72
br i1 %73, label %74, label %151
74: ; preds = %69
%75 = add nsw i32 %65, 1
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 %76
%78 = load i8, i8* %77
%79 = icmp eq i8 %78, 84
br i1 %79, label %80, label %151
80: ; preds = %74
%81 = add nsw i32 %65, 2
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 %82
%84 = load i8, i8* %83
%85 = icmp eq i8 %84, 84
br i1 %85, label %86, label %151
86: ; preds = %80
%87 = add nsw i32 %65, 3
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 %88
%90 = load i8, i8* %89
%91 = icmp eq i8 %90, 80
br i1 %91, label %92, label %151
92: ; preds = %86
%93 = add nsw i32 %65, 4
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 %94
%96 = load i8, i8* %95
%97 = icmp eq i8 %96, 47
br i1 %97, label %98, label %151
98: ; preds = %92
%99 = add nsw i32 %65, 5
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 %100
%102 = load i8, i8* %101
%103 = icmp eq i8 %102, 49
br i1 %103, label %104, label %151
104: ; preds = %98
%105 = add nsw i32 %65, 6
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 %106
%108 = load i8, i8* %107
%109 = icmp eq i8 %108, 46
br i1 %109, label %110, label %151
110: ; preds = %104
%111 = add nsw i32 %65, 7
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 %112
%114 = load i8, i8* %113
%115 = and i8 %114, -2
%116 = icmp eq i8 %115, 48
br i1 %116, label %117, label %151
117: ; preds = %110
%118 = sext i32 %64 to i64
%119 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 %118
%120 = load i8, i8* %119
%121 = icmp eq i8 %120, 47
br i1 %121, label %122, label %133
122: ; preds = %117
%123 = add nsw i32 %64, 1
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 %124
%126 = load i8, i8* %125
%127 = icmp eq i8 %126, 32
br i1 %127, label %128, label %133
128: ; preds = %122
%129 = call i64 @fwrite(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i64 17, i64 1, i32* %10)
%130 = call i64 @fwrite(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i64 19, i64 1, i32* %10)
%131 = call i64 @fwrite(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i64 23, i64 1, i32* %10)
%132 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i64 2, i64 1, i32* %10)
br label %151
133: ; preds = %122, %117
%134 = call i64 @fwrite(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), i64 26, i64 1, i32* %10)
%135 = call i64 @fwrite(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i64 19, i64 1, i32* %10)
%136 = call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i64 20, i64 1, i32* %10)
%137 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i64 2, i64 1, i32* %10)
%138 = call i64 @fwrite(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i64 17, i64 1, i32* %10)
br label %151
139: ; preds = %37, %67
%140 = call i64 @fwrite(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), i64 26, i64 1, i32* %10)
%141 = call i64 @fwrite(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i64 19, i64 1, i32* %10)
%142 = call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i64 20, i64 1, i32* %10)
%143 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i64 2, i64 1, i32* %10)
%144 = call i64 @fwrite(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i64 17, i64 1, i32* %10)
br label %151
145: ; preds = %28
%146 = call i64 @fwrite(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), i64 26, i64 1, i32* %10)
%147 = call i64 @fwrite(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i64 19, i64 1, i32* %10)
%148 = call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i64 20, i64 1, i32* %10)
%149 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i64 2, i64 1, i32* %10)
%150 = call i64 @fwrite(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i64 17, i64 1, i32* %10)
br label %151
151: ; preds = %110, %139, %128, %133, %104, %98, %92, %86, %80, %74, %69, %145
%152 = phi i32 [ 0, %145 ], [ 1, %128 ], [ 0, %133 ], [ 0, %104 ], [ 0, %98 ], [ 0, %92 ], [ 0, %86 ], [ 0, %80 ], [ 0, %74 ], [ 0, %69 ], [ 0, %139 ], [ 0, %110 ]
br label %153
153: ; preds = %151, %20
%154 = phi i32 [ %152, %151 ], [ 0, %20 ]
%155 = icmp eq i32 %154, 0
br i1 %155, label %20, label %156
156: ; preds = %153
%157 = call i32 @sleep(i32 1)
%158 = call i64 @fwrite(i8* getelementptr inbounds ([1002 x i8], [1002 x i8]* @.str, i64 0, i64 0), i64 1001, i64 1, i32* %10)
%159 = getelementptr inbounds [500 x i8], [500 x i8]* %3, i64 0, i64 0
br label %160
160: ; preds = %166, %156
%161 = call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i64 5, i64 1, i32* %10)
%162 = call i32* @fgets_or_exit(i8* %159, i32 500, i32* %10)
%163 = icmp eq i32* %162, null
br i1 %163, label %166, label %164
164: ; preds = %160
%165 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* %159)
br label %166
166: ; preds = %164, %160
br label %160
167: ; preds = %9, %6
%168 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %6 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), %9 ]
%169 = tail call i32 @perror(i8* %168)
ret i32 -1
}