#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*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int load_list();
int login();
int /*<<< orphan*/ printf(char *, char *);
int proccess_args(int, char **);
int /*<<< orphan*/ stderr;
int verify_values();
int main(int argc, char *argv[]) {
  if (argc == 1) {
    printf("%s[+]Usage: ./ftp_brute \n", "\x1B[32m");
    printf("Options:\n-p <port>\n-h <host>(IP and .com only)\n-d <delay "
           "between tries>\n-u <username>\n-pass <password file>\n%s",
           "\x1B[0m");
    goto bail;
  }
  if (proccess_args(argc, argv) == -1)
    goto bail;
  if (verify_values() == -1)
    goto bail;
  if (load_list() == -1)
    goto bail;
  if (login() == -1)
    goto bail;
  return 0;
bail:
  fprintf(stderr, "%s[+]Execution failed.%s\n", "\x1B[31m", "\x1B[0m");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    11ab <main+0x4b>
lea    0xe79(%rip),%rdi
lea    0xe8c(%rip),%rsi
call   1030 <printf@plt>
lea    0xe86(%rip),%rdi
lea    0xeee(%rip),%rsi
call   1030 <printf@plt>
jmp    1210 <main+0xb0>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1080 <proccess_args@plt>
cmp    $0xffffffff,%eax
jne    11c5 <main+0x65>
jmp    1210 <main+0xb0>
mov    $0x0,%al
call   1070 <verify_values@plt>
cmp    $0xffffffff,%eax
jne    11da <main+0x7a>
jmp    1210 <main+0xb0>
mov    $0x0,%al
call   1050 <load_list@plt>
cmp    $0xffffffff,%eax
jne    11ef <main+0x8f>
jmp    1210 <main+0xb0>
mov    $0x0,%al
call   1040 <login@plt>
cmp    $0xffffffff,%eax
jne    1204 <main+0xa4>
jmp    1210 <main+0xb0>
movl   $0x0,-0x4(%rbp)
jmp    123a <main+0xda>
mov    0x2dc9(%rip),%rax
mov    (%rax),%edi
lea    0xe74(%rip),%rsi
lea    0xe87(%rip),%rdx
lea    0xe61(%rip),%rcx
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x1,%edi
jne    118e <main+0x2e>
lea    0xe93(%rip),%rdi
lea    0xea6(%rip),%rsi
call   1030 <printf@plt>
lea    0xea0(%rip),%rdi
lea    0xf08(%rip),%rsi
call   1030 <printf@plt>
jmp    11be <main+0x5e>
call   1080 <proccess_args@plt>
cmp    $0xffffffff,%eax
je     11be <main+0x5e>
xor    %eax,%eax
call   1070 <verify_values@plt>
cmp    $0xffffffff,%eax
je     11be <main+0x5e>
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <load_list@plt>
cmp    $0xffffffff,%eax
je     11be <main+0x5e>
xor    %eax,%eax
call   1040 <login@plt>
cmp    $0xffffffff,%eax
jne    11e6 <main+0x86>
mov    0x2e1b(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
lea    0xed9(%rip),%rdx
lea    0xeb3(%rip),%rcx
call   1060 <fprintf@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"%s[+]Usage: ./ftp_brute \0A\00"
@.str.1 = [6 x i8] c"\1B[32m\00"
@.str.2 = [111 x i8] c"Options:\0A-p <port>\0A-h <host>(IP and .com only)\0A-d <delay between tries>\0A-u <username>\0A-pass <password file>\0A%s\00"
@.str.3 = [5 x i8] c"\1B[0m\00"
@stderr = global i32 0
@.str.4 = [26 x i8] c"%s[+]Execution failed.%s\0A\00"
@.str.5 = [6 x i8] c"\1B[31m\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %30
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i8**, i8*** %5
%14 = call i32 @proccess_args(i32 %12, i8** %13)
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %17
16: ; preds = %11
br label %30
17: ; preds = %11
%18 = call i32 (...) @verify_values()
%19 = icmp eq i32 %18, -1
br i1 %19, label %20, label %21
20: ; preds = %17
br label %30
21: ; preds = %17
%22 = call i32 (...) @load_list()
%23 = icmp eq i32 %22, -1
br i1 %23, label %24, label %25
24: ; preds = %21
br label %30
25: ; preds = %21
%26 = call i32 (...) @login()
%27 = icmp eq i32 %26, -1
br i1 %27, label %28, label %29
28: ; preds = %25
br label %30
29: ; preds = %25
store i32 0, i32* %3
br label %33
30: ; preds = %28, %24, %20, %16, %8
%31 = load i32, i32* @stderr
%32 = call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %33
33: ; preds = %30, %29
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
@.str = [26 x i8] c"%s[+]Usage: ./ftp_brute \0A\00"
@.str.1 = [6 x i8] c"\1B[32m\00"
@.str.2 = [111 x i8] c"Options:\0A-p <port>\0A-h <host>(IP and .com only)\0A-d <delay between tries>\0A-u <username>\0A-pass <password file>\0A%s\00"
@.str.3 = [5 x i8] c"\1B[0m\00"
@stderr = global i32 0
@.str.4 = [26 x i8] c"%s[+]Execution failed.%s\0A\00"
@.str.5 = [6 x i8] c"\1B[31m\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @printf(i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %19
7: ; preds = %2
%8 = tail call i32 @proccess_args(i32 %0, i8** %1)
%9 = icmp eq i32 %8, -1
br i1 %9, label %19, label %10
10: ; preds = %7
%11 = tail call i32 (...) @verify_values()
%12 = icmp eq i32 %11, -1
br i1 %12, label %19, label %13
13: ; preds = %10
%14 = tail call i32 (...) @load_list()
%15 = icmp eq i32 %14, -1
br i1 %15, label %19, label %16
16: ; preds = %13
%17 = tail call i32 (...) @login()
%18 = icmp eq i32 %17, -1
br i1 %18, label %19, label %22
19: ; preds = %16, %13, %10, %7, %4
%20 = load i32, i32* @stderr
%21 = tail call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %22
22: ; preds = %16, %19
%23 = phi i32 [ 1, %19 ], [ 0, %16 ]
ret i32 %23
}