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

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
char checkDistro();
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
scalar_t__ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ sscanf(char *, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ system(char *);
char toupper(char);
int depInstall() {
  char c = '0', id = '0', buff[255];
  fprintf(stdout, "\nThe following dependencies are requested:\n"
                  "\t* build-essential\n"
                  "\t* libssl-dev/openssl-devel\n"
                  "\t* libnl-3-dev, libnl-genl-3-dev\n"
                  "\t* libpcap(-dev)\n"
                  "\t* libsqlite3(-dev)\n"
                  "\t* pkg-config\n"
                  "\t* xterm\n"
                  "\t* wget\n"
                  "\t* macchanger\n"
                  "Continue?  [Y-N]\n");
  if ((id = checkDistro()) == '0')
    return (EXIT_FAILURE);
  do {
    fgets(buff, 255 - 1, stdin);
    sscanf(buff, "%c", &c);
    c = toupper(c);
  } while (c != 'Y' && c != 'N' && fprintf(stdout, "Type only [Y-N]\n"));
  if (c == 'Y') {
    fprintf(stdout, "\nInstalling dependencies...\n\n");
    if (id == 'u')
      system("apt-get install build-essential libssl-dev libnl-3-dev "
             "libnl-genl-3-dev libpcap0.8 libpcap0.8-dev libsqlite3-0 "
             "libsqlite3-dev pkg-config xterm wget macchanger "
             "--install-suggests -y --force-yes");
    else if (id == 'y')
      system("yum install make automake gcc gcc-c++ kernel-devel openssl-devel "
             "libnl3-devel libpcap libpcap-devel libsqlite3x libsqlite3x-devel "
             "xterm wget macchanger -y");
    else if (id == 'a')
      system("pacman -S base-devel openssl libnl libpcap lib32-sqlite "
             "pkg-config xterm wget macchanger --noconfirm");
    else {
      fprintf(stderr, "ERROR\n");
      return (EXIT_FAILURE);
    }
  } else {
    fprintf(stdout, "Execution aborted.\n");
    return (EXIT_FAILURE);
  }
  fprintf(stdout, "\n");
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<depInstall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movb   $0x30,-0x5(%rbp)
movb   $0x30,-0x6(%rbp)
mov    0x2e4e(%rip),%rax
mov    (%rax),%edi
lea    0xe7d(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x0,%al
call   1080 <checkDistro@plt>
mov    %al,-0x6(%rbp)
movsbl %al,%eax
cmp    $0x30,%eax
jne    11af <depInstall+0x4f>
mov    0x2e2b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1343 <depInstall+0x1e3>
jmp    11b4 <depInstall+0x54>
lea    -0x110(%rbp),%rdi
mov    0x2e26(%rip),%rax
mov    (%rax),%edx
mov    $0xfe,%esi
call   1050 <fgets@plt>
lea    -0x110(%rbp),%rdi
lea    0xf03(%rip),%rsi
lea    -0x5(%rbp),%rdx
call   1070 <sscanf@plt>
movsbl -0x5(%rbp),%edi
call   1030 <toupper@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%ecx
xor    %eax,%eax
cmp    $0x59,%ecx
mov    %al,-0x111(%rbp)
je     123d <depInstall+0xdd>
movsbl -0x5(%rbp),%ecx
xor    %eax,%eax
cmp    $0x4e,%ecx
mov    %al,-0x111(%rbp)
je     123d <depInstall+0xdd>
mov    0x2da6(%rip),%rax
mov    (%rax),%edi
lea    0xeb7(%rip),%rsi
call   1060 <fprintf@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x111(%rbp)
mov    -0x111(%rbp),%al
test   $0x1,%al
jne    11b4 <depInstall+0x54>
movsbl -0x5(%rbp),%eax
cmp    $0x59,%eax
jne    12fc <depInstall+0x19c>
mov    0x2d69(%rip),%rax
mov    (%rax),%edi
lea    0xe8b(%rip),%rsi
call   1060 <fprintf@plt>
movsbl -0x6(%rbp),%eax
cmp    $0x75,%eax
jne    128b <depInstall+0x12b>
lea    0xe90(%rip),%rdi
call   1040 <system@plt>
jmp    12f7 <depInstall+0x197>
movsbl -0x6(%rbp),%eax
cmp    $0x79,%eax
jne    12a9 <depInstall+0x149>
lea    0xf33(%rip),%rdi
call   1040 <system@plt>
jmp    12f2 <depInstall+0x192>
movsbl -0x6(%rbp),%eax
cmp    $0x61,%eax
jne    12c7 <depInstall+0x167>
lea    0xfb0(%rip),%rdi
call   1040 <system@plt>
jmp    12ed <depInstall+0x18d>
mov    0x2d0a(%rip),%rax
mov    (%rax),%edi
lea    0xffb(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2ced(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1343 <depInstall+0x1e3>
jmp    12f2 <depInstall+0x192>
jmp    12f7 <depInstall+0x197>
jmp    1322 <depInstall+0x1c2>
mov    0x2cc5(%rip),%rax
mov    (%rax),%edi
lea    0xfcd(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2cb8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1343 <depInstall+0x1e3>
mov    0x2c9f(%rip),%rax
mov    (%rax),%edi
lea    0xddd(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2c82(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<depInstall>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
movb   $0x30,0xe(%rsp)
mov    0x2e4b(%rip),%r13
mov    0x0(%r13),%edi
lea    0xe78(%rip),%rsi
call   1060 <fprintf@plt>
xor    %eax,%eax
call   1080 <checkDistro@plt>
mov    0x2e35(%rip),%rcx
cmp    $0x30,%al
je     1287 <depInstall+0x127>
mov    %al,0xf(%rsp)
mov    0x2e3a(%rip),%r14
lea    0x10(%rsp),%rbx
lea    0xf25(%rip),%r15
lea    0xe(%rsp),%rbp
lea    0xf1c(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
mov    (%r14),%edx
mov    %rbx,%rdi
mov    $0xfe,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
call   1070 <sscanf@plt>
movsbl 0xe(%rsp),%edi
call   1030 <toupper@plt>
mov    %al,0xe(%rsp)
cmp    $0x4e,%al
je     1219 <depInstall+0xb9>
cmp    $0x59,%al
je     1219 <depInstall+0xb9>
mov    0x0(%r13),%edi
mov    %r12,%rsi
call   1060 <fprintf@plt>
test   %rax,%rax
jne    11d0 <depInstall+0x70>
mov    0xe(%rsp),%al
mov    0x0(%r13),%edi
cmp    $0x59,%al
jne    1246 <depInstall+0xe6>
lea    0xecb(%rip),%rsi
call   1060 <fprintf@plt>
mov    0xf(%rsp),%al
cmp    $0x61,%al
je     125b <depInstall+0xfb>
cmp    $0x75,%al
je     1264 <depInstall+0x104>
cmp    $0x79,%al
jne    129b <depInstall+0x13b>
lea    0xf8e(%rip),%rdi
jmp    126b <depInstall+0x10b>
lea    0x108c(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2d77(%rip),%rcx
jmp    1287 <depInstall+0x127>
lea    0x100b(%rip),%rdi
jmp    126b <depInstall+0x10b>
lea    0xea6(%rip),%rdi
call   1040 <system@plt>
mov    0x0(%r13),%edi
lea    0xe94(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2d39(%rip),%rcx
mov    (%rcx),%eax
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2d36(%rip),%rax
mov    (%rax),%edi
lea    0x1027(%rip),%rsi
jmp    124d <depInstall+0xed>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [223 x i8] c"\0AThe following dependencies are requested:\0A\09* build-essential\0A\09* libssl-dev/openssl-devel\0A\09* libnl-3-dev, libnl-genl-3-dev\0A\09* libpcap(-dev)\0A\09* libsqlite3(-dev)\0A\09* pkg-config\0A\09* xterm\0A\09* wget\0A\09* macchanger\0AContinue? [Y-N]\0A\00"
@EXIT_FAILURE = global i32 0
@stdin = global i32 0
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [17 x i8] c"Type only [Y-N]\0A\00"
@.str.3 = [30 x i8] c"\0AInstalling dependencies...\0A\0A\00"
@.str.4 = [193 x i8] c"apt-get install build-essential libssl-dev libnl-3-dev libnl-genl-3-dev libpcap0.8 libpcap0.8-dev libsqlite3-0 libsqlite3-dev pkg-config xterm wget macchanger --install-suggests -y --force-yes\00"
@.str.5 = [155 x i8] c"yum install make automake gcc gcc-c++ kernel-devel openssl-devel libnl3-devel libpcap libpcap-devel libsqlite3x libsqlite3x-devel xterm wget macchanger -y\00"
@.str.6 = [101 x i8] c"pacman -S base-devel openssl libnl libpcap lib32-sqlite pkg-config xterm wget macchanger --noconfirm\00"
@stderr = global i32 0
@.str.7 = [7 x i8] c"ERROR\0A\00"
@.str.8 = [20 x i8] c"Execution aborted.\0A\00"
@.str.9 = [2 x i8] c"\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @depInstall() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca [255 x i8]
store i8 48, i8* %2
store i8 48, i8* %3
%5 = load i32, i32* @stdout
%6 = call i64 @fprintf(i32 %5, i8* getelementptr inbounds ([223 x i8], [223 x i8]* @.str, i64 0, i64 0))
%7 = call signext i8 (...) @checkDistro()
store i8 %7, i8* %3
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 48
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = load i32, i32* @EXIT_FAILURE
store i32 %11, i32* %1
br label %74
12: ; preds = %0
br label %13
13: ; preds = %33, %12
%14 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%15 = load i32, i32* @stdin
%16 = call i32 @fgets(i8* %14, i32 254, i32 %15)
%17 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%18 = call i32 @sscanf(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%19 = load i8, i8* %2
%20 = call signext i8 @toupper(i8 signext %19)
store i8 %20, i8* %2
br label %21
21: ; preds = %13
%22 = load i8, i8* %2
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %23, 89
br i1 %24, label %25, label %33
25: ; preds = %21
%26 = load i8, i8* %2
%27 = sext i8 %26 to i32
%28 = icmp ne i32 %27, 78
br i1 %28, label %29, label %33
29: ; preds = %25
%30 = load i32, i32* @stdout
%31 = call i64 @fprintf(i32 %30, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%32 = icmp ne i64 %31, 0
br label %33
33: ; preds = %29, %25, %21
%34 = phi i1 [ false, %25 ], [ false, %21 ], [ %32, %29 ]
br i1 %34, label %13, label %35
35: ; preds = %33
%36 = load i8, i8* %2
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 89
br i1 %38, label %39, label %66
39: ; preds = %35
%40 = load i32, i32* @stdout
%41 = call i64 @fprintf(i32 %40, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%42 = load i8, i8* %3
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 117
br i1 %44, label %45, label %47
45: ; preds = %39
%46 = call i32 @system(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.4, i64 0, i64 0))
br label %65
47: ; preds = %39
%48 = load i8, i8* %3
%49 = sext i8 %48 to i32
%50 = icmp eq i32 %49, 121
br i1 %50, label %51, label %53
51: ; preds = %47
%52 = call i32 @system(i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str.5, i64 0, i64 0))
br label %64
53: ; preds = %47
%54 = load i8, i8* %3
%55 = sext i8 %54 to i32
%56 = icmp eq i32 %55, 97
br i1 %56, label %57, label %59
57: ; preds = %53
%58 = call i32 @system(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str.6, i64 0, i64 0))
br label %63
59: ; preds = %53
%60 = load i32, i32* @stderr
%61 = call i64 @fprintf(i32 %60, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%62 = load i32, i32* @EXIT_FAILURE
store i32 %62, i32* %1
br label %74
63: ; preds = %57
br label %64
64: ; preds = %63, %51
br label %65
65: ; preds = %64, %45
br label %70
66: ; preds = %35
%67 = load i32, i32* @stdout
%68 = call i64 @fprintf(i32 %67, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0))
%69 = load i32, i32* @EXIT_FAILURE
store i32 %69, i32* %1
br label %74
70: ; preds = %65
%71 = load i32, i32* @stdout
%72 = call i64 @fprintf(i32 %71, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%73 = load i32, i32* @EXIT_SUCCESS
store i32 %73, i32* %1
br label %74
74: ; preds = %70, %66, %59, %10
%75 = load i32, i32* %1
ret i32 %75
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [223 x i8] c"\0AThe following dependencies are requested:\0A\09* build-essential\0A\09* libssl-dev/openssl-devel\0A\09* libnl-3-dev, libnl-genl-3-dev\0A\09* libpcap(-dev)\0A\09* libsqlite3(-dev)\0A\09* pkg-config\0A\09* xterm\0A\09* wget\0A\09* macchanger\0AContinue? [Y-N]\0A\00"
@EXIT_FAILURE = global i32 0
@stdin = global i32 0
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [17 x i8] c"Type only [Y-N]\0A\00"
@.str.3 = [30 x i8] c"\0AInstalling dependencies...\0A\0A\00"
@.str.4 = [193 x i8] c"apt-get install build-essential libssl-dev libnl-3-dev libnl-genl-3-dev libpcap0.8 libpcap0.8-dev libsqlite3-0 libsqlite3-dev pkg-config xterm wget macchanger --install-suggests -y --force-yes\00"
@.str.5 = [155 x i8] c"yum install make automake gcc gcc-c++ kernel-devel openssl-devel libnl3-devel libpcap libpcap-devel libsqlite3x libsqlite3x-devel xterm wget macchanger -y\00"
@.str.6 = [101 x i8] c"pacman -S base-devel openssl libnl libpcap lib32-sqlite pkg-config xterm wget macchanger --noconfirm\00"
@stderr = global i32 0
@.str.7 = [7 x i8] c"ERROR\0A\00"
@.str.8 = [20 x i8] c"Execution aborted.\0A\00"
@.str.9 = [2 x i8] c"\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @depInstall() {
%1 = alloca i8
%2 = alloca [255 x i8]
store i8 48, i8* %1
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* @stdout
%5 = tail call i64 @fprintf(i32 %4, i8* getelementptr inbounds ([223 x i8], [223 x i8]* @.str, i64 0, i64 0))
%6 = tail call signext i8 (...) @checkDistro()
%7 = icmp eq i8 %6, 48
br i1 %7, label %38, label %8
8: ; preds = %0, %14
%9 = load i32, i32* @stdin
%10 = call i32 @fgets(i8* %3, i32 254, i32 %9)
%11 = call i32 @sscanf(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%12 = load i8, i8* %1
%13 = call signext i8 @toupper(i8 signext %12)
store i8 %13, i8* %1
switch i8 %13, label %14 [
i8 89, label %20
i8 78, label %20
]
14: ; preds = %8
%15 = load i32, i32* @stdout
%16 = call i64 @fprintf(i32 %15, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %8
18: ; preds = %14
%19 = load i8, i8* %1
br label %20
20: ; preds = %8, %8, %18
%21 = phi i8 [ %19, %18 ], [ %13, %8 ], [ %13, %8 ]
%22 = icmp eq i8 %21, 89
%23 = load i32, i32* @stdout
br i1 %22, label %24, label %31
24: ; preds = %20
%25 = call i64 @fprintf(i32 %23, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
switch i8 %6, label %28 [
i8 117, label %33
i8 121, label %26
i8 97, label %27
]
26: ; preds = %24
br label %33
27: ; preds = %24
br label %33
28: ; preds = %24
%29 = load i32, i32* @stderr
%30 = call i64 @fprintf(i32 %29, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
br label %38
31: ; preds = %20
%32 = call i64 @fprintf(i32 %23, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0))
br label %38
33: ; preds = %24, %27, %26
%34 = phi i8* [ getelementptr inbounds ([101 x i8], [101 x i8]* @.str.6, i64 0, i64 0), %27 ], [ getelementptr inbounds ([155 x i8], [155 x i8]* @.str.5, i64 0, i64 0), %26 ], [ getelementptr inbounds ([193 x i8], [193 x i8]* @.str.4, i64 0, i64 0), %24 ]
%35 = call i32 @system(i8* %34)
%36 = load i32, i32* @stdout
%37 = call i64 @fprintf(i32 %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
br label %38
38: ; preds = %0, %33, %31, %28
%39 = phi i32* [ @EXIT_SUCCESS, %33 ], [ @EXIT_FAILURE, %28 ], [ @EXIT_FAILURE, %31 ], [ @EXIT_FAILURE, %0 ]
%40 = load i32, i32* %39
ret i32 %40
}