// File: lmclaramunt[P]AES-Crypto/Cipher.cpp
// Function: Cipher::Cipher(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool, bool)
Cipher::Cipher(string* _textPath, string* _aesKeyPath, string* _macKeyPath, 
    bool padding, bool encrypt): 
    textPath(_textPath), aesKeyPath(*_aesKeyPath), macKeyPath(*_macKeyPath){
    try {
        if(!fileExists(textPath)) throw "File given in path '-p' wasn't found\n";
        if(!fileExists(_aesKeyPath)) throw "Key given in '-aes' wasn't found\n";
        if(!fileExists(_macKeyPath)) throw "Key given in '-mac' wasn't found\n";
        int keyLength = getKeySize(&aesKeyPath, &macKeyPath);
        cryptoDir();
        setBlockRoundCombinations(&keyLength, false);
        getKey(encrypt, &aesKeyPath, &aesKeyExp);
        getKey(encrypt, &macKeyPath, &macKeyExp);
        vector<unsigned char> inpVct;
        readText(&inpVct);
        inputBlock = new Block(&inpVct, padding);
    } catch(const char* str) {
        throw str;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movl %r8d, -0x8c(%rbp)
movq %rcx, %rax
movl -0x8c(%rbp), %ecx
movq %rax, -0x88(%rbp)
movq %rdx, %rax
movq -0x88(%rbp), %rdx
movq %rax, -0x80(%rbp)
movq %rsi, %rax
movq -0x80(%rbp), %rsi
movq %rax, -0x78(%rbp)
movq %rdi, %r8
movq -0x78(%rbp), %rdi
movb %r9b, %al
movq %r8, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
andb $0x1, %cl
movb %cl, -0x21(%rbp)
andb $0x1, %al
movb %al, -0x22(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x68(%rbp)
movq -0x10(%rbp), %rax
movq %rax, 0x28(%rdi)
addq $0x30, %rdi
movq %rdi, -0x70(%rbp)
callq 0x3390
movq -0x68(%rbp), %rdi
addq $0x50, %rdi
movq %rdi, -0x60(%rbp)
movq -0x18(%rbp), %rsi
callq 0x30d0
jmp 0x80b4
movq -0x68(%rbp), %rdi
addq $0x70, %rdi
movq %rdi, -0x98(%rbp)
movq -0x20(%rbp), %rsi
callq 0x30d0
jmp 0x80ce
movq -0x68(%rbp), %rdi
movq 0x28(%rdi), %rsi
callq 0x77e0
movb %al, -0x99(%rbp)
jmp 0x80e3
movb -0x99(%rbp), %al
testb $0x1, %al
jne 0x814e
jmp 0x80ef
movl $0x8, %edi
callq 0x3120
movq %rax, %rdi
leaq 0x7587(%rip), %rax      # 0xf68a
movq %rax, (%rdi)
movq 0xdeb3(%rip), %rsi      # 0x15fc0
xorl %eax, %eax
movl %eax, %edx
callq 0x3490
jmp 0x8389
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x8377
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x836e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x8307
movq -0x68(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x77e0
movb %al, -0x9a(%rbp)
jmp 0x8163
movb -0x9a(%rbp), %al
testb $0x1, %al
jne 0x819b
jmp 0x816f
movl $0x8, %edi
callq 0x3120
movq %rax, %rdi
leaq 0x752d(%rip), %rax      # 0xf6b0
movq %rax, (%rdi)
movq 0xde33(%rip), %rsi      # 0x15fc0
xorl %eax, %eax
movl %eax, %edx
callq 0x3490
jmp 0x8389
movq -0x68(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x77e0
movb %al, -0x9b(%rbp)
jmp 0x81b0
movb -0x9b(%rbp), %al
testb $0x1, %al
jne 0x81e8
jmp 0x81bc
movl $0x8, %edi
callq 0x3120
movq %rax, %rdi
leaq 0x7502(%rip), %rax      # 0xf6d2
movq %rax, (%rdi)
movq 0xdde6(%rip), %rsi      # 0x15fc0
xorl %eax, %eax
movl %eax, %edx
callq 0x3490
jmp 0x8389
movq -0x68(%rbp), %rdi
movq %rdi, %rsi
addq $0x50, %rsi
movq %rdi, %rdx
addq $0x70, %rdx
callq 0x8390
movl %eax, -0xa0(%rbp)
jmp 0x8207
movq -0x68(%rbp), %rdi
movl -0xa0(%rbp), %eax
movl %eax, -0x38(%rbp)
callq 0x7820
jmp 0x821b
movq -0x68(%rbp), %rdi
leaq -0x38(%rbp), %rsi
xorl %edx, %edx
callq 0x78c0
jmp 0x822c
movq -0x68(%rbp), %rcx
movq %rcx, %rdx
addq $0x50, %rdx
movzbl -0x22(%rbp), %esi
andl $0x1, %esi
movq %rcx, %rdi
callq 0x7b80
jmp 0x8248
movq -0x68(%rbp), %rdi
movq %rdi, %rdx
addq $0x70, %rdx
movq %rdi, %rcx
addq $0x8, %rcx
movzbl -0x22(%rbp), %esi
andl $0x1, %esi
callq 0x7b80
jmp 0x8268
leaq -0x50(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
callq 0xaf30
movq -0x68(%rbp), %rdi
movq -0xa8(%rbp), %rsi
callq 0x7e60
jmp 0x828a
movl $0x18, %edi
callq 0x3280
movq %rax, -0xb0(%rbp)
jmp 0x829d
movq -0xb0(%rbp), %rdi
movzbl -0x21(%rbp), %edx
andl $0x1, %edx
leaq -0x50(%rbp), %rsi
callq 0x4ee0
jmp 0x82b6
movq -0x68(%rbp), %rax
movq -0xb0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq -0x50(%rbp), %rdi
callq 0xaf50
jmp 0x8359
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x82fe
movq -0xb0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
movl $0x18, %esi
callq 0x3290
leaq -0x50(%rbp), %rdi
callq 0xaf50
movl -0x34(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x8362
movq -0x30(%rbp), %rdi
callq 0x30b0
movq %rax, -0x58(%rbp)
movl $0x8, %edi
callq 0x3120
movq %rax, %rdi
movq -0x58(%rbp), %rax
movq %rax, (%rdi)
movq 0xdc85(%rip), %rsi      # 0x15fc0
xorl %eax, %eax
movl %eax, %edx
callq 0x3490
jmp 0x8389
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x3450
jmp 0x8362
addq $0xb0, %rsp
popq %rbp
retq
movq -0x98(%rbp), %rdi
callq 0x3180
movq -0x60(%rbp), %rdi
callq 0x3180
movq -0x70(%rbp), %rdi
callq 0x3180
movq -0x30(%rbp), %rdi
callq 0x34d0
nopl (%rax)