#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__ {
  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*/ socklen_t;
typedef int /*<<< orphan*/ server;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ SOCK_STREAM;
int accept(int, struct sockaddr *, int /*<<< orphan*/ *);
scalar_t__ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ listen(int, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sleep(int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int socket_desc, new_socket, c;
  struct sockaddr_in server, client;
  char message[100];
  socket_desc = socket(AF_INET, SOCK_STREAM, 0);
  if (socket_desc == -1) {
    printf("Could not create socket");
  }
  server.sin_family = AF_INET;
  server.sin_addr.s_addr = INADDR_ANY;
  server.sin_port = htons(8888);
  if (bind(socket_desc, (struct sockaddr *)&server, sizeof(server)) < 0) {
    puts("bind failed");
    return 1;
  }
  puts("bind done");
  listen(socket_desc, 1024);
  puts("Waiting for incoming connections...");
  c = sizeof(struct sockaddr_in);
  int i = 0;
  while (1) {
    new_socket =
        accept(socket_desc, (struct sockaddr *)&client, (socklen_t *)&c);
    if (new_socket < 0) {
      perror("accept failed");
      return 1;
    }
    puts("Connection accepted");
    i++;
    sprintf(message,
            "Hello Client , I have received your connection %d times\n", i);
    printf("src (%s) \n");
    printf("processing numer (%d) request\n", i);
    sleep(5);
    write(new_socket, message, strlen(message));
    sleep(1);
    close(new_socket);
    if (i == 5) {
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2df8(%rip),%rax
mov    (%rax),%edi
mov    0x2dd7(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10f0 <socket@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    121d <main+0x4d>
lea    0xdea(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    0x2dc4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    0x2db0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    $0x22b8,%edi
call   1060 <htons@plt>
mov    %eax,-0x28(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x28(%rbp),%rsi
mov    $0xc,%edx
call   10a0 <bind@plt>
cmp    $0x0,%rax
jge    1275 <main+0xa5>
lea    0xdb4(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    13a7 <main+0x1d7>
lea    0xda8(%rip),%rdi
call   1030 <puts@plt>
mov    -0x14(%rbp),%edi
mov    $0x400,%esi
call   1090 <listen@plt>
lea    0xd99(%rip),%rdi
call   1030 <puts@plt>
movl   $0xc,-0x1c(%rbp)
movl   $0x0,-0xa4(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x38(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   10c0 <accept@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    12e0 <main+0x110>
lea    0xd83(%rip),%rdi
call   10b0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    13a7 <main+0x1d7>
lea    0xd79(%rip),%rdi
call   1030 <puts@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0xa4(%rbp),%edx
lea    0xd65(%rip),%rsi
call   10d0 <sprintf@plt>
lea    0xd92(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0xa4(%rbp),%esi
lea    0xd89(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x5,%edi
call   10e0 <sleep@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0xb4(%rbp)
lea    -0xa0(%rbp),%rax
mov    %rax,-0xb0(%rbp)
lea    -0xa0(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0xb4(%rbp),%edi
mov    -0xb0(%rbp),%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10e0 <sleep@plt>
mov    -0x18(%rbp),%edi
call   1080 <close@plt>
cmpl   $0x5,-0xa4(%rbp)
jne    139b <main+0x1cb>
jmp    13a0 <main+0x1d0>
jmp    12ab <main+0xdb>
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   %rbx
sub    $0x98,%rsp
mov    0x2e04(%rip),%rbx
mov    (%rbx),%edi
mov    0x2de3(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10f0 <socket@plt>
mov    %eax,%r15d
cmp    $0xffffffff,%eax
jne    120c <main+0x3c>
lea    0xdfb(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    (%rbx),%eax
mov    %eax,0x28(%rsp)
mov    0x2dc7(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x24(%rsp)
mov    $0x22b8,%edi
call   1060 <htons@plt>
mov    %eax,0x20(%rsp)
lea    0x20(%rsp),%rsi
mov    %r15d,%edi
mov    $0xc,%edx
call   10a0 <bind@plt>
test   %rax,%rax
js     154f <main+0x37f>
lea    0xdd5(%rip),%rdi
call   1030 <puts@plt>
mov    %r15d,%edi
mov    $0x400,%esi
call   1090 <listen@plt>
lea    0xdc6(%rip),%rdi
call   1030 <puts@plt>
movl   $0xc,0xc(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    %r15d,%edi
call   10c0 <accept@plt>
test   %eax,%eax
js     155d <main+0x38d>
mov    %eax,%ebp
lea    0xdc8(%rip),%rdi
call   1030 <puts@plt>
lea    0xdd0(%rip),%rsi
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   10d0 <sprintf@plt>
lea    0xdf0(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xded(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x5,%edi
call   10e0 <sleep@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10e0 <sleep@plt>
mov    %ebp,%edi
call   1080 <close@plt>
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    %r15d,%edi
call   10c0 <accept@plt>
test   %eax,%eax
js     155d <main+0x38d>
mov    %eax,%ebp
lea    0xd37(%rip),%rdi
call   1030 <puts@plt>
lea    0xd3f(%rip),%rsi
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x2,%edx
call   10d0 <sprintf@plt>
lea    0xd5f(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xd5c(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x5,%edi
call   10e0 <sleep@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10e0 <sleep@plt>
mov    %ebp,%edi
call   1080 <close@plt>
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    %r15d,%edi
call   10c0 <accept@plt>
test   %eax,%eax
js     155d <main+0x38d>
mov    %eax,%ebp
lea    0xca6(%rip),%rdi
call   1030 <puts@plt>
lea    0xcae(%rip),%rsi
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x3,%edx
call   10d0 <sprintf@plt>
lea    0xcce(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xccb(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x5,%edi
call   10e0 <sleep@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10e0 <sleep@plt>
mov    %ebp,%edi
call   1080 <close@plt>
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    %r15d,%edi
call   10c0 <accept@plt>
test   %eax,%eax
js     155d <main+0x38d>
mov    %eax,%ebp
lea    0xc15(%rip),%rdi
call   1030 <puts@plt>
lea    0xc1d(%rip),%rsi
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x4,%edx
call   10d0 <sprintf@plt>
lea    0xc3d(%rip),%rdi
xor    %r14d,%r14d
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xc37(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x5,%edi
call   10e0 <sleep@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10e0 <sleep@plt>
mov    %ebp,%edi
call   1080 <close@plt>
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    %r15d,%edi
call   10c0 <accept@plt>
test   %eax,%eax
js     155d <main+0x38d>
mov    %eax,%ebx
lea    0xb81(%rip),%rdi
call   1030 <puts@plt>
lea    0xb89(%rip),%rsi
lea    0x30(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x5,%edx
call   10d0 <sprintf@plt>
lea    0xba9(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xba6(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x5,%edi
call   10e0 <sleep@plt>
mov    %rbp,%rdi
call   1050 <strlen@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   10e0 <sleep@plt>
mov    %ebx,%edi
call   1080 <close@plt>
jmp    156f <main+0x39f>
lea    0xac2(%rip),%rdi
call   1030 <puts@plt>
jmp    1569 <main+0x399>
lea    0xaee(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%r14d
mov    %r14d,%eax
add    $0x98,%rsp
pop    %rbx
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.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [24 x i8] c"Could not create socket\00"
@INADDR_ANY = global i32 0
@.str.1 = [12 x i8] c"bind failed\00"
@.str.2 = [10 x i8] c"bind done\00"
@.str.3 = [36 x i8] c"Waiting for incoming connections...\00"
@.str.4 = [14 x i8] c"accept failed\00"
@.str.5 = [20 x i8] c"Connection accepted\00"
@.str.6 = [57 x i8] c"Hello Client , I have received your connection %d times\0A\00"
@.str.7 = [11 x i8] c"src (%s) \0A\00"
@.str.8 = [31 x i8] c"processing numer (%d) request\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 %struct.sockaddr_in
%10 = alloca %struct.sockaddr_in
%11 = alloca [100 x i8]
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i32, i32* @AF_INET
%14 = load i32, i32* @SOCK_STREAM
%15 = call i32 @socket(i32 %13, i32 %14, i32 0)
store i32 %15, i32* %6
%16 = load i32, i32* %6
%17 = icmp eq i32 %16, -1
br i1 %17, label %18, label %20
18: ; preds = %2
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %20
20: ; preds = %18, %2
%21 = load i32, i32* @AF_INET
%22 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 2
store i32 %21, i32* %22
%23 = load i32, i32* @INADDR_ANY
%24 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 1
%25 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %24, i32 0, i32 0
store i32 %23, i32* %25
%26 = call i32 @htons(i32 8888)
%27 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 0
store i32 %26, i32* %27
%28 = load i32, i32* %6
%29 = bitcast %struct.sockaddr_in* %9 to %struct.sockaddr*
%30 = call i64 @bind(i32 %28, %struct.sockaddr* %29, i32 12)
%31 = icmp slt i64 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %20
%33 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %71
34: ; preds = %20
%35 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%36 = load i32, i32* %6
%37 = call i32 @listen(i32 %36, i32 1024)
%38 = call i32 @puts(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
store i32 12, i32* %8
store i32 0, i32* %12
br label %39
39: ; preds = %34, %69
%40 = load i32, i32* %6
%41 = bitcast %struct.sockaddr_in* %10 to %struct.sockaddr*
%42 = call i32 @accept(i32 %40, %struct.sockaddr* %41, i32* %8)
store i32 %42, i32* %7
%43 = load i32, i32* %7
%44 = icmp slt i32 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %39
%46 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %3
br label %71
47: ; preds = %39
%48 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%49 = load i32, i32* %12
%50 = add nsw i32 %49, 1
store i32 %50, i32* %12
%51 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%52 = load i32, i32* %12
%53 = call i32 @sprintf(i8* %51, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.6, i64 0, i64 0), i32 %52)
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%55 = load i32, i32* %12
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0), i32 %55)
%57 = call i32 @sleep(i32 5)
%58 = load i32, i32* %7
%59 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%60 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%61 = call i32 @strlen(i8* %60)
%62 = call i32 @write(i32 %58, i8* %59, i32 %61)
%63 = call i32 @sleep(i32 1)
%64 = load i32, i32* %7
%65 = call i32 @close(i32 %64)
%66 = load i32, i32* %12
%67 = icmp eq i32 %66, 5
br i1 %67, label %68, label %69
68: ; preds = %47
br label %70
69: ; preds = %47
br label %39
70: ; preds = %68
store i32 0, i32* %3
br label %71
71: ; preds = %70, %45, %32
%72 = load i32, i32* %3
ret i32 %72
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [24 x i8] c"Could not create socket\00"
@INADDR_ANY = global i32 0
@.str.1 = [12 x i8] c"bind failed\00"
@.str.2 = [10 x i8] c"bind done\00"
@.str.3 = [36 x i8] c"Waiting for incoming connections...\00"
@.str.4 = [14 x i8] c"accept failed\00"
@.str.5 = [20 x i8] c"Connection accepted\00"
@.str.6 = [57 x i8] c"Hello Client , I have received your connection %d times\0A\00"
@.str.7 = [11 x i8] c"src (%s) \0A\00"
@.str.8 = [31 x i8] c"processing numer (%d) request\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca %struct.sockaddr_in
%5 = alloca %struct.sockaddr_in
%6 = alloca [100 x i8]
%7 = bitcast i32* %3 to i8*
%8 = bitcast %struct.sockaddr_in* %4 to i8*
%9 = bitcast %struct.sockaddr_in* %5 to i8*
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%11 = load i32, i32* @AF_INET
%12 = load i32, i32* @SOCK_STREAM
%13 = tail call i32 @socket(i32 %11, i32 %12, i32 0)
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %2
%18 = load i32, i32* @AF_INET
%19 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 2
store i32 %18, i32* %19
%20 = load i32, i32* @INADDR_ANY
%21 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 1, i32 0
store i32 %20, i32* %21
%22 = tail call i32 @htons(i32 8888)
%23 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 0
store i32 %22, i32* %23
%24 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%25 = call i64 @bind(i32 %13, %struct.sockaddr* %24, i32 12)
%26 = icmp slt i64 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %17
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %96
29: ; preds = %17
%30 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%31 = call i32 @listen(i32 %13, i32 1024)
%32 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
store i32 12, i32* %3
%33 = bitcast %struct.sockaddr_in* %5 to %struct.sockaddr*
%34 = call i32 @accept(i32 %13, %struct.sockaddr* %33, i32* %3)
%35 = icmp slt i32 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %74, %62, %50, %38, %29
%37 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
br label %96
38: ; preds = %29
%39 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%40 = call i32 @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.6, i64 0, i64 0), i32 1)
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0), i32 1)
%43 = call i32 @sleep(i32 5)
%44 = call i32 @strlen(i8* %10)
%45 = call i32 @write(i32 %34, i8* %10, i32 %44)
%46 = call i32 @sleep(i32 1)
%47 = call i32 @close(i32 %34)
%48 = call i32 @accept(i32 %13, %struct.sockaddr* %33, i32* %3)
%49 = icmp slt i32 %48, 0
br i1 %49, label %36, label %50
50: ; preds = %38
%51 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%52 = call i32 @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.6, i64 0, i64 0), i32 2)
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0), i32 2)
%55 = call i32 @sleep(i32 5)
%56 = call i32 @strlen(i8* %10)
%57 = call i32 @write(i32 %48, i8* %10, i32 %56)
%58 = call i32 @sleep(i32 1)
%59 = call i32 @close(i32 %48)
%60 = call i32 @accept(i32 %13, %struct.sockaddr* %33, i32* %3)
%61 = icmp slt i32 %60, 0
br i1 %61, label %36, label %62
62: ; preds = %50
%63 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%64 = call i32 @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.6, i64 0, i64 0), i32 3)
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0), i32 3)
%67 = call i32 @sleep(i32 5)
%68 = call i32 @strlen(i8* %10)
%69 = call i32 @write(i32 %60, i8* %10, i32 %68)
%70 = call i32 @sleep(i32 1)
%71 = call i32 @close(i32 %60)
%72 = call i32 @accept(i32 %13, %struct.sockaddr* %33, i32* %3)
%73 = icmp slt i32 %72, 0
br i1 %73, label %36, label %74
74: ; preds = %62
%75 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%76 = call i32 @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.6, i64 0, i64 0), i32 4)
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%78 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0), i32 4)
%79 = call i32 @sleep(i32 5)
%80 = call i32 @strlen(i8* %10)
%81 = call i32 @write(i32 %72, i8* %10, i32 %80)
%82 = call i32 @sleep(i32 1)
%83 = call i32 @close(i32 %72)
%84 = call i32 @accept(i32 %13, %struct.sockaddr* %33, i32* %3)
%85 = icmp slt i32 %84, 0
br i1 %85, label %36, label %86
86: ; preds = %74
%87 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%88 = call i32 @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.6, i64 0, i64 0), i32 5)
%89 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%90 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0), i32 5)
%91 = call i32 @sleep(i32 5)
%92 = call i32 @strlen(i8* %10)
%93 = call i32 @write(i32 %84, i8* %10, i32 %92)
%94 = call i32 @sleep(i32 1)
%95 = call i32 @close(i32 %84)
br label %96
96: ; preds = %86, %36, %27
%97 = phi i32 [ 1, %27 ], [ 1, %36 ], [ 0, %86 ]
ret i32 %97
}