#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*/ FILE;

/* Variables and functions */
char EOF;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
void print_rule() {
  FILE *pf;
  char token[20];
  char ch;
  int i = 0;
  printf("in/out    src ip    src mask    src port    dest ip    dest mask     "
         "dest port    proto    action\n");
  pf = fopen("/proc/minifirewall", "r");
  if (pf == NULL) {
    printf("Cannot open /proc/minifirewall for reading\n");
    return;
  } else {
    while (1) {
      while (((ch = fgetc(pf)) == ' ') || (ch == '\n')) {
      }
      if (ch == EOF)
        break;
      i = 0;
      token[i++] = ch;
      while (((ch = fgetc(pf)) != EOF) && (ch != ' ')) {
        token[i++] = ch;
      }
      token[i] = '\0';
      printf("  %s  ", token);
      if (ch == EOF)
        break;
      i = 0;
      while (((ch = fgetc(pf)) != EOF) && (ch != ' ')) {
        token[i++] = ch;
      }
      token[i] = '\0';
      if (strcmp(token, "-") == 0) {
        printf("      %s     ", token);
      } else {
        printf(" %s ", token);
      }
      i = 0;
      while (((ch = fgetc(pf)) != EOF) && (ch != ' ')) {
        token[i++] = ch;
      }
      token[i] = '\0';
      if (strcmp(token, "-") == 0) {
        printf("     %s         ", token);
      } else {
        printf(" %s ", token);
      }
      if (ch == EOF)
        break;
      i = 0;
      token[i++] = ' ';
      while (((ch = fgetc(pf)) != EOF) && (ch != ' ')) {
        token[i++] = ch;
      }
      token[i] = '\0';
      printf("%s     ", token);
      if (ch == EOF)
        break;
      i = 0;
      while (((ch = fgetc(pf)) != EOF) && (ch != ' ')) {
        token[i++] = ch;
      }
      token[i] = '\0';
      if (strcmp(token, "-") == 0) {
        printf("      %s     ", token);
      } else {
        printf(" %s ", token);
      }
      if (ch == EOF)
        break;
      i = 0;
      while (((ch = fgetc(pf)) != EOF) && (ch != ' ')) {
        token[i++] = ch;
      }
      token[i] = '\0';
      if (strcmp(token, "-") == 0) {
        printf("      %s             ", token);
      } else {
        printf(" %s ", token);
      }
      if (ch == EOF)
        break;
      i = 0;
      while (((ch = fgetc(pf)) != EOF) && (ch != ' ')) {
        token[i++] = ch;
      }
      token[i] = '\0';
      printf("%s      ", token);
      if (ch == EOF)
        break;
      i = 0;
      while (((ch = fgetc(pf)) != EOF) && (ch != ' ')) {
        token[i++] = ch;
      }
      token[i] = '\0';
      printf("    %s    ", token);
      if (ch == EOF)
        break;
      i = 0;
      while (((ch = fgetc(pf)) != EOF) && (ch != ' ') && (ch != '\n')) {
        token[i++] = ch;
      }
      token[i] = '\0';
      printf(" %s\n", token);
      if (ch == EOF)
        break;
    }
  }
  fclose(pf);
  return;
}


