#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 */

/* Type definitions */
typedef int /*<<< orphan*/ yes;
typedef int /*<<< orphan*/ time_t;
struct sockaddr_in {
  int /*<<< orphan*/ sin_addr;
  int /*<<< orphan*/ sin_port;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ srv_addr;
typedef int socklen_t;
typedef int /*<<< orphan*/ msg;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_BROADCAST;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ bzero(struct sockaddr_in *, int);
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ inet_aton(char *, int /*<<< orphan*/ *);
char *inet_ntoa(int /*<<< orphan*/);
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *, int /*<<< orphan*/, char *);
int recvfrom(int, void *, int, int /*<<< orphan*/, struct sockaddr *, int *);
int sendto(int, char *, scalar_t__, int /*<<< orphan*/, struct sockaddr const *,
           int);
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int /*<<< orphan*/ sleep(int);
int snprintf(char *, int, char *, char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ strlen(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  struct sockaddr_in srv_addr, cli_addr;
  int sock_fd, n;
  socklen_t addr_len;
  char buf[4096] = {0};
  assert(argc >= 2);
  sock_fd = socket(AF_INET, SOCK_DGRAM, 0);
  if (sock_fd < 0) {
    perror("socket");
    exit(-1);
  }
  int yes = 1;
  n = setsockopt(sock_fd, SOL_SOCKET, SO_BROADCAST, &yes, sizeof(yes));
  if (n < 0) {
    perror("setsockopt");
    exit(-1);
  }
  bzero(&srv_addr, sizeof(srv_addr));
  srv_addr.sin_family = AF_INET;
  srv_addr.sin_port = htons(6666);
  inet_aton(argv[1], &srv_addr.sin_addr);
  addr_len = sizeof(srv_addr);
  int i = 5;
  while (--i) {
    sleep(1);
    time_t t = time(NULL);
    char msg[128] = {0};
    n = snprintf(msg, sizeof(msg) - 1, "%s", ctime(&t));
    msg[n - 1] = '\0';
    n = sendto(sock_fd, msg, strlen(msg) + 1, 0,
               (const struct sockaddr *)&srv_addr, addr_len);
    if (n < 0) {
      perror("sendto");
      break;
    }
    n = recvfrom(sock_fd, (void *)buf, 4096 - 1, 0,
                 (struct sockaddr *)&srv_addr, &addr_len);
    if (n <= 0) {
      perror("recvfrom");
      break;
    } else {
      buf[n - 1] = '\0';
      printf("client: [%s:%hu]:%s\n", inet_ntoa(cli_addr.sin_addr),
             ntohs(cli_addr.sin_port), buf);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10f0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1040(%rbp),%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   10a0 <memset@plt>
cmpl   $0x2,-0x8(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   10c0 <assert@plt>
mov    0x2d6c(%rip),%rax
mov    (%rax),%edi
mov    0x2d5b(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1150 <socket@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jge    12a9 <main+0x79>
lea    0xd66(%rip),%rdi
call   1110 <perror@plt>
mov    $0xffffffff,%edi
call   1130 <exit@plt>
movl   $0x1,-0x1044(%rbp)
mov    -0x34(%rbp),%edi
mov    0x2d2b(%rip),%rax
mov    (%rax),%esi
mov    0x2d0a(%rip),%rax
mov    (%rax),%edx
lea    -0x1044(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0x0,-0x38(%rbp)
jge    12fd <main+0xcd>
lea    0xd19(%rip),%rdi
call   1110 <perror@plt>
mov    $0xffffffff,%edi
call   1130 <exit@plt>
lea    -0x20(%rbp),%rdi
mov    $0xc,%esi
call   1120 <bzero@plt>
mov    0x2cce(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    $0x1a0a,%edi
call   1070 <htons@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x20(%rbp),%rsi
call   10e0 <inet_aton@plt>
movl   $0xc,-0x3c(%rbp)
movl   $0x5,-0x1048(%rbp)
mov    -0x1048(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1048(%rbp)
cmp    $0x0,%eax
je     14ba <main+0x28a>
mov    $0x1,%edi
call   1140 <sleep@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10d0 <time@plt>
mov    %eax,-0x104c(%rbp)
lea    -0x10d0(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   10a0 <memset@plt>
lea    -0x10d0(%rbp),%rax
mov    %rax,-0x10e8(%rbp)
lea    -0x104c(%rbp),%rdi
call   1050 <ctime@plt>
mov    -0x10e8(%rbp),%rdi
mov    %rax,%rcx
mov    $0x7f,%esi
lea    0xc58(%rip),%rdx
call   1090 <snprintf@plt>
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
sub    $0x1,%eax
cltq
movb   $0x0,-0x10d0(%rbp,%rax,1)
mov    -0x34(%rbp),%eax
mov    %eax,-0x10dc(%rbp)
lea    -0x10d0(%rbp),%rax
mov    %rax,-0x10d8(%rbp)
lea    -0x10d0(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x10dc(%rbp),%edi
mov    -0x10d8(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
lea    -0x20(%rbp),%r8
mov    -0x3c(%rbp),%r9d
xor    %ecx,%ecx
call   10b0 <sendto@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0x0,-0x38(%rbp)
jge    1436 <main+0x206>
lea    0xbe9(%rip),%rdi
call   1110 <perror@plt>
jmp    14ba <main+0x28a>
mov    -0x34(%rbp),%edi
lea    -0x1040(%rbp),%rsi
lea    -0x20(%rbp),%r8
mov    $0xfff,%edx
xor    %ecx,%ecx
lea    -0x3c(%rbp),%r9
call   10f0 <recvfrom@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0x0,-0x38(%rbp)
jg     1472 <main+0x242>
lea    0xbb4(%rip),%rdi
call   1110 <perror@plt>
jmp    14ba <main+0x28a>
mov    -0x38(%rbp),%eax
sub    $0x1,%eax
cltq
movb   $0x0,-0x1040(%rbp,%rax,1)
mov    -0x30(%rbp),%edi
call   1040 <inet_ntoa@plt>
mov    %rax,-0x10f0(%rbp)
mov    -0x2c(%rbp),%edi
call   1100 <ntohs@plt>
mov    -0x10f0(%rbp),%rsi
mov    %eax,%edx
lea    -0x1040(%rbp),%rcx
lea    0xb75(%rip),%rdi
call   1080 <printf@plt>
jmp    1346 <main+0x116>
xor    %eax,%eax
add    $0x10f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10a8,%rsp
mov    %rsi,%r15
mov    %edi,%ebx
lea    0xa0(%rsp),%rdi
mov    $0x1000,%edx
xor    %esi,%esi
call   10a0 <memset@plt>
xor    %edi,%edi
cmp    $0x2,%ebx
setge  %dil
call   10c0 <assert@plt>
mov    0x2d71(%rip),%rbp
mov    0x0(%rbp),%edi
mov    0x2d5f(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1150 <socket@plt>
test   %eax,%eax
js     1424 <main+0x1f4>
mov    %eax,%ebx
movl   $0x1,0xc(%rsp)
mov    0x2d4d(%rip),%rax
mov    (%rax),%esi
mov    0x2d2c(%rip),%rax
mov    (%rax),%edx
lea    0xc(%rsp),%rcx
mov    %ebx,%edi
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
test   %eax,%eax
js     142d <main+0x1fd>
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    $0xc,%esi
call   1120 <bzero@plt>
mov    0x0(%rbp),%eax
mov    %eax,0x18(%rsp)
mov    $0x1a0a,%edi
call   1070 <htons@plt>
mov    %eax,0x14(%rsp)
mov    0x8(%r15),%rdi
mov    %r14,%rsi
call   10e0 <inet_aton@plt>
movl   $0xc,0x4(%rsp)
mov    $0xfffffffc,%r13d
lea    0x20(%rsp),%rbp
lea    0xa0(%rsp),%r15
xchg   %ax,%ax
mov    $0x1,%edi
call   1140 <sleep@plt>
xor    %edi,%edi
call   10d0 <time@plt>
mov    %eax,0x8(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
lea    0x8(%rsp),%rdi
call   1050 <ctime@plt>
mov    %rbp,%rdi
mov    $0x7f,%esi
lea    0xca3(%rip),%rdx
mov    %rax,%rcx
call   1090 <snprintf@plt>
cltq
movb   $0x0,-0x1(%rax,%rbp,1)
mov    %rbp,%rdi
call   1060 <strlen@plt>
lea    0x1(%rax),%rdx
mov    0x4(%rsp),%r9d
mov    %ebx,%edi
mov    %rbp,%rsi
xor    %ecx,%ecx
mov    %r14,%r8
call   10b0 <sendto@plt>
test   %eax,%eax
js     1408 <main+0x1d8>
mov    %ebx,%edi
mov    %r15,%rsi
mov    $0xfff,%edx
xor    %ecx,%ecx
mov    %r14,%r8
lea    0x4(%rsp),%r9
call   10f0 <recvfrom@plt>
test   %eax,%eax
jle    1416 <main+0x1e6>
add    $0xffffffff,%eax
movb   $0x0,0xa0(%rsp,%rax,1)
call   1040 <inet_ntoa@plt>
mov    %rax,%r12
call   1100 <ntohs@plt>
lea    0xc47(%rip),%rdi
mov    %r12,%rsi
mov    %eax,%edx
mov    %r15,%rcx
call   1080 <printf@plt>
inc    %r13d
jne    1310 <main+0xe0>
xor    %eax,%eax
add    $0x10a8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc06(%rip),%rdi
call   1110 <perror@plt>
jmp    13f4 <main+0x1c4>
lea    0xbff(%rip),%rdi
call   1110 <perror@plt>
jmp    13f4 <main+0x1c4>
lea    0xbd5(%rip),%rdi
jmp    1434 <main+0x204>
lea    0xbd3(%rip),%rdi
call   1110 <perror@plt>
mov    $0xffffffff,%edi
call   1130 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, i32, i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@.str = [7 x i8] c"socket\00"
@SOL_SOCKET = global i32 0
@SO_BROADCAST = global i32 0
@.str.1 = [11 x i8] c"setsockopt\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [7 x i8] c"sendto\00"
@.str.4 = [9 x i8] c"recvfrom\00"
@.str.5 = [21 x i8] c"client: [%s:%hu]:%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 %struct.sockaddr_in
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [4096 x i8]
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca [128 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = bitcast [4096 x i8]* %11 to i8*
%17 = load i32, i32* %4
%18 = icmp sge i32 %17, 2
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = load i32, i32* @AF_INET
%22 = load i32, i32* @SOCK_DGRAM
%23 = call i32 @socket(i32 %21, i32 %22, i32 0)
store i32 %23, i32* %8
%24 = load i32, i32* %8
%25 = icmp slt i32 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %2
%27 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%28 = call i32 @exit(i32 -1)
unreachable
29: ; preds = %2
store i32 1, i32* %12
%30 = load i32, i32* %8
%31 = load i32, i32* @SOL_SOCKET
%32 = load i32, i32* @SO_BROADCAST
%33 = call i32 @setsockopt(i32 %30, i32 %31, i32 %32, i32* %12, i32 4)
store i32 %33, i32* %9
%34 = load i32, i32* %9
%35 = icmp slt i32 %34, 0
br i1 %35, label %36, label %39
36: ; preds = %29
%37 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%38 = call i32 @exit(i32 -1)
unreachable
39: ; preds = %29
%40 = call i32 @bzero(%struct.sockaddr_in* %6, i32 12)
%41 = load i32, i32* @AF_INET
%42 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 2
store i32 %41, i32* %42
%43 = call i32 @htons(i32 6666)
%44 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 1
store i32 %43, i32* %44
%45 = load i8**, i8*** %5
%46 = getelementptr inbounds i8*, i8** %45, i64 1
%47 = load i8*, i8** %46
%48 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 0
%49 = call i32 @inet_aton(i8* %47, i32* %48)
store i32 12, i32* %10
store i32 5, i32* %13
br label %50
50: ; preds = %99, %39
%51 = load i32, i32* %13
%52 = add nsw i32 %51, -1
store i32 %52, i32* %13
%53 = icmp ne i32 %52, 0
br i1 %53, label %54, label %100
54: ; preds = %50
%55 = call i32 @sleep(i32 1)
%56 = call i32 @time(i32* null)
store i32 %56, i32* %14
%57 = bitcast [128 x i8]* %15 to i8*
%58 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 0
%59 = call i8* @ctime(i32* %14)
%60 = call i32 @snprintf(i8* %58, i32 127, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %59)
store i32 %60, i32* %9
%61 = load i32, i32* %9
%62 = sub nsw i32 %61, 1
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 %63
store i8 0, i8* %64
%65 = load i32, i32* %8
%66 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 0
%67 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 0
%68 = call i64 @strlen(i8* %67)
%69 = add nsw i64 %68, 1
%70 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%71 = load i32, i32* %10
%72 = call i32 @sendto(i32 %65, i8* %66, i64 %69, i32 0, %struct.sockaddr* %70, i32 %71)
store i32 %72, i32* %9
%73 = load i32, i32* %9
%74 = icmp slt i32 %73, 0
br i1 %74, label %75, label %77
75: ; preds = %54
%76 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %100
77: ; preds = %54
%78 = load i32, i32* %8
%79 = getelementptr inbounds [4096 x i8], [4096 x i8]* %11, i64 0, i64 0
%80 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%81 = call i32 @recvfrom(i32 %78, i8* %79, i32 4095, i32 0, %struct.sockaddr* %80, i32* %10)
store i32 %81, i32* %9
%82 = load i32, i32* %9
%83 = icmp sle i32 %82, 0
br i1 %83, label %84, label %86
84: ; preds = %77
%85 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
br label %100
86: ; preds = %77
%87 = load i32, i32* %9
%88 = sub nsw i32 %87, 1
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [4096 x i8], [4096 x i8]* %11, i64 0, i64 %89
store i8 0, i8* %90
%91 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 0
%92 = load i32, i32* %91
%93 = call i8* @inet_ntoa(i32 %92)
%94 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 1
%95 = load i32, i32* %94
%96 = call i32 @ntohs(i32 %95)
%97 = getelementptr inbounds [4096 x i8], [4096 x i8]* %11, i64 0, i64 0
%98 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %93, i32 %96, i8* %97)
br label %99
99: ; preds = %86
br label %50
100: ; preds = %84, %75, %50
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, i32, i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@.str = [7 x i8] c"socket\00"
@SOL_SOCKET = global i32 0
@SO_BROADCAST = global i32 0
@.str.1 = [11 x i8] c"setsockopt\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [7 x i8] c"sendto\00"
@.str.4 = [9 x i8] c"recvfrom\00"
@.str.5 = [21 x i8] c"client: [%s:%hu]:%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca i32
%5 = alloca [4096 x i8]
%6 = alloca i32
%7 = alloca i32
%8 = alloca [128 x i8]
%9 = bitcast %struct.sockaddr_in* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%12 = icmp sgt i32 %0, 1
%13 = zext i1 %12 to i32
%14 = tail call i32 @assert(i32 %13)
%15 = load i32, i32* @AF_INET
%16 = load i32, i32* @SOCK_DGRAM
%17 = tail call i32 @socket(i32 %15, i32 %16, i32 0)
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %2
%20 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%21 = tail call i32 @exit(i32 -1)
unreachable
22: ; preds = %2
%23 = bitcast i32* %6 to i8*
store i32 1, i32* %6
%24 = load i32, i32* @SOL_SOCKET
%25 = load i32, i32* @SO_BROADCAST
%26 = call i32 @setsockopt(i32 %17, i32 %24, i32 %25, i32* %6, i32 4)
%27 = icmp slt i32 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %22
%29 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%30 = call i32 @exit(i32 -1)
unreachable
31: ; preds = %22
%32 = call i32 @bzero(%struct.sockaddr_in* %3, i32 12)
%33 = load i32, i32* @AF_INET
%34 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i32 %33, i32* %34
%35 = call i32 @htons(i32 6666)
%36 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1
store i32 %35, i32* %36
%37 = getelementptr inbounds i8*, i8** %1, i64 1
%38 = load i8*, i8** %37
%39 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
%40 = call i32 @inet_aton(i8* %38, i32* %39)
store i32 12, i32* %4
%41 = bitcast i32* %7 to i8*
%42 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%43 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
br label %44
44: ; preds = %31, %64
%45 = phi i32 [ 4, %31 ], [ %71, %64 ]
%46 = call i32 @sleep(i32 1)
%47 = call i32 @time(i32* null)
store i32 %47, i32* %7
%48 = call i8* @ctime(i32* %7)
%49 = call i32 @snprintf(i8* %42, i32 127, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %48)
%50 = add nsw i32 %49, -1
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 %51
store i8 0, i8* %52
%53 = call i64 @strlen(i8* %42)
%54 = add nsw i64 %53, 1
%55 = load i32, i32* %4
%56 = call i32 @sendto(i32 %17, i8* %42, i64 %54, i32 0, %struct.sockaddr* %43, i32 %55)
%57 = icmp slt i32 %56, 0
br i1 %57, label %61, label %58
58: ; preds = %44
%59 = call i32 @recvfrom(i32 %17, i8* %11, i32 4095, i32 0, %struct.sockaddr* %43, i32* %4)
%60 = icmp slt i32 %59, 1
br i1 %60, label %61, label %64
61: ; preds = %58, %44
%62 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), %44 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), %58 ]
%63 = call i32 @perror(i8* %62)
br label %73
64: ; preds = %58
%65 = add nsw i32 %59, -1
%66 = zext i32 %65 to i64
%67 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 %66
store i8 0, i8* %67
%68 = call i8* @inet_ntoa(i32 undef)
%69 = call i32 @ntohs(i32 undef)
%70 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %68, i32 %69, i8* %11)
%71 = add nsw i32 %45, -1
%72 = icmp eq i32 %71, 0
br i1 %72, label %73, label %44
73: ; preds = %64, %61
ret i32 0
}