LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/ArthoPacini[P]blockchaincpp/./nlohmann/json.hpp
// Function: nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>>::push_back(std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>>> const&)
void push_back(const typename object_t::value_type& val)
    {
        // push_back only works for null objects or objects
        if (JSON_HEDLEY_UNLIKELY(!(is_null() || is_object())))
        {
            JSON_THROW(type_error::create(308, "cannot use push_back() with " + std::string(type_name())));
        }

        // transform null object into an object
        if (is_null())
        {
            m_type = value_t::object;
            m_value = value_t::object;
            assert_invariant();
        }

        // add element to array
        m_value.object->insert(val);
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movzbl (%rdi), %eax
testl %eax, %eax
jne 0xa386
movb $0x1, (%r14)
callq 0x82cc
movq %rax, 0x8(%r14)
movq %r14, %rdi
callq 0x7766
jmp 0xa38b
cmpl $0x1, %eax
jne 0xa39f
movq 0x8(%r14), %rdi
movq %rbx, %rsi
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0xa526
pushq $0x20
popq %rdi
callq 0x41d0
movq %rax, %rbx
movq %r14, %rdi
callq 0x7fbe
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
movq %rax, %rsi
callq 0x52b2
leaq 0xcbce(%rip), %rsi      # 0x16f99
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x7f9a
movb $0x1, %bpl
leaq 0x30(%rsp), %rdx
movq %rbx, %rdi
movl $0x134, %esi            # imm = 0x134
callq 0x7ba2
xorl %ebp, %ebp
leaq 0x1a7a0(%rip), %rsi     # 0x24b98
leaq 0x5b6b(%rip), %rdx      # 0xff6a
movq %rbx, %rdi
callq 0x4560
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x41a0
jmp 0xa41c
movq %rax, %r14
movb $0x1, %bpl
leaq 0x10(%rsp), %rdi
callq 0x41a0
testb %bpl, %bpl
jne 0xa430
jmp 0xa438
movq %rax, %r14
movq %rbx, %rdi
callq 0x42c0
movq %r14, %rdi
callq 0x4570
// File: /workspace/github_cpp_makefile_star2_O2/ArthoPacini[P]blockchaincpp/./nlohmann/json.hpp
// Function: nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>>::push_back(nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>>&&)
void push_back(basic_json&& val)
    {
        // push_back only works for null objects or arrays
        if (JSON_HEDLEY_UNLIKELY(!(is_null() || is_array())))
        {
            JSON_THROW(type_error::create(308, "cannot use push_back() with " + std::string(type_name())));
        }

        // transform null object into an array
        if (is_null())
        {
            m_type = value_t::array;
            m_value = value_t::array;
            assert_invariant();
        }

        // add element to array (move semantics)
        m_value.array->push_back(std::move(val));
        // if val is moved from, basic_json move constructor marks it null so we do not call the destructor
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movzbl (%rdi), %eax
testl %eax, %eax
jne 0xa46c
movb $0x2, (%r14)
callq 0x8320
movq %rax, 0x8(%r14)
movq %r14, %rdi
callq 0x7766
jmp 0xa471
cmpl $0x2, %eax
jne 0xa485
movq 0x8(%r14), %rdi
movq %rbx, %rsi
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x9446
pushq $0x20
popq %rdi
callq 0x41d0
movq %rax, %rbx
movq %r14, %rdi
callq 0x7fbe
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
movq %rax, %rsi
callq 0x52b2
leaq 0xcae8(%rip), %rsi      # 0x16f99
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x7f9a
movb $0x1, %bpl
leaq 0x30(%rsp), %rdx
movq %rbx, %rdi
movl $0x134, %esi            # imm = 0x134
callq 0x7ba2
xorl %ebp, %ebp
leaq 0x1a6ba(%rip), %rsi     # 0x24b98
leaq 0x5a85(%rip), %rdx      # 0xff6a
movq %rbx, %rdi
callq 0x4560
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x41a0
jmp 0xa502
movq %rax, %r14
movb $0x1, %bpl
leaq 0x10(%rsp), %rdi
callq 0x41a0
testb %bpl, %bpl
jne 0xa516
jmp 0xa51e
movq %rax, %r14
movq %rbx, %rdi
callq 0x42c0
movq %r14, %rdi
callq 0x4570
// File: /workspace/github_cpp_makefile_star2_O2/ArthoPacini[P]blockchaincpp/./nlohmann/json.hpp
// Function: nlohmann::detail::input_stream_adapter::~input_stream_adapter()
~input_stream_adapter()
    {
        // clear stream flags; we use underlying streambuf I/O, do not
        // maintain ifstream flags, except eof
        if (is != nullptr)
        {
            is->clear(is->rdstate() & std::ios::eofbit);
        }
    }

// Assembly:
pushq %rax
movq (%rdi), %rax
testq %rax, %rax
je 0xe01e
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %rdi
movl 0x20(%rax,%rcx), %esi
andl $0x2, %esi
callq 0x4540
popq %rax
retq
movq %rax, %rdi
callq 0x5d74
// File: /workspace/github_cpp_makefile_star2_O2/ArthoPacini[P]blockchaincpp/./nlohmann/json.hpp
// Function: nlohmann::detail::input_stream_adapter::get_character()
std::char_traits<char>::int_type get_character()
    {
        auto res = sb->sbumpc();
        // set eof manually, as we don't use the istream interface.
        if (JSON_HEDLEY_UNLIKELY(res == EOF))
        {
            is->clear(is->rdstate() | std::ios::eofbit);
        }
        return res;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x8(%rdi), %rdi
callq 0x4200
movl %eax, %ebx
cmpl $-0x1, %eax
je 0xecb7
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq (%r14), %rax
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %rdi
movl 0x20(%rax,%rcx), %esi
orl $0x2, %esi
callq 0x4540
jmp 0xecad
nop
// File: /workspace/github_cpp_makefile_star2_O2/ArthoPacini[P]blockchaincpp/./Transaction.hpp
// Function: Transaction::Transaction(nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>>)
Transaction(nlohmann::json transaction_json)
    {
        this->amount = transaction_json["amount"];
        this->senderKey = transaction_json["senderKey"];
        this->receiverKey = transaction_json["receiverKey"];
        this->timestamp = transaction_json["timestamp"];
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %r13
leaq 0x18(%rdi), %rax
movq %rax, 0x8(%rdi)
andq $0x0, 0x10(%rdi)
movq %rsi, %r12
xorl %eax, %eax
movb %al, 0x18(%rdi)
leaq 0x38(%rdi), %rcx
movq %rcx, 0x28(%rdi)
andq $0x0, 0x30(%rdi)
leaq 0x8(%rdi), %rbx
leaq 0x28(%rdi), %r14
movb %al, 0x38(%rdi)
leaq 0x48(%rdi), %r15
callq 0x4050
movq %r15, %rdi
movq %rax, %rsi
callq 0x4c3b
leaq 0x2b00(%rip), %rsi      # 0x16f72
movq %r12, %rdi
callq 0x99e4
movq %rax, %rdi
callq 0x1486a
movsd %xmm0, (%r13)
leaq 0x2aea(%rip), %rsi      # 0x16f79
movq %r12, %rdi
callq 0x99e4
movq %rsp, %rdi
movq %rax, %rsi
callq 0x14664
movq %rsp, %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4400
movq %r13, %rdi
callq 0x41a0
leaq 0x2ac4(%rip), %rsi      # 0x16f83
movq %r12, %rdi
callq 0x99e4
movq %rsp, %rdi
movq %rax, %rsi
callq 0x14664
movq %rsp, %r13
movq %r14, %rdi
movq %r13, %rsi
callq 0x4400
movq %r13, %rdi
callq 0x41a0
leaq 0x2aa0(%rip), %rsi      # 0x16f8f
movq %r12, %rdi
callq 0x99e4
movq %rsp, %rdi
movq %rax, %rsi
callq 0x14664
movq %rsp, %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4400
movq %rbx, %rdi
callq 0x41a0
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r12
jmp 0x1453c
jmp 0x14531
jmp 0x14531
jmp 0x14531
movq %rax, %r12
movq %r15, %rdi
callq 0x41a0
movq %r14, %rdi
callq 0x41a0
movq %rbx, %rdi
callq 0x41a0
movq %r12, %rdi
callq 0x4570
// File: /workspace/github_cpp_makefile_star2_O2/divinity76[P]pi_compression/compressor/compressor.cpp
// Function: file_get_contents(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
static std::string file_get_contents(const std::string &$filename)
{
    std::ostringstream ss;
    std::ifstream ifs($filename,std::ifstream::binary);
    ifs.exceptions ( std::ifstream::failbit | std::ifstream::badbit );
    ss << ifs.rdbuf();
    return ss.str();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x380, %rsp            # imm = 0x380
movq %rsi, %r15
movq %rdi, %rbx
movq %rsp, %rdi
callq 0x2180
leaq 0x178(%rsp), %r14
pushq $0x4
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x21c0
movq 0x178(%rsp), %rax
addq -0x18(%rax), %r14
pushq $0x5
popq %rsi
movq %r14, %rdi
callq 0x2090
leaq 0x188(%rsp), %rsi
movq %rsp, %rdi
callq 0x2030
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x21b0
leaq 0x178(%rsp), %rdi
callq 0x2060
movq %rsp, %rdi
callq 0x2050
movq %rbx, %rax
addq $0x380, %rsp            # imm = 0x380
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
jmp 0x281a
movq %rax, %rbx
leaq 0x178(%rsp), %rdi
callq 0x2060
movq %rsp, %rdi
callq 0x2050
movq %rbx, %rdi
callq 0x21e0
// File: /workspace/github_cpp_makefile_star2_O2/DiplIngFrankGerlach[P]MST/./aes/aes.c
// Function: aes_encrypt_cbc
int aes_encrypt_cbc(const BYTE in[], size_t in_len, BYTE out[], const WORD key[], int keysize, const BYTE iv[])
{
	BYTE buf_in[AES_BLOCK_SIZE], buf_out[AES_BLOCK_SIZE], iv_buf[AES_BLOCK_SIZE];
	int blocks, idx;

	if (in_len % AES_BLOCK_SIZE != 0)
		return(FALSE);

	blocks = in_len / AES_BLOCK_SIZE;

	memcpy(iv_buf, iv, AES_BLOCK_SIZE);

	for (idx = 0; idx < blocks; idx++) {
		memcpy(buf_in, &in[idx * AES_BLOCK_SIZE], AES_BLOCK_SIZE);
		xor_buf(iv_buf, buf_in, AES_BLOCK_SIZE);
		aes_encrypt(buf_in, buf_out, key, keysize);
		memcpy(&out[idx * AES_BLOCK_SIZE], buf_out, AES_BLOCK_SIZE);
		memcpy(iv_buf, buf_out, AES_BLOCK_SIZE);
	}

	return(TRUE);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r12
xorl %eax, %eax
testb $0xf, %r12b
jne 0x13de
movq %rdi, %r15
movq %rdx, %r13
movq %rcx, 0x8(%rsp)
movl %r8d, %r14d
shrq $0x4, %r12
movups (%r9), %xmm0
leaq 0x10(%rsp), %rax
movaps %xmm0, (%rax)
xorl %ebx, %ebx
testl %r12d, %r12d
cmovlel %ebx, %r12d
shlq $0x4, %r12
leaq 0x30(%rsp), %rbp
cmpq %rbx, %r12
je 0x13db
movups (%r15,%rbx), %xmm0
movaps %xmm0, 0x30(%rsp)
leaq 0x10(%rsp), %rdi
movq %rbp, %rsi
pushq $0x10
popq %rdx
callq 0x132c
movq %rbp, %rdi
leaq 0x20(%rsp), %rsi
movq 0x8(%rsp), %rdx
movl %r14d, %ecx
callq 0x13ed
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%r13,%rbx)
movaps 0x20(%rsp), %xmm0
movaps %xmm0, 0x10(%rsp)
addq $0x10, %rbx
jmp 0x138c
pushq $0x1
popq %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DiplIngFrankGerlach[P]MST/./aes/aes.c
// Function: aes_encrypt_cbc_mac
int aes_encrypt_cbc_mac(const BYTE in[], size_t in_len, BYTE out[], const WORD key[], int keysize, const BYTE iv[])
{
	BYTE buf_in[AES_BLOCK_SIZE], buf_out[AES_BLOCK_SIZE], iv_buf[AES_BLOCK_SIZE];
	int blocks, idx;

	if (in_len % AES_BLOCK_SIZE != 0)
		return(FALSE);

	blocks = in_len / AES_BLOCK_SIZE;

	memcpy(iv_buf, iv, AES_BLOCK_SIZE);

	for (idx = 0; idx < blocks; idx++) {
		memcpy(buf_in, &in[idx * AES_BLOCK_SIZE], AES_BLOCK_SIZE);
		xor_buf(iv_buf, buf_in, AES_BLOCK_SIZE);
		aes_encrypt(buf_in, buf_out, key, keysize);
		memcpy(iv_buf, buf_out, AES_BLOCK_SIZE);
		// Do not output all encrypted blocks.
	}

	memcpy(out, buf_out, AES_BLOCK_SIZE);   // Only output the last block.

	return(TRUE);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r15
xorl %eax, %eax
testb $0xf, %r15b
jne 0x1a95
movl %r8d, %ebp
movq %rcx, %r14
movq %rdi, %r12
movq %rdx, 0x8(%rsp)
shrq $0x4, %r15
movups (%r9), %xmm0
leaq 0x10(%rsp), %rax
movaps %xmm0, (%rax)
xorl %r13d, %r13d
testl %r15d, %r15d
cmovlel %r13d, %r15d
shlq $0x4, %r15
leaq 0x30(%rsp), %rbx
cmpq %r13, %r15
je 0x1a85
movups (%r12,%r13), %xmm0
movaps %xmm0, 0x30(%rsp)
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
pushq $0x10
popq %rdx
callq 0x132c
movq %rbx, %rdi
leaq 0x20(%rsp), %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x13ed
movaps 0x20(%rsp), %xmm0
movaps %xmm0, 0x10(%rsp)
addq $0x10, %r13
jmp 0x1a44
movaps 0x20(%rsp), %xmm0
movq 0x8(%rsp), %rax
movups %xmm0, (%rax)
pushq $0x1
popq %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DiplIngFrankGerlach[P]MST/./aes/aes.c
// Function: aes_decrypt_cbc
int aes_decrypt_cbc(const BYTE in[], size_t in_len, BYTE out[], const WORD key[], int keysize, const BYTE iv[])
{
	BYTE buf_in[AES_BLOCK_SIZE], buf_out[AES_BLOCK_SIZE], iv_buf[AES_BLOCK_SIZE];
	int blocks, idx;

	if (in_len % AES_BLOCK_SIZE != 0)
		return(FALSE);

	blocks = in_len / AES_BLOCK_SIZE;

	memcpy(iv_buf, iv, AES_BLOCK_SIZE);

	for (idx = 0; idx < blocks; idx++) {
		memcpy(buf_in, &in[idx * AES_BLOCK_SIZE], AES_BLOCK_SIZE);
		aes_decrypt(buf_in, buf_out, key, keysize);
		xor_buf(iv_buf, buf_out, AES_BLOCK_SIZE);
		memcpy(&out[idx * AES_BLOCK_SIZE], buf_out, AES_BLOCK_SIZE);
		memcpy(iv_buf, buf_in, AES_BLOCK_SIZE);
	}

	return(TRUE);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r12
xorl %eax, %eax
testb $0xf, %r12b
jne 0x1b45
movl %r8d, %r14d
movq %rcx, %r15
movq %rdi, %r13
movq %rdx, 0x8(%rsp)
shrq $0x4, %r12
movups (%r9), %xmm0
leaq 0x10(%rsp), %rax
movaps %xmm0, (%rax)
xorl %ebx, %ebx
testl %r12d, %r12d
cmovlel %ebx, %r12d
shlq $0x4, %r12
leaq 0x30(%rsp), %rbp
cmpq %rbx, %r12
je 0x1b42
movups (%r13,%rbx), %xmm0
movaps %xmm0, 0x20(%rsp)
leaq 0x20(%rsp), %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r14d, %ecx
callq 0x1b54
leaq 0x10(%rsp), %rdi
movq %rbp, %rsi
pushq $0x10
popq %rdx
callq 0x132c
movaps 0x30(%rsp), %xmm0
movq 0x8(%rsp), %rax
movups %xmm0, (%rax,%rbx)
movaps 0x20(%rsp), %xmm0
movaps %xmm0, 0x10(%rsp)
addq $0x10, %rbx
jmp 0x1af1
pushq $0x1
popq %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DiplIngFrankGerlach[P]MST/./aes/aes.c
// Function: increment_iv
void increment_iv(BYTE iv[], int counter_size)
{
	int idx;

	// Use counter_size bytes at the end of the IV as the big-endian integer to increment.
	for (idx = AES_BLOCK_SIZE - 1; idx >= AES_BLOCK_SIZE - counter_size; idx--) {
		iv[idx]++;
		if (iv[idx] != 0 || idx == AES_BLOCK_SIZE - counter_size)
			break;
	}
}

// Assembly:
pushq $0x10
popq %rax
subl %esi, %eax
cltq
movslq %esi, %rcx
pushq $0xf
popq %rdx
cmpq %rax, %rdx
jl 0x219c
leaq (%rcx,%rdx), %r8
movb (%rdi,%rdx), %sil
incb %sil
movb %sil, (%rdi,%rdx)
cmpq $0x10, %r8
je 0x219c
decq %rdx
testb %sil, %sil
je 0x217a
retq
// File: /workspace/github_cpp_makefile_star2_O2/DiplIngFrankGerlach[P]MST/./aes/aes.c
// Function: aes_encrypt_ctr
void aes_encrypt_ctr(const BYTE in[], size_t in_len, BYTE out[], const WORD key[], int keysize, const BYTE iv[])
{
	size_t idx = 0, last_block_length;
	BYTE iv_buf[AES_BLOCK_SIZE], out_buf[AES_BLOCK_SIZE];

	if (in != out)
		memcpy(out, in, in_len);

	memcpy(iv_buf, iv, AES_BLOCK_SIZE);
	last_block_length = in_len - AES_BLOCK_SIZE;

	if (in_len > AES_BLOCK_SIZE) {
		for (idx = 0; idx < last_block_length; idx += AES_BLOCK_SIZE) {
			aes_encrypt(iv_buf, out_buf, key, keysize);
			xor_buf(out_buf, &out[idx], AES_BLOCK_SIZE);
			increment_iv(iv_buf, AES_BLOCK_SIZE);
		}
	}

	aes_encrypt(iv_buf, out_buf, key, keysize);
	xor_buf(out_buf, &out[idx], in_len - idx);   // Use the Most Significant bytes.
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %r14
movl %r8d, 0x4(%rsp)
movq %rcx, %r15
movq %rdx, %rbx
movq %rsi, %r13
cmpq %rdx, %rdi
je 0x21cf
movq %rdi, %rsi
movq %rbx, %rdi
movq %r13, %rdx
callq 0x10e0
movups (%r14), %xmm0
movaps %xmm0, 0x10(%rsp)
cmpq $0x11, %r13
jb 0x2232
movq %r13, 0x8(%rsp)
leaq -0x10(%r13), %rbp
xorl %r14d, %r14d
leaq 0x10(%rsp), %r12
leaq 0x20(%rsp), %r13
cmpq %rbp, %r14
jae 0x222b
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
movl 0x4(%rsp), %ecx
callq 0x13ed
leaq (%rbx,%r14), %rsi
movq %r13, %rdi
pushq $0x10
popq %rdx
callq 0x132c
movq %r12, %rdi
pushq $0x10
popq %rsi
callq 0x216d
addq $0x10, %r14
jmp 0x21f4
movq 0x8(%rsp), %r13
jmp 0x2235
xorl %r14d, %r14d
leaq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %r12
movq %r12, %rsi
movq %r15, %rdx
movl 0x4(%rsp), %ecx
callq 0x13ed
addq %r14, %rbx
subq %r14, %r13
movq %r12, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x132c
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DiplIngFrankGerlach[P]MST/./aes/aes.c
// Function: aes_key_setup
void aes_key_setup(const BYTE key[], WORD w[], int keysize)
{
	int Nb=4,Nr,Nk,idx;
	WORD temp,Rcon[]={0x01000000,0x02000000,0x04000000,0x08000000,0x10000000,0x20000000,
	                  0x40000000,0x80000000,0x1b000000,0x36000000,0x6c000000,0xd8000000,
	                  0xab000000,0x4d000000,0x9a000000};

	switch (keysize) {
		case 128: Nr = 10; Nk = 4; break;
		case 192: Nr = 12; Nk = 6; break;
		case 256: Nr = 14; Nk = 8; break;
		default: return;
	}

	for (idx=0; idx < Nk; ++idx) {
		w[idx] = ((key[4 * idx]) << 24) | ((key[4 * idx + 1]) << 16) |
				   ((key[4 * idx + 2]) << 8) | ((key[4 * idx + 3]));
	}

	for (idx = Nk; idx < Nb * (Nr+1); ++idx) {
		temp = w[idx - 1];
		if ((idx % Nk) == 0)
			temp = SubWord(KE_ROTWORD(temp)) ^ Rcon[(idx-1)/Nk];
		else if (Nk > 6 && (idx % Nk) == 4)
			temp = SubWord(temp);
		w[idx] = w[idx-Nk] ^ temp;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r13
cmpl $0x80, %edx
je 0x24ec
cmpl $0x100, %edx            # imm = 0x100
je 0x24e0
cmpl $0xc0, %edx
jne 0x256f
pushq $0x6
popq %rax
pushq $0x34
jmp 0x24f1
pushq $0x8
popq %rax
movb $0x1, %bpl
pushq $0x3c
popq %r15
jmp 0x24f5
pushq $0x4
popq %rax
pushq $0x2c
popq %r15
xorl %ebp, %ebp
movl %eax, %r12d
xorl %eax, %eax
cmpq %rax, %r12
je 0x250e
movl (%rdi,%rax,4), %ecx
bswapl %ecx
movl %ecx, (%r13,%rax,4)
incq %rax
jmp 0x24fa
xorb $0x1, %bpl
movq %r13, %rbx
movq %r12, %r14
cmpq %r14, %r15
je 0x256f
movl -0x4(%r13,%r14,4), %edi
movl %r14d, %eax
xorl %edx, %edx
divl %r12d
testl %edx, %edx
je 0x2542
cmpl $0x4, %edx
setne %al
orb %bpl, %al
jne 0x255f
callq 0x295c
movl %eax, %edi
jmp 0x255f
roll $0x8, %edi
callq 0x295c
movl %eax, %edi
leal -0x1(%r14), %eax
xorl %edx, %edx
divl %r12d
leaq 0x2bc4(%rip), %rcx      # 0x5120
xorl (%rcx,%rax,4), %edi
xorl (%rbx), %edi
movl %edi, (%r13,%r14,4)
incq %r14
addq $0x4, %rbx
jmp 0x2518
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DiplIngFrankGerlach[P]MST/./aes/aes.c
// Function: ccm_prepare_first_format_blk
void ccm_prepare_first_format_blk(BYTE buf[], int assoc_len, int payload_len, int payload_len_store_size, int mac_len, const BYTE nonce[], int nonce_len)
{
	// Set the flags for the first byte of the first block.
	buf[0] = ((((mac_len - 2) / 2) & 0x07) << 3) | ((payload_len_store_size - 1) & 0x07);
	if (assoc_len > 0)
		buf[0] += 0x40;
	// Format the rest of the first block, storing the nonce and the size of the payload.
	memcpy(&buf[1], nonce, nonce_len);
	memset(&buf[1 + nonce_len], 0, AES_BLOCK_SIZE - 1 - nonce_len);
	buf[15] = payload_len & 0x000000FF;
	buf[14] = (payload_len >> 8) & 0x000000FF;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rdi, %r14
movslq 0x20(%rsp), %r15
leal -0x2(%r8), %eax
pushq $0x2
popq %rdi
cltd
idivl %edi
andl $0x7, %eax
decl %ecx
andl $0x7, %ecx
leal (%rcx,%rax,8), %eax
leal 0x40(%rax), %ecx
testl %esi, %esi
movzbl %cl, %ecx
cmovlel %eax, %ecx
movb %cl, (%r14)
leaq 0x1(%r14), %rdi
movq %r9, %rsi
movq %r15, %rdx
callq 0x10e0
leaq (%r14,%r15), %rdi
incq %rdi
pushq $0xf
popq %rax
subl %r15d, %eax
movslq %eax, %rdx
xorl %esi, %esi
callq 0x1090
rolw $0x8, %bx
movw %bx, 0xe(%r14)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/DiplIngFrankGerlach[P]MST/./aes/aes.c
// Function: ccm_format_assoc_data
void ccm_format_assoc_data(BYTE buf[], int *end_of_buf, const BYTE assoc[], int assoc_len)
{
	int pad;

	buf[*end_of_buf + 1] = assoc_len & 0x00FF;
	buf[*end_of_buf] = (assoc_len >> 8) & 0x00FF;
	*end_of_buf += 2;
	memcpy(&buf[*end_of_buf], assoc, assoc_len);
	*end_of_buf += assoc_len;
	pad = AES_BLOCK_SIZE - (*end_of_buf % AES_BLOCK_SIZE); /*BUG?*/
	memset(&buf[*end_of_buf], 0, pad);
	*end_of_buf += pad;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %rbp
movslq (%rsi), %rax
movb %cl, 0x1(%rdi,%rax)
movslq (%rsi), %rax
movb %ch, (%rdi,%rax)
movslq (%rsi), %rax
leaq 0x2(%rax), %rsi
movl %esi, (%rbx)
leaq 0x2(%rdi,%rax), %rdi
movslq %ecx, %r14
movq %rdx, %rsi
movq %r14, %rdx
callq 0x10e0
movslq (%rbx), %rdi
addq %r14, %rdi
movl %edi, (%rbx)
pushq $0x10
popq %r14
movl %edi, %eax
cltd
idivl %r14d
subl %edx, %r14d
addq %rbp, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x1090
addl %r14d, (%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DiplIngFrankGerlach[P]MST/./aes/aes.c
// Function: ccm_format_payload_data
void ccm_format_payload_data(BYTE buf[], int *end_of_buf, const BYTE payload[], int payload_len)
{
	int pad;

	memcpy(&buf[*end_of_buf], payload, payload_len);
	*end_of_buf += payload_len;
	pad = *end_of_buf % AES_BLOCK_SIZE;
	if (pad != 0)
		pad = AES_BLOCK_SIZE - pad;
	memset(&buf[*end_of_buf], 0, pad);
	*end_of_buf += pad;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movslq (%rsi), %rdi
addq %r14, %rdi
movslq %ecx, %r15
movq %rdx, %rsi
movq %r15, %rdx
callq 0x10e0
movslq (%rbx), %rdi
addq %r15, %rdi
movl %edi, (%rbx)
pushq $0x10
popq %r15
movl %edi, %eax
cltd
idivl %r15d
subl %edx, %r15d
testl %edx, %edx
cmovel %edx, %r15d
addq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x1090
addl %r15d, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/DiplIngFrankGerlach[P]MST/SampleAndTesting.cpp
// Function: main
int main()
{
   char plaintext[32];  

   strcpy(plaintext,"1123456789012345678901234567890");

   uint8_t hash[16];   
   DM_Hash::hash((uint8_t*) plaintext,32,hash);

   Util::dumpHex(hash,16); 

   char testInput[100];
   strcpy(testInput,"helloWorld");


   uint8_t* authPlaintext(NULL);
   uint32_t length(0);
   Util::dumpHex((uint8_t*)testInput,strlen(testInput));
   MST_Hash mstHash;
   if(mstHash.createAuthPlaintext( (uint8_t*)testInput,strlen(testInput)+1,&authPlaintext,&length) )
   {
      Util::dumpHex(authPlaintext,length);
   }
   else cout << "failure" << endl;

   uint8_t* plaintextBack;  
   uint32_t lengthPT;
   if( mstHash.checkAndExtractPlaintext(authPlaintext, length,&plaintextBack,&lengthPT) )
   {
      cout << ((char*)plaintext) << endl; 
   }
   else cout << "failure check" << endl;

   unitTestSuite(); 
  
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movups 0x273d(%rip), %xmm0     # 0x5870
leaq -0x90(%rbp), %rbx
movaps %xmm0, 0x10(%rbx)
movups 0x271b(%rip), %xmm0     # 0x5860
movaps %xmm0, (%rbx)
pushq $0x20
popq %rsi
leaq -0x70(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rdx
callq 0x326c
pushq $0x10
popq %rsi
movq %r14, %rdi
callq 0x3312
movabsq $0x726f576f6c6c6568, %rax # imm = 0x726F576F6C6C6568
leaq -0x100(%rbp), %r14
movq %rax, (%r14)
movl $0x646c72, 0x7(%r14)    # imm = 0x646C72
leaq -0x38(%rbp), %r15
andq $0x0, (%r15)
leaq -0x2c(%rbp), %r12
andl $0x0, (%r12)
movq %r14, %rdi
callq 0x1060
movq %r14, %rdi
movl %eax, %esi
callq 0x3312
leaq -0x48(%rbp), %r13
andq $0x0, (%r13)
andl $0x0, 0x8(%r13)
movq %r14, %rdi
callq 0x1060
leal 0x1(%rax), %edx
movq %r13, %rdi
movq %r14, %rsi
movq %r15, %rcx
movq %r12, %r8
callq 0x3364
testb %al, %al
je 0x31e0
movq -0x38(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x3312
jmp 0x31fb
movq 0x4df1(%rip), %rdi      # 0x7fd8
leaq 0x269d(%rip), %rsi      # 0x588b
callq 0x1100
movq %rax, %rdi
callq 0x1080
movq -0x38(%rbp), %rsi
movl -0x2c(%rbp), %edx
leaq -0x48(%rbp), %rdi
leaq -0x58(%rbp), %rcx
leaq -0x4c(%rbp), %r8
callq 0x3426
leaq 0x2679(%rip), %rsi      # 0x5893
testb %al, %al
cmovneq %rbx, %rsi
movq 0x4db1(%rip), %rdi      # 0x7fd8
callq 0x1100
movq %rax, %rdi
callq 0x1080
callq 0x407e
leaq -0x48(%rbp), %rdi
callq 0x34ac
xorl %eax, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3258
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x34ac
movq %rbx, %rdi
callq 0x1180
// File: /workspace/github_cpp_makefile_star2_O2/DiplIngFrankGerlach[P]MST/./DaviesMeyerHash.h
// Function: DM_Hash::hash(unsigned char const*, unsigned int, unsigned char*)
static bool hash(const uint8_t* input, uint32_t length, uint8_t* output)
   {
      if( (length == 0) || ((length & (HashWordSize-1)) != 0) )
      {
         return false;
      }
      unsigned int schedule[60];
      uint8_t state1[HashWordSize];
      uint8_t state2[HashWordSize];
      uint8_t* stateInPtr  = state1;
      uint8_t* stateOutPtr = state2;
      memset(stateInPtr,0,HashWordSize);
      for(uint32_t i=0; i < length;i += 16)
      {
          aes_key_setup(input+i,
                        schedule, 
                        HashWordSizeBits);

          aes_encrypt(stateInPtr, 
                      stateOutPtr,
                      schedule,  
                      HashWordSizeBits) ;
          uint8_t* temp = stateInPtr;
          stateInPtr = stateOutPtr;
          stateOutPtr = temp;
      }
      memcpy(output,stateInPtr,HashWordSize);//stateInPtr is in fact the output here
      return true;
   }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movl %esi, %r14d
movq %rdi, -0x40(%rbp)
testl %esi, %esi
setne %cl
testb $0xf, %r14b
sete %al
andb %cl, %al
cmpb $0x1, %al
jne 0x3300
movb %al, -0x29(%rbp)
movq %rdx, -0x38(%rbp)
xorps %xmm0, %xmm0
leaq -0x60(%rbp), %rax
movaps %xmm0, (%rax)
xorl %r12d, %r12d
leaq -0x50(%rbp), %r15
leaq -0x150(%rbp), %r13
movq %rax, %rbx
cmpl %r14d, %r12d
jae 0x32f3
movl %r12d, %edi
addq -0x40(%rbp), %rdi
movq %r13, %rsi
movl $0x80, %edx
callq 0x24af
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
movl $0x80, %ecx
callq 0x13ed
addl $0x10, %r12d
movq %r15, %rax
movq %rbx, %r15
jmp 0x32b8
movups (%rbx), %xmm0
movq -0x38(%rbp), %rax
movups %xmm0, (%rax)
movb -0x29(%rbp), %al
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DiplIngFrankGerlach[P]MST/./Util.h
// Function: Util::dumpHex(unsigned char const*, unsigned int)
static void dumpHex(const uint8_t* buffer,uint32_t length)
  {
     for(uint32_t i=0; i < length; i++)
     {
         uint8_t octet = buffer[i];

         uint8_t nibbleUpper = octet >> 4;
         uint8_t nibbleLower = octet & 0xF;
         printNibble(nibbleUpper);
         printNibble(nibbleLower);
     }
     cout << endl;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl %esi, %r15d
xorl %r12d, %r12d
cmpq %r12, %r15
je 0x334f
movzbl (%rbx,%r12), %r14d
movl %r14d, %eax
shrb $0x4, %al
movzbl %al, %edi
callq 0x34de
andl $0xf, %r14d
movl %r14d, %edi
callq 0x34de
incq %r12
jmp 0x3326
movq 0x4c82(%rip), %rdi      # 0x7fd8
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1080
nop
// File: /workspace/github_cpp_makefile_star2_O2/DiplIngFrankGerlach[P]MST/./Protocol.h
// Function: MST_Hash::createAuthPlaintext(unsigned char*, unsigned int, unsigned char**, unsigned int*)
bool createAuthPlaintext(uint8_t* sourcePlaintext,//the plaintext
                            uint32_t length,         //length of plaintext
                            uint8_t** outputBuffer,  //typically a reference to a pointer
                            uint32_t* outputSize)    //typically a reference to a uint32_t 
   {
        if( (length == 0) || (length > (UINT_MAX-32) ) )
        {
          return false;
        }
        if( _outputBufferSize < (length+32) )
        {
           memset(_outputBuffer,0,_outputBufferSize);
           delete[] _outputBuffer;
           
           _outputBufferSize = length + 4 + 32;
           _outputBuffer = new uint8_t[_outputBufferSize];
           if( _outputBuffer == NULL )
           {
              return false;
           }
        }
        Util::int2Octets(length,_outputBuffer);
        memcpy(_outputBuffer+4,sourcePlaintext,length);
        uint32_t pos;
        for( pos = length+4; (pos & 0xF) != 0; pos++)
        {
           _outputBuffer[pos]=0;
        }
         
        if( DM_Hash::hash(_outputBuffer,pos,_outputBuffer+pos) == false)
        {
           return false;
        }
        *outputBuffer = _outputBuffer;
        *outputSize = pos + 16;
        return true;
   }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r15d
leal 0x20(%r15), %eax
cmpl $0x21, %eax
jb 0x3415
movq %r8, %rbx
movq %rcx, %r14
movq %rsi, %r13
movq %rdi, %r12
movl 0x8(%rdi), %edx
movq (%rdi), %rsi
cmpl %eax, %edx
jae 0x33c5
movq %rsi, %rdi
xorl %esi, %esi
callq 0x1090
movq (%r12), %rdi
testq %rdi, %rdi
je 0x33b0
callq 0x1140
leal 0x24(%r15), %edi
movl %edi, 0x8(%r12)
callq 0x1030
movq %rax, %rsi
movq %rax, (%r12)
movl %r15d, %edi
callq 0x3508
movq (%r12), %rdi
addq $0x4, %rdi
movl %r15d, %edx
movq %r13, %rsi
callq 0x10e0
addl $0x14, %r15d
leal -0x10(%r15), %esi
movq (%r12), %rdi
leaq (%rsi,%rdi), %rdx
testb $0xf, %sil
je 0x33fe
movb $0x0, (%rdx)
incl %r15d
jmp 0x33e4
callq 0x326c
testb %al, %al
je 0x3415
movq (%r12), %rax
movq %rax, (%r14)
movl %r15d, (%rbx)
movb $0x1, %al
jmp 0x3417
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DiplIngFrankGerlach[P]MST/./Protocol.h
// Function: MST_Hash::checkAndExtractPlaintext(unsigned char*, unsigned int, unsigned char**, unsigned int*)
bool checkAndExtractPlaintext(uint8_t*   authPlaintext,   //AuthPlainText PDU
                                 uint32_t   length,          //length of PDU
                                 uint8_t**  plaintext,       //typically a reference to a pointer
                                 uint32_t*  lengthPlaintext )//typically a reference to a uint32_t
   {
      *plaintext = NULL;
      if( length < 32 )
      {
        return false;
      }
      uint8_t computedHash[16];
      if(DM_Hash::hash(authPlaintext,length-16,computedHash) )
      {
         if( memcmp(computedHash,authPlaintext+length-16,16) == 0 )
         {
            Util::octets2Int(authPlaintext,lengthPlaintext);
            if( (*lengthPlaintext) < (length-16) )
            {
               *plaintext = authPlaintext+4;
               return true;
            }            
         }
      } 
      return false;
   }

// Assembly:
andq $0x0, (%rcx)
cmpl $0x20, %edx
jae 0x3432
xorl %eax, %eax
retq
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r15
movq %rcx, %rbx
movl %edx, %r13d
movq %rsi, %r14
leal -0x10(%r13), %r12d
leaq -0x40(%rbp), %rdx
movq %rsi, %rdi
movl %r12d, %esi
callq 0x326c
testb %al, %al
je 0x349b
movl %r13d, %eax
movdqu -0x10(%r14,%rax), %xmm0
pcmpeqb -0x40(%rbp), %xmm0
pmovmskb %xmm0, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
jne 0x349b
movq %r14, %rdi
movq %r15, %rsi
callq 0x3522
cmpl %r12d, (%r15)
jae 0x349b
addq $0x4, %r14
movq %r14, (%rbx)
movb $0x1, %al
jmp 0x349d
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DiplIngFrankGerlach[P]MST/./Protocol.h
// Function: MST_Hash::~MST_Hash()
~MST_Hash()
   {
      memset(_outputBuffer,0,_outputBufferSize);
      delete[] _outputBuffer;
      _outputBuffer = NULL;
      _outputBufferSize = 0;
   }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
movl 0x8(%rbx), %edx
xorl %esi, %esi
callq 0x1090
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x34cf
callq 0x1140
andq $0x0, (%rbx)
andl $0x0, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DiplIngFrankGerlach[P]MST/./Util.h
// Function: Util::octets2Int(unsigned char*, unsigned int*)
static void octets2Int(uint8_t* source,uint32_t* destination)
  {
     *destination = 0;
     for(int8_t i=3; i >= 0; i--)
     {
       (*destination) += source[i];
       if( i > 0 )
       {
         (*destination) <<= 8;
       }
     }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
andl $0x0, (%rsi)
movb $0x3, %al
xorl %ecx, %ecx
testb %al, %al
js 0x3548
movzbl %al, %edx
movzbl (%rdi,%rdx), %edx
addl %edx, %ecx
movl %ecx, %edx
shll $0x8, %edx
subb $0x1, %al
cmovael %edx, %ecx
movl %ecx, (%rsi)
jmp 0x352d
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/DiplIngFrankGerlach[P]MST/UnitTest.cpp
// Function: testProc(unsigned int)
void testProc(uint32_t testSize)
{
   cout << "testProc size=" << testSize << endl;
   uint8_t* testData = new uint8_t[testSize];

   for(uint32_t i=0; i < testSize; i++)
   {
       testData[i] = uint8_t(i & 0xFF);
   }


   uint8_t* authPlaintext(NULL);
   uint32_t lengthAuth;
    
   MST_Hash mstHash;
   assert(mstHash.createAuthPlaintext( testData,testSize,&authPlaintext,&lengthAuth) );

   uint8_t* plaintextBack;  
   uint32_t lengthPT;

   //test:authPlaintext[6] ^= 1;

   assert( mstHash.checkAndExtractPlaintext(authPlaintext, lengthAuth,&plaintextBack,&lengthPT) );
   assert(testSize == lengthPT);
   assert(memcmp(testData,plaintextBack,testSize) == 0 );

   delete[] testData;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %edi, %ebx
movq 0x4a76(%rip), %rdi      # 0x7fd8
leaq 0x23b7(%rip), %rsi      # 0x5920
callq 0x1100
movl %ebx, %r14d
movq %rax, %rdi
movq %r14, %rsi
callq 0x10b0
movq %rax, %rdi
callq 0x1080
movq %r14, %rdi
callq 0x1030
movq %rax, %r15
xorl %eax, %eax
cmpq %rax, %r14
je 0x359f
movb %al, (%r15,%rax)
incq %rax
jmp 0x3591
leaq -0x40(%rbp), %rcx
andq $0x0, (%rcx)
leaq -0x38(%rbp), %rdi
andq $0x0, (%rdi)
andl $0x0, 0x8(%rdi)
leaq -0x20(%rbp), %r8
movq %r15, %rsi
movl %r14d, %edx
callq 0x3364
testb %al, %al
je 0x3616
movq -0x40(%rbp), %rsi
movl -0x20(%rbp), %edx
leaq -0x38(%rbp), %rdi
leaq -0x28(%rbp), %rcx
leaq -0x1c(%rbp), %r8
callq 0x3426
testb %al, %al
je 0x362f
cmpl %ebx, -0x1c(%rbp)
jne 0x3648
movq -0x28(%rbp), %rsi
movq %r15, %rdi
movq %r14, %rdx
callq 0x1110
testl %eax, %eax
jne 0x3661
movq %r15, %rdi
callq 0x1140
leaq -0x38(%rbp), %rdi
callq 0x34ac
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2312(%rip), %rdi      # 0x592f
leaq 0x2356(%rip), %rsi      # 0x597a
leaq 0x235c(%rip), %rcx      # 0x5987
pushq $0x1f
jmp 0x3678
leaq 0x2369(%rip), %rdi      # 0x599f
leaq 0x233d(%rip), %rsi      # 0x597a
leaq 0x2343(%rip), %rcx      # 0x5987
pushq $0x26
jmp 0x3678
leaq 0x23a5(%rip), %rdi      # 0x59f4
leaq 0x2324(%rip), %rsi      # 0x597a
leaq 0x232a(%rip), %rcx      # 0x5987
pushq $0x27
jmp 0x3678
leaq 0x23a1(%rip), %rdi      # 0x5a09
leaq 0x230b(%rip), %rsi      # 0x597a
leaq 0x2311(%rip), %rcx      # 0x5987
pushq $0x28
popq %rdx
callq 0x10a0
jmp 0x3680
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x34ac
movq %rbx, %rdi
callq 0x1180
// File: /workspace/github_cpp_makefile_star2_O2/DiplIngFrankGerlach[P]MST/UnitTest.cpp
// Function: encryptedCommunicationFailTest()
void encryptedCommunicationFailTest()
{
   uint8_t sharedKey[16] = {11,55,11,33,67,89,91,11,55,11,33,67,89,91,0,0};

   MST_Endpoint endpointA(sharedKey);
   MST_Endpoint endpointB(sharedKey);

   uint8_t mcA[16];
   endpointA.generateMaskCounterExchange(mcA);

   uint8_t mcB[16];
   endpointB.generateMaskCounterExchange(mcB);

   //exchange of masking counters
   endpointA.decryptMaskCounterExchange(mcB);
   endpointB.decryptMaskCounterExchange(mcA);
 
   
   //now we can securely encrypt with all assurances of the protocol
   const char* plaintext = "Schiller, Goethe, Von der Vogelweide";
   uint8_t* secureMessage;
   uint32_t lengthSM;
   uint32_t lp = strlen(plaintext)+1;
   assert( endpointA.encryptToSecureMessage((uint8_t*)plaintext,lp,&secureMessage,&lengthSM) );
   
   //flip a bit
   secureMessage[0] ^= 1;   

   uint8_t* plaintextDec;
   uint32_t lengthPT;
   assert( endpointB.decryptSecureMessage(secureMessage,lengthSM,&plaintextDec,&lengthPT) == false);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x2e8, %rsp            # imm = 0x2E8
movaps 0x1d53(%rip), %xmm0     # 0x58f0
leaq -0x60(%rbp), %rbx
movaps %xmm0, (%rbx)
leaq -0x2f0(%rbp), %rdi
movq %rbx, %rsi
callq 0x4222
leaq -0x1a8(%rbp), %rdi
movq %rbx, %rsi
callq 0x4222
leaq -0x2f0(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x4286
leaq -0x1a8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x4286
leaq -0x2f0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x42d0
leaq -0x1a8(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x42d0
leaq 0x1e2d(%rip), %rsi      # 0x5a36
leaq -0x2f0(%rbp), %rdi
pushq $0x25
popq %rdx
leaq -0x18(%rbp), %rcx
leaq -0xc(%rbp), %r8
callq 0x4300
testb %al, %al
je 0x3c6c
movq -0x18(%rbp), %rax
xorb $0x1, (%rax)
movq -0x18(%rbp), %rsi
movl -0xc(%rbp), %edx
leaq -0x1a8(%rbp), %rdi
leaq -0x48(%rbp), %rcx
leaq -0x1c(%rbp), %r8
callq 0x43b8
testb %al, %al
jne 0x3c8b
leaq -0x1a8(%rbp), %rdi
callq 0x44ae
leaq -0x2f0(%rbp), %rdi
callq 0x44ae
addq $0x2e8, %rsp            # imm = 0x2E8
popq %rbx
popq %rbp
retq
leaq 0x1de8(%rip), %rdi      # 0x5a5b
leaq 0x1d00(%rip), %rsi      # 0x597a
leaq 0x20ab(%rip), %rcx      # 0x5d2c
movl $0xac, %edx
callq 0x10a0
leaq 0x20c0(%rip), %rdi      # 0x5d52
leaq 0x1ce1(%rip), %rsi      # 0x597a
leaq 0x208c(%rip), %rcx      # 0x5d2c
movl $0xb3, %edx
callq 0x10a0
jmp 0x3cb5
jmp 0x3cb5
jmp 0x3cb5
movq %rax, %rbx
jmp 0x3cc4
movq %rax, %rbx
leaq -0x1a8(%rbp), %rdi
callq 0x44ae
leaq -0x2f0(%rbp), %rdi
callq 0x44ae
movq %rbx, %rdi
callq 0x1180
// File: /workspace/github_cpp_makefile_star2_O2/DiplIngFrankGerlach[P]MST/./Protocol.h
// Function: MST_Endpoint::MST_Endpoint(unsigned char const*)
MST_Endpoint(const uint8_t* sharedSecret):_buffer(NULL),_bufferSize(0)
   {
        memcpy(_sharedSecret,sharedSecret,16);
   
        aes_key_setup(_sharedSecret,_aesSchedule,128);
        _maskCounterExchangeGenerated = false;
        _partnerMaskCounterExchangeDecrypted = false;
   }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
andq $0x0, 0x128(%rdi)
andl $0x0, 0x130(%rdi)
andq $0x0, 0x138(%rdi)
andl $0x0, 0x140(%rdi)
leaq 0x138(%rdi), %r14
movups (%rsi), %xmm0
movups %xmm0, (%rdi)
leaq 0x30(%rdi), %rsi
movl $0x80, %edx
callq 0x24af
andw $0x0, 0x120(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
movq %r14, %rdi
callq 0x34ac
movq %rbx, %rdi
callq 0x1180
nop
// File: /workspace/github_cpp_makefile_star2_O2/DiplIngFrankGerlach[P]MST/./Protocol.h
// Function: MST_Endpoint::encryptToSecureMessage(unsigned char*, unsigned int, unsigned char**, unsigned int*)
bool encryptToSecureMessage(uint8_t* plaintext,
                               uint32_t length,
                               uint8_t** securedMessage,
                               uint32_t* lengthSM)
   {
       if( !_maskCounterExchangeGenerated )  
       {
          return false;
       }
        
       if( _mstHash.createAuthPlaintext(plaintext,length,securedMessage,lengthSM) )
       {
	      for(uint32_t i=0; i < (*lengthSM); i+=16)
	      {
		 //apply masking
		 uint8_t encrypted[16];
		 uint8_t* masked = (*securedMessage)+i;
		 for(uint8_t j=0; j < 16; j++)
		 {
		    masked[j] ^= _maskCounterOwn[j];
		 }
		 incrementMC(_maskCounterOwn);
		 aes_encrypt(masked,encrypted,_aesSchedule,128);
		 memcpy((*securedMessage)+i,encrypted,16);
		 
	      }
              return true; 
       }
       return false;
   }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpb $0x1, 0x120(%rdi)
jne 0x439e
movq %r8, %rbx
movq %rcx, %r14
movq %rdi, %r15
addq $0x138, %rdi            # imm = 0x138
callq 0x3364
xorl %r12d, %r12d
testb %al, %al
je 0x43a6
leaq 0x10(%r15), %r13
addq $0x30, %r15
movq %r15, -0x30(%rbp)
cmpl (%rbx), %r12d
jae 0x43a3
movq %rbx, %r15
movl %r12d, %r12d
movq (%r14), %rbx
addq %r12, %rbx
xorl %eax, %eax
cmpq $0x10, %rax
je 0x436c
movb (%r13,%rax), %cl
xorb %cl, (%rbx,%rax)
incq %rax
jmp 0x4359
movq %r13, %rdi
callq 0x4538
movq %rbx, %rdi
leaq -0x40(%rbp), %rsi
movq -0x30(%rbp), %rdx
movl $0x80, %ecx
callq 0x13ed
movq (%r14), %rax
movaps -0x40(%rbp), %xmm0
movups %xmm0, (%rax,%r12)
addl $0x10, %r12d
movq %r15, %rbx
jmp 0x4346
xorl %r12d, %r12d
jmp 0x43a6
movb $0x1, %r12b
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DiplIngFrankGerlach[P]MST/./Protocol.h
// Function: MST_Endpoint::decryptSecureMessage(unsigned char*, unsigned int, unsigned char**, unsigned int*)
bool decryptSecureMessage(uint8_t* securedMessage, //SecuredMessage PDU
                             uint32_t lengthSM,       
                             uint8_t** plaintext,  //plaintext output, typically a reference to a pointer
                             uint32_t* lengthPlaintext) //plaintext length, typically a refrence to a uint32_t
   {
      if( !_partnerMaskCounterExchangeDecrypted )  
      {
         return false;
      }
      if( (lengthSM < 32) || ((lengthSM & 0xF) != 0 ) )
      {
         return false;
      }
      if( !ensureBufferSize(lengthSM) )
      {
         return false;
      }
      for(uint32_t i=0; i < lengthSM; i+=16)
      {
         aes_decrypt(securedMessage+i,_buffer+i,_aesSchedule,128);
         //remove masking
         uint8_t* masked = _buffer+i;
         for(uint8_t j=0; j < 16; j++)
         {
            masked[j] ^= _maskCounterPartner[j];
         }
         incrementMC(_maskCounterPartner);
      } 
      if( _mstHash.checkAndExtractPlaintext(_buffer,lengthSM,plaintext,lengthPlaintext) )
      {
         return true;
      }
      return false;
   }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, -0x40(%rbp)
cmpb $0x1, 0x121(%rdi)
jne 0x446d
movq %rcx, %r14
movl %edx, %r15d
cmpl $0x20, %edx
setb %al
testb $0xf, %r15b
setne %cl
orb %al, %cl
jne 0x446d
movq %r8, %rbx
movq %rdi, %r12
movl %r15d, %esi
callq 0x459c
testb %al, %al
je 0x446d
movq %r14, -0x30(%rbp)
movq %rbx, -0x38(%rbp)
leaq 0x30(%r12), %rbx
leaq 0x20(%r12), %r14
xorl %r13d, %r13d
cmpl %r15d, %r13d
jae 0x447e
movl %r13d, %r13d
movq -0x40(%rbp), %rax
leaq (%rax,%r13), %rdi
movq 0x128(%r12), %rsi
addq %r13, %rsi
movq %rbx, %rdx
movl $0x80, %ecx
callq 0x1b54
movq 0x128(%r12), %rax
addq %r13, %rax
xorl %ecx, %ecx
cmpq $0x10, %rcx
je 0x445f
movb (%r14,%rcx), %dl
xorb %dl, (%rax,%rcx)
incq %rcx
jmp 0x444d
movq %r14, %rdi
callq 0x4538
addl $0x10, %r13d
jmp 0x4418
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x128(%r12), %rsi
addq $0x138, %r12            # imm = 0x138
movq %r12, %rdi
movl %r15d, %edx
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %r8
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3426
// File: /workspace/github_cpp_makefile_star2_O2/DiplIngFrankGerlach[P]MST/./RandomSource.h
// Function: RandomSource::getRandomNumber128(unsigned char*)
bool getRandomNumber128(uint8_t* destination)
    {
        int randomFH = open("/dev/urandom", O_RDONLY);
	if (randomFH >= 0)
	{
	    ssize_t result = read(randomFH, destination, 16);
            close(randomFH);
	    if (result == 16)
	    {
		return true;
	    }
	}
        return false;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
leaq 0x19ea(%rip), %rdi      # 0x5f4f
xorl %esi, %esi
xorl %eax, %eax
callq 0x10d0
testl %eax, %eax
js 0x4595
movl %eax, %r14d
pushq $0x10
popq %rdx
movl %eax, %edi
movq %rbx, %rsi
callq 0x1160
movq %rax, %rbx
movl %r14d, %edi
callq 0x11b0
movb $0x1, %al
cmpq $0x10, %rbx
je 0x4597
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DiplIngFrankGerlach[P]MST/./Protocol.h
// Function: MST_Endpoint::ensureBufferSize(unsigned int)
bool ensureBufferSize(uint32_t sz)
   {
      if(_bufferSize < sz )
      {
         memset(_buffer,0,_bufferSize);
         _bufferSize = sz;
         delete[] _buffer;
         _buffer = new uint8_t[_bufferSize];
         if( _buffer == NULL )
         {
            return false;
         }
      }
      return true;
   }

// Assembly:
movl 0x130(%rdi), %edx
cmpl %esi, %edx
jae 0x45f3
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
movq 0x128(%rdi), %rdi
xorl %esi, %esi
callq 0x1090
movl %r14d, 0x130(%rbx)
movq 0x128(%rbx), %rdi
testq %rdi, %rdi
je 0x45e0
callq 0x1140
movl 0x130(%rbx), %r14d
movl %r14d, %edi
callq 0x1030
movq %rax, 0x128(%rbx)
popq %rbx
popq %r14
popq %rbp
movb $0x1, %al
retq
// File: /workspace/github_cpp_makefile_star2_O2/xjrueda[P]fixprime/src/Acceptor.cpp
// Function: fprime::Acceptor::start()
bool Acceptor::start() {
        try {
            thread t1(std::bind(&Acceptor::startAcceptor, this, sessionSetup.getPort()));
            t1.detach();
            usleep(10000);
            return sessionRunning;
        } catch (exception& e) {
            //TODO: log error
            return false;
        }
    }

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
addq $0x28, %rdi
callq 0x41bb0
movq 0x3bc5c(%rip), %rcx     # 0x7ecd8
leaq 0x8(%rsp), %rsi
movq %rcx, (%rsi)
andq $0x0, 0x8(%rsi)
movl %eax, 0x10(%rsi)
movq %rbx, 0x18(%rsi)
movq %rsp, %rdi
callq 0x3f230
movq %rsp, %rdi
callq 0x421b0
movl $0x2710, %edi           # imm = 0x2710
callq 0x414a0
movb 0x1d8(%rbx), %bl
movq %rsp, %rdi
callq 0x41950
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq %rdx, %r14
movq %rax, %rbx
movq %rsp, %rdi
callq 0x41950
jmp 0x430d8
movq %rdx, %r14
movq %rax, %rbx
movq %rbx, %rdi
cmpl $0x1, %r14d
jne 0x430ef
callq 0x3ed90
callq 0x41d30
xorl %ebx, %ebx
jmp 0x430b8
callq 0x42200
// File: /workspace/github_cpp_makefile_star2_O2/xjrueda[P]fixprime/include/Session.h
// Function: fprime::Session::stop()
virtual void stop() {
            setConnected(false);
            setIbRunning(false);
            setObRunning(false);
            setSessionRunning(false);
        }

// Assembly:
pushq %rbx
movq %rdi, %rbx
xorl %esi, %esi
callq 0x3f5d0
andw $0x0, 0x1d9(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
jmp 0x42a90
// File: /workspace/github_cpp_makefile_star2_O2/xjrueda[P]fixprime/include/Session.h
// Function: fprime::Session::disconnect()
virtual void disconnect() {
            setConnected(false);
            setIbRunning(false);
            setObRunning(false);
            inboundCondition.notify_one();
            outboundCondition.notify_one();
        }

// Assembly:
pushq %rbx
movq %rdi, %rbx
xorl %esi, %esi
callq 0x3f5d0
andw $0x0, 0x1d9(%rbx)
leaq 0x208(%rbx), %rdi
callq 0x3f120
addq $0x238, %rbx            # imm = 0x238
movq %rbx, %rdi
popq %rbx
jmp 0x3f120
nop
// File: /workspace/github_cpp_makefile_star2_O2/xjrueda[P]fixprime/include/Session.h
// Function: fprime::Session::send(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
virtual bool send(string msg) {
            if (!connected)
                //TODO: register log entry
                return false;
            else {
                pushOutbound(msg);
                return true;
            };
        }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movb 0x1db(%rdi), %bl
cmpb $0x1, %bl
jne 0x4375f
movq %rdi, %r14
movq %rsp, %r15
movq %r15, %rdi
callq 0x412d0
movq %r14, %rdi
movq %r15, %rsi
callq 0x42580
movq %rsp, %rdi
callq 0x3ef50
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x3ef50
movq %rbx, %rdi
callq 0x42200