#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 */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};
struct addrinfo {
  scalar_t__ ai_addr;
  int /*<<< orphan*/ ai_socktype;
  int /*<<< orphan*/ ai_family;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ F_SETFL;
int /*<<< orphan*/ O_NONBLOCK;
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ bzero(struct addrinfo *, int);
int /*<<< orphan*/ close(int);
int connect(int, struct sockaddr *, int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int fcntl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ freeaddrinfo(struct addrinfo *);
char *gai_strerror(int);
int getaddrinfo(char *, char *, struct addrinfo *, struct addrinfo **);
int /*<<< orphan*/ perror(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int recv(int, char *, int, int /*<<< orphan*/);
int send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void *fonctionThread(void *descSockP) {
  int retour = 0;
  struct sockaddr_in adress_sock;
  struct addrinfo *first_info;
  struct addrinfo hints;
  bzero(&hints, sizeof(struct addrinfo));
  hints.ai_family = AF_INET;
  hints.ai_socktype = SOCK_STREAM;
  retour = getaddrinfo("lucien", "2628", &hints, &first_info);
  if (retour != 0) {
    printf("%s\n", gai_strerror(retour));
    exit(1);
  }
  if (first_info != NULL) {
    adress_sock = *(struct sockaddr_in *)first_info->ai_addr;
  }
  int desc_sock = socket(PF_INET, SOCK_STREAM, 0);
  retour = connect(desc_sock, (struct sockaddr *)&adress_sock,
                   sizeof(struct sockaddr_in));
  if (retour == -1) {
    perror(strerror(errno));
    exit(1);
  }
  if (fcntl(desc_sock, F_SETFL, O_NONBLOCK) == -1) {
    perror(strerror(errno));
    exit(1);
  }
  int descSock = *(int *)descSockP;
  char buf2[1024];
  int recu = recv(descSock, buf2, 1023 * sizeof(char), 0);
  buf2[recu] = '\0';
  retour = send(desc_sock, buf2, strlen(buf2), 0);
  if (retour == -1) {
    perror(strerror(errno));
    exit(1);
  }
  sleep(1);
  char buff[1024];
  int size_rec = 0;
  while ((size_rec = recv(desc_sock, buff, 1023 * sizeof(char), 0)) != -1) {
    buff[size_rec] = '\0';
    retour = send(descSock, buff, strlen(buff), 0);
    if (retour == -1) {
      perror(strerror(errno));
      exit(1);
    }
  }
  close(desc_sock);
  freeaddrinfo(first_info);
  return NULL;
}


x86 assembly (clang, -O0):
<fonctionThread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x870,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x28(%rbp),%rdi
mov    $0x10,%esi
call   10b0 <bzero@plt>
mov    0x2dbd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    0x2d91(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
lea    0xdbd(%rip),%rdi
lea    0xdbd(%rip),%rsi
lea    -0x28(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   10e0 <getaddrinfo@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1285 <fonctionThread+0x85>
mov    -0xc(%rbp),%edi
call   1080 <gai_strerror@plt>
mov    %rax,%rsi
lea    0xd96(%rip),%rdi
call   1070 <printf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
cmpq   $0x0,-0x18(%rbp)
je     129c <fonctionThread+0x9c>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    0x2d15(%rip),%rax
mov    (%rax),%edi
mov    0x2d1c(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1120 <socket@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   10d0 <connect@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    12f5 <fonctionThread+0xf5>
mov    0x2ce3(%rip),%rax
mov    (%rax),%edi
call   10f0 <strerror@plt>
mov    %eax,%edi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x2c(%rbp),%edi
mov    0x2cd1(%rip),%rax
mov    (%rax),%esi
mov    0x2cd8(%rip),%rax
mov    (%rax),%edx
call   1040 <fcntl@plt>
cmp    $0xffffffff,%eax
jne    1337 <fonctionThread+0x137>
mov    0x2ca1(%rip),%rax
mov    (%rax),%edi
call   10f0 <strerror@plt>
mov    %eax,%edi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%edi
lea    -0x430(%rbp),%rsi
mov    $0x3ff,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x434(%rbp)
movslq -0x434(%rbp),%rax
movb   $0x0,-0x430(%rbp,%rax,1)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x854(%rbp)
lea    -0x430(%rbp),%rax
mov    %rax,-0x850(%rbp)
lea    -0x430(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x854(%rbp),%edi
mov    -0x850(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    13d0 <fonctionThread+0x1d0>
mov    0x2c08(%rip),%rax
mov    (%rax),%edi
call   10f0 <strerror@plt>
mov    %eax,%edi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    $0x1,%edi
call   1100 <sleep@plt>
movl   $0x0,-0x844(%rbp)
mov    -0x2c(%rbp),%edi
lea    -0x840(%rbp),%rsi
mov    $0x3ff,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x844(%rbp)
cmp    $0xffffffff,%eax
je     1482 <fonctionThread+0x282>
movslq -0x844(%rbp),%rax
movb   $0x0,-0x840(%rbp,%rax,1)
mov    -0x30(%rbp),%eax
mov    %eax,-0x864(%rbp)
lea    -0x840(%rbp),%rax
mov    %rax,-0x860(%rbp)
lea    -0x840(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x864(%rbp),%edi
mov    -0x860(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    147d <fonctionThread+0x27d>
mov    0x2b5b(%rip),%rax
mov    (%rax),%edi
call   10f0 <strerror@plt>
mov    %eax,%edi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
jmp    13e4 <fonctionThread+0x1e4>
mov    -0x2c(%rbp),%edi
call   1090 <close@plt>
mov    -0x18(%rbp),%rdi
call   1110 <freeaddrinfo@plt>
xor    %eax,%eax
add    $0x870,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fonctionThread>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x828,%rsp
mov    %rdi,%r14
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x10,%esi
call   10b0 <bzero@plt>
mov    0x2dbf(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x1c(%rsp)
mov    0x2d92(%rip),%rbp
mov    0x0(%rbp),%eax
mov    %eax,0x18(%rsp)
lea    0xdbc(%rip),%rdi
lea    0xdbc(%rip),%rsi
lea    0x8(%rsp),%rcx
mov    %rbx,%rdx
call   10e0 <getaddrinfo@plt>
test   %eax,%eax
jne    139a <fonctionThread+0x19a>
mov    0x8(%rsp),%rax
test   %rax,%rax
je     1272 <fonctionThread+0x72>
mov    (%rax),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
mov    0x2d3f(%rip),%rax
mov    (%rax),%edi
mov    0x0(%rbp),%esi
xor    %edx,%edx
call   1120 <socket@plt>
mov    %eax,%r15d
mov    %rsp,%rsi
mov    %eax,%edi
mov    $0x4,%edx
call   10d0 <connect@plt>
cmp    $0xffffffff,%eax
je     1359 <fonctionThread+0x159>
mov    0x2d29(%rip),%rax
mov    (%rax),%esi
mov    0x2d30(%rip),%rax
mov    (%rax),%edx
mov    %r15d,%edi
call   1040 <fcntl@plt>
cmp    $0xffffffff,%eax
je     1359 <fonctionThread+0x159>
mov    (%r14),%ebp
lea    0x420(%rsp),%rbx
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x3ff,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cltq
movb   $0x0,0x420(%rsp,%rax,1)
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %r15d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
cmp    $0xffffffff,%eax
je     1359 <fonctionThread+0x159>
mov    $0x1,%edi
call   1100 <sleep@plt>
lea    0x20(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r15d,%edi
mov    %rbx,%rsi
mov    $0x3ff,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
je     1378 <fonctionThread+0x178>
cltq
movb   $0x0,0x20(%rsp,%rax,1)
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
cmp    $0xffffffff,%eax
jne    1320 <fonctionThread+0x120>
mov    0x2c60(%rip),%rax
mov    (%rax),%edi
call   10f0 <strerror@plt>
mov    %eax,%edi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    %r15d,%edi
call   1090 <close@plt>
mov    0x8(%rsp),%rdi
call   1110 <freeaddrinfo@plt>
xor    %eax,%eax
add    $0x828,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%edi
call   1080 <gai_strerror@plt>
lea    0xc64(%rip),%rdi
mov    %rax,%rsi
call   1070 <printf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.addrinfo = type { i64, i32, i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [7 x i8] c"lucien\00"
@.str.1 = [5 x i8] c"2628\00"
@.str.2 = [4 x i8] c"%s\0A\00"
@PF_INET = global i32 0
@errno = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i8* @fonctionThread(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.sockaddr_in
%5 = alloca %struct.addrinfo*
%6 = alloca %struct.addrinfo
%7 = alloca i32
%8 = alloca i32
%9 = alloca [1024 x i8]
%10 = alloca i32
%11 = alloca [1024 x i8]
%12 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%13 = call i32 @bzero(%struct.addrinfo* %6, i32 16)
%14 = load i32, i32* @AF_INET
%15 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %6, i32 0, i32 2
store i32 %14, i32* %15
%16 = load i32, i32* @SOCK_STREAM
%17 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %6, i32 0, i32 1
store i32 %16, i32* %17
%18 = call i32 @getaddrinfo(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %struct.addrinfo* %6, %struct.addrinfo** %5)
store i32 %18, i32* %3
%19 = load i32, i32* %3
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %26
21: ; preds = %1
%22 = load i32, i32* %3
%23 = call i8* @gai_strerror(i32 %22)
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %23)
%25 = call i32 @exit(i32 1)
unreachable
26: ; preds = %1
%27 = load %struct.addrinfo*, %struct.addrinfo** %5
%28 = icmp ne %struct.addrinfo* %27, null
br i1 %28, label %29, label %36
29: ; preds = %26
%30 = load %struct.addrinfo*, %struct.addrinfo** %5
%31 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %30, i32 0, i32 0
%32 = load i64, i64* %31
%33 = inttoptr i64 %32 to %struct.sockaddr_in*
%34 = bitcast %struct.sockaddr_in* %4 to i8*
%35 = bitcast %struct.sockaddr_in* %33 to i8*
br label %36
36: ; preds = %29, %26
%37 = load i32, i32* @PF_INET
%38 = load i32, i32* @SOCK_STREAM
%39 = call i32 @socket(i32 %37, i32 %38, i32 0)
store i32 %39, i32* %7
%40 = load i32, i32* %7
%41 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%42 = call i32 @connect(i32 %40, %struct.sockaddr* %41, i32 4)
store i32 %42, i32* %3
%43 = load i32, i32* %3
%44 = icmp eq i32 %43, -1
br i1 %44, label %45, label %50
45: ; preds = %36
%46 = load i32, i32* @errno
%47 = call i32 @strerror(i32 %46)
%48 = call i32 @perror(i32 %47)
%49 = call i32 @exit(i32 1)
unreachable
50: ; preds = %36
%51 = load i32, i32* %7
%52 = load i32, i32* @F_SETFL
%53 = load i32, i32* @O_NONBLOCK
%54 = call i32 @fcntl(i32 %51, i32 %52, i32 %53)
%55 = icmp eq i32 %54, -1
br i1 %55, label %56, label %61
56: ; preds = %50
%57 = load i32, i32* @errno
%58 = call i32 @strerror(i32 %57)
%59 = call i32 @perror(i32 %58)
%60 = call i32 @exit(i32 1)
unreachable
61: ; preds = %50
%62 = load i8*, i8** %2
%63 = bitcast i8* %62 to i32*
%64 = load i32, i32* %63
store i32 %64, i32* %8
%65 = load i32, i32* %8
%66 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%67 = call i32 @recv(i32 %65, i8* %66, i32 1023, i32 0)
store i32 %67, i32* %10
%68 = load i32, i32* %10
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 %69
store i8 0, i8* %70
%71 = load i32, i32* %7
%72 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%73 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%74 = call i32 @strlen(i8* %73)
%75 = call i32 @send(i32 %71, i8* %72, i32 %74, i32 0)
store i32 %75, i32* %3
%76 = load i32, i32* %3
%77 = icmp eq i32 %76, -1
br i1 %77, label %78, label %83
78: ; preds = %61
%79 = load i32, i32* @errno
%80 = call i32 @strerror(i32 %79)
%81 = call i32 @perror(i32 %80)
%82 = call i32 @exit(i32 1)
unreachable
83: ; preds = %61
%84 = call i32 @sleep(i32 1)
store i32 0, i32* %12
br label %85
85: ; preds = %106, %83
%86 = load i32, i32* %7
%87 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%88 = call i32 @recv(i32 %86, i8* %87, i32 1023, i32 0)
store i32 %88, i32* %12
%89 = icmp ne i32 %88, -1
br i1 %89, label %90, label %107
90: ; preds = %85
%91 = load i32, i32* %12
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 %92
store i8 0, i8* %93
%94 = load i32, i32* %8
%95 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%96 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%97 = call i32 @strlen(i8* %96)
%98 = call i32 @send(i32 %94, i8* %95, i32 %97, i32 0)
store i32 %98, i32* %3
%99 = load i32, i32* %3
%100 = icmp eq i32 %99, -1
br i1 %100, label %101, label %106
101: ; preds = %90
%102 = load i32, i32* @errno
%103 = call i32 @strerror(i32 %102)
%104 = call i32 @perror(i32 %103)
%105 = call i32 @exit(i32 1)
unreachable
106: ; preds = %90
br label %85
107: ; preds = %85
%108 = load i32, i32* %7
%109 = call i32 @close(i32 %108)
%110 = load %struct.addrinfo*, %struct.addrinfo** %5
%111 = call i32 @freeaddrinfo(%struct.addrinfo* %110)
ret i8* null
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.addrinfo = type { i64, i32, i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [7 x i8] c"lucien\00"
@.str.1 = [5 x i8] c"2628\00"
@.str.2 = [4 x i8] c"%s\0A\00"
@PF_INET = global i32 0
@errno = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define noalias i8* @fonctionThread(i8* nocapture %0) {
%2 = alloca %struct.sockaddr_in
%3 = alloca %struct.addrinfo*
%4 = alloca %struct.addrinfo
%5 = alloca [1024 x i8]
%6 = alloca [1024 x i8]
%7 = bitcast %struct.sockaddr_in* %2 to i8*
%8 = bitcast %struct.addrinfo** %3 to i8*
%9 = bitcast %struct.addrinfo* %4 to i8*
%10 = call i32 @bzero(%struct.addrinfo* %4, i32 16)
%11 = load i32, i32* @AF_INET
%12 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %4, i64 0, i32 2
store i32 %11, i32* %12
%13 = load i32, i32* @SOCK_STREAM
%14 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %4, i64 0, i32 1
store i32 %13, i32* %14
%15 = call i32 @getaddrinfo(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %struct.addrinfo* %4, %struct.addrinfo** %3)
%16 = icmp eq i32 %15, 0
br i1 %16, label %21, label %17
17: ; preds = %1
%18 = call i8* @gai_strerror(i32 %15)
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %18)
%20 = call i32 @exit(i32 1)
unreachable
21: ; preds = %1
%22 = load %struct.addrinfo*, %struct.addrinfo** %3
%23 = icmp eq %struct.addrinfo* %22, null
br i1 %23, label %30, label %24
24: ; preds = %21
%25 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %22, i64 0, i32 0
%26 = load i64, i64* %25
%27 = inttoptr i64 %26 to i32*
%28 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 0
%29 = load i32, i32* %27
store i32 %29, i32* %28
br label %30
30: ; preds = %24, %21
%31 = load i32, i32* @PF_INET
%32 = load i32, i32* @SOCK_STREAM
%33 = call i32 @socket(i32 %31, i32 %32, i32 0)
%34 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%35 = call i32 @connect(i32 %33, %struct.sockaddr* %34, i32 4)
%36 = icmp eq i32 %35, -1
br i1 %36, label %37, label %42
37: ; preds = %30
%38 = load i32, i32* @errno
%39 = call i32 @strerror(i32 %38)
%40 = call i32 @perror(i32 %39)
%41 = call i32 @exit(i32 1)
unreachable
42: ; preds = %30
%43 = load i32, i32* @F_SETFL
%44 = load i32, i32* @O_NONBLOCK
%45 = call i32 @fcntl(i32 %33, i32 %43, i32 %44)
%46 = icmp eq i32 %45, -1
br i1 %46, label %47, label %52
47: ; preds = %42
%48 = load i32, i32* @errno
%49 = call i32 @strerror(i32 %48)
%50 = call i32 @perror(i32 %49)
%51 = call i32 @exit(i32 1)
unreachable
52: ; preds = %42
%53 = bitcast i8* %0 to i32*
%54 = load i32, i32* %53
%55 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%56 = call i32 @recv(i32 %54, i8* %55, i32 1023, i32 0)
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 %57
store i8 0, i8* %58
%59 = call i32 @strlen(i8* %55)
%60 = call i32 @send(i32 %33, i8* %55, i32 %59, i32 0)
%61 = icmp eq i32 %60, -1
br i1 %61, label %62, label %67
62: ; preds = %52
%63 = load i32, i32* @errno
%64 = call i32 @strerror(i32 %63)
%65 = call i32 @perror(i32 %64)
%66 = call i32 @exit(i32 1)
unreachable
67: ; preds = %52
%68 = call i32 @sleep(i32 1)
%69 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
br label %70
70: ; preds = %73, %67
%71 = call i32 @recv(i32 %33, i8* %69, i32 1023, i32 0)
%72 = icmp eq i32 %71, -1
br i1 %72, label %84, label %73
73: ; preds = %70
%74 = sext i32 %71 to i64
%75 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 %74
store i8 0, i8* %75
%76 = call i32 @strlen(i8* %69)
%77 = call i32 @send(i32 %54, i8* %69, i32 %76, i32 0)
%78 = icmp eq i32 %77, -1
br i1 %78, label %79, label %70
79: ; preds = %73
%80 = load i32, i32* @errno
%81 = call i32 @strerror(i32 %80)
%82 = call i32 @perror(i32 %81)
%83 = call i32 @exit(i32 1)
unreachable
84: ; preds = %70
%85 = call i32 @close(i32 %33)
%86 = load %struct.addrinfo*, %struct.addrinfo** %3
%87 = call i32 @freeaddrinfo(%struct.addrinfo* %86)
ret i8* null
}