#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 TYPE_2__ {
  int /*<<< orphan*/ s_addr;
};
struct sockaddr_in {
  int /*<<< orphan*/ sin_port;
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef scalar_t__ ssize_t;
typedef int socklen_t;
typedef int /*<<< orphan*/ serv_addr;
typedef int /*<<< orphan*/ flag;
typedef int /*<<< orphan*/ cli_addr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int EPIPE;
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int accept(int, struct sockaddr *, int *);
scalar_t__ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ close(int);
int errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ listen(int, int);
int /*<<< orphan*/ memset(struct sockaddr_in *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *);
scalar_t__ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int /*<<< orphan*/ sleep(int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
char *strerror(int);
scalar_t__ strlen(char *);
scalar_t__ write(int, char *, scalar_t__);
int main(int argc, char *argv[]) {
  int portno = 6789;
  int flag = 1;
  int sockfd, newsockfd;
  socklen_t clilen;
  struct sockaddr_in serv_addr, cli_addr;
  sockfd = socket(AF_INET, SOCK_STREAM, 0);
  if (sockfd < 0) {
    fprintf(stderr, "ERROR opening socket\n");
    exit(EXIT_FAILURE);
  }
  memset(&serv_addr, 0, sizeof(serv_addr));
  serv_addr.sin_family = AF_INET;
  serv_addr.sin_addr.s_addr = INADDR_ANY;
  serv_addr.sin_port = htons(portno);
  if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &flag, sizeof(flag)) < 0) {
    fprintf(stderr, "ERROR ON setockopt\n");
    exit(EXIT_FAILURE);
  }
  if (bind(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0) {
    fprintf(stderr, "ERROR on binding");
    exit(EXIT_FAILURE);
  }
  listen(sockfd, 5);
  while (1) {
    clilen = sizeof(cli_addr);
    newsockfd = accept(sockfd, (struct sockaddr *)&cli_addr, &clilen);
    if (newsockfd < 0) {
      fprintf(stderr, "accept client failed\n");
      continue;
    }
    char *str = "hello, world\n";
    ssize_t num_bytes;
    int tmp_errno;
    while (1) {
      tmp_errno = errno;
      errno = 0;
      num_bytes = write(newsockfd, str, strlen(str));
      if (num_bytes != strlen(str)) {
        if (errno == EPIPE) {
          close(newsockfd);
          newsockfd = -1;
          errno = tmp_errno;
          printf("Client close connection.\n");
          break;
        } else
          fprintf(stderr, "write() failed: %s\n", strerror(errno));
      }
      sleep(5);
    }
    continue;
  }
  close(sockfd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1a85,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    0x2dc5(%rip),%rax
mov    (%rax),%edi
mov    0x2d94(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1110 <socket@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    125f <main+0x6f>
mov    0x2d87(%rip),%rax
mov    (%rax),%edi
lea    0xdb6(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    0x2d50(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1080 <memset@plt>
mov    0x2d6a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    0x2d56(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x14(%rbp),%edi
call   1060 <htons@plt>
mov    %eax,-0x30(%rbp)
mov    -0x1c(%rbp),%edi
mov    0x2d4c(%rip),%rax
mov    (%rax),%esi
mov    0x2cfb(%rip),%rax
mov    (%rax),%edx
lea    -0x18(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0x0,%rax
jge    12e5 <main+0xf5>
mov    0x2d01(%rip),%rax
mov    (%rax),%edi
lea    0xd46(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    0x2cca(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
mov    -0x1c(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0xc,%edx
call   10c0 <bind@plt>
cmp    $0x0,%rax
jge    1325 <main+0x135>
mov    0x2cc1(%rip),%rax
mov    (%rax),%edi
lea    0xd1a(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    0x2c8a(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
mov    -0x1c(%rbp),%edi
mov    $0x5,%esi
call   10b0 <listen@plt>
movl   $0xc,-0x24(%rbp)
mov    -0x1c(%rbp),%edi
lea    -0x40(%rbp),%rsi
lea    -0x24(%rbp),%rdx
call   10d0 <accept@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    1372 <main+0x182>
mov    0x2c6b(%rip),%rax
mov    (%rax),%edi
lea    0xcd5(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    1332 <main+0x142>
lea    0xcd8(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0x2c2c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
mov    0x2c20(%rip),%rax
movl   $0x0,(%rax)
mov    -0x20(%rbp),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x48(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x6c(%rbp),%edi
mov    -0x68(%rbp),%rsi
mov    %rax,%rdx
call   1040 <write@plt>
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x48(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rcx
mov    -0x60(%rbp),%rax
cmp    %rcx,%rax
je     1458 <main+0x268>
mov    0x2bc8(%rip),%rax
mov    (%rax),%eax
mov    0x2bcf(%rip),%rcx
cmp    (%rcx),%eax
jne    1425 <main+0x235>
mov    -0x20(%rbp),%edi
call   1090 <close@plt>
movl   $0xffffffff,-0x20(%rbp)
mov    -0x54(%rbp),%ecx
mov    0x2b9e(%rip),%rax
mov    %ecx,(%rax)
lea    0xc44(%rip),%rdi
call   1070 <printf@plt>
jmp    1467 <main+0x277>
mov    0x2b9c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x70(%rbp)
mov    0x2b78(%rip),%rax
mov    (%rax),%edi
call   10f0 <strerror@plt>
mov    -0x70(%rbp),%edi
mov    %rax,%rdx
lea    0xc2d(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    1458 <main+0x268>
mov    $0x5,%edi
call   1100 <sleep@plt>
jmp    137d <main+0x18d>
jmp    1332 <main+0x142>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
movl   $0x1,0x14(%rsp)
mov    0x2de3(%rip),%rbp
mov    0x0(%rbp),%edi
mov    0x2db1(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1100 <socket@plt>
test   %eax,%eax
js     137b <main+0x19b>
mov    %eax,%ebx
lea    0x18(%rsp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1070 <memset@plt>
mov    0x0(%rbp),%eax
mov    %eax,0x20(%rsp)
mov    0x2d9f(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x1c(%rsp)
mov    $0x1a85,%edi
call   1060 <htons@plt>
mov    %eax,0x18(%rsp)
mov    0x2d94(%rip),%rax
mov    (%rax),%esi
mov    0x2d43(%rip),%rax
mov    (%rax),%edx
lea    0x14(%rsp),%rcx
mov    %ebx,%edi
mov    $0x4,%r8d
call   1040 <setsockopt@plt>
test   %rax,%rax
js     138d <main+0x1ad>
lea    0x18(%rsp),%rsi
mov    %ebx,%edi
mov    $0xc,%edx
call   10b0 <bind@plt>
test   %rax,%rax
js     139f <main+0x1bf>
mov    %ebx,%edi
mov    $0x5,%esi
call   10a0 <listen@plt>
mov    0x2d09(%rip),%rbp
lea    0xda3(%rip),%r12
mov    0x2d0b(%rip),%r15
mov    %ebx,0xc(%rsp)
jmp    12db <main+0xfb>
nopl   0x0(%rax,%rax,1)
mov    %r13d,%edi
call   1080 <close@plt>
mov    %ebx,0x0(%rbp)
lea    0xda1(%rip),%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%ebx
movl   $0xc,0x10(%rsp)
mov    %ebx,%edi
lea    0x28(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   10c0 <accept@plt>
mov    %eax,%r13d
test   %eax,%eax
jns    132a <main+0x14a>
mov    0x2cc6(%rip),%rax
mov    (%rax),%edi
lea    0xd30(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0xc(%rsp),%ebx
jmp    12db <main+0xfb>
nopl   0x0(%rax,%rax,1)
mov    $0x5,%edi
call   10f0 <sleep@plt>
mov    0x0(%rbp),%ebx
movl   $0x0,0x0(%rbp)
mov    $0xd,%edx
mov    %r13d,%edi
mov    %r12,%rsi
call   1050 <write@plt>
cmp    $0xd,%rax
je     1320 <main+0x140>
mov    0x0(%rbp),%edi
cmp    (%r15),%edi
je     12c0 <main+0xe0>
mov    0x2c6b(%rip),%rax
mov    (%rax),%r14d
call   10e0 <strerror@plt>
mov    %r14d,%edi
lea    0xcf0(%rip),%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
jmp    1320 <main+0x140>
mov    0x2c46(%rip),%rax
mov    (%rax),%edi
lea    0xc75(%rip),%rsi
jmp    13af <main+0x1cf>
mov    0x2c34(%rip),%rax
mov    (%rax),%edi
lea    0xc79(%rip),%rsi
jmp    13af <main+0x1cf>
mov    0x2c22(%rip),%rax
mov    (%rax),%edi
lea    0xc7b(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x2beb(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@stderr = global i32 0
@.str = [22 x i8] c"ERROR opening socket\0A\00"
@EXIT_FAILURE = global i32 0
@INADDR_ANY = global i32 0
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@.str.1 = [20 x i8] c"ERROR ON setockopt\0A\00"
@.str.2 = [17 x i8] c"ERROR on binding\00"
@.str.3 = [22 x i8] c"accept client failed\0A\00"
@.str.4 = [14 x i8] c"hello, world\0A\00"
@errno = global i32 0
@EPIPE = global i32 0
@.str.5 = [26 x i8] c"Client close connection.\0A\00"
@.str.6 = [20 x i8] c"write() failed: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca %struct.sockaddr_in
%12 = alloca %struct.sockaddr_in
%13 = alloca i8*
%14 = alloca i64
%15 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 6789, i32* %6
store i32 1, i32* %7
%16 = load i32, i32* @AF_INET
%17 = load i32, i32* @SOCK_STREAM
%18 = call i32 @socket(i32 %16, i32 %17, i32 0)
store i32 %18, i32* %8
%19 = load i32, i32* %8
%20 = icmp slt i32 %19, 0
br i1 %20, label %21, label %26
21: ; preds = %2
%22 = load i32, i32* @stderr
%23 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%24 = load i32, i32* @EXIT_FAILURE
%25 = call i32 @exit(i32 %24)
unreachable
26: ; preds = %2
%27 = call i32 @memset(%struct.sockaddr_in* %11, i32 0, i32 12)
%28 = load i32, i32* @AF_INET
%29 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 2
store i32 %28, i32* %29
%30 = load i32, i32* @INADDR_ANY
%31 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 1
%32 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %31, i32 0, i32 0
store i32 %30, i32* %32
%33 = load i32, i32* %6
%34 = call i32 @htons(i32 %33)
%35 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 0
store i32 %34, i32* %35
%36 = load i32, i32* %8
%37 = load i32, i32* @SOL_SOCKET
%38 = load i32, i32* @SO_REUSEADDR
%39 = call i64 @setsockopt(i32 %36, i32 %37, i32 %38, i32* %7, i32 4)
%40 = icmp slt i64 %39, 0
br i1 %40, label %41, label %46
41: ; preds = %26
%42 = load i32, i32* @stderr
%43 = call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%44 = load i32, i32* @EXIT_FAILURE
%45 = call i32 @exit(i32 %44)
unreachable
46: ; preds = %26
%47 = load i32, i32* %8
%48 = bitcast %struct.sockaddr_in* %11 to %struct.sockaddr*
%49 = call i64 @bind(i32 %47, %struct.sockaddr* %48, i32 12)
%50 = icmp slt i64 %49, 0
br i1 %50, label %51, label %56
51: ; preds = %46
%52 = load i32, i32* @stderr
%53 = call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%54 = load i32, i32* @EXIT_FAILURE
%55 = call i32 @exit(i32 %54)
unreachable
56: ; preds = %46
%57 = load i32, i32* %8
%58 = call i32 @listen(i32 %57, i32 5)
br label %59
59: ; preds = %56, %65, %97
store i32 12, i32* %10
%60 = load i32, i32* %8
%61 = bitcast %struct.sockaddr_in* %12 to %struct.sockaddr*
%62 = call i32 @accept(i32 %60, %struct.sockaddr* %61, i32* %10)
store i32 %62, i32* %9
%63 = load i32, i32* %9
%64 = icmp slt i32 %63, 0
br i1 %64, label %65, label %68
65: ; preds = %59
%66 = load i32, i32* @stderr
%67 = call i32 (i32, i8*, ...) @fprintf(i32 %66, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
br label %59
68: ; preds = %59
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8** %13
br label %69
69: ; preds = %68, %95
%70 = load i32, i32* @errno
store i32 %70, i32* %15
store i32 0, i32* @errno
%71 = load i32, i32* %9
%72 = load i8*, i8** %13
%73 = load i8*, i8** %13
%74 = call i64 @strlen(i8* %73)
%75 = call i64 @write(i32 %71, i8* %72, i64 %74)
store i64 %75, i64* %14
%76 = load i64, i64* %14
%77 = load i8*, i8** %13
%78 = call i64 @strlen(i8* %77)
%79 = icmp ne i64 %76, %78
br i1 %79, label %80, label %95
80: ; preds = %69
%81 = load i32, i32* @errno
%82 = load i32, i32* @EPIPE
%83 = icmp eq i32 %81, %82
br i1 %83, label %84, label %89
84: ; preds = %80
%85 = load i32, i32* %9
%86 = call i32 @close(i32 %85)
store i32 -1, i32* %9
%87 = load i32, i32* %15
store i32 %87, i32* @errno
%88 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
br label %97
89: ; preds = %80
%90 = load i32, i32* @stderr
%91 = load i32, i32* @errno
%92 = call i8* @strerror(i32 %91)
%93 = call i32 (i32, i8*, ...) @fprintf(i32 %90, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i8* %92)
br label %94
94: ; preds = %89
br label %95
95: ; preds = %94, %69
%96 = call i32 @sleep(i32 5)
br label %69
97: ; preds = %84
br label %59
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@stderr = global i32 0
@.str = [22 x i8] c"ERROR opening socket\0A\00"
@EXIT_FAILURE = global i32 0
@INADDR_ANY = global i32 0
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@.str.1 = [20 x i8] c"ERROR ON setockopt\0A\00"
@.str.2 = [17 x i8] c"ERROR on binding\00"
@.str.3 = [22 x i8] c"accept client failed\0A\00"
@.str.4 = [14 x i8] c"hello, world\0A\00"
@errno = global i32 0
@EPIPE = global i32 0
@.str.6 = [20 x i8] c"write() failed: %s\0A\00"
@str = [25 x i8] c"Client close connection.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.sockaddr_in
%6 = alloca %struct.sockaddr_in
%7 = bitcast i32* %3 to i8*
store i32 1, i32* %3
%8 = bitcast i32* %4 to i8*
%9 = bitcast %struct.sockaddr_in* %5 to i8*
%10 = bitcast %struct.sockaddr_in* %6 to i8*
%11 = load i32, i32* @AF_INET
%12 = load i32, i32* @SOCK_STREAM
%13 = tail call i32 @socket(i32 %11, i32 %12, i32 0)
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = tail call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%18 = load i32, i32* @EXIT_FAILURE
%19 = tail call i32 @exit(i32 %18)
unreachable
20: ; preds = %2
%21 = call i32 @memset(%struct.sockaddr_in* %5, i32 0, i32 12)
%22 = load i32, i32* @AF_INET
%23 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 2
store i32 %22, i32* %23
%24 = load i32, i32* @INADDR_ANY
%25 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 1, i32 0
store i32 %24, i32* %25
%26 = call i32 @htons(i32 6789)
%27 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 0
store i32 %26, i32* %27
%28 = load i32, i32* @SOL_SOCKET
%29 = load i32, i32* @SO_REUSEADDR
%30 = call i64 @setsockopt(i32 %13, i32 %28, i32 %29, i32* %3, i32 4)
%31 = icmp slt i64 %30, 0
br i1 %31, label %32, label %37
32: ; preds = %20
%33 = load i32, i32* @stderr
%34 = call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%35 = load i32, i32* @EXIT_FAILURE
%36 = call i32 @exit(i32 %35)
unreachable
37: ; preds = %20
%38 = bitcast %struct.sockaddr_in* %5 to %struct.sockaddr*
%39 = call i64 @bind(i32 %13, %struct.sockaddr* %38, i32 12)
%40 = icmp slt i64 %39, 0
br i1 %40, label %41, label %46
41: ; preds = %37
%42 = load i32, i32* @stderr
%43 = call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%44 = load i32, i32* @EXIT_FAILURE
%45 = call i32 @exit(i32 %44)
unreachable
46: ; preds = %37
%47 = call i32 @listen(i32 %13, i32 5)
%48 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
br label %49
49: ; preds = %55, %46
store i32 12, i32* %4
%50 = call i32 @accept(i32 %13, %struct.sockaddr* %48, i32* %4)
%51 = icmp slt i32 %50, 0
br i1 %51, label %52, label %56
52: ; preds = %49
%53 = load i32, i32* @stderr
%54 = call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
br label %55
55: ; preds = %52, %64
br label %49
56: ; preds = %49, %71
%57 = load i32, i32* @errno
store i32 0, i32* @errno
%58 = call i64 @write(i32 %50, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i64 13)
%59 = icmp eq i64 %58, 13
br i1 %59, label %71, label %60
60: ; preds = %56
%61 = load i32, i32* @errno
%62 = load i32, i32* @EPIPE
%63 = icmp eq i32 %61, %62
br i1 %63, label %64, label %67
64: ; preds = %60
%65 = call i32 @close(i32 %50)
store i32 %57, i32* @errno
%66 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
br label %55
67: ; preds = %60
%68 = load i32, i32* @stderr
%69 = call i8* @strerror(i32 %61)
%70 = call i32 (i32, i8*, ...) @fprintf(i32 %68, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i8* %69)
br label %71
71: ; preds = %67, %56
%72 = call i32 @sleep(i32 5)
br label %56
}