#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 */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct timeval {
  int dummy;
};
struct TYPE_2__ {
  int /*<<< orphan*/ s_addr;
};
struct sockaddr_in {
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_port;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ sa;
typedef int /*<<< orphan*/ fd_set;
typedef int /*<<< orphan*/ csa;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ FD_CLR(int, int /*<<< orphan*/ *);
scalar_t__ FD_ISSET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ SOCK_STREAM;
int accept(int, struct sockaddr *, int *);
int bind(int, struct sockaddr *, int);
int /*<<< orphan*/ close(int);
int getdtablesize();
int /*<<< orphan*/ htons(int);
int listen(int, int);
int /*<<< orphan*/ memset(struct sockaddr_in *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(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*/ write(int, char *, int);
int main() {
  int i;
  int rc;
  int s;
  int cs;
  char buf[1024 + 1];
  struct sockaddr_in sa;
  struct sockaddr_in csa;
  int size_csa;
  fd_set rfd;
  fd_set c_rfd;
  int dsize;
  memset(&sa, 0, sizeof(sa));
  sa.sin_family = AF_INET;
  sa.sin_port = htons(5060);
  sa.sin_addr.s_addr = INADDR_ANY;
  s = socket(AF_INET, SOCK_STREAM, 0);
  if (s < 0) {
    perror("socket: allocation failed");
  }
  rc = bind(s, (struct sockaddr *)&sa, sizeof(sa));
  if (rc) {
    perror("bind");
  }
  rc = listen(s, 5);
  if (rc) {
    perror("listen");
  }
  size_csa = sizeof(csa);
  dsize = getdtablesize();
  for (i = 0; i < dsize; i++)
    if (i != s)
      close(i);
  FD_ZERO(&rfd);
  FD_SET(s, &rfd);
  while (1) {
    c_rfd = rfd;
    rc = select(dsize, &c_rfd, NULL, NULL, (struct timeval *)NULL);
    if (FD_ISSET(s, &c_rfd)) {
      cs = accept(s, (struct sockaddr *)&csa, &size_csa);
      if (cs < 0)
        continue;
      FD_SET(cs, &rfd);
      continue;
    }
    for (i = 0; i < dsize; i++)
      if (i != s && FD_ISSET(i, &c_rfd)) {
        rc = read(i, buf, 1024);
        if (rc == 0) {
          close(i);
          FD_CLR(i, &rfd);
        } else {
          write(i, buf, rc);
        }
      }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x450,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x430(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1060 <memset@plt>
mov    0x2dbc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x428(%rbp)
mov    $0x13c4,%edi
call   1050 <htons@plt>
mov    %eax,-0x42c(%rbp)
mov    0x2d95(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x430(%rbp)
mov    0x2d8e(%rip),%rax
mov    (%rax),%edi
mov    0x2d6d(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1120 <socket@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1285 <main+0x85>
lea    0xd80(%rip),%rdi
call   10d0 <perror@plt>
mov    -0x10(%rbp),%edi
lea    -0x430(%rbp),%rsi
mov    $0xc,%edx
call   10c0 <bind@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     12b2 <main+0xb2>
lea    0xd6d(%rip),%rdi
call   10d0 <perror@plt>
mov    -0x10(%rbp),%edi
mov    $0x5,%esi
call   10b0 <listen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     12d8 <main+0xd8>
lea    0xd4c(%rip),%rdi
call   10d0 <perror@plt>
movl   $0xc,-0x444(%rbp)
mov    $0x0,%al
call   1110 <getdtablesize@plt>
mov    %eax,-0x450(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x450(%rbp),%eax
jge    132c <main+0x12c>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     1319 <main+0x119>
mov    -0x8(%rbp),%edi
call   1070 <close@plt>
jmp    131e <main+0x11e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12f6 <main+0xf6>
lea    -0x448(%rbp),%rdi
call   1090 <FD_ZERO@plt>
mov    -0x10(%rbp),%edi
lea    -0x448(%rbp),%rsi
call   1100 <FD_SET@plt>
mov    -0x448(%rbp),%eax
mov    %eax,-0x44c(%rbp)
mov    -0x450(%rbp),%edi
lea    -0x44c(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdx
mov    %r8,%rcx
call   10a0 <select@plt>
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%edi
lea    -0x44c(%rbp),%rsi
call   1040 <FD_ISSET@plt>
cmp    $0x0,%rax
je     13c8 <main+0x1c8>
mov    -0x10(%rbp),%edi
lea    -0x440(%rbp),%rsi
lea    -0x444(%rbp),%rdx
call   10e0 <accept@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    13b4 <main+0x1b4>
jmp    1347 <main+0x147>
mov    -0x14(%rbp),%edi
lea    -0x448(%rbp),%rsi
call   1100 <FD_SET@plt>
jmp    1347 <main+0x147>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x450(%rbp),%eax
jge    146a <main+0x26a>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     1457 <main+0x257>
mov    -0x8(%rbp),%edi
lea    -0x44c(%rbp),%rsi
call   1040 <FD_ISSET@plt>
cmp    $0x0,%rax
je     1457 <main+0x257>
mov    -0x8(%rbp),%edi
lea    -0x420(%rbp),%rsi
mov    $0x400,%edx
call   1080 <read@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1440 <main+0x240>
mov    -0x8(%rbp),%edi
call   1070 <close@plt>
mov    -0x8(%rbp),%edi
lea    -0x448(%rbp),%rsi
call   10f0 <FD_CLR@plt>
jmp    1452 <main+0x252>
mov    -0x8(%rbp),%edi
lea    -0x420(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <write@plt>
jmp    1457 <main+0x257>
jmp    145c <main+0x25c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    13cf <main+0x1cf>
jmp    1347 <main+0x147>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x438,%rsp
lea    0x10(%rsp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1060 <memset@plt>
mov    0x2dbf(%rip),%rbx
mov    (%rbx),%eax
mov    %eax,0x18(%rsp)
mov    $0x13c4,%edi
call   1050 <htons@plt>
mov    %eax,0x14(%rsp)
mov    0x2d9c(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x10(%rsp)
mov    (%rbx),%edi
mov    0x2d7d(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1120 <socket@plt>
mov    %eax,%ebx
test   %eax,%eax
js     13ac <main+0x1ac>
lea    0x10(%rsp),%rsi
mov    %ebx,%edi
mov    $0xc,%edx
call   10c0 <bind@plt>
test   %eax,%eax
jne    13bd <main+0x1bd>
mov    %ebx,%edi
mov    $0x5,%esi
call   10b0 <listen@plt>
test   %eax,%eax
jne    13ce <main+0x1ce>
movl   $0xc,0xc(%rsp)
xor    %r14d,%r14d
xor    %eax,%eax
call   1110 <getdtablesize@plt>
mov    %eax,%ebp
test   %eax,%eax
jg     139d <main+0x19d>
lea    0x8(%rsp),%r14
mov    %r14,%rdi
call   1090 <FD_ZERO@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1100 <FD_SET@plt>
lea    0x4(%rsp),%r15
lea    0x30(%rsp),%r12
mov    0x8(%rsp),%eax
mov    %eax,0x4(%rsp)
mov    %ebp,%edi
mov    %r15,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   10a0 <select@plt>
mov    %ebx,%edi
mov    %r15,%rsi
call   1040 <FD_ISSET@plt>
test   %rax,%rax
je     1320 <main+0x120>
mov    %ebx,%edi
lea    0x20(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   10e0 <accept@plt>
test   %eax,%eax
js     12d0 <main+0xd0>
mov    %eax,%edi
mov    %r14,%rsi
call   1100 <FD_SET@plt>
jmp    12d0 <main+0xd0>
nopl   0x0(%rax)
test   %ebp,%ebp
jle    12d0 <main+0xd0>
xor    %r13d,%r13d
jmp    1349 <main+0x149>
mov    %r12,%rsi
mov    %eax,%edx
call   1030 <write@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%r13d
cmp    %r13d,%ebp
je     12d0 <main+0xd0>
cmp    %r13d,%ebx
je     1340 <main+0x140>
mov    %r13d,%edi
mov    %r15,%rsi
call   1040 <FD_ISSET@plt>
test   %rax,%rax
je     1340 <main+0x140>
mov    %r13d,%edi
mov    %r12,%rsi
mov    $0x400,%edx
call   1080 <read@plt>
mov    %r13d,%edi
test   %eax,%eax
jne    1329 <main+0x129>
call   1070 <close@plt>
mov    %r13d,%edi
mov    %r14,%rsi
call   10f0 <FD_CLR@plt>
jmp    1340 <main+0x140>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r14d
cmp    %r14d,%ebp
je     12af <main+0xaf>
cmp    %r14d,%ebx
je     1390 <main+0x190>
mov    %r14d,%edi
call   1070 <close@plt>
jmp    1390 <main+0x190>
lea    0xc4d(%rip),%rdi
call   10d0 <perror@plt>
jmp    1266 <main+0x66>
lea    0xc56(%rip),%rdi
call   10d0 <perror@plt>
jmp    127f <main+0x7f>
lea    0xc4a(%rip),%rdi
call   10d0 <perror@plt>
jmp    1293 <main+0x93>

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
%struct.timeval = type { i32 }
@AF_INET = global i32 0
@INADDR_ANY = global i32 0
@SOCK_STREAM = global i32 0
@.str = [26 x i8] c"socket: allocation failed\00"
@.str.1 = [5 x i8] c"bind\00"
@.str.2 = [7 x i8] c"listen\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [1025 x i8]
%7 = alloca %struct.sockaddr_in
%8 = alloca %struct.sockaddr_in
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %1
%13 = call i32 @memset(%struct.sockaddr_in* %7, i32 0, i32 12)
%14 = load i32, i32* @AF_INET
%15 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 2
store i32 %14, i32* %15
%16 = call i32 @htons(i32 5060)
%17 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 1
store i32 %16, i32* %17
%18 = load i32, i32* @INADDR_ANY
%19 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 0
%20 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %19, i32 0, i32 0
store i32 %18, i32* %20
%21 = load i32, i32* @AF_INET
%22 = load i32, i32* @SOCK_STREAM
%23 = call i32 @socket(i32 %21, i32 %22, i32 0)
store i32 %23, i32* %4
%24 = load i32, i32* %4
%25 = icmp slt i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %0
%27 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %28
28: ; preds = %26, %0
%29 = load i32, i32* %4
%30 = bitcast %struct.sockaddr_in* %7 to %struct.sockaddr*
%31 = call i32 @bind(i32 %29, %struct.sockaddr* %30, i32 12)
store i32 %31, i32* %3
%32 = load i32, i32* %3
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %28
%35 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %36
36: ; preds = %34, %28
%37 = load i32, i32* %4
%38 = call i32 @listen(i32 %37, i32 5)
store i32 %38, i32* %3
%39 = load i32, i32* %3
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %36
%42 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %43
43: ; preds = %41, %36
store i32 12, i32* %9
%44 = call i32 (...) @getdtablesize()
store i32 %44, i32* %12
store i32 0, i32* %2
br label %45
45: ; preds = %57, %43
%46 = load i32, i32* %2
%47 = load i32, i32* %12
%48 = icmp slt i32 %46, %47
br i1 %48, label %49, label %60
49: ; preds = %45
%50 = load i32, i32* %2
%51 = load i32, i32* %4
%52 = icmp ne i32 %50, %51
br i1 %52, label %53, label %56
53: ; preds = %49
%54 = load i32, i32* %2
%55 = call i32 @close(i32 %54)
br label %56
56: ; preds = %53, %49
br label %57
57: ; preds = %56
%58 = load i32, i32* %2
%59 = add nsw i32 %58, 1
store i32 %59, i32* %2
br label %45
60: ; preds = %45
%61 = call i32 @FD_ZERO(i32* %10)
%62 = load i32, i32* %4
%63 = call i32 @FD_SET(i32 %62, i32* %10)
br label %64
64: ; preds = %60, %77, %78, %115
%65 = load i32, i32* %10
store i32 %65, i32* %11
%66 = load i32, i32* %12
%67 = call i32 @select(i32 %66, i32* %11, i32* null, i32* null, %struct.timeval* null)
store i32 %67, i32* %3
%68 = load i32, i32* %4
%69 = call i64 @FD_ISSET(i32 %68, i32* %11)
%70 = icmp ne i64 %69, 0
br i1 %70, label %71, label %81
71: ; preds = %64
%72 = load i32, i32* %4
%73 = bitcast %struct.sockaddr_in* %8 to %struct.sockaddr*
%74 = call i32 @accept(i32 %72, %struct.sockaddr* %73, i32* %9)
store i32 %74, i32* %5
%75 = load i32, i32* %5
%76 = icmp slt i32 %75, 0
br i1 %76, label %77, label %78
77: ; preds = %71
br label %64
78: ; preds = %71
%79 = load i32, i32* %5
%80 = call i32 @FD_SET(i32 %79, i32* %10)
br label %64
81: ; preds = %64
store i32 0, i32* %2
br label %82
82: ; preds = %112, %81
%83 = load i32, i32* %2
%84 = load i32, i32* %12
%85 = icmp slt i32 %83, %84
br i1 %85, label %86, label %115
86: ; preds = %82
%87 = load i32, i32* %2
%88 = load i32, i32* %4
%89 = icmp ne i32 %87, %88
br i1 %89, label %90, label %111
90: ; preds = %86
%91 = load i32, i32* %2
%92 = call i64 @FD_ISSET(i32 %91, i32* %11)
%93 = icmp ne i64 %92, 0
br i1 %93, label %94, label %111
94: ; preds = %90
%95 = load i32, i32* %2
%96 = getelementptr inbounds [1025 x i8], [1025 x i8]* %6, i64 0, i64 0
%97 = call i32 @read(i32 %95, i8* %96, i32 1024)
store i32 %97, i32* %3
%98 = load i32, i32* %3
%99 = icmp eq i32 %98, 0
br i1 %99, label %100, label %105
100: ; preds = %94
%101 = load i32, i32* %2
%102 = call i32 @close(i32 %101)
%103 = load i32, i32* %2
%104 = call i32 @FD_CLR(i32 %103, i32* %10)
br label %110
105: ; preds = %94
%106 = load i32, i32* %2
%107 = getelementptr inbounds [1025 x i8], [1025 x i8]* %6, i64 0, i64 0
%108 = load i32, i32* %3
%109 = call i32 @write(i32 %106, i8* %107, i32 %108)
br label %110
110: ; preds = %105, %100
br label %111
111: ; preds = %110, %90, %86
br label %112
112: ; preds = %111
%113 = load i32, i32* %2
%114 = add nsw i32 %113, 1
store i32 %114, i32* %2
br label %82
115: ; preds = %82
br label %64
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
%struct.timeval = type { i32 }
@AF_INET = global i32 0
@INADDR_ANY = global i32 0
@SOCK_STREAM = global i32 0
@.str = [26 x i8] c"socket: allocation failed\00"
@.str.1 = [5 x i8] c"bind\00"
@.str.2 = [7 x i8] c"listen\00"
define i32 @main() {
%1 = alloca [1025 x i8]
%2 = alloca %struct.sockaddr_in
%3 = alloca %struct.sockaddr_in
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = getelementptr inbounds [1025 x i8], [1025 x i8]* %1, i64 0, i64 0
%8 = bitcast %struct.sockaddr_in* %2 to i8*
%9 = bitcast %struct.sockaddr_in* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = bitcast i32* %5 to i8*
%12 = bitcast i32* %6 to i8*
%13 = call i32 @memset(%struct.sockaddr_in* %2, i32 0, i32 12)
%14 = load i32, i32* @AF_INET
%15 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 2
store i32 %14, i32* %15
%16 = call i32 @htons(i32 5060)
%17 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 1
store i32 %16, i32* %17
%18 = load i32, i32* @INADDR_ANY
%19 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 0, i32 0
store i32 %18, i32* %19
%20 = load i32, i32* @AF_INET
%21 = load i32, i32* @SOCK_STREAM
%22 = call i32 @socket(i32 %20, i32 %21, i32 0)
%23 = icmp slt i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %0
%25 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %26
26: ; preds = %24, %0
%27 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%28 = call i32 @bind(i32 %22, %struct.sockaddr* %27, i32 12)
%29 = icmp eq i32 %28, 0
br i1 %29, label %32, label %30
30: ; preds = %26
%31 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %32
32: ; preds = %30, %26
%33 = call i32 @listen(i32 %22, i32 5)
%34 = icmp eq i32 %33, 0
br i1 %34, label %37, label %35
35: ; preds = %32
%36 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %37
37: ; preds = %35, %32
store i32 12, i32* %4
%38 = call i32 (...) @getdtablesize()
%39 = icmp sgt i32 %38, 0
br i1 %39, label %40, label %48
40: ; preds = %37, %45
%41 = phi i32 [ %46, %45 ], [ 0, %37 ]
%42 = icmp eq i32 %41, %22
br i1 %42, label %45, label %43
43: ; preds = %40
%44 = call i32 @close(i32 %41)
br label %45
45: ; preds = %40, %43
%46 = add nuw nsw i32 %41, 1
%47 = icmp eq i32 %46, %38
br i1 %47, label %48, label %40
48: ; preds = %45, %37
%49 = call i32 @FD_ZERO(i32* %5)
%50 = call i32 @FD_SET(i32 %22, i32* %5)
%51 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
br label %52
52: ; preds = %58, %48
%53 = load i32, i32* %5
store i32 %53, i32* %6
%54 = call i32 @select(i32 %38, i32* %6, i32* null, i32* null, %struct.timeval* null)
%55 = call i64 @FD_ISSET(i32 %22, i32* %6)
%56 = icmp eq i64 %55, 0
br i1 %56, label %57, label %59
57: ; preds = %52
br i1 %39, label %64, label %58
58: ; preds = %78, %57, %62, %59
br label %52
59: ; preds = %52
%60 = call i32 @accept(i32 %22, %struct.sockaddr* %51, i32* %4)
%61 = icmp slt i32 %60, 0
br i1 %61, label %58, label %62
62: ; preds = %59
%63 = call i32 @FD_SET(i32 %60, i32* %5)
br label %58
64: ; preds = %57, %78
%65 = phi i32 [ %79, %78 ], [ 0, %57 ]
%66 = icmp eq i32 %65, %22
br i1 %66, label %78, label %67
67: ; preds = %64
%68 = call i64 @FD_ISSET(i32 %65, i32* %6)
%69 = icmp eq i64 %68, 0
br i1 %69, label %78, label %70
70: ; preds = %67
%71 = call i32 @read(i32 %65, i8* %7, i32 1024)
%72 = icmp eq i32 %71, 0
br i1 %72, label %73, label %76
73: ; preds = %70
%74 = call i32 @close(i32 %65)
%75 = call i32 @FD_CLR(i32 %65, i32* %5)
br label %78
76: ; preds = %70
%77 = call i32 @write(i32 %65, i8* %7, i32 %71)
br label %78
78: ; preds = %64, %67, %76, %73
%79 = add nuw nsw i32 %65, 1
%80 = icmp eq i32 %79, %38
br i1 %80, label %58, label %64
}