#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 /*<<< orphan*/ abort();
int authorized(char *);
int /*<<< orphan*/ disconnect(int);
int /*<<< orphan*/ free(char *);
char *get_nick(char *);
char *next_message(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ send_raw_msg(int, char *);
scalar_t__ snprintf(char *, int, char *, char *, ...);
char *strstr(char *, char *);
void main_loop(int socket) {
  char *msg, *nick;
  char buff[8192];
LOOP:
  msg = next_message(socket);
  if (msg == NULL) {
    disconnect(socket);
    abort();
  }
  if (strstr(msg, "PRIVMSG "
                  "d8Gbot") != NULL) {
    if (strstr(msg, "quit") != NULL) {
      if (authorized(strstr(msg, "quit") + 5) == 1) {
        free(msg);
        msg = NULL;
        goto END;
      }
    } else if (strstr(msg, "ping") != NULL) {
      nick = get_nick(msg);
      if (snprintf(buff, 8192, "PRIVMSG %s :pong\n", nick) < 0) {
        perror("snprintf");
        abort();
      }
      send_raw_msg(socket, buff);
      free(nick);
    } else if (strstr(msg, ":op ") != NULL) {
      if (authorized(strstr(msg, "op") + 3)) {
        nick = get_nick(msg);
        if (snprintf(buff, 8192, "MODE #%s +o %s\n", "test", nick) < 0) {
          perror("");
          abort();
        }
        send_raw_msg(socket, buff);
        free(nick);
      }
    }
  } else {
    if (strstr(msg, "PING :") != NULL) {
      if (snprintf(buff, 8192, "PONG :%s\n", (strstr(msg, " :") + 2)) < 0) {
        perror("snprintf");
        abort();
      }
      send_raw_msg(socket, buff);
    }
  }
  free(msg);
  msg = NULL;
  goto LOOP;
END:
  send_raw_msg(socket, "QUIT :\n");
}


x86 assembly (clang, -O0):
<main_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2030,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <next_message@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11d4 <main_loop+0x34>
mov    -0x4(%rbp),%edi
call   10c0 <disconnect@plt>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x10(%rbp),%rdi
lea    0xe21(%rip),%rsi
call   10b0 <strstr@plt>
cmp    $0x0,%rax
je     1381 <main_loop+0x1e1>
mov    -0x10(%rbp),%rdi
lea    0xe16(%rip),%rsi
call   10b0 <strstr@plt>
cmp    $0x0,%rax
je     1248 <main_loop+0xa8>
mov    -0x10(%rbp),%rdi
lea    0xdfc(%rip),%rsi
call   10b0 <strstr@plt>
mov    %rax,%rdi
add    $0x5,%rdi
call   1080 <authorized@plt>
cmp    $0x1,%eax
jne    1243 <main_loop+0xa3>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x10(%rbp)
jmp    1421 <main_loop+0x281>
jmp    137c <main_loop+0x1dc>
mov    -0x10(%rbp),%rdi
lea    0xdc1(%rip),%rsi
call   10b0 <strstr@plt>
cmp    $0x0,%rax
je     12c7 <main_loop+0x127>
mov    -0x10(%rbp),%rdi
call   10a0 <get_nick@plt>
mov    %rax,-0x18(%rbp)
lea    -0x2020(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x2000,%esi
lea    0xd93(%rip),%rdx
mov    $0x0,%al
call   1060 <snprintf@plt>
cmp    $0x0,%rax
jge    12aa <main_loop+0x10a>
lea    0xd8d(%rip),%rdi
call   1090 <perror@plt>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x4(%rbp),%edi
lea    -0x2020(%rbp),%rsi
call   1070 <send_raw_msg@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
jmp    1377 <main_loop+0x1d7>
mov    -0x10(%rbp),%rdi
lea    0xd62(%rip),%rsi
call   10b0 <strstr@plt>
cmp    $0x0,%rax
je     1372 <main_loop+0x1d2>
mov    -0x10(%rbp),%rdi
lea    0xd4d(%rip),%rsi
call   10b0 <strstr@plt>
mov    %rax,%rdi
add    $0x3,%rdi
call   1080 <authorized@plt>
cmp    $0x0,%eax
je     136d <main_loop+0x1cd>
mov    -0x10(%rbp),%rdi
call   10a0 <get_nick@plt>
mov    %rax,-0x18(%rbp)
lea    -0x2020(%rbp),%rdi
mov    -0x18(%rbp),%r8
mov    $0x2000,%esi
lea    0xd12(%rip),%rdx
lea    0xd1b(%rip),%rcx
mov    $0x0,%al
call   1060 <snprintf@plt>
cmp    $0x0,%rax
jge    1355 <main_loop+0x1b5>
lea    0xd20(%rip),%rdi
call   1090 <perror@plt>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x4(%rbp),%edi
lea    -0x2020(%rbp),%rsi
call   1070 <send_raw_msg@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
jmp    1372 <main_loop+0x1d2>
jmp    1377 <main_loop+0x1d7>
jmp    137c <main_loop+0x1dc>
jmp    140b <main_loop+0x26b>
mov    -0x10(%rbp),%rdi
lea    0xcc5(%rip),%rsi
call   10b0 <strstr@plt>
cmp    $0x0,%rax
je     1406 <main_loop+0x266>
lea    -0x2020(%rbp),%rax
mov    %rax,-0x2028(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xca1(%rip),%rsi
call   10b0 <strstr@plt>
mov    -0x2028(%rbp),%rdi
mov    %rax,%rcx
add    $0x2,%rcx
mov    $0x2000,%esi
lea    0xc85(%rip),%rdx
mov    $0x0,%al
call   1060 <snprintf@plt>
cmp    $0x0,%rax
jge    13f7 <main_loop+0x257>
lea    0xc40(%rip),%rdi
call   1090 <perror@plt>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x4(%rbp),%edi
lea    -0x2020(%rbp),%rsi
call   1070 <send_raw_msg@plt>
jmp    140b <main_loop+0x26b>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x10(%rbp)
jmp    11ae <main_loop+0xe>
mov    -0x4(%rbp),%edi
lea    0xc37(%rip),%rsi
call   1070 <send_raw_msg@plt>
add    $0x2030,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_loop>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2008,%rsp
mov    %edi,%r13d
call   1050 <next_message@plt>
test   %rax,%rax
je     13a6 <main_loop+0x206>
mov    %rax,%rbx
lea    0xe34(%rip),%r14
lea    0xe7e(%rip),%r15
mov    %rsp,%r12
lea    0xe32(%rip),%rbp
jmp    1211 <main_loop+0x71>
nop
add    $0x5,%rax
mov    %rax,%rdi
call   1080 <authorized@plt>
cmp    $0x1,%eax
je     137d <main_loop+0x1dd>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r13d,%edi
call   1050 <next_message@plt>
mov    %rax,%rbx
test   %rax,%rax
je     13a6 <main_loop+0x206>
mov    %rbx,%rdi
mov    %r14,%rsi
call   10b0 <strstr@plt>
mov    %rbx,%rdi
test   %rax,%rax
je     12a0 <main_loop+0x100>
mov    %rbp,%rsi
call   10b0 <strstr@plt>
test   %rax,%rax
jne    11e0 <main_loop+0x40>
mov    %rbx,%rdi
lea    0xdd9(%rip),%rsi
call   10b0 <strstr@plt>
mov    %rbx,%rdi
test   %rax,%rax
je     12f3 <main_loop+0x153>
call   10a0 <get_nick@plt>
mov    %rax,%rbp
mov    %r12,%rdi
mov    $0x2000,%esi
lea    0xdb6(%rip),%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1060 <snprintf@plt>
test   %rax,%rax
js     13b5 <main_loop+0x215>
mov    %r13d,%edi
mov    %r12,%rsi
call   1070 <send_raw_msg@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
lea    0xd7f(%rip),%rbp
jmp    11f5 <main_loop+0x55>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15,%rsi
call   10b0 <strstr@plt>
test   %rax,%rax
je     11f5 <main_loop+0x55>
mov    %rbx,%rdi
lea    0xd9a(%rip),%rsi
call   10b0 <strstr@plt>
lea    0x2(%rax),%rcx
mov    %r12,%rdi
mov    $0x2000,%esi
lea    0xd85(%rip),%rdx
xor    %eax,%eax
call   1060 <snprintf@plt>
test   %rax,%rax
js     13b5 <main_loop+0x215>
mov    %r13d,%edi
mov    %r12,%rsi
call   1070 <send_raw_msg@plt>
jmp    11f5 <main_loop+0x55>
lea    0xd3a(%rip),%rsi
call   10b0 <strstr@plt>
test   %rax,%rax
je     11f5 <main_loop+0x55>
mov    %rbx,%rdi
lea    0xd27(%rip),%rsi
call   10b0 <strstr@plt>
lea    0x3(%rax),%rdi
call   1080 <authorized@plt>
test   %eax,%eax
je     11f5 <main_loop+0x55>
mov    %r15,%rbp
mov    %rbx,%rdi
call   10a0 <get_nick@plt>
mov    %rax,%r15
mov    %r12,%rdi
mov    $0x2000,%esi
lea    0xcf7(%rip),%rdx
lea    0xd00(%rip),%rcx
mov    %rax,%r8
xor    %eax,%eax
call   1060 <snprintf@plt>
test   %rax,%rax
js     13c8 <main_loop+0x228>
mov    %r13d,%edi
mov    %r12,%rsi
call   1070 <send_raw_msg@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbp,%r15
lea    0xc97(%rip),%rbp
jmp    11f5 <main_loop+0x55>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xcd6(%rip),%rsi
mov    %r13d,%edi
call   1070 <send_raw_msg@plt>
add    $0x2008,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r13d,%edi
call   10c0 <disconnect@plt>
xor    %eax,%eax
call   1040 <abort@plt>
lea    0xc6f(%rip),%rdi
call   1090 <perror@plt>
xor    %eax,%eax
call   1040 <abort@plt>
lea    0xc9a(%rip),%rdi
jmp    13bc <main_loop+0x21c>

LLVM IR (-O0):
@.str = [15 x i8] c"PRIVMSG d8Gbot\00"
@.str.1 = [5 x i8] c"quit\00"
@.str.2 = [5 x i8] c"ping\00"
@.str.3 = [18 x i8] c"PRIVMSG %s :pong\0A\00"
@.str.4 = [9 x i8] c"snprintf\00"
@.str.5 = [5 x i8] c":op \00"
@.str.6 = [3 x i8] c"op\00"
@.str.7 = [16 x i8] c"MODE #%s +o %s\0A\00"
@.str.8 = [5 x i8] c"test\00"
@.str.9 = [1 x i8] zeroinitializer
@.str.10 = [7 x i8] c"PING :\00"
@.str.11 = [10 x i8] c"PONG :%s\0A\00"
@.str.12 = [3 x i8] c" :\00"
@.str.13 = [8 x i8] c"QUIT :\0A\00"
define void @main_loop(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [8192 x i8]
store i32 %0, i32* %2
br label %6
6: ; preds = %102, %1
%7 = load i32, i32* %2
%8 = call i8* @next_message(i32 %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %6
%12 = load i32, i32* %2
%13 = call i32 @disconnect(i32 %12)
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %6
%16 = load i8*, i8** %3
%17 = call i8* @strstr(i8* %16, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %83
19: ; preds = %15
%20 = load i8*, i8** %3
%21 = call i8* @strstr(i8* %20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp ne i8* %21, null
br i1 %22, label %23, label %33
23: ; preds = %19
%24 = load i8*, i8** %3
%25 = call i8* @strstr(i8* %24, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%26 = getelementptr inbounds i8, i8* %25, i64 5
%27 = call i32 @authorized(i8* %26)
%28 = icmp eq i32 %27, 1
br i1 %28, label %29, label %32
29: ; preds = %23
%30 = load i8*, i8** %3
%31 = call i32 @free(i8* %30)
store i8* null, i8** %3
br label %105
32: ; preds = %23
br label %82
33: ; preds = %19
%34 = load i8*, i8** %3
%35 = call i8* @strstr(i8* %34, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%36 = icmp ne i8* %35, null
br i1 %36, label %37, label %53
37: ; preds = %33
%38 = load i8*, i8** %3
%39 = call i8* @get_nick(i8* %38)
store i8* %39, i8** %4
%40 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%41 = load i8*, i8** %4
%42 = call i64 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %40, i32 8192, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %41)
%43 = icmp slt i64 %42, 0
br i1 %43, label %44, label %47
44: ; preds = %37
%45 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%46 = call i32 (...) @abort()
unreachable
47: ; preds = %37
%48 = load i32, i32* %2
%49 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%50 = call i32 @send_raw_msg(i32 %48, i8* %49)
%51 = load i8*, i8** %4
%52 = call i32 @free(i8* %51)
br label %81
53: ; preds = %33
%54 = load i8*, i8** %3
%55 = call i8* @strstr(i8* %54, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%56 = icmp ne i8* %55, null
br i1 %56, label %57, label %80
57: ; preds = %53
%58 = load i8*, i8** %3
%59 = call i8* @strstr(i8* %58, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%60 = getelementptr inbounds i8, i8* %59, i64 3
%61 = call i32 @authorized(i8* %60)
%62 = icmp ne i32 %61, 0
br i1 %62, label %63, label %79
63: ; preds = %57
%64 = load i8*, i8** %3
%65 = call i8* @get_nick(i8* %64)
store i8* %65, i8** %4
%66 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%67 = load i8*, i8** %4
%68 = call i64 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %66, i32 8192, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %67)
%69 = icmp slt i64 %68, 0
br i1 %69, label %70, label %73
70: ; preds = %63
%71 = call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.9, i64 0, i64 0))
%72 = call i32 (...) @abort()
unreachable
73: ; preds = %63
%74 = load i32, i32* %2
%75 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%76 = call i32 @send_raw_msg(i32 %74, i8* %75)
%77 = load i8*, i8** %4
%78 = call i32 @free(i8* %77)
br label %79
79: ; preds = %73, %57
br label %80
80: ; preds = %79, %53
br label %81
81: ; preds = %80, %47
br label %82
82: ; preds = %81, %32
br label %102
83: ; preds = %15
%84 = load i8*, i8** %3
%85 = call i8* @strstr(i8* %84, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%86 = icmp ne i8* %85, null
br i1 %86, label %87, label %101
87: ; preds = %83
%88 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%89 = load i8*, i8** %3
%90 = call i8* @strstr(i8* %89, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%91 = getelementptr inbounds i8, i8* %90, i64 2
%92 = call i64 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %88, i32 8192, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i8* %91)
%93 = icmp slt i64 %92, 0
br i1 %93, label %94, label %97
94: ; preds = %87
%95 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%96 = call i32 (...) @abort()
unreachable
97: ; preds = %87
%98 = load i32, i32* %2
%99 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%100 = call i32 @send_raw_msg(i32 %98, i8* %99)
br label %101
101: ; preds = %97, %83
br label %102
102: ; preds = %101, %82
%103 = load i8*, i8** %3
%104 = call i32 @free(i8* %103)
store i8* null, i8** %3
br label %6
105: ; preds = %29
%106 = load i32, i32* %2
%107 = call i32 @send_raw_msg(i32 %106, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"PRIVMSG d8Gbot\00"
@.str.1 = [5 x i8] c"quit\00"
@.str.2 = [5 x i8] c"ping\00"
@.str.3 = [18 x i8] c"PRIVMSG %s :pong\0A\00"
@.str.4 = [9 x i8] c"snprintf\00"
@.str.5 = [5 x i8] c":op \00"
@.str.6 = [3 x i8] c"op\00"
@.str.7 = [16 x i8] c"MODE #%s +o %s\0A\00"
@.str.8 = [5 x i8] c"test\00"
@.str.9 = [1 x i8] zeroinitializer
@.str.10 = [7 x i8] c"PING :\00"
@.str.11 = [10 x i8] c"PONG :%s\0A\00"
@.str.12 = [3 x i8] c" :\00"
@.str.13 = [8 x i8] c"QUIT :\0A\00"
define void @main_loop(i32 %0) {
%2 = alloca [8192 x i8]
%3 = getelementptr inbounds [8192 x i8], [8192 x i8]* %2, i64 0, i64 0
%4 = call i8* @next_message(i32 %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %67, %1
%7 = call i32 @disconnect(i32 %0)
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %1, %67
%10 = phi i8* [ %69, %67 ], [ %4, %1 ]
%11 = call i8* @strstr(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i8* %11, null
br i1 %12, label %54, label %13
13: ; preds = %9
%14 = call i8* @strstr(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i8* %14, null
br i1 %15, label %23, label %16
16: ; preds = %13
%17 = getelementptr inbounds i8, i8* %14, i64 5
%18 = call i32 @authorized(i8* %17)
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %67
20: ; preds = %16
%21 = call i32 @free(i8* %10)
%22 = call i32 @send_raw_msg(i32 %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0))
ret void
23: ; preds = %13
%24 = call i8* @strstr(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%25 = icmp eq i8* %24, null
br i1 %25, label %36, label %26
26: ; preds = %23
%27 = call i8* @get_nick(i8* %10)
%28 = call i64 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %3, i32 8192, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %27)
%29 = icmp slt i64 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %26
%31 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%32 = call i32 (...) @abort()
unreachable
33: ; preds = %26
%34 = call i32 @send_raw_msg(i32 %0, i8* %3)
%35 = call i32 @free(i8* %27)
br label %67
36: ; preds = %23
%37 = call i8* @strstr(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%38 = icmp eq i8* %37, null
br i1 %38, label %67, label %39
39: ; preds = %36
%40 = call i8* @strstr(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%41 = getelementptr inbounds i8, i8* %40, i64 3
%42 = call i32 @authorized(i8* %41)
%43 = icmp eq i32 %42, 0
br i1 %43, label %67, label %44
44: ; preds = %39
%45 = call i8* @get_nick(i8* %10)
%46 = call i64 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %3, i32 8192, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %45)
%47 = icmp slt i64 %46, 0
br i1 %47, label %48, label %51
48: ; preds = %44
%49 = call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.9, i64 0, i64 0))
%50 = call i32 (...) @abort()
unreachable
51: ; preds = %44
%52 = call i32 @send_raw_msg(i32 %0, i8* %3)
%53 = call i32 @free(i8* %45)
br label %67
54: ; preds = %9
%55 = call i8* @strstr(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%56 = icmp eq i8* %55, null
br i1 %56, label %67, label %57
57: ; preds = %54
%58 = call i8* @strstr(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%59 = getelementptr inbounds i8, i8* %58, i64 2
%60 = call i64 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %3, i32 8192, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i8* %59)
%61 = icmp slt i64 %60, 0
br i1 %61, label %62, label %65
62: ; preds = %57
%63 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%64 = call i32 (...) @abort()
unreachable
65: ; preds = %57
%66 = call i32 @send_raw_msg(i32 %0, i8* %3)
br label %67
67: ; preds = %54, %65, %16, %36, %51, %39, %33
%68 = call i32 @free(i8* %10)
%69 = call i8* @next_message(i32 %0)
%70 = icmp eq i8* %69, null
br i1 %70, label %6, label %9
}