#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 {
  short sin_port;
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
struct in_addr {
  int /*<<< orphan*/ s_addr;
};
struct hostent {
  scalar_t__ *h_addr_list;
};
typedef int /*<<< orphan*/ optval;
typedef int /*<<< orphan*/ macaddr;
typedef int /*<<< orphan*/ bcast;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_BROADCAST;
int errno;
int /*<<< orphan*/ exit(int);
struct hostent *gethostbyname(char *);
short htons(int);
int /*<<< orphan*/ inet_aton(char *, struct in_addr *);
int /*<<< orphan*/ memset(struct sockaddr_in *, int /*<<< orphan*/, int);
int /*<<< orphan*/ parse_mac(unsigned char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sendto(int, char **, int, int /*<<< orphan*/,
                          struct sockaddr *, int);
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
char *strerror(int);
int send_wol(char *target, char *mac) {
  int sock;
  int optval = 1;
  int i, j, rc;
  char msg[1024];
  int msglen = 0;
  struct sockaddr_in bcast;
  struct hostent *he;
  struct in_addr inaddr;
  unsigned char macaddr[6];
  short bport = htons(32767);
  if (!parse_mac(macaddr, mac)) {
    printf("Illegal MAC address '%s'\n", mac);
    exit(1);
  }
  if (!inet_aton(target, &inaddr)) {
    he = gethostbyname(target);
    inaddr = *(struct in_addr *)he->h_addr_list[0];
  }
  for (i = 0; i < 6; i++) {
    msg[msglen++] = 0xff;
  }
  for (i = 0; i < 16; i++) {
    for (j = 0; j < sizeof(macaddr); j++) {
      msg[msglen++] = macaddr[j];
    }
  }
  memset(&bcast, 0, sizeof(bcast));
  bcast.sin_family = AF_INET;
  bcast.sin_addr.s_addr = inaddr.s_addr;
  bcast.sin_port = bport;
  sock = socket(AF_INET, SOCK_DGRAM, 0);
  if (sock < 0) {
    printf("Can't allocate socket\n");
    return -1;
  }
  if ((rc = setsockopt(sock, SOL_SOCKET, SO_BROADCAST, &optval,
                       sizeof(optval))) < 0) {
    printf("Can't socket option SO_BROADCAST: rc = %d, errno=%s(%d)\n", rc,
           strerror(errno), errno);
    return -1;
  }
  sendto(sock, &msg, msglen, 0, (struct sockaddr *)&bcast, sizeof(bcast));
  return 0;
}


x86 assembly (clang, -O0):
<send_wol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x460,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x1,-0x20(%rbp)
movl   $0x0,-0x434(%rbp)
mov    $0x7fff,%edi
call   1040 <htons@plt>
mov    %ax,-0x458(%rbp)
lea    -0x456(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1080 <parse_mac@plt>
cmp    $0x0,%eax
jne    121a <send_wol+0x6a>
mov    -0x18(%rbp),%rsi
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    -0x10(%rbp),%rdi
lea    -0x450(%rbp),%rsi
call   10a0 <inet_aton@plt>
cmp    $0x0,%eax
jne    1258 <send_wol+0xa8>
mov    -0x10(%rbp),%rdi
call   1090 <gethostbyname@plt>
mov    %rax,-0x448(%rbp)
mov    -0x448(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    %eax,-0x450(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x6,-0x24(%rbp)
jge    1292 <send_wol+0xe2>
mov    -0x434(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x434(%rbp)
cltq
movb   $0xff,-0x430(%rbp,%rax,1)
ff
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    125f <send_wol+0xaf>
movl   $0x0,-0x24(%rbp)
cmpl   $0x10,-0x24(%rbp)
jge    12fe <send_wol+0x14e>
movl   $0x0,-0x28(%rbp)
movslq -0x28(%rbp),%rax
cmp    $0x6,%rax
jae    12eb <send_wol+0x13b>
movslq -0x28(%rbp),%rax
mov    -0x456(%rbp,%rax,1),%cl
mov    -0x434(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x434(%rbp)
cltq
mov    %cl,-0x430(%rbp,%rax,1)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    12aa <send_wol+0xfa>
jmp    12f0 <send_wol+0x140>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1299 <send_wol+0xe9>
lea    -0x440(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1060 <memset@plt>
mov    0x2cc8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x438(%rbp)
mov    -0x450(%rbp),%eax
mov    %eax,-0x43c(%rbp)
mov    -0x458(%rbp),%ax
mov    %ax,-0x440(%rbp)
mov    0x2c9f(%rip),%rax
mov    (%rax),%edi
mov    0x2c8e(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10d0 <socket@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    137a <send_wol+0x1ca>
lea    0xcb3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1418 <send_wol+0x268>
mov    -0x1c(%rbp),%edi
mov    0x2c64(%rip),%rax
mov    (%rax),%esi
mov    0x2c43(%rip),%rax
mov    (%rax),%edx
lea    -0x20(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
mov    %eax,-0x2c(%rbp)
cmp    $0x0,%eax
jge    13ed <send_wol+0x23d>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x45c(%rbp)
mov    0x2c06(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
mov    -0x45c(%rbp),%esi
mov    %rax,%rdx
mov    0x2bef(%rip),%rax
mov    (%rax),%ecx
lea    0xc57(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1418 <send_wol+0x268>
mov    -0x1c(%rbp),%edi
lea    -0x430(%rbp),%rsi
mov    -0x434(%rbp),%edx
lea    -0x440(%rbp),%r8
xor    %ecx,%ecx
mov    $0xc,%r9d
call   1070 <sendto@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x460,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_wol>:
push   %rbp
push   %r14
push   %rbx
sub    $0x420,%rsp
mov    %rsi,%rbp
mov    %rdi,%rbx
movl   $0x1,0xc(%rsp)
mov    $0x7fff,%edi
call   1050 <htons@plt>
mov    %eax,%r14d
lea    0x2(%rsp),%rdi
mov    %rbp,%rsi
call   1090 <parse_mac@plt>
test   %eax,%eax
je     13b2 <send_wol+0x1f2>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   10b0 <inet_aton@plt>
test   %eax,%eax
jne    1220 <send_wol+0x60>
mov    %rbx,%rdi
call   10a0 <gethostbyname@plt>
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    %eax,0x8(%rsp)
movw   $0xffff,0x24(%rsp)
movl   $0xffffffff,0x20(%rsp)
ff
mov    0x2(%rsp),%eax
mov    %eax,0x26(%rsp)
movzwl 0x6(%rsp),%ecx
mov    %cx,0x2a(%rsp)
mov    %eax,0x2c(%rsp)
mov    %cx,0x30(%rsp)
mov    %eax,0x32(%rsp)
mov    %cx,0x36(%rsp)
mov    %eax,0x38(%rsp)
mov    %cx,0x3c(%rsp)
mov    %cx,0x42(%rsp)
mov    %eax,0x3e(%rsp)
mov    %eax,0x44(%rsp)
mov    %cx,0x48(%rsp)
mov    %cx,0x4e(%rsp)
mov    %eax,0x4a(%rsp)
movzwl 0x6(%rsp),%eax
mov    %ax,0x54(%rsp)
mov    0x2(%rsp),%ecx
mov    %ecx,0x50(%rsp)
mov    %ecx,0x56(%rsp)
mov    %ax,0x5a(%rsp)
mov    %ecx,0x5c(%rsp)
mov    %ax,0x60(%rsp)
mov    %ecx,0x62(%rsp)
mov    %ax,0x66(%rsp)
mov    %ax,0x6c(%rsp)
mov    %ecx,0x68(%rsp)
mov    %ecx,0x6e(%rsp)
mov    %ax,0x72(%rsp)
mov    %ax,0x78(%rsp)
mov    %ecx,0x74(%rsp)
mov    %ecx,0x7a(%rsp)
mov    %ax,0x7e(%rsp)
movzwl 0x6(%rsp),%eax
mov    %ax,0x84(%rsp)
mov    0x2(%rsp),%eax
mov    %eax,0x80(%rsp)
lea    0x10(%rsp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1070 <memset@plt>
mov    0x2ce8(%rip),%rax
mov    (%rax),%edi
mov    %edi,0x18(%rsp)
mov    0x8(%rsp),%eax
mov    %eax,0x14(%rsp)
mov    %r14w,0x10(%rsp)
mov    0x2cc5(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10e0 <socket@plt>
test   %eax,%eax
js     136c <send_wol+0x1ac>
mov    %eax,%ebx
mov    0x2cbf(%rip),%rax
mov    (%rax),%esi
mov    0x2c9e(%rip),%rax
mov    (%rax),%edx
lea    0xc(%rsp),%rcx
mov    %ebx,%edi
mov    $0x4,%r8d
call   1040 <setsockopt@plt>
test   %eax,%eax
js     137a <send_wol+0x1ba>
lea    0x20(%rsp),%rsi
xor    %ebp,%ebp
lea    0x10(%rsp),%r8
mov    %ebx,%edi
mov    $0x66,%edx
xor    %ecx,%ecx
mov    $0xc,%r9d
call   1080 <sendto@plt>
jmp    13a4 <send_wol+0x1e4>
lea    0xce0(%rip),%rdi
call   1030 <puts@plt>
jmp    139f <send_wol+0x1df>
mov    %eax,%ebp
mov    0x2c3d(%rip),%rbx
mov    (%rbx),%edi
call   10d0 <strerror@plt>
mov    (%rbx),%ecx
lea    0xc87(%rip),%rdi
mov    %ebp,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x420,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0xc47(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i16, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.hostent = type { i64* }
%struct.in_addr = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [26 x i8] c"Illegal MAC address '%s'\0A\00"
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@.str.1 = [23 x i8] c"Can't allocate socket\0A\00"
@SOL_SOCKET = global i32 0
@SO_BROADCAST = global i32 0
@.str.2 = [57 x i8] c"Can't socket option SO_BROADCAST: rc = %d, errno=%s(%d)\0A\00"
@errno = global i32 0
define i32 @send_wol(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [1024 x i8]
%12 = alloca i32
%13 = alloca %struct.sockaddr_in
%14 = alloca %struct.hostent*
%15 = alloca %struct.in_addr
%16 = alloca [6 x i8]
%17 = alloca i16
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 1, i32* %7
store i32 0, i32* %12
%18 = call signext i16 @htons(i32 32767)
store i16 %18, i16* %17
%19 = getelementptr inbounds [6 x i8], [6 x i8]* %16, i64 0, i64 0
%20 = load i8*, i8** %5
%21 = call i32 @parse_mac(i8* %19, i8* %20)
%22 = icmp ne i32 %21, 0
br i1 %22, label %27, label %23
23: ; preds = %2
%24 = load i8*, i8** %5
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %24)
%26 = call i32 @exit(i32 1)
unreachable
27: ; preds = %2
%28 = load i8*, i8** %4
%29 = call i32 @inet_aton(i8* %28, %struct.in_addr* %15)
%30 = icmp ne i32 %29, 0
br i1 %30, label %42, label %31
31: ; preds = %27
%32 = load i8*, i8** %4
%33 = call %struct.hostent* @gethostbyname(i8* %32)
store %struct.hostent* %33, %struct.hostent** %14
%34 = load %struct.hostent*, %struct.hostent** %14
%35 = getelementptr inbounds %struct.hostent, %struct.hostent* %34, i32 0, i32 0
%36 = load i64*, i64** %35
%37 = getelementptr inbounds i64, i64* %36, i64 0
%38 = load i64, i64* %37
%39 = inttoptr i64 %38 to %struct.in_addr*
%40 = bitcast %struct.in_addr* %15 to i8*
%41 = bitcast %struct.in_addr* %39 to i8*
br label %42
42: ; preds = %31, %27
store i32 0, i32* %8
br label %43
43: ; preds = %51, %42
%44 = load i32, i32* %8
%45 = icmp slt i32 %44, 6
br i1 %45, label %46, label %54
46: ; preds = %43
%47 = load i32, i32* %12
%48 = add nsw i32 %47, 1
store i32 %48, i32* %12
%49 = sext i32 %47 to i64
%50 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 %49
store i8 -1, i8* %50
br label %51
51: ; preds = %46
%52 = load i32, i32* %8
%53 = add nsw i32 %52, 1
store i32 %53, i32* %8
br label %43
54: ; preds = %43
store i32 0, i32* %8
br label %55
55: ; preds = %76, %54
%56 = load i32, i32* %8
%57 = icmp slt i32 %56, 16
br i1 %57, label %58, label %79
58: ; preds = %55
store i32 0, i32* %9
br label %59
59: ; preds = %72, %58
%60 = load i32, i32* %9
%61 = sext i32 %60 to i64
%62 = icmp ult i64 %61, 6
br i1 %62, label %63, label %75
63: ; preds = %59
%64 = load i32, i32* %9
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [6 x i8], [6 x i8]* %16, i64 0, i64 %65
%67 = load i8, i8* %66
%68 = load i32, i32* %12
%69 = add nsw i32 %68, 1
store i32 %69, i32* %12
%70 = sext i32 %68 to i64
%71 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 %70
store i8 %67, i8* %71
br label %72
72: ; preds = %63
%73 = load i32, i32* %9
%74 = add nsw i32 %73, 1
store i32 %74, i32* %9
br label %59
75: ; preds = %59
br label %76
76: ; preds = %75
%77 = load i32, i32* %8
%78 = add nsw i32 %77, 1
store i32 %78, i32* %8
br label %55
79: ; preds = %55
%80 = call i32 @memset(%struct.sockaddr_in* %13, i32 0, i32 12)
%81 = load i32, i32* @AF_INET
%82 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %13, i32 0, i32 2
store i32 %81, i32* %82
%83 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %15, i32 0, i32 0
%84 = load i32, i32* %83
%85 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %13, i32 0, i32 1
%86 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %85, i32 0, i32 0
store i32 %84, i32* %86
%87 = load i16, i16* %17
%88 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %13, i32 0, i32 0
store i16 %87, i16* %88
%89 = load i32, i32* @AF_INET
%90 = load i32, i32* @SOCK_DGRAM
%91 = call i32 @socket(i32 %89, i32 %90, i32 0)
store i32 %91, i32* %6
%92 = load i32, i32* %6
%93 = icmp slt i32 %92, 0
br i1 %93, label %94, label %96
94: ; preds = %79
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %114
96: ; preds = %79
%97 = load i32, i32* %6
%98 = load i32, i32* @SOL_SOCKET
%99 = load i32, i32* @SO_BROADCAST
%100 = call i32 @setsockopt(i32 %97, i32 %98, i32 %99, i32* %7, i32 4)
store i32 %100, i32* %10
%101 = icmp slt i32 %100, 0
br i1 %101, label %102, label %108
102: ; preds = %96
%103 = load i32, i32* %10
%104 = load i32, i32* @errno
%105 = call i8* @strerror(i32 %104)
%106 = load i32, i32* @errno
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i64 0, i64 0), i32 %103, i8* %105, i32 %106)
store i32 -1, i32* %3
br label %114
108: ; preds = %96
%109 = load i32, i32* %6
%110 = bitcast [1024 x i8]* %11 to i8**
%111 = load i32, i32* %12
%112 = bitcast %struct.sockaddr_in* %13 to %struct.sockaddr*
%113 = call i32 @sendto(i32 %109, i8** %110, i32 %111, i32 0, %struct.sockaddr* %112, i32 12)
store i32 0, i32* %3
br label %114
114: ; preds = %108, %102, %94
%115 = load i32, i32* %3
ret i32 %115
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i16, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.in_addr = type { i32 }
%struct.hostent = type { i64* }
%struct.sockaddr = type { i32 }
@.str = [26 x i8] c"Illegal MAC address '%s'\0A\00"
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@SOL_SOCKET = global i32 0
@SO_BROADCAST = global i32 0
@.str.2 = [57 x i8] c"Can't socket option SO_BROADCAST: rc = %d, errno=%s(%d)\0A\00"
@errno = global i32 0
@str = [22 x i8] c"Can't allocate socket\00"
define i32 @send_wol(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = alloca %struct.sockaddr_in
%7 = alloca %struct.in_addr
%8 = alloca [6 x i8]
%9 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 0
%10 = bitcast i32* %3 to i8*
store i32 1, i32* %3
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%12 = bitcast %struct.sockaddr_in* %6 to i8*
%13 = bitcast %struct.in_addr* %7 to i8*
%14 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 0
%15 = tail call signext i16 @htons(i32 32767)
%16 = call i32 @parse_mac(i8* %14, i8* %1)
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %2
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %1)
%20 = call i32 @exit(i32 1)
unreachable
21: ; preds = %2
%22 = call i32 @inet_aton(i8* %0, %struct.in_addr* %7)
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %32
24: ; preds = %21
%25 = call %struct.hostent* @gethostbyname(i8* %0)
%26 = getelementptr inbounds %struct.hostent, %struct.hostent* %25, i64 0, i32 0
%27 = load i64*, i64** %26
%28 = load i64, i64* %27
%29 = inttoptr i64 %28 to i32*
%30 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %7, i64 0, i32 0
%31 = load i32, i32* %29
store i32 %31, i32* %30
br label %32
32: ; preds = %24, %21
%33 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 6
%34 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 12
%35 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 18
%36 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 24
%37 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 30
%38 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 36
%39 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 42
%40 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 48
%41 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 54
%42 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 60
%43 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 66
%44 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 72
%45 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 78
%46 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 84
%47 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 90
%48 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 96
%49 = call i32 @memset(%struct.sockaddr_in* %6, i32 0, i32 12)
%50 = load i32, i32* @AF_INET
%51 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i64 0, i32 2
store i32 %50, i32* %51
%52 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %7, i64 0, i32 0
%53 = load i32, i32* %52
%54 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i64 0, i32 1, i32 0
store i32 %53, i32* %54
%55 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i64 0, i32 0
store i16 %15, i16* %55
%56 = load i32, i32* @SOCK_DGRAM
%57 = call i32 @socket(i32 %50, i32 %56, i32 0)
%58 = icmp slt i32 %57, 0
br i1 %58, label %59, label %61
59: ; preds = %32
%60 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
br label %75
61: ; preds = %32
%62 = load i32, i32* @SOL_SOCKET
%63 = load i32, i32* @SO_BROADCAST
%64 = call i32 @setsockopt(i32 %57, i32 %62, i32 %63, i32* %3, i32 4)
%65 = icmp slt i32 %64, 0
br i1 %65, label %66, label %71
66: ; preds = %61
%67 = load i32, i32* @errno
%68 = call i8* @strerror(i32 %67)
%69 = load i32, i32* @errno
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i64 0, i64 0), i32 %64, i8* %68, i32 %69)
br label %75
71: ; preds = %61
%72 = bitcast [1024 x i8]* %4 to i8**
%73 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%74 = call i32 @sendto(i32 %57, i8** %72, i32 102, i32 0, %struct.sockaddr* %73, i32 12)
br label %75
75: ; preds = %71, %66, %59
%76 = phi i32 [ -1, %59 ], [ -1, %66 ], [ 0, %71 ]
ret i32 %76
}