#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 */
int /*<<< orphan*/ F_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
char checkDistro();
scalar_t__ errno;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
char *findWiface(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int fscanf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char setDistro(char *stdwlan, char *netwstart, char *netwstop, char *manag) {
  char id, *tmp;
  FILE *fp;
  errno = 0;
  id = checkDistro();
  if (access("/tmp/airnetw", F_OK) == 0 &&
      (fp = fopen("/tmp/airnetw", "r")) != NULL) {
    if (fscanf(fp, "%s", manag) != 1) {
      fprintf(stderr, "Warning: empty or wrong file \"%s\".\n", "/tmp/airnetw");
      strcpy(manag, "network-manager");
    }
    fclose(fp);
  } else if (access("/usr/sbin/NetworkManager", F_OK) == 0) {
    if (id == 'y' || id == 'a')
      strcpy(manag, "NetworkManager");
    else
      strcpy(manag, "network-manager");
  } else if (access("/usr/bin/wicd", F_OK) == 0)
    strcpy(manag, "wicd");
  else
    strcpy(manag, "network-manager");
  if (access("/usr/bin/systemctl", F_OK) == 0) {
    sprintf(netwstart, "systemctl start %s.service", manag);
    sprintf(netwstop, "systemctl stop %s.service", manag);
  } else if (access("/usr/bin/service", F_OK) == 0) {
    sprintf(netwstart, "service %s start", manag);
    sprintf(netwstop, "service %s stop", manag);
  }
  tmp = findWiface(1);
  if (tmp != NULL && strlen(tmp) > 0)
    sprintf(stdwlan, " %s ", tmp);
  else {
    if (id == 'u')
      strcpy(stdwlan, " wlan0 ");
    else if (id == 'y' || id == 'a')
      strcpy(stdwlan, " wlp2s0 ");
    else if (id == '0') {
      fprintf(stderr, "Warning: there may be misbehavior!\n");
      strcpy(stdwlan, " wlan0 ");
    }
  }
  return id;
}


x86 assembly (clang, -O0):
<setDistro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2e19(%rip),%rax
movq   $0x0,(%rax)
mov    $0x0,%al
call   1090 <checkDistro@plt>
mov    %al,-0x21(%rbp)
mov    0x2df1(%rip),%rax
mov    (%rax),%esi
lea    0xe20(%rip),%rdi
call   10a0 <access@plt>
cmp    $0x0,%rax
jne    1269 <setDistro+0xc9>
lea    0xe0a(%rip),%rdi
lea    0xe5e(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
je     1269 <setDistro+0xc9>
mov    -0x38(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xdee(%rip),%rsi
call   1060 <fscanf@plt>
cmp    $0x1,%eax
je     125b <setDistro+0xbb>
mov    0x2dac(%rip),%rax
mov    (%rax),%edi
lea    0xdd3(%rip),%rsi
lea    0xdbc(%rip),%rdx
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xdde(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x38(%rbp),%rdi
call   1040 <fclose@plt>
jmp    131a <setDistro+0x17a>
mov    0x2d58(%rip),%rax
mov    (%rax),%esi
lea    0xdcb(%rip),%rdi
call   10a0 <access@plt>
cmp    $0x0,%rax
jne    12cc <setDistro+0x12c>
movsbl -0x21(%rbp),%eax
cmp    $0x79,%eax
je     12a2 <setDistro+0x102>
movsbl -0x21(%rbp),%eax
cmp    $0x61,%eax
jne    12b7 <setDistro+0x117>
mov    -0x20(%rbp),%rdi
lea    0xda1(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12c7 <setDistro+0x127>
mov    -0x20(%rbp),%rdi
lea    0xd72(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1315 <setDistro+0x175>
mov    0x2cf5(%rip),%rax
mov    (%rax),%esi
lea    0xd81(%rip),%rdi
call   10a0 <access@plt>
cmp    $0x0,%rax
jne    1300 <setDistro+0x160>
mov    -0x20(%rbp),%rdi
lea    0xd70(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1310 <setDistro+0x170>
mov    -0x20(%rbp),%rdi
lea    0xd29(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1315 <setDistro+0x175>
jmp    131a <setDistro+0x17a>
mov    0x2ca7(%rip),%rax
mov    (%rax),%esi
lea    0xd41(%rip),%rdi
call   10a0 <access@plt>
cmp    $0x0,%rax
jne    1366 <setDistro+0x1c6>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xd36(%rip),%rsi
call   10c0 <sprintf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xd3d(%rip),%rsi
call   10c0 <sprintf@plt>
jmp    13b2 <setDistro+0x212>
mov    0x2c5b(%rip),%rax
mov    (%rax),%esi
lea    0xd3d(%rip),%rdi
call   10a0 <access@plt>
cmp    $0x0,%rax
jne    13ad <setDistro+0x20d>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xd30(%rip),%rsi
call   10c0 <sprintf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xd2d(%rip),%rsi
call   10c0 <sprintf@plt>
jmp    13b2 <setDistro+0x212>
mov    $0x1,%edi
call   1070 <findWiface@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     13f7 <setDistro+0x257>
mov    -0x30(%rbp),%rdi
call   1050 <strlen@plt>
cmp    $0x0,%rax
jle    13f7 <setDistro+0x257>
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%rdx
lea    0xcf8(%rip),%rsi
call   10c0 <sprintf@plt>
jmp    148b <setDistro+0x2eb>
movsbl -0x21(%rbp),%eax
cmp    $0x75,%eax
jne    1419 <setDistro+0x279>
mov    -0x8(%rbp),%rdi
lea    0xcdb(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1486 <setDistro+0x2e6>
movsbl -0x21(%rbp),%eax
cmp    $0x79,%eax
je     1433 <setDistro+0x293>
movsbl -0x21(%rbp),%eax
cmp    $0x61,%eax
jne    1448 <setDistro+0x2a8>
mov    -0x8(%rbp),%rdi
lea    0xcb4(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1481 <setDistro+0x2e1>
movsbl -0x21(%rbp),%eax
cmp    $0x30,%eax
jne    147c <setDistro+0x2dc>
mov    0x2b84(%rip),%rax
mov    (%rax),%edi
lea    0xc96(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xc73(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1481 <setDistro+0x2e1>
jmp    1486 <setDistro+0x2e6>
jmp    148b <setDistro+0x2eb>
movsbl -0x21(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setDistro>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,(%rsp)
mov    0x2e19(%rip),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
call   1090 <checkDistro@plt>
mov    %eax,%r13d
mov    0x2df1(%rip),%r14
mov    (%r14),%esi
lea    0xe1f(%rip),%rdi
call   10a0 <access@plt>
test   %rax,%rax
je     1227 <setDistro+0x87>
mov    (%r14),%esi
lea    0xe4f(%rip),%rdi
call   10a0 <access@plt>
test   %rax,%rax
je     1290 <setDistro+0xf0>
mov    (%r14),%esi
lea    0xe50(%rip),%rdi
call   10a0 <access@plt>
test   %rax,%rax
jne    12a5 <setDistro+0x105>
lea    0xe44(%rip),%rsi
jmp    12ac <setDistro+0x10c>
lea    0xdd2(%rip),%rdi
lea    0xe26(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     11eb <setDistro+0x4b>
mov    %rax,%rbp
lea    0xdc4(%rip),%rsi
mov    %rax,%rdi
mov    %rbx,%rdx
call   1060 <fscanf@plt>
cmp    $0x1,%eax
je     1286 <setDistro+0xe6>
mov    0x2d80(%rip),%rax
mov    (%rax),%edi
lea    0xda7(%rip),%rsi
lea    0xd90(%rip),%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0xdb6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbp,%rdi
call   1040 <fclose@plt>
jmp    12b4 <setDistro+0x114>
cmp    $0x79,%r13b
je     129c <setDistro+0xfc>
cmp    $0x61,%r13b
jne    12a5 <setDistro+0x105>
lea    0xdab(%rip),%rsi
jmp    12ac <setDistro+0x10c>
lea    0xd88(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    (%r14),%esi
lea    0xdad(%rip),%rdi
call   10a0 <access@plt>
test   %rax,%rax
je     12ec <setDistro+0x14c>
mov    (%r14),%esi
lea    0xde1(%rip),%rdi
call   10a0 <access@plt>
test   %rax,%rax
jne    1313 <setDistro+0x173>
lea    0xdf2(%rip),%rbp
lea    0xdda(%rip),%rsi
jmp    12fa <setDistro+0x15a>
lea    0xda6(%rip),%rbp
lea    0xd84(%rip),%rsi
mov    %r12,%rdi
mov    %rbx,%rdx
call   10c0 <sprintf@plt>
mov    %r15,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
call   10c0 <sprintf@plt>
mov    $0x1,%edi
call   1070 <findWiface@plt>
test   %rax,%rax
je     1347 <setDistro+0x1a7>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <strlen@plt>
test   %rax,%rax
jle    1347 <setDistro+0x1a7>
lea    0xdac(%rip),%rsi
mov    (%rsp),%rdi
mov    %rbx,%rdx
call   10c0 <sprintf@plt>
jmp    1399 <setDistro+0x1f9>
cmp    $0x74,%r13b
jg     135b <setDistro+0x1bb>
cmp    $0x30,%r13b
je     1372 <setDistro+0x1d2>
cmp    $0x61,%r13b
je     1369 <setDistro+0x1c9>
jmp    1399 <setDistro+0x1f9>
cmp    $0x79,%r13b
je     1369 <setDistro+0x1c9>
cmp    $0x75,%r13b
je     1389 <setDistro+0x1e9>
jmp    1399 <setDistro+0x1f9>
lea    0xd82(%rip),%rsi
jmp    1390 <setDistro+0x1f0>
mov    0x2c67(%rip),%rax
mov    (%rax),%edi
lea    0xd79(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0xd5a(%rip),%rsi
mov    (%rsp),%rdi
call   1030 <strcpy@plt>
mov    %r13d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@.str = [13 x i8] c"/tmp/airnetw\00"
@F_OK = global i32 0
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%s\00"
@stderr = global i32 0
@.str.3 = [36 x i8] c"Warning: empty or wrong file \22%s\22.\0A\00"
@.str.4 = [16 x i8] c"network-manager\00"
@.str.5 = [25 x i8] c"/usr/sbin/NetworkManager\00"
@.str.6 = [15 x i8] c"NetworkManager\00"
@.str.7 = [14 x i8] c"/usr/bin/wicd\00"
@.str.8 = [5 x i8] c"wicd\00"
@.str.9 = [19 x i8] c"/usr/bin/systemctl\00"
@.str.10 = [27 x i8] c"systemctl start %s.service\00"
@.str.11 = [26 x i8] c"systemctl stop %s.service\00"
@.str.12 = [17 x i8] c"/usr/bin/service\00"
@.str.13 = [17 x i8] c"service %s start\00"
@.str.14 = [16 x i8] c"service %s stop\00"
@.str.15 = [5 x i8] c" %s \00"
@.str.16 = [8 x i8] c" wlan0 \00"
@.str.17 = [9 x i8] c" wlp2s0 \00"
@.str.18 = [36 x i8] c"Warning: there may be misbehavior!\0A\00"
define signext i8 @setDistro(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8
%10 = alloca i8*
%11 = alloca i32*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
store i64 0, i64* @errno
%12 = call signext i8 (...) @checkDistro()
store i8 %12, i8* %9
%13 = load i32, i32* @F_OK
%14 = call i64 @access(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %32
16: ; preds = %4
%17 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %17, i32** %11
%18 = icmp ne i32* %17, null
br i1 %18, label %19, label %32
19: ; preds = %16
%20 = load i32*, i32** %11
%21 = load i8*, i8** %8
%22 = call i32 @fscanf(i32* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %21)
%23 = icmp ne i32 %22, 1
br i1 %23, label %24, label %29
24: ; preds = %19
%25 = load i32, i32* @stderr
%26 = call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%27 = load i8*, i8** %8
%28 = call i32 @strcpy(i8* %27, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
br label %29
29: ; preds = %24, %19
%30 = load i32*, i32** %11
%31 = call i32 @fclose(i32* %30)
br label %63
32: ; preds = %16, %4
%33 = load i32, i32* @F_OK
%34 = call i64 @access(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 %33)
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %51
36: ; preds = %32
%37 = load i8, i8* %9
%38 = sext i8 %37 to i32
%39 = icmp eq i32 %38, 121
br i1 %39, label %44, label %40
40: ; preds = %36
%41 = load i8, i8* %9
%42 = sext i8 %41 to i32
%43 = icmp eq i32 %42, 97
br i1 %43, label %44, label %47
44: ; preds = %40, %36
%45 = load i8*, i8** %8
%46 = call i32 @strcpy(i8* %45, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
br label %50
47: ; preds = %40
%48 = load i8*, i8** %8
%49 = call i32 @strcpy(i8* %48, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
br label %50
50: ; preds = %47, %44
br label %62
51: ; preds = %32
%52 = load i32, i32* @F_OK
%53 = call i64 @access(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 %52)
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %58
55: ; preds = %51
%56 = load i8*, i8** %8
%57 = call i32 @strcpy(i8* %56, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
br label %61
58: ; preds = %51
%59 = load i8*, i8** %8
%60 = call i32 @strcpy(i8* %59, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
br label %61
61: ; preds = %58, %55
br label %62
62: ; preds = %61, %50
br label %63
63: ; preds = %62, %29
%64 = load i32, i32* @F_OK
%65 = call i64 @access(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i32 %64)
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %74
67: ; preds = %63
%68 = load i8*, i8** %6
%69 = load i8*, i8** %8
%70 = call i32 @sprintf(i8* %68, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), i8* %69)
%71 = load i8*, i8** %7
%72 = load i8*, i8** %8
%73 = call i32 @sprintf(i8* %71, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0), i8* %72)
br label %86
74: ; preds = %63
%75 = load i32, i32* @F_OK
%76 = call i64 @access(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0), i32 %75)
%77 = icmp eq i64 %76, 0
br i1 %77, label %78, label %85
78: ; preds = %74
%79 = load i8*, i8** %6
%80 = load i8*, i8** %8
%81 = call i32 @sprintf(i8* %79, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.13, i64 0, i64 0), i8* %80)
%82 = load i8*, i8** %7
%83 = load i8*, i8** %8
%84 = call i32 @sprintf(i8* %82, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.14, i64 0, i64 0), i8* %83)
br label %85
85: ; preds = %78, %74
br label %86
86: ; preds = %85, %67
%87 = call i8* @findWiface(i32 1)
store i8* %87, i8** %10
%88 = load i8*, i8** %10
%89 = icmp ne i8* %88, null
br i1 %89, label %90, label %98
90: ; preds = %86
%91 = load i8*, i8** %10
%92 = call i64 @strlen(i8* %91)
%93 = icmp sgt i64 %92, 0
br i1 %93, label %94, label %98
94: ; preds = %90
%95 = load i8*, i8** %5
%96 = load i8*, i8** %10
%97 = call i32 @sprintf(i8* %95, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i8* %96)
br label %128
98: ; preds = %90, %86
%99 = load i8, i8* %9
%100 = sext i8 %99 to i32
%101 = icmp eq i32 %100, 117
br i1 %101, label %102, label %105
102: ; preds = %98
%103 = load i8*, i8** %5
%104 = call i32 @strcpy(i8* %103, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0))
br label %127
105: ; preds = %98
%106 = load i8, i8* %9
%107 = sext i8 %106 to i32
%108 = icmp eq i32 %107, 121
br i1 %108, label %113, label %109
109: ; preds = %105
%110 = load i8, i8* %9
%111 = sext i8 %110 to i32
%112 = icmp eq i32 %111, 97
br i1 %112, label %113, label %116
113: ; preds = %109, %105
%114 = load i8*, i8** %5
%115 = call i32 @strcpy(i8* %114, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0))
br label %126
116: ; preds = %109
%117 = load i8, i8* %9
%118 = sext i8 %117 to i32
%119 = icmp eq i32 %118, 48
br i1 %119, label %120, label %125
120: ; preds = %116
%121 = load i32, i32* @stderr
%122 = call i32 (i32, i8*, ...) @fprintf(i32 %121, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.18, i64 0, i64 0))
%123 = load i8*, i8** %5
%124 = call i32 @strcpy(i8* %123, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0))
br label %125
125: ; preds = %120, %116
br label %126
126: ; preds = %125, %113
br label %127
127: ; preds = %126, %102
br label %128
128: ; preds = %127, %94
%129 = load i8, i8* %9
ret i8 %129
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [13 x i8] c"/tmp/airnetw\00"
@F_OK = global i32 0
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%s\00"
@stderr = global i32 0
@.str.3 = [36 x i8] c"Warning: empty or wrong file \22%s\22.\0A\00"
@.str.4 = [16 x i8] c"network-manager\00"
@.str.5 = [25 x i8] c"/usr/sbin/NetworkManager\00"
@.str.6 = [15 x i8] c"NetworkManager\00"
@.str.7 = [14 x i8] c"/usr/bin/wicd\00"
@.str.8 = [5 x i8] c"wicd\00"
@.str.9 = [19 x i8] c"/usr/bin/systemctl\00"
@.str.10 = [27 x i8] c"systemctl start %s.service\00"
@.str.11 = [26 x i8] c"systemctl stop %s.service\00"
@.str.12 = [17 x i8] c"/usr/bin/service\00"
@.str.13 = [17 x i8] c"service %s start\00"
@.str.14 = [16 x i8] c"service %s stop\00"
@.str.15 = [5 x i8] c" %s \00"
@.str.16 = [8 x i8] c" wlan0 \00"
@.str.17 = [9 x i8] c" wlp2s0 \00"
@.str.18 = [36 x i8] c"Warning: there may be misbehavior!\0A\00"
define signext i8 @setDistro(i8* %0, i8* nocapture writeonly %1, i8* nocapture writeonly %2, i8* %3) {
store i64 0, i64* @errno
%5 = tail call signext i8 (...) @checkDistro()
%6 = load i32, i32* @F_OK
%7 = tail call i64 @access(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %21
9: ; preds = %4
%10 = tail call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i32* %10, null
br i1 %11, label %21, label %12
12: ; preds = %9
%13 = tail call i32 @fscanf(i32* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%14 = icmp eq i32 %13, 1
br i1 %14, label %19, label %15
15: ; preds = %12
%16 = load i32, i32* @stderr
%17 = tail call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%18 = tail call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
br label %19
19: ; preds = %15, %12
%20 = tail call i32 @fclose(i32* %10)
br label %38
21: ; preds = %9, %4
%22 = load i32, i32* @F_OK
%23 = tail call i64 @access(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 %22)
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %30
25: ; preds = %21
switch i8 %5, label %28 [
i8 121, label %26
i8 97, label %26
]
26: ; preds = %25, %25
%27 = tail call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
br label %38
28: ; preds = %25
%29 = tail call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
br label %38
30: ; preds = %21
%31 = load i32, i32* @F_OK
%32 = tail call i64 @access(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 %31)
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %30
%35 = tail call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
br label %38
36: ; preds = %30
%37 = tail call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
br label %38
38: ; preds = %28, %26, %36, %34, %19
%39 = load i32, i32* @F_OK
%40 = tail call i64 @access(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i32 %39)
%41 = icmp eq i64 %40, 0
br i1 %41, label %46, label %42
42: ; preds = %38
%43 = load i32, i32* @F_OK
%44 = tail call i64 @access(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0), i32 %43)
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %51
46: ; preds = %42, %38
%47 = phi i8* [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), %38 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.13, i64 0, i64 0), %42 ]
%48 = phi i8* [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0), %38 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.14, i64 0, i64 0), %42 ]
%49 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) %47, i8* %3)
%50 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) %48, i8* %3)
br label %51
51: ; preds = %46, %42
%52 = tail call i8* @findWiface(i32 1)
%53 = icmp eq i8* %52, null
br i1 %53, label %59, label %54
54: ; preds = %51
%55 = tail call i64 @strlen(i8* %52)
%56 = icmp sgt i64 %55, 0
br i1 %56, label %57, label %59
57: ; preds = %54
%58 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i8* %52)
br label %68
59: ; preds = %54, %51
switch i8 %5, label %68 [
i8 117, label %60
i8 121, label %62
i8 97, label %62
i8 48, label %64
]
60: ; preds = %59
%61 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0))
br label %68
62: ; preds = %59, %59
%63 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0))
br label %68
64: ; preds = %59
%65 = load i32, i32* @stderr
%66 = tail call i32 (i32, i8*, ...) @fprintf(i32 %65, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.18, i64 0, i64 0))
%67 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0))
br label %68
68: ; preds = %59, %60, %64, %62, %57
ret i8 %5
}