#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 /*<<< orphan*/ IPPROTO_IP;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ perror(char *);
scalar_t__ setsockopt(int /*<<< orphan*/, int /*<<< orphan*/, scalar_t__,
                      int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int flush_rules() {
  if (setsockopt(0, IPPROTO_IP, (0xf400 + 0), NULL, 0)) {
    perror("setsockopt");
    fprintf(
        stderr,
        "Probably you don't have rights or bindprivs module isn't loaded.\n");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<flush_rules>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
xor    %r8d,%r8d
mov    $0xf400,%edx
xor    %eax,%eax
mov    %eax,%ecx
mov    %r8d,%edi
call   1030 <setsockopt@plt>
cmp    $0x0,%rax
je     118c <flush_rules+0x5c>
lea    0xe9a(%rip),%rdi
call   1050 <perror@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
lea    0xe90(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1193 <flush_rules+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush_rules>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
xor    %ebx,%ebx
mov    $0xf400,%edx
xor    %edi,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <setsockopt@plt>
test   %rax,%rax
jne    1156 <flush_rules+0x26>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xea3(%rip),%rdi
call   1050 <perror@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
lea    0xe99(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%ebx
jmp    1152 <flush_rules+0x22>

LLVM IR (-O0):
@IPPROTO_IP = global i32 0
@.str = [11 x i8] c"setsockopt\00"
@stderr = global i32 0
@.str.1 = [66 x i8] c"Probably you don't have rights or bindprivs module isn't loaded.\0A\00"
define i32 @flush_rules() {
%1 = alloca i32
%2 = load i32, i32* @IPPROTO_IP
%3 = call i64 @setsockopt(i32 0, i32 %2, i64 62464, i32* null, i32 0)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %10
9: ; preds = %0
store i32 0, i32* %1
br label %10
10: ; preds = %9, %5
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@IPPROTO_IP = global i32 0
@.str = [11 x i8] c"setsockopt\00"
@stderr = global i32 0
@.str.1 = [66 x i8] c"Probably you don't have rights or bindprivs module isn't loaded.\0A\00"
define i32 @flush_rules() {
%1 = load i32, i32* @IPPROTO_IP
%2 = tail call i64 @setsockopt(i32 0, i32 %1, i64 62464, i32* null, i32 0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %0
%5 = tail call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %0, %4
%9 = phi i32 [ 1, %4 ], [ 0, %0 ]
ret i32 %9
}