#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*/ printf(char *, ...);
void usage(char *progname) {
  printf("%s detects and disrupts broadcast name resolution MiTM attacks\n",
         progname);
  printf("\t-i\tinterface to monitor (e.g. \"eth0\")\n");
  printf("\t-u\ttab delimited list of usernames and passwords\n");
  printf("\t-t\ttime in seconds between probes\n");
  printf("\t-p\taverage time in seconds between probes\n");
  printf("\t-d\tresponses to MiTM detectoin\n");
  printf("\t\tlog\tlogs the detection\n");
  printf("\t\thash\tsends credentials from the file -u file\n");
  printf("\t\tflood\tperform a resource exhaustion attack\n");
  printf("\t-s\tspecify a known spoofing server instead of detection\n");
  printf("\t-v\tverbose mode\n");
  printf("\n\nExamples:\n");
  printf("\t%s -d \"log hash\" -u ./usernames.txt -t 10 -i eth0\n", progname);
  printf("\tThis looks for MiTM servers ever 10 seconds. It also sends a fake "
         "hash from the \"usernames.txt\" file and logs the detection\n");
  printf("\t%s -d \"flood\" -s 10.0.0.23\n", progname);
  printf("\tThis floods the MiTM server at 10.0.0.23.\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf0b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf25(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf4a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfbf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfdf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x100b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x100f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0x100a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1030(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0x109c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x10ab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf55(%rip),%rdi
call   1030 <puts@plt>
lea    0xf70(%rip),%rdi
call   1030 <puts@plt>
lea    0xf96(%rip),%rdi
call   1030 <puts@plt>
lea    0xfad(%rip),%rdi
call   1030 <puts@plt>
lea    0xfcc(%rip),%rdi
call   1030 <puts@plt>
lea    0xfe0(%rip),%rdi
call   1030 <puts@plt>
lea    0xfed(%rip),%rdi
call   1030 <puts@plt>
lea    0x1010(%rip),%rdi
call   1030 <puts@plt>
lea    0x1031(%rip),%rdi
call   1030 <puts@plt>
lea    0x105e(%rip),%rdi
call   1030 <puts@plt>
lea    0x1063(%rip),%rdi
call   1030 <puts@plt>
lea    0xe80(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1052(%rip),%rdi
call   1030 <puts@plt>
lea    0xe97(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x10b2(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [64 x i8] c"%s detects and disrupts broadcast name resolution MiTM attacks\0A\00"
@.str.1 = [40 x i8] c"\09-i\09interface to monitor (e.g. \22eth0\22)\0A\00"
@.str.2 = [51 x i8] c"\09-u\09tab delimited list of usernames and passwords\0A\00"
@.str.3 = [36 x i8] c"\09-t\09time in seconds between probes\0A\00"
@.str.4 = [44 x i8] c"\09-p\09average time in seconds between probes\0A\00"
@.str.5 = [33 x i8] c"\09-d\09responses to MiTM detectoin\0A\00"
@.str.6 = [26 x i8] c"\09\09log\09logs the detection\0A\00"
@.str.7 = [48 x i8] c"\09\09hash\09sends credentials from the file -u file\0A\00"
@.str.8 = [46 x i8] c"\09\09flood\09perform a resource exhaustion attack\0A\00"
@.str.9 = [58 x i8] c"\09-s\09specify a known spoofing server instead of detection\0A\00"
@.str.10 = [18 x i8] c"\09-v\09verbose mode\0A\00"
@.str.11 = [13 x i8] c"\0A\0AExamples:\0A\00"
@.str.12 = [52 x i8] c"\09%s -d \22log hash\22 -u ./usernames.txt -t 10 -i eth0\0A\00"
@.str.13 = [126 x i8] c"\09This looks for MiTM servers ever 10 seconds. It also sends a fake hash from the \22usernames.txt\22 file and logs the detection\0A\00"
@.str.14 = [29 x i8] c"\09%s -d \22flood\22 -s 10.0.0.23\0A\00"
@.str.15 = [44 x i8] c"\09This floods the MiTM server at 10.0.0.23.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.8, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.9, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0))
%16 = load i8*, i8** %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.12, i64 0, i64 0), i8* %16)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.13, i64 0, i64 0))
%19 = load i8*, i8** %2
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.14, i64 0, i64 0), i8* %19)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.15, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [64 x i8] c"%s detects and disrupts broadcast name resolution MiTM attacks\0A\00"
@.str.12 = [52 x i8] c"\09%s -d \22log hash\22 -u ./usernames.txt -t 10 -i eth0\0A\00"
@.str.14 = [29 x i8] c"\09%s -d \22flood\22 -s 10.0.0.23\0A\00"
@str = [39 x i8] c"\09-i\09interface to monitor (e.g. \22eth0\22)\00"
@str.16 = [50 x i8] c"\09-u\09tab delimited list of usernames and passwords\00"
@str.17 = [35 x i8] c"\09-t\09time in seconds between probes\00"
@str.18 = [43 x i8] c"\09-p\09average time in seconds between probes\00"
@str.19 = [32 x i8] c"\09-d\09responses to MiTM detectoin\00"
@str.20 = [25 x i8] c"\09\09log\09logs the detection\00"
@str.21 = [47 x i8] c"\09\09hash\09sends credentials from the file -u file\00"
@str.22 = [45 x i8] c"\09\09flood\09perform a resource exhaustion attack\00"
@str.23 = [57 x i8] c"\09-s\09specify a known spoofing server instead of detection\00"
@str.24 = [17 x i8] c"\09-v\09verbose mode\00"
@str.25 = [12 x i8] c"\0A\0AExamples:\00"
@str.26 = [125 x i8] c"\09This looks for MiTM servers ever 10 seconds. It also sends a fake hash from the \22usernames.txt\22 file and logs the detection\00"
@str.27 = [43 x i8] c"\09This floods the MiTM server at 10.0.0.23.\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.16, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.17, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.18, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.19, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.20, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.21, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.22, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.23, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.24, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.25, i64 0, i64 0))
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.12, i64 0, i64 0), i8* %0)
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([125 x i8], [125 x i8]* @str.26, i64 0, i64 0))
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.14, i64 0, i64 0), i8* %0)
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.27, i64 0, i64 0))
ret void
}