#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 {
  int /*<<< orphan*/ sin_family;
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_port;
};
struct sockaddr {
  int dummy;
};
struct hostent {
  char *h_name;
};
typedef int /*<<< orphan*/ servaddr;
typedef int /*<<< orphan*/ buff;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ SOCK_STREAM;
int accept(int, struct sockaddr *, int *);
scalar_t__ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ bzero(struct sockaddr_in *, int);
int /*<<< orphan*/ close(int);
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
struct hostent *gethostbyaddr(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int /*<<< orphan*/ htons(int);
char *inet_ntoa(TYPE_1__);
scalar_t__ listen(int, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
scalar_t__ write(int, char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int listenfd;
  int connfd;
  struct sockaddr_in servaddr;
  struct sockaddr_in cliaddr;
  struct hostent *hostptr;
  int lenstruct;
  char buff[4096];
  time_t ticks;
  listenfd = socket(AF_INET, SOCK_STREAM, 0);
  if (listenfd < 0) {
    perror("socket error");
    return 1;
  }
  bzero(&servaddr, sizeof(servaddr));
  servaddr.sin_family = AF_INET;
  servaddr.sin_port = htons(60000);
  servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
  lenstruct = sizeof(servaddr);
  if ((bind(listenfd, (struct sockaddr *)&servaddr, lenstruct)) < 0) {
    perror("bind error");
    return 1;
  }
  if (listen(listenfd, 10) < 0) {
    perror("listen error");
    return 1;
  }
  for (;;) {
    connfd = accept(listenfd, (struct sockaddr *)&cliaddr, &lenstruct);
    if (connfd < 0) {
      perror("accept error");
      return 1;
    }
    fprintf(stderr, "Addr of connected client: %s\n",
            inet_ntoa(cliaddr.sin_addr));
    hostptr = gethostbyaddr((char *)&cliaddr.sin_addr, sizeof(cliaddr.sin_addr),
                            cliaddr.sin_family);
    if (!hostptr) {
      perror("gethostbyaddr error");
      return 1;
    }
    fprintf(stderr, "The client name is %s\n", hostptr->h_name);
    ticks = time(NULL);
    snprintf(buff, sizeof(buff), "%.24s\r\n", ctime(&ticks));
    if (write(connfd, buff, strlen(buff)) < 0) {
      fprintf(stderr, "write error\n");
      return 1;
    }
    close(connfd);
  }
  close(listenfd);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1070,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2db8(%rip),%rax
mov    (%rax),%edi
mov    0x2d8f(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1267 <main+0x57>
lea    0xdaa(%rip),%rdi
call   10f0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    147d <main+0x26d>
lea    -0x28(%rbp),%rdi
mov    $0xc,%esi
call   1100 <bzero@plt>
mov    0x2d6c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    $0xea60,%edi
call   1070 <htons@plt>
mov    %eax,-0x20(%rbp)
mov    0x2d4b(%rip),%rax
mov    (%rax),%edi
call   1090 <htonl@plt>
mov    %eax,-0x24(%rbp)
movl   $0xc,-0x44(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x28(%rbp),%rsi
mov    -0x44(%rbp),%edx
call   10e0 <bind@plt>
cmp    $0x0,%rax
jge    12d7 <main+0xc7>
lea    0xd47(%rip),%rdi
call   10f0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    147d <main+0x26d>
mov    -0x14(%rbp),%edi
mov    $0xa,%esi
call   10d0 <listen@plt>
cmp    $0x0,%rax
jge    1306 <main+0xf6>
lea    0xd23(%rip),%rdi
call   10f0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    147d <main+0x26d>
jmp    130b <main+0xfb>
mov    -0x14(%rbp),%edi
lea    -0x38(%rbp),%rsi
lea    -0x44(%rbp),%rdx
call   1110 <accept@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1340 <main+0x130>
lea    0xcf6(%rip),%rdi
call   10f0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    147d <main+0x26d>
mov    0x2c89(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1058(%rbp)
mov    -0x34(%rbp),%edi
call   1040 <inet_ntoa@plt>
mov    -0x1058(%rbp),%edi
mov    %rax,%rdx
lea    0xccb(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
lea    -0x38(%rbp),%rdi
add    $0x4,%rdi
mov    -0x38(%rbp),%edx
mov    $0x4,%esi
call   1120 <gethostbyaddr@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    13aa <main+0x19a>
lea    0xcb7(%rip),%rdi
call   10f0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    147d <main+0x26d>
mov    0x2c1f(%rip),%rax
mov    (%rax),%edi
mov    -0x40(%rbp),%rax
mov    (%rax),%rdx
lea    0xca3(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10c0 <time@plt>
mov    %eax,-0x1054(%rbp)
lea    -0x1050(%rbp),%rax
mov    %rax,-0x1070(%rbp)
lea    -0x1054(%rbp),%rdi
call   1050 <ctime@plt>
mov    -0x1070(%rbp),%rdi
mov    %rax,%rcx
mov    $0x1000,%esi
lea    0xc74(%rip),%rdx
call   1080 <snprintf@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x1064(%rbp)
lea    -0x1050(%rbp),%rax
mov    %rax,-0x1060(%rbp)
lea    -0x1050(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x1064(%rbp),%edi
mov    -0x1060(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
cmp    $0x0,%rax
jge    1470 <main+0x260>
mov    0x2b7c(%rip),%rax
mov    (%rax),%edi
lea    0xc26(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    147d <main+0x26d>
mov    -0x18(%rbp),%edi
call   10a0 <close@plt>
jmp    130b <main+0xfb>
mov    -0x4(%rbp),%eax
add    $0x1070,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1038,%rsp
mov    0x2dc0(%rip),%rbp
mov    0x0(%rbp),%edi
mov    0x2d96(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1130 <socket@plt>
test   %eax,%eax
js     13b1 <main+0x1a1>
mov    %eax,%ebx
lea    0x20(%rsp),%r14
mov    %r14,%rdi
mov    $0xc,%esi
call   1100 <bzero@plt>
mov    0x0(%rbp),%eax
mov    %eax,0x20(%rsp)
mov    $0xea60,%edi
call   1070 <htons@plt>
mov    %eax,0x28(%rsp)
mov    0x2d6d(%rip),%rax
mov    (%rax),%edi
call   1090 <htonl@plt>
mov    %eax,0x24(%rsp)
movl   $0xc,0x8(%rsp)
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0xc,%edx
call   10e0 <bind@plt>
test   %rax,%rax
js     13ba <main+0x1aa>
mov    %ebx,%edi
mov    $0xa,%esi
call   10d0 <listen@plt>
test   %rax,%rax
js     13c3 <main+0x1b3>
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %ebx,%edi
call   1110 <accept@plt>
test   %eax,%eax
js     1395 <main+0x185>
mov    %eax,%ebp
mov    0x2cfb(%rip),%r14
lea    0x30(%rsp),%r15
lea    0x8(%rsp),%r13
nop
mov    (%r14),%r12d
mov    0x14(%rsp),%edi
call   1040 <inet_ntoa@plt>
mov    %r12d,%edi
lea    0xd3c(%rip),%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    0x10(%rsp),%edx
lea    0x14(%rsp),%rdi
mov    $0x4,%esi
call   1120 <gethostbyaddr@plt>
test   %rax,%rax
je     13cc <main+0x1bc>
mov    (%r14),%edi
mov    (%rax),%rdx
lea    0xd3b(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
xor    %edi,%edi
call   10c0 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1050 <ctime@plt>
mov    %r15,%rdi
mov    $0x1000,%esi
lea    0xd27(%rip),%rdx
mov    %rax,%rcx
call   1080 <snprintf@plt>
mov    %r15,%rdi
call   1060 <strlen@plt>
mov    %ebp,%edi
mov    %r15,%rsi
mov    %eax,%edx
call   1030 <write@plt>
test   %rax,%rax
js     139e <main+0x18e>
mov    %ebp,%edi
call   10a0 <close@plt>
mov    %ebx,%edi
lea    0x10(%rsp),%rsi
mov    %r13,%rdx
call   1110 <accept@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    12e0 <main+0xd0>
lea    0xc89(%rip),%rdi
jmp    13d3 <main+0x1c3>
mov    (%r14),%edi
lea    0xcdb(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
jmp    13d8 <main+0x1c8>
lea    0xc48(%rip),%rdi
jmp    13d3 <main+0x1c3>
lea    0xc4c(%rip),%rdi
jmp    13d3 <main+0x1c3>
lea    0xc4e(%rip),%rdi
jmp    13d3 <main+0x1c3>
lea    0xc7d(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x1,%eax
add    $0x1038,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.hostent = type { i8* }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [13 x i8] c"socket error\00"
@INADDR_ANY = global i32 0
@.str.1 = [11 x i8] c"bind error\00"
@.str.2 = [13 x i8] c"listen error\00"
@.str.3 = [13 x i8] c"accept error\00"
@stderr = global i32 0
@.str.4 = [30 x i8] c"Addr of connected client: %s\0A\00"
@.str.5 = [20 x i8] c"gethostbyaddr error\00"
@.str.6 = [23 x i8] c"The client name is %s\0A\00"
@.str.7 = [8 x i8] c"%.24s\0D\0A\00"
@.str.8 = [13 x i8] c"write error\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 %struct.sockaddr_in
%10 = alloca %struct.hostent*
%11 = alloca i32
%12 = alloca [4096 x i8]
%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 = load i32, i32* %6
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %2
%20 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %91
21: ; preds = %2
%22 = call i32 @bzero(%struct.sockaddr_in* %8, i32 12)
%23 = load i32, i32* @AF_INET
%24 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 0
store i32 %23, i32* %24
%25 = call i32 @htons(i32 60000)
%26 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 2
store i32 %25, i32* %26
%27 = load i32, i32* @INADDR_ANY
%28 = call i32 @htonl(i32 %27)
%29 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 1
%30 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %29, i32 0, i32 0
store i32 %28, i32* %30
store i32 12, i32* %11
%31 = load i32, i32* %6
%32 = bitcast %struct.sockaddr_in* %8 to %struct.sockaddr*
%33 = load i32, i32* %11
%34 = call i64 @bind(i32 %31, %struct.sockaddr* %32, i32 %33)
%35 = icmp slt i64 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %21
%37 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %91
38: ; preds = %21
%39 = load i32, i32* %6
%40 = call i64 @listen(i32 %39, i32 10)
%41 = icmp slt i64 %40, 0
br i1 %41, label %42, label %44
42: ; preds = %38
%43 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
br label %91
44: ; preds = %38
br label %45
45: ; preds = %88, %44
%46 = load i32, i32* %6
%47 = bitcast %struct.sockaddr_in* %9 to %struct.sockaddr*
%48 = call i32 @accept(i32 %46, %struct.sockaddr* %47, i32* %11)
store i32 %48, i32* %7
%49 = load i32, i32* %7
%50 = icmp slt i32 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %45
%52 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %91
53: ; preds = %45
%54 = load i32, i32* @stderr
%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 = load i32, i32* %56
%58 = call i8* @inet_ntoa(i32 %57)
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %54, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* %58)
%60 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 1
%61 = bitcast %struct.TYPE_2__* %60 to i8*
%62 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 0
%63 = load i32, i32* %62
%64 = call %struct.hostent* @gethostbyaddr(i8* %61, i32 4, i32 %63)
store %struct.hostent* %64, %struct.hostent** %10
%65 = load %struct.hostent*, %struct.hostent** %10
%66 = icmp ne %struct.hostent* %65, null
br i1 %66, label %69, label %67
67: ; preds = %53
%68 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %3
br label %91
69: ; preds = %53
%70 = load i32, i32* @stderr
%71 = load %struct.hostent*, %struct.hostent** %10
%72 = getelementptr inbounds %struct.hostent, %struct.hostent* %71, i32 0, i32 0
%73 = load i8*, i8** %72
%74 = call i32 (i32, i8*, ...) @fprintf(i32 %70, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i8* %73)
%75 = call i32 @time(i32* null)
store i32 %75, i32* %13
%76 = getelementptr inbounds [4096 x i8], [4096 x i8]* %12, i64 0, i64 0
%77 = call i8* @ctime(i32* %13)
%78 = call i32 @snprintf(i8* %76, i32 4096, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8* %77)
%79 = load i32, i32* %7
%80 = getelementptr inbounds [4096 x i8], [4096 x i8]* %12, i64 0, i64 0
%81 = getelementptr inbounds [4096 x i8], [4096 x i8]* %12, i64 0, i64 0
%82 = call i32 @strlen(i8* %81)
%83 = call i64 @write(i32 %79, i8* %80, i32 %82)
%84 = icmp slt i64 %83, 0
br i1 %84, label %85, label %88
85: ; preds = %69
%86 = load i32, i32* @stderr
%87 = call i32 (i32, i8*, ...) @fprintf(i32 %86, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
store i32 1, i32* %3
br label %91
88: ; preds = %69
%89 = load i32, i32* %7
%90 = call i32 @close(i32 %89)
br label %45
91: ; preds = %85, %67, %51, %42, %36, %19
%92 = load i32, i32* %3
ret i32 %92
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
%struct.hostent = type { i8* }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [13 x i8] c"socket error\00"
@INADDR_ANY = global i32 0
@.str.1 = [11 x i8] c"bind error\00"
@.str.2 = [13 x i8] c"listen error\00"
@.str.3 = [13 x i8] c"accept error\00"
@stderr = global i32 0
@.str.4 = [30 x i8] c"Addr of connected client: %s\0A\00"
@.str.5 = [20 x i8] c"gethostbyaddr error\00"
@.str.6 = [23 x i8] c"The client name is %s\0A\00"
@.str.7 = [8 x i8] c"%.24s\0D\0A\00"
@.str.8 = [13 x i8] c"write error\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca %struct.sockaddr_in
%5 = alloca i32
%6 = alloca [4096 x i8]
%7 = alloca i32
%8 = bitcast %struct.sockaddr_in* %3 to i8*
%9 = bitcast %struct.sockaddr_in* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%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 %19
17: ; preds = %2
%18 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %78
19: ; preds = %2
%20 = call i32 @bzero(%struct.sockaddr_in* %3, i32 12)
%21 = load i32, i32* @AF_INET
%22 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
store i32 %21, i32* %22
%23 = tail call i32 @htons(i32 60000)
%24 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i32 %23, i32* %24
%25 = load i32, i32* @INADDR_ANY
%26 = tail call i32 @htonl(i32 %25)
%27 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1, i32 0
store i32 %26, i32* %27
store i32 12, i32* %5
%28 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%29 = call i64 @bind(i32 %15, %struct.sockaddr* %28, i32 12)
%30 = icmp slt i64 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %19
%32 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %78
33: ; preds = %19
%34 = call i64 @listen(i32 %15, i32 10)
%35 = icmp slt i64 %34, 0
br i1 %35, label %45, label %36
36: ; preds = %33
%37 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%38 = call i32 @accept(i32 %15, %struct.sockaddr* %37, i32* %5)
%39 = icmp slt i32 %38, 0
br i1 %39, label %47, label %40
40: ; preds = %36
%41 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 1
%42 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %41, i64 0, i32 0
%43 = bitcast %struct.TYPE_2__* %41 to i8*
%44 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 0
br label %49
45: ; preds = %33
%46 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %78
47: ; preds = %74, %36
%48 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
br label %78
49: ; preds = %40, %74
%50 = phi i32 [ %38, %40 ], [ %76, %74 ]
%51 = load i32, i32* @stderr
%52 = load i32, i32* %42
%53 = call i8* @inet_ntoa(i32 %52)
%54 = call i32 (i32, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* %53)
%55 = load i32, i32* %44
%56 = call %struct.hostent* @gethostbyaddr(i8* %43, i32 4, i32 %55)
%57 = icmp eq %struct.hostent* %56, null
br i1 %57, label %58, label %60
58: ; preds = %49
%59 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
br label %78
60: ; preds = %49
%61 = load i32, i32* @stderr
%62 = getelementptr inbounds %struct.hostent, %struct.hostent* %56, i64 0, i32 0
%63 = load i8*, i8** %62
%64 = call i32 (i32, i8*, ...) @fprintf(i32 %61, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i8* %63)
%65 = call i32 @time(i32* null)
store i32 %65, i32* %7
%66 = call i8* @ctime(i32* %7)
%67 = call i32 @snprintf(i8* %11, i32 4096, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8* %66)
%68 = call i32 @strlen(i8* %11)
%69 = call i64 @write(i32 %50, i8* %11, i32 %68)
%70 = icmp slt i64 %69, 0
br i1 %70, label %71, label %74
71: ; preds = %60
%72 = load i32, i32* @stderr
%73 = call i32 (i32, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
br label %78
74: ; preds = %60
%75 = call i32 @close(i32 %50)
%76 = call i32 @accept(i32 %15, %struct.sockaddr* %37, i32* %5)
%77 = icmp slt i32 %76, 0
br i1 %77, label %47, label %49
78: ; preds = %71, %58, %47, %45, %31, %17
ret i32 1
}