#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 */

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ log_add(int, int /*<<< orphan*/ *, int, char *, ...);
int /*<<< orphan*/ server_connect(int, char *);
int /*<<< orphan*/ server_ctcp(int, char *);
int /*<<< orphan*/ server_ctcpr(int, char *);
int /*<<< orphan*/ server_dcc(int, char *);
int /*<<< orphan*/ server_hello(int, char *);
int /*<<< orphan*/ server_invite(int, char *);
int /*<<< orphan*/ server_join(int, char *);
int /*<<< orphan*/ server_msg(int, char *);
int /*<<< orphan*/ server_nick(int, char *);
int /*<<< orphan*/ server_note(int, char *);
int /*<<< orphan*/ server_notice(int, char *);
int /*<<< orphan*/ server_part(int, char *);
int /*<<< orphan*/ server_quit(int, char *);
int /*<<< orphan*/ server_send(int, char *);
int /*<<< orphan*/ server_snotice(int, char *);
int /*<<< orphan*/ server_topic(int, char *);
int /*<<< orphan*/ server_update(int, char *);
scalar_t__ strcmp(char *, char *);
char *strtok(char *, char *);
int parse_server_input(char *msg) {
  char *id, *cmd, *param;
  int cid;
  id = strtok(msg, " ");
  cmd = strtok(NULL, " ");
  if (id == NULL) {
    log_add(-1, NULL, 0x00000004, "Garbage server input: no child id");
    return -1;
  }
  if (cmd == NULL) {
    log_add(-1, NULL, 0x00000004, "Garbage server input: no command");
    return -1;
  }
  param = strtok(NULL, "");
  cid = atoi(id);
  if (strcmp(cmd, "HELLO") == 0)
    server_hello(cid, param);
  else if (strcmp(cmd, "MSG") == 0)
    server_msg(cid, param);
  else if (strcmp(cmd, "CTCP") == 0)
    server_ctcp(cid, param);
  else if (strcmp(cmd, "NOTICE") == 0)
    server_notice(cid, param);
  else if (strcmp(cmd, "SNOTICE") == 0)
    server_snotice(cid, param);
  else if (strcmp(cmd, "CTCPR") == 0)
    server_ctcpr(cid, param);
  else if (strcmp(cmd, "JOIN") == 0)
    server_join(cid, param);
  else if (strcmp(cmd, "PART") == 0)
    server_part(cid, param);
  else if (strcmp(cmd, "NICK") == 0)
    server_nick(cid, param);
  else if (strcmp(cmd, "QUIT") == 0)
    server_quit(cid, param);
  else if (strcmp(cmd, "CONNECT") == 0)
    server_connect(cid, param);
  else if (strcmp(cmd, "UPDATE") == 0)
    server_update(cid, param);
  else if (strcmp(cmd, "SEND") == 0)
    server_send(cid, param);
  else if (strcmp(cmd, "TOPIC") == 0)
    server_topic(cid, param);
  else if (strcmp(cmd, "NOTE") == 0)
    server_note(cid, param);
  else if (strcmp(cmd, "DCC") == 0)
    server_dcc(cid, param);
  else if (strcmp(cmd, "INVITE") == 0)
    server_invite(cid, param);
  else {
    log_add(-1, NULL, 0x00000004, "Garbage server input: unknown command `%s'.",
            cmd);
  }
  return 0;
}


