#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 {
  scalar_t__ sin_port;
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ srv;
typedef int /*<<< orphan*/ buffer;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_DGRAM;
scalar_t__ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int getopt(int, char **, char *);
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
scalar_t__ htons(int);
int /*<<< orphan*/ memset(struct sockaddr_in *, int /*<<< orphan*/, int);
char *optarg;
int /*<<< orphan*/ printf(char *, int);
int recvfrom(int, char *, int, int /*<<< orphan*/, int /*<<< orphan*/ *,
             int /*<<< orphan*/ *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
int main(int argc, char *argv[]) {
  struct sockaddr_in srv;
  int sockfd;
  char buffer[(1024) + 1];
  int n;
  char *path;
  FILE *file;
  int c;
  path = NULL;
  while ((c = getopt(argc, argv, "o:")) != -1) {
    switch (c) {
    case 'o':
      path = optarg;
      break;
    }
  }
  if (path) {
    file = fopen(path, "a");
    if (!file) {
      fprintf(stderr, "Failed to open database file(%s)!\n", path);
      return -1;
    }
  } else {
    file = stdout;
  }
  sockfd = socket(PF_INET, SOCK_DGRAM, 0);
  if (sockfd < 0) {
    fprintf(stderr, "Failed to create socket file!\n");
    return -2;
  }
  memset(&srv, 0, sizeof(srv));
  srv.sin_family = AF_INET;
  srv.sin_addr.s_addr = htonl(INADDR_ANY);
  srv.sin_port = htons((0x431));
  if (bind(sockfd, (struct sockaddr *)&srv, sizeof(srv)) < 0) {
    fprintf(stderr, "Failed to bind udp server!\n");
    return -2;
  }
  printf("Listening port %d\n", (int)srv.sin_port);
  for (;;) {
    n = recvfrom(sockfd, buffer, sizeof(buffer), 0, NULL, NULL);
    if (n < 0) {
      fprintf(stderr, "Some error occurs when receiving data!\n");
      continue;
    }
    if (n >= (int)sizeof(buffer)) {
      fprintf(stderr, "The recived data is out of length. Drop it!\n");
      continue;
    }
    buffer[n] = '\0';
    fprintf(file, "%s\n", buffer);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x450,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x440(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe2e(%rip),%rdx
call   10b0 <getopt@plt>
mov    %eax,-0x44c(%rbp)
cmp    $0xffffffff,%eax
je     1210 <main+0x70>
mov    -0x44c(%rbp),%eax
sub    $0x6f,%eax
jne    120b <main+0x6b>
jmp    11fa <main+0x5a>
mov    0x2df7(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x440(%rbp)
jmp    11c4 <main+0x24>
cmpq   $0x0,-0x440(%rbp)
je     1276 <main+0xd6>
mov    -0x440(%rbp),%rdi
lea    0xdd7(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x448(%rbp)
cmpq   $0x0,-0x448(%rbp)
jne    1271 <main+0xd1>
mov    0x2d73(%rip),%rax
mov    (%rax),%rdi
mov    -0x440(%rbp),%rdx
lea    0xda7(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1408 <main+0x268>
jmp    1287 <main+0xe7>
mov    0x2d33(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x448(%rbp)
mov    0x2d2a(%rip),%rax
mov    (%rax),%edi
mov    0x2d39(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10c0 <socket@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    12d1 <main+0x131>
mov    0x2d0c(%rip),%rax
mov    (%rax),%rdi
lea    0xd6a(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1408 <main+0x268>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1060 <memset@plt>
mov    0x2cf8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    0x2ce4(%rip),%rax
mov    (%rax),%edi
call   1050 <htonl@plt>
mov    %eax,-0x18(%rbp)
mov    $0x431,%edi
call   1030 <htons@plt>
mov    %rax,-0x20(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x10,%edx
call   1090 <bind@plt>
cmp    $0x0,%rax
jge    134b <main+0x1ab>
mov    0x2c92(%rip),%rax
mov    (%rax),%rdi
lea    0xd0f(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1408 <main+0x268>
mov    -0x20(%rbp),%rax
mov    %eax,%esi
lea    0xd0b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x24(%rbp),%edi
lea    -0x430(%rbp),%rsi
mov    $0x401,%edx
xor    %ecx,%ecx
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%r8
call   1080 <recvfrom@plt>
mov    %eax,-0x434(%rbp)
cmpl   $0x0,-0x434(%rbp)
jge    13ab <main+0x20b>
mov    0x2c2b(%rip),%rax
mov    (%rax),%rdi
lea    0xcd7(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    135d <main+0x1bd>
cmpl   $0x401,-0x434(%rbp)
jl     13d8 <main+0x238>
mov    0x2bfe(%rip),%rax
mov    (%rax),%rdi
lea    0xcd2(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    135d <main+0x1bd>
movslq -0x434(%rbp),%rax
movb   $0x0,-0x430(%rbp,%rax,1)
mov    -0x448(%rbp),%rdi
lea    -0x430(%rbp),%rdx
lea    0xccf(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    135d <main+0x1bd>
mov    -0x4(%rbp),%eax
add    $0x450,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x418,%rsp
mov    %rsi,%rbp
mov    %edi,%ebx
xor    %r15d,%r15d
lea    0xe30(%rip),%r14
mov    0x2e21(%rip),%r12
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %r14,%rdx
call   10b0 <getopt@plt>
cmp    $0xffffffff,%eax
je     11fd <main+0x4d>
cmp    $0x6f,%eax
jne    11e0 <main+0x30>
mov    (%r12),%r15
jmp    11e0 <main+0x30>
test   %r15,%r15
je     123e <main+0x8e>
lea    0xdfa(%rip),%rsi
mov    %r15,%rdi
call   10a0 <fopen@plt>
mov    %rax,%r14
test   %rax,%rax
jne    1248 <main+0x98>
mov    0x2da0(%rip),%rax
mov    (%rax),%rdi
lea    0xddb(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0xffffffff,%eax
jmp    13a6 <main+0x1f6>
mov    0x2d6b(%rip),%rax
mov    (%rax),%r14
mov    0x2d69(%rip),%rax
mov    (%rax),%edi
mov    0x2d78(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10d0 <socket@plt>
test   %eax,%eax
js     1369 <main+0x1b9>
mov    %eax,%ebp
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1060 <memset@plt>
mov    0x2d5c(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rsp)
mov    0x2d47(%rip),%rax
mov    (%rax),%edi
call   1050 <htonl@plt>
mov    %eax,0x8(%rsp)
mov    $0x431,%edi
call   1030 <htons@plt>
mov    %rax,(%rsp)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x10,%edx
call   1090 <bind@plt>
test   %rax,%rax
js     1381 <main+0x1d1>
mov    (%rsp),%esi
lea    0xd97(%rip),%rdi
call   1040 <printf@plt>
lea    0x10(%rsp),%rbx
mov    0x2ce3(%rip),%r12
lea    0xd92(%rip),%r15
lea    0xde0(%rip),%r13
jmp    1306 <main+0x156>
nopl   (%rax)
mov    (%r12),%rcx
mov    $0x27,%esi
mov    $0x1,%edx
mov    %r15,%rdi
call   10c0 <fwrite@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x401,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1080 <recvfrom@plt>
test   %eax,%eax
js     12f0 <main+0x140>
cmp    $0x401,%eax
jb     1350 <main+0x1a0>
mov    (%r12),%rcx
mov    $0x2c,%esi
mov    $0x1,%edx
lea    0xd61(%rip),%rdi
call   10c0 <fwrite@plt>
jmp    1306 <main+0x156>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %eax,%eax
movb   $0x0,0x10(%rsp,%rax,1)
mov    %r14,%rdi
mov    %r13,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    1306 <main+0x156>
mov    0x2c50(%rip),%rax
mov    (%rax),%rcx
lea    0xcae(%rip),%rdi
mov    $0x1e,%esi
jmp    1397 <main+0x1e7>
mov    0x2c38(%rip),%rax
mov    (%rax),%rcx
lea    0xcb5(%rip),%rdi
mov    $0x1b,%esi
mov    $0x1,%edx
call   10c0 <fwrite@plt>
mov    $0xfffffffe,%eax
add    $0x418,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i64, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [3 x i8] c"o:\00"
@optarg = global i8* null
@.str.1 = [2 x i8] c"a\00"
@stderr = global i32* null
@.str.2 = [35 x i8] c"Failed to open database file(%s)!\0A\00"
@stdout = global i32* null
@PF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@.str.3 = [31 x i8] c"Failed to create socket file!\0A\00"
@AF_INET = global i32 0
@INADDR_ANY = global i32 0
@.str.4 = [28 x i8] c"Failed to bind udp server!\0A\00"
@.str.5 = [19 x i8] c"Listening port %d\0A\00"
@.str.6 = [40 x i8] c"Some error occurs when receiving data!\0A\00"
@.str.7 = [45 x i8] c"The recived data is out of length. Drop it!\0A\00"
@.str.8 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.sockaddr_in
%7 = alloca i32
%8 = alloca [1025 x i8]
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32*
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %10
br label %13
13: ; preds = %22, %2
%14 = load i32, i32* %4
%15 = load i8**, i8*** %5
%16 = call i32 @getopt(i32 %14, i8** %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32 %16, i32* %12
%17 = icmp ne i32 %16, -1
br i1 %17, label %18, label %23
18: ; preds = %13
%19 = load i32, i32* %12
switch i32 %19, label %22 [
i32 111, label %20
]
20: ; preds = %18
%21 = load i8*, i8** @optarg
store i8* %21, i8** %10
br label %22
22: ; preds = %18, %20
br label %13
23: ; preds = %13
%24 = load i8*, i8** %10
%25 = icmp ne i8* %24, null
br i1 %25, label %26, label %36
26: ; preds = %23
%27 = load i8*, i8** %10
%28 = call i32* @fopen(i8* %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %28, i32** %11
%29 = load i32*, i32** %11
%30 = icmp ne i32* %29, null
br i1 %30, label %35, label %31
31: ; preds = %26
%32 = load i32*, i32** @stderr
%33 = load i8*, i8** %10
%34 = call i32 (i32*, i8*, ...) @fprintf(i32* %32, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8* %33)
store i32 -1, i32* %3
br label %91
35: ; preds = %26
br label %38
36: ; preds = %23
%37 = load i32*, i32** @stdout
store i32* %37, i32** %11
br label %38
38: ; preds = %36, %35
%39 = load i32, i32* @PF_INET
%40 = load i32, i32* @SOCK_DGRAM
%41 = call i32 @socket(i32 %39, i32 %40, i32 0)
store i32 %41, i32* %7
%42 = load i32, i32* %7
%43 = icmp slt i32 %42, 0
br i1 %43, label %44, label %47
44: ; preds = %38
%45 = load i32*, i32** @stderr
%46 = call i32 (i32*, i8*, ...) @fprintf(i32* %45, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
store i32 -2, i32* %3
br label %91
47: ; preds = %38
%48 = call i32 @memset(%struct.sockaddr_in* %6, i32 0, i32 16)
%49 = load i32, i32* @AF_INET
%50 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 2
store i32 %49, i32* %50
%51 = load i32, i32* @INADDR_ANY
%52 = call i32 @htonl(i32 %51)
%53 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 1
%54 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %53, i32 0, i32 0
store i32 %52, i32* %54
%55 = call i64 @htons(i32 1073)
%56 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 0
store i64 %55, i64* %56
%57 = load i32, i32* %7
%58 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%59 = call i64 @bind(i32 %57, %struct.sockaddr* %58, i32 16)
%60 = icmp slt i64 %59, 0
br i1 %60, label %61, label %64
61: ; preds = %47
%62 = load i32*, i32** @stderr
%63 = call i32 (i32*, i8*, ...) @fprintf(i32* %62, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
store i32 -2, i32* %3
br label %91
64: ; preds = %47
%65 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 0
%66 = load i64, i64* %65
%67 = trunc i64 %66 to i32
%68 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 %67)
br label %69
69: ; preds = %84, %81, %75, %64
%70 = load i32, i32* %7
%71 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%72 = call i32 @recvfrom(i32 %70, i8* %71, i32 1025, i32 0, i32* null, i32* null)
store i32 %72, i32* %9
%73 = load i32, i32* %9
%74 = icmp slt i32 %73, 0
br i1 %74, label %75, label %78
75: ; preds = %69
%76 = load i32*, i32** @stderr
%77 = call i32 (i32*, i8*, ...) @fprintf(i32* %76, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0))
br label %69
78: ; preds = %69
%79 = load i32, i32* %9
%80 = icmp sge i32 %79, 1025
br i1 %80, label %81, label %84
81: ; preds = %78
%82 = load i32*, i32** @stderr
%83 = call i32 (i32*, i8*, ...) @fprintf(i32* %82, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.7, i64 0, i64 0))
br label %69
84: ; preds = %78
%85 = load i32, i32* %9
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 %86
store i8 0, i8* %87
%88 = load i32*, i32** %11
%89 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%90 = call i32 (i32*, i8*, ...) @fprintf(i32* %88, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* %89)
br label %69
91: ; preds = %61, %44, %31
%92 = load i32, i32* %3
ret i32 %92
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i64, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [3 x i8] c"o:\00"
@optarg = global i8* null
@.str.1 = [2 x i8] c"a\00"
@stderr = global i32* null
@.str.2 = [35 x i8] c"Failed to open database file(%s)!\0A\00"
@stdout = global i32* null
@PF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@.str.3 = [31 x i8] c"Failed to create socket file!\0A\00"
@AF_INET = global i32 0
@INADDR_ANY = global i32 0
@.str.4 = [28 x i8] c"Failed to bind udp server!\0A\00"
@.str.5 = [19 x i8] c"Listening port %d\0A\00"
@.str.6 = [40 x i8] c"Some error occurs when receiving data!\0A\00"
@.str.7 = [45 x i8] c"The recived data is out of length. Drop it!\0A\00"
@.str.8 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca [1025 x i8]
%5 = bitcast %struct.sockaddr_in* %3 to i8*
%6 = getelementptr inbounds [1025 x i8], [1025 x i8]* %4, i64 0, i64 0
br label %7
7: ; preds = %11, %2
%8 = phi i8* [ %12, %11 ], [ null, %2 ]
br label %9
9: ; preds = %7, %9
%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 %9 [
i32 -1, label %13
i32 111, label %11
]
11: ; preds = %9
%12 = load i8*, i8** @optarg
br label %7
13: ; preds = %9
%14 = icmp eq i8* %8, null
br i1 %14, label %21, label %15
15: ; preds = %13
%16 = tail call i32* @fopen(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp eq i32* %16, null
br i1 %17, label %18, label %23
18: ; preds = %15
%19 = load i32*, i32** @stderr
%20 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %19, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8* %8)
br label %67
21: ; preds = %13
%22 = load i32*, i32** @stdout
br label %23
23: ; preds = %15, %21
%24 = phi i32* [ %16, %15 ], [ %22, %21 ]
%25 = load i32, i32* @PF_INET
%26 = load i32, i32* @SOCK_DGRAM
%27 = tail call i32 @socket(i32 %25, i32 %26, i32 0)
%28 = icmp slt i32 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %23
%30 = load i32*, i32** @stderr
%31 = tail call i64 @fwrite(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i64 30, i64 1, i32* %30)
br label %67
32: ; preds = %23
%33 = call i32 @memset(%struct.sockaddr_in* %3, i32 0, i32 16)
%34 = load i32, i32* @AF_INET
%35 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i32 %34, i32* %35
%36 = load i32, i32* @INADDR_ANY
%37 = call i32 @htonl(i32 %36)
%38 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1, i32 0
store i32 %37, i32* %38
%39 = call i64 @htons(i32 1073)
%40 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
store i64 %39, i64* %40
%41 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%42 = call i64 @bind(i32 %27, %struct.sockaddr* %41, i32 16)
%43 = icmp slt i64 %42, 0
br i1 %43, label %44, label %47
44: ; preds = %32
%45 = load i32*, i32** @stderr
%46 = call i64 @fwrite(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i64 27, i64 1, i32* %45)
br label %67
47: ; preds = %32
%48 = load i64, i64* %40
%49 = trunc i64 %48 to i32
%50 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 %49)
br label %51
51: ; preds = %57, %47
%52 = call i32 @recvfrom(i32 %27, i8* %6, i32 1025, i32 0, i32* null, i32* null)
%53 = icmp slt i32 %52, 0
br i1 %53, label %54, label %58
54: ; preds = %51
%55 = load i32*, i32** @stderr
%56 = call i64 @fwrite(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0), i64 39, i64 1, i32* %55)
br label %57
57: ; preds = %54, %60, %63
br label %51
58: ; preds = %51
%59 = icmp ugt i32 %52, 1024
br i1 %59, label %60, label %63
60: ; preds = %58
%61 = load i32*, i32** @stderr
%62 = call i64 @fwrite(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.7, i64 0, i64 0), i64 44, i64 1, i32* %61)
br label %57
63: ; preds = %58
%64 = zext i32 %52 to i64
%65 = getelementptr inbounds [1025 x i8], [1025 x i8]* %4, i64 0, i64 %64
store i8 0, i8* %65
%66 = call i32 (i32*, i8*, ...) @fprintf(i32* %24, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* %6)
br label %57
67: ; preds = %44, %29, %18
%68 = phi i32 [ -2, %29 ], [ -2, %44 ], [ -1, %18 ]
ret i32 %68
}