#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 */
struct qserver {
  int dummy;
};
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
char *get_param_value(struct qserver *, char *, int /*<<< orphan*/ *);
char *put_bytes(char *, char *, int, size_t *);
int /*<<< orphan*/ put_long_little(int, char *);
char *put_string(char *, char *, size_t *);
scalar_t__ qserver_send(struct qserver *, char *, int);
char *strchr(char *, char);
unsigned int strlen(char *);
scalar_t__ strncmp(char *, char *, unsigned int);
int ut2004_send_query(struct qserver *server) {
  char buf[4096] = {0};
  size_t left = sizeof(buf);
  char *b = buf;
  char *param, *r, *sep = "";
  unsigned flen = 0;
  unsigned char items = 0;
  b += 6;
  left -= 6;
  param = get_param_value(server, "gametype", NULL);
  if (param) {
    ++items;
    b = put_string(b, "gametype", &left);
    b = put_string(b, param, &left);
    b = put_bytes(b, "", 1, &left);
  }
  param = get_param_value(server, "status", NULL);
  r = param;
  while (param && sep) {
    sep = strchr(r, ':');
    if (sep)
      flen = sep - r;
    else
      flen = strlen(r);
    if (strncmp(r, "standard", flen) == 0 ||
        strncmp(r, "nostandard", flen) == 0) {
      ++items;
      b = put_string(b, "standard", &left);
      if (*r == 'n')
        b = put_string(b, "false", &left);
      else
        b = put_string(b, "true", &left);
      b = put_bytes(b, "", 1, &left);
    } else if (strncmp(r, "password", flen) == 0 ||
               strncmp(r, "nopassword", flen) == 0) {
      ++items;
      b = put_string(b, "password", &left);
      if (*r == 'n')
        b = put_string(b, "false", &left);
      else
        b = put_string(b, "true", &left);
      b = put_bytes(b, "", 1, &left);
    } else if (strncmp(r, "notempty", flen) == 0) {
      ++items;
      b = put_string(b, "currentplayers", &left);
      b = put_string(b, "0", &left);
      b = put_bytes(b, "\x04", 1, &left);
    } else if (strncmp(r, "notfull", flen) == 0) {
      ++items;
      b = put_string(b, "freespace", &left);
      b = put_string(b, "0", &left);
      b = put_bytes(b, "\x04", 1, &left);
    } else if (strncmp(r, "nobots", flen) == 0) {
      ++items;
      b = put_string(b, "nobots", &left);
      b = put_string(b, "true", &left);
      b = put_bytes(b, "", 1, &left);
    } else if (strncmp(r, "stats", flen) == 0 ||
               strncmp(r, "nostats", flen) == 0) {
      ++items;
      b = put_string(b, "stats", &left);
      if (*r == 'n')
        b = put_string(b, "false", &left);
      else
        b = put_string(b, "true", &left);
      b = put_bytes(b, "", 1, &left);
    } else if (strncmp(r, "weaponstay", flen) == 0 ||
               strncmp(r, "noweaponstay", flen) == 0) {
      ++items;
      b = put_string(b, "weaponstay", &left);
      if (*r == 'n')
        b = put_string(b, "false", &left);
      else
        b = put_string(b, "true", &left);
      b = put_bytes(b, "", 1, &left);
    } else if (strncmp(r, "transloc", flen) == 0 ||
               strncmp(r, "notransloc", flen) == 0) {
      ++items;
      b = put_string(b, "transloc", &left);
      if (*r == 'n')
        b = put_string(b, "false", &left);
      else
        b = put_string(b, "true", &left);
      b = put_bytes(b, "", 1, &left);
    }
    r = sep + 1;
  }
  param = get_param_value(server, "mutator", NULL);
  r = param;
  sep = "";
  while (param && sep) {
    char neg = '\0';
    unsigned char l;
    sep = strchr(r, ':');
    if (sep)
      flen = sep - r;
    else
      flen = strlen(r);
    if (*r == '-') {
      neg = '\x04';
      ++r;
      --flen;
    }
    if (!flen)
      continue;
    b = put_string(b, "mutator", &left);
    l = flen + 1;
    b = put_bytes(b, (char *)&l, 1, &left);
    b = put_bytes(b, r, flen, &left);
    b = put_bytes(b, "", 1, &left);
    b = put_bytes(b, &neg, 1, &left);
    ++items;
    r = sep + 1;
  }
  if (!b) {
    ;
    return 0;
  }
  put_long_little(b - buf - 4, buf);
  buf[5] = items;
  return (qserver_send(server, buf, sizeof(buf) - left) > 0);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x1050,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x1010(%rbp),%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   1070 <memset@plt>
movq   $0x1000,-0x1018(%rbp)
lea    -0x1010(%rbp),%rax
mov    %rax,-0x1020(%rbp)
lea    0xe7a(%rip),%rax
mov    %rax,-0x1038(%rbp)
movl   $0x0,-0x103c(%rbp)
movb   $0x0,-0x103d(%rbp)
mov    -0x1020(%rbp),%rax
add    $0x6,%rax
mov    %rax,-0x1020(%rbp)
mov    -0x1018(%rbp),%rax
sub    $0x6,%rax
mov    %rax,-0x1018(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xde7(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1080 <get_param_value@plt>
mov    %rax,-0x1028(%rbp)
cmpq   $0x0,-0x1028(%rbp)
je     12ad <ut2004_send_query+0x11d>
mov    -0x103d(%rbp),%al
add    $0x1,%al
mov    %al,-0x103d(%rbp)
mov    -0x1020(%rbp),%rdi
lea    0xdad(%rip),%rsi
lea    -0x1018(%rbp),%rdx
call   10b0 <put_string@plt>
mov    %rax,-0x1020(%rbp)
mov    -0x1020(%rbp),%rdi
mov    -0x1028(%rbp),%rsi
lea    -0x1018(%rbp),%rdx
call   10b0 <put_string@plt>
mov    %rax,-0x1020(%rbp)
mov    -0x1020(%rbp),%rdi
lea    0xdb7(%rip),%rsi
mov    $0x1,%edx
lea    -0x1018(%rbp),%rcx
call   1030 <put_bytes@plt>
mov    %rax,-0x1020(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xd51(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1080 <get_param_value@plt>
mov    %rax,-0x1028(%rbp)
mov    -0x1028(%rbp),%rax
mov    %rax,-0x1030(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x1028(%rbp)
mov    %al,-0x1040(%rbp)
je     12fd <ut2004_send_query+0x16d>
cmpq   $0x0,-0x1038(%rbp)
setne  %al
mov    %al,-0x1040(%rbp)
mov    -0x1040(%rbp),%al
test   $0x1,%al
jne    1310 <ut2004_send_query+0x180>
jmp    1a55 <ut2004_send_query+0x8c5>
mov    -0x1030(%rbp),%rdi
mov    $0x3a,%esi
call   1060 <strchr@plt>
mov    %rax,-0x1038(%rbp)
cmpq   $0x0,-0x1038(%rbp)
je     1352 <ut2004_send_query+0x1c2>
mov    -0x1038(%rbp),%rax
mov    -0x1030(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x103c(%rbp)
jmp    1364 <ut2004_send_query+0x1d4>
mov    -0x1030(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x103c(%rbp)
mov    -0x1030(%rbp),%rdi
mov    -0x103c(%rbp),%edx
lea    0xc9a(%rip),%rsi
call   1040 <strncmp@plt>
cmp    $0x0,%rax
je     13aa <ut2004_send_query+0x21a>
mov    -0x1030(%rbp),%rdi
mov    -0x103c(%rbp),%edx
lea    0xc75(%rip),%rsi
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    145e <ut2004_send_query+0x2ce>
mov    -0x103d(%rbp),%al
add    $0x1,%al
mov    %al,-0x103d(%rbp)
mov    -0x1020(%rbp),%rdi
lea    0xc4c(%rip),%rsi
lea    -0x1018(%rbp),%rdx
call   10b0 <put_string@plt>
mov    %rax,-0x1020(%rbp)
mov    -0x1030(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x6e,%eax
jne    1412 <ut2004_send_query+0x282>
mov    -0x1020(%rbp),%rdi
lea    0xc21(%rip),%rsi
lea    -0x1018(%rbp),%rdx
call   10b0 <put_string@plt>
mov    %rax,-0x1020(%rbp)
jmp    1433 <ut2004_send_query+0x2a3>
mov    -0x1020(%rbp),%rdi
lea    0xc01(%rip),%rsi
lea    -0x1018(%rbp),%rdx
call   10b0 <put_string@plt>
mov    %rax,-0x1020(%rbp)
mov    -0x1020(%rbp),%rdi
lea    0xc0b(%rip),%rsi
mov    $0x1,%edx
lea    -0x1018(%rbp),%rcx
call   1030 <put_bytes@plt>
mov    %rax,-0x1020(%rbp)
jmp    1a3e <ut2004_send_query+0x8ae>
mov    -0x1030(%rbp),%rdi
mov    -0x103c(%rbp),%edx
lea    0xbb6(%rip),%rsi
call   1040 <strncmp@plt>
cmp    $0x0,%rax
je     14a4 <ut2004_send_query+0x314>
mov    -0x1030(%rbp),%rdi
mov    -0x103c(%rbp),%edx
lea    0xb91(%rip),%rsi
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1558 <ut2004_send_query+0x3c8>
mov    -0x103d(%rbp),%al
add    $0x1,%al
mov    %al,-0x103d(%rbp)
mov    -0x1020(%rbp),%rdi
lea    0xb68(%rip),%rsi
lea    -0x1018(%rbp),%rdx
call   10b0 <put_string@plt>
mov    %rax,-0x1020(%rbp)
mov    -0x1030(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x6e,%eax
jne    150c <ut2004_send_query+0x37c>
mov    -0x1020(%rbp),%rdi
lea    0xb27(%rip),%rsi
lea    -0x1018(%rbp),%rdx
call   10b0 <put_string@plt>
mov    %rax,-0x1020(%rbp)
jmp    152d <ut2004_send_query+0x39d>
mov    -0x1020(%rbp),%rdi
lea    0xb07(%rip),%rsi
lea    -0x1018(%rbp),%rdx
call   10b0 <put_string@plt>
mov    %rax,-0x1020(%rbp)
mov    -0x1020(%rbp),%rdi
lea    0xb11(%rip),%rsi
mov    $0x1,%edx
lea    -0x1018(%rbp),%rcx
call   1030 <put_bytes@plt>
mov    %rax,-0x1020(%rbp)
jmp    1a39 <ut2004_send_query+0x8a9>
mov    -0x1030(%rbp),%rdi
mov    -0x103c(%rbp),%edx
lea    0xac5(%rip),%rsi
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    15f6 <ut2004_send_query+0x466>
mov    -0x103d(%rbp),%al
add    $0x1,%al
mov    %al,-0x103d(%rbp)
mov    -0x1020(%rbp),%rdi
lea    0xaa3(%rip),%rsi
lea    -0x1018(%rbp),%rdx
call   10b0 <put_string@plt>
mov    %rax,-0x1020(%rbp)
mov    -0x1020(%rbp),%rdi
lea    0xa91(%rip),%rsi
lea    -0x1018(%rbp),%rdx
call   10b0 <put_string@plt>
mov    %rax,-0x1020(%rbp)
mov    -0x1020(%rbp),%rdi
lea    0xa72(%rip),%rsi
mov    $0x1,%edx
lea    -0x1018(%rbp),%rcx
call   1030 <put_bytes@plt>
mov    %rax,-0x1020(%rbp)
jmp    1a34 <ut2004_send_query+0x8a4>
mov    -0x1030(%rbp),%rdi
mov    -0x103c(%rbp),%edx
lea    0xa43(%rip),%rsi
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1694 <ut2004_send_query+0x504>
mov    -0x103d(%rbp),%al
add    $0x1,%al
mov    %al,-0x103d(%rbp)
mov    -0x1020(%rbp),%rdi
lea    0xa20(%rip),%rsi
lea    -0x1018(%rbp),%rdx
call   10b0 <put_string@plt>
mov    %rax,-0x1020(%rbp)
mov    -0x1020(%rbp),%rdi
lea    0x9f3(%rip),%rsi
lea    -0x1018(%rbp),%rdx
call   10b0 <put_string@plt>
mov    %rax,-0x1020(%rbp)
mov    -0x1020(%rbp),%rdi
lea    0x9d4(%rip),%rsi
mov    $0x1,%edx
lea    -0x1018(%rbp),%rcx
call   1030 <put_bytes@plt>
mov    %rax,-0x1020(%rbp)
jmp    1a2f <ut2004_send_query+0x89f>
mov    -0x1030(%rbp),%rdi
mov    -0x103c(%rbp),%edx
lea    0x9b7(%rip),%rsi
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1732 <ut2004_send_query+0x5a2>
mov    -0x103d(%rbp),%al
add    $0x1,%al
mov    %al,-0x103d(%rbp)
mov    -0x1020(%rbp),%rdi
lea    0x98c(%rip),%rsi
lea    -0x1018(%rbp),%rdx
call   10b0 <put_string@plt>
mov    %rax,-0x1020(%rbp)
mov    -0x1020(%rbp),%rdi
lea    0x92d(%rip),%rsi
lea    -0x1018(%rbp),%rdx
call   10b0 <put_string@plt>
mov    %rax,-0x1020(%rbp)
mov    -0x1020(%rbp),%rdi
lea    0x937(%rip),%rsi
mov    $0x1,%edx
lea    -0x1018(%rbp),%rcx
call   1030 <put_bytes@plt>
mov    %rax,-0x1020(%rbp)
jmp    1a2a <ut2004_send_query+0x89a>
mov    -0x1030(%rbp),%rdi
mov    -0x103c(%rbp),%edx
lea    0x922(%rip),%rsi
call   1040 <strncmp@plt>
cmp    $0x0,%rax
je     1778 <ut2004_send_query+0x5e8>
mov    -0x1030(%rbp),%rdi
mov    -0x103c(%rbp),%edx
lea    0x8fd(%rip),%rsi
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    182c <ut2004_send_query+0x69c>
mov    -0x103d(%rbp),%al
add    $0x1,%al
mov    %al,-0x103d(%rbp)
mov    -0x1020(%rbp),%rdi
lea    0x8d4(%rip),%rsi
lea    -0x1018(%rbp),%rdx
call   10b0 <put_string@plt>
mov    %rax,-0x1020(%rbp)
mov    -0x1030(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x6e,%eax
jne    17e0 <ut2004_send_query+0x650>
mov    -0x1020(%rbp),%rdi
lea    0x853(%rip),%rsi
lea    -0x1018(%rbp),%rdx
call   10b0 <put_string@plt>
mov    %rax,-0x1020(%rbp)
jmp    1801 <ut2004_send_query+0x671>
mov    -0x1020(%rbp),%rdi
lea    0x833(%rip),%rsi
lea    -0x1018(%rbp),%rdx
call   10b0 <put_string@plt>
mov    %rax,-0x1020(%rbp)
mov    -0x1020(%rbp),%rdi
lea    0x83d(%rip),%rsi
mov    $0x1,%edx
lea    -0x1018(%rbp),%rcx
call   1030 <put_bytes@plt>
mov    %rax,-0x1020(%rbp)
jmp    1a25 <ut2004_send_query+0x895>
mov    -0x1030(%rbp),%rdi
mov    -0x103c(%rbp),%edx
lea    0x830(%rip),%rsi
call   1040 <strncmp@plt>
cmp    $0x0,%rax
je     1872 <ut2004_send_query+0x6e2>
mov    -0x1030(%rbp),%rdi
mov    -0x103c(%rbp),%edx
lea    0x80b(%rip),%rsi
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1926 <ut2004_send_query+0x796>
mov    -0x103d(%rbp),%al
add    $0x1,%al
mov    %al,-0x103d(%rbp)
mov    -0x1020(%rbp),%rdi
lea    0x7e2(%rip),%rsi
lea    -0x1018(%rbp),%rdx
call   10b0 <put_string@plt>
mov    %rax,-0x1020(%rbp)
mov    -0x1030(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x6e,%eax
jne    18da <ut2004_send_query+0x74a>
mov    -0x1020(%rbp),%rdi
lea    0x759(%rip),%rsi
lea    -0x1018(%rbp),%rdx
call   10b0 <put_string@plt>
mov    %rax,-0x1020(%rbp)
jmp    18fb <ut2004_send_query+0x76b>
mov    -0x1020(%rbp),%rdi
lea    0x739(%rip),%rsi
lea    -0x1018(%rbp),%rdx
call   10b0 <put_string@plt>
mov    %rax,-0x1020(%rbp)
mov    -0x1020(%rbp),%rdi
lea    0x743(%rip),%rsi
mov    $0x1,%edx
lea    -0x1018(%rbp),%rcx
call   1030 <put_bytes@plt>
mov    %rax,-0x1020(%rbp)
jmp    1a20 <ut2004_send_query+0x890>
mov    -0x1030(%rbp),%rdi
mov    -0x103c(%rbp),%edx
lea    0x743(%rip),%rsi
call   1040 <strncmp@plt>
cmp    $0x0,%rax
je     196c <ut2004_send_query+0x7dc>
mov    -0x1030(%rbp),%rdi
mov    -0x103c(%rbp),%edx
lea    0x71e(%rip),%rsi
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1a1b <ut2004_send_query+0x88b>
mov    -0x103d(%rbp),%al
add    $0x1,%al
mov    %al,-0x103d(%rbp)
mov    -0x1020(%rbp),%rdi
lea    0x6f5(%rip),%rsi
lea    -0x1018(%rbp),%rdx
call   10b0 <put_string@plt>
mov    %rax,-0x1020(%rbp)
mov    -0x1030(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x6e,%eax
jne    19d4 <ut2004_send_query+0x844>
mov    -0x1020(%rbp),%rdi
lea    0x65f(%rip),%rsi
lea    -0x1018(%rbp),%rdx
call   10b0 <put_string@plt>
mov    %rax,-0x1020(%rbp)
jmp    19f5 <ut2004_send_query+0x865>
mov    -0x1020(%rbp),%rdi
lea    0x63f(%rip),%rsi
lea    -0x1018(%rbp),%rdx
call   10b0 <put_string@plt>
mov    %rax,-0x1020(%rbp)
mov    -0x1020(%rbp),%rdi
lea    0x649(%rip),%rsi
mov    $0x1,%edx
lea    -0x1018(%rbp),%rcx
call   1030 <put_bytes@plt>
mov    %rax,-0x1020(%rbp)
jmp    1a20 <ut2004_send_query+0x890>
jmp    1a25 <ut2004_send_query+0x895>
jmp    1a2a <ut2004_send_query+0x89a>
jmp    1a2f <ut2004_send_query+0x89f>
jmp    1a34 <ut2004_send_query+0x8a4>
jmp    1a39 <ut2004_send_query+0x8a9>
jmp    1a3e <ut2004_send_query+0x8ae>
mov    -0x1038(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1030(%rbp)
jmp    12d6 <ut2004_send_query+0x146>
mov    -0x10(%rbp),%rdi
lea    0x626(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1080 <get_param_value@plt>
mov    %rax,-0x1028(%rbp)
mov    -0x1028(%rbp),%rax
mov    %rax,-0x1030(%rbp)
lea    0x5c7(%rip),%rax
mov    %rax,-0x1038(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x1028(%rbp)
mov    %al,-0x1041(%rbp)
je     1ab3 <ut2004_send_query+0x923>
cmpq   $0x0,-0x1038(%rbp)
setne  %al
mov    %al,-0x1041(%rbp)
mov    -0x1041(%rbp),%al
test   $0x1,%al
jne    1ac6 <ut2004_send_query+0x936>
jmp    1c5c <ut2004_send_query+0xacc>
movb   $0x0,-0x103e(%rbp)
mov    -0x1030(%rbp),%rdi
mov    $0x3a,%esi
call   1060 <strchr@plt>
mov    %rax,-0x1038(%rbp)
cmpq   $0x0,-0x1038(%rbp)
je     1b0f <ut2004_send_query+0x97f>
mov    -0x1038(%rbp),%rax
mov    -0x1030(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x103c(%rbp)
jmp    1b21 <ut2004_send_query+0x991>
mov    -0x1030(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x103c(%rbp)
mov    -0x1030(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1b5c <ut2004_send_query+0x9cc>
movb   $0x4,-0x103e(%rbp)
mov    -0x1030(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1030(%rbp)
mov    -0x103c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x103c(%rbp)
cmpl   $0x0,-0x103c(%rbp)
jne    1b6e <ut2004_send_query+0x9de>
jmp    1a8c <ut2004_send_query+0x8fc>
mov    -0x1020(%rbp),%rdi
lea    0x50a(%rip),%rsi
lea    -0x1018(%rbp),%rdx
call   10b0 <put_string@plt>
mov    %rax,-0x1020(%rbp)
mov    -0x103c(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x103f(%rbp)
mov    -0x1020(%rbp),%rdi
lea    -0x103f(%rbp),%rsi
mov    $0x1,%edx
lea    -0x1018(%rbp),%rcx
call   1030 <put_bytes@plt>
mov    %rax,-0x1020(%rbp)
mov    -0x1020(%rbp),%rdi
mov    -0x1030(%rbp),%rsi
mov    -0x103c(%rbp),%edx
lea    -0x1018(%rbp),%rcx
call   1030 <put_bytes@plt>
mov    %rax,-0x1020(%rbp)
mov    -0x1020(%rbp),%rdi
lea    0x453(%rip),%rsi
mov    $0x1,%edx
lea    -0x1018(%rbp),%rcx
call   1030 <put_bytes@plt>
mov    %rax,-0x1020(%rbp)
mov    -0x1020(%rbp),%rdi
lea    -0x103e(%rbp),%rsi
mov    $0x1,%edx
lea    -0x1018(%rbp),%rcx
call   1030 <put_bytes@plt>
mov    %rax,-0x1020(%rbp)
mov    -0x103d(%rbp),%al
add    $0x1,%al
mov    %al,-0x103d(%rbp)
mov    -0x1038(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1030(%rbp)
jmp    1a8c <ut2004_send_query+0x8fc>
cmpq   $0x0,-0x1020(%rbp)
jne    1c76 <ut2004_send_query+0xae6>
movl   $0x0,-0x4(%rbp)
jmp    1cd2 <ut2004_send_query+0xb42>
mov    -0x1020(%rbp),%rax
lea    -0x1010(%rbp),%rcx
sub    %rcx,%rax
sub    $0x4,%rax
mov    %eax,%edi
lea    -0x1010(%rbp),%rsi
call   10a0 <put_long_little@plt>
mov    -0x103d(%rbp),%al
mov    %al,-0x100b(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x1010(%rbp),%rsi
mov    $0x1000,%eax
sub    -0x1018(%rbp),%rax
mov    %eax,%edx
call   1090 <qserver_send@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1050,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1038,%rsp
mov    %rdi,%r15
lea    0x30(%rsp),%rdi
xor    %r14d,%r14d
mov    $0x1000,%edx
xor    %esi,%esi
call   1070 <memset@plt>
lea    0x36(%rsp),%rbx
movq   $0xffa,0x20(%rsp)
lea    0xe33(%rip),%rsi
mov    %r15,%rdi
xor    %edx,%edx
call   1080 <get_param_value@plt>
test   %rax,%rax
je     1221 <ut2004_send_query+0x91>
mov    %rax,%rbp
lea    0xe1a(%rip),%rsi
lea    0x20(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rdx
call   10b0 <put_string@plt>
mov    %rax,%rdi
mov    %rbp,%rsi
mov    %r14,%rdx
call   10b0 <put_string@plt>
lea    0xe41(%rip),%rsi
mov    %rax,%rdi
mov    $0x1,%edx
mov    %r14,%rcx
call   1030 <put_bytes@plt>
mov    %rax,%rbx
mov    $0x1,%r14b
lea    0xde1(%rip),%rsi
mov    %r15,%rdi
xor    %edx,%edx
call   1080 <get_param_value@plt>
test   %rax,%rax
mov    %r15,0x28(%rsp)
mov    %r14,0x10(%rsp)
je     1536 <ut2004_send_query+0x3a6>
mov    %rax,%r13
lea    0x20(%rsp),%r12
lea    0xe0b(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r13,%rdi
mov    $0x3a,%esi
call   1060 <strchr@plt>
mov    %rax,%r14
test   %rax,%rax
je     1280 <ut2004_send_query+0xf0>
mov    %r14d,%ebp
sub    %r13d,%ebp
jmp    128a <ut2004_send_query+0xfa>
nopl   (%rax)
mov    %r13,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebp
mov    %r13,%rdi
lea    0xd7e(%rip),%rsi
mov    %ebp,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     13f0 <ut2004_send_query+0x260>
mov    %r13,%rdi
lea    0xd62(%rip),%rsi
mov    %ebp,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     13f0 <ut2004_send_query+0x260>
mov    %r13,%rdi
lea    0xd60(%rip),%rsi
mov    %ebp,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1410 <ut2004_send_query+0x280>
mov    %r13,%rdi
lea    0xd44(%rip),%rsi
mov    %ebp,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1410 <ut2004_send_query+0x280>
mov    %r13,%rdi
lea    0xd35(%rip),%rsi
mov    %ebp,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     147c <ut2004_send_query+0x2ec>
mov    %r13,%rdi
lea    0xd37(%rip),%rsi
mov    %ebp,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1494 <ut2004_send_query+0x304>
mov    %r13,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     14eb <ut2004_send_query+0x35b>
mov    %r13,%rdi
lea    0xd22(%rip),%rsi
mov    %ebp,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     14d0 <ut2004_send_query+0x340>
mov    %r13,%rdi
lea    0xd06(%rip),%rsi
mov    %ebp,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     14d0 <ut2004_send_query+0x340>
mov    %r13,%rdi
lea    0xcf6(%rip),%rsi
mov    %ebp,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     151b <ut2004_send_query+0x38b>
mov    %r13,%rdi
lea    0xcda(%rip),%rsi
mov    %ebp,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     151b <ut2004_send_query+0x38b>
mov    %r13,%rdi
lea    0xccf(%rip),%rsi
mov    %ebp,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     13d4 <ut2004_send_query+0x244>
mov    %r13,%rdi
lea    0xcb7(%rip),%rsi
mov    %ebp,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
jne    146a <ut2004_send_query+0x2da>
mov    0x10(%rsp),%rax
add    $0x1,%al
mov    %rax,0x10(%rsp)
mov    %rbx,%rdi
lea    0xc93(%rip),%rsi
jmp    1426 <ut2004_send_query+0x296>
nopl   0x0(%rax)
mov    0x10(%rsp),%rax
add    $0x1,%al
mov    %rax,0x10(%rsp)
mov    %rbx,%rdi
lea    0xc0c(%rip),%rsi
jmp    1426 <ut2004_send_query+0x296>
nopl   0x0(%rax,%rax,1)
mov    0x10(%rsp),%rax
add    $0x1,%al
mov    %rax,0x10(%rsp)
mov    %rbx,%rdi
lea    0xc02(%rip),%rsi
mov    %r12,%rdx
call   10b0 <put_string@plt>
cmpb   $0x6e,0x0(%r13)
lea    0xbe7(%rip),%rsi
lea    0xbda(%rip),%rcx
cmove  %rcx,%rsi
mov    %rax,%rdi
mov    %r12,%rdx
call   10b0 <put_string@plt>
mov    %rax,%rdi
lea    0xbf2(%rip),%rsi
mov    $0x1,%edx
mov    %r12,%rcx
call   1030 <put_bytes@plt>
mov    %rax,%rbx
lea    0x1(%r14),%r13
test   %r14,%r14
jne    1260 <ut2004_send_query+0xd0>
jmp    1536 <ut2004_send_query+0x3a6>
mov    0x10(%rsp),%rax
add    $0x1,%al
mov    %rax,0x10(%rsp)
mov    %rbx,%rdi
lea    0xba8(%rip),%rsi
jmp    14aa <ut2004_send_query+0x31a>
mov    0x10(%rsp),%rax
add    $0x1,%al
mov    %rax,0x10(%rsp)
mov    %rbx,%rdi
lea    0xbab(%rip),%rsi
mov    %r12,%rdx
call   10b0 <put_string@plt>
mov    %rax,%rdi
lea    0xb8d(%rip),%rsi
mov    %r12,%rdx
call   10b0 <put_string@plt>
mov    %rax,%rdi
lea    0xb7d(%rip),%rsi
jmp    145a <ut2004_send_query+0x2ca>
mov    0x10(%rsp),%rax
add    $0x1,%al
mov    %rax,0x10(%rsp)
mov    %rbx,%rdi
lea    0xb82(%rip),%rsi
jmp    1426 <ut2004_send_query+0x296>
mov    0x10(%rsp),%rax
add    $0x1,%al
mov    %rax,0x10(%rsp)
mov    %rbx,%rdi
lea    0xb5e(%rip),%r15
mov    %r15,%rsi
mov    %r12,%rdx
call   10b0 <put_string@plt>
mov    %rax,%rdi
lea    0xb0b(%rip),%rsi
jmp    1448 <ut2004_send_query+0x2b8>
mov    0x10(%rsp),%rax
add    $0x1,%al
mov    %rax,0x10(%rsp)
mov    %rbx,%rdi
lea    0xb3f(%rip),%rsi
jmp    1426 <ut2004_send_query+0x296>
lea    0xb49(%rip),%rsi
mov    0x28(%rsp),%rdi
xor    %edx,%edx
call   1080 <get_param_value@plt>
test   %rax,%rax
je     165a <ut2004_send_query+0x4ca>
mov    %rax,%r15
lea    0x20(%rsp),%rbp
lea    0xf(%rsp),%r14
jmp    1579 <ut2004_send_query+0x3e9>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
test   %r13,%r13
je     165a <ut2004_send_query+0x4ca>
movb   $0x0,0xf(%rsp)
mov    %r15,%rdi
mov    $0x3a,%esi
call   1060 <strchr@plt>
mov    %rax,%r13
test   %rax,%rax
je     1640 <ut2004_send_query+0x4b0>
mov    %r13d,%r12d
sub    %r15d,%r12d
cmpb   $0x2d,(%r15)
jne    15b0 <ut2004_send_query+0x420>
movb   $0x4,0xf(%rsp)
add    $0x1,%r15
add    $0xffffffff,%r12d
test   %r12d,%r12d
je     1570 <ut2004_send_query+0x3e0>
mov    %rbx,%rdi
lea    0xac7(%rip),%rsi
mov    %rbp,%rdx
call   10b0 <put_string@plt>
lea    0x1(%r12),%ecx
mov    %cl,0x1f(%rsp)
mov    %rax,%rdi
lea    0x1f(%rsp),%rsi
mov    $0x1,%edx
mov    %rbp,%rcx
call   1030 <put_bytes@plt>
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r12d,%edx
mov    %rbp,%rcx
call   1030 <put_bytes@plt>
mov    %rax,%rdi
lea    0xa4c(%rip),%rsi
mov    $0x1,%edx
mov    %rbp,%rcx
call   1030 <put_bytes@plt>
mov    %rax,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    %rbp,%rcx
call   1030 <put_bytes@plt>
mov    %rax,%rbx
mov    0x10(%rsp),%rax
add    $0x1,%al
mov    %rax,0x10(%rsp)
lea    0x1(%r13),%r15
jmp    1570 <ut2004_send_query+0x3e0>
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1050 <strlen@plt>
mov    %eax,%r12d
cmpb   $0x2d,(%r15)
je     15a3 <ut2004_send_query+0x413>
jmp    15b0 <ut2004_send_query+0x420>
test   %rbx,%rbx
mov    $0x0,%ecx
je     169f <ut2004_send_query+0x50f>
lea    0x30(%rsp),%rbp
sub    %ebp,%ebx
add    $0xfffffffc,%ebx
mov    %ebx,%edi
mov    %rbp,%rsi
call   10a0 <put_long_little@plt>
mov    0x10(%rsp),%rax
mov    %al,0x35(%rsp)
mov    $0x1000,%edx
sub    0x20(%rsp),%edx
mov    0x28(%rsp),%rdi
mov    %rbp,%rsi
call   1090 <qserver_send@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
mov    %ecx,%eax
add    $0x1038,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.qserver = type { i32 }
@.str = [1 x i8] zeroinitializer
@.str.1 = [9 x i8] c"gametype\00"
@.str.2 = [7 x i8] c"status\00"
@.str.3 = [9 x i8] c"standard\00"
@.str.4 = [11 x i8] c"nostandard\00"
@.str.5 = [6 x i8] c"false\00"
@.str.6 = [5 x i8] c"true\00"
@.str.7 = [9 x i8] c"password\00"
@.str.8 = [11 x i8] c"nopassword\00"
@.str.9 = [9 x i8] c"notempty\00"
@.str.10 = [15 x i8] c"currentplayers\00"
@.str.11 = [2 x i8] c"0\00"
@.str.12 = [2 x i8] c"\04\00"
@.str.13 = [8 x i8] c"notfull\00"
@.str.14 = [10 x i8] c"freespace\00"
@.str.15 = [7 x i8] c"nobots\00"
@.str.16 = [6 x i8] c"stats\00"
@.str.17 = [8 x i8] c"nostats\00"
@.str.18 = [11 x i8] c"weaponstay\00"
@.str.19 = [13 x i8] c"noweaponstay\00"
@.str.20 = [9 x i8] c"transloc\00"
@.str.21 = [11 x i8] c"notransloc\00"
@.str.22 = [8 x i8] c"mutator\00"
define i32 @ut2004_send_query(%struct.qserver* %0) {
%2 = alloca i32
%3 = alloca %struct.qserver*
%4 = alloca [4096 x i8]
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i8
%12 = alloca i8
%13 = alloca i8
store %struct.qserver* %0, %struct.qserver** %3
%14 = bitcast [4096 x i8]* %4 to i8*
store i64 4096, i64* %5
%15 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
store i8* %15, i8** %6
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %9
store i32 0, i32* %10
store i8 0, i8* %11
%16 = load i8*, i8** %6
%17 = getelementptr inbounds i8, i8* %16, i64 6
store i8* %17, i8** %6
%18 = load i64, i64* %5
%19 = sub i64 %18, 6
store i64 %19, i64* %5
%20 = load %struct.qserver*, %struct.qserver** %3
%21 = call i8* @get_param_value(%struct.qserver* %20, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* null)
store i8* %21, i8** %7
%22 = load i8*, i8** %7
%23 = icmp ne i8* %22, null
br i1 %23, label %24, label %34
24: ; preds = %1
%25 = load i8, i8* %11
%26 = add i8 %25, 1
store i8 %26, i8* %11
%27 = load i8*, i8** %6
%28 = call i8* @put_string(i8* %27, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i64* %5)
store i8* %28, i8** %6
%29 = load i8*, i8** %6
%30 = load i8*, i8** %7
%31 = call i8* @put_string(i8* %29, i8* %30, i64* %5)
store i8* %31, i8** %6
%32 = load i8*, i8** %6
%33 = call i8* @put_bytes(i8* %32, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1, i64* %5)
store i8* %33, i8** %6
br label %34
34: ; preds = %24, %1
%35 = load %struct.qserver*, %struct.qserver** %3
%36 = call i8* @get_param_value(%struct.qserver* %35, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32* null)
store i8* %36, i8** %7
%37 = load i8*, i8** %7
store i8* %37, i8** %8
br label %38
38: ; preds = %250, %34
%39 = load i8*, i8** %7
%40 = icmp ne i8* %39, null
br i1 %40, label %41, label %44
41: ; preds = %38
%42 = load i8*, i8** %9
%43 = icmp ne i8* %42, null
br label %44
44: ; preds = %41, %38
%45 = phi i1 [ false, %38 ], [ %43, %41 ]
br i1 %45, label %46, label %253
46: ; preds = %44
%47 = load i8*, i8** %8
%48 = call i8* @strchr(i8* %47, i8 signext 58)
store i8* %48, i8** %9
%49 = load i8*, i8** %9
%50 = icmp ne i8* %49, null
br i1 %50, label %51, label %58
51: ; preds = %46
%52 = load i8*, i8** %9
%53 = load i8*, i8** %8
%54 = ptrtoint i8* %52 to i64
%55 = ptrtoint i8* %53 to i64
%56 = sub i64 %54, %55
%57 = trunc i64 %56 to i32
store i32 %57, i32* %10
br label %61
58: ; preds = %46
%59 = load i8*, i8** %8
%60 = call i32 @strlen(i8* %59)
store i32 %60, i32* %10
br label %61
61: ; preds = %58, %51
%62 = load i8*, i8** %8
%63 = load i32, i32* %10
%64 = call i64 @strncmp(i8* %62, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %63)
%65 = icmp eq i64 %64, 0
br i1 %65, label %71, label %66
66: ; preds = %61
%67 = load i8*, i8** %8
%68 = load i32, i32* %10
%69 = call i64 @strncmp(i8* %67, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %68)
%70 = icmp eq i64 %69, 0
br i1 %70, label %71, label %89
71: ; preds = %66, %61
%72 = load i8, i8* %11
%73 = add i8 %72, 1
store i8 %73, i8* %11
%74 = load i8*, i8** %6
%75 = call i8* @put_string(i8* %74, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i64* %5)
store i8* %75, i8** %6
%76 = load i8*, i8** %8
%77 = load i8, i8* %76
%78 = sext i8 %77 to i32
%79 = icmp eq i32 %78, 110
br i1 %79, label %80, label %83
80: ; preds = %71
%81 = load i8*, i8** %6
%82 = call i8* @put_string(i8* %81, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i64* %5)
store i8* %82, i8** %6
br label %86
83: ; preds = %71
%84 = load i8*, i8** %6
%85 = call i8* @put_string(i8* %84, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i64* %5)
store i8* %85, i8** %6
br label %86
86: ; preds = %83, %80
%87 = load i8*, i8** %6
%88 = call i8* @put_bytes(i8* %87, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1, i64* %5)
store i8* %88, i8** %6
br label %250
89: ; preds = %66
%90 = load i8*, i8** %8
%91 = load i32, i32* %10
%92 = call i64 @strncmp(i8* %90, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 %91)
%93 = icmp eq i64 %92, 0
br i1 %93, label %99, label %94
94: ; preds = %89
%95 = load i8*, i8** %8
%96 = load i32, i32* %10
%97 = call i64 @strncmp(i8* %95, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i32 %96)
%98 = icmp eq i64 %97, 0
br i1 %98, label %99, label %117
99: ; preds = %94, %89
%100 = load i8, i8* %11
%101 = add i8 %100, 1
store i8 %101, i8* %11
%102 = load i8*, i8** %6
%103 = call i8* @put_string(i8* %102, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i64* %5)
store i8* %103, i8** %6
%104 = load i8*, i8** %8
%105 = load i8, i8* %104
%106 = sext i8 %105 to i32
%107 = icmp eq i32 %106, 110
br i1 %107, label %108, label %111
108: ; preds = %99
%109 = load i8*, i8** %6
%110 = call i8* @put_string(i8* %109, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i64* %5)
store i8* %110, i8** %6
br label %114
111: ; preds = %99
%112 = load i8*, i8** %6
%113 = call i8* @put_string(i8* %112, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i64* %5)
store i8* %113, i8** %6
br label %114
114: ; preds = %111, %108
%115 = load i8*, i8** %6
%116 = call i8* @put_bytes(i8* %115, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1, i64* %5)
store i8* %116, i8** %6
br label %249
117: ; preds = %94
%118 = load i8*, i8** %8
%119 = load i32, i32* %10
%120 = call i64 @strncmp(i8* %118, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i32 %119)
%121 = icmp eq i64 %120, 0
br i1 %121, label %122, label %131
122: ; preds = %117
%123 = load i8, i8* %11
%124 = add i8 %123, 1
store i8 %124, i8* %11
%125 = load i8*, i8** %6
%126 = call i8* @put_string(i8* %125, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), i64* %5)
store i8* %126, i8** %6
%127 = load i8*, i8** %6
%128 = call i8* @put_string(i8* %127, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0), i64* %5)
store i8* %128, i8** %6
%129 = load i8*, i8** %6
%130 = call i8* @put_bytes(i8* %129, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0), i32 1, i64* %5)
store i8* %130, i8** %6
br label %248
131: ; preds = %117
%132 = load i8*, i8** %8
%133 = load i32, i32* %10
%134 = call i64 @strncmp(i8* %132, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0), i32 %133)
%135 = icmp eq i64 %134, 0
br i1 %135, label %136, label %145
136: ; preds = %131
%137 = load i8, i8* %11
%138 = add i8 %137, 1
store i8 %138, i8* %11
%139 = load i8*, i8** %6
%140 = call i8* @put_string(i8* %139, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), i64* %5)
store i8* %140, i8** %6
%141 = load i8*, i8** %6
%142 = call i8* @put_string(i8* %141, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0), i64* %5)
store i8* %142, i8** %6
%143 = load i8*, i8** %6
%144 = call i8* @put_bytes(i8* %143, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0), i32 1, i64* %5)
store i8* %144, i8** %6
br label %247
145: ; preds = %131
%146 = load i8*, i8** %8
%147 = load i32, i32* %10
%148 = call i64 @strncmp(i8* %146, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), i32 %147)
%149 = icmp eq i64 %148, 0
br i1 %149, label %150, label %159
150: ; preds = %145
%151 = load i8, i8* %11
%152 = add i8 %151, 1
store i8 %152, i8* %11
%153 = load i8*, i8** %6
%154 = call i8* @put_string(i8* %153, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), i64* %5)
store i8* %154, i8** %6
%155 = load i8*, i8** %6
%156 = call i8* @put_string(i8* %155, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i64* %5)
store i8* %156, i8** %6
%157 = load i8*, i8** %6
%158 = call i8* @put_bytes(i8* %157, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1, i64* %5)
store i8* %158, i8** %6
br label %246
159: ; preds = %145
%160 = load i8*, i8** %8
%161 = load i32, i32* %10
%162 = call i64 @strncmp(i8* %160, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i32 %161)
%163 = icmp eq i64 %162, 0
br i1 %163, label %169, label %164
164: ; preds = %159
%165 = load i8*, i8** %8
%166 = load i32, i32* %10
%167 = call i64 @strncmp(i8* %165, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0), i32 %166)
%168 = icmp eq i64 %167, 0
br i1 %168, label %169, label %187
169: ; preds = %164, %159
%170 = load i8, i8* %11
%171 = add i8 %170, 1
store i8 %171, i8* %11
%172 = load i8*, i8** %6
%173 = call i8* @put_string(i8* %172, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i64* %5)
store i8* %173, i8** %6
%174 = load i8*, i8** %8
%175 = load i8, i8* %174
%176 = sext i8 %175 to i32
%177 = icmp eq i32 %176, 110
br i1 %177, label %178, label %181
178: ; preds = %169
%179 = load i8*, i8** %6
%180 = call i8* @put_string(i8* %179, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i64* %5)
store i8* %180, i8** %6
br label %184
181: ; preds = %169
%182 = load i8*, i8** %6
%183 = call i8* @put_string(i8* %182, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i64* %5)
store i8* %183, i8** %6
br label %184
184: ; preds = %181, %178
%185 = load i8*, i8** %6
%186 = call i8* @put_bytes(i8* %185, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1, i64* %5)
store i8* %186, i8** %6
br label %245
187: ; preds = %164
%188 = load i8*, i8** %8
%189 = load i32, i32* %10
%190 = call i64 @strncmp(i8* %188, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.18, i64 0, i64 0), i32 %189)
%191 = icmp eq i64 %190, 0
br i1 %191, label %197, label %192
192: ; preds = %187
%193 = load i8*, i8** %8
%194 = load i32, i32* %10
%195 = call i64 @strncmp(i8* %193, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.19, i64 0, i64 0), i32 %194)
%196 = icmp eq i64 %195, 0
br i1 %196, label %197, label %215
197: ; preds = %192, %187
%198 = load i8, i8* %11
%199 = add i8 %198, 1
store i8 %199, i8* %11
%200 = load i8*, i8** %6
%201 = call i8* @put_string(i8* %200, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.18, i64 0, i64 0), i64* %5)
store i8* %201, i8** %6
%202 = load i8*, i8** %8
%203 = load i8, i8* %202
%204 = sext i8 %203 to i32
%205 = icmp eq i32 %204, 110
br i1 %205, label %206, label %209
206: ; preds = %197
%207 = load i8*, i8** %6
%208 = call i8* @put_string(i8* %207, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i64* %5)
store i8* %208, i8** %6
br label %212
209: ; preds = %197
%210 = load i8*, i8** %6
%211 = call i8* @put_string(i8* %210, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i64* %5)
store i8* %211, i8** %6
br label %212
212: ; preds = %209, %206
%213 = load i8*, i8** %6
%214 = call i8* @put_bytes(i8* %213, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1, i64* %5)
store i8* %214, i8** %6
br label %244
215: ; preds = %192
%216 = load i8*, i8** %8
%217 = load i32, i32* %10
%218 = call i64 @strncmp(i8* %216, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.20, i64 0, i64 0), i32 %217)
%219 = icmp eq i64 %218, 0
br i1 %219, label %225, label %220
220: ; preds = %215
%221 = load i8*, i8** %8
%222 = load i32, i32* %10
%223 = call i64 @strncmp(i8* %221, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.21, i64 0, i64 0), i32 %222)
%224 = icmp eq i64 %223, 0
br i1 %224, label %225, label %243
225: ; preds = %220, %215
%226 = load i8, i8* %11
%227 = add i8 %226, 1
store i8 %227, i8* %11
%228 = load i8*, i8** %6
%229 = call i8* @put_string(i8* %228, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.20, i64 0, i64 0), i64* %5)
store i8* %229, i8** %6
%230 = load i8*, i8** %8
%231 = load i8, i8* %230
%232 = sext i8 %231 to i32
%233 = icmp eq i32 %232, 110
br i1 %233, label %234, label %237
234: ; preds = %225
%235 = load i8*, i8** %6
%236 = call i8* @put_string(i8* %235, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i64* %5)
store i8* %236, i8** %6
br label %240
237: ; preds = %225
%238 = load i8*, i8** %6
%239 = call i8* @put_string(i8* %238, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i64* %5)
store i8* %239, i8** %6
br label %240
240: ; preds = %237, %234
%241 = load i8*, i8** %6
%242 = call i8* @put_bytes(i8* %241, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1, i64* %5)
store i8* %242, i8** %6
br label %243
243: ; preds = %240, %220
br label %244
244: ; preds = %243, %212
br label %245
245: ; preds = %244, %184
br label %246
246: ; preds = %245, %150
br label %247
247: ; preds = %246, %136
br label %248
248: ; preds = %247, %122
br label %249
249: ; preds = %248, %114
br label %250
250: ; preds = %249, %86
%251 = load i8*, i8** %9
%252 = getelementptr inbounds i8, i8* %251, i64 1
store i8* %252, i8** %8
br label %38
253: ; preds = %44
%254 = load %struct.qserver*, %struct.qserver** %3
%255 = call i8* @get_param_value(%struct.qserver* %254, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.22, i64 0, i64 0), i32* null)
store i8* %255, i8** %7
%256 = load i8*, i8** %7
store i8* %256, i8** %8
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %9
br label %257
257: ; preds = %294, %293, %253
%258 = load i8*, i8** %7
%259 = icmp ne i8* %258, null
br i1 %259, label %260, label %263
260: ; preds = %257
%261 = load i8*, i8** %9
%262 = icmp ne i8* %261, null
br label %263
263: ; preds = %260, %257
%264 = phi i1 [ false, %257 ], [ %262, %260 ]
br i1 %264, label %265, label %314
265: ; preds = %263
store i8 0, i8* %12
%266 = load i8*, i8** %8
%267 = call i8* @strchr(i8* %266, i8 signext 58)
store i8* %267, i8** %9
%268 = load i8*, i8** %9
%269 = icmp ne i8* %268, null
br i1 %269, label %270, label %277
270: ; preds = %265
%271 = load i8*, i8** %9
%272 = load i8*, i8** %8
%273 = ptrtoint i8* %271 to i64
%274 = ptrtoint i8* %272 to i64
%275 = sub i64 %273, %274
%276 = trunc i64 %275 to i32
store i32 %276, i32* %10
br label %280
277: ; preds = %265
%278 = load i8*, i8** %8
%279 = call i32 @strlen(i8* %278)
store i32 %279, i32* %10
br label %280
280: ; preds = %277, %270
%281 = load i8*, i8** %8
%282 = load i8, i8* %281
%283 = sext i8 %282 to i32
%284 = icmp eq i32 %283, 45
br i1 %284, label %285, label %290
285: ; preds = %280
store i8 4, i8* %12
%286 = load i8*, i8** %8
%287 = getelementptr inbounds i8, i8* %286, i32 1
store i8* %287, i8** %8
%288 = load i32, i32* %10
%289 = add i32 %288, -1
store i32 %289, i32* %10
br label %290
290: ; preds = %285, %280
%291 = load i32, i32* %10
%292 = icmp ne i32 %291, 0
br i1 %292, label %294, label %293
293: ; preds = %290
br label %257
294: ; preds = %290
%295 = load i8*, i8** %6
%296 = call i8* @put_string(i8* %295, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.22, i64 0, i64 0), i64* %5)
store i8* %296, i8** %6
%297 = load i32, i32* %10
%298 = add i32 %297, 1
%299 = trunc i32 %298 to i8
store i8 %299, i8* %13
%300 = load i8*, i8** %6
%301 = call i8* @put_bytes(i8* %300, i8* %13, i32 1, i64* %5)
store i8* %301, i8** %6
%302 = load i8*, i8** %6
%303 = load i8*, i8** %8
%304 = load i32, i32* %10
%305 = call i8* @put_bytes(i8* %302, i8* %303, i32 %304, i64* %5)
store i8* %305, i8** %6
%306 = load i8*, i8** %6
%307 = call i8* @put_bytes(i8* %306, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1, i64* %5)
store i8* %307, i8** %6
%308 = load i8*, i8** %6
%309 = call i8* @put_bytes(i8* %308, i8* %12, i32 1, i64* %5)
store i8* %309, i8** %6
%310 = load i8, i8* %11
%311 = add i8 %310, 1
store i8 %311, i8* %11
%312 = load i8*, i8** %9
%313 = getelementptr inbounds i8, i8* %312, i64 1
store i8* %313, i8** %8
br label %257
314: ; preds = %263
%315 = load i8*, i8** %6
%316 = icmp ne i8* %315, null
br i1 %316, label %318, label %317
317: ; preds = %314
store i32 0, i32* %2
br label %338
318: ; preds = %314
%319 = load i8*, i8** %6
%320 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%321 = ptrtoint i8* %319 to i64
%322 = ptrtoint i8* %320 to i64
%323 = sub i64 %321, %322
%324 = sub nsw i64 %323, 4
%325 = trunc i64 %324 to i32
%326 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%327 = call i32 @put_long_little(i32 %325, i8* %326)
%328 = load i8, i8* %11
%329 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 5
store i8 %328, i8* %329
%330 = load %struct.qserver*, %struct.qserver** %3
%331 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%332 = load i64, i64* %5
%333 = sub i64 4096, %332
%334 = trunc i64 %333 to i32
%335 = call i64 @qserver_send(%struct.qserver* %330, i8* %331, i32 %334)
%336 = icmp sgt i64 %335, 0
%337 = zext i1 %336 to i32
store i32 %337, i32* %2
br label %338
338: ; preds = %318, %317
%339 = load i32, i32* %2
ret i32 %339
}

LLVM IR (-O2):
%struct.qserver = type { i32 }
@.str = [1 x i8] zeroinitializer
@.str.1 = [9 x i8] c"gametype\00"
@.str.2 = [7 x i8] c"status\00"
@.str.3 = [9 x i8] c"standard\00"
@.str.4 = [11 x i8] c"nostandard\00"
@.str.5 = [6 x i8] c"false\00"
@.str.6 = [5 x i8] c"true\00"
@.str.7 = [9 x i8] c"password\00"
@.str.8 = [11 x i8] c"nopassword\00"
@.str.9 = [9 x i8] c"notempty\00"
@.str.10 = [15 x i8] c"currentplayers\00"
@.str.11 = [2 x i8] c"0\00"
@.str.12 = [2 x i8] c"\04\00"
@.str.13 = [8 x i8] c"notfull\00"
@.str.14 = [10 x i8] c"freespace\00"
@.str.15 = [7 x i8] c"nobots\00"
@.str.16 = [6 x i8] c"stats\00"
@.str.17 = [8 x i8] c"nostats\00"
@.str.18 = [11 x i8] c"weaponstay\00"
@.str.19 = [13 x i8] c"noweaponstay\00"
@.str.20 = [9 x i8] c"transloc\00"
@.str.21 = [11 x i8] c"notransloc\00"
@.str.22 = [8 x i8] c"mutator\00"
define i32 @ut2004_send_query(%struct.qserver* %0) {
%2 = alloca [4096 x i8]
%3 = alloca i64
%4 = alloca i8
%5 = alloca i8
%6 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%7 = bitcast i64* %3 to i8*
%8 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 6
store i64 4090, i64* %3
%9 = tail call i8* @get_param_value(%struct.qserver* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* null)
%10 = icmp eq i8* %9, null
br i1 %10, label %15, label %11
11: ; preds = %1
%12 = call i8* @put_string(i8* %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i64* %3)
%13 = call i8* @put_string(i8* %12, i8* %9, i64* %3)
%14 = call i8* @put_bytes(i8* %13, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1, i64* %3)
br label %15
15: ; preds = %11, %1
%16 = phi i8* [ %14, %11 ], [ %8, %1 ]
%17 = phi i8 [ 1, %11 ], [ 0, %1 ]
%18 = call i8* @get_param_value(%struct.qserver* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32* null)
%19 = icmp eq i8* %18, null
br i1 %19, label %133, label %20
20: ; preds = %15, %128
%21 = phi i8 [ %130, %128 ], [ %17, %15 ]
%22 = phi i8* [ %131, %128 ], [ %18, %15 ]
%23 = phi i8* [ %129, %128 ], [ %16, %15 ]
%24 = call i8* @strchr(i8* dereferenceable(1) %22, i8 signext 58)
%25 = icmp eq i8* %24, null
br i1 %25, label %31, label %26
26: ; preds = %20
%27 = ptrtoint i8* %24 to i64
%28 = ptrtoint i8* %22 to i64
%29 = sub i64 %27, %28
%30 = trunc i64 %29 to i32
br label %33
31: ; preds = %20
%32 = call i32 @strlen(i8* %22)
br label %33
33: ; preds = %31, %26
%34 = phi i32 [ %30, %26 ], [ %32, %31 ]
%35 = call i64 @strncmp(i8* %22, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %34)
%36 = icmp eq i64 %35, 0
br i1 %36, label %40, label %37
37: ; preds = %33
%38 = call i64 @strncmp(i8* %22, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %34)
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %48
40: ; preds = %37, %33
%41 = add i8 %21, 1
%42 = call i8* @put_string(i8* %23, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i64* %3)
%43 = load i8, i8* %22
%44 = icmp eq i8 %43, 110
%45 = select i1 %44, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0)
%46 = call i8* @put_string(i8* %42, i8* %45, i64* %3)
%47 = call i8* @put_bytes(i8* %46, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1, i64* %3)
br label %128
48: ; preds = %37
%49 = call i64 @strncmp(i8* %22, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 %34)
%50 = icmp eq i64 %49, 0
br i1 %50, label %54, label %51
51: ; preds = %48
%52 = call i64 @strncmp(i8* %22, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i32 %34)
%53 = icmp eq i64 %52, 0
br i1 %53, label %54, label %62
54: ; preds = %51, %48
%55 = add i8 %21, 1
%56 = call i8* @put_string(i8* %23, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i64* %3)
%57 = load i8, i8* %22
%58 = icmp eq i8 %57, 110
%59 = select i1 %58, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0)
%60 = call i8* @put_string(i8* %56, i8* %59, i64* %3)
%61 = call i8* @put_bytes(i8* %60, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1, i64* %3)
br label %128
62: ; preds = %51
%63 = call i64 @strncmp(i8* %22, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i32 %34)
%64 = icmp eq i64 %63, 0
br i1 %64, label %65, label %70
65: ; preds = %62
%66 = add i8 %21, 1
%67 = call i8* @put_string(i8* %23, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), i64* %3)
%68 = call i8* @put_string(i8* %67, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0), i64* %3)
%69 = call i8* @put_bytes(i8* %68, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0), i32 1, i64* %3)
br label %128
70: ; preds = %62
%71 = call i64 @strncmp(i8* %22, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0), i32 %34)
%72 = icmp eq i64 %71, 0
br i1 %72, label %73, label %78
73: ; preds = %70
%74 = add i8 %21, 1
%75 = call i8* @put_string(i8* %23, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), i64* %3)
%76 = call i8* @put_string(i8* %75, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0), i64* %3)
%77 = call i8* @put_bytes(i8* %76, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0), i32 1, i64* %3)
br label %128
78: ; preds = %70
%79 = call i64 @strncmp(i8* %22, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), i32 %34)
%80 = icmp eq i64 %79, 0
br i1 %80, label %81, label %86
81: ; preds = %78
%82 = add i8 %21, 1
%83 = call i8* @put_string(i8* %23, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), i64* %3)
%84 = call i8* @put_string(i8* %83, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i64* %3)
%85 = call i8* @put_bytes(i8* %84, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1, i64* %3)
br label %128
86: ; preds = %78
%87 = call i64 @strncmp(i8* %22, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i32 %34)
%88 = icmp eq i64 %87, 0
br i1 %88, label %92, label %89
89: ; preds = %86
%90 = call i64 @strncmp(i8* %22, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0), i32 %34)
%91 = icmp eq i64 %90, 0
br i1 %91, label %92, label %100
92: ; preds = %89, %86
%93 = add i8 %21, 1
%94 = call i8* @put_string(i8* %23, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i64* %3)
%95 = load i8, i8* %22
%96 = icmp eq i8 %95, 110
%97 = select i1 %96, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0)
%98 = call i8* @put_string(i8* %94, i8* %97, i64* %3)
%99 = call i8* @put_bytes(i8* %98, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1, i64* %3)
br label %128
100: ; preds = %89
%101 = call i64 @strncmp(i8* %22, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.18, i64 0, i64 0), i32 %34)
%102 = icmp eq i64 %101, 0
br i1 %102, label %106, label %103
103: ; preds = %100
%104 = call i64 @strncmp(i8* %22, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.19, i64 0, i64 0), i32 %34)
%105 = icmp eq i64 %104, 0
br i1 %105, label %106, label %114
106: ; preds = %103, %100
%107 = add i8 %21, 1
%108 = call i8* @put_string(i8* %23, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.18, i64 0, i64 0), i64* %3)
%109 = load i8, i8* %22
%110 = icmp eq i8 %109, 110
%111 = select i1 %110, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0)
%112 = call i8* @put_string(i8* %108, i8* %111, i64* %3)
%113 = call i8* @put_bytes(i8* %112, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1, i64* %3)
br label %128
114: ; preds = %103
%115 = call i64 @strncmp(i8* %22, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.20, i64 0, i64 0), i32 %34)
%116 = icmp eq i64 %115, 0
br i1 %116, label %120, label %117
117: ; preds = %114
%118 = call i64 @strncmp(i8* %22, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.21, i64 0, i64 0), i32 %34)
%119 = icmp eq i64 %118, 0
br i1 %119, label %120, label %128
120: ; preds = %117, %114
%121 = add i8 %21, 1
%122 = call i8* @put_string(i8* %23, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.20, i64 0, i64 0), i64* %3)
%123 = load i8, i8* %22
%124 = icmp eq i8 %123, 110
%125 = select i1 %124, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0)
%126 = call i8* @put_string(i8* %122, i8* %125, i64* %3)
%127 = call i8* @put_bytes(i8* %126, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1, i64* %3)
br label %128
128: ; preds = %54, %73, %92, %117, %120, %106, %81, %65, %40
%129 = phi i8* [ %47, %40 ], [ %61, %54 ], [ %69, %65 ], [ %77, %73 ], [ %85, %81 ], [ %99, %92 ], [ %113, %106 ], [ %127, %120 ], [ %23, %117 ]
%130 = phi i8 [ %41, %40 ], [ %55, %54 ], [ %66, %65 ], [ %74, %73 ], [ %82, %81 ], [ %93, %92 ], [ %107, %106 ], [ %121, %120 ], [ %21, %117 ]
%131 = getelementptr inbounds i8, i8* %24, i64 1
%132 = icmp eq i8* %24, null
br i1 %132, label %133, label %20
133: ; preds = %128, %15
%134 = phi i8* [ %16, %15 ], [ %129, %128 ]
%135 = phi i8 [ %17, %15 ], [ %130, %128 ]
%136 = call i8* @get_param_value(%struct.qserver* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.22, i64 0, i64 0), i32* null)
%137 = icmp eq i8* %136, null
br i1 %137, label %177, label %138
138: ; preds = %133, %172
%139 = phi i8 [ %175, %172 ], [ %135, %133 ]
%140 = phi i8* [ %174, %172 ], [ %136, %133 ]
%141 = phi i8* [ %173, %172 ], [ %134, %133 ]
store i8 0, i8* %4
%142 = call i8* @strchr(i8* dereferenceable(1) %140, i8 signext 58)
%143 = icmp eq i8* %142, null
br i1 %143, label %149, label %144
144: ; preds = %138
%145 = ptrtoint i8* %142 to i64
%146 = ptrtoint i8* %140 to i64
%147 = sub i64 %145, %146
%148 = trunc i64 %147 to i32
br label %151
149: ; preds = %138
%150 = call i32 @strlen(i8* %140)
br label %151
151: ; preds = %149, %144
%152 = phi i32 [ %148, %144 ], [ %150, %149 ]
%153 = load i8, i8* %140
%154 = icmp eq i8 %153, 45
br i1 %154, label %155, label %158
155: ; preds = %151
store i8 4, i8* %4
%156 = getelementptr inbounds i8, i8* %140, i64 1
%157 = add i32 %152, -1
br label %158
158: ; preds = %155, %151
%159 = phi i8* [ %156, %155 ], [ %140, %151 ]
%160 = phi i32 [ %157, %155 ], [ %152, %151 ]
%161 = icmp eq i32 %160, 0
br i1 %161, label %172, label %162
162: ; preds = %158
%163 = call i8* @put_string(i8* %141, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.22, i64 0, i64 0), i64* %3)
%164 = trunc i32 %160 to i8
%165 = add i8 %164, 1
store i8 %165, i8* %5
%166 = call i8* @put_bytes(i8* %163, i8* %5, i32 1, i64* %3)
%167 = call i8* @put_bytes(i8* %166, i8* %159, i32 %160, i64* %3)
%168 = call i8* @put_bytes(i8* %167, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1, i64* %3)
%169 = call i8* @put_bytes(i8* %168, i8* %4, i32 1, i64* %3)
%170 = add i8 %139, 1
%171 = getelementptr inbounds i8, i8* %142, i64 1
br label %172
172: ; preds = %158, %162
%173 = phi i8* [ %169, %162 ], [ %141, %158 ]
%174 = phi i8* [ %171, %162 ], [ %159, %158 ]
%175 = phi i8 [ %170, %162 ], [ %139, %158 ]
%176 = icmp eq i8* %142, null
br i1 %176, label %177, label %138
177: ; preds = %172, %133
%178 = phi i8* [ %134, %133 ], [ %173, %172 ]
%179 = phi i8 [ %135, %133 ], [ %175, %172 ]
%180 = icmp eq i8* %178, null
br i1 %180, label %195, label %181
181: ; preds = %177
%182 = ptrtoint i8* %178 to i64
%183 = ptrtoint [4096 x i8]* %2 to i64
%184 = sub i64 %182, %183
%185 = trunc i64 %184 to i32
%186 = add i32 %185, -4
%187 = call i32 @put_long_little(i32 %186, i8* %6)
%188 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 5
store i8 %179, i8* %188
%189 = load i64, i64* %3
%190 = trunc i64 %189 to i32
%191 = sub i32 4096, %190
%192 = call i64 @qserver_send(%struct.qserver* %0, i8* %6, i32 %191)
%193 = icmp sgt i64 %192, 0
%194 = zext i1 %193 to i32
br label %195
195: ; preds = %177, %181
%196 = phi i32 [ %194, %181 ], [ 0, %177 ]
ret i32 %196
}