x86 assembly (clang, -O0):
<parse_server_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xd99(%rip),%rsi
call   1110 <strtok@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xd85(%rip),%rsi
call   1110 <strtok@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    12b7 <parse_server_input+0x67>
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x4,%edx
lea    0xd5e(%rip),%rcx
mov    $0x0,%al
call   10f0 <log_add@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    165c <parse_server_input+0x40c>
cmpq   $0x0,-0x20(%rbp)
jne    12ea <parse_server_input+0x9a>
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x4,%edx
lea    0xd4d(%rip),%rcx
mov    $0x0,%al
call   10f0 <log_add@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    165c <parse_server_input+0x40c>
xor    %eax,%eax
mov    %eax,%edi
lea    0xd0c(%rip),%rsi
call   1110 <strtok@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1130 <atoi@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xd30(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1335 <parse_server_input+0xe5>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   1050 <server_hello@plt>
jmp    1655 <parse_server_input+0x405>
mov    -0x20(%rbp),%rdi
lea    0xd0b(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1360 <parse_server_input+0x110>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   10b0 <server_msg@plt>
jmp    1650 <parse_server_input+0x400>
mov    -0x20(%rbp),%rdi
lea    0xce4(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    138b <parse_server_input+0x13b>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   1080 <server_ctcp@plt>
jmp    164b <parse_server_input+0x3fb>
mov    -0x20(%rbp),%rdi
lea    0xcbf(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    13b6 <parse_server_input+0x166>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   1040 <server_notice@plt>
jmp    1646 <parse_server_input+0x3f6>
mov    -0x20(%rbp),%rdi
lea    0xc93(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    13e1 <parse_server_input+0x191>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   10e0 <server_snotice@plt>
jmp    1641 <parse_server_input+0x3f1>
mov    -0x20(%rbp),%rdi
lea    0xc70(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    140c <parse_server_input+0x1bc>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   1060 <server_ctcpr@plt>
jmp    163c <parse_server_input+0x3ec>
mov    -0x20(%rbp),%rdi
lea    0xc4b(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1437 <parse_server_input+0x1e7>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   1140 <server_join@plt>
jmp    1637 <parse_server_input+0x3e7>
mov    -0x20(%rbp),%rdi
lea    0xc25(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1462 <parse_server_input+0x212>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   1120 <server_part@plt>
jmp    1632 <parse_server_input+0x3e2>
mov    -0x20(%rbp),%rdi
lea    0xbff(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    148d <parse_server_input+0x23d>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   1090 <server_nick@plt>
jmp    162d <parse_server_input+0x3dd>
mov    -0x20(%rbp),%rdi
lea    0xbd9(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    14b8 <parse_server_input+0x268>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   1170 <server_quit@plt>
jmp    1628 <parse_server_input+0x3d8>
mov    -0x20(%rbp),%rdi
lea    0xbb3(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    14e3 <parse_server_input+0x293>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   1100 <server_connect@plt>
jmp    1623 <parse_server_input+0x3d3>
mov    -0x20(%rbp),%rdi
lea    0xb90(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    150e <parse_server_input+0x2be>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   10a0 <server_update@plt>
jmp    161e <parse_server_input+0x3ce>
mov    -0x20(%rbp),%rdi
lea    0xb6c(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1539 <parse_server_input+0x2e9>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   1150 <server_send@plt>
jmp    1619 <parse_server_input+0x3c9>
mov    -0x20(%rbp),%rdi
lea    0xb46(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1564 <parse_server_input+0x314>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   1160 <server_topic@plt>
jmp    1614 <parse_server_input+0x3c4>
mov    -0x20(%rbp),%rdi
lea    0xb21(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    158f <parse_server_input+0x33f>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   1030 <server_note@plt>
jmp    160f <parse_server_input+0x3bf>
mov    -0x20(%rbp),%rdi
lea    0xafb(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    15ba <parse_server_input+0x36a>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   10d0 <server_dcc@plt>
jmp    160a <parse_server_input+0x3ba>
mov    -0x20(%rbp),%rdi
lea    0xad4(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    15e5 <parse_server_input+0x395>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   10c0 <server_invite@plt>
jmp    1605 <parse_server_input+0x3b5>
mov    -0x20(%rbp),%r8
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x4,%edx
lea    0xaa2(%rip),%rcx
mov    $0x0,%al
call   10f0 <log_add@plt>
jmp    160a <parse_server_input+0x3ba>
jmp    160f <parse_server_input+0x3bf>
jmp    1614 <parse_server_input+0x3c4>
jmp    1619 <parse_server_input+0x3c9>
jmp    161e <parse_server_input+0x3ce>
jmp    1623 <parse_server_input+0x3d3>
jmp    1628 <parse_server_input+0x3d8>
jmp    162d <parse_server_input+0x3dd>
jmp    1632 <parse_server_input+0x3e2>
jmp    1637 <parse_server_input+0x3e7>
jmp    163c <parse_server_input+0x3ec>
jmp    1641 <parse_server_input+0x3f1>
jmp    1646 <parse_server_input+0x3f6>
jmp    164b <parse_server_input+0x3fb>
jmp    1650 <parse_server_input+0x400>
jmp    1655 <parse_server_input+0x405>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_server_input>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
lea    0xda1(%rip),%rbp
mov    %rbp,%rsi
call   1110 <strtok@plt>
mov    %rax,%rbx
xor    %edi,%edi
mov    %rbp,%rsi
call   1110 <strtok@plt>
test   %rbx,%rbx
je     1460 <parse_server_input+0x210>
mov    %rax,%r12
test   %rax,%rax
je     1469 <parse_server_input+0x219>
lea    0xd71(%rip),%rsi
xor    %ebp,%ebp
xor    %edi,%edi
call   1110 <strtok@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1130 <atoi@plt>
mov    %eax,%r15d
lea    0xd97(%rip),%rsi
mov    %r12,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1493 <parse_server_input+0x243>
lea    0xd85(%rip),%rsi
mov    %r12,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     14a0 <parse_server_input+0x250>
lea    0xd71(%rip),%rsi
mov    %r12,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     14af <parse_server_input+0x25f>
lea    0xd5f(%rip),%rsi
mov    %r12,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     14be <parse_server_input+0x26e>
lea    0xd46(%rip),%rsi
mov    %r12,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     14cd <parse_server_input+0x27d>
lea    0xd36(%rip),%rsi
mov    %r12,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     14dc <parse_server_input+0x28c>
lea    0xd24(%rip),%rsi
mov    %r12,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     14eb <parse_server_input+0x29b>
lea    0xd11(%rip),%rsi
mov    %r12,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     14fa <parse_server_input+0x2aa>
lea    0xcfe(%rip),%rsi
mov    %r12,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     150c <parse_server_input+0x2bc>
lea    0xceb(%rip),%rsi
mov    %r12,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     151e <parse_server_input+0x2ce>
lea    0xcd8(%rip),%rsi
mov    %r12,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1530 <parse_server_input+0x2e0>
lea    0xcc8(%rip),%rsi
mov    %r12,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1542 <parse_server_input+0x2f2>
lea    0xcb7(%rip),%rsi
mov    %r12,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1554 <parse_server_input+0x304>
lea    0xca4(%rip),%rsi
mov    %r12,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1566 <parse_server_input+0x316>
lea    0xc92(%rip),%rsi
mov    %r12,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1578 <parse_server_input+0x328>
lea    0xc7f(%rip),%rsi
mov    %r12,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     158a <parse_server_input+0x33a>
lea    0xc6b(%rip),%rsi
mov    %r12,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     159c <parse_server_input+0x34c>
lea    0xc5a(%rip),%rcx
xor    %ebp,%ebp
mov    $0xffffffff,%edi
xor    %esi,%esi
mov    $0x4,%edx
mov    %r12,%r8
xor    %eax,%eax
call   10f0 <log_add@plt>
jmp    1488 <parse_server_input+0x238>
lea    0xb9b(%rip),%rcx
jmp    1470 <parse_server_input+0x220>
lea    0xbb4(%rip),%rcx
mov    $0xffffffff,%ebp
mov    $0xffffffff,%edi
xor    %esi,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   10f0 <log_add@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r15d,%edi
mov    %r14,%rsi
call   1050 <server_hello@plt>
jmp    1488 <parse_server_input+0x238>
mov    %r15d,%edi
mov    %r14,%rsi
call   10b0 <server_msg@plt>
xor    %ebp,%ebp
jmp    1488 <parse_server_input+0x238>
mov    %r15d,%edi
mov    %r14,%rsi
call   1080 <server_ctcp@plt>
xor    %ebp,%ebp
jmp    1488 <parse_server_input+0x238>
mov    %r15d,%edi
mov    %r14,%rsi
call   1040 <server_notice@plt>
xor    %ebp,%ebp
jmp    1488 <parse_server_input+0x238>
mov    %r15d,%edi
mov    %r14,%rsi
call   10e0 <server_snotice@plt>
xor    %ebp,%ebp
jmp    1488 <parse_server_input+0x238>
mov    %r15d,%edi
mov    %r14,%rsi
call   1060 <server_ctcpr@plt>
xor    %ebp,%ebp
jmp    1488 <parse_server_input+0x238>
mov    %r15d,%edi
mov    %r14,%rsi
call   1140 <server_join@plt>
xor    %ebp,%ebp
jmp    1488 <parse_server_input+0x238>
mov    %r15d,%edi
mov    %r14,%rsi
call   1120 <server_part@plt>
xor    %ebp,%ebp
jmp    1488 <parse_server_input+0x238>
mov    %r15d,%edi
mov    %r14,%rsi
call   1090 <server_nick@plt>
xor    %ebp,%ebp
jmp    1488 <parse_server_input+0x238>
mov    %r15d,%edi
mov    %r14,%rsi
call   1170 <server_quit@plt>
xor    %ebp,%ebp
jmp    1488 <parse_server_input+0x238>
mov    %r15d,%edi
mov    %r14,%rsi
call   1100 <server_connect@plt>
xor    %ebp,%ebp
jmp    1488 <parse_server_input+0x238>
mov    %r15d,%edi
mov    %r14,%rsi
call   10a0 <server_update@plt>
xor    %ebp,%ebp
jmp    1488 <parse_server_input+0x238>
mov    %r15d,%edi
mov    %r14,%rsi
call   1150 <server_send@plt>
xor    %ebp,%ebp
jmp    1488 <parse_server_input+0x238>
mov    %r15d,%edi
mov    %r14,%rsi
call   1160 <server_topic@plt>
xor    %ebp,%ebp
jmp    1488 <parse_server_input+0x238>
mov    %r15d,%edi
mov    %r14,%rsi
call   1030 <server_note@plt>
xor    %ebp,%ebp
jmp    1488 <parse_server_input+0x238>
mov    %r15d,%edi
mov    %r14,%rsi
call   10d0 <server_dcc@plt>
xor    %ebp,%ebp
jmp    1488 <parse_server_input+0x238>
mov    %r15d,%edi
mov    %r14,%rsi
call   10c0 <server_invite@plt>
xor    %ebp,%ebp
jmp    1488 <parse_server_input+0x238>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [34 x i8] c"Garbage server input: no child id\00"
@.str.2 = [33 x i8] c"Garbage server input: no command\00"
@.str.3 = [1 x i8] zeroinitializer
@.str.4 = [6 x i8] c"HELLO\00"
@.str.5 = [4 x i8] c"MSG\00"
@.str.6 = [5 x i8] c"CTCP\00"
@.str.7 = [7 x i8] c"NOTICE\00"
@.str.8 = [8 x i8] c"SNOTICE\00"
@.str.9 = [6 x i8] c"CTCPR\00"
@.str.10 = [5 x i8] c"JOIN\00"
@.str.11 = [5 x i8] c"PART\00"
@.str.12 = [5 x i8] c"NICK\00"
@.str.13 = [5 x i8] c"QUIT\00"
@.str.14 = [8 x i8] c"CONNECT\00"
@.str.15 = [7 x i8] c"UPDATE\00"
@.str.16 = [5 x i8] c"SEND\00"
@.str.17 = [6 x i8] c"TOPIC\00"
@.str.18 = [5 x i8] c"NOTE\00"
@.str.19 = [4 x i8] c"DCC\00"
@.str.20 = [7 x i8] c"INVITE\00"
@.str.21 = [44 x i8] c"Garbage server input: unknown command `%s'.\00"
define i32 @parse_server_input(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %3
%8 = load i8*, i8** %3
%9 = call i8* @strtok(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %9, i8** %4
%10 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %10, i8** %5
%11 = load i8*, i8** %4
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = call i32 (i32, i32*, i32, i8*, ...) @log_add(i32 -1, i32* null, i32 4, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %2
br label %179
15: ; preds = %1
%16 = load i8*, i8** %5
%17 = icmp eq i8* %16, null
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 (i32, i32*, i32, i8*, ...) @log_add(i32 -1, i32* null, i32 4, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %2
br label %179
20: ; preds = %15
%21 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
store i8* %21, i8** %6
%22 = load i8*, i8** %4
%23 = call i32 @atoi(i8* %22)
store i32 %23, i32* %7
%24 = load i8*, i8** %5
%25 = call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %31
27: ; preds = %20
%28 = load i32, i32* %7
%29 = load i8*, i8** %6
%30 = call i32 @server_hello(i32 %28, i8* %29)
br label %178
31: ; preds = %20
%32 = load i8*, i8** %5
%33 = call i64 @strcmp(i8* %32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %39
35: ; preds = %31
%36 = load i32, i32* %7
%37 = load i8*, i8** %6
%38 = call i32 @server_msg(i32 %36, i8* %37)
br label %177
39: ; preds = %31
%40 = load i8*, i8** %5
%41 = call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %47
43: ; preds = %39
%44 = load i32, i32* %7
%45 = load i8*, i8** %6
%46 = call i32 @server_ctcp(i32 %44, i8* %45)
br label %176
47: ; preds = %39
%48 = load i8*, i8** %5
%49 = call i64 @strcmp(i8* %48, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %55
51: ; preds = %47
%52 = load i32, i32* %7
%53 = load i8*, i8** %6
%54 = call i32 @server_notice(i32 %52, i8* %53)
br label %175
55: ; preds = %47
%56 = load i8*, i8** %5
%57 = call i64 @strcmp(i8* %56, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%58 = icmp eq i64 %57, 0
br i1 %58, label %59, label %63
59: ; preds = %55
%60 = load i32, i32* %7
%61 = load i8*, i8** %6
%62 = call i32 @server_snotice(i32 %60, i8* %61)
br label %174
63: ; preds = %55
%64 = load i8*, i8** %5
%65 = call i64 @strcmp(i8* %64, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %71
67: ; preds = %63
%68 = load i32, i32* %7
%69 = load i8*, i8** %6
%70 = call i32 @server_ctcpr(i32 %68, i8* %69)
br label %173
71: ; preds = %63
%72 = load i8*, i8** %5
%73 = call i64 @strcmp(i8* %72, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%74 = icmp eq i64 %73, 0
br i1 %74, label %75, label %79
75: ; preds = %71
%76 = load i32, i32* %7
%77 = load i8*, i8** %6
%78 = call i32 @server_join(i32 %76, i8* %77)
br label %172
79: ; preds = %71
%80 = load i8*, i8** %5
%81 = call i64 @strcmp(i8* %80, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%82 = icmp eq i64 %81, 0
br i1 %82, label %83, label %87
83: ; preds = %79
%84 = load i32, i32* %7
%85 = load i8*, i8** %6
%86 = call i32 @server_part(i32 %84, i8* %85)
br label %171
87: ; preds = %79
%88 = load i8*, i8** %5
%89 = call i64 @strcmp(i8* %88, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
%90 = icmp eq i64 %89, 0
br i1 %90, label %91, label %95
91: ; preds = %87
%92 = load i32, i32* %7
%93 = load i8*, i8** %6
%94 = call i32 @server_nick(i32 %92, i8* %93)
br label %170
95: ; preds = %87
%96 = load i8*, i8** %5
%97 = call i64 @strcmp(i8* %96, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
%98 = icmp eq i64 %97, 0
br i1 %98, label %99, label %103
99: ; preds = %95
%100 = load i32, i32* %7
%101 = load i8*, i8** %6
%102 = call i32 @server_quit(i32 %100, i8* %101)
br label %169
103: ; preds = %95
%104 = load i8*, i8** %5
%105 = call i64 @strcmp(i8* %104, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0))
%106 = icmp eq i64 %105, 0
br i1 %106, label %107, label %111
107: ; preds = %103
%108 = load i32, i32* %7
%109 = load i8*, i8** %6
%110 = call i32 @server_connect(i32 %108, i8* %109)
br label %168
111: ; preds = %103
%112 = load i8*, i8** %5
%113 = call i64 @strcmp(i8* %112, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0))
%114 = icmp eq i64 %113, 0
br i1 %114, label %115, label %119
115: ; preds = %111
%116 = load i32, i32* %7
%117 = load i8*, i8** %6
%118 = call i32 @server_update(i32 %116, i8* %117)
br label %167
119: ; preds = %111
%120 = load i8*, i8** %5
%121 = call i64 @strcmp(i8* %120, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0))
%122 = icmp eq i64 %121, 0
br i1 %122, label %123, label %127
123: ; preds = %119
%124 = load i32, i32* %7
%125 = load i8*, i8** %6
%126 = call i32 @server_send(i32 %124, i8* %125)
br label %166
127: ; preds = %119
%128 = load i8*, i8** %5
%129 = call i64 @strcmp(i8* %128, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.17, i64 0, i64 0))
%130 = icmp eq i64 %129, 0
br i1 %130, label %131, label %135
131: ; preds = %127
%132 = load i32, i32* %7
%133 = load i8*, i8** %6
%134 = call i32 @server_topic(i32 %132, i8* %133)
br label %165
135: ; preds = %127
%136 = load i8*, i8** %5
%137 = call i64 @strcmp(i8* %136, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0))
%138 = icmp eq i64 %137, 0
br i1 %138, label %139, label %143
139: ; preds = %135
%140 = load i32, i32* %7
%141 = load i8*, i8** %6
%142 = call i32 @server_note(i32 %140, i8* %141)
br label %164
143: ; preds = %135
%144 = load i8*, i8** %5
%145 = call i64 @strcmp(i8* %144, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0))
%146 = icmp eq i64 %145, 0
br i1 %146, label %147, label %151
147: ; preds = %143
%148 = load i32, i32* %7
%149 = load i8*, i8** %6
%150 = call i32 @server_dcc(i32 %148, i8* %149)
br label %163
151: ; preds = %143
%152 = load i8*, i8** %5
%153 = call i64 @strcmp(i8* %152, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0))
%154 = icmp eq i64 %153, 0
br i1 %154, label %155, label %159
155: ; preds = %151
%156 = load i32, i32* %7
%157 = load i8*, i8** %6
%158 = call i32 @server_invite(i32 %156, i8* %157)
br label %162
159: ; preds = %151
%160 = load i8*, i8** %5
%161 = call i32 (i32, i32*, i32, i8*, ...) @log_add(i32 -1, i32* null, i32 4, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.21, i64 0, i64 0), i8* %160)
br label %162
162: ; preds = %159, %155
br label %163
163: ; preds = %162, %147
br label %164
164: ; preds = %163, %139
br label %165
165: ; preds = %164, %131
br label %166
166: ; preds = %165, %123
br label %167
167: ; preds = %166, %115
br label %168
168: ; preds = %167, %107
br label %169
169: ; preds = %168, %99
br label %170
170: ; preds = %169, %91
br label %171
171: ; preds = %170, %83
br label %172
172: ; preds = %171, %75
br label %173
173: ; preds = %172, %67
br label %174
174: ; preds = %173, %59
br label %175
175: ; preds = %174, %51
br label %176
176: ; preds = %175, %43
br label %177
177: ; preds = %176, %35
br label %178
178: ; preds = %177, %27
store i32 0, i32* %2
br label %179
179: ; preds = %178, %18, %13
%180 = load i32, i32* %2
ret i32 %180
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [34 x i8] c"Garbage server input: no child id\00"
@.str.2 = [33 x i8] c"Garbage server input: no command\00"
@.str.3 = [1 x i8] zeroinitializer
@.str.4 = [6 x i8] c"HELLO\00"
@.str.5 = [4 x i8] c"MSG\00"
@.str.6 = [5 x i8] c"CTCP\00"
@.str.7 = [7 x i8] c"NOTICE\00"
@.str.8 = [8 x i8] c"SNOTICE\00"
@.str.9 = [6 x i8] c"CTCPR\00"
@.str.10 = [5 x i8] c"JOIN\00"
@.str.11 = [5 x i8] c"PART\00"
@.str.12 = [5 x i8] c"NICK\00"
@.str.13 = [5 x i8] c"QUIT\00"
@.str.14 = [8 x i8] c"CONNECT\00"
@.str.15 = [7 x i8] c"UPDATE\00"
@.str.16 = [5 x i8] c"SEND\00"
@.str.17 = [6 x i8] c"TOPIC\00"
@.str.18 = [5 x i8] c"NOTE\00"
@.str.19 = [4 x i8] c"DCC\00"
@.str.20 = [7 x i8] c"INVITE\00"
@.str.21 = [44 x i8] c"Garbage server input: unknown command `%s'.\00"
define i32 @parse_server_input(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %2, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (i32, i32*, i32, i8*, ...) @log_add(i32 -1, i32* null, i32 4, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %100
7: ; preds = %1
%8 = icmp eq i8* %3, null
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = tail call i32 (i32, i32*, i32, i8*, ...) @log_add(i32 -1, i32* null, i32 4, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
br label %100
11: ; preds = %7
%12 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%13 = tail call i32 @atoi(i8* %2)
%14 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = tail call i32 @server_hello(i32 %13, i8* %12)
br label %100
18: ; preds = %11
%19 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = tail call i32 @server_msg(i32 %13, i8* %12)
br label %100
23: ; preds = %18
%24 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = tail call i32 @server_ctcp(i32 %13, i8* %12)
br label %100
28: ; preds = %23
%29 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = tail call i32 @server_notice(i32 %13, i8* %12)
br label %100
33: ; preds = %28
%34 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = tail call i32 @server_snotice(i32 %13, i8* %12)
br label %100
38: ; preds = %33
%39 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %38
%42 = tail call i32 @server_ctcpr(i32 %13, i8* %12)
br label %100
43: ; preds = %38
%44 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %43
%47 = tail call i32 @server_join(i32 %13, i8* %12)
br label %100
48: ; preds = %43
%49 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %48
%52 = tail call i32 @server_part(i32 %13, i8* %12)
br label %100
53: ; preds = %48
%54 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %58
56: ; preds = %53
%57 = tail call i32 @server_nick(i32 %13, i8* %12)
br label %100
58: ; preds = %53
%59 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %63
61: ; preds = %58
%62 = tail call i32 @server_quit(i32 %13, i8* %12)
br label %100
63: ; preds = %58
%64 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0))
%65 = icmp eq i64 %64, 0
br i1 %65, label %66, label %68
66: ; preds = %63
%67 = tail call i32 @server_connect(i32 %13, i8* %12)
br label %100
68: ; preds = %63
%69 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0))
%70 = icmp eq i64 %69, 0
br i1 %70, label %71, label %73
71: ; preds = %68
%72 = tail call i32 @server_update(i32 %13, i8* %12)
br label %100
73: ; preds = %68
%74 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0))
%75 = icmp eq i64 %74, 0
br i1 %75, label %76, label %78
76: ; preds = %73
%77 = tail call i32 @server_send(i32 %13, i8* %12)
br label %100
78: ; preds = %73
%79 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.17, i64 0, i64 0))
%80 = icmp eq i64 %79, 0
br i1 %80, label %81, label %83
81: ; preds = %78
%82 = tail call i32 @server_topic(i32 %13, i8* %12)
br label %100
83: ; preds = %78
%84 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0))
%85 = icmp eq i64 %84, 0
br i1 %85, label %86, label %88
86: ; preds = %83
%87 = tail call i32 @server_note(i32 %13, i8* %12)
br label %100
88: ; preds = %83
%89 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0))
%90 = icmp eq i64 %89, 0
br i1 %90, label %91, label %93
91: ; preds = %88
%92 = tail call i32 @server_dcc(i32 %13, i8* %12)
br label %100
93: ; preds = %88
%94 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0))
%95 = icmp eq i64 %94, 0
br i1 %95, label %96, label %98
96: ; preds = %93
%97 = tail call i32 @server_invite(i32 %13, i8* %12)
br label %100
98: ; preds = %93
%99 = tail call i32 (i32, i32*, i32, i8*, ...) @log_add(i32 -1, i32* null, i32 4, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.21, i64 0, i64 0), i8* %3)
br label %100
100: ; preds = %16, %26, %36, %46, %56, %66, %76, %86, %96, %98, %91, %81, %71, %61, %51, %41, %31, %21, %9, %5
%101 = phi i32 [ -1, %5 ], [ -1, %9 ], [ 0, %21 ], [ 0, %31 ], [ 0, %41 ], [ 0, %51 ], [ 0, %61 ], [ 0, %71 ], [ 0, %81 ], [ 0, %91 ], [ 0, %98 ], [ 0, %96 ], [ 0, %86 ], [ 0, %76 ], [ 0, %66 ], [ 0, %56 ], [ 0, %46 ], [ 0, %36 ], [ 0, %26 ], [ 0, %16 ]
ret i32 %101
}