#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 sockaddr_storage {
  int /*<<< orphan*/ ss_family;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;

/* Variables and functions */
int INET6_ADDRSTRLEN;
int accept(int, struct sockaddr *, int *);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fork();
int /*<<< orphan*/ get_in_addr(struct sockaddr *);
int /*<<< orphan*/ handler_cmd(void *, char *, char *, int);
int /*<<< orphan*/ inet_ntop(int /*<<< orphan*/, int /*<<< orphan*/, char *,
                             int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int recv(int, char *, int, int /*<<< orphan*/);
scalar_t__ send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void accept_conn(int sock, void *cmd_handler) {
  struct sockaddr_storage peer;
  char s[INET6_ADDRSTRLEN];
  socklen_t peer_sz;
  int fd;
  while (1) {
    peer_sz = sizeof peer;
    fd = accept(sock, (struct sockaddr *)&peer, &peer_sz);
    if (fd == -1) {
      perror("accept");
      continue;
    }
    inet_ntop(peer.ss_family, get_in_addr((struct sockaddr *)&peer), s,
              sizeof s);
    printf("Got connection from %s\r\n", s);
    if (!fork()) {
      char buf[1024];
      char response[1024];
      close(sock);
      while (1) {
        int nbytes = 0;
        memset(buf, 0, sizeof buf);
        nbytes = recv(fd, buf, sizeof buf, 0);
        if (nbytes < 0) {
          perror("recv");
          break;
        } else if (nbytes == 0) {
          printf("Remote end closed the connection\r\n");
          break;
        } else {
          printf("Received %d bytes\r\n", nbytes);
          char *pos = buf;
          while (pos < (buf + sizeof buf)) {
            if (*pos == 0)
              break;
            if (*pos == '\r' || *pos == '\n')
              *pos = 0;
            pos++;
          }
          printf("Received cmd: [%s ]\r\n", buf);
          handler_cmd(cmd_handler, buf, response, sizeof response);
          printf("Sending response: [%s]\r\n", response);
          if (send(fd, response, strlen(response), 0) < 0)
            perror("send");
        }
      }
      close(fd);
      exit(0);
    }
    close(fd);
  }
}


x86 assembly (clang, -O0):
<accept_conn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x870,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2dff(%rip),%rax
mov    (%rax),%eax
mov    %rax,-0x850(%rbp)
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x848(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
jmp    121d <accept_conn+0x4d>
movl   $0x4,-0x2c(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
lea    -0x2c(%rbp),%rdx
call   10d0 <accept@plt>
mov    %eax,-0x30(%rbp)
cmpl   $0xffffffff,-0x30(%rbp)
jne    1252 <accept_conn+0x82>
lea    0xdb8(%rip),%rdi
call   10c0 <perror@plt>
jmp    1218 <accept_conn+0x48>
mov    -0x18(%rbp),%eax
mov    %eax,-0x854(%rbp)
lea    -0x18(%rbp),%rdi
call   1050 <get_in_addr@plt>
mov    -0x854(%rbp),%edi
mov    -0x848(%rbp),%rdx
mov    %eax,%esi
mov    -0x850(%rbp),%rax
mov    %eax,%ecx
call   1030 <inet_ntop@plt>
mov    -0x848(%rbp),%rsi
lea    0xd78(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x0,%al
call   10f0 <fork@plt>
cmp    $0x0,%eax
jne    147c <accept_conn+0x2ac>
mov    -0x4(%rbp),%edi
call   10a0 <close@plt>
jmp    12b3 <accept_conn+0xe3>
movl   $0x0,-0x834(%rbp)
lea    -0x430(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1090 <memset@plt>
mov    -0x30(%rbp),%edi
lea    -0x430(%rbp),%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1040 <recv@plt>
mov    %eax,-0x834(%rbp)
cmpl   $0x0,-0x834(%rbp)
jge    130a <accept_conn+0x13a>
lea    0xd20(%rip),%rdi
call   10c0 <perror@plt>
jmp    146d <accept_conn+0x29d>
cmpl   $0x0,-0x834(%rbp)
jne    132a <accept_conn+0x15a>
lea    0xd07(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    146d <accept_conn+0x29d>
mov    -0x834(%rbp),%esi
lea    0xd11(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x430(%rbp),%rax
mov    %rax,-0x840(%rbp)
mov    -0x840(%rbp),%rax
lea    -0x430(%rbp),%rcx
add    $0x400,%rcx
cmp    %rcx,%rax
jae    13c9 <accept_conn+0x1f9>
mov    -0x840(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1382 <accept_conn+0x1b2>
jmp    13c9 <accept_conn+0x1f9>
mov    -0x840(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
je     13a8 <accept_conn+0x1d8>
mov    -0x840(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    13b2 <accept_conn+0x1e2>
mov    -0x840(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x840(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x840(%rbp)
jmp    134c <accept_conn+0x17c>
lea    -0x430(%rbp),%rsi
lea    0xc85(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x430(%rbp),%rsi
lea    -0x830(%rbp),%rdx
mov    $0x400,%ecx
call   10b0 <handler_cmd@plt>
lea    -0x830(%rbp),%rsi
lea    0xc6a(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x30(%rbp),%eax
mov    %eax,-0x864(%rbp)
lea    -0x830(%rbp),%rax
mov    %rax,-0x860(%rbp)
lea    -0x830(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x864(%rbp),%edi
mov    -0x860(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1070 <send@plt>
cmp    $0x0,%rax
jge    145e <accept_conn+0x28e>
lea    0xc32(%rip),%rdi
call   10c0 <perror@plt>
jmp    1463 <accept_conn+0x293>
jmp    1468 <accept_conn+0x298>
jmp    12ae <accept_conn+0xde>
mov    -0x30(%rbp),%edi
call   10a0 <close@plt>
xor    %edi,%edi
call   10e0 <exit@plt>
mov    -0x30(%rbp),%edi
call   10a0 <close@plt>
jmp    1218 <accept_conn+0x48>

x86 assembly (clang, -O2):
<accept_conn>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x818,%rsp
mov    %rsi,-0x40(%rbp)
mov    %edi,-0x2c(%rbp)
mov    0x2de6(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rbx
mov    %rax,%r15
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
lea    -0x30(%rbp),%r14
jmp    1230 <accept_conn+0x50>
lea    0xddb(%rip),%rdi
call   10d0 <perror@plt>
nopw   0x0(%rax,%rax,1)
movl   $0x4,-0x34(%rbp)
mov    -0x2c(%rbp),%edi
mov    %r14,%rsi
lea    -0x34(%rbp),%rdx
call   10e0 <accept@plt>
cmp    $0xffffffff,%eax
je     121e <accept_conn+0x3e>
mov    %eax,%r13d
mov    -0x30(%rbp),%r12d
mov    %r14,%rdi
call   1050 <get_in_addr@plt>
mov    %r12d,%edi
mov    %eax,%esi
mov    %rbx,%rdx
mov    %r15d,%ecx
call   1030 <inet_ntop@plt>
lea    0xd96(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
xor    %eax,%eax
call   1100 <fork@plt>
test   %eax,%eax
je     1290 <accept_conn+0xb0>
mov    %r13d,%edi
call   10b0 <close@plt>
jmp    1230 <accept_conn+0x50>
mov    -0x2c(%rbp),%edi
call   10b0 <close@plt>
lea    -0x440(%rbp),%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   10a0 <memset@plt>
mov    %r13d,%edi
mov    %r15,%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1040 <recv@plt>
test   %eax,%eax
jns    12df <accept_conn+0xff>
lea    0xd55(%rip),%rdi
call   10d0 <perror@plt>
mov    %r13d,%edi
call   10b0 <close@plt>
xor    %edi,%edi
call   10f0 <exit@plt>
lea    -0x40(%rbp),%rbx
lea    -0x840(%rbp),%r12
lea    0xd5e(%rip),%r14
jmp    1377 <accept_conn+0x197>
cs nopw 0x0(%rax,%rax,1)
lea    0xd32(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    -0x40(%rbp),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    $0x400,%ecx
call   10c0 <handler_cmd@plt>
mov    %r14,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %r12,%rdi
call   1070 <strlen@plt>
mov    %r13d,%edi
mov    %r12,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1080 <send@plt>
test   %rax,%rax
js     13b6 <accept_conn+0x1d6>
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   10a0 <memset@plt>
mov    %r13d,%edi
mov    %r15,%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1040 <recv@plt>
test   %eax,%eax
js     12c4 <accept_conn+0xe4>
test   %eax,%eax
je     13c4 <accept_conn+0x1e4>
lea    0xca3(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %r15,%rax
jmp    13a0 <accept_conn+0x1c0>
movb   $0x0,(%rax)
add    $0x1,%rax
cmp    %rbx,%rax
jae    1300 <accept_conn+0x120>
movzbl (%rax),%ecx
cmp    $0xa,%cl
je     1390 <accept_conn+0x1b0>
cmp    $0xd,%cl
je     1390 <accept_conn+0x1b0>
test   %cl,%cl
jne    1393 <accept_conn+0x1b3>
jmp    1300 <accept_conn+0x120>
lea    0xcab(%rip),%rdi
call   10d0 <perror@plt>
jmp    134e <accept_conn+0x16e>
lea    0xca2(%rip),%rdi
call   1060 <puts@plt>
jmp    12d0 <accept_conn+0xf0>

LLVM IR (-O0):
%struct.sockaddr_storage = type { i32 }
%struct.sockaddr = type { i32 }
@INET6_ADDRSTRLEN = global i32 0
@.str = [7 x i8] c"accept\00"
@.str.1 = [25 x i8] c"Got connection from %s\0D\0A\00"
@.str.2 = [5 x i8] c"recv\00"
@.str.3 = [35 x i8] c"Remote end closed the connection\0D\0A\00"
@.str.4 = [20 x i8] c"Received %d bytes\0D\0A\00"
@.str.5 = [22 x i8] c"Received cmd: [%s ]\0D\0A\00"
@.str.6 = [25 x i8] c"Sending response: [%s]\0D\0A\00"
@.str.7 = [5 x i8] c"send\00"
define void @accept_conn(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.sockaddr_storage
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
%9 = alloca i32
%10 = alloca [1024 x i8]
%11 = alloca [1024 x i8]
%12 = alloca i32
%13 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%14 = load i32, i32* @INET6_ADDRSTRLEN
%15 = zext i32 %14 to i64
%16 = call i8* @llvm.stacksave()
store i8* %16, i8** %6
%17 = alloca i8, i64 %15
store i64 %15, i64* %7
br label %18
18: ; preds = %110, %25, %2
br label %19
19: ; preds = %18
store i32 4, i32* %8
%20 = load i32, i32* %3
%21 = bitcast %struct.sockaddr_storage* %5 to %struct.sockaddr*
%22 = call i32 @accept(i32 %20, %struct.sockaddr* %21, i32* %8)
store i32 %22, i32* %9
%23 = load i32, i32* %9
%24 = icmp eq i32 %23, -1
br i1 %24, label %25, label %27
25: ; preds = %19
%26 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %18
27: ; preds = %19
%28 = getelementptr inbounds %struct.sockaddr_storage, %struct.sockaddr_storage* %5, i32 0, i32 0
%29 = load i32, i32* %28
%30 = bitcast %struct.sockaddr_storage* %5 to %struct.sockaddr*
%31 = call i32 @get_in_addr(%struct.sockaddr* %30)
%32 = trunc i64 %15 to i32
%33 = call i32 @inet_ntop(i32 %29, i32 %31, i8* %17, i32 %32)
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %17)
%35 = call i32 (...) @fork()
%36 = icmp ne i32 %35, 0
br i1 %36, label %110, label %37
37: ; preds = %27
%38 = load i32, i32* %3
%39 = call i32 @close(i32 %38)
br label %40
40: ; preds = %105, %37
br label %41
41: ; preds = %40
store i32 0, i32* %12
%42 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%43 = call i32 @memset(i8* %42, i32 0, i32 1024)
%44 = load i32, i32* %9
%45 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%46 = call i32 @recv(i32 %44, i8* %45, i32 1024, i32 0)
store i32 %46, i32* %12
%47 = load i32, i32* %12
%48 = icmp slt i32 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %41
%50 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %106
51: ; preds = %41
%52 = load i32, i32* %12
%53 = icmp eq i32 %52, 0
br i1 %53, label %54, label %56
54: ; preds = %51
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
br label %106
56: ; preds = %51
%57 = load i32, i32* %12
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %57)
%59 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
store i8* %59, i8** %13
br label %60
60: ; preds = %83, %56
%61 = load i8*, i8** %13
%62 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%63 = getelementptr inbounds i8, i8* %62, i64 1024
%64 = icmp ult i8* %61, %63
br i1 %64, label %65, label %86
65: ; preds = %60
%66 = load i8*, i8** %13
%67 = load i8, i8* %66
%68 = sext i8 %67 to i32
%69 = icmp eq i32 %68, 0
br i1 %69, label %70, label %71
70: ; preds = %65
br label %86
71: ; preds = %65
%72 = load i8*, i8** %13
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
%75 = icmp eq i32 %74, 13
br i1 %75, label %81, label %76
76: ; preds = %71
%77 = load i8*, i8** %13
%78 = load i8, i8* %77
%79 = sext i8 %78 to i32
%80 = icmp eq i32 %79, 10
br i1 %80, label %81, label %83
81: ; preds = %76, %71
%82 = load i8*, i8** %13
store i8 0, i8* %82
br label %83
83: ; preds = %81, %76
%84 = load i8*, i8** %13
%85 = getelementptr inbounds i8, i8* %84, i32 1
store i8* %85, i8** %13
br label %60
86: ; preds = %70, %60
%87 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i8* %87)
%89 = load i8*, i8** %4
%90 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%91 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%92 = call i32 @handler_cmd(i8* %89, i8* %90, i8* %91, i32 1024)
%93 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i8* %93)
%95 = load i32, i32* %9
%96 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%97 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%98 = call i32 @strlen(i8* %97)
%99 = call i64 @send(i32 %95, i8* %96, i32 %98, i32 0)
%100 = icmp slt i64 %99, 0
br i1 %100, label %101, label %103
101: ; preds = %86
%102 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
br label %103
103: ; preds = %101, %86
br label %104
104: ; preds = %103
br label %105
105: ; preds = %104
br label %40
106: ; preds = %54, %49
%107 = load i32, i32* %9
%108 = call i32 @close(i32 %107)
%109 = call i32 @exit(i32 0)
unreachable
110: ; preds = %27
%111 = load i32, i32* %9
%112 = call i32 @close(i32 %111)
br label %18
}

LLVM IR (-O2):
%struct.sockaddr_storage = type { i32 }
%struct.sockaddr = type { i32 }
@INET6_ADDRSTRLEN = global i32 0
@.str = [7 x i8] c"accept\00"
@.str.1 = [25 x i8] c"Got connection from %s\0D\0A\00"
@.str.2 = [5 x i8] c"recv\00"
@.str.4 = [20 x i8] c"Received %d bytes\0D\0A\00"
@.str.5 = [22 x i8] c"Received cmd: [%s ]\0D\0A\00"
@.str.6 = [25 x i8] c"Sending response: [%s]\0D\0A\00"
@.str.7 = [5 x i8] c"send\00"
@str = [34 x i8] c"Remote end closed the connection\0D\00"
define void @accept_conn(i32 %0, i8* %1) {
%3 = alloca %struct.sockaddr_storage
%4 = alloca i32
%5 = alloca [1024 x i8]
%6 = alloca [1024 x i8]
%7 = bitcast %struct.sockaddr_storage* %3 to i8*
%8 = load i32, i32* @INET6_ADDRSTRLEN
%9 = zext i32 %8 to i64
%10 = alloca i8, i64 %9
%11 = bitcast i32* %4 to i8*
%12 = getelementptr inbounds %struct.sockaddr_storage, %struct.sockaddr_storage* %3, i64 0, i32 0
%13 = bitcast %struct.sockaddr_storage* %3 to %struct.sockaddr*
br label %14
14: ; preds = %19, %2
store i32 4, i32* %4
%15 = call i32 @accept(i32 %0, %struct.sockaddr* %13, i32* %4)
%16 = icmp eq i32 %15, -1
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %68
br label %14
20: ; preds = %14
%21 = load i32, i32* %12
%22 = call i32 @get_in_addr(%struct.sockaddr* %13)
%23 = call i32 @inet_ntop(i32 %21, i32 %22, i8* %10, i32 %8)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%25 = call i32 (...) @fork()
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %68
27: ; preds = %20
%28 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%29 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%30 = call i32 @close(i32 %0)
%31 = call i32 @memset(i8* %28, i32 0, i32 1024)
%32 = call i32 @recv(i32 %15, i8* %28, i32 1024, i32 0)
%33 = icmp slt i32 %32, 0
br i1 %33, label %36, label %34
34: ; preds = %27
%35 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 1024
br label %38
36: ; preds = %61, %27
%37 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %65
38: ; preds = %34, %61
%39 = phi i32 [ %32, %34 ], [ %63, %61 ]
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %38
%42 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
br label %65
43: ; preds = %38
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %39)
br label %45
45: ; preds = %43, %49
%46 = phi i8* [ %28, %43 ], [ %50, %49 ]
%47 = load i8, i8* %46
switch i8 %47, label %49 [
i8 0, label %52
i8 13, label %48
i8 10, label %48
]
48: ; preds = %45, %45
store i8 0, i8* %46
br label %49
49: ; preds = %45, %48
%50 = getelementptr inbounds i8, i8* %46, i64 1
%51 = icmp ult i8* %50, %35
br i1 %51, label %45, label %52
52: ; preds = %45, %49
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i8* %28)
%54 = call i32 @handler_cmd(i8* %1, i8* %28, i8* %29, i32 1024)
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i8* %29)
%56 = call i32 @strlen(i8* %29)
%57 = call i64 @send(i32 %15, i8* %29, i32 %56, i32 0)
%58 = icmp slt i64 %57, 0
br i1 %58, label %59, label %61
59: ; preds = %52
%60 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
br label %61
61: ; preds = %52, %59
%62 = call i32 @memset(i8* %28, i32 0, i32 1024)
%63 = call i32 @recv(i32 %15, i8* %28, i32 1024, i32 0)
%64 = icmp slt i32 %63, 0
br i1 %64, label %36, label %38
65: ; preds = %36, %41
%66 = call i32 @close(i32 %15)
%67 = call i32 @exit(i32 0)
unreachable
68: ; preds = %20
%69 = call i32 @close(i32 %15)
br label %19
}