#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 in_addr {
  int dummy;
};
struct sockaddr_in {
  int /*<<< orphan*/ sin_zero;
  struct in_addr sin_addr;
  int /*<<< orphan*/ sin_port;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
struct hostent {
  scalar_t__ h_addr;
};
typedef int /*<<< orphan*/ servaddr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
scalar_t__ EINPROGRESS;
int /*<<< orphan*/ SOCK_STREAM;
scalar_t__ connect(int, struct sockaddr *, int);
scalar_t__ errno;
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, char, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, int, char *);
int recv(int, char *, int, int /*<<< orphan*/);
int send(int, char *, scalar_t__, int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ strlen(char *);
int strncmp(char *, char *, int);
int pop(struct hostent *he, int port, int count) {
  struct sockaddr_in servaddr;
  char buf[255 + 1] = "\0";
  int sd, num;
  char cmd[255 + 1] = "user me@domain.com\r\n";
  servaddr.sin_family = AF_INET;
  servaddr.sin_port = htons(port);
  servaddr.sin_addr = *((struct in_addr *)he->h_addr);
  memset(&(servaddr.sin_zero), '\0', 8);
  if ((sd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
    perror("socket");
    return 0;
  }
  if (connect(sd, (struct sockaddr *)&servaddr, sizeof(servaddr)) < 0) {
    if (errno != EINPROGRESS)
      return 0;
  }
  num = recv(sd, buf, 255, 0);
  buf[num] = '\0';
  if (strlen(buf) > 0) {
    printf("%i %s", count + 1, buf);
    if (strncmp(buf, "+OK", 3) == 0) {
      if (send(sd, cmd, strlen(cmd) + 1, 0) == -1) {
        perror("send");
        return 0;
      }
      num = recv(sd, buf, 255, 0);
      buf[num] = '\0';
      printf("%i %s\n", count + 1, buf);
      int res = strncmp(buf, "+OK", 3);
      if (res == 0) {
        return 1;
      } else {
        return 0;
      }
    } else {
      return 0;
    }
  }
}


x86 assembly (clang, -O0):
<pop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x260,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
lea    -0x130(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1090 <memset@plt>
lea    -0x240(%rbp),%rdi
lea    0xe1a(%rip),%rsi
mov    $0x100,%edx
call   10a0 <memcpy@plt>
mov    0x2df1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
call   1060 <htons@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
lea    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1090 <memset@plt>
mov    0x2dbe(%rip),%rax
mov    (%rax),%edi
mov    0x2d9d(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10d0 <socket@plt>
mov    %eax,-0x134(%rbp)
cmp    $0x0,%eax
jge    1263 <pop+0xb3>
lea    0xeae(%rip),%rdi
call   10b0 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    141d <pop+0x26d>
mov    -0x134(%rbp),%edi
lea    -0x28(%rbp),%rsi
mov    $0x10,%edx
call   10c0 <connect@plt>
cmp    $0x0,%rax
jge    12ac <pop+0xfc>
mov    0x2d40(%rip),%rax
mov    (%rax),%rax
mov    0x2d4e(%rip),%rcx
cmp    (%rcx),%rax
je     12a7 <pop+0xf7>
movl   $0x0,-0x4(%rbp)
jmp    141d <pop+0x26d>
jmp    12ac <pop+0xfc>
mov    -0x134(%rbp),%edi
lea    -0x130(%rbp),%rsi
mov    $0xff,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x138(%rbp)
movslq -0x138(%rbp),%rax
movb   $0x0,-0x130(%rbp,%rax,1)
lea    -0x130(%rbp),%rdi
call   1050 <strlen@plt>
cmp    $0x0,%rax
jle    141d <pop+0x26d>
mov    -0x18(%rbp),%esi
add    $0x1,%esi
lea    -0x130(%rbp),%rdx
lea    0xe03(%rip),%rdi
call   1080 <printf@plt>
lea    -0x130(%rbp),%rdi
lea    0xdf6(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1416 <pop+0x266>
mov    -0x134(%rbp),%eax
mov    %eax,-0x254(%rbp)
lea    -0x240(%rbp),%rax
mov    %rax,-0x250(%rbp)
lea    -0x240(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x254(%rbp),%edi
mov    -0x250(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
xor    %ecx,%ecx
call   1070 <send@plt>
cmp    $0xffffffff,%eax
jne    138c <pop+0x1dc>
lea    0xd96(%rip),%rdi
call   10b0 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    141d <pop+0x26d>
mov    -0x134(%rbp),%edi
lea    -0x130(%rbp),%rsi
mov    $0xff,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x138(%rbp)
movslq -0x138(%rbp),%rax
movb   $0x0,-0x130(%rbp,%rax,1)
mov    -0x18(%rbp),%esi
add    $0x1,%esi
lea    -0x130(%rbp),%rdx
lea    0xd48(%rip),%rdi
call   1080 <printf@plt>
lea    -0x130(%rbp),%rdi
lea    0xd2c(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
mov    %eax,-0x244(%rbp)
cmpl   $0x0,-0x244(%rbp)
jne    140a <pop+0x25a>
movl   $0x1,-0x4(%rbp)
jmp    141d <pop+0x26d>
movl   $0x0,-0x4(%rbp)
jmp    141d <pop+0x26d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x260,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pop>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x210,%rsp
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
xorps  %xmm0,%xmm0
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
lea    0xdc4(%rip),%rsi
lea    0x110(%rsp),%rdi
mov    $0x100,%edx
call   10a0 <memcpy@plt>
mov    0x2d93(%rip),%r12
mov    (%r12),%eax
mov    %eax,0xc(%rsp)
mov    %ebp,%edi
call   1060 <htons@plt>
mov    %eax,0x8(%rsp)
mov    (%rbx),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
xor    %r15d,%r15d
xor    %esi,%esi
mov    $0x8,%edx
call   1090 <memset@plt>
mov    (%r12),%edi
mov    0x2d42(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10d0 <socket@plt>
test   %eax,%eax
js     13bf <pop+0x20f>
mov    %eax,%ebx
mov    %rsp,%rsi
mov    %eax,%edi
mov    $0x10,%edx
call   10c0 <connect@plt>
test   %rax,%rax
jns    12d2 <pop+0x122>
mov    0x2d0c(%rip),%rax
mov    (%rax),%rax
mov    0x2d1a(%rip),%rcx
xor    %r15d,%r15d
cmp    (%rcx),%rax
jne    13ac <pop+0x1fc>
lea    0x10(%rsp),%rbp
xor    %r15d,%r15d
mov    %ebx,%edi
mov    %rbp,%rsi
mov    $0xff,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cltq
movb   $0x0,0x10(%rsp,%rax,1)
mov    %rbp,%rdi
call   1050 <strlen@plt>
test   %rax,%rax
jle    13ac <pop+0x1fc>
add    $0x1,%r14d
lea    0xdf9(%rip),%rdi
lea    0x10(%rsp),%rbp
mov    %r14d,%esi
mov    %rbp,%rdx
call   1080 <printf@plt>
lea    0xde8(%rip),%rsi
mov    %rbp,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
jne    13ac <pop+0x1fc>
lea    0x110(%rsp),%rbp
mov    %rbp,%rdi
call   1050 <strlen@plt>
lea    0x1(%rax),%rdx
xor    %r15d,%r15d
mov    %ebx,%edi
mov    %rbp,%rsi
xor    %ecx,%ecx
call   1070 <send@plt>
cmp    $0xffffffff,%eax
je     13cd <pop+0x21d>
lea    0x10(%rsp),%rbp
mov    %ebx,%edi
mov    %rbp,%rsi
mov    $0xff,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cltq
movb   $0x0,0x10(%rsp,%rax,1)
lea    0xd94(%rip),%rdi
mov    %r14d,%esi
mov    %rbp,%rdx
call   1080 <printf@plt>
lea    0xd79(%rip),%rsi
mov    %rbp,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
xor    %r15d,%r15d
test   %eax,%eax
sete   %r15b
jmp    13ac <pop+0x1fc>
mov    %r15d,%eax
add    $0x210,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd3a(%rip),%rdi
call   10b0 <perror@plt>
jmp    13ac <pop+0x1fc>
lea    0xd3d(%rip),%rdi
call   10b0 <perror@plt>
jmp    13ac <pop+0x1fc>

LLVM IR (-O0):
%struct.hostent = type { i64 }
%struct.sockaddr_in = type { i32, %struct.in_addr, i32, i32 }
%struct.in_addr = type { i32 }
%struct.sockaddr = type { i32 }
@__const.pop.cmd = [256 x i8] c"user me@domain.com\0D\0A\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [7 x i8] c"socket\00"
@errno = global i64 0
@EINPROGRESS = global i64 0
@.str.1 = [6 x i8] c"%i %s\00"
@.str.2 = [4 x i8] c"+OK\00"
@.str.3 = [5 x i8] c"send\00"
@.str.4 = [7 x i8] c"%i %s\0A\00"
define i32 @pop(%struct.hostent* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.hostent*
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.sockaddr_in
%9 = alloca [256 x i8]
%10 = alloca i32
%11 = alloca i32
%12 = alloca [256 x i8]
%13 = alloca i32
store %struct.hostent* %0, %struct.hostent** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%14 = bitcast [256 x i8]* %9 to i8*
%15 = bitcast [256 x i8]* %12 to i8*
%16 = load i32, i32* @AF_INET
%17 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 3
store i32 %16, i32* %17
%18 = load i32, i32* %6
%19 = call i32 @htons(i32 %18)
%20 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 2
store i32 %19, i32* %20
%21 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 1
%22 = load %struct.hostent*, %struct.hostent** %5
%23 = getelementptr inbounds %struct.hostent, %struct.hostent* %22, i32 0, i32 0
%24 = load i64, i64* %23
%25 = inttoptr i64 %24 to %struct.in_addr*
%26 = bitcast %struct.in_addr* %21 to i8*
%27 = bitcast %struct.in_addr* %25 to i8*
%28 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 0
%29 = call i32 @memset(i32* %28, i8 signext 0, i32 8)
%30 = load i32, i32* @AF_INET
%31 = load i32, i32* @SOCK_STREAM
%32 = call i32 @socket(i32 %30, i32 %31, i32 0)
store i32 %32, i32* %10
%33 = icmp slt i32 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %3
%35 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %93
36: ; preds = %3
%37 = load i32, i32* %10
%38 = bitcast %struct.sockaddr_in* %8 to %struct.sockaddr*
%39 = call i64 @connect(i32 %37, %struct.sockaddr* %38, i32 16)
%40 = icmp slt i64 %39, 0
br i1 %40, label %41, label %47
41: ; preds = %36
%42 = load i64, i64* @errno
%43 = load i64, i64* @EINPROGRESS
%44 = icmp ne i64 %42, %43
br i1 %44, label %45, label %46
45: ; preds = %41
store i32 0, i32* %4
br label %93
46: ; preds = %41
br label %47
47: ; preds = %46, %36
%48 = load i32, i32* %10
%49 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%50 = call i32 @recv(i32 %48, i8* %49, i32 255, i32 0)
store i32 %50, i32* %11
%51 = load i32, i32* %11
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 %52
store i8 0, i8* %53
%54 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%55 = call i64 @strlen(i8* %54)
%56 = icmp sgt i64 %55, 0
br i1 %56, label %57, label %93
57: ; preds = %47
%58 = load i32, i32* %7
%59 = add nsw i32 %58, 1
%60 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%61 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %59, i8* %60)
%62 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%63 = call i32 @strncmp(i8* %62, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 3)
%64 = icmp eq i32 %63, 0
br i1 %64, label %65, label %92
65: ; preds = %57
%66 = load i32, i32* %10
%67 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%68 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%69 = call i64 @strlen(i8* %68)
%70 = add nsw i64 %69, 1
%71 = call i32 @send(i32 %66, i8* %67, i64 %70, i32 0)
%72 = icmp eq i32 %71, -1
br i1 %72, label %73, label %75
73: ; preds = %65
%74 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %4
br label %93
75: ; preds = %65
%76 = load i32, i32* %10
%77 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%78 = call i32 @recv(i32 %76, i8* %77, i32 255, i32 0)
store i32 %78, i32* %11
%79 = load i32, i32* %11
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 %80
store i8 0, i8* %81
%82 = load i32, i32* %7
%83 = add nsw i32 %82, 1
%84 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%85 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 %83, i8* %84)
%86 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%87 = call i32 @strncmp(i8* %86, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 3)
store i32 %87, i32* %13
%88 = load i32, i32* %13
%89 = icmp eq i32 %88, 0
br i1 %89, label %90, label %91
90: ; preds = %75
store i32 1, i32* %4
br label %93
91: ; preds = %75
store i32 0, i32* %4
br label %93
92: ; preds = %57
store i32 0, i32* %4
br label %93
93: ; preds = %34, %45, %73, %90, %91, %92, %47
%94 = load i32, i32* %4
ret i32 %94
}

LLVM IR (-O2):
%struct.hostent = type { i64 }
%struct.sockaddr_in = type { i32, %struct.in_addr, i32, i32 }
%struct.in_addr = type { i32 }
%struct.sockaddr = type { i32 }
@__const.pop.cmd = [256 x i8] c"user me@domain.com\0D\0A\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [7 x i8] c"socket\00"
@errno = global i64 0
@EINPROGRESS = global i64 0
@.str.1 = [6 x i8] c"%i %s\00"
@.str.2 = [4 x i8] c"+OK\00"
@.str.3 = [5 x i8] c"send\00"
@.str.4 = [7 x i8] c"%i %s\0A\00"
define i32 @pop(%struct.hostent* nocapture %0, i32 %1, i32 %2) {
%4 = alloca %struct.sockaddr_in
%5 = alloca [256 x i8]
%6 = alloca [256 x i8]
%7 = bitcast %struct.sockaddr_in* %4 to i8*
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%10 = load i32, i32* @AF_INET
%11 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 3
store i32 %10, i32* %11
%12 = tail call i32 @htons(i32 %1)
%13 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 2
store i32 %12, i32* %13
%14 = getelementptr inbounds %struct.hostent, %struct.hostent* %0, i64 0, i32 0
%15 = load i64, i64* %14
%16 = inttoptr i64 %15 to i32*
%17 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 1, i32 0
%18 = load i32, i32* %16
store i32 %18, i32* %17
%19 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 0
%20 = call i32 @memset(i32* %19, i8 signext 0, i32 8)
%21 = load i32, i32* @AF_INET
%22 = load i32, i32* @SOCK_STREAM
%23 = call i32 @socket(i32 %21, i32 %22, i32 0)
%24 = icmp slt i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %3
%26 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %61
27: ; preds = %3
%28 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%29 = call i64 @connect(i32 %23, %struct.sockaddr* %28, i32 16)
%30 = icmp slt i64 %29, 0
br i1 %30, label %31, label %35
31: ; preds = %27
%32 = load i64, i64* @errno
%33 = load i64, i64* @EINPROGRESS
%34 = icmp eq i64 %32, %33
br i1 %34, label %35, label %61
35: ; preds = %31, %27
%36 = call i32 @recv(i32 %23, i8* %8, i32 255, i32 0)
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 %37
store i8 0, i8* %38
%39 = call i64 @strlen(i8* %8)
%40 = icmp sgt i64 %39, 0
br i1 %40, label %41, label %61
41: ; preds = %35
%42 = add nsw i32 %2, 1
%43 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %42, i8* %8)
%44 = call i32 @strncmp(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 3)
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %61
46: ; preds = %41
%47 = call i64 @strlen(i8* %9)
%48 = add nsw i64 %47, 1
%49 = call i32 @send(i32 %23, i8* %9, i64 %48, i32 0)
%50 = icmp eq i32 %49, -1
br i1 %50, label %51, label %53
51: ; preds = %46
%52 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %61
53: ; preds = %46
%54 = call i32 @recv(i32 %23, i8* %8, i32 255, i32 0)
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 %55
store i8 0, i8* %56
%57 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 %42, i8* %8)
%58 = call i32 @strncmp(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 3)
%59 = icmp eq i32 %58, 0
%60 = zext i1 %59 to i32
br label %61
61: ; preds = %35, %41, %31, %53, %51, %25
%62 = phi i32 [ 0, %25 ], [ 0, %51 ], [ %60, %53 ], [ 0, %31 ], [ 0, %41 ], [ undef, %35 ]
ret i32 %62
}