#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 /*<<< orphan*/ sin_port;
  int /*<<< orphan*/ sin_addr;
};
struct sockaddr {
  int /*<<< orphan*/ sa_family;
};
struct addrinfo {
  int /*<<< orphan*/ ai_family;
  scalar_t__ ai_addr;
  struct addrinfo *ai_next;
  int /*<<< orphan*/ ai_socktype;
};
typedef int /*<<< orphan*/ inaddr;
typedef int /*<<< orphan*/ hint;
typedef int /*<<< orphan*/ addr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
scalar_t__ EINTR;
int /*<<< orphan*/ SOCK_STREAM;
int connect(int, struct sockaddr *, int);
scalar_t__ errno;
int /*<<< orphan*/ freeaddrinfo(struct addrinfo *);
int /*<<< orphan*/ gai_strerror(int);
int getaddrinfo(char const *, int /*<<< orphan*/ *, struct addrinfo *,
                struct addrinfo **);
int /*<<< orphan*/ htons(unsigned int);
int /*<<< orphan*/ inet_ntop(int /*<<< orphan*/, int /*<<< orphan*/ *, char *,
                             int);
int /*<<< orphan*/ ltr_int_log_message(char *, ...);
int /*<<< orphan*/ ltr_int_my_perror(char *);
int /*<<< orphan*/ memset(struct addrinfo *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(unsigned int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int init_client(const char *name, unsigned int port,
                unsigned int restart_timeout) {
  int sfd;
  struct addrinfo *ai;
  struct addrinfo hint;
  memset(&hint, 0, sizeof(hint));
  hint.ai_family = AF_INET;
  hint.ai_socktype = SOCK_STREAM;
  int status = getaddrinfo(name, NULL, &hint, &ai);
  if (status != 0) {
    ltr_int_log_message("getaddrinfo: %s\n", gai_strerror(status));
    return -1;
  }
  struct addrinfo *tmp_ai;
  struct sockaddr_in *sinp;
  struct sockaddr_in inaddr;
  for (tmp_ai = ai; tmp_ai != NULL; tmp_ai = tmp_ai->ai_next) {
    char addr[1024];
    sinp = (struct sockaddr_in *)tmp_ai->ai_addr;
    inet_ntop(ai->ai_family, &sinp->sin_addr, addr, sizeof(addr));
    ltr_int_log_message("Have result! %s\n", addr);
    sinp->sin_port = htons(port);
    inaddr = *sinp;
    sfd = socket(((struct sockaddr *)sinp)->sa_family, SOCK_STREAM, 0);
    printf("Socket %d\n", sfd);
    if (sfd < 0) {
      ltr_int_my_perror("socket");
      continue;
    }
    break;
  }
  if (tmp_ai == NULL) {
    ltr_int_log_message("Didn't work!\n");
    return -1;
  }
  freeaddrinfo(ai);
  while (1) {
    status = connect(sfd, (struct sockaddr *)&inaddr, sizeof(inaddr));
    printf("Connecting...\n");
    if (status != 0) {
      if (errno == EINTR) {
        continue;
      } else {
        ltr_int_my_perror("connect");
        if (restart_timeout != 0) {
          sleep(restart_timeout);
        }
        return -1;
      }
    }
    break;
  }
  return sfd;
}


x86 assembly (clang, -O0):
<init_client>:
push   %rbp
mov    %rsp,%rbp
sub    $0x470,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
lea    -0x48(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1080 <memset@plt>
mov    0x2dfc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x48(%rbp)
mov    0x2de0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
lea    -0x48(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   10b0 <getaddrinfo@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0x0,-0x4c(%rbp)
je     1243 <init_client+0x83>
mov    -0x4c(%rbp),%edi
call   1070 <gai_strerror@plt>
mov    %eax,%esi
lea    0xdd0(%rip),%rdi
mov    $0x0,%al
call   1040 <ltr_int_log_message@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13ba <init_client+0x1fa>
mov    -0x28(%rbp),%rax
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
je     130c <init_client+0x14c>
mov    -0x58(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x60(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%edi
mov    -0x60(%rbp),%rsi
add    $0x4,%rsi
lea    -0x470(%rbp),%rdx
mov    $0x400,%ecx
call   1030 <inet_ntop@plt>
lea    -0x470(%rbp),%rsi
lea    0xd82(%rip),%rdi
mov    $0x0,%al
call   1040 <ltr_int_log_message@plt>
mov    -0x14(%rbp),%edi
call   1050 <htons@plt>
mov    %eax,%ecx
mov    -0x60(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x60(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x68(%rbp)
mov    -0x60(%rbp),%rax
mov    (%rax),%edi
mov    0x2d1a(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10e0 <socket@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xd4e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
cmpl   $0x0,-0x1c(%rbp)
jge    12f6 <init_client+0x136>
lea    0xd41(%rip),%rdi
call   1090 <ltr_int_my_perror@plt>
jmp    12fb <init_client+0x13b>
jmp    130c <init_client+0x14c>
mov    -0x58(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x58(%rbp)
jmp    124b <init_client+0x8b>
cmpq   $0x0,-0x58(%rbp)
jne    1331 <init_client+0x171>
lea    0xd16(%rip),%rdi
mov    $0x0,%al
call   1040 <ltr_int_log_message@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13ba <init_client+0x1fa>
mov    -0x28(%rbp),%rdi
call   10d0 <freeaddrinfo@plt>
mov    -0x1c(%rbp),%edi
lea    -0x68(%rbp),%rsi
mov    $0x8,%edx
call   10a0 <connect@plt>
mov    %eax,-0x4c(%rbp)
lea    0xced(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
cmpl   $0x0,-0x4c(%rbp)
je     13af <init_client+0x1ef>
mov    0x2c63(%rip),%rax
mov    (%rax),%rax
mov    0x2c51(%rip),%rcx
cmp    (%rcx),%rax
jne    1385 <init_client+0x1c5>
jmp    133a <init_client+0x17a>
lea    0xcc5(%rip),%rdi
call   1090 <ltr_int_my_perror@plt>
cmpl   $0x0,-0x18(%rbp)
je     13a3 <init_client+0x1e3>
mov    -0x18(%rbp),%edi
call   10c0 <sleep@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13ba <init_client+0x1fa>
jmp    13b4 <init_client+0x1f4>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x470,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_client>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x448,%rsp
mov    %edx,%r14d
mov    %esi,%r15d
mov    %rdi,%rbx
lea    0x20(%rsp),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1090 <memset@plt>
mov    0x2de3(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x20(%rsp)
mov    0x2dc6(%rip),%r12
mov    (%r12),%eax
mov    %eax,0x38(%rsp)
lea    0x8(%rsp),%rcx
mov    %rbx,%rdi
xor    %esi,%esi
mov    %rbp,%rdx
call   10c0 <getaddrinfo@plt>
test   %eax,%eax
je     124c <init_client+0x7c>
mov    %eax,%edi
call   1080 <gai_strerror@plt>
lea    0xdc2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <ltr_int_log_message@plt>
jmp    12f6 <init_client+0x126>
mov    %r14d,0x14(%rsp)
mov    0x8(%rsp),%rax
test   %rax,%rax
je     12e8 <init_client+0x118>
lea    0x40(%rsp),%rbx
lea    0xdb7(%rip),%r13
mov    %rax,%r14
xchg   %ax,%ax
mov    0x8(%r14),%rbp
mov    (%rax),%edi
lea    0x4(%rbp),%rsi
mov    %rbx,%rdx
mov    $0x400,%ecx
call   1030 <inet_ntop@plt>
lea    0xd83(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <ltr_int_log_message@plt>
mov    %r15d,%edi
call   1060 <htons@plt>
mov    %eax,0x0(%rbp)
mov    0x0(%rbp),%rax
mov    %rax,0x18(%rsp)
mov    0x0(%rbp),%edi
mov    (%r12),%esi
xor    %edx,%edx
call   10f0 <socket@plt>
mov    %eax,%ebp
mov    %r13,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
test   %ebp,%ebp
jns    130f <init_client+0x13f>
lea    0xd5a(%rip),%rdi
call   10a0 <ltr_int_my_perror@plt>
mov    0x10(%r14),%r14
test   %r14,%r14
je     12e8 <init_client+0x118>
mov    0x8(%rsp),%rax
jmp    1270 <init_client+0xa0>
lea    0xd45(%rip),%rdi
xor    %eax,%eax
call   1050 <ltr_int_log_message@plt>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x448,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x8(%rsp),%rdi
call   10e0 <freeaddrinfo@plt>
lea    0x18(%rsp),%r14
lea    0xd25(%rip),%r15
mov    0x2ca4(%rip),%r12
mov    0x2c95(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebp,%edi
mov    %r14,%rsi
mov    $0x8,%edx
call   10b0 <connect@plt>
mov    %eax,%ebx
mov    %r15,%rdi
call   1040 <puts@plt>
test   %ebx,%ebx
je     12fb <init_client+0x12b>
mov    (%r12),%rax
cmp    0x0(%r13),%rax
je     1340 <init_client+0x170>
lea    0xcd4(%rip),%rdi
call   10a0 <ltr_int_my_perror@plt>
mov    $0xffffffff,%ebp
mov    0x14(%rsp),%edi
test   %edi,%edi
je     12fb <init_client+0x12b>
call   10d0 <sleep@plt>
jmp    12fb <init_client+0x12b>

LLVM IR (-O0):
%struct.addrinfo = type { i32, i64, %struct.addrinfo*, i32 }
%struct.sockaddr_in = type { i32, i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [17 x i8] c"getaddrinfo: %s\0A\00"
@.str.1 = [17 x i8] c"Have result! %s\0A\00"
@.str.2 = [11 x i8] c"Socket %d\0A\00"
@.str.3 = [7 x i8] c"socket\00"
@.str.4 = [14 x i8] c"Didn't work!\0A\00"
@.str.5 = [15 x i8] c"Connecting...\0A\00"
@errno = global i64 0
@EINTR = global i64 0
@.str.6 = [8 x i8] c"connect\00"
define i32 @init_client(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca %struct.addrinfo*
%10 = alloca %struct.addrinfo
%11 = alloca i32
%12 = alloca %struct.addrinfo*
%13 = alloca %struct.sockaddr_in*
%14 = alloca %struct.sockaddr_in
%15 = alloca [1024 x i8]
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%16 = call i32 @memset(%struct.addrinfo* %10, i32 0, i32 32)
%17 = load i32, i32* @AF_INET
%18 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %10, i32 0, i32 0
store i32 %17, i32* %18
%19 = load i32, i32* @SOCK_STREAM
%20 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %10, i32 0, i32 3
store i32 %19, i32* %20
%21 = load i8*, i8** %5
%22 = call i32 @getaddrinfo(i8* %21, i32* null, %struct.addrinfo* %10, %struct.addrinfo** %9)
store i32 %22, i32* %11
%23 = load i32, i32* %11
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %29
25: ; preds = %3
%26 = load i32, i32* %11
%27 = call i32 @gai_strerror(i32 %26)
%28 = call i32 (i8*, ...) @ltr_int_log_message(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %27)
store i32 -1, i32* %4
br label %103
29: ; preds = %3
%30 = load %struct.addrinfo*, %struct.addrinfo** %9
store %struct.addrinfo* %30, %struct.addrinfo** %12
br label %31
31: ; preds = %68, %29
%32 = load %struct.addrinfo*, %struct.addrinfo** %12
%33 = icmp ne %struct.addrinfo* %32, null
br i1 %33, label %34, label %72
34: ; preds = %31
%35 = load %struct.addrinfo*, %struct.addrinfo** %12
%36 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %35, i32 0, i32 1
%37 = load i64, i64* %36
%38 = inttoptr i64 %37 to %struct.sockaddr_in*
store %struct.sockaddr_in* %38, %struct.sockaddr_in** %13
%39 = load %struct.addrinfo*, %struct.addrinfo** %9
%40 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %39, i32 0, i32 0
%41 = load i32, i32* %40
%42 = load %struct.sockaddr_in*, %struct.sockaddr_in** %13
%43 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %42, i32 0, i32 1
%44 = getelementptr inbounds [1024 x i8], [1024 x i8]* %15, i64 0, i64 0
%45 = call i32 @inet_ntop(i32 %41, i32* %43, i8* %44, i32 1024)
%46 = getelementptr inbounds [1024 x i8], [1024 x i8]* %15, i64 0, i64 0
%47 = call i32 (i8*, ...) @ltr_int_log_message(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %46)
%48 = load i32, i32* %6
%49 = call i32 @htons(i32 %48)
%50 = load %struct.sockaddr_in*, %struct.sockaddr_in** %13
%51 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %50, i32 0, i32 0
store i32 %49, i32* %51
%52 = load %struct.sockaddr_in*, %struct.sockaddr_in** %13
%53 = bitcast %struct.sockaddr_in* %14 to i8*
%54 = bitcast %struct.sockaddr_in* %52 to i8*
%55 = load %struct.sockaddr_in*, %struct.sockaddr_in** %13
%56 = bitcast %struct.sockaddr_in* %55 to %struct.sockaddr*
%57 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %56, i32 0, i32 0
%58 = load i32, i32* %57
%59 = load i32, i32* @SOCK_STREAM
%60 = call i32 @socket(i32 %58, i32 %59, i32 0)
store i32 %60, i32* %8
%61 = load i32, i32* %8
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %61)
%63 = load i32, i32* %8
%64 = icmp slt i32 %63, 0
br i1 %64, label %65, label %67
65: ; preds = %34
%66 = call i32 @ltr_int_my_perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %68
67: ; preds = %34
br label %72
68: ; preds = %65
%69 = load %struct.addrinfo*, %struct.addrinfo** %12
%70 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %69, i32 0, i32 2
%71 = load %struct.addrinfo*, %struct.addrinfo** %70
store %struct.addrinfo* %71, %struct.addrinfo** %12
br label %31
72: ; preds = %67, %31
%73 = load %struct.addrinfo*, %struct.addrinfo** %12
%74 = icmp eq %struct.addrinfo* %73, null
br i1 %74, label %75, label %77
75: ; preds = %72
%76 = call i32 (i8*, ...) @ltr_int_log_message(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
store i32 -1, i32* %4
br label %103
77: ; preds = %72
%78 = load %struct.addrinfo*, %struct.addrinfo** %9
%79 = call i32 @freeaddrinfo(%struct.addrinfo* %78)
br label %80
80: ; preds = %77, %91
%81 = load i32, i32* %8
%82 = bitcast %struct.sockaddr_in* %14 to %struct.sockaddr*
%83 = call i32 @connect(i32 %81, %struct.sockaddr* %82, i32 8)
store i32 %83, i32* %11
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%85 = load i32, i32* %11
%86 = icmp ne i32 %85, 0
br i1 %86, label %87, label %100
87: ; preds = %80
%88 = load i64, i64* @errno
%89 = load i64, i64* @EINTR
%90 = icmp eq i64 %88, %89
br i1 %90, label %91, label %92
91: ; preds = %87
br label %80
92: ; preds = %87
%93 = call i32 @ltr_int_my_perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%94 = load i32, i32* %7
%95 = icmp ne i32 %94, 0
br i1 %95, label %96, label %99
96: ; preds = %92
%97 = load i32, i32* %7
%98 = call i32 @sleep(i32 %97)
br label %99
99: ; preds = %96, %92
store i32 -1, i32* %4
br label %103
100: ; preds = %80
br label %101
101: ; preds = %100
%102 = load i32, i32* %8
store i32 %102, i32* %4
br label %103
103: ; preds = %101, %99, %75, %25
%104 = load i32, i32* %4
ret i32 %104
}

LLVM IR (-O2):
%struct.addrinfo = type { i32, i64, %struct.addrinfo*, i32 }
%struct.sockaddr_in = type { i32, i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [17 x i8] c"getaddrinfo: %s\0A\00"
@.str.1 = [17 x i8] c"Have result! %s\0A\00"
@.str.2 = [11 x i8] c"Socket %d\0A\00"
@.str.3 = [7 x i8] c"socket\00"
@.str.4 = [14 x i8] c"Didn't work!\0A\00"
@errno = global i64 0
@EINTR = global i64 0
@.str.6 = [8 x i8] c"connect\00"
@str = [14 x i8] c"Connecting...\00"
define i32 @init_client(i8* %0, i32 %1, i32 %2) {
%4 = alloca %struct.addrinfo*
%5 = alloca %struct.addrinfo
%6 = alloca i64
%7 = alloca [1024 x i8]
%8 = bitcast %struct.addrinfo** %4 to i8*
%9 = bitcast %struct.addrinfo* %5 to i8*
%10 = call i32 @memset(%struct.addrinfo* %5, i32 0, i32 32)
%11 = load i32, i32* @AF_INET
%12 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %5, i64 0, i32 0
store i32 %11, i32* %12
%13 = load i32, i32* @SOCK_STREAM
%14 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %5, i64 0, i32 3
store i32 %13, i32* %14
%15 = call i32 @getaddrinfo(i8* %0, i32* null, %struct.addrinfo* %5, %struct.addrinfo** %4)
%16 = icmp eq i32 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %3
%18 = call i32 @gai_strerror(i32 %15)
%19 = call i32 (i8*, ...) @ltr_int_log_message(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %18)
br label %76
20: ; preds = %3
%21 = bitcast i64* %6 to i8*
%22 = load %struct.addrinfo*, %struct.addrinfo** %4
%23 = icmp eq %struct.addrinfo* %22, null
br i1 %23, label %55, label %24
24: ; preds = %20
%25 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
br label %26
26: ; preds = %53, %24
%27 = phi %struct.addrinfo* [ %22, %24 ], [ %54, %53 ]
%28 = phi %struct.addrinfo* [ %22, %24 ], [ %51, %53 ]
%29 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %28, i64 0, i32 1
%30 = load i64, i64* %29
%31 = inttoptr i64 %30 to %struct.sockaddr_in*
%32 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %27, i64 0, i32 0
%33 = load i32, i32* %32
%34 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %31, i64 0, i32 1
%35 = call i32 @inet_ntop(i32 %33, i32* %34, i8* %25, i32 1024)
%36 = call i32 (i8*, ...) @ltr_int_log_message(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %25)
%37 = call i32 @htons(i32 %1)
%38 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %31, i64 0, i32 0
store i32 %37, i32* %38
%39 = inttoptr i64 %30 to i64*
%40 = load i64, i64* %39
store i64 %40, i64* %6
%41 = inttoptr i64 %30 to %struct.sockaddr*
%42 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %41, i64 0, i32 0
%43 = load i32, i32* %42
%44 = load i32, i32* @SOCK_STREAM
%45 = call i32 @socket(i32 %43, i32 %44, i32 0)
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %45)
%47 = icmp slt i32 %45, 0
br i1 %47, label %48, label %57
48: ; preds = %26
%49 = call i32 @ltr_int_my_perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%50 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %28, i64 0, i32 2
%51 = load %struct.addrinfo*, %struct.addrinfo** %50
%52 = icmp eq %struct.addrinfo* %51, null
br i1 %52, label %55, label %53
53: ; preds = %48
%54 = load %struct.addrinfo*, %struct.addrinfo** %4
br label %26
55: ; preds = %48, %20
%56 = call i32 (i8*, ...) @ltr_int_log_message(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
br label %74
57: ; preds = %26
%58 = load %struct.addrinfo*, %struct.addrinfo** %4
%59 = call i32 @freeaddrinfo(%struct.addrinfo* %58)
%60 = bitcast i64* %6 to %struct.sockaddr*
br label %61
61: ; preds = %65, %57
%62 = call i32 @connect(i32 %45, %struct.sockaddr* %60, i32 8)
%63 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%64 = icmp eq i32 %62, 0
br i1 %64, label %74, label %65
65: ; preds = %61
%66 = load i64, i64* @errno
%67 = load i64, i64* @EINTR
%68 = icmp eq i64 %66, %67
br i1 %68, label %61, label %69
69: ; preds = %65
%70 = call i32 @ltr_int_my_perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%71 = icmp eq i32 %2, 0
br i1 %71, label %74, label %72
72: ; preds = %69
%73 = call i32 @sleep(i32 %2)
br label %74
74: ; preds = %61, %69, %72, %55
%75 = phi i32 [ -1, %55 ], [ -1, %72 ], [ -1, %69 ], [ %45, %61 ]
br label %76
76: ; preds = %74, %17
%77 = phi i32 [ -1, %17 ], [ %75, %74 ]
ret i32 %77
}