#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 */
typedef int /*<<< orphan*/ fd_set;
typedef int /*<<< orphan*/ command;

/* Variables and functions */
scalar_t__ FD_ISSET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ recv(int, char *, int, int /*<<< orphan*/);
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, int /*<<< orphan*/ *);
scalar_t__ send(int, char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
scalar_t__ strcmp(char *, char *);
int strlen(char *);
void receive_Chat(char send_name[256], int send_sockfd, int recv_sockfd) {
  fd_set read_fds;
  fd_set tmp_fds;
  int fdmax;
  FD_ZERO(&read_fds);
  FD_ZERO(&tmp_fds);
  FD_SET(send_sockfd, &read_fds);
  FD_SET(0, &read_fds);
  fdmax = send_sockfd;
  char command[1024];
  sprintf(command, "ok");
  if (send(send_sockfd, command, strlen(command), 0) < 0) {
    fprintf(stderr, "ERROR: Unable writing on socket!\n");
    return;
  }
  printf("INFO: Chat activated!\n");
  while (1) {
    tmp_fds = read_fds;
    if (select(fdmax + 1, &tmp_fds, NULL, NULL, NULL) == -1) {
      fprintf(stderr, "ERROR CLIENT: Unable in select!\n");
      return;
    }
    if (FD_ISSET(0, &tmp_fds)) {
      memset(command, 0, 1024);
      if (fgets(command, sizeof(command), stdin) != NULL) {
        command[strlen(command) - 1] = '\0';
        if (send(send_sockfd, command, strlen(command), 0) < 0) {
          fprintf(stderr, "ERROR: Unable writing on socket!\n");
          return;
        }
        if (strcmp(command, "exit") == 0) {
          printf("INFO: Chat deactivated!\n");
          return;
        }
      }
    }
    if (FD_ISSET(send_sockfd, &tmp_fds)) {
      memset(command, 0, 1024);
      if (recv(recv_sockfd, command, sizeof(command), 0) <= 0) {
        fprintf(stderr, "ERROR: Unable reading from socket!\n");
        return;
      }
      if (strcmp(command, "exit") == 0) {
        printf("INFO: %s left the conversation!\n", send_name);
        return;
      }
      printf("%s: %s\n", send_name, command);
    }
  }
}


x86 assembly (clang, -O0):
<receive_Chat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x440,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
call   10c0 <FD_ZERO@plt>
lea    -0x18(%rbp),%rdi
call   10c0 <FD_ZERO@plt>
mov    -0xc(%rbp),%edi
lea    -0x14(%rbp),%rsi
call   10f0 <FD_SET@plt>
xor    %edi,%edi
lea    -0x14(%rbp),%rsi
call   10f0 <FD_SET@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    -0x420(%rbp),%rdi
lea    0xdde(%rip),%rsi
call   10e0 <sprintf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x42c(%rbp)
lea    -0x420(%rbp),%rax
mov    %rax,-0x428(%rbp)
lea    -0x420(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x42c(%rbp),%edi
mov    -0x428(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
cmp    $0x0,%rax
jge    1284 <receive_Chat+0xb4>
mov    0x2d67(%rip),%rax
mov    (%rax),%edi
lea    0xd89(%rip),%rsi
call   10b0 <fprintf@plt>
jmp    1486 <receive_Chat+0x2b6>
lea    0xd9a(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%edi
add    $0x1,%edi
lea    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdx
mov    %r8,%rcx
call   10d0 <select@plt>
cmp    $0xffffffff,%eax
jne    12d5 <receive_Chat+0x105>
mov    0x2d16(%rip),%rax
mov    (%rax),%edi
lea    0xd71(%rip),%rsi
call   10b0 <fprintf@plt>
jmp    1486 <receive_Chat+0x2b6>
xor    %edi,%edi
lea    -0x18(%rbp),%rsi
call   1040 <FD_ISSET@plt>
cmp    $0x0,%rax
je     13d1 <receive_Chat+0x201>
lea    -0x420(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1080 <memset@plt>
lea    -0x420(%rbp),%rdi
mov    0x2cdd(%rip),%rax
mov    (%rax),%edx
mov    $0x400,%esi
call   1090 <fgets@plt>
cmp    $0x0,%rax
je     13cc <receive_Chat+0x1fc>
lea    -0x420(%rbp),%rdi
call   1050 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0x420(%rbp,%rax,1)
mov    -0xc(%rbp),%eax
mov    %eax,-0x43c(%rbp)
lea    -0x420(%rbp),%rax
mov    %rax,-0x438(%rbp)
lea    -0x420(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x43c(%rbp),%edi
mov    -0x438(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
cmp    $0x0,%rax
jge    1397 <receive_Chat+0x1c7>
mov    0x2c54(%rip),%rax
mov    (%rax),%edi
lea    0xc76(%rip),%rsi
call   10b0 <fprintf@plt>
jmp    1486 <receive_Chat+0x2b6>
lea    -0x420(%rbp),%rdi
lea    0xcb8(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    13c7 <receive_Chat+0x1f7>
lea    0xca7(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1486 <receive_Chat+0x2b6>
jmp    13cc <receive_Chat+0x1fc>
jmp    13d1 <receive_Chat+0x201>
mov    -0xc(%rbp),%edi
lea    -0x18(%rbp),%rsi
call   1040 <FD_ISSET@plt>
cmp    $0x0,%rax
je     1481 <receive_Chat+0x2b1>
lea    -0x420(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1080 <memset@plt>
mov    -0x10(%rbp),%edi
lea    -0x420(%rbp),%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0x0,%rax
jg     1434 <receive_Chat+0x264>
mov    0x2bb7(%rip),%rax
mov    (%rax),%edi
lea    0xc51(%rip),%rsi
call   10b0 <fprintf@plt>
jmp    1486 <receive_Chat+0x2b6>
lea    -0x420(%rbp),%rdi
lea    0xc1b(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1468 <receive_Chat+0x298>
mov    -0x8(%rbp),%rsi
lea    0xc43(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1486 <receive_Chat+0x2b6>
mov    -0x8(%rbp),%rsi
lea    -0x420(%rbp),%rdx
lea    0xc46(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1292 <receive_Chat+0xc2>
add    $0x440,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<receive_Chat>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x418,%rsp
mov    %edx,%r15d
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xc(%rsp),%rbp
mov    %rbp,%rdi
call   10d0 <FD_ZERO@plt>
lea    0x8(%rsp),%rdi
call   10d0 <FD_ZERO@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
call   10f0 <FD_SET@plt>
xor    %edi,%edi
mov    %rbp,%rsi
call   10f0 <FD_SET@plt>
movb   $0x0,0x12(%rsp)
movw   $0x6b6f,0x10(%rsp)
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
call   1060 <strlen@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1070 <send@plt>
test   %rax,%rax
js     1396 <receive_Chat+0x1c6>
lea    0xe4d(%rip),%rdi
call   1040 <puts@plt>
lea    0x1(%rbx),%r12d
mov    0xc(%rsp),%eax
mov    %eax,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    %r12d,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   10e0 <select@plt>
cmp    $0xffffffff,%eax
je     13a8 <receive_Chat+0x1d8>
lea    0x8(%rsp),%r13
jmp    12b7 <receive_Chat+0xe7>
lea    0xe09(%rip),%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1080 <printf@plt>
mov    0xc(%rsp),%eax
mov    %eax,0x8(%rsp)
mov    %r12d,%edi
mov    %r13,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   10e0 <select@plt>
cmp    $0xffffffff,%eax
je     13a8 <receive_Chat+0x1d8>
xor    %edi,%edi
mov    %r13,%rsi
call   1050 <FD_ISSET@plt>
test   %rax,%rax
je     1332 <receive_Chat+0x162>
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1090 <memset@plt>
mov    0x2d0c(%rip),%rax
mov    (%rax),%edx
mov    %rbp,%rdi
mov    $0x400,%esi
call   10a0 <fgets@plt>
test   %rax,%rax
je     1332 <receive_Chat+0x162>
mov    %rbp,%rdi
call   1060 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbp,1)
mov    %rbp,%rdi
call   1060 <strlen@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1070 <send@plt>
test   %rax,%rax
js     1396 <receive_Chat+0x1c6>
mov    %rbp,%rdi
lea    0xd22(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     13e1 <receive_Chat+0x211>
mov    %ebx,%edi
mov    %r13,%rsi
call   1050 <FD_ISSET@plt>
test   %rax,%rax
je     1294 <receive_Chat+0xc4>
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1090 <memset@plt>
mov    %r15d,%edi
mov    %rbp,%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
test   %rax,%rax
jle    13cf <receive_Chat+0x1ff>
mov    %rbp,%rdi
lea    0xcd1(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
jne    1280 <receive_Chat+0xb0>
lea    0xce5(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
jmp    13bd <receive_Chat+0x1ed>
mov    0x2c3b(%rip),%rax
mov    (%rax),%edi
lea    0xc5d(%rip),%rsi
jmp    13b8 <receive_Chat+0x1e8>
mov    0x2c29(%rip),%rax
mov    (%rax),%edi
lea    0xc6d(%rip),%rsi
call   10c0 <fprintf@plt>
add    $0x418,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c02(%rip),%rax
mov    (%rax),%edi
lea    0xc6c(%rip),%rsi
jmp    13b8 <receive_Chat+0x1e8>
lea    0xcc6(%rip),%rdi
call   1040 <puts@plt>
jmp    13bd <receive_Chat+0x1ed>

LLVM IR (-O0):
@.str = [3 x i8] c"ok\00"
@stderr = global i32 0
@.str.1 = [34 x i8] c"ERROR: Unable writing on socket!\0A\00"
@.str.2 = [23 x i8] c"INFO: Chat activated!\0A\00"
@.str.3 = [33 x i8] c"ERROR CLIENT: Unable in select!\0A\00"
@stdin = global i32 0
@.str.4 = [5 x i8] c"exit\00"
@.str.5 = [25 x i8] c"INFO: Chat deactivated!\0A\00"
@.str.6 = [36 x i8] c"ERROR: Unable reading from socket!\0A\00"
@.str.7 = [33 x i8] c"INFO: %s left the conversation!\0A\00"
@.str.8 = [8 x i8] c"%s: %s\0A\00"
define void @receive_Chat(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca [1024 x i8]
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%11 = call i32 @FD_ZERO(i32* %7)
%12 = call i32 @FD_ZERO(i32* %8)
%13 = load i32, i32* %5
%14 = call i32 @FD_SET(i32 %13, i32* %7)
%15 = call i32 @FD_SET(i32 0, i32* %7)
%16 = load i32, i32* %5
store i32 %16, i32* %9
%17 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%18 = call i32 @sprintf(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%19 = load i32, i32* %5
%20 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%21 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%22 = call i32 @strlen(i8* %21)
%23 = call i64 @send(i32 %19, i8* %20, i32 %22, i32 0)
%24 = icmp slt i64 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %3
%26 = load i32, i32* @stderr
%27 = call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %98
28: ; preds = %3
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %30
30: ; preds = %28, %97
%31 = load i32, i32* %7
store i32 %31, i32* %8
%32 = load i32, i32* %9
%33 = add nsw i32 %32, 1
%34 = call i32 @select(i32 %33, i32* %8, i32* null, i32* null, i32* null)
%35 = icmp eq i32 %34, -1
br i1 %35, label %36, label %39
36: ; preds = %30
%37 = load i32, i32* @stderr
%38 = call i32 @fprintf(i32 %37, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
br label %98
39: ; preds = %30
%40 = call i64 @FD_ISSET(i32 0, i32* %8)
%41 = icmp ne i64 %40, 0
br i1 %41, label %42, label %72
42: ; preds = %39
%43 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%44 = call i32 @memset(i8* %43, i32 0, i32 1024)
%45 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%46 = load i32, i32* @stdin
%47 = call i32* @fgets(i8* %45, i32 1024, i32 %46)
%48 = icmp ne i32* %47, null
br i1 %48, label %49, label %71
49: ; preds = %42
%50 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%51 = call i32 @strlen(i8* %50)
%52 = sub nsw i32 %51, 1
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 %53
store i8 0, i8* %54
%55 = load i32, i32* %5
%56 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%57 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%58 = call i32 @strlen(i8* %57)
%59 = call i64 @send(i32 %55, i8* %56, i32 %58, i32 0)
%60 = icmp slt i64 %59, 0
br i1 %60, label %61, label %64
61: ; preds = %49
%62 = load i32, i32* @stderr
%63 = call i32 @fprintf(i32 %62, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %98
64: ; preds = %49
%65 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%66 = call i64 @strcmp(i8* %65, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%67 = icmp eq i64 %66, 0
br i1 %67, label %68, label %70
68: ; preds = %64
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
br label %98
70: ; preds = %64
br label %71
71: ; preds = %70, %42
br label %72
72: ; preds = %71, %39
%73 = load i32, i32* %5
%74 = call i64 @FD_ISSET(i32 %73, i32* %8)
%75 = icmp ne i64 %74, 0
br i1 %75, label %76, label %97
76: ; preds = %72
%77 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%78 = call i32 @memset(i8* %77, i32 0, i32 1024)
%79 = load i32, i32* %6
%80 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%81 = call i64 @recv(i32 %79, i8* %80, i32 1024, i32 0)
%82 = icmp sle i64 %81, 0
br i1 %82, label %83, label %86
83: ; preds = %76
%84 = load i32, i32* @stderr
%85 = call i32 @fprintf(i32 %84, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.6, i64 0, i64 0))
br label %98
86: ; preds = %76
%87 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%88 = call i64 @strcmp(i8* %87, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%89 = icmp eq i64 %88, 0
br i1 %89, label %90, label %93
90: ; preds = %86
%91 = load i8*, i8** %4
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i8* %91)
br label %98
93: ; preds = %86
%94 = load i8*, i8** %4
%95 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i8* %94, i8* %95)
br label %97
97: ; preds = %93, %72
br label %30
98: ; preds = %90, %83, %68, %61, %36, %25
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"ok\00"
@stderr = global i32 0
@.str.1 = [34 x i8] c"ERROR: Unable writing on socket!\0A\00"
@.str.3 = [33 x i8] c"ERROR CLIENT: Unable in select!\0A\00"
@stdin = global i32 0
@.str.4 = [5 x i8] c"exit\00"
@.str.6 = [36 x i8] c"ERROR: Unable reading from socket!\0A\00"
@.str.7 = [33 x i8] c"INFO: %s left the conversation!\0A\00"
@.str.8 = [8 x i8] c"%s: %s\0A\00"
@str = [22 x i8] c"INFO: Chat activated!\00"
@str.9 = [24 x i8] c"INFO: Chat deactivated!\00"
define void @receive_Chat(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca [1024 x i8]
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = call i32 @FD_ZERO(i32* %4)
%10 = call i32 @FD_ZERO(i32* %5)
%11 = call i32 @FD_SET(i32 %1, i32* %4)
%12 = call i32 @FD_SET(i32 0, i32* %4)
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%14 = call i32 @strlen(i8* %13)
%15 = call i64 @send(i32 %1, i8* %13, i32 %14, i32 0)
%16 = icmp slt i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %3
%18 = load i32, i32* @stderr
%19 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %74
20: ; preds = %3
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%22 = add nsw i32 %1, 1
%23 = load i32, i32* %4
store i32 %23, i32* %5
%24 = call i32 @select(i32 %22, i32* %5, i32* null, i32* null, i32* null)
%25 = icmp eq i32 %24, -1
br i1 %25, label %26, label %29
26: ; preds = %70, %20
%27 = load i32, i32* @stderr
%28 = call i32 @fprintf(i32 %27, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
br label %74
29: ; preds = %20, %70
%30 = call i64 @FD_ISSET(i32 0, i32* %5)
%31 = icmp eq i64 %30, 0
br i1 %31, label %53, label %32
32: ; preds = %29
%33 = call i32 @memset(i8* %13, i32 0, i32 1024)
%34 = load i32, i32* @stdin
%35 = call i32* @fgets(i8* %13, i32 1024, i32 %34)
%36 = icmp eq i32* %35, null
br i1 %36, label %53, label %37
37: ; preds = %32
%38 = call i32 @strlen(i8* %13)
%39 = add nsw i32 %38, -1
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 %40
store i8 0, i8* %41
%42 = call i32 @strlen(i8* %13)
%43 = call i64 @send(i32 %1, i8* %13, i32 %42, i32 0)
%44 = icmp slt i64 %43, 0
br i1 %44, label %45, label %48
45: ; preds = %37
%46 = load i32, i32* @stderr
%47 = call i32 @fprintf(i32 %46, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %74
48: ; preds = %37
%49 = call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %48
%52 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.9, i64 0, i64 0))
br label %74
53: ; preds = %32, %48, %29
%54 = call i64 @FD_ISSET(i32 %1, i32* %5)
%55 = icmp eq i64 %54, 0
br i1 %55, label %70, label %56
56: ; preds = %53
%57 = call i32 @memset(i8* %13, i32 0, i32 1024)
%58 = call i64 @recv(i32 %2, i8* %13, i32 1024, i32 0)
%59 = icmp slt i64 %58, 1
br i1 %59, label %60, label %63
60: ; preds = %56
%61 = load i32, i32* @stderr
%62 = call i32 @fprintf(i32 %61, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.6, i64 0, i64 0))
br label %74
63: ; preds = %56
%64 = call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%65 = icmp eq i64 %64, 0
br i1 %65, label %66, label %68
66: ; preds = %63
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i8* %0)
br label %74
68: ; preds = %63
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i8* %0, i8* %13)
br label %70
70: ; preds = %68, %53
%71 = load i32, i32* %4
store i32 %71, i32* %5
%72 = call i32 @select(i32 %22, i32* %5, i32* null, i32* null, i32* null)
%73 = icmp eq i32 %72, -1
br i1 %73, label %26, label %29
74: ; preds = %66, %60, %51, %45, %26, %17
ret void
}