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

/* Variables and functions */
int /*<<< orphan*/ iwpriv(char const *, char *, char const *);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *);
scalar_t__ strlen(char const *);
scalar_t__ strstr(char const *, char *);
int /*<<< orphan*/ system(char *);
void wifi_repeater_start(const char *ifname, const char *staname,
                         const char *channel, const char *ssid,
                         const char *bssid, const char *key, const char *enc,
                         const char *crypto) {
  char buf[100];
  int enctype = 0;
  iwpriv(ifname, "Channel", channel);
  iwpriv(staname, "ApCliEnable", "0");
  if ((strstr(enc, "WPA2PSK") || strstr(enc, "WPAPSKWPA2PSK")) && key) {
    enctype = 1;
    iwpriv(staname, "ApCliAuthMode", "WPA2PSK");
  } else if (strstr(enc, "WPAPSK") && key) {
    enctype = 1;
    iwpriv(staname, "ApCliAuthMode", "WPAPSK");
  } else if (strstr(enc, "WEP") && key) {
    iwpriv(staname, "ApCliAuthMode", "AUTOWEP");
    iwpriv(staname, "ApCliEncrypType", "WEP");
    iwpriv(staname, "ApCliDefaultKeyID", "1");
    iwpriv(staname, "ApCliKey1", key);
  } else if (!key || key[0] == '\0') {
    iwpriv(staname, "ApCliAuthMode", "NONE");
  } else {
    return;
  }
  if (enctype) {
    if (strstr(crypto, "AES") || strstr(crypto, "TKIPAES"))
      iwpriv(staname, "ApCliEncrypType", "AES");
    else
      iwpriv(staname, "ApCliEncrypType", "TKIP");
    iwpriv(staname, "ApCliWPAPSK", key);
  }
  if (bssid && strlen(bssid))
    iwpriv(staname, "ApCliBssid", bssid);
  else
    iwpriv(staname, "ApCliBssid", "");
  iwpriv(staname, "ApCliSsid", ssid);
  iwpriv(staname, "ApCliEnable", "1");
  snprintf(buf, (sizeof(buf) / sizeof(buf[0])) - 1, "ifconfig '%s' up",
           staname);
  system(buf);
}


