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

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_SETSIZE;
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ SIGCHLD;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ child_code(int *, int *);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int fork();
int /*<<< orphan*/ perror(char *);
scalar_t__ pipe(int *);
int /*<<< orphan*/ printf(char *, int, ...);
int read(int, int *, int);
int select(int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
int main(void) {
  int i;
  int sz;
  int child_to_parent[2];
  int parent_to_child[10][2];
  int pid;
  char msg[1024];
  signal(SIGCHLD, SIG_IGN);
  if (pipe(child_to_parent) < 0) {
    perror("pipe");
    exit(-1);
  }
  for (i = 0; i < 10; i++) {
    if (pipe(parent_to_child[i]) < 0) {
      perror("pipe");
      exit(-1);
    }
    printf("PIPE [%d, %d]\n", parent_to_child[i][0], parent_to_child[i][1]);
    if ((pid = fork()) < 0) {
      perror("fork");
      exit(-1);
    } else if (pid == 0) {
      child_code(parent_to_child[i], child_to_parent);
      exit(0);
    } else {
    }
  }
  close(child_to_parent[1]);
  for (i = 0; i < 10; i++) {
    close(parent_to_child[i][0]);
    sprintf(msg, "PARENT TO CHILD %d", i);
    write(parent_to_child[i][1], msg, strlen(msg));
  }
  sleep(5);
  fd_set set;
  int ret;
  FD_ZERO(&set);
  FD_SET(child_to_parent[0], &set);
  while (1) {
    ret = select(FD_SETSIZE, &set, NULL, NULL, NULL);
    if (ret > 0) {
      ret = read(child_to_parent[0], &pid, sizeof(pid));
      if (ret > 0) {
        printf("PARENT RECV: [%d]\n", pid);
      } else {
        break;
      }
    } else {
      perror("select");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4a0,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2dcf(%rip),%rax
mov    (%rax),%edi
mov    0x2dbe(%rip),%rax
mov    (%rax),%esi
call   1090 <signal@plt>
lea    -0x14(%rbp),%rdi
call   1070 <pipe@plt>
cmp    $0x0,%rax
jge    1252 <main+0x52>
lea    0xdbd(%rip),%rdi
call   10c0 <perror@plt>
mov    $0xffffffff,%edi
call   10e0 <exit@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1324 <main+0x124>
movslq -0x8(%rbp),%rax
lea    -0x70(%rbp),%rdi
shl    $0x3,%rax
add    %rax,%rdi
call   1070 <pipe@plt>
cmp    $0x0,%rax
jge    1297 <main+0x97>
lea    0xd78(%rip),%rdi
call   10c0 <perror@plt>
mov    $0xffffffff,%edi
call   10e0 <exit@plt>
movslq -0x8(%rbp),%rax
mov    -0x70(%rbp,%rax,8),%esi
movslq -0x8(%rbp),%rax
mov    -0x6c(%rbp,%rax,8),%edx
lea    0xd57(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1120 <fork@plt>
mov    %eax,-0x74(%rbp)
cmp    $0x0,%eax
jge    12de <main+0xde>
lea    0xd45(%rip),%rdi
call   10c0 <perror@plt>
mov    $0xffffffff,%edi
call   10e0 <exit@plt>
cmpl   $0x0,-0x74(%rbp)
jne    1307 <main+0x107>
movslq -0x8(%rbp),%rax
lea    -0x70(%rbp),%rdi
shl    $0x3,%rax
add    %rax,%rdi
lea    -0x14(%rbp),%rsi
call   10f0 <child_code@plt>
xor    %edi,%edi
call   10e0 <exit@plt>
jmp    130c <main+0x10c>
jmp    1311 <main+0x111>
jmp    1316 <main+0x116>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1259 <main+0x59>
mov    -0x10(%rbp),%edi
call   1060 <close@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    13aa <main+0x1aa>
movslq -0x8(%rbp),%rax
mov    -0x70(%rbp,%rax,8),%edi
call   1060 <close@plt>
lea    -0x480(%rbp),%rdi
mov    -0x8(%rbp),%edx
lea    0xcbe(%rip),%rsi
call   10d0 <sprintf@plt>
movslq -0x8(%rbp),%rax
mov    -0x6c(%rbp,%rax,8),%eax
mov    %eax,-0x494(%rbp)
lea    -0x480(%rbp),%rax
mov    %rax,-0x490(%rbp)
lea    -0x480(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x494(%rbp),%edi
mov    -0x490(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1333 <main+0x133>
mov    $0x5,%edi
call   1110 <sleep@plt>
lea    -0x484(%rbp),%rdi
call   10a0 <FD_ZERO@plt>
mov    -0x14(%rbp),%edi
lea    -0x484(%rbp),%rsi
call   1100 <FD_SET@plt>
mov    0x2bfa(%rip),%rax
mov    (%rax),%edi
lea    -0x484(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdx
mov    %r8,%rcx
call   10b0 <select@plt>
mov    %eax,-0x488(%rbp)
cmpl   $0x0,-0x488(%rbp)
jle    1446 <main+0x246>
mov    -0x14(%rbp),%edi
lea    -0x74(%rbp),%rsi
mov    $0x4,%edx
call   1080 <read@plt>
mov    %eax,-0x488(%rbp)
cmpl   $0x0,-0x488(%rbp)
jle    143c <main+0x23c>
mov    -0x74(%rbp),%esi
lea    0xbfc(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1441 <main+0x241>
jmp    1457 <main+0x257>
jmp    1452 <main+0x252>
lea    0xbf2(%rip),%rdi
call   10c0 <perror@plt>
jmp    13cf <main+0x1cf>
xor    %eax,%eax
add    $0x4a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x460,%rsp
mov    0x2dd2(%rip),%rax
mov    (%rax),%edi
mov    0x2dc1(%rip),%rax
mov    (%rax),%esi
call   1090 <signal@plt>
lea    0x4(%rsp),%rdi
call   1070 <pipe@plt>
test   %rax,%rax
js     138c <main+0x18c>
lea    0xdc5(%rip),%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%rsp,%rbp,1),%rbx
add    $0x10,%rbx
mov    %rbx,%rdi
call   1070 <pipe@plt>
test   %rax,%rax
js     138c <main+0x18c>
mov    0x10(%rsp,%rbp,1),%esi
mov    0x14(%rsp,%rbp,1),%edx
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1120 <fork@plt>
test   %eax,%eax
js     1395 <main+0x195>
je     13ab <main+0x1ab>
add    $0x8,%rbp
cmp    $0x50,%rbp
jne    1250 <main+0x50>
mov    %eax,(%rsp)
mov    0x8(%rsp),%edi
call   1060 <close@plt>
xor    %ebx,%ebx
lea    0xd6a(%rip),%r14
lea    0x60(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x10(%rsp,%rbx,8),%edi
call   1060 <close@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   10d0 <sprintf@plt>
mov    0x14(%rsp,%rbx,8),%ebp
mov    %r15,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %r15,%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x1,%rbx
cmp    $0xa,%rbx
jne    12c0 <main+0xc0>
mov    $0x5,%edi
call   1110 <sleep@plt>
lea    0xc(%rsp),%r14
mov    %r14,%rdi
call   10a0 <FD_ZERO@plt>
mov    0x4(%rsp),%edi
mov    %r14,%rsi
call   1100 <FD_SET@plt>
mov    0x2cae(%rip),%rbp
mov    %rsp,%rbx
lea    0xd00(%rip),%r15
lea    0xd0c(%rip),%r12
jmp    1340 <main+0x140>
mov    %r12,%rdi
call   10c0 <perror@plt>
nopl   (%rax)
mov    0x0(%rbp),%edi
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   10b0 <select@plt>
test   %eax,%eax
jle    1335 <main+0x135>
mov    0x4(%rsp),%edi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1080 <read@plt>
test   %eax,%eax
jle    137a <main+0x17a>
mov    (%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1340 <main+0x140>
xor    %eax,%eax
add    $0x460,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc6d(%rip),%rdi
jmp    139c <main+0x19c>
lea    0xc78(%rip),%rdi
call   10c0 <perror@plt>
mov    $0xffffffff,%edi
call   10e0 <exit@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   10f0 <child_code@plt>
xor    %edi,%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
@SIGCHLD = global i32 0
@SIG_IGN = global i32 0
@.str = [5 x i8] c"pipe\00"
@.str.1 = [15 x i8] c"PIPE [%d, %d]\0A\00"
@.str.2 = [5 x i8] c"fork\00"
@.str.3 = [19 x i8] c"PARENT TO CHILD %d\00"
@FD_SETSIZE = global i32 0
@.str.4 = [19 x i8] c"PARENT RECV: [%d]\0A\00"
@.str.5 = [7 x i8] c"select\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [2 x i32]
%5 = alloca [10 x [2 x i32]]
%6 = alloca i32
%7 = alloca [1024 x i8]
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
%10 = load i32, i32* @SIGCHLD
%11 = load i32, i32* @SIG_IGN
%12 = call i32 @signal(i32 %10, i32 %11)
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%14 = call i64 @pipe(i32* %13)
%15 = icmp slt i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %0
%17 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%18 = call i32 @exit(i32 -1)
unreachable
19: ; preds = %0
store i32 0, i32* %2
br label %20
20: ; preds = %64, %19
%21 = load i32, i32* %2
%22 = icmp slt i32 %21, 10
br i1 %22, label %23, label %67
23: ; preds = %20
%24 = load i32, i32* %2
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %5, i64 0, i64 %25
%27 = getelementptr inbounds [2 x i32], [2 x i32]* %26, i64 0, i64 0
%28 = call i64 @pipe(i32* %27)
%29 = icmp slt i64 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %23
%31 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%32 = call i32 @exit(i32 -1)
unreachable
33: ; preds = %23
%34 = load i32, i32* %2
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %5, i64 0, i64 %35
%37 = getelementptr inbounds [2 x i32], [2 x i32]* %36, i64 0, i64 0
%38 = load i32, i32* %37
%39 = load i32, i32* %2
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %5, i64 0, i64 %40
%42 = getelementptr inbounds [2 x i32], [2 x i32]* %41, i64 0, i64 1
%43 = load i32, i32* %42
%44 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %38, i32 %43)
%45 = call i32 (...) @fork()
store i32 %45, i32* %6
%46 = icmp slt i32 %45, 0
br i1 %46, label %47, label %50
47: ; preds = %33
%48 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%49 = call i32 @exit(i32 -1)
unreachable
50: ; preds = %33
%51 = load i32, i32* %6
%52 = icmp eq i32 %51, 0
br i1 %52, label %53, label %61
53: ; preds = %50
%54 = load i32, i32* %2
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %5, i64 0, i64 %55
%57 = getelementptr inbounds [2 x i32], [2 x i32]* %56, i64 0, i64 0
%58 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%59 = call i32 @child_code(i32* %57, i32* %58)
%60 = call i32 @exit(i32 0)
unreachable
61: ; preds = %50
br label %62
62: ; preds = %61
br label %63
63: ; preds = %62
br label %64
64: ; preds = %63
%65 = load i32, i32* %2
%66 = add nsw i32 %65, 1
store i32 %66, i32* %2
br label %20
67: ; preds = %20
%68 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%69 = load i32, i32* %68
%70 = call i32 @close(i32 %69)
store i32 0, i32* %2
br label %71
71: ; preds = %93, %67
%72 = load i32, i32* %2
%73 = icmp slt i32 %72, 10
br i1 %73, label %74, label %96
74: ; preds = %71
%75 = load i32, i32* %2
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %5, i64 0, i64 %76
%78 = getelementptr inbounds [2 x i32], [2 x i32]* %77, i64 0, i64 0
%79 = load i32, i32* %78
%80 = call i32 @close(i32 %79)
%81 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%82 = load i32, i32* %2
%83 = call i32 @sprintf(i8* %81, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %82)
%84 = load i32, i32* %2
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %5, i64 0, i64 %85
%87 = getelementptr inbounds [2 x i32], [2 x i32]* %86, i64 0, i64 1
%88 = load i32, i32* %87
%89 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%90 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%91 = call i32 @strlen(i8* %90)
%92 = call i32 @write(i32 %88, i8* %89, i32 %91)
br label %93
93: ; preds = %74
%94 = load i32, i32* %2
%95 = add nsw i32 %94, 1
store i32 %95, i32* %2
br label %71
96: ; preds = %71
%97 = call i32 @sleep(i32 5)
%98 = call i32 @FD_ZERO(i32* %8)
%99 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%100 = load i32, i32* %99
%101 = call i32 @FD_SET(i32 %100, i32* %8)
br label %102
102: ; preds = %96, %120
%103 = load i32, i32* @FD_SETSIZE
%104 = call i32 @select(i32 %103, i32* %8, i32* null, i32* null, i32* null)
store i32 %104, i32* %9
%105 = load i32, i32* %9
%106 = icmp sgt i32 %105, 0
br i1 %106, label %107, label %118
107: ; preds = %102
%108 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%109 = load i32, i32* %108
%110 = call i32 @read(i32 %109, i32* %6, i32 4)
store i32 %110, i32* %9
%111 = load i32, i32* %9
%112 = icmp sgt i32 %111, 0
br i1 %112, label %113, label %116
113: ; preds = %107
%114 = load i32, i32* %6
%115 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 %114)
br label %117
116: ; preds = %107
br label %121
117: ; preds = %113
br label %120
118: ; preds = %102
%119 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
br label %120
120: ; preds = %118, %117
br label %102
121: ; preds = %116
ret i32 0
}

LLVM IR (-O2):
@SIGCHLD = global i32 0
@SIG_IGN = global i32 0
@.str = [5 x i8] c"pipe\00"
@.str.1 = [15 x i8] c"PIPE [%d, %d]\0A\00"
@.str.2 = [5 x i8] c"fork\00"
@.str.3 = [19 x i8] c"PARENT TO CHILD %d\00"
@FD_SETSIZE = global i32 0
@.str.4 = [19 x i8] c"PARENT RECV: [%d]\0A\00"
@.str.5 = [7 x i8] c"select\00"
define i32 @main() {
%1 = alloca [2 x i32]
%2 = alloca [10 x [2 x i32]]
%3 = alloca i32
%4 = alloca [1024 x i8]
%5 = alloca i32
%6 = bitcast [2 x i32]* %1 to i8*
%7 = bitcast [10 x [2 x i32]]* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%10 = load i32, i32* @SIGCHLD
%11 = load i32, i32* @SIG_IGN
%12 = tail call i32 @signal(i32 %10, i32 %11)
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%14 = call i64 @pipe(i32* %13)
%15 = icmp slt i64 %14, 0
br i1 %15, label %16, label %22
16: ; preds = %0
%17 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%18 = call i32 @exit(i32 -1)
unreachable
19: ; preds = %40
%20 = add nuw nsw i64 %23, 1
%21 = icmp eq i64 %20, 10
br i1 %21, label %45, label %22
22: ; preds = %0, %19
%23 = phi i64 [ %20, %19 ], [ 0, %0 ]
%24 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %2, i64 0, i64 %23, i64 0
%25 = call i64 @pipe(i32* %24)
%26 = icmp slt i64 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %22
%28 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%29 = call i32 @exit(i32 -1)
unreachable
30: ; preds = %22
%31 = load i32, i32* %24
%32 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %2, i64 0, i64 %23, i64 1
%33 = load i32, i32* %32
%34 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %31, i32 %33)
%35 = call i32 (...) @fork()
%36 = icmp slt i32 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %30
%38 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%39 = call i32 @exit(i32 -1)
unreachable
40: ; preds = %30
%41 = icmp eq i32 %35, 0
br i1 %41, label %42, label %19
42: ; preds = %40
%43 = call i32 @child_code(i32* %24, i32* %13)
%44 = call i32 @exit(i32 0)
unreachable
45: ; preds = %19
store i32 %35, i32* %3
%46 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
%47 = load i32, i32* %46
%48 = call i32 @close(i32 %47)
br label %49
49: ; preds = %45, %49
%50 = phi i64 [ 0, %45 ], [ %60, %49 ]
%51 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %2, i64 0, i64 %50, i64 0
%52 = load i32, i32* %51
%53 = call i32 @close(i32 %52)
%54 = trunc i64 %50 to i32
%55 = call i32 @sprintf(i8* %9, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %54)
%56 = getelementptr inbounds [10 x [2 x i32]], [10 x [2 x i32]]* %2, i64 0, i64 %50, i64 1
%57 = load i32, i32* %56
%58 = call i32 @strlen(i8* %9)
%59 = call i32 @write(i32 %57, i8* %9, i32 %58)
%60 = add nuw nsw i64 %50, 1
%61 = icmp eq i64 %60, 10
br i1 %61, label %62, label %49
62: ; preds = %49
%63 = call i32 @sleep(i32 5)
%64 = bitcast i32* %5 to i8*
%65 = call i32 @FD_ZERO(i32* %5)
%66 = load i32, i32* %13
%67 = call i32 @FD_SET(i32 %66, i32* %5)
br label %68
68: ; preds = %81, %62
%69 = load i32, i32* @FD_SETSIZE
%70 = call i32 @select(i32 %69, i32* %5, i32* null, i32* null, i32* null)
%71 = icmp sgt i32 %70, 0
br i1 %71, label %72, label %79
72: ; preds = %68
%73 = load i32, i32* %13
%74 = call i32 @read(i32 %73, i32* %3, i32 4)
%75 = icmp sgt i32 %74, 0
br i1 %75, label %76, label %82
76: ; preds = %72
%77 = load i32, i32* %3
%78 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 %77)
br label %81
79: ; preds = %68
%80 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
br label %81
81: ; preds = %79, %76
br label %68
82: ; preds = %72
ret i32 0
}