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

/* Variables and functions */
int /*<<< orphan*/ LOG_DEBUG;
int /*<<< orphan*/ _debug(char *, int, int /*<<< orphan*/, char *, char *,
                          char const *, char const *, ...);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
char fgetc(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ iptables_do_command(char *);
int /*<<< orphan*/ iptables_insert_gateway_id(char **);
int /*<<< orphan*/ pclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char *, char *);
int /*<<< orphan*/ safe_asprintf(char **, char *, char const *, char const *,
                                 ...);
char *safe_strdup(char const *);
int sscanf(char *, char *, char *);
scalar_t__ strstr(char *, char *);
int iptables_fw_destroy_mention(const char *table, const char *chain,
                                const char *mention) {
  FILE *p = NULL;
  char *command = NULL;
  char *command2 = NULL;
  char line[4096];
  char rulenum[10];
  char *victim = safe_strdup(mention);
  int deleted = 0;
  iptables_insert_gateway_id(&victim);
  _debug("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/ForgotFun/wifidog/refs/heads/master/src/"
         "fw_iptables.c",
         443, LOG_DEBUG, "Attempting to destroy all mention of %s from %s.%s",
         victim, table, chain);
  safe_asprintf(&command, "iptables -t %s -L %s -n --line-numbers -v", table,
                chain);
  iptables_insert_gateway_id(&command);
  if ((p = popen(command, "r"))) {
    while (!feof(p) && fgetc(p) != '\n')
      ;
    while (!feof(p) && fgetc(p) != '\n')
      ;
    while (fgets(line, sizeof(line), p)) {
      if (strstr(line, victim)) {
        if (sscanf(line, "%9[0-9]", rulenum) == 1) {
          _debug("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/ForgotFun/wifidog/refs/"
                 "heads/master/src/fw_iptables.c",
                 459, LOG_DEBUG,
                 "Deleting rule %s from %s.%s because it mentions %s", rulenum,
                 table, chain, victim);
          safe_asprintf(&command2, "-t %s -D %s %s", table, chain, rulenum);
          iptables_do_command(command2);
          free(command2);
          deleted = 1;
          break;
        }
      }
    }
    pclose(p);
  }
  free(command);
  free(victim);
  if (deleted) {
    iptables_fw_destroy_mention(table, chain, mention);
  }
  return (deleted);
}


