#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 tv_sec;
  unsigned long tv_usec;
};
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*/ servaddr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int atoi(char *);
int /*<<< orphan*/ close(int);
scalar_t__ connect(int, struct sockaddr *, int);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ inet_addr(char *);
int /*<<< orphan*/ memset(struct sockaddr_in *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int recv(int, char *, int, int /*<<< orphan*/);
scalar_t__ send(int, char *, int, int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int /*<<< orphan*/ usage(char *);
int main(int argc, char **argv) {
  char server[16] = {'\0'};
  int port;
  int data_size;
  struct timeval tv_start;
  struct timeval tv_end;
  int sockfd;
  struct sockaddr_in servaddr;
  int len;
  char buf[65536];
  int write_count = 0;
  int read_count = 0;
  unsigned long fct;
  if (argc != 4) {
    usage(argv[0]);
    return 0;
  }
  strncpy(server, argv[1], 15);
  port = atoi(argv[2]);
  data_size = atoi(argv[3]);
  memset(&servaddr, 0, sizeof(servaddr));
  servaddr.sin_family = AF_INET;
  servaddr.sin_addr.s_addr = inet_addr(server);
  servaddr.sin_port = htons(port);
  if ((sockfd = socket(PF_INET, SOCK_STREAM, 0)) < 0) {
    perror("Socket error\n");
    return 0;
  }
  if (connect(sockfd, (struct sockaddr *)&servaddr, sizeof(struct sockaddr)) <
      0) {
    printf("Can not connect to %s\n", server);
    return 0;
  }
  gettimeofday(&tv_start, NULL);
  write_count = strlen(argv[3]);
  while (write_count > 0)
    write_count -= send(sockfd, argv[3], write_count, 0);
  while (1) {
    len = recv(sockfd, buf, 65536, 0);
    read_count += len;
    if (len <= 0)
      break;
  }
  gettimeofday(&tv_end, NULL);
  close(sockfd);
  fct = (tv_end.tv_sec - tv_start.tv_sec) * 1000000 + tv_end.tv_usec -
        tv_start.tv_usec;
  if (data_size * 1024 == read_count)
    printf("From %s: %d KB %lu us\n", server, data_size, fct);
  else
    printf("We receive %d (of %d) bytes.\n", read_count, data_size * 1024);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10070,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   10a0 <memset@plt>
movl   $0x0,-0x10064(%rbp)
movl   $0x0,-0x10068(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     124f <main+0x5f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10d0 <usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    1452 <main+0x262>
lea    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    $0xf,%edx
call   1040 <strncpy@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10f0 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10f0 <atoi@plt>
mov    %eax,-0x28(%rbp)
lea    -0x58(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   10a0 <memset@plt>
mov    0x2d4c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x50(%rbp)
lea    -0x20(%rbp),%rdi
call   10c0 <inet_addr@plt>
mov    %eax,-0x54(%rbp)
mov    -0x24(%rbp),%edi
call   1060 <htons@plt>
mov    %eax,-0x58(%rbp)
mov    0x2d11(%rip),%rax
mov    (%rax),%edi
mov    0x2d10(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1110 <socket@plt>
mov    %eax,-0x4c(%rbp)
cmp    $0x0,%eax
jge    12f5 <main+0x105>
lea    0xd1c(%rip),%rdi
call   10e0 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    1452 <main+0x262>
mov    -0x4c(%rbp),%edi
lea    -0x58(%rbp),%rsi
mov    $0x4,%edx
call   1100 <connect@plt>
cmp    $0x0,%rax
jge    132e <main+0x13e>
lea    -0x20(%rbp),%rsi
lea    0xcf3(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1452 <main+0x262>
lea    -0x38(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1090 <gettimeofday@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x10064(%rbp)
cmpl   $0x0,-0x10064(%rbp)
jle    138b <main+0x19b>
mov    -0x4c(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
mov    -0x10064(%rbp),%edx
xor    %ecx,%ecx
call   1070 <send@plt>
mov    %rax,%rcx
movslq -0x10064(%rbp),%rax
sub    %rcx,%rax
mov    %eax,-0x10064(%rbp)
jmp    134e <main+0x15e>
jmp    1390 <main+0x1a0>
mov    -0x4c(%rbp),%edi
lea    -0x10060(%rbp),%rsi
mov    $0x10000,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
add    -0x10068(%rbp),%eax
mov    %eax,-0x10068(%rbp)
cmpl   $0x0,-0x5c(%rbp)
jg     13c7 <main+0x1d7>
jmp    13cc <main+0x1dc>
jmp    1390 <main+0x1a0>
lea    -0x48(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1090 <gettimeofday@plt>
mov    -0x4c(%rbp),%edi
call   10b0 <close@plt>
mov    -0x48(%rbp),%eax
sub    -0x38(%rbp),%eax
imul   $0xf4240,%eax,%eax
cltq
add    -0x40(%rbp),%rax
sub    -0x30(%rbp),%rax
mov    %rax,-0x10070(%rbp)
mov    -0x28(%rbp),%eax
shl    $0xa,%eax
cmp    -0x10068(%rbp),%eax
jne    1431 <main+0x241>
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
mov    -0x10070(%rbp),%rcx
lea    0xc00(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    144b <main+0x25b>
mov    -0x10068(%rbp),%esi
mov    -0x28(%rbp),%edx
shl    $0xa,%edx
lea    0xbf8(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10070,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10040,%rsp
mov    %rsi,%r15
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
cmp    $0x4,%edi
jne    135f <main+0x16f>
mov    0x8(%r15),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xf,%edx
call   1040 <strncpy@plt>
mov    0x10(%r15),%rdi
call   10f0 <atoi@plt>
mov    %eax,%ebp
mov    0x18(%r15),%rdi
call   10f0 <atoi@plt>
mov    %eax,%r14d
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   10a0 <memset@plt>
mov    0x2d92(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x8(%rsp)
mov    %rbx,%rdi
call   10c0 <inet_addr@plt>
mov    %eax,0x4(%rsp)
mov    %ebp,%edi
call   1060 <htons@plt>
mov    %eax,(%rsp)
mov    0x2d57(%rip),%rax
mov    (%rax),%edi
mov    0x2d56(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1110 <socket@plt>
test   %eax,%eax
js     13a0 <main+0x1b0>
mov    %eax,%r12d
mov    %rsp,%rsi
mov    %eax,%edi
mov    $0x4,%edx
call   1100 <connect@plt>
test   %rax,%rax
js     1369 <main+0x179>
xor    %ebx,%ebx
lea    0x30(%rsp),%rdi
xor    %esi,%esi
call   1090 <gettimeofday@plt>
mov    0x18(%r15),%rdi
call   1050 <strlen@plt>
test   %eax,%eax
jle    12e6 <main+0xf6>
mov    %eax,%ebp
nopl   0x0(%rax,%rax,1)
mov    0x18(%r15),%rsi
mov    %r12d,%edi
mov    %ebp,%edx
xor    %ecx,%ecx
call   1070 <send@plt>
sub    %eax,%ebp
test   %ebp,%ebp
jg     12d0 <main+0xe0>
lea    0x40(%rsp),%rbp
nopl   0x0(%rax,%rax,1)
mov    %r12d,%edi
mov    %rbp,%rsi
mov    $0x10000,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
add    %eax,%ebx
test   %eax,%eax
jg     12f0 <main+0x100>
lea    0x20(%rsp),%rdi
xor    %esi,%esi
call   1090 <gettimeofday@plt>
mov    %r12d,%edi
call   10b0 <close@plt>
mov    %r14d,%edx
shl    $0xa,%edx
cmp    %ebx,%edx
jne    137e <main+0x18e>
mov    0x28(%rsp),%rcx
movslq 0x20(%rsp),%rax
movslq 0x30(%rsp),%rdx
sub    %rdx,%rax
imul   $0xf4240,%rax,%rax
sub    0x38(%rsp),%rcx
add    %rax,%rcx
lea    0xcd7(%rip),%rdi
lea    0x10(%rsp),%rsi
mov    %r14d,%edx
xor    %eax,%eax
call   1080 <printf@plt>
jmp    138e <main+0x19e>
mov    (%r15),%rdi
call   10d0 <usage@plt>
jmp    138e <main+0x19e>
lea    0xc9e(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1080 <printf@plt>
jmp    138e <main+0x19e>
lea    0xcb7(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1080 <printf@plt>
xor    %eax,%eax
add    $0x10040,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc59(%rip),%rdi
call   10e0 <perror@plt>
jmp    138e <main+0x19e>

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [14 x i8] c"Socket error\0A\00"
@.str.1 = [23 x i8] c"Can not connect to %s\0A\00"
@.str.2 = [23 x i8] c"From %s: %d KB %lu us\0A\00"
@.str.3 = [30 x i8] c"We receive %d (of %d) bytes.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [16 x i8]
%7 = alloca i32
%8 = alloca i32
%9 = alloca %struct.timeval
%10 = alloca %struct.timeval
%11 = alloca i32
%12 = alloca %struct.sockaddr_in
%13 = alloca i32
%14 = alloca [65536 x i8]
%15 = alloca i32
%16 = alloca i32
%17 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%18 = bitcast [16 x i8]* %6 to i8*
store i32 0, i32* %15
store i32 0, i32* %16
%19 = load i32, i32* %4
%20 = icmp ne i32 %19, 4
br i1 %20, label %21, label %26
21: ; preds = %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
%25 = call i32 @usage(i8* %24)
store i32 0, i32* %3
br label %128
26: ; preds = %2
%27 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = call i32 @strncpy(i8* %27, i8* %30, i32 15)
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 2
%34 = load i8*, i8** %33
%35 = call i32 @atoi(i8* %34)
store i32 %35, i32* %7
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 3
%38 = load i8*, i8** %37
%39 = call i32 @atoi(i8* %38)
store i32 %39, i32* %8
%40 = call i32 @memset(%struct.sockaddr_in* %12, i32 0, i32 12)
%41 = load i32, i32* @AF_INET
%42 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %12, i32 0, i32 2
store i32 %41, i32* %42
%43 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%44 = call i32 @inet_addr(i8* %43)
%45 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %12, i32 0, i32 1
%46 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %45, i32 0, i32 0
store i32 %44, i32* %46
%47 = load i32, i32* %7
%48 = call i32 @htons(i32 %47)
%49 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %12, i32 0, i32 0
store i32 %48, i32* %49
%50 = load i32, i32* @PF_INET
%51 = load i32, i32* @SOCK_STREAM
%52 = call i32 @socket(i32 %50, i32 %51, i32 0)
store i32 %52, i32* %11
%53 = icmp slt i32 %52, 0
br i1 %53, label %54, label %56
54: ; preds = %26
%55 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %128
56: ; preds = %26
%57 = load i32, i32* %11
%58 = bitcast %struct.sockaddr_in* %12 to %struct.sockaddr*
%59 = call i64 @connect(i32 %57, %struct.sockaddr* %58, i32 4)
%60 = icmp slt i64 %59, 0
br i1 %60, label %61, label %64
61: ; preds = %56
%62 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %62)
store i32 0, i32* %3
br label %128
64: ; preds = %56
%65 = call i32 @gettimeofday(%struct.timeval* %9, i32* null)
%66 = load i8**, i8*** %5
%67 = getelementptr inbounds i8*, i8** %66, i64 3
%68 = load i8*, i8** %67
%69 = call i32 @strlen(i8* %68)
store i32 %69, i32* %15
br label %70
70: ; preds = %73, %64
%71 = load i32, i32* %15
%72 = icmp sgt i32 %71, 0
br i1 %72, label %73, label %84
73: ; preds = %70
%74 = load i32, i32* %11
%75 = load i8**, i8*** %5
%76 = getelementptr inbounds i8*, i8** %75, i64 3
%77 = load i8*, i8** %76
%78 = load i32, i32* %15
%79 = call i64 @send(i32 %74, i8* %77, i32 %78, i32 0)
%80 = load i32, i32* %15
%81 = sext i32 %80 to i64
%82 = sub nsw i64 %81, %79
%83 = trunc i64 %82 to i32
store i32 %83, i32* %15
br label %70
84: ; preds = %70
br label %85
85: ; preds = %84, %95
%86 = load i32, i32* %11
%87 = getelementptr inbounds [65536 x i8], [65536 x i8]* %14, i64 0, i64 0
%88 = call i32 @recv(i32 %86, i8* %87, i32 65536, i32 0)
store i32 %88, i32* %13
%89 = load i32, i32* %13
%90 = load i32, i32* %16
%91 = add nsw i32 %90, %89
store i32 %91, i32* %16
%92 = load i32, i32* %13
%93 = icmp sle i32 %92, 0
br i1 %93, label %94, label %95
94: ; preds = %85
br label %96
95: ; preds = %85
br label %85
96: ; preds = %94
%97 = call i32 @gettimeofday(%struct.timeval* %10, i32* null)
%98 = load i32, i32* %11
%99 = call i32 @close(i32 %98)
%100 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i32 0, i32 0
%101 = load i32, i32* %100
%102 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 0
%103 = load i32, i32* %102
%104 = sub nsw i32 %101, %103
%105 = mul nsw i32 %104, 1000000
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i32 0, i32 1
%108 = load i64, i64* %107
%109 = add i64 %106, %108
%110 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 1
%111 = load i64, i64* %110
%112 = sub i64 %109, %111
store i64 %112, i64* %17
%113 = load i32, i32* %8
%114 = mul nsw i32 %113, 1024
%115 = load i32, i32* %16
%116 = icmp eq i32 %114, %115
br i1 %116, label %117, label %122
117: ; preds = %96
%118 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%119 = load i32, i32* %8
%120 = load i64, i64* %17
%121 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %118, i32 %119, i64 %120)
br label %127
122: ; preds = %96
%123 = load i32, i32* %16
%124 = load i32, i32* %8
%125 = mul nsw i32 %124, 1024
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i32 %123, i32 %125)
br label %127
127: ; preds = %122, %117
store i32 0, i32* %3
br label %128
128: ; preds = %127, %61, %54, %21
%129 = load i32, i32* %3
ret i32 %129
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [14 x i8] c"Socket error\0A\00"
@.str.1 = [23 x i8] c"Can not connect to %s\0A\00"
@.str.2 = [23 x i8] c"From %s: %d KB %lu us\0A\00"
@.str.3 = [30 x i8] c"We receive %d (of %d) bytes.\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [16 x i8]
%4 = alloca %struct.timeval
%5 = alloca %struct.timeval
%6 = alloca %struct.sockaddr_in
%7 = alloca [65536 x i8]
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%9 = bitcast %struct.timeval* %4 to i8*
%10 = bitcast %struct.timeval* %5 to i8*
%11 = bitcast %struct.sockaddr_in* %6 to i8*
%12 = getelementptr inbounds [65536 x i8], [65536 x i8]* %7, i64 0, i64 0
%13 = icmp eq i32 %0, 4
br i1 %13, label %17, label %14
14: ; preds = %2
%15 = load i8*, i8** %1
%16 = tail call i32 @usage(i8* %15)
br label %86
17: ; preds = %2
%18 = getelementptr inbounds i8*, i8** %1, i64 1
%19 = load i8*, i8** %18
%20 = call i32 @strncpy(i8* %8, i8* %19, i32 15)
%21 = getelementptr inbounds i8*, i8** %1, i64 2
%22 = load i8*, i8** %21
%23 = call i32 @atoi(i8* %22)
%24 = getelementptr inbounds i8*, i8** %1, i64 3
%25 = load i8*, i8** %24
%26 = call i32 @atoi(i8* %25)
%27 = call i32 @memset(%struct.sockaddr_in* %6, i32 0, i32 12)
%28 = load i32, i32* @AF_INET
%29 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i64 0, i32 2
store i32 %28, i32* %29
%30 = call i32 @inet_addr(i8* %8)
%31 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i64 0, i32 1, i32 0
store i32 %30, i32* %31
%32 = call i32 @htons(i32 %23)
%33 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i64 0, i32 0
store i32 %32, i32* %33
%34 = load i32, i32* @PF_INET
%35 = load i32, i32* @SOCK_STREAM
%36 = call i32 @socket(i32 %34, i32 %35, i32 0)
%37 = icmp slt i32 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %17
%39 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %86
40: ; preds = %17
%41 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%42 = call i64 @connect(i32 %36, %struct.sockaddr* %41, i32 4)
%43 = icmp slt i64 %42, 0
br i1 %43, label %44, label %46
44: ; preds = %40
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %8)
br label %86
46: ; preds = %40
%47 = call i32 @gettimeofday(%struct.timeval* %4, i32* null)
%48 = load i8*, i8** %24
%49 = call i32 @strlen(i8* %48)
%50 = icmp sgt i32 %49, 0
br i1 %50, label %51, label %58
51: ; preds = %46, %51
%52 = phi i32 [ %56, %51 ], [ %49, %46 ]
%53 = load i8*, i8** %24
%54 = call i64 @send(i32 %36, i8* %53, i32 %52, i32 0)
%55 = trunc i64 %54 to i32
%56 = sub i32 %52, %55
%57 = icmp sgt i32 %56, 0
br i1 %57, label %51, label %58
58: ; preds = %51, %46
br label %59
59: ; preds = %58, %59
%60 = phi i32 [ %62, %59 ], [ 0, %58 ]
%61 = call i32 @recv(i32 %36, i8* %12, i32 65536, i32 0)
%62 = add nsw i32 %61, %60
%63 = icmp slt i32 %61, 1
br i1 %63, label %64, label %59
64: ; preds = %59
%65 = call i32 @gettimeofday(%struct.timeval* %5, i32* null)
%66 = call i32 @close(i32 %36)
%67 = shl nsw i32 %26, 10
%68 = icmp eq i32 %67, %62
br i1 %68, label %69, label %84
69: ; preds = %64
%70 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 1
%71 = load i64, i64* %70
%72 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 0
%73 = load i32, i32* %72
%74 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 0
%75 = load i32, i32* %74
%76 = sub nsw i32 %73, %75
%77 = mul nsw i32 %76, 1000000
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 1
%80 = load i64, i64* %79
%81 = sub i64 %71, %80
%82 = add i64 %81, %78
%83 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %8, i32 %26, i64 %82)
br label %86
84: ; preds = %64
%85 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i32 %62, i32 %67)
br label %86
86: ; preds = %69, %84, %44, %38, %14
ret i32 0
}