#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 {
  int /*<<< orphan*/ sin_port;
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ sAddr;
typedef int /*<<< orphan*/ optval;
typedef int /*<<< orphan*/ message;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ IPPROTO_UDP;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_BROADCAST;
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ htons(unsigned int);
int /*<<< orphan*/ inet_addr(char const *);
scalar_t__ macTranslate(char const *, unsigned char *);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, int);
int /*<<< orphan*/ memset(unsigned char *, int, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ sendto(int, char *, int, int /*<<< orphan*/, struct sockaddr *, int);
scalar_t__ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int sendWol(const char *macAddrHex, const char *broadcastIP, unsigned port) {
  assert(macAddrHex != NULL);
  unsigned char macAddr[7];
  unsigned char message[102];
  unsigned char *messagePtr = message;
  int sock;
  int optval = 1;
  struct sockaddr_in sAddr;
  if (macTranslate(macAddrHex, macAddr) < 0) {
    printf("Specified MAC adress is not valid!\n");
    return -1;
  }
  if ((sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
    perror("ERROR socket");
    return -1;
  }
  memset(messagePtr, 0xFF, 6);
  messagePtr += 6;
  for (int i = 0; i < 16; ++i) {
    memcpy(messagePtr, macAddr, 6);
    messagePtr += 6;
  }
  if (setsockopt(sock, SOL_SOCKET, SO_BROADCAST, &optval, sizeof(optval)) < 0) {
    perror("ERROR setsockopt");
    close(sock);
    return -1;
  }
  sAddr.sin_family = AF_INET;
  sAddr.sin_addr.s_addr = inet_addr(broadcastIP);
  sAddr.sin_port = htons(port);
  if (sendto(sock, (char *)message, sizeof(message), 0,
             (struct sockaddr *)&sAddr, sizeof(sAddr)) < 0) {
    perror("ERROR sendto");
    close(sock);
    return -1;
  }
  close(sock);
  printf("WoL frame succesfuly send to %s\n", macAddrHex);
  return 0;
}


x86 assembly (clang, -O0):
<sendWol>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   10a0 <assert@plt>
lea    -0x90(%rbp),%rax
mov    %rax,-0x98(%rbp)
movl   $0x1,-0xa0(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x23(%rbp),%rsi
call   10c0 <macTranslate@plt>
cmp    $0x0,%rax
jge    1231 <sendWol+0x71>
lea    0xde2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13ec <sendWol+0x22c>
mov    0x2da8(%rip),%rax
mov    (%rax),%edi
mov    0x2d97(%rip),%rax
mov    (%rax),%esi
mov    0x2d6e(%rip),%rax
mov    (%rax),%edx
call   10e0 <socket@plt>
mov    %eax,-0x9c(%rbp)
cmp    $0x0,%eax
jge    1278 <sendWol+0xb8>
lea    0xdbd(%rip),%rdi
call   10d0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13ec <sendWol+0x22c>
mov    -0x98(%rbp),%rdi
mov    $0xff,%esi
mov    $0x6,%edx
call   1060 <memset@plt>
mov    -0x98(%rbp),%rax
add    $0x6,%rax
mov    %rax,-0x98(%rbp)
movl   $0x0,-0xb4(%rbp)
cmpl   $0x10,-0xb4(%rbp)
jge    12f2 <sendWol+0x132>
mov    -0x98(%rbp),%rdi
lea    -0x23(%rbp),%rsi
mov    $0x6,%edx
call   10b0 <memcpy@plt>
mov    -0x98(%rbp),%rax
add    $0x6,%rax
mov    %rax,-0x98(%rbp)
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    12aa <sendWol+0xea>
mov    -0x9c(%rbp),%edi
mov    0x2ce9(%rip),%rax
mov    (%rax),%esi
mov    0x2cc8(%rip),%rax
mov    (%rax),%edx
lea    -0xa0(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0x0,%rax
jge    1349 <sendWol+0x189>
lea    0xd04(%rip),%rdi
call   10d0 <perror@plt>
mov    -0x9c(%rbp),%edi
call   1080 <close@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13ec <sendWol+0x22c>
mov    0x2c90(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xa8(%rbp)
mov    -0x18(%rbp),%rdi
call   1090 <inet_addr@plt>
mov    %eax,-0xac(%rbp)
mov    -0x1c(%rbp),%edi
call   1040 <htons@plt>
mov    %eax,-0xb0(%rbp)
mov    -0x9c(%rbp),%edi
lea    -0x90(%rbp),%rsi
lea    -0xb0(%rbp),%r8
mov    $0x66,%edx
xor    %ecx,%ecx
mov    $0xc,%r9d
call   1070 <sendto@plt>
cmp    $0x0,%rax
jge    13c8 <sendWol+0x208>
lea    0xc96(%rip),%rdi
call   10d0 <perror@plt>
mov    -0x9c(%rbp),%edi
call   1080 <close@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13ec <sendWol+0x22c>
mov    -0x9c(%rbp),%edi
call   1080 <close@plt>
mov    -0x10(%rbp),%rsi
lea    0xc71(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendWol>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %edx,%r14d
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   10b0 <assert@plt>
movl   $0x1,0x4(%rsp)
lea    0x19(%rsp),%rsi
mov    %rbx,%rdi
call   10d0 <macTranslate@plt>
test   %rax,%rax
js     140e <sendWol+0x23e>
mov    0x2dc3(%rip),%r13
mov    0x0(%r13),%edi
mov    0x2db0(%rip),%rax
mov    (%rax),%esi
mov    0x2d87(%rip),%rax
mov    (%rax),%edx
call   10f0 <socket@plt>
test   %eax,%eax
js     1433 <sendWol+0x263>
mov    %eax,%r12d
lea    0x20(%rsp),%rdi
mov    $0xff,%esi
mov    $0x6,%edx
call   1070 <memset@plt>
lea    0x26(%rsp),%rdi
lea    0x19(%rsp),%rbp
mov    %rbp,%rsi
mov    $0x6,%edx
call   10c0 <memcpy@plt>
lea    0x2c(%rsp),%rdi
mov    %rbp,%rsi
mov    $0x6,%edx
call   10c0 <memcpy@plt>
lea    0x32(%rsp),%rdi
mov    %rbp,%rsi
mov    $0x6,%edx
call   10c0 <memcpy@plt>
lea    0x38(%rsp),%rdi
mov    %rbp,%rsi
mov    $0x6,%edx
call   10c0 <memcpy@plt>
lea    0x3e(%rsp),%rdi
mov    %rbp,%rsi
mov    $0x6,%edx
call   10c0 <memcpy@plt>
lea    0x44(%rsp),%rdi
mov    %rbp,%rsi
mov    $0x6,%edx
call   10c0 <memcpy@plt>
lea    0x4a(%rsp),%rdi
mov    %rbp,%rsi
mov    $0x6,%edx
call   10c0 <memcpy@plt>
lea    0x50(%rsp),%rdi
mov    %rbp,%rsi
mov    $0x6,%edx
call   10c0 <memcpy@plt>
lea    0x56(%rsp),%rdi
mov    %rbp,%rsi
mov    $0x6,%edx
call   10c0 <memcpy@plt>
lea    0x5c(%rsp),%rdi
mov    %rbp,%rsi
mov    $0x6,%edx
call   10c0 <memcpy@plt>
lea    0x62(%rsp),%rdi
mov    %rbp,%rsi
mov    $0x6,%edx
call   10c0 <memcpy@plt>
lea    0x68(%rsp),%rdi
mov    %rbp,%rsi
mov    $0x6,%edx
call   10c0 <memcpy@plt>
lea    0x6e(%rsp),%rdi
mov    %rbp,%rsi
mov    $0x6,%edx
call   10c0 <memcpy@plt>
lea    0x74(%rsp),%rdi
mov    %rbp,%rsi
mov    $0x6,%edx
call   10c0 <memcpy@plt>
lea    0x7a(%rsp),%rdi
mov    %rbp,%rsi
mov    $0x6,%edx
call   10c0 <memcpy@plt>
lea    0x80(%rsp),%rdi
mov    %rbp,%rsi
mov    $0x6,%edx
call   10c0 <memcpy@plt>
mov    0x2c62(%rip),%rax
mov    (%rax),%esi
mov    0x2c41(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    %r12d,%edi
mov    $0x4,%r8d
call   1040 <setsockopt@plt>
test   %rax,%rax
js     1441 <sendWol+0x271>
mov    0x0(%r13),%eax
mov    %eax,0x10(%rsp)
mov    %r15,%rdi
call   10a0 <inet_addr@plt>
mov    %eax,0xc(%rsp)
mov    %r14d,%edi
call   1050 <htons@plt>
mov    %eax,0x8(%rsp)
lea    0x20(%rsp),%rsi
xor    %ebp,%ebp
lea    0x8(%rsp),%r8
mov    %r12d,%edi
mov    $0x66,%edx
xor    %ecx,%ecx
mov    $0xc,%r9d
call   1080 <sendto@plt>
test   %rax,%rax
js     144a <sendWol+0x27a>
mov    %r12d,%edi
call   1090 <close@plt>
lea    0xc29(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    141f <sendWol+0x24f>
lea    0xc37(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xbc6(%rip),%rdi
call   10e0 <perror@plt>
jmp    141a <sendWol+0x24a>
lea    0xbc5(%rip),%rdi
jmp    1451 <sendWol+0x281>
lea    0xbcd(%rip),%rdi
call   10e0 <perror@plt>
mov    %r12d,%edi
call   1090 <close@plt>
jmp    141a <sendWol+0x24a>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [36 x i8] c"Specified MAC adress is not valid!\0A\00"
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@IPPROTO_UDP = global i32 0
@.str.1 = [13 x i8] c"ERROR socket\00"
@SOL_SOCKET = global i32 0
@SO_BROADCAST = global i32 0
@.str.2 = [17 x i8] c"ERROR setsockopt\00"
@.str.3 = [13 x i8] c"ERROR sendto\00"
@.str.4 = [33 x i8] c"WoL frame succesfuly send to %s\0A\00"
define i32 @sendWol(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca [7 x i8]
%9 = alloca [102 x i8]
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca %struct.sockaddr_in
%14 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%15 = load i8*, i8** %5
%16 = icmp ne i8* %15, null
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = getelementptr inbounds [102 x i8], [102 x i8]* %9, i64 0, i64 0
store i8* %19, i8** %10
store i32 1, i32* %12
%20 = load i8*, i8** %5
%21 = getelementptr inbounds [7 x i8], [7 x i8]* %8, i64 0, i64 0
%22 = call i64 @macTranslate(i8* %20, i8* %21)
%23 = icmp slt i64 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %3
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %4
br label %85
26: ; preds = %3
%27 = load i32, i32* @AF_INET
%28 = load i32, i32* @SOCK_DGRAM
%29 = load i32, i32* @IPPROTO_UDP
%30 = call i32 @socket(i32 %27, i32 %28, i32 %29)
store i32 %30, i32* %11
%31 = icmp slt i32 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %26
%33 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %4
br label %85
34: ; preds = %26
%35 = load i8*, i8** %10
%36 = call i32 @memset(i8* %35, i32 255, i32 6)
%37 = load i8*, i8** %10
%38 = getelementptr inbounds i8, i8* %37, i64 6
store i8* %38, i8** %10
store i32 0, i32* %14
br label %39
39: ; preds = %48, %34
%40 = load i32, i32* %14
%41 = icmp slt i32 %40, 16
br i1 %41, label %42, label %51
42: ; preds = %39
%43 = load i8*, i8** %10
%44 = getelementptr inbounds [7 x i8], [7 x i8]* %8, i64 0, i64 0
%45 = call i32 @memcpy(i8* %43, i8* %44, i32 6)
%46 = load i8*, i8** %10
%47 = getelementptr inbounds i8, i8* %46, i64 6
store i8* %47, i8** %10
br label %48
48: ; preds = %42
%49 = load i32, i32* %14
%50 = add nsw i32 %49, 1
store i32 %50, i32* %14
br label %39
51: ; preds = %39
%52 = load i32, i32* %11
%53 = load i32, i32* @SOL_SOCKET
%54 = load i32, i32* @SO_BROADCAST
%55 = call i64 @setsockopt(i32 %52, i32 %53, i32 %54, i32* %12, i32 4)
%56 = icmp slt i64 %55, 0
br i1 %56, label %57, label %61
57: ; preds = %51
%58 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%59 = load i32, i32* %11
%60 = call i32 @close(i32 %59)
store i32 -1, i32* %4
br label %85
61: ; preds = %51
%62 = load i32, i32* @AF_INET
%63 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %13, i32 0, i32 2
store i32 %62, i32* %63
%64 = load i8*, i8** %6
%65 = call i32 @inet_addr(i8* %64)
%66 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %13, i32 0, i32 1
%67 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %66, i32 0, i32 0
store i32 %65, i32* %67
%68 = load i32, i32* %7
%69 = call i32 @htons(i32 %68)
%70 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %13, i32 0, i32 0
store i32 %69, i32* %70
%71 = load i32, i32* %11
%72 = getelementptr inbounds [102 x i8], [102 x i8]* %9, i64 0, i64 0
%73 = bitcast %struct.sockaddr_in* %13 to %struct.sockaddr*
%74 = call i64 @sendto(i32 %71, i8* %72, i32 102, i32 0, %struct.sockaddr* %73, i32 12)
%75 = icmp slt i64 %74, 0
br i1 %75, label %76, label %80
76: ; preds = %61
%77 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%78 = load i32, i32* %11
%79 = call i32 @close(i32 %78)
store i32 -1, i32* %4
br label %85
80: ; preds = %61
%81 = load i32, i32* %11
%82 = call i32 @close(i32 %81)
%83 = load i8*, i8** %5
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i8* %83)
store i32 0, i32* %4
br label %85
85: ; preds = %80, %76, %57, %32, %24
%86 = load i32, i32* %4
ret i32 %86
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@IPPROTO_UDP = global i32 0
@.str.1 = [13 x i8] c"ERROR socket\00"
@SOL_SOCKET = global i32 0
@SO_BROADCAST = global i32 0
@.str.2 = [17 x i8] c"ERROR setsockopt\00"
@.str.3 = [13 x i8] c"ERROR sendto\00"
@.str.4 = [33 x i8] c"WoL frame succesfuly send to %s\0A\00"
@str = [35 x i8] c"Specified MAC adress is not valid!\00"
define i32 @sendWol(i8* %0, i8* %1, i32 %2) {
%4 = alloca [7 x i8]
%5 = alloca [102 x i8]
%6 = alloca i32
%7 = alloca %struct.sockaddr_in
%8 = icmp ne i8* %0, null
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = getelementptr inbounds [7 x i8], [7 x i8]* %4, i64 0, i64 0
%12 = getelementptr inbounds [102 x i8], [102 x i8]* %5, i64 0, i64 0
%13 = bitcast i32* %6 to i8*
store i32 1, i32* %6
%14 = bitcast %struct.sockaddr_in* %7 to i8*
%15 = call i64 @macTranslate(i8* %0, i8* %11)
%16 = icmp slt i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %3
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
br label %84
19: ; preds = %3
%20 = load i32, i32* @AF_INET
%21 = load i32, i32* @SOCK_DGRAM
%22 = load i32, i32* @IPPROTO_UDP
%23 = call i32 @socket(i32 %20, i32 %21, i32 %22)
%24 = icmp slt i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %19
%26 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %84
27: ; preds = %19
%28 = call i32 @memset(i8* %12, i32 255, i32 6)
%29 = getelementptr inbounds [102 x i8], [102 x i8]* %5, i64 0, i64 6
%30 = call i32 @memcpy(i8* %29, i8* %11, i32 6)
%31 = getelementptr inbounds [102 x i8], [102 x i8]* %5, i64 0, i64 12
%32 = call i32 @memcpy(i8* %31, i8* %11, i32 6)
%33 = getelementptr inbounds [102 x i8], [102 x i8]* %5, i64 0, i64 18
%34 = call i32 @memcpy(i8* %33, i8* %11, i32 6)
%35 = getelementptr inbounds [102 x i8], [102 x i8]* %5, i64 0, i64 24
%36 = call i32 @memcpy(i8* %35, i8* %11, i32 6)
%37 = getelementptr inbounds [102 x i8], [102 x i8]* %5, i64 0, i64 30
%38 = call i32 @memcpy(i8* %37, i8* %11, i32 6)
%39 = getelementptr inbounds [102 x i8], [102 x i8]* %5, i64 0, i64 36
%40 = call i32 @memcpy(i8* %39, i8* %11, i32 6)
%41 = getelementptr inbounds [102 x i8], [102 x i8]* %5, i64 0, i64 42
%42 = call i32 @memcpy(i8* %41, i8* %11, i32 6)
%43 = getelementptr inbounds [102 x i8], [102 x i8]* %5, i64 0, i64 48
%44 = call i32 @memcpy(i8* %43, i8* %11, i32 6)
%45 = getelementptr inbounds [102 x i8], [102 x i8]* %5, i64 0, i64 54
%46 = call i32 @memcpy(i8* %45, i8* %11, i32 6)
%47 = getelementptr inbounds [102 x i8], [102 x i8]* %5, i64 0, i64 60
%48 = call i32 @memcpy(i8* %47, i8* %11, i32 6)
%49 = getelementptr inbounds [102 x i8], [102 x i8]* %5, i64 0, i64 66
%50 = call i32 @memcpy(i8* %49, i8* %11, i32 6)
%51 = getelementptr inbounds [102 x i8], [102 x i8]* %5, i64 0, i64 72
%52 = call i32 @memcpy(i8* %51, i8* %11, i32 6)
%53 = getelementptr inbounds [102 x i8], [102 x i8]* %5, i64 0, i64 78
%54 = call i32 @memcpy(i8* %53, i8* %11, i32 6)
%55 = getelementptr inbounds [102 x i8], [102 x i8]* %5, i64 0, i64 84
%56 = call i32 @memcpy(i8* %55, i8* %11, i32 6)
%57 = getelementptr inbounds [102 x i8], [102 x i8]* %5, i64 0, i64 90
%58 = call i32 @memcpy(i8* %57, i8* %11, i32 6)
%59 = getelementptr inbounds [102 x i8], [102 x i8]* %5, i64 0, i64 96
%60 = call i32 @memcpy(i8* %59, i8* %11, i32 6)
%61 = load i32, i32* @SOL_SOCKET
%62 = load i32, i32* @SO_BROADCAST
%63 = call i64 @setsockopt(i32 %23, i32 %61, i32 %62, i32* %6, i32 4)
%64 = icmp slt i64 %63, 0
br i1 %64, label %65, label %68
65: ; preds = %27
%66 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%67 = call i32 @close(i32 %23)
br label %84
68: ; preds = %27
%69 = load i32, i32* @AF_INET
%70 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i64 0, i32 2
store i32 %69, i32* %70
%71 = call i32 @inet_addr(i8* %1)
%72 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i64 0, i32 1, i32 0
store i32 %71, i32* %72
%73 = call i32 @htons(i32 %2)
%74 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i64 0, i32 0
store i32 %73, i32* %74
%75 = bitcast %struct.sockaddr_in* %7 to %struct.sockaddr*
%76 = call i64 @sendto(i32 %23, i8* %12, i32 102, i32 0, %struct.sockaddr* %75, i32 12)
%77 = icmp slt i64 %76, 0
br i1 %77, label %78, label %81
78: ; preds = %68
%79 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%80 = call i32 @close(i32 %23)
br label %84
81: ; preds = %68
%82 = call i32 @close(i32 %23)
%83 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i8* %0)
br label %84
84: ; preds = %81, %78, %65, %25, %17
%85 = phi i32 [ -1, %17 ], [ -1, %25 ], [ -1, %65 ], [ -1, %78 ], [ 0, %81 ]
ret i32 %85
}