#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_zero;
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_port;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ addr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
scalar_t__ EAGAIN;
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int /*<<< orphan*/ INADDR_ANY;
int O_NONBLOCK;
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int accept(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int bind(int, struct sockaddr *, int);
int /*<<< orphan*/ close(int);
scalar_t__ errno;
int fcntl(int, int /*<<< orphan*/, ...);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ htons(int);
int listen(int, int);
int /*<<< orphan*/ memset(int /*<<< orphan*/, char, int);
int /*<<< orphan*/ printf(char *);
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
char *strerror(scalar_t__);
int create_pts(void) {
  struct sockaddr_in addr;
  int ret;
  int jp_comm_m;
  int jp_comm;
  addr.sin_family = AF_INET;
  addr.sin_port = htons(4567);
  addr.sin_addr.s_addr = INADDR_ANY;
  memset(addr.sin_zero, '\0', sizeof(addr.sin_zero));
  jp_comm_m = socket(PF_INET, SOCK_STREAM, 0);
  if (jp_comm_m < 0) {
    fprintf(stderr, "Unable to create comm socket: %s\n", strerror(errno));
    return 0;
  }
  int yes = 1;
  if (setsockopt(jp_comm_m, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) ==
      -1) {
    fprintf(stderr, "Unable to setsockopt on the socket: %s\n",
            strerror(errno));
    return 0;
  }
  if (bind(jp_comm_m, (struct sockaddr *)&addr, sizeof(addr)) == -1) {
    fprintf(stderr, "Unable to bind the socket: %s\n", strerror(errno));
    return 0;
  }
  if (listen(jp_comm_m, 1) == -1) {
    fprintf(stderr, "Unable to listen: %s\n", strerror(errno));
    return 0;
  }
  fprintf(stderr, "Listening on port %d\n", 4567);
  if ((jp_comm = accept(jp_comm_m, NULL, NULL)) == -1) {
    if (errno == EAGAIN)
      return 0;
    fprintf(stderr, "Unable to accept connection: %s\n", strerror(errno));
    return 0;
  }
  ret = fcntl(jp_comm, F_GETFL);
  ret |= O_NONBLOCK;
  fcntl(jp_comm, F_SETFL, ret);
  close(jp_comm_m);
  printf("UART communication connected!\n");
  return (jp_comm);
}


x86 assembly (clang, -O0):
<create_pts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x2e11(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x11d7,%edi
call   1050 <htons@plt>
mov    %eax,-0x10(%rbp)
mov    0x2de8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%edi
xor    %esi,%esi
mov    $0x4,%edx
call   1070 <memset@plt>
mov    0x2d95(%rip),%rax
mov    (%rax),%edi
mov    0x2da4(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10e0 <socket@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    125d <create_pts+0x9d>
mov    0x2d97(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    0x2d73(%rip),%rax
mov    (%rax),%rdi
call   10d0 <strerror@plt>
mov    -0x2c(%rbp),%edi
mov    %rax,%rdx
lea    0xdb6(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    145f <create_pts+0x29f>
movl   $0x1,-0x28(%rbp)
mov    -0x20(%rbp),%edi
mov    0x2d7a(%rip),%rax
mov    (%rax),%esi
mov    0x2d19(%rip),%rax
mov    (%rax),%edx
lea    -0x28(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0xffffffff,%eax
jne    12cc <create_pts+0x10c>
mov    0x2d28(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    0x2d04(%rip),%rax
mov    (%rax),%rdi
call   10d0 <strerror@plt>
mov    -0x30(%rbp),%edi
mov    %rax,%rdx
lea    0xd69(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    145f <create_pts+0x29f>
mov    -0x20(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x10,%edx
call   10b0 <bind@plt>
cmp    $0xffffffff,%eax
jne    1321 <create_pts+0x161>
mov    0x2cd3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    0x2caf(%rip),%rax
mov    (%rax),%rdi
call   10d0 <strerror@plt>
mov    -0x34(%rbp),%edi
mov    %rax,%rdx
lea    0xd3c(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    145f <create_pts+0x29f>
mov    -0x20(%rbp),%edi
mov    $0x1,%esi
call   10a0 <listen@plt>
cmp    $0xffffffff,%eax
jne    1372 <create_pts+0x1b2>
mov    0x2c82(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
mov    0x2c5e(%rip),%rax
mov    (%rax),%rdi
call   10d0 <strerror@plt>
mov    -0x38(%rbp),%edi
mov    %rax,%rdx
lea    0xd0a(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    145f <create_pts+0x29f>
mov    0x2c47(%rip),%rax
mov    (%rax),%edi
lea    0xcfd(%rip),%rsi
mov    $0x11d7,%edx
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x20(%rbp),%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   10c0 <accept@plt>
mov    %eax,-0x24(%rbp)
cmp    $0xffffffff,%eax
jne    140a <create_pts+0x24a>
mov    0x2bf8(%rip),%rax
mov    (%rax),%rax
mov    0x2bc6(%rip),%rcx
cmp    (%rcx),%rax
jne    13cf <create_pts+0x20f>
movl   $0x0,-0x4(%rbp)
jmp    145f <create_pts+0x29f>
mov    0x2bea(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    0x2bc6(%rip),%rax
mov    (%rax),%rdi
call   10d0 <strerror@plt>
mov    -0x3c(%rbp),%edi
mov    %rax,%rdx
lea    0xc9e(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    145f <create_pts+0x29f>
mov    -0x24(%rbp),%edi
mov    0x2b8c(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1040 <fcntl@plt>
mov    %eax,-0x1c(%rbp)
mov    0x2bb1(%rip),%rax
mov    (%rax),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x24(%rbp),%edi
mov    0x2b7f(%rip),%rax
mov    (%rax),%esi
mov    -0x1c(%rbp),%edx
mov    $0x0,%al
call   1040 <fcntl@plt>
mov    -0x20(%rbp),%edi
call   1080 <close@plt>
lea    0xc62(%rip),%rdi
call   1060 <printf@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_pts>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    0x2e0f(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x14(%rsp)
mov    $0x11d7,%edi
call   1060 <htons@plt>
mov    %eax,0x10(%rsp)
mov    0x2de4(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rsp)
xor    %ebx,%ebx
xor    %esi,%esi
mov    $0x4,%edx
call   1070 <memset@plt>
mov    0x2d91(%rip),%rax
mov    (%rax),%edi
mov    0x2da0(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10e0 <socket@plt>
test   %eax,%eax
js     1309 <create_pts+0x149>
mov    %eax,%ebp
movl   $0x1,0x4(%rsp)
mov    0x2db6(%rip),%rax
mov    (%rax),%esi
mov    0x2d55(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    %ebp,%edi
mov    $0x4,%r8d
call   1040 <setsockopt@plt>
cmp    $0xffffffff,%eax
je     132a <create_pts+0x16a>
lea    0x8(%rsp),%rsi
mov    %ebp,%edi
mov    $0x10,%edx
call   10b0 <bind@plt>
cmp    $0xffffffff,%eax
je     134b <create_pts+0x18b>
mov    %ebp,%edi
mov    $0x1,%esi
call   10a0 <listen@plt>
mov    0x2d3b(%rip),%r15
mov    (%r15),%r14d
cmp    $0xffffffff,%eax
je     1385 <create_pts+0x1c5>
lea    0xde7(%rip),%rsi
xor    %ebx,%ebx
mov    %r14d,%edi
mov    $0x11d7,%edx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    %ebp,%edi
xor    %esi,%esi
xor    %edx,%edx
call   10c0 <accept@plt>
cmp    $0xffffffff,%eax
je     13a2 <create_pts+0x1e2>
mov    %eax,%r14d
mov    0x2cd9(%rip),%rax
mov    (%rax),%esi
mov    %r14d,%edi
xor    %eax,%eax
call   1050 <fcntl@plt>
mov    0x2cfe(%rip),%rcx
or     (%rcx),%eax
mov    0x2cd5(%rip),%rcx
mov    (%rcx),%esi
mov    %r14d,%edi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <fcntl@plt>
mov    %ebp,%edi
call   1080 <close@plt>
lea    0xdb7(%rip),%rdi
call   1030 <puts@plt>
mov    %r14d,%ebx
jmp    1378 <create_pts+0x1b8>
mov    0x2cb0(%rip),%rax
mov    (%rax),%ebp
mov    0x2c8f(%rip),%rax
mov    (%rax),%rdi
call   10d0 <strerror@plt>
lea    0xcd8(%rip),%rsi
jmp    136c <create_pts+0x1ac>
mov    0x2c8f(%rip),%rax
mov    (%rax),%ebp
mov    0x2c6e(%rip),%rax
mov    (%rax),%rdi
call   10d0 <strerror@plt>
lea    0xcd9(%rip),%rsi
jmp    136a <create_pts+0x1aa>
mov    0x2c6e(%rip),%rax
mov    (%rax),%ebp
mov    0x2c4d(%rip),%rax
mov    (%rax),%rdi
call   10d0 <strerror@plt>
lea    0xce0(%rip),%rsi
xor    %ebx,%ebx
mov    %ebp,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c1c(%rip),%rax
mov    (%rax),%rdi
call   10d0 <strerror@plt>
lea    0xcce(%rip),%rsi
xor    %ebx,%ebx
mov    %r14d,%edi
jmp    136e <create_pts+0x1ae>
mov    0x2bff(%rip),%rax
mov    (%rax),%rdi
mov    0x2bcd(%rip),%rax
cmp    (%rax),%rdi
je     1378 <create_pts+0x1b8>
mov    (%r15),%ebp
call   10d0 <strerror@plt>
lea    0xcce(%rip),%rsi
jmp    136a <create_pts+0x1aa>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@INADDR_ANY = global i32 0
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@stderr = global i32 0
@.str = [34 x i8] c"Unable to create comm socket: %s\0A\00"
@errno = global i64 0
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@.str.1 = [40 x i8] c"Unable to setsockopt on the socket: %s\0A\00"
@.str.2 = [31 x i8] c"Unable to bind the socket: %s\0A\00"
@.str.3 = [22 x i8] c"Unable to listen: %s\0A\00"
@.str.4 = [22 x i8] c"Listening on port %d\0A\00"
@EAGAIN = global i64 0
@.str.5 = [33 x i8] c"Unable to accept connection: %s\0A\00"
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
@.str.6 = [31 x i8] c"UART communication connected!\0A\00"
define i32 @create_pts() {
%1 = alloca i32
%2 = alloca %struct.sockaddr_in
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = load i32, i32* @AF_INET
%8 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i32 0, i32 3
store i32 %7, i32* %8
%9 = call i32 @htons(i32 4567)
%10 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i32 0, i32 2
store i32 %9, i32* %10
%11 = load i32, i32* @INADDR_ANY
%12 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i32 0, i32 1
%13 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %12, i32 0, i32 0
store i32 %11, i32* %13
%14 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i32 0, i32 0
%15 = load i32, i32* %14
%16 = call i32 @memset(i32 %15, i8 signext 0, i32 4)
%17 = load i32, i32* @PF_INET
%18 = load i32, i32* @SOCK_STREAM
%19 = call i32 @socket(i32 %17, i32 %18, i32 0)
store i32 %19, i32* %4
%20 = load i32, i32* %4
%21 = icmp slt i32 %20, 0
br i1 %21, label %22, label %27
22: ; preds = %0
%23 = load i32, i32* @stderr
%24 = load i64, i64* @errno
%25 = call i8* @strerror(i64 %24)
%26 = call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %25)
store i32 0, i32* %1
br label %88
27: ; preds = %0
store i32 1, i32* %6
%28 = load i32, i32* %4
%29 = load i32, i32* @SOL_SOCKET
%30 = load i32, i32* @SO_REUSEADDR
%31 = call i32 @setsockopt(i32 %28, i32 %29, i32 %30, i32* %6, i32 4)
%32 = icmp eq i32 %31, -1
br i1 %32, label %33, label %38
33: ; preds = %27
%34 = load i32, i32* @stderr
%35 = load i64, i64* @errno
%36 = call i8* @strerror(i64 %35)
%37 = call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i8* %36)
store i32 0, i32* %1
br label %88
38: ; preds = %27
%39 = load i32, i32* %4
%40 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%41 = call i32 @bind(i32 %39, %struct.sockaddr* %40, i32 16)
%42 = icmp eq i32 %41, -1
br i1 %42, label %43, label %48
43: ; preds = %38
%44 = load i32, i32* @stderr
%45 = load i64, i64* @errno
%46 = call i8* @strerror(i64 %45)
%47 = call i32 (i32, i8*, ...) @fprintf(i32 %44, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* %46)
store i32 0, i32* %1
br label %88
48: ; preds = %38
%49 = load i32, i32* %4
%50 = call i32 @listen(i32 %49, i32 1)
%51 = icmp eq i32 %50, -1
br i1 %51, label %52, label %57
52: ; preds = %48
%53 = load i32, i32* @stderr
%54 = load i64, i64* @errno
%55 = call i8* @strerror(i64 %54)
%56 = call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i8* %55)
store i32 0, i32* %1
br label %88
57: ; preds = %48
%58 = load i32, i32* @stderr
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 4567)
%60 = load i32, i32* %4
%61 = call i32 @accept(i32 %60, i32* null, i32* null)
store i32 %61, i32* %5
%62 = icmp eq i32 %61, -1
br i1 %62, label %63, label %73
63: ; preds = %57
%64 = load i64, i64* @errno
%65 = load i64, i64* @EAGAIN
%66 = icmp eq i64 %64, %65
br i1 %66, label %67, label %68
67: ; preds = %63
store i32 0, i32* %1
br label %88
68: ; preds = %63
%69 = load i32, i32* @stderr
%70 = load i64, i64* @errno
%71 = call i8* @strerror(i64 %70)
%72 = call i32 (i32, i8*, ...) @fprintf(i32 %69, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i8* %71)
store i32 0, i32* %1
br label %88
73: ; preds = %57
%74 = load i32, i32* %5
%75 = load i32, i32* @F_GETFL
%76 = call i32 (i32, i32, ...) @fcntl(i32 %74, i32 %75)
store i32 %76, i32* %3
%77 = load i32, i32* @O_NONBLOCK
%78 = load i32, i32* %3
%79 = or i32 %78, %77
store i32 %79, i32* %3
%80 = load i32, i32* %5
%81 = load i32, i32* @F_SETFL
%82 = load i32, i32* %3
%83 = call i32 (i32, i32, ...) @fcntl(i32 %80, i32 %81, i32 %82)
%84 = load i32, i32* %4
%85 = call i32 @close(i32 %84)
%86 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
%87 = load i32, i32* %5
store i32 %87, i32* %1
br label %88
88: ; preds = %73, %68, %67, %52, %43, %33, %22
%89 = load i32, i32* %1
ret i32 %89
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@INADDR_ANY = global i32 0
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@stderr = global i32 0
@.str = [34 x i8] c"Unable to create comm socket: %s\0A\00"
@errno = global i64 0
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@.str.1 = [40 x i8] c"Unable to setsockopt on the socket: %s\0A\00"
@.str.2 = [31 x i8] c"Unable to bind the socket: %s\0A\00"
@.str.3 = [22 x i8] c"Unable to listen: %s\0A\00"
@.str.4 = [22 x i8] c"Listening on port %d\0A\00"
@EAGAIN = global i64 0
@.str.5 = [33 x i8] c"Unable to accept connection: %s\0A\00"
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
@str = [30 x i8] c"UART communication connected!\00"
define i32 @create_pts() {
%1 = alloca %struct.sockaddr_in
%2 = alloca i32
%3 = bitcast %struct.sockaddr_in* %1 to i8*
%4 = load i32, i32* @AF_INET
%5 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 3
store i32 %4, i32* %5
%6 = tail call i32 @htons(i32 4567)
%7 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 2
store i32 %6, i32* %7
%8 = load i32, i32* @INADDR_ANY
%9 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 1, i32 0
store i32 %8, i32* %9
%10 = tail call i32 @memset(i32 undef, i8 signext 0, i32 4)
%11 = load i32, i32* @PF_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 = %0
%16 = load i32, i32* @stderr
%17 = load i64, i64* @errno
%18 = tail call i8* @strerror(i64 %17)
%19 = tail call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %18)
br label %71
20: ; preds = %0
%21 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%22 = load i32, i32* @SOL_SOCKET
%23 = load i32, i32* @SO_REUSEADDR
%24 = call i32 @setsockopt(i32 %13, i32 %22, i32 %23, i32* %2, i32 4)
%25 = icmp eq i32 %24, -1
br i1 %25, label %26, label %31
26: ; preds = %20
%27 = load i32, i32* @stderr
%28 = load i64, i64* @errno
%29 = call i8* @strerror(i64 %28)
%30 = call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i8* %29)
br label %69
31: ; preds = %20
%32 = bitcast %struct.sockaddr_in* %1 to %struct.sockaddr*
%33 = call i32 @bind(i32 %13, %struct.sockaddr* %32, i32 16)
%34 = icmp eq i32 %33, -1
br i1 %34, label %35, label %40
35: ; preds = %31
%36 = load i32, i32* @stderr
%37 = load i64, i64* @errno
%38 = call i8* @strerror(i64 %37)
%39 = call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* %38)
br label %69
40: ; preds = %31
%41 = call i32 @listen(i32 %13, i32 1)
%42 = icmp eq i32 %41, -1
%43 = load i32, i32* @stderr
br i1 %42, label %44, label %48
44: ; preds = %40
%45 = load i64, i64* @errno
%46 = call i8* @strerror(i64 %45)
%47 = call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i8* %46)
br label %69
48: ; preds = %40
%49 = call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 4567)
%50 = call i32 @accept(i32 %13, i32* null, i32* null)
%51 = icmp eq i32 %50, -1
br i1 %51, label %52, label %60
52: ; preds = %48
%53 = load i64, i64* @errno
%54 = load i64, i64* @EAGAIN
%55 = icmp eq i64 %53, %54
br i1 %55, label %69, label %56
56: ; preds = %52
%57 = load i32, i32* @stderr
%58 = call i8* @strerror(i64 %53)
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i8* %58)
br label %69
60: ; preds = %48
%61 = load i32, i32* @F_GETFL
%62 = call i32 (i32, i32, ...) @fcntl(i32 %50, i32 %61)
%63 = load i32, i32* @O_NONBLOCK
%64 = or i32 %63, %62
%65 = load i32, i32* @F_SETFL
%66 = call i32 (i32, i32, ...) @fcntl(i32 %50, i32 %65, i32 %64)
%67 = call i32 @close(i32 %13)
%68 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
br label %69
69: ; preds = %52, %60, %56, %44, %35, %26
%70 = phi i32 [ 0, %26 ], [ 0, %35 ], [ 0, %44 ], [ 0, %56 ], [ %50, %60 ], [ 0, %52 ]
br label %71
71: ; preds = %69, %15
%72 = phi i32 [ 0, %15 ], [ %70, %69 ]
ret i32 %72
}