// File: lmclaramunt[P]AES-Crypto/Main.cpp
// Function: main
int main(int argc, char* argv[]) {
    if(argc < 2) {
        help(argv[0]);
        return 1;
}

    string filePath = "", aesKeyPath = "", macKeyPath = "";
    int keyLength = 0;
    bool encrypt = false, decrypt = false, ofb = false, cbc = false;
    for(int i = 1; i < argc; i++) {
        string arg = argv[i];
        if(arg == "-h" || arg== "-help" ) {
            help(argv[0]);
            return 1;
        } else if(arg == "-e" || arg == "-encrypt") {
            encrypt = true;
        } else if(arg == "-d" || arg == "-decrypt") {
            decrypt = true;
        } else if(arg == "-ofb") {
            ofb = true;
        } else if(arg == "-cbc") {
            cbc = true;
        } else if(arg == "-b" || arg == "-bits") {
            if(i+1 < argc) {
                stringstream ss(argv[++i]);
                ss >> keyLength;
            } else {
                cerr<<"-b/bits option requires key length in bits (128/192/256)"<<endl;
                return 1;
            }
        } else if(arg == "-aes") {
            if(i+1 < argc) {
                aesKeyPath = argv[++i];
            } else {
                cerr<<"-aes option requires the path to the AES key"<<endl;
                return 1;
            }
        } else if(arg == "-mac") {
            if(i+1 < argc) {
                macKeyPath = argv[++i];
            } else {
                cerr<<"-mac option requires the path to the MAC key"<<endl;
                return 1;
            }
        } else if (arg == "-p" || arg == "-path") {
            if(i+1 < argc) {
                filePath = argv[++i];
            } else {
                cerr<<"-p/path option requires a path"<<endl;
                return 1;
            }
        }
    }

    try {
        Cipher* c;
        if(encrypt && !filePath.empty() && (ofb || cbc)) {
            if(!aesKeyPath.empty() && !macKeyPath.empty())
                if(keyLength > 0)
                    c = new Cipher(&filePath, &aesKeyPath, &macKeyPath, &keyLength, cbc, true);
                else
                    c = new Cipher(&filePath, &aesKeyPath, &macKeyPath, cbc, true);     //cbc bool determines if 
            else                                                                        //padding is needed
                c = new Cipher(&filePath, &keyLength, cbc, true);                       //true - since we're encrypting
            if(cbc) {
                c->CBC_encrypt();
            } else {
                c->OFB_encrypt();
            }            
        } else if(decrypt && !filePath.empty() && (ofb || cbc)) {
            if(!aesKeyPath.empty() && !macKeyPath.empty())
                if(keyLength > 0)
                    c = new Cipher(&filePath, &aesKeyPath, &macKeyPath, &keyLength, false, false);
                else
                   c = new Cipher(&filePath, &aesKeyPath, &macKeyPath, false, false);  //both bool to false since we are
            else                                                                       //decrypting and no padding is needed
                c = new Cipher(&filePath, &keyLength, false, false);
            if(cbc) {
                c->CBC_decrypt();
            } else {
                c->OFB_decrypt();
            }
        } else {
            cerr<<"Invalid parameters. Use -h/help for assistance if needed"<<endl;
            return 1;
        }
    } catch(const char* str) {
        cerr<<"Exception: "<<str<<endl;
        return 1;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3d0, %rsp            # imm = 0x3D0
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x8(%rbp)
jge 0x37c4
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x2e8(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x2e0(%rbp)
callq 0x34e0
movq -0x2e8(%rbp), %rsi
movq -0x2e0(%rbp), %rdx
leaq -0x30(%rbp), %rdi
callq 0x4670
jmp 0x376a
leaq -0x30(%rbp), %rdi
callq 0x4520
jmp 0x3775
leaq -0x30(%rbp), %rdi
callq 0x3180
leaq -0x31(%rbp), %rdi
callq 0x32c0
movl $0x1, -0x4(%rbp)
jmp 0x4505
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x37b6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3180
leaq -0x31(%rbp), %rdi
callq 0x32c0
jmp 0x4511
leaq -0x69(%rbp), %rdi
movq %rdi, -0x2f0(%rbp)
callq 0x34e0
movq -0x2f0(%rbp), %rdx
leaq 0xc024(%rip), %rsi      # 0xf806
leaq -0x68(%rbp), %rdi
callq 0x4670
jmp 0x37ed
leaq -0x69(%rbp), %rdi
callq 0x32c0
leaq -0x91(%rbp), %rdi
movq %rdi, -0x2f8(%rbp)
callq 0x34e0
movq -0x2f8(%rbp), %rdx
leaq 0xbfef(%rip), %rsi      # 0xf806
leaq -0x90(%rbp), %rdi
callq 0x4670
jmp 0x3825
leaq -0x91(%rbp), %rdi
callq 0x32c0
leaq -0xb9(%rbp), %rdi
movq %rdi, -0x300(%rbp)
callq 0x34e0
movq -0x300(%rbp), %rdx
leaq 0xbfb4(%rip), %rsi      # 0xf806
leaq -0xb8(%rbp), %rdi
callq 0x4670
jmp 0x3860
leaq -0xb9(%rbp), %rdi
callq 0x32c0
movl $0x0, -0xc0(%rbp)
movb $0x0, -0xc1(%rbp)
movb $0x0, -0xc2(%rbp)
movb $0x0, -0xc3(%rbp)
movb $0x0, -0xc4(%rbp)
movl $0x1, -0xc8(%rbp)
movl -0xc8(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x3fde
movq -0x10(%rbp), %rax
movslq -0xc8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x310(%rbp)
leaq -0xe9(%rbp), %rdi
movq %rdi, -0x308(%rbp)
callq 0x34e0
movq -0x310(%rbp), %rsi
movq -0x308(%rbp), %rdx
leaq -0xe8(%rbp), %rdi
callq 0x4670
jmp 0x38f0
leaq -0xe9(%rbp), %rdi
callq 0x32c0
leaq 0xb701(%rip), %rsi      # 0xf004
leaq -0xe8(%rbp), %rdi
callq 0x4720
movb %al, -0x311(%rbp)
jmp 0x3917
movb -0x311(%rbp), %al
testb $0x1, %al
jne 0x394d
jmp 0x3923
leaq 0xb6dd(%rip), %rsi      # 0xf007
leaq -0xe8(%rbp), %rdi
callq 0x4720
movb %al, -0x312(%rbp)
jmp 0x393e
movb -0x312(%rbp), %al
testb $0x1, %al
jne 0x394d
jmp 0x3a7f
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x328(%rbp)
leaq -0x111(%rbp), %rdi
movq %rdi, -0x320(%rbp)
callq 0x34e0
movq -0x328(%rbp), %rsi
movq -0x320(%rbp), %rdx
leaq -0x110(%rbp), %rdi
callq 0x4670
jmp 0x398a
leaq -0x110(%rbp), %rdi
callq 0x4520
jmp 0x3998
leaq -0x110(%rbp), %rdi
callq 0x3180
leaq -0x111(%rbp), %rdi
callq 0x32c0
movl $0x1, -0x4(%rbp)
movl $0x1, -0x118(%rbp)
jmp 0x3f9b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x69(%rbp), %rdi
callq 0x32c0
jmp 0x4511
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x91(%rbp), %rdi
callq 0x32c0
jmp 0x44fa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xb9(%rbp), %rdi
callq 0x32c0
jmp 0x44ee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xe9(%rbp), %rdi
callq 0x32c0
jmp 0x44e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3fcd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3a6e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x3180
leaq -0x111(%rbp), %rdi
callq 0x32c0
jmp 0x3fcd
leaq 0xb587(%rip), %rsi      # 0xf00d
leaq -0xe8(%rbp), %rdi
callq 0x4720
movb %al, -0x329(%rbp)
jmp 0x3a9a
movb -0x329(%rbp), %al
testb $0x1, %al
jne 0x3acd
jmp 0x3aa6
leaq 0xb563(%rip), %rsi      # 0xf010
leaq -0xe8(%rbp), %rdi
callq 0x4720
movb %al, -0x32a(%rbp)
jmp 0x3ac1
movb -0x32a(%rbp), %al
testb $0x1, %al
jne 0x3acd
jmp 0x3ad9
movb $0x1, -0xc1(%rbp)
jmp 0x3f8f
leaq 0xb539(%rip), %rsi      # 0xf019
leaq -0xe8(%rbp), %rdi
callq 0x4720
movb %al, -0x32b(%rbp)
jmp 0x3af4
movb -0x32b(%rbp), %al
testb $0x1, %al
jne 0x3b27
jmp 0x3b00
leaq 0xb515(%rip), %rsi      # 0xf01c
leaq -0xe8(%rbp), %rdi
callq 0x4720
movb %al, -0x32c(%rbp)
jmp 0x3b1b
movb -0x32c(%rbp), %al
testb $0x1, %al
jne 0x3b27
jmp 0x3b33
movb $0x1, -0xc2(%rbp)
jmp 0x3f8d
leaq 0xb4eb(%rip), %rsi      # 0xf025
leaq -0xe8(%rbp), %rdi
callq 0x4720
movb %al, -0x32d(%rbp)
jmp 0x3b4e
movb -0x32d(%rbp), %al
testb $0x1, %al
jne 0x3b5a
jmp 0x3b66
movb $0x1, -0xc3(%rbp)
jmp 0x3f8b
leaq 0xb4bd(%rip), %rsi      # 0xf02a
leaq -0xe8(%rbp), %rdi
callq 0x4720
movb %al, -0x32e(%rbp)
jmp 0x3b81
movb -0x32e(%rbp), %al
testb $0x1, %al
jne 0x3b8d
jmp 0x3b99
movb $0x1, -0xc4(%rbp)
jmp 0x3f89
leaq 0xb48f(%rip), %rsi      # 0xf02f
leaq -0xe8(%rbp), %rdi
callq 0x4720
movb %al, -0x32f(%rbp)
jmp 0x3bb4
movb -0x32f(%rbp), %al
testb $0x1, %al
jne 0x3bea
jmp 0x3bc0
leaq 0xb46b(%rip), %rsi      # 0xf032
leaq -0xe8(%rbp), %rdi
callq 0x4720
movb %al, -0x330(%rbp)
jmp 0x3bdb
movb -0x330(%rbp), %al
testb $0x1, %al
jne 0x3bea
jmp 0x3d5c
movl -0xc8(%rbp), %eax
addl $0x1, %eax
cmpl -0x8(%rbp), %eax
jge 0x3d10
movq -0x10(%rbp), %rax
movslq -0xc8(%rbp), %rcx
movl %ecx, %edx
incl %edx
movl %edx, -0xc8(%rbp)
movq 0x8(%rax,%rcx,8), %rax
movq %rax, -0x340(%rbp)
leaq -0x2c1(%rbp), %rdi
movq %rdi, -0x338(%rbp)
callq 0x34e0
movq -0x340(%rbp), %rsi
movq -0x338(%rbp), %rdx
leaq -0x2c0(%rbp), %rdi
callq 0x4670
jmp 0x3c4c
movl $0x10, %edi
movl $0x8, %esi
callq 0x4750
movl %eax, -0x344(%rbp)
jmp 0x3c63
movl -0x344(%rbp), %edx
leaq -0x2a0(%rbp), %rdi
leaq -0x2c0(%rbp), %rsi
callq 0x3410
jmp 0x3c7e
leaq -0x2c0(%rbp), %rdi
callq 0x3180
leaq -0x2c1(%rbp), %rdi
callq 0x32c0
leaq -0x2a0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x3170
jmp 0x3cab
leaq -0x2a0(%rbp), %rdi
callq 0x31c0
jmp 0x3d57
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3ce2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x2c0(%rbp), %rdi
callq 0x3180
leaq -0x2c1(%rbp), %rdi
callq 0x32c0
jmp 0x3fcd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x2a0(%rbp), %rdi
callq 0x31c0
jmp 0x3fcd
movq 0x122d9(%rip), %rdi     # 0x15ff0
leaq 0xb31a(%rip), %rsi      # 0xf038
callq 0x3270
movq %rax, -0x350(%rbp)
jmp 0x3d2c
movq -0x350(%rbp), %rdi
movq 0x1227e(%rip), %rsi     # 0x15fb8
callq 0x32a0
jmp 0x3d41
movl $0x1, -0x4(%rbp)
movl $0x1, -0x118(%rbp)
jmp 0x3f9b
jmp 0x3f87
leaq 0xb30e(%rip), %rsi      # 0xf071
leaq -0xe8(%rbp), %rdi
callq 0x4720
movb %al, -0x351(%rbp)
jmp 0x3d77
movb -0x351(%rbp), %al
testb $0x1, %al
jne 0x3d86
jmp 0x3e0a
movl -0xc8(%rbp), %eax
addl $0x1, %eax
cmpl -0x8(%rbp), %eax
jge 0x3dbe
movq -0x10(%rbp), %rax
movslq -0xc8(%rbp), %rcx
movl %ecx, %edx
incl %edx
movl %edx, -0xc8(%rbp)
movq 0x8(%rax,%rcx,8), %rsi
leaq -0x90(%rbp), %rdi
callq 0x3380
jmp 0x3dbc
jmp 0x3e05
movq 0x1222b(%rip), %rdi     # 0x15ff0
leaq 0xb2aa(%rip), %rsi      # 0xf076
callq 0x3270
movq %rax, -0x360(%rbp)
jmp 0x3dda
movq -0x360(%rbp), %rdi
movq 0x121d0(%rip), %rsi     # 0x15fb8
callq 0x32a0
jmp 0x3def
movl $0x1, -0x4(%rbp)
movl $0x1, -0x118(%rbp)
jmp 0x3f9b
jmp 0x3f85
leaq 0xb292(%rip), %rsi      # 0xf0a3
leaq -0xe8(%rbp), %rdi
callq 0x4720
movb %al, -0x361(%rbp)
jmp 0x3e25
movb -0x361(%rbp), %al
testb $0x1, %al
jne 0x3e34
jmp 0x3eb8
movl -0xc8(%rbp), %eax
addl $0x1, %eax
cmpl -0x8(%rbp), %eax
jge 0x3e6c
movq -0x10(%rbp), %rax
movslq -0xc8(%rbp), %rcx
movl %ecx, %edx
incl %edx
movl %edx, -0xc8(%rbp)
movq 0x8(%rax,%rcx,8), %rsi
leaq -0xb8(%rbp), %rdi
callq 0x3380
jmp 0x3e6a
jmp 0x3eb3
movq 0x1217d(%rip), %rdi     # 0x15ff0
leaq 0xb22e(%rip), %rsi      # 0xf0a8
callq 0x3270
movq %rax, -0x370(%rbp)
jmp 0x3e88
movq -0x370(%rbp), %rdi
movq 0x12122(%rip), %rsi     # 0x15fb8
callq 0x32a0
jmp 0x3e9d
movl $0x1, -0x4(%rbp)
movl $0x1, -0x118(%rbp)
jmp 0x3f9b
jmp 0x3f83
leaq 0xb216(%rip), %rsi      # 0xf0d5
leaq -0xe8(%rbp), %rdi
callq 0x4720
movb %al, -0x371(%rbp)
jmp 0x3ed3
movb -0x371(%rbp), %al
testb $0x1, %al
jne 0x3f06
jmp 0x3edf
leaq 0xb1f2(%rip), %rsi      # 0xf0d8
leaq -0xe8(%rbp), %rdi
callq 0x4720
movb %al, -0x372(%rbp)
jmp 0x3efa
movb -0x372(%rbp), %al
testb $0x1, %al
jne 0x3f06
jmp 0x3f81
movl -0xc8(%rbp), %eax
addl $0x1, %eax
cmpl -0x8(%rbp), %eax
jge 0x3f3b
movq -0x10(%rbp), %rax
movslq -0xc8(%rbp), %rcx
movl %ecx, %edx
incl %edx
movl %edx, -0xc8(%rbp)
movq 0x8(%rax,%rcx,8), %rsi
leaq -0x68(%rbp), %rdi
callq 0x3380
jmp 0x3f39
jmp 0x3f7f
movq 0x120ae(%rip), %rdi     # 0x15ff0
leaq 0xb195(%rip), %rsi      # 0xf0de
callq 0x3270
movq %rax, -0x380(%rbp)
jmp 0x3f57
movq -0x380(%rbp), %rdi
movq 0x12053(%rip), %rsi     # 0x15fb8
callq 0x32a0
jmp 0x3f6c
movl $0x1, -0x4(%rbp)
movl $0x1, -0x118(%rbp)
jmp 0x3f9b
jmp 0x3f81
jmp 0x3f83
jmp 0x3f85
jmp 0x3f87
jmp 0x3f89
jmp 0x3f8b
jmp 0x3f8d
jmp 0x3f8f
jmp 0x3f91
movl $0x0, -0x118(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x3180
movl -0x118(%rbp), %eax
testl %eax, %eax
jne 0x44bf
jmp 0x3fb7
jmp 0x3fb9
movl -0xc8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc8(%rbp)
jmp 0x389c
leaq -0xe8(%rbp), %rdi
callq 0x3180
jmp 0x44e2
testb $0x1, -0xc1(%rbp)
je 0x41f1
leaq -0x68(%rbp), %rdi
callq 0x3460
testb $0x1, %al
jne 0x41f1
testb $0x1, -0xc3(%rbp)
jne 0x4012
testb $0x1, -0xc4(%rbp)
je 0x41f1
leaq -0x90(%rbp), %rdi
callq 0x3460
testb $0x1, %al
jne 0x4155
leaq -0xb8(%rbp), %rdi
callq 0x3460
testb $0x1, %al
jne 0x4155
cmpl $0x0, -0xc0(%rbp)
jle 0x40dc
movl $0x90, %edi
callq 0x3280
movq %rax, -0x388(%rbp)
jmp 0x405a
movq -0x388(%rbp), %rdi
movzbl -0xc4(%rbp), %r9d
movq %rsp, %rax
movl $0x1, (%rax)
andl $0x1, %r9d
leaq -0x68(%rbp), %rsi
leaq -0x90(%rbp), %rdx
leaq -0xb8(%rbp), %rcx
leaq -0xc0(%rbp), %r8
callq 0x8580
jmp 0x4096
movq -0x388(%rbp), %rax
movq %rax, -0x2d0(%rbp)
jmp 0x4153
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x43a0
movq -0x388(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x90, %esi
callq 0x3290
jmp 0x43a0
movl $0x90, %edi
callq 0x3280
movq %rax, -0x390(%rbp)
jmp 0x40ef
movq -0x390(%rbp), %rdi
movzbl -0xc4(%rbp), %r8d
andl $0x1, %r8d
leaq -0x68(%rbp), %rsi
leaq -0x90(%rbp), %rdx
leaq -0xb8(%rbp), %rcx
movl $0x1, %r9d
callq 0x8020
jmp 0x4121
movq -0x390(%rbp), %rax
movq %rax, -0x2d0(%rbp)
jmp 0x4153
movq -0x390(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x90, %esi
callq 0x3290
jmp 0x43a0
jmp 0x41c3
movl $0x90, %edi
callq 0x3280
movq %rax, -0x398(%rbp)
jmp 0x4168
movq -0x398(%rbp), %rdi
movzbl -0xc4(%rbp), %ecx
andl $0x1, %ecx
leaq -0x68(%rbp), %rsi
leaq -0xc0(%rbp), %rdx
movl $0x1, %r8d
callq 0x75b0
jmp 0x4191
movq -0x398(%rbp), %rax
movq %rax, -0x2d0(%rbp)
jmp 0x41c3
movq -0x398(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x90, %esi
callq 0x3290
jmp 0x43a0
testb $0x1, -0xc4(%rbp)
je 0x41dc
movq -0x2d0(%rbp), %rdi
callq 0xa4b0
jmp 0x41da
jmp 0x41ec
movq -0x2d0(%rbp), %rdi
callq 0xaa80
jmp 0x41ea
jmp 0x41ec
jmp 0x4499
testb $0x1, -0xc2(%rbp)
je 0x4453
leaq -0x68(%rbp), %rdi
callq 0x3460
testb $0x1, %al
jne 0x4453
testb $0x1, -0xc3(%rbp)
jne 0x4225
testb $0x1, -0xc4(%rbp)
je 0x4453
leaq -0x90(%rbp), %rdi
callq 0x3460
testb $0x1, %al
jne 0x433e
leaq -0xb8(%rbp), %rdi
callq 0x3460
testb $0x1, %al
jne 0x433e
cmpl $0x0, -0xc0(%rbp)
jle 0x42d1
movl $0x90, %edi
callq 0x3280
movq %rax, -0x3a0(%rbp)
jmp 0x4269
movq -0x3a0(%rbp), %rdi
movq %rsp, %rax
movl $0x0, (%rax)
leaq -0x68(%rbp), %rsi
leaq -0x90(%rbp), %rdx
leaq -0xb8(%rbp), %rcx
leaq -0xc0(%rbp), %r8
xorl %r9d, %r9d
callq 0x8580
jmp 0x429c
movq -0x3a0(%rbp), %rax
movq %rax, -0x2d0(%rbp)
jmp 0x4339
movq -0x3a0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x90, %esi
callq 0x3290
jmp 0x43a0
movl $0x90, %edi
callq 0x3280
movq %rax, -0x3a8(%rbp)
jmp 0x42e4
movq -0x3a8(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x90(%rbp), %rdx
leaq -0xb8(%rbp), %rcx
xorl %r9d, %r9d
movl %r9d, %r8d
callq 0x8020
jmp 0x430a
movq -0x3a8(%rbp), %rax
movq %rax, -0x2d0(%rbp)
jmp 0x4339
movq -0x3a8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x90, %esi
callq 0x3290
jmp 0x43a0
jmp 0x4428
movl $0x90, %edi
callq 0x3280
movq %rax, -0x3b0(%rbp)
jmp 0x4351
movq -0x3b0(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0xc0(%rbp), %rdx
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0x75b0
jmp 0x4370
movq -0x3b0(%rbp), %rax
movq %rax, -0x2d0(%rbp)
jmp 0x4428
movq -0x3b0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x90, %esi
callq 0x3290
movl -0x44(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x44e2
movq -0x40(%rbp), %rdi
callq 0x30b0
movq %rax, -0x2d8(%rbp)
movq 0x11c29(%rip), %rdi     # 0x15ff0
leaq 0xad68(%rip), %rsi      # 0xf136
callq 0x3270
movq %rax, -0x3b8(%rbp)
jmp 0x43dc
movq -0x3b8(%rbp), %rdi
movq -0x2d8(%rbp), %rsi
callq 0x3270
movq %rax, -0x3c0(%rbp)
jmp 0x43f8
movq -0x3c0(%rbp), %rdi
movq 0x11bb2(%rip), %rsi     # 0x15fb8
callq 0x32a0
jmp 0x440d
movl $0x1, -0x4(%rbp)
movl $0x1, -0x118(%rbp)
callq 0x3450
jmp 0x44bf
testb $0x1, -0xc4(%rbp)
je 0x4441
movq -0x2d0(%rbp), %rdi
callq 0xa6e0
jmp 0x443f
jmp 0x4451
movq -0x2d0(%rbp), %rdi
callq 0xacf0
jmp 0x444f
jmp 0x4451
jmp 0x4497
movq 0x11b96(%rip), %rdi     # 0x15ff0
leaq 0xac9c(%rip), %rsi      # 0xf0fd
callq 0x3270
movq %rax, -0x3c8(%rbp)
jmp 0x446f
movq -0x3c8(%rbp), %rdi
movq 0x11b3b(%rip), %rsi     # 0x15fb8
callq 0x32a0
jmp 0x4484
movl $0x1, -0x4(%rbp)
movl $0x1, -0x118(%rbp)
jmp 0x44bf
jmp 0x4499
jmp 0x44ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
callq 0x3450
jmp 0x44e2
movl $0x0, -0x4(%rbp)
movl $0x1, -0x118(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x3180
leaq -0x90(%rbp), %rdi
callq 0x3180
leaq -0x68(%rbp), %rdi
callq 0x3180
jmp 0x4505
leaq -0xb8(%rbp), %rdi
callq 0x3180
leaq -0x90(%rbp), %rdi
callq 0x3180
leaq -0x68(%rbp), %rdi
callq 0x3180
jmp 0x4511
movl -0x4(%rbp), %eax
addq $0x3d0, %rsp            # imm = 0x3D0
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x34d0
nopw (%rax,%rax)