#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 */
typedef int /*<<< orphan*/ whereto;
typedef int u_char;
struct sockaddr {
  int /*<<< orphan*/ sa_data;
  scalar_t__ sa_family;
};
struct TYPE_2__ {
  unsigned int *sa_data;
};
struct ifreq {
  TYPE_1__ ifr_hwaddr;
  int /*<<< orphan*/ ifr_name;
};
struct cfgData {
  int dummy;
};
typedef int /*<<< orphan*/ one;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
scalar_t__ EPERM;
int /*<<< orphan*/ SIOCGIFHWADDR;
int /*<<< orphan*/ SOCK_PACKET;
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_BROADCAST;
int /*<<< orphan*/ close(int);
scalar_t__ errno;
int /*<<< orphan*/ getuid();
scalar_t__ ioctl(int, int /*<<< orphan*/, struct ifreq *);
int /*<<< orphan*/ memcpy(int *, ...);
int sendto(int, int *, int, int /*<<< orphan*/, struct sockaddr *, int);
scalar_t__ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, char *, int);
scalar_t__ setuid(int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strcpy(int /*<<< orphan*/, char *);
int send_arping(const struct cfgData *data, char *ifname) {
  u_char outpack[1000];
  struct sockaddr whereto;
  int sd;
  int one = 1;
  int offset = 0;
  if ((sd == socket(AF_INET, SOCK_PACKET, SOCK_PACKET)) < 0) {
    if (errno == EPERM)
      return 14;
    return 10;
  }
  if (setuid(getuid()) != 0) {
    return 15;
  }
  struct ifreq if_hwaddr;
  unsigned long destaddr = 0xFFFFFFFFFFFF;
  memcpy(outpack, &destaddr, 6);
  offset += 6;
  strcpy(if_hwaddr.ifr_name, ifname);
  if (ioctl(sd, SIOCGIFHWADDR, &if_hwaddr) < 0) {
    return 16;
  }
  memcpy(outpack + offset, if_hwaddr.ifr_hwaddr.sa_data, 6);
  offset += 6;
  unsigned int protocol = 0x0806;
  memcpy(outpack + offset, &protocol, 2);
  offset += 2;
  unsigned int hwtype = 0x0001;
  unsigned int protype = 0x0800;
  unsigned int opcode = 0x0001;
  memcpy(outpack + offset, &hwtype, 2);
  offset += 2;
  memcpy(outpack + offset, &protype, 2);
  offset += 2;
  outpack[offset] = 0x06;
  outpack[offset + 1] = 0x04;
  offset += 2;
  memcpy(outpack + offset, &opcode, 2);
  offset += 2;
  memcpy(outpack + offset, if_hwaddr.ifr_hwaddr.sa_data, 6);
  if (setsockopt(sd, SOL_SOCKET, SO_BROADCAST, (char *)&one, sizeof(one)) < 0)
    return 17;
  offset += 6;
  whereto.sa_family = 0;
  strcpy(whereto.sa_data, ifname);
  int i;
  if ((i = sendto(sd, outpack, offset, 0, &whereto, sizeof(whereto))) < 0)
    return 18;
  else
    ;
  close(sd);
  return 0;
}


x86 assembly (clang, -O0):
<send_arping>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1010,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x1,-0xfd8(%rbp)
movl   $0x0,-0xfdc(%rbp)
mov    -0xfd4(%rbp),%eax
mov    %eax,-0x1010(%rbp)
mov    0x2e0e(%rip),%rax
mov    (%rax),%edi
mov    0x2e0d(%rip),%rax
mov    (%rax),%esi
mov    0x2e04(%rip),%rax
mov    (%rax),%edx
call   10b0 <socket@plt>
mov    %eax,%ecx
mov    -0x1010(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
jge    1230 <send_arping+0xa0>
mov    0x2db3(%rip),%rax
mov    (%rax),%rax
mov    0x2d99(%rip),%rcx
cmp    (%rcx),%rax
jne    1224 <send_arping+0x94>
movl   $0xe,-0x4(%rbp)
jmp    152a <send_arping+0x39a>
movl   $0xa,-0x4(%rbp)
jmp    152a <send_arping+0x39a>
mov    $0x0,%al
call   1050 <getuid@plt>
mov    %eax,%edi
call   10a0 <setuid@plt>
cmp    $0x0,%rax
je     1254 <send_arping+0xc4>
movl   $0xf,-0x4(%rbp)
jmp    152a <send_arping+0x39a>
movabs $0xffffffffffff,%rax
mov    %rax,-0xff8(%rbp)
lea    -0xfc0(%rbp),%rdi
xor    %eax,%eax
lea    -0xff8(%rbp),%rsi
mov    $0x6,%edx
call   1090 <memcpy@plt>
mov    -0xfdc(%rbp),%eax
add    $0x6,%eax
mov    %eax,-0xfdc(%rbp)
mov    -0xfe8(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0xfd4(%rbp),%edi
mov    0x2d16(%rip),%rax
mov    (%rax),%esi
lea    -0xff0(%rbp),%rdx
call   1060 <ioctl@plt>
cmp    $0x0,%rax
jge    12ce <send_arping+0x13e>
movl   $0x10,-0x4(%rbp)
jmp    152a <send_arping+0x39a>
lea    -0xfc0(%rbp),%rdi
movslq -0xfdc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0xff0(%rbp),%rsi
xor    %eax,%eax
mov    $0x6,%edx
call   1090 <memcpy@plt>
mov    -0xfdc(%rbp),%eax
add    $0x6,%eax
mov    %eax,-0xfdc(%rbp)
movl   $0x806,-0xffc(%rbp)
lea    -0xfc0(%rbp),%rdi
movslq -0xfdc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
xor    %eax,%eax
lea    -0xffc(%rbp),%rsi
mov    $0x2,%edx
call   1090 <memcpy@plt>
mov    -0xfdc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xfdc(%rbp)
movl   $0x1,-0x1000(%rbp)
movl   $0x800,-0x1004(%rbp)
movl   $0x1,-0x1008(%rbp)
lea    -0xfc0(%rbp),%rdi
movslq -0xfdc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
xor    %eax,%eax
lea    -0x1000(%rbp),%rsi
mov    $0x2,%edx
call   1090 <memcpy@plt>
mov    -0xfdc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xfdc(%rbp)
lea    -0xfc0(%rbp),%rdi
movslq -0xfdc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
xor    %eax,%eax
lea    -0x1004(%rbp),%rsi
mov    $0x2,%edx
call   1090 <memcpy@plt>
mov    -0xfdc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xfdc(%rbp)
movslq -0xfdc(%rbp),%rax
movl   $0x6,-0xfc0(%rbp,%rax,4)
mov    -0xfdc(%rbp),%eax
add    $0x1,%eax
cltq
movl   $0x4,-0xfc0(%rbp,%rax,4)
mov    -0xfdc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xfdc(%rbp)
lea    -0xfc0(%rbp),%rdi
movslq -0xfdc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
xor    %eax,%eax
lea    -0x1008(%rbp),%rsi
mov    $0x2,%edx
call   1090 <memcpy@plt>
mov    -0xfdc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xfdc(%rbp)
lea    -0xfc0(%rbp),%rdi
movslq -0xfdc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0xff0(%rbp),%rsi
xor    %eax,%eax
mov    $0x6,%edx
call   1090 <memcpy@plt>
mov    -0xfd4(%rbp),%edi
mov    0x2b73(%rip),%rax
mov    (%rax),%esi
mov    0x2b52(%rip),%rax
mov    (%rax),%edx
lea    -0xfd8(%rbp),%rcx
mov    $0x4,%r8d
call   1040 <setsockopt@plt>
cmp    $0x0,%rax
jge    14a8 <send_arping+0x318>
movl   $0x11,-0x4(%rbp)
jmp    152a <send_arping+0x39a>
mov    -0xfdc(%rbp),%eax
add    $0x6,%eax
mov    %eax,-0xfdc(%rbp)
movq   $0x0,-0xfc8(%rbp)
mov    -0xfd0(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0xfd4(%rbp),%edi
lea    -0xfc0(%rbp),%rsi
mov    -0xfdc(%rbp),%edx
xor    %ecx,%ecx
lea    -0xfd0(%rbp),%r8
mov    $0x10,%r9d
call   1070 <sendto@plt>
mov    %eax,-0x100c(%rbp)
cmp    $0x0,%eax
jge    1513 <send_arping+0x383>
movl   $0x12,-0x4(%rbp)
jmp    152a <send_arping+0x39a>
jmp    1518 <send_arping+0x388>
mov    -0xfd4(%rbp),%edi
call   1080 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_arping>:
push   %rbp
push   %rbx
sub    $0xfe8,%rsp
mov    %rsi,%rbx
movl   $0x1,0x14(%rsp)
mov    0x2e2d(%rip),%rax
mov    (%rax),%edi
mov    0x2e2c(%rip),%rax
mov    (%rax),%edx
mov    %edx,%esi
call   10b0 <socket@plt>
xor    %eax,%eax
call   1050 <getuid@plt>
mov    %eax,%edi
call   10a0 <setuid@plt>
mov    $0xf,%ebp
test   %rax,%rax
je     11e1 <send_arping+0x51>
mov    %ebp,%eax
add    $0xfe8,%rsp
pop    %rbx
pop    %rbp
ret
movabs $0xffffffffffff,%rax
mov    %rax,0x18(%rsp)
lea    0x40(%rsp),%rdi
lea    0x18(%rsp),%rsi
mov    $0x6,%edx
xor    %eax,%eax
call   1090 <memcpy@plt>
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    0x2dab(%rip),%rax
mov    (%rax),%esi
lea    0x20(%rsp),%rdx
call   1060 <ioctl@plt>
test   %rax,%rax
js     134d <send_arping+0x1bd>
lea    0x58(%rsp),%rdi
mov    0x20(%rsp),%rsi
mov    $0x6,%edx
xor    %eax,%eax
call   1090 <memcpy@plt>
movl   $0x806,0x10(%rsp)
lea    0x70(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    $0x2,%edx
xor    %eax,%eax
call   1090 <memcpy@plt>
movl   $0x1,0xc(%rsp)
movl   $0x800,0x8(%rsp)
movl   $0x1,0x4(%rsp)
lea    0x78(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    $0x2,%edx
xor    %eax,%eax
call   1090 <memcpy@plt>
lea    0x80(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0x2,%edx
xor    %eax,%eax
call   1090 <memcpy@plt>
movabs $0x400000006,%rax
mov    %rax,0x88(%rsp)
lea    0x90(%rsp),%rdi
lea    0x4(%rsp),%rsi
mov    $0x2,%edx
xor    %eax,%eax
call   1090 <memcpy@plt>
lea    0x98(%rsp),%rdi
mov    0x20(%rsp),%rsi
mov    $0x6,%edx
xor    %eax,%eax
call   1090 <memcpy@plt>
mov    0x2cf8(%rip),%rax
mov    (%rax),%esi
mov    0x2cd7(%rip),%rax
mov    (%rax),%edx
lea    0x14(%rsp),%rcx
mov    $0x4,%r8d
call   1040 <setsockopt@plt>
test   %rax,%rax
js     1357 <send_arping+0x1c7>
movq   $0x0,0x38(%rsp)
mov    %rbx,%rsi
call   1030 <strcpy@plt>
lea    0x40(%rsp),%rsi
xor    %ebp,%ebp
lea    0x30(%rsp),%r8
mov    $0x1c,%edx
xor    %ecx,%ecx
mov    $0x10,%r9d
call   1070 <sendto@plt>
test   %eax,%eax
js     1361 <send_arping+0x1d1>
call   1080 <close@plt>
jmp    11d5 <send_arping+0x45>
mov    $0x10,%ebp
jmp    11d5 <send_arping+0x45>
mov    $0x11,%ebp
jmp    11d5 <send_arping+0x45>
mov    $0x12,%ebp
jmp    11d5 <send_arping+0x45>

LLVM IR (-O0):
%struct.cfgData = type { i32 }
%struct.sockaddr = type { i32, i64 }
%struct.ifreq = type { %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32* }
@AF_INET = global i32 0
@SOCK_PACKET = global i32 0
@errno = global i64 0
@EPERM = global i64 0
@SIOCGIFHWADDR = global i32 0
@SOL_SOCKET = global i32 0
@SO_BROADCAST = global i32 0
define i32 @send_arping(%struct.cfgData* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.cfgData*
%5 = alloca i8*
%6 = alloca [1000 x i32]
%7 = alloca %struct.sockaddr
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca %struct.ifreq
%12 = alloca i64
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
store %struct.cfgData* %0, %struct.cfgData** %4
store i8* %1, i8** %5
store i32 1, i32* %9
store i32 0, i32* %10
%18 = load i32, i32* %8
%19 = load i32, i32* @AF_INET
%20 = load i32, i32* @SOCK_PACKET
%21 = load i32, i32* @SOCK_PACKET
%22 = call i32 @socket(i32 %19, i32 %20, i32 %21)
%23 = icmp eq i32 %18, %22
%24 = zext i1 %23 to i32
%25 = icmp slt i32 %24, 0
br i1 %25, label %26, label %32
26: ; preds = %2
%27 = load i64, i64* @errno
%28 = load i64, i64* @EPERM
%29 = icmp eq i64 %27, %28
br i1 %29, label %30, label %31
30: ; preds = %26
store i32 14, i32* %3
br label %132
31: ; preds = %26
store i32 10, i32* %3
br label %132
32: ; preds = %2
%33 = call i32 (...) @getuid()
%34 = call i64 @setuid(i32 %33)
%35 = icmp ne i64 %34, 0
br i1 %35, label %36, label %37
36: ; preds = %32
store i32 15, i32* %3
br label %132
37: ; preds = %32
store i64 281474976710655, i64* %12
%38 = getelementptr inbounds [1000 x i32], [1000 x i32]* %6, i64 0, i64 0
%39 = call i32 (i32*, ...) @memcpy(i32* %38, i64* %12, i32 6)
%40 = load i32, i32* %10
%41 = add nsw i32 %40, 6
store i32 %41, i32* %10
%42 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %11, i32 0, i32 1
%43 = load i32, i32* %42
%44 = load i8*, i8** %5
%45 = call i32 @strcpy(i32 %43, i8* %44)
%46 = load i32, i32* %8
%47 = load i32, i32* @SIOCGIFHWADDR
%48 = call i64 @ioctl(i32 %46, i32 %47, %struct.ifreq* %11)
%49 = icmp slt i64 %48, 0
br i1 %49, label %50, label %51
50: ; preds = %37
store i32 16, i32* %3
br label %132
51: ; preds = %37
%52 = getelementptr inbounds [1000 x i32], [1000 x i32]* %6, i64 0, i64 0
%53 = load i32, i32* %10
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i32, i32* %52, i64 %54
%56 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %11, i32 0, i32 0
%57 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %56, i32 0, i32 0
%58 = load i32*, i32** %57
%59 = call i32 (i32*, ...) @memcpy(i32* %55, i32* %58, i32 6)
%60 = load i32, i32* %10
%61 = add nsw i32 %60, 6
store i32 %61, i32* %10
store i32 2054, i32* %13
%62 = getelementptr inbounds [1000 x i32], [1000 x i32]* %6, i64 0, i64 0
%63 = load i32, i32* %10
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i32, i32* %62, i64 %64
%66 = call i32 (i32*, ...) @memcpy(i32* %65, i32* %13, i32 2)
%67 = load i32, i32* %10
%68 = add nsw i32 %67, 2
store i32 %68, i32* %10
store i32 1, i32* %14
store i32 2048, i32* %15
store i32 1, i32* %16
%69 = getelementptr inbounds [1000 x i32], [1000 x i32]* %6, i64 0, i64 0
%70 = load i32, i32* %10
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds i32, i32* %69, i64 %71
%73 = call i32 (i32*, ...) @memcpy(i32* %72, i32* %14, i32 2)
%74 = load i32, i32* %10
%75 = add nsw i32 %74, 2
store i32 %75, i32* %10
%76 = getelementptr inbounds [1000 x i32], [1000 x i32]* %6, i64 0, i64 0
%77 = load i32, i32* %10
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i32, i32* %76, i64 %78
%80 = call i32 (i32*, ...) @memcpy(i32* %79, i32* %15, i32 2)
%81 = load i32, i32* %10
%82 = add nsw i32 %81, 2
store i32 %82, i32* %10
%83 = load i32, i32* %10
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds [1000 x i32], [1000 x i32]* %6, i64 0, i64 %84
store i32 6, i32* %85
%86 = load i32, i32* %10
%87 = add nsw i32 %86, 1
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [1000 x i32], [1000 x i32]* %6, i64 0, i64 %88
store i32 4, i32* %89
%90 = load i32, i32* %10
%91 = add nsw i32 %90, 2
store i32 %91, i32* %10
%92 = getelementptr inbounds [1000 x i32], [1000 x i32]* %6, i64 0, i64 0
%93 = load i32, i32* %10
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds i32, i32* %92, i64 %94
%96 = call i32 (i32*, ...) @memcpy(i32* %95, i32* %16, i32 2)
%97 = load i32, i32* %10
%98 = add nsw i32 %97, 2
store i32 %98, i32* %10
%99 = getelementptr inbounds [1000 x i32], [1000 x i32]* %6, i64 0, i64 0
%100 = load i32, i32* %10
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds i32, i32* %99, i64 %101
%103 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %11, i32 0, i32 0
%104 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %103, i32 0, i32 0
%105 = load i32*, i32** %104
%106 = call i32 (i32*, ...) @memcpy(i32* %102, i32* %105, i32 6)
%107 = load i32, i32* %8
%108 = load i32, i32* @SOL_SOCKET
%109 = load i32, i32* @SO_BROADCAST
%110 = bitcast i32* %9 to i8*
%111 = call i64 @setsockopt(i32 %107, i32 %108, i32 %109, i8* %110, i32 4)
%112 = icmp slt i64 %111, 0
br i1 %112, label %113, label %114
113: ; preds = %51
store i32 17, i32* %3
br label %132
114: ; preds = %51
%115 = load i32, i32* %10
%116 = add nsw i32 %115, 6
store i32 %116, i32* %10
%117 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %7, i32 0, i32 1
store i64 0, i64* %117
%118 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %7, i32 0, i32 0
%119 = load i32, i32* %118
%120 = load i8*, i8** %5
%121 = call i32 @strcpy(i32 %119, i8* %120)
%122 = load i32, i32* %8
%123 = getelementptr inbounds [1000 x i32], [1000 x i32]* %6, i64 0, i64 0
%124 = load i32, i32* %10
%125 = call i32 @sendto(i32 %122, i32* %123, i32 %124, i32 0, %struct.sockaddr* %7, i32 16)
store i32 %125, i32* %17
%126 = icmp slt i32 %125, 0
br i1 %126, label %127, label %128
127: ; preds = %114
store i32 18, i32* %3
br label %132
128: ; preds = %114
br label %129
129: ; preds = %128
%130 = load i32, i32* %8
%131 = call i32 @close(i32 %130)
store i32 0, i32* %3
br label %132
132: ; preds = %129, %127, %113, %50, %36, %31, %30
%133 = load i32, i32* %3
ret i32 %133
}

LLVM IR (-O2):
%struct.cfgData = type { i32 }
%struct.sockaddr = type { i32, i64 }
%struct.ifreq = type { %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32* }
@AF_INET = global i32 0
@SOCK_PACKET = global i32 0
@errno = global i64 0
@EPERM = global i64 0
@SIOCGIFHWADDR = global i32 0
@SOL_SOCKET = global i32 0
@SO_BROADCAST = global i32 0
define i32 @send_arping(%struct.cfgData* nocapture readnone %0, i8* %1) {
%3 = alloca [1000 x i32]
%4 = alloca %struct.sockaddr
%5 = alloca i32
%6 = alloca %struct.ifreq
%7 = alloca i64
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = bitcast [1000 x i32]* %3 to i8*
%13 = bitcast %struct.sockaddr* %4 to i8*
%14 = bitcast i32* %5 to i8*
store i32 1, i32* %5
%15 = load i32, i32* @AF_INET
%16 = load i32, i32* @SOCK_PACKET
%17 = tail call i32 @socket(i32 %15, i32 %16, i32 %16)
%18 = tail call i32 (...) @getuid()
%19 = tail call i64 @setuid(i32 %18)
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %67
21: ; preds = %2
%22 = bitcast %struct.ifreq* %6 to i8*
%23 = bitcast i64* %7 to i8*
store i64 281474976710655, i64* %7
%24 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 0
%25 = call i32 (i32*, ...) @memcpy(i32* %24, i64* %7, i32 6)
%26 = call i32 @strcpy(i32 undef, i8* %1)
%27 = load i32, i32* @SIOCGIFHWADDR
%28 = call i64 @ioctl(i32 undef, i32 %27, %struct.ifreq* %6)
%29 = icmp slt i64 %28, 0
br i1 %29, label %65, label %30
30: ; preds = %21
%31 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 6
%32 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %6, i64 0, i32 0, i32 0
%33 = load i32*, i32** %32
%34 = call i32 (i32*, ...) @memcpy(i32* %31, i32* %33, i32 6)
%35 = bitcast i32* %8 to i8*
store i32 2054, i32* %8
%36 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 12
%37 = call i32 (i32*, ...) @memcpy(i32* %36, i32* %8, i32 2)
%38 = bitcast i32* %9 to i8*
store i32 1, i32* %9
%39 = bitcast i32* %10 to i8*
store i32 2048, i32* %10
%40 = bitcast i32* %11 to i8*
store i32 1, i32* %11
%41 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 14
%42 = call i32 (i32*, ...) @memcpy(i32* %41, i32* %9, i32 2)
%43 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 16
%44 = call i32 (i32*, ...) @memcpy(i32* %43, i32* %10, i32 2)
%45 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 18
store i32 6, i32* %45
%46 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 19
store i32 4, i32* %46
%47 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 20
%48 = call i32 (i32*, ...) @memcpy(i32* %47, i32* %11, i32 2)
%49 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 22
%50 = load i32*, i32** %32
%51 = call i32 (i32*, ...) @memcpy(i32* %49, i32* %50, i32 6)
%52 = load i32, i32* @SOL_SOCKET
%53 = load i32, i32* @SO_BROADCAST
%54 = call i64 @setsockopt(i32 undef, i32 %52, i32 %53, i8* %14, i32 4)
%55 = icmp slt i64 %54, 0
br i1 %55, label %63, label %56
56: ; preds = %30
%57 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %4, i64 0, i32 1
store i64 0, i64* %57
%58 = call i32 @strcpy(i32 undef, i8* %1)
%59 = call i32 @sendto(i32 undef, i32* %24, i32 28, i32 0, %struct.sockaddr* %4, i32 16)
%60 = icmp slt i32 %59, 0
br i1 %60, label %63, label %61
61: ; preds = %56
%62 = call i32 @close(i32 undef)
br label %63
63: ; preds = %61, %56, %30
%64 = phi i32 [ 17, %30 ], [ 0, %61 ], [ 18, %56 ]
br label %65
65: ; preds = %21, %63
%66 = phi i32 [ %64, %63 ], [ 16, %21 ]
br label %67
67: ; preds = %2, %65
%68 = phi i32 [ %66, %65 ], [ 15, %2 ]
ret i32 %68
}