#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*/ F_SETFL;
int /*<<< orphan*/ O_NONBLOCK;
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ fcntl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ help();
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *, ...);
char *read_command();
int recv(int, char *, int, int /*<<< orphan*/);
int send(int, char *, int, int /*<<< orphan*/);
char *strdup(char *);
int strlen(char *);
scalar_t__ strncasecmp(char *, char *, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *strtok(char *, char *);
void command_loop(int fd, char *hostname, char *port) {
  char *line, buf[1024];
  int status = 1;
  while (status > 0) {
    printf("%s:%s> ", hostname, port);
    line = read_command();
    char *supp_command = strdup(line);
    char *comm = strtok(supp_command, " ");
    if (strlen(line) > 1) {
      char token[4];
      strncpy(token, line, 4);
      if (strncasecmp(comm, "KEYS", 4) == 0 ||
          strncasecmp(comm, "VALUES", 6) == 0 ||
          strncasecmp(comm, "KEYSPACE", 8) == 0) {
        fcntl(fd, F_SETFL, O_NONBLOCK);
        status = send(fd, line, strlen(line), 0);
        if (status < 0)
          perror("ERROR writing to socket");
        while (recv(fd, buf, 1024, 0) > 0) {
          printf("%s", buf);
          bzero(buf, 1024);
        }
      } else if (token[0] == '?' || token[0] == 'h' || token[0] == 'H' ||
                 strncasecmp(token, "HELP", 4) == 0) {
        help();
        bzero(buf, 1024);
      } else {
        status = send(fd, line, strlen(line), 0);
        if (status < 0)
          perror("ERROR writing to socket");
        bzero(buf, 1024);
        status = recv(fd, buf, 1024, 0);
        if (status < 0)
          perror("ERROR reading from socket");
        printf("%s", buf);
      }
      free(supp_command);
      free(line);
    }
  }
}


x86 assembly (clang, -O0):
<command_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x460,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x1,-0x424(%rbp)
cmpl   $0x0,-0x424(%rbp)
jle    14e0 <command_loop+0x300>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xde4(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
mov    $0x0,%al
call   1070 <read_command@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1100 <strdup@plt>
mov    %rax,-0x430(%rbp)
mov    -0x430(%rbp),%rdi
lea    0xdba(%rip),%rsi
call   10d0 <strtok@plt>
mov    %rax,-0x438(%rbp)
mov    -0x20(%rbp),%rdi
call   1080 <strlen@plt>
cmp    $0x1,%eax
jle    14db <command_loop+0x2fb>
lea    -0x43c(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x4,%edx
call   1050 <strncpy@plt>
mov    -0x438(%rbp),%rdi
lea    0xd7b(%rip),%rsi
mov    $0x4,%edx
call   10b0 <strncasecmp@plt>
cmp    $0x0,%rax
je     12e5 <command_loop+0x105>
mov    -0x438(%rbp),%rdi
lea    0xd5e(%rip),%rsi
mov    $0x6,%edx
call   10b0 <strncasecmp@plt>
cmp    $0x0,%rax
je     12e5 <command_loop+0x105>
mov    -0x438(%rbp),%rdi
lea    0xd43(%rip),%rsi
mov    $0x8,%edx
call   10b0 <strncasecmp@plt>
cmp    $0x0,%rax
jne    13a5 <command_loop+0x1c5>
mov    -0x4(%rbp),%edi
mov    0x2ce9(%rip),%rax
mov    (%rax),%esi
mov    0x2cf0(%rip),%rax
mov    (%rax),%edx
call   1060 <fcntl@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x44c(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x448(%rbp)
mov    -0x20(%rbp),%rdi
call   1080 <strlen@plt>
mov    -0x44c(%rbp),%edi
mov    -0x448(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1090 <send@plt>
mov    %eax,-0x424(%rbp)
cmpl   $0x0,-0x424(%rbp)
jge    1351 <command_loop+0x171>
lea    0xcd1(%rip),%rdi
call   10c0 <perror@plt>
jmp    1356 <command_loop+0x176>
mov    -0x4(%rbp),%edi
lea    -0x420(%rbp),%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1040 <recv@plt>
cmp    $0x0,%eax
jle    13a0 <command_loop+0x1c0>
lea    -0x420(%rbp),%rsi
lea    0xcb2(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
lea    -0x420(%rbp),%rdi
mov    $0x400,%esi
call   10e0 <bzero@plt>
jmp    1356 <command_loop+0x176>
jmp    14c6 <command_loop+0x2e6>
movsbl -0x43c(%rbp),%eax
cmp    $0x3f,%eax
je     13f7 <command_loop+0x217>
movsbl -0x43c(%rbp),%eax
cmp    $0x68,%eax
je     13f7 <command_loop+0x217>
movsbl -0x43c(%rbp),%eax
cmp    $0x48,%eax
je     13f7 <command_loop+0x217>
lea    -0x43c(%rbp),%rdi
lea    0xc55(%rip),%rsi
mov    $0x4,%edx
call   10b0 <strncasecmp@plt>
cmp    $0x0,%rax
jne    1414 <command_loop+0x234>
mov    $0x0,%al
call   10f0 <help@plt>
lea    -0x420(%rbp),%rdi
mov    $0x400,%esi
call   10e0 <bzero@plt>
jmp    14c1 <command_loop+0x2e1>
mov    -0x4(%rbp),%eax
mov    %eax,-0x45c(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x458(%rbp)
mov    -0x20(%rbp),%rdi
call   1080 <strlen@plt>
mov    -0x45c(%rbp),%edi
mov    -0x458(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1090 <send@plt>
mov    %eax,-0x424(%rbp)
cmpl   $0x0,-0x424(%rbp)
jge    1466 <command_loop+0x286>
lea    0xbbc(%rip),%rdi
call   10c0 <perror@plt>
lea    -0x420(%rbp),%rdi
mov    $0x400,%esi
call   10e0 <bzero@plt>
mov    -0x4(%rbp),%edi
lea    -0x420(%rbp),%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1040 <recv@plt>
mov    %eax,-0x424(%rbp)
cmpl   $0x0,-0x424(%rbp)
jge    14ac <command_loop+0x2cc>
lea    0xb96(%rip),%rdi
call   10c0 <perror@plt>
lea    -0x420(%rbp),%rsi
lea    0xb7b(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
jmp    14c6 <command_loop+0x2e6>
mov    -0x430(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
jmp    1200 <command_loop+0x20>
add    $0x460,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<command_loop>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x428,%rsp
mov    %rdx,0x18(%rsp)
mov    %rsi,0x10(%rsp)
mov    %edi,%ebp
movl   $0x1,0x8(%rsp)
lea    0x20(%rsp),%r13
lea    0xe24(%rip),%r15
jmp    1242 <command_loop+0x62>
xor    %eax,%eax
call   10f0 <help@plt>
mov    %r13,%rdi
mov    $0x400,%esi
call   10e0 <bzero@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
cmpl   $0x0,0x8(%rsp)
jle    1446 <command_loop+0x266>
lea    0xdb7(%rip),%rdi
mov    0x10(%rsp),%rsi
mov    0x18(%rsp),%rdx
xor    %eax,%eax
call   10a0 <printf@plt>
xor    %eax,%eax
call   1070 <read_command@plt>
mov    %rax,%r12
mov    %rax,%rdi
call   1100 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
lea    0xd8d(%rip),%rsi
call   10d0 <strtok@plt>
mov    %rax,%r14
mov    %r12,%rdi
call   1080 <strlen@plt>
cmp    $0x2,%eax
jl     1237 <command_loop+0x57>
lea    0xc(%rsp),%rdi
mov    %r12,%rsi
mov    $0x4,%edx
call   1050 <strncpy@plt>
mov    %r14,%rdi
lea    0xd5e(%rip),%rsi
mov    $0x4,%edx
call   10b0 <strncasecmp@plt>
test   %rax,%rax
je     13a0 <command_loop+0x1c0>
mov    %r14,%rdi
lea    0xd46(%rip),%rsi
mov    $0x6,%edx
call   10b0 <strncasecmp@plt>
test   %rax,%rax
je     13a0 <command_loop+0x1c0>
mov    %r14,%rdi
lea    0xd30(%rip),%rsi
mov    $0x8,%edx
call   10b0 <strncasecmp@plt>
test   %rax,%rax
je     13a0 <command_loop+0x1c0>
mov    0xc(%rsp),%al
add    $0xc1,%al
cmp    $0x29,%al
ja     1318 <command_loop+0x138>
movzbl %al,%eax
movabs $0x20000000201,%rcx
bt     %rax,%rcx
jb     1213 <command_loop+0x33>
lea    0xc(%rsp),%rdi
lea    0xd14(%rip),%rsi
mov    $0x4,%edx
call   10b0 <strncasecmp@plt>
test   %rax,%rax
je     1213 <command_loop+0x33>
mov    %r12,%rdi
call   1080 <strlen@plt>
mov    %ebp,%edi
mov    %r12,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1090 <send@plt>
test   %eax,%eax
js     1424 <command_loop+0x244>
mov    %r13,%rdi
mov    $0x400,%esi
call   10e0 <bzero@plt>
mov    %ebp,%edi
mov    %r13,%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1040 <recv@plt>
mov    %eax,0x8(%rsp)
test   %eax,%eax
js     1435 <command_loop+0x255>
mov    %r15,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
jmp    1227 <command_loop+0x47>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x2c31(%rip),%rax
mov    (%rax),%esi
mov    0x2c38(%rip),%rax
mov    (%rax),%edx
mov    %ebp,%edi
call   1060 <fcntl@plt>
mov    %r12,%rdi
call   1080 <strlen@plt>
mov    %ebp,%edi
mov    %r12,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1090 <send@plt>
mov    %eax,0x8(%rsp)
test   %eax,%eax
jns    140a <command_loop+0x22a>
lea    0xc3f(%rip),%rdi
call   10c0 <perror@plt>
jmp    140a <command_loop+0x22a>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    %r13,%rdi
mov    $0x400,%esi
call   10e0 <bzero@plt>
mov    %ebp,%edi
mov    %r13,%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1040 <recv@plt>
test   %eax,%eax
jg     13f0 <command_loop+0x210>
jmp    1227 <command_loop+0x47>
lea    0xbf2(%rip),%rdi
call   10c0 <perror@plt>
jmp    1355 <command_loop+0x175>
lea    0xc01(%rip),%rdi
call   10c0 <perror@plt>
jmp    137f <command_loop+0x19f>
add    $0x428,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%s:%s> \00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [5 x i8] c"KEYS\00"
@.str.3 = [7 x i8] c"VALUES\00"
@.str.4 = [9 x i8] c"KEYSPACE\00"
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
@.str.5 = [24 x i8] c"ERROR writing to socket\00"
@.str.6 = [3 x i8] c"%s\00"
@.str.7 = [5 x i8] c"HELP\00"
@.str.8 = [26 x i8] c"ERROR reading from socket\00"
define void @command_loop(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca [1024 x i8]
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca [4 x i8]
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
store i32 1, i32* %9
br label %13
13: ; preds = %121, %3
%14 = load i32, i32* %9
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %122
16: ; preds = %13
%17 = load i8*, i8** %5
%18 = load i8*, i8** %6
%19 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %17, i8* %18)
%20 = call i8* (...) @read_command()
store i8* %20, i8** %7
%21 = load i8*, i8** %7
%22 = call i8* @strdup(i8* %21)
store i8* %22, i8** %10
%23 = load i8*, i8** %10
%24 = call i8* @strtok(i8* %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %24, i8** %11
%25 = load i8*, i8** %7
%26 = call i32 @strlen(i8* %25)
%27 = icmp sgt i32 %26, 1
br i1 %27, label %28, label %121
28: ; preds = %16
%29 = getelementptr inbounds [4 x i8], [4 x i8]* %12, i64 0, i64 0
%30 = load i8*, i8** %7
%31 = call i32 @strncpy(i8* %29, i8* %30, i32 4)
%32 = load i8*, i8** %11
%33 = call i64 @strncasecmp(i8* %32, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 4)
%34 = icmp eq i64 %33, 0
br i1 %34, label %43, label %35
35: ; preds = %28
%36 = load i8*, i8** %11
%37 = call i64 @strncasecmp(i8* %36, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 6)
%38 = icmp eq i64 %37, 0
br i1 %38, label %43, label %39
39: ; preds = %35
%40 = load i8*, i8** %11
%41 = call i64 @strncasecmp(i8* %40, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 8)
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %69
43: ; preds = %39, %35, %28
%44 = load i32, i32* %4
%45 = load i32, i32* @F_SETFL
%46 = load i32, i32* @O_NONBLOCK
%47 = call i32 @fcntl(i32 %44, i32 %45, i32 %46)
%48 = load i32, i32* %4
%49 = load i8*, i8** %7
%50 = load i8*, i8** %7
%51 = call i32 @strlen(i8* %50)
%52 = call i32 @send(i32 %48, i8* %49, i32 %51, i32 0)
store i32 %52, i32* %9
%53 = load i32, i32* %9
%54 = icmp slt i32 %53, 0
br i1 %54, label %55, label %57
55: ; preds = %43
%56 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
br label %57
57: ; preds = %55, %43
br label %58
58: ; preds = %63, %57
%59 = load i32, i32* %4
%60 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%61 = call i32 @recv(i32 %59, i8* %60, i32 1024, i32 0)
%62 = icmp sgt i32 %61, 0
br i1 %62, label %63, label %68
63: ; preds = %58
%64 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%65 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %64)
%66 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%67 = call i32 @bzero(i8* %66, i32 1024)
br label %58
68: ; preds = %58
br label %116
69: ; preds = %39
%70 = getelementptr inbounds [4 x i8], [4 x i8]* %12, i64 0, i64 0
%71 = load i8, i8* %70
%72 = sext i8 %71 to i32
%73 = icmp eq i32 %72, 63
br i1 %73, label %88, label %74
74: ; preds = %69
%75 = getelementptr inbounds [4 x i8], [4 x i8]* %12, i64 0, i64 0
%76 = load i8, i8* %75
%77 = sext i8 %76 to i32
%78 = icmp eq i32 %77, 104
br i1 %78, label %88, label %79
79: ; preds = %74
%80 = getelementptr inbounds [4 x i8], [4 x i8]* %12, i64 0, i64 0
%81 = load i8, i8* %80
%82 = sext i8 %81 to i32
%83 = icmp eq i32 %82, 72
br i1 %83, label %88, label %84
84: ; preds = %79
%85 = getelementptr inbounds [4 x i8], [4 x i8]* %12, i64 0, i64 0
%86 = call i64 @strncasecmp(i8* %85, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 4)
%87 = icmp eq i64 %86, 0
br i1 %87, label %88, label %92
88: ; preds = %84, %79, %74, %69
%89 = call i32 (...) @help()
%90 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%91 = call i32 @bzero(i8* %90, i32 1024)
br label %115
92: ; preds = %84
%93 = load i32, i32* %4
%94 = load i8*, i8** %7
%95 = load i8*, i8** %7
%96 = call i32 @strlen(i8* %95)
%97 = call i32 @send(i32 %93, i8* %94, i32 %96, i32 0)
store i32 %97, i32* %9
%98 = load i32, i32* %9
%99 = icmp slt i32 %98, 0
br i1 %99, label %100, label %102
100: ; preds = %92
%101 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
br label %102
102: ; preds = %100, %92
%103 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%104 = call i32 @bzero(i8* %103, i32 1024)
%105 = load i32, i32* %4
%106 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%107 = call i32 @recv(i32 %105, i8* %106, i32 1024, i32 0)
store i32 %107, i32* %9
%108 = load i32, i32* %9
%109 = icmp slt i32 %108, 0
br i1 %109, label %110, label %112
110: ; preds = %102
%111 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0))
br label %112
112: ; preds = %110, %102
%113 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%114 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %113)
br label %115
115: ; preds = %112, %88
br label %116
116: ; preds = %115, %68
%117 = load i8*, i8** %10
%118 = call i32 @free(i8* %117)
%119 = load i8*, i8** %7
%120 = call i32 @free(i8* %119)
br label %121
121: ; preds = %116, %16
br label %13
122: ; preds = %13
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s:%s> \00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [5 x i8] c"KEYS\00"
@.str.3 = [7 x i8] c"VALUES\00"
@.str.4 = [9 x i8] c"KEYSPACE\00"
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
@.str.5 = [24 x i8] c"ERROR writing to socket\00"
@.str.6 = [3 x i8] c"%s\00"
@.str.7 = [5 x i8] c"HELP\00"
@.str.8 = [26 x i8] c"ERROR reading from socket\00"
define void @command_loop(i32 %0, i8* %1, i8* %2) {
%4 = alloca [1024 x i8]
%5 = alloca [4 x i8]
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
br label %8
8: ; preds = %3, %69
%9 = phi i32 [ 1, %3 ], [ %70, %69 ]
%10 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
%11 = call i8* (...) @read_command()
%12 = call i8* @strdup(i8* %11)
%13 = call i8* @strtok(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @strlen(i8* %11)
%15 = icmp sgt i32 %14, 1
br i1 %15, label %16, label %69
16: ; preds = %8
%17 = call i32 @strncpy(i8* %7, i8* %11, i32 4)
%18 = call i64 @strncasecmp(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 4)
%19 = icmp eq i64 %18, 0
br i1 %19, label %26, label %20
20: ; preds = %16
%21 = call i64 @strncasecmp(i8* %13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 6)
%22 = icmp eq i64 %21, 0
br i1 %22, label %26, label %23
23: ; preds = %20
%24 = call i64 @strncasecmp(i8* %13, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 8)
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %43
26: ; preds = %23, %20, %16
%27 = load i32, i32* @F_SETFL
%28 = load i32, i32* @O_NONBLOCK
%29 = call i32 @fcntl(i32 %0, i32 %27, i32 %28)
%30 = call i32 @strlen(i8* %11)
%31 = call i32 @send(i32 %0, i8* %11, i32 %30, i32 0)
%32 = icmp slt i32 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %26
%34 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
br label %35
35: ; preds = %33, %26
%36 = call i32 @recv(i32 %0, i8* %6, i32 1024, i32 0)
%37 = icmp sgt i32 %36, 0
br i1 %37, label %38, label %65
38: ; preds = %35, %38
%39 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %6)
%40 = call i32 @bzero(i8* %6, i32 1024)
%41 = call i32 @recv(i32 %0, i8* %6, i32 1024, i32 0)
%42 = icmp sgt i32 %41, 0
br i1 %42, label %38, label %65
43: ; preds = %23
%44 = load i8, i8* %7
switch i8 %44, label %45 [
i8 104, label %48
i8 72, label %48
i8 63, label %48
]
45: ; preds = %43
%46 = call i64 @strncasecmp(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 4)
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %51
48: ; preds = %43, %43, %43, %45
%49 = call i32 (...) @help()
%50 = call i32 @bzero(i8* %6, i32 1024)
br label %65
51: ; preds = %45
%52 = call i32 @strlen(i8* %11)
%53 = call i32 @send(i32 %0, i8* %11, i32 %52, i32 0)
%54 = icmp slt i32 %53, 0
br i1 %54, label %55, label %57
55: ; preds = %51
%56 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
br label %57
57: ; preds = %55, %51
%58 = call i32 @bzero(i8* %6, i32 1024)
%59 = call i32 @recv(i32 %0, i8* %6, i32 1024, i32 0)
%60 = icmp slt i32 %59, 0
br i1 %60, label %61, label %63
61: ; preds = %57
%62 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0))
br label %63
63: ; preds = %61, %57
%64 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %6)
br label %65
65: ; preds = %38, %35, %48, %63
%66 = phi i32 [ %9, %48 ], [ %59, %63 ], [ %31, %35 ], [ %31, %38 ]
%67 = call i32 @free(i8* %12)
%68 = call i32 @free(i8* %11)
br label %69
69: ; preds = %65, %8
%70 = phi i32 [ %66, %65 ], [ %9, %8 ]
%71 = icmp sgt i32 %70, 0
br i1 %71, label %8, label %72
72: ; preds = %69
ret void
}