#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*/ serv_addr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ close(int);
scalar_t__ connect(int, struct sockaddr *, unsigned int);
int /*<<< orphan*/ htons(int /*<<< orphan*/);
int /*<<< orphan*/ inet_addr(char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ read(int, char **, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int write(int, char **, int);
void *client_thread(void *arguments) {
  int socket_fd;
  char pedido[1024] = "GET /index.html HTTP/1.1\r\n";
  char resposta[1024];
  struct sockaddr_in serv_addr;
  unsigned int server_lenght = sizeof(serv_addr);
  char **argv = (char **)arguments;
  if ((socket_fd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) {
    perror("client: can't open stream socket");
    return 0;
  }
  bzero((char *)&serv_addr, sizeof(serv_addr));
  serv_addr.sin_family = AF_INET;
  serv_addr.sin_addr.s_addr = inet_addr(argv[1]);
  serv_addr.sin_port = htons(atoi(argv[2]));
  if (connect(socket_fd, (struct sockaddr *)&serv_addr, server_lenght) < 0) {
    perror("client_thread: can't connect to server\n");
    return 0;
  }
  if (write(socket_fd, &pedido, 1024) == -1) {
    printf("erro\n");
  }
  read(socket_fd, &resposta, 1024);
  printf("resposta recebida: %s\n", resposta);
  printf("***thread over***\n");
  close(socket_fd);
  return 0;
}


x86 assembly (clang, -O0):
<client_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x840,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x420(%rbp),%rdi
lea    0xe23(%rip),%rsi
mov    $0x400,%edx
call   1090 <memcpy@plt>
movl   $0xc,-0x834(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x840(%rbp)
mov    0x2dc5(%rip),%rax
mov    (%rax),%edi
mov    0x2dc4(%rip),%rax
mov    (%rax),%esi
mov    0x2dcb(%rip),%rax
mov    (%rax),%edx
call   10e0 <socket@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    1241 <client_thread+0x81>
lea    0x11d1(%rip),%rdi
call   10a0 <perror@plt>
movq   $0x0,-0x8(%rbp)
jmp    133e <client_thread+0x17e>
lea    -0x830(%rbp),%rdi
mov    $0xc,%esi
call   10b0 <bzero@plt>
mov    0x2d8f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x828(%rbp)
mov    -0x840(%rbp),%rax
mov    0x8(%rax),%rdi
call   1080 <inet_addr@plt>
mov    %eax,-0x82c(%rbp)
mov    -0x840(%rbp),%rax
mov    0x10(%rax),%rdi
call   10c0 <atoi@plt>
mov    %eax,%edi
call   1040 <htons@plt>
mov    %eax,-0x830(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x830(%rbp),%rsi
mov    -0x834(%rbp),%edx
call   10d0 <connect@plt>
cmp    $0x0,%rax
jge    12cc <client_thread+0x10c>
lea    0x1167(%rip),%rdi
call   10a0 <perror@plt>
movq   $0x0,-0x8(%rbp)
jmp    133e <client_thread+0x17e>
mov    -0x14(%rbp),%edi
lea    -0x420(%rbp),%rsi
mov    $0x400,%edx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
jne    12f7 <client_thread+0x137>
lea    0x1159(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
lea    -0x820(%rbp),%rsi
mov    $0x400,%edx
call   1070 <read@plt>
lea    -0x820(%rbp),%rsi
lea    0x1136(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0x113f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
call   1060 <close@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x840,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<client_thread>:
push   %r15
push   %r14
push   %rbx
sub    $0x810,%rsp
mov    %rdi,%r14
lea    0xe1a(%rip),%rsi
lea    0x10(%rsp),%rdi
mov    $0x400,%edx
call   10a0 <memcpy@plt>
mov    0x2dcc(%rip),%rax
mov    (%rax),%edi
mov    0x2dcb(%rip),%rax
mov    (%rax),%esi
mov    0x2dd2(%rip),%rax
mov    (%rax),%edx
call   10f0 <socket@plt>
test   %eax,%eax
js     12dc <client_thread+0x10c>
mov    %eax,%ebx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0xc,%esi
call   10c0 <bzero@plt>
mov    0x2db2(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x8(%rsp)
mov    0x8(%r14),%rdi
call   1090 <inet_addr@plt>
mov    %eax,0x4(%rsp)
mov    0x10(%r14),%rdi
call   10d0 <atoi@plt>
mov    %eax,%edi
call   1050 <htons@plt>
mov    %eax,(%rsp)
mov    %ebx,%edi
mov    %r15,%rsi
mov    $0xc,%edx
call   10e0 <connect@plt>
test   %rax,%rax
js     12ea <client_thread+0x11a>
lea    0x10(%rsp),%rsi
mov    %ebx,%edi
mov    $0x400,%edx
call   1040 <write@plt>
cmp    $0xffffffff,%eax
jne    1292 <client_thread+0xc2>
lea    0x11e5(%rip),%rdi
call   1030 <puts@plt>
lea    0x410(%rsp),%r14
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x400,%edx
call   1080 <read@plt>
lea    0x1199(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x119f(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1070 <close@plt>
xor    %eax,%eax
add    $0x810,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0x111d(%rip),%rdi
call   10b0 <perror@plt>
jmp    12cd <client_thread+0xfd>
lea    0x1130(%rip),%rdi
call   10b0 <perror@plt>
jmp    12cd <client_thread+0xfd>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@__const.client_thread.pedido = [1024 x i8] c"GET /index.html HTTP/1.1\0D\0A\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
@.str = [33 x i8] c"client: can't open stream socket\00"
@AF_INET = global i32 0
@.str.1 = [40 x i8] c"client_thread: can't connect to server\0A\00"
@.str.2 = [6 x i8] c"erro\0A\00"
@.str.3 = [23 x i8] c"resposta recebida: %s\0A\00"
@.str.4 = [19 x i8] c"***thread over***\0A\00"
define i8* @client_thread(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [1024 x i8]
%6 = alloca [1024 x i8]
%7 = alloca %struct.sockaddr_in
%8 = alloca i32
%9 = alloca i8**
store i8* %0, i8** %3
%10 = bitcast [1024 x i8]* %5 to i8*
store i32 12, i32* %8
%11 = load i8*, i8** %3
%12 = bitcast i8* %11 to i8**
store i8** %12, i8*** %9
%13 = load i32, i32* @PF_INET
%14 = load i32, i32* @SOCK_STREAM
%15 = load i32, i32* @IPPROTO_TCP
%16 = call i32 @socket(i32 %13, i32 %14, i32 %15)
store i32 %16, i32* %4
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %1
%19 = call i32 @perror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
store i8* null, i8** %2
br label %60
20: ; preds = %1
%21 = bitcast %struct.sockaddr_in* %7 to i8*
%22 = call i32 @bzero(i8* %21, i32 12)
%23 = load i32, i32* @AF_INET
%24 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 2
store i32 %23, i32* %24
%25 = load i8**, i8*** %9
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i32 @inet_addr(i8* %27)
%29 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 1
%30 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %29, i32 0, i32 0
store i32 %28, i32* %30
%31 = load i8**, i8*** %9
%32 = getelementptr inbounds i8*, i8** %31, i64 2
%33 = load i8*, i8** %32
%34 = call i32 @atoi(i8* %33)
%35 = call i32 @htons(i32 %34)
%36 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 0
store i32 %35, i32* %36
%37 = load i32, i32* %4
%38 = bitcast %struct.sockaddr_in* %7 to %struct.sockaddr*
%39 = load i32, i32* %8
%40 = call i64 @connect(i32 %37, %struct.sockaddr* %38, i32 %39)
%41 = icmp slt i64 %40, 0
br i1 %41, label %42, label %44
42: ; preds = %20
%43 = call i32 @perror(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
store i8* null, i8** %2
br label %60
44: ; preds = %20
%45 = load i32, i32* %4
%46 = bitcast [1024 x i8]* %5 to i8**
%47 = call i32 @write(i32 %45, i8** %46, i32 1024)
%48 = icmp eq i32 %47, -1
br i1 %48, label %49, label %51
49: ; preds = %44
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %51
51: ; preds = %49, %44
%52 = load i32, i32* %4
%53 = bitcast [1024 x i8]* %6 to i8**
%54 = call i32 @read(i32 %52, i8** %53, i32 1024)
%55 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8* %55)
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%58 = load i32, i32* %4
%59 = call i32 @close(i32 %58)
store i8* null, i8** %2
br label %60
60: ; preds = %51, %42, %18
%61 = load i8*, i8** %2
ret i8* %61
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@__const.client_thread.pedido = [1024 x i8] c"GET /index.html HTTP/1.1\0D\0A\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
@.str = [33 x i8] c"client: can't open stream socket\00"
@AF_INET = global i32 0
@.str.1 = [40 x i8] c"client_thread: can't connect to server\0A\00"
@.str.3 = [23 x i8] c"resposta recebida: %s\0A\00"
@str = [18 x i8] c"***thread over***\00"
@str.5 = [5 x i8] c"erro\00"
define noalias i8* @client_thread(i8* nocapture %0) {
%2 = alloca [1024 x i8]
%3 = alloca [1024 x i8]
%4 = alloca %struct.sockaddr_in
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%7 = bitcast %struct.sockaddr_in* %4 to i8*
%8 = load i32, i32* @PF_INET
%9 = load i32, i32* @SOCK_STREAM
%10 = load i32, i32* @IPPROTO_TCP
%11 = tail call i32 @socket(i32 %8, i32 %9, i32 %10)
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = tail call i32 @perror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %47
15: ; preds = %1
%16 = call i32 @bzero(i8* %7, i32 12)
%17 = load i32, i32* @AF_INET
%18 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 2
store i32 %17, i32* %18
%19 = getelementptr inbounds i8, i8* %0, i64 8
%20 = bitcast i8* %19 to i8**
%21 = load i8*, i8** %20
%22 = tail call i32 @inet_addr(i8* %21)
%23 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 1, i32 0
store i32 %22, i32* %23
%24 = getelementptr inbounds i8, i8* %0, i64 16
%25 = bitcast i8* %24 to i8**
%26 = load i8*, i8** %25
%27 = tail call i32 @atoi(i8* %26)
%28 = tail call i32 @htons(i32 %27)
%29 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 0
store i32 %28, i32* %29
%30 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%31 = call i64 @connect(i32 %11, %struct.sockaddr* %30, i32 12)
%32 = icmp slt i64 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %15
%34 = call i32 @perror(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
br label %47
35: ; preds = %15
%36 = bitcast [1024 x i8]* %2 to i8**
%37 = call i32 @write(i32 %11, i8** %36, i32 1024)
%38 = icmp eq i32 %37, -1
br i1 %38, label %39, label %41
39: ; preds = %35
%40 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.5, i64 0, i64 0))
br label %41
41: ; preds = %39, %35
%42 = bitcast [1024 x i8]* %3 to i8**
%43 = call i32 @read(i32 %11, i8** %42, i32 1024)
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8* %6)
%45 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%46 = call i32 @close(i32 %11)
br label %47
47: ; preds = %41, %33, %13
ret i8* null
}