#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 */

/* Type definitions */

/* Variables and functions */
int ATF_COM;
int ATF_NETMASK;
int ATF_PERM;
int ATF_PUBL;
int ATF_USETRAILERS;
int /*<<< orphan*/ printf(char *, ...);
void arp_disp(char *ip, int type, int arp_flags, char *hwa, char *mask,
              char *dev) {
  printf("%s ", ip);
  if (!(arp_flags & ATF_COM)) {
    if (arp_flags & ATF_PUBL)
      printf("* ");
    else
      printf("<incomplete> ");
  } else {
    printf("%s 0x%02x ", hwa, arp_flags);
  }
  if (arp_flags & ATF_NETMASK)
    printf("netmask %s ", mask);
  if (arp_flags & ATF_PERM)
    printf("PERM ");
  if (arp_flags & ATF_PUBL)
    printf("PUP ");
  if (arp_flags & ATF_USETRAILERS)
    printf("TRAIL ");
  printf("on %s\n", dev);
}


x86 assembly (clang, -O0):
<arp_disp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeeb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
mov    0x2e96(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
jne    1190 <arp_disp+0x80>
mov    -0x10(%rbp),%eax
mov    0x2e61(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     117d <arp_disp+0x6d>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118b <arp_disp+0x7b>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a5 <arp_disp+0x95>
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%edx
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
mov    0x2e21(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     11cc <arp_disp+0xbc>
mov    -0x20(%rbp),%rsi
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
mov    0x2df2(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     11ef <arp_disp+0xdf>
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
mov    0x2dc7(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1212 <arp_disp+0x102>
lea    0xe23(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
mov    0x2dcc(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1235 <arp_disp+0x125>
lea    0xe05(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xdfa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arp_disp>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%rbx
mov    %edx,%ebp
mov    %rdi,%rsi
lea    0xef8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2ea6(%rip),%rax
test   %ebp,(%rax)
je     1153 <arp_disp+0x43>
lea    0xecc(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1175 <arp_disp+0x65>
mov    0x2e66(%rip),%rax
test   %ebp,(%rax)
je     1167 <arp_disp+0x57>
lea    0xe9b(%rip),%rdi
jmp    116e <arp_disp+0x5e>
lea    0xe95(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e54(%rip),%rax
test   %ebp,(%rax)
je     1191 <arp_disp+0x81>
lea    0xe95(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e30(%rip),%rax
test   %ebp,(%rax)
je     11aa <arp_disp+0x9a>
lea    0xe85(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e0f(%rip),%rax
test   %ebp,(%rax)
je     11c3 <arp_disp+0xb3>
lea    0xe72(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e1e(%rip),%rax
test   %ebp,(%rax)
je     11dc <arp_disp+0xcc>
lea    0xe5e(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe57(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s \00"
@ATF_COM = global i32 0
@ATF_PUBL = global i32 0
@.str.1 = [3 x i8] c"* \00"
@.str.2 = [14 x i8] c"<incomplete> \00"
@.str.3 = [11 x i8] c"%s 0x%02x \00"
@ATF_NETMASK = global i32 0
@.str.4 = [12 x i8] c"netmask %s \00"
@ATF_PERM = global i32 0
@.str.5 = [6 x i8] c"PERM \00"
@.str.6 = [5 x i8] c"PUP \00"
@ATF_USETRAILERS = global i32 0
@.str.7 = [7 x i8] c"TRAIL \00"
@.str.8 = [7 x i8] c"on %s\0A\00"
define void @arp_disp(i8* %0, i32 %1, i32 %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
store i8* %0, i8** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i8*, i8** %7
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i32, i32* %9
%16 = load i32, i32* @ATF_COM
%17 = and i32 %15, %16
%18 = icmp ne i32 %17, 0
br i1 %18, label %29, label %19
19: ; preds = %6
%20 = load i32, i32* %9
%21 = load i32, i32* @ATF_PUBL
%22 = and i32 %20, %21
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %19
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %28
26: ; preds = %19
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %28
28: ; preds = %26, %24
br label %33
29: ; preds = %6
%30 = load i8*, i8** %10
%31 = load i32, i32* %9
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* %30, i32 %31)
br label %33
33: ; preds = %29, %28
%34 = load i32, i32* %9
%35 = load i32, i32* @ATF_NETMASK
%36 = and i32 %34, %35
%37 = icmp ne i32 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %33
%39 = load i8*, i8** %11
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* %39)
br label %41
41: ; preds = %38, %33
%42 = load i32, i32* %9
%43 = load i32, i32* @ATF_PERM
%44 = and i32 %42, %43
%45 = icmp ne i32 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %41
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %48
48: ; preds = %46, %41
%49 = load i32, i32* %9
%50 = load i32, i32* @ATF_PUBL
%51 = and i32 %49, %50
%52 = icmp ne i32 %51, 0
br i1 %52, label %53, label %55
53: ; preds = %48
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
br label %55
55: ; preds = %53, %48
%56 = load i32, i32* %9
%57 = load i32, i32* @ATF_USETRAILERS
%58 = and i32 %56, %57
%59 = icmp ne i32 %58, 0
br i1 %59, label %60, label %62
60: ; preds = %55
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
br label %62
62: ; preds = %60, %55
%63 = load i8*, i8** %12
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* %63)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
@ATF_COM = global i32 0
@ATF_PUBL = global i32 0
@.str.1 = [3 x i8] c"* \00"
@.str.2 = [14 x i8] c"<incomplete> \00"
@.str.3 = [11 x i8] c"%s 0x%02x \00"
@ATF_NETMASK = global i32 0
@.str.4 = [12 x i8] c"netmask %s \00"
@ATF_PERM = global i32 0
@.str.5 = [6 x i8] c"PERM \00"
@.str.6 = [5 x i8] c"PUP \00"
@ATF_USETRAILERS = global i32 0
@.str.7 = [7 x i8] c"TRAIL \00"
@.str.8 = [7 x i8] c"on %s\0A\00"
define void @arp_disp(i8* %0, i32 %1, i32 %2, i8* %3, i8* %4, i8* %5) {
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = load i32, i32* @ATF_COM
%9 = and i32 %8, %2
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %6
%12 = load i32, i32* @ATF_PUBL
%13 = and i32 %12, %2
%14 = icmp eq i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %11
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %21
17: ; preds = %11
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %21
19: ; preds = %6
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* %3, i32 %2)
br label %21
21: ; preds = %15, %17, %19
%22 = load i32, i32* @ATF_NETMASK
%23 = and i32 %22, %2
%24 = icmp eq i32 %23, 0
br i1 %24, label %27, label %25
25: ; preds = %21
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* %4)
br label %27
27: ; preds = %25, %21
%28 = load i32, i32* @ATF_PERM
%29 = and i32 %28, %2
%30 = icmp eq i32 %29, 0
br i1 %30, label %33, label %31
31: ; preds = %27
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %33
33: ; preds = %31, %27
%34 = load i32, i32* @ATF_PUBL
%35 = and i32 %34, %2
%36 = icmp eq i32 %35, 0
br i1 %36, label %39, label %37
37: ; preds = %33
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
br label %39
39: ; preds = %37, %33
%40 = load i32, i32* @ATF_USETRAILERS
%41 = and i32 %40, %2
%42 = icmp eq i32 %41, 0
br i1 %42, label %45, label %43
43: ; preds = %39
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
br label %45
45: ; preds = %43, %39
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* %5)
ret void
}