#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 timeval {
  int /*<<< orphan*/ tv_sec;
};
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;
};
struct hostent {
  int /*<<< orphan*/ h_length;
  scalar_t__ h_addr;
};
typedef int /*<<< orphan*/ serv_addr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int atoi(char *);
int /*<<< orphan*/ bcopy(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ close(int);
scalar_t__ connect(int, struct sockaddr *, int);
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
struct hostent *gethostbyname(char *);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ printf(char *, ...);
int read(int, char *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ strlen(char *);
int write(int, char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int sockfd, portno, n;
  struct sockaddr_in serv_addr;
  struct hostent *server;
  struct timeval startClock, endClock;
  char buffer[256];
  if (argc < 3) {
    fprintf(stderr, "usage %s hostname port\n", argv[0]);
    exit(0);
  }
  portno = atoi(argv[2]);
  sockfd = socket(AF_INET, SOCK_STREAM, 0);
  if (sockfd < 0)
    error("ERROR opening socket");
  server = gethostbyname(argv[1]);
  if (server == NULL) {
    fprintf(stderr, "ERROR, no such host\n");
    exit(0);
  }
  bzero((char *)&serv_addr, sizeof(serv_addr));
  serv_addr.sin_family = AF_INET;
  bcopy((char *)server->h_addr, (char *)&serv_addr.sin_addr.s_addr,
        server->h_length);
  serv_addr.sin_port = htons(portno);
  if (connect(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0)
    error("ERROR connecting");
  printf("Please enter the message: ");
  bzero(buffer, 256);
  fgets(buffer, 255, stdin);
  gettimeofday(&startClock, NULL);
  n = write(sockfd, buffer, strlen(buffer));
  if (n < 0)
    error("ERROR writing to socket");
  bzero(buffer, 256);
  n = read(sockfd, buffer, 255);
  if (n < 0)
    error("ERROR reading from socket");
  printf("%s\n", buffer);
  gettimeofday(&endClock, NULL);
  printf("cost time is %ld\n", endClock.tv_sec - startClock.tv_sec);
  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)
cmpl   $0x3,-0x8(%rbp)
jge    1258 <main+0x48>
mov    0x2d96(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xdb6(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
xor    %edi,%edi
call   1110 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1100 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    0x2d79(%rip),%rax
mov    (%rax),%edi
mov    0x2d50(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    129a <main+0x8a>
lea    0xd83(%rip),%rdi
call   10e0 <error@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10b0 <gethostbyname@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    12d4 <main+0xc4>
mov    0x2d13(%rip),%rax
mov    (%rax),%edi
lea    0xd67(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
xor    %edi,%edi
call   1110 <exit@plt>
lea    -0x28(%rbp),%rdi
mov    $0xc,%esi
call   10f0 <bzero@plt>
mov    0x2cff(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x30(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x28(%rbp),%rsi
add    $0x4,%rsi
mov    -0x30(%rbp),%rax
mov    (%rax),%edx
call   10d0 <bcopy@plt>
mov    -0x18(%rbp),%edi
call   1050 <htons@plt>
mov    %eax,-0x28(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x28(%rbp),%rsi
mov    $0xc,%edx
call   1120 <connect@plt>
cmp    $0x0,%rax
jge    133b <main+0x12b>
lea    0xd0c(%rip),%rdi
call   10e0 <error@plt>
lea    0xd11(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x140(%rbp),%rdi
mov    $0x100,%esi
call   10f0 <bzero@plt>
lea    -0x140(%rbp),%rdi
mov    0x2c78(%rip),%rax
mov    (%rax),%edx
mov    $0xff,%esi
call   10a0 <fgets@plt>
lea    -0x38(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gettimeofday@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    %eax,%edx
call   1030 <write@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    13d1 <main+0x1c1>
lea    0xca2(%rip),%rdi
call   10e0 <error@plt>
lea    -0x140(%rbp),%rdi
mov    $0x100,%esi
call   10f0 <bzero@plt>
mov    -0x14(%rbp),%edi
lea    -0x140(%rbp),%rsi
mov    $0xff,%edx
call   1090 <read@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    140f <main+0x1ff>
lea    0xc7c(%rip),%rdi
call   10e0 <error@plt>
lea    -0x140(%rbp),%rsi
lea    0xc83(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x40(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gettimeofday@plt>
mov    -0x40(%rbp),%esi
sub    -0x38(%rbp),%esi
lea    0xc66(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x14(%rbp),%edi
call   1080 <close@plt>
xor    %eax,%eax
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x120,%rsp
mov    %rsi,%rbp
cmp    $0x2,%edi
jle    13b9 <main+0x199>
mov    0x10(%rbp),%rdi
call   1110 <atoi@plt>
mov    %eax,%r14d
mov    0x2d9a(%rip),%r12
mov    (%r12),%edi
mov    0x2d6f(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1140 <socket@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1274 <main+0x54>
lea    0xda9(%rip),%rdi
call   10f0 <error@plt>
mov    0x8(%rbp),%rdi
call   10c0 <gethostbyname@plt>
test   %rax,%rax
je     13db <main+0x1bb>
mov    %rax,%rbp
lea    0x10(%rsp),%r15
mov    %r15,%rdi
mov    $0xc,%esi
call   1100 <bzero@plt>
mov    (%r12),%eax
mov    %eax,0x18(%rsp)
mov    0x8(%rbp),%rsi
lea    0x14(%rsp),%rdi
mov    0x0(%rbp),%edx
call   10e0 <memmove@plt>
mov    %r14d,%edi
call   1060 <htons@plt>
mov    %eax,0x10(%rsp)
mov    %ebx,%edi
mov    %r15,%rsi
mov    $0xc,%edx
call   1130 <connect@plt>
test   %rax,%rax
jns    12e0 <main+0xc0>
lea    0xd67(%rip),%rdi
call   10f0 <error@plt>
lea    0xd6c(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x20(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x100,%esi
call   1100 <bzero@plt>
mov    0x2cd9(%rip),%rax
mov    (%rax),%edx
mov    %rbp,%rdi
mov    $0xff,%esi
call   10b0 <fgets@plt>
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1080 <gettimeofday@plt>
mov    %rbp,%rdi
call   1050 <strlen@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %eax,%edx
call   1040 <write@plt>
test   %eax,%eax
jns    1346 <main+0x126>
lea    0xd2d(%rip),%rdi
call   10f0 <error@plt>
lea    0x20(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x100,%esi
call   1100 <bzero@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    $0xff,%edx
call   10a0 <read@plt>
test   %eax,%eax
jns    1377 <main+0x157>
lea    0xd14(%rip),%rdi
call   10f0 <error@plt>
lea    0x20(%rsp),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
xor    %esi,%esi
call   1080 <gettimeofday@plt>
mov    (%rsp),%esi
sub    0x8(%rsp),%esi
lea    0xd07(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebx,%edi
call   1090 <close@plt>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c10(%rip),%rax
mov    (%rax),%edi
mov    0x0(%rbp),%rdx
lea    0xc33(%rip),%rsi
xor    %eax,%eax
call   10d0 <fprintf@plt>
xor    %edi,%edi
call   1120 <exit@plt>
mov    0x2bee(%rip),%rax
mov    (%rax),%edi
lea    0xc42(%rip),%rsi
xor    %eax,%eax
call   10d0 <fprintf@plt>
xor    %edi,%edi
call   1120 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.hostent = type { i32, i64 }
%struct.timeval = type { i32 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [24 x i8] c"usage %s hostname port\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [21 x i8] c"ERROR opening socket\00"
@.str.2 = [21 x i8] c"ERROR, no such host\0A\00"
@.str.3 = [17 x i8] c"ERROR connecting\00"
@.str.4 = [27 x i8] c"Please enter the message: \00"
@stdin = global i32 0
@.str.5 = [24 x i8] c"ERROR writing to socket\00"
@.str.6 = [26 x i8] c"ERROR reading from socket\00"
@.str.7 = [4 x i8] c"%s\0A\00"
@.str.8 = [18 x i8] c"cost time is %ld\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_in
%10 = alloca %struct.hostent*
%11 = alloca %struct.timeval
%12 = alloca %struct.timeval
%13 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 3
br i1 %15, label %16, label %23
16: ; preds = %2
%17 = load i32, i32* @stderr
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 0
%20 = load i8*, i8** %19
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %20)
%22 = call i32 @exit(i32 0)
unreachable
23: ; preds = %2
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 2
%26 = load i8*, i8** %25
%27 = call i32 @atoi(i8* %26)
store i32 %27, i32* %7
%28 = load i32, i32* @AF_INET
%29 = load i32, i32* @SOCK_STREAM
%30 = call i32 @socket(i32 %28, i32 %29, i32 0)
store i32 %30, i32* %6
%31 = load i32, i32* %6
%32 = icmp slt i32 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %23
%34 = call i32 @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %35
35: ; preds = %33, %23
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 1
%38 = load i8*, i8** %37
%39 = call %struct.hostent* @gethostbyname(i8* %38)
store %struct.hostent* %39, %struct.hostent** %10
%40 = load %struct.hostent*, %struct.hostent** %10
%41 = icmp eq %struct.hostent* %40, null
br i1 %41, label %42, label %46
42: ; preds = %35
%43 = load i32, i32* @stderr
%44 = call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%45 = call i32 @exit(i32 0)
unreachable
46: ; preds = %35
%47 = bitcast %struct.sockaddr_in* %9 to i8*
%48 = call i32 @bzero(i8* %47, i32 12)
%49 = load i32, i32* @AF_INET
%50 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 2
store i32 %49, i32* %50
%51 = load %struct.hostent*, %struct.hostent** %10
%52 = getelementptr inbounds %struct.hostent, %struct.hostent* %51, i32 0, i32 1
%53 = load i64, i64* %52
%54 = inttoptr i64 %53 to i8*
%55 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 1
%56 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %55, i32 0, i32 0
%57 = bitcast i32* %56 to i8*
%58 = load %struct.hostent*, %struct.hostent** %10
%59 = getelementptr inbounds %struct.hostent, %struct.hostent* %58, i32 0, i32 0
%60 = load i32, i32* %59
%61 = call i32 @bcopy(i8* %54, i8* %57, i32 %60)
%62 = load i32, i32* %7
%63 = call i32 @htons(i32 %62)
%64 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 0
store i32 %63, i32* %64
%65 = load i32, i32* %6
%66 = bitcast %struct.sockaddr_in* %9 to %struct.sockaddr*
%67 = call i64 @connect(i32 %65, %struct.sockaddr* %66, i32 12)
%68 = icmp slt i64 %67, 0
br i1 %68, label %69, label %71
69: ; preds = %46
%70 = call i32 @error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
br label %71
71: ; preds = %69, %46
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%73 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%74 = call i32 @bzero(i8* %73, i32 256)
%75 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%76 = load i32, i32* @stdin
%77 = call i32 @fgets(i8* %75, i32 255, i32 %76)
%78 = call i32 @gettimeofday(%struct.timeval* %11, i32* null)
%79 = load i32, i32* %6
%80 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%81 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%82 = call i32 @strlen(i8* %81)
%83 = call i32 @write(i32 %79, i8* %80, i32 %82)
store i32 %83, i32* %8
%84 = load i32, i32* %8
%85 = icmp slt i32 %84, 0
br i1 %85, label %86, label %88
86: ; preds = %71
%87 = call i32 @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
br label %88
88: ; preds = %86, %71
%89 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%90 = call i32 @bzero(i8* %89, i32 256)
%91 = load i32, i32* %6
%92 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%93 = call i32 @read(i32 %91, i8* %92, i32 255)
store i32 %93, i32* %8
%94 = load i32, i32* %8
%95 = icmp slt i32 %94, 0
br i1 %95, label %96, label %98
96: ; preds = %88
%97 = call i32 @error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
br label %98
98: ; preds = %96, %88
%99 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %99)
%101 = call i32 @gettimeofday(%struct.timeval* %12, i32* null)
%102 = getelementptr inbounds %struct.timeval, %struct.timeval* %12, i32 0, i32 0
%103 = load i32, i32* %102
%104 = getelementptr inbounds %struct.timeval, %struct.timeval* %11, i32 0, i32 0
%105 = load i32, i32* %104
%106 = sub nsw i32 %103, %105
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i32 %106)
%108 = load i32, i32* %6
%109 = call i32 @close(i32 %108)
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.timeval = type { i32 }
%struct.hostent = type { i32, i64 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [24 x i8] c"usage %s hostname port\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [21 x i8] c"ERROR opening socket\00"
@.str.2 = [21 x i8] c"ERROR, no such host\0A\00"
@.str.3 = [17 x i8] c"ERROR connecting\00"
@.str.4 = [27 x i8] c"Please enter the message: \00"
@stdin = global i32 0
@.str.5 = [24 x i8] c"ERROR writing to socket\00"
@.str.6 = [26 x i8] c"ERROR reading from socket\00"
@.str.8 = [18 x i8] c"cost time is %ld\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca %struct.timeval
%5 = alloca %struct.timeval
%6 = alloca [256 x i8]
%7 = bitcast %struct.sockaddr_in* %3 to i8*
%8 = bitcast %struct.timeval* %4 to i8*
%9 = bitcast %struct.timeval* %5 to i8*
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%11 = icmp slt i32 %0, 3
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = load i8*, i8** %1
%15 = tail call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = tail call i32 @exit(i32 0)
unreachable
17: ; preds = %2
%18 = getelementptr inbounds i8*, i8** %1, i64 2
%19 = load i8*, i8** %18
%20 = tail call i32 @atoi(i8* %19)
%21 = load i32, i32* @AF_INET
%22 = load i32, i32* @SOCK_STREAM
%23 = tail call i32 @socket(i32 %21, i32 %22, i32 0)
%24 = icmp slt i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %17
%26 = tail call i32 @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %27
27: ; preds = %25, %17
%28 = getelementptr inbounds i8*, i8** %1, i64 1
%29 = load i8*, i8** %28
%30 = tail call %struct.hostent* @gethostbyname(i8* %29)
%31 = icmp eq %struct.hostent* %30, null
br i1 %31, label %32, label %36
32: ; preds = %27
%33 = load i32, i32* @stderr
%34 = tail call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%35 = tail call i32 @exit(i32 0)
unreachable
36: ; preds = %27
%37 = call i32 @bzero(i8* %7, i32 12)
%38 = load i32, i32* @AF_INET
%39 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i32 %38, i32* %39
%40 = getelementptr inbounds %struct.hostent, %struct.hostent* %30, i64 0, i32 1
%41 = load i64, i64* %40
%42 = inttoptr i64 %41 to i8*
%43 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1, i32 0
%44 = bitcast i32* %43 to i8*
%45 = getelementptr inbounds %struct.hostent, %struct.hostent* %30, i64 0, i32 0
%46 = load i32, i32* %45
%47 = tail call i32 @htons(i32 %20)
%48 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
store i32 %47, i32* %48
%49 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%50 = call i64 @connect(i32 %23, %struct.sockaddr* %49, i32 12)
%51 = icmp slt i64 %50, 0
br i1 %51, label %52, label %54
52: ; preds = %36
%53 = call i32 @error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
br label %54
54: ; preds = %52, %36
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%56 = call i32 @bzero(i8* %10, i32 256)
%57 = load i32, i32* @stdin
%58 = call i32 @fgets(i8* %10, i32 255, i32 %57)
%59 = call i32 @gettimeofday(%struct.timeval* %4, i32* null)
%60 = call i32 @strlen(i8* %10)
%61 = call i32 @write(i32 %23, i8* %10, i32 %60)
%62 = icmp slt i32 %61, 0
br i1 %62, label %63, label %65
63: ; preds = %54
%64 = call i32 @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
br label %65
65: ; preds = %63, %54
%66 = call i32 @bzero(i8* %10, i32 256)
%67 = call i32 @read(i32 %23, i8* %10, i32 255)
%68 = icmp slt i32 %67, 0
br i1 %68, label %69, label %71
69: ; preds = %65
%70 = call i32 @error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
br label %71
71: ; preds = %69, %65
%72 = call i32 @puts(i8* %10)
%73 = call i32 @gettimeofday(%struct.timeval* %5, i32* null)
%74 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 0
%75 = load i32, i32* %74
%76 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 0
%77 = load i32, i32* %76
%78 = sub nsw i32 %75, %77
%79 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i32 %78)
%80 = call i32 @close(i32 %23)
ret i32 0
}