LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: 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>>>::rotate_right(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 rotate_right(node *n)
    {
	node *p = n->parent; // p is above [D]
	node *l = n->left;   // l is [B]

	n->left = l->right;  // [D] now points left to [C]
	if (n->left)
	    n->left->parent = n;

	l->right = n;        // [B] now points right to [D]
	n->parent = l;

	l->parent = p;       // Make [B] the root of the subtree
	fix_downptr(p, n, l);
    }

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x40(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq 0x38(%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x10(%rsp), %rax
cmpq $0x0, 0x30(%rax)
je 0x4293
movq 0x10(%rsp), %rcx
movq 0x10(%rsp), %rax
movq 0x30(%rax), %rax
movq %rcx, 0x40(%rax)
movq 0x10(%rsp), %rcx
movq (%rsp), %rax
movq %rcx, 0x38(%rax)
movq (%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x40(%rax)
movq 0x8(%rsp), %rcx
movq (%rsp), %rax
movq %rcx, 0x40(%rax)
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq (%rsp), %rdx
callq 0x43a0
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
je 0x4724
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq (%rsp), %rdx
callq 0x3c30
testb $0x1, %al
jne 0x46e0
jmp 0x46ee
movq (%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, (%rsp)
jmp 0x4722
movq 0x18(%rsp), %rdi
movq (%rsp), %rsi
movq 0x10(%rsp), %rdx
callq 0x3c30
testb $0x1, %al
jne 0x4707
jmp 0x4715
movq (%rsp), %rax
movq 0x38(%rax), %rax
movq %rax, (%rsp)
jmp 0x4720
movq (%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x472e
jmp 0x4722
jmp 0x46c0
movq 0x8(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rsi, 0x20(%rsp)
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
callq 0x47a0
movq 0x8(%rsp), %rdi
addq $0x2, %rdi
movq 0x10(%rsp), %rsi
callq 0x3630
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x50(%rax)
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
nop
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpq $0x0, 0x30(%rax)
je 0x47cb
movq 0x10(%rsp), %rax
cmpq $0x0, 0x38(%rax)
je 0x47cb
movq 0x10(%rsp), %rdi
callq 0x4870
movq 0x10(%rsp), %rdi
callq 0x49f0
movq 0x10(%rsp), %rax
cmpq $0x0, 0x30(%rax)
je 0x47f0
movq 0x10(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, (%rsp)
jmp 0x47fd
movq 0x10(%rsp), %rax
movq 0x38(%rax), %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq 0x40(%rax), %rdi
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
callq 0x43a0
cmpq $0x0, 0x8(%rsp)
je 0x4844
movq 0x10(%rsp), %rax
movq 0x40(%rax), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x40(%rax)
movq 0x8(%rsp), %rdi
callq 0x4130
jmp 0x4864
movq 0x10(%rsp), %rdi
callq 0x4a40
testb $0x1, %al
jne 0x4854
jmp 0x4856
jmp 0x4864
movq 0x10(%rsp), %rax
movq 0x40(%rax), %rdi
callq 0x4a70
addq $0x18, %rsp
retq
nopl (%rax)
// File: 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>>>::leftmost_child(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 *leftmost_child(node *n)
    {
	if (!n)
	    return n;

	while (n->left)
	    n = n->left;

	return n;
    }

// Assembly:
movq %rdi, -0x10(%rsp)
cmpq $0x0, -0x10(%rsp)
jne 0x4d49
movq -0x10(%rsp), %rax
movq %rax, -0x8(%rsp)
jmp 0x4d71
jmp 0x4d4b
movq -0x10(%rsp), %rax
cmpq $0x0, 0x30(%rax)
je 0x4d67
movq -0x10(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x10(%rsp)
jmp 0x4d4b
movq -0x10(%rsp), %rax
movq %rax, -0x8(%rsp)
movq -0x8(%rsp), %rax
retq
nopw (%rax,%rax)
// File: 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>>>::next_in_order(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 *next_in_order(node *n)
    {
	// If we have a right subtree, return the first item in it
	if (n->right)
	    return leftmost_child(n->right);

	// Otherwise, return the first ancestor from which we descended
	// left, or return the header as an end-of-sequence marker.
	while (!is_root(n) && is_right_child(n))
	    n = n->parent;

	// This will return the header if we ascended to the root in the
	// previous step.
	return n->parent;
    }

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rsp), %rax
cmpq $0x0, 0x38(%rax)
je 0x67ca
movq 0x8(%rsp), %rax
movq 0x38(%rax), %rdi
callq 0x4d30
movq %rax, 0x10(%rsp)
jmp 0x6819
jmp 0x67cc
movq 0x8(%rsp), %rdi
callq 0x4110
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0x7(%rsp)
jne 0x67f1
movq 0x8(%rsp), %rdi
callq 0x4220
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0x67fb
jmp 0x680b
movq 0x8(%rsp), %rax
movq 0x40(%rax), %rax
movq %rax, 0x8(%rsp)
jmp 0x67cc
movq 0x8(%rsp), %rax
movq 0x40(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: 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:
subq $0x328, %rsp            # imm = 0x328
movq %rdi, 0x320(%rsp)
movq %rsi, 0x318(%rsp)
movl %edx, 0x314(%rsp)
movq 0x320(%rsp), %rsi
leaq 0x108(%rsp), %rdi
movl $0x8, %edx
callq 0x2260
movq 0x108(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x108(%rsp,%rax), %rdi
callq 0x2270
movb %al, 0x1f(%rsp)
jmp 0x7947
movb 0x1f(%rsp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x7956
jmp 0x7aad
cmpl $0x0, 0x314(%rsp)
jl 0x7996
movl 0x314(%rsp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, 0x314(%rsp)
cmpl $0x0, %eax
jne 0x7996
jmp 0x7aad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x100(%rsp)
movl %eax, 0xfc(%rsp)
jmp 0x7ac2
movq 0x108(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x108(%rsp,%rax), %rdi
callq 0x2220
movb %al, 0x1e(%rsp)
jmp 0x79b5
movb 0x1e(%rsp), %al
testb $0x1, %al
jne 0x79bf
jmp 0x79c1
jmp 0x79e0
leaq 0x170b(%rip), %rdi      # 0x90d3
leaq 0x170e(%rip), %rsi      # 0x90dd
movl $0x2b, %edx
leaq 0x1710(%rip), %rcx      # 0x90eb
callq 0x2100
leaq 0x108(%rsp), %rdi
leaq 0x70(%rsp), %rsi
movl $0x80, %edx
callq 0x2080
jmp 0x79f9
movq 0x318(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x7ae0
movl %eax, 0x18(%rsp)
jmp 0x7a16
movl 0x18(%rsp), %eax
movl %eax, 0x34(%rsp)
leaq 0x70(%rsp), %rdi
leaq 0x34(%rsp), %rsi
callq 0x7c10
movl %edx, 0x4(%rsp)
movq %rax, 0x8(%rsp)
jmp 0x7a38
movl 0x4(%rsp), %eax
movq 0x8(%rsp), %rcx
movq %rcx, 0x20(%rsp)
movl %eax, 0x28(%rsp)
movl 0x28(%rsp), %eax
movl %eax, 0x40(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0x48(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x7c50
jmp 0x7a6d
movq 0x10(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x7be0
jmp 0x7a7e
leaq 0x48(%rsp), %rdi
callq 0x33d0
jmp 0x7928
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x100(%rsp)
movl %eax, 0xfc(%rsp)
leaq 0x48(%rsp), %rdi
callq 0x33d0
jmp 0x7ac2
leaq 0x108(%rsp), %rdi
callq 0x2060
addq $0x328, %rsp            # imm = 0x328
retq
leaq 0x108(%rsp), %rdi
callq 0x2060
movq 0x100(%rsp), %rdi
callq 0x2240
nopl (%rax)
// File: dlbeer[P]summary_map/test_util.cpp
// Function: x33a(char const*)
static int x33a(const char *word)
{
    int sum = 0;

    while (*word)
	sum = sum * 33 + *(word++);

    return sum;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movl $0x0, -0xc(%rsp)
movq -0x8(%rsp), %rax
cmpb $0x0, (%rax)
je 0x7b18
imull $0x21, -0xc(%rsp), %eax
movq -0x8(%rsp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x8(%rsp)
movsbl (%rcx), %ecx
addl %ecx, %eax
movl %eax, -0xc(%rsp)
jmp 0x7aed
movl -0xc(%rsp), %eax
retq
nopl (%rax)
// File: 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:
subq $0x13b8, %rsp           # imm = 0x13B8
movq %rdi, 0x13b0(%rsp)
movl %esi, 0x13ac(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x7ce0
movslq 0x13ac(%rsp), %rsi
leaq 0x20(%rsp), %rdi
callq 0x7d00
movq 0x13b0(%rsp), %rdi
callq 0x2d70
subq $0x1, %rax
movl %eax, 0x1c(%rsp)
cmpl $0x0, 0x1c(%rsp)
jle 0x7bcd
movq 0x13b0(%rsp), %rdi
movslq 0x1c(%rsp), %rsi
callq 0x3820
movq %rax, 0x10(%rsp)
movq 0x13b0(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x7dd0
movq 0x8(%rsp), %rdi
movslq 0x1c(%rsp), %rcx
xorl %edx, %edx
divq %rcx
movq %rdx, %rsi
callq 0x3820
movq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x6080
movl 0x1c(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x7b67
addq $0x13b8, %rsp           # imm = 0x13B8
retq
nopw %cs:(%rax,%rax)
nop
// File: 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:
subq $0xa8, %rsp
movq %rdi, 0xa0(%rsp)
movq 0xa0(%rsp), %rdi
movq %rdi, 0x48(%rsp)
movq %rdi, %rax
movq %rax, (%rsp)
callq 0x3330
movq 0x48(%rsp), %rdi
addq $0x28, %rdi
movq %rdi, 0x8(%rsp)
callq 0x3ed0
movq 0x48(%rsp), %rdi
addq $0x30, %rdi
movq %rdi, 0x10(%rsp)
callq 0x3f00
movq 0x48(%rsp), %rdi
addq $0x48, %rdi
movq %rdi, 0x38(%rsp)
callq 0x3f00
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x80(%rsp)
movq $0x0, 0x90(%rsp)
leaq 0x80(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x3f00
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x3f10
movq 0x18(%rsp), %rdi
callq 0x3f50
movaps 0x20(%rsp), %xmm0
movaps %xmm0, 0x60(%rsp)
movq $0x0, 0x70(%rsp)
leaq 0x60(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x3f00
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x3f10
movq 0x40(%rsp), %rdi
callq 0x3f50
movq 0x48(%rsp), %rdi
leaq 0x132e5(%rip), %rsi     # 0x16934
callq 0x3320
jmp 0x3656
movq (%rsp), %rax
movb $0x0, 0x20(%rax)
movb $0x0, 0x60(%rax)
movq $0x0, 0x68(%rax)
movl $0x0, 0x70(%rax)
addq $0xa8, %rsp
retq
movq 0x38(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
callq 0x3f50
movq 0x10(%rsp), %rdi
callq 0x3f50
movq 0x8(%rsp), %rdi
callq 0x3fb0
movq 0x48(%rsp), %rdi
callq 0x31a0
movq 0x58(%rsp), %rdi
callq 0x33d0
nopl (%rax)
// File: 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 %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movq 0x28(%rax), %rcx
movw $0x0, (%rcx)
movq 0x40(%rax), %rcx
movw $0x0, (%rcx)
movq 0x58(%rax), %rcx
movw $0x0, (%rcx)
movq 0x70(%rax), %rcx
movw $0x0, (%rcx)
movw $0x0, 0x88(%rax)
movw $0x0, 0x8a(%rax)
movb $0x0, 0x8c(%rax)
movq $0x0, 0x10(%rax)
movb $0x0, 0x8d(%rax)
movb $0x0, 0x8e(%rax)
movb $0x0, 0x8f(%rax)
movb $0x0, 0x90(%rax)
movb $0x1, 0x18(%rax)
retq
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
movq (%rax), %rcx
movq 0x10(%rcx), %rcx
movzwl (%rcx), %edx
addl $0x4, %edx
movw %dx, (%rcx)
movq 0x10(%rax), %rcx
addq $0x4, %rcx
movq %rcx, 0x10(%rax)
movq (%rax), %rax
movq 0x10(%rax), %rax
movzbl 0x5(%rax), %eax
cmpl $0x0, %eax
jle 0x5fa2
movq 0x8(%rsp), %rax
movq (%rax), %rcx
movq 0x10(%rcx), %rcx
movzbl 0x5(%rcx), %edx
subl $0x4, %edx
movb %dl, 0x5(%rcx)
movq (%rax), %rax
movq 0x10(%rax), %rax
movzbl 0x5(%rax), %eax
cmpl $0x0, %eax
jne 0x5fa0
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movl $0x4, %esi
callq 0xef30
movq 0x8(%rsp), %rax
movq (%rax), %rcx
movq 0x10(%rcx), %rcx
movb 0x3(%rcx), %cl
movq (%rax), %rax
movq 0x10(%rax), %rax
movb %cl, 0x2(%rax)
jmp 0x5fa2
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rdi
callq 0x15ea0
testb $0x1, %al
jne 0x5fb9
jmp 0x5ff0
movq 0x8(%rsp), %rax
movq (%rax), %rcx
movq 0x10(%rcx), %rcx
movb 0x2(%rcx), %dl
addb $0x1, %dl
movb %dl, 0x2(%rcx)
movq (%rax), %rax
movq 0x10(%rax), %rax
movzbl 0x2(%rax), %eax
cmpl $0x0, %eax
jne 0x5fee
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movb $0x4, 0x5(%rax)
jmp 0x5ff0
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rdi
callq 0x15e30
movb %al, %dl
movq 0x8(%rsp), %rax
movq (%rax), %rcx
movq 0x10(%rcx), %rcx
andb $0x1, %dl
movb %dl, 0x6(%rcx)
testb $0x1, 0x8d(%rax)
jne 0x602b
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0xf4a0
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x10910
addq $0x18, %rsp
retq
nop
// File: 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:
subq $0x28, %rsp
movb %sil, %al
movq %rdi, 0x20(%rsp)
movb %al, 0x1f(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, 0x10(%rsp)
movzbl 0x1f(%rsp), %eax
sarl $0x7, %eax
shll $0x4, %eax
movb %al, 0x1e(%rsp)
movzbl 0x1f(%rsp), %eax
shll %eax
movl %eax, 0xc(%rsp)
callq 0x60a0
movq 0x10(%rsp), %rdi
movb %al, %cl
movl 0xc(%rsp), %eax
movzbl %cl, %ecx
sarl $0x4, %ecx
orl %ecx, %eax
movb %al, 0x1f(%rsp)
movzbl 0x1f(%rsp), %eax
movzwl %ax, %esi
callq 0x60c0
movb %al, %cl
movq 0x10(%rsp), %rax
movzbl %cl, %ecx
movzbl 0x1e(%rsp), %edx
orl %edx, %ecx
movq 0x38(%rax), %rax
movb %cl, (%rax)
movb 0x1f(%rsp), %al
addq $0x28, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x28, %rsp
movb %sil, %al
movq %rdi, 0x20(%rsp)
movb %al, 0x1f(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, 0x10(%rsp)
movzbl 0x1f(%rsp), %eax
andl $0x1, %eax
shll $0x4, %eax
movb %al, 0x1e(%rsp)
movzbl 0x1f(%rsp), %eax
sarl %eax
movl %eax, 0xc(%rsp)
callq 0x60a0
movq 0x10(%rsp), %rdi
movb %al, %cl
movl 0xc(%rsp), %eax
movzbl %cl, %ecx
shll $0x3, %ecx
orl %ecx, %eax
movb %al, 0x1f(%rsp)
movzbl 0x1f(%rsp), %eax
movzwl %ax, %esi
callq 0x60c0
movb %al, %cl
movq 0x10(%rsp), %rax
movzbl %cl, %ecx
movzbl 0x1e(%rsp), %edx
orl %edx, %ecx
movq 0x38(%rax), %rax
movb %cl, (%rax)
movb 0x1f(%rsp), %al
addq $0x28, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x18, %rsp
movb %sil, %al
movq %rdi, 0x10(%rsp)
movb %al, 0xf(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, (%rsp)
movzbl 0xf(%rsp), %eax
sarl $0x7, %eax
shll $0x4, %eax
movb %al, 0xe(%rsp)
movzbl 0xf(%rsp), %eax
shll %eax
movb %al, 0xf(%rsp)
movzbl 0xf(%rsp), %eax
movzwl %ax, %esi
callq 0x60c0
movb %al, %cl
movq (%rsp), %rax
movzbl %cl, %ecx
movzbl 0xe(%rsp), %edx
orl %edx, %ecx
movq 0x38(%rax), %rax
movb %cl, (%rax)
movb 0xf(%rsp), %al
addq $0x18, %rsp
retq
nop
// File: 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:
subq $0x18, %rsp
movb %sil, %al
movq %rdi, 0x10(%rsp)
movb %al, 0xf(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, (%rsp)
movzbl 0xf(%rsp), %eax
andl $0x1, %eax
shll $0x4, %eax
movb %al, 0xe(%rsp)
movzbl 0xf(%rsp), %eax
sarl %eax
movzbl 0xf(%rsp), %ecx
andl $0x80, %ecx
orl %ecx, %eax
movb %al, 0xf(%rsp)
movzbl 0xf(%rsp), %eax
movzwl %ax, %esi
callq 0x60c0
movb %al, %cl
movq (%rsp), %rax
movzbl %cl, %ecx
movzbl 0xe(%rsp), %edx
orl %edx, %ecx
movq 0x38(%rax), %rax
movb %cl, (%rax)
movb 0xf(%rsp), %al
addq $0x18, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x18, %rsp
movb %sil, %al
movq %rdi, 0x10(%rsp)
andb $0x1, %al
movb %al, 0xf(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x6470
movw %ax, 0xc(%rsp)
testb $0x1, 0xf(%rsp)
je 0x7141
movq (%rsp), %rdi
movw 0xc(%rsp), %ax
movw %ax, 0x8a(%rdi)
callq 0x5f10
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x18, %rsp
movb %sil, %al
movq %rdi, 0x10(%rsp)
andb $0x1, %al
movb %al, 0xf(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x6440
movb %al, 0xe(%rsp)
testb $0x1, 0xf(%rsp)
je 0x7199
movq (%rsp), %rdi
movsbl 0xe(%rsp), %ecx
movzwl 0x8a(%rdi), %eax
addl %ecx, %eax
movw %ax, 0x8a(%rdi)
callq 0x5f10
addq $0x18, %rsp
retq
nop
// File: 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:
subq $0x18, %rsp
movb %sil, %al
movq %rdi, 0x10(%rsp)
andb $0x1, %al
movb %al, 0xf(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x6470
movw %ax, 0xc(%rsp)
testb $0x1, 0xf(%rsp)
je 0x71ef
movq (%rsp), %rax
movq %rax, %rdi
movzwl 0x8a(%rax), %esi
callq 0x64b0
movq (%rsp), %rax
movw 0xc(%rsp), %cx
movw %cx, 0x8a(%rax)
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: nicoeps[P]NicoGB/src/cpu.cpp
// Function: CPU::RET(bool)
void CPU::RET(bool flag) {
    tick();
    if (flag) {
        PC = pop();
        tick();
    }
}

// Assembly:
subq $0x18, %rsp
movb %sil, %al
movq %rdi, 0x10(%rsp)
andb $0x1, %al
movb %al, 0xf(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x5f10
testb $0x1, 0xf(%rsp)
je 0x7240
movq (%rsp), %rdi
callq 0x6530
movq (%rsp), %rdi
movw %ax, 0x8a(%rdi)
callq 0x5f10
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: nicoeps[P]NicoGB/src/joypad.cpp
// Function: Joypad::reset()
void Joypad::reset() {
    interrupt = false;
    keys[0] = 0x0F;
    keys[1] = 0x0F;
    mode = 0;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movb $0x0, 0x3(%rax)
movb $0xf, (%rax)
movb $0xf, 0x1(%rax)
movb $0x0, 0x2(%rax)
retq
nopw (%rax,%rax)
// File: 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:
movq %rdi, -0x10(%rsp)
movq -0x10(%rsp), %rax
movq %rax, -0x20(%rsp)
movzbl 0x2(%rax), %eax
movl %eax, -0x14(%rsp)
testl %eax, %eax
je 0xc533
jmp 0xc51d
movl -0x14(%rsp), %eax
subl $0x10, %eax
je 0xc552
jmp 0xc528
movl -0x14(%rsp), %eax
subl $0x20, %eax
je 0xc56b
jmp 0xc585
movq -0x20(%rsp), %rdx
movzbl 0x2(%rdx), %eax
orl $0xc0, %eax
movzbl (%rdx), %ecx
movzbl 0x1(%rdx), %edx
andl %edx, %ecx
orl %ecx, %eax
movb %al, -0x1(%rsp)
jmp 0xc58a
movq -0x20(%rsp), %rcx
movzbl 0x2(%rcx), %eax
orl $0xc0, %eax
movzbl (%rcx), %ecx
orl %ecx, %eax
movb %al, -0x1(%rsp)
jmp 0xc58a
movq -0x20(%rsp), %rcx
movzbl 0x2(%rcx), %eax
orl $0xc0, %eax
movzbl 0x1(%rcx), %ecx
orl %ecx, %eax
movb %al, -0x1(%rsp)
jmp 0xc58a
movb $-0x31, -0x1(%rsp)
movb -0x1(%rsp), %al
retq
nop
// File: 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:
movq %rdi, -0x8(%rsp)
movl %esi, -0xc(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x20(%rsp)
movl -0xc(%rsp), %eax
movq %rax, -0x18(%rsp)
subq $0x7, %rax
ja 0xc6b9
movq -0x18(%rsp), %rax
leaq 0xa302(%rip), %rcx      # 0x168e4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x20(%rsp), %rax
movzbl 0x1(%rax), %ecx
orl $0x2, %ecx
movb %cl, 0x1(%rax)
movzbl 0x1(%rax), %ecx
andl $0xe, %ecx
movb %cl, 0x1(%rax)
movb $0x1, 0x3(%rax)
jmp 0xc6bb
movq -0x20(%rsp), %rax
movzbl 0x1(%rax), %ecx
orl $0x1, %ecx
movb %cl, 0x1(%rax)
movzbl 0x1(%rax), %ecx
andl $0xd, %ecx
movb %cl, 0x1(%rax)
movb $0x1, 0x3(%rax)
jmp 0xc6bb
movq -0x20(%rsp), %rax
movzbl 0x1(%rax), %ecx
orl $0x8, %ecx
movb %cl, 0x1(%rax)
movzbl 0x1(%rax), %ecx
andl $0xb, %ecx
movb %cl, 0x1(%rax)
movb $0x1, 0x3(%rax)
jmp 0xc6bb
movq -0x20(%rsp), %rax
movzbl 0x1(%rax), %ecx
orl $0x4, %ecx
movb %cl, 0x1(%rax)
movzbl 0x1(%rax), %ecx
andl $0x7, %ecx
movb %cl, 0x1(%rax)
movb $0x1, 0x3(%rax)
jmp 0xc6bb
movq -0x20(%rsp), %rax
movzbl (%rax), %ecx
andl $0xe, %ecx
movb %cl, (%rax)
movb $0x1, 0x3(%rax)
jmp 0xc6bb
movq -0x20(%rsp), %rax
movzbl (%rax), %ecx
andl $0xd, %ecx
movb %cl, (%rax)
movb $0x1, 0x3(%rax)
jmp 0xc6bb
movq -0x20(%rsp), %rax
movzbl (%rax), %ecx
andl $0xb, %ecx
movb %cl, (%rax)
movb $0x1, 0x3(%rax)
jmp 0xc6bb
movq -0x20(%rsp), %rax
movzbl (%rax), %ecx
andl $0x7, %ecx
movb %cl, (%rax)
movb $0x1, 0x3(%rax)
jmp 0xc6bb
jmp 0xc6bb
retq
nopl (%rax)
// File: 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:
movq %rdi, -0x8(%rsp)
movl %esi, -0xc(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x20(%rsp)
movl -0xc(%rsp), %eax
movq %rax, -0x18(%rsp)
subq $0x7, %rax
ja 0xc77b
movq -0x18(%rsp), %rax
leaq 0xa212(%rip), %rcx      # 0x16904
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x20(%rsp), %rax
movzbl 0x1(%rax), %ecx
orl $0x1, %ecx
movb %cl, 0x1(%rax)
jmp 0xc77d
movq -0x20(%rsp), %rax
movzbl 0x1(%rax), %ecx
orl $0x2, %ecx
movb %cl, 0x1(%rax)
jmp 0xc77d
movq -0x20(%rsp), %rax
movzbl 0x1(%rax), %ecx
orl $0x4, %ecx
movb %cl, 0x1(%rax)
jmp 0xc77d
movq -0x20(%rsp), %rax
movzbl 0x1(%rax), %ecx
orl $0x8, %ecx
movb %cl, 0x1(%rax)
jmp 0xc77d
movq -0x20(%rsp), %rax
movzbl (%rax), %ecx
orl $0x1, %ecx
movb %cl, (%rax)
jmp 0xc77d
movq -0x20(%rsp), %rax
movzbl (%rax), %ecx
orl $0x2, %ecx
movb %cl, (%rax)
jmp 0xc77d
movq -0x20(%rsp), %rax
movzbl (%rax), %ecx
orl $0x4, %ecx
movb %cl, (%rax)
jmp 0xc77d
movq -0x20(%rsp), %rax
movzbl (%rax), %ecx
orl $0x8, %ecx
movb %cl, (%rax)
jmp 0xc77d
jmp 0xc77d
retq
nop
// File: 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:
movl %edi, -0x8(%rsp)
movl -0x8(%rsp), %eax
movl %eax, -0xc(%rsp)
subl $0xd, %eax
je 0xc895
jmp 0xc7e7
movl -0xc(%rsp), %eax
subl $0x78, %eax
je 0xc881
jmp 0xc7f6
movl -0xc(%rsp), %eax
subl $0x7a, %eax
je 0xc877
jmp 0xc801
movl -0xc(%rsp), %eax
subl $0x4000004f, %eax       # imm = 0x4000004F
je 0xc84f
jmp 0xc80e
movl -0xc(%rsp), %eax
subl $0x40000050, %eax       # imm = 0x40000050
je 0xc859
jmp 0xc81b
movl -0xc(%rsp), %eax
subl $0x40000051, %eax       # imm = 0x40000051
je 0xc86d
jmp 0xc828
movl -0xc(%rsp), %eax
subl $0x40000052, %eax       # imm = 0x40000052
je 0xc863
jmp 0xc835
movl -0xc(%rsp), %eax
subl $0x400000e1, %eax       # imm = 0x400000E1
je 0xc88b
jmp 0xc842
movl -0xc(%rsp), %eax
subl $0x400000e5, %eax       # imm = 0x400000E5
je 0xc88b
jmp 0xc89f
movl $0x0, -0x4(%rsp)
jmp 0xc8a7
movl $0x1, -0x4(%rsp)
jmp 0xc8a7
movl $0x2, -0x4(%rsp)
jmp 0xc8a7
movl $0x3, -0x4(%rsp)
jmp 0xc8a7
movl $0x4, -0x4(%rsp)
jmp 0xc8a7
movl $0x5, -0x4(%rsp)
jmp 0xc8a7
movl $0x6, -0x4(%rsp)
jmp 0xc8a7
movl $0x7, -0x4(%rsp)
jmp 0xc8a7
movl $0x8, -0x4(%rsp)
movl -0x4(%rsp), %eax
retq
nopl (%rax)
// File: 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:
subq $0x28, %rsp
movw %si, %ax
movq %rdi, 0x18(%rsp)
movw %ax, 0x16(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movzwl 0x16(%rsp), %eax
cmpl $0x7fff, %eax           # imm = 0x7FFF
jg 0xd914
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
movzwl 0x16(%rsp), %eax
movl %eax, %esi
callq 0x40f0
movb (%rax), %al
movb %al, 0x27(%rsp)
jmp 0xd958
movzwl 0x16(%rsp), %eax
cmpl $0xa000, %eax           # imm = 0xA000
jl 0xd953
movzwl 0x16(%rsp), %eax
cmpl $0xbfff, %eax           # imm = 0xBFFF
jg 0xd953
movq 0x8(%rsp), %rcx
movq 0x10(%rcx), %rdi
movzwl 0x16(%rsp), %eax
subl $0xa000, %eax           # imm = 0xA000
cltd
idivl 0x18(%rcx)
movslq %edx, %rsi
callq 0x40f0
movb (%rax), %al
movb %al, 0x27(%rsp)
jmp 0xd958
movb $-0x1, 0x27(%rsp)
movb 0x27(%rsp), %al
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x28, %rsp
movw %si, %ax
movq %rdi, 0x18(%rsp)
movw %ax, 0x16(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movzwl 0x16(%rsp), %eax
cmpl $0x3fff, %eax           # imm = 0x3FFF
jg 0xda67
movq 0x8(%rsp), %rax
testb $0x1, 0x28(%rax)
je 0xda24
movq 0x8(%rsp), %rax
movzbl 0x25(%rax), %eax
shll $0x5, %eax
movl %eax, 0x4(%rsp)
jmp 0xda2c
xorl %eax, %eax
movl %eax, 0x4(%rsp)
jmp 0xda2c
movq 0x8(%rsp), %rcx
movl 0x4(%rsp), %eax
movb %al, 0x26(%rcx)
movq 0x8(%rcx), %rdi
movzbl 0x26(%rcx), %eax
shll $0xe, %eax
movzwl 0x16(%rsp), %edx
andl $0x3fff, %edx           # imm = 0x3FFF
orl %edx, %eax
cltd
idivl 0x1c(%rcx)
movslq %edx, %rsi
callq 0x40f0
movb (%rax), %al
movb %al, 0x27(%rsp)
jmp 0xdb3d
movzwl 0x16(%rsp), %eax
cmpl $0x7fff, %eax           # imm = 0x7FFF
jg 0xdab7
movq 0x8(%rsp), %rcx
movzbl 0x25(%rcx), %eax
shll $0x5, %eax
movzbl 0x24(%rcx), %edx
orl %edx, %eax
movb %al, 0x26(%rcx)
movq 0x8(%rcx), %rdi
movzbl 0x26(%rcx), %eax
shll $0xe, %eax
movzwl 0x16(%rsp), %edx
andl $0x3fff, %edx           # imm = 0x3FFF
orl %edx, %eax
cltd
idivl 0x1c(%rcx)
movslq %edx, %rsi
callq 0x40f0
movb (%rax), %al
movb %al, 0x27(%rsp)
jmp 0xdb3d
movzwl 0x16(%rsp), %eax
cmpl $0xa000, %eax           # imm = 0xA000
jl 0xdb38
movzwl 0x16(%rsp), %eax
cmpl $0xbfff, %eax           # imm = 0xBFFF
jg 0xdb38
movq 0x8(%rsp), %rax
testb $0x1, 0x18(%rax)
je 0xdb31
movq 0x8(%rsp), %rax
testb $0x1, 0x28(%rax)
je 0xdaf3
movq 0x8(%rsp), %rax
movzbl 0x25(%rax), %eax
movl %eax, (%rsp)
jmp 0xdafa
xorl %eax, %eax
movl %eax, (%rsp)
jmp 0xdafa
movq 0x8(%rsp), %rcx
movl (%rsp), %eax
movb %al, 0x27(%rcx)
movq 0x10(%rcx), %rdi
movzbl 0x27(%rcx), %eax
shll $0xd, %eax
movzwl 0x16(%rsp), %edx
andl $0x1fff, %edx           # imm = 0x1FFF
orl %edx, %eax
cltd
idivl 0x20(%rcx)
movslq %edx, %rsi
callq 0x40f0
movb (%rax), %al
movb %al, 0x27(%rsp)
jmp 0xdb3d
movb $-0x1, 0x27(%rsp)
jmp 0xdb3d
movb $-0x1, 0x27(%rsp)
movb 0x27(%rsp), %al
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x28, %rsp
movb %dl, %al
movw %si, %cx
movq %rdi, 0x20(%rsp)
movw %cx, 0x1e(%rsp)
movb %al, 0x1d(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movzwl 0x1e(%rsp), %eax
cmpl $0x1fff, %eax           # imm = 0x1FFF
jg 0xdb9b
movq 0x10(%rsp), %rax
movzbl 0x1d(%rsp), %ecx
andl $0xf, %ecx
cmpl $0xa, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x18(%rax)
jmp 0xdcab
movzwl 0x1e(%rsp), %eax
cmpl $0x3fff, %eax           # imm = 0x3FFF
jg 0xdbd3
movzbl 0x1d(%rsp), %eax
andl $0x1f, %eax
movb %al, 0x1d(%rsp)
movzbl 0x1d(%rsp), %eax
cmpl $0x0, %eax
jne 0xdbc2
movb $0x1, 0x1d(%rsp)
movq 0x10(%rsp), %rax
movb 0x1d(%rsp), %cl
movb %cl, 0x24(%rax)
jmp 0xdca9
movzwl 0x1e(%rsp), %eax
cmpl $0x5fff, %eax           # imm = 0x5FFF
jg 0xdbf4
movq 0x10(%rsp), %rax
movzbl 0x1d(%rsp), %ecx
andl $0x3, %ecx
movb %cl, 0x25(%rax)
jmp 0xdca7
movzwl 0x1e(%rsp), %eax
cmpl $0x7fff, %eax           # imm = 0x7FFF
jg 0xdc1e
movq 0x10(%rsp), %rax
movzbl 0x1d(%rsp), %ecx
andl $0x1, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, 0x28(%rax)
jmp 0xdca5
movzwl 0x1e(%rsp), %eax
cmpl $0xa000, %eax           # imm = 0xA000
jl 0xdca3
movzwl 0x1e(%rsp), %eax
cmpl $0xbfff, %eax           # imm = 0xBFFF
jg 0xdca3
movq 0x10(%rsp), %rax
testb $0x1, 0x18(%rax)
je 0xdca1
movq 0x10(%rsp), %rax
testb $0x1, 0x28(%rax)
je 0xdc5b
movq 0x10(%rsp), %rax
movzbl 0x25(%rax), %eax
movl %eax, 0xc(%rsp)
jmp 0xdc63
xorl %eax, %eax
movl %eax, 0xc(%rsp)
jmp 0xdc63
movq 0x10(%rsp), %rcx
movl 0xc(%rsp), %eax
movb %al, 0x27(%rcx)
movb 0x1d(%rsp), %al
movb %al, 0xb(%rsp)
movq 0x10(%rcx), %rdi
movzbl 0x27(%rcx), %eax
shll $0xd, %eax
movzwl 0x1e(%rsp), %edx
andl $0x1fff, %edx           # imm = 0x1FFF
orl %edx, %eax
cltd
idivl 0x20(%rcx)
movslq %edx, %rsi
callq 0x40f0
movb 0xb(%rsp), %cl
movb %cl, (%rax)
jmp 0xdca3
jmp 0xdca5
jmp 0xdca7
jmp 0xdca9
jmp 0xdcab
addq $0x28, %rsp
retq
// File: 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:
subq $0x28, %rsp
movw %si, %ax
movq %rdi, 0x18(%rsp)
movw %ax, 0x16(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movzwl 0x16(%rsp), %eax
cmpl $0x3fff, %eax           # imm = 0x3FFF
jg 0xdcf7
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
movzwl 0x16(%rsp), %eax
movl %eax, %esi
callq 0x40f0
movb (%rax), %al
movb %al, 0x27(%rsp)
jmp 0xdd85
movzwl 0x16(%rsp), %eax
cmpl $0x7fff, %eax           # imm = 0x7FFF
jg 0xdd34
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rdi
movzbl 0x24(%rcx), %eax
shll $0xe, %eax
movzwl 0x16(%rsp), %edx
andl $0x3fff, %edx           # imm = 0x3FFF
orl %edx, %eax
cltd
idivl 0x1c(%rcx)
movslq %edx, %rsi
callq 0x40f0
movb (%rax), %al
movb %al, 0x27(%rsp)
jmp 0xdd85
movzwl 0x16(%rsp), %eax
cmpl $0xa000, %eax           # imm = 0xA000
jl 0xdd80
movzwl 0x16(%rsp), %eax
cmpl $0xbfff, %eax           # imm = 0xBFFF
jg 0xdd80
movq 0x8(%rsp), %rax
testb $0x1, 0x18(%rax)
je 0xdd79
movq 0x8(%rsp), %rcx
movq 0x10(%rcx), %rdi
movzwl 0x16(%rsp), %eax
cltd
idivl 0x20(%rcx)
movslq %edx, %rsi
callq 0x40f0
movb (%rax), %al
movb %al, 0x27(%rsp)
jmp 0xdd85
movb $-0x1, 0x27(%rsp)
jmp 0xdd85
movb $-0x1, 0x27(%rsp)
movb 0x27(%rsp), %al
addq $0x28, %rsp
retq
nop
// File: 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:
subq $0x28, %rsp
movb %dl, %al
movw %si, %cx
movq %rdi, 0x20(%rsp)
movw %cx, 0x1e(%rsp)
movb %al, 0x1d(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movzwl 0x1e(%rsp), %eax
cmpl $0x3fff, %eax           # imm = 0x3FFF
jg 0xde1c
movzbl 0x1d(%rsp), %eax
andl $0xf, %eax
movb %al, 0x1d(%rsp)
movzwl 0x1e(%rsp), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
jne 0xddf0
movq 0x10(%rsp), %rax
movzbl 0x1d(%rsp), %ecx
cmpl $0xa, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x18(%rax)
jmp 0xde1a
movzbl 0x1d(%rsp), %eax
cmpl $0x0, %eax
jne 0xde05
movl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xde0e
movzbl 0x1d(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x10(%rsp), %rax
movl 0xc(%rsp), %ecx
movb %cl, 0x24(%rax)
jmp 0xde71
movzwl 0x1e(%rsp), %eax
cmpl $0xa000, %eax           # imm = 0xA000
jl 0xde6f
movzwl 0x1e(%rsp), %eax
cmpl $0xbfff, %eax           # imm = 0xBFFF
jg 0xde6f
movq 0x10(%rsp), %rax
testb $0x1, 0x18(%rax)
je 0xde6d
movq 0x10(%rsp), %rcx
movzbl 0x1d(%rsp), %eax
orl $0xf0, %eax
movb %al, 0xb(%rsp)
movq 0x10(%rcx), %rdi
movzwl 0x1e(%rsp), %eax
cltd
idivl 0x20(%rcx)
movslq %edx, %rsi
callq 0x40f0
movb 0xb(%rsp), %cl
movb %cl, (%rax)
jmp 0xde6f
jmp 0xde71
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x28, %rsp
movw %si, %ax
movq %rdi, 0x18(%rsp)
movw %ax, 0x16(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movzwl 0x16(%rsp), %eax
cmpl $0x3fff, %eax           # imm = 0x3FFF
jg 0xdec7
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
movzwl 0x16(%rsp), %eax
movl %eax, %esi
callq 0x40f0
movb (%rax), %al
movb %al, 0x27(%rsp)
jmp 0xdfb9
movzwl 0x16(%rsp), %eax
cmpl $0x7fff, %eax           # imm = 0x7FFF
jg 0xdf07
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rdi
movzbl 0x24(%rcx), %eax
shll $0xe, %eax
movzwl 0x16(%rsp), %edx
andl $0x3fff, %edx           # imm = 0x3FFF
orl %edx, %eax
cltd
idivl 0x1c(%rcx)
movslq %edx, %rsi
callq 0x40f0
movb (%rax), %al
movb %al, 0x27(%rsp)
jmp 0xdfb9
movzwl 0x16(%rsp), %eax
cmpl $0xa000, %eax           # imm = 0xA000
jl 0xdfb4
movzwl 0x16(%rsp), %eax
cmpl $0xbfff, %eax           # imm = 0xBFFF
jg 0xdfb4
movq 0x8(%rsp), %rax
testb $0x1, 0x18(%rax)
je 0xdfad
movq 0x8(%rsp), %rax
movzbl 0x25(%rax), %eax
cmpl $0x3, %eax
jg 0xdf71
movq 0x8(%rsp), %rcx
movq 0x10(%rcx), %rdi
movzbl 0x25(%rcx), %eax
shll $0xd, %eax
movzwl 0x16(%rsp), %edx
andl $0x1fff, %edx           # imm = 0x1FFF
orl %edx, %eax
cltd
idivl 0x20(%rcx)
movslq %edx, %rsi
callq 0x40f0
movb (%rax), %al
movb %al, 0x27(%rsp)
jmp 0xdfb9
movq 0x8(%rsp), %rax
movzbl 0x25(%rax), %eax
cmpl $0x8, %eax
jl 0xdfa6
movq 0x8(%rsp), %rax
movzbl 0x25(%rax), %eax
cmpl $0xc, %eax
jg 0xdfa6
movq 0x8(%rsp), %rax
movzbl 0x25(%rax), %ecx
subl $0x8, %ecx
movslq %ecx, %rcx
movb 0x26(%rax,%rcx), %al
movb %al, 0x27(%rsp)
jmp 0xdfb9
movb $-0x1, 0x27(%rsp)
jmp 0xdfb9
movb $-0x1, 0x27(%rsp)
jmp 0xdfb9
movb $-0x1, 0x27(%rsp)
movb 0x27(%rsp), %al
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x28, %rsp
movb %dl, %al
movw %si, %cx
movq %rdi, 0x20(%rsp)
movw %cx, 0x1e(%rsp)
movb %al, 0x1d(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movzwl 0x1e(%rsp), %eax
cmpl $0x1fff, %eax           # imm = 0x1FFF
jg 0xe01b
movq 0x10(%rsp), %rax
movzbl 0x1d(%rsp), %ecx
andl $0xf, %ecx
cmpl $0xa, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x18(%rax)
jmp 0xe134
movzwl 0x1e(%rsp), %eax
cmpl $0x3fff, %eax           # imm = 0x3FFF
jg 0xe053
movzbl 0x1d(%rsp), %eax
andl $0x7f, %eax
movb %al, 0x1d(%rsp)
movzbl 0x1d(%rsp), %eax
cmpl $0x0, %eax
jne 0xe042
movb $0x1, 0x1d(%rsp)
movq 0x10(%rsp), %rax
movb 0x1d(%rsp), %cl
movb %cl, 0x24(%rax)
jmp 0xe132
movzwl 0x1e(%rsp), %eax
cmpl $0x5fff, %eax           # imm = 0x5FFF
jg 0xe070
movq 0x10(%rsp), %rax
movb 0x1d(%rsp), %cl
movb %cl, 0x25(%rax)
jmp 0xe130
movzwl 0x1e(%rsp), %eax
cmpl $0x7fff, %eax           # imm = 0x7FFF
jg 0xe081
jmp 0xe12e
movzwl 0x1e(%rsp), %eax
cmpl $0xa000, %eax           # imm = 0xA000
jl 0xe12c
movzwl 0x1e(%rsp), %eax
cmpl $0xbfff, %eax           # imm = 0xBFFF
jg 0xe12c
movq 0x10(%rsp), %rax
testb $0x1, 0x18(%rax)
je 0xe12a
movq 0x10(%rsp), %rax
movzbl 0x25(%rax), %eax
cmpl $0x3, %eax
jg 0xe0f3
movq 0x10(%rsp), %rcx
movb 0x1d(%rsp), %al
movb %al, 0xf(%rsp)
movq 0x10(%rcx), %rdi
movzbl 0x25(%rcx), %eax
shll $0xd, %eax
movzwl 0x1e(%rsp), %edx
andl $0x1fff, %edx           # imm = 0x1FFF
orl %edx, %eax
cltd
idivl 0x20(%rcx)
movslq %edx, %rsi
callq 0x40f0
movb 0xf(%rsp), %cl
movb %cl, (%rax)
jmp 0xe128
movq 0x10(%rsp), %rax
movzbl 0x25(%rax), %eax
cmpl $0x8, %eax
jl 0xe126
movq 0x10(%rsp), %rax
movzbl 0x25(%rax), %eax
cmpl $0xc, %eax
jg 0xe126
movq 0x10(%rsp), %rax
movb 0x1d(%rsp), %dl
movzbl 0x25(%rax), %ecx
subl $0x8, %ecx
movslq %ecx, %rcx
movb %dl, 0x26(%rax,%rcx)
jmp 0xe128
jmp 0xe12a
jmp 0xe12c
jmp 0xe12e
jmp 0xe130
jmp 0xe132
jmp 0xe134
addq $0x28, %rsp
retq
nopl (%rax)