#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*/ wireless_mode_get;
typedef int /*<<< orphan*/ tmpWMODE;
typedef int /*<<< orphan*/ tmpBSSID;
typedef int /*<<< orphan*/ cmd;
typedef int /*<<< orphan*/ bssid_get;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ format_bssid_upper(char *, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ get_sta_assoc_bssid(int, char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(char *, int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, ...);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strcpy_delspace(char *, char *);
int /*<<< orphan*/ system(char *);
int get_sta_assoc_wmode(int radio, char *wmode) {
  char cmd[128];
  char bssid[32], converted_bssid[32];
  FILE *fp;
  char *pBssidList = (char *)malloc(256 * sizeof(char));
  char tmpBSSID[28], tmpWMODE[16];
  char bssid_get[28], wireless_mode_get[16];
  get_sta_assoc_bssid(radio, bssid);
  sprintf(cmd, "iwpriv apclii0 set SiteSurvey=1");
  do {
    printf("\033[1;33;40m");
    printf(cmd);
    printf("\033[0m");
    printf("\n");
    system(cmd);
  } while (0);
  memset(cmd, 0, sizeof(cmd));
  format_bssid_upper(bssid, converted_bssid);
  sprintf(cmd,
          "iwpriv apclii0 get_site_survey | grep \"%s\" > "
          "/tmp/site_survey_middleware.dat",
          converted_bssid);
  do {
    printf("\033[1;33;40m");
    printf(cmd);
    printf("\033[0m");
    printf("\n");
    system(cmd);
  } while (0);
  memset(cmd, 0, sizeof(cmd));
  if (NULL == (fp = fopen("/tmp/site_survey_middleware.dat", "r"))) {
    printf("Ap list is NONE\n");
    free(pBssidList);
    return -1;
  } else {
    while (!feof(fp)) {
      memset(tmpBSSID, 0x00, sizeof(tmpBSSID));
      memset(tmpWMODE, 0x00, sizeof(tmpWMODE));
      memset(bssid_get, 0x00, sizeof(bssid_get));
      memset(wireless_mode_get, 0x00, sizeof(wireless_mode_get));
      fgets(pBssidList, 256, fp);
      snprintf(tmpBSSID, 19, "%s", pBssidList + 39);
      format_bssid_upper(tmpBSSID, bssid_get);
      snprintf(tmpWMODE, 9, "%s", pBssidList + 90);
      strcpy_delspace(tmpWMODE, wireless_mode_get);
      if (!strcmp(bssid, bssid_get)) {
        strcpy(wmode, wireless_mode_get);
        break;
      }
    }
  }
  free(pBssidList);
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<get_sta_assoc_wmode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x100,%edi
call   10f0 <malloc@plt>
mov    %rax,-0xe0(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xb0(%rbp),%rsi
call   1060 <get_sta_assoc_bssid@plt>
lea    -0x90(%rbp),%rdi
lea    0xdc0(%rip),%rsi
mov    $0x0,%al
call   1120 <sprintf@plt>
lea    0xdd2(%rip),%rdi
call   1090 <printf@plt>
lea    -0x90(%rbp),%rdi
call   1090 <printf@plt>
lea    0xdc5(%rip),%rdi
call   1090 <printf@plt>
lea    0xe1c(%rip),%rdi
call   1090 <printf@plt>
lea    -0x90(%rbp),%rdi
call   1080 <system@plt>
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   10b0 <memset@plt>
lea    -0xb0(%rbp),%rdi
lea    -0xd0(%rbp),%rsi
call   1100 <format_bssid_upper@plt>
lea    -0x90(%rbp),%rdi
lea    -0xd0(%rbp),%rdx
lea    0xd72(%rip),%rsi
mov    $0x0,%al
call   1120 <sprintf@plt>
lea    0xd54(%rip),%rdi
call   1090 <printf@plt>
lea    -0x90(%rbp),%rdi
call   1090 <printf@plt>
lea    0xd47(%rip),%rdi
call   1090 <printf@plt>
lea    0xd9e(%rip),%rdi
call   1090 <printf@plt>
lea    -0x90(%rbp),%rdi
call   1080 <system@plt>
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   10b0 <memset@plt>
lea    0xd42(%rip),%rdi
lea    0xd5b(%rip),%rsi
call   1110 <fopen@plt>
mov    %rax,%rcx
mov    %rcx,-0xd8(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
jne    1360 <get_sta_assoc_wmode+0x160>
lea    0xd3c(%rip),%rdi
call   1090 <printf@plt>
mov    -0xe0(%rbp),%rdi
call   1030 <free@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14b0 <get_sta_assoc_wmode+0x2b0>
jmp    1365 <get_sta_assoc_wmode+0x165>
mov    -0xd8(%rbp),%rdi
call   10e0 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1386 <get_sta_assoc_wmode+0x186>
jmp    148c <get_sta_assoc_wmode+0x28c>
lea    -0x100(%rbp),%rdi
xor    %esi,%esi
mov    $0x1c,%edx
call   10b0 <memset@plt>
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   10b0 <memset@plt>
lea    -0x130(%rbp),%rdi
xor    %esi,%esi
mov    $0x1c,%edx
call   10b0 <memset@plt>
lea    -0x140(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   10b0 <memset@plt>
mov    -0xe0(%rbp),%rdi
mov    -0xd8(%rbp),%rdx
mov    $0x100,%esi
call   10c0 <fgets@plt>
lea    -0x100(%rbp),%rdi
mov    -0xe0(%rbp),%rcx
add    $0x27,%rcx
mov    $0x13,%esi
lea    0xc88(%rip),%rdx
call   10a0 <snprintf@plt>
lea    -0x100(%rbp),%rdi
lea    -0x130(%rbp),%rsi
call   1100 <format_bssid_upper@plt>
lea    -0x110(%rbp),%rdi
mov    -0xe0(%rbp),%rcx
add    $0x5a,%rcx
mov    $0x9,%esi
lea    0xc52(%rip),%rdx
call   10a0 <snprintf@plt>
lea    -0x110(%rbp),%rdi
lea    -0x140(%rbp),%rsi
call   1040 <strcpy_delspace@plt>
lea    -0xb0(%rbp),%rdi
lea    -0x130(%rbp),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%eax
jne    1487 <get_sta_assoc_wmode+0x287>
mov    -0x10(%rbp),%rdi
lea    -0x140(%rbp),%rsi
call   1050 <strcpy@plt>
jmp    148c <get_sta_assoc_wmode+0x28c>
jmp    1365 <get_sta_assoc_wmode+0x165>
jmp    1491 <get_sta_assoc_wmode+0x291>
mov    -0xe0(%rbp),%rdi
call   1030 <free@plt>
mov    -0xd8(%rbp),%rdi
call   1070 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sta_assoc_wmode>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x148,%rsp
mov    %rsi,0x8(%rsp)
mov    %edi,%ebx
mov    $0x100,%edi
call   1110 <malloc@plt>
mov    %rax,%r13
lea    0x40(%rsp),%r12
mov    %ebx,%edi
mov    %r12,%rsi
call   1070 <get_sta_assoc_bssid@plt>
movups 0xda5(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movups 0xda6(%rip),%xmm0
movaps %xmm0,0xd0(%rsp)
lea    0xda7(%rip),%r14
mov    %r14,%rdi
call   10b0 <printf@plt>
lea    0xc0(%rsp),%rbx
mov    %rbx,%rdi
call   10b0 <printf@plt>
lea    0xd93(%rip),%r15
mov    %r15,%rdi
call   10b0 <printf@plt>
mov    $0xa,%edi
call   1050 <putchar@plt>
mov    %rbx,%rdi
call   10a0 <system@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   10d0 <memset@plt>
lea    0xa0(%rsp),%rbp
mov    %r12,%rdi
mov    %rbp,%rsi
call   1120 <format_bssid_upper@plt>
lea    0xd55(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1140 <sprintf@plt>
mov    %r14,%rdi
call   10b0 <printf@plt>
mov    %rbx,%rdi
call   10b0 <printf@plt>
mov    %r15,%rdi
call   10b0 <printf@plt>
mov    $0xa,%edi
call   1050 <putchar@plt>
mov    %rbx,%rdi
call   10a0 <system@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   10d0 <memset@plt>
lea    0xd35(%rip),%rdi
lea    0xd4e(%rip),%rsi
call   1130 <fopen@plt>
test   %rax,%rax
je     1452 <get_sta_assoc_wmode+0x232>
mov    %rax,%rbx
lea    0x27(%r13),%rax
mov    %rax,0x18(%rsp)
mov    %r13,(%rsp)
add    $0x5a,%r13
mov    %r13,0x10(%rsp)
lea    0x80(%rsp),%rbp
lea    0x30(%rsp),%r14
lea    0x60(%rsp),%r15
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1100 <feof@plt>
test   %eax,%eax
jne    143d <get_sta_assoc_wmode+0x21d>
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x1c,%edx
call   10d0 <memset@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   10d0 <memset@plt>
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x1c,%edx
call   10d0 <memset@plt>
lea    0x20(%rsp),%r12
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   10d0 <memset@plt>
mov    (%rsp),%rdi
mov    $0x100,%esi
mov    %rbx,%rdx
call   10e0 <fgets@plt>
mov    %rbp,%rdi
mov    $0x13,%esi
lea    0xc9e(%rip),%r13
mov    %r13,%rdx
mov    0x18(%rsp),%rcx
call   10c0 <snprintf@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
call   1120 <format_bssid_upper@plt>
mov    %r14,%rdi
mov    $0x9,%esi
mov    %r13,%rdx
mov    0x10(%rsp),%rcx
call   10c0 <snprintf@plt>
mov    %r14,%rdi
mov    %r12,%rsi
call   1040 <strcpy_delspace@plt>
lea    0x40(%rsp),%rdi
mov    %r15,%rsi
call   10f0 <strcmp@plt>
test   %eax,%eax
jne    1370 <get_sta_assoc_wmode+0x150>
lea    0x20(%rsp),%rsi
mov    0x8(%rsp),%rdi
call   1060 <strcpy@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1090 <fclose@plt>
xor    %eax,%eax
jmp    146b <get_sta_assoc_wmode+0x24b>
lea    0xc29(%rip),%rdi
call   1080 <puts@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    $0xffffffff,%eax
add    $0x148,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"iwpriv apclii0 set SiteSurvey=1\00"
@.str.1 = [11 x i8] c"\1B[1;33;40m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [77 x i8] c"iwpriv apclii0 get_site_survey | grep \22%s\22 > /tmp/site_survey_middleware.dat\00"
@.str.5 = [32 x i8] c"/tmp/site_survey_middleware.dat\00"
@.str.6 = [2 x i8] c"r\00"
@.str.7 = [17 x i8] c"Ap list is NONE\0A\00"
@.str.8 = [3 x i8] c"%s\00"
define i32 @get_sta_assoc_wmode(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca [128 x i8]
%7 = alloca [32 x i8]
%8 = alloca [32 x i8]
%9 = alloca i32*
%10 = alloca i8*
%11 = alloca [28 x i8]
%12 = alloca [16 x i8]
%13 = alloca [28 x i8]
%14 = alloca [16 x i8]
store i32 %0, i32* %4
store i8* %1, i8** %5
%15 = call i64 @malloc(i32 256)
%16 = inttoptr i64 %15 to i8*
store i8* %16, i8** %10
%17 = load i32, i32* %4
%18 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%19 = call i32 @get_sta_assoc_bssid(i32 %17, i8* %18)
%20 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%21 = call i32 (i8*, i8*, ...) @sprintf(i8* %20, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %22
22: ; preds = %2
%23 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%24 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%25 = call i32 @printf(i8* %24)
%26 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%27 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%28 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%29 = call i32 @system(i8* %28)
br label %30
30: ; preds = %22
%31 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%32 = call i32 @memset(i8* %31, i32 0, i32 128)
%33 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%34 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 0
%35 = call i32 @format_bssid_upper(i8* %33, i8* %34)
%36 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%37 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 0
%38 = call i32 (i8*, i8*, ...) @sprintf(i8* %36, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.4, i64 0, i64 0), i8* %37)
br label %39
39: ; preds = %30
%40 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%41 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%42 = call i32 @printf(i8* %41)
%43 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%44 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%45 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%46 = call i32 @system(i8* %45)
br label %47
47: ; preds = %39
%48 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%49 = call i32 @memset(i8* %48, i32 0, i32 128)
%50 = call i32* @fopen(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32* %50, i32** %9
%51 = icmp eq i32* null, %50
br i1 %51, label %52, label %56
52: ; preds = %47
%53 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0))
%54 = load i8*, i8** %10
%55 = call i32 @free(i8* %54)
store i32 -1, i32* %3
br label %103
56: ; preds = %47
br label %57
57: ; preds = %96, %56
%58 = load i32*, i32** %9
%59 = call i32 @feof(i32* %58)
%60 = icmp ne i32 %59, 0
%61 = xor i1 %60, true
br i1 %61, label %62, label %97
62: ; preds = %57
%63 = getelementptr inbounds [28 x i8], [28 x i8]* %11, i64 0, i64 0
%64 = call i32 @memset(i8* %63, i32 0, i32 28)
%65 = getelementptr inbounds [16 x i8], [16 x i8]* %12, i64 0, i64 0
%66 = call i32 @memset(i8* %65, i32 0, i32 16)
%67 = getelementptr inbounds [28 x i8], [28 x i8]* %13, i64 0, i64 0
%68 = call i32 @memset(i8* %67, i32 0, i32 28)
%69 = getelementptr inbounds [16 x i8], [16 x i8]* %14, i64 0, i64 0
%70 = call i32 @memset(i8* %69, i32 0, i32 16)
%71 = load i8*, i8** %10
%72 = load i32*, i32** %9
%73 = call i32 @fgets(i8* %71, i32 256, i32* %72)
%74 = getelementptr inbounds [28 x i8], [28 x i8]* %11, i64 0, i64 0
%75 = load i8*, i8** %10
%76 = getelementptr inbounds i8, i8* %75, i64 39
%77 = call i32 @snprintf(i8* %74, i32 19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %76)
%78 = getelementptr inbounds [28 x i8], [28 x i8]* %11, i64 0, i64 0
%79 = getelementptr inbounds [28 x i8], [28 x i8]* %13, i64 0, i64 0
%80 = call i32 @format_bssid_upper(i8* %78, i8* %79)
%81 = getelementptr inbounds [16 x i8], [16 x i8]* %12, i64 0, i64 0
%82 = load i8*, i8** %10
%83 = getelementptr inbounds i8, i8* %82, i64 90
%84 = call i32 @snprintf(i8* %81, i32 9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %83)
%85 = getelementptr inbounds [16 x i8], [16 x i8]* %12, i64 0, i64 0
%86 = getelementptr inbounds [16 x i8], [16 x i8]* %14, i64 0, i64 0
%87 = call i32 @strcpy_delspace(i8* %85, i8* %86)
%88 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%89 = getelementptr inbounds [28 x i8], [28 x i8]* %13, i64 0, i64 0
%90 = call i32 @strcmp(i8* %88, i8* %89)
%91 = icmp ne i32 %90, 0
br i1 %91, label %96, label %92
92: ; preds = %62
%93 = load i8*, i8** %5
%94 = getelementptr inbounds [16 x i8], [16 x i8]* %14, i64 0, i64 0
%95 = call i32 @strcpy(i8* %93, i8* %94)
br label %97
96: ; preds = %62
br label %57
97: ; preds = %92, %57
br label %98
98: ; preds = %97
%99 = load i8*, i8** %10
%100 = call i32 @free(i8* %99)
%101 = load i32*, i32** %9
%102 = call i32 @fclose(i32* %101)
store i32 0, i32* %3
br label %103
103: ; preds = %98, %52
%104 = load i32, i32* %3
ret i32 %104
}

LLVM IR (-O2):
@.str = [32 x i8] c"iwpriv apclii0 set SiteSurvey=1\00"
@.str.1 = [11 x i8] c"\1B[1;33;40m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
@.str.4 = [77 x i8] c"iwpriv apclii0 get_site_survey | grep \22%s\22 > /tmp/site_survey_middleware.dat\00"
@.str.5 = [32 x i8] c"/tmp/site_survey_middleware.dat\00"
@.str.6 = [2 x i8] c"r\00"
@.str.8 = [3 x i8] c"%s\00"
@str = [16 x i8] c"Ap list is NONE\00"
define i32 @get_sta_assoc_wmode(i32 %0, i8* %1) {
%3 = alloca [128 x i8]
%4 = alloca [32 x i8]
%5 = alloca [32 x i8]
%6 = alloca [28 x i8]
%7 = alloca [16 x i8]
%8 = alloca [28 x i8]
%9 = alloca [16 x i8]
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%11 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%12 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%13 = tail call i64 @malloc(i32 256)
%14 = inttoptr i64 %13 to i8*
%15 = getelementptr inbounds [28 x i8], [28 x i8]* %6, i64 0, i64 0
%16 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%17 = getelementptr inbounds [28 x i8], [28 x i8]* %8, i64 0, i64 0
%18 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%19 = call i32 @get_sta_assoc_bssid(i32 %0, i8* %11)
%20 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%21 = call i32 @printf(i8* %10)
%22 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%23 = call i32 @putchar(i32 10)
%24 = call i32 @system(i8* %10)
%25 = call i32 @memset(i8* %10, i32 0, i32 128)
%26 = call i32 @format_bssid_upper(i8* %11, i8* %12)
%27 = call i32 (i8*, i8*, ...) @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @.str.4, i64 0, i64 0), i8* %12)
%28 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%29 = call i32 @printf(i8* %10)
%30 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%31 = call i32 @putchar(i32 10)
%32 = call i32 @system(i8* %10)
%33 = call i32 @memset(i8* %10, i32 0, i32 128)
%34 = call i32* @fopen(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%35 = icmp eq i32* %34, null
br i1 %35, label %39, label %36
36: ; preds = %2
%37 = getelementptr inbounds i8, i8* %14, i64 39
%38 = getelementptr inbounds i8, i8* %14, i64 90
br label %42
39: ; preds = %2
%40 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%41 = call i32 @free(i8* %14)
br label %62
42: ; preds = %36, %45
%43 = call i32 @feof(i32* %34)
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %59
45: ; preds = %42
%46 = call i32 @memset(i8* %15, i32 0, i32 28)
%47 = call i32 @memset(i8* %16, i32 0, i32 16)
%48 = call i32 @memset(i8* %17, i32 0, i32 28)
%49 = call i32 @memset(i8* %18, i32 0, i32 16)
%50 = call i32 @fgets(i8* %14, i32 256, i32* %34)
%51 = call i32 @snprintf(i8* %15, i32 19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %37)
%52 = call i32 @format_bssid_upper(i8* %15, i8* %17)
%53 = call i32 @snprintf(i8* %16, i32 9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %38)
%54 = call i32 @strcpy_delspace(i8* %16, i8* %18)
%55 = call i32 @strcmp(i8* %11, i8* %17)
%56 = icmp eq i32 %55, 0
br i1 %56, label %57, label %42
57: ; preds = %45
%58 = call i32 @strcpy(i8* %1, i8* %18)
br label %59
59: ; preds = %42, %57
%60 = call i32 @free(i8* %14)
%61 = call i32 @fclose(i32* %34)
br label %62
62: ; preds = %59, %39
%63 = phi i32 [ -1, %39 ], [ 0, %59 ]
ret i32 %63
}