#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*/ s6_addr;
};
struct sockaddr_in6 {
  int /*<<< orphan*/ sin6_port;
  TYPE_1__ sin6_addr;
  int /*<<< orphan*/ sin6_family;
  scalar_t__ sin6_flowinfo;
};
struct sockaddr {
  int dummy;
};
struct hostent {
  int /*<<< orphan*/ h_length;
  scalar_t__ h_addr;
};
typedef int /*<<< orphan*/ serv_addr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET6;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ close(int);
scalar_t__ connect(int, struct sockaddr *, int);
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
struct hostent *gethostbyname(char *);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ memmove(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int recv(int, char *, int, int /*<<< orphan*/);
int send(int, char *, scalar_t__, int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
scalar_t__ strlen(char *);
int main(int argc, char *argv[]) {
  int sockfd, portno, n;
  struct sockaddr_in6 serv_addr;
  struct hostent *server;
  char buffer[256] = "This is a string from client!";
  if (argc < 1) {
    fprintf(stderr, "Usage: %s  \n", argv[0]);
    exit(0);
  }
  portno = 3200;
  printf("\nIPv6 TCP Client Started...\n");
  sockfd = socket(AF_INET6, SOCK_STREAM, 0);
  if (sockfd < 0)
    error("ERROR opening socket");
  server = gethostbyname("localhost");
  if (server == NULL) {
    fprintf(stderr, "ERROR, no such host\n");
    exit(0);
  }
  memset((char *)&serv_addr, 0, sizeof(serv_addr));
  serv_addr.sin6_flowinfo = 0;
  serv_addr.sin6_family = AF_INET6;
  memmove((char *)&serv_addr.sin6_addr.s6_addr, (char *)server->h_addr,
          server->h_length);
  serv_addr.sin6_port = htons(portno);
  if (connect(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0)
    error("ERROR connecting");
  n = send(sockfd, buffer, strlen(buffer) + 1, 0);
  if (n < 0)
    error("ERROR writing to socket");
  memset(buffer, 0, 256);
  n = recv(sockfd, buffer, 255, 0);
  if (n < 0)
    error("ERROR reading from socket");
  printf("Message from server: %s\n", buffer);
  close(sockfd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x140(%rbp),%rdi
lea    0xde9(%rip),%rsi
mov    $0x100,%edx
call   10c0 <memcpy@plt>
cmpl   $0x1,-0x8(%rbp)
jge    1250 <main+0x60>
mov    0x2da6(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xebe(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
xor    %edi,%edi
call   10f0 <exit@plt>
movl   $0xc80,-0x18(%rbp)
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    0x2d7c(%rip),%rax
mov    (%rax),%edi
mov    0x2d5b(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1110 <socket@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1297 <main+0xa7>
lea    0xe98(%rip),%rdi
call   10e0 <error@plt>
lea    0xea1(%rip),%rdi
call   10a0 <gethostbyname@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    12d0 <main+0xe0>
mov    0x2d1f(%rip),%rax
mov    (%rax),%edi
lea    0xe87(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
xor    %edi,%edi
call   10f0 <exit@plt>
lea    -0x38(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1080 <memset@plt>
movq   $0x0,-0x28(%rbp)
mov    0x2cf9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
lea    -0x38(%rbp),%rdi
add    $0x4,%rdi
mov    -0x40(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x40(%rbp),%rax
mov    (%rax),%edx
call   10d0 <memmove@plt>
mov    -0x18(%rbp),%edi
call   1050 <htons@plt>
mov    %eax,-0x38(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x38(%rbp),%rsi
mov    $0x18,%edx
call   1100 <connect@plt>
cmp    $0x0,%rax
jge    1341 <main+0x151>
lea    0xe22(%rip),%rdi
call   10e0 <error@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x14c(%rbp)
lea    -0x140(%rbp),%rax
mov    %rax,-0x148(%rbp)
lea    -0x140(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x14c(%rbp),%edi
mov    -0x148(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
xor    %ecx,%ecx
call   1060 <send@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1398 <main+0x1a8>
lea    0xddc(%rip),%rdi
call   10e0 <error@plt>
lea    -0x140(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1080 <memset@plt>
mov    -0x14(%rbp),%edi
lea    -0x140(%rbp),%rsi
mov    $0xff,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    13da <main+0x1ea>
lea    0xdb2(%rip),%rdi
call   10e0 <error@plt>
lea    -0x140(%rbp),%rsi
lea    0xdb9(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x14(%rbp),%edi
call   1090 <close@plt>
xor    %eax,%eax
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x128,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xde7(%rip),%rsi
lea    0x20(%rsp),%rdi
mov    $0x100,%edx
call   10d0 <memcpy@plt>
test   %ebp,%ebp
jle    136e <main+0x16e>
lea    0xf66(%rip),%rdi
call   1040 <puts@plt>
mov    0x2da5(%rip),%r15
mov    (%r15),%edi
mov    0x2d83(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1120 <socket@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    1268 <main+0x68>
lea    0xeaa(%rip),%rdi
call   10f0 <error@plt>
lea    0xeb3(%rip),%rdi
call   10b0 <gethostbyname@plt>
test   %rax,%rax
je     138f <main+0x18f>
mov    %rax,%rbx
lea    0x8(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1090 <memset@plt>
movq   $0x0,0x18(%rsp)
mov    (%r15),%eax
mov    %eax,0x10(%rsp)
lea    0xc(%rsp),%rdi
mov    0x8(%rbx),%rsi
mov    (%rbx),%edx
call   10e0 <memmove@plt>
mov    $0xc80,%edi
call   1060 <htons@plt>
mov    %eax,0x8(%rsp)
mov    %ebp,%edi
mov    %r14,%rsi
mov    $0x18,%edx
call   1110 <connect@plt>
test   %rax,%rax
jns    12e2 <main+0xe2>
lea    0xe64(%rip),%rdi
call   10f0 <error@plt>
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %ebp,%edi
mov    %rbx,%rsi
xor    %ecx,%ecx
call   1070 <send@plt>
test   %eax,%eax
jns    130f <main+0x10f>
lea    0xe48(%rip),%rdi
call   10f0 <error@plt>
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1090 <memset@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0xff,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
test   %eax,%eax
jns    1344 <main+0x144>
lea    0xe2b(%rip),%rdi
call   10f0 <error@plt>
lea    0xe39(%rip),%rdi
lea    0x20(%rsp),%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %ebp,%edi
call   10a0 <close@plt>
xor    %eax,%eax
add    $0x128,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c63(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xd7f(%rip),%rsi
xor    %eax,%eax
call   10c0 <fprintf@plt>
xor    %edi,%edi
call   1100 <exit@plt>
mov    0x2c42(%rip),%rax
mov    (%rax),%edi
lea    0xd8d(%rip),%rsi
xor    %eax,%eax
call   10c0 <fprintf@plt>
xor    %edi,%edi
call   1100 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in6 = type { i32, %struct.TYPE_2__, i32, i64 }
%struct.TYPE_2__ = type { i32 }
%struct.hostent = type { i32, i64 }
%struct.sockaddr = type { i32 }
@__const.main.buffer = [256 x i8] c"This is a string from client!\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@stderr = global i32 0
@.str = [13 x i8] c"Usage: %s \0A\00"
@.str.1 = [29 x i8] c"\0AIPv6 TCP Client Started...\0A\00"
@AF_INET6 = global i32 0
@SOCK_STREAM = global i32 0
@.str.2 = [21 x i8] c"ERROR opening socket\00"
@.str.3 = [10 x i8] c"localhost\00"
@.str.4 = [21 x i8] c"ERROR, no such host\0A\00"
@.str.5 = [17 x i8] c"ERROR connecting\00"
@.str.6 = [24 x i8] c"ERROR writing to socket\00"
@.str.7 = [26 x i8] c"ERROR reading from socket\00"
@.str.8 = [25 x i8] c"Message from server: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca %struct.sockaddr_in6
%10 = alloca %struct.hostent*
%11 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = bitcast [256 x i8]* %11 to i8*
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 1
br i1 %14, label %15, label %22
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %19)
%21 = call i32 @exit(i32 0)
unreachable
22: ; preds = %2
store i32 3200, i32* %7
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%24 = load i32, i32* @AF_INET6
%25 = load i32, i32* @SOCK_STREAM
%26 = call i32 @socket(i32 %24, i32 %25, i32 0)
store i32 %26, i32* %6
%27 = load i32, i32* %6
%28 = icmp slt i32 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %22
%30 = call i32 @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %31
31: ; preds = %29, %22
%32 = call %struct.hostent* @gethostbyname(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
store %struct.hostent* %32, %struct.hostent** %10
%33 = load %struct.hostent*, %struct.hostent** %10
%34 = icmp eq %struct.hostent* %33, null
br i1 %34, label %35, label %39
35: ; preds = %31
%36 = load i32, i32* @stderr
%37 = call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
%38 = call i32 @exit(i32 0)
unreachable
39: ; preds = %31
%40 = bitcast %struct.sockaddr_in6* %9 to i8*
%41 = call i32 @memset(i8* %40, i32 0, i32 24)
%42 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %9, i32 0, i32 3
store i64 0, i64* %42
%43 = load i32, i32* @AF_INET6
%44 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %9, i32 0, i32 2
store i32 %43, i32* %44
%45 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %9, i32 0, i32 1
%46 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %45, i32 0, i32 0
%47 = bitcast i32* %46 to i8*
%48 = load %struct.hostent*, %struct.hostent** %10
%49 = getelementptr inbounds %struct.hostent, %struct.hostent* %48, i32 0, i32 1
%50 = load i64, i64* %49
%51 = inttoptr i64 %50 to i8*
%52 = load %struct.hostent*, %struct.hostent** %10
%53 = getelementptr inbounds %struct.hostent, %struct.hostent* %52, i32 0, i32 0
%54 = load i32, i32* %53
%55 = call i32 @memmove(i8* %47, i8* %51, i32 %54)
%56 = load i32, i32* %7
%57 = call i32 @htons(i32 %56)
%58 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %9, i32 0, i32 0
store i32 %57, i32* %58
%59 = load i32, i32* %6
%60 = bitcast %struct.sockaddr_in6* %9 to %struct.sockaddr*
%61 = call i64 @connect(i32 %59, %struct.sockaddr* %60, i32 24)
%62 = icmp slt i64 %61, 0
br i1 %62, label %63, label %65
63: ; preds = %39
%64 = call i32 @error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
br label %65
65: ; preds = %63, %39
%66 = load i32, i32* %6
%67 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%68 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%69 = call i64 @strlen(i8* %68)
%70 = add nsw i64 %69, 1
%71 = call i32 @send(i32 %66, i8* %67, i64 %70, i32 0)
store i32 %71, i32* %8
%72 = load i32, i32* %8
%73 = icmp slt i32 %72, 0
br i1 %73, label %74, label %76
74: ; preds = %65
%75 = call i32 @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
br label %76
76: ; preds = %74, %65
%77 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%78 = call i32 @memset(i8* %77, i32 0, i32 256)
%79 = load i32, i32* %6
%80 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%81 = call i32 @recv(i32 %79, i8* %80, i32 255, i32 0)
store i32 %81, i32* %8
%82 = load i32, i32* %8
%83 = icmp slt i32 %82, 0
br i1 %83, label %84, label %86
84: ; preds = %76
%85 = call i32 @error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0))
br label %86
86: ; preds = %84, %76
%87 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0), i8* %87)
%89 = load i32, i32* %6
%90 = call i32 @close(i32 %89)
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr_in6 = type { i32, %struct.TYPE_2__, i32, i64 }
%struct.TYPE_2__ = type { i32 }
%struct.hostent = type { i32, i64 }
%struct.sockaddr = type { i32 }
@__const.main.buffer = [256 x i8] c"This is a string from client!\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@stderr = global i32 0
@.str = [13 x i8] c"Usage: %s \0A\00"
@AF_INET6 = global i32 0
@SOCK_STREAM = global i32 0
@.str.2 = [21 x i8] c"ERROR opening socket\00"
@.str.3 = [10 x i8] c"localhost\00"
@.str.4 = [21 x i8] c"ERROR, no such host\0A\00"
@.str.5 = [17 x i8] c"ERROR connecting\00"
@.str.6 = [24 x i8] c"ERROR writing to socket\00"
@.str.7 = [26 x i8] c"ERROR reading from socket\00"
@.str.8 = [25 x i8] c"Message from server: %s\0A\00"
@str = [28 x i8] c"\0AIPv6 TCP Client Started...\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_in6
%4 = alloca [256 x i8]
%5 = bitcast %struct.sockaddr_in6* %3 to i8*
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%7 = icmp slt i32 %0, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %1
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = tail call i32 @exit(i32 0)
unreachable
13: ; preds = %2
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%15 = load i32, i32* @AF_INET6
%16 = load i32, i32* @SOCK_STREAM
%17 = tail call i32 @socket(i32 %15, i32 %16, i32 0)
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %13
%20 = tail call i32 @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %21
21: ; preds = %19, %13
%22 = tail call %struct.hostent* @gethostbyname(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%23 = icmp eq %struct.hostent* %22, null
br i1 %23, label %24, label %28
24: ; preds = %21
%25 = load i32, i32* @stderr
%26 = tail call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
%27 = tail call i32 @exit(i32 0)
unreachable
28: ; preds = %21
%29 = call i32 @memset(i8* %5, i32 0, i32 24)
%30 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %3, i64 0, i32 3
store i64 0, i64* %30
%31 = load i32, i32* @AF_INET6
%32 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %3, i64 0, i32 2
store i32 %31, i32* %32
%33 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %3, i64 0, i32 1, i32 0
%34 = bitcast i32* %33 to i8*
%35 = getelementptr inbounds %struct.hostent, %struct.hostent* %22, i64 0, i32 1
%36 = load i64, i64* %35
%37 = inttoptr i64 %36 to i8*
%38 = getelementptr inbounds %struct.hostent, %struct.hostent* %22, i64 0, i32 0
%39 = load i32, i32* %38
%40 = call i32 @memmove(i8* %34, i8* %37, i32 %39)
%41 = call i32 @htons(i32 3200)
%42 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %3, i64 0, i32 0
store i32 %41, i32* %42
%43 = bitcast %struct.sockaddr_in6* %3 to %struct.sockaddr*
%44 = call i64 @connect(i32 %17, %struct.sockaddr* %43, i32 24)
%45 = icmp slt i64 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %28
%47 = call i32 @error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
br label %48
48: ; preds = %46, %28
%49 = call i64 @strlen(i8* %6)
%50 = add nsw i64 %49, 1
%51 = call i32 @send(i32 %17, i8* %6, i64 %50, i32 0)
%52 = icmp slt i32 %51, 0
br i1 %52, label %53, label %55
53: ; preds = %48
%54 = call i32 @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
br label %55
55: ; preds = %53, %48
%56 = call i32 @memset(i8* %6, i32 0, i32 256)
%57 = call i32 @recv(i32 %17, i8* %6, i32 255, i32 0)
%58 = icmp slt i32 %57, 0
br i1 %58, label %59, label %61
59: ; preds = %55
%60 = call i32 @error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0))
br label %61
61: ; preds = %59, %55
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0), i8* %6)
%63 = call i32 @close(i32 %17)
ret i32 0
}