#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 socklen_t;
typedef int /*<<< orphan*/ servaddr;
typedef int /*<<< orphan*/ cliaddr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int accept(int, struct sockaddr *, int *);
char *asctime(int /*<<< orphan*/);
scalar_t__ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ inet_addr(char *);
scalar_t__ listen(int, int);
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(struct sockaddr_in *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int read(int, char *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int /*<<< orphan*/ write(int, char *, int);
int main(int argc, char **argv) {
  int listenfd, connfd, n;
  socklen_t clilen;
  char buff[4096];
  struct sockaddr_in cliaddr, servaddr;
  time_t ts;
  if ((listenfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
    printf("server socket creation failed\n");
    exit(0);
  }
  printf("Server Socket created successfully listenfd=%d\n", listenfd);
  memset(&servaddr, 0, sizeof(servaddr));
  servaddr.sin_family = AF_INET;
  servaddr.sin_port = htons(4000);
  servaddr.sin_addr.s_addr = inet_addr("0.0.0.0");
  if (bind(listenfd, (struct sockaddr *)&servaddr, sizeof(servaddr)) < 0) {
    printf("Error : Server bind to port %d failed \n", 4000);
    exit(0);
  }
  printf("Server bound to port %d successfully\n", 4000);
  if (listen(listenfd, 5) < 0) {
    printf("ERROR : server is not listening\n");
    exit(0);
  }
  printf("Server is listening ..\n client requests are accepted\n\n");
  for (;;) {
    clilen = sizeof(cliaddr);
    if ((connfd = accept(listenfd, (struct sockaddr *)&cliaddr, &clilen)) < 0) {
      printf("Error : Server didnt accept the client request \n");
      exit(0);
    }
    printf("Server accepted the accept() request from client\n");
    while ((n = read(connfd, buff, 4096)) != 0) {
      ts = time(NULL);
      printf("%s client message : %s \n\n", asctime(localtime(&ts)), buff);
      write(connfd, buff, 4096);
    }
    if (n == 0)
      printf("Error :Client Disconnected\n");
    else if (n == -1)
      printf("Error :Server receive operation failed\n");
    close(connfd);
  }
  close(listenfd);
  printf("Server stopped listening\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1050,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2dd8(%rip),%rax
mov    (%rax),%edi
mov    0x2dbf(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1110 <socket@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    1243 <main+0x53>
lea    0xdcb(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
xor    %edi,%edi
call   1100 <exit@plt>
mov    -0x14(%rbp),%esi
lea    0xdd2(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x1040(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1080 <memset@plt>
mov    0x2d7a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1038(%rbp)
mov    $0xfa0,%edi
call   1060 <htons@plt>
mov    %eax,-0x103c(%rbp)
lea    0xdc2(%rip),%rdi
call   10b0 <inet_addr@plt>
mov    %eax,-0x1040(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x1040(%rbp),%rsi
mov    $0xc,%edx
call   10e0 <bind@plt>
cmp    $0x0,%rax
jge    12d0 <main+0xe0>
lea    0xd9a(%rip),%rdi
mov    $0xfa0,%esi
mov    $0x0,%al
call   1070 <printf@plt>
xor    %edi,%edi
call   1100 <exit@plt>
lea    0xda8(%rip),%rdi
mov    $0xfa0,%esi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x14(%rbp),%edi
mov    $0x5,%esi
call   10d0 <listen@plt>
cmp    $0x0,%rax
jge    130f <main+0x11f>
lea    0xda4(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
xor    %edi,%edi
call   1100 <exit@plt>
lea    0xdb0(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0xc,-0x20(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x1030(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   10f0 <accept@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jge    1358 <main+0x168>
lea    0xdb3(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
xor    %edi,%edi
call   1100 <exit@plt>
lea    0xdcf(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x18(%rbp),%edi
lea    -0x1020(%rbp),%rsi
mov    $0x1000,%edx
call   10a0 <read@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     13d9 <main+0x1e9>
xor    %eax,%eax
mov    %eax,%edi
call   10c0 <time@plt>
mov    %eax,-0x1044(%rbp)
lea    -0x1044(%rbp),%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1050 <asctime@plt>
mov    %rax,%rsi
lea    -0x1020(%rbp),%rdx
lea    0xda7(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x18(%rbp),%edi
lea    -0x1020(%rbp),%rsi
mov    $0x1000,%edx
call   1040 <write@plt>
jmp    1366 <main+0x176>
cmpl   $0x0,-0x1c(%rbp)
jne    13f6 <main+0x206>
lea    0xd90(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1413 <main+0x223>
cmpl   $0xffffffff,-0x1c(%rbp)
jne    140e <main+0x21e>
lea    0xd8f(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1413 <main+0x223>
mov    -0x18(%rbp),%edi
call   1090 <close@plt>
jmp    131d <main+0x12d>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1038,%rsp
mov    0x2dd0(%rip),%rbx
mov    (%rbx),%edi
mov    0x2db7(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1120 <socket@plt>
test   %eax,%eax
jns    123a <main+0x3a>
lea    0xf3d(%rip),%rdi
jmp    130f <main+0x10f>
mov    %eax,%ebp
lea    0xdbd(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0x10(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1090 <memset@plt>
mov    (%rbx),%eax
mov    %eax,0x18(%rsp)
mov    $0xfa0,%edi
call   1070 <htons@plt>
mov    %eax,0x14(%rsp)
lea    0xdb5(%rip),%rdi
call   10c0 <inet_addr@plt>
mov    %eax,0x10(%rsp)
mov    %ebp,%edi
mov    %r14,%rsi
mov    $0xc,%edx
call   10f0 <bind@plt>
test   %rax,%rax
jns    12b2 <main+0xb2>
lea    0xd99(%rip),%rdi
mov    $0xfa0,%esi
xor    %eax,%eax
call   1080 <printf@plt>
xor    %edi,%edi
call   1110 <exit@plt>
lea    0xda7(%rip),%rdi
mov    $0xfa0,%esi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %ebp,%edi
mov    $0x5,%esi
call   10e0 <listen@plt>
test   %rax,%rax
jns    12df <main+0xdf>
lea    0xe75(%rip),%rdi
jmp    130f <main+0x10f>
lea    0xdba(%rip),%rdi
call   1040 <puts@plt>
movl   $0xc,0x8(%rsp)
lea    0x20(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %ebp,%edi
call   1100 <accept@plt>
test   %eax,%eax
jns    131b <main+0x11b>
lea    0xe13(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1110 <exit@plt>
mov    %eax,%r14d
lea    0x30(%rsp),%rbx
lea    0x8(%rsp),%r13
lea    0xc(%rsp),%r15
lea    0xd52(%rip),%r12
jmp    1372 <main+0x172>
cs nopw 0x0(%rax,%rax,1)
lea    0xdc0(%rip),%rdi
call   1040 <puts@plt>
mov    %r14d,%edi
call   10a0 <close@plt>
movl   $0xc,0x8(%rsp)
mov    %ebp,%edi
lea    0x20(%rsp),%rsi
mov    %r13,%rdx
call   1100 <accept@plt>
mov    %eax,%r14d
test   %eax,%eax
js     1308 <main+0x108>
lea    0xd5d(%rip),%rdi
call   1040 <puts@plt>
xchg   %ax,%ax
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0x1000,%edx
call   10b0 <read@plt>
test   %eax,%eax
je     1340 <main+0x140>
xor    %edi,%edi
call   10d0 <time@plt>
mov    %eax,0xc(%rsp)
mov    %r15,%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1060 <asctime@plt>
mov    %r12,%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0x1000,%edx
call   1050 <write@plt>
jmp    1380 <main+0x180>

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [31 x i8] c"server socket creation failed\0A\00"
@.str.1 = [48 x i8] c"Server Socket created successfully listenfd=%d\0A\00"
@.str.2 = [8 x i8] c"0.0.0.0\00"
@.str.3 = [40 x i8] c"Error : Server bind to port %d failed \0A\00"
@.str.4 = [38 x i8] c"Server bound to port %d successfully\0A\00"
@.str.5 = [33 x i8] c"ERROR : server is not listening\0A\00"
@.str.6 = [55 x i8] c"Server is listening ..\0A client requests are accepted\0A\0A\00"
@.str.7 = [49 x i8] c"Error : Server didnt accept the client request \0A\00"
@.str.8 = [50 x i8] c"Server accepted the accept() request from client\0A\00"
@.str.9 = [26 x i8] c"%s client message : %s \0A\0A\00"
@.str.10 = [28 x i8] c"Error :Client Disconnected\0A\00"
@.str.11 = [40 x i8] c"Error :Server receive operation failed\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 i32
%10 = alloca [4096 x i8]
%11 = alloca %struct.sockaddr_in
%12 = alloca %struct.sockaddr_in
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = load i32, i32* @AF_INET
%15 = load i32, i32* @SOCK_STREAM
%16 = call i32 @socket(i32 %14, i32 %15, i32 0)
store i32 %16, i32* %6
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %2
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%20 = call i32 @exit(i32 0)
unreachable
21: ; preds = %2
%22 = load i32, i32* %6
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i32 %22)
%24 = call i32 @memset(%struct.sockaddr_in* %12, i32 0, i32 12)
%25 = load i32, i32* @AF_INET
%26 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %12, i32 0, i32 2
store i32 %25, i32* %26
%27 = call i32 @htons(i32 4000)
%28 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %12, i32 0, i32 1
store i32 %27, i32* %28
%29 = call i32 @inet_addr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%30 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %12, i32 0, i32 0
%31 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %30, i32 0, i32 0
store i32 %29, i32* %31
%32 = load i32, i32* %6
%33 = bitcast %struct.sockaddr_in* %12 to %struct.sockaddr*
%34 = call i64 @bind(i32 %32, %struct.sockaddr* %33, i32 12)
%35 = icmp slt i64 %34, 0
br i1 %35, label %36, label %39
36: ; preds = %21
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i32 4000)
%38 = call i32 @exit(i32 0)
unreachable
39: ; preds = %21
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i32 4000)
%41 = load i32, i32* %6
%42 = call i64 @listen(i32 %41, i32 5)
%43 = icmp slt i64 %42, 0
br i1 %43, label %44, label %47
44: ; preds = %39
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
%46 = call i32 @exit(i32 0)
unreachable
47: ; preds = %39
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.6, i64 0, i64 0))
br label %49
49: ; preds = %84, %47
store i32 12, i32* %9
%50 = load i32, i32* %6
%51 = bitcast %struct.sockaddr_in* %11 to %struct.sockaddr*
%52 = call i32 @accept(i32 %50, %struct.sockaddr* %51, i32* %9)
store i32 %52, i32* %7
%53 = icmp slt i32 %52, 0
br i1 %53, label %54, label %57
54: ; preds = %49
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.7, i64 0, i64 0))
%56 = call i32 @exit(i32 0)
unreachable
57: ; preds = %49
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.8, i64 0, i64 0))
br label %59
59: ; preds = %64, %57
%60 = load i32, i32* %7
%61 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 0
%62 = call i32 @read(i32 %60, i8* %61, i32 4096)
store i32 %62, i32* %8
%63 = icmp ne i32 %62, 0
br i1 %63, label %64, label %73
64: ; preds = %59
%65 = call i32 @time(i32* null)
store i32 %65, i32* %13
%66 = call i32 @localtime(i32* %13)
%67 = call i8* @asctime(i32 %66)
%68 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 0
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i8* %67, i8* %68)
%70 = load i32, i32* %7
%71 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 0
%72 = call i32 @write(i32 %70, i8* %71, i32 4096)
br label %59
73: ; preds = %59
%74 = load i32, i32* %8
%75 = icmp eq i32 %74, 0
br i1 %75, label %76, label %78
76: ; preds = %73
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0))
br label %84
78: ; preds = %73
%79 = load i32, i32* %8
%80 = icmp eq i32 %79, -1
br i1 %80, label %81, label %83
81: ; preds = %78
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.11, i64 0, i64 0))
br label %83
83: ; preds = %81, %78
br label %84
84: ; preds = %83, %76
%85 = load i32, i32* %7
%86 = call i32 @close(i32 %85)
br label %49
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [48 x i8] c"Server Socket created successfully listenfd=%d\0A\00"
@.str.2 = [8 x i8] c"0.0.0.0\00"
@.str.3 = [40 x i8] c"Error : Server bind to port %d failed \0A\00"
@.str.4 = [38 x i8] c"Server bound to port %d successfully\0A\00"
@.str.9 = [26 x i8] c"%s client message : %s \0A\0A\00"
@str = [54 x i8] c"Server is listening ..\0A client requests are accepted\0A\00"
@str.12 = [49 x i8] c"Server accepted the accept() request from client\00"
@str.13 = [27 x i8] c"Error :Client Disconnected\00"
@str.14 = [48 x i8] c"Error : Server didnt accept the client request \00"
@str.15 = [32 x i8] c"ERROR : server is not listening\00"
@str.16 = [30 x i8] c"server socket creation failed\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [4096 x i8]
%5 = alloca %struct.sockaddr_in
%6 = alloca %struct.sockaddr_in
%7 = alloca i32
%8 = bitcast i32* %3 to i8*
%9 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%10 = bitcast %struct.sockaddr_in* %5 to i8*
%11 = bitcast %struct.sockaddr_in* %6 to i8*
%12 = bitcast i32* %7 to i8*
%13 = load i32, i32* @AF_INET
%14 = load i32, i32* @SOCK_STREAM
%15 = tail call i32 @socket(i32 %13, i32 %14, i32 0)
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %2
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.16, i64 0, i64 0))
%19 = tail call i32 @exit(i32 0)
unreachable
20: ; preds = %2
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%22 = call i32 @memset(%struct.sockaddr_in* %6, i32 0, i32 12)
%23 = load i32, i32* @AF_INET
%24 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i64 0, i32 2
store i32 %23, i32* %24
%25 = call i32 @htons(i32 4000)
%26 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i64 0, i32 1
store i32 %25, i32* %26
%27 = call i32 @inet_addr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%28 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i64 0, i32 0, i32 0
store i32 %27, i32* %28
%29 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%30 = call i64 @bind(i32 %15, %struct.sockaddr* %29, i32 12)
%31 = icmp slt i64 %30, 0
br i1 %31, label %32, label %35
32: ; preds = %20
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i32 4000)
%34 = call i32 @exit(i32 0)
unreachable
35: ; preds = %20
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i32 4000)
%37 = call i64 @listen(i32 %15, i32 5)
%38 = icmp slt i64 %37, 0
br i1 %38, label %39, label %42
39: ; preds = %35
%40 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.15, i64 0, i64 0))
%41 = call i32 @exit(i32 0)
unreachable
42: ; preds = %35
%43 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
%44 = bitcast %struct.sockaddr_in* %5 to %struct.sockaddr*
store i32 12, i32* %3
%45 = call i32 @accept(i32 %15, %struct.sockaddr* %44, i32* %3)
%46 = icmp slt i32 %45, 0
br i1 %46, label %47, label %50
47: ; preds = %63, %42
%48 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.14, i64 0, i64 0))
%49 = call i32 @exit(i32 0)
unreachable
50: ; preds = %42, %63
%51 = phi i32 [ %66, %63 ], [ %45, %42 ]
%52 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.12, i64 0, i64 0))
%53 = call i32 @read(i32 %51, i8* %9, i32 4096)
%54 = icmp eq i32 %53, 0
br i1 %54, label %63, label %55
55: ; preds = %50, %55
%56 = call i32 @time(i32* null)
store i32 %56, i32* %7
%57 = call i32 @localtime(i32* %7)
%58 = call i8* @asctime(i32 %57)
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i8* %58, i8* %9)
%60 = call i32 @write(i32 %51, i8* %9, i32 4096)
%61 = call i32 @read(i32 %51, i8* %9, i32 4096)
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %55
63: ; preds = %55, %50
%64 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.13, i64 0, i64 0))
%65 = call i32 @close(i32 %51)
store i32 12, i32* %3
%66 = call i32 @accept(i32 %15, %struct.sockaddr* %44, i32* %3)
%67 = icmp slt i32 %66, 0
br i1 %67, label %47, label %50
}