x86 assembly (clang, -O0):
<wifi_repeater_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0xa4(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xe6c(%rip),%rsi
call   1060 <iwpriv@plt>
mov    -0x10(%rbp),%rdi
lea    0xe64(%rip),%rsi
lea    0xe69(%rip),%rdx
call   1060 <iwpriv@plt>
mov    0x10(%rbp),%rdi
lea    0xe61(%rip),%rsi
call   1070 <strstr@plt>
cmp    $0x0,%rax
jne    11e4 <wifi_repeater_start+0x94>
mov    0x10(%rbp),%rdi
lea    0xe41(%rip),%rsi
call   1070 <strstr@plt>
cmp    $0x0,%rax
je     1215 <wifi_repeater_start+0xc5>
cmpq   $0x0,-0x30(%rbp)
je     1215 <wifi_repeater_start+0xc5>
movl   $0x1,-0xa4(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe20(%rip),%rsi
lea    0xe11(%rip),%rdx
call   1060 <iwpriv@plt>
jmp    132e <wifi_repeater_start+0x1de>
mov    0x10(%rbp),%rdi
lea    0xe5d(%rip),%rsi
call   1070 <strstr@plt>
cmp    $0x0,%rax
je     1260 <wifi_repeater_start+0x110>
cmpq   $0x0,-0x30(%rbp)
je     1260 <wifi_repeater_start+0x110>
movl   $0x1,-0xa4(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xdd5(%rip),%rsi
lea    0xe27(%rip),%rdx
call   1060 <iwpriv@plt>
jmp    1329 <wifi_repeater_start+0x1d9>
mov    0x10(%rbp),%rdi
lea    0xdcb(%rip),%rsi
call   1070 <strstr@plt>
cmp    $0x0,%rax
je     12e3 <wifi_repeater_start+0x193>
cmpq   $0x0,-0x30(%rbp)
je     12e3 <wifi_repeater_start+0x193>
mov    -0x10(%rbp),%rdi
lea    0xd94(%rip),%rsi
lea    0xd9b(%rip),%rdx
call   1060 <iwpriv@plt>
mov    -0x10(%rbp),%rdi
lea    0xd93(%rip),%rsi
lea    0xd88(%rip),%rdx
call   1060 <iwpriv@plt>
mov    -0x10(%rbp),%rdi
lea    0xd8c(%rip),%rsi
lea    0xd9f(%rip),%rdx
call   1060 <iwpriv@plt>
mov    -0x10(%rbp),%rdi
mov    -0x30(%rbp),%rdx
lea    0xd83(%rip),%rsi
call   1060 <iwpriv@plt>
jmp    1324 <wifi_repeater_start+0x1d4>
cmpq   $0x0,-0x30(%rbp)
je     12fe <wifi_repeater_start+0x1ae>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    131a <wifi_repeater_start+0x1ca>
mov    -0x10(%rbp),%rdi
lea    0xd1b(%rip),%rsi
lea    0xd56(%rip),%rdx
call   1060 <iwpriv@plt>
jmp    131f <wifi_repeater_start+0x1cf>
jmp    1457 <wifi_repeater_start+0x307>
jmp    1324 <wifi_repeater_start+0x1d4>
jmp    1329 <wifi_repeater_start+0x1d9>
jmp    132e <wifi_repeater_start+0x1de>
cmpl   $0x0,-0xa4(%rbp)
je     13b6 <wifi_repeater_start+0x266>
mov    0x18(%rbp),%rdi
lea    0xd29(%rip),%rsi
call   1070 <strstr@plt>
cmp    $0x0,%rax
jne    136f <wifi_repeater_start+0x21f>
mov    0x18(%rbp),%rdi
lea    0xd0b(%rip),%rsi
call   1070 <strstr@plt>
cmp    $0x0,%rax
je     138b <wifi_repeater_start+0x23b>
mov    -0x10(%rbp),%rdi
lea    0xcc0(%rip),%rsi
lea    0xcee(%rip),%rdx
call   1060 <iwpriv@plt>
jmp    13a2 <wifi_repeater_start+0x252>
mov    -0x10(%rbp),%rdi
lea    0xca4(%rip),%rsi
lea    0xcd6(%rip),%rdx
call   1060 <iwpriv@plt>
mov    -0x10(%rbp),%rdi
mov    -0x30(%rbp),%rdx
lea    0xcc7(%rip),%rsi
call   1060 <iwpriv@plt>
cmpq   $0x0,-0x28(%rbp)
je     13ed <wifi_repeater_start+0x29d>
mov    -0x28(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
je     13ed <wifi_repeater_start+0x29d>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rdx
lea    0xca1(%rip),%rsi
call   1060 <iwpriv@plt>
jmp    1404 <wifi_repeater_start+0x2b4>
mov    -0x10(%rbp),%rdi
lea    0xc8c(%rip),%rsi
lea    0xc16(%rip),%rdx
call   1060 <iwpriv@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xc7c(%rip),%rsi
call   1060 <iwpriv@plt>
mov    -0x10(%rbp),%rdi
lea    0xbe5(%rip),%rsi
lea    0xc3a(%rip),%rdx
call   1060 <iwpriv@plt>
lea    -0xa0(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x63,%esi
lea    0xc53(%rip),%rdx
call   1050 <snprintf@plt>
lea    -0xa0(%rbp),%rdi
call   1040 <system@plt>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wifi_repeater_start>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %r9,%r12
mov    %r8,%r15
mov    %rcx,%r14
mov    %rsi,%rbx
mov    0xa0(%rsp),%r13
lea    0xe97(%rip),%rsi
call   1050 <iwpriv@plt>
lea    0xe93(%rip),%rsi
lea    0xe98(%rip),%rdx
mov    %rbx,%rdi
call   1050 <iwpriv@plt>
lea    0xe91(%rip),%rbp
mov    %r13,%rdi
mov    %rbp,%rsi
call   1060 <strstr@plt>
test   %rax,%rax
je     11a2 <wifi_repeater_start+0x62>
test   %r12,%r12
jne    11df <wifi_repeater_start+0x9f>
jmp    11bb <wifi_repeater_start+0x7b>
lea    0xe6d(%rip),%rsi
mov    %r13,%rdi
call   1060 <strstr@plt>
test   %r12,%r12
je     11bb <wifi_repeater_start+0x7b>
test   %rax,%rax
jne    11df <wifi_repeater_start+0x9f>
lea    0xebb(%rip),%rbp
mov    %r13,%rdi
mov    %rbp,%rsi
call   1060 <strstr@plt>
test   %r12,%r12
je     12e1 <wifi_repeater_start+0x1a1>
test   %rax,%rax
je     12e1 <wifi_repeater_start+0x1a1>
mov    0xa8(%rsp),%r13
lea    0xe36(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
call   1050 <iwpriv@plt>
lea    0xe6f(%rip),%rbp
mov    %r13,%rdi
mov    %rbp,%rsi
call   1060 <strstr@plt>
test   %rax,%rax
jne    1234 <wifi_repeater_start+0xf4>
lea    0xe54(%rip),%rsi
mov    %r13,%rdi
call   1060 <strstr@plt>
test   %rax,%rax
lea    0xe4a(%rip),%rax
lea    0xe3f(%rip),%rbp
cmove  %rax,%rbp
lea    0xdff(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
call   1050 <iwpriv@plt>
lea    0xe2b(%rip),%rsi
mov    %rbx,%rdi
mov    %r12,%rdx
call   1050 <iwpriv@plt>
test   %r15,%r15
je     1272 <wifi_repeater_start+0x132>
cmpb   $0x0,(%r15)
je     1272 <wifi_repeater_start+0x132>
lea    0xe1a(%rip),%rsi
mov    %rbx,%rdi
mov    %r15,%rdx
jmp    1283 <wifi_repeater_start+0x143>
lea    0xe0b(%rip),%rsi
lea    0xd95(%rip),%rdx
mov    %rbx,%rdi
call   1050 <iwpriv@plt>
lea    0xe00(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1050 <iwpriv@plt>
lea    0xd67(%rip),%rsi
lea    0xdbc(%rip),%rdx
mov    %rbx,%rdi
call   1050 <iwpriv@plt>
lea    0xde2(%rip),%rdx
mov    %rsp,%rbp
mov    %rbp,%rdi
mov    $0x63,%esi
mov    %rbx,%rcx
call   1040 <snprintf@plt>
mov    %rbp,%rdi
call   1030 <system@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd4e(%rip),%rsi
mov    %r13,%rdi
call   1060 <strstr@plt>
test   %r12,%r12
je     1348 <wifi_repeater_start+0x208>
test   %rax,%rax
je     1348 <wifi_repeater_start+0x208>
lea    0xd23(%rip),%rsi
lea    0xd2a(%rip),%rdx
mov    %rbx,%rdi
call   1050 <iwpriv@plt>
lea    0xd23(%rip),%rsi
lea    0xd18(%rip),%rdx
mov    %rbx,%rdi
call   1050 <iwpriv@plt>
lea    0xd1d(%rip),%rsi
lea    0xd30(%rip),%rdx
mov    %rbx,%rdi
call   1050 <iwpriv@plt>
lea    0xd19(%rip),%rsi
jmp    124d <wifi_repeater_start+0x10d>
test   %r12,%r12
je     1358 <wifi_repeater_start+0x218>
cmpb   $0x0,(%r12)
jne    12d2 <wifi_repeater_start+0x192>
lea    0xcc5(%rip),%rsi
lea    0xd00(%rip),%rdx
mov    %rbx,%rdi
jmp    1253 <wifi_repeater_start+0x113>

LLVM IR (-O0):
@.str = [8 x i8] c"Channel\00"
@.str.1 = [12 x i8] c"ApCliEnable\00"
@.str.2 = [2 x i8] c"0\00"
@.str.3 = [8 x i8] c"WPA2PSK\00"
@.str.4 = [14 x i8] c"WPAPSKWPA2PSK\00"
@.str.5 = [14 x i8] c"ApCliAuthMode\00"
@.str.6 = [7 x i8] c"WPAPSK\00"
@.str.7 = [4 x i8] c"WEP\00"
@.str.8 = [8 x i8] c"AUTOWEP\00"
@.str.9 = [16 x i8] c"ApCliEncrypType\00"
@.str.10 = [18 x i8] c"ApCliDefaultKeyID\00"
@.str.11 = [2 x i8] c"1\00"
@.str.12 = [10 x i8] c"ApCliKey1\00"
@.str.13 = [5 x i8] c"NONE\00"
@.str.14 = [4 x i8] c"AES\00"
@.str.15 = [8 x i8] c"TKIPAES\00"
@.str.16 = [5 x i8] c"TKIP\00"
@.str.17 = [12 x i8] c"ApCliWPAPSK\00"
@.str.18 = [11 x i8] c"ApCliBssid\00"
@.str.19 = [1 x i8] zeroinitializer
@.str.20 = [10 x i8] c"ApCliSsid\00"
@.str.21 = [17 x i8] c"ifconfig '%s' up\00"
define void @wifi_repeater_start(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6, i8* %7) {
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca [100 x i8]
%18 = alloca i32
store i8* %0, i8** %9
store i8* %1, i8** %10
store i8* %2, i8** %11
store i8* %3, i8** %12
store i8* %4, i8** %13
store i8* %5, i8** %14
store i8* %6, i8** %15
store i8* %7, i8** %16
store i32 0, i32* %18
%19 = load i8*, i8** %9
%20 = load i8*, i8** %11
%21 = call i32 @iwpriv(i8* %19, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %20)
%22 = load i8*, i8** %10
%23 = call i32 @iwpriv(i8* %22, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%24 = load i8*, i8** %15
%25 = call i64 @strstr(i8* %24, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%26 = icmp ne i64 %25, 0
br i1 %26, label %31, label %27
27: ; preds = %8
%28 = load i8*, i8** %15
%29 = call i64 @strstr(i8* %28, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
%30 = icmp ne i64 %29, 0
br i1 %30, label %31, label %37
31: ; preds = %27, %8
%32 = load i8*, i8** %14
%33 = icmp ne i8* %32, null
br i1 %33, label %34, label %37
34: ; preds = %31
store i32 1, i32* %18
%35 = load i8*, i8** %10
%36 = call i32 @iwpriv(i8* %35, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %80
37: ; preds = %31, %27
%38 = load i8*, i8** %15
%39 = call i64 @strstr(i8* %38, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%40 = icmp ne i64 %39, 0
br i1 %40, label %41, label %47
41: ; preds = %37
%42 = load i8*, i8** %14
%43 = icmp ne i8* %42, null
br i1 %43, label %44, label %47
44: ; preds = %41
store i32 1, i32* %18
%45 = load i8*, i8** %10
%46 = call i32 @iwpriv(i8* %45, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %79
47: ; preds = %41, %37
%48 = load i8*, i8** %15
%49 = call i64 @strstr(i8* %48, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%50 = icmp ne i64 %49, 0
br i1 %50, label %51, label %64
51: ; preds = %47
%52 = load i8*, i8** %14
%53 = icmp ne i8* %52, null
br i1 %53, label %54, label %64
54: ; preds = %51
%55 = load i8*, i8** %10
%56 = call i32 @iwpriv(i8* %55, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%57 = load i8*, i8** %10
%58 = call i32 @iwpriv(i8* %57, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%59 = load i8*, i8** %10
%60 = call i32 @iwpriv(i8* %59, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%61 = load i8*, i8** %10
%62 = load i8*, i8** %14
%63 = call i32 @iwpriv(i8* %61, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i8* %62)
br label %78
64: ; preds = %51, %47
%65 = load i8*, i8** %14
%66 = icmp ne i8* %65, null
br i1 %66, label %67, label %73
67: ; preds = %64
%68 = load i8*, i8** %14
%69 = getelementptr inbounds i8, i8* %68, i64 0
%70 = load i8, i8* %69
%71 = sext i8 %70 to i32
%72 = icmp eq i32 %71, 0
br i1 %72, label %73, label %76
73: ; preds = %67, %64
%74 = load i8*, i8** %10
%75 = call i32 @iwpriv(i8* %74, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
br label %77
76: ; preds = %67
br label %126
77: ; preds = %73
br label %78
78: ; preds = %77, %54
br label %79
79: ; preds = %78, %44
br label %80
80: ; preds = %79, %34
%81 = load i32, i32* %18
%82 = icmp ne i32 %81, 0
br i1 %82, label %83, label %101
83: ; preds = %80
%84 = load i8*, i8** %16
%85 = call i64 @strstr(i8* %84, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%86 = icmp ne i64 %85, 0
br i1 %86, label %91, label %87
87: ; preds = %83
%88 = load i8*, i8** %16
%89 = call i64 @strstr(i8* %88, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
%90 = icmp ne i64 %89, 0
br i1 %90, label %91, label %94
91: ; preds = %87, %83
%92 = load i8*, i8** %10
%93 = call i32 @iwpriv(i8* %92, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
br label %97
94: ; preds = %87
%95 = load i8*, i8** %10
%96 = call i32 @iwpriv(i8* %95, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0))
br label %97
97: ; preds = %94, %91
%98 = load i8*, i8** %10
%99 = load i8*, i8** %14
%100 = call i32 @iwpriv(i8* %98, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.17, i64 0, i64 0), i8* %99)
br label %101
101: ; preds = %97, %80
%102 = load i8*, i8** %13
%103 = icmp ne i8* %102, null
br i1 %103, label %104, label %112
104: ; preds = %101
%105 = load i8*, i8** %13
%106 = call i64 @strlen(i8* %105)
%107 = icmp ne i64 %106, 0
br i1 %107, label %108, label %112
108: ; preds = %104
%109 = load i8*, i8** %10
%110 = load i8*, i8** %13
%111 = call i32 @iwpriv(i8* %109, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.18, i64 0, i64 0), i8* %110)
br label %115
112: ; preds = %104, %101
%113 = load i8*, i8** %10
%114 = call i32 @iwpriv(i8* %113, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.19, i64 0, i64 0))
br label %115
115: ; preds = %112, %108
%116 = load i8*, i8** %10
%117 = load i8*, i8** %12
%118 = call i32 @iwpriv(i8* %116, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.20, i64 0, i64 0), i8* %117)
%119 = load i8*, i8** %10
%120 = call i32 @iwpriv(i8* %119, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%121 = getelementptr inbounds [100 x i8], [100 x i8]* %17, i64 0, i64 0
%122 = load i8*, i8** %10
%123 = call i32 @snprintf(i8* %121, i32 99, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.21, i64 0, i64 0), i8* %122)
%124 = getelementptr inbounds [100 x i8], [100 x i8]* %17, i64 0, i64 0
%125 = call i32 @system(i8* %124)
br label %126
126: ; preds = %115, %76
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"Channel\00"
@.str.1 = [12 x i8] c"ApCliEnable\00"
@.str.2 = [2 x i8] c"0\00"
@.str.3 = [8 x i8] c"WPA2PSK\00"
@.str.4 = [14 x i8] c"WPAPSKWPA2PSK\00"
@.str.5 = [14 x i8] c"ApCliAuthMode\00"
@.str.6 = [7 x i8] c"WPAPSK\00"
@.str.7 = [4 x i8] c"WEP\00"
@.str.8 = [8 x i8] c"AUTOWEP\00"
@.str.9 = [16 x i8] c"ApCliEncrypType\00"
@.str.10 = [18 x i8] c"ApCliDefaultKeyID\00"
@.str.11 = [2 x i8] c"1\00"
@.str.12 = [10 x i8] c"ApCliKey1\00"
@.str.13 = [5 x i8] c"NONE\00"
@.str.14 = [4 x i8] c"AES\00"
@.str.15 = [8 x i8] c"TKIPAES\00"
@.str.16 = [5 x i8] c"TKIP\00"
@.str.17 = [12 x i8] c"ApCliWPAPSK\00"
@.str.18 = [11 x i8] c"ApCliBssid\00"
@.str.19 = [1 x i8] zeroinitializer
@.str.20 = [10 x i8] c"ApCliSsid\00"
@.str.21 = [17 x i8] c"ifconfig '%s' up\00"
define void @wifi_repeater_start(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6, i8* %7) {
%9 = alloca [100 x i8]
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%11 = tail call i32 @iwpriv(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %2)
%12 = tail call i32 @iwpriv(i8* %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%13 = tail call i64 @strstr(i8* %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %8
%16 = tail call i64 @strstr(i8* %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
%17 = icmp ne i64 %16, 0
%18 = icmp ne i8* %5, null
%19 = and i1 %18, %17
br i1 %19, label %42, label %22
20: ; preds = %8
%21 = icmp eq i8* %5, null
br i1 %21, label %22, label %42
22: ; preds = %20, %15
%23 = tail call i64 @strstr(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%24 = icmp ne i64 %23, 0
%25 = icmp ne i8* %5, null
%26 = and i1 %25, %24
br i1 %26, label %42, label %27
27: ; preds = %22
%28 = tail call i64 @strstr(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%29 = icmp ne i64 %28, 0
%30 = and i1 %25, %29
br i1 %30, label %31, label %36
31: ; preds = %27
%32 = tail call i32 @iwpriv(i8* %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%33 = tail call i32 @iwpriv(i8* %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%34 = tail call i32 @iwpriv(i8* %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%35 = tail call i32 @iwpriv(i8* %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i8* %5)
br label %55
36: ; preds = %27
br i1 %25, label %37, label %40
37: ; preds = %36
%38 = load i8, i8* %5
%39 = icmp eq i8 %38, 0
br i1 %39, label %40, label %69
40: ; preds = %37, %36
%41 = tail call i32 @iwpriv(i8* %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
br label %55
42: ; preds = %22, %20, %15
%43 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), %15 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), %20 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), %22 ]
%44 = tail call i32 @iwpriv(i8* %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* %43)
%45 = tail call i64 @strstr(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %51
47: ; preds = %42
%48 = tail call i64 @strstr(i8* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
%50 = select i1 %49, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0)
br label %51
51: ; preds = %47, %42
%52 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), %42 ], [ %50, %47 ]
%53 = tail call i32 @iwpriv(i8* %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i8* %52)
%54 = tail call i32 @iwpriv(i8* %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.17, i64 0, i64 0), i8* %5)
br label %55
55: ; preds = %31, %40, %51
%56 = icmp eq i8* %4, null
br i1 %56, label %62, label %57
57: ; preds = %55
%58 = load i8, i8* %4
%59 = icmp eq i8 %58, 0
br i1 %59, label %62, label %60
60: ; preds = %57
%61 = tail call i32 @iwpriv(i8* %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.18, i64 0, i64 0), i8* %4)
br label %64
62: ; preds = %57, %55
%63 = tail call i32 @iwpriv(i8* %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.19, i64 0, i64 0))
br label %64
64: ; preds = %62, %60
%65 = tail call i32 @iwpriv(i8* %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.20, i64 0, i64 0), i8* %3)
%66 = tail call i32 @iwpriv(i8* %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%67 = call i32 @snprintf(i8* %10, i32 99, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.21, i64 0, i64 0), i8* %1)
%68 = call i32 @system(i8* %10)
br label %69
69: ; preds = %37, %64
ret void
}