#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 int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int bind(int, struct sockaddr *, int);
int connect(int, struct sockaddr const *, int);
int errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fork();
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ inet_addr(char *);
int listen(int, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
char *strerror(int);
int main() {
  int sock = 0, ret = 0, val = 0, len = 0, tfd = 0;
  int csk[5];
  struct sockaddr_in sin;
  pid_t pid;
  sin.sin_family = AF_INET;
  sin.sin_addr.s_addr = inet_addr("192.168.0.119");
  sin.sin_port = htons(10292);
  if ((pid = fork()) == 0) {
    sock = socket(AF_INET, SOCK_STREAM, 0);
    if (sock == -1) {
      perror("socket failed");
      exit(-1);
    }
    ret = bind(sock, (struct sockaddr *)&sin, sizeof(struct sockaddr_in));
    if (ret == -1) {
      perror("bind failed");
      printf("errno = %d(%s)\n", errno, strerror(errno));
      exit(-1);
    }
    ret = listen(sock, 3);
    if (ret == -1) {
      perror("listen failed");
      printf("errno = %d(%s)\n", errno, strerror(errno));
      exit(-1);
    }
    sleep(100);
    exit(1);
  }
  sleep(3);
  for (val = 0; val < 5; val++) {
    csk[val] = socket(AF_INET, SOCK_STREAM, 0);
    if (csk[val] == -1) {
      perror("csk socket failed");
      exit(-1);
    }
    ret = connect(csk[val], (const struct sockaddr *)&sin,
                  sizeof(struct sockaddr));
    if (ret != 0) {
      printf("csk [%d] connect errno = %d(%s)\n", val, errno, strerror(errno));
    } else
      printf("cn ok\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    0x2def(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
lea    0xdfb(%rip),%rdi
call   1050 <inet_addr@plt>
mov    %eax,-0x3c(%rbp)
mov    $0x2834,%edi
call   1030 <htons@plt>
mov    %eax,-0x40(%rbp)
mov    $0x0,%al
call   10d0 <fork@plt>
mov    %eax,-0x44(%rbp)
cmp    $0x0,%eax
jne    133d <main+0x17d>
mov    0x2db4(%rip),%rax
mov    (%rax),%edi
mov    0x2d9b(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10e0 <socket@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1269 <main+0xa9>
lea    0xdd2(%rip),%rdi
call   1080 <perror@plt>
mov    $0xffffffff,%edi
call   1090 <exit@plt>
mov    -0x8(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    $0xc,%edx
call   1070 <bind@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    12cb <main+0x10b>
lea    0xd80(%rip),%rdi
call   1080 <perror@plt>
mov    0x2d36(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x48(%rbp)
mov    0x2d2a(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
mov    -0x48(%rbp),%esi
mov    %rax,%rdx
lea    0xd91(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1090 <exit@plt>
mov    -0x8(%rbp),%edi
mov    $0x3,%esi
call   1060 <listen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1329 <main+0x169>
lea    0xd2e(%rip),%rdi
call   1080 <perror@plt>
mov    0x2cd8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    0x2ccc(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
mov    -0x4c(%rbp),%esi
mov    %rax,%rdx
lea    0xd33(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1090 <exit@plt>
mov    $0x64,%edi
call   10c0 <sleep@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    $0x3,%edi
call   10c0 <sleep@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    1420 <main+0x260>
mov    0x2c89(%rip),%rax
mov    (%rax),%edi
mov    0x2c70(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10e0 <socket@plt>
mov    %eax,%ecx
movslq -0x10(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
movslq -0x10(%rbp),%rax
cmpl   $0xffffffff,-0x30(%rbp,%rax,4)
jne    13a0 <main+0x1e0>
lea    0xc97(%rip),%rdi
call   1080 <perror@plt>
mov    $0xffffffff,%edi
call   1090 <exit@plt>
movslq -0x10(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%edi
lea    -0x40(%rbp),%rsi
mov    $0x4,%edx
call   10a0 <connect@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     13ff <main+0x23f>
mov    -0x10(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    0x2c00(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x50(%rbp)
mov    0x2bf4(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
mov    -0x54(%rbp),%esi
mov    -0x50(%rbp),%edx
mov    %rax,%rcx
lea    0xc47(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    140d <main+0x24d>
lea    0xc55(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1412 <main+0x252>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    134e <main+0x18e>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    0x2e08(%rip),%r14
mov    (%r14),%eax
mov    %eax,0x8(%rsp)
lea    0xe12(%rip),%rdi
call   1060 <inet_addr@plt>
mov    %eax,0x4(%rsp)
mov    $0x2834,%edi
call   1040 <htons@plt>
mov    %eax,(%rsp)
xor    %eax,%eax
call   10e0 <fork@plt>
test   %eax,%eax
je     141a <main+0x24a>
mov    $0x3,%edi
call   10d0 <sleep@plt>
mov    (%r14),%edi
mov    0x2db1(%rip),%r15
mov    (%r15),%esi
xor    %edx,%edx
call   10f0 <socket@plt>
cmp    $0xffffffff,%eax
je     1404 <main+0x234>
mov    %rsp,%rsi
mov    %eax,%edi
mov    $0x4,%edx
call   10b0 <connect@plt>
test   %eax,%eax
je     1274 <main+0xa4>
mov    0x2d7c(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10c0 <strerror@plt>
lea    0xdd6(%rip),%rdi
xor    %esi,%esi
mov    %ebx,%edx
mov    %rax,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1280 <main+0xb0>
lea    0xde0(%rip),%rdi
call   1030 <puts@plt>
mov    (%r14),%edi
mov    (%r15),%esi
xor    %edx,%edx
call   10f0 <socket@plt>
cmp    $0xffffffff,%eax
je     1404 <main+0x234>
mov    %rsp,%rsi
mov    %eax,%edi
mov    $0x4,%edx
call   10b0 <connect@plt>
test   %eax,%eax
je     12d3 <main+0x103>
mov    0x2d20(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10c0 <strerror@plt>
lea    0xd7a(%rip),%rdi
mov    $0x1,%esi
mov    %ebx,%edx
mov    %rax,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
jmp    12df <main+0x10f>
lea    0xd81(%rip),%rdi
call   1030 <puts@plt>
mov    (%r14),%edi
mov    (%r15),%esi
xor    %edx,%edx
call   10f0 <socket@plt>
cmp    $0xffffffff,%eax
je     1404 <main+0x234>
mov    %rsp,%rsi
mov    %eax,%edi
mov    $0x4,%edx
call   10b0 <connect@plt>
test   %eax,%eax
je     1332 <main+0x162>
mov    0x2cc1(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10c0 <strerror@plt>
lea    0xd1b(%rip),%rdi
mov    $0x2,%esi
mov    %ebx,%edx
mov    %rax,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
jmp    133e <main+0x16e>
lea    0xd22(%rip),%rdi
call   1030 <puts@plt>
mov    (%r14),%edi
mov    (%r15),%esi
xor    %edx,%edx
call   10f0 <socket@plt>
cmp    $0xffffffff,%eax
je     1404 <main+0x234>
mov    %rsp,%rsi
mov    %eax,%edi
mov    $0x4,%edx
call   10b0 <connect@plt>
test   %eax,%eax
je     1391 <main+0x1c1>
mov    0x2c62(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10c0 <strerror@plt>
lea    0xcbc(%rip),%rdi
mov    $0x3,%esi
mov    %ebx,%edx
mov    %rax,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
jmp    139d <main+0x1cd>
lea    0xcc3(%rip),%rdi
call   1030 <puts@plt>
mov    (%r14),%edi
mov    (%r15),%esi
xor    %edx,%edx
call   10f0 <socket@plt>
cmp    $0xffffffff,%eax
je     1404 <main+0x234>
mov    %rsp,%rsi
mov    %eax,%edi
mov    $0x4,%edx
call   10b0 <connect@plt>
test   %eax,%eax
je     13ec <main+0x21c>
mov    0x2c07(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10c0 <strerror@plt>
lea    0xc61(%rip),%rdi
mov    $0x4,%esi
mov    %ebx,%edx
mov    %rax,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
jmp    13f8 <main+0x228>
lea    0xc68(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xc1d(%rip),%rdi
call   1090 <perror@plt>
mov    $0xffffffff,%edi
call   10a0 <exit@plt>
mov    (%r14),%edi
mov    0x2bb4(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10f0 <socket@plt>
cmp    $0xffffffff,%eax
jne    143b <main+0x26b>
lea    0xbf3(%rip),%rdi
jmp    140b <main+0x23b>
mov    %eax,%ebx
mov    %rsp,%rsi
mov    %eax,%edi
mov    $0xc,%edx
call   1080 <bind@plt>
cmp    $0xffffffff,%eax
jne    145a <main+0x28a>
lea    0xbb6(%rip),%rdi
jmp    1472 <main+0x2a2>
mov    %ebx,%edi
mov    $0x3,%esi
call   1070 <listen@plt>
cmp    $0xffffffff,%eax
jne    14a4 <main+0x2d4>
lea    0xba8(%rip),%rdi
call   1090 <perror@plt>
mov    0x2b52(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10c0 <strerror@plt>
lea    0xbbd(%rip),%rdi
mov    %ebx,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xffffffff,%edi
call   10a0 <exit@plt>
mov    $0x64,%edi
call   10d0 <sleep@plt>
mov    $0x1,%edi
call   10a0 <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
@.str = [14 x i8] c"192.168.0.119\00"
@SOCK_STREAM = global i32 0
@.str.1 = [14 x i8] c"socket failed\00"
@.str.2 = [12 x i8] c"bind failed\00"
@.str.3 = [16 x i8] c"errno = %d(%s)\0A\00"
@errno = global i32 0
@.str.4 = [14 x i8] c"listen failed\00"
@.str.5 = [18 x i8] c"csk socket failed\00"
@.str.6 = [33 x i8] c"csk [%d] connect errno = %d(%s)\0A\00"
@.str.7 = [7 x i8] c"cn ok\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [5 x i32]
%8 = alloca %struct.sockaddr_in
%9 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
%10 = load i32, i32* @AF_INET
%11 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 2
store i32 %10, i32* %11
%12 = call i32 @inet_addr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%13 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 1
%14 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %13, i32 0, i32 0
store i32 %12, i32* %14
%15 = call i32 @htons(i32 10292)
%16 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 0
store i32 %15, i32* %16
%17 = call i32 (...) @fork()
store i32 %17, i32* %9
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %56
19: ; preds = %0
%20 = load i32, i32* @AF_INET
%21 = load i32, i32* @SOCK_STREAM
%22 = call i32 @socket(i32 %20, i32 %21, i32 0)
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = icmp eq i32 %23, -1
br i1 %24, label %25, label %28
25: ; preds = %19
%26 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%27 = call i32 @exit(i32 -1)
unreachable
28: ; preds = %19
%29 = load i32, i32* %2
%30 = bitcast %struct.sockaddr_in* %8 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 eq i32 %32, -1
br i1 %33, label %34, label %41
34: ; preds = %28
%35 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%36 = load i32, i32* @errno
%37 = load i32, i32* @errno
%38 = call i8* @strerror(i32 %37)
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %36, i8* %38)
%40 = call i32 @exit(i32 -1)
unreachable
41: ; preds = %28
%42 = load i32, i32* %2
%43 = call i32 @listen(i32 %42, i32 3)
store i32 %43, i32* %3
%44 = load i32, i32* %3
%45 = icmp eq i32 %44, -1
br i1 %45, label %46, label %53
46: ; preds = %41
%47 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
%48 = load i32, i32* @errno
%49 = load i32, i32* @errno
%50 = call i8* @strerror(i32 %49)
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %48, i8* %50)
%52 = call i32 @exit(i32 -1)
unreachable
53: ; preds = %41
%54 = call i32 @sleep(i32 100)
%55 = call i32 @exit(i32 1)
unreachable
56: ; preds = %0
%57 = call i32 @sleep(i32 3)
store i32 0, i32* %4
br label %58
58: ; preds = %94, %56
%59 = load i32, i32* %4
%60 = icmp slt i32 %59, 5
br i1 %60, label %61, label %97
61: ; preds = %58
%62 = load i32, i32* @AF_INET
%63 = load i32, i32* @SOCK_STREAM
%64 = call i32 @socket(i32 %62, i32 %63, i32 0)
%65 = load i32, i32* %4
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 %66
store i32 %64, i32* %67
%68 = load i32, i32* %4
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 %69
%71 = load i32, i32* %70
%72 = icmp eq i32 %71, -1
br i1 %72, label %73, label %76
73: ; preds = %61
%74 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%75 = call i32 @exit(i32 -1)
unreachable
76: ; preds = %61
%77 = load i32, i32* %4
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 %78
%80 = load i32, i32* %79
%81 = bitcast %struct.sockaddr_in* %8 to %struct.sockaddr*
%82 = call i32 @connect(i32 %80, %struct.sockaddr* %81, i32 4)
store i32 %82, i32* %3
%83 = load i32, i32* %3
%84 = icmp ne i32 %83, 0
br i1 %84, label %85, label %91
85: ; preds = %76
%86 = load i32, i32* %4
%87 = load i32, i32* @errno
%88 = load i32, i32* @errno
%89 = call i8* @strerror(i32 %88)
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0), i32 %86, i32 %87, i8* %89)
br label %93
91: ; preds = %76
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
br label %93
93: ; preds = %91, %85
br label %94
94: ; preds = %93
%95 = load i32, i32* %4
%96 = add nsw i32 %95, 1
store i32 %96, i32* %4
br label %58
97: ; preds = %58
ret i32 0
}

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
@.str = [14 x i8] c"192.168.0.119\00"
@SOCK_STREAM = global i32 0
@.str.1 = [14 x i8] c"socket failed\00"
@.str.2 = [12 x i8] c"bind failed\00"
@.str.3 = [16 x i8] c"errno = %d(%s)\0A\00"
@errno = global i32 0
@.str.4 = [14 x i8] c"listen failed\00"
@.str.5 = [18 x i8] c"csk socket failed\00"
@.str.6 = [33 x i8] c"csk [%d] connect errno = %d(%s)\0A\00"
@str = [6 x i8] c"cn ok\00"
define i32 @main() {
%1 = alloca %struct.sockaddr_in
%2 = bitcast %struct.sockaddr_in* %1 to i8*
%3 = load i32, i32* @AF_INET
%4 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 2
store i32 %3, i32* %4
%5 = tail call i32 @inet_addr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 1, i32 0
store i32 %5, i32* %6
%7 = tail call i32 @htons(i32 10292)
%8 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 0
store i32 %7, i32* %8
%9 = tail call i32 (...) @fork()
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %41
11: ; preds = %0
%12 = load i32, i32* @AF_INET
%13 = load i32, i32* @SOCK_STREAM
%14 = tail call i32 @socket(i32 %12, i32 %13, i32 0)
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %19
16: ; preds = %11
%17 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%18 = tail call i32 @exit(i32 -1)
unreachable
19: ; preds = %11
%20 = bitcast %struct.sockaddr_in* %1 to %struct.sockaddr*
%21 = call i32 @bind(i32 %14, %struct.sockaddr* %20, i32 12)
%22 = icmp eq i32 %21, -1
br i1 %22, label %23, label %29
23: ; preds = %19
%24 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%25 = load i32, i32* @errno
%26 = call i8* @strerror(i32 %25)
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %25, i8* %26)
%28 = call i32 @exit(i32 -1)
unreachable
29: ; preds = %19
%30 = call i32 @listen(i32 %14, i32 3)
%31 = icmp eq i32 %30, -1
br i1 %31, label %32, label %38
32: ; preds = %29
%33 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
%34 = load i32, i32* @errno
%35 = call i8* @strerror(i32 %34)
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %34, i8* %35)
%37 = call i32 @exit(i32 -1)
unreachable
38: ; preds = %29
%39 = call i32 @sleep(i32 100)
%40 = call i32 @exit(i32 1)
unreachable
41: ; preds = %0
%42 = tail call i32 @sleep(i32 3)
%43 = bitcast %struct.sockaddr_in* %1 to %struct.sockaddr*
%44 = load i32, i32* @AF_INET
%45 = load i32, i32* @SOCK_STREAM
%46 = call i32 @socket(i32 %44, i32 %45, i32 0)
%47 = icmp eq i32 %46, -1
br i1 %47, label %48, label %51
48: ; preds = %102, %88, %74, %60, %41
%49 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%50 = call i32 @exit(i32 -1)
unreachable
51: ; preds = %41
%52 = call i32 @connect(i32 %46, %struct.sockaddr* %43, i32 4)
%53 = icmp eq i32 %52, 0
br i1 %53, label %58, label %54
54: ; preds = %51
%55 = load i32, i32* @errno
%56 = call i8* @strerror(i32 %55)
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0), i32 0, i32 %55, i8* %56)
br label %60
58: ; preds = %51
%59 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
br label %60
60: ; preds = %54, %58
%61 = load i32, i32* @AF_INET
%62 = load i32, i32* @SOCK_STREAM
%63 = call i32 @socket(i32 %61, i32 %62, i32 0)
%64 = icmp eq i32 %63, -1
br i1 %64, label %48, label %65
65: ; preds = %60
%66 = call i32 @connect(i32 %63, %struct.sockaddr* %43, i32 4)
%67 = icmp eq i32 %66, 0
br i1 %67, label %72, label %68
68: ; preds = %65
%69 = load i32, i32* @errno
%70 = call i8* @strerror(i32 %69)
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0), i32 1, i32 %69, i8* %70)
br label %74
72: ; preds = %65
%73 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
br label %74
74: ; preds = %72, %68
%75 = load i32, i32* @AF_INET
%76 = load i32, i32* @SOCK_STREAM
%77 = call i32 @socket(i32 %75, i32 %76, i32 0)
%78 = icmp eq i32 %77, -1
br i1 %78, label %48, label %79
79: ; preds = %74
%80 = call i32 @connect(i32 %77, %struct.sockaddr* %43, i32 4)
%81 = icmp eq i32 %80, 0
br i1 %81, label %86, label %82
82: ; preds = %79
%83 = load i32, i32* @errno
%84 = call i8* @strerror(i32 %83)
%85 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0), i32 2, i32 %83, i8* %84)
br label %88
86: ; preds = %79
%87 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
br label %88
88: ; preds = %86, %82
%89 = load i32, i32* @AF_INET
%90 = load i32, i32* @SOCK_STREAM
%91 = call i32 @socket(i32 %89, i32 %90, i32 0)
%92 = icmp eq i32 %91, -1
br i1 %92, label %48, label %93
93: ; preds = %88
%94 = call i32 @connect(i32 %91, %struct.sockaddr* %43, i32 4)
%95 = icmp eq i32 %94, 0
br i1 %95, label %100, label %96
96: ; preds = %93
%97 = load i32, i32* @errno
%98 = call i8* @strerror(i32 %97)
%99 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0), i32 3, i32 %97, i8* %98)
br label %102
100: ; preds = %93
%101 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
br label %102
102: ; preds = %100, %96
%103 = load i32, i32* @AF_INET
%104 = load i32, i32* @SOCK_STREAM
%105 = call i32 @socket(i32 %103, i32 %104, i32 0)
%106 = icmp eq i32 %105, -1
br i1 %106, label %48, label %107
107: ; preds = %102
%108 = call i32 @connect(i32 %105, %struct.sockaddr* %43, i32 4)
%109 = icmp eq i32 %108, 0
br i1 %109, label %114, label %110
110: ; preds = %107
%111 = load i32, i32* @errno
%112 = call i8* @strerror(i32 %111)
%113 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0), i32 4, i32 %111, i8* %112)
br label %116
114: ; preds = %107
%115 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
br label %116
116: ; preds = %114, %110
ret i32 0
}