#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 /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *);
int /*<<< orphan*/ system(char *);
void fakeAuth(char *bssid, char *mon, char *mac, int mode) {
  char cmd[256];
  if (mode == 1) {
    sprintf(cmd, "aireplay-ng -1 0 -a %s -h %s %s --ignore-negative-one", bssid,
            mac, mon);
  } else if (mode == 2) {
    sprintf(cmd,
            "xterm 2> /dev/null -T FakeAuth -e \"aireplay-ng -1 6000 -o 1 -q "
            "10 -a %s -h %s %s --ignore-negative-one\" &",
            bssid, mac, mon);
  }
  system(cmd);
}


x86 assembly (clang, -O0):
<fakeAuth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jne    1168 <fakeAuth+0x48>
lea    -0x120(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xea2(%rip),%rsi
call   1040 <sprintf@plt>
jmp    1196 <fakeAuth+0x76>
cmpl   $0x2,-0x1c(%rbp)
jne    1191 <fakeAuth+0x71>
lea    -0x120(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xeaa(%rip),%rsi
call   1040 <sprintf@plt>
jmp    1196 <fakeAuth+0x76>
lea    -0x120(%rbp),%rdi
call   1030 <system@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fakeAuth>:
sub    $0x108,%rsp
mov    %rdx,%rax
mov    %rsi,%r8
mov    %rdi,%rdx
cmp    $0x1,%ecx
je     1143 <fakeAuth+0x23>
cmp    $0x2,%ecx
jne    1155 <fakeAuth+0x35>
lea    0xef5(%rip),%rsi
jmp    114a <fakeAuth+0x2a>
lea    0xeb6(%rip),%rsi
mov    %rsp,%rdi
mov    %rax,%rcx
call   1040 <sprintf@plt>
mov    %rsp,%rdi
call   1030 <system@plt>
add    $0x108,%rsp
ret

LLVM IR (-O0):
@.str = [54 x i8] c"aireplay-ng -1 0 -a %s -h %s %s --ignore-negative-one\00"
@.str.1 = [106 x i8] c"xterm 2> /dev/null -T FakeAuth -e \22aireplay-ng -1 6000 -o 1 -q 10 -a %s -h %s %s --ignore-negative-one\22 &\00"
define void @fakeAuth(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca [256 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i32, i32* %8
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %18
12: ; preds = %4
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%14 = load i8*, i8** %5
%15 = load i8*, i8** %7
%16 = load i8*, i8** %6
%17 = call i32 @sprintf(i8* %13, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %14, i8* %15, i8* %16)
br label %28
18: ; preds = %4
%19 = load i32, i32* %8
%20 = icmp eq i32 %19, 2
br i1 %20, label %21, label %27
21: ; preds = %18
%22 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%23 = load i8*, i8** %5
%24 = load i8*, i8** %7
%25 = load i8*, i8** %6
%26 = call i32 @sprintf(i8* %22, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str.1, i64 0, i64 0), i8* %23, i8* %24, i8* %25)
br label %27
27: ; preds = %21, %18
br label %28
28: ; preds = %27, %12
%29 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%30 = call i32 @system(i8* %29)
ret void
}

LLVM IR (-O2):
@.str = [54 x i8] c"aireplay-ng -1 0 -a %s -h %s %s --ignore-negative-one\00"
@.str.1 = [106 x i8] c"xterm 2> /dev/null -T FakeAuth -e \22aireplay-ng -1 6000 -o 1 -q 10 -a %s -h %s %s --ignore-negative-one\22 &\00"
define void @fakeAuth(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca [256 x i8]
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
switch i32 %3, label %11 [
i32 1, label %8
i32 2, label %7
]
7: ; preds = %4
br label %8
8: ; preds = %4, %7
%9 = phi i8* [ getelementptr inbounds ([106 x i8], [106 x i8]* @.str.1, i64 0, i64 0), %7 ], [ getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), %4 ]
%10 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) %9, i8* %0, i8* %2, i8* %1)
br label %11
11: ; preds = %8, %4
%12 = call i32 @system(i8* %6)
ret void
}