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

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
scalar_t__ FD_ISSET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int STDOUT_FILENO;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int fileno(int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int read(int, char *, int);
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ *stdin;
scalar_t__ strcmp(char *, char *);
int strlen(char *);
int /*<<< orphan*/ write(int, char *, int);
void send_and_recv(int connfd) {
  FILE *fp = stdin;
  int lens;
  char send[1024];
  char recv[1024];
  fd_set rset;
  FD_ZERO(&rset);
  int maxfd = (fileno(fp) > connfd ? fileno(fp) : connfd + 1);
  int n;
  while (1) {
    FD_SET(fileno(fp), &rset);
    FD_SET(connfd, &rset);
    if (select(maxfd, &rset, NULL, NULL, NULL) == -1) {
      printf("Client Select Error..\n");
      exit(EXIT_FAILURE);
    }
    if (FD_ISSET(connfd, &rset)) {
      printf("client get from server ...\n");
      memset(recv, 0, sizeof(recv));
      n = read(connfd, recv, 1024);
      if (n == 0) {
        printf("Recv ok...\n");
        break;
      } else if (n == -1) {
        printf("Recv error...\n");
        break;
      } else {
        lens = strlen(recv);
        recv[lens] = '\0';
        write(STDOUT_FILENO, recv, 1024);
        printf("\n");
      }
    }
    if (FD_ISSET(fileno(fp), &rset)) {
      memset(send, 0, sizeof(send));
      if (fgets(send, 1024, fp) == NULL) {
        printf("End...\n");
        exit(EXIT_FAILURE);
      } else {
        lens = strlen(send);
        send[lens - 1] = '\0';
        if (strcmp(send, "q") == 0) {
          printf("Bye..\n");
          return;
        }
        printf("Client send : %s\n", send);
        write(connfd, send, strlen(send));
      }
    }
  }
}


x86 assembly (clang, -O0):
<send_and_recv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x840,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2dfb(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
lea    -0x824(%rbp),%rdi
call   10c0 <FD_ZERO@plt>
mov    -0x10(%rbp),%rdi
call   10b0 <fileno@plt>
cmp    -0x4(%rbp),%eax
jle    121e <send_and_recv+0x4e>
mov    -0x10(%rbp),%rdi
call   10b0 <fileno@plt>
mov    %eax,-0x830(%rbp)
jmp    122a <send_and_recv+0x5a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x830(%rbp)
mov    -0x830(%rbp),%eax
mov    %eax,-0x828(%rbp)
mov    -0x10(%rbp),%rdi
call   10b0 <fileno@plt>
mov    %eax,%edi
lea    -0x824(%rbp),%rsi
call   10f0 <FD_SET@plt>
mov    -0x4(%rbp),%edi
lea    -0x824(%rbp),%rsi
call   10f0 <FD_SET@plt>
mov    -0x828(%rbp),%edi
lea    -0x824(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdx
mov    %r8,%rcx
call   10d0 <select@plt>
cmp    $0xffffffff,%eax
jne    129e <send_and_recv+0xce>
lea    0xd77(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2d39(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
mov    -0x4(%rbp),%edi
lea    -0x824(%rbp),%rsi
call   1040 <FD_ISSET@plt>
cmp    $0x0,%rax
je     137f <send_and_recv+0x1af>
lea    0xd59(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x820(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1070 <memset@plt>
mov    -0x4(%rbp),%edi
lea    -0x820(%rbp),%rsi
mov    $0x400,%edx
call   1080 <read@plt>
mov    %eax,-0x82c(%rbp)
cmpl   $0x0,-0x82c(%rbp)
jne    1312 <send_and_recv+0x142>
lea    0xd2d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1493 <send_and_recv+0x2c3>
cmpl   $0xffffffff,-0x82c(%rbp)
jne    1332 <send_and_recv+0x162>
lea    0xd19(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1493 <send_and_recv+0x2c3>
lea    -0x820(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
movb   $0x0,-0x820(%rbp,%rax,1)
mov    0x2c9c(%rip),%rax
mov    (%rax),%edi
lea    -0x820(%rbp),%rsi
mov    $0x400,%edx
call   1030 <write@plt>
lea    0xcc3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    137a <send_and_recv+0x1aa>
jmp    137f <send_and_recv+0x1af>
mov    -0x10(%rbp),%rdi
call   10b0 <fileno@plt>
mov    %eax,%edi
lea    -0x824(%rbp),%rsi
call   1040 <FD_ISSET@plt>
cmp    $0x0,%rax
je     148e <send_and_recv+0x2be>
lea    -0x420(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1070 <memset@plt>
lea    -0x420(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x400,%esi
call   1090 <fgets@plt>
cmp    $0x0,%rax
jne    13ee <send_and_recv+0x21e>
lea    0xc75(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2be9(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
lea    -0x420(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
cltq
movb   $0x0,-0x420(%rbp,%rax,1)
lea    -0x420(%rbp),%rdi
lea    0xc3b(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    143d <send_and_recv+0x26d>
lea    0xc27(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1493 <send_and_recv+0x2c3>
lea    -0x420(%rbp),%rsi
lea    0xc14(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x83c(%rbp)
lea    -0x420(%rbp),%rax
mov    %rax,-0x838(%rbp)
lea    -0x420(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x83c(%rbp),%edi
mov    -0x838(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
jmp    148e <send_and_recv+0x2be>
jmp    1236 <send_and_recv+0x66>
add    $0x840,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_and_recv>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x818,%rsp
mov    %edi,%ebx
mov    0x2dd6(%rip),%rax
mov    (%rax),%r14
lea    0xc(%rsp),%rdi
call   10e0 <FD_ZERO@plt>
mov    %r14,%rdi
call   10d0 <fileno@plt>
cmp    %ebx,%eax
jle    1230 <send_and_recv+0x40>
mov    %r14,%rdi
call   10d0 <fileno@plt>
mov    %eax,%r15d
jmp    1234 <send_and_recv+0x44>
lea    0x1(%rbx),%r15d
mov    %r14,%rdi
call   10d0 <fileno@plt>
lea    0xc(%rsp),%rbp
mov    %eax,%edi
mov    %rbp,%rsi
call   1110 <FD_SET@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
call   1110 <FD_SET@plt>
mov    %r15d,%edi
mov    %rbp,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   10f0 <select@plt>
cmp    $0xffffffff,%eax
je     1400 <send_and_recv+0x210>
lea    0xc(%rsp),%r13
lea    0x410(%rsp),%rbp
lea    0x10(%rsp),%r12
jmp    12c7 <send_and_recv+0xd7>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   10d0 <fileno@plt>
mov    %eax,%edi
mov    %r13,%rsi
call   1110 <FD_SET@plt>
mov    %ebx,%edi
mov    %r13,%rsi
call   1110 <FD_SET@plt>
mov    %r15d,%edi
mov    %r13,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   10f0 <select@plt>
cmp    $0xffffffff,%eax
je     1400 <send_and_recv+0x210>
mov    %ebx,%edi
mov    %r13,%rsi
call   1060 <FD_ISSET@plt>
test   %rax,%rax
je     1340 <send_and_recv+0x150>
lea    0xd44(%rip),%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1090 <memset@plt>
mov    %ebx,%edi
mov    %r12,%rsi
mov    $0x400,%edx
call   10a0 <read@plt>
cmp    $0xffffffff,%eax
je     13d0 <send_and_recv+0x1e0>
test   %eax,%eax
je     13d9 <send_and_recv+0x1e9>
mov    %r12,%rdi
call   1070 <strlen@plt>
cltq
movb   $0x0,0x10(%rsp,%rax,1)
mov    0x2cc9(%rip),%rax
mov    (%rax),%edi
mov    %r12,%rsi
mov    $0x400,%edx
call   1050 <write@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
call   10d0 <fileno@plt>
mov    %eax,%edi
mov    %r13,%rsi
call   1060 <FD_ISSET@plt>
test   %rax,%rax
je     1290 <send_and_recv+0xa0>
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1090 <memset@plt>
mov    %rbp,%rdi
mov    $0x400,%esi
mov    %r14,%rdx
call   10b0 <fgets@plt>
test   %rax,%rax
je     1409 <send_and_recv+0x219>
mov    %rbp,%rdi
call   1070 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbp,1)
mov    %rbp,%rdi
lea    0xc64(%rip),%rsi
call   10c0 <strcmp@plt>
test   %rax,%rax
je     13e2 <send_and_recv+0x1f2>
lea    0xc55(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbp,%rdi
call   1070 <strlen@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %eax,%edx
call   1050 <write@plt>
jmp    1290 <send_and_recv+0xa0>
lea    0xc65(%rip),%rdi
jmp    13e9 <send_and_recv+0x1f9>
lea    0xc6a(%rip),%rdi
jmp    13e9 <send_and_recv+0x1f9>
lea    0xc2b(%rip),%rdi
call   1040 <puts@plt>
add    $0x818,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc4e(%rip),%rdi
jmp    1410 <send_and_recv+0x220>
lea    0xc0a(%rip),%rdi
call   1040 <puts@plt>
mov    0x2bb4(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>

LLVM IR (-O0):
@stdin = global i32* null
@.str = [23 x i8] c"Client Select Error..\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [28 x i8] c"client get from server ...\0A\00"
@.str.2 = [12 x i8] c"Recv ok...\0A\00"
@.str.3 = [15 x i8] c"Recv error...\0A\00"
@STDOUT_FILENO = global i32 0
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [8 x i8] c"End...\0A\00"
@.str.6 = [2 x i8] c"q\00"
@.str.7 = [7 x i8] c"Bye..\0A\00"
@.str.8 = [18 x i8] c"Client send : %s\0A\00"
define void @send_and_recv(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca [1024 x i8]
%6 = alloca [1024 x i8]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %2
%10 = load i32*, i32** @stdin
store i32* %10, i32** %3
%11 = call i32 @FD_ZERO(i32* %7)
%12 = load i32*, i32** %3
%13 = call i32 @fileno(i32* %12)
%14 = load i32, i32* %2
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %19
16: ; preds = %1
%17 = load i32*, i32** %3
%18 = call i32 @fileno(i32* %17)
br label %22
19: ; preds = %1
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
br label %22
22: ; preds = %19, %16
%23 = phi i32 [ %18, %16 ], [ %21, %19 ]
store i32 %23, i32* %8
br label %24
24: ; preds = %22, %106
%25 = load i32*, i32** %3
%26 = call i32 @fileno(i32* %25)
%27 = call i32 @FD_SET(i32 %26, i32* %7)
%28 = load i32, i32* %2
%29 = call i32 @FD_SET(i32 %28, i32* %7)
%30 = load i32, i32* %8
%31 = call i32 @select(i32 %30, i32* %7, i32* null, i32* null, i32* null)
%32 = icmp eq i32 %31, -1
br i1 %32, label %33, label %37
33: ; preds = %24
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%35 = load i32, i32* @EXIT_FAILURE
%36 = call i32 @exit(i32 %35)
unreachable
37: ; preds = %24
%38 = load i32, i32* %2
%39 = call i64 @FD_ISSET(i32 %38, i32* %7)
%40 = icmp ne i64 %39, 0
br i1 %40, label %41, label %69
41: ; preds = %37
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%43 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%44 = call i32 @memset(i8* %43, i32 0, i32 1024)
%45 = load i32, i32* %2
%46 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%47 = call i32 @read(i32 %45, i8* %46, i32 1024)
store i32 %47, i32* %9
%48 = load i32, i32* %9
%49 = icmp eq i32 %48, 0
br i1 %49, label %50, label %52
50: ; preds = %41
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %107
52: ; preds = %41
%53 = load i32, i32* %9
%54 = icmp eq i32 %53, -1
br i1 %54, label %55, label %57
55: ; preds = %52
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
br label %107
57: ; preds = %52
%58 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%59 = call i32 @strlen(i8* %58)
store i32 %59, i32* %4
%60 = load i32, i32* %4
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 %61
store i8 0, i8* %62
%63 = load i32, i32* @STDOUT_FILENO
%64 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%65 = call i32 @write(i32 %63, i8* %64, i32 1024)
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %67
67: ; preds = %57
br label %68
68: ; preds = %67
br label %69
69: ; preds = %68, %37
%70 = load i32*, i32** %3
%71 = call i32 @fileno(i32* %70)
%72 = call i64 @FD_ISSET(i32 %71, i32* %7)
%73 = icmp ne i64 %72, 0
br i1 %73, label %74, label %106
74: ; preds = %69
%75 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%76 = call i32 @memset(i8* %75, i32 0, i32 1024)
%77 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%78 = load i32*, i32** %3
%79 = call i32* @fgets(i8* %77, i32 1024, i32* %78)
%80 = icmp eq i32* %79, null
br i1 %80, label %81, label %85
81: ; preds = %74
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%83 = load i32, i32* @EXIT_FAILURE
%84 = call i32 @exit(i32 %83)
unreachable
85: ; preds = %74
%86 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%87 = call i32 @strlen(i8* %86)
store i32 %87, i32* %4
%88 = load i32, i32* %4
%89 = sub nsw i32 %88, 1
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 %90
store i8 0, i8* %91
%92 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%93 = call i64 @strcmp(i8* %92, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%94 = icmp eq i64 %93, 0
br i1 %94, label %95, label %97
95: ; preds = %85
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
br label %107
97: ; preds = %85
%98 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i8* %98)
%100 = load i32, i32* %2
%101 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%102 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%103 = call i32 @strlen(i8* %102)
%104 = call i32 @write(i32 %100, i8* %101, i32 %103)
br label %105
105: ; preds = %97
br label %106
106: ; preds = %105, %69
br label %24
107: ; preds = %95, %55, %50
ret void
}

LLVM IR (-O2):
@stdin = global i32* null
@EXIT_FAILURE = global i32 0
@STDOUT_FILENO = global i32 0
@.str.6 = [2 x i8] c"q\00"
@.str.8 = [18 x i8] c"Client send : %s\0A\00"
@str = [6 x i8] c"Bye..\00"
@str.9 = [7 x i8] c"End...\00"
@str.10 = [27 x i8] c"client get from server ...\00"
@str.11 = [14 x i8] c"Recv error...\00"
@str.12 = [11 x i8] c"Recv ok...\00"
@str.13 = [22 x i8] c"Client Select Error..\00"
define void @send_and_recv(i32 %0) {
%2 = alloca [1024 x i8]
%3 = alloca [1024 x i8]
%4 = alloca i32
%5 = load i32*, i32** @stdin
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%8 = bitcast i32* %4 to i8*
%9 = call i32 @FD_ZERO(i32* %4)
%10 = call i32 @fileno(i32* %5)
%11 = icmp sgt i32 %10, %0
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = call i32 @fileno(i32* %5)
br label %16
14: ; preds = %1
%15 = add nsw i32 %0, 1
br label %16
16: ; preds = %14, %12
%17 = phi i32 [ %13, %12 ], [ %15, %14 ]
%18 = call i32 @fileno(i32* %5)
%19 = call i32 @FD_SET(i32 %18, i32* %4)
%20 = call i32 @FD_SET(i32 %0, i32* %4)
%21 = call i32 @select(i32 %17, i32* %4, i32* null, i32* null, i32* null)
%22 = icmp eq i32 %21, -1
br i1 %22, label %23, label %27
23: ; preds = %64, %16
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.13, i64 0, i64 0))
%25 = load i32, i32* @EXIT_FAILURE
%26 = call i32 @exit(i32 %25)
unreachable
27: ; preds = %16, %64
%28 = call i64 @FD_ISSET(i32 %0, i32* %4)
%29 = icmp eq i64 %28, 0
br i1 %29, label %41, label %30
30: ; preds = %27
%31 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.10, i64 0, i64 0))
%32 = call i32 @memset(i8* %7, i32 0, i32 1024)
%33 = call i32 @read(i32 %0, i8* %7, i32 1024)
switch i32 %33, label %34 [
i32 0, label %71
i32 -1, label %70
]
34: ; preds = %30
%35 = call i32 @strlen(i8* %7)
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 %36
store i8 0, i8* %37
%38 = load i32, i32* @STDOUT_FILENO
%39 = call i32 @write(i32 %38, i8* %7, i32 1024)
%40 = call i32 @putchar(i32 10)
br label %41
41: ; preds = %34, %27
%42 = call i32 @fileno(i32* %5)
%43 = call i64 @FD_ISSET(i32 %42, i32* %4)
%44 = icmp eq i64 %43, 0
br i1 %44, label %64, label %45
45: ; preds = %41
%46 = call i32 @memset(i8* %6, i32 0, i32 1024)
%47 = call i32* @fgets(i8* %6, i32 1024, i32* %5)
%48 = icmp eq i32* %47, null
br i1 %48, label %49, label %53
49: ; preds = %45
%50 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.9, i64 0, i64 0))
%51 = load i32, i32* @EXIT_FAILURE
%52 = call i32 @exit(i32 %51)
unreachable
53: ; preds = %45
%54 = call i32 @strlen(i8* %6)
%55 = add nsw i32 %54, -1
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 %56
store i8 0, i8* %57
%58 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%59 = icmp eq i64 %58, 0
br i1 %59, label %71, label %60
60: ; preds = %53
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i8* %6)
%62 = call i32 @strlen(i8* %6)
%63 = call i32 @write(i32 %0, i8* %6, i32 %62)
br label %64
64: ; preds = %60, %41
%65 = call i32 @fileno(i32* %5)
%66 = call i32 @FD_SET(i32 %65, i32* %4)
%67 = call i32 @FD_SET(i32 %0, i32* %4)
%68 = call i32 @select(i32 %17, i32* %4, i32* null, i32* null, i32* null)
%69 = icmp eq i32 %68, -1
br i1 %69, label %23, label %27
70: ; preds = %30
br label %71
71: ; preds = %53, %30, %70
%72 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @str.11, i64 0, i64 0), %70 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0), %53 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @str.12, i64 0, i64 0), %30 ]
%73 = call i32 @puts(i8* dereferenceable(1) %72)
ret void
}