#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*/ yes;
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*/ serv_addr;
typedef int /*<<< orphan*/ cli_addr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int EXIT_FAILURE;
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ SIGCHLD;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int accept(int, struct sockaddr *, int *);
int /*<<< orphan*/ analyze(char *, int);
int atoi(int /*<<< orphan*/);
scalar_t__ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int fork();
int getopt(int, char **, char *);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ listen(int, int);
int /*<<< orphan*/ optarg;
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ print_usage();
int read(int, char *, int);
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int option = 0;
  int cislo_portu = 0;
  while ((option = getopt(argc, argv, "p:")) != -1) {
    switch (option) {
    case 'p':
      cislo_portu = atoi(optarg);
      break;
    default:
      print_usage();
      exit(EXIT_FAILURE);
    }
  }
  int sockfd, newsockfd, portno, clilen;
  portno = cislo_portu;
  struct sockaddr_in serv_addr, cli_addr;
  sockfd = socket(AF_INET, SOCK_STREAM, 0);
  int yes = 1;
  if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)) == -1) {
    perror("setsockopt");
    exit(1);
  }
  if (sockfd < 0) {
    perror("ERROR opening socket");
    exit(1);
  }
  bzero((char *)&serv_addr, sizeof(serv_addr));
  serv_addr.sin_family = AF_INET;
  serv_addr.sin_addr.s_addr = INADDR_ANY;
  serv_addr.sin_port = htons(portno);
  if (bind(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0) {
    perror("ERROR on binding");
    exit(1);
  }
  listen(sockfd, 5);
  clilen = sizeof(cli_addr);
  while (1) {
    newsockfd = accept(sockfd, (struct sockaddr *)&cli_addr, &clilen);
    if (newsockfd < 0) {
      perror("ERROR on accept");
      exit(1);
    }
    signal(SIGCHLD, SIG_IGN);
    int pid = fork();
    if (pid < 0) {
      perror("ERROR on fork");
      exit(1);
    }
    if (pid == 0) {
      close(sockfd);
      int n;
      char buffer[256];
      bzero(buffer, 256);
      n = read(newsockfd, buffer, 255);
      if (n < 0) {
        perror("ERROR reading from socket");
        exit(1);
      }
      analyze(buffer, newsockfd);
      exit(0);
    } else {
      close(newsockfd);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xdbb(%rip),%rdx
call   10d0 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     1297 <main+0x87>
mov    -0x14(%rbp),%eax
sub    $0x70,%eax
jne    127d <main+0x6d>
jmp    1267 <main+0x57>
mov    0x2d8a(%rip),%rax
mov    (%rax),%edi
call   10f0 <atoi@plt>
mov    %eax,-0x18(%rbp)
jmp    1292 <main+0x82>
mov    $0x0,%al
call   1110 <print_usage@plt>
mov    0x2d1d(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
jmp    1237 <main+0x27>
mov    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    0x2d34(%rip),%rax
mov    (%rax),%edi
mov    0x2d03(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %eax,-0x1c(%rbp)
movl   $0x1,-0x4c(%rbp)
mov    -0x1c(%rbp),%edi
mov    0x2d16(%rip),%rax
mov    (%rax),%esi
mov    0x2ccd(%rip),%rax
mov    (%rax),%edx
lea    -0x4c(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0xffffffff,%eax
jne    1303 <main+0xf3>
lea    0xd0f(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
cmpl   $0x0,-0x1c(%rbp)
jge    1323 <main+0x113>
lea    0xcfa(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
lea    -0x38(%rbp),%rdi
mov    $0xc,%esi
call   10c0 <bzero@plt>
mov    0x2ca0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    0x2c8c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x24(%rbp),%edi
call   1040 <htons@plt>
mov    %eax,-0x38(%rbp)
mov    -0x1c(%rbp),%edi
lea    -0x38(%rbp),%rsi
mov    $0xc,%edx
call   10a0 <bind@plt>
cmp    $0x0,%rax
jge    1385 <main+0x175>
lea    0xcad(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
mov    -0x1c(%rbp),%edi
mov    $0x5,%esi
call   1090 <listen@plt>
movl   $0xc,-0x28(%rbp)
mov    -0x1c(%rbp),%edi
lea    -0x48(%rbp),%rsi
lea    -0x28(%rbp),%rdx
call   10e0 <accept@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    13cc <main+0x1bc>
lea    0xc77(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
mov    0x2bf5(%rip),%rax
mov    (%rax),%edi
mov    0x2be4(%rip),%rax
mov    (%rax),%esi
call   1080 <signal@plt>
mov    $0x0,%al
call   1120 <fork@plt>
mov    %eax,-0x50(%rbp)
cmpl   $0x0,-0x50(%rbp)
jge    140d <main+0x1fd>
lea    0xc46(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
cmpl   $0x0,-0x50(%rbp)
jne    147d <main+0x26d>
mov    -0x1c(%rbp),%edi
call   1060 <close@plt>
lea    -0x160(%rbp),%rdi
mov    $0x100,%esi
call   10c0 <bzero@plt>
mov    -0x20(%rbp),%edi
lea    -0x160(%rbp),%rsi
mov    $0xff,%edx
call   1070 <read@plt>
mov    %eax,-0x54(%rbp)
cmpl   $0x0,-0x54(%rbp)
jge    1467 <main+0x257>
lea    0xbfa(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
lea    -0x160(%rbp),%rdi
mov    -0x20(%rbp),%esi
call   1050 <analyze@plt>
xor    %edi,%edi
call   1100 <exit@plt>
mov    -0x20(%rbp),%edi
call   1060 <close@plt>
jmp    1399 <main+0x189>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x138,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %r15d,%r15d
lea    0xdd0(%rip),%r14
mov    0x2dc1(%rip),%r12
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   10d0 <getopt@plt>
cmp    $0x70,%eax
jne    1260 <main+0x50>
mov    (%r12),%edi
call   10f0 <atoi@plt>
mov    %eax,%r15d
jmp    1240 <main+0x30>
cmp    $0xffffffff,%eax
jne    12c0 <main+0xb0>
mov    0x2d6c(%rip),%rbp
mov    0x0(%rbp),%edi
mov    0x2d3a(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %eax,%r14d
movl   $0x1,0xc(%rsp)
mov    0x2d4f(%rip),%rax
mov    (%rax),%esi
mov    0x2d06(%rip),%rax
mov    (%rax),%edx
lea    0xc(%rsp),%rcx
mov    %r14d,%edi
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0xffffffff,%eax
jne    12d5 <main+0xc5>
lea    0xd48(%rip),%rdi
jmp    13fb <main+0x1eb>
xor    %eax,%eax
call   1110 <print_usage@plt>
mov    0x2cda(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
test   %r14d,%r14d
jns    12e6 <main+0xd6>
lea    0xd2d(%rip),%rdi
jmp    13fb <main+0x1eb>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xc,%esi
call   10c0 <bzero@plt>
mov    0x0(%rbp),%eax
mov    %eax,0x18(%rsp)
mov    0x2cca(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x14(%rsp)
mov    %r15d,%edi
call   1040 <htons@plt>
mov    %eax,0x10(%rsp)
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0xc,%edx
call   10a0 <bind@plt>
test   %rax,%rax
jns    1339 <main+0x129>
lea    0xcef(%rip),%rdi
jmp    13fb <main+0x1eb>
mov    %r14d,%edi
mov    $0x5,%esi
call   1090 <listen@plt>
movl   $0xc,0x8(%rsp)
lea    0x20(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %r14d,%edi
call   10e0 <accept@plt>
test   %eax,%eax
js     13b5 <main+0x1a5>
mov    %eax,%ebp
mov    0x2c5b(%rip),%r12
mov    0x2c4c(%rip),%r13
lea    0x20(%rsp),%r15
lea    0x8(%rsp),%rbx
xchg   %ax,%ax
mov    (%r12),%edi
mov    0x0(%r13),%esi
call   1080 <signal@plt>
xor    %eax,%eax
call   1120 <fork@plt>
test   %eax,%eax
js     13be <main+0x1ae>
je     13c7 <main+0x1b7>
mov    %ebp,%edi
call   1060 <close@plt>
mov    %r14d,%edi
mov    %r15,%rsi
mov    %rbx,%rdx
call   10e0 <accept@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    1380 <main+0x170>
lea    0xc78(%rip),%rdi
jmp    13fb <main+0x1eb>
lea    0xc7f(%rip),%rdi
jmp    13fb <main+0x1eb>
mov    %r14d,%edi
call   1060 <close@plt>
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   10c0 <bzero@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0xff,%edx
call   1070 <read@plt>
test   %eax,%eax
jns    140a <main+0x1fa>
lea    0xc57(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
lea    0x30(%rsp),%rdi
mov    %ebp,%esi
call   1050 <analyze@plt>
xor    %edi,%edi
call   1100 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [3 x i8] c"p:\00"
@optarg = global i32 0
@EXIT_FAILURE = global i32 0
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@.str.1 = [11 x i8] c"setsockopt\00"
@.str.2 = [21 x i8] c"ERROR opening socket\00"
@INADDR_ANY = global i32 0
@.str.3 = [17 x i8] c"ERROR on binding\00"
@.str.4 = [16 x i8] c"ERROR on accept\00"
@SIGCHLD = global i32 0
@SIG_IGN = global i32 0
@.str.5 = [14 x i8] c"ERROR on fork\00"
@.str.6 = [26 x i8] c"ERROR reading from socket\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 i32
%11 = alloca i32
%12 = alloca %struct.sockaddr_in
%13 = alloca %struct.sockaddr_in
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
br label %18
18: ; preds = %32, %2
%19 = load i32, i32* %4
%20 = load i8**, i8*** %5
%21 = call i32 @getopt(i32 %19, i8** %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32 %21, i32* %6
%22 = icmp ne i32 %21, -1
br i1 %22, label %23, label %33
23: ; preds = %18
%24 = load i32, i32* %6
switch i32 %24, label %28 [
i32 112, label %25
]
25: ; preds = %23
%26 = load i32, i32* @optarg
%27 = call i32 @atoi(i32 %26)
store i32 %27, i32* %7
br label %32
28: ; preds = %23
%29 = call i32 (...) @print_usage()
%30 = load i32, i32* @EXIT_FAILURE
%31 = call i32 @exit(i32 %30)
unreachable
32: ; preds = %25
br label %18
33: ; preds = %18
%34 = load i32, i32* %7
store i32 %34, i32* %10
%35 = load i32, i32* @AF_INET
%36 = load i32, i32* @SOCK_STREAM
%37 = call i32 @socket(i32 %35, i32 %36, i32 0)
store i32 %37, i32* %8
store i32 1, i32* %14
%38 = load i32, i32* %8
%39 = load i32, i32* @SOL_SOCKET
%40 = load i32, i32* @SO_REUSEADDR
%41 = call i32 @setsockopt(i32 %38, i32 %39, i32 %40, i32* %14, i32 4)
%42 = icmp eq i32 %41, -1
br i1 %42, label %43, label %46
43: ; preds = %33
%44 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%45 = call i32 @exit(i32 1)
unreachable
46: ; preds = %33
%47 = load i32, i32* %8
%48 = icmp slt i32 %47, 0
br i1 %48, label %49, label %52
49: ; preds = %46
%50 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%51 = call i32 @exit(i32 1)
unreachable
52: ; preds = %46
%53 = bitcast %struct.sockaddr_in* %12 to i8*
%54 = call i32 @bzero(i8* %53, i32 12)
%55 = load i32, i32* @AF_INET
%56 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %12, i32 0, i32 2
store i32 %55, i32* %56
%57 = load i32, i32* @INADDR_ANY
%58 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %12, i32 0, i32 1
%59 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %58, i32 0, i32 0
store i32 %57, i32* %59
%60 = load i32, i32* %10
%61 = call i32 @htons(i32 %60)
%62 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %12, i32 0, i32 0
store i32 %61, i32* %62
%63 = load i32, i32* %8
%64 = bitcast %struct.sockaddr_in* %12 to %struct.sockaddr*
%65 = call i64 @bind(i32 %63, %struct.sockaddr* %64, i32 12)
%66 = icmp slt i64 %65, 0
br i1 %66, label %67, label %70
67: ; preds = %52
%68 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%69 = call i32 @exit(i32 1)
unreachable
70: ; preds = %52
%71 = load i32, i32* %8
%72 = call i32 @listen(i32 %71, i32 5)
store i32 12, i32* %11
br label %73
73: ; preds = %70, %116
%74 = load i32, i32* %8
%75 = bitcast %struct.sockaddr_in* %13 to %struct.sockaddr*
%76 = call i32 @accept(i32 %74, %struct.sockaddr* %75, i32* %11)
store i32 %76, i32* %9
%77 = load i32, i32* %9
%78 = icmp slt i32 %77, 0
br i1 %78, label %79, label %82
79: ; preds = %73
%80 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%81 = call i32 @exit(i32 1)
unreachable
82: ; preds = %73
%83 = load i32, i32* @SIGCHLD
%84 = load i32, i32* @SIG_IGN
%85 = call i32 @signal(i32 %83, i32 %84)
%86 = call i32 (...) @fork()
store i32 %86, i32* %15
%87 = load i32, i32* %15
%88 = icmp slt i32 %87, 0
br i1 %88, label %89, label %92
89: ; preds = %82
%90 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
%91 = call i32 @exit(i32 1)
unreachable
92: ; preds = %82
%93 = load i32, i32* %15
%94 = icmp eq i32 %93, 0
br i1 %94, label %95, label %113
95: ; preds = %92
%96 = load i32, i32* %8
%97 = call i32 @close(i32 %96)
%98 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%99 = call i32 @bzero(i8* %98, i32 256)
%100 = load i32, i32* %9
%101 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%102 = call i32 @read(i32 %100, i8* %101, i32 255)
store i32 %102, i32* %16
%103 = load i32, i32* %16
%104 = icmp slt i32 %103, 0
br i1 %104, label %105, label %108
105: ; preds = %95
%106 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
%107 = call i32 @exit(i32 1)
unreachable
108: ; preds = %95
%109 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%110 = load i32, i32* %9
%111 = call i32 @analyze(i8* %109, i32 %110)
%112 = call i32 @exit(i32 0)
unreachable
113: ; preds = %92
%114 = load i32, i32* %9
%115 = call i32 @close(i32 %114)
br label %116
116: ; preds = %113
br label %73
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [3 x i8] c"p:\00"
@optarg = global i32 0
@EXIT_FAILURE = global i32 0
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@.str.1 = [11 x i8] c"setsockopt\00"
@.str.2 = [21 x i8] c"ERROR opening socket\00"
@INADDR_ANY = global i32 0
@.str.3 = [17 x i8] c"ERROR on binding\00"
@.str.4 = [16 x i8] c"ERROR on accept\00"
@SIGCHLD = global i32 0
@SIG_IGN = global i32 0
@.str.5 = [14 x i8] c"ERROR on fork\00"
@.str.6 = [26 x i8] c"ERROR reading from socket\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca %struct.sockaddr_in
%5 = alloca %struct.sockaddr_in
%6 = alloca i32
%7 = alloca [256 x i8]
br label %8
8: ; preds = %11, %2
%9 = phi i32 [ 0, %2 ], [ %13, %11 ]
%10 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
switch i32 %10, label %14 [
i32 -1, label %18
i32 112, label %11
]
11: ; preds = %8
%12 = load i32, i32* @optarg
%13 = tail call i32 @atoi(i32 %12)
br label %8
14: ; preds = %8
%15 = tail call i32 (...) @print_usage()
%16 = load i32, i32* @EXIT_FAILURE
%17 = tail call i32 @exit(i32 %16)
unreachable
18: ; preds = %8
%19 = bitcast i32* %3 to i8*
%20 = bitcast %struct.sockaddr_in* %4 to i8*
%21 = bitcast %struct.sockaddr_in* %5 to i8*
%22 = load i32, i32* @AF_INET
%23 = load i32, i32* @SOCK_STREAM
%24 = tail call i32 @socket(i32 %22, i32 %23, i32 0)
%25 = bitcast i32* %6 to i8*
store i32 1, i32* %6
%26 = load i32, i32* @SOL_SOCKET
%27 = load i32, i32* @SO_REUSEADDR
%28 = call i32 @setsockopt(i32 %24, i32 %26, i32 %27, i32* %6, i32 4)
%29 = icmp eq i32 %28, -1
br i1 %29, label %30, label %33
30: ; preds = %18
%31 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%32 = call i32 @exit(i32 1)
unreachable
33: ; preds = %18
%34 = icmp slt i32 %24, 0
br i1 %34, label %35, label %38
35: ; preds = %33
%36 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%37 = call i32 @exit(i32 1)
unreachable
38: ; preds = %33
%39 = call i32 @bzero(i8* %20, i32 12)
%40 = load i32, i32* @AF_INET
%41 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 2
store i32 %40, i32* %41
%42 = load i32, i32* @INADDR_ANY
%43 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 1, i32 0
store i32 %42, i32* %43
%44 = call i32 @htons(i32 %9)
%45 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 0
store i32 %44, i32* %45
%46 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%47 = call i64 @bind(i32 %24, %struct.sockaddr* %46, i32 12)
%48 = icmp slt i64 %47, 0
br i1 %48, label %49, label %52
49: ; preds = %38
%50 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%51 = call i32 @exit(i32 1)
unreachable
52: ; preds = %38
%53 = call i32 @listen(i32 %24, i32 5)
store i32 12, i32* %3
%54 = bitcast %struct.sockaddr_in* %5 to %struct.sockaddr*
%55 = call i32 @accept(i32 %24, %struct.sockaddr* %54, i32* %3)
%56 = icmp slt i32 %55, 0
br i1 %56, label %57, label %60
57: ; preds = %84, %52
%58 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%59 = call i32 @exit(i32 1)
unreachable
60: ; preds = %52, %84
%61 = phi i32 [ %86, %84 ], [ %55, %52 ]
%62 = load i32, i32* @SIGCHLD
%63 = load i32, i32* @SIG_IGN
%64 = call i32 @signal(i32 %62, i32 %63)
%65 = call i32 (...) @fork()
%66 = icmp slt i32 %65, 0
br i1 %66, label %67, label %70
67: ; preds = %60
%68 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
%69 = call i32 @exit(i32 1)
unreachable
70: ; preds = %60
%71 = icmp eq i32 %65, 0
br i1 %71, label %72, label %84
72: ; preds = %70
%73 = call i32 @close(i32 %24)
%74 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%75 = call i32 @bzero(i8* %74, i32 256)
%76 = call i32 @read(i32 %61, i8* %74, i32 255)
%77 = icmp slt i32 %76, 0
br i1 %77, label %78, label %81
78: ; preds = %72
%79 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
%80 = call i32 @exit(i32 1)
unreachable
81: ; preds = %72
%82 = call i32 @analyze(i8* %74, i32 %61)
%83 = call i32 @exit(i32 0)
unreachable
84: ; preds = %70
%85 = call i32 @close(i32 %61)
%86 = call i32 @accept(i32 %24, %struct.sockaddr* %54, i32* %3)
%87 = icmp slt i32 %86, 0
br i1 %87, label %57, label %60
}