#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_6__ TYPE_3__;
typedef struct TYPE_5__ TYPE_2__;
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
typedef scalar_t__ uint32_t;
struct TYPE_4__ {
  int s_addr;
};
struct sockaddr_in {
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_port;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
struct TYPE_6__ {
  int s_addr;
};
struct TYPE_5__ {
  int /*<<< orphan*/ s_addr;
};
struct ip_mreq {
  TYPE_3__ imr_interface;
  TYPE_2__ imr_multiaddr;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ mreq;
typedef int /*<<< orphan*/ message;
typedef int /*<<< orphan*/ data;
typedef int /*<<< orphan*/ crc;
typedef int /*<<< orphan*/ addr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ INADDR_ANY;
int INET6_ADDRSTRLEN;
int /*<<< orphan*/ IPPROTO_IP;
int /*<<< orphan*/ IP_ADD_MEMBERSHIP;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ adler32(scalar_t__);
scalar_t__ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, scalar_t__, int,
                           scalar_t__, scalar_t__);
int /*<<< orphan*/ get_ip_str(struct sockaddr *, char *);
int htonl(int /*<<< orphan*/);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ inet_addr(char *);
int /*<<< orphan*/ memset(struct sockaddr_in *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ puts(char *);
int recvfrom(int, char *, int, int /*<<< orphan*/, struct sockaddr *, int *);
scalar_t__ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                      struct ip_mreq *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int main(void) {
  struct sockaddr_in addr;
  struct ip_mreq mreq;
  uint32_t data, crc;
  socklen_t addrlen;
  char message[sizeof(data) + sizeof(crc)], addrstr[INET6_ADDRSTRLEN];
  int sock, ret;
  if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
    perror("socket() failed");
    exit(EXIT_SUCCESS);
  }
  memset(&addr, 0, sizeof(addr));
  addr.sin_family = AF_INET;
  addr.sin_port = htons(2015);
  addr.sin_addr.s_addr = htonl(INADDR_ANY);
  addrlen = sizeof(addr);
  if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
    perror("bind() failed");
    close(sock);
    exit(EXIT_FAILURE);
  }
  mreq.imr_multiaddr.s_addr = inet_addr("224.0.0.3");
  mreq.imr_interface.s_addr = htonl(INADDR_ANY);
  if (setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) <
      0) {
    perror("setsockopt() failed");
    close(sock);
    exit(EXIT_FAILURE);
  }
  if (recvfrom(sock, message, sizeof(message), 0, (struct sockaddr *)&addr,
               &addrlen) != (sizeof(data) + sizeof(crc))) {
    perror("recvfrom() failed");
    close(sock);
    exit(EXIT_FAILURE);
  }
  close(sock);
  data = *(uint32_t *)message;
  crc = *(uint32_t *)(message + 4);
  if (crc != htonl(adler32(data))) {
    fprintf(stderr, "0x%x != 0x%x (0x%x 0x%x)\n", crc, htonl(adler32(data)),
            data, crc);
    exit(EXIT_FAILURE);
  }
  get_ip_str((struct sockaddr *)&addr, addrstr);
  puts(addrstr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ddf(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x60(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x50(%rbp)
mov    0x2da3(%rip),%rax
mov    (%rax),%edi
mov    0x2d82(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1110 <socket@plt>
mov    %eax,-0x54(%rbp)
cmp    $0x0,%eax
jge    126d <main+0x7d>
lea    0xda6(%rip),%rdi
call   10e0 <perror@plt>
mov    0x2d3a(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1070 <memset@plt>
mov    0x2d54(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    $0x7df,%edi
call   1050 <htons@plt>
mov    %eax,-0xc(%rbp)
mov    0x2d2b(%rip),%rax
mov    (%rax),%edi
call   1060 <htonl@plt>
mov    %eax,-0x10(%rbp)
movl   $0xc,-0x2c(%rbp)
mov    -0x54(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0xc,%edx
call   10d0 <bind@plt>
cmp    $0x0,%rax
jge    12eb <main+0xfb>
lea    0xd40(%rip),%rdi
call   10e0 <perror@plt>
mov    -0x54(%rbp),%edi
call   1080 <close@plt>
mov    0x2cc4(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
lea    0xd2c(%rip),%rdi
call   1090 <inet_addr@plt>
mov    %eax,-0x14(%rbp)
mov    0x2cc7(%rip),%rax
mov    (%rax),%edi
call   1060 <htonl@plt>
mov    %eax,-0x18(%rbp)
mov    -0x54(%rbp),%edi
mov    0x2cbb(%rip),%rax
mov    (%rax),%esi
mov    0x2cc2(%rip),%rax
mov    (%rax),%edx
lea    -0x18(%rbp),%rcx
mov    $0x8,%r8d
call   1040 <setsockopt@plt>
cmp    $0x0,%rax
jge    135b <main+0x16b>
lea    0xce8(%rip),%rdi
call   10e0 <perror@plt>
mov    -0x54(%rbp),%edi
call   1080 <close@plt>
mov    0x2c54(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
mov    -0x54(%rbp),%edi
lea    -0x40(%rbp),%rsi
lea    -0x10(%rbp),%r8
mov    $0x10,%edx
xor    %ecx,%ecx
lea    -0x2c(%rbp),%r9
call   10c0 <recvfrom@plt>
cltq
cmp    $0x10,%rax
je     13a4 <main+0x1b4>
lea    0xcb3(%rip),%rdi
call   10e0 <perror@plt>
mov    -0x54(%rbp),%edi
call   1080 <close@plt>
mov    0x2c0b(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
mov    -0x54(%rbp),%edi
call   1080 <close@plt>
mov    -0x40(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x3c(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x20(%rbp),%rdi
call   10b0 <adler32@plt>
mov    %eax,%edi
call   1060 <htonl@plt>
mov    %eax,%ecx
mov    -0x68(%rbp),%rax
movslq %ecx,%rcx
cmp    %rcx,%rax
je     1435 <main+0x245>
mov    0x2bc3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x74(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x20(%rbp),%rdi
call   10b0 <adler32@plt>
mov    %eax,%edi
call   1060 <htonl@plt>
mov    -0x74(%rbp),%edi
mov    -0x70(%rbp),%rdx
mov    %eax,%ecx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
lea    0xc2c(%rip),%rsi
call   10a0 <fprintf@plt>
mov    0x2b7a(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
mov    -0x60(%rbp),%rsi
lea    -0x10(%rbp),%rdi
call   10f0 <get_ip_str@plt>
mov    -0x60(%rbp),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rsp,%r12
mov    0x2ddd(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%r14
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r14
mov    %r14,%rsp
mov    0x2db3(%rip),%r13
mov    0x0(%r13),%edi
mov    0x2d90(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1110 <socket@plt>
test   %eax,%eax
js     134f <main+0x15f>
mov    %eax,%ebx
lea    -0x38(%rbp),%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1070 <memset@plt>
mov    0x0(%r13),%eax
mov    %eax,-0x30(%rbp)
mov    $0x7df,%edi
call   1050 <htons@plt>
mov    %eax,-0x34(%rbp)
mov    0x2d57(%rip),%r13
mov    0x0(%r13),%edi
call   1060 <htonl@plt>
mov    %eax,-0x38(%rbp)
movl   $0xc,-0x3c(%rbp)
mov    %ebx,%edi
mov    %r15,%rsi
mov    $0xc,%edx
call   10d0 <bind@plt>
test   %rax,%rax
js     1369 <main+0x179>
lea    0xd7b(%rip),%rdi
call   1090 <inet_addr@plt>
mov    %eax,-0x44(%rbp)
mov    0x0(%r13),%edi
call   1060 <htonl@plt>
mov    %eax,-0x48(%rbp)
mov    0x2d12(%rip),%rax
mov    (%rax),%esi
mov    0x2d19(%rip),%rax
mov    (%rax),%edx
lea    -0x48(%rbp),%rcx
mov    %ebx,%edi
mov    $0x8,%r8d
call   1040 <setsockopt@plt>
test   %rax,%rax
js     1372 <main+0x182>
lea    -0x60(%rbp),%rsi
lea    -0x38(%rbp),%r8
lea    -0x3c(%rbp),%r9
mov    %ebx,%edi
mov    $0x10,%edx
xor    %ecx,%ecx
call   10c0 <recvfrom@plt>
cmp    $0x10,%eax
jne    137b <main+0x18b>
mov    %ebx,%edi
call   1080 <close@plt>
mov    -0x60(%rbp),%rbx
mov    -0x5c(%rbp),%r15
mov    %rbx,%rdi
call   10b0 <adler32@plt>
mov    %eax,%edi
call   1060 <htonl@plt>
cltq
cmp    %rax,%r15
jne    1390 <main+0x1a0>
lea    -0x38(%rbp),%rdi
mov    %r14,%rsi
call   10f0 <get_ip_str@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r12,%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcaa(%rip),%rdi
call   10e0 <perror@plt>
mov    0x2c3e(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
lea    0xca0(%rip),%rdi
jmp    1382 <main+0x192>
lea    0xcaf(%rip),%rdi
jmp    1382 <main+0x192>
lea    0xcba(%rip),%rdi
call   10e0 <perror@plt>
mov    %ebx,%edi
call   1080 <close@plt>
jmp    13c3 <main+0x1d3>
mov    0x2c19(%rip),%rax
mov    (%rax),%r14d
mov    %rbx,%rdi
call   10b0 <adler32@plt>
mov    %eax,%edi
call   1060 <htonl@plt>
lea    0xc9e(%rip),%rsi
mov    %r14d,%edi
mov    %r15,%rdx
mov    %eax,%ecx
mov    %rbx,%r8
mov    %r15,%r9
call   10a0 <fprintf@plt>
mov    0x2bde(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.TYPE_4__, i32, i32 }
%struct.TYPE_4__ = type { i32 }
%struct.ip_mreq = type { %struct.TYPE_6__, %struct.TYPE_5__ }
%struct.TYPE_6__ = type { i32 }
%struct.TYPE_5__ = type { i32 }
%struct.sockaddr = type { i32 }
@INET6_ADDRSTRLEN = global i32 0
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@.str = [16 x i8] c"socket() failed\00"
@EXIT_SUCCESS = global i32 0
@INADDR_ANY = global i32 0
@.str.1 = [14 x i8] c"bind() failed\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [10 x i8] c"224.0.0.3\00"
@IPPROTO_IP = global i32 0
@IP_ADD_MEMBERSHIP = global i32 0
@.str.3 = [20 x i8] c"setsockopt() failed\00"
@.str.4 = [18 x i8] c"recvfrom() failed\00"
@stderr = global i32 0
@.str.5 = [26 x i8] c"0x%x != 0x%x (0x%x 0x%x)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.sockaddr_in
%3 = alloca %struct.ip_mreq
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
%7 = alloca [16 x i8]
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %1
%12 = load i32, i32* @INET6_ADDRSTRLEN
%13 = zext i32 %12 to i64
%14 = call i8* @llvm.stacksave()
store i8* %14, i8** %8
%15 = alloca i8, i64 %13
store i64 %13, i64* %9
%16 = load i32, i32* @AF_INET
%17 = load i32, i32* @SOCK_DGRAM
%18 = call i32 @socket(i32 %16, i32 %17, i32 0)
store i32 %18, i32* %10
%19 = icmp slt i32 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %0
%21 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%22 = load i32, i32* @EXIT_SUCCESS
%23 = call i32 @exit(i32 %22)
unreachable
24: ; preds = %0
%25 = call i32 @memset(%struct.sockaddr_in* %2, i32 0, i32 12)
%26 = load i32, i32* @AF_INET
%27 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i32 0, i32 2
store i32 %26, i32* %27
%28 = call i32 @htons(i32 2015)
%29 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i32 0, i32 1
store i32 %28, i32* %29
%30 = load i32, i32* @INADDR_ANY
%31 = call i32 @htonl(i32 %30)
%32 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i32 0, i32 0
%33 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %32, i32 0, i32 0
store i32 %31, i32* %33
store i32 12, i32* %6
%34 = load i32, i32* %10
%35 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%36 = call i64 @bind(i32 %34, %struct.sockaddr* %35, i32 12)
%37 = icmp slt i64 %36, 0
br i1 %37, label %38, label %44
38: ; preds = %24
%39 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%40 = load i32, i32* %10
%41 = call i32 @close(i32 %40)
%42 = load i32, i32* @EXIT_FAILURE
%43 = call i32 @exit(i32 %42)
unreachable
44: ; preds = %24
%45 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%46 = getelementptr inbounds %struct.ip_mreq, %struct.ip_mreq* %3, i32 0, i32 1
%47 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %46, i32 0, i32 0
store i32 %45, i32* %47
%48 = load i32, i32* @INADDR_ANY
%49 = call i32 @htonl(i32 %48)
%50 = getelementptr inbounds %struct.ip_mreq, %struct.ip_mreq* %3, i32 0, i32 0
%51 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %50, i32 0, i32 0
store i32 %49, i32* %51
%52 = load i32, i32* %10
%53 = load i32, i32* @IPPROTO_IP
%54 = load i32, i32* @IP_ADD_MEMBERSHIP
%55 = call i64 @setsockopt(i32 %52, i32 %53, i32 %54, %struct.ip_mreq* %3, i32 8)
%56 = icmp slt i64 %55, 0
br i1 %56, label %57, label %63
57: ; preds = %44
%58 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%59 = load i32, i32* %10
%60 = call i32 @close(i32 %59)
%61 = load i32, i32* @EXIT_FAILURE
%62 = call i32 @exit(i32 %61)
unreachable
63: ; preds = %44
%64 = load i32, i32* %10
%65 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%66 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%67 = call i32 @recvfrom(i32 %64, i8* %65, i32 16, i32 0, %struct.sockaddr* %66, i32* %6)
%68 = sext i32 %67 to i64
%69 = icmp ne i64 %68, 16
br i1 %69, label %70, label %76
70: ; preds = %63
%71 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%72 = load i32, i32* %10
%73 = call i32 @close(i32 %72)
%74 = load i32, i32* @EXIT_FAILURE
%75 = call i32 @exit(i32 %74)
unreachable
76: ; preds = %63
%77 = load i32, i32* %10
%78 = call i32 @close(i32 %77)
%79 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%80 = bitcast i8* %79 to i64*
%81 = load i64, i64* %80
store i64 %81, i64* %4
%82 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%83 = getelementptr inbounds i8, i8* %82, i64 4
%84 = bitcast i8* %83 to i64*
%85 = load i64, i64* %84
store i64 %85, i64* %5
%86 = load i64, i64* %5
%87 = load i64, i64* %4
%88 = call i32 @adler32(i64 %87)
%89 = call i32 @htonl(i32 %88)
%90 = sext i32 %89 to i64
%91 = icmp ne i64 %86, %90
br i1 %91, label %92, label %103
92: ; preds = %76
%93 = load i32, i32* @stderr
%94 = load i64, i64* %5
%95 = load i64, i64* %4
%96 = call i32 @adler32(i64 %95)
%97 = call i32 @htonl(i32 %96)
%98 = load i64, i64* %4
%99 = load i64, i64* %5
%100 = call i32 @fprintf(i32 %93, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i64 %94, i32 %97, i64 %98, i64 %99)
%101 = load i32, i32* @EXIT_FAILURE
%102 = call i32 @exit(i32 %101)
unreachable
103: ; preds = %76
%104 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%105 = call i32 @get_ip_str(%struct.sockaddr* %104, i8* %15)
%106 = call i32 @puts(i8* %15)
store i32 0, i32* %1
%107 = load i8*, i8** %8
%108 = load i32, i32* %1
ret i32 %108
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.TYPE_4__, i32, i32 }
%struct.TYPE_4__ = type { i32 }
%struct.ip_mreq = type { %struct.TYPE_6__, %struct.TYPE_5__ }
%struct.TYPE_6__ = type { i32 }
%struct.TYPE_5__ = type { i32 }
%struct.sockaddr = type { i32 }
@INET6_ADDRSTRLEN = global i32 0
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@.str = [16 x i8] c"socket() failed\00"
@EXIT_SUCCESS = global i32 0
@INADDR_ANY = global i32 0
@.str.1 = [14 x i8] c"bind() failed\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [10 x i8] c"224.0.0.3\00"
@IPPROTO_IP = global i32 0
@IP_ADD_MEMBERSHIP = global i32 0
@.str.3 = [20 x i8] c"setsockopt() failed\00"
@.str.4 = [18 x i8] c"recvfrom() failed\00"
@stderr = global i32 0
@.str.5 = [26 x i8] c"0x%x != 0x%x (0x%x 0x%x)\0A\00"
define i32 @main() {
%1 = alloca %struct.sockaddr_in
%2 = alloca %struct.ip_mreq
%3 = alloca i32
%4 = alloca [16 x i8]
%5 = bitcast %struct.sockaddr_in* %1 to i8*
%6 = bitcast %struct.ip_mreq* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%9 = load i32, i32* @INET6_ADDRSTRLEN
%10 = zext i32 %9 to i64
%11 = tail call i8* @llvm.stacksave()
%12 = alloca i8, i64 %10
%13 = load i32, i32* @AF_INET
%14 = load i32, i32* @SOCK_DGRAM
%15 = tail call i32 @socket(i32 %13, i32 %14, i32 0)
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %0
%18 = tail call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%19 = load i32, i32* @EXIT_SUCCESS
%20 = tail call i32 @exit(i32 %19)
unreachable
21: ; preds = %0
%22 = call i32 @memset(%struct.sockaddr_in* %1, i32 0, i32 12)
%23 = load i32, i32* @AF_INET
%24 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 2
store i32 %23, i32* %24
%25 = call i32 @htons(i32 2015)
%26 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 1
store i32 %25, i32* %26
%27 = load i32, i32* @INADDR_ANY
%28 = call i32 @htonl(i32 %27)
%29 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 0, i32 0
store i32 %28, i32* %29
store i32 12, i32* %3
%30 = bitcast %struct.sockaddr_in* %1 to %struct.sockaddr*
%31 = call i64 @bind(i32 %15, %struct.sockaddr* %30, i32 12)
%32 = icmp slt i64 %31, 0
br i1 %32, label %33, label %38
33: ; preds = %21
%34 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%35 = call i32 @close(i32 %15)
%36 = load i32, i32* @EXIT_FAILURE
%37 = call i32 @exit(i32 %36)
unreachable
38: ; preds = %21
%39 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%40 = getelementptr inbounds %struct.ip_mreq, %struct.ip_mreq* %2, i64 0, i32 1, i32 0
store i32 %39, i32* %40
%41 = load i32, i32* @INADDR_ANY
%42 = call i32 @htonl(i32 %41)
%43 = getelementptr inbounds %struct.ip_mreq, %struct.ip_mreq* %2, i64 0, i32 0, i32 0
store i32 %42, i32* %43
%44 = load i32, i32* @IPPROTO_IP
%45 = load i32, i32* @IP_ADD_MEMBERSHIP
%46 = call i64 @setsockopt(i32 %15, i32 %44, i32 %45, %struct.ip_mreq* %2, i32 8)
%47 = icmp slt i64 %46, 0
br i1 %47, label %48, label %53
48: ; preds = %38
%49 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%50 = call i32 @close(i32 %15)
%51 = load i32, i32* @EXIT_FAILURE
%52 = call i32 @exit(i32 %51)
unreachable
53: ; preds = %38
%54 = call i32 @recvfrom(i32 %15, i8* %8, i32 16, i32 0, %struct.sockaddr* %30, i32* %3)
%55 = icmp eq i32 %54, 16
br i1 %55, label %61, label %56
56: ; preds = %53
%57 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%58 = call i32 @close(i32 %15)
%59 = load i32, i32* @EXIT_FAILURE
%60 = call i32 @exit(i32 %59)
unreachable
61: ; preds = %53
%62 = call i32 @close(i32 %15)
%63 = bitcast [16 x i8]* %4 to i64*
%64 = load i64, i64* %63
%65 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 4
%66 = bitcast i8* %65 to i64*
%67 = load i64, i64* %66
%68 = call i32 @adler32(i64 %64)
%69 = call i32 @htonl(i32 %68)
%70 = sext i32 %69 to i64
%71 = icmp eq i64 %67, %70
br i1 %71, label %79, label %72
72: ; preds = %61
%73 = load i32, i32* @stderr
%74 = call i32 @adler32(i64 %64)
%75 = call i32 @htonl(i32 %74)
%76 = call i32 @fprintf(i32 %73, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i64 %67, i32 %75, i64 %64, i64 %67)
%77 = load i32, i32* @EXIT_FAILURE
%78 = call i32 @exit(i32 %77)
unreachable
79: ; preds = %61
%80 = call i32 @get_ip_str(%struct.sockaddr* %30, i8* %12)
%81 = call i32 @puts(i8* %12)
ret i32 0
}