#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*/ construct_vap(char *, int, int, int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
char fgetc(int /*<<< orphan*/ *);
scalar_t__ find_pattern_from_str(char *, char *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ nvram_get(char *);
int /*<<< orphan*/ nvram_get_system_mode(int *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ readline(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ ungetc(char, int /*<<< orphan*/ *);
int vap_already_in_bridge(int radio, int vapid, int mode) {
  char vap_name[32];
  char cmd[128] = {0};
  FILE *fin;
  char str[256] = {0}, c;
  char bridge_name[32] = {0};
  int opmode = -1;
  if (0 == mode) {
    strcpy(bridge_name, nvram_get("lan0_ifname"));
  } else {
    nvram_get_system_mode(&opmode);
    if ((6 == opmode) || (7 == opmode)) {
      strcpy(bridge_name, nvram_get("wan0_device"));
    } else {
      strcpy(bridge_name, nvram_get("lan0_ifname"));
    }
  }
  construct_vap(vap_name, radio, vapid, mode);
  sprintf(cmd, "brctl show %s | grep -w %s > /tmp/bridge_info", bridge_name,
          vap_name);
  do {
    printf("\033[1;33;40m");
    printf(cmd);
    printf("\033[0m");
    printf("\n");
    system(cmd);
  } while (0);
  fin = fopen("/tmp/bridge_info", "r");
  while ((c = fgetc(fin)) != EOF) {
    ungetc(c, fin);
    readline(str, fin);
    if (find_pattern_from_str(str, vap_name) == 0) {
      printf("vap %s is in bridge %s\n", vap_name, bridge_name);
      fclose(fin);
      do {
        printf("\033[1;33;40m");
        printf("rm -f /tmp/bridge_info");
        printf("\033[0m");
        printf("\n");
        system("rm -f /tmp/bridge_info");
      } while (0);
      return 1;
    }
  }
  printf("vap %s is not in bridge %s now\n", vap_name, bridge_name);
  fclose(fin);
  do {
    printf("\033[1;33;40m");
    printf("rm -f /tmp/bridge_info");
    printf("\033[0m");
    printf("\n");
    system("rm -f /tmp/bridge_info");
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<vap_already_in_bridge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    -0xb0(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1080 <memset@plt>
lea    -0x1c0(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1080 <memset@plt>
lea    -0x1f0(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1080 <memset@plt>
movl   $0xffffffff,-0x1f4(%rbp)
ff ff ff
xor    %eax,%eax
cmp    -0x10(%rbp),%eax
jne    126f <vap_already_in_bridge+0x8f>
lea    -0x1f0(%rbp),%rax
mov    %rax,-0x200(%rbp)
lea    0xda9(%rip),%rdi
call   1100 <nvram_get@plt>
mov    -0x200(%rbp),%rdi
mov    %eax,%esi
call   1030 <strcpy@plt>
jmp    12f7 <vap_already_in_bridge+0x117>
lea    -0x1f4(%rbp),%rdi
call   10b0 <nvram_get_system_mode@plt>
mov    $0x6,%eax
cmp    -0x1f4(%rbp),%eax
je     129d <vap_already_in_bridge+0xbd>
mov    $0x7,%eax
cmp    -0x1f4(%rbp),%eax
jne    12ca <vap_already_in_bridge+0xea>
lea    -0x1f0(%rbp),%rax
mov    %rax,-0x208(%rbp)
lea    0xd5a(%rip),%rdi
call   1100 <nvram_get@plt>
mov    -0x208(%rbp),%rdi
mov    %eax,%esi
call   1030 <strcpy@plt>
jmp    12f2 <vap_already_in_bridge+0x112>
lea    -0x1f0(%rbp),%rax
mov    %rax,-0x210(%rbp)
lea    0xd21(%rip),%rdi
call   1100 <nvram_get@plt>
mov    -0x210(%rbp),%rdi
mov    %eax,%esi
call   1030 <strcpy@plt>
jmp    12f7 <vap_already_in_bridge+0x117>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <construct_vap@plt>
lea    -0xb0(%rbp),%rdi
lea    -0x1f0(%rbp),%rdx
lea    -0x30(%rbp),%rcx
lea    0xcf6(%rip),%rsi
call   10f0 <sprintf@plt>
lea    0xd18(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0xb0(%rbp),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xd07(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xd16(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0xb0(%rbp),%rdi
call   1060 <system@plt>
lea    0xcc3(%rip),%rdi
lea    0xcdd(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0xb8(%rbp)
mov    -0xb8(%rbp),%rdi
call   10a0 <fgetc@plt>
mov    %al,-0x1c1(%rbp)
movsbl %al,%eax
mov    0x2c47(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1468 <vap_already_in_bridge+0x288>
mov    -0x1c1(%rbp),%al
mov    -0xb8(%rbp),%rsi
movsbl %al,%edi
call   10c0 <ungetc@plt>
lea    -0x1c0(%rbp),%rdi
mov    -0xb8(%rbp),%rsi
call   1090 <readline@plt>
lea    -0x1c0(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   10d0 <find_pattern_from_str@plt>
cmp    $0x0,%rax
jne    1463 <vap_already_in_bridge+0x283>
lea    -0x30(%rbp),%rsi
lea    -0x1f0(%rbp),%rdx
lea    0xc58(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0xb8(%rbp),%rdi
call   1050 <fclose@plt>
lea    0xc2c(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xc48(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xc1b(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xc2a(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xc1e(%rip),%rdi
call   1060 <system@plt>
movl   $0x1,-0x4(%rbp)
jmp    14d8 <vap_already_in_bridge+0x2f8>
jmp    1385 <vap_already_in_bridge+0x1a5>
lea    -0x30(%rbp),%rsi
lea    -0x1f0(%rbp),%rdx
lea    0xc0d(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0xb8(%rbp),%rdi
call   1050 <fclose@plt>
lea    0xbb2(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xbce(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xba1(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xbb0(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xba4(%rip),%rdi
call   1060 <system@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vap_already_in_bridge>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1d8,%rsp
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%r15d
xorps  %xmm0,%xmm0
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x1a0(%rsp)
movaps %xmm0,0x190(%rsp)
movaps %xmm0,0x180(%rsp)
movaps %xmm0,0x170(%rsp)
movaps %xmm0,0x160(%rsp)
movaps %xmm0,0x150(%rsp)
movaps %xmm0,0x140(%rsp)
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0xffffffff,0xc(%rsp)
ff
test   %edx,%edx
je     12e2 <vap_already_in_bridge+0x102>
lea    0xc(%rsp),%rdi
call   10b0 <nvram_get_system_mode@plt>
mov    0xc(%rsp),%eax
and    $0xfffffffe,%eax
cmp    $0x6,%eax
jne    12e2 <vap_already_in_bridge+0x102>
lea    0xd2c(%rip),%rdi
jmp    12e9 <vap_already_in_bridge+0x109>
lea    0xd17(%rip),%rdi
call   1100 <nvram_get@plt>
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    %eax,%esi
call   1040 <strcpy@plt>
lea    0x1b0(%rsp),%r12
mov    %r12,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %ebx,%ecx
call   1050 <construct_vap@plt>
lea    0xcfc(%rip),%rsi
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    %rbp,%rdx
mov    %r12,%rcx
call   10f0 <sprintf@plt>
lea    0xd10(%rip),%rdi
xor    %r14d,%r14d
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xd00(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   1070 <system@plt>
lea    0xcc4(%rip),%rdi
lea    0xcde(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,%rbx
mov    0x2c61(%rip),%r13
lea    0xb0(%rsp),%rbp
lea    0xcc2(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   10a0 <fgetc@plt>
cmp    0x0(%r13),%al
je     13dc <vap_already_in_bridge+0x1fc>
movsbl %al,%edi
mov    %rbx,%rsi
call   10c0 <ungetc@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1090 <readline@plt>
mov    %rbp,%rdi
mov    %r12,%rsi
call   10d0 <find_pattern_from_str@plt>
test   %rax,%rax
jne    13a0 <vap_already_in_bridge+0x1c0>
mov    $0x1,%r14d
jmp    13e3 <vap_already_in_bridge+0x203>
lea    0xca4(%rip),%r15
lea    0x1b0(%rsp),%rsi
lea    0x10(%rsp),%rdx
mov    %r15,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbx,%rdi
call   1060 <fclose@plt>
lea    0xc3d(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xc59(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xc29(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   1070 <system@plt>
mov    %r14d,%eax
add    $0x1d8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"lan0_ifname\00"
@.str.1 = [12 x i8] c"wan0_device\00"
@.str.2 = [46 x i8] c"brctl show %s | grep -w %s > /tmp/bridge_info\00"
@.str.3 = [11 x i8] c"\1B[1;33;40m\00"
@.str.4 = [5 x i8] c"\1B[0m\00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [17 x i8] c"/tmp/bridge_info\00"
@.str.7 = [2 x i8] c"r\00"
@EOF = global i8 0
@.str.8 = [24 x i8] c"vap %s is in bridge %s\0A\00"
@.str.9 = [23 x i8] c"rm -f /tmp/bridge_info\00"
@.str.10 = [32 x i8] c"vap %s is not in bridge %s now\0A\00"
define i32 @vap_already_in_bridge(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [32 x i8]
%9 = alloca [128 x i8]
%10 = alloca i32*
%11 = alloca [256 x i8]
%12 = alloca i8
%13 = alloca [32 x i8]
%14 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%15 = bitcast [128 x i8]* %9 to i8*
%16 = bitcast [256 x i8]* %11 to i8*
%17 = bitcast [32 x i8]* %13 to i8*
store i32 -1, i32* %14
%18 = load i32, i32* %7
%19 = icmp eq i32 0, %18
br i1 %19, label %20, label %24
20: ; preds = %3
%21 = getelementptr inbounds [32 x i8], [32 x i8]* %13, i64 0, i64 0
%22 = call i32 @nvram_get(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%23 = call i32 @strcpy(i8* %21, i32 %22)
br label %40
24: ; preds = %3
%25 = call i32 @nvram_get_system_mode(i32* %14)
%26 = load i32, i32* %14
%27 = icmp eq i32 6, %26
br i1 %27, label %31, label %28
28: ; preds = %24
%29 = load i32, i32* %14
%30 = icmp eq i32 7, %29
br i1 %30, label %31, label %35
31: ; preds = %28, %24
%32 = getelementptr inbounds [32 x i8], [32 x i8]* %13, i64 0, i64 0
%33 = call i32 @nvram_get(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%34 = call i32 @strcpy(i8* %32, i32 %33)
br label %39
35: ; preds = %28
%36 = getelementptr inbounds [32 x i8], [32 x i8]* %13, i64 0, i64 0
%37 = call i32 @nvram_get(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%38 = call i32 @strcpy(i8* %36, i32 %37)
br label %39
39: ; preds = %35, %31
br label %40
40: ; preds = %39, %20
%41 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 0
%42 = load i32, i32* %5
%43 = load i32, i32* %6
%44 = load i32, i32* %7
%45 = call i32 @construct_vap(i8* %41, i32 %42, i32 %43, i32 %44)
%46 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%47 = getelementptr inbounds [32 x i8], [32 x i8]* %13, i64 0, i64 0
%48 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 0
%49 = call i32 @sprintf(i8* %46, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0), i8* %47, i8* %48)
br label %50
50: ; preds = %40
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%52 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%53 = call i32 (i8*, ...) @printf(i8* %52)
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%56 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%57 = call i32 @system(i8* %56)
br label %58
58: ; preds = %50
%59 = call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %59, i32** %10
br label %60
60: ; preds = %91, %58
%61 = load i32*, i32** %10
%62 = call signext i8 @fgetc(i32* %61)
store i8 %62, i8* %12
%63 = sext i8 %62 to i32
%64 = load i8, i8* @EOF
%65 = sext i8 %64 to i32
%66 = icmp ne i32 %63, %65
br i1 %66, label %67, label %92
67: ; preds = %60
%68 = load i8, i8* %12
%69 = load i32*, i32** %10
%70 = call i32 @ungetc(i8 signext %68, i32* %69)
%71 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%72 = load i32*, i32** %10
%73 = call i32 @readline(i8* %71, i32* %72)
%74 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%75 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 0
%76 = call i64 @find_pattern_from_str(i8* %74, i8* %75)
%77 = icmp eq i64 %76, 0
br i1 %77, label %78, label %91
78: ; preds = %67
%79 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 0
%80 = getelementptr inbounds [32 x i8], [32 x i8]* %13, i64 0, i64 0
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0), i8* %79, i8* %80)
%82 = load i32*, i32** %10
%83 = call i32 @fclose(i32* %82)
br label %84
84: ; preds = %78
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0))
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%89 = call i32 @system(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0))
br label %90
90: ; preds = %84
store i32 1, i32* %4
br label %105
91: ; preds = %67
br label %60
92: ; preds = %60
%93 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 0
%94 = getelementptr inbounds [32 x i8], [32 x i8]* %13, i64 0, i64 0
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0), i8* %93, i8* %94)
%96 = load i32*, i32** %10
%97 = call i32 @fclose(i32* %96)
br label %98
98: ; preds = %92
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0))
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%103 = call i32 @system(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0))
br label %104
104: ; preds = %98
store i32 0, i32* %4
br label %105
105: ; preds = %104, %90
%106 = load i32, i32* %4
ret i32 %106
}

LLVM IR (-O2):
@.str = [12 x i8] c"lan0_ifname\00"
@.str.1 = [12 x i8] c"wan0_device\00"
@.str.2 = [46 x i8] c"brctl show %s | grep -w %s > /tmp/bridge_info\00"
@.str.3 = [11 x i8] c"\1B[1;33;40m\00"
@.str.4 = [5 x i8] c"\1B[0m\00"
@.str.6 = [17 x i8] c"/tmp/bridge_info\00"
@.str.7 = [2 x i8] c"r\00"
@EOF = global i8 0
@.str.8 = [24 x i8] c"vap %s is in bridge %s\0A\00"
@.str.9 = [23 x i8] c"rm -f /tmp/bridge_info\00"
@.str.10 = [32 x i8] c"vap %s is not in bridge %s now\0A\00"
define i32 @vap_already_in_bridge(i32 %0, i32 %1, i32 %2) {
%4 = alloca [32 x i8]
%5 = alloca [128 x i8]
%6 = alloca [256 x i8]
%7 = alloca [32 x i8]
%8 = alloca i32
%9 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%12 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%13 = bitcast i32* %8 to i8*
store i32 -1, i32* %8
%14 = icmp eq i32 %2, 0
br i1 %14, label %15, label %17
15: ; preds = %3
%16 = tail call i32 @nvram_get(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %26
17: ; preds = %3
%18 = call i32 @nvram_get_system_mode(i32* %8)
%19 = load i32, i32* %8
%20 = and i32 %19, -2
%21 = icmp eq i32 %20, 6
br i1 %21, label %22, label %24
22: ; preds = %17
%23 = call i32 @nvram_get(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %26
24: ; preds = %17
%25 = call i32 @nvram_get(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %26
26: ; preds = %22, %24, %15
%27 = phi i32 [ %23, %22 ], [ %25, %24 ], [ %16, %15 ]
%28 = call i32 @strcpy(i8* %12, i32 %27)
%29 = call i32 @construct_vap(i8* %9, i32 %0, i32 %1, i32 %2)
%30 = call i32 @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0), i8* %12, i8* %9)
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%32 = call i32 (i8*, ...) @printf(i8* %10)
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%34 = call i32 @putchar(i32 10)
%35 = call i32 @system(i8* %10)
%36 = call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %37
37: ; preds = %41, %26
%38 = call signext i8 @fgetc(i32* %36)
%39 = load i8, i8* @EOF
%40 = icmp eq i8 %38, %39
br i1 %40, label %46, label %41
41: ; preds = %37
%42 = call i32 @ungetc(i8 signext %38, i32* %36)
%43 = call i32 @readline(i8* %11, i32* %36)
%44 = call i64 @find_pattern_from_str(i8* %11, i8* %9)
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %37
46: ; preds = %37, %41
%47 = phi i8* [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0), %41 ], [ getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0), %37 ]
%48 = phi i32 [ 1, %41 ], [ 0, %37 ]
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %47, i8* %9, i8* %12)
%50 = call i32 @fclose(i32* %36)
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0))
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%54 = call i32 @putchar(i32 10)
%55 = call i32 @system(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0))
ret i32 %48
}