#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 */
struct sockaddr_storage {
  int dummy;
};
struct sockaddr {
  int dummy;
};
struct addrinfo {
  int /*<<< orphan*/ ai_addrlen;
  int /*<<< orphan*/ *ai_addr;
  scalar_t__ ai_protocol;
  int /*<<< orphan*/ ai_socktype;
  int /*<<< orphan*/ ai_family;
  struct addrinfo *ai_next;
  scalar_t__ ai_canonname;
  int /*<<< orphan*/ ai_flags;
};
typedef int socklen_t;

/* Variables and functions */
int /*<<< orphan*/ AF_UNSPEC;
int /*<<< orphan*/ AI_PASSIVE;
int NI_MAXHOST;
int NI_MAXSERV;
int /*<<< orphan*/ NI_NUMERICSERV;
int /*<<< orphan*/ SOCK_DGRAM;
scalar_t__ bind(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ freeaddrinfo(struct addrinfo *);
int /*<<< orphan*/ getaddrinfo(int /*<<< orphan*/ *, char *, struct addrinfo *,
                               struct addrinfo **);
int getnameinfo(struct sockaddr *, int, char *, int, char *, int,
                int /*<<< orphan*/);
int /*<<< orphan*/ memset(struct addrinfo *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int recvfrom(int, char *, int, int /*<<< orphan*/, struct sockaddr *, int *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, scalar_t__);
int main(int argc, char *argv[]) {
  struct addrinfo hints;
  struct addrinfo *result, *rp;
  struct sockaddr_storage peer_addr;
  int sfd, s, nread;
  socklen_t peer_addr_len;
  char buf[500];
  memset(&hints, 0, sizeof(struct addrinfo));
  hints.ai_family = AF_UNSPEC;
  hints.ai_socktype = SOCK_DGRAM;
  hints.ai_flags = AI_PASSIVE;
  hints.ai_protocol = 0;
  hints.ai_canonname = 0;
  hints.ai_addr = NULL;
  hints.ai_next = NULL;
  getaddrinfo(NULL, argv[1], &hints, &result);
  for (rp = result; rp != NULL; rp = rp->ai_next) {
    sfd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol);
    if (sfd == -1)
      continue;
    if (bind(sfd, rp->ai_addr, rp->ai_addrlen) == 0)
      break;
    close(sfd);
  }
  if (rp == NULL) {
    printf("Couldn't bind\n");
    exit(-1);
  }
  freeaddrinfo(result);
  for (;;) {
    peer_addr_len = sizeof(struct sockaddr_storage);
    nread = recvfrom(sfd, buf, 500, 0, (struct sockaddr *)&peer_addr,
                     &peer_addr_len);
    if (nread == -1)
      continue;
    char host[NI_MAXHOST], service[NI_MAXSERV];
    s = getnameinfo((struct sockaddr *)&peer_addr, peer_addr_len, host,
                    NI_MAXHOST, service, NI_MAXSERV, NI_NUMERICSERV);
    if (s == 0)
      printf("Received %ld bytes from %s:%s\n", (long)nread, host, service);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2a0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x48(%rbp),%rdi
xor    %esi,%esi
mov    $0x38,%edx
call   1040 <memset@plt>
mov    0x2e08(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    0x2dec(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    0x2df8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
xor    %eax,%eax
mov    %eax,%edi
lea    -0x48(%rbp),%rdx
lea    -0x50(%rbp),%rcx
call   10a0 <getaddrinfo@plt>
mov    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
je     12a4 <main+0x104>
mov    -0x58(%rbp),%rax
mov    0x1c(%rax),%edi
mov    -0x58(%rbp),%rax
mov    0x18(%rax),%esi
mov    -0x58(%rbp),%rax
mov    0x10(%rax),%rdx
call   10c0 <socket@plt>
mov    %eax,-0x64(%rbp)
cmpl   $0xffffffff,-0x64(%rbp)
jne    1266 <main+0xc6>
jmp    1293 <main+0xf3>
mov    -0x64(%rbp),%edi
mov    -0x58(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x58(%rbp),%rax
mov    (%rax),%edx
call   1080 <bind@plt>
cmp    $0x0,%rax
jne    128b <main+0xeb>
jmp    12a4 <main+0x104>
mov    -0x64(%rbp),%edi
call   1050 <close@plt>
mov    -0x58(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x58(%rbp)
jmp    122e <main+0x8e>
cmpq   $0x0,-0x58(%rbp)
jne    12c7 <main+0x127>
lea    0xd4a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1090 <exit@plt>
mov    -0x50(%rbp),%rdi
call   10b0 <freeaddrinfo@plt>
movl   $0x4,-0x70(%rbp)
mov    -0x64(%rbp),%edi
lea    -0x270(%rbp),%rsi
lea    -0x60(%rbp),%r8
mov    $0x1f4,%edx
xor    %ecx,%ecx
lea    -0x70(%rbp),%r9
call   1070 <recvfrom@plt>
mov    %eax,-0x6c(%rbp)
cmpl   $0xffffffff,-0x6c(%rbp)
jne    1307 <main+0x167>
jmp    12d0 <main+0x130>
mov    0x2caa(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x278(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdx
sub    %rcx,%rdx
mov    %rdx,-0x298(%rbp)
mov    %rdx,%rsp
mov    %rax,-0x280(%rbp)
mov    0x2c8d(%rip),%rax
mov    (%rax),%eax
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%r8
sub    %rcx,%r8
mov    %r8,-0x290(%rbp)
mov    %r8,%rsp
mov    %rax,-0x288(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x70(%rbp),%esi
mov    0x2c43(%rip),%rax
mov    (%rax),%ecx
mov    0x2c52(%rip),%rax
mov    (%rax),%r9d
mov    0x2c60(%rip),%rax
mov    (%rax),%eax
sub    $0x10,%rsp
mov    %eax,(%rsp)
call   1060 <getnameinfo@plt>
add    $0x10,%rsp
mov    %eax,-0x68(%rbp)
cmpl   $0x0,-0x68(%rbp)
jne    13c7 <main+0x227>
mov    -0x290(%rbp),%rcx
mov    -0x298(%rbp),%rdx
movslq -0x6c(%rbp),%rsi
lea    0xc4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x278(%rbp),%rax
mov    %rax,%rsp
jmp    12d0 <main+0x130>

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x248,%rsp
mov    %rsi,%rbx
lea    -0x78(%rbp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x38,%edx
call   1050 <memset@plt>
mov    0x2df7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x5c(%rbp)
mov    0x2ddb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x60(%rbp)
mov    0x2de7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x48(%rbp)
xorps  %xmm0,%xmm0
movups %xmm0,-0x70(%rbp)
movups %xmm0,-0x58(%rbp)
mov    0x8(%rbx),%rsi
lea    -0x38(%rbp),%rcx
xor    %edi,%edi
mov    %r14,%rdx
call   10b0 <getaddrinfo@plt>
mov    -0x38(%rbp),%r14
jmp    123c <main+0x8c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r15d,%edi
call   1060 <close@plt>
mov    0x20(%r14),%r14
test   %r14,%r14
je     1347 <main+0x197>
mov    0x1c(%r14),%edi
mov    0x18(%r14),%esi
mov    0x10(%r14),%rdx
call   10d0 <socket@plt>
cmp    $0xffffffff,%eax
je     1238 <main+0x88>
mov    %eax,%r15d
mov    0x8(%r14),%rsi
mov    (%r14),%edx
mov    %eax,%edi
call   1090 <bind@plt>
test   %rax,%rax
jne    1230 <main+0x80>
mov    -0x38(%rbp),%rdi
call   10c0 <freeaddrinfo@plt>
lea    -0x40(%rbp),%rbx
mov    %r15d,-0x30(%rbp)
jmp    1297 <main+0xe7>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r15,%rsp
mov    -0x30(%rbp),%r15d
movl   $0x4,-0x2c(%rbp)
mov    %r15d,%edi
lea    -0x270(%rbp),%rsi
mov    $0x1f4,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
lea    -0x2c(%rbp),%r9
call   1080 <recvfrom@plt>
cmp    $0xffffffff,%eax
je     1297 <main+0xe7>
mov    %eax,%r13d
mov    %rsp,%r15
mov    0x2ceb(%rip),%rcx
mov    (%rcx),%eax
mov    %rbx,%rdi
mov    %rsp,%r14
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r14
mov    %r14,%rsp
mov    0x2ce6(%rip),%rax
mov    (%rax),%r9d
mov    %rsp,%r12
mov    %r9,%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
mov    -0x2c(%rbp),%esi
mov    (%rcx),%ecx
mov    0x2cdb(%rip),%rax
mov    (%rax),%eax
sub    $0x8,%rsp
mov    %r14,%rdx
mov    %r12,%r8
push   %rax
call   1070 <getnameinfo@plt>
add    $0x10,%rsp
test   %eax,%eax
jne    1290 <main+0xe0>
movslq %r13d,%rsi
lea    0xccb(%rip),%rdi
mov    %r14,%rdx
mov    %r12,%rcx
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1290 <main+0xe0>
lea    0xcd1(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
%struct.addrinfo = type { i32, i32*, i64, i32, i32, %struct.addrinfo*, i64, i32 }
%struct.sockaddr_storage = type { i32 }
%struct.sockaddr = type { i32 }
@AF_UNSPEC = global i32 0
@SOCK_DGRAM = global i32 0
@AI_PASSIVE = global i32 0
@.str = [15 x i8] c"Couldn't bind\0A\00"
@NI_MAXHOST = global i32 0
@NI_MAXSERV = global i32 0
@NI_NUMERICSERV = global i32 0
@.str.1 = [31 x i8] c"Received %ld bytes from %s:%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.addrinfo
%7 = alloca %struct.addrinfo*
%8 = alloca %struct.addrinfo*
%9 = alloca %struct.sockaddr_storage
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca [500 x i8]
%15 = alloca i8*
%16 = alloca i64
%17 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%18 = call i32 @memset(%struct.addrinfo* %6, i32 0, i32 56)
%19 = load i32, i32* @AF_UNSPEC
%20 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %6, i32 0, i32 4
store i32 %19, i32* %20
%21 = load i32, i32* @SOCK_DGRAM
%22 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %6, i32 0, i32 3
store i32 %21, i32* %22
%23 = load i32, i32* @AI_PASSIVE
%24 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %6, i32 0, i32 7
store i32 %23, i32* %24
%25 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %6, i32 0, i32 2
store i64 0, i64* %25
%26 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %6, i32 0, i32 6
store i64 0, i64* %26
%27 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %6, i32 0, i32 1
store i32* null, i32** %27
%28 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %6, i32 0, i32 5
store %struct.addrinfo* null, %struct.addrinfo** %28
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 1
%31 = load i8*, i8** %30
%32 = call i32 @getaddrinfo(i32* null, i8* %31, %struct.addrinfo* %6, %struct.addrinfo** %7)
%33 = load %struct.addrinfo*, %struct.addrinfo** %7
store %struct.addrinfo* %33, %struct.addrinfo** %8
br label %34
34: ; preds = %65, %2
%35 = load %struct.addrinfo*, %struct.addrinfo** %8
%36 = icmp ne %struct.addrinfo* %35, null
br i1 %36, label %37, label %69
37: ; preds = %34
%38 = load %struct.addrinfo*, %struct.addrinfo** %8
%39 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %38, i32 0, i32 4
%40 = load i32, i32* %39
%41 = load %struct.addrinfo*, %struct.addrinfo** %8
%42 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %41, i32 0, i32 3
%43 = load i32, i32* %42
%44 = load %struct.addrinfo*, %struct.addrinfo** %8
%45 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %44, i32 0, i32 2
%46 = load i64, i64* %45
%47 = call i32 @socket(i32 %40, i32 %43, i64 %46)
store i32 %47, i32* %10
%48 = load i32, i32* %10
%49 = icmp eq i32 %48, -1
br i1 %49, label %50, label %51
50: ; preds = %37
br label %65
51: ; preds = %37
%52 = load i32, i32* %10
%53 = load %struct.addrinfo*, %struct.addrinfo** %8
%54 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %53, i32 0, i32 1
%55 = load i32*, i32** %54
%56 = load %struct.addrinfo*, %struct.addrinfo** %8
%57 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %56, i32 0, i32 0
%58 = load i32, i32* %57
%59 = call i64 @bind(i32 %52, i32* %55, i32 %58)
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %62
61: ; preds = %51
br label %69
62: ; preds = %51
%63 = load i32, i32* %10
%64 = call i32 @close(i32 %63)
br label %65
65: ; preds = %62, %50
%66 = load %struct.addrinfo*, %struct.addrinfo** %8
%67 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %66, i32 0, i32 5
%68 = load %struct.addrinfo*, %struct.addrinfo** %67
store %struct.addrinfo* %68, %struct.addrinfo** %8
br label %34
69: ; preds = %61, %34
%70 = load %struct.addrinfo*, %struct.addrinfo** %8
%71 = icmp eq %struct.addrinfo* %70, null
br i1 %71, label %72, label %75
72: ; preds = %69
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%74 = call i32 @exit(i32 -1)
unreachable
75: ; preds = %69
%76 = load %struct.addrinfo*, %struct.addrinfo** %7
%77 = call i32 @freeaddrinfo(%struct.addrinfo* %76)
br label %78
78: ; preds = %106, %85, %75
store i32 4, i32* %13
%79 = load i32, i32* %10
%80 = getelementptr inbounds [500 x i8], [500 x i8]* %14, i64 0, i64 0
%81 = bitcast %struct.sockaddr_storage* %9 to %struct.sockaddr*
%82 = call i32 @recvfrom(i32 %79, i8* %80, i32 500, i32 0, %struct.sockaddr* %81, i32* %13)
store i32 %82, i32* %12
%83 = load i32, i32* %12
%84 = icmp eq i32 %83, -1
br i1 %84, label %85, label %86
85: ; preds = %78
br label %78
86: ; preds = %78
%87 = load i32, i32* @NI_MAXHOST
%88 = zext i32 %87 to i64
%89 = call i8* @llvm.stacksave()
store i8* %89, i8** %15
%90 = alloca i8, i64 %88
store i64 %88, i64* %16
%91 = load i32, i32* @NI_MAXSERV
%92 = zext i32 %91 to i64
%93 = alloca i8, i64 %92
store i64 %92, i64* %17
%94 = bitcast %struct.sockaddr_storage* %9 to %struct.sockaddr*
%95 = load i32, i32* %13
%96 = load i32, i32* @NI_MAXHOST
%97 = load i32, i32* @NI_MAXSERV
%98 = load i32, i32* @NI_NUMERICSERV
%99 = call i32 @getnameinfo(%struct.sockaddr* %94, i32 %95, i8* %90, i32 %96, i8* %93, i32 %97, i32 %98)
store i32 %99, i32* %11
%100 = load i32, i32* %11
%101 = icmp eq i32 %100, 0
br i1 %101, label %102, label %106
102: ; preds = %86
%103 = load i32, i32* %12
%104 = sext i32 %103 to i64
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i64 %104, i8* %90, i8* %93)
br label %106
106: ; preds = %102, %86
%107 = load i8*, i8** %15
br label %78
}

LLVM IR (-O2):
%struct.addrinfo = type { i32, i32*, i64, i32, i32, %struct.addrinfo*, i64, i32 }
%struct.sockaddr_storage = type { i32 }
%struct.sockaddr = type { i32 }
@AF_UNSPEC = global i32 0
@SOCK_DGRAM = global i32 0
@AI_PASSIVE = global i32 0
@NI_MAXHOST = global i32 0
@NI_MAXSERV = global i32 0
@NI_NUMERICSERV = global i32 0
@.str.1 = [31 x i8] c"Received %ld bytes from %s:%s\0A\00"
@str = [14 x i8] c"Couldn't bind\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.addrinfo
%4 = alloca %struct.addrinfo*
%5 = alloca %struct.sockaddr_storage
%6 = alloca i32
%7 = alloca [500 x i8]
%8 = bitcast %struct.addrinfo* %3 to i8*
%9 = bitcast %struct.addrinfo** %4 to i8*
%10 = bitcast %struct.sockaddr_storage* %5 to i8*
%11 = bitcast i32* %6 to i8*
%12 = getelementptr inbounds [500 x i8], [500 x i8]* %7, i64 0, i64 0
%13 = call i32 @memset(%struct.addrinfo* %3, i32 0, i32 56)
%14 = load i32, i32* @AF_UNSPEC
%15 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 4
store i32 %14, i32* %15
%16 = load i32, i32* @SOCK_DGRAM
%17 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 3
store i32 %16, i32* %17
%18 = load i32, i32* @AI_PASSIVE
%19 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 7
store i32 %18, i32* %19
%20 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 1
%21 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 5
%22 = getelementptr inbounds i8*, i8** %1, i64 1
%23 = bitcast i32** %20 to i8*
%24 = bitcast %struct.addrinfo** %21 to i8*
%25 = load i8*, i8** %22
%26 = call i32 @getaddrinfo(i32* null, i8* %25, %struct.addrinfo* %3, %struct.addrinfo** %4)
%27 = load %struct.addrinfo*, %struct.addrinfo** %4
%28 = icmp eq %struct.addrinfo* %27, null
br i1 %28, label %52, label %29
29: ; preds = %2, %48
%30 = phi %struct.addrinfo* [ %50, %48 ], [ %27, %2 ]
%31 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %30, i64 0, i32 4
%32 = load i32, i32* %31
%33 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %30, i64 0, i32 3
%34 = load i32, i32* %33
%35 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %30, i64 0, i32 2
%36 = load i64, i64* %35
%37 = call i32 @socket(i32 %32, i32 %34, i64 %36)
%38 = icmp eq i32 %37, -1
br i1 %38, label %48, label %39
39: ; preds = %29
%40 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %30, i64 0, i32 1
%41 = load i32*, i32** %40
%42 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %30, i64 0, i32 0
%43 = load i32, i32* %42
%44 = call i64 @bind(i32 %37, i32* %41, i32 %43)
%45 = icmp eq i64 %44, 0
br i1 %45, label %55, label %46
46: ; preds = %39
%47 = call i32 @close(i32 %37)
br label %48
48: ; preds = %29, %46
%49 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %30, i64 0, i32 5
%50 = load %struct.addrinfo*, %struct.addrinfo** %49
%51 = icmp eq %struct.addrinfo* %50, null
br i1 %51, label %52, label %29
52: ; preds = %48, %2
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%54 = call i32 @exit(i32 -1)
unreachable
55: ; preds = %39
%56 = load %struct.addrinfo*, %struct.addrinfo** %4
%57 = call i32 @freeaddrinfo(%struct.addrinfo* %56)
%58 = bitcast %struct.sockaddr_storage* %5 to %struct.sockaddr*
br label %59
59: ; preds = %79, %55
store i32 4, i32* %6
%60 = call i32 @recvfrom(i32 %37, i8* %12, i32 500, i32 0, %struct.sockaddr* %58, i32* %6)
%61 = icmp eq i32 %60, -1
br i1 %61, label %79, label %62
62: ; preds = %59
%63 = load i32, i32* @NI_MAXHOST
%64 = zext i32 %63 to i64
%65 = call i8* @llvm.stacksave()
%66 = alloca i8, i64 %64
%67 = load i32, i32* @NI_MAXSERV
%68 = zext i32 %67 to i64
%69 = alloca i8, i64 %68
%70 = load i32, i32* %6
%71 = load i32, i32* @NI_MAXHOST
%72 = load i32, i32* @NI_NUMERICSERV
%73 = call i32 @getnameinfo(%struct.sockaddr* %58, i32 %70, i8* %66, i32 %71, i8* %69, i32 %67, i32 %72)
%74 = icmp eq i32 %73, 0
br i1 %74, label %75, label %78
75: ; preds = %62
%76 = sext i32 %60 to i64
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i64 %76, i8* %66, i8* %69)
br label %78
78: ; preds = %75, %62
br label %79
79: ; preds = %78, %59
br label %59
}