#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_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ s_addr;
};
struct sockaddr_in {
  void *sin_port;
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ si;
typedef int /*<<< orphan*/ msg;
typedef int /*<<< orphan*/ ip;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ MSG_DONTWAIT;
int /*<<< orphan*/ SOCK_DGRAM;
short atoi(char *);
int /*<<< orphan*/ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ close(int);
void *htons(short);
char *inet_ntop(int /*<<< orphan*/, TYPE_1__ *, char *, int);
int /*<<< orphan*/ inet_pton(int /*<<< orphan*/, char *, TYPE_1__ *);
int ntohs(void *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int recvfrom(int, char *, int, int /*<<< orphan*/, struct sockaddr *, int *);
int /*<<< orphan*/ scanf(char *, char *, ...);
int /*<<< orphan*/ sendto(int, char *, int /*<<< orphan*/, int /*<<< orphan*/,
                          struct sockaddr *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int main(int argc, char *argv[]) {
  if (argc != 2) {
    printf("%s port\n", argv[0]);
    return 0;
  }
  int s = socket(AF_INET, SOCK_DGRAM, 0);
  struct sockaddr_in si;
  si.sin_family = AF_INET;
  si.sin_addr.s_addr = INADDR_ANY;
  si.sin_port = htons(atoi(argv[1]));
  bind(s, (struct sockaddr *)&si, sizeof(si));
  char cmd;
  char ip[128];
  short port;
  char msg[1024];
  for (;;) {
    printf("input:");
    scanf(" %c", &cmd);
    if (cmd == 'q')
      break;
    if (cmd == 'w') {
      scanf("%s%hd %[^\n]", ip, &port, msg);
      inet_pton(AF_INET, ip, &si.sin_addr);
      si.sin_port = htons(port);
      sendto(s, msg, strlen(msg), 0, (struct sockaddr *)&si, sizeof(si));
    } else if (cmd == 'r') {
      socklen_t len = sizeof(si);
      int n;
      n = recvfrom(s, msg, sizeof(msg) - 1, MSG_DONTWAIT,
                   (struct sockaddr *)&si, &len);
      if (n < 0)
        puts("no message");
      else {
        msg[n] = '\0';
        printf("%s:%d %s\n", inet_ntop(AF_INET, &si.sin_addr, ip, sizeof(ip)),
               ntohs(si.sin_port), msg);
      }
    } else {
    }
  }
  close(s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4e0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1224 <main+0x44>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xdef(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1437 <main+0x257>
mov    0x2dbd(%rip),%rax
mov    (%rax),%edi
mov    0x2da4(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1100 <socket@plt>
mov    %eax,-0x14(%rbp)
mov    0x2da1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    0x2d8d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10f0 <atoi@plt>
movswl %ax,%edi
call   1060 <htons@plt>
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x28(%rbp),%rsi
mov    $0x10,%edx
call   10e0 <bind@plt>
lea    0xd80(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xd79(%rip),%rdi
lea    -0x29(%rbp),%rsi
mov    $0x0,%al
call   10d0 <scanf@plt>
movsbl -0x29(%rbp),%eax
cmp    $0x71,%eax
jne    12b4 <main+0xd4>
jmp    142f <main+0x24f>
movsbl -0x29(%rbp),%eax
cmp    $0x77,%eax
jne    1359 <main+0x179>
lea    -0xb0(%rbp),%rsi
lea    -0x4c0(%rbp),%rcx
lea    0xd3e(%rip),%rdi
lea    -0xb2(%rbp),%rdx
mov    $0x0,%al
call   10d0 <scanf@plt>
mov    0x2cfd(%rip),%rax
mov    (%rax),%edi
lea    -0xb0(%rbp),%rsi
lea    -0x28(%rbp),%rdx
add    $0x8,%rdx
call   10a0 <inet_pton@plt>
movswl -0xb2(%rbp),%edi
call   1060 <htons@plt>
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4d4(%rbp)
lea    -0x4c0(%rbp),%rax
mov    %rax,-0x4d0(%rbp)
lea    -0x4c0(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x4d4(%rbp),%edi
mov    -0x4d0(%rbp),%rsi
mov    %eax,%edx
lea    -0x28(%rbp),%r8
xor    %ecx,%ecx
mov    $0x10,%r9d
call   1080 <sendto@plt>
jmp    142a <main+0x24a>
movsbl -0x29(%rbp),%eax
cmp    $0x72,%eax
jne    1420 <main+0x240>
movl   $0x10,-0x4c4(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x4c0(%rbp),%rsi
mov    0x2c47(%rip),%rax
mov    (%rax),%ecx
lea    -0x28(%rbp),%r8
mov    $0x3ff,%edx
lea    -0x4c4(%rbp),%r9
call   10b0 <recvfrom@plt>
mov    %eax,-0x4c8(%rbp)
cmpl   $0x0,-0x4c8(%rbp)
jge    13bc <main+0x1dc>
lea    0xc6e(%rip),%rdi
call   1040 <puts@plt>
jmp    141b <main+0x23b>
movslq -0x4c8(%rbp),%rax
movb   $0x0,-0x4c0(%rbp,%rax,1)
mov    0x2c16(%rip),%rax
mov    (%rax),%edi
lea    -0x28(%rbp),%rsi
add    $0x8,%rsi
lea    -0xb0(%rbp),%rdx
mov    $0x80,%ecx
call   1030 <inet_ntop@plt>
mov    %rax,-0x4e0(%rbp)
mov    -0x28(%rbp),%rdi
call   10c0 <ntohs@plt>
mov    -0x4e0(%rbp),%rsi
mov    %eax,%edx
lea    -0x4c0(%rbp),%rcx
lea    0xc17(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1425 <main+0x245>
jmp    1425 <main+0x245>
jmp    142a <main+0x24a>
jmp    1282 <main+0xa2>
mov    -0x14(%rbp),%edi
call   1090 <close@plt>
mov    -0x4(%rbp),%eax
add    $0x4e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x4b8,%rsp
mov    %rsi,%r14
cmp    $0x2,%edi
jne    13b3 <main+0x1d3>
mov    0x2de4(%rip),%rbp
mov    0x0(%rbp),%edi
mov    0x2dca(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1100 <socket@plt>
mov    %eax,%ebx
mov    0x0(%rbp),%eax
mov    %eax,0x24(%rsp)
mov    0x2db9(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x20(%rsp)
mov    0x8(%r14),%rdi
call   10f0 <atoi@plt>
movswl %ax,%edi
call   1060 <htons@plt>
mov    %rax,0x18(%rsp)
lea    0x18(%rsp),%r15
mov    %ebx,0x10(%rsp)
mov    %ebx,%edi
mov    %r15,%rsi
mov    $0x10,%edx
call   10e0 <bind@plt>
lea    0xda7(%rip),%r12
lea    0xda7(%rip),%r14
jmp    12d6 <main+0xf6>
nopl   0x0(%rax,%rax,1)
lea    0xd9d(%rip),%rdi
lea    0x30(%rsp),%r13
mov    %r13,%rsi
lea    0x16(%rsp),%rdx
lea    0xb0(%rsp),%rbx
mov    %rbx,%rcx
xor    %eax,%eax
call   10d0 <scanf@plt>
mov    0x0(%rbp),%edi
mov    %r13,%rsi
lea    0x20(%rsp),%rdx
call   10a0 <inet_pton@plt>
movswl 0x16(%rsp),%edi
call   1060 <htons@plt>
mov    %rax,0x18(%rsp)
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    0x10(%rsp),%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
mov    %r15,%r8
mov    $0x10,%r9d
call   1080 <sendto@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r14,%rdi
lea    0xf(%rsp),%rsi
xor    %eax,%eax
call   10d0 <scanf@plt>
movzbl 0xf(%rsp),%eax
cmp    $0x72,%al
je     1310 <main+0x130>
cmp    $0x77,%al
je     1270 <main+0x90>
cmp    $0x71,%al
jne    12d6 <main+0xf6>
jmp    13c6 <main+0x1e6>
nopl   0x0(%rax)
movl   $0x10,0x2c(%rsp)
mov    0x2ca9(%rip),%rax
mov    (%rax),%ecx
mov    0x10(%rsp),%edi
lea    0xb0(%rsp),%rbx
mov    %rbx,%rsi
mov    $0x3ff,%edx
mov    %r15,%r8
lea    0x2c(%rsp),%r9
call   10b0 <recvfrom@plt>
test   %eax,%eax
js     13a2 <main+0x1c2>
mov    %eax,%eax
movb   $0x0,0xb0(%rsp,%rax,1)
mov    0x0(%rbp),%edi
lea    0x20(%rsp),%rsi
lea    0x30(%rsp),%rdx
mov    $0x80,%ecx
call   1030 <inet_ntop@plt>
mov    %r12,%r13
mov    %r15,%r12
mov    %rax,%r15
mov    0x18(%rsp),%rdi
call   10c0 <ntohs@plt>
lea    0xcaa(%rip),%rdi
mov    %r15,%rsi
mov    %r12,%r15
mov    %r13,%r12
lea    0xc7f(%rip),%r14
mov    %eax,%edx
mov    %rbx,%rcx
xor    %eax,%eax
call   1070 <printf@plt>
jmp    12d6 <main+0xf6>
lea    0xc77(%rip),%rdi
call   1040 <puts@plt>
jmp    12d6 <main+0xf6>
mov    (%r14),%rsi
lea    0xc43(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    13cf <main+0x1ef>
mov    0x10(%rsp),%edi
call   1090 <close@plt>
xor    %eax,%eax
add    $0x4b8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i8*, %struct.TYPE_3__, i32 }
%struct.TYPE_3__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [9 x i8] c"%s port\0A\00"
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@INADDR_ANY = global i32 0
@.str.1 = [7 x i8] c"input:\00"
@.str.2 = [4 x i8] c" %c\00"
@.str.3 = [12 x i8] c"%s%hd %[^\0A]\00"
@MSG_DONTWAIT = global i32 0
@.str.4 = [11 x i8] c"no message\00"
@.str.5 = [10 x i8] c"%s:%d %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca %struct.sockaddr_in
%8 = alloca i8
%9 = alloca [128 x i8]
%10 = alloca i16
%11 = alloca [1024 x i8]
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 2
br i1 %15, label %16, label %21
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %19)
store i32 0, i32* %3
br label %101
21: ; preds = %2
%22 = load i32, i32* @AF_INET
%23 = load i32, i32* @SOCK_DGRAM
%24 = call i32 @socket(i32 %22, i32 %23, i32 0)
store i32 %24, i32* %6
%25 = load i32, i32* @AF_INET
%26 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 2
store i32 %25, i32* %26
%27 = load i32, i32* @INADDR_ANY
%28 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 1
%29 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %28, i32 0, i32 0
store i32 %27, i32* %29
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call signext i16 @atoi(i8* %32)
%34 = call i8* @htons(i16 signext %33)
%35 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 0
store i8* %34, i8** %35
%36 = load i32, i32* %6
%37 = bitcast %struct.sockaddr_in* %7 to %struct.sockaddr*
%38 = call i32 @bind(i32 %36, %struct.sockaddr* %37, i32 16)
br label %39
39: ; preds = %97, %21
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%41 = call i32 (i8*, i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%42 = load i8, i8* %8
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 113
br i1 %44, label %45, label %46
45: ; preds = %39
br label %98
46: ; preds = %39
%47 = load i8, i8* %8
%48 = sext i8 %47 to i32
%49 = icmp eq i32 %48, 119
br i1 %49, label %50, label %67
50: ; preds = %46
%51 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%52 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%53 = call i32 (i8*, i8*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* %51, i16* %10, i8* %52)
%54 = load i32, i32* @AF_INET
%55 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%56 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 1
%57 = call i32 @inet_pton(i32 %54, i8* %55, %struct.TYPE_3__* %56)
%58 = load i16, i16* %10
%59 = call i8* @htons(i16 signext %58)
%60 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 0
store i8* %59, i8** %60
%61 = load i32, i32* %6
%62 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%63 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%64 = call i32 @strlen(i8* %63)
%65 = bitcast %struct.sockaddr_in* %7 to %struct.sockaddr*
%66 = call i32 @sendto(i32 %61, i8* %62, i32 %64, i32 0, %struct.sockaddr* %65, i32 16)
br label %97
67: ; preds = %46
%68 = load i8, i8* %8
%69 = sext i8 %68 to i32
%70 = icmp eq i32 %69, 114
br i1 %70, label %71, label %95
71: ; preds = %67
store i32 16, i32* %12
%72 = load i32, i32* %6
%73 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%74 = load i32, i32* @MSG_DONTWAIT
%75 = bitcast %struct.sockaddr_in* %7 to %struct.sockaddr*
%76 = call i32 @recvfrom(i32 %72, i8* %73, i32 1023, i32 %74, %struct.sockaddr* %75, i32* %12)
store i32 %76, i32* %13
%77 = load i32, i32* %13
%78 = icmp slt i32 %77, 0
br i1 %78, label %79, label %81
79: ; preds = %71
%80 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
br label %94
81: ; preds = %71
%82 = load i32, i32* %13
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 %83
store i8 0, i8* %84
%85 = load i32, i32* @AF_INET
%86 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 1
%87 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%88 = call i8* @inet_ntop(i32 %85, %struct.TYPE_3__* %86, i8* %87, i32 128)
%89 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 0
%90 = load i8*, i8** %89
%91 = call i32 @ntohs(i8* %90)
%92 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8* %88, i32 %91, i8* %92)
br label %94
94: ; preds = %81, %79
br label %96
95: ; preds = %67
br label %96
96: ; preds = %95, %94
br label %97
97: ; preds = %96, %50
br label %39
98: ; preds = %45
%99 = load i32, i32* %6
%100 = call i32 @close(i32 %99)
br label %101
101: ; preds = %98, %16
%102 = load i32, i32* %3
ret i32 %102
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i8*, %struct.TYPE_3__, i32 }
%struct.TYPE_3__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [9 x i8] c"%s port\0A\00"
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@INADDR_ANY = global i32 0
@.str.1 = [7 x i8] c"input:\00"
@.str.2 = [4 x i8] c" %c\00"
@.str.3 = [12 x i8] c"%s%hd %[^\0A]\00"
@MSG_DONTWAIT = global i32 0
@.str.4 = [11 x i8] c"no message\00"
@.str.5 = [10 x i8] c"%s:%d %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca i8
%5 = alloca [128 x i8]
%6 = alloca i16
%7 = alloca [1024 x i8]
%8 = alloca i32
%9 = icmp eq i32 %0, 2
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = load i8*, i8** %1
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %64
13: ; preds = %2
%14 = load i32, i32* @AF_INET
%15 = load i32, i32* @SOCK_DGRAM
%16 = tail call i32 @socket(i32 %14, i32 %15, i32 0)
%17 = bitcast %struct.sockaddr_in* %3 to i8*
%18 = load i32, i32* @AF_INET
%19 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i32 %18, i32* %19
%20 = load i32, i32* @INADDR_ANY
%21 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1
%22 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %21, i64 0, i32 0
store i32 %20, i32* %22
%23 = getelementptr inbounds i8*, i8** %1, i64 1
%24 = load i8*, i8** %23
%25 = tail call signext i16 @atoi(i8* %24)
%26 = tail call i8* @htons(i16 signext %25)
%27 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
store i8* %26, i8** %27
%28 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%29 = call i32 @bind(i32 %16, %struct.sockaddr* %28, i32 16)
%30 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%31 = bitcast i16* %6 to i8*
%32 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%33 = bitcast i32* %8 to i8*
br label %34
34: ; preds = %38, %13
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%36 = call i32 (i8*, i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%37 = load i8, i8* %4
switch i8 %37, label %38 [
i8 113, label %62
i8 119, label %39
i8 114, label %47
]
38: ; preds = %34, %61, %39
br label %34
39: ; preds = %34
%40 = call i32 (i8*, i8*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* %30, i16* %6, i8* %32)
%41 = load i32, i32* @AF_INET
%42 = call i32 @inet_pton(i32 %41, i8* %30, %struct.TYPE_3__* %21)
%43 = load i16, i16* %6
%44 = call i8* @htons(i16 signext %43)
store i8* %44, i8** %27
%45 = call i32 @strlen(i8* %32)
%46 = call i32 @sendto(i32 %16, i8* %32, i32 %45, i32 0, %struct.sockaddr* %28, i32 16)
br label %38
47: ; preds = %34
store i32 16, i32* %8
%48 = load i32, i32* @MSG_DONTWAIT
%49 = call i32 @recvfrom(i32 %16, i8* %32, i32 1023, i32 %48, %struct.sockaddr* %28, i32* %8)
%50 = icmp slt i32 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %47
%52 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
br label %61
53: ; preds = %47
%54 = zext i32 %49 to i64
%55 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 %54
store i8 0, i8* %55
%56 = load i32, i32* @AF_INET
%57 = call i8* @inet_ntop(i32 %56, %struct.TYPE_3__* %21, i8* %30, i32 128)
%58 = load i8*, i8** %27
%59 = call i32 @ntohs(i8* %58)
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8* %57, i32 %59, i8* %32)
br label %61
61: ; preds = %53, %51
br label %38
62: ; preds = %34
%63 = call i32 @close(i32 %16)
br label %64
64: ; preds = %62, %10
ret i32 0
}