LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/ch4rli3kop[P]ch4rli3-fuzzer/main.cc
// Function: main
int main(int argc, char* argv[]){

	char* target = TARGET;
	char* argvs[] = {TARGET, "-i", "out/cur_input.j2k", "-o", "out/tmp.pgm", NULL};

	printf("[+] target : %s\n", target);

	shared_memory_init();
	init_corpus();

	while (true){
	
		for (int i = 0; i < corpus.size(); i++){
			mutation(corpus[i]);

			// run target with the input created by mutation.
			int input_size = input.size();
			for (int j = 0; j < input_size; j++){
				create_input();
				//use_radamsa();
				run_target(target, argvs);
			}
		}
	}

	// cout << corpus.size() << endl;
	// int len = corpus.size();
	// for (int i = 0; i < len; i++){
	// 	char* tmp = corpus.front();
	// 	corpus.pop();
	// 	printf("%p\n", tmp);
	// 	printf("%s\n", tmp);
	// }

	// char* Data = reinterpret_cast<char*>(shmAddr);
	// printf("%p\n", shmAddr);
	// printf("%p\n", Data);

	// printf("Result : %s\n", shmAddr);
	// for (int i = 0; i < 0x100; i++){
	// 	if (i % 0x10 == 0) printf("\n");
	// 	printf("%x ", Data[i]);
	// }

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movaps 0x3d34(%rip), %xmm0     # 0x6da0
leaq -0x50(%rbp), %rbx
movaps %xmm0, 0x20(%rbx)
movaps 0x3d15(%rip), %xmm0     # 0x6d90
movaps %xmm0, 0x10(%rbx)
movaps 0x3cfa(%rip), %xmm0     # 0x6d80
movaps %xmm0, (%rbx)
leaq 0x10d8(%rip), %rdi      # 0x4168
leaq 0x1093(%rip), %r14      # 0x412a
movq %r14, %rsi
xorl %eax, %eax
callq 0x2050
callq 0x2c9d
callq 0x2cdd
movq 0x41a6(%rip), %rcx      # 0x7258
movq 0x4197(%rip), %rax      # 0x7250
cmpq %rax, %rcx
movq %rax, %rcx
je 0x30b9
xorl %r15d, %r15d
movq (%rax,%r15,8), %rdi
callq 0x2f53
movq 0x4174(%rip), %rax      # 0x7248
movl 0x414e(%rip), %ecx      # 0x7228
movl %eax, %edx
subl %ecx, %edx
shrl $0x3, %edx
cmpq $0x1, %rax
adcl $-0x1, %edx
shll $0x6, %edx
movq 0x413e(%rip), %rax      # 0x7230
subq 0x413f(%rip), %rax      # 0x7238
shrq $0x3, %rax
movq 0x411c(%rip), %r12      # 0x7220
subq 0x4105(%rip), %r12      # 0x7210
shrq $0x3, %r12
addl %eax, %r12d
addl %edx, %r12d
testl %r12d, %r12d
jle 0x312f
callq 0x2f99
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2c1f
decl %r12d
jne 0x311a
incq %r15
movq 0x411f(%rip), %rcx      # 0x7258
movq 0x4110(%rip), %rax      # 0x7250
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r15, %rdx
ja 0x30c4
jmp 0x30b9
// File: /workspace/github_cpp_makefile_star2_O3/ch4rli3kop[P]ch4rli3-fuzzer/sha256.cpp
// Function: sha256(unsigned char*, int)
unsigned char* sha256(unsigned char* input, int length)
{
    unsigned char* digest = new unsigned char[SHA256::DIGEST_SIZE];
    memset(digest,0,SHA256::DIGEST_SIZE);
 
    SHA256 ctx = SHA256();
    ctx.init();
    ctx.update(input, length);
    ctx.final(digest);
 
    return digest;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xb0, %rsp
movl %esi, %r14d
movq %rdi, %r15
movl $0x20, %edi
callq 0x2030
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
leaq -0xc8(%rbp), %r12
movups %xmm0, 0x78(%r12)
movups %xmm0, 0x68(%r12)
movups %xmm0, 0x58(%r12)
movups %xmm0, 0x48(%r12)
movups %xmm0, 0x38(%r12)
movups %xmm0, 0x28(%r12)
movups %xmm0, 0x18(%r12)
movups %xmm0, 0x8(%r12)
movaps 0x4e1(%rip), %xmm0      # 0x42c0
movups %xmm0, 0x88(%r12)
movaps 0x4e1(%rip), %xmm0      # 0x42d0
movups %xmm0, 0x98(%r12)
movq $0x0, (%r12)
movq %r12, %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0x3bd6
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3c82
movq %rbx, %rax
addq $0xb0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lmclaramunt[P]AES-Crypto/Sequence.cpp
// Function: Sequence::setSize(int)
void Sequence::setSize(int _size) {
    if(_size > 16 || _size < 0) throw "Invalid capacity\n";
    if(size != _size) {
        unsigned char* temp = new unsigned char[_size];
        for(int i=0; i< _size; i++)
            temp[i] = sq[i];
        delete[] sq;
        sq = temp;
        size = _size;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x11, %esi
jae 0x3258
movl %esi, %ebx
movq %rdi, %r14
cmpl %esi, 0x8(%rdi)
je 0x324c
movl %ebx, %r12d
movq %r12, %rdi
callq 0x2030
movq %rax, %r15
movq (%r14), %rdi
testl %ebx, %ebx
je 0x323b
xorl %eax, %eax
movb (%rdi,%rax), %cl
movb %cl, (%r15,%rax)
incq %rax
cmpq %rax, %r12
jne 0x322a
jmp 0x3240
testq %rdi, %rdi
je 0x3245
callq 0x22b0
movq %r15, (%r14)
movl %ebx, 0x8(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl $0x8, %edi
callq 0x2120
leaq 0x411d(%rip), %rcx      # 0x7386
movq %rcx, (%rax)
movq 0x7d4d(%rip), %rsi      # 0xafc0
movq %rax, %rdi
xorl %edx, %edx
callq 0x23d0
nop
// File: /workspace/github_cpp_makefile_star2_O3/lmclaramunt[P]AES-Crypto/Block.cpp
// Function: Block::Block(std::vector<unsigned char, std::allocator<unsigned char>>*, bool)
Block::Block(vector<unsigned char>* input, bool pad) {
    if(pad) padding(input);
    Sequence sq = ((*input).size() >= 16) ? Sequence(16) : Sequence((*input).size());
    int j = 0;
    for (int i=0; i < (*input).size(); i++) {
        sq.getSequence()[j] = (unsigned) (*input).at(i);
        if (i%16==15) {
            sequenceVct.push_back(sq);      //Append 128 bits, and restart
            sq = (((*input).size()-(i+1)) >= 16) ? Sequence(16) : Sequence(((*input).size()-(i+1)));
            j = -1;
        }
        j++;
    }
    if (j != 0) sequenceVct.push_back(sq);       //Left over is padding was avoided
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
testl %edx, %edx
je 0x33ba
movq %r14, %rsi
callq 0x34fc
movq 0x8(%r14), %rax
subq (%r14), %rax
cmpq $0x10, %rax
movl $0x10, %esi
cmovbl %eax, %esi
leaq 0x8(%rsp), %rdi
callq 0x31dc
movq (%r14), %rax
cmpq %rax, 0x8(%r14)
je 0x34c6
xorl %r13d, %r13d
leaq 0x8(%rsp), %r15
xorl %ebp, %ebp
movb (%rax,%r13), %r12b
movq %r15, %rdi
callq 0x31f0
movq (%rax), %rax
movslq %ebp, %rcx
movb %r12b, (%rax,%rcx)
movl %r13d, %eax
notl %eax
testb $0xf, %al
jne 0x3426
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x343c
movups 0x8(%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x8(%rbx)
jmp 0x3447
incq %r13
incl %ebp
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
cmpq %r13, %rcx
ja 0x33ee
jmp 0x349c
movq %rbx, %rdi
movq %r15, %rdx
callq 0x3658
movq 0x8(%r14), %rsi
subq (%r14), %rsi
incq %r13
movq %rsi, %rax
subq %r13, %rax
subl %r13d, %esi
cmpq $0x10, %rax
movl $0x10, %eax
cmovael %eax, %esi
leaq 0x18(%rsp), %rdi
callq 0x31dc
movl 0x20(%rsp), %eax
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
movl $0x0, %ebp
cmpq %r13, %rcx
ja 0x33ee
jmp 0x34c6
testl %ebp, %ebp
je 0x34c6
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x34b9
movups 0x8(%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x8(%rbx)
jmp 0x34c6
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x3658
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x34dd
jmp 0x34dd
jmp 0x34dd
jmp 0x34dd
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x34f4
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x2250
movq %r14, %rdi
callq 0x2400
// File: /workspace/github_cpp_makefile_star2_O3/lmclaramunt[P]AES-Crypto/Block.cpp
// Function: Block::~Block()
Block::~Block() {
    try {
        sequenceVct.clear();
        sequenceVct.shrink_to_fit();
    } catch (...) {
        cout<<"Could not clear the vector from memory!"<<endl;
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
cmpq %rdi, 0x8(%rbx)
je 0x354d
movq %rdi, 0x8(%rbx)
cmpq %rdi, 0x10(%rbx)
je 0x355e
movq %rbx, %rdi
callq 0x3798
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x3570
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
popq %rbx
jmp 0x2250
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/lmclaramunt[P]AES-Crypto/Block.cpp
// Function: operator<<(std::ostream&, Block const&)
ostream& operator<<(ostream& os, const Block& block) {
    for (Sequence sq: block.sequenceVct) {
        for (int i = 0; i < sq.getSize(); i++) {
            os << hex << (int)sq.getSequence()[i]<<" ";
        }
        os << endl;
    }
    return os;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq (%rsi), %r12
movq 0x8(%rsi), %r13
cmpq %r13, %r12
je 0x363a
movq %rsp, %r14
leaq 0x3c6c(%rip), %r15      # 0x720d
movups (%r12), %xmm0
movaps %xmm0, (%rsp)
movq %r14, %rdi
callq 0x31f4
testl %eax, %eax
jle 0x3606
xorl %ebp, %ebp
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rbx,%rax)
movq %r14, %rdi
callq 0x31f0
movq (%rax), %rax
movzbl (%rax,%rbp), %esi
movq %rbx, %rdi
callq 0x23e0
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2260
incq %rbp
movq %r14, %rdi
callq 0x31f4
cltq
cmpq %rax, %rbp
jl 0x35b8
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2220
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2160
addq $0x10, %r12
cmpq %r13, %r12
jne 0x35a1
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lmclaramunt[P]AES-Crypto/State.cpp
// Function: State::State(Sequence*)
State::State(Sequence* sq): s(new unsigned char*[4]) {
    for (int i=0; i < 4; i++) {
        s[i] = new unsigned char[4];
    }
    for (int i=0; i < 4; i++) {
        for (int j=0; j < 4; j++) {
            s[i][j] = sq->getSequence()[i + 4*j];
        }
    }
}

/*
 * Destructor for cleanup
 */
State::~State() {
    try {
        for (int i=0; i < 4; i++) 
            for (int j=0; j < 4; j++) s[i][j] = 0;
    } catch (...) {
        throw "Failed to override the used State!\n";
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x20, %edi
callq 0x2030
movq %rax, (%r14)
xorl %r15d, %r15d
movl $0x4, %edi
callq 0x2030
movq (%r14), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
cmpq $0x4, %r15
jne 0x3a16
xorl %r15d, %r15d
xorl %r12d, %r12d
movq %rbx, %rdi
callq 0x31f0
movq (%rax), %rax
addq %r15, %rax
movb (%rax,%r12,4), %al
movq (%r14), %rcx
movq (%rcx,%r15,8), %rcx
movb %al, (%rcx,%r12)
incq %r12
cmpq $0x4, %r12
jne 0x3a36
incq %r15
cmpq $0x4, %r15
jne 0x3a33
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/lmclaramunt[P]AES-Crypto/State.cpp
// Function: State::toSequence() const
Sequence State::toSequence() const {
    Sequence sq(16);
    for(int column = 0; column < 4; column++) {
        for(int row = 0; row < 4; row++){    
            sq.getSequence()[row + 4*column] = s[row][column];
        }
    }
    return sq;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x10, %esi
callq 0x31dc
xorl %r15d, %r15d
xorl %r12d, %r12d
xorl %r13d, %r13d
movq (%rbx), %rax
movq (%rax,%r13,8), %rax
movb (%rax,%r12), %bpl
movq %r14, %rdi
callq 0x31f0
movq (%rax), %rax
addq %r15, %rax
movb %bpl, (%r13,%rax)
incq %r13
cmpq $0x4, %r13
jne 0x3ac4
incq %r12
addq $0x4, %r15
cmpq $0x4, %r12
jne 0x3ac1
movq 0x8(%rsp), %rax
movl 0x10(%rsp), %edx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lmclaramunt[P]AES-Crypto/State.cpp
// Function: operator<<(std::ostream&, State const&)
ostream& operator<<(ostream& os, const State& state) {
    for (int i=0; i < 4; i++) {
        for (int j=0; j < 4; j++) {
            os << hex <<(int)state.s[i][j] << ' ';
        }
        os << endl;
    }
    return os;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorl %r12d, %r12d
leaq 0xf(%rsp), %r15
xorl %r13d, %r13d
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rbx,%rax)
movq (%r14), %rax
movq (%rax,%r12,8), %rax
movzbl (%rax,%r13), %esi
movq %rbx, %rdi
callq 0x23e0
movb $0x20, 0xf(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2260
incq %r13
cmpq $0x4, %r13
jne 0x3b32
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2220
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2160
incq %r12
cmpq $0x4, %r12
jne 0x3b2f
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/lmclaramunt[P]AES-Crypto/State.cpp
// Function: operator^(State&, State&)
State& operator^(State& a, State& b) {
    for (int i=0; i < 4; i++) {
        for (int j=0; j < 4; j++) {
            a.s[i][j] ^= b.s[i][j];
        }
    }
    return a;
}

// Assembly:
movq %rdi, %rax
xorl %ecx, %ecx
xorl %edx, %edx
movq (%rsi), %rdi
movq (%rdi,%rcx,8), %rdi
movb (%rdi,%rdx), %dil
movq (%rax), %r8
movq (%r8,%rcx,8), %r8
xorb %dil, (%r8,%rdx)
incq %rdx
cmpq $0x4, %rdx
jne 0x3bc1
incq %rcx
cmpq $0x4, %rcx
jne 0x3bbf
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/lmclaramunt[P]AES-Crypto/Cipher.cpp
// Function: Cipher::Cipher(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, int*, bool, bool)
Cipher::Cipher(string* _textPath, int* keyLength, bool padding, bool encrypt): 
        textPath(_textPath) {
    try {
        if(!fileExists(textPath)) throw "File given in path '-p' wasn't found\n";
        cryptoDir();
        setBlockRoundCombinations(keyLength, true);
        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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movl %r8d, %r12d
movl %ecx, %ebp
movq %rdx, %r13
movq %rdi, %rbx
movq %rsi, 0x28(%rdi)
leaq 0x40(%rdi), %rax
movq %rax, 0x10(%rsp)
movq %rax, 0x30(%rdi)
xorl %eax, %eax
movq %rax, 0x38(%rdi)
movb %al, 0x40(%rdi)
leaq 0x50(%rdi), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x60(%rdi), %rcx
movq %rcx, 0x8(%rsp)
movq %rcx, 0x50(%rdi)
movq %rax, 0x58(%rdi)
movb %al, 0x60(%rdi)
leaq 0x70(%rdi), %r15
leaq 0x80(%rdi), %r14
movq %r14, 0x70(%rdi)
movq %rax, 0x78(%rdi)
movb %al, 0x80(%rdi)
movq (%rsi), %rdi
leaq 0x20(%rsp), %rsi
callq 0x21f0
testl %eax, %eax
jne 0x3d14
movq %rbx, %rdi
callq 0x3e24
movq %rbx, %rdi
movq %r13, %rsi
movl $0x1, %edx
callq 0x3eb6
movzbl %r12b, %r12d
movq %rbx, %rdi
movl %r12d, %esi
movq 0x18(%rsp), %rdx
movq %rbx, %rcx
callq 0x42b0
leaq 0x8(%rbx), %rcx
movq %rbx, %rdi
movl %r12d, %esi
movq %r15, %rdx
callq 0x42b0
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rsi
movaps %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movq %rbx, %rdi
callq 0x448c
movl $0x18, %edi
callq 0x2240
movq %rax, %r12
movzbl %bpl, %edx
leaq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x338c
movq %r12, 0x10(%rbx)
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x3d02
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x8, %edi
callq 0x2120
leaq 0x3955(%rip), %rcx      # 0x767a
movq %rcx, (%rax)
movq 0x7291(%rip), %rsi      # 0xafc0
movq %rax, %rdi
xorl %edx, %edx
callq 0x23d0
jmp 0x3da4
movq %rdx, %r13
movq %rax, %rbp
movl $0x18, %esi
movq %r12, %rdi
callq 0x2250
jmp 0x3d56
movq %rdx, %r13
movq %rax, %rbp
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x3d75
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
jmp 0x3d75
movq %rdx, %r13
movq %rax, %rbp
cmpl $0x1, %r13d
jne 0x3dac
movq %rbp, %rdi
callq 0x20d0
movq %rax, %r12
movl $0x8, %edi
callq 0x2120
movq %r12, (%rax)
movq 0x7226(%rip), %rsi      # 0xafc0
movq %rax, %rdi
xorl %edx, %edx
callq 0x23d0
movq %rax, %rbp
callq 0x23a0
movq (%r15), %rdi
cmpq %r14, %rdi
je 0x3dbf
movq (%r14), %rsi
incq %rsi
callq 0x2250
movq 0x18(%rsp), %rax
movq (%rax), %rdi
cmpq 0x8(%rsp), %rdi
je 0x3dde
movq 0x8(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x2250
movq 0x30(%rbx), %rdi
cmpq 0x10(%rsp), %rdi
je 0x3df9
movq 0x10(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x2250
movq %rbp, %rdi
callq 0x2400
nop
// File: /workspace/github_cpp_makefile_star2_O3/lmclaramunt[P]AES-Crypto/Cipher.cpp
// Function: Cipher::cryptoDir()
void Cipher::cryptoDir() {
    struct stat info;
    home = getenv("HOME");
    home += "/.crypto";
    char *pathname = &home[0];
    if(stat(pathname, &info) != 0) {
        mkdir(pathname, 0770);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
leaq 0x38d2(%rip), %rdi      # 0x770e
callq 0x2290
movq %rax, %r14
leaq 0x30(%rbx), %r15
movq 0x38(%rbx), %r12
movq %rax, %rdi
callq 0x20e0
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %r14, %rcx
movq %rax, %r8
callq 0x2360
leaq 0x38a5(%rip), %rsi      # 0x7713
movq %r15, %rdi
callq 0x2430
movq 0x30(%rbx), %rbx
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x21f0
testl %eax, %eax
je 0x3ea6
movq %rbx, %rdi
movl $0x1f8, %esi            # imm = 0x1F8
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x20f0
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/lmclaramunt[P]AES-Crypto/Cipher.cpp
// Function: Cipher::readText(std::vector<unsigned char, std::allocator<unsigned char>>*)
void Cipher::readText(vector<unsigned char>* inpVct) {
    ifstream input(*textPath, ios::binary);
    streampos textSize;             //Size of the file
    input.seekg(0, ios::end);
    textSize = input.tellg();
    input.seekg(0, ios::beg);
    inpVct->reserve(textSize);      //The vector will have enough space for all elements
    inpVct->insert(inpVct->begin(), 
        (istreambuf_iterator<char>(input)),
        (istreambuf_iterator<char>()));
    input.close();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rsi, %rbx
movq 0x28(%rdi), %rsi
movq %rsp, %r14
movq %r14, %rdi
movl $0x4, %edx
callq 0x2380
movq %r14, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x22d0
movq %rsp, %rdi
callq 0x23f0
movq %rax, %r14
movq %rsp, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x22d0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x62ba
movq (%rbx), %rsi
movq (%rsp), %rax
movq -0x18(%rax), %rax
movq 0xe8(%rsp,%rax), %rdx
movq %rbx, %rdi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %r8d, %r8d
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
callq 0x6558
movq %rsp, %rdi
callq 0x2050
movq %rsp, %rdi
callq 0x2070
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r14
retq
jmp 0x4526
jmp 0x4526
movq %rax, %rbx
movq %rsp, %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x2400
nop
// File: /workspace/github_cpp_makefile_star2_O3/lmclaramunt[P]AES-Crypto/Cipher.cpp
// Function: Cipher::getKeySize(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*)
int Cipher::getKeySize(string* aesKey, string* macKey){
    ifstream aes(*aesKey, ios::binary);
    aes.seekg(0, ios::end);
    int aes_size = aes.tellg();
    ifstream mac(*macKey, ios::binary);
    mac.seekg(0, ios::end);
    int mac_size = mac.tellg();
    if(aes_size != mac_size)
        throw "AES and MAC key must be of the same size\n";
    return aes_size*8;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x418, %rsp            # imm = 0x418
movq %rdx, %r14
leaq 0x210(%rsp), %rbx
movq %rbx, %rdi
movl $0x4, %edx
callq 0x2380
movq %rbx, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x22d0
leaq 0x210(%rsp), %rdi
callq 0x23f0
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
movl $0x4, %edx
callq 0x2380
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x22d0
leaq 0x8(%rsp), %rdi
callq 0x23f0
cmpl %eax, %ebx
jne 0x4863
shll $0x3, %ebx
leaq 0x8(%rsp), %rdi
callq 0x2070
leaq 0x210(%rsp), %rdi
callq 0x2070
movl %ebx, %eax
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r14
retq
movl $0x8, %edi
callq 0x2120
leaq 0x2e70(%rip), %rcx      # 0x76e4
movq %rcx, (%rax)
movq 0x6742(%rip), %rsi      # 0xafc0
movq %rax, %rdi
xorl %edx, %edx
callq 0x23d0
jmp 0x488c
jmp 0x488c
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2070
jmp 0x48a2
jmp 0x489f
jmp 0x489f
movq %rax, %rbx
leaq 0x210(%rsp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x2400
nop
// File: /workspace/github_cpp_makefile_star2_O3/lmclaramunt[P]AES-Crypto/Cipher.cpp
// Function: Cipher::~Cipher()
Cipher::~Cipher() {
    try {
        inputBlock->~Block();
        for(int j=0; j<4*(Nr+1); j++) {
            std::fill_n(aesKeyExp[j], 4, 0);
            delete[] aesKeyExp[j];
            std::fill_n(macKeyExp[j], 4, 0);
            delete[] macKeyExp[j];
        }
        delete[] aesKeyExp, macKeyExp;
    } catch (...) {
        cout<<"Could not clear the keyExpansion from memory!"<<endl;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
callq 0x353c
movl 0x1c(%rbx), %eax
leal 0x4(,%rax,4), %eax
testl %eax, %eax
jle 0x4b6b
xorl %r14d, %r14d
movq (%rbx), %rax
movq (%rax,%r14,8), %rax
movl $0x0, (%rax)
movq (%rbx), %rax
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0x4b37
callq 0x22b0
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rax
movl $0x0, (%rax)
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0x4b57
callq 0x22b0
incq %r14
movl 0x1c(%rbx), %eax
leal 0x4(,%rax,4), %eax
cltq
cmpq %rax, %r14
jl 0x4b19
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x4b78
callq 0x22b0
movq 0x70(%rbx), %rdi
leaq 0x80(%rbx), %rax
cmpq %rax, %rdi
je 0x4b93
movq (%rax), %rsi
incq %rsi
callq 0x2250
movq 0x50(%rbx), %rdi
leaq 0x60(%rbx), %rax
cmpq %rax, %rdi
je 0x4bab
movq (%rax), %rsi
incq %rsi
callq 0x2250
movq 0x30(%rbx), %rdi
addq $0x40, %rbx
cmpq %rbx, %rdi
je 0x4bca
movq (%rbx), %rsi
incq %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2250
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/lmclaramunt[P]AES-Crypto/Cipher.cpp
// Function: Cipher::keyExpansion(unsigned char*, unsigned char**)
void Cipher::keyExpansion(unsigned char* key, unsigned char** keyExpanded) {
    unsigned char temp[4];
    int i = 0;
    
    while(i < Nk) {
        for(int j=0; j<4; j++) keyExpanded[i][j] = key[4*i+j];
        i++;
    }
    i = Nk;
    while (i < 4*(Nr+1)) {
        for(int j=0; j<4; j++) temp[j] = keyExpanded[i-1][j];
        if (i % Nk == 0) {
            unsigned char rcon[4];
            Rcon(i/Nk, rcon);
            RotWord(temp);
            subWord(temp);
            for(int j=0; j<4; j++) temp[j] ^= rcon[j];
        } else if (Nk > 6 && i % Nk == 4) {
            subWord(temp);
        }
        for(int j=0; j<4; j++) 
            keyExpanded[i][j] = keyExpanded[i-Nk][j] ^ temp[j];
        i++;
    }
}

// Assembly:
movq %rdx, %rcx
movl 0x18(%rdi), %edx
testl %edx, %edx
jle 0x4e03
xorl %eax, %eax
xorl %edx, %edx
movb (%rsi,%rdx), %r8b
movq (%rcx,%rax,8), %r9
movb %r8b, (%r9,%rdx)
incq %rdx
cmpq $0x4, %rdx
jne 0x4dde
incq %rax
movslq 0x18(%rdi), %rdx
addq $0x4, %rsi
cmpq %rdx, %rax
jl 0x4ddc
movl 0x1c(%rdi), %eax
leal 0x4(,%rax,4), %eax
cmpl %eax, %edx
jge 0x4f1a
movslq %edx, %rsi
leaq 0x2851(%rip), %r8       # 0x7670
leaq 0x264a(%rip), %r9       # 0x7470
movq -0x8(%rcx,%rsi,8), %rax
movl (%rax), %eax
movl %eax, -0x4(%rsp)
movl 0x18(%rdi), %r10d
movl %esi, %eax
cltd
idivl %r10d
testl %edx, %edx
je 0x4e79
cmpl $0x7, %r10d
jl 0x4ed8
cmpl $0x4, %edx
jne 0x4ed8
xorl %eax, %eax
movzbl -0x4(%rsp,%rax), %edx
movl %edx, %r10d
andl $0xf, %r10d
andl $-0x10, %edx
addq %r9, %rdx
movb (%r10,%rdx), %dl
movb %dl, -0x4(%rsp,%rax)
incq %rax
cmpq $0x4, %rax
jne 0x4e54
jmp 0x4ed8
cltq
movzbl -0x1(%rax,%r8), %eax
movd %eax, %xmm0
movd -0x4(%rsp), %xmm1
movdqa %xmm1, %xmm2
psrld $0x8, %xmm2
pslld $0x18, %xmm1
por %xmm2, %xmm1
movd %xmm1, -0x4(%rsp)
xorl %eax, %eax
movzbl -0x4(%rsp,%rax), %edx
movl %edx, %r10d
andl $0xf, %r10d
andl $-0x10, %edx
addq %r9, %rdx
movb (%r10,%rdx), %dl
movb %dl, -0x4(%rsp,%rax)
incq %rax
cmpq $0x4, %rax
jne 0x4ea5
movd -0x4(%rsp), %xmm1
pxor %xmm0, %xmm1
movd %xmm1, -0x4(%rsp)
xorl %eax, %eax
movslq 0x18(%rdi), %rdx
movq %rsi, %r10
subq %rdx, %r10
movq (%rcx,%r10,8), %rdx
movb -0x4(%rsp,%rax), %r10b
xorb (%rdx,%rax), %r10b
movq (%rcx,%rsi,8), %rdx
movb %r10b, (%rdx,%rax)
incq %rax
cmpq $0x4, %rax
jne 0x4eda
incq %rsi
movl 0x1c(%rdi), %eax
leal 0x4(,%rax,4), %eax
cltq
cmpq %rax, %rsi
jl 0x4e26
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/lmclaramunt[P]AES-Crypto/Cipher.cpp
// Function: Cipher::shiftColumnsByOne(unsigned char**, int*, bool)
void Cipher::shiftColumnsByOne(unsigned char** st, int* row, bool leftDir) {
    if(leftDir) {
        for(int column = 0; column < 3; column++) {
            unsigned char temp = st[*row][column];
            int next = (column + 1) % 4;
            st[*row][column] = st[*row][next];
            st[*row][next] = temp;
        }
    } else {
        for(int column = 3; column > 0; column--) {
            unsigned char temp = st[*row][column];
            int next = (column + 1) % 4;
            st[*row][column] = st[*row][next];
            st[*row][next] = temp;
        }
    }
}

// Assembly:
testl %ecx, %ecx
je 0x4fb6
movl $0x1, %eax
movslq (%rdx), %rcx
movq (%rsi,%rcx,8), %rcx
movb -0x1(%rcx,%rax), %dil
movb (%rcx,%rax), %r8b
movb %r8b, -0x1(%rcx,%rax)
movslq (%rdx), %rcx
movq (%rsi,%rcx,8), %rcx
movb %dil, (%rcx,%rax)
incq %rax
cmpq $0x4, %rax
jne 0x4f8b
jmp 0x4feb
movl $0x4, %eax
movslq (%rdx), %rcx
movq (%rsi,%rcx,8), %rcx
movb -0x1(%rcx,%rax), %dil
movl %eax, %r8d
andl $0x3, %r8d
movb (%rcx,%r8), %r9b
movb %r9b, -0x1(%rcx,%rax)
movslq (%rdx), %rcx
movq (%rsi,%rcx,8), %rcx
movb %dil, (%rcx,%r8)
decq %rax
cmpq $0x1, %rax
ja 0x4fbb
retq
// File: /workspace/github_cpp_makefile_star2_O3/lmclaramunt[P]AES-Crypto/Cipher.cpp
// Function: Cipher::shiftColumnsByTwo(unsigned char**, int*)
void Cipher::shiftColumnsByTwo(unsigned char** st, int* row) {
    for(int column = 0; column < 2; column++) {
        unsigned char temp = st[*row][column];
        st[*row][column] = st[*row][column+2];
        st[*row][column+2] = temp;
    }
}

// Assembly:
movb $0x1, %al
xorl %ecx, %ecx
movslq (%rdx), %rdi
movq (%rsi,%rdi,8), %rdi
movb (%rdi,%rcx), %r8b
movb 0x2(%rdi,%rcx), %r9b
movb %r9b, (%rdi,%rcx)
movslq (%rdx), %rdi
movq (%rsi,%rdi,8), %rdi
movb %r8b, 0x2(%rdi,%rcx)
movl $0x1, %ecx
testb $0x1, %al
movl $0x0, %eax
jne 0x4ff0
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/lmclaramunt[P]AES-Crypto/Cipher.cpp
// Function: Cipher::shiftRows(unsigned char**)
void Cipher::shiftRows(unsigned char** st) {
    int row = 1;
    shiftColumnsByOne(st, &row, true);
    shiftColumnsByTwo(st, &(++row));
    shiftColumnsByOne(st, &(++row), false);   //Shift to the right by 1 is equivalent to shift to the left by 3
}

// Assembly:
movl $0x1, %eax
movq 0x8(%rsi), %rcx
movb -0x1(%rcx,%rax), %dl
movb (%rcx,%rax), %dil
movb %dil, -0x1(%rcx,%rax)
movq 0x8(%rsi), %rcx
movb %dl, (%rcx,%rax)
incq %rax
cmpq $0x4, %rax
jne 0x5025
movq 0x10(%rsi), %rax
movb (%rax), %cl
movb 0x2(%rax), %dl
movb %dl, (%rax)
movq 0x10(%rsi), %rax
movb %cl, 0x2(%rax)
movq 0x10(%rsi), %rax
movb 0x1(%rax), %cl
movb 0x3(%rax), %dl
movb %dl, 0x1(%rax)
movq 0x10(%rsi), %rax
movb %cl, 0x3(%rax)
movl $0x4, %eax
movq 0x18(%rsi), %rcx
movb -0x1(%rcx,%rax), %dl
movl %eax, %edi
andl $0x3, %edi
movb (%rcx,%rdi), %r8b
movb %r8b, -0x1(%rcx,%rax)
movq 0x18(%rsi), %rcx
movb %dl, (%rcx,%rdi)
decq %rax
cmpq $0x1, %rax
ja 0x5071
retq
// File: /workspace/github_cpp_makefile_star2_O3/lmclaramunt[P]AES-Crypto/Cipher.cpp
// Function: Cipher::gFMultiply(unsigned char, unsigned char)
unsigned char Cipher::gFMultiply(unsigned char matrixValue, unsigned char st) {
    unsigned char mul = 0x00;
    if (matrixValue%0x02) {
        mul = st;
        matrixValue -= 0x01;
    }
    while (matrixValue) {
        unsigned char xt = st;
        for (int i=0; i < (int)log2(matrixValue); i++){
            xt = xTime(xt);
        }
        mul ^= xt;
        matrixValue %= (unsigned)(int)pow(2, (int)log2(matrixValue));
    }
    return mul;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebp
movl %esi, %edx
xorl %ebx, %ebx
testb $0x1, %dl
cmovnel %ebp, %ebx
andb $-0x2, %dl
je 0x5150
movzbl %dl, %r14d
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
movsd %xmm0, 0x8(%rsp)
callq 0x2410
cvttsd2si %xmm0, %eax
movl %ebp, %r15d
testl %eax, %eax
jle 0x511e
xorl %r12d, %r12d
movl %ebp, %r15d
leal (%r15,%r15), %eax
movzbl %al, %ecx
xorb $0x1b, %al
testb %r15b, %r15b
movzbl %al, %r15d
cmovnsl %ecx, %r15d
incl %r12d
movsd 0x8(%rsp), %xmm0
callq 0x2410
cvttsd2si %xmm0, %eax
cmpl %eax, %r12d
jl 0x50f3
xorb %r15b, %bl
movsd 0x8(%rsp), %xmm0
callq 0x2410
cvttsd2si %xmm0, %edi
movsd 0x2328(%rip), %xmm0     # 0x7460
callq 0x2340
cvttsd2si %xmm0, %ecx
movl %r14d, %eax
xorl %edx, %edx
divl %ecx
testl %edx, %edx
jne 0x50cb
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/lmclaramunt[P]AES-Crypto/Cipher.cpp
// Function: Cipher::mixColumns(unsigned char**, unsigned char**)
void Cipher::mixColumns(unsigned char** st, unsigned char** s2){
    unsigned char matrixValues[4] = {0x02, 0x03, 0x01, 0x01};
    for (int i=0; i < 4; i++) {
        for (unsigned int j=0; j < 4; j++) {
            if (i==0) {
                s2[j] = new unsigned char[4];
            }
            unsigned int temp = 0;
            for (unsigned int k=0; k < 4; k++) {
                temp ^= gFMultiply(matrixValues[(k-j)%4], st[k][i]);
            }
            s2[j][i] = temp;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, 0x8(%rsp)
movq %rsi, %r14
xorl %r15d, %r15d
leaq 0x26be(%rip), %r12      # 0x783e
xorl %r13d, %r13d
xorl %ebx, %ebx
testq %r15, %r15
jne 0x519d
movl $0x4, %edi
callq 0x2030
movq 0x8(%rsp), %rcx
movq %rax, (%rcx,%rbx,8)
movq %rbx, 0x10(%rsp)
xorl %ebx, %ebx
xorl %ebp, %ebp
leal (%rbx,%r13), %eax
andl $0x3, %eax
movzbl (%rax,%r12), %esi
movq (%r14,%rbx,8), %rax
movzbl (%rax,%r15), %edx
callq 0x50aa
xorb %al, %bpl
incq %rbx
cmpq $0x4, %rbx
jne 0x51a6
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rbx
movq (%rax,%rbx,8), %rax
movb %bpl, (%rax,%r15)
incq %rbx
decq %r13
cmpq $0x4, %rbx
jne 0x5185
incq %r15
cmpq $0x4, %r15
jne 0x5180
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lmclaramunt[P]AES-Crypto/Cipher.cpp
// Function: Cipher::invSubBytes(unsigned char**)
void Cipher::invSubBytes(unsigned char** st) {
    for(int i = 0; i < 4; i++) {
        for(int j=0; j < 4; j++) {
            int k = (int)st[i][j];
            st[i][j] = sboxInv[k/16][k%16];
        }
    }
}

// Assembly:
xorl %eax, %eax
leaq 0x2045(%rip), %rcx      # 0x7570
xorl %edx, %edx
movq (%rsi,%rax,8), %rdi
movzbl (%rdi,%rdx), %r8d
movl %r8d, %r9d
andl $0xf, %r9d
andl $-0x10, %r8d
addq %rcx, %r8
movb (%r9,%r8), %r8b
movb %r8b, (%rdi,%rdx)
incq %rdx
cmpq $0x4, %rdx
jne 0x552d
incq %rax
cmpq $0x4, %rax
jne 0x552b
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/lmclaramunt[P]AES-Crypto/Cipher.cpp
// Function: Cipher::invMixColumns(unsigned char**, unsigned char**)
void Cipher::invMixColumns(unsigned char** st, unsigned char** s2) {
    unsigned char matrixValues[4] = {0x0e, 0x0b, 0x0d, 0x09};
    for (int i=0; i < 4; i++) {
        for (unsigned int j=0; j < 4; j++) {
            if (i==0) {
                s2[j] = new unsigned char[4];
            }
            unsigned int temp = 0;
            for (unsigned int k=0; k < 4; k++) {
                temp ^= gFMultiply(matrixValues[(k-j)%4], st[k][i]);
            }
            s2[j][i] = temp;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, 0x8(%rsp)
movq %rsi, %r14
xorl %r15d, %r15d
leaq 0x22c2(%rip), %r12      # 0x7842
xorl %r13d, %r13d
xorl %ebx, %ebx
testq %r15, %r15
jne 0x559d
movl $0x4, %edi
callq 0x2030
movq 0x8(%rsp), %rcx
movq %rax, (%rcx,%rbx,8)
movq %rbx, 0x10(%rsp)
xorl %ebx, %ebx
xorl %ebp, %ebp
leal (%rbx,%r13), %eax
andl $0x3, %eax
movzbl (%rax,%r12), %esi
movq (%r14,%rbx,8), %rax
movzbl (%rax,%r15), %edx
callq 0x50aa
xorb %al, %bpl
incq %rbx
cmpq $0x4, %rbx
jne 0x55a6
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rbx
movq (%rax,%rbx,8), %rax
movb %bpl, (%rax,%r15)
incq %rbx
decq %r13
cmpq $0x4, %rbx
jne 0x5585
incq %r15
cmpq $0x4, %r15
jne 0x5580
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lmclaramunt[P]AES-Crypto/Cipher.cpp
// Function: Cipher::CBC_MAC(Block, bool, bool)
Sequence Cipher::CBC_MAC(Block block, bool encrypting, bool padding){
    Sequence tag(16);
    unsigned char* mssgLength;
    getMessageLength(&mssgLength, encrypting, padding);
    tag.setSequence(mssgLength);
    encrypt(&tag, macKeyExp);
    int i = -1;
    for(Sequence sq: block.getSequenceVector()){
        i++;
        if(!encrypting && (i < 1)) continue;    //First block of ciphertext contains MAC Tag, so ommit it
        tag = tag ^ sq;
        encrypt(&tag, macKeyExp);               //Using a different key than authorization!!
    }
    return tag;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, %ebp
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
movq %rsp, %r12
movq %r12, %rdi
movl $0x10, %esi
callq 0x31dc
leaq 0x20(%rsp), %r13
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movl %ebp, %ecx
callq 0x58e2
movq (%r13), %rsi
movq %r12, %rdi
callq 0x31f8
movq 0x8(%r14), %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x5278
movq %r15, %rdi
callq 0x3572
movq (%rax), %r13
movq 0x8(%rax), %rbp
cmpq %rbp, %r13
je 0x58ca
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movq %rsp, %r15
movups (%r13), %xmm0
movaps %xmm0, 0x10(%rsp)
testl %r12d, %r12d
setns %al
orb %bl, %al
cmpb $0x1, %al
jne 0x58be
movq %r15, %rdi
leaq 0x10(%rsp), %rsi
callq 0x335d
movq (%rax), %rcx
movq %rcx, (%rsp)
movl 0x8(%rax), %eax
movl %eax, 0x8(%rsp)
movq 0x8(%r14), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x5278
addq $0x10, %r13
incl %r12d
cmpq %rbp, %r13
jne 0x587e
movq (%rsp), %rax
movl 0x8(%rsp), %edx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/lmclaramunt[P]AES-Crypto/Cipher.cpp
// Function: Cipher::getMessageLength(unsigned char**, bool, bool)
void Cipher::getMessageLength(unsigned char** s, bool encrypting, bool padding){
    *s = new  unsigned char[16];
    ifstream text(*textPath, ios::binary);
    text.seekg(0, ios::end);
    int length = text.tellg();                     //Get the file's length
    if(encrypting){                                //Length will be the ciphertext length
        length += 32;                              //Add IV and MAC's Tag length
        if(padding) 
            length += (length%16 == 0) ? 16 : (length%16);
    }
    unsigned char bytes[sizeof length];
    std::copy(static_cast<const unsigned char*>(static_cast<const void*>(&length)),
          static_cast<const unsigned char*>(static_cast<const void*>(&length)) + sizeof length,
          bytes);
    for(int i = 0; i < sizeof length; i++)      //First 4 bytes will have length values
        (*s)[i] = bytes[i];
    for(int i = sizeof length; i < 16; i++)     //The remained will be initialzed to zero
        (*s)[i] = 0x00;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movl %ecx, %ebp
movl %edx, %r14d
movq %rsi, %rbx
movq %rdi, %r15
movl $0x10, %edi
callq 0x2030
movq %rax, (%rbx)
movq 0x28(%r15), %rsi
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movl $0x4, %edx
callq 0x2380
movq %r15, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x22d0
leaq 0x10(%rsp), %rdi
callq 0x23f0
testb %r14b, %r14b
je 0x595e
addl $0x20, %eax
testb %bpl, %bpl
je 0x595e
leal 0xf(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
andl $-0x10, %ecx
movl %eax, %edx
subl %ecx, %edx
movl $0x10, %ecx
cmovnel %edx, %ecx
addl %eax, %ecx
movl %ecx, %eax
movl %eax, 0xc(%rsp)
xorl %eax, %eax
movb 0xc(%rsp,%rax), %cl
movq (%rbx), %rdx
movb %cl, (%rdx,%rax)
incq %rax
cmpq $0x4, %rax
jne 0x5964
movl $0x4, %eax
movq (%rbx), %rcx
movb $0x0, (%rcx,%rax)
incq %rax
cmpq $0x10, %rax
jne 0x597c
leaq 0x10(%rsp), %rdi
callq 0x2070
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x59a6
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x2400
nop
// File: /workspace/github_cpp_makefile_star2_O3/lmclaramunt[P]AES-Crypto/Cipher.cpp
// Function: Cipher::authenticateSequences(Sequence*, Sequence*)
bool Cipher::authenticateSequences(Sequence* first, Sequence* second){
    bool same = true;
    for(int i=0; i < 16; i++){
        if(first->getSequence()[i] != second->getSequence()[i]){
            same = false;
            break;
        }
    }
    return same;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rsi, %rdi
callq 0x31f0
movq (%rax), %rax
movb (%rax), %bpl
movq %rbx, %rdi
callq 0x31f0
movq (%rax), %rax
cmpb (%rax), %bpl
jne 0x5a21
xorl %eax, %eax
movq %rax, %r15
cmpq $0xf, %rax
je 0x5a18
movq %r14, %rdi
callq 0x31f0
movq (%rax), %rax
movb 0x1(%rax,%r15), %bpl
movq %rbx, %rdi
callq 0x31f0
movq (%rax), %rcx
leaq 0x1(%r15), %rax
cmpb 0x1(%rcx,%r15), %bpl
je 0x59e9
cmpq $0xf, %r15
setae %al
jmp 0x5a23
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/lmclaramunt[P]AES-Crypto/Cipher.cpp
// Function: Cipher::removePadding(Sequence*)
void Cipher::removePadding(Sequence* lastPlainText) { 
    int paddingValue = lastPlainText->getSequence()[15];    //Last byte tells how many bytes to remove      
    bool error = false;
    for(int i = 15; i > 16-paddingValue; i--){
        if(lastPlainText->getSequence()[i] != paddingValue){
            error = true;
            break;
        }
    }
    if(!error){
        lastPlainText->setSize(16-paddingValue);
    }else
        throw "Padding error!\n";   //Error if the last block doesn't containt `10` in its last bytes
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rsi, %rdi
callq 0x31f0
movq (%rax), %rax
movzbl 0xf(%rax), %r15d
movl $0x10, %r14d
subq %r15, %r14
cmpq $0x2, %r15
jb 0x5a77
movl $0xf, %r12d
movq %rbx, %rdi
callq 0x31f0
movq (%rax), %rax
cmpb %r15b, (%rax,%r12)
jne 0x5a8d
decq %r12
cmpq %r14, %r12
jg 0x5a5e
movq %rbx, %rdi
movl %r14d, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x31fc
movl $0x8, %edi
callq 0x2120
leaq 0x1ce5(%rip), %rcx      # 0x7783
movq %rcx, (%rax)
movq 0x5518(%rip), %rsi      # 0xafc0
movq %rax, %rdi
xorl %edx, %edx
callq 0x23d0
// File: /workspace/github_cpp_makefile_star2_O3/lmclaramunt[P]AES-Crypto/Cipher.cpp
// Function: Cipher::writePlainText()
void Cipher::writePlainText(){
    ofstream plaintext;
    plaintext.open(*textPath, ios::binary);
    int i = -1;
    for(Sequence sq: inputBlock->getSequenceVector()){
        i++;
        if(i <= 1) continue;           //Don't write neither IV nor MAC Tag in Plaintext
        plaintext.write((const char*)sq.getSequence(), sq.getSize());
    }
    plaintext.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rdi, %rbx
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x23c0
movq 0x28(%rbx), %rsi
movq %r14, %rdi
movl $0x4, %edx
callq 0x2100
movq 0x10(%rbx), %rdi
callq 0x3572
movq (%rax), %r12
movq 0x8(%rax), %r13
cmpq %r13, %r12
je 0x5b3f
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %rsp, %rbx
leaq 0x18(%rsp), %r14
movups (%r12), %xmm0
movaps %xmm0, (%rsp)
testl %ebp, %ebp
jle 0x5b34
movq %rbx, %rdi
callq 0x31f0
movq (%rax), %r15
movq %rbx, %rdi
callq 0x31f4
movslq %eax, %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x22c0
addq $0x10, %r12
incl %ebp
cmpq %r13, %r12
jne 0x5b06
leaq 0x18(%rsp), %rdi
callq 0x2300
movq 0x5480(%rip), %rax      # 0xafd0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x20(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x18(%rsp,%rcx)
callq 0x21d0
leaq 0x110(%rsp), %rdi
callq 0x20b0
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5b93
jmp 0x5b93
jmp 0x5b93
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x2320
movq %rbx, %rdi
callq 0x2400
// File: /workspace/github_cpp_makefile_star2_O3/lmclaramunt[P]AES-Crypto/Cipher.cpp
// Function: Cipher::writeCipherText(Sequence*)
void Cipher::writeCipherText(Sequence* tag){
    ofstream ciphertext;
    ciphertext.open(*textPath, ios::binary);
    ciphertext.write((const char*)tag->getSequence(), tag->getSize());
    for(Sequence sq: inputBlock->getSequenceVector()){
    ciphertext.write((const char*)sq.getSequence(), sq.getSize());
    }
    ciphertext.close();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x23c0
movq 0x28(%rbx), %rsi
movq %r15, %rdi
movl $0x4, %edx
callq 0x2100
movq %r14, %rdi
callq 0x31f0
movq (%rax), %r15
movq %r14, %rdi
callq 0x31f4
movslq %eax, %rdx
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x22c0
movq 0x10(%rbx), %rdi
callq 0x3572
movq (%rax), %r12
movq 0x8(%rax), %r13
cmpq %r13, %r12
je 0x5c4f
movq %rsp, %rbx
leaq 0x10(%rsp), %r14
movups (%r12), %xmm0
movaps %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x31f0
movq (%rax), %r15
movq %rbx, %rdi
callq 0x31f4
movslq %eax, %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x22c0
addq $0x10, %r12
cmpq %r13, %r12
jne 0x5c1c
leaq 0x10(%rsp), %rdi
callq 0x2300
movq 0x5370(%rip), %rax      # 0xafd0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x18(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x10(%rsp,%rcx)
callq 0x21d0
leaq 0x108(%rsp), %rdi
callq 0x20b0
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x5ca0
jmp 0x5ca0
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2320
movq %rbx, %rdi
callq 0x2400
nop
// File: /workspace/github_cpp_makefile_star2_O3/lmclaramunt[P]AES-Crypto/Cipher.cpp
// Function: Cipher::CBC_encrypt()
void Cipher::CBC_encrypt(){
    Sequence ivSq(16), ivOriginal(16);      //ivOriginal keeps track of IV, to write it in ciphertext
    generateKey(ivSq.getSequence(), 4);
    ivOriginal.updateSequence(ivSq);
    
    //Encrypt
    for(Sequence sq: inputBlock->getSequenceVector()){  
        ivSq = sq ^ ivSq;
        encrypt(&ivSq, aesKeyExp);
    }

    //Authenticate
    inputBlock->getSequenceVector().
        insert(inputBlock->getSequenceVector().begin(), ivOriginal);    //Append IV to Ciphertext
    Sequence tag = CBC_MAC(*inputBlock, true, true);    // both bool true since we are encrypting with padding
    
    //Write ciphertext after encryption and authentication
    writeCipherText(&tag);
    /* Sequence cleanup as it can leave traces in memory */
    ivSq.~Sequence();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
movq %rsp, %r14
movq %r14, %rdi
movl $0x10, %esi
callq 0x31dc
leaq 0x40(%rsp), %r15
movq %r15, %rdi
movl $0x10, %esi
callq 0x31dc
movq %r14, %rdi
callq 0x31f0
movq (%rax), %rsi
movl $0x4, %edx
callq 0x4bd2
movq (%r14), %rsi
movl 0x8(%r14), %edx
movq %r15, %rdi
callq 0x327e
movq 0x10(%rbx), %rdi
callq 0x3572
movq (%rax), %r12
movq 0x8(%rax), %r13
cmpq %r13, %r12
je 0x5d63
leaq 0x10(%rsp), %r14
movq %rsp, %r15
movups (%r12), %xmm0
movaps %xmm0, 0x10(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x335d
movq (%rax), %rcx
movq %rcx, (%rsp)
movl 0x8(%rax), %eax
movl %eax, 0x8(%rsp)
movq (%rbx), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5278
addq $0x10, %r12
cmpq %r13, %r12
jne 0x5d29
movq 0x10(%rbx), %rdi
callq 0x3572
movq %rax, %r14
movq 0x10(%rbx), %rdi
callq 0x3572
movq (%rax), %rsi
leaq 0x40(%rsp), %rdx
movq %r14, %rdi
callq 0x634c
movq 0x10(%rbx), %rsi
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0x644a
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x580a
leaq 0x10(%rsp), %r14
movq %rax, (%r14)
movl %edx, 0x8(%r14)
leaq 0x28(%rsp), %rdi
callq 0x353c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5ba8
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x353c
movq %rbx, %rdi
callq 0x2400
// File: /workspace/github_cpp_makefile_star2_O3/lmclaramunt[P]AES-Crypto/Cipher.cpp
// Function: Cipher::OFB_encrypt()
void Cipher::OFB_encrypt(){   
    Sequence ivSq(16), ivOriginal(16);
    time_t rawtime;
    struct tm * timeinfo;
    unsigned char iv[16];
    time(&rawtime);
    timeinfo = localtime(&rawtime);
    strftime ((char *)iv, 16, "%r", timeinfo);
    ivSq.setSequence(iv);
    ivOriginal.updateSequence(ivSq);        //Keep track of IV to write it in Ciphertext
    
    //Encrypt
    for(Sequence sq: inputBlock->getSequenceVector()){
        encrypt(&ivSq, aesKeyExp);
        sq = sq ^ ivSq;
    }

    //Authenticate
    inputBlock->getSequenceVector().
        insert(inputBlock->getSequenceVector().begin(), ivOriginal);    //Append IV to Ciphertext
    Sequence tag = CBC_MAC(*inputBlock, true, false);       //Get MAC Tag, we are encrypting without padding
    
    //Write ciphertext after encryption and authentication
    writeCipherText(&tag);
    /* Sequence cleanup as it can leave traces in memory */
    ivSq.~Sequence();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rdi, %rbx
leaq 0x40(%rsp), %r14
movq %r14, %rdi
movl $0x10, %esi
callq 0x31dc
leaq 0x30(%rsp), %r15
movq %r15, %rdi
movl $0x10, %esi
callq 0x31dc
leaq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0x2200
movq %r12, %rdi
callq 0x2190
leaq 0x1763(%rip), %rdx      # 0x77c9
leaq 0x50(%rsp), %r12
movl $0x10, %esi
movq %r12, %rdi
movq %rax, %rcx
callq 0x21b0
movq %r14, %rdi
movq %r12, %rsi
callq 0x31f8
movq (%r14), %rsi
movl 0x8(%r14), %edx
movq %r15, %rdi
callq 0x327e
movq 0x10(%rbx), %rdi
callq 0x3572
movq (%rax), %r12
movq 0x8(%rax), %r13
cmpq %r13, %r12
je 0x60dd
leaq 0x40(%rsp), %r14
movq %rsp, %r15
movups (%r12), %xmm0
movaps %xmm0, (%rsp)
movq (%rbx), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5278
movq %r15, %rdi
movq %r14, %rsi
callq 0x335d
addq $0x10, %r12
cmpq %r13, %r12
jne 0x60b2
movq 0x10(%rbx), %rdi
callq 0x3572
movq %rax, %r14
movq 0x10(%rbx), %rdi
callq 0x3572
movq (%rax), %rsi
leaq 0x30(%rsp), %rdx
movq %r14, %rdi
callq 0x634c
movq 0x10(%rbx), %rsi
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x644a
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x580a
movq %rsp, %r14
movq %rax, (%r14)
movl %edx, 0x8(%r14)
leaq 0x10(%rsp), %rdi
callq 0x353c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5ba8
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x353c
movq %rbx, %rdi
callq 0x2400
nop