#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 */
scalar_t__ mib_set(int, void *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setupMacFilter();
int setDefaultMacFilteringAction(char inact, char outact) {
  if (mib_set(0 + 32, (void *)&outact) == 0) {
    printf("Set MIB_MACF_OUT_ACTION error!\n");
    return -1;
  }
  outact = !outact;
  if (mib_set(0 + 103, (void *)&outact) == 0) {
    printf("Set MIB_ETH_MAC_CTRL error!\n");
    return -1;
  }
  if (mib_set(0 + 300 + 181, (void *)&outact) == 0) {
    printf("Set MIB_WLAN_MAC_CTRL error!\n");
    return -1;
  }
  if (mib_set(0 + 33, (void *)&inact) == 0) {
    printf("Set MIB_MACF_IN_ACTION error!\n");
    return -1;
  }
  setupMacFilter();
  return 0;
}


x86 assembly (clang, -O0):
<setDefaultMacFilteringAction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    $0x20,%edi
lea    -0x6(%rbp),%rsi
call   1030 <mib_set@plt>
cmp    $0x0,%rax
jne    1174 <setDefaultMacFilteringAction+0x44>
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1223 <setDefaultMacFilteringAction+0xf3>
cmpb   $0x0,-0x6(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %al,-0x6(%rbp)
mov    $0x67,%edi
lea    -0x6(%rbp),%rsi
call   1030 <mib_set@plt>
cmp    $0x0,%rax
jne    11b5 <setDefaultMacFilteringAction+0x85>
lea    0xe7c(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1223 <setDefaultMacFilteringAction+0xf3>
mov    $0x1e1,%edi
lea    -0x6(%rbp),%rsi
call   1030 <mib_set@plt>
cmp    $0x0,%rax
jne    11e5 <setDefaultMacFilteringAction+0xb5>
lea    0xe69(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1223 <setDefaultMacFilteringAction+0xf3>
mov    $0x21,%edi
lea    -0x5(%rbp),%rsi
call   1030 <mib_set@plt>
cmp    $0x0,%rax
jne    1215 <setDefaultMacFilteringAction+0xe5>
lea    0xe57(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1223 <setDefaultMacFilteringAction+0xf3>
mov    $0x0,%al
call   1050 <setupMacFilter@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setDefaultMacFilteringAction>:
push   %rbx
sub    $0x10,%rsp
mov    %dil,0xf(%rsp)
mov    %sil,0xe(%rsp)
lea    0xe(%rsp),%rsi
mov    $0x20,%edi
call   1040 <mib_set@plt>
test   %rax,%rax
je     11a4 <setDefaultMacFilteringAction+0x74>
cmpb   $0x0,0xe(%rsp)
sete   0xe(%rsp)
lea    0xe(%rsp),%rsi
mov    $0x67,%edi
call   1040 <mib_set@plt>
test   %rax,%rax
je     11ad <setDefaultMacFilteringAction+0x7d>
lea    0xe(%rsp),%rsi
mov    $0x1e1,%edi
call   1040 <mib_set@plt>
test   %rax,%rax
je     11b6 <setDefaultMacFilteringAction+0x86>
lea    0xf(%rsp),%rsi
mov    $0x21,%edi
call   1040 <mib_set@plt>
test   %rax,%rax
je     11bf <setDefaultMacFilteringAction+0x8f>
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <setupMacFilter@plt>
jmp    11d0 <setDefaultMacFilteringAction+0xa0>
lea    0xeac(%rip),%rdi
jmp    11c6 <setDefaultMacFilteringAction+0x96>
lea    0xe87(%rip),%rdi
jmp    11c6 <setDefaultMacFilteringAction+0x96>
lea    0xe61(%rip),%rdi
jmp    11c6 <setDefaultMacFilteringAction+0x96>
lea    0xe3a(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Set MIB_MACF_OUT_ACTION error!\0A\00"
@.str.1 = [29 x i8] c"Set MIB_ETH_MAC_CTRL error!\0A\00"
@.str.2 = [30 x i8] c"Set MIB_WLAN_MAC_CTRL error!\0A\00"
@.str.3 = [31 x i8] c"Set MIB_MACF_IN_ACTION error!\0A\00"
define i32 @setDefaultMacFilteringAction(i8 signext %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
%6 = call i64 @mib_set(i32 32, i8* %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %32
10: ; preds = %2
%11 = load i8, i8* %5
%12 = icmp ne i8 %11, 0
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
%15 = trunc i32 %14 to i8
store i8 %15, i8* %5
%16 = call i64 @mib_set(i32 103, i8* %5)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %10
%19 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %32
20: ; preds = %10
%21 = call i64 @mib_set(i32 481, i8* %5)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %3
br label %32
25: ; preds = %20
%26 = call i64 @mib_set(i32 33, i8* %4)
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
store i32 -1, i32* %3
br label %32
30: ; preds = %25
%31 = call i32 (...) @setupMacFilter()
store i32 0, i32* %3
br label %32
32: ; preds = %30, %28, %23, %18, %8
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
@str = [30 x i8] c"Set MIB_MACF_IN_ACTION error!\00"
@str.4 = [29 x i8] c"Set MIB_WLAN_MAC_CTRL error!\00"
@str.5 = [28 x i8] c"Set MIB_ETH_MAC_CTRL error!\00"
@str.6 = [31 x i8] c"Set MIB_MACF_OUT_ACTION error!\00"
define i32 @setDefaultMacFilteringAction(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = call i64 @mib_set(i32 32, i8* %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.6, i64 0, i64 0))
br label %29
9: ; preds = %2
%10 = load i8, i8* %4
%11 = icmp eq i8 %10, 0
%12 = zext i1 %11 to i8
store i8 %12, i8* %4
%13 = call i64 @mib_set(i32 103, i8* %4)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %9
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.5, i64 0, i64 0))
br label %29
17: ; preds = %9
%18 = call i64 @mib_set(i32 481, i8* %4)
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.4, i64 0, i64 0))
br label %29
22: ; preds = %17
%23 = call i64 @mib_set(i32 33, i8* %3)
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
br label %29
27: ; preds = %22
%28 = call i32 (...) @setupMacFilter()
br label %29
29: ; preds = %27, %25, %20, %15, %7
%30 = phi i32 [ -1, %7 ], [ -1, %15 ], [ -1, %20 ], [ -1, %25 ], [ 0, %27 ]
ret i32 %30
}