#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 */
typedef int /*<<< orphan*/ tmp;

/* Variables and functions */
int /*<<< orphan*/ IFNAMSIZ;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *);
int /*<<< orphan*/ stderr;
scalar_t__ system(char *);
void _clear_neighbor_cache(const char *ifname) {
  char tmp[20 + IFNAMSIZ];
  snprintf(tmp, sizeof(tmp), "ip neigh flush dev %s", ifname);
  if (system(tmp) < 0) {
    fprintf(stderr, "error while flushing device neighbor cache\n");
  }
}


x86 assembly (clang, -O0):
<_clear_neighbor_cache>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
add    $0x14,%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x20(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
mov    %eax,%esi
mov    -0x8(%rbp),%rcx
lea    0xe88(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
jge    11a5 <_clear_neighbor_cache+0x75>
mov    0x2e49(%rip),%rax
mov    (%rax),%edi
lea    0xe76(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_clear_neighbor_cache>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %rdi,%rcx
mov    0x2e98(%rip),%rax
mov    (%rax),%esi
add    $0x14,%esi
mov    %rsp,%rbx
lea    0xf(%rsi),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
lea    0xea3(%rip),%rdx
mov    %rbx,%rdi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
test   %rax,%rax
jns    1187 <_clear_neighbor_cache+0x57>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1050 <fprintf@plt>
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@IFNAMSIZ = global i32 0
@.str = [22 x i8] c"ip neigh flush dev %s\00"
@stderr = global i32 0
@.str.1 = [44 x i8] c"error while flushing device neighbor cache\0A\00"
define void @_clear_neighbor_cache(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i32, i32* @IFNAMSIZ
%6 = add nsw i32 20, %5
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %3
%9 = alloca i8, i64 %7
store i64 %7, i64* %4
%10 = trunc i64 %7 to i32
%11 = load i8*, i8** %2
%12 = call i32 @snprintf(i8* %9, i32 %10, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i64 @system(i8* %9)
%14 = icmp slt i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %1
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %15, %1
%19 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
@IFNAMSIZ = global i32 0
@.str = [22 x i8] c"ip neigh flush dev %s\00"
@stderr = global i32 0
@.str.1 = [44 x i8] c"error while flushing device neighbor cache\0A\00"
define void @_clear_neighbor_cache(i8* %0) {
%2 = load i32, i32* @IFNAMSIZ
%3 = add nsw i32 %2, 20
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = call i32 @snprintf(i8* %5, i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = call i64 @system(i8* %5)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %9, %1
ret void
}