LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/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::initializer_list<nlohmann::detail::json_ref<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(initializer_list_t init)
    {
        if (is_object() && init.size() == 2 && (*init.begin())->is_string())
        {
            basic_json&& key = init.begin()->moved_or_copied();
            push_back(typename object_t::value_type(
                          std::move(key.get_ref<string_t&>()), (init.begin() + 1)->moved_or_copied()));
        }
        else
        {
            push_back(basic_json(init));
        }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x1, (%rdi)
sete %al
cmpq $0x2, %rdx
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xab4d
movq 0x10(%r14), %rax
cmpb $0x3, (%rax)
jne 0xab4d
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x8f5a
movq %r15, %rdi
callq 0xaf28
movq %rax, %r15
addq $0x20, %r14
movq %rsp, %rdi
movq %r14, %rsi
callq 0x8f5a
leaq 0x20(%rsp), %r14
movq %rsp, %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x97e2
movq %rbx, %rdi
movq %r14, %rsi
callq 0xabce
leaq 0x40(%rsp), %rdi
callq 0x829a
leaq 0x48(%rsp), %rbx
movzbl -0x8(%rbx), %esi
movq %rbx, %rdi
callq 0x99e0
movq -0x28(%rbx), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0xab26
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3340
movq %rsp, %rdi
callq 0x829a
leaq 0x8(%rsp), %rdi
movzbl -0x8(%rdi), %esi
callq 0x99e0
leaq 0x10(%rsp), %rdi
callq 0x829a
leaq 0x18(%rsp), %rdi
jmp 0xab82
leaq 0x20(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movl $0x1, %ecx
movl $0x2, %r8d
callq 0x7702
movq %rbx, %rdi
movq %r15, %rsi
callq 0xad20
leaq 0x20(%rsp), %rdi
callq 0x829a
leaq 0x28(%rsp), %rdi
movzbl -0x8(%rdi), %esi
callq 0x99e0
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x9346
movq %rsp, %rdi
callq 0x7860
jmp 0xabb1
jmp 0xabae
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0xabc0
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x7860
movq %rbx, %rdi
callq 0x3510
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movzbl (%rdi), %eax
testl %eax, %eax
jne 0xac1d
movb $0x1, (%r14)
movl $0x30, %edi
callq 0x3330
leaq 0x8(%rax), %rcx
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
xorl %edx, %edx
movq %rdx, 0x10(%rax)
movq %rcx, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq %rdx, 0x28(%rax)
movq %rax, 0x8(%r14)
movq %r14, %rdi
callq 0x829a
jmp 0xac22
cmpl $0x1, %eax
jne 0xac38
movq 0x8(%r14), %rdi
movq %rbx, %rsi
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xae64
movl $0x20, %edi
callq 0x31a0
movq %rax, %rbx
movq %r14, %rdi
callq 0x8a50
movq %rax, %r14
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq %rax, %rdi
callq 0x3190
leaq (%rax,%r14), %rdx
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0xd9ec
leaq 0xe0ba(%rip), %rsi      # 0x18d33
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x89df
movb $0x1, %bpl
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
movl $0x134, %esi            # imm = 0x134
callq 0x84ca
xorl %ebp, %ebp
leaq 0x18ef2(%rip), %rsi     # 0x23b98
leaq 0x6b45(%rip), %rdx      # 0x117f2
movq %rbx, %rdi
callq 0x3500
movq %rax, %r14
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xacd3
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0xacea
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3340
testb %bpl, %bpl
jne 0xad10
jmp 0xad18
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0xad10
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3340
jmp 0xad10
movq %rax, %r14
movq %rbx, %rdi
callq 0x3270
movq %r14, %rdi
callq 0x3510
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movzbl (%rdi), %eax
testl %eax, %eax
jne 0xad61
movb $0x2, (%r14)
movl $0x18, %edi
callq 0x3330
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq %rax, 0x8(%r14)
movq %r14, %rdi
callq 0x829a
jmp 0xad66
cmpl $0x2, %eax
jne 0xad7c
movq 0x8(%r14), %rdi
movq %rbx, %rsi
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x9de8
movl $0x20, %edi
callq 0x31a0
movq %rax, %rbx
movq %r14, %rdi
callq 0x8a50
movq %rax, %r14
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq %rax, %rdi
callq 0x3190
leaq (%rax,%r14), %rdx
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0xd9ec
leaq 0xdf76(%rip), %rsi      # 0x18d33
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x89df
movb $0x1, %bpl
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
movl $0x134, %esi            # imm = 0x134
callq 0x84ca
xorl %ebp, %ebp
leaq 0x18dae(%rip), %rsi     # 0x23b98
leaq 0x6a01(%rip), %rdx      # 0x117f2
movq %rbx, %rdi
callq 0x3500
movq %rax, %r14
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xae17
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0xae2e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3340
testb %bpl, %bpl
jne 0xae54
jmp 0xae5c
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0xae54
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3340
jmp 0xae54
movq %rax, %r14
movq %rbx, %rdi
callq 0x3270
movq %r14, %rdi
callq 0x3510
// File: /workspace/github_cpp_makefile_star2_O3/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 0xf026
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %rdi
movl 0x20(%rax,%rcx), %esi
andl $0x2, %esi
callq 0x34e0
popq %rax
retq
movq %rax, %rdi
callq 0x5cdb
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r13
movq %rdi, %r15
leaq 0x8(%rdi), %r14
leaq 0x18(%rdi), %rax
movq %rax, 0x8(%rsp)
movq %rax, 0x8(%rdi)
xorl %eax, %eax
movq %rax, 0x10(%rdi)
movb %al, 0x18(%rdi)
leaq 0x28(%rdi), %rbx
leaq 0x38(%rdi), %rcx
movq %rcx, (%rsp)
movq %rcx, 0x28(%rdi)
movq %rax, 0x30(%rdi)
movb %al, 0x38(%rdi)
leaq 0x48(%rdi), %r12
callq 0x3060
movq %r12, %rdi
movq %rax, %rsi
movq %r14, 0x30(%rsp)
callq 0x3f29
leaq 0x18b3(%rip), %rsi      # 0x18d0c
movq %r13, %rdi
callq 0xa440
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0x1796e
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%r15)
leaq 0x1893(%rip), %rsi      # 0x18d13
movq %r13, %rdi
callq 0xa440
leaq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x176f8
leaq 0x10(%rsp), %rbp
movq %r14, %rdi
movq %rbp, %rsi
callq 0x33d0
movq (%rbp), %rdi
leaq 0x20(%rsp), %r14
cmpq %r14, %rdi
je 0x174c0
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x1856(%rip), %rsi      # 0x18d1d
movq %r13, %rdi
callq 0xa440
leaq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x176f8
leaq 0x10(%rsp), %rbp
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x33d0
movq (%rbp), %rdi
cmpq %r14, %rdi
je 0x17502
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x1820(%rip), %rsi      # 0x18d29
movq %r13, %rdi
callq 0xa440
leaq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x176f8
leaq 0x10(%rsp), %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x33d0
movq (%rbx), %rdi
cmpq %r14, %rdi
je 0x17543
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3340
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r12
jmp 0x17578
jmp 0x1755d
jmp 0x1755d
jmp 0x1755d
movq %rax, %r12
movq 0x48(%r15), %rdi
addq $0x58, %r15
cmpq %r15, %rdi
je 0x17578
movq (%r15), %rsi
incq %rsi
callq 0x3340
movq (%rbx), %rdi
cmpq (%rsp), %rdi
je 0x17590
movq (%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x3340
movq 0x30(%rsp), %rax
movq (%rax), %rdi
cmpq 0x8(%rsp), %rdi
je 0x175af
movq 0x8(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x3340
movq %r12, %rdi
callq 0x3510
// File: /workspace/github_cpp_makefile_star2_O3/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 %r14
pushq %rbx
subq $0x388, %rsp            # imm = 0x388
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
callq 0x21d0
leaq 0x180(%rsp), %rdi
movq %r14, %rsi
movl $0x4, %edx
callq 0x2210
movq 0x180(%rsp), %rax
movq -0x18(%rax), %rax
leaq (%rsp,%rax), %rdi
addq $0x180, %rdi            # imm = 0x180
movl $0x5, 0x1c(%rdi)
movl 0x20(%rdi), %esi
callq 0x2220
leaq 0x190(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0x2040
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x2200
leaq 0x180(%rsp), %rdi
callq 0x2060
movq 0x25ef(%rip), %rsi      # 0x4fc8
leaq 0x8(%rsp), %rdi
callq 0x20d0
leaq 0x78(%rsp), %rdi
callq 0x2090
addq $0x388, %rsp            # imm = 0x388
popq %rbx
popq %r14
retq
movq %rax, %rbx
jmp 0x2a0d
movq %rax, %rbx
leaq 0x180(%rsp), %rdi
callq 0x2060
movq 0x25b4(%rip), %rsi      # 0x4fc8
leaq 0x8(%rsp), %rdi
callq 0x20d0
leaq 0x78(%rsp), %rdi
callq 0x2090
movq %rbx, %rdi
callq 0x2240
// File: /workspace/github_cpp_makefile_star2_O3/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 $0x28, %rsp
movq %rsi, %r12
xorl %eax, %eax
testb $0xf, %r12b
jne 0x13e2
shrq $0x4, %r12
movl $0x1, %eax
testl %r12d, %r12d
jle 0x13e2
movl %r8d, %r14d
movq %rcx, %r15
movq %rdx, %r13
movq %rdi, %rbp
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
xorl %ebx, %ebx
movups (%r9), %xmm0
movups (%rbp,%rbx), %xmm1
movaps %xmm1, 0x10(%rsp)
xorps %xmm1, %xmm0
movaps %xmm0, 0x10(%rsp)
leaq 0x10(%rsp), %rdi
movq %rsp, %rsi
movq %r15, %rdx
movl %r14d, %ecx
callq 0x13f1
movaps (%rsp), %xmm0
movups %xmm0, (%r13,%rbx)
addq $0x10, %rbx
movq %rsp, %r9
decq %r12
jne 0x139e
movl $0x1, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 $0x38, %rsp
movq %rsi, %r15
xorl %eax, %eax
testb $0xf, %r15b
jne 0x1a7f
movq %rdx, 0x8(%rsp)
shrq $0x4, %r15
testl %r15d, %r15d
jle 0x1a6d
movl %r8d, %ebp
movq %rcx, %r14
movq %rdi, %r12
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
leaq 0x10(%rsp), %r13
leaq 0x20(%rsp), %rbx
movups (%r9), %xmm0
movups (%r12), %xmm1
movaps %xmm1, 0x10(%rsp)
xorps %xmm1, %xmm0
movaps %xmm0, 0x10(%rsp)
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x13f1
addq $0x10, %r12
movq %rbx, %r9
decq %r15
jne 0x1a3b
movaps 0x20(%rsp), %xmm0
movq 0x8(%rsp), %rax
movups %xmm0, (%rax)
movl $0x1, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 $0x38, %rsp
movq %rsi, %r12
xorl %eax, %eax
testb $0xf, %r12b
jne 0x1b16
shrq $0x4, %r12
movl $0x1, %eax
testl %r12d, %r12d
jle 0x1b16
movl %r8d, %r14d
movq %rcx, %r15
movq %rdx, %r13
movq %rdi, %rbp
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
xorl %ebx, %ebx
movups (%r9), %xmm0
movaps %xmm0, 0x20(%rsp)
movups (%rbp,%rbx), %xmm0
movaps %xmm0, 0x10(%rsp)
leaq 0x10(%rsp), %rdi
movq %rsp, %rsi
movq %r15, %rdx
movl %r14d, %ecx
callq 0x1b25
movaps 0x20(%rsp), %xmm0
xorps (%rsp), %xmm0
movaps %xmm0, (%rsp)
movups %xmm0, (%r13,%rbx)
addq $0x10, %rbx
leaq 0x10(%rsp), %r9
decq %r12
jne 0x1aca
movl $0x1, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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:
testl %esi, %esi
jle 0x2162
movl $0x10, %eax
subl %esi, %eax
cltq
movl $0xf, %ecx
incb (%rdi,%rcx)
sete %dl
cmpq %rax, %rcx
jle 0x2162
decq %rcx
testb %dl, %dl
jne 0x2150
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 $0x28, %rsp
movq %r9, %r12
movl %r8d, %ebp
movq %rcx, %r15
movq %rdx, %rbx
movq %rsi, %r14
cmpq %rdx, %rdi
je 0x2193
movq %rdi, %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x10e0
movups (%r12), %xmm0
movaps %xmm0, 0x10(%rsp)
cmpq $0x11, %r14
jb 0x21eb
leaq -0x10(%r14), %r13
xorl %r12d, %r12d
leaq 0x10(%rsp), %rdi
movq %rsp, %rsi
movq %r15, %rdx
movl %ebp, %ecx
callq 0x13f1
movups (%rbx,%r12), %xmm0
xorps (%rsp), %xmm0
movups %xmm0, (%rbx,%r12)
movl $0xf, %eax
incb 0x10(%rsp,%rax)
sete %cl
addq $-0x1, %rax
jae 0x21e0
testb %cl, %cl
jne 0x21cf
addq $0x10, %r12
cmpq %r13, %r12
jb 0x21aa
jmp 0x21ee
xorl %r12d, %r12d
leaq 0x10(%rsp), %rdi
movq %rsp, %rsi
movq %r15, %rdx
movl %ebp, %ecx
callq 0x13f1
subq %r12, %r14
je 0x2218
addq %r12, %rbx
xorl %eax, %eax
movb (%rsp,%rax), %cl
xorb %cl, (%rbx,%rax)
incq %rax
cmpq %rax, %r14
jne 0x220a
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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, %rbx
cmpl $0x80, %edx
je 0x2528
cmpl $0x100, %edx            # imm = 0x100
je 0x2518
cmpl $0xc0, %edx
jne 0x25aa
movl $0x6, %eax
movl $0x34, %r15d
jmp 0x2533
movl $0x8, %eax
movb $0x1, %bpl
movl $0x3c, %r15d
jmp 0x2535
movl $0x4, %eax
movl $0x2c, %r15d
xorl %ebp, %ebp
movl %eax, %r12d
xorl %eax, %eax
movl (%rdi,%rax,4), %ecx
bswapl %ecx
movl %ecx, (%rbx,%rax,4)
incq %rax
cmpq %rax, %r12
jne 0x253a
movl -0x4(%rbx,%r12,4), %edi
xorl %r13d, %r13d
xorb $0x1, %bpl
movq %r12, %r14
movl %r14d, %eax
xorl %edx, %edx
divl %r12d
testl %edx, %edx
je 0x2579
cmpl $0x4, %edx
setne %al
orb %bpl, %al
jne 0x2596
callq 0x2a2b
movl %eax, %edi
jmp 0x2596
roll $0x8, %edi
callq 0x2a2b
movl %eax, %edi
leal -0x1(%r14), %eax
xorl %edx, %edx
divl %r12d
leaq 0x2b8d(%rip), %rcx      # 0x5120
xorl (%rcx,%rax,4), %edi
xorl (%rbx,%r13), %edi
movl %edi, (%rbx,%r14,4)
incq %r14
addq $0x4, %r13
cmpq %r14, %r15
jne 0x2559
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
testl %esi, %esi
je 0x34af
movq %rdi, %rbx
movl %esi, %r15d
xorl %r12d, %r12d
movzbl (%rbx,%r12), %r14d
movl %r14d, %eax
shrb $0x4, %al
movzbl %al, %edi
callq 0x366a
andl $0xf, %r14d
movl %r14d, %edi
callq 0x366a
incq %r12
cmpq %r12, %r15
jne 0x3488
movq 0x4b22(%rip), %rbx      # 0x7fd8
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1040
movq %rax, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x10b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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
movq %rcx, %r15
movl %edx, %r14d
leal 0x20(%r14), %ecx
cmpl $0x21, %ecx
jb 0x35ad
movq %r8, %rbx
movq %rsi, %r13
movq %rdi, %r12
movl 0x8(%rdi), %edx
movq (%rdi), %rax
cmpl %ecx, %edx
jae 0x3544
movq %rax, %rdi
xorl %esi, %esi
callq 0x1080
movq (%r12), %rdi
testq %rdi, %rdi
je 0x3532
callq 0x1150
leal 0x24(%r14), %edi
movl %edi, 0x8(%r12)
callq 0x1030
movq %rax, (%r12)
xorl %ecx, %ecx
movl %r14d, %edx
movb %dl, (%rax,%rcx)
shrl $0x8, %edx
incq %rcx
cmpq $0x4, %rcx
jne 0x3549
movq (%r12), %rdi
addq $0x4, %rdi
movl %r14d, %edx
movq %r13, %rsi
callq 0x10e0
addl $0x4, %r14d
testb $0xf, %r14b
je 0x3585
movq (%r12), %rax
movl %r14d, %ecx
movb $0x0, (%rax,%rcx)
incl %r14d
jmp 0x356f
movq (%r12), %rdi
movl %r14d, %edx
addq %rdi, %rdx
movl %r14d, %esi
callq 0x33ca
testb %al, %al
je 0x35ad
movq (%r12), %rax
movq %rax, (%r15)
addl $0x10, %r14d
movl %r14d, (%rbx)
movb $0x1, %al
jmp 0x35af
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_O3/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:
movq $0x0, (%rcx)
cmpl $0x20, %edx
jae 0x35cd
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 0x33ca
testb %al, %al
je 0x3658
movl %r13d, %eax
movdqu -0x10(%r14,%rax), %xmm0
pcmpeqb -0x40(%rbp), %xmm0
pmovmskb %xmm0, %ecx
xorl %eax, %eax
cmpl $0xffff, %ecx           # imm = 0xFFFF
jne 0x365a
movl $0x0, (%r15)
movl $0x3, %ecx
movzbl (%r14,%rcx), %edx
orl %eax, %edx
movl %edx, %eax
shll $0x8, %eax
subq $0x1, %rcx
movl %eax, %esi
cmovbl %edx, %esi
movl %esi, (%r15)
cmpq $-0x1, %rcx
jne 0x362a
cmpl %r12d, %edx
jae 0x3658
addq $0x4, %r14
movq %r14, (%rbx)
movb $0x1, %al
jmp 0x365a
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/DiplIngFrankGerlach[P]MST/./Util.h
// Function: Util::printNibble(unsigned char)
static void printNibble(uint8_t value)
  {
      if(value < 10)
      {
        cout << char('0'+value);
      }
      else
      {
        cout << char('A'-10+value);
      }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
cmpb $0x9, %dil
ja 0x3682
orb $0x30, %dil
leaq -0x1(%rbp), %rsi
jmp 0x368a
addb $0x37, %dil
leaq -0x2(%rbp), %rsi
movb %dil, (%rsi)
movq 0x4944(%rip), %rdi      # 0x7fd8
movl $0x1, %edx
callq 0x1130
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x491e(%rip), %r15      # 0x7fd8
leaq 0x225f(%rip), %rsi      # 0x5920
movl $0xe, %edx
movq %r15, %rdi
callq 0x1130
movl %ebx, %r14d
movq %r15, %rdi
movq %r14, %rsi
callq 0x10a0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x1100
movsbl %al, %esi
movq %r15, %rdi
callq 0x1040
movq %rax, %rdi
callq 0x10b0
movq %r14, %rdi
callq 0x1030
movq %rax, %r15
testl %ebx, %ebx
je 0x3723
xorl %eax, %eax
movb %al, (%r15,%rax)
incq %rax
cmpq %rax, %r14
jne 0x3717
xorl %eax, %eax
leaq -0x40(%rbp), %rcx
movq %rax, (%rcx)
leaq -0x28(%rbp), %rdi
movq %rax, (%rdi)
movl $0x0, 0x8(%rdi)
leaq -0x30(%rbp), %r8
movq %r15, %rsi
movl %ebx, %edx
callq 0x34e6
testb %al, %al
je 0x37b7
movq -0x40(%rbp), %rsi
movl -0x30(%rbp), %edx
leaq -0x28(%rbp), %rdi
leaq -0x38(%rbp), %rcx
leaq -0x2c(%rbp), %r8
callq 0x35be
testb %al, %al
je 0x37d6
cmpl %ebx, -0x2c(%rbp)
jne 0x37f5
movq -0x38(%rbp), %rsi
movq %r15, %rdi
movq %r14, %rdx
callq 0x1120
testl %eax, %eax
jne 0x3814
movq %r15, %rdi
callq 0x1150
movq -0x28(%rbp), %rdi
movl -0x20(%rbp), %edx
xorl %esi, %esi
callq 0x1080
movq -0x28(%rbp), %rdi
testq %rdi, %rdi
je 0x37ac
callq 0x1150
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2171(%rip), %rdi      # 0x592f
leaq 0x21b5(%rip), %rsi      # 0x597a
leaq 0x21bb(%rip), %rcx      # 0x5987
movl $0x1f, %edx
callq 0x1090
leaq 0x21c2(%rip), %rdi      # 0x599f
leaq 0x2196(%rip), %rsi      # 0x597a
leaq 0x219c(%rip), %rcx      # 0x5987
movl $0x26, %edx
callq 0x1090
leaq 0x21f8(%rip), %rdi      # 0x59f4
leaq 0x2177(%rip), %rsi      # 0x597a
leaq 0x217d(%rip), %rcx      # 0x5987
movl $0x27, %edx
callq 0x1090
leaq 0x21ee(%rip), %rdi      # 0x5a09
leaq 0x2158(%rip), %rsi      # 0x597a
leaq 0x215e(%rip), %rcx      # 0x5987
movl $0x28, %edx
callq 0x1090
jmp 0x3835
movq %rax, %rbx
movq -0x28(%rbp), %rdi
movl -0x20(%rbp), %edx
xorl %esi, %esi
callq 0x1080
movq -0x28(%rbp), %rdi
testq %rdi, %rdi
je 0x3854
callq 0x1150
movq %rbx, %rdi
callq 0x11a0
// File: /workspace/github_cpp_makefile_star2_O3/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 0x1a10(%rip), %xmm0     # 0x58f0
leaq -0x60(%rbp), %rbx
movaps %xmm0, (%rbx)
leaq -0x2f0(%rbp), %rdi
movq %rbx, %rsi
callq 0x4654
leaq -0x1a8(%rbp), %rdi
movq %rbx, %rsi
callq 0x4654
leaq -0x2f0(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x46e2
leaq -0x1a8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x46e2
leaq -0x2d0(%rbp), %rsi
leaq -0x2c0(%rbp), %rdx
leaq -0x30(%rbp), %rdi
movl $0x80, %ecx
callq 0x1b25
movb $0x1, -0x1cf(%rbp)
leaq -0x188(%rbp), %rsi
leaq -0x178(%rbp), %rdx
leaq -0x40(%rbp), %rdi
movl $0x80, %ecx
callq 0x1b25
movb $0x1, -0x87(%rbp)
leaq 0x1ac4(%rip), %rsi      # 0x5a36
leaq -0x2f0(%rbp), %rdi
leaq -0x18(%rbp), %rcx
leaq -0xc(%rbp), %r8
movl $0x25, %edx
callq 0x472c
testb %al, %al
je 0x3fd7
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 0x47e2
testb %al, %al
jne 0x3ff6
leaq -0x1a8(%rbp), %rdi
callq 0x48e6
leaq -0x2f0(%rbp), %rdi
callq 0x48e6
addq $0x2e8, %rsp            # imm = 0x2E8
popq %rbx
popq %rbp
retq
leaq 0x1a7d(%rip), %rdi      # 0x5a5b
leaq 0x1995(%rip), %rsi      # 0x597a
leaq 0x1d40(%rip), %rcx      # 0x5d2c
movl $0xac, %edx
callq 0x1090
leaq 0x1d55(%rip), %rdi      # 0x5d52
leaq 0x1976(%rip), %rsi      # 0x597a
leaq 0x1d21(%rip), %rcx      # 0x5d2c
movl $0xb3, %edx
callq 0x1090
jmp 0x4020
jmp 0x4020
jmp 0x4020
movq %rax, %rbx
jmp 0x402f
movq %rax, %rbx
leaq -0x1a8(%rbp), %rdi
callq 0x48e6
leaq -0x2f0(%rbp), %rdi
callq 0x48e6
movq %rbx, %rdi
callq 0x11a0
// File: /workspace/github_cpp_makefile_star2_O3/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
xorl %eax, %eax
movq %rax, 0x128(%rdi)
movl %eax, 0x130(%rdi)
movq %rax, 0x138(%rdi)
movl %eax, 0x140(%rdi)
movups (%rsi), %xmm0
movups %xmm0, (%rdi)
leaq 0x30(%rdi), %rsi
movl $0x80, %edx
callq 0x24e1
movw $0x0, 0x120(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
movq 0x138(%rbx), %rdi
movl 0x140(%rbx), %edx
xorl %esi, %esi
callq 0x1080
movq 0x138(%rbx), %rdi
testq %rdi, %rdi
je 0x46c4
callq 0x1150
movq $0x0, 0x138(%rbx)
movl $0x0, 0x140(%rbx)
movq %r14, %rdi
callq 0x11a0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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:
cmpb $0x1, 0x120(%rdi)
jne 0x47cd
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movq %rcx, %r14
movq %rdi, %r15
addq $0x138, %rdi            # imm = 0x138
callq 0x34e6
testb %al, %al
je 0x47d0
movb $0x1, %al
cmpl $0x0, (%rbx)
je 0x47d2
leaq 0x30(%r15), %r13
xorl %eax, %eax
movl %eax, %r12d
movq (%r14), %rdi
addq %r12, %rdi
xorl %eax, %eax
movb 0x10(%r15,%rax), %cl
xorb %cl, (%rdi,%rax)
incq %rax
cmpq $0x10, %rax
jne 0x477b
xorl %eax, %eax
incb 0x10(%r15,%rax)
sete %cl
cmpq $0xe, %rax
ja 0x47a3
incq %rax
testb %cl, %cl
jne 0x478e
leaq -0x40(%rbp), %rsi
movq %r13, %rdx
movl $0x80, %ecx
callq 0x13f1
movq (%r14), %rax
movaps -0x40(%rbp), %xmm0
movups %xmm0, (%rax,%r12)
leal 0x10(%r12), %eax
cmpl (%rbx), %eax
jb 0x4770
movb $0x1, %al
jmp 0x47d2
xorl %eax, %eax
retq
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x48d5
movq %rcx, %r14
movl %edx, %r15d
cmpl $0x20, %edx
setb %al
testb $0xf, %r15b
setne %cl
orb %al, %cl
jne 0x48d5
movq %r8, %rbx
movq %rdi, %r12
movl %r15d, %esi
callq 0x49ae
testb %al, %al
je 0x48d5
movq %r14, -0x30(%rbp)
movq %rbx, -0x38(%rbp)
leaq 0x30(%r12), %rbx
xorl %r14d, %r14d
movl %r14d, %r13d
movq -0x40(%rbp), %rax
leaq (%rax,%r13), %rdi
movq 0x128(%r12), %rsi
addq %r13, %rsi
movq %rbx, %rdx
movl $0x80, %ecx
callq 0x1b25
addq 0x128(%r12), %r13
xorl %eax, %eax
movb 0x20(%r12,%rax), %cl
xorb %cl, (%r13,%rax)
incq %rax
cmpq $0x10, %rax
jne 0x4872
xorl %eax, %eax
incb 0x20(%r12,%rax)
sete %cl
cmpq $0xe, %rax
ja 0x489c
incq %rax
testb %cl, %cl
jne 0x4887
addl $0x10, %r14d
cmpl %r15d, %r14d
jb 0x4845
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 0x35be
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_O3/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 0x15da(%rip), %rdi      # 0x5f4f
xorl %esi, %esi
xorl %eax, %eax
callq 0x10d0
testl %eax, %eax
js 0x49a7
movl %eax, %r14d
movl $0x10, %edx
movl %eax, %edi
movq %rbx, %rsi
callq 0x1170
movq %rax, %rbx
movl %r14d, %edi
callq 0x11d0
movb $0x1, %al
cmpq $0x10, %rbx
je 0x49a9
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4a05
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
movq 0x128(%rdi), %rdi
xorl %esi, %esi
callq 0x1080
movl %r14d, 0x130(%rbx)
movq 0x128(%rbx), %rdi
testq %rdi, %rdi
je 0x49f2
callq 0x1150
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_O3/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 %rbx
subq $0x30, %rsp
movq %rdi, %rbx
addq $0x28, %rdi
callq 0x30670
movq 0x3f55e(%rip), %rcx     # 0x70cc8
leaq 0x10(%rsp), %rsi
movq %rcx, (%rsi)
movq $0x0, 0x8(%rsi)
movl %eax, 0x10(%rsi)
movq %rbx, 0x18(%rsi)
leaq 0x8(%rsp), %rdi
callq 0x2ebd0
leaq 0x8(%rsp), %rdi
callq 0x309e0
movl $0x2710, %edi           # imm = 0x2710
callq 0x301a0
cmpq $0x0, 0x8(%rsp)
jne 0x317bb
movb 0x1d8(%rbx), %al
addq $0x30, %rsp
popq %rbx
retq
cmpq $0x0, 0x8(%rsp)
je 0x317c0
callq 0x2e550
movq %rax, %rdi
cmpl $0x1, %edx
jne 0x317d6
callq 0x2e8b0
callq 0x30740
xorl %eax, %eax
jmp 0x317ad
callq 0x30a10
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2ee10
movw $0x0, 0x1d9(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
jmp 0x31030
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %r12
pushq %rbx
subq $0x28, %rsp
movb 0x1db(%rdi), %bl
cmpb $0x1, %bl
jne 0x31f5d
movq %rdi, %r14
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x2e8a0
movq %r14, %rdi
movq %r15, %rsi
callq 0x30c70
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x31f5d
callq 0x2f6c0
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x31f7d
callq 0x2f6c0
movq %rbx, %rdi
callq 0x30a10
nop
// File: /workspace/github_cpp_makefile_star2_O3/xjrueda[P]fixprime/include/Session.h
// Function: fprime::Session::setSessionRunning(bool)
void setSessionRunning(bool val) {
            mutex lock;
            lock.lock();
            sessionRunning = val;
            lock.unlock();
        }

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebx
movq %rdi, %r14
xorps %xmm0, %xmm0
movq %rsp, %rdi
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
movq $0x0, 0x20(%rdi)
callq 0x30330
testl %eax, %eax
jne 0x32321
movb %bl, 0x1d8(%r14)
movq %rsp, %rdi
callq 0x2f210
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movl %eax, %edi
callq 0x2f050
// File: /workspace/github_cpp_makefile_star2_O3/xjrueda[P]fixprime/include/Session.h
// Function: fprime::Session::setConnected(bool)
void setConnected(bool val) {
            mutex lock;
            lock.lock();
            connected = val;
            lock.unlock();
        }

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebx
movq %rdi, %r14
xorps %xmm0, %xmm0
movq %rsp, %rdi
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
movq $0x0, 0x20(%rdi)
callq 0x30330
testl %eax, %eax
jne 0x32369
movb %bl, 0x1db(%r14)
movq %rsp, %rdi
callq 0x2f210
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movl %eax, %edi
callq 0x2f050
// File: /workspace/github_cpp_makefile_star2_O3/xjrueda[P]fixprime/include/Session.h
// Function: fprime::Session::outboundProcessor(std::shared_ptr<SocketConnector>)
void outboundProcessor(SocketPtr socketPtr) {
            setObRunning(true);
            while (obpRunning) {
                unique_lock<mutex> lock(outboundLock);
                while (outboundQueue.empty() && obpRunning) {
                    outboundCondition.wait(lock);
                }
                if (obpRunning) {
                    string rawMsg = outboundQueue.front();
                    outboundQueue.pop();
                    lock.unlock();
                    try {
                        *socketPtr << rawMsg;
                    } catch (SocketException& se) {
                        cout << "Error trying to send: " << se.description() << endl;
                        cout.flush();
                    }

                }
            }
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, 0x40(%rsp)
movq %rdi, %r14
movb $0x1, 0x1da(%rdi)
leaq 0x2b8(%rdi), %rbx
leaq 0x238(%rdi), %r15
leaq 0x268(%rdi), %r12
leaq 0x10(%rsp), %r13
leaq 0x48(%rsp), %rbp
movq %rbx, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
movq %r13, %rdi
callq 0x2fb70
movb $0x1, 0x18(%rsp)
movq 0x278(%r14), %rax
cmpq %rax, 0x298(%r14)
jne 0x3328e
cmpb $0x1, 0x1da(%r14)
jne 0x3328e
movq %r15, %rdi
movq %r13, %rsi
callq 0x2e5b0
jmp 0x33267
cmpb $0x1, 0x1da(%r14)
jne 0x332e8
leaq 0x58(%rsp), %rcx
movq %rcx, 0x48(%rsp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %rbp, %rdi
callq 0x2e8a0
movq %r12, %rdi
callq 0x2fcc0
movq %r13, %rdi
callq 0x2e060
movq 0x40(%rsp), %rax
movq (%rax), %rdi
movq %rbp, %rsi
callq 0x2f300
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x332e8
callq 0x2f6c0
movq %r13, %rdi
callq 0x2e720
cmpb $0x0, 0x1da(%r14)
jne 0x33250
jmp 0x333a3
movq %rax, 0x8(%rsp)
cmpl $0x1, %edx
jne 0x333f1
movq 0x8(%rsp), %rdi
callq 0x2e8b0
movq %rax, 0x8(%rsp)
movl $0x16, %edx
movq 0x3db34(%rip), %rdi     # 0x70e60
leaq 0x26e42(%rip), %rsi     # 0x5a175
callq 0x2fb10
leaq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x20(%rsp), %rdi
callq 0x2e8a0
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq 0x3daf4(%rip), %rdi     # 0x70e60
callq 0x2fb10
movq %rax, %rdi
callq 0x2eab0
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x3338d
callq 0x2f6c0
movq 0x3dacc(%rip), %rdi     # 0x70e60
callq 0x2f0a0
callq 0x30740
jmp 0x332d4
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x333ec
jmp 0x333d1
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x333d6
callq 0x2f6c0
jmp 0x333d6
movq %rax, 0x8(%rsp)
callq 0x30740
jmp 0x333f1
movq %rax, %rdi
callq 0x320e8
movq %rax, 0x8(%rsp)
jmp 0x33405
movq %rax, 0x8(%rsp)
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x33405
callq 0x2f6c0
leaq 0x10(%rsp), %rdi
callq 0x2e720
movq 0x8(%rsp), %rdi
callq 0x30a10
nop