#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 */
typedef int /*<<< orphan*/ target_addr;
struct TYPE_2__ {
  int /*<<< orphan*/ s_addr;
};
struct sockaddr_in {
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_port;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
struct hostent {
  scalar_t__ *h_addr_list;
};
typedef int /*<<< orphan*/ in_addr_t;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int atoi(char *);
int /*<<< orphan*/ close(int);
int connect(int, struct sockaddr *, int);
struct hostent *gethostbyname(char *);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int recv(int, char *, int, int /*<<< orphan*/);
int send(int, char *, int, int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, ...);
int /*<<< orphan*/ strcat(char *, char *);
int strlen(char *);
int main(int argc, char *argv[]) {
  struct hostent *host;
  int port;
  int soc;
  struct sockaddr_in target_addr;
  char request_str[1024];
  int send_len;
  char response_buf[4096];
  int recv_len;
  int content_len;
  char content_len_str[256];
  if (argc != 5) {
    printf("Not enough input arguments.\n");
    return -1;
  }
  host = gethostbyname(argv[1]);
  if (host == NULL) {
    printf("gethostbyname error!\n");
    return -2;
  }
  port = atoi(argv[2]);
  soc = socket(AF_INET, SOCK_STREAM, 0);
  if (soc == -1) {
    printf("socket error!\n");
    return -3;
  }
  target_addr.sin_family = AF_INET;
  target_addr.sin_port = htons(port);
  target_addr.sin_addr.s_addr = *(in_addr_t *)host->h_addr_list[0];
  if (connect(soc, (struct sockaddr *)&target_addr, sizeof(target_addr)) ==
      -1) {
    printf("connect error!\n");
    close(soc);
    return -4;
  }
  printf("connect success.\n");
  memset(request_str, 0, sizeof(char) * 1024);
  sprintf(request_str, "POST %s HTTP/1.0\r\n", argv[3]);
  sprintf(content_len_str, "Content-Length: %d\r\n", strlen(argv[4]));
  strcat(request_str, content_len_str);
  strcat(request_str, "Content-Type: text/plain\r\n");
  strcat(request_str, "\r\n");
  strcat(request_str, argv[4]);
  send_len = send(soc, request_str, strlen(request_str), 0);
  memset(response_buf, 0, sizeof(char) * 4096);
  recv_len = recv(soc, response_buf, sizeof(char) * 4096, 0);
  printf("%s\n", response_buf);
  close(soc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1570,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x5,-0x8(%rbp)
je     120d <main+0x3d>
lea    0xe06(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1444 <main+0x274>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10a0 <gethostbyname@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1243 <main+0x73>
lea    0xded(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1444 <main+0x274>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    0x2d8e(%rip),%rax
mov    (%rax),%edi
mov    0x2d75(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10f0 <socket@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0xffffffff,-0x20(%rbp)
jne    1293 <main+0xc3>
lea    0xdb3(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0xfffffffd,-0x4(%rbp)
jmp    1444 <main+0x274>
mov    0x2d4e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x1c(%rbp),%edi
call   1050 <htons@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    -0x20(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0xc,%edx
call   10e0 <connect@plt>
cmp    $0xffffffff,%eax
jne    12f5 <main+0x125>
lea    0xd68(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x20(%rbp),%edi
call   1090 <close@plt>
movl   $0xfffffffc,-0x4(%rbp)
jmp    1444 <main+0x274>
lea    0xd56(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x430(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1080 <memset@plt>
lea    -0x430(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdx
lea    0xd38(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
lea    -0x1550(%rbp),%rax
mov    %rax,-0x1568(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1040 <strlen@plt>
mov    -0x1568(%rbp),%rdi
mov    %eax,%edx
lea    0xd19(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
lea    -0x430(%rbp),%rdi
lea    -0x1550(%rbp),%rsi
call   10c0 <strcat@plt>
lea    -0x430(%rbp),%rdi
lea    0xd06(%rip),%rsi
call   10c0 <strcat@plt>
lea    -0x430(%rbp),%rdi
lea    0xcdb(%rip),%rsi
call   10c0 <strcat@plt>
lea    -0x430(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rsi
call   10c0 <strcat@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x155c(%rbp)
lea    -0x430(%rbp),%rax
mov    %rax,-0x1558(%rbp)
lea    -0x430(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x155c(%rbp),%edi
mov    -0x1558(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
mov    %eax,-0x434(%rbp)
lea    -0x1440(%rbp),%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   1080 <memset@plt>
mov    -0x20(%rbp),%edi
lea    -0x1440(%rbp),%rsi
mov    $0x1000,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x1444(%rbp)
lea    -0x1440(%rbp),%rsi
lea    0xc79(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x20(%rbp),%edi
call   1090 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1570,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x1510,%rsp
cmp    $0x5,%edi
jne    134e <main+0x17e>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   10a0 <gethostbyname@plt>
test   %rax,%rax
je     1361 <main+0x191>
mov    %rax,%rbp
mov    0x10(%rbx),%rdi
call   10b0 <atoi@plt>
mov    %eax,%r15d
mov    0x2dd5(%rip),%r12
mov    (%r12),%edi
mov    0x2dba(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10f0 <socket@plt>
cmp    $0xffffffff,%eax
je     1374 <main+0x1a4>
mov    %eax,%r14d
mov    (%r12),%eax
mov    %eax,0x8(%rsp)
mov    %r15d,%edi
call   1060 <htons@plt>
mov    %eax,0x4(%rsp)
mov    0x0(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
mov    %rsp,%rsi
mov    %r14d,%edi
mov    $0xc,%edx
call   10e0 <connect@plt>
cmp    $0xffffffff,%eax
je     1387 <main+0x1b7>
lea    0xdd0(%rip),%rdi
call   1040 <puts@plt>
lea    0x110(%rsp),%r15
xor    %ebp,%ebp
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1080 <memset@plt>
mov    0x18(%rbx),%rdx
lea    0xd64(%rip),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   10d0 <sprintf@plt>
mov    0x20(%rbx),%rdi
call   1050 <strlen@plt>
lea    0xd5d(%rip),%rsi
lea    0x10(%rsp),%r12
mov    %r12,%rdi
mov    %eax,%edx
xor    %eax,%eax
call   10d0 <sprintf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   10c0 <strcat@plt>
lea    0xd4f(%rip),%rsi
mov    %r15,%rdi
call   10c0 <strcat@plt>
lea    0xd28(%rip),%rsi
mov    %r15,%rdi
call   10c0 <strcat@plt>
mov    0x20(%rbx),%rsi
mov    %r15,%rdi
call   10c0 <strcat@plt>
mov    %r15,%rdi
call   1050 <strlen@plt>
mov    %r14d,%edi
mov    %r15,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1070 <send@plt>
lea    0x510(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   1080 <memset@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0x1000,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %r14d,%edi
call   1090 <close@plt>
jmp    13a0 <main+0x1d0>
lea    0xd31(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%ebp
jmp    13a0 <main+0x1d0>
lea    0xd09(%rip),%rdi
call   1040 <puts@plt>
mov    $0xfffffffe,%ebp
jmp    13a0 <main+0x1d0>
lea    0xce8(%rip),%rdi
call   1040 <puts@plt>
mov    $0xfffffffd,%ebp
jmp    13a0 <main+0x1d0>
lea    0xcc6(%rip),%rdi
call   1040 <puts@plt>
mov    %r14d,%edi
call   1090 <close@plt>
mov    $0xfffffffc,%ebp
mov    %ebp,%eax
add    $0x1510,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.hostent = type { i64* }
%struct.sockaddr_in = type { %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [29 x i8] c"Not enough input arguments.\0A\00"
@.str.1 = [22 x i8] c"gethostbyname error!\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.2 = [15 x i8] c"socket error!\0A\00"
@.str.3 = [16 x i8] c"connect error!\0A\00"
@.str.4 = [18 x i8] c"connect success.\0A\00"
@.str.5 = [19 x i8] c"POST %s HTTP/1.0\0D\0A\00"
@.str.6 = [21 x i8] c"Content-Length: %d\0D\0A\00"
@.str.7 = [27 x i8] c"Content-Type: text/plain\0D\0A\00"
@.str.8 = [3 x i8] c"\0D\0A\00"
@.str.9 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.hostent*
%7 = alloca i32
%8 = alloca i32
%9 = alloca %struct.sockaddr_in
%10 = alloca [1024 x i8]
%11 = alloca i32
%12 = alloca [4096 x i8]
%13 = alloca i32
%14 = alloca i32
%15 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = load i32, i32* %4
%17 = icmp ne i32 %16, 5
br i1 %17, label %18, label %20
18: ; preds = %2
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %105
20: ; preds = %2
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call %struct.hostent* @gethostbyname(i8* %23)
store %struct.hostent* %24, %struct.hostent** %6
%25 = load %struct.hostent*, %struct.hostent** %6
%26 = icmp eq %struct.hostent* %25, null
br i1 %26, label %27, label %29
27: ; preds = %20
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
store i32 -2, i32* %3
br label %105
29: ; preds = %20
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 2
%32 = load i8*, i8** %31
%33 = call i32 @atoi(i8* %32)
store i32 %33, i32* %7
%34 = load i32, i32* @AF_INET
%35 = load i32, i32* @SOCK_STREAM
%36 = call i32 @socket(i32 %34, i32 %35, i32 0)
store i32 %36, i32* %8
%37 = load i32, i32* %8
%38 = icmp eq i32 %37, -1
br i1 %38, label %39, label %41
39: ; preds = %29
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
store i32 -3, i32* %3
br label %105
41: ; preds = %29
%42 = load i32, i32* @AF_INET
%43 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 2
store i32 %42, i32* %43
%44 = load i32, i32* %7
%45 = call i32 @htons(i32 %44)
%46 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 1
store i32 %45, i32* %46
%47 = load %struct.hostent*, %struct.hostent** %6
%48 = getelementptr inbounds %struct.hostent, %struct.hostent* %47, i32 0, i32 0
%49 = load i64*, i64** %48
%50 = getelementptr inbounds i64, i64* %49, i64 0
%51 = load i64, i64* %50
%52 = inttoptr i64 %51 to i32*
%53 = load i32, i32* %52
%54 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 0
%55 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %54, i32 0, i32 0
store i32 %53, i32* %55
%56 = load i32, i32* %8
%57 = bitcast %struct.sockaddr_in* %9 to %struct.sockaddr*
%58 = call i32 @connect(i32 %56, %struct.sockaddr* %57, i32 12)
%59 = icmp eq i32 %58, -1
br i1 %59, label %60, label %64
60: ; preds = %41
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%62 = load i32, i32* %8
%63 = call i32 @close(i32 %62)
store i32 -4, i32* %3
br label %105
64: ; preds = %41
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%66 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%67 = call i32 @memset(i8* %66, i32 0, i32 1024)
%68 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%69 = load i8**, i8*** %5
%70 = getelementptr inbounds i8*, i8** %69, i64 3
%71 = load i8*, i8** %70
%72 = call i32 (i8*, i8*, ...) @sprintf(i8* %68, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i8* %71)
%73 = getelementptr inbounds [256 x i8], [256 x i8]* %15, i64 0, i64 0
%74 = load i8**, i8*** %5
%75 = getelementptr inbounds i8*, i8** %74, i64 4
%76 = load i8*, i8** %75
%77 = call i32 @strlen(i8* %76)
%78 = call i32 (i8*, i8*, ...) @sprintf(i8* %73, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i32 %77)
%79 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%80 = getelementptr inbounds [256 x i8], [256 x i8]* %15, i64 0, i64 0
%81 = call i32 @strcat(i8* %79, i8* %80)
%82 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%83 = call i32 @strcat(i8* %82, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
%84 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%85 = call i32 @strcat(i8* %84, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%86 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%87 = load i8**, i8*** %5
%88 = getelementptr inbounds i8*, i8** %87, i64 4
%89 = load i8*, i8** %88
%90 = call i32 @strcat(i8* %86, i8* %89)
%91 = load i32, i32* %8
%92 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%93 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%94 = call i32 @strlen(i8* %93)
%95 = call i32 @send(i32 %91, i8* %92, i32 %94, i32 0)
store i32 %95, i32* %11
%96 = getelementptr inbounds [4096 x i8], [4096 x i8]* %12, i64 0, i64 0
%97 = call i32 @memset(i8* %96, i32 0, i32 4096)
%98 = load i32, i32* %8
%99 = getelementptr inbounds [4096 x i8], [4096 x i8]* %12, i64 0, i64 0
%100 = call i32 @recv(i32 %98, i8* %99, i32 4096, i32 0)
store i32 %100, i32* %13
%101 = getelementptr inbounds [4096 x i8], [4096 x i8]* %12, i64 0, i64 0
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* %101)
%103 = load i32, i32* %8
%104 = call i32 @close(i32 %103)
store i32 0, i32* %3
br label %105
105: ; preds = %64, %60, %39, %27, %18
%106 = load i32, i32* %3
ret i32 %106
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.hostent = type { i64* }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.5 = [19 x i8] c"POST %s HTTP/1.0\0D\0A\00"
@.str.6 = [21 x i8] c"Content-Length: %d\0D\0A\00"
@.str.7 = [27 x i8] c"Content-Type: text/plain\0D\0A\00"
@.str.8 = [3 x i8] c"\0D\0A\00"
@str = [17 x i8] c"connect success.\00"
@str.10 = [15 x i8] c"connect error!\00"
@str.11 = [14 x i8] c"socket error!\00"
@str.12 = [21 x i8] c"gethostbyname error!\00"
@str.13 = [28 x i8] c"Not enough input arguments.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca [1024 x i8]
%5 = alloca [4096 x i8]
%6 = alloca [256 x i8]
%7 = bitcast %struct.sockaddr_in* %3 to i8*
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%9 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%11 = icmp eq i32 %0, 5
br i1 %11, label %14, label %12
12: ; preds = %2
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.13, i64 0, i64 0))
br label %69
14: ; preds = %2
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
%17 = tail call %struct.hostent* @gethostbyname(i8* %16)
%18 = icmp eq %struct.hostent* %17, null
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.12, i64 0, i64 0))
br label %69
21: ; preds = %14
%22 = getelementptr inbounds i8*, i8** %1, i64 2
%23 = load i8*, i8** %22
%24 = tail call i32 @atoi(i8* %23)
%25 = load i32, i32* @AF_INET
%26 = load i32, i32* @SOCK_STREAM
%27 = tail call i32 @socket(i32 %25, i32 %26, i32 0)
%28 = icmp eq i32 %27, -1
br i1 %28, label %29, label %31
29: ; preds = %21
%30 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.11, i64 0, i64 0))
br label %69
31: ; preds = %21
%32 = load i32, i32* @AF_INET
%33 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i32 %32, i32* %33
%34 = tail call i32 @htons(i32 %24)
%35 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1
store i32 %34, i32* %35
%36 = getelementptr inbounds %struct.hostent, %struct.hostent* %17, i64 0, i32 0
%37 = load i64*, i64** %36
%38 = load i64, i64* %37
%39 = inttoptr i64 %38 to i32*
%40 = load i32, i32* %39
%41 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0, i32 0
store i32 %40, i32* %41
%42 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%43 = call i32 @connect(i32 %27, %struct.sockaddr* %42, i32 12)
%44 = icmp eq i32 %43, -1
br i1 %44, label %45, label %48
45: ; preds = %31
%46 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.10, i64 0, i64 0))
%47 = call i32 @close(i32 %27)
br label %69
48: ; preds = %31
%49 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%50 = call i32 @memset(i8* %8, i32 0, i32 1024)
%51 = getelementptr inbounds i8*, i8** %1, i64 3
%52 = load i8*, i8** %51
%53 = call i32 (i8*, i8*, ...) @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i8* %52)
%54 = getelementptr inbounds i8*, i8** %1, i64 4
%55 = load i8*, i8** %54
%56 = call i32 @strlen(i8* %55)
%57 = call i32 (i8*, i8*, ...) @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i32 %56)
%58 = call i32 @strcat(i8* %8, i8* %10)
%59 = call i32 @strcat(i8* %8, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
%60 = call i32 @strcat(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%61 = load i8*, i8** %54
%62 = call i32 @strcat(i8* %8, i8* %61)
%63 = call i32 @strlen(i8* %8)
%64 = call i32 @send(i32 %27, i8* %8, i32 %63, i32 0)
%65 = call i32 @memset(i8* %9, i32 0, i32 4096)
%66 = call i32 @recv(i32 %27, i8* %9, i32 4096, i32 0)
%67 = call i32 @puts(i8* %9)
%68 = call i32 @close(i32 %27)
br label %69
69: ; preds = %48, %45, %29, %19, %12
%70 = phi i32 [ -1, %12 ], [ -2, %19 ], [ -3, %29 ], [ -4, %45 ], [ 0, %48 ]
ret i32 %70
}