#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 socklen_t;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ close(int);
int connect(int, struct sockaddr *, int);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ inet_addr(char *);
int /*<<< orphan*/ memset(int /*<<< orphan*/, char, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ send(int, char *, int, int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int registerDep(char *server, int serverport, int num_interfaces,
                char **interfaces, int type) {
  int depSocket;
  char buffer[1024], num_int[5];
  struct sockaddr_in serverAddr;
  socklen_t addr_size;
  if (1)
    printf("Connectiong to %s:%d\n", server, serverport);
  depSocket = socket(AF_INET, SOCK_STREAM, 0);
  serverAddr.sin_family = AF_INET;
  serverAddr.sin_port = htons(serverport);
  serverAddr.sin_addr.s_addr = inet_addr(server);
  memset(serverAddr.sin_zero, '\0', sizeof serverAddr.sin_zero);
  addr_size = sizeof serverAddr;
  int result = connect(depSocket, (struct sockaddr *)&serverAddr, addr_size);
  if (1)
    printf("Connecting to receiving handler: %d\n", result);
  strcpy(buffer, "out ");
  if (type == 1)
    strcat(buffer, "device,");
  else
    strcat(buffer, "node,");
  sprintf(num_int, "%d", num_interfaces);
  strcat(buffer, interfaces[0]);
  if (type == 1) {
    strcat(buffer, ",");
    strcat(buffer, num_int);
  }
  strcat(buffer, "\n");
  if (1)
    printf("Registering with command %s\n", buffer);
  if (1)
    printf("Sent first command\n");
  if (type == 1) {
    strcat(buffer, "out ");
    int i = 0;
    while (interfaces[i] != NULL) {
      strcat(buffer, interfaces[i]);
      if (interfaces[i + 1] != NULL)
        strcat(buffer, ",");
      else {
        break;
      }
      i++;
    }
    strcat(buffer, "\n");
    if (1)
      printf("Registering interfaces %s\n", buffer);
  }
  send(depSocket, buffer, 512, 0);
  close(depSocket);
}


x86 assembly (clang, -O0):
<registerDep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x460,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xe25(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2dff(%rip),%rax
mov    (%rax),%edi
mov    0x2de6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10d0 <socket@plt>
mov    %eax,-0x28(%rbp)
mov    0x2de3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x43c(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <htons@plt>
mov    %eax,-0x440(%rbp)
mov    -0x10(%rbp),%rdi
call   1090 <inet_addr@plt>
mov    %eax,-0x444(%rbp)
mov    -0x448(%rbp),%edi
xor    %esi,%esi
mov    $0x4,%edx
call   1070 <memset@plt>
movl   $0x10,-0x44c(%rbp)
mov    -0x28(%rbp),%edi
lea    -0x448(%rbp),%rsi
mov    -0x44c(%rbp),%edx
call   10c0 <connect@plt>
mov    %eax,-0x450(%rbp)
mov    -0x450(%rbp),%esi
lea    0xda8(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x430(%rbp),%rdi
lea    0xdb8(%rip),%rsi
call   1030 <strcpy@plt>
cmpl   $0x1,-0x24(%rbp)
jne    12aa <registerDep+0xfa>
lea    -0x430(%rbp),%rdi
lea    0xda0(%rip),%rsi
call   10a0 <strcat@plt>
jmp    12bd <registerDep+0x10d>
lea    -0x430(%rbp),%rdi
lea    0xd90(%rip),%rsi
call   10a0 <strcat@plt>
lea    -0x435(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    0xd80(%rip),%rsi
call   10b0 <sprintf@plt>
lea    -0x430(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
call   10a0 <strcat@plt>
cmpl   $0x1,-0x24(%rbp)
jne    1316 <registerDep+0x166>
lea    -0x430(%rbp),%rdi
lea    0xd48(%rip),%rsi
call   10a0 <strcat@plt>
lea    -0x430(%rbp),%rdi
lea    -0x435(%rbp),%rsi
call   10a0 <strcat@plt>
lea    -0x430(%rbp),%rdi
lea    0xd15(%rip),%rsi
call   10a0 <strcat@plt>
lea    -0x430(%rbp),%rsi
lea    0xd1a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd29(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
cmpl   $0x1,-0x24(%rbp)
jne    1418 <registerDep+0x268>
lea    -0x430(%rbp),%rdi
lea    0xcd7(%rip),%rsi
call   10a0 <strcat@plt>
movl   $0x0,-0x454(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x454(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     13f0 <registerDep+0x240>
lea    -0x430(%rbp),%rdi
mov    -0x20(%rbp),%rax
movslq -0x454(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   10a0 <strcat@plt>
mov    -0x20(%rbp),%rax
mov    -0x454(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     13d7 <registerDep+0x227>
lea    -0x430(%rbp),%rdi
lea    0xc79(%rip),%rsi
call   10a0 <strcat@plt>
jmp    13dc <registerDep+0x22c>
jmp    13f0 <registerDep+0x240>
mov    -0x454(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x454(%rbp)
jmp    1373 <registerDep+0x1c3>
lea    -0x430(%rbp),%rdi
lea    0xc3b(%rip),%rsi
call   10a0 <strcat@plt>
lea    -0x430(%rbp),%rsi
lea    0xc71(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x28(%rbp),%edi
lea    -0x430(%rbp),%rsi
mov    $0x200,%edx
xor    %ecx,%ecx
call   1050 <send@plt>
mov    -0x28(%rbp),%edi
call   1080 <close@plt>
mov    -0x4(%rbp),%eax
add    $0x460,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<registerDep>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x428,%rsp
mov    %r8d,%r12d
mov    %rcx,%rbx
mov    %edx,%r15d
mov    %esi,%ebp
mov    %rdi,%r13
lea    0xe1a(%rip),%rdi
mov    %r13,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x2def(%rip),%r14
mov    (%r14),%edi
mov    0x2dd5(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10e0 <socket@plt>
mov    (%r14),%ecx
mov    %eax,%r14d
mov    %ecx,0x1c(%rsp)
mov    %ebp,%edi
call   1050 <htons@plt>
mov    %eax,0x18(%rsp)
mov    %r13,%rdi
call   10a0 <inet_addr@plt>
mov    %eax,0x14(%rsp)
xor    %esi,%esi
mov    $0x4,%edx
call   1080 <memset@plt>
lea    0x10(%rsp),%rsi
mov    %r14d,%edi
mov    $0x10,%edx
call   10d0 <connect@plt>
lea    0xdc4(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xdd9(%rip),%rsi
lea    0x20(%rsp),%rbp
mov    %rbp,%rdi
call   1030 <strcpy@plt>
cmp    $0x1,%r12d
lea    0xdc6(%rip),%rax
lea    0xdc7(%rip),%rsi
cmove  %rax,%rsi
mov    %rbp,%rdi
call   10b0 <strcat@plt>
lea    0xdba(%rip),%rsi
lea    0xb(%rsp),%rdi
mov    %r15d,%edx
call   10c0 <sprintf@plt>
mov    (%rbx),%rsi
mov    %rbp,%rdi
call   10b0 <strcat@plt>
cmp    $0x1,%r12d
jne    137c <registerDep+0x1bc>
lea    0xd89(%rip),%rsi
lea    0x20(%rsp),%rbp
mov    %rbp,%rdi
call   10b0 <strcat@plt>
lea    0xb(%rsp),%rsi
mov    %rbp,%rdi
call   10b0 <strcat@plt>
lea    0xd5b(%rip),%rsi
mov    %rbp,%rdi
call   10b0 <strcat@plt>
lea    0xd64(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xd8b(%rip),%rdi
call   1040 <puts@plt>
lea    0xd31(%rip),%rsi
mov    %rbp,%rdi
call   10b0 <strcat@plt>
mov    (%rbx),%rsi
test   %rsi,%rsi
je     1355 <registerDep+0x195>
add    $0x8,%rbx
lea    0x20(%rsp),%rbp
lea    0xd1c(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    %rbp,%rdi
call   10b0 <strcat@plt>
cmpq   $0x0,(%rbx)
je     1355 <registerDep+0x195>
mov    %rbp,%rdi
mov    %r15,%rsi
call   10b0 <strcat@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1330 <registerDep+0x170>
lea    0xcdd(%rip),%rsi
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
call   10b0 <strcat@plt>
lea    0xcfe(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    13ad <registerDep+0x1ed>
lea    0xcb6(%rip),%rsi
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
call   10b0 <strcat@plt>
lea    0xcba(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xce1(%rip),%rdi
call   1040 <puts@plt>
lea    0x20(%rsp),%rsi
mov    %r14d,%edi
mov    $0x200,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
mov    %r14d,%edi
call   1090 <close@plt>
add    $0x428,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [22 x i8] c"Connectiong to %s:%d\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [37 x i8] c"Connecting to receiving handler: %d\0A\00"
@.str.2 = [5 x i8] c"out \00"
@.str.3 = [8 x i8] c"device,\00"
@.str.4 = [6 x i8] c"node,\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [2 x i8] c",\00"
@.str.7 = [2 x i8] c"\0A\00"
@.str.8 = [29 x i8] c"Registering with command %s\0A\00"
@.str.9 = [20 x i8] c"Sent first command\0A\00"
@.str.10 = [27 x i8] c"Registering interfaces %s\0A\00"
define i32 @registerDep(i8* %0, i32 %1, i32 %2, i8** %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8**
%11 = alloca i32
%12 = alloca i32
%13 = alloca [1024 x i8]
%14 = alloca [5 x i8]
%15 = alloca %struct.sockaddr_in
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store i8* %0, i8** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i8** %3, i8*** %10
store i32 %4, i32* %11
%19 = load i8*, i8** %7
%20 = load i32, i32* %8
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %19, i32 %20)
%22 = load i32, i32* @AF_INET
%23 = load i32, i32* @SOCK_STREAM
%24 = call i32 @socket(i32 %22, i32 %23, i32 0)
store i32 %24, i32* %12
%25 = load i32, i32* @AF_INET
%26 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %15, i32 0, i32 3
store i32 %25, i32* %26
%27 = load i32, i32* %8
%28 = call i32 @htons(i32 %27)
%29 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %15, i32 0, i32 2
store i32 %28, i32* %29
%30 = load i8*, i8** %7
%31 = call i32 @inet_addr(i8* %30)
%32 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %15, i32 0, i32 1
%33 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %32, i32 0, i32 0
store i32 %31, i32* %33
%34 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %15, i32 0, i32 0
%35 = load i32, i32* %34
%36 = call i32 @memset(i32 %35, i8 signext 0, i32 4)
store i32 16, i32* %16
%37 = load i32, i32* %12
%38 = bitcast %struct.sockaddr_in* %15 to %struct.sockaddr*
%39 = load i32, i32* %16
%40 = call i32 @connect(i32 %37, %struct.sockaddr* %38, i32 %39)
store i32 %40, i32* %17
%41 = load i32, i32* %17
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 %41)
%43 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%44 = call i32 @strcpy(i8* %43, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%45 = load i32, i32* %11
%46 = icmp eq i32 %45, 1
br i1 %46, label %47, label %50
47: ; preds = %5
%48 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%49 = call i32 @strcat(i8* %48, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %53
50: ; preds = %5
%51 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%52 = call i32 @strcat(i8* %51, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %53
53: ; preds = %50, %47
%54 = getelementptr inbounds [5 x i8], [5 x i8]* %14, i64 0, i64 0
%55 = load i32, i32* %9
%56 = call i32 @sprintf(i8* %54, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %55)
%57 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%58 = load i8**, i8*** %10
%59 = getelementptr inbounds i8*, i8** %58, i64 0
%60 = load i8*, i8** %59
%61 = call i32 @strcat(i8* %57, i8* %60)
%62 = load i32, i32* %11
%63 = icmp eq i32 %62, 1
br i1 %63, label %64, label %70
64: ; preds = %53
%65 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%66 = call i32 @strcat(i8* %65, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%67 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%68 = getelementptr inbounds [5 x i8], [5 x i8]* %14, i64 0, i64 0
%69 = call i32 @strcat(i8* %67, i8* %68)
br label %70
70: ; preds = %64, %53
%71 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%72 = call i32 @strcat(i8* %71, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%73 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i8* %73)
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0))
%76 = load i32, i32* %11
%77 = icmp eq i32 %76, 1
br i1 %77, label %78, label %115
78: ; preds = %70
%79 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%80 = call i32 @strcat(i8* %79, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %18
br label %81
81: ; preds = %107, %78
%82 = load i8**, i8*** %10
%83 = load i32, i32* %18
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i8*, i8** %82, i64 %84
%86 = load i8*, i8** %85
%87 = icmp ne i8* %86, null
br i1 %87, label %88, label %110
88: ; preds = %81
%89 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%90 = load i8**, i8*** %10
%91 = load i32, i32* %18
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds i8*, i8** %90, i64 %92
%94 = load i8*, i8** %93
%95 = call i32 @strcat(i8* %89, i8* %94)
%96 = load i8**, i8*** %10
%97 = load i32, i32* %18
%98 = add nsw i32 %97, 1
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds i8*, i8** %96, i64 %99
%101 = load i8*, i8** %100
%102 = icmp ne i8* %101, null
br i1 %102, label %103, label %106
103: ; preds = %88
%104 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%105 = call i32 @strcat(i8* %104, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %107
106: ; preds = %88
br label %110
107: ; preds = %103
%108 = load i32, i32* %18
%109 = add nsw i32 %108, 1
store i32 %109, i32* %18
br label %81
110: ; preds = %106, %81
%111 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%112 = call i32 @strcat(i8* %111, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%113 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), i8* %113)
br label %115
115: ; preds = %110, %70
%116 = load i32, i32* %12
%117 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%118 = call i32 @send(i32 %116, i8* %117, i32 512, i32 0)
%119 = load i32, i32* %12
%120 = call i32 @close(i32 %119)
%121 = load i32, i32* %6
ret i32 %121
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [22 x i8] c"Connectiong to %s:%d\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [37 x i8] c"Connecting to receiving handler: %d\0A\00"
@.str.2 = [5 x i8] c"out \00"
@.str.3 = [8 x i8] c"device,\00"
@.str.4 = [6 x i8] c"node,\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [2 x i8] c",\00"
@.str.7 = [2 x i8] c"\0A\00"
@.str.8 = [29 x i8] c"Registering with command %s\0A\00"
@.str.10 = [27 x i8] c"Registering interfaces %s\0A\00"
@str = [19 x i8] c"Sent first command\00"
define i32 @registerDep(i8* %0, i32 %1, i32 %2, i8** nocapture %3, i32 %4) {
%6 = alloca [1024 x i8]
%7 = alloca [5 x i8]
%8 = alloca %struct.sockaddr_in
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%11 = bitcast %struct.sockaddr_in* %8 to i8*
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%13 = load i32, i32* @AF_INET
%14 = load i32, i32* @SOCK_STREAM
%15 = tail call i32 @socket(i32 %13, i32 %14, i32 0)
%16 = load i32, i32* @AF_INET
%17 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i64 0, i32 3
store i32 %16, i32* %17
%18 = tail call i32 @htons(i32 %1)
%19 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i64 0, i32 2
store i32 %18, i32* %19
%20 = tail call i32 @inet_addr(i8* %0)
%21 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i64 0, i32 1, i32 0
store i32 %20, i32* %21
%22 = tail call i32 @memset(i32 undef, i8 signext 0, i32 4)
%23 = bitcast %struct.sockaddr_in* %8 to %struct.sockaddr*
%24 = call i32 @connect(i32 %15, %struct.sockaddr* %23, i32 16)
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 %24)
%26 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%27 = icmp eq i32 %4, 1
%28 = select i1 %27, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0)
%29 = call i32 @strcat(i8* %9, i8* %28)
%30 = call i32 @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %2)
%31 = load i8*, i8** %3
%32 = call i32 @strcat(i8* %9, i8* %31)
br i1 %27, label %33, label %57
33: ; preds = %5
%34 = call i32 @strcat(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%35 = call i32 @strcat(i8* %9, i8* %10)
%36 = call i32 @strcat(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i8* %9)
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%39 = call i32 @strcat(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%40 = load i8*, i8** %3
%41 = icmp eq i8* %40, null
br i1 %41, label %54, label %42
42: ; preds = %33, %50
%43 = phi i64 [ %46, %50 ], [ 0, %33 ]
%44 = phi i8* [ %52, %50 ], [ %40, %33 ]
%45 = call i32 @strcat(i8* %9, i8* %44)
%46 = add nuw i64 %43, 1
%47 = getelementptr inbounds i8*, i8** %3, i64 %46
%48 = load i8*, i8** %47
%49 = icmp eq i8* %48, null
br i1 %49, label %54, label %50
50: ; preds = %42
%51 = call i32 @strcat(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%52 = load i8*, i8** %47
%53 = icmp eq i8* %52, null
br i1 %53, label %54, label %42
54: ; preds = %50, %42, %33
%55 = call i32 @strcat(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), i8* %9)
br label %61
57: ; preds = %5
%58 = call i32 @strcat(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i8* %9)
%60 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %61
61: ; preds = %57, %54
%62 = call i32 @send(i32 %15, i8* %9, i32 512, i32 0)
%63 = call i32 @close(i32 %15)
ret i32 undef
}