#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 timeval {
  int member_0;
  int /*<<< orphan*/ member_1;
};
struct sockaddr_un {
  char *member_1;
  int /*<<< orphan*/ member_0;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ fd_set;
typedef int /*<<< orphan*/ client_info;

/* Variables and functions */
int /*<<< orphan*/ AF_UNIX;
scalar_t__ FD_ISSET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ SUN_LEN(struct sockaddr_un *);
int accept(int, struct sockaddr *, int *);
int bind(int, struct sockaddr *, int /*<<< orphan*/);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int listen(int, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int read(int, char *, int);
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, struct timeval *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ unlink(char *);
int main() {
  unlink("/tmp/my_socket");
  int sock_fd = 0;
  sock_fd = socket(AF_UNIX, SOCK_STREAM, 0);
  struct sockaddr_un our_addr = {AF_UNIX, "/tmp/my_socket"};
  int ret = bind(sock_fd, (struct sockaddr *)&our_addr, SUN_LEN(&our_addr));
  if (ret < 0) {
    perror("bind");
  };
  ret = listen(sock_fd, 100500);
  struct sockaddr_un client_info;
  int client_info_len = sizeof(client_info);
  int client_fd =
      accept(sock_fd, (struct sockaddr *)&client_info, &client_info_len);
  if (client_fd < 0) {
    perror("accept");
    exit(1);
  }
  char message[10] = {0};
  fd_set read_descriptors;
  FD_ZERO(&read_descriptors);
  FD_SET(0, &read_descriptors);
  FD_SET(client_fd, &read_descriptors);
  struct timeval timeout = {10, 0};
  int ready_descriptor, ready_count;
  while (1) {
    ready_count =
        select(client_fd + 1, &read_descriptors, NULL, NULL, &timeout);
    if (ready_count < 0) {
      perror("select");
      exit(1);
    }
    if (ready_count > 0) {
      if (FD_ISSET(0, &read_descriptors)) {
        ret = read(0, message, 10);
        if (ret < 0) {
          perror("read");
          exit(1);
        }
        printf("Read from stdin: %s\n", message);
      }
      if (FD_ISSET(client_fd, &read_descriptors)) {
        ret = read(client_fd, message, 10);
        if (ret < 0) {
          perror("read");
          exit(1);
        }
        printf("Message received: %s\n", message);
      }
    } else {
      printf("Timeout!\n");
      break;
    }
  }
  close(client_fd);
  close(sock_fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xdea(%rip),%rdi
call   1030 <unlink@plt>
movl   $0x0,-0x8(%rbp)
mov    0x2dbf(%rip),%rax
mov    (%rax),%edi
mov    0x2da6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1120 <socket@plt>
mov    %eax,-0x8(%rbp)
mov    0x2da3(%rip),%rax
movslq (%rax),%rax
mov    %rax,-0x18(%rbp)
lea    0xdad(%rip),%rax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x64(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x60(%rbp)
lea    -0x18(%rbp),%rdi
call   1110 <SUN_LEN@plt>
mov    -0x64(%rbp),%edi
mov    -0x60(%rbp),%rsi
mov    %eax,%edx
call   10c0 <bind@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1294 <main+0x94>
lea    0xd80(%rip),%rdi
call   10d0 <perror@plt>
mov    -0x8(%rbp),%edi
mov    $0x18894,%esi
call   10b0 <listen@plt>
mov    %eax,-0x1c(%rbp)
movl   $0x10,-0x34(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x30(%rbp),%rsi
lea    -0x34(%rbp),%rdx
call   10e0 <accept@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0x0,-0x38(%rbp)
jge    12de <main+0xde>
lea    0xd45(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
lea    -0x42(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1060 <memset@plt>
lea    -0x48(%rbp),%rdi
call   1090 <FD_ZERO@plt>
xor    %edi,%edi
lea    -0x48(%rbp),%rsi
call   1100 <FD_SET@plt>
mov    -0x38(%rbp),%edi
lea    -0x48(%rbp),%rsi
call   1100 <FD_SET@plt>
mov    0xd47(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    -0x38(%rbp),%edi
add    $0x1,%edi
lea    -0x48(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x50(%rbp),%r8
mov    %rcx,%rdx
call   10a0 <select@plt>
mov    %eax,-0x58(%rbp)
cmpl   $0x0,-0x58(%rbp)
jge    1356 <main+0x156>
lea    0xcd4(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
cmpl   $0x0,-0x58(%rbp)
jle    141b <main+0x21b>
xor    %edi,%edi
lea    -0x48(%rbp),%rsi
call   1040 <FD_ISSET@plt>
cmp    $0x0,%rax
je     13ba <main+0x1ba>
lea    -0x42(%rbp),%rsi
xor    %edi,%edi
mov    $0xa,%edx
call   1080 <read@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    13a8 <main+0x1a8>
lea    0xc89(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
lea    -0x42(%rbp),%rsi
lea    0xc74(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x38(%rbp),%edi
lea    -0x48(%rbp),%rsi
call   1040 <FD_ISSET@plt>
cmp    $0x0,%rax
je     1416 <main+0x216>
mov    -0x38(%rbp),%edi
lea    -0x42(%rbp),%rsi
mov    $0xa,%edx
call   1080 <read@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1404 <main+0x204>
lea    0xc2d(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
lea    -0x42(%rbp),%rsi
lea    0xc2d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    142e <main+0x22e>
lea    0xc30(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1433 <main+0x233>
jmp    1319 <main+0x119>
mov    -0x38(%rbp),%edi
call   1070 <close@plt>
mov    -0x8(%rbp),%edi
call   1070 <close@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
lea    0xdeb(%rip),%r14
mov    %r14,%rdi
call   1030 <unlink@plt>
mov    0x2dc4(%rip),%rbx
mov    (%rbx),%edi
mov    0x2dab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1120 <socket@plt>
mov    %eax,%ebp
movslq (%rbx),%rax
mov    %rax,0x28(%rsp)
mov    %r14d,0x30(%rsp)
lea    0x28(%rsp),%rbx
mov    %rbx,%rdi
call   1110 <SUN_LEN@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   10c0 <bind@plt>
test   %eax,%eax
js     13c9 <main+0x1c9>
mov    %ebp,%edi
mov    $0x18894,%esi
call   10b0 <listen@plt>
movl   $0x10,0xc(%rsp)
lea    0x38(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    %ebp,0x4(%rsp)
mov    %ebp,%edi
call   10e0 <accept@plt>
test   %eax,%eax
js     13f9 <main+0x1f9>
mov    %eax,%r13d
movw   $0x0,0x20(%rsp)
movq   $0x0,0x18(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1090 <FD_ZERO@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1100 <FD_SET@plt>
mov    %r13d,%edi
mov    %rbx,%rsi
call   1100 <FD_SET@plt>
movq   $0xa,0x10(%rsp)
mov    %r13d,%r15d
add    $0x1,%r15d
lea    0x10(%rsp),%r8
mov    %r15d,%edi
mov    %rbx,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   10a0 <select@plt>
test   %eax,%eax
js     13e3 <main+0x1e3>
lea    0x8(%rsp),%rbx
lea    0x10(%rsp),%r12
lea    0x18(%rsp),%rbp
lea    0xd19(%rip),%r14
jmp    132a <main+0x12a>
mov    %r15d,%edi
mov    %rbx,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %r12,%r8
call   10a0 <select@plt>
test   %eax,%eax
js     13e3 <main+0x1e3>
test   %eax,%eax
je     139b <main+0x19b>
xor    %edi,%edi
mov    %rbx,%rsi
call   1050 <FD_ISSET@plt>
test   %rax,%rax
je     1361 <main+0x161>
xor    %edi,%edi
mov    %rbp,%rsi
mov    $0xa,%edx
call   1080 <read@plt>
test   %eax,%eax
js     13da <main+0x1da>
mov    %r14,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r13d,%edi
mov    %rbx,%rsi
call   1050 <FD_ISSET@plt>
test   %rax,%rax
je     1310 <main+0x110>
mov    %r13d,%edi
mov    %rbp,%rsi
mov    $0xa,%edx
call   1080 <read@plt>
test   %eax,%eax
js     13da <main+0x1da>
lea    0xcb0(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    1310 <main+0x110>
lea    0xcb0(%rip),%rdi
call   1040 <puts@plt>
mov    %r13d,%edi
call   1070 <close@plt>
mov    0x4(%rsp),%edi
call   1070 <close@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc3f(%rip),%rdi
call   10d0 <perror@plt>
jmp    1266 <main+0x66>
lea    0xc41(%rip),%rdi
jmp    13ea <main+0x1ea>
lea    0xc31(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
lea    0xc14(%rip),%rdi
jmp    13ea <main+0x1ea>

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
%struct.sockaddr_un = type { i8*, i32 }
%struct.sockaddr = type { i32 }
@.str = [15 x i8] c"/tmp/my_socket\00"
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [5 x i8] c"bind\00"
@.str.2 = [7 x i8] c"accept\00"
@__const.main.timeout = %struct.timeval { i32 10, i32 0 }
@.str.3 = [7 x i8] c"select\00"
@.str.4 = [5 x i8] c"read\00"
@.str.5 = [21 x i8] c"Read from stdin: %s\0A\00"
@.str.6 = [22 x i8] c"Message received: %s\0A\00"
@.str.7 = [10 x i8] c"Timeout!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.sockaddr_un
%4 = alloca i32
%5 = alloca %struct.sockaddr_un
%6 = alloca i32
%7 = alloca i32
%8 = alloca [10 x i8]
%9 = alloca i32
%10 = alloca %struct.timeval
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %1
%13 = call i32 @unlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
%14 = load i32, i32* @AF_UNIX
%15 = load i32, i32* @SOCK_STREAM
%16 = call i32 @socket(i32 %14, i32 %15, i32 0)
store i32 %16, i32* %2
%17 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %3, i32 0, i32 0
%18 = load i32, i32* @AF_UNIX
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to i8*
store i8* %20, i8** %17
%21 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %3, i32 0, i32 1
store i32 ptrtoint ([15 x i8]* @.str to i32), i32* %21
%22 = load i32, i32* %2
%23 = bitcast %struct.sockaddr_un* %3 to %struct.sockaddr*
%24 = call i32 @SUN_LEN(%struct.sockaddr_un* %3)
%25 = call i32 @bind(i32 %22, %struct.sockaddr* %23, i32 %24)
store i32 %25, i32* %4
%26 = load i32, i32* %4
%27 = icmp slt i32 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %0
%29 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %30
30: ; preds = %28, %0
%31 = load i32, i32* %2
%32 = call i32 @listen(i32 %31, i32 100500)
store i32 %32, i32* %4
store i32 16, i32* %6
%33 = load i32, i32* %2
%34 = bitcast %struct.sockaddr_un* %5 to %struct.sockaddr*
%35 = call i32 @accept(i32 %33, %struct.sockaddr* %34, i32* %6)
store i32 %35, i32* %7
%36 = load i32, i32* %7
%37 = icmp slt i32 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %30
%39 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%40 = call i32 @exit(i32 1)
unreachable
41: ; preds = %30
%42 = bitcast [10 x i8]* %8 to i8*
%43 = call i32 @FD_ZERO(i32* %9)
%44 = call i32 @FD_SET(i32 0, i32* %9)
%45 = load i32, i32* %7
%46 = call i32 @FD_SET(i32 %45, i32* %9)
%47 = bitcast %struct.timeval* %10 to i8*
br label %48
48: ; preds = %41, %93
%49 = load i32, i32* %7
%50 = add nsw i32 %49, 1
%51 = call i32 @select(i32 %50, i32* %9, i32* null, i32* null, %struct.timeval* %10)
store i32 %51, i32* %12
%52 = load i32, i32* %12
%53 = icmp slt i32 %52, 0
br i1 %53, label %54, label %57
54: ; preds = %48
%55 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%56 = call i32 @exit(i32 1)
unreachable
57: ; preds = %48
%58 = load i32, i32* %12
%59 = icmp sgt i32 %58, 0
br i1 %59, label %60, label %91
60: ; preds = %57
%61 = call i64 @FD_ISSET(i32 0, i32* %9)
%62 = icmp ne i64 %61, 0
br i1 %62, label %63, label %74
63: ; preds = %60
%64 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%65 = call i32 @read(i32 0, i8* %64, i32 10)
store i32 %65, i32* %4
%66 = load i32, i32* %4
%67 = icmp slt i32 %66, 0
br i1 %67, label %68, label %71
68: ; preds = %63
%69 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%70 = call i32 @exit(i32 1)
unreachable
71: ; preds = %63
%72 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %72)
br label %74
74: ; preds = %71, %60
%75 = load i32, i32* %7
%76 = call i64 @FD_ISSET(i32 %75, i32* %9)
%77 = icmp ne i64 %76, 0
br i1 %77, label %78, label %90
78: ; preds = %74
%79 = load i32, i32* %7
%80 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%81 = call i32 @read(i32 %79, i8* %80, i32 10)
store i32 %81, i32* %4
%82 = load i32, i32* %4
%83 = icmp slt i32 %82, 0
br i1 %83, label %84, label %87
84: ; preds = %78
%85 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%86 = call i32 @exit(i32 1)
unreachable
87: ; preds = %78
%88 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i8* %88)
br label %90
90: ; preds = %87, %74
br label %93
91: ; preds = %57
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
br label %94
93: ; preds = %90
br label %48
94: ; preds = %91
%95 = load i32, i32* %7
%96 = call i32 @close(i32 %95)
%97 = load i32, i32* %2
%98 = call i32 @close(i32 %97)
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr_un = type { i8*, i32 }
%struct.timeval = type { i32, i32 }
%struct.sockaddr = type { i32 }
@.str = [15 x i8] c"/tmp/my_socket\00"
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [5 x i8] c"bind\00"
@.str.2 = [7 x i8] c"accept\00"
@.str.3 = [7 x i8] c"select\00"
@.str.4 = [5 x i8] c"read\00"
@.str.5 = [21 x i8] c"Read from stdin: %s\0A\00"
@.str.6 = [22 x i8] c"Message received: %s\0A\00"
@str = [9 x i8] c"Timeout!\00"
define i32 @main() {
%1 = alloca %struct.sockaddr_un
%2 = alloca %struct.sockaddr_un
%3 = alloca i32
%4 = alloca [10 x i8]
%5 = alloca i32
%6 = alloca i64
%7 = bitcast i64* %6 to %struct.timeval*
%8 = tail call i32 @unlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @AF_UNIX
%10 = load i32, i32* @SOCK_STREAM
%11 = tail call i32 @socket(i32 %9, i32 %10, i32 0)
%12 = bitcast %struct.sockaddr_un* %1 to i8*
%13 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %1, i64 0, i32 0
%14 = load i32, i32* @AF_UNIX
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i8*
store i8* %16, i8** %13
%17 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %1, i64 0, i32 1
store i32 ptrtoint ([15 x i8]* @.str to i32), i32* %17
%18 = bitcast %struct.sockaddr_un* %1 to %struct.sockaddr*
%19 = call i32 @SUN_LEN(%struct.sockaddr_un* %1)
%20 = call i32 @bind(i32 %11, %struct.sockaddr* %18, i32 %19)
%21 = icmp slt i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %0
%23 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %24
24: ; preds = %22, %0
%25 = call i32 @listen(i32 %11, i32 100500)
%26 = bitcast %struct.sockaddr_un* %2 to i8*
%27 = bitcast i32* %3 to i8*
store i32 16, i32* %3
%28 = bitcast %struct.sockaddr_un* %2 to %struct.sockaddr*
%29 = call i32 @accept(i32 %11, %struct.sockaddr* %28, i32* %3)
%30 = icmp slt i32 %29, 0
br i1 %30, label %31, label %34
31: ; preds = %24
%32 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%33 = call i32 @exit(i32 1)
unreachable
34: ; preds = %24
%35 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%36 = bitcast i32* %5 to i8*
%37 = call i32 @FD_ZERO(i32* %5)
%38 = call i32 @FD_SET(i32 0, i32* %5)
%39 = call i32 @FD_SET(i32 %29, i32* %5)
%40 = bitcast i64* %6 to i8*
store i64 10, i64* %6
%41 = add nuw nsw i32 %29, 1
%42 = call i32 @select(i32 %41, i32* %5, i32* null, i32* null, %struct.timeval* %7)
%43 = icmp slt i32 %42, 0
br i1 %43, label %44, label %47
44: ; preds = %76, %34
%45 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%46 = call i32 @exit(i32 1)
unreachable
47: ; preds = %34, %76
%48 = phi i32 [ %77, %76 ], [ %42, %34 ]
%49 = icmp eq i32 %48, 0
br i1 %49, label %72, label %50
50: ; preds = %47
%51 = call i64 @FD_ISSET(i32 0, i32* %5)
%52 = icmp eq i64 %51, 0
br i1 %52, label %61, label %53
53: ; preds = %50
%54 = call i32 @read(i32 0, i8* %35, i32 10)
%55 = icmp slt i32 %54, 0
br i1 %55, label %56, label %59
56: ; preds = %53
%57 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%58 = call i32 @exit(i32 1)
unreachable
59: ; preds = %53
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %35)
br label %61
61: ; preds = %59, %50
%62 = call i64 @FD_ISSET(i32 %29, i32* %5)
%63 = icmp eq i64 %62, 0
br i1 %63, label %76, label %64
64: ; preds = %61
%65 = call i32 @read(i32 %29, i8* %35, i32 10)
%66 = icmp slt i32 %65, 0
br i1 %66, label %67, label %70
67: ; preds = %64
%68 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%69 = call i32 @exit(i32 1)
unreachable
70: ; preds = %64
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i8* %35)
br label %76
72: ; preds = %47
%73 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%74 = call i32 @close(i32 %29)
%75 = call i32 @close(i32 %11)
ret i32 0
76: ; preds = %61, %70
%77 = call i32 @select(i32 %41, i32* %5, i32* null, i32* null, %struct.timeval* %7)
%78 = icmp slt i32 %77, 0
br i1 %78, label %44, label %47
}