#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*/ LOG_NOTICE;
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
int /*<<< orphan*/ system(char *);
void *scheduler0(void *variables0) {
  int vars;
  int *p_vars = (int *)variables0;
  vars = *p_vars;
  while (1) {
    puts("#!/bin/sh ; while read i ; do iptables -A INPUT -p tcp -s $i  -j "
         "DROP ; iptables -A INPUT -p udp -s $i -j DROP ; done < $(diff "
         "/etc/vpn-helper-allow.conf /etc/vpn-helper-forbidden.conf | grep "
         "'^>' | sed -e 's\/>\/\/'); iptables-save > /etc/iptables.up.rules ; "
         "exit 0 ");
    system("#!/bin/sh ; while read i ; do iptables -A INPUT -p tcp -s $i  -j "
           "DROP ; iptables -A INPUT -p udp -s $i -j DROP ; done < $(diff "
           "/etc/vpn-helper-allow.conf /etc/vpn-helper-forbidden.conf | grep "
           "'^>' | sed -e 's\/>\/\/'); iptables-save > /etc/iptables.up.rules "
           "; exit 0 ");
    puts("#!/bin/sh ; while read i ; do iptables -A INPUT -p tcp -s $i -j "
         "ACCEPT ; iptables -A INPUT -p udp -s $i -j ACCEPT ; done < $(diff "
         "/etc/vpn-helper-forbidden.conf /etc/vpn-helper-allow.conf | grep "
         "'^>' | sed -e 's\/>\/\/'); iptables-save > /etc/iptables.up.rules ; "
         "exit 0");
    system("#!/bin/sh ; while read i ; do iptables -A INPUT -p tcp -s $i -j "
           "ACCEPT ; iptables -A INPUT -p udp -s $i -j ACCEPT ; done < $(diff "
           "/etc/vpn-helper-forbidden.conf /etc/vpn-helper-allow.conf | grep "
           "'^>' | sed -e 's\/>\/\/'); iptables-save > /etc/iptables.up.rules "
           "; exit 0");
    puts("#!/bin/sh ; while read i ; do iptables -A OUTPUT -p tcp -d $i -j "
         "ACCEPT ; iptables -A OUTPUT -p udp -d $i -j ACCEPT ; done < $(diff "
         "/etc/vpn-helper-forbidden.conf /etc/vpn-helper-allow.conf | grep "
         "'^>' | sed -e 's\/>\/\/'); iptables-save > /etc/iptables.up.rules ; "
         "exit 0");
    system("#!/bin/sh ; while read i ; do iptables -A OUTPUT -p tcp -d $i -j "
           "ACCEPT ; iptables -A OUTPUT -p udp -d $i -j ACCEPT ; done < $(diff "
           "/etc/vpn-helper-forbidden.conf /etc/vpn-helper-allow.conf | grep "
           "'^>' | sed -e 's\/>\/\/'); iptables-save > /etc/iptables.up.rules "
           "; exit 0");
    puts("#!/bin/sh ; while read i ; do iptables -A OUTPUT -p tcp -d $i -j "
         "ACCEPT ; iptables -A OUTPUT -p udp -d $i -j ACCEPT ; done < $(diff "
         "/etc/vpn-helper-allow.conf /etc/vpn-helper-forbidden.conf  | grep "
         "'^>' | sed -e 's\/>\/\/'); iptables-save > /etc/iptables.up.rules ; "
         "exit 0");
    system("#!/bin/sh ; while read i ; do iptables -A OUTPUT -p tcp -d $i -j "
           "ACCEPT ; iptables -A OUTPUT -p udp -d $i -j ACCEPT ; done < $(diff "
           "/etc/vpn-helper-allow.conf /etc/vpn-helper-forbidden.conf  | grep "
           "'^>' | sed -e 's\/>\/\/'); iptables-save > /etc/iptables.up.rules "
           "; exit 0");
    syslog(LOG_NOTICE, "Firewall has been Updated.");
    sleep(vars);
  }
}


x86 assembly (clang, -O0):
<scheduler0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    0xe9c(%rip),%rdi
call   1030 <puts@plt>
lea    0xe90(%rip),%rdi
call   1040 <system@plt>
lea    0xf8d(%rip),%rdi
call   1030 <puts@plt>
lea    0xf81(%rip),%rdi
call   1040 <system@plt>
lea    0x1080(%rip),%rdi
call   1030 <puts@plt>
lea    0x1074(%rip),%rdi
call   1040 <system@plt>
lea    0x1175(%rip),%rdi
call   1030 <puts@plt>
lea    0x1169(%rip),%rdi
call   1040 <system@plt>
mov    0x2e1c(%rip),%rax
mov    (%rax),%edi
lea    0x1262(%rip),%rsi
call   1050 <syslog@plt>
mov    -0xc(%rbp),%edi
call   1060 <sleep@plt>
jmp    115d <scheduler0+0x1d>

