#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*/ time_t;
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;
};
typedef int /*<<< orphan*/ servaddr;
typedef int /*<<< orphan*/ sendline;
typedef int /*<<< orphan*/ recvline;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
char *asctime(int /*<<< orphan*/);
int /*<<< orphan*/ close(int);
scalar_t__ connect(int, struct sockaddr *, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ inet_addr(char *);
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int read(int, char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int write(int, char *, int);
int main(int argc, char **argv) {
  int sockfd, n;
  struct sockaddr_in servaddr;
  char sendline[4096], recvline[4096];
  time_t ts;
  if (argc != 2) {
    printf("usage %s server-IP-addr\n", argv[0]);
    exit(0);
  }
  if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
    printf("Problem in creating the socket");
    exit(0);
  }
  printf("socket creation successful");
  servaddr.sin_family = AF_INET;
  servaddr.sin_port = htons(4000);
  servaddr.sin_addr.s_addr = inet_addr(argv[1]);
  if ((connect(sockfd, (struct sockaddr *)&servaddr, sizeof(servaddr))) < 0) {
    printf("Error : Server connect failed.\n");
    exit(0);
  }
  printf("client got connected to the server\n");
  printf("info Type 'exit' to end the session\n");
  while (1) {
    ts = time(NULL);
    printf("[%s Enter Message] : ", asctime(localtime(&ts)));
    scanf("%s", sendline);
    printf("%s\n", sendline);
    if (strcmp(sendline, "exit") == 0)
      break;
    if ((n = write(sockfd, sendline, sizeof(sendline))) < 0) {
      printf("n = %d Error : Client message sending to serverf failed\n", n);
      return 1;
    }
    printf("n= %d Info : Client Message a sent to server successfully\n", n);
    if ((n = read(sockfd, recvline, sizeof(recvline))) < 0) {
      printf("Error : server reply messsage didnt received\n");
      return 1;
    }
    ts = time(NULL);
    printf("[%s Server Message] : %s\n\n", asctime(localtime(&ts)), recvline);
  }
  close(sockfd);
  printf("client terminated the server session\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2040,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     121f <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xdef(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
xor    %edi,%edi
call   10e0 <exit@plt>
mov    0x2dc2(%rip),%rax
mov    (%rax),%edi
mov    0x2da9(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1100 <socket@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    1259 <main+0x79>
lea    0xdce(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
xor    %edi,%edi
call   10e0 <exit@plt>
lea    0xdd8(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    0x2d7a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    $0xfa0,%edi
call   1060 <htons@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10a0 <inet_addr@plt>
mov    %eax,-0x28(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x28(%rbp),%rsi
mov    $0xc,%edx
call   10f0 <connect@plt>
cmp    $0x0,%rax
jge    12c0 <main+0xe0>
lea    0xda1(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
xor    %edi,%edi
call   10e0 <exit@plt>
lea    0xdac(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xdc2(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10c0 <time@plt>
mov    %eax,-0x2034(%rbp)
lea    -0x2034(%rbp),%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1050 <asctime@plt>
mov    %rax,%rsi
lea    0xdb4(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x1030(%rbp),%rsi
lea    0xdb5(%rip),%rdi
call   10d0 <scanf@plt>
lea    -0x1030(%rbp),%rsi
lea    0xda5(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x1030(%rbp),%rdi
lea    0xd94(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%rax
jne    1359 <main+0x179>
jmp    1420 <main+0x240>
mov    -0x14(%rbp),%edi
lea    -0x1030(%rbp),%rsi
mov    $0x1000,%edx
call   1040 <write@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jge    1396 <main+0x1b6>
mov    -0x18(%rbp),%esi
lea    0xd5b(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    143d <main+0x25d>
mov    -0x18(%rbp),%esi
lea    0xd77(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x14(%rbp),%edi
lea    -0x2030(%rbp),%rsi
mov    $0x1000,%edx
call   1090 <read@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jge    13e1 <main+0x201>
lea    0xd84(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    143d <main+0x25d>
xor    %eax,%eax
mov    %eax,%edi
call   10c0 <time@plt>
mov    %eax,-0x2034(%rbp)
lea    -0x2034(%rbp),%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1050 <asctime@plt>
mov    %rax,%rsi
lea    -0x2030(%rbp),%rdx
lea    0xd6c(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    12dc <main+0xfc>
mov    -0x14(%rbp),%edi
call   1080 <close@plt>
lea    0xd6c(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2040,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2028,%rsp
mov    %rsi,%rbx
cmp    $0x2,%edi
jne    13c3 <main+0x1d3>
mov    0x2dd4(%rip),%r14
mov    (%r14),%edi
mov    0x2dba(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1110 <socket@plt>
test   %eax,%eax
js     13db <main+0x1eb>
mov    %eax,%ebp
lea    0xe00(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    (%r14),%eax
mov    %eax,0x18(%rsp)
mov    $0xfa0,%edi
call   1070 <htons@plt>
mov    %eax,0x14(%rsp)
mov    0x8(%rbx),%rdi
call   10b0 <inet_addr@plt>
mov    %eax,0x10(%rsp)
lea    0x10(%rsp),%rsi
mov    %ebp,%edi
mov    $0xc,%edx
call   1100 <connect@plt>
test   %rax,%rax
js     13f0 <main+0x200>
lea    0xe7e(%rip),%rdi
call   1040 <puts@plt>
lea    0xe95(%rip),%rdi
call   1040 <puts@plt>
lea    0xc(%rsp),%r14
lea    0xdca(%rip),%r12
lea    0x1020(%rsp),%rbx
lea    0xdbe(%rip),%r13
lea    0x20(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %edi,%edi
call   10d0 <time@plt>
mov    %eax,0xc(%rsp)
mov    %r14,%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1060 <asctime@plt>
lea    0xd72(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   10e0 <scanf@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   10c0 <strcmp@plt>
test   %rax,%rax
je     1377 <main+0x187>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x1000,%edx
call   1050 <write@plt>
test   %eax,%eax
js     138e <main+0x19e>
lea    0xd82(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %ebp,%edi
mov    %r15,%rsi
mov    $0x1000,%edx
call   10a0 <read@plt>
test   %eax,%eax
js     13a0 <main+0x1b0>
xor    %edi,%edi
call   10d0 <time@plt>
mov    %eax,0xc(%rsp)
mov    %r14,%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1060 <asctime@plt>
lea    0xd80(%rip),%rdi
mov    %rax,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1080 <printf@plt>
jmp    12c0 <main+0xd0>
mov    %ebp,%edi
call   1090 <close@plt>
lea    0xdef(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
jmp    13b1 <main+0x1c1>
lea    0xcdc(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1080 <printf@plt>
jmp    13ac <main+0x1bc>
lea    0xda0(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%eax
add    $0x2028,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%rbx),%rsi
lea    0xc33(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
xor    %edi,%edi
call   10f0 <exit@plt>
lea    0xc37(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
xor    %edi,%edi
call   10f0 <exit@plt>
lea    0xda2(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [25 x i8] c"usage %s server-IP-addr\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [31 x i8] c"Problem in creating the socket\00"
@.str.2 = [27 x i8] c"socket creation successful\00"
@.str.3 = [32 x i8] c"Error : Server connect failed.\0A\00"
@.str.4 = [36 x i8] c"client got connected to the server\0A\00"
@.str.5 = [37 x i8] c"info Type 'exit' to end the session\0A\00"
@.str.6 = [22 x i8] c"[%s Enter Message] : \00"
@.str.7 = [3 x i8] c"%s\00"
@.str.8 = [4 x i8] c"%s\0A\00"
@.str.9 = [5 x i8] c"exit\00"
@.str.10 = [57 x i8] c"n = %d Error : Client message sending to serverf failed\0A\00"
@.str.11 = [59 x i8] c"n= %d Info : Client Message a sent to server successfully\0A\00"
@.str.12 = [46 x i8] c"Error : server reply messsage didnt received\0A\00"
@.str.13 = [27 x i8] c"[%s Server Message] : %s\0A\0A\00"
@.str.14 = [38 x i8] c"client terminated the server session\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 %struct.sockaddr_in
%9 = alloca [4096 x i8]
%10 = alloca [4096 x i8]
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 2
br i1 %13, label %14, label %20
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 0
%17 = load i8*, i8** %16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = call i32 @exit(i32 0)
unreachable
20: ; preds = %2
%21 = load i32, i32* @AF_INET
%22 = load i32, i32* @SOCK_STREAM
%23 = call i32 @socket(i32 %21, i32 %22, i32 0)
store i32 %23, i32* %6
%24 = icmp slt i32 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %20
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%27 = call i32 @exit(i32 0)
unreachable
28: ; preds = %20
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%30 = load i32, i32* @AF_INET
%31 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 2
store i32 %30, i32* %31
%32 = call i32 @htons(i32 4000)
%33 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 1
store i32 %32, i32* %33
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 1
%36 = load i8*, i8** %35
%37 = call i32 @inet_addr(i8* %36)
%38 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 0
%39 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %38, i32 0, i32 0
store i32 %37, i32* %39
%40 = load i32, i32* %6
%41 = bitcast %struct.sockaddr_in* %8 to %struct.sockaddr*
%42 = call i64 @connect(i32 %40, %struct.sockaddr* %41, i32 12)
%43 = icmp slt i64 %42, 0
br i1 %43, label %44, label %47
44: ; preds = %28
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%46 = call i32 @exit(i32 0)
unreachable
47: ; preds = %28
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0))
br label %50
50: ; preds = %47, %80
%51 = call i32 @time(i32* null)
store i32 %51, i32* %11
%52 = call i32 @localtime(i32* %11)
%53 = call i8* @asctime(i32 %52)
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i8* %53)
%55 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%56 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %55)
%57 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* %57)
%59 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%60 = call i64 @strcmp(i8* %59, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%61 = icmp eq i64 %60, 0
br i1 %61, label %62, label %63
62: ; preds = %50
br label %86
63: ; preds = %50
%64 = load i32, i32* %6
%65 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%66 = call i32 @write(i32 %64, i8* %65, i32 4096)
store i32 %66, i32* %7
%67 = icmp slt i32 %66, 0
br i1 %67, label %68, label %71
68: ; preds = %63
%69 = load i32, i32* %7
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.10, i64 0, i64 0), i32 %69)
store i32 1, i32* %3
br label %90
71: ; preds = %63
%72 = load i32, i32* %7
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.11, i64 0, i64 0), i32 %72)
%74 = load i32, i32* %6
%75 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 0
%76 = call i32 @read(i32 %74, i8* %75, i32 4096)
store i32 %76, i32* %7
%77 = icmp slt i32 %76, 0
br i1 %77, label %78, label %80
78: ; preds = %71
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.12, i64 0, i64 0))
store i32 1, i32* %3
br label %90
80: ; preds = %71
%81 = call i32 @time(i32* null)
store i32 %81, i32* %11
%82 = call i32 @localtime(i32* %11)
%83 = call i8* @asctime(i32 %82)
%84 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 0
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i64 0, i64 0), i8* %83, i8* %84)
br label %50
86: ; preds = %62
%87 = load i32, i32* %6
%88 = call i32 @close(i32 %87)
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.14, i64 0, i64 0))
store i32 0, i32* %3
br label %90
90: ; preds = %86, %78, %68
%91 = load i32, i32* %3
ret i32 %91
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [25 x i8] c"usage %s server-IP-addr\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [31 x i8] c"Problem in creating the socket\00"
@.str.2 = [27 x i8] c"socket creation successful\00"
@.str.6 = [22 x i8] c"[%s Enter Message] : \00"
@.str.7 = [3 x i8] c"%s\00"
@.str.9 = [5 x i8] c"exit\00"
@.str.10 = [57 x i8] c"n = %d Error : Client message sending to serverf failed\0A\00"
@.str.11 = [59 x i8] c"n= %d Info : Client Message a sent to server successfully\0A\00"
@.str.13 = [27 x i8] c"[%s Server Message] : %s\0A\0A\00"
@str = [35 x i8] c"client got connected to the server\00"
@str.15 = [36 x i8] c"info Type 'exit' to end the session\00"
@str.16 = [45 x i8] c"Error : server reply messsage didnt received\00"
@str.17 = [37 x i8] c"client terminated the server session\00"
@str.18 = [31 x i8] c"Error : Server connect failed.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca [4096 x i8]
%5 = alloca [4096 x i8]
%6 = alloca i32
%7 = bitcast %struct.sockaddr_in* %3 to i8*
%8 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%9 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%10 = bitcast i32* %6 to i8*
%11 = icmp eq i32 %0, 2
br i1 %11, label %16, label %12
12: ; preds = %2
%13 = load i8*, i8** %1
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = tail call i32 @exit(i32 0)
unreachable
16: ; preds = %2
%17 = load i32, i32* @AF_INET
%18 = load i32, i32* @SOCK_STREAM
%19 = tail call i32 @socket(i32 %17, i32 %18, i32 0)
%20 = icmp slt i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %16
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%23 = tail call i32 @exit(i32 0)
unreachable
24: ; preds = %16
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%26 = load i32, i32* @AF_INET
%27 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i32 %26, i32* %27
%28 = tail call i32 @htons(i32 4000)
%29 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1
store i32 %28, i32* %29
%30 = getelementptr inbounds i8*, i8** %1, i64 1
%31 = load i8*, i8** %30
%32 = tail call i32 @inet_addr(i8* %31)
%33 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0, i32 0
store i32 %32, i32* %33
%34 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%35 = call i64 @connect(i32 %19, %struct.sockaddr* %34, i32 12)
%36 = icmp slt i64 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %24
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.18, i64 0, i64 0))
%39 = call i32 @exit(i32 0)
unreachable
40: ; preds = %24
%41 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%42 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.15, i64 0, i64 0))
br label %43
43: ; preds = %63, %40
%44 = call i32 @time(i32* null)
store i32 %44, i32* %6
%45 = call i32 @localtime(i32* %6)
%46 = call i8* @asctime(i32 %45)
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i8* %46)
%48 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %8)
%49 = call i32 @puts(i8* %8)
%50 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%51 = icmp eq i64 %50, 0
br i1 %51, label %68, label %52
52: ; preds = %43
%53 = call i32 @write(i32 %19, i8* %8, i32 4096)
%54 = icmp slt i32 %53, 0
br i1 %54, label %55, label %57
55: ; preds = %52
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.10, i64 0, i64 0), i32 %53)
br label %71
57: ; preds = %52
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.11, i64 0, i64 0), i32 %53)
%59 = call i32 @read(i32 %19, i8* %9, i32 4096)
%60 = icmp slt i32 %59, 0
br i1 %60, label %61, label %63
61: ; preds = %57
%62 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.16, i64 0, i64 0))
br label %71
63: ; preds = %57
%64 = call i32 @time(i32* null)
store i32 %64, i32* %6
%65 = call i32 @localtime(i32* %6)
%66 = call i8* @asctime(i32 %65)
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i64 0, i64 0), i8* %66, i8* %9)
br label %43
68: ; preds = %43
%69 = call i32 @close(i32 %19)
%70 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.17, i64 0, i64 0))
br label %71
71: ; preds = %68, %61, %55
%72 = phi i32 [ 0, %68 ], [ 1, %55 ], [ 1, %61 ]
ret i32 %72
}