x86 assembly (clang, -O0):
<print_rule>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x28(%rbp)
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeef(%rip),%rdi
lea    0xefb(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    11a2 <print_rule+0x52>
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    185b <print_rule+0x70b>
jmp    11a7 <print_rule+0x57>
jmp    11ac <print_rule+0x5c>
mov    -0x8(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %al,-0x21(%rbp)
movsbl %al,%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x29(%rbp)
je     11d6 <print_rule+0x86>
movsbl -0x21(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
test   $0x1,%al
jne    11e6 <print_rule+0x96>
jmp    11eb <print_rule+0x9b>
jmp    11ac <print_rule+0x5c>
movsbl -0x21(%rbp),%eax
mov    0x2df2(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1206 <print_rule+0xb6>
jmp    184d <print_rule+0x6fd>
movl   $0x0,-0x28(%rbp)
mov    -0x21(%rbp),%cl
mov    -0x28(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x28(%rbp)
cltq
mov    %cl,-0x20(%rbp,%rax,1)
mov    -0x8(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %al,-0x21(%rbp)
movsbl %al,%ecx
mov    0x2db1(%rip),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x2a(%rbp)
je     1254 <print_rule+0x104>
movsbl -0x21(%rbp),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0x2a(%rbp)
mov    -0x2a(%rbp),%al
test   $0x1,%al
jne    1264 <print_rule+0x114>
jmp    127d <print_rule+0x12d>
mov    -0x21(%rbp),%cl
mov    -0x28(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x28(%rbp)
cltq
mov    %cl,-0x20(%rbp,%rax,1)
jmp    1221 <print_rule+0xd1>
movslq -0x28(%rbp),%rax
movb   $0x0,-0x20(%rbp,%rax,1)
lea    -0x20(%rbp),%rsi
lea    0xe13(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbl -0x21(%rbp),%eax
mov    0x2d45(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    12b3 <print_rule+0x163>
jmp    184d <print_rule+0x6fd>
movl   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %al,-0x21(%rbp)
movsbl %al,%ecx
mov    0x2d18(%rip),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x2b(%rbp)
je     12ed <print_rule+0x19d>
movsbl -0x21(%rbp),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0x2b(%rbp)
mov    -0x2b(%rbp),%al
test   $0x1,%al
jne    12fd <print_rule+0x1ad>
jmp    1316 <print_rule+0x1c6>
mov    -0x21(%rbp),%cl
mov    -0x28(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x28(%rbp)
cltq
mov    %cl,-0x20(%rbp,%rax,1)
jmp    12ba <print_rule+0x16a>
movslq -0x28(%rbp),%rax
movb   $0x0,-0x20(%rbp,%rax,1)
lea    -0x20(%rbp),%rdi
lea    0xd81(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1350 <print_rule+0x200>
lea    -0x20(%rbp),%rsi
lea    0xd69(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1362 <print_rule+0x212>
lea    -0x20(%rbp),%rsi
lea    0xd60(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %al,-0x21(%rbp)
movsbl %al,%ecx
mov    0x2c69(%rip),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x2c(%rbp)
je     139c <print_rule+0x24c>
movsbl -0x21(%rbp),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0x2c(%rbp)
mov    -0x2c(%rbp),%al
test   $0x1,%al
jne    13ac <print_rule+0x25c>
jmp    13c5 <print_rule+0x275>
mov    -0x21(%rbp),%cl
mov    -0x28(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x28(%rbp)
cltq
mov    %cl,-0x20(%rbp,%rax,1)
jmp    1369 <print_rule+0x219>
movslq -0x28(%rbp),%rax
movb   $0x0,-0x20(%rbp,%rax,1)
lea    -0x20(%rbp),%rdi
lea    0xcd2(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    13ff <print_rule+0x2af>
lea    -0x20(%rbp),%rsi
lea    0xccd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1411 <print_rule+0x2c1>
lea    -0x20(%rbp),%rsi
lea    0xcb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbl -0x21(%rbp),%eax
mov    0x2bcc(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    142c <print_rule+0x2dc>
jmp    184d <print_rule+0x6fd>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x28(%rbp)
cltq
movb   $0x20,-0x20(%rbp,%rax,1)
mov    -0x8(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %al,-0x21(%rbp)
movsbl %al,%ecx
mov    0x2b8d(%rip),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x2d(%rbp)
je     1478 <print_rule+0x328>
movsbl -0x21(%rbp),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0x2d(%rbp)
mov    -0x2d(%rbp),%al
test   $0x1,%al
jne    1488 <print_rule+0x338>
jmp    14a1 <print_rule+0x351>
mov    -0x21(%rbp),%cl
mov    -0x28(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x28(%rbp)
cltq
mov    %cl,-0x20(%rbp,%rax,1)
jmp    1445 <print_rule+0x2f5>
movslq -0x28(%rbp),%rax
movb   $0x0,-0x20(%rbp,%rax,1)
lea    -0x20(%rbp),%rsi
lea    0xbfe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbl -0x21(%rbp),%eax
mov    0x2b21(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    14d7 <print_rule+0x387>
jmp    184d <print_rule+0x6fd>
movl   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %al,-0x21(%rbp)
movsbl %al,%ecx
mov    0x2af4(%rip),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x2e(%rbp)
je     1511 <print_rule+0x3c1>
movsbl -0x21(%rbp),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0x2e(%rbp)
mov    -0x2e(%rbp),%al
test   $0x1,%al
jne    1521 <print_rule+0x3d1>
jmp    153a <print_rule+0x3ea>
mov    -0x21(%rbp),%cl
mov    -0x28(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x28(%rbp)
cltq
mov    %cl,-0x20(%rbp,%rax,1)
jmp    14de <print_rule+0x38e>
movslq -0x28(%rbp),%rax
movb   $0x0,-0x20(%rbp,%rax,1)
lea    -0x20(%rbp),%rdi
lea    0xb5d(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1574 <print_rule+0x424>
lea    -0x20(%rbp),%rsi
lea    0xb45(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1586 <print_rule+0x436>
lea    -0x20(%rbp),%rsi
lea    0xb3c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbl -0x21(%rbp),%eax
mov    0x2a57(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    15a1 <print_rule+0x451>
jmp    184d <print_rule+0x6fd>
movl   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %al,-0x21(%rbp)
movsbl %al,%ecx
mov    0x2a2a(%rip),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x2f(%rbp)
je     15db <print_rule+0x48b>
movsbl -0x21(%rbp),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0x2f(%rbp)
mov    -0x2f(%rbp),%al
test   $0x1,%al
jne    15eb <print_rule+0x49b>
jmp    1604 <print_rule+0x4b4>
mov    -0x21(%rbp),%cl
mov    -0x28(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x28(%rbp)
cltq
mov    %cl,-0x20(%rbp,%rax,1)
jmp    15a8 <print_rule+0x458>
movslq -0x28(%rbp),%rax
movb   $0x0,-0x20(%rbp,%rax,1)
lea    -0x20(%rbp),%rdi
lea    0xa93(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    163e <print_rule+0x4ee>
lea    -0x20(%rbp),%rsi
lea    0xa9f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1650 <print_rule+0x500>
lea    -0x20(%rbp),%rsi
lea    0xa72(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbl -0x21(%rbp),%eax
mov    0x298d(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    166b <print_rule+0x51b>
jmp    184d <print_rule+0x6fd>
movl   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %al,-0x21(%rbp)
movsbl %al,%ecx
mov    0x2960(%rip),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x30(%rbp)
je     16a5 <print_rule+0x555>
movsbl -0x21(%rbp),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0x30(%rbp)
mov    -0x30(%rbp),%al
test   $0x1,%al
jne    16b5 <print_rule+0x565>
jmp    16ce <print_rule+0x57e>
mov    -0x21(%rbp),%cl
mov    -0x28(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x28(%rbp)
cltq
mov    %cl,-0x20(%rbp,%rax,1)
jmp    1672 <print_rule+0x522>
movslq -0x28(%rbp),%rax
movb   $0x0,-0x20(%rbp,%rax,1)
lea    -0x20(%rbp),%rsi
lea    0xa05(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbl -0x21(%rbp),%eax
mov    0x28f4(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1704 <print_rule+0x5b4>
jmp    184d <print_rule+0x6fd>
movl   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %al,-0x21(%rbp)
movsbl %al,%ecx
mov    0x28c7(%rip),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x31(%rbp)
je     173e <print_rule+0x5ee>
movsbl -0x21(%rbp),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
test   $0x1,%al
jne    174e <print_rule+0x5fe>
jmp    1767 <print_rule+0x617>
mov    -0x21(%rbp),%cl
mov    -0x28(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x28(%rbp)
cltq
mov    %cl,-0x20(%rbp,%rax,1)
jmp    170b <print_rule+0x5bb>
movslq -0x28(%rbp),%rax
movb   $0x0,-0x20(%rbp,%rax,1)
lea    -0x20(%rbp),%rsi
lea    0x975(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbl -0x21(%rbp),%eax
mov    0x285b(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    179d <print_rule+0x64d>
jmp    184d <print_rule+0x6fd>
movl   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %al,-0x21(%rbp)
movsbl %al,%ecx
mov    0x282e(%rip),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x32(%rbp)
je     17e9 <print_rule+0x699>
movsbl -0x21(%rbp),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x32(%rbp)
je     17e9 <print_rule+0x699>
movsbl -0x21(%rbp),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x32(%rbp)
mov    -0x32(%rbp),%al
test   $0x1,%al
jne    17f9 <print_rule+0x6a9>
jmp    1812 <print_rule+0x6c2>
mov    -0x21(%rbp),%cl
mov    -0x28(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x28(%rbp)
cltq
mov    %cl,-0x20(%rbp,%rax,1)
jmp    17a4 <print_rule+0x654>
movslq -0x28(%rbp),%rax
movb   $0x0,-0x20(%rbp,%rax,1)
lea    -0x20(%rbp),%rsi
lea    0x8d5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbl -0x21(%rbp),%eax
mov    0x27b0(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1848 <print_rule+0x6f8>
jmp    184d <print_rule+0x6fd>
jmp    11a7 <print_rule+0x57>
jmp    1852 <print_rule+0x702>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_rule>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xefc(%rip),%rdi
call   1030 <puts@plt>
lea    0xe7f(%rip),%rdi
lea    0xe8b(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
je     1594 <print_rule+0x434>
mov    %rax,%r13
mov    0x2e48(%rip),%r14
mov    %rsp,%r15
lea    0xe82(%rip),%r12
jmp    11d0 <print_rule+0x70>
nopl   0x0(%rax)
mov    %ebp,%eax
movb   $0x0,(%rsp,%rax,1)
lea    0xeaf(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    (%r14),%bl
je     157d <print_rule+0x41d>
mov    %r13,%rdi
call   1060 <fgetc@plt>
cmp    $0xa,%al
je     11d0 <print_rule+0x70>
cmp    $0x20,%al
je     11d0 <print_rule+0x70>
cmp    (%r14),%al
je     157d <print_rule+0x41d>
mov    %al,(%rsp)
mov    %r13,%rdi
call   1060 <fgetc@plt>
mov    %eax,%ebx
mov    $0x1,%ebp
cmp    $0x20,%al
je     122a <print_rule+0xca>
cmp    (%r14),%bl
je     122a <print_rule+0xca>
mov    $0x1,%ebp
nopl   0x0(%rax)
mov    %bl,(%rsp,%rbp,1)
add    $0x1,%rbp
mov    %r13,%rdi
call   1060 <fgetc@plt>
mov    %eax,%ebx
cmp    $0x20,%al
je     122a <print_rule+0xca>
cmp    (%r14),%bl
jne    1210 <print_rule+0xb0>
mov    %ebp,%eax
movb   $0x0,(%rsp,%rax,1)
lea    0xdde(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    (%r14),%bl
je     157d <print_rule+0x41d>
mov    %r13,%rdi
call   1060 <fgetc@plt>
cmp    $0x20,%al
je     128a <print_rule+0x12a>
mov    $0x0,%ebx
cmp    (%r14),%al
je     128c <print_rule+0x12c>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %al,(%rsp,%rbx,1)
add    $0x1,%rbx
mov    %r13,%rdi
call   1060 <fgetc@plt>
cmp    $0x20,%al
je     128c <print_rule+0x12c>
cmp    (%r14),%al
jne    1270 <print_rule+0x110>
jmp    128c <print_rule+0x12c>
xor    %ebx,%ebx
mov    %ebx,%eax
movb   $0x0,(%rsp,%rax,1)
mov    %r15,%rdi
lea    0xd80(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
mov    %r12,%rdi
lea    0xd70(%rip),%rax
cmove  %rax,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r13,%rdi
call   1060 <fgetc@plt>
mov    %eax,%ebp
cmp    $0x20,%al
je     12fd <print_rule+0x19d>
cmp    (%r14),%bpl
je     12fd <print_rule+0x19d>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %bpl,(%rsp,%rbx,1)
add    $0x1,%rbx
mov    %r13,%rdi
call   1060 <fgetc@plt>
mov    %eax,%ebp
cmp    $0x20,%al
je     12ff <print_rule+0x19f>
cmp    (%r14),%bpl
jne    12e0 <print_rule+0x180>
jmp    12ff <print_rule+0x19f>
xor    %ebx,%ebx
mov    %ebx,%eax
movb   $0x0,(%rsp,%rax,1)
mov    %r15,%rdi
lea    0xd0d(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
mov    %r12,%rdi
lea    0xd10(%rip),%rax
cmove  %rax,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    (%r14),%bpl
je     157d <print_rule+0x41d>
movb   $0x20,(%rsp)
mov    %r13,%rdi
call   1060 <fgetc@plt>
mov    %eax,%ebx
mov    $0x1,%ebp
cmp    $0x20,%al
je     137a <print_rule+0x21a>
cmp    (%r14),%bl
je     137a <print_rule+0x21a>
mov    $0x1,%ebp
nopl   0x0(%rax)
mov    %bl,(%rsp,%rbp,1)
add    $0x1,%rbp
mov    %r13,%rdi
call   1060 <fgetc@plt>
mov    %eax,%ebx
cmp    $0x20,%al
je     137a <print_rule+0x21a>
cmp    (%r14),%bl
jne    1360 <print_rule+0x200>
mov    %ebp,%eax
movb   $0x0,(%rsp,%rax,1)
lea    0xc9d(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    (%r14),%bl
je     157d <print_rule+0x41d>
mov    %r13,%rdi
call   1060 <fgetc@plt>
mov    %eax,%ebx
cmp    $0x20,%al
je     13cc <print_rule+0x26c>
cmp    (%r14),%bl
je     13cc <print_rule+0x26c>
xor    %ebp,%ebp
nop
mov    %bl,(%rsp,%rbp,1)
add    $0x1,%rbp
mov    %r13,%rdi
call   1060 <fgetc@plt>
mov    %eax,%ebx
cmp    $0x20,%al
je     13ce <print_rule+0x26e>
cmp    (%r14),%bl
jne    13b0 <print_rule+0x250>
jmp    13ce <print_rule+0x26e>
xor    %ebp,%ebp
mov    %ebp,%eax
movb   $0x0,(%rsp,%rax,1)
mov    %r15,%rdi
lea    0xc3e(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
mov    %r12,%rdi
lea    0xc2e(%rip),%rax
cmove  %rax,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    (%r14),%bl
je     157d <print_rule+0x41d>
mov    %r13,%rdi
call   1060 <fgetc@plt>
mov    %eax,%ebx
cmp    $0x20,%al
je     143c <print_rule+0x2dc>
cmp    (%r14),%bl
je     143c <print_rule+0x2dc>
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %bl,(%rsp,%rbp,1)
add    $0x1,%rbp
mov    %r13,%rdi
call   1060 <fgetc@plt>
mov    %eax,%ebx
cmp    $0x20,%al
je     143e <print_rule+0x2de>
cmp    (%r14),%bl
jne    1420 <print_rule+0x2c0>
jmp    143e <print_rule+0x2de>
xor    %ebp,%ebp
mov    %ebp,%eax
movb   $0x0,(%rsp,%rax,1)
mov    %r15,%rdi
lea    0xbce(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
mov    %r12,%rdi
lea    0xbe2(%rip),%rax
cmove  %rax,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    (%r14),%bl
je     157d <print_rule+0x41d>
mov    %r13,%rdi
call   1060 <fgetc@plt>
mov    %eax,%ebx
cmp    $0x20,%al
je     14ac <print_rule+0x34c>
cmp    (%r14),%bl
je     14ac <print_rule+0x34c>
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %bl,(%rsp,%rbp,1)
add    $0x1,%rbp
mov    %r13,%rdi
call   1060 <fgetc@plt>
mov    %eax,%ebx
cmp    $0x20,%al
je     14ae <print_rule+0x34e>
cmp    (%r14),%bl
jne    1490 <print_rule+0x330>
jmp    14ae <print_rule+0x34e>
xor    %ebp,%ebp
mov    %ebp,%eax
movb   $0x0,(%rsp,%rax,1)
lea    0xb9d(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    (%r14),%bl
je     157d <print_rule+0x41d>
mov    %r13,%rdi
call   1060 <fgetc@plt>
mov    %eax,%ebx
cmp    $0x20,%al
je     150c <print_rule+0x3ac>
cmp    (%r14),%bl
je     150c <print_rule+0x3ac>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %bl,(%rsp,%rbp,1)
add    $0x1,%rbp
mov    %r13,%rdi
call   1060 <fgetc@plt>
mov    %eax,%ebx
cmp    $0x20,%al
je     150e <print_rule+0x3ae>
cmp    (%r14),%bl
jne    14f0 <print_rule+0x390>
jmp    150e <print_rule+0x3ae>
xor    %ebp,%ebp
mov    %ebp,%eax
movb   $0x0,(%rsp,%rax,1)
lea    0xb46(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    (%r14),%bl
je     157d <print_rule+0x41d>
mov    %r13,%rdi
call   1060 <fgetc@plt>
mov    %eax,%ebx
xor    %ebp,%ebp
cmp    (%r14),%al
je     11b0 <print_rule+0x50>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    $0xa,%bl
je     11b0 <print_rule+0x50>
cmp    $0x20,%bl
je     11b0 <print_rule+0x50>
mov    %bl,(%rsp,%rbp,1)
add    $0x1,%rbp
mov    %r13,%rdi
call   1060 <fgetc@plt>
mov    %eax,%ebx
cmp    (%r14),%al
jne    1550 <print_rule+0x3f0>
jmp    11b0 <print_rule+0x50>
mov    %r13,%rdi
call   1040 <fclose@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xb38(%rip),%rdi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [99 x i8] c"in/out src ip src mask src port dest ip dest mask dest port proto action\0A\00"
@.str.1 = [19 x i8] c"/proc/minifirewall\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [44 x i8] c"Cannot open /proc/minifirewall for reading\0A\00"
@EOF = global i8 0
@.str.4 = [7 x i8] c" %s \00"
@.str.5 = [2 x i8] c"-\00"
@.str.6 = [14 x i8] c" %s \00"
@.str.7 = [5 x i8] c" %s \00"
@.str.8 = [17 x i8] c" %s \00"
@.str.9 = [8 x i8] c"%s \00"
@.str.10 = [22 x i8] c" %s \00"
@.str.11 = [9 x i8] c"%s \00"
@.str.12 = [11 x i8] c" %s \00"
@.str.13 = [5 x i8] c" %s\0A\00"
define void @print_rule() {
%1 = alloca i32*
%2 = alloca [20 x i8]
%3 = alloca i8
%4 = alloca i32
store i32 0, i32* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str, i64 0, i64 0))
%6 = call i32* @fopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %6, i32** %1
%7 = load i32*, i32** %1
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
br label %363
11: ; preds = %0
br label %12
12: ; preds = %11, %358
br label %13
13: ; preds = %24, %12
%14 = load i32*, i32** %1
%15 = call signext i8 @fgetc(i32* %14)
store i8 %15, i8* %3
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 32
br i1 %17, label %22, label %18
18: ; preds = %13
%19 = load i8, i8* %3
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 10
br label %22
22: ; preds = %18, %13
%23 = phi i1 [ true, %13 ], [ %21, %18 ]
br i1 %23, label %24, label %25
24: ; preds = %22
br label %13
25: ; preds = %22
%26 = load i8, i8* %3
%27 = sext i8 %26 to i32
%28 = load i8, i8* @EOF
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %27, %29
br i1 %30, label %31, label %32
31: ; preds = %25
br label %359
32: ; preds = %25
store i32 0, i32* %4
%33 = load i8, i8* %3
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
store i32 %35, i32* %4
%36 = sext i32 %34 to i64
%37 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %36
store i8 %33, i8* %37
br label %38
38: ; preds = %51, %32
%39 = load i32*, i32** %1
%40 = call signext i8 @fgetc(i32* %39)
store i8 %40, i8* %3
%41 = sext i8 %40 to i32
%42 = load i8, i8* @EOF
%43 = sext i8 %42 to i32
%44 = icmp ne i32 %41, %43
br i1 %44, label %45, label %49
45: ; preds = %38
%46 = load i8, i8* %3
%47 = sext i8 %46 to i32
%48 = icmp ne i32 %47, 32
br label %49
49: ; preds = %45, %38
%50 = phi i1 [ false, %38 ], [ %48, %45 ]
br i1 %50, label %51, label %57
51: ; preds = %49
%52 = load i8, i8* %3
%53 = load i32, i32* %4
%54 = add nsw i32 %53, 1
store i32 %54, i32* %4
%55 = sext i32 %53 to i64
%56 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %55
store i8 %52, i8* %56
br label %38
57: ; preds = %49
%58 = load i32, i32* %4
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %59
store i8 0, i8* %60
%61 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %61)
%63 = load i8, i8* %3
%64 = sext i8 %63 to i32
%65 = load i8, i8* @EOF
%66 = sext i8 %65 to i32
%67 = icmp eq i32 %64, %66
br i1 %67, label %68, label %69
68: ; preds = %57
br label %359
69: ; preds = %57
store i32 0, i32* %4
br label %70
70: ; preds = %83, %69
%71 = load i32*, i32** %1
%72 = call signext i8 @fgetc(i32* %71)
store i8 %72, i8* %3
%73 = sext i8 %72 to i32
%74 = load i8, i8* @EOF
%75 = sext i8 %74 to i32
%76 = icmp ne i32 %73, %75
br i1 %76, label %77, label %81
77: ; preds = %70
%78 = load i8, i8* %3
%79 = sext i8 %78 to i32
%80 = icmp ne i32 %79, 32
br label %81
81: ; preds = %77, %70
%82 = phi i1 [ false, %70 ], [ %80, %77 ]
br i1 %82, label %83, label %89
83: ; preds = %81
%84 = load i8, i8* %3
%85 = load i32, i32* %4
%86 = add nsw i32 %85, 1
store i32 %86, i32* %4
%87 = sext i32 %85 to i64
%88 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %87
store i8 %84, i8* %88
br label %70
89: ; preds = %81
%90 = load i32, i32* %4
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %91
store i8 0, i8* %92
%93 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%94 = call i64 @strcmp(i8* %93, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%95 = icmp eq i64 %94, 0
br i1 %95, label %96, label %99
96: ; preds = %89
%97 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* %97)
br label %102
99: ; preds = %89
%100 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* %100)
br label %102
102: ; preds = %99, %96
store i32 0, i32* %4
br label %103
103: ; preds = %116, %102
%104 = load i32*, i32** %1
%105 = call signext i8 @fgetc(i32* %104)
store i8 %105, i8* %3
%106 = sext i8 %105 to i32
%107 = load i8, i8* @EOF
%108 = sext i8 %107 to i32
%109 = icmp ne i32 %106, %108
br i1 %109, label %110, label %114
110: ; preds = %103
%111 = load i8, i8* %3
%112 = sext i8 %111 to i32
%113 = icmp ne i32 %112, 32
br label %114
114: ; preds = %110, %103
%115 = phi i1 [ false, %103 ], [ %113, %110 ]
br i1 %115, label %116, label %122
116: ; preds = %114
%117 = load i8, i8* %3
%118 = load i32, i32* %4
%119 = add nsw i32 %118, 1
store i32 %119, i32* %4
%120 = sext i32 %118 to i64
%121 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %120
store i8 %117, i8* %121
br label %103
122: ; preds = %114
%123 = load i32, i32* %4
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %124
store i8 0, i8* %125
%126 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%127 = call i64 @strcmp(i8* %126, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%128 = icmp eq i64 %127, 0
br i1 %128, label %129, label %132
129: ; preds = %122
%130 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%131 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), i8* %130)
br label %135
132: ; preds = %122
%133 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* %133)
br label %135
135: ; preds = %132, %129
%136 = load i8, i8* %3
%137 = sext i8 %136 to i32
%138 = load i8, i8* @EOF
%139 = sext i8 %138 to i32
%140 = icmp eq i32 %137, %139
br i1 %140, label %141, label %142
141: ; preds = %135
br label %359
142: ; preds = %135
store i32 0, i32* %4
%143 = load i32, i32* %4
%144 = add nsw i32 %143, 1
store i32 %144, i32* %4
%145 = sext i32 %143 to i64
%146 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %145
store i8 32, i8* %146
br label %147
147: ; preds = %160, %142
%148 = load i32*, i32** %1
%149 = call signext i8 @fgetc(i32* %148)
store i8 %149, i8* %3
%150 = sext i8 %149 to i32
%151 = load i8, i8* @EOF
%152 = sext i8 %151 to i32
%153 = icmp ne i32 %150, %152
br i1 %153, label %154, label %158
154: ; preds = %147
%155 = load i8, i8* %3
%156 = sext i8 %155 to i32
%157 = icmp ne i32 %156, 32
br label %158
158: ; preds = %154, %147
%159 = phi i1 [ false, %147 ], [ %157, %154 ]
br i1 %159, label %160, label %166
160: ; preds = %158
%161 = load i8, i8* %3
%162 = load i32, i32* %4
%163 = add nsw i32 %162, 1
store i32 %163, i32* %4
%164 = sext i32 %162 to i64
%165 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %164
store i8 %161, i8* %165
br label %147
166: ; preds = %158
%167 = load i32, i32* %4
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %168
store i8 0, i8* %169
%170 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%171 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i8* %170)
%172 = load i8, i8* %3
%173 = sext i8 %172 to i32
%174 = load i8, i8* @EOF
%175 = sext i8 %174 to i32
%176 = icmp eq i32 %173, %175
br i1 %176, label %177, label %178
177: ; preds = %166
br label %359
178: ; preds = %166
store i32 0, i32* %4
br label %179
179: ; preds = %192, %178
%180 = load i32*, i32** %1
%181 = call signext i8 @fgetc(i32* %180)
store i8 %181, i8* %3
%182 = sext i8 %181 to i32
%183 = load i8, i8* @EOF
%184 = sext i8 %183 to i32
%185 = icmp ne i32 %182, %184
br i1 %185, label %186, label %190
186: ; preds = %179
%187 = load i8, i8* %3
%188 = sext i8 %187 to i32
%189 = icmp ne i32 %188, 32
br label %190
190: ; preds = %186, %179
%191 = phi i1 [ false, %179 ], [ %189, %186 ]
br i1 %191, label %192, label %198
192: ; preds = %190
%193 = load i8, i8* %3
%194 = load i32, i32* %4
%195 = add nsw i32 %194, 1
store i32 %195, i32* %4
%196 = sext i32 %194 to i64
%197 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %196
store i8 %193, i8* %197
br label %179
198: ; preds = %190
%199 = load i32, i32* %4
%200 = sext i32 %199 to i64
%201 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %200
store i8 0, i8* %201
%202 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%203 = call i64 @strcmp(i8* %202, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%204 = icmp eq i64 %203, 0
br i1 %204, label %205, label %208
205: ; preds = %198
%206 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%207 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* %206)
br label %211
208: ; preds = %198
%209 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%210 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* %209)
br label %211
211: ; preds = %208, %205
%212 = load i8, i8* %3
%213 = sext i8 %212 to i32
%214 = load i8, i8* @EOF
%215 = sext i8 %214 to i32
%216 = icmp eq i32 %213, %215
br i1 %216, label %217, label %218
217: ; preds = %211
br label %359
218: ; preds = %211
store i32 0, i32* %4
br label %219
219: ; preds = %232, %218
%220 = load i32*, i32** %1
%221 = call signext i8 @fgetc(i32* %220)
store i8 %221, i8* %3
%222 = sext i8 %221 to i32
%223 = load i8, i8* @EOF
%224 = sext i8 %223 to i32
%225 = icmp ne i32 %222, %224
br i1 %225, label %226, label %230
226: ; preds = %219
%227 = load i8, i8* %3
%228 = sext i8 %227 to i32
%229 = icmp ne i32 %228, 32
br label %230
230: ; preds = %226, %219
%231 = phi i1 [ false, %219 ], [ %229, %226 ]
br i1 %231, label %232, label %238
232: ; preds = %230
%233 = load i8, i8* %3
%234 = load i32, i32* %4
%235 = add nsw i32 %234, 1
store i32 %235, i32* %4
%236 = sext i32 %234 to i64
%237 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %236
store i8 %233, i8* %237
br label %219
238: ; preds = %230
%239 = load i32, i32* %4
%240 = sext i32 %239 to i64
%241 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %240
store i8 0, i8* %241
%242 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%243 = call i64 @strcmp(i8* %242, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%244 = icmp eq i64 %243, 0
br i1 %244, label %245, label %248
245: ; preds = %238
%246 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%247 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i8* %246)
br label %251
248: ; preds = %238
%249 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%250 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* %249)
br label %251
251: ; preds = %248, %245
%252 = load i8, i8* %3
%253 = sext i8 %252 to i32
%254 = load i8, i8* @EOF
%255 = sext i8 %254 to i32
%256 = icmp eq i32 %253, %255
br i1 %256, label %257, label %258
257: ; preds = %251
br label %359
258: ; preds = %251
store i32 0, i32* %4
br label %259
259: ; preds = %272, %258
%260 = load i32*, i32** %1
%261 = call signext i8 @fgetc(i32* %260)
store i8 %261, i8* %3
%262 = sext i8 %261 to i32
%263 = load i8, i8* @EOF
%264 = sext i8 %263 to i32
%265 = icmp ne i32 %262, %264
br i1 %265, label %266, label %270
266: ; preds = %259
%267 = load i8, i8* %3
%268 = sext i8 %267 to i32
%269 = icmp ne i32 %268, 32
br label %270
270: ; preds = %266, %259
%271 = phi i1 [ false, %259 ], [ %269, %266 ]
br i1 %271, label %272, label %278
272: ; preds = %270
%273 = load i8, i8* %3
%274 = load i32, i32* %4
%275 = add nsw i32 %274, 1
store i32 %275, i32* %4
%276 = sext i32 %274 to i64
%277 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %276
store i8 %273, i8* %277
br label %259
278: ; preds = %270
%279 = load i32, i32* %4
%280 = sext i32 %279 to i64
%281 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %280
store i8 0, i8* %281
%282 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%283 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i8* %282)
%284 = load i8, i8* %3
%285 = sext i8 %284 to i32
%286 = load i8, i8* @EOF
%287 = sext i8 %286 to i32
%288 = icmp eq i32 %285, %287
br i1 %288, label %289, label %290
289: ; preds = %278
br label %359
290: ; preds = %278
store i32 0, i32* %4
br label %291
291: ; preds = %304, %290
%292 = load i32*, i32** %1
%293 = call signext i8 @fgetc(i32* %292)
store i8 %293, i8* %3
%294 = sext i8 %293 to i32
%295 = load i8, i8* @EOF
%296 = sext i8 %295 to i32
%297 = icmp ne i32 %294, %296
br i1 %297, label %298, label %302
298: ; preds = %291
%299 = load i8, i8* %3
%300 = sext i8 %299 to i32
%301 = icmp ne i32 %300, 32
br label %302
302: ; preds = %298, %291
%303 = phi i1 [ false, %291 ], [ %301, %298 ]
br i1 %303, label %304, label %310
304: ; preds = %302
%305 = load i8, i8* %3
%306 = load i32, i32* %4
%307 = add nsw i32 %306, 1
store i32 %307, i32* %4
%308 = sext i32 %306 to i64
%309 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %308
store i8 %305, i8* %309
br label %291
310: ; preds = %302
%311 = load i32, i32* %4
%312 = sext i32 %311 to i64
%313 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %312
store i8 0, i8* %313
%314 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%315 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0), i8* %314)
%316 = load i8, i8* %3
%317 = sext i8 %316 to i32
%318 = load i8, i8* @EOF
%319 = sext i8 %318 to i32
%320 = icmp eq i32 %317, %319
br i1 %320, label %321, label %322
321: ; preds = %310
br label %359
322: ; preds = %310
store i32 0, i32* %4
br label %323
323: ; preds = %340, %322
%324 = load i32*, i32** %1
%325 = call signext i8 @fgetc(i32* %324)
store i8 %325, i8* %3
%326 = sext i8 %325 to i32
%327 = load i8, i8* @EOF
%328 = sext i8 %327 to i32
%329 = icmp ne i32 %326, %328
br i1 %329, label %330, label %338
330: ; preds = %323
%331 = load i8, i8* %3
%332 = sext i8 %331 to i32
%333 = icmp ne i32 %332, 32
br i1 %333, label %334, label %338
334: ; preds = %330
%335 = load i8, i8* %3
%336 = sext i8 %335 to i32
%337 = icmp ne i32 %336, 10
br label %338
338: ; preds = %334, %330, %323
%339 = phi i1 [ false, %330 ], [ false, %323 ], [ %337, %334 ]
br i1 %339, label %340, label %346
340: ; preds = %338
%341 = load i8, i8* %3
%342 = load i32, i32* %4
%343 = add nsw i32 %342, 1
store i32 %343, i32* %4
%344 = sext i32 %342 to i64
%345 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %344
store i8 %341, i8* %345
br label %323
346: ; preds = %338
%347 = load i32, i32* %4
%348 = sext i32 %347 to i64
%349 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %348
store i8 0, i8* %349
%350 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%351 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0), i8* %350)
%352 = load i8, i8* %3
%353 = sext i8 %352 to i32
%354 = load i8, i8* @EOF
%355 = sext i8 %354 to i32
%356 = icmp eq i32 %353, %355
br i1 %356, label %357, label %358
357: ; preds = %346
br label %359
358: ; preds = %346
br label %12
359: ; preds = %357, %321, %289, %257, %217, %177, %141, %68, %31
br label %360
360: ; preds = %359
%361 = load i32*, i32** %1
%362 = call i32 @fclose(i32* %361)
br label %363
363: ; preds = %360, %9
ret void
}

LLVM IR (-O2):
@.str.1 = [19 x i8] c"/proc/minifirewall\00"
@.str.2 = [2 x i8] c"r\00"
@EOF = global i8 0
@.str.4 = [7 x i8] c" %s \00"
@.str.5 = [2 x i8] c"-\00"
@.str.6 = [14 x i8] c" %s \00"
@.str.7 = [5 x i8] c" %s \00"
@.str.8 = [17 x i8] c" %s \00"
@.str.9 = [8 x i8] c"%s \00"
@.str.10 = [22 x i8] c" %s \00"
@.str.11 = [9 x i8] c"%s \00"
@.str.12 = [11 x i8] c" %s \00"
@.str.13 = [5 x i8] c" %s\0A\00"
@str = [98 x i8] c"in/out src ip src mask src port dest ip dest mask dest port proto action\00"
@str.14 = [43 x i8] c"Cannot open /proc/minifirewall for reading\00"
define void @print_rule() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([98 x i8], [98 x i8]* @str, i64 0, i64 0))
%4 = tail call i32* @fopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.14, i64 0, i64 0))
br label %243
8: ; preds = %0, %240
%9 = call signext i8 @fgetc(i32* %4)
switch i8 %9, label %10 [
i8 32, label %240
i8 10, label %240
]
10: ; preds = %8
%11 = load i8, i8* @EOF
%12 = icmp eq i8 %9, %11
br i1 %12, label %241, label %13
13: ; preds = %10
store i8 %9, i8* %2
%14 = call signext i8 @fgetc(i32* %4)
%15 = load i8, i8* @EOF
%16 = icmp ne i8 %14, %15
%17 = icmp ne i8 %14, 32
%18 = and i1 %17, %16
br i1 %18, label %19, label %29
19: ; preds = %13, %19
%20 = phi i64 [ %22, %19 ], [ 1, %13 ]
%21 = phi i8 [ %24, %19 ], [ %14, %13 ]
%22 = add nuw i64 %20, 1
%23 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %20
store i8 %21, i8* %23
%24 = call signext i8 @fgetc(i32* %4)
%25 = load i8, i8* @EOF
%26 = icmp ne i8 %24, %25
%27 = icmp ne i8 %24, 32
%28 = and i1 %27, %26
br i1 %28, label %19, label %29
29: ; preds = %19, %13
%30 = phi i64 [ 1, %13 ], [ %22, %19 ]
%31 = phi i8 [ %14, %13 ], [ %24, %19 ]
%32 = and i64 %30, 4294967295
%33 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %32
store i8 0, i8* %33
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %2)
%35 = load i8, i8* @EOF
%36 = icmp eq i8 %31, %35
br i1 %36, label %241, label %37
37: ; preds = %29
%38 = call signext i8 @fgetc(i32* %4)
%39 = load i8, i8* @EOF
%40 = icmp ne i8 %38, %39
%41 = icmp ne i8 %38, 32
%42 = and i1 %41, %40
br i1 %42, label %43, label %53
43: ; preds = %37, %43
%44 = phi i64 [ %46, %43 ], [ 0, %37 ]
%45 = phi i8 [ %48, %43 ], [ %38, %37 ]
%46 = add nuw i64 %44, 1
%47 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %44
store i8 %45, i8* %47
%48 = call signext i8 @fgetc(i32* %4)
%49 = load i8, i8* @EOF
%50 = icmp ne i8 %48, %49
%51 = icmp ne i8 %48, 32
%52 = and i1 %51, %50
br i1 %52, label %43, label %53
53: ; preds = %43, %37
%54 = phi i64 [ 0, %37 ], [ %46, %43 ]
%55 = and i64 %54, 4294967295
%56 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %55
store i8 0, i8* %56
%57 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%58 = icmp eq i64 %57, 0
%59 = select i1 %58, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0)
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %59, i8* %2)
%61 = call signext i8 @fgetc(i32* %4)
%62 = load i8, i8* @EOF
%63 = icmp ne i8 %61, %62
%64 = icmp ne i8 %61, 32
%65 = and i1 %64, %63
br i1 %65, label %66, label %76
66: ; preds = %53, %66
%67 = phi i64 [ %69, %66 ], [ 0, %53 ]
%68 = phi i8 [ %71, %66 ], [ %61, %53 ]
%69 = add nuw i64 %67, 1
%70 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %67
store i8 %68, i8* %70
%71 = call signext i8 @fgetc(i32* %4)
%72 = load i8, i8* @EOF
%73 = icmp ne i8 %71, %72
%74 = icmp ne i8 %71, 32
%75 = and i1 %74, %73
br i1 %75, label %66, label %76
76: ; preds = %66, %53
%77 = phi i64 [ 0, %53 ], [ %69, %66 ]
%78 = phi i8 [ %61, %53 ], [ %71, %66 ]
%79 = and i64 %77, 4294967295
%80 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %79
store i8 0, i8* %80
%81 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%82 = icmp eq i64 %81, 0
%83 = select i1 %82, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0)
%84 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %83, i8* %2)
%85 = load i8, i8* @EOF
%86 = icmp eq i8 %78, %85
br i1 %86, label %241, label %87
87: ; preds = %76
store i8 32, i8* %2
%88 = call signext i8 @fgetc(i32* %4)
%89 = load i8, i8* @EOF
%90 = icmp ne i8 %88, %89
%91 = icmp ne i8 %88, 32
%92 = and i1 %91, %90
br i1 %92, label %93, label %103
93: ; preds = %87, %93
%94 = phi i64 [ %96, %93 ], [ 1, %87 ]
%95 = phi i8 [ %98, %93 ], [ %88, %87 ]
%96 = add nuw i64 %94, 1
%97 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %94
store i8 %95, i8* %97
%98 = call signext i8 @fgetc(i32* %4)
%99 = load i8, i8* @EOF
%100 = icmp ne i8 %98, %99
%101 = icmp ne i8 %98, 32
%102 = and i1 %101, %100
br i1 %102, label %93, label %103
103: ; preds = %93, %87
%104 = phi i64 [ 1, %87 ], [ %96, %93 ]
%105 = phi i8 [ %88, %87 ], [ %98, %93 ]
%106 = and i64 %104, 4294967295
%107 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %106
store i8 0, i8* %107
%108 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i8* %2)
%109 = load i8, i8* @EOF
%110 = icmp eq i8 %105, %109
br i1 %110, label %241, label %111
111: ; preds = %103
%112 = call signext i8 @fgetc(i32* %4)
%113 = load i8, i8* @EOF
%114 = icmp ne i8 %112, %113
%115 = icmp ne i8 %112, 32
%116 = and i1 %115, %114
br i1 %116, label %117, label %127
117: ; preds = %111, %117
%118 = phi i64 [ %120, %117 ], [ 0, %111 ]
%119 = phi i8 [ %122, %117 ], [ %112, %111 ]
%120 = add nuw i64 %118, 1
%121 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %118
store i8 %119, i8* %121
%122 = call signext i8 @fgetc(i32* %4)
%123 = load i8, i8* @EOF
%124 = icmp ne i8 %122, %123
%125 = icmp ne i8 %122, 32
%126 = and i1 %125, %124
br i1 %126, label %117, label %127
127: ; preds = %117, %111
%128 = phi i64 [ 0, %111 ], [ %120, %117 ]
%129 = phi i8 [ %112, %111 ], [ %122, %117 ]
%130 = and i64 %128, 4294967295
%131 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %130
store i8 0, i8* %131
%132 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%133 = icmp eq i64 %132, 0
%134 = select i1 %133, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0)
%135 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %134, i8* %2)
%136 = load i8, i8* @EOF
%137 = icmp eq i8 %129, %136
br i1 %137, label %241, label %138
138: ; preds = %127
%139 = call signext i8 @fgetc(i32* %4)
%140 = load i8, i8* @EOF
%141 = icmp ne i8 %139, %140
%142 = icmp ne i8 %139, 32
%143 = and i1 %142, %141
br i1 %143, label %144, label %154
144: ; preds = %138, %144
%145 = phi i64 [ %147, %144 ], [ 0, %138 ]
%146 = phi i8 [ %149, %144 ], [ %139, %138 ]
%147 = add nuw i64 %145, 1
%148 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %145
store i8 %146, i8* %148
%149 = call signext i8 @fgetc(i32* %4)
%150 = load i8, i8* @EOF
%151 = icmp ne i8 %149, %150
%152 = icmp ne i8 %149, 32
%153 = and i1 %152, %151
br i1 %153, label %144, label %154
154: ; preds = %144, %138
%155 = phi i64 [ 0, %138 ], [ %147, %144 ]
%156 = phi i8 [ %139, %138 ], [ %149, %144 ]
%157 = and i64 %155, 4294967295
%158 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %157
store i8 0, i8* %158
%159 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%160 = icmp eq i64 %159, 0
%161 = select i1 %160, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0)
%162 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %161, i8* %2)
%163 = load i8, i8* @EOF
%164 = icmp eq i8 %156, %163
br i1 %164, label %241, label %165
165: ; preds = %154
%166 = call signext i8 @fgetc(i32* %4)
%167 = load i8, i8* @EOF
%168 = icmp ne i8 %166, %167
%169 = icmp ne i8 %166, 32
%170 = and i1 %169, %168
br i1 %170, label %171, label %181
171: ; preds = %165, %171
%172 = phi i64 [ %174, %171 ], [ 0, %165 ]
%173 = phi i8 [ %176, %171 ], [ %166, %165 ]
%174 = add nuw i64 %172, 1
%175 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %172
store i8 %173, i8* %175
%176 = call signext i8 @fgetc(i32* %4)
%177 = load i8, i8* @EOF
%178 = icmp ne i8 %176, %177
%179 = icmp ne i8 %176, 32
%180 = and i1 %179, %178
br i1 %180, label %171, label %181
181: ; preds = %171, %165
%182 = phi i64 [ 0, %165 ], [ %174, %171 ]
%183 = phi i8 [ %166, %165 ], [ %176, %171 ]
%184 = and i64 %182, 4294967295
%185 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %184
store i8 0, i8* %185
%186 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i8* %2)
%187 = load i8, i8* @EOF
%188 = icmp eq i8 %183, %187
br i1 %188, label %241, label %189
189: ; preds = %181
%190 = call signext i8 @fgetc(i32* %4)
%191 = load i8, i8* @EOF
%192 = icmp ne i8 %190, %191
%193 = icmp ne i8 %190, 32
%194 = and i1 %193, %192
br i1 %194, label %195, label %205
195: ; preds = %189, %195
%196 = phi i64 [ %198, %195 ], [ 0, %189 ]
%197 = phi i8 [ %200, %195 ], [ %190, %189 ]
%198 = add nuw i64 %196, 1
%199 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %196
store i8 %197, i8* %199
%200 = call signext i8 @fgetc(i32* %4)
%201 = load i8, i8* @EOF
%202 = icmp ne i8 %200, %201
%203 = icmp ne i8 %200, 32
%204 = and i1 %203, %202
br i1 %204, label %195, label %205
205: ; preds = %195, %189
%206 = phi i64 [ 0, %189 ], [ %198, %195 ]
%207 = phi i8 [ %190, %189 ], [ %200, %195 ]
%208 = and i64 %206, 4294967295
%209 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %208
store i8 0, i8* %209
%210 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0), i8* %2)
%211 = load i8, i8* @EOF
%212 = icmp eq i8 %207, %211
br i1 %212, label %241, label %213
213: ; preds = %205
%214 = call signext i8 @fgetc(i32* %4)
%215 = load i8, i8* @EOF
%216 = freeze i8 %215
%217 = icmp eq i8 %214, %216
br i1 %217, label %232, label %218
218: ; preds = %213, %222
%219 = phi i64 [ %223, %222 ], [ 0, %213 ]
%220 = phi i8 [ %226, %222 ], [ %214, %213 ]
%221 = phi i32 [ %224, %222 ], [ 0, %213 ]
switch i8 %220, label %222 [
i8 32, label %230
i8 10, label %230
]
222: ; preds = %218
%223 = add nuw i64 %219, 1
%224 = add nuw nsw i32 %221, 1
%225 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %219
store i8 %220, i8* %225
%226 = call signext i8 @fgetc(i32* %4)
%227 = load i8, i8* @EOF
%228 = freeze i8 %227
%229 = icmp eq i8 %226, %228
br i1 %229, label %232, label %218
230: ; preds = %218, %218
%231 = trunc i64 %219 to i32
br label %232
232: ; preds = %222, %230, %213
%233 = phi i32 [ 0, %213 ], [ %231, %230 ], [ %224, %222 ]
%234 = phi i8 [ %214, %213 ], [ %220, %230 ], [ %226, %222 ]
%235 = zext i32 %233 to i64
%236 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %235
store i8 0, i8* %236
%237 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0), i8* %2)
%238 = load i8, i8* @EOF
%239 = icmp eq i8 %234, %238
br i1 %239, label %241, label %240
240: ; preds = %232, %8, %8
br label %8
241: ; preds = %10, %29, %76, %103, %127, %154, %181, %205, %232
%242 = call i32 @fclose(i32* %4)
br label %243
243: ; preds = %241, %6
ret void
}