x86 assembly (clang, -O0):
<iptables_fw_destroy_mention>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1060,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
call   10d0 <safe_strdup@plt>
mov    %rax,-0x1048(%rbp)
movl   $0x0,-0x104c(%rbp)
lea    -0x1048(%rbp),%rdi
call   1050 <iptables_insert_gateway_id@plt>
mov    0x2da4(%rip),%rax
mov    (%rax),%edx
mov    -0x1048(%rbp),%r8
mov    -0x8(%rbp),%r9
mov    -0x10(%rbp),%rax
lea    0xdac(%rip),%rdi
mov    $0x1bb,%esi
lea    0xe30(%rip),%rcx
mov    %rax,(%rsp)
mov    $0x0,%al
call   10a0 <_debug@plt>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    -0x28(%rbp),%rdi
lea    0xe45(%rip),%rsi
mov    $0x0,%al
call   10f0 <safe_asprintf@plt>
lea    -0x28(%rbp),%rdi
call   1050 <iptables_insert_gateway_id@plt>
mov    -0x28(%rbp),%rdi
lea    0xe54(%rip),%rsi
call   10e0 <popen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1449 <iptables_fw_destroy_mention+0x269>
jmp    12b1 <iptables_fw_destroy_mention+0xd1>
mov    -0x20(%rbp),%rdi
call   1090 <feof@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x104d(%rbp)
jne    12e5 <iptables_fw_destroy_mention+0x105>
mov    -0x20(%rbp),%rdi
call   1070 <fgetc@plt>
movsbl %al,%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x104d(%rbp)
mov    -0x104d(%rbp),%al
test   $0x1,%al
jne    12f8 <iptables_fw_destroy_mention+0x118>
jmp    12fd <iptables_fw_destroy_mention+0x11d>
jmp    12b1 <iptables_fw_destroy_mention+0xd1>
jmp    1302 <iptables_fw_destroy_mention+0x122>
mov    -0x20(%rbp),%rdi
call   1090 <feof@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x104e(%rbp)
jne    1336 <iptables_fw_destroy_mention+0x156>
mov    -0x20(%rbp),%rdi
call   1070 <fgetc@plt>
movsbl %al,%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x104e(%rbp)
mov    -0x104e(%rbp),%al
test   $0x1,%al
jne    1349 <iptables_fw_destroy_mention+0x169>
jmp    134e <iptables_fw_destroy_mention+0x16e>
jmp    1302 <iptables_fw_destroy_mention+0x122>
jmp    1353 <iptables_fw_destroy_mention+0x173>
lea    -0x1030(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x1000,%esi
call   1080 <fgets@plt>
cmp    $0x0,%rax
je     1440 <iptables_fw_destroy_mention+0x260>
lea    -0x1030(%rbp),%rdi
mov    -0x1048(%rbp),%rsi
call   1100 <strstr@plt>
cmp    $0x0,%rax
je     143b <iptables_fw_destroy_mention+0x25b>
lea    -0x1030(%rbp),%rdi
lea    -0x103a(%rbp),%rdx
lea    0xd4b(%rip),%rsi
call   10b0 <sscanf@plt>
cmp    $0x1,%eax
jne    1436 <iptables_fw_destroy_mention+0x256>
mov    0x2c27(%rip),%rax
mov    (%rax),%edx
lea    -0x103a(%rbp),%r8
mov    -0x8(%rbp),%r9
mov    -0x10(%rbp),%r10
mov    -0x1048(%rbp),%rax
lea    0xc28(%rip),%rdi
mov    $0x1cb,%esi
lea    0xd13(%rip),%rcx
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   10a0 <_debug@plt>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    -0x103a(%rbp),%r8
lea    -0x30(%rbp),%rdi
lea    0xd1c(%rip),%rsi
mov    $0x0,%al
call   10f0 <safe_asprintf@plt>
mov    -0x30(%rbp),%rdi
call   10c0 <iptables_do_command@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
movl   $0x1,-0x104c(%rbp)
jmp    1440 <iptables_fw_destroy_mention+0x260>
jmp    143b <iptables_fw_destroy_mention+0x25b>
jmp    1353 <iptables_fw_destroy_mention+0x173>
mov    -0x20(%rbp),%rdi
call   1060 <pclose@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x1048(%rbp),%rdi
call   1030 <free@plt>
cmpl   $0x0,-0x104c(%rbp)
je     147c <iptables_fw_destroy_mention+0x29c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <iptables_fw_destroy_mention@plt>
mov    -0x104c(%rbp),%eax
add    $0x1060,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iptables_fw_destroy_mention>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1048,%rsp
mov    %rdx,%r14
mov    %rsi,%rbp
mov    %rdi,%r12
movq   $0x0,0x18(%rsp)
movq   $0x0,0x10(%rsp)
mov    %rdx,%rdi
call   10d0 <safe_strdup@plt>
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1050 <iptables_insert_gateway_id@plt>
mov    0x2db6(%rip),%rax
mov    (%rax),%edx
mov    0x8(%rsp),%r8
sub    $0x8,%rsp
lea    0xdc4(%rip),%rdi
lea    0xe4d(%rip),%rcx
xor    %r13d,%r13d
mov    $0x1bb,%esi
mov    %r12,%r9
xor    %eax,%eax
push   %rbp
call   10a0 <_debug@plt>
add    $0x10,%rsp
lea    0xe62(%rip),%rsi
lea    0x18(%rsp),%rbx
mov    %rbx,%rdi
mov    %r12,%rdx
mov    %rbp,%rcx
xor    %eax,%eax
call   10f0 <safe_asprintf@plt>
mov    %rbx,%rdi
call   1050 <iptables_insert_gateway_id@plt>
mov    0x18(%rsp),%rdi
lea    0xe63(%rip),%rsi
call   10e0 <popen@plt>
test   %rax,%rax
je     13e9 <iptables_fw_destroy_mention+0x209>
mov    %rax,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1090 <feof@plt>
test   %eax,%eax
jne    12c0 <iptables_fw_destroy_mention+0xe0>
mov    %rbx,%rdi
call   1070 <fgetc@plt>
cmp    $0xa,%al
jne    12a0 <iptables_fw_destroy_mention+0xc0>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1090 <feof@plt>
test   %eax,%eax
jne    12d8 <iptables_fw_destroy_mention+0xf8>
mov    %rbx,%rdi
call   1070 <fgetc@plt>
cmp    $0xa,%al
jne    12c0 <iptables_fw_destroy_mention+0xe0>
lea    0x40(%rsp),%rdi
mov    $0x1000,%esi
mov    %rbx,%rdx
call   1080 <fgets@plt>
xor    %r13d,%r13d
test   %rax,%rax
je     13e1 <iptables_fw_destroy_mention+0x201>
mov    %rbp,0x20(%rsp)
mov    %r14,0x28(%rsp)
lea    0x40(%rsp),%rbp
lea    0xde3(%rip),%r14
lea    0x36(%rsp),%r15
jmp    1339 <iptables_fw_destroy_mention+0x159>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbp,%rdi
mov    $0x1000,%esi
mov    %rbx,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     13d7 <iptables_fw_destroy_mention+0x1f7>
mov    0x8(%rsp),%rsi
mov    %rbp,%rdi
call   1100 <strstr@plt>
test   %rax,%rax
je     1320 <iptables_fw_destroy_mention+0x140>
mov    %rbp,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   10b0 <sscanf@plt>
cmp    $0x1,%eax
jne    1320 <iptables_fw_destroy_mention+0x140>
mov    0x2c7b(%rip),%rax
mov    (%rax),%edx
lea    0xc92(%rip),%rdi
lea    0xd82(%rip),%rcx
lea    0x36(%rsp),%r14
mov    $0x1cb,%esi
mov    %r14,%r8
mov    %r12,%r9
xor    %eax,%eax
push   0x8(%rsp)
mov    0x28(%rsp),%rbp
push   %rbp
call   10a0 <_debug@plt>
add    $0x10,%rsp
lea    0xd89(%rip),%rsi
lea    0x10(%rsp),%rdi
mov    %r12,%rdx
mov    %rbp,%rcx
mov    %r14,%r8
xor    %eax,%eax
call   10f0 <safe_asprintf@plt>
mov    0x10(%rsp),%rdi
call   10c0 <iptables_do_command@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    $0x1,%r13d
mov    0x28(%rsp),%r14
jmp    13e1 <iptables_fw_destroy_mention+0x201>
mov    0x28(%rsp),%r14
mov    0x20(%rsp),%rbp
mov    %rbx,%rdi
call   1060 <pclose@plt>
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
test   %r13d,%r13d
je     1410 <iptables_fw_destroy_mention+0x230>
mov    %r12,%rdi
mov    %rbp,%rsi
mov    %r14,%rdx
call   1040 <iptables_fw_destroy_mention@plt>
mov    %r13d,%eax
add    $0x1048,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ForgotFun/wifidog/refs/heads/master/src/fw_iptables.c\00"
@LOG_DEBUG = global i32 0
@.str.1 = [51 x i8] c"Attempting to destroy all mention of %s from %s.%s\00"
@.str.2 = [42 x i8] c"iptables -t %s -L %s -n --line-numbers -v\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [8 x i8] c"%9[0-9]\00"
@.str.5 = [51 x i8] c"Deleting rule %s from %s.%s because it mentions %s\00"
@.str.6 = [15 x i8] c"-t %s -D %s %s\00"
define i32 @iptables_fw_destroy_mention(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca [4096 x i8]
%11 = alloca [10 x i8]
%12 = alloca i8*
%13 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
store i32* null, i32** %7
store i8* null, i8** %8
store i8* null, i8** %9
%14 = load i8*, i8** %6
%15 = call i8* @safe_strdup(i8* %14)
store i8* %15, i8** %12
store i32 0, i32* %13
%16 = call i32 @iptables_insert_gateway_id(i8** %12)
%17 = load i32, i32* @LOG_DEBUG
%18 = load i8*, i8** %12
%19 = load i8*, i8** %4
%20 = load i8*, i8** %5
%21 = call i32 (i8*, i32, i32, i8*, i8*, i8*, i8*, ...) @_debug(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 443, i32 %17, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i8* %18, i8* %19, i8* %20)
%22 = load i8*, i8** %4
%23 = load i8*, i8** %5
%24 = call i32 (i8**, i8*, i8*, i8*, ...) @safe_asprintf(i8** %8, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8* %22, i8* %23)
%25 = call i32 @iptables_insert_gateway_id(i8** %8)
%26 = load i8*, i8** %8
%27 = call i32* @popen(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %27, i32** %7
%28 = icmp ne i32* %27, null
br i1 %28, label %29, label %91
29: ; preds = %3
br label %30
30: ; preds = %41, %29
%31 = load i32*, i32** %7
%32 = call i32 @feof(i32* %31)
%33 = icmp ne i32 %32, 0
br i1 %33, label %39, label %34
34: ; preds = %30
%35 = load i32*, i32** %7
%36 = call signext i8 @fgetc(i32* %35)
%37 = sext i8 %36 to i32
%38 = icmp ne i32 %37, 10
br label %39
39: ; preds = %34, %30
%40 = phi i1 [ false, %30 ], [ %38, %34 ]
br i1 %40, label %41, label %42
41: ; preds = %39
br label %30
42: ; preds = %39
br label %43
43: ; preds = %54, %42
%44 = load i32*, i32** %7
%45 = call i32 @feof(i32* %44)
%46 = icmp ne i32 %45, 0
br i1 %46, label %52, label %47
47: ; preds = %43
%48 = load i32*, i32** %7
%49 = call signext i8 @fgetc(i32* %48)
%50 = sext i8 %49 to i32
%51 = icmp ne i32 %50, 10
br label %52
52: ; preds = %47, %43
%53 = phi i1 [ false, %43 ], [ %51, %47 ]
br i1 %53, label %54, label %55
54: ; preds = %52
br label %43
55: ; preds = %52
br label %56
56: ; preds = %87, %55
%57 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 0
%58 = load i32*, i32** %7
%59 = call i64 @fgets(i8* %57, i32 4096, i32* %58)
%60 = icmp ne i64 %59, 0
br i1 %60, label %61, label %88
61: ; preds = %56
%62 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 0
%63 = load i8*, i8** %12
%64 = call i64 @strstr(i8* %62, i8* %63)
%65 = icmp ne i64 %64, 0
br i1 %65, label %66, label %87
66: ; preds = %61
%67 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 0
%68 = getelementptr inbounds [10 x i8], [10 x i8]* %11, i64 0, i64 0
%69 = call i32 @sscanf(i8* %67, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %68)
%70 = icmp eq i32 %69, 1
br i1 %70, label %71, label %86
71: ; preds = %66
%72 = load i32, i32* @LOG_DEBUG
%73 = getelementptr inbounds [10 x i8], [10 x i8]* %11, i64 0, i64 0
%74 = load i8*, i8** %4
%75 = load i8*, i8** %5
%76 = load i8*, i8** %12
%77 = call i32 (i8*, i32, i32, i8*, i8*, i8*, i8*, ...) @_debug(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 459, i32 %72, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0), i8* %73, i8* %74, i8* %75, i8* %76)
%78 = load i8*, i8** %4
%79 = load i8*, i8** %5
%80 = getelementptr inbounds [10 x i8], [10 x i8]* %11, i64 0, i64 0
%81 = call i32 (i8**, i8*, i8*, i8*, ...) @safe_asprintf(i8** %9, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i8* %78, i8* %79, i8* %80)
%82 = load i8*, i8** %9
%83 = call i32 @iptables_do_command(i8* %82)
%84 = load i8*, i8** %9
%85 = call i32 @free(i8* %84)
store i32 1, i32* %13
br label %88
86: ; preds = %66
br label %87
87: ; preds = %86, %61
br label %56
88: ; preds = %71, %56
%89 = load i32*, i32** %7
%90 = call i32 @pclose(i32* %89)
br label %91
91: ; preds = %88, %3
%92 = load i8*, i8** %8
%93 = call i32 @free(i8* %92)
%94 = load i8*, i8** %12
%95 = call i32 @free(i8* %94)
%96 = load i32, i32* %13
%97 = icmp ne i32 %96, 0
br i1 %97, label %98, label %103
98: ; preds = %91
%99 = load i8*, i8** %4
%100 = load i8*, i8** %5
%101 = load i8*, i8** %6
%102 = call i32 @iptables_fw_destroy_mention(i8* %99, i8* %100, i8* %101)
br label %103
103: ; preds = %98, %91
%104 = load i32, i32* %13
ret i32 %104
}

LLVM IR (-O2):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ForgotFun/wifidog/refs/heads/master/src/fw_iptables.c\00"
@LOG_DEBUG = global i32 0
@.str.1 = [51 x i8] c"Attempting to destroy all mention of %s from %s.%s\00"
@.str.2 = [42 x i8] c"iptables -t %s -L %s -n --line-numbers -v\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [8 x i8] c"%9[0-9]\00"
@.str.5 = [51 x i8] c"Deleting rule %s from %s.%s because it mentions %s\00"
@.str.6 = [15 x i8] c"-t %s -D %s %s\00"
define i32 @iptables_fw_destroy_mention(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca [4096 x i8]
%7 = alloca [10 x i8]
%8 = alloca i8*
%9 = bitcast i8** %4 to i8*
store i8* null, i8** %4
%10 = bitcast i8** %5 to i8*
store i8* null, i8** %5
%11 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%13 = bitcast i8** %8 to i8*
%14 = tail call i8* @safe_strdup(i8* %2)
store i8* %14, i8** %8
%15 = call i32 @iptables_insert_gateway_id(i8** %8)
%16 = load i32, i32* @LOG_DEBUG
%17 = load i8*, i8** %8
%18 = call i32 (i8*, i32, i32, i8*, i8*, i8*, i8*, ...) @_debug(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 443, i32 %16, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i8* %17, i8* %0, i8* %1)
%19 = call i32 (i8**, i8*, i8*, i8*, ...) @safe_asprintf(i8** %4, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8* %0, i8* %1)
%20 = call i32 @iptables_insert_gateway_id(i8** %4)
%21 = load i8*, i8** %4
%22 = call i32* @popen(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%23 = icmp eq i32* %22, null
br i1 %23, label %62, label %24
24: ; preds = %3, %27
%25 = call i32 @feof(i32* %22)
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = call signext i8 @fgetc(i32* %22)
%29 = icmp eq i8 %28, 10
br i1 %29, label %30, label %24
30: ; preds = %24, %27
br label %31
31: ; preds = %30, %34
%32 = call i32 @feof(i32* %22)
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %37
34: ; preds = %31
%35 = call signext i8 @fgetc(i32* %22)
%36 = icmp eq i8 %35, 10
br i1 %36, label %37, label %31
37: ; preds = %31, %34
%38 = call i64 @fgets(i8* %11, i32 4096, i32* %22)
%39 = icmp eq i64 %38, 0
br i1 %39, label %59, label %40
40: ; preds = %37, %56
%41 = load i8*, i8** %8
%42 = call i64 @strstr(i8* %11, i8* %41)
%43 = icmp eq i64 %42, 0
br i1 %43, label %56, label %44
44: ; preds = %40
%45 = call i32 @sscanf(i8* %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %12)
%46 = icmp eq i32 %45, 1
br i1 %46, label %47, label %56
47: ; preds = %44
%48 = load i32, i32* @LOG_DEBUG
%49 = load i8*, i8** %8
%50 = call i32 (i8*, i32, i32, i8*, i8*, i8*, i8*, ...) @_debug(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 459, i32 %48, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0), i8* %12, i8* %0, i8* %1, i8* %49)
%51 = call i32 (i8**, i8*, i8*, i8*, ...) @safe_asprintf(i8** %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i8* %0, i8* %1, i8* %12)
%52 = load i8*, i8** %5
%53 = call i32 @iptables_do_command(i8* %52)
%54 = load i8*, i8** %5
%55 = call i32 @free(i8* %54)
br label %59
56: ; preds = %44, %40
%57 = call i64 @fgets(i8* %11, i32 4096, i32* %22)
%58 = icmp eq i64 %57, 0
br i1 %58, label %59, label %40
59: ; preds = %56, %37, %47
%60 = phi i32 [ 1, %47 ], [ 0, %37 ], [ 0, %56 ]
%61 = call i32 @pclose(i32* %22)
br label %62
62: ; preds = %59, %3
%63 = phi i32 [ %60, %59 ], [ 0, %3 ]
%64 = load i8*, i8** %4
%65 = call i32 @free(i8* %64)
%66 = load i8*, i8** %8
%67 = call i32 @free(i8* %66)
%68 = icmp eq i32 %63, 0
br i1 %68, label %71, label %69
69: ; preds = %62
%70 = call i32 @iptables_fw_destroy_mention(i8* %0, i8* %1, i8* %2)
br label %71
71: ; preds = %69, %62
ret i32 %63
}