LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/dlbeer[P]summary_map/./summary_map.hpp
// Function: summary_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, summary, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, aggregator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>, summary>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>::insert(summary_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, summary, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, aggregator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>, summary>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>::iterator, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int> const&)
iterator insert(iterator pos, const value_type& val)
    {
	// Special-case optimization: insertion of sequential data (with
	// end() supplied as a hint).
	if ((pos == end()) && header.left) {
	    node *last = rightmost_child(header.left);

	    // Does it come after the last item?
	    if (comparer(last->value.first, val.first)) {
		node *n = new_node(allocator, val);

		last->right = n;
		n->parent = last;

		rebalance_after_insert(n);
		return n;
	    }
	}

	return insert(val).first;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
leaq 0x8(%rdi), %r15
cmpq %rsi, %r15
setne %cl
movq 0x38(%rdi), %rax
testq %rax, %rax
sete %dl
orb %cl, %dl
jne 0x2d2c
movq %rax, %r12
movq 0x38(%rax), %rax
testq %rax, %rax
jne 0x2ceb
movq %r12, %rdi
movq %r14, %rsi
callq 0x2030
movl %eax, %ebp
testl %eax, %eax
jns 0x2d28
leaq 0x2(%rbx), %rdi
movq %r14, %rsi
callq 0x2d64
movq %rax, %r13
movq %rax, 0x38(%r12)
movq %r12, 0x40(%rax)
movq %rax, %rdi
callq 0x2ddc
testl %ebp, %ebp
js 0x2d4a
leaq 0x2(%rbx), %rsi
movq %rbx, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x2fc2
movq %rax, %r13
testb $0x1, %dl
je 0x2d4a
incq 0x50(%rbx)
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0x2ad9
// File: /workspace/github_cpp_makefile_star2_O1/dlbeer[P]summary_map/./summary_map.hpp
// Function: summary_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, summary, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, aggregator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>, summary>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>::new_node(std::allocator<summary_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, summary, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, aggregator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>, summary>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>::node>&, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int> const&)
static node *new_node(node_allocator& alloc, const value_type& val)
    {
	node *n = alloc.allocate(1);

	try {
	    n = new (n) node(val);
	}
	catch (...) {
	    alloc.deallocate(n, 1);
	    throw;
	}

	return n;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movl $0x48, %edi
callq 0x2170
movq %rax, %rbx
addq $0x10, %rax
movq %rax, (%rbx)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x2f32
movl 0x20(%r14), %eax
movl %eax, 0x20(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rbx)
movups %xmm0, 0x38(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rdi
callq 0x2090
movq %rbx, %rdi
callq 0x2150
callq 0x21c0
movq %rax, %rbx
callq 0x21e0
movq %rbx, %rdi
callq 0x2210
movq %rax, %rdi
callq 0x2ad9
nop
// File: /workspace/github_cpp_makefile_star2_O1/dlbeer[P]summary_map/./summary_map.hpp
// Function: summary_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, summary, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, aggregator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>, summary>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>::add_node(std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>> const&, std::allocator<summary_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, summary, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, aggregator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>, summary>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>::node>&, summary_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, summary, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, aggregator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>, summary>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>::node*, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int> const&)
static std::pair<node *, bool>
    add_node(const key_compare& cmp, node_allocator& alloc,
	     node *header, const value_type& val)
    {
	node **nptr = &header->left;
	node *p = header;

	// Keep descending until we find a null down-pointer
	while (*nptr) {
	    node *c = *nptr;

	    invalidate(c);

	    if (cmp(val.first, c->value.first))
		nptr = &c->left;
	    else if (cmp(c->value.first, val.first))
		nptr = &c->right;
	    else
		return std::make_pair(c, false);

	    p = c;
	}

	// Attach a new node to the tree
	node *c = new_node(alloc, val);

	*nptr = c;
	c->parent = p;

	// Perform rebalancing
	rebalance_after_insert(c);

	return std::make_pair(c, true);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
leaq 0x30(%rdx), %rbp
movq (%rbp), %r13
testq %r13, %r13
je 0x3024
andb $-0x3, 0x2c(%r13)
movq %r14, %rdi
movq %r13, %rsi
callq 0x2030
testl %eax, %eax
js 0x300d
movq %r13, %rdi
movq %r14, %rsi
callq 0x2030
testl %eax, %eax
js 0x3013
xorl %eax, %eax
movq %r13, %rbx
jmp 0x301c
leaq 0x30(%r13), %rbp
jmp 0x3017
leaq 0x38(%r13), %rbp
movb $0x1, %al
movq %r13, %r15
testb %al, %al
jne 0x2fda
xorl %edx, %edx
jmp 0x3044
movq %r12, %rdi
movq %r14, %rsi
callq 0x2d64
movq %rax, %rbx
movq %rax, (%rbp)
movq %r15, 0x40(%rax)
movq %rax, %rdi
callq 0x2ddc
movb $0x1, %dl
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3058
movq %rax, %rdi
callq 0x2ad9
// File: /workspace/github_cpp_makefile_star2_O1/dlbeer[P]summary_map/./summary_map.hpp
// Function: summary_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, summary, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, aggregator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>, summary>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>::find_eq(std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, summary_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, summary, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, aggregator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>, summary>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>::node*)
static node *find_eq(const key_compare& cmp, const key_type& target,
			 node *header)
    {
	node *n = header->left;

	while (n) {
	    if (cmp(target, n->value.first))
		n = n->left;
	    else if (cmp(n->value.first, target))
		n = n->right;
	    else
		return n;
	}

	return header;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq 0x30(%rdx), %r14
testq %r14, %r14
je 0x30ac
movq %rsi, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x2030
testl %eax, %eax
js 0x3099
movq %r14, %rdi
movq %r15, %rsi
callq 0x2030
movl $0x38, %ecx
testl %eax, %eax
js 0x309e
jmp 0x30a9
movl $0x30, %ecx
movq (%r14,%rcx), %r14
testq %r14, %r14
jne 0x3074
jmp 0x30ac
movq %r14, %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
jmp 0x30b7
movq %rax, %rdi
callq 0x2ad9
nop
// File: /workspace/github_cpp_makefile_star2_O1/dlbeer[P]summary_map/./summary_map.hpp
// Function: summary_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, summary, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, aggregator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>, summary>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>::erase(summary_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, summary, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, aggregator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>, summary>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>::iterator)
void erase(iterator pos)
    {
	node *n = pos.m_cur;

	unlink_node(n);
	delete_node(allocator, n);
	item_count--;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x30f8
movq (%r14), %rdi
leaq 0x10(%r14), %rax
cmpq %rax, %rdi
je 0x30e3
callq 0x2150
movq %r14, %rdi
callq 0x2150
decq 0x50(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/dlbeer[P]summary_map/./summary_map.hpp
// Function: summary_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, summary, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, aggregator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>, summary>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>::unlink_node(summary_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, summary, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, aggregator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>, summary>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>::node*)
static void unlink_node(node *n)
    {
	// If we have two children, swap and reduce the problem to that
	// of removing a node with a single child. After removing n,
	// ordering will be preserved.
	if (n->left && n->right)
	    swap_with_successor(n);

	invalidate_up(n);

	// Replace the node with its child (if any).
	node *s = n->left ? n->left : n->right;
	fix_downptr(n->parent, n, s);

	// If n has a child, then n is black and s is red (otherwise it
	// wouldn't be possible to be black-balanced with one non-null
	// child).
	//
	// In this case, we can just recolour it and return immediately.
	if (s) {
	    s->parent = n->parent;
	    make_black(s);
	    return;
	}

	// If we removed a red node (which had no children), or the
	// root, we haven't altered the black balance.
	if (is_red(n))
	    return;

	// Otherwise, we have things to fix
	rebalance_after_remove(n->parent);
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x30(%rdi)
je 0x3112
cmpq $0x0, 0x38(%rbx)
je 0x3112
movq %rbx, %rdi
callq 0x316c
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0x3131
movq %rdi, %rax
movq %rbx, %rcx
andb $-0x3, 0x2c(%rcx)
movq %rax, %rcx
movq 0x40(%rax), %rax
testq %rax, %rax
jne 0x3121
movq 0x30(%rbx), %rax
testq %rax, %rax
jne 0x313e
movq 0x38(%rbx), %rax
xorl %ecx, %ecx
cmpq %rbx, 0x30(%rdi)
setne %cl
movq %rax, 0x30(%rdi,%rcx,8)
testq %rax, %rax
je 0x315b
movq %rdi, 0x40(%rax)
andb $-0x2, 0x2c(%rax)
popq %rbx
retq
testq %rbx, %rbx
je 0x3166
testb $0x1, 0x2c(%rbx)
jne 0x3159
popq %rbx
jmp 0x321e
// File: /workspace/github_cpp_makefile_star2_O1/dlbeer[P]summary_map/./summary_map.hpp
// Function: summary_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, summary, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, aggregator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>, summary>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>::swap_with_successor(summary_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, summary, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, aggregator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>, summary>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>::node*)
static void swap_with_successor(node *n)
    {
	node *p = n->parent;
	node *s = leftmost_child(n->right);

	if (s->parent == n) {
	    // This is a tricky case: we can't just swap pointers,
	    // because we'd end up with a cycle.
	    node *left = n->left;
	    node *right = s->right;

	    s->left = left;
	    s->right = n;
	    s->parent = p;

	    n->right = right;
	    n->parent = s;

	    left->parent = s;
	} else {
	    s->left = n->left;

	    std::swap(n->right, s->right);
	    std::swap(n->parent, s->parent);

	    s->left->parent = s;
	    s->right->parent = s;

	    n->parent->left = n;
	}

	std::swap(n->flags, s->flags);
	n->left = 0;

	fix_downptr(p, n, s);

	if (n->right)
	    n->right->parent = n;
    }

// Assembly:
movq 0x38(%rdi), %rcx
testq %rcx, %rcx
je 0x3183
movq %rcx, %rax
movq 0x30(%rcx), %rcx
testq %rcx, %rcx
jne 0x3175
jmp 0x3185
xorl %eax, %eax
movq 0x40(%rdi), %rcx
movq 0x30(%rdi), %rdx
cmpq %rdi, 0x40(%rax)
je 0x31d1
movq %rdx, 0x30(%rax)
movq 0x38(%rdi), %rdx
movq 0x38(%rax), %rsi
movq %rsi, 0x38(%rdi)
movq %rdx, 0x38(%rax)
movq 0x40(%rdi), %rdx
movq 0x40(%rax), %rsi
movq %rsi, 0x40(%rdi)
movq %rdx, 0x40(%rax)
movq 0x30(%rax), %rdx
movq %rax, 0x40(%rdx)
movq 0x38(%rax), %rdx
movq %rax, 0x40(%rdx)
movq 0x40(%rdi), %rdx
movq %rdi, 0x30(%rdx)
jmp 0x31ed
movq 0x38(%rax), %rsi
movq %rdx, 0x30(%rax)
movq %rdi, 0x38(%rax)
movq %rcx, 0x40(%rax)
movq %rsi, 0x38(%rdi)
movq %rax, 0x40(%rdi)
movq %rax, 0x40(%rdx)
movl 0x2c(%rdi), %edx
movl 0x2c(%rax), %esi
movl %esi, 0x2c(%rdi)
movl %edx, 0x2c(%rax)
movq $0x0, 0x30(%rdi)
xorl %edx, %edx
cmpq %rdi, 0x30(%rcx)
setne %dl
movq %rax, 0x30(%rcx,%rdx,8)
movq 0x38(%rdi), %rax
testq %rax, %rax
je 0x321c
movq %rdi, 0x40(%rax)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/dlbeer[P]summary_map/test_util.cpp
// Function: load_words(char const*, std::vector<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int>>>&, int)
void load_words(const char *path, test_vector& vec, int limit)
{
    std::ifstream in(path);

    while (!in.eof()) {
	char buf[128];

	if (limit >= 0 && !(limit--))
	    break;

	assert(in.good());
	in.getline(buf, sizeof(buf));

	vec.push_back(std::make_pair(buf, x33a(buf)));
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2b8, %rsp            # imm = 0x2B8
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %rsi
leaq 0xb0(%rsp), %r15
movq %r15, %rdi
movl $0x8, %edx
callq 0x2230
leaq 0x30(%rsp), %r12
leaq 0x8(%rsp), %r13
movq 0xb0(%rsp), %rax
movq -0x18(%rax), %rcx
testb $0x2, 0xd0(%rsp,%rcx)
jne 0x43c9
testl %ebx, %ebx
js 0x432e
subl $0x1, %ebx
jae 0x432e
xorl %eax, %eax
jmp 0x43c1
movq -0x18(%rax), %rax
cmpl $0x0, 0xd0(%rsp,%rax)
jne 0x43e8
leaq (%rsp,%rax), %rdi
addq $0xb0, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %ecx
movl $0x80, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x2240
movb 0x30(%rsp), %al
xorl %ebp, %ebp
testb %al, %al
je 0x438c
leaq 0x31(%rsp), %rcx
movl %ebp, %edx
shll $0x5, %edx
addl %ebp, %edx
movsbl %al, %ebp
addl %edx, %ebp
movb (%rcx), %al
incq %rcx
testb %al, %al
jne 0x4377
movq %r13, %rdi
movq %r12, %rsi
leaq 0x7(%rsp), %rdx
callq 0x2080
movl %ebp, 0x28(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x45ae
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x43bf
callq 0x2150
movb $0x1, %al
testb %al, %al
jne 0x4304
leaq 0xb0(%rsp), %rdi
callq 0x2050
addq $0x2b8, %rsp            # imm = 0x2B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd41(%rip), %rdi       # 0x5130
leaq 0xd44(%rip), %rsi       # 0x513a
leaq 0xd4b(%rip), %rcx       # 0x5148
movl $0x2b, %edx
callq 0x20d0
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x4425
callq 0x2150
jmp 0x4425
jmp 0x4422
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x2050
movq %rbx, %rdi
callq 0x2210
// File: /workspace/github_cpp_makefile_star2_O1/dlbeer[P]summary_map/test_util.cpp
// Function: shuffle(std::vector<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int>>>&, int)
void shuffle(test_vector& vec, int seed)
{
    std::mt19937 engine;

    engine.seed(seed);

    for (int i = vec.size() - 1; i > 0; i--)
	std::swap(vec[i], vec[engine() % i]);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1388, %rsp           # imm = 0x1388
movq %rdi, %rbx
movq $0x1571, (%rsp)         # imm = 0x1571
movl $0x1, %eax
movl $0x1571, %ecx           # imm = 0x1571
movq %rcx, %rdx
shrq $0x1e, %rdx
xorl %ecx, %edx
imull $0x6c078965, %edx, %ecx # imm = 0x6C078965
addl %eax, %ecx
movq %rcx, (%rsp,%rax,8)
incq %rax
cmpq $0x270, %rax            # imm = 0x270
jne 0x4460
movq $0x270, 0x1380(%rsp) # imm = 0x270
movl %esi, %eax
movq %rax, (%rsp)
movl $0x1, %ecx
movq %rax, %rdx
shrq $0x1e, %rdx
xorl %eax, %edx
imull $0x6c078965, %edx, %eax # imm = 0x6C078965
addl %ecx, %eax
movq %rax, (%rsp,%rcx,8)
incq %rcx
cmpq $0x270, %rcx            # imm = 0x270
jne 0x4497
movq $0x270, 0x1380(%rsp) # imm = 0x270
movq 0x8(%rbx), %rax
subq (%rbx), %rax
shrq $0x3, %rax
imull $0xcccccccd, %eax, %eax # imm = 0xCCCCCCCD
decl %eax
testl %eax, %eax
jle 0x4539
movl %eax, %r13d
leaq (,%r13,8), %rax
leaq (%rax,%rax,4), %rbp
movq (%rbx), %r14
leaq (%r14,%rbp), %r15
movq %rsp, %rdi
callq 0x454c
xorl %edx, %edx
divq %r13
movq (%rbx), %rax
leaq (%rdx,%rdx,4), %rcx
leaq (%rax,%rcx,8), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x2110
movl 0x20(%r14,%rbp), %eax
movl 0x20(%r12), %ecx
movl %ecx, 0x20(%r14,%rbp)
movl %eax, 0x20(%r12)
leaq -0x1(%r13), %rax
addq $-0x28, %rbp
cmpq $0x1, %r13
movq %rax, %r13
jg 0x44ea
addq $0x1388, %rsp           # imm = 0x1388
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/nicoeps[P]NicoGB/src/cartridge.cpp
// Function: Cartridge::Cartridge()
Cartridge::Cartridge() {
    cartridgeROM = std::vector<uint8_t>();
    cartridgeRAM = std::vector<uint8_t>();
    title = "";
    loaded = false;
    cartridgeType = 0;
    romSize = 0;
    ramSize = 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x10(%rdi), %r14
movq %r14, (%rdi)
xorl %eax, %eax
movq %rax, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
leaq 0x30(%rdi), %r15
leaq 0x48(%rdi), %r12
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rdi)
movups %xmm0, 0x38(%rdi)
movups %xmm0, 0x48(%rdi)
movq %rax, 0x58(%rdi)
movq %rsp, %r13
movq %rax, 0x10(%r13)
movaps %xmm0, (%r13)
movq %r15, %rdi
movq %r13, %rsi
callq 0x285c
movq (%r13), %rdi
testq %rdi, %rdi
je 0x2486
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x21c0
movq %rsp, %r13
xorps %xmm0, %xmm0
movaps %xmm0, (%r13)
movq $0x0, 0x10(%r13)
movq %r12, %rdi
movq %r13, %rsi
callq 0x285c
movq (%r13), %rdi
testq %rdi, %rdi
je 0x24ba
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x21c0
leaq 0x28(%rbx), %r13
movq 0x8(%rbx), %rdx
leaq 0x848b(%rip), %rcx      # 0xa954
movq %rbx, %rdi
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x2210
xorl %eax, %eax
movb %al, 0x20(%rbx)
movb %al, 0x60(%rbx)
movq $0x0, 0x68(%rbx)
movl $0x0, 0x70(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbp
movq (%r12), %rdi
testq %rdi, %rdi
je 0x2514
movq 0x58(%rbx), %rsi
subq %rdi, %rsi
callq 0x21c0
movq %r15, %rdi
movq %r13, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x22b0
movq %rbp, %rdi
callq 0x2270
nop
// File: /workspace/github_cpp_makefile_star2_O1/nicoeps[P]NicoGB/src/cpu.cpp
// Function: CPU::init()
void CPU::init() {
    AF = 0;
    BC = 0;
    DE = 0;
    HL = 0;
    SP = 0;
    PC = 0;
    opcode = 0;

    totalCycles = 0;
    halted = 0;
    haltBug = 0;
    IRQ = 0;
    IME = 0;
    run = true;
}

// Assembly:
movq 0x28(%rdi), %rax
xorl %ecx, %ecx
movw %cx, (%rax)
movq 0x40(%rdi), %rax
movw %cx, (%rax)
movq 0x58(%rdi), %rax
movw %cx, (%rax)
movq 0x70(%rdi), %rax
movw %cx, (%rax)
movq %rcx, 0x10(%rdi)
movq %rcx, 0x88(%rdi)
movb $0x0, 0x90(%rdi)
movb $0x1, 0x18(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/nicoeps[P]NicoGB/src/cpu.cpp
// Function: CPU::tick()
void CPU::tick() {
    memory.timer.counter += 4;
    totalCycles += 4;

    if (memory.timer.reload > 0) {
        memory.timer.reload -= 4;
        if (memory.timer.reload == 0) {
            memory.interrupt(TIMER);
            memory.timer.tima = memory.timer.tma;
        }
    }

    if (memory.timer.fallingEdge()) {
        memory.timer.tima++;
        if (memory.timer.tima == 0) {
            memory.timer.reload = 4;
        }
    }
    memory.timer.oldEdge = memory.timer.currentEdge();

    if (!halted) {
        memory.transfer();
    }

    ppu.update();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
movq 0x10(%rax), %rax
addw $0x4, (%rax)
addq $0x4, 0x10(%rdi)
movq (%rdi), %rdi
movq 0x10(%rdi), %rax
movb 0x5(%rax), %cl
testb %cl, %cl
je 0x2bbd
addb $-0x4, %cl
movb %cl, 0x5(%rax)
jne 0x2bbd
movl $0x4, %esi
callq 0x70c6
movq (%rbx), %rax
movq 0x10(%rax), %rax
movb 0x3(%rax), %cl
movb %cl, 0x2(%rax)
movq (%rbx), %rax
movq 0x10(%rax), %rdi
callq 0x9062
testb %al, %al
je 0x2bdd
movq (%rbx), %rax
movq 0x10(%rax), %rax
incb 0x2(%rax)
jne 0x2bdd
movb $0x4, 0x5(%rax)
movq (%rbx), %rax
movq 0x10(%rax), %rdi
callq 0x9040
movq (%rbx), %rdi
movq 0x10(%rdi), %rcx
movb %al, 0x6(%rcx)
cmpb $0x0, 0x8d(%rbx)
jne 0x2c01
callq 0x7292
movq 0x8(%rbx), %rdi
popq %rbx
jmp 0x7c54
nop
// File: /workspace/github_cpp_makefile_star2_O1/nicoeps[P]NicoGB/src/cpu.cpp
// Function: CPU::RL(unsigned char)
uint8_t CPU::RL(uint8_t n) {
    uint8_t C = (n >> 7) << 4;
    n = (n << 1) | (CARRY_F() >> 4);
    F = ZERO_S(n) | C;
    return n;
}

// Assembly:
leal (%rsi,%rsi), %ecx
movl %esi, %edx
shrb $0x3, %dl
andb $0x10, %dl
movq 0x28(%rdi), %rax
movq 0x38(%rdi), %rsi
movb (%rax), %al
shrb $0x4, %al
andb $0x1, %al
orb %cl, %al
sete %cl
shlb $0x7, %cl
orb %dl, %cl
movb %cl, (%rsi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/nicoeps[P]NicoGB/src/cpu.cpp
// Function: CPU::RR(unsigned char)
uint8_t CPU::RR(uint8_t n) {
    uint8_t C = (n & 0x1) << 4;
    n = (n >> 1) | (CARRY_F() << 3);
    F = ZERO_S(n) | C;
    return n;
}

// Assembly:
movl %esi, %ecx
shlb $0x4, %cl
andb $0x10, %cl
shrb %sil
movq 0x28(%rdi), %rax
movq 0x38(%rdi), %rdx
movb (%rax), %al
shlb $0x3, %al
andb $-0x80, %al
orb %sil, %al
sete %sil
shlb $0x7, %sil
orb %cl, %sil
movb %sil, (%rdx)
retq
// File: /workspace/github_cpp_makefile_star2_O1/nicoeps[P]NicoGB/src/cpu.cpp
// Function: CPU::SLA(unsigned char)
uint8_t CPU::SLA(uint8_t n) {
    uint8_t C = (n >> 7) << 4;
    n = n << 1;
    F = ZERO_S(n) | C;
    return n;
}

// Assembly:
movl %esi, %eax
movl %eax, %ecx
shrb $0x3, %cl
andb $0x10, %cl
addb %al, %al
sete %dl
shlb $0x7, %dl
orb %cl, %dl
movq 0x38(%rdi), %rcx
movb %dl, (%rcx)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/nicoeps[P]NicoGB/src/cpu.cpp
// Function: CPU::SRA(unsigned char)
uint8_t CPU::SRA(uint8_t n) {
    uint8_t C = (n & 0x1) << 4;
    n = (n >> 1) | (n & 0x80);
    F = ZERO_S(n) | C;
    return n;
}

// Assembly:
movl %esi, %ecx
shlb $0x4, %cl
andb $0x10, %cl
movl %esi, %eax
shrb %al
andb $-0x80, %sil
orb %sil, %al
sete %dl
shlb $0x7, %dl
orb %cl, %dl
movq 0x38(%rdi), %rcx
movb %dl, (%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O1/nicoeps[P]NicoGB/src/cpu.cpp
// Function: CPU::SRL(unsigned char)
uint8_t CPU::SRL(uint8_t n) {
    uint8_t C = (n & 0x1) << 4;
    n = n >> 1;
    F = ZERO_S(n) | C;
    return n;
}

// Assembly:
movl %esi, %ecx
shlb $0x4, %cl
andb $0x10, %cl
movl %esi, %eax
shrb %al
cmpb $0x2, %sil
setb %dl
shlb $0x7, %dl
orb %cl, %dl
movq 0x38(%rdi), %rcx
movb %dl, (%rcx)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/nicoeps[P]NicoGB/src/cpu.cpp
// Function: CPU::JP(bool)
void CPU::JP(bool flag) {
    uint16_t nn = readb16();
    if (flag) {
        PC = nn;
        tick();
    }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
callq 0x2d7e
testl %ebp, %ebp
je 0x3328
movw %ax, 0x8a(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2b7c
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/nicoeps[P]NicoGB/src/cpu.cpp
// Function: CPU::JR(bool)
void CPU::JR(bool flag) {
    int8_t e = readByte();
    if (flag) {
        PC += e;
        tick();
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
movzwl 0x8a(%rdi), %esi
leal 0x1(%rsi), %eax
movw %ax, 0x8a(%rdi)
movq (%rdi), %rdi
callq 0x70d8
movl %eax, %ebp
movq %rbx, %rdi
callq 0x2b7c
testl %r14d, %r14d
je 0x3379
movsbl %bpl, %eax
addw %ax, 0x8a(%rbx)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2b7c
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/nicoeps[P]NicoGB/src/cpu.cpp
// Function: CPU::CALL(bool)
void CPU::CALL(bool flag) {
    uint16_t nn = readb16();
    if (flag) {
        push(PC);
        PC = nn;
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
callq 0x2d7e
testl %r14d, %r14d
je 0x33aa
movl %eax, %ebp
movzwl 0x8a(%rbx), %esi
movq %rbx, %rdi
callq 0x2dde
movw %bp, 0x8a(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/nicoeps[P]NicoGB/src/cpu.cpp
// Function: CPU::RET(bool)
void CPU::RET(bool flag) {
    tick();
    if (flag) {
        PC = pop();
        tick();
    }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
callq 0x2b7c
testl %ebp, %ebp
je 0x33de
movq %rbx, %rdi
callq 0x2e44
movw %ax, 0x8a(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2b7c
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/nicoeps[P]NicoGB/src/joypad.cpp
// Function: Joypad::read()
uint8_t Joypad::read() {
    switch (mode) {
        case 0x00: return 0xC0 | mode | (keys[0] & keys[1]);
        case 0x10: return 0xC0 | mode | keys[0];
        case 0x20: return 0xC0 | mode | keys[1];
        default: return 0xCF;
    }
}

// Assembly:
movzbl 0x2(%rdi), %ecx
cmpl $0x20, %ecx
je 0x5f0d
cmpl $0x10, %ecx
je 0x5f08
movb $-0x31, %al
testl %ecx, %ecx
jne 0x5f12
movb 0x1(%rdi), %al
andb (%rdi), %al
orb $-0x40, %al
retq
movb (%rdi), %al
orb $-0x30, %al
retq
movb 0x1(%rdi), %al
orb $-0x20, %al
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/nicoeps[P]NicoGB/src/joypad.cpp
// Function: Joypad::keyDown(Key)
void Joypad::keyDown(Key key) {
    switch (key) {
        case RIGHT:  keys[1] |= 0x2; keys[1] &= 0xE; interrupt = true; break;
        case LEFT:   keys[1] |= 0x1; keys[1] &= 0xD; interrupt = true; break;
        case UP:     keys[1] |= 0x8; keys[1] &= 0xB; interrupt = true; break;
        case DOWN:   keys[1] |= 0x4; keys[1] &= 0x7; interrupt = true; break;
        case A:      keys[0] &= 0xE; interrupt = true; break;
        case B:      keys[0] &= 0xD; interrupt = true; break;
        case SELECT: keys[0] &= 0xB; interrupt = true; break;
        case START:  keys[0] &= 0x7; interrupt = true; break;
        default: break;
    }
}

// Assembly:
cmpl $0x7, %esi
ja 0x5f68
movl %esi, %eax
leaq 0x49c8(%rip), %rcx      # 0xa8f4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb 0x1(%rdi), %al
andb $0xc, %al
orb $0x2, %al
jmp 0x5f61
andb $0xe, (%rdi)
jmp 0x5f64
movb 0x1(%rdi), %al
andb $0x3, %al
orb $0x8, %al
jmp 0x5f61
movb 0x1(%rdi), %al
andb $0x3, %al
orb $0x4, %al
jmp 0x5f61
andb $0x7, (%rdi)
jmp 0x5f64
movb 0x1(%rdi), %al
andb $0xc, %al
incb %al
movb %al, 0x1(%rdi)
movb $0x1, 0x3(%rdi)
retq
andb $0xd, (%rdi)
jmp 0x5f64
andb $0xb, (%rdi)
jmp 0x5f64
nop
// File: /workspace/github_cpp_makefile_star2_O1/nicoeps[P]NicoGB/src/joypad.cpp
// Function: Joypad::keyUp(Key)
void Joypad::keyUp(Key key) {
    switch (key) {
        case RIGHT:  keys[1] |= 0x1; break;
        case LEFT:   keys[1] |= 0x2; break;
        case UP:     keys[1] |= 0x4; break;
        case DOWN:   keys[1] |= 0x8; break;
        case A:      keys[0] |= 0x1; break;
        case B:      keys[0] |= 0x2; break;
        case SELECT: keys[0] |= 0x4; break;
        case START:  keys[0] |= 0x8; break;
        default: break;
    } 
}

// Assembly:
cmpl $0x7, %esi
ja 0x5fa7
movb $0x1, %al
movl %esi, %ecx
leaq 0x4990(%rip), %rdx      # 0xa914
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
incq %rdi
jmp 0x5fa5
incq %rdi
movb $0x2, %al
jmp 0x5fa5
incq %rdi
movb $0x8, %al
jmp 0x5fa5
incq %rdi
movb $0x4, %al
orb %al, (%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/nicoeps[P]NicoGB/src/main.cpp
// Function: getKey(int)
Key getKey(SDL_Keycode sym) {
    switch (sym) {
        case SDLK_RIGHT:  return RIGHT;  break;
        case SDLK_LEFT:   return LEFT;   break;
        case SDLK_UP:     return UP;     break;
        case SDLK_DOWN:   return DOWN;   break;
        case SDLK_z:      return A;      break;
        case SDLK_x:      return B;      break;
        case SDLK_LSHIFT:
        case SDLK_RSHIFT: return SELECT; break;
        case SDLK_RETURN: return START;  break;
        default:          return NONE;   break;
    }
}

// Assembly:
cmpl $0x4000004e, %edi       # imm = 0x4000004E
jle 0x5ffd
leal -0x4000004f(%rdi), %eax
cmpl $0x3, %eax
ja 0x6012
leaq 0x4943(%rip), %rcx      # 0xa934
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %eax, %eax
retq
cmpl $0xd, %edi
je 0x6028
cmpl $0x78, %edi
je 0x602e
cmpl $0x7a, %edi
jne 0x6046
movl $0x4, %eax
retq
cmpl $0x400000e1, %edi       # imm = 0x400000E1
je 0x6022
cmpl $0x400000e5, %edi       # imm = 0x400000E5
jne 0x6046
movl $0x6, %eax
retq
movl $0x7, %eax
retq
movl $0x5, %eax
retq
movl $0x3, %eax
retq
movl $0x2, %eax
retq
movl $0x1, %eax
retq
movl $0x8, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/nicoeps[P]NicoGB/src/mbc.cpp
// Function: MBC0::read(unsigned short)
uint8_t MBC0::read(uint16_t address) {
    if (address <= 0x7FFF) {
        return rom[address];
    } else if (address >= 0xA000 && address <= 0xBFFF) {
        return ram[(address - 0xA000) % ramSize];
    } else {
        return 0xFF;
    }
}

// Assembly:
testw %si, %si
js 0x67ae
addq $0x8, %rdi
movzwl %si, %edx
jmp 0x67d0
movl %esi, %ecx
andl $0xe000, %ecx           # imm = 0xE000
movb $-0x1, %al
cmpl $0xa000, %ecx           # imm = 0xA000
jne 0x67d9
addl $0xffff6000, %esi       # imm = 0xFFFF6000
movl %esi, %eax
cltd
idivl 0x18(%rdi)
addq $0x10, %rdi
movq (%rdi), %rax
movq (%rax), %rax
movb (%rax,%rdx), %al
retq
// File: /workspace/github_cpp_makefile_star2_O1/nicoeps[P]NicoGB/src/mbc.cpp
// Function: MBC1::read(unsigned short)
uint8_t MBC1::read(uint16_t address) {
    if (address <= 0x3FFF) {
        romBank = (mode ? (bank2 << 5) : 0);
        return rom[((romBank << 14) | (address & 0x3FFF)) % romSize];
    } else if (address <= 0x7FFF) {
        romBank = ((bank2 << 5) | bank1);
        return rom[((romBank << 14) | (address & 0x3FFF)) % romSize];
    } else if (address >= 0xA000 && address <= 0xBFFF) {
        if (ramg) {
            ramBank = (mode ? bank2 : 0);
            return ram[((ramBank << 13) | (address & 0x1FFF)) % ramSize];
        } else {
            return 0xFF;
        }
    } else {
        return 0xFF;
    }
}

// Assembly:
cmpl $0x3fff, %esi           # imm = 0x3FFF
ja 0x682d
movb 0x25(%rdi), %al
shlb $0x5, %al
movzbl %al, %eax
xorl %ecx, %ecx
cmpb $0x0, 0x28(%rdi)
cmovel %ecx, %eax
movb %al, 0x26(%rdi)
leaq 0x8(%rdi), %rcx
movzbl %al, %eax
shll $0xe, %eax
orl %esi, %eax
jmp 0x6852
testw %si, %si
js 0x6863
movb 0x25(%rdi), %al
shlb $0x5, %al
orb 0x24(%rdi), %al
movzbl %al, %eax
movb %al, 0x26(%rdi)
leaq 0x8(%rdi), %rcx
shll $0xe, %eax
andl $0x3fff, %esi           # imm = 0x3FFF
orl %eax, %esi
movl %esi, %eax
xorl %edx, %edx
idivl 0x1c(%rdi)
movq (%rcx), %rax
movl %edx, %ecx
movq (%rax), %rax
movb (%rax,%rcx), %al
retq
movl %esi, %ecx
andl $0xe000, %ecx           # imm = 0xE000
movb $-0x1, %al
cmpl $0xa000, %ecx           # imm = 0xA000
jne 0x6862
cmpb $0x1, 0x18(%rdi)
jne 0x6862
movzbl 0x25(%rdi), %eax
xorl %ecx, %ecx
cmpb $0x0, 0x28(%rdi)
cmovel %ecx, %eax
movb %al, 0x27(%rdi)
leaq 0x10(%rdi), %rcx
movzbl %al, %eax
shll $0xd, %eax
andl $0x1fff, %esi           # imm = 0x1FFF
orl %eax, %esi
movl %esi, %eax
xorl %edx, %edx
idivl 0x20(%rdi)
jmp 0x6857
// File: /workspace/github_cpp_makefile_star2_O1/nicoeps[P]NicoGB/src/mbc.cpp
// Function: MBC1::write(unsigned short, unsigned char)
void MBC1::write(uint16_t address, uint8_t n) {
    if (address <= 0x1FFF) {
        ramg = ((n & 0x0F) == 0x0A);
    } else if (address <= 0x3FFF) {
        n &= 0x1F;
        if (n == 0) {
            n = 0x1;
        }
        bank1 = n;
    } else if (address <= 0x5FFF) {
        bank2 = n & 0x3;
    } else if (address <= 0x7FFF) {
        mode = n & 0x1;
    } else if (address >= 0xA000 && address <= 0xBFFF) {
        if (ramg) {
            ramBank = (mode ? bank2 : 0);
            ram[((ramBank << 13) | (address & 0x1FFF)) % ramSize] = n;
        }
    }
}

// Assembly:
movl %edx, %ecx
cmpl $0x1fff, %esi           # imm = 0x1FFF
ja 0x68bb
andb $0xf, %cl
cmpb $0xa, %cl
sete 0x18(%rdi)
retq
movzwl %si, %eax
cmpl $0x3fff, %eax           # imm = 0x3FFF
ja 0x68d9
andb $0x1f, %cl
movzbl %cl, %eax
cmpb $0x2, %al
movl $0x1, %ecx
cmovael %eax, %ecx
movb %cl, 0x24(%rdi)
retq
cmpl $0x5fff, %eax           # imm = 0x5FFF
ja 0x68e7
andb $0x3, %cl
movb %cl, 0x25(%rdi)
retq
testw %si, %si
js 0x68f3
andb $0x1, %cl
movb %cl, 0x28(%rdi)
retq
movl %esi, %eax
andl $0xe000, %eax           # imm = 0xE000
cmpl $0xa000, %eax           # imm = 0xA000
jne 0x68f2
cmpb $0x1, 0x18(%rdi)
jne 0x68f2
movzbl 0x25(%rdi), %eax
xorl %edx, %edx
cmpb $0x0, 0x28(%rdi)
cmovel %edx, %eax
movb %al, 0x27(%rdi)
movq 0x10(%rdi), %r8
movzbl %al, %eax
shll $0xd, %eax
andl $0x1fff, %esi           # imm = 0x1FFF
orl %eax, %esi
movl %esi, %eax
xorl %edx, %edx
idivl 0x20(%rdi)
movq (%r8), %rax
movb %cl, (%rax,%rdx)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/nicoeps[P]NicoGB/src/mbc.cpp
// Function: MBC2::read(unsigned short)
uint8_t MBC2::read(uint16_t address) {
    if (address <= 0x3FFF) {
        return rom[address];
    } else if (address <= 0x7FFF) {
        return rom[((romb << 14) | (address & 0x3FFF)) % romSize];
    } else if (address >= 0xA000 && address <= 0xBFFF) {
        if (ramg) {
            return ram[address % ramSize];
        } else {
            return 0xFF;
        }
    } else {
        return 0xFF;
    }
}

// Assembly:
cmpl $0x3fff, %esi           # imm = 0x3FFF
ja 0x6949
addq $0x8, %rdi
movzwl %si, %edx
jmp 0x6968
testw %si, %si
js 0x6972
movzbl 0x24(%rdi), %eax
shll $0xe, %eax
andl $0x3fff, %esi           # imm = 0x3FFF
orl %eax, %esi
movl %esi, %eax
xorl %edx, %edx
idivl 0x1c(%rdi)
addq $0x8, %rdi
movq (%rdi), %rax
movq (%rax), %rax
movb (%rax,%rdx), %al
retq
movl %esi, %ecx
andl $0xe000, %ecx           # imm = 0xE000
movb $-0x1, %al
cmpl $0xa000, %ecx           # imm = 0xA000
jne 0x6971
cmpb $0x1, 0x18(%rdi)
jne 0x6971
movl %esi, %eax
xorl %edx, %edx
idivl 0x20(%rdi)
addq $0x10, %rdi
jmp 0x6968
nop
// File: /workspace/github_cpp_makefile_star2_O1/nicoeps[P]NicoGB/src/mbc.cpp
// Function: MBC2::write(unsigned short, unsigned char)
void MBC2::write(uint16_t address, uint8_t n) {
    if (address <= 0x3FFF) {
        n &= 0x0F;
        if ((address & 0x100) == 0) {
            ramg = n == 0x0A;
        } else {
            romb = n == 0 ? 0x1 : n;
        }
    } else if (address >= 0xA000 && address <= 0xBFFF) {
        if (ramg) {
            ram[address % ramSize] = n | 0xF0;
        }
    }
}

// Assembly:
movl %edx, %ecx
cmpl $0x3fff, %esi           # imm = 0x3FFF
ja 0x69b3
andb $0xf, %cl
btl $0x8, %esi
jb 0x69dc
cmpb $0xa, %cl
sete 0x18(%rdi)
retq
movl %esi, %eax
andl $0xe000, %eax           # imm = 0xE000
cmpl $0xa000, %eax           # imm = 0xA000
jne 0x69ec
cmpb $0x1, 0x18(%rdi)
jne 0x69ec
movq 0x10(%rdi), %r8
movl %esi, %eax
xorl %edx, %edx
idivl 0x20(%rdi)
orb $-0x10, %cl
movq (%r8), %rax
movb %cl, (%rax,%rdx)
retq
movzbl %cl, %eax
cmpb $0x2, %al
movl $0x1, %ecx
cmovael %eax, %ecx
movb %cl, 0x24(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/nicoeps[P]NicoGB/src/mbc.cpp
// Function: MBC3::read(unsigned short)
uint8_t MBC3::read(uint16_t address) {
    if (address <= 0x3FFF) {
        return rom[address];
    } else if (address <= 0x7FFF) {
        return rom[((romBank << 14) | (address & 0x3FFF)) % romSize];
    } else if (address >= 0xA000 && address <= 0xBFFF) {
        if (ramg) {
            if (ramBank <= 0x3) {
                return ram[((ramBank << 13) | (address & 0x1FFF)) % ramSize];
            } else if (ramBank >= 0x08 && ramBank <= 0x0C) {
                return RTC[ramBank - 0x08];
            } else {
                return 0xFF;
            }
        } else {
            return 0xFF;
        }
    } else {
        return 0xFF;
    }
}

// Assembly:
cmpl $0x3fff, %esi           # imm = 0x3FFF
ja 0x6a02
movq 0x8(%rdi), %rax
movzwl %si, %edx
addq (%rax), %rdx
jmp 0x6a24
testw %si, %si
js 0x6a27
movq 0x8(%rdi), %rcx
movzbl 0x24(%rdi), %eax
shll $0xe, %eax
andl $0x3fff, %esi           # imm = 0x3FFF
orl %eax, %esi
movl %esi, %eax
xorl %edx, %edx
idivl 0x1c(%rdi)
addq (%rcx), %rdx
movb (%rdx), %al
retq
movl %esi, %ecx
andl $0xe000, %ecx           # imm = 0xE000
movb $-0x1, %al
cmpl $0xa000, %ecx           # imm = 0xA000
jne 0x6a26
cmpb $0x1, 0x18(%rdi)
jne 0x6a26
movzbl 0x25(%rdi), %ecx
cmpl $0x3, %ecx
ja 0x6a63
movq 0x10(%rdi), %r8
shll $0xd, %ecx
andl $0x1fff, %esi           # imm = 0x1FFF
orl %ecx, %esi
movl %esi, %eax
xorl %edx, %edx
idivl 0x20(%rdi)
addq (%r8), %rdx
jmp 0x6a24
leal -0x8(%rcx), %edx
cmpb $0x4, %dl
ja 0x6a26
addl $-0x8, %ecx
leaq (%rdi,%rcx), %rdx
addq $0x26, %rdx
jmp 0x6a24
// File: /workspace/github_cpp_makefile_star2_O1/nicoeps[P]NicoGB/src/mbc.cpp
// Function: MBC3::write(unsigned short, unsigned char)
void MBC3::write(uint16_t address, uint8_t n) {
    if (address <= 0x1FFF) {
        ramg = ((n & 0x0F) == 0x0A);
    } else if (address <= 0x3FFF) {
        n &= 0x7F;
        if (n == 0) {
            n = 0x1;
        }
        romBank = n;
    } else if (address <= 0x5FFF) {
        ramBank = n;
    } else if (address <= 0x7FFF) {
        ;
    } else if (address >= 0xA000 && address <= 0xBFFF) {
        if (ramg) {
            if (ramBank <= 0x3) {
                ram[((ramBank << 13) | (address & 0x1FFF)) % ramSize] = n;
            } else if (ramBank >= 0x08 && ramBank <= 0x0C) {
                RTC[ramBank - 0x08] = n;
            }
        }
    }
}

// Assembly:
movl %edx, %ecx
cmpl $0x1fff, %esi           # imm = 0x1FFF
ja 0x6a8d
andb $0xf, %cl
cmpb $0xa, %cl
sete 0x18(%rdi)
retq
movzwl %si, %eax
cmpl $0x3fff, %eax           # imm = 0x3FFF
ja 0x6aab
andb $0x7f, %cl
movzbl %cl, %eax
cmpb $0x2, %al
movl $0x1, %ecx
cmovael %eax, %ecx
movb %cl, 0x24(%rdi)
retq
cmpl $0x5fff, %eax           # imm = 0x5FFF
ja 0x6ab6
movb %cl, 0x25(%rdi)
retq
movl %esi, %eax
andl $0xe000, %eax           # imm = 0xE000
cmpl $0xa000, %eax           # imm = 0xA000
jne 0x6aff
cmpb $0x1, 0x18(%rdi)
jne 0x6aff
movzbl 0x25(%rdi), %eax
cmpl $0x3, %eax
ja 0x6af0
movq 0x10(%rdi), %r8
shll $0xd, %eax
andl $0x1fff, %esi           # imm = 0x1FFF
orl %eax, %esi
movl %esi, %eax
xorl %edx, %edx
idivl 0x20(%rdi)
movq (%r8), %rax
movb %cl, (%rax,%rdx)
retq
leal -0x8(%rax), %edx
cmpb $0x4, %dl
ja 0x6aff
addl $-0x8, %eax
movb %cl, 0x26(%rdi,%rax)
retq
// File: /workspace/github_cpp_makefile_star2_O1/nicoeps[P]NicoGB/src/mbc.cpp
// Function: MBC5::read(unsigned short)
uint8_t MBC5::read(uint16_t address) {
    if (address <= 0x3FFF) {
        return rom[address];
    } else if (address <= 0x7FFF) {
        romBank = ((bank2 << 8) | bank1);
        return rom[((romBank << 14) | (address & 0x3FFF)) % romSize];
    } else if (address >= 0xA000 && address <= 0xBFFF) {
        if (ramg) {
            return ram[((ramBank << 13) | (address & 0x1FFF)) % ramSize];
        } else {
            return 0xFF;
        }
    } else {
        return 0xFF;
    }
}

// Assembly:
cmpl $0x3fff, %esi           # imm = 0x3FFF
ja 0x6b11
addq $0x8, %rdi
movzwl %si, %edx
jmp 0x6b34
testw %si, %si
js 0x6b3e
movzwl 0x21(%rdi), %eax
movw %ax, 0x24(%rdi)
shll $0xe, %eax
andl $0x3fff, %esi           # imm = 0x3FFF
orl %eax, %esi
movl %esi, %eax
xorl %edx, %edx
idivl 0x18(%rdi)
addq $0x8, %rdi
movq (%rdi), %rax
movq (%rax), %rax
movb (%rax,%rdx), %al
retq
movl %esi, %ecx
andl $0xe000, %ecx           # imm = 0xE000
movb $-0x1, %al
cmpl $0xa000, %ecx           # imm = 0xA000
jne 0x6b3d
cmpb $0x1, 0x20(%rdi)
jne 0x6b3d
movzbl 0x26(%rdi), %eax
shll $0xd, %eax
andl $0x1fff, %esi           # imm = 0x1FFF
orl %eax, %esi
movl %esi, %eax
xorl %edx, %edx
idivl 0x1c(%rdi)
addq $0x10, %rdi
jmp 0x6b34
// File: /workspace/github_cpp_makefile_star2_O1/nicoeps[P]NicoGB/src/mbc.cpp
// Function: MBC5::write(unsigned short, unsigned char)
void MBC5::write(uint16_t address, uint8_t n) {
    if (address <= 0x1FFF) {
        ramg = (n == 0x0A);
    } else if (address <= 0x2FFF) {
        bank1 = n;
    } else if (address <= 0x3FFF) {
        bank2 = n & 0x1;
    } else if (address <= 0x5FFF) {
        ramBank = n & 0xF;
    } else if (address >= 0xA000 && address <= 0xBFFF) {
        if (ramg) {
            ram[((ramBank << 13) | (address & 0x1FFF)) % ramSize] = n;
        }
    }
}

// Assembly:
movl %edx, %ecx
cmpl $0x1fff, %esi           # imm = 0x1FFF
ja 0x6b84
cmpb $0xa, %cl
sete 0x20(%rdi)
retq
movzwl %si, %eax
cmpl $0x2fff, %eax           # imm = 0x2FFF
ja 0x6b92
movb %cl, 0x21(%rdi)
retq
cmpl $0x3fff, %eax           # imm = 0x3FFF
ja 0x6ba0
andb $0x1, %cl
movb %cl, 0x22(%rdi)
retq
cmpl $0x5fff, %eax           # imm = 0x5FFF
ja 0x6bae
andb $0xf, %cl
movb %cl, 0x26(%rdi)
retq
movl %esi, %eax
andl $0xe000, %eax           # imm = 0xE000
cmpl $0xa000, %eax           # imm = 0xA000
jne 0x6bad
cmpb $0x1, 0x20(%rdi)
jne 0x6bad
movq 0x10(%rdi), %r8
movzbl 0x26(%rdi), %eax
shll $0xd, %eax
andl $0x1fff, %esi           # imm = 0x1FFF
orl %eax, %esi
movl %esi, %eax
xorl %edx, %edx
idivl 0x1c(%rdi)
movq (%r8), %rax
movb %cl, (%rax,%rdx)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/nicoeps[P]NicoGB/src/memory.cpp
// Function: Memory::init()
void Memory::init() {
    bootEnabled = false;
    std::fill_n(vram.begin(), 0x2000, 0);
    std::fill_n(wram.begin(), 0x2000, 0);
    std::fill_n(oam.begin(), 0xA0, 0);
    std::fill_n(io.begin(), 0x100, 0xFF);
    std::fill_n(hram.begin(), 0x7F, 0);
    lcd.lcdc = 0;
    lcd.stat = 0;
    lcd.scy = 0;
    lcd.scx = 0;
    lcd.ly = 0;
    lcd.lyc = 0;
    lcd.bgp = 0xFC;
    lcd.obp0 = 0xFF;
    lcd.obp1 = 0xFF;
    lcd.wy = 0;
    lcd.wx = 0;
    dmaAddress = 0;
    dmaCycle = 0xFF;
    write(0xFF01, 0x00); // SB
    write(0xFF02, 0x7E); // SC
    write(0xFF0F, 0x00); // IF
    write(0xFFFF, 0x00); // IE
    bootEnabled = true;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %ebp, %ebp
movb %bpl, 0x23(%rdi)
movq 0x28(%rdi), %rdi
movl $0x2000, %edx           # imm = 0x2000
xorl %esi, %esi
callq 0x2120
movq 0x40(%rbx), %rdi
movl $0x2000, %edx           # imm = 0x2000
xorl %esi, %esi
callq 0x2120
movq 0x58(%rbx), %rdi
movl $0xa0, %edx
xorl %esi, %esi
callq 0x2120
movq 0x70(%rbx), %rdi
movl $0x100, %edx            # imm = 0x100
movl $0xff, %esi
callq 0x2120
movq 0x88(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x50(%rax)
movups %xmm0, 0x60(%rax)
movups %xmm0, 0x6f(%rax)
movw %bp, 0x1c(%rbx)
movl $0x0, 0x18(%rbx)
movl $0xfffffc, 0x1e(%rbx)   # imm = 0xFFFFFC
movb %bpl, 0x22(%rbx)
movw %bp, 0x24(%rbx)
movb $-0x1, 0x26(%rbx)
movq 0x70(%rbx), %rax
movb %bpl, 0x1(%rax)
movq 0x70(%rbx), %rax
movb $0x7e, 0x2(%rax)
movq 0x70(%rbx), %rax
movb $-0x20, 0xf(%rax)
movq 0x70(%rbx), %rax
movb %bpl, 0xff(%rax)
movb $0x1, 0x23(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq