#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 dhcpOfferedAddr TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ tmpexpires;
typedef int /*<<< orphan*/ sysCmd;
struct in_addr {
  unsigned long s_addr;
};
typedef int /*<<< orphan*/ lease;
struct dhcpOfferedAddr {
  unsigned char *mac;
  unsigned long ip;
  unsigned long expires;
  unsigned char *hostname;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fread(TYPE_1__ *, int, int, int /*<<< orphan*/ *);
char *inet_ntoa(struct in_addr);
int /*<<< orphan*/ isARPReply(char *);
char *mac2if(char *);
unsigned long ntohl(unsigned long);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, unsigned char, unsigned char,
                           unsigned char, unsigned char, unsigned char,
                           unsigned char);
scalar_t__ strlen(unsigned char *);
int /*<<< orphan*/ system(char *);
int scanDhcpLease() {
  FILE *fp;
  char tmpmac[30];
  char sysCmd[256];
  char tmpexpires[64];
  unsigned long expires;
  unsigned d, h, m;
  struct dhcpOfferedAddr {
    unsigned char mac[16];
    unsigned long ip;
    unsigned long expires;
    unsigned char hostname[64];
  } lease;
  struct in_addr addr;
  snprintf(sysCmd, sizeof(sysCmd),
           "sqlite3 /tmp/system.db \"delete from DhcpLeasedClients\"");
  system(sysCmd);
  system("killall -q -USR1 udhcpd");
  fp = fopen("/tmp/udhcpd0.leases", "r");
  if (NULL == fp) {
    return -1;
  }
  while (fread(&lease, 1, sizeof(lease), fp) == sizeof(lease)) {
    if (strlen(lease.hostname) > 0) {
      sprintf(tmpmac, "%02x:%02x:%02x:%02x:%02x:%02x", lease.mac[0],
              lease.mac[1], lease.mac[2], lease.mac[3], lease.mac[4],
              lease.mac[5]);
      addr.s_addr = lease.ip;
      expires = ntohl(lease.expires);
      d = expires / (24 * 60 * 60);
      expires %= (24 * 60 * 60);
      h = expires / (60 * 60);
      expires %= (60 * 60);
      m = expires / 60;
      expires %= 60;
      if (d)
        snprintf(tmpexpires, sizeof(tmpexpires), "%u days %02u:%02u:%02u\n", d,
                 h, m, (unsigned)expires);
      if (!isARPReply(inet_ntoa(addr))) {
        snprintf(sysCmd, sizeof(sysCmd),
                 "sqlite3 /tmp/system.db \"insert into attacheddevice  "
                 "(AttchedType, IpAddress, MacAddress, DeviceName) values "
                 "('%s', '%s', '%s', '%s')\"",
                 mac2if(tmpmac), inet_ntoa(addr), tmpmac, lease.hostname);
        printf("[debug] %s\n", sysCmd);
        system(sysCmd);
      } else
        printf("%s didn't exist anymore...\n", inet_ntoa(addr));
      snprintf(sysCmd, sizeof(sysCmd),
               "sqlite3 /tmp/system.db \"insert into DhcpLeasedClients "
               "(LogicalIfname, hostName, IPAddress, MacAddress, Timeout, "
               "clientIf)  values ('br0', '%s', '%s', '%s', '%s', '%s')\"",
               lease.hostname, inet_ntoa(addr), tmpmac, tmpexpires,
               mac2if(tmpmac));
      system(sysCmd);
      return 0;
    }
  }
  fclose(fp);
  fp = fopen("/tmp/udhcpd1.leases", "r");
  if (NULL == fp) {
    return -1;
  }
  while (fread(&lease, 1, sizeof(lease), fp) == sizeof(lease)) {
    if (strlen(lease.hostname) > 0) {
      sprintf(tmpmac, "%02x:%02x:%02x:%02x:%02x:%02x", lease.mac[0],
              lease.mac[1], lease.mac[2], lease.mac[3], lease.mac[4],
              lease.mac[5]);
      addr.s_addr = lease.ip;
      if (!isARPReply(inet_ntoa(addr))) {
        snprintf(sysCmd, sizeof(sysCmd),
                 "sqlite3 /tmp/system.db \"insert into attacheddevice  "
                 "(AttchedType, IpAddress, MacAddress, DeviceName) values "
                 "('%s', '%s', '%s', '%s')\"",
                 mac2if(tmpmac), inet_ntoa(addr), tmpmac, lease.hostname);
        system(sysCmd);
      } else
        printf("%s didn't exist anymore...\n", inet_ntoa(addr));
      return 0;
    }
  }
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<scanDhcpLease>:
push   %rbp
mov    %rsp,%rbp
sub    $0x250,%rsp
lea    -0x130(%rbp),%rdi
mov    $0x100,%esi
lea    0xe22(%rip),%rdx
mov    $0x0,%al
call   1090 <snprintf@plt>
lea    -0x130(%rbp),%rdi
call   1070 <system@plt>
lea    0xe3f(%rip),%rdi
call   1070 <system@plt>
lea    0xe4b(%rip),%rdi
lea    0xe58(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    122c <scanDhcpLease+0x6c>
movl   $0xffffffff,-0x4(%rbp)
jmp    16c6 <scanDhcpLease+0x506>
jmp    1231 <scanDhcpLease+0x71>
lea    -0x1e8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0x60,%edx
call   1030 <fread@plt>
cltq
cmp    $0x60,%rax
jne    1521 <scanDhcpLease+0x361>
lea    -0x1e8(%rbp),%rdi
add    $0x20,%rdi
call   1060 <strlen@plt>
cmp    $0x0,%rax
jle    151c <scanDhcpLease+0x35c>
lea    -0x30(%rbp),%rdi
mov    -0x1e8(%rbp),%dl
mov    -0x1e7(%rbp),%cl
mov    -0x1e6(%rbp),%r8b
mov    -0x1e5(%rbp),%r9b
mov    -0x1e4(%rbp),%al
lea    0xdc9(%rip),%rsi
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl %r8b,%r8d
movzbl %r9b,%r9d
movzbl %al,%eax
mov    %eax,(%rsp)
movzbl -0x1e3(%rbp),%eax
mov    %eax,0x8(%rsp)
call   10d0 <sprintf@plt>
mov    -0x1d8(%rbp),%rax
mov    %rax,-0x1f0(%rbp)
mov    -0x1d0(%rbp),%rdi
call   10e0 <ntohl@plt>
mov    %rax,-0x178(%rbp)
mov    -0x178(%rbp),%rax
mov    $0x15180,%ecx
xor    %edx,%edx
div    %rcx
mov    %eax,-0x17c(%rbp)
mov    -0x178(%rbp),%rax
mov    $0x15180,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x178(%rbp)
mov    -0x178(%rbp),%rax
mov    $0xe10,%ecx
xor    %edx,%edx
div    %rcx
mov    %eax,-0x180(%rbp)
mov    -0x178(%rbp),%rax
mov    $0xe10,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x178(%rbp)
mov    -0x178(%rbp),%rax
mov    $0x3c,%ecx
xor    %edx,%edx
div    %rcx
mov    %eax,-0x184(%rbp)
mov    -0x178(%rbp),%rax
mov    $0x3c,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x178(%rbp)
cmpl   $0x0,-0x17c(%rbp)
je     13b3 <scanDhcpLease+0x1f3>
lea    -0x170(%rbp),%rdi
mov    -0x17c(%rbp),%ecx
mov    -0x180(%rbp),%r8d
mov    -0x184(%rbp),%r9d
mov    -0x178(%rbp),%rax
mov    $0x40,%esi
lea    0xcda(%rip),%rdx
mov    %eax,(%rsp)
mov    $0x0,%al
call   1090 <snprintf@plt>
mov    -0x1f0(%rbp),%rdi
call   1040 <inet_ntoa@plt>
mov    %rax,%rdi
call   10b0 <isARPReply@plt>
cmp    $0x0,%eax
jne    1455 <scanDhcpLease+0x295>
lea    -0x130(%rbp),%rax
mov    %rax,-0x200(%rbp)
lea    -0x30(%rbp),%rdi
call   10c0 <mac2if@plt>
mov    %rax,-0x1f8(%rbp)
mov    -0x1f0(%rbp),%rdi
call   1040 <inet_ntoa@plt>
mov    -0x200(%rbp),%rdi
mov    -0x1f8(%rbp),%rcx
mov    %rax,%r8
lea    -0x30(%rbp),%r9
lea    -0x1e8(%rbp),%rax
add    $0x20,%rax
mov    $0x100,%esi
lea    0xc75(%rip),%rdx
mov    %rax,(%rsp)
mov    $0x0,%al
call   1090 <snprintf@plt>
lea    -0x130(%rbp),%rsi
lea    0xce2(%rip),%rdi
call   1080 <printf@plt>
lea    -0x130(%rbp),%rdi
call   1070 <system@plt>
jmp    1470 <scanDhcpLease+0x2b0>
mov    -0x1f0(%rbp),%rdi
call   1040 <inet_ntoa@plt>
mov    %rax,%rsi
lea    0xcc2(%rip),%rdi
call   1080 <printf@plt>
lea    -0x130(%rbp),%rax
mov    %rax,-0x228(%rbp)
lea    -0x1e8(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x220(%rbp)
mov    -0x1f0(%rbp),%rdi
call   1040 <inet_ntoa@plt>
mov    %rax,-0x218(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x210(%rbp)
lea    -0x170(%rbp),%rax
mov    %rax,-0x208(%rbp)
lea    -0x30(%rbp),%rdi
call   10c0 <mac2if@plt>
mov    -0x228(%rbp),%rdi
mov    -0x220(%rbp),%rcx
mov    -0x218(%rbp),%r8
mov    -0x210(%rbp),%r9
mov    -0x208(%rbp),%r10
mov    $0x100,%esi
lea    0xc55(%rip),%rdx
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1090 <snprintf@plt>
lea    -0x130(%rbp),%rdi
call   1070 <system@plt>
movl   $0x0,-0x4(%rbp)
jmp    16c6 <scanDhcpLease+0x506>
jmp    1231 <scanDhcpLease+0x71>
mov    -0x10(%rbp),%rdi
call   1050 <fclose@plt>
lea    0xcc1(%rip),%rdi
lea    0xb2b(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1559 <scanDhcpLease+0x399>
movl   $0xffffffff,-0x4(%rbp)
jmp    16c6 <scanDhcpLease+0x506>
jmp    155e <scanDhcpLease+0x39e>
lea    -0x1e8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0x60,%edx
call   1030 <fread@plt>
cltq
cmp    $0x60,%rax
jne    16b6 <scanDhcpLease+0x4f6>
lea    -0x1e8(%rbp),%rdi
add    $0x20,%rdi
call   1060 <strlen@plt>
cmp    $0x0,%rax
jle    16b1 <scanDhcpLease+0x4f1>
lea    -0x30(%rbp),%rdi
mov    -0x1e8(%rbp),%dl
mov    -0x1e7(%rbp),%cl
mov    -0x1e6(%rbp),%r8b
mov    -0x1e5(%rbp),%r9b
mov    -0x1e4(%rbp),%al
lea    0xa9c(%rip),%rsi
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl %r8b,%r8d
movzbl %r9b,%r9d
movzbl %al,%eax
mov    %eax,(%rsp)
movzbl -0x1e3(%rbp),%eax
mov    %eax,0x8(%rsp)
call   10d0 <sprintf@plt>
mov    -0x1d8(%rbp),%rax
mov    %rax,-0x1f0(%rbp)
mov    -0x1f0(%rbp),%rdi
call   1040 <inet_ntoa@plt>
mov    %rax,%rdi
call   10b0 <isARPReply@plt>
cmp    $0x0,%eax
jne    168a <scanDhcpLease+0x4ca>
lea    -0x130(%rbp),%rax
mov    %rax,-0x238(%rbp)
lea    -0x30(%rbp),%rdi
call   10c0 <mac2if@plt>
mov    %rax,-0x230(%rbp)
mov    -0x1f0(%rbp),%rdi
call   1040 <inet_ntoa@plt>
mov    -0x238(%rbp),%rdi
mov    -0x230(%rbp),%rcx
mov    %rax,%r8
lea    -0x30(%rbp),%r9
lea    -0x1e8(%rbp),%rax
add    $0x20,%rax
mov    $0x100,%esi
lea    0xa2d(%rip),%rdx
mov    %rax,(%rsp)
mov    $0x0,%al
call   1090 <snprintf@plt>
lea    -0x130(%rbp),%rdi
call   1070 <system@plt>
jmp    16a5 <scanDhcpLease+0x4e5>
mov    -0x1f0(%rbp),%rdi
call   1040 <inet_ntoa@plt>
mov    %rax,%rsi
lea    0xa8d(%rip),%rdi
call   1080 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    16c6 <scanDhcpLease+0x506>
jmp    155e <scanDhcpLease+0x39e>
mov    -0x10(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x250,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scanDhcpLease>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1c8,%rsp
lea    0xe28(%rip),%rdx
lea    0xc0(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
xor    %eax,%eax
call   1090 <snprintf@plt>
mov    %rbx,%rdi
call   1070 <system@plt>
lea    0xe39(%rip),%rdi
call   1070 <system@plt>
lea    0xe45(%rip),%rdi
lea    0xe52(%rip),%rsi
call   10a0 <fopen@plt>
mov    $0xffffffff,%r14d
test   %rax,%rax
je     14e3 <scanDhcpLease+0x323>
mov    %rax,%rbp
lea    0x20(%rsp),%r15
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x60,%edx
mov    %rbp,%rcx
call   1030 <fread@plt>
cmp    $0x60,%eax
jne    134b <scanDhcpLease+0x18b>
mov    %r15,%rdi
call   1060 <strlen@plt>
test   %rax,%rax
jle    1230 <scanDhcpLease+0x70>
movzbl (%rsp),%edx
movzbl 0x1(%rsp),%ecx
movzbl 0x2(%rsp),%r8d
movzbl 0x3(%rsp),%r9d
movzbl 0x4(%rsp),%eax
movzbl 0x5(%rsp),%ebp
lea    0xde4(%rip),%rsi
lea    0x60(%rsp),%rdi
push   %rbp
push   %rax
call   10d0 <sprintf@plt>
add    $0x10,%rsp
mov    0x10(%rsp),%r14
mov    0x18(%rsp),%rdi
call   10e0 <ntohl@plt>
mov    %rax,%rsi
movabs $0xc22e450672894ab7,%rcx
45 2e c2
mul    %rcx
mov    %rdx,%rcx
shr    $0x10,%rcx
test   %ecx,%ecx
je     1317 <scanDhcpLease+0x157>
imul   $0x15180,%ecx,%eax
sub    %eax,%esi
mov    %esi,%eax
mov    $0x91a2b3c5,%r8d
imul   %rax,%r8
shr    $0x2b,%r8
imul   $0xe10,%r8d,%eax
sub    %eax,%esi
movzwl %si,%eax
imul   $0x8889,%eax,%r9d
shr    $0x15,%r9d
imul   $0x3c,%r9d,%eax
sub    %eax,%esi
movzwl %si,%ebp
sub    $0x8,%rsp
lea    0xd85(%rip),%rdx
lea    0x88(%rsp),%rdi
mov    $0x40,%esi
xor    %eax,%eax
push   %rbp
call   1090 <snprintf@plt>
add    $0x10,%rsp
mov    %r14,%rdi
call   1040 <inet_ntoa@plt>
mov    %rax,%rdi
call   10b0 <isARPReply@plt>
test   %eax,%eax
je     141a <scanDhcpLease+0x25a>
mov    %r14,%rdi
call   1040 <inet_ntoa@plt>
lea    0xdef(%rip),%rdi
mov    %rax,%rsi
call   1080 <printf@plt>
jmp    147a <scanDhcpLease+0x2ba>
mov    %rbp,%rdi
call   1050 <fclose@plt>
lea    0xe98(%rip),%rdi
lea    0xd02(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     14e3 <scanDhcpLease+0x323>
mov    %rax,%rbp
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x60,%edx
mov    %rbp,%rcx
call   1030 <fread@plt>
cmp    $0x60,%eax
jne    14d8 <scanDhcpLease+0x318>
mov    %r15,%rdi
call   1060 <strlen@plt>
test   %rax,%rax
jle    1380 <scanDhcpLease+0x1c0>
movzbl (%rsp),%edx
movzbl 0x1(%rsp),%ecx
movzbl 0x2(%rsp),%r8d
movzbl 0x3(%rsp),%r9d
movzbl 0x4(%rsp),%eax
movzbl 0x5(%rsp),%ebp
lea    0xc94(%rip),%rsi
lea    0x60(%rsp),%rdi
push   %rbp
push   %rax
call   10d0 <sprintf@plt>
add    $0x10,%rsp
mov    0x10(%rsp),%rbp
mov    %rbp,%rdi
call   1040 <inet_ntoa@plt>
mov    %rax,%rdi
call   10b0 <isARPReply@plt>
test   %eax,%eax
je     14f8 <scanDhcpLease+0x338>
mov    %rbp,%rdi
call   1040 <inet_ntoa@plt>
lea    0xd20(%rip),%rdi
mov    %rax,%rsi
call   1080 <printf@plt>
jmp    14e0 <scanDhcpLease+0x320>
lea    0x60(%rsp),%r12
mov    %r12,%rdi
call   10c0 <mac2if@plt>
mov    %rax,%rbp
mov    %r14,%rdi
call   1040 <inet_ntoa@plt>
sub    $0x8,%rsp
lea    0xc5e(%rip),%rdx
lea    0xc8(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
mov    %rbp,%rcx
mov    %rax,%r8
mov    %r12,%r9
xor    %eax,%eax
push   %r15
call   1090 <snprintf@plt>
add    $0x10,%rsp
lea    0xcb7(%rip),%rdi
mov    %rbx,%rsi
call   1080 <printf@plt>
mov    %rbx,%rdi
call   1070 <system@plt>
mov    %r14,%rdi
call   1040 <inet_ntoa@plt>
mov    %rax,%rbx
lea    0x60(%rsp),%r12
mov    %r12,%rdi
call   10c0 <mac2if@plt>
mov    %rax,%rbp
lea    0x80(%rsp),%r10
lea    0xca5(%rip),%rdx
xor    %r14d,%r14d
lea    0xc0(%rsp),%r13
mov    %r13,%rdi
mov    $0x100,%esi
mov    %r15,%rcx
mov    %rbx,%r8
mov    %r12,%r9
xor    %eax,%eax
push   %rbp
push   %r10
call   1090 <snprintf@plt>
add    $0x10,%rsp
mov    %r13,%rdi
call   1070 <system@plt>
jmp    14e3 <scanDhcpLease+0x323>
mov    %rbp,%rdi
call   1050 <fclose@plt>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x1c8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x60(%rsp),%r12
mov    %r12,%rdi
call   10c0 <mac2if@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
call   1040 <inet_ntoa@plt>
sub    $0x8,%rsp
lea    0xb80(%rip),%rdx
xor    %r14d,%r14d
lea    0xc8(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x100,%esi
mov    %rbx,%rcx
mov    %rax,%r8
mov    %r12,%r9
xor    %eax,%eax
push   %r15
call   1090 <snprintf@plt>
add    $0x10,%rsp
mov    %rbp,%rdi
call   1070 <system@plt>
jmp    14e3 <scanDhcpLease+0x323>

LLVM IR (-O0):
%struct.dhcpOfferedAddr = type { [16 x i8], i64, i64, [64 x i8] }
%struct.in_addr = type { i64 }
%struct.dhcpOfferedAddr.0 = type { i8*, i64, i64, i8* }
@.str = [55 x i8] c"sqlite3 /tmp/system.db \22delete from DhcpLeasedClients\22\00"
@.str.1 = [24 x i8] c"killall -q -USR1 udhcpd\00"
@.str.2 = [20 x i8] c"/tmp/udhcpd0.leases\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [30 x i8] c"%02x:%02x:%02x:%02x:%02x:%02x\00"
@.str.5 = [24 x i8] c"%u days %02u:%02u:%02u\0A\00"
@.str.6 = [134 x i8] c"sqlite3 /tmp/system.db \22insert into attacheddevice (AttchedType, IpAddress, MacAddress, DeviceName) values ('%s', '%s', '%s', '%s')\22\00"
@.str.7 = [12 x i8] c"[debug] %s\0A\00"
@.str.8 = [28 x i8] c"%s didn't exist anymore...\0A\00"
@.str.9 = [169 x i8] c"sqlite3 /tmp/system.db \22insert into DhcpLeasedClients (LogicalIfname, hostName, IPAddress, MacAddress, Timeout, clientIf) values ('br0', '%s', '%s', '%s', '%s', '%s')\22\00"
@.str.10 = [20 x i8] c"/tmp/udhcpd1.leases\00"
define i32 @scanDhcpLease() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca [30 x i8]
%4 = alloca [256 x i8]
%5 = alloca [64 x i8]
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.dhcpOfferedAddr
%11 = alloca %struct.in_addr
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%13 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %12, i32 256, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%14 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%15 = call i32 @system(i8* %14)
%16 = call i32 @system(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %17, i32** %2
%18 = load i32*, i32** %2
%19 = icmp eq i32* null, %18
br i1 %19, label %20, label %21
20: ; preds = %0
store i32 -1, i32* %1
br label %197
21: ; preds = %0
br label %22
22: ; preds = %125, %21
%23 = bitcast %struct.dhcpOfferedAddr* %10 to %struct.dhcpOfferedAddr.0*
%24 = load i32*, i32** %2
%25 = call i32 @fread(%struct.dhcpOfferedAddr.0* %23, i32 1, i32 96, i32* %24)
%26 = sext i32 %25 to i64
%27 = icmp eq i64 %26, 96
br i1 %27, label %28, label %126
28: ; preds = %22
%29 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %10, i32 0, i32 3
%30 = getelementptr inbounds [64 x i8], [64 x i8]* %29, i64 0, i64 0
%31 = call i64 @strlen(i8* %30)
%32 = icmp sgt i64 %31, 0
br i1 %32, label %33, label %125
33: ; preds = %28
%34 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%35 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %10, i32 0, i32 0
%36 = getelementptr inbounds [16 x i8], [16 x i8]* %35, i64 0, i64 0
%37 = load i8, i8* %36
%38 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %10, i32 0, i32 0
%39 = getelementptr inbounds [16 x i8], [16 x i8]* %38, i64 0, i64 1
%40 = load i8, i8* %39
%41 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %10, i32 0, i32 0
%42 = getelementptr inbounds [16 x i8], [16 x i8]* %41, i64 0, i64 2
%43 = load i8, i8* %42
%44 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %10, i32 0, i32 0
%45 = getelementptr inbounds [16 x i8], [16 x i8]* %44, i64 0, i64 3
%46 = load i8, i8* %45
%47 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %10, i32 0, i32 0
%48 = getelementptr inbounds [16 x i8], [16 x i8]* %47, i64 0, i64 4
%49 = load i8, i8* %48
%50 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %10, i32 0, i32 0
%51 = getelementptr inbounds [16 x i8], [16 x i8]* %50, i64 0, i64 5
%52 = load i8, i8* %51
%53 = call i32 @sprintf(i8* %34, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8 zeroext %37, i8 zeroext %40, i8 zeroext %43, i8 zeroext %46, i8 zeroext %49, i8 zeroext %52)
%54 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %10, i32 0, i32 1
%55 = load i64, i64* %54
%56 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %11, i32 0, i32 0
store i64 %55, i64* %56
%57 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %10, i32 0, i32 2
%58 = load i64, i64* %57
%59 = call i64 @ntohl(i64 %58)
store i64 %59, i64* %6
%60 = load i64, i64* %6
%61 = udiv i64 %60, 86400
%62 = trunc i64 %61 to i32
store i32 %62, i32* %7
%63 = load i64, i64* %6
%64 = urem i64 %63, 86400
store i64 %64, i64* %6
%65 = load i64, i64* %6
%66 = udiv i64 %65, 3600
%67 = trunc i64 %66 to i32
store i32 %67, i32* %8
%68 = load i64, i64* %6
%69 = urem i64 %68, 3600
store i64 %69, i64* %6
%70 = load i64, i64* %6
%71 = udiv i64 %70, 60
%72 = trunc i64 %71 to i32
store i32 %72, i32* %9
%73 = load i64, i64* %6
%74 = urem i64 %73, 60
store i64 %74, i64* %6
%75 = load i32, i32* %7
%76 = icmp ne i32 %75, 0
br i1 %76, label %77, label %85
77: ; preds = %33
%78 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%79 = load i32, i32* %7
%80 = load i32, i32* %8
%81 = load i32, i32* %9
%82 = load i64, i64* %6
%83 = trunc i64 %82 to i32
%84 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %78, i32 64, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i32 %79, i32 %80, i32 %81, i32 %83)
br label %85
85: ; preds = %77, %33
%86 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %11, i32 0, i32 0
%87 = load i64, i64* %86
%88 = call i8* @inet_ntoa(i64 %87)
%89 = call i32 @isARPReply(i8* %88)
%90 = icmp ne i32 %89, 0
br i1 %90, label %106, label %91
91: ; preds = %85
%92 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%93 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%94 = call i8* @mac2if(i8* %93)
%95 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %11, i32 0, i32 0
%96 = load i64, i64* %95
%97 = call i8* @inet_ntoa(i64 %96)
%98 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%99 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %10, i32 0, i32 3
%100 = getelementptr inbounds [64 x i8], [64 x i8]* %99, i64 0, i64 0
%101 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %92, i32 256, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str.6, i64 0, i64 0), i8* %94, i8* %97, i8* %98, i8* %100)
%102 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%103 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i8* %102)
%104 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%105 = call i32 @system(i8* %104)
br label %111
106: ; preds = %85
%107 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %11, i32 0, i32 0
%108 = load i64, i64* %107
%109 = call i8* @inet_ntoa(i64 %108)
%110 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i8* %109)
br label %111
111: ; preds = %106, %91
%112 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%113 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %10, i32 0, i32 3
%114 = getelementptr inbounds [64 x i8], [64 x i8]* %113, i64 0, i64 0
%115 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %11, i32 0, i32 0
%116 = load i64, i64* %115
%117 = call i8* @inet_ntoa(i64 %116)
%118 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%119 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%120 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%121 = call i8* @mac2if(i8* %120)
%122 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %112, i32 256, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str.9, i64 0, i64 0), i8* %114, i8* %117, i8* %118, i8* %119, i8* %121)
%123 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%124 = call i32 @system(i8* %123)
store i32 0, i32* %1
br label %197
125: ; preds = %28
br label %22
126: ; preds = %22
%127 = load i32*, i32** %2
%128 = call i32 @fclose(i32* %127)
%129 = call i32* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %129, i32** %2
%130 = load i32*, i32** %2
%131 = icmp eq i32* null, %130
br i1 %131, label %132, label %133
132: ; preds = %126
store i32 -1, i32* %1
br label %197
133: ; preds = %126
br label %134
134: ; preds = %193, %133
%135 = bitcast %struct.dhcpOfferedAddr* %10 to %struct.dhcpOfferedAddr.0*
%136 = load i32*, i32** %2
%137 = call i32 @fread(%struct.dhcpOfferedAddr.0* %135, i32 1, i32 96, i32* %136)
%138 = sext i32 %137 to i64
%139 = icmp eq i64 %138, 96
br i1 %139, label %140, label %194
140: ; preds = %134
%141 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %10, i32 0, i32 3
%142 = getelementptr inbounds [64 x i8], [64 x i8]* %141, i64 0, i64 0
%143 = call i64 @strlen(i8* %142)
%144 = icmp sgt i64 %143, 0
br i1 %144, label %145, label %193
145: ; preds = %140
%146 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%147 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %10, i32 0, i32 0
%148 = getelementptr inbounds [16 x i8], [16 x i8]* %147, i64 0, i64 0
%149 = load i8, i8* %148
%150 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %10, i32 0, i32 0
%151 = getelementptr inbounds [16 x i8], [16 x i8]* %150, i64 0, i64 1
%152 = load i8, i8* %151
%153 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %10, i32 0, i32 0
%154 = getelementptr inbounds [16 x i8], [16 x i8]* %153, i64 0, i64 2
%155 = load i8, i8* %154
%156 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %10, i32 0, i32 0
%157 = getelementptr inbounds [16 x i8], [16 x i8]* %156, i64 0, i64 3
%158 = load i8, i8* %157
%159 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %10, i32 0, i32 0
%160 = getelementptr inbounds [16 x i8], [16 x i8]* %159, i64 0, i64 4
%161 = load i8, i8* %160
%162 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %10, i32 0, i32 0
%163 = getelementptr inbounds [16 x i8], [16 x i8]* %162, i64 0, i64 5
%164 = load i8, i8* %163
%165 = call i32 @sprintf(i8* %146, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8 zeroext %149, i8 zeroext %152, i8 zeroext %155, i8 zeroext %158, i8 zeroext %161, i8 zeroext %164)
%166 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %10, i32 0, i32 1
%167 = load i64, i64* %166
%168 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %11, i32 0, i32 0
store i64 %167, i64* %168
%169 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %11, i32 0, i32 0
%170 = load i64, i64* %169
%171 = call i8* @inet_ntoa(i64 %170)
%172 = call i32 @isARPReply(i8* %171)
%173 = icmp ne i32 %172, 0
br i1 %173, label %187, label %174
174: ; preds = %145
%175 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%176 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%177 = call i8* @mac2if(i8* %176)
%178 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %11, i32 0, i32 0
%179 = load i64, i64* %178
%180 = call i8* @inet_ntoa(i64 %179)
%181 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%182 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %10, i32 0, i32 3
%183 = getelementptr inbounds [64 x i8], [64 x i8]* %182, i64 0, i64 0
%184 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %175, i32 256, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str.6, i64 0, i64 0), i8* %177, i8* %180, i8* %181, i8* %183)
%185 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%186 = call i32 @system(i8* %185)
br label %192
187: ; preds = %145
%188 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %11, i32 0, i32 0
%189 = load i64, i64* %188
%190 = call i8* @inet_ntoa(i64 %189)
%191 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i8* %190)
br label %192
192: ; preds = %187, %174
store i32 0, i32* %1
br label %197
193: ; preds = %140
br label %134
194: ; preds = %134
%195 = load i32*, i32** %2
%196 = call i32 @fclose(i32* %195)
store i32 0, i32* %1
br label %197
197: ; preds = %194, %192, %132, %111, %20
%198 = load i32, i32* %1
ret i32 %198
}

LLVM IR (-O2):
%struct.dhcpOfferedAddr = type { [16 x i8], i64, i64, [64 x i8] }
%struct.dhcpOfferedAddr.0 = type { i8*, i64, i64, i8* }
@.str = [55 x i8] c"sqlite3 /tmp/system.db \22delete from DhcpLeasedClients\22\00"
@.str.1 = [24 x i8] c"killall -q -USR1 udhcpd\00"
@.str.2 = [20 x i8] c"/tmp/udhcpd0.leases\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [30 x i8] c"%02x:%02x:%02x:%02x:%02x:%02x\00"
@.str.5 = [24 x i8] c"%u days %02u:%02u:%02u\0A\00"
@.str.6 = [134 x i8] c"sqlite3 /tmp/system.db \22insert into attacheddevice (AttchedType, IpAddress, MacAddress, DeviceName) values ('%s', '%s', '%s', '%s')\22\00"
@.str.7 = [12 x i8] c"[debug] %s\0A\00"
@.str.8 = [28 x i8] c"%s didn't exist anymore...\0A\00"
@.str.9 = [169 x i8] c"sqlite3 /tmp/system.db \22insert into DhcpLeasedClients (LogicalIfname, hostName, IPAddress, MacAddress, Timeout, clientIf) values ('br0', '%s', '%s', '%s', '%s', '%s')\22\00"
@.str.10 = [20 x i8] c"/tmp/udhcpd1.leases\00"
define i32 @scanDhcpLease() {
%1 = alloca [30 x i8]
%2 = alloca [256 x i8]
%3 = alloca [64 x i8]
%4 = alloca %struct.dhcpOfferedAddr
%5 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %4, i64 0, i32 0, i64 0
%9 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %6, i32 256, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @system(i8* %6)
%11 = call i32 @system(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%13 = icmp eq i32* %12, null
br i1 %13, label %111, label %14
14: ; preds = %0
%15 = bitcast %struct.dhcpOfferedAddr* %4 to %struct.dhcpOfferedAddr.0*
%16 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %4, i64 0, i32 3, i64 0
br label %17
17: ; preds = %14, %20
%18 = call i32 @fread(%struct.dhcpOfferedAddr.0* %15, i32 1, i32 96, i32* %12)
%19 = icmp eq i32 %18, 96
br i1 %19, label %20, label %73
20: ; preds = %17
%21 = call i64 @strlen(i8* %16)
%22 = icmp sgt i64 %21, 0
br i1 %22, label %23, label %17
23: ; preds = %20
%24 = load i8, i8* %8
%25 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %4, i64 0, i32 0, i64 1
%26 = load i8, i8* %25
%27 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %4, i64 0, i32 0, i64 2
%28 = load i8, i8* %27
%29 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %4, i64 0, i32 0, i64 3
%30 = load i8, i8* %29
%31 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %4, i64 0, i32 0, i64 4
%32 = load i8, i8* %31
%33 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %4, i64 0, i32 0, i64 5
%34 = load i8, i8* %33
%35 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8 zeroext %24, i8 zeroext %26, i8 zeroext %28, i8 zeroext %30, i8 zeroext %32, i8 zeroext %34)
%36 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %4, i64 0, i32 1
%37 = load i64, i64* %36
%38 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %4, i64 0, i32 2
%39 = load i64, i64* %38
%40 = call i64 @ntohl(i64 %39)
%41 = udiv i64 %40, 86400
%42 = trunc i64 %41 to i32
%43 = urem i64 %40, 86400
%44 = trunc i64 %43 to i32
%45 = icmp eq i32 %42, 0
br i1 %45, label %55, label %46
46: ; preds = %23
%47 = urem i32 %44, 3600
%48 = trunc i32 %47 to i16
%49 = urem i16 %48, 60
%50 = udiv i16 %48, 60
%51 = zext i16 %50 to i32
%52 = udiv i32 %44, 3600
%53 = zext i16 %49 to i32
%54 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %7, i32 64, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i32 %42, i32 %52, i32 %51, i32 %53)
br label %55
55: ; preds = %46, %23
%56 = call i8* @inet_ntoa(i64 %37)
%57 = call i32 @isARPReply(i8* %56)
%58 = icmp eq i32 %57, 0
br i1 %58, label %59, label %65
59: ; preds = %55
%60 = call i8* @mac2if(i8* %5)
%61 = call i8* @inet_ntoa(i64 %37)
%62 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %6, i32 256, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str.6, i64 0, i64 0), i8* %60, i8* %61, i8* %5, i8* %16)
%63 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i8* %6)
%64 = call i32 @system(i8* %6)
br label %68
65: ; preds = %55
%66 = call i8* @inet_ntoa(i64 %37)
%67 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i8* %66)
br label %68
68: ; preds = %65, %59
%69 = call i8* @inet_ntoa(i64 %37)
%70 = call i8* @mac2if(i8* %5)
%71 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %6, i32 256, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str.9, i64 0, i64 0), i8* %16, i8* %69, i8* %5, i8* %7, i8* %70)
%72 = call i32 @system(i8* %6)
br label %111
73: ; preds = %17
%74 = call i32 @fclose(i32* %12)
%75 = call i32* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%76 = icmp eq i32* %75, null
br i1 %76, label %111, label %77
77: ; preds = %73, %80
%78 = call i32 @fread(%struct.dhcpOfferedAddr.0* %15, i32 1, i32 96, i32* %75)
%79 = icmp eq i32 %78, 96
br i1 %79, label %80, label %109
80: ; preds = %77
%81 = call i64 @strlen(i8* %16)
%82 = icmp sgt i64 %81, 0
br i1 %82, label %83, label %77
83: ; preds = %80
%84 = load i8, i8* %8
%85 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %4, i64 0, i32 0, i64 1
%86 = load i8, i8* %85
%87 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %4, i64 0, i32 0, i64 2
%88 = load i8, i8* %87
%89 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %4, i64 0, i32 0, i64 3
%90 = load i8, i8* %89
%91 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %4, i64 0, i32 0, i64 4
%92 = load i8, i8* %91
%93 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %4, i64 0, i32 0, i64 5
%94 = load i8, i8* %93
%95 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8 zeroext %84, i8 zeroext %86, i8 zeroext %88, i8 zeroext %90, i8 zeroext %92, i8 zeroext %94)
%96 = getelementptr inbounds %struct.dhcpOfferedAddr, %struct.dhcpOfferedAddr* %4, i64 0, i32 1
%97 = load i64, i64* %96
%98 = call i8* @inet_ntoa(i64 %97)
%99 = call i32 @isARPReply(i8* %98)
%100 = icmp eq i32 %99, 0
br i1 %100, label %101, label %106
101: ; preds = %83
%102 = call i8* @mac2if(i8* %5)
%103 = call i8* @inet_ntoa(i64 %97)
%104 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %6, i32 256, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str.6, i64 0, i64 0), i8* %102, i8* %103, i8* %5, i8* %16)
%105 = call i32 @system(i8* %6)
br label %111
106: ; preds = %83
%107 = call i8* @inet_ntoa(i64 %97)
%108 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i8* %107)
br label %111
109: ; preds = %77
%110 = call i32 @fclose(i32* %75)
br label %111
111: ; preds = %101, %106, %73, %0, %109, %68
%112 = phi i32 [ 0, %68 ], [ 0, %109 ], [ -1, %0 ], [ -1, %73 ], [ 0, %106 ], [ 0, %101 ]
ret i32 %112
}