#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 TYPE_2__ {
  void *s_addr;
};
struct sockaddr_in {
  TYPE_1__ sin_addr;
  void *sin_port;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ sa;
typedef int /*<<< orphan*/ remote_addr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int 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);
int errno;
int /*<<< orphan*/ exit(int);
void *htons(int);
scalar_t__ listen(int, int);
int /*<<< orphan*/ overflow(char *);
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*/);
scalar_t__ strcmp(char *, char *);
int main() {
  int socketfd = socket(AF_INET, SOCK_STREAM, 0);
  if (socketfd == -1) {
    printf("errno=%d ", errno);
    exit(1);
  } else {
    printf("socket create successfully ");
  }
  struct sockaddr_in sa;
  bzero(&sa, sizeof(sa));
  sa.sin_family = AF_INET;
  sa.sin_port = htons(8080);
  sa.sin_addr.s_addr = htons(INADDR_ANY);
  if (bind(socketfd, (struct sockaddr *)&sa, sizeof(sa)) != 0) {
    printf("bind failed ");
    printf("errno=%d ", errno);
    exit(1);
  } else {
    printf("bind successfully ");
  }
  if (listen(socketfd, 10) != 0) {
    printf("listen error ");
    exit(1);
  } else {
    printf("listen successfully ");
  }
  int clientfd;
  struct sockaddr_in remote_addr;
  char buff[101];
  int len = sizeof(remote_addr);
  while ((clientfd = accept(socketfd, (struct sockaddr *)&remote_addr, &len)) >
         0) {
    int n;
    while ((n = recv(clientfd, buff, 100, 0)) > 0) {
      overflow(buff);
      printf("number of receive bytes = %d ", n);
      buff[n] = '\0';
      printf("%s\n", buff);
      if (send(clientfd, buff, n, 0) < 0) {
        perror("write");
        return 1;
      }
      if (strcmp(buff, "quit") == 0) {
        printf("server is closed");
        break;
      }
    }
    close(clientfd);
  }
  close(socketfd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2def(%rip),%rax
mov    (%rax),%edi
mov    0x2dce(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1100 <socket@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1239 <main+0x59>
mov    0x2da9(%rip),%rax
mov    (%rax),%esi
lea    0xdd8(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
lea    0xdca(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x18,%esi
call   10d0 <bzero@plt>
mov    0x2d8c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    $0x1f90,%edi
call   1040 <htons@plt>
mov    %rax,-0x18(%rbp)
mov    0x2d6a(%rip),%rax
mov    (%rax),%edi
call   1040 <htons@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x18,%edx
call   10b0 <bind@plt>
cmp    $0x0,%rax
je     12cb <main+0xeb>
lea    0xd83(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2d17(%rip),%rax
mov    (%rax),%esi
lea    0xd46(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
lea    0xd61(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x8(%rbp),%edi
mov    $0xa,%esi
call   10a0 <listen@plt>
cmp    $0x0,%rax
je     1308 <main+0x128>
lea    0xd4f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
lea    0xd45(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x18,-0xb4(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x40(%rbp),%rsi
lea    -0xb4(%rbp),%rdx
call   10e0 <accept@plt>
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
jle    1428 <main+0x248>
jmp    1344 <main+0x164>
mov    -0x24(%rbp),%edi
lea    -0xb0(%rbp),%rsi
mov    $0x64,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0xb8(%rbp)
cmp    $0x0,%eax
jle    141b <main+0x23b>
lea    -0xb0(%rbp),%rdi
call   1080 <overflow@plt>
mov    -0xb8(%rbp),%esi
lea    0xce7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movslq -0xb8(%rbp),%rax
movb   $0x0,-0xb0(%rbp,%rax,1)
lea    -0xb0(%rbp),%rsi
lea    0xce1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x24(%rbp),%edi
lea    -0xb0(%rbp),%rsi
mov    -0xb8(%rbp),%edx
xor    %ecx,%ecx
call   1050 <send@plt>
cmp    $0x0,%rax
jge    13e6 <main+0x206>
lea    0xcb6(%rip),%rdi
call   10c0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1437 <main+0x257>
lea    -0xb0(%rbp),%rdi
lea    0xc9d(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1416 <main+0x236>
lea    0xc8c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    141b <main+0x23b>
jmp    1344 <main+0x164>
mov    -0x24(%rbp),%edi
call   1070 <close@plt>
jmp    1320 <main+0x140>
mov    -0x8(%rbp),%edi
call   1070 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
mov    0x2de0(%rip),%rbp
mov    0x0(%rbp),%edi
mov    0x2dbe(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1110 <socket@plt>
cmp    $0xffffffff,%eax
je     13d3 <main+0x1e3>
mov    %eax,%r15d
lea    0xddc(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x18,%esi
call   10e0 <bzero@plt>
mov    0x0(%rbp),%eax
mov    %eax,0x20(%rsp)
mov    $0x1f90,%edi
call   1050 <htons@plt>
mov    %rax,0x18(%rsp)
mov    0x2d7c(%rip),%rax
mov    (%rax),%edi
call   1050 <htons@plt>
mov    %rax,0x10(%rsp)
mov    %r15d,%edi
mov    %rbx,%rsi
mov    $0x18,%edx
call   10c0 <bind@plt>
test   %rax,%rax
jne    13c5 <main+0x1d5>
lea    0xda3(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r15d,%edi
mov    $0xa,%esi
call   10b0 <listen@plt>
test   %rax,%rax
jne    13f4 <main+0x204>
lea    0xda0(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
movl   $0x18,0xc(%rsp)
lea    0x28(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    %r15d,%edi
call   10f0 <accept@plt>
test   %eax,%eax
jle    1396 <main+0x1a6>
mov    %eax,%ebx
lea    0x40(%rsp),%rbp
lea    0xd7e(%rip),%r12
lea    0xd9b(%rip),%r13
jmp    1330 <main+0x140>
lea    0xd97(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebx,%edi
call   1080 <close@plt>
mov    %r15d,%edi
lea    0x28(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   10f0 <accept@plt>
mov    %eax,%ebx
test   %eax,%eax
jle    1396 <main+0x1a6>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %rbp,%rsi
mov    $0x64,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
test   %eax,%eax
jle    1302 <main+0x112>
mov    %eax,%r14d
mov    %rbp,%rdi
call   1090 <overflow@plt>
mov    %r12,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r14d,%eax
movb   $0x0,0x40(%rsp,%rax,1)
mov    %rbp,%rdi
call   1040 <puts@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %r14d,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
test   %rax,%rax
js     13a2 <main+0x1b2>
mov    %rbp,%rdi
mov    %r13,%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
jne    1330 <main+0x140>
jmp    12f4 <main+0x104>
mov    %r15d,%edi
call   1080 <close@plt>
xor    %eax,%eax
jmp    13b3 <main+0x1c3>
lea    0xcde(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%eax
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc5a(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x2bee(%rip),%rax
mov    (%rax),%esi
lea    0xc1d(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
lea    0xc4b(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%edi
call   1100 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.TYPE_2__, i8*, i32 }
%struct.TYPE_2__ = type { i8* }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [10 x i8] c"errno=%d \00"
@errno = global i32 0
@.str.1 = [28 x i8] c"socket create successfully \00"
@INADDR_ANY = global i32 0
@.str.2 = [13 x i8] c"bind failed \00"
@.str.3 = [19 x i8] c"bind successfully \00"
@.str.4 = [14 x i8] c"listen error \00"
@.str.5 = [21 x i8] c"listen successfully \00"
@.str.6 = [30 x i8] c"number of receive bytes = %d \00"
@.str.7 = [4 x i8] c"%s\0A\00"
@.str.8 = [6 x i8] c"write\00"
@.str.9 = [5 x i8] c"quit\00"
@.str.10 = [17 x i8] c"server is closed\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.sockaddr_in
%4 = alloca i32
%5 = alloca %struct.sockaddr_in
%6 = alloca [101 x i8]
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
%9 = load i32, i32* @AF_INET
%10 = load i32, i32* @SOCK_STREAM
%11 = call i32 @socket(i32 %9, i32 %10, i32 0)
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %18
14: ; preds = %0
%15 = load i32, i32* @errno
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %0
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
br label %20
20: ; preds = %18
%21 = call i32 @bzero(%struct.sockaddr_in* %3, i32 24)
%22 = load i32, i32* @AF_INET
%23 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 2
store i32 %22, i32* %23
%24 = call i8* @htons(i32 8080)
%25 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 1
store i8* %24, i8** %25
%26 = load i32, i32* @INADDR_ANY
%27 = call i8* @htons(i32 %26)
%28 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 0
%29 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %28, i32 0, i32 0
store i8* %27, i8** %29
%30 = load i32, i32* %2
%31 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%32 = call i64 @bind(i32 %30, %struct.sockaddr* %31, i32 24)
%33 = icmp ne i64 %32, 0
br i1 %33, label %34, label %39
34: ; preds = %20
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%36 = load i32, i32* @errno
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %36)
%38 = call i32 @exit(i32 1)
unreachable
39: ; preds = %20
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
br label %41
41: ; preds = %39
%42 = load i32, i32* %2
%43 = call i64 @listen(i32 %42, i32 10)
%44 = icmp ne i64 %43, 0
br i1 %44, label %45, label %48
45: ; preds = %41
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
%47 = call i32 @exit(i32 1)
unreachable
48: ; preds = %41
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
br label %50
50: ; preds = %48
store i32 24, i32* %7
br label %51
51: ; preds = %86, %50
%52 = load i32, i32* %2
%53 = bitcast %struct.sockaddr_in* %5 to %struct.sockaddr*
%54 = call i32 @accept(i32 %52, %struct.sockaddr* %53, i32* %7)
store i32 %54, i32* %4
%55 = icmp sgt i32 %54, 0
br i1 %55, label %56, label %89
56: ; preds = %51
br label %57
57: ; preds = %85, %56
%58 = load i32, i32* %4
%59 = getelementptr inbounds [101 x i8], [101 x i8]* %6, i64 0, i64 0
%60 = call i32 @recv(i32 %58, i8* %59, i32 100, i32 0)
store i32 %60, i32* %8
%61 = icmp sgt i32 %60, 0
br i1 %61, label %62, label %86
62: ; preds = %57
%63 = getelementptr inbounds [101 x i8], [101 x i8]* %6, i64 0, i64 0
%64 = call i32 @overflow(i8* %63)
%65 = load i32, i32* %8
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i32 %65)
%67 = load i32, i32* %8
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [101 x i8], [101 x i8]* %6, i64 0, i64 %68
store i8 0, i8* %69
%70 = getelementptr inbounds [101 x i8], [101 x i8]* %6, i64 0, i64 0
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %70)
%72 = load i32, i32* %4
%73 = getelementptr inbounds [101 x i8], [101 x i8]* %6, i64 0, i64 0
%74 = load i32, i32* %8
%75 = call i64 @send(i32 %72, i8* %73, i32 %74, i32 0)
%76 = icmp slt i64 %75, 0
br i1 %76, label %77, label %79
77: ; preds = %62
%78 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
store i32 1, i32* %1
br label %92
79: ; preds = %62
%80 = getelementptr inbounds [101 x i8], [101 x i8]* %6, i64 0, i64 0
%81 = call i64 @strcmp(i8* %80, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%82 = icmp eq i64 %81, 0
br i1 %82, label %83, label %85
83: ; preds = %79
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0))
br label %86
85: ; preds = %79
br label %57
86: ; preds = %83, %57
%87 = load i32, i32* %4
%88 = call i32 @close(i32 %87)
br label %51
89: ; preds = %51
%90 = load i32, i32* %2
%91 = call i32 @close(i32 %90)
store i32 0, i32* %1
br label %92
92: ; preds = %89, %77
%93 = load i32, i32* %1
ret i32 %93
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.TYPE_2__, i8*, i32 }
%struct.TYPE_2__ = type { i8* }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [10 x i8] c"errno=%d \00"
@errno = global i32 0
@.str.1 = [28 x i8] c"socket create successfully \00"
@INADDR_ANY = global i32 0
@.str.2 = [13 x i8] c"bind failed \00"
@.str.3 = [19 x i8] c"bind successfully \00"
@.str.4 = [14 x i8] c"listen error \00"
@.str.5 = [21 x i8] c"listen successfully \00"
@.str.6 = [30 x i8] c"number of receive bytes = %d \00"
@.str.8 = [6 x i8] c"write\00"
@.str.9 = [5 x i8] c"quit\00"
@.str.10 = [17 x i8] c"server is closed\00"
define i32 @main() {
%1 = alloca %struct.sockaddr_in
%2 = alloca %struct.sockaddr_in
%3 = alloca [101 x i8]
%4 = alloca i32
%5 = load i32, i32* @AF_INET
%6 = load i32, i32* @SOCK_STREAM
%7 = tail call i32 @socket(i32 %5, i32 %6, i32 0)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %13
9: ; preds = %0
%10 = load i32, i32* @errno
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %0
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%15 = bitcast %struct.sockaddr_in* %1 to i8*
%16 = call i32 @bzero(%struct.sockaddr_in* %1, i32 24)
%17 = load i32, i32* @AF_INET
%18 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 2
store i32 %17, i32* %18
%19 = tail call i8* @htons(i32 8080)
%20 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 1
store i8* %19, i8** %20
%21 = load i32, i32* @INADDR_ANY
%22 = tail call i8* @htons(i32 %21)
%23 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 0, i32 0
store i8* %22, i8** %23
%24 = bitcast %struct.sockaddr_in* %1 to %struct.sockaddr*
%25 = call i64 @bind(i32 %7, %struct.sockaddr* %24, i32 24)
%26 = icmp eq i64 %25, 0
br i1 %26, label %32, label %27
27: ; preds = %13
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%29 = load i32, i32* @errno
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %29)
%31 = call i32 @exit(i32 1)
unreachable
32: ; preds = %13
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%34 = call i64 @listen(i32 %7, i32 10)
%35 = icmp eq i64 %34, 0
br i1 %35, label %39, label %36
36: ; preds = %32
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
%38 = call i32 @exit(i32 1)
unreachable
39: ; preds = %32
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
%41 = bitcast %struct.sockaddr_in* %2 to i8*
%42 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 0
%43 = bitcast i32* %4 to i8*
store i32 24, i32* %4
%44 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%45 = call i32 @accept(i32 %7, %struct.sockaddr* %44, i32* %4)
%46 = icmp sgt i32 %45, 0
br i1 %46, label %47, label %71
47: ; preds = %39, %67
%48 = phi i32 [ %69, %67 ], [ %45, %39 ]
br label %49
49: ; preds = %47, %62
%50 = call i32 @recv(i32 %48, i8* %42, i32 100, i32 0)
%51 = icmp sgt i32 %50, 0
br i1 %51, label %52, label %67
52: ; preds = %49
%53 = call i32 @overflow(i8* %42)
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i32 %50)
%55 = zext i32 %50 to i64
%56 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 %55
store i8 0, i8* %56
%57 = call i32 @puts(i8* %42)
%58 = call i64 @send(i32 %48, i8* %42, i32 %50, i32 0)
%59 = icmp slt i64 %58, 0
br i1 %59, label %60, label %62
60: ; preds = %52
%61 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
br label %73
62: ; preds = %52
%63 = call i64 @strcmp(i8* %42, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%64 = icmp eq i64 %63, 0
br i1 %64, label %65, label %49
65: ; preds = %62
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0))
br label %67
67: ; preds = %49, %65
%68 = call i32 @close(i32 %48)
%69 = call i32 @accept(i32 %7, %struct.sockaddr* %44, i32* %4)
%70 = icmp sgt i32 %69, 0
br i1 %70, label %47, label %71
71: ; preds = %67, %39
%72 = call i32 @close(i32 %7)
br label %73
73: ; preds = %60, %71
%74 = phi i32 [ 0, %71 ], [ 1, %60 ]
ret i32 %74
}