x86 assembly (clang, -O2):
<scheduler0>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    (%rdi),%r14d
lea    0xeab(%rip),%r15
lea    0xfad(%rip),%r12
lea    0x10b1(%rip),%rbx
lea    0x11b7(%rip),%rbp
lea    0x12be(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1040 <system@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1040 <system@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
mov    %rbp,%rdi
call   1030 <puts@plt>
mov    %rbp,%rdi
call   1040 <system@plt>
mov    0x2e19(%rip),%rax
mov    (%rax),%edi
mov    %r13,%rsi
call   1050 <syslog@plt>
mov    %r14d,%edi
call   1060 <sleep@plt>
jmp    1180 <scheduler0+0x40>

LLVM IR (-O0):
@.str = [265 x i8] c"#!/bin/sh ; while read i ; do iptables -A INPUT -p tcp -s $i -j DROP ; iptables -A INPUT -p udp -s $i -j DROP ; done < $(diff /etc/vpn-helper-allow.conf /etc/vpn-helper-forbidden.conf | grep '^>' | sed -e 's/>//'); iptables-save > /etc/iptables.up.rules ; exit 0 \00"
@.str.1 = [267 x i8] c"#!/bin/sh ; while read i ; do iptables -A INPUT -p tcp -s $i -j ACCEPT ; iptables -A INPUT -p udp -s $i -j ACCEPT ; done < $(diff /etc/vpn-helper-forbidden.conf /etc/vpn-helper-allow.conf | grep '^>' | sed -e 's/>//'); iptables-save > /etc/iptables.up.rules ; exit 0\00"
@.str.2 = [269 x i8] c"#!/bin/sh ; while read i ; do iptables -A OUTPUT -p tcp -d $i -j ACCEPT ; iptables -A OUTPUT -p udp -d $i -j ACCEPT ; done < $(diff /etc/vpn-helper-forbidden.conf /etc/vpn-helper-allow.conf | grep '^>' | sed -e 's/>//'); iptables-save > /etc/iptables.up.rules ; exit 0\00"
@.str.3 = [270 x i8] c"#!/bin/sh ; while read i ; do iptables -A OUTPUT -p tcp -d $i -j ACCEPT ; iptables -A OUTPUT -p udp -d $i -j ACCEPT ; done < $(diff /etc/vpn-helper-allow.conf /etc/vpn-helper-forbidden.conf | grep '^>' | sed -e 's/>//'); iptables-save > /etc/iptables.up.rules ; exit 0\00"
@LOG_NOTICE = global i32 0
@.str.4 = [27 x i8] c"Firewall has been Updated.\00"
define i8* @scheduler0(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
store i32 %8, i32* %3
br label %9
9: ; preds = %1, %9
%10 = call i32 @puts(i8* getelementptr inbounds ([265 x i8], [265 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @system(i8* getelementptr inbounds ([265 x i8], [265 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @puts(i8* getelementptr inbounds ([267 x i8], [267 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @system(i8* getelementptr inbounds ([267 x i8], [267 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @puts(i8* getelementptr inbounds ([269 x i8], [269 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 @system(i8* getelementptr inbounds ([269 x i8], [269 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 @puts(i8* getelementptr inbounds ([270 x i8], [270 x i8]* @.str.3, i64 0, i64 0))
%17 = call i32 @system(i8* getelementptr inbounds ([270 x i8], [270 x i8]* @.str.3, i64 0, i64 0))
%18 = load i32, i32* @LOG_NOTICE
%19 = call i32 @syslog(i32 %18, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%20 = load i32, i32* %3
%21 = call i32 @sleep(i32 %20)
br label %9
}

LLVM IR (-O2):
@.str = [265 x i8] c"#!/bin/sh ; while read i ; do iptables -A INPUT -p tcp -s $i -j DROP ; iptables -A INPUT -p udp -s $i -j DROP ; done < $(diff /etc/vpn-helper-allow.conf /etc/vpn-helper-forbidden.conf | grep '^>' | sed -e 's/>//'); iptables-save > /etc/iptables.up.rules ; exit 0 \00"
@.str.1 = [267 x i8] c"#!/bin/sh ; while read i ; do iptables -A INPUT -p tcp -s $i -j ACCEPT ; iptables -A INPUT -p udp -s $i -j ACCEPT ; done < $(diff /etc/vpn-helper-forbidden.conf /etc/vpn-helper-allow.conf | grep '^>' | sed -e 's/>//'); iptables-save > /etc/iptables.up.rules ; exit 0\00"
@.str.2 = [269 x i8] c"#!/bin/sh ; while read i ; do iptables -A OUTPUT -p tcp -d $i -j ACCEPT ; iptables -A OUTPUT -p udp -d $i -j ACCEPT ; done < $(diff /etc/vpn-helper-forbidden.conf /etc/vpn-helper-allow.conf | grep '^>' | sed -e 's/>//'); iptables-save > /etc/iptables.up.rules ; exit 0\00"
@.str.3 = [270 x i8] c"#!/bin/sh ; while read i ; do iptables -A OUTPUT -p tcp -d $i -j ACCEPT ; iptables -A OUTPUT -p udp -d $i -j ACCEPT ; done < $(diff /etc/vpn-helper-allow.conf /etc/vpn-helper-forbidden.conf | grep '^>' | sed -e 's/>//'); iptables-save > /etc/iptables.up.rules ; exit 0\00"
@LOG_NOTICE = global i32 0
@.str.4 = [27 x i8] c"Firewall has been Updated.\00"
define noalias i8* @scheduler0(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
br label %4
4: ; preds = %4, %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([265 x i8], [265 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @system(i8* getelementptr inbounds ([265 x i8], [265 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([267 x i8], [267 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @system(i8* getelementptr inbounds ([267 x i8], [267 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([269 x i8], [269 x i8]* @.str.2, i64 0, i64 0))
%10 = tail call i32 @system(i8* getelementptr inbounds ([269 x i8], [269 x i8]* @.str.2, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([270 x i8], [270 x i8]* @.str.3, i64 0, i64 0))
%12 = tail call i32 @system(i8* getelementptr inbounds ([270 x i8], [270 x i8]* @.str.3, i64 0, i64 0))
%13 = load i32, i32* @LOG_NOTICE
%14 = tail call i32 @syslog(i32 %13, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%15 = tail call i32 @sleep(i32 %3)
br label %4
}