#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 mqd_t;

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ O_WRONLY;
int /*<<< orphan*/ cgi_exit();
scalar_t__ cgi_get_isset(char *);
char *cgi_get_value(char *);
scalar_t__ cgi_has_get();
int /*<<< orphan*/ cgi_init();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int mq_open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ receive(int, char *);
int /*<<< orphan*/ send(int, char *);
int /*<<< orphan*/ stdout;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int main() {
  char *buf;
  char action[80];
  char msg[8192];
  mqd_t to_server;
  mqd_t from_server;
  cgi_init();
  to_server = mq_open("/apricot_server", O_WRONLY);
  from_server = mq_open("/apricot_admin", O_RDONLY);
  if (to_server == -1 || from_server == -1)
    return EXIT_FAILURE;
  printf("Content-type: text/html\n");
  if (cgi_has_get() && cgi_get_isset("action")) {
    strncpy(action, cgi_get_value("action"), 79);
    if (!strcmp(action, "printlog")) {
      printf("<html><head><title>Apricot Admin Interface</title>\n");
      printf("</head>\n\n");
      printf("<body>\n");
      strcpy(msg, "LOGSEND");
      send(to_server, msg);
      printf("<h1>Apricot server log</h1>\n");
      receive(from_server, msg);
      while (strcmp(msg, "OK") && strcmp(msg, "FAIL")) {
        printf("<p>%s</p>", msg);
        receive(from_server, msg);
      }
      printf("</body>\n");
      printf("</html>\n");
    } else if (!strcmp(action, "truncatelog")) {
      printf("<html><head><title>Apricot Admin Interface</title>\n");
      printf("</head>\n\n");
      printf("<body>\n");
      strcpy(msg, "TRUNCATELOG");
      send(to_server, msg);
      receive(from_server, msg);
      if (!strcmp(msg, "OK")) {
        printf("<h1>Log file reset done</h1>\n");
      } else {
        printf("<h1>Log file reset failed</h1>\n");
      }
      printf("</body>\n");
      printf("</html>\n");
    } else if (!strcmp(action, "serverstop")) {
      printf("<html><head><title>Apricot Admin Interface</title>\n");
      printf("</head>\n\n");
      printf("<body>\n");
      strcpy(msg, "SERVERSTOP");
      send(to_server, msg);
      printf("<h1 style=\"color:red;\"> Server stopped</h1>\n");
      printf("</body>\n");
      printf("</html>\n");
    } else if (!strcmp(action, "resizepool")) {
      printf("<html><head><title>Apricot Admin Interface</title>\n");
      printf("</head>\n\n");
      printf("<body>\n");
      if (!cgi_get_isset("size")) {
        printf("<form method=\"get\" action=\"admin\">\n");
        printf("<input type=\"hidden\" name=\"action\" "
               "value=\"resizepool\"></input>\n");
        printf("<label>Pool size : </label><input type=\"text\" size=\"20\" "
               "name=\"size\"></input>\n");
        printf("<input type=\"submit\" value=\"Ok\"></input></form>\n");
      } else {
        strcpy(msg, "RESIZEPOOL");
        send(to_server, msg);
        strcpy(msg, cgi_get_value("size"));
        send(to_server, msg);
        receive(from_server, msg);
        if (!strcmp(msg, "OK")) {
          printf("<h1>Pool resize done</h1>\n");
        } else {
          printf("<h1>Pool resize failed</h1>\n");
        }
      }
      printf("</body>\n");
      printf("</html>\n");
    } else {
      printf("<html><head><title>Apricot Admin Interface</title>\n");
      printf("</head>\n\n");
      printf("<body>\n");
      printf("<h1>Unknown action %s</h1>\n", action);
      printf("</body>\n");
      printf("</html>\n");
    }
  } else {
    printf("<html><head><title>Apricot Admin Interface</title></head>\n\n");
    printf("<body>\n");
    printf("<h1>Apricot administration interface</h1>\n");
    printf("</br><a href=\"?action=printlog\">Print the log file</a>\n");
    printf("</br><a href=\"?action=truncatelog\">Reset log file</a>\n");
    printf("</br><a href=\"?action=serverstop\">Stop server</a>\n");
    printf("</br><a href=\"?action=resizepool\">Resize workers pool</a>\n");
    printf("</body>\n");
    printf("</html>\n");
  }
  cgi_exit();
  fflush(stdout);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2080,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   10d0 <cgi_init@plt>
mov    0x2dc8(%rip),%rax
mov    (%rax),%esi
lea    0xe07(%rip),%rdi
call   10b0 <mq_open@plt>
mov    %eax,-0x2064(%rbp)
mov    0x2ddd(%rip),%rax
mov    (%rax),%esi
lea    0xdfc(%rip),%rdi
call   10b0 <mq_open@plt>
mov    %eax,-0x2068(%rbp)
cmpl   $0xffffffff,-0x2064(%rbp)
je     1239 <main+0x69>
cmpl   $0xffffffff,-0x2068(%rbp)
jne    124a <main+0x7a>
mov    0x2d98(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    17c5 <main+0x5f5>
lea    0xdce(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   1070 <cgi_has_get@plt>
cmp    $0x0,%rax
je     1726 <main+0x556>
lea    0xdc8(%rip),%rdi
call   10e0 <cgi_get_isset@plt>
cmp    $0x0,%rax
je     1726 <main+0x556>
lea    -0x60(%rbp),%rax
mov    %rax,-0x2070(%rbp)
lea    0xda7(%rip),%rdi
call   10a0 <cgi_get_value@plt>
mov    -0x2070(%rbp),%rdi
mov    %rax,%rsi
mov    $0x4f,%edx
call   1030 <strncpy@plt>
lea    -0x60(%rbp),%rdi
lea    0xd8a(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    13db <main+0x20b>
lea    0xd7d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0x1011(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd95(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x2060(%rbp),%rdi
lea    0xd88(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x2064(%rbp),%edi
lea    -0x2060(%rbp),%rsi
call   1050 <send@plt>
lea    0xd72(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x2068(%rbp),%edi
lea    -0x2060(%rbp),%rsi
call   1080 <receive@plt>
lea    -0x2060(%rbp),%rdi
lea    0xd68(%rip),%rsi
call   1090 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x2071(%rbp)
je     137b <main+0x1ab>
lea    -0x2060(%rbp),%rdi
lea    0xd43(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2071(%rbp)
mov    -0x2071(%rbp),%al
test   $0x1,%al
jne    138e <main+0x1be>
jmp    13ba <main+0x1ea>
lea    -0x2060(%rbp),%rsi
lea    0xd15(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x2068(%rbp),%edi
lea    -0x2060(%rbp),%rsi
call   1080 <receive@plt>
jmp    1333 <main+0x163>
lea    0xcfa(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xcf5(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1721 <main+0x551>
lea    -0x60(%rbp),%rdi
lea    0xce7(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    14b5 <main+0x2e5>
lea    0xc4c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xee0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xc64(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x2060(%rbp),%rdi
lea    0xcac(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x2064(%rbp),%edi
lea    -0x2060(%rbp),%rsi
call   1050 <send@plt>
mov    -0x2068(%rbp),%edi
lea    -0x2060(%rbp),%rsi
call   1080 <receive@plt>
lea    -0x2060(%rbp),%rdi
lea    0xc45(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1486 <main+0x2b6>
lea    0xc6b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1494 <main+0x2c4>
lea    0xc76(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xc20(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xc1b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    171c <main+0x54c>
lea    -0x60(%rbp),%rdi
lea    0xc63(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    154d <main+0x37d>
lea    0xb72(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe06(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xb8a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x2060(%rbp),%rdi
lea    0xc27(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x2064(%rbp),%edi
lea    -0x2060(%rbp),%rsi
call   1050 <send@plt>
lea    0xc14(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xb88(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xb83(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1717 <main+0x547>
lea    -0x60(%rbp),%rdi
lea    0xc0e(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    16ba <main+0x4ea>
lea    0xada(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd6e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xaf2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xbd9(%rip),%rdi
call   10e0 <cgi_get_isset@plt>
cmp    $0x0,%rax
jne    15e4 <main+0x414>
lea    0xbc8(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xbde(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xc10(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xc50(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1699 <main+0x4c9>
lea    -0x2060(%rbp),%rdi
lea    0xc67(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x2064(%rbp),%edi
lea    -0x2060(%rbp),%rsi
call   1050 <send@plt>
lea    -0x2060(%rbp),%rax
mov    %rax,-0x2080(%rbp)
lea    0xb53(%rip),%rdi
call   10a0 <cgi_get_value@plt>
mov    -0x2080(%rbp),%rdi
mov    %rax,%rsi
call   1040 <strcpy@plt>
mov    -0x2064(%rbp),%edi
lea    -0x2060(%rbp),%rsi
call   1050 <send@plt>
mov    -0x2068(%rbp),%edi
lea    -0x2060(%rbp),%rsi
call   1080 <receive@plt>
lea    -0x2060(%rbp),%rdi
lea    0xa45(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1686 <main+0x4b6>
lea    0xbea(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1694 <main+0x4c4>
lea    0xbf2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1699 <main+0x4c9>
lea    0xa1b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xa16(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1712 <main+0x542>
lea    0x987(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xc1b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0x99f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x60(%rbp),%rsi
lea    0xbad(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0x9be(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0x9b9(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1717 <main+0x547>
jmp    171c <main+0x54c>
jmp    1721 <main+0x551>
jmp    17a4 <main+0x5d4>
lea    0xb8b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0x941(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xbab(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xbc8(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xbf2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xc1b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xc40(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0x92c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0x927(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   10f0 <cgi_exit@plt>
mov    0x281e(%rip),%rax
mov    (%rax),%edi
call   10c0 <fflush@plt>
mov    0x2808(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2080,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x2050,%rsp
xor    %eax,%eax
call   10e0 <cgi_init@plt>
mov    0x2dbb(%rip),%rax
mov    (%rax),%esi
lea    0xdfa(%rip),%rdi
call   10c0 <mq_open@plt>
mov    %eax,%r15d
mov    0x2dd3(%rip),%rax
mov    (%rax),%esi
lea    0xdf2(%rip),%rdi
call   10c0 <mq_open@plt>
mov    %eax,%ebx
mov    0x2dac(%rip),%rax
cmp    $0xffffffff,%r15d
je     13ae <main+0x1ce>
cmp    $0xffffffff,%ebx
je     13ae <main+0x1ce>
lea    0xe68(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1080 <cgi_has_get@plt>
test   %rax,%rax
je     1326 <main+0x146>
lea    0xdbd(%rip),%rdi
call   10f0 <cgi_get_isset@plt>
test   %rax,%rax
je     1326 <main+0x146>
lea    0xda8(%rip),%rdi
call   10b0 <cgi_get_value@plt>
mov    %rsp,%rbp
mov    %rbp,%rdi
mov    %rax,%rsi
mov    $0x4f,%edx
call   1030 <strncpy@plt>
lea    0xd90(%rip),%rsi
mov    %rbp,%rdi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     13c0 <main+0x1e0>
lea    0xd9b(%rip),%rsi
mov    %rsp,%rdi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     1490 <main+0x2b0>
lea    0xd9b(%rip),%rsi
mov    %rsp,%rdi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     1506 <main+0x326>
lea    0xd99(%rip),%rsi
mov    %rsp,%rdi
call   10a0 <strcmp@plt>
lea    0x10b0(%rip),%rdi
test   %rax,%rax
je     1555 <main+0x375>
call   1050 <puts@plt>
lea    0xdf6(%rip),%rdi
call   1050 <puts@plt>
lea    0x10c2(%rip),%rdi
call   1050 <puts@plt>
lea    0xd78(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    137a <main+0x19a>
lea    0xd99(%rip),%rdi
call   1050 <puts@plt>
lea    0x1097(%rip),%rdi
call   1050 <puts@plt>
lea    0xdbc(%rip),%rdi
call   1050 <puts@plt>
lea    0xdda(%rip),%rdi
call   1050 <puts@plt>
lea    0xe05(%rip),%rdi
call   1050 <puts@plt>
lea    0xe2f(%rip),%rdi
call   1050 <puts@plt>
lea    0xe55(%rip),%rdi
call   1050 <puts@plt>
lea    0x1056(%rip),%rdi
call   1050 <puts@plt>
lea    0x1052(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1100 <cgi_exit@plt>
mov    0x2c30(%rip),%rax
mov    (%rax),%edi
call   10d0 <fflush@plt>
mov    0x2c1a(%rip),%rax
mov    (%rax),%eax
add    $0x2050,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xfd6(%rip),%rdi
call   1050 <puts@plt>
lea    0xd25(%rip),%rdi
call   1050 <puts@plt>
lea    0xff1(%rip),%rdi
call   1050 <puts@plt>
lea    0xc44(%rip),%rsi
lea    0x50(%rsp),%rbp
mov    %rbp,%rdi
call   1040 <strcpy@plt>
mov    %r15d,%edi
mov    %rbp,%rsi
call   1060 <send@plt>
lea    0xdfa(%rip),%rdi
call   1050 <puts@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
call   1090 <receive@plt>
lea    0xc17(%rip),%rsi
mov    %rbp,%rdi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     137a <main+0x19a>
lea    0xc02(%rip),%r14
lea    0x50(%rsp),%rbp
lea    0xbfb(%rip),%r15
lea    0xbec(%rip),%r12
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    %r14,%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     137a <main+0x19a>
mov    %r15,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
call   1090 <receive@plt>
mov    %rbp,%rdi
mov    %r12,%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
jne    1450 <main+0x270>
jmp    137a <main+0x19a>
lea    0xf06(%rip),%rdi
call   1050 <puts@plt>
lea    0xc55(%rip),%rdi
call   1050 <puts@plt>
lea    0xf21(%rip),%rdi
call   1050 <puts@plt>
lea    0xb9a(%rip),%rsi
lea    0x50(%rsp),%rbp
mov    %rbp,%rdi
call   1040 <strcpy@plt>
mov    %r15d,%edi
mov    %rbp,%rsi
call   1060 <send@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
call   1090 <receive@plt>
lea    0xb53(%rip),%rsi
mov    %rbp,%rdi
call   10a0 <strcmp@plt>
test   %rax,%rax
lea    0xd2a(%rip),%rax
lea    0xd40(%rip),%rdi
cmove  %rax,%rdi
jmp    1375 <main+0x195>
lea    0xe90(%rip),%rdi
call   1050 <puts@plt>
lea    0xbdf(%rip),%rdi
call   1050 <puts@plt>
lea    0xeab(%rip),%rdi
call   1050 <puts@plt>
lea    0xb3b(%rip),%rsi
lea    0x50(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    %r15d,%edi
mov    %rbx,%rsi
call   1060 <send@plt>
lea    0xd0c(%rip),%rdi
jmp    1375 <main+0x195>
call   1050 <puts@plt>
lea    0xb97(%rip),%rdi
call   1050 <puts@plt>
lea    0xe63(%rip),%rdi
call   1050 <puts@plt>
lea    0xb09(%rip),%rdi
call   10f0 <cgi_get_isset@plt>
test   %rax,%rax
je     15f7 <main+0x417>
lea    0xafd(%rip),%rsi
lea    0x50(%rsp),%r14
mov    %r14,%rdi
call   1040 <strcpy@plt>
mov    %r15d,%edi
mov    %r14,%rsi
call   1060 <send@plt>
lea    0xad9(%rip),%rdi
call   10b0 <cgi_get_value@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <strcpy@plt>
mov    %r15d,%edi
mov    %r14,%rsi
call   1060 <send@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1090 <receive@plt>
lea    0xa62(%rip),%rsi
mov    %r14,%rdi
call   10a0 <strcmp@plt>
test   %rax,%rax
lea    0xd80(%rip),%rax
lea    0xd93(%rip),%rdi
cmove  %rax,%rdi
jmp    1375 <main+0x195>
lea    0xc8a(%rip),%rdi
call   1050 <puts@plt>
lea    0xca1(%rip),%rdi
call   1050 <puts@plt>
lea    0xcd4(%rip),%rdi
call   1050 <puts@plt>
lea    0xd15(%rip),%rdi
jmp    1375 <main+0x195>

LLVM IR (-O0):
@.str = [16 x i8] c"/apricot_server\00"
@O_WRONLY = global i32 0
@.str.1 = [15 x i8] c"/apricot_admin\00"
@O_RDONLY = global i32 0
@EXIT_FAILURE = global i32 0
@.str.2 = [25 x i8] c"Content-type: text/html\0A\00"
@.str.3 = [7 x i8] c"action\00"
@.str.4 = [9 x i8] c"printlog\00"
@.str.5 = [52 x i8] c"<html><head><title>Apricot Admin Interface</title>\0A\00"
@.str.6 = [10 x i8] c"</head>\0A\0A\00"
@.str.7 = [8 x i8] c"<body>\0A\00"
@.str.8 = [8 x i8] c"LOGSEND\00"
@.str.9 = [29 x i8] c"<h1>Apricot server log</h1>\0A\00"
@.str.10 = [3 x i8] c"OK\00"
@.str.11 = [5 x i8] c"FAIL\00"
@.str.12 = [10 x i8] c"<p>%s</p>\00"
@.str.13 = [9 x i8] c"</body>\0A\00"
@.str.14 = [9 x i8] c"</html>\0A\00"
@.str.15 = [12 x i8] c"truncatelog\00"
@.str.16 = [12 x i8] c"TRUNCATELOG\00"
@.str.17 = [30 x i8] c"<h1>Log file reset done</h1>\0A\00"
@.str.18 = [32 x i8] c"<h1>Log file reset failed</h1>\0A\00"
@.str.19 = [11 x i8] c"serverstop\00"
@.str.20 = [11 x i8] c"SERVERSTOP\00"
@.str.21 = [45 x i8] c"<h1 style=\22color:red;\22> Server stopped</h1>\0A\00"
@.str.22 = [11 x i8] c"resizepool\00"
@.str.23 = [5 x i8] c"size\00"
@.str.24 = [36 x i8] c"<form method=\22get\22 action=\22admin\22>\0A\00"
@.str.25 = [64 x i8] c"<input type=\22hidden\22 name=\22action\22 value=\22resizepool\22></input>\0A\00"
@.str.26 = [78 x i8] c"<label>Pool size : </label><input type=\22text\22 size=\2220\22 name=\22size\22></input>\0A\00"
@.str.27 = [49 x i8] c"<input type=\22submit\22 value=\22Ok\22></input></form>\0A\00"
@.str.28 = [11 x i8] c"RESIZEPOOL\00"
@.str.29 = [27 x i8] c"<h1>Pool resize done</h1>\0A\00"
@.str.30 = [29 x i8] c"<h1>Pool resize failed</h1>\0A\00"
@.str.31 = [28 x i8] c"<h1>Unknown action %s</h1>\0A\00"
@.str.32 = [60 x i8] c"<html><head><title>Apricot Admin Interface</title></head>\0A\0A\00"
@.str.33 = [43 x i8] c"<h1>Apricot administration interface</h1>\0A\00"
@.str.34 = [56 x i8] c"</br><a href=\22?action=printlog\22>Print the log file</a>\0A\00"
@.str.35 = [55 x i8] c"</br><a href=\22?action=truncatelog\22>Reset log file</a>\0A\00"
@.str.36 = [51 x i8] c"</br><a href=\22?action=serverstop\22>Stop server</a>\0A\00"
@.str.37 = [59 x i8] c"</br><a href=\22?action=resizepool\22>Resize workers pool</a>\0A\00"
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca [80 x i8]
%4 = alloca [8192 x i8]
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 (...) @cgi_init()
%8 = load i32, i32* @O_WRONLY
%9 = call i32 @mq_open(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* @O_RDONLY
%11 = call i32 @mq_open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %10)
store i32 %11, i32* %6
%12 = load i32, i32* %5
%13 = icmp eq i32 %12, -1
br i1 %13, label %17, label %14
14: ; preds = %0
%15 = load i32, i32* %6
%16 = icmp eq i32 %15, -1
br i1 %16, label %17, label %19
17: ; preds = %14, %0
%18 = load i32, i32* @EXIT_FAILURE
store i32 %18, i32* %1
br label %175
19: ; preds = %14
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%21 = call i64 (...) @cgi_has_get()
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %160
23: ; preds = %19
%24 = call i64 @cgi_get_isset(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %160
26: ; preds = %23
%27 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%28 = call i8* @cgi_get_value(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%29 = call i32 @strncpy(i8* %27, i8* %28, i32 79)
%30 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%31 = call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%32 = icmp ne i64 %31, 0
br i1 %32, label %65, label %33
33: ; preds = %26
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0))
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%37 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%38 = call i32 @strcpy(i8* %37, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%39 = load i32, i32* %5
%40 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%41 = call i32 @send(i32 %39, i8* %40)
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.9, i64 0, i64 0))
%43 = load i32, i32* %6
%44 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%45 = call i32 @receive(i32 %43, i8* %44)
br label %46
46: ; preds = %56, %33
%47 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%48 = call i64 @strcmp(i8* %47, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%49 = icmp ne i64 %48, 0
br i1 %49, label %50, label %54
50: ; preds = %46
%51 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%52 = call i64 @strcmp(i8* %51, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%53 = icmp ne i64 %52, 0
br label %54
54: ; preds = %50, %46
%55 = phi i1 [ false, %46 ], [ %53, %50 ]
br i1 %55, label %56, label %62
56: ; preds = %54
%57 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i8* %57)
%59 = load i32, i32* %6
%60 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%61 = call i32 @receive(i32 %59, i8* %60)
br label %46
62: ; preds = %54
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0))
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0))
br label %159
65: ; preds = %26
%66 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%67 = call i64 @strcmp(i8* %66, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.15, i64 0, i64 0))
%68 = icmp ne i64 %67, 0
br i1 %68, label %91, label %69
69: ; preds = %65
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0))
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%73 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%74 = call i32 @strcpy(i8* %73, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.16, i64 0, i64 0))
%75 = load i32, i32* %5
%76 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%77 = call i32 @send(i32 %75, i8* %76)
%78 = load i32, i32* %6
%79 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%80 = call i32 @receive(i32 %78, i8* %79)
%81 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%82 = call i64 @strcmp(i8* %81, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%83 = icmp ne i64 %82, 0
br i1 %83, label %86, label %84
84: ; preds = %69
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.17, i64 0, i64 0))
br label %88
86: ; preds = %69
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.18, i64 0, i64 0))
br label %88
88: ; preds = %86, %84
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0))
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0))
br label %158
91: ; preds = %65
%92 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%93 = call i64 @strcmp(i8* %92, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.19, i64 0, i64 0))
%94 = icmp ne i64 %93, 0
br i1 %94, label %107, label %95
95: ; preds = %91
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0))
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%99 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%100 = call i32 @strcpy(i8* %99, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.20, i64 0, i64 0))
%101 = load i32, i32* %5
%102 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%103 = call i32 @send(i32 %101, i8* %102)
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.21, i64 0, i64 0))
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0))
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0))
br label %157
107: ; preds = %91
%108 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%109 = call i64 @strcmp(i8* %108, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.22, i64 0, i64 0))
%110 = icmp ne i64 %109, 0
br i1 %110, label %148, label %111
111: ; preds = %107
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0))
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%115 = call i64 @cgi_get_isset(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.23, i64 0, i64 0))
%116 = icmp ne i64 %115, 0
br i1 %116, label %122, label %117
117: ; preds = %111
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.24, i64 0, i64 0))
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.25, i64 0, i64 0))
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.26, i64 0, i64 0))
%121 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.27, i64 0, i64 0))
br label %145
122: ; preds = %111
%123 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%124 = call i32 @strcpy(i8* %123, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.28, i64 0, i64 0))
%125 = load i32, i32* %5
%126 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%127 = call i32 @send(i32 %125, i8* %126)
%128 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%129 = call i8* @cgi_get_value(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.23, i64 0, i64 0))
%130 = call i32 @strcpy(i8* %128, i8* %129)
%131 = load i32, i32* %5
%132 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%133 = call i32 @send(i32 %131, i8* %132)
%134 = load i32, i32* %6
%135 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%136 = call i32 @receive(i32 %134, i8* %135)
%137 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%138 = call i64 @strcmp(i8* %137, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%139 = icmp ne i64 %138, 0
br i1 %139, label %142, label %140
140: ; preds = %122
%141 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.29, i64 0, i64 0))
br label %144
142: ; preds = %122
%143 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.30, i64 0, i64 0))
br label %144
144: ; preds = %142, %140
br label %145
145: ; preds = %144, %117
%146 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0))
%147 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0))
br label %156
148: ; preds = %107
%149 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0))
%150 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%151 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%152 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%153 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.31, i64 0, i64 0), i8* %152)
%154 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0))
%155 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0))
br label %156
156: ; preds = %148, %145
br label %157
157: ; preds = %156, %95
br label %158
158: ; preds = %157, %88
br label %159
159: ; preds = %158, %62
br label %170
160: ; preds = %23, %19
%161 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.32, i64 0, i64 0))
%162 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%163 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.33, i64 0, i64 0))
%164 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.34, i64 0, i64 0))
%165 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.35, i64 0, i64 0))
%166 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.36, i64 0, i64 0))
%167 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.37, i64 0, i64 0))
%168 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0))
%169 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0))
br label %170
170: ; preds = %160, %159
%171 = call i32 (...) @cgi_exit()
%172 = load i32, i32* @stdout
%173 = call i32 @fflush(i32 %172)
%174 = load i32, i32* @EXIT_SUCCESS
store i32 %174, i32* %1
br label %175
175: ; preds = %170, %17
%176 = load i32, i32* %1
ret i32 %176
}

LLVM IR (-O2):
@.str = [16 x i8] c"/apricot_server\00"
@O_WRONLY = global i32 0
@.str.1 = [15 x i8] c"/apricot_admin\00"
@O_RDONLY = global i32 0
@EXIT_FAILURE = global i32 0
@.str.3 = [7 x i8] c"action\00"
@.str.4 = [9 x i8] c"printlog\00"
@.str.8 = [8 x i8] c"LOGSEND\00"
@.str.10 = [3 x i8] c"OK\00"
@.str.11 = [5 x i8] c"FAIL\00"
@.str.12 = [10 x i8] c"<p>%s</p>\00"
@.str.15 = [12 x i8] c"truncatelog\00"
@.str.16 = [12 x i8] c"TRUNCATELOG\00"
@.str.19 = [11 x i8] c"serverstop\00"
@.str.20 = [11 x i8] c"SERVERSTOP\00"
@.str.22 = [11 x i8] c"resizepool\00"
@.str.23 = [5 x i8] c"size\00"
@.str.28 = [11 x i8] c"RESIZEPOOL\00"
@.str.31 = [28 x i8] c"<h1>Unknown action %s</h1>\0A\00"
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
@str = [24 x i8] c"Content-type: text/html\00"
@str.38 = [59 x i8] c"<html><head><title>Apricot Admin Interface</title></head>\0A\00"
@str.40 = [42 x i8] c"<h1>Apricot administration interface</h1>\00"
@str.41 = [55 x i8] c"</br><a href=\22?action=printlog\22>Print the log file</a>\00"
@str.42 = [54 x i8] c"</br><a href=\22?action=truncatelog\22>Reset log file</a>\00"
@str.43 = [50 x i8] c"</br><a href=\22?action=serverstop\22>Stop server</a>\00"
@str.44 = [58 x i8] c"</br><a href=\22?action=resizepool\22>Resize workers pool</a>\00"
@str.50 = [28 x i8] c"<h1>Apricot server log</h1>\00"
@str.56 = [29 x i8] c"<h1>Log file reset done</h1>\00"
@str.59 = [31 x i8] c"<h1>Log file reset failed</h1>\00"
@str.63 = [44 x i8] c"<h1 style=\22color:red;\22> Server stopped</h1>\00"
@str.69 = [35 x i8] c"<form method=\22get\22 action=\22admin\22>\00"
@str.70 = [63 x i8] c"<input type=\22hidden\22 name=\22action\22 value=\22resizepool\22></input>\00"
@str.71 = [77 x i8] c"<label>Pool size : </label><input type=\22text\22 size=\2220\22 name=\22size\22></input>\00"
@str.72 = [48 x i8] c"<input type=\22submit\22 value=\22Ok\22></input></form>\00"
@str.75 = [26 x i8] c"<h1>Pool resize done</h1>\00"
@str.76 = [28 x i8] c"<h1>Pool resize failed</h1>\00"
@str.77 = [51 x i8] c"<html><head><title>Apricot Admin Interface</title>\00"
@str.78 = [9 x i8] c"</head>\0A\00"
@str.79 = [7 x i8] c"<body>\00"
@str.80 = [8 x i8] c"</body>\00"
@str.81 = [8 x i8] c"</html>\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = alloca [8192 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [8192 x i8], [8192 x i8]* %2, i64 0, i64 0
%5 = tail call i32 (...) @cgi_init()
%6 = load i32, i32* @O_WRONLY
%7 = tail call i32 @mq_open(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @O_RDONLY
%9 = tail call i32 @mq_open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = icmp eq i32 %7, -1
%11 = icmp eq i32 %9, -1
%12 = select i1 %10, i1 true, i1 %11
br i1 %12, label %123, label %13
13: ; preds = %0
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%15 = tail call i64 (...) @cgi_has_get()
%16 = icmp eq i64 %15, 0
br i1 %16, label %109, label %17
17: ; preds = %13
%18 = tail call i64 @cgi_get_isset(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %109, label %20
20: ; preds = %17
%21 = tail call i8* @cgi_get_value(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%22 = call i32 @strncpy(i8* %3, i8* %21, i32 79)
%23 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %46
25: ; preds = %20
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.77, i64 0, i64 0))
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.78, i64 0, i64 0))
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.79, i64 0, i64 0))
%29 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%30 = call i32 @send(i32 %7, i8* %4)
%31 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.50, i64 0, i64 0))
%32 = call i32 @receive(i32 %9, i8* %4)
%33 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %43, label %35
35: ; preds = %25, %38
%36 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %43, label %38
38: ; preds = %35
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i8* %4)
%40 = call i32 @receive(i32 %9, i8* %4)
%41 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %35
43: ; preds = %35, %38, %25
%44 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.80, i64 0, i64 0))
%45 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.81, i64 0, i64 0))
br label %119
46: ; preds = %20
%47 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.15, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %62
49: ; preds = %46
%50 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.77, i64 0, i64 0))
%51 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.78, i64 0, i64 0))
%52 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.79, i64 0, i64 0))
%53 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.16, i64 0, i64 0))
%54 = call i32 @send(i32 %7, i8* %4)
%55 = call i32 @receive(i32 %9, i8* %4)
%56 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%57 = icmp eq i64 %56, 0
%58 = select i1 %57, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @str.56, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @str.59, i64 0, i64 0)
%59 = call i32 @puts(i8* dereferenceable(1) %58)
%60 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.80, i64 0, i64 0))
%61 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.81, i64 0, i64 0))
br label %119
62: ; preds = %46
%63 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.19, i64 0, i64 0))
%64 = icmp eq i64 %63, 0
br i1 %64, label %65, label %74
65: ; preds = %62
%66 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.77, i64 0, i64 0))
%67 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.78, i64 0, i64 0))
%68 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.79, i64 0, i64 0))
%69 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.20, i64 0, i64 0))
%70 = call i32 @send(i32 %7, i8* %4)
%71 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.63, i64 0, i64 0))
%72 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.80, i64 0, i64 0))
%73 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.81, i64 0, i64 0))
br label %119
74: ; preds = %62
%75 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.22, i64 0, i64 0))
%76 = icmp eq i64 %75, 0
br i1 %76, label %77, label %102
77: ; preds = %74
%78 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.77, i64 0, i64 0))
%79 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.78, i64 0, i64 0))
%80 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.79, i64 0, i64 0))
%81 = call i64 @cgi_get_isset(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.23, i64 0, i64 0))
%82 = icmp eq i64 %81, 0
br i1 %82, label %83, label %87
83: ; preds = %77
%84 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.69, i64 0, i64 0))
%85 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.70, i64 0, i64 0))
%86 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str.71, i64 0, i64 0))
br label %97
87: ; preds = %77
%88 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.28, i64 0, i64 0))
%89 = call i32 @send(i32 %7, i8* %4)
%90 = call i8* @cgi_get_value(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.23, i64 0, i64 0))
%91 = call i32 @strcpy(i8* %4, i8* %90)
%92 = call i32 @send(i32 %7, i8* %4)
%93 = call i32 @receive(i32 %9, i8* %4)
%94 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%95 = icmp eq i64 %94, 0
%96 = select i1 %95, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @str.75, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @str.76, i64 0, i64 0)
br label %97
97: ; preds = %87, %83
%98 = phi i8* [ getelementptr inbounds ([48 x i8], [48 x i8]* @str.72, i64 0, i64 0), %83 ], [ %96, %87 ]
%99 = call i32 @puts(i8* dereferenceable(1) %98)
%100 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.80, i64 0, i64 0))
%101 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.81, i64 0, i64 0))
br label %119
102: ; preds = %74
%103 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.77, i64 0, i64 0))
%104 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.78, i64 0, i64 0))
%105 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.79, i64 0, i64 0))
%106 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.31, i64 0, i64 0), i8* %3)
%107 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.80, i64 0, i64 0))
%108 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.81, i64 0, i64 0))
br label %119
109: ; preds = %17, %13
%110 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.38, i64 0, i64 0))
%111 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.79, i64 0, i64 0))
%112 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.40, i64 0, i64 0))
%113 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.41, i64 0, i64 0))
%114 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.42, i64 0, i64 0))
%115 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.43, i64 0, i64 0))
%116 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.44, i64 0, i64 0))
%117 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.80, i64 0, i64 0))
%118 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.81, i64 0, i64 0))
br label %119
119: ; preds = %43, %65, %102, %97, %49, %109
%120 = call i32 (...) @cgi_exit()
%121 = load i32, i32* @stdout
%122 = call i32 @fflush(i32 %121)
br label %123
123: ; preds = %0, %119
%124 = phi i32* [ @EXIT_SUCCESS, %119 ], [ @EXIT_FAILURE, %0 ]
%125 = load i32, i32* %124
ret i32 %125
}