LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: ksherlock[P]wdc-utils/link.cpp
// Function: one_file(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool one_file(const std::string &name) {

	if (flags.v) printf("Processing %s\n", name.c_str());

	int fd = open(name.c_str(), O_RDONLY | O_BINARY);
	if (fd < 0) {
		warn("Unable to open %s", name.c_str());
		return false;
	}
	bool rv = false;

	Header h;
	ssize_t ok;

	ok = read(fd, &h, sizeof(h));
	if (ok != sizeof(h)) {
		warnx("Invalid object file: %s", name.c_str());
		close(fd);
		return false;
	}

	le_to_host(h.magic);
	le_to_host(h.version);
	le_to_host(h.filetype);

	if (h.magic != MOD_MAGIC || h.version != MOD_VERSION || h.filetype < MOD_OBJECT || h.filetype > MOD_LIBRARY) {
		warnx("Invalid object file: %s", name.c_str());
		close(fd);
		return false;
	}

	if (h.filetype == MOD_LIBRARY) {
		warnx("%s is a library", name.c_str());
		close(fd);
		// todo -- add to library list...
		return true;
	}

	lseek(fd, 0, SEEK_SET);
	while(one_module(name, fd)) ;

	close(fd);
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
testb $0x1, 0x37e4d(%rip)     # 0x3f340
je 0x750f
movq -0x10(%rbp), %rdi
callq 0x3130
movq %rax, %rsi
leaq 0x24166(%rip), %rdi     # 0x2b66e
movb $0x0, %al
callq 0x3060
movq -0x10(%rbp), %rdi
callq 0x3130
movq %rax, %rdi
xorl %esi, %esi
movb $0x0, %al
callq 0x3280
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jge 0x7550
movq -0x10(%rbp), %rdi
callq 0x3130
movq %rax, %rsi
leaq 0x2413d(%rip), %rdi     # 0x2b67d
movb $0x0, %al
callq 0x30e0
movb $0x0, -0x1(%rbp)
jmp 0x766d
movb $0x0, -0x15(%rbp)
movl -0x14(%rbp), %edi
leaq -0x1c(%rbp), %rsi
movl $0x7, %edx
callq 0x3480
movq %rax, -0x28(%rbp)
cmpq $0x7, -0x28(%rbp)
je 0x759b
movq -0x10(%rbp), %rdi
callq 0x3130
movq %rax, %rsi
leaq 0x2402c(%rip), %rdi     # 0x2b5af
movb $0x0, %al
callq 0x3360
movl -0x14(%rbp), %edi
callq 0x3600
movb $0x0, -0x1(%rbp)
jmp 0x766d
leaq -0x1c(%rbp), %rdi
callq 0xc9b0
leaq -0x1c(%rbp), %rdi
addq $0x4, %rdi
callq 0xc9d0
leaq -0x1c(%rbp), %rdi
addq $0x6, %rdi
callq 0xc9f0
cmpl $0x5a44525a, -0x1c(%rbp) # imm = 0x5A44525A
jne 0x75e2
movzwl -0x18(%rbp), %eax
cmpl $0x1, %eax
jne 0x75e2
movzbl -0x16(%rbp), %eax
cmpl $0x1, %eax
jl 0x75e2
movzbl -0x16(%rbp), %eax
cmpl $0x2, %eax
jle 0x760a
movq -0x10(%rbp), %rdi
callq 0x3130
movq %rax, %rsi
leaq 0x23fba(%rip), %rdi     # 0x2b5af
movb $0x0, %al
callq 0x3360
movl -0x14(%rbp), %edi
callq 0x3600
movb $0x0, -0x1(%rbp)
jmp 0x766d
movzbl -0x16(%rbp), %eax
cmpl $0x2, %eax
jne 0x763b
movq -0x10(%rbp), %rdi
callq 0x3130
movq %rax, %rsi
leaq 0x24069(%rip), %rdi     # 0x2b68f
movb $0x0, %al
callq 0x3360
movl -0x14(%rbp), %edi
callq 0x3600
movb $0x1, -0x1(%rbp)
jmp 0x766d
movl -0x14(%rbp), %edi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x35a0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x6fa0
testb $0x1, %al
jne 0x765f
jmp 0x7661
jmp 0x7649
movl -0x14(%rbp), %edi
callq 0x3600
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: ksherlock[P]wdc-utils/link.cpp
// Function: intersection(std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned int, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, unsigned int>>> const&, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, std::map<unsigned int, int, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, int>>>&)
bool intersection(const std::unordered_map<std::string, uint32_t> &a,
	const std::set<std::string> &b, 
	std::map<uint32_t, int> &c)
{
	bool rv = false;

	for (const auto &name : b) {
		auto iter = a.find(name);
		if (iter == a.end()) continue;
		rv = true;
		c.emplace(iter->second, kPending);		
	}

	return rv;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0xcc70
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
callq 0xcca0
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0xccd0
testb $0x1, %al
jne 0x76d0
jmp 0x7755
leaq -0x30(%rbp), %rdi
callq 0xcd00
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0xcd20
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
callq 0xcd80
movq %rax, -0x50(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0xcd50
testb $0x1, %al
jne 0x770e
jmp 0x7710
jmp 0x7747
movb $0x1, -0x19(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq -0x48(%rbp), %rdi
callq 0xcdb0
movq -0x70(%rbp), %rdi
movq %rax, %rsi
addq $0x20, %rsi
movl $0x1, -0x54(%rbp)
leaq -0x54(%rbp), %rdx
callq 0x7760
movq %rax, -0x68(%rbp)
movb %dl, -0x60(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xcde0
jmp 0x76ba
movb -0x19(%rbp), %al
andb $0x1, %al
addq $0x70, %rsp
popq %rbp
retq
// File: ksherlock[P]wdc-utils/link.cpp
// Function: libraries()
void libraries() {

	if (undefined_symbols.empty()) return;

	for (auto &l : flags.l) {
		for (auto &L : flags.L) {
			//std::string path = L + "lib" + l;
			std::string path = L + l + ".lib";

			if (one_lib(path)) break;
		}
		if (undefined_symbols.empty()) break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
leaq 0x37606(%rip), %rdi     # 0x3f448
callq 0xd200
testb $0x1, %al
jne 0x7e4d
jmp 0x7e52
jmp 0x7ff8
leaq 0x374e7(%rip), %rax     # 0x3f340
addq $0x28, %rax
movq %rax, -0x8(%rbp)
leaq 0x374d8(%rip), %rdi     # 0x3f340
addq $0x28, %rdi
callq 0xd220
movq %rax, -0x10(%rbp)
leaq 0x374c4(%rip), %rdi     # 0x3f340
addq $0x28, %rdi
callq 0xd250
movq %rax, -0x18(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0xd280
testb $0x1, %al
jne 0x7e9f
jmp 0x7ff8
leaq -0x10(%rbp), %rdi
callq 0xd2c0
movq %rax, -0x20(%rbp)
leaq 0x3748d(%rip), %rax     # 0x3f340
addq $0x40, %rax
movq %rax, -0x28(%rbp)
leaq 0x3747e(%rip), %rdi     # 0x3f340
addq $0x40, %rdi
callq 0xd220
movq %rax, -0x30(%rbp)
leaq 0x3746a(%rip), %rdi     # 0x3f340
addq $0x40, %rdi
callq 0xd250
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0xd280
testb $0x1, %al
jne 0x7ef9
jmp 0x7fd4
leaq -0x30(%rbp), %rdi
callq 0xd2c0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x80(%rbp), %rdi
movq %rdi, -0x98(%rbp)
callq 0xd330
movq -0x98(%rbp), %rsi
leaq 0x237a3(%rip), %rdx     # 0x2b6cf
leaq -0x60(%rbp), %rdi
callq 0xd2e0
jmp 0x7f37
leaq -0x80(%rbp), %rdi
callq 0x31f0
leaq -0x60(%rbp), %rdi
callq 0x77b0
movb %al, -0x99(%rbp)
jmp 0x7f51
movb -0x99(%rbp), %al
testb $0x1, %al
jne 0x7f5d
jmp 0x7fa3
movl $0x4, -0x90(%rbp)
jmp 0x7fad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x31f0
jmp 0x8001
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x31f0
jmp 0x8001
movl $0x0, -0x90(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x31f0
movl -0x90(%rbp), %eax
testl %eax, %eax
je 0x7fc4
jmp 0x7fc2
jmp 0x7fd4
jmp 0x7fc6
leaq -0x30(%rbp), %rdi
callq 0xd3b0
jmp 0x7ee3
leaq 0x3746d(%rip), %rdi     # 0x3f448
callq 0xd200
testb $0x1, %al
jne 0x7fe6
jmp 0x7fe8
jmp 0x7ff8
jmp 0x7fea
leaq -0x10(%rbp), %rdi
callq 0xd3b0
jmp 0x7e89
addq $0xa0, %rsp
popq %rbp
retq
movq -0x88(%rbp), %rdi
callq 0x3540
nopl (%rax)
// File: ksherlock[P]wdc-utils/link.cpp
// Function: parse_ft(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool parse_ft(const std::string &s) {

	// gcc doesn't like std::xdigit w/ std::all_of

	if (s.length() != 2 && s.length() != 7) return false;
	if (!std::all_of(s.begin(), s.begin() + 2, isxdigit)) return false;
	if (s.length() == 7) {
		if (s[2] != ',' && s[2] != ':') return false;
		if (!std::all_of(s.begin() + 3, s.end(), isxdigit)) return false;
	}

	auto lambda = [](int lhs, uint8_t rhs){
		lhs <<= 4;
		if (rhs <= '9') return lhs + rhs - '0';
		return lhs + (rhs | 0x20) - 'a' + 10;
	};

	flags.file_type = std::accumulate(s.begin(), s.begin() + 2, 0, lambda);
	flags.aux_type = 0;

	if (s.length() == 7)
		flags.aux_type = std::accumulate(s.begin() + 3, s.end(), 0, lambda);

	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x34a0
cmpq $0x2, %rax
je 0x8046
movq -0x10(%rbp), %rdi
callq 0x34a0
cmpq $0x7, %rax
je 0x8046
movb $0x0, -0x1(%rbp)
jmp 0x81d2
movq -0x10(%rbp), %rdi
callq 0x3310
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3310
movq %rax, -0x28(%rbp)
leaq -0x28(%rbp), %rdi
movl $0x2, %esi
callq 0xd420
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq 0x36f2f(%rip), %rdx     # 0x3efb0
callq 0xd3d0
xorb $-0x1, %al
testb $0x1, %al
jne 0x808e
jmp 0x8097
movb $0x0, -0x1(%rbp)
jmp 0x81d2
movq -0x10(%rbp), %rdi
callq 0x34a0
cmpq $0x7, %rax
jne 0x8132
movq -0x10(%rbp), %rdi
movl $0x2, %esi
callq 0x3390
movsbl (%rax), %eax
cmpl $0x2c, %eax
je 0x80df
movq -0x10(%rbp), %rdi
movl $0x2, %esi
callq 0x3390
movsbl (%rax), %eax
cmpl $0x3a, %eax
je 0x80df
movb $0x0, -0x1(%rbp)
jmp 0x81d2
movq -0x10(%rbp), %rdi
callq 0x3310
movq %rax, -0x38(%rbp)
leaq -0x38(%rbp), %rdi
movl $0x3, %esi
callq 0xd420
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0x35c0
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq 0x36e96(%rip), %rdx     # 0x3efb0
callq 0xd3d0
xorb $-0x1, %al
testb $0x1, %al
jne 0x8127
jmp 0x8130
movb $0x0, -0x1(%rbp)
jmp 0x81d2
jmp 0x8132
movq -0x10(%rbp), %rdi
callq 0x3310
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3310
movq %rax, -0x60(%rbp)
leaq -0x60(%rbp), %rdi
movl $0x2, %esi
callq 0xd420
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
xorl %edx, %edx
callq 0x81e0
movw %ax, 0x37228(%rip)      # 0x3f39c
movl $0x0, 0x37222(%rip)     # 0x3f3a0
movq -0x10(%rbp), %rdi
callq 0x34a0
cmpq $0x7, %rax
jne 0x81ce
movq -0x10(%rbp), %rdi
callq 0x3310
movq %rax, -0x78(%rbp)
leaq -0x78(%rbp), %rdi
movl $0x3, %esi
callq 0xd420
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rdi
callq 0x35c0
movq %rax, -0x80(%rbp)
movq -0x70(%rbp), %rdi
movq -0x80(%rbp), %rsi
xorl %edx, %edx
callq 0x81e0
movl %eax, 0x371d2(%rip)     # 0x3f3a0
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x90, %rsp
popq %rbp
retq
// File: ksherlock[P]wdc-utils/link.cpp
// Function: void append<unsigned char>(std::vector<unsigned char, std::allocator<unsigned char>>&, std::vector<unsigned char, std::allocator<unsigned char>>&)
void append(std::vector<T> &to, std::vector<T> &from) {
	// std::move(from.begin(), from.end(), std::back_inserter(to));
	to.insert(to.end(),
		std::make_move_iterator(from.begin()),
		std::make_move_iterator(from.end())
	);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rdi
callq 0xa870
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0xa8a0
movq -0x10(%rbp), %rdi
callq 0xce10
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x1d660
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0xa870
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
callq 0x1d660
movq -0x50(%rbp), %rdi
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x38(%rbp), %rcx
callq 0x1d5b0
movq %rax, -0x48(%rbp)
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: ksherlock[P]wdc-utils/link.cpp
// Function: parenthesize(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
inline std::string parenthesize(const std::string &s) {
	std::string tmp;
	tmp.push_back('(');
	tmp.append(s);
	tmp.push_back(')');
	return tmp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x30(%rbp)
movq %rdi, %rax
movq %rax, -0x38(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
callq 0x3460
movq -0x30(%rbp), %rdi
movl $0x28, %esi
callq 0x32d0
jmp 0xeec4
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x35f0
jmp 0xeed3
movq -0x30(%rbp), %rdi
movl $0x29, %esi
callq 0x32d0
jmp 0xeee3
movb $0x1, -0x11(%rbp)
testb $0x1, -0x11(%rbp)
jne 0xef0f
jmp 0xef06
movq -0x30(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x31f0
jmp 0xef19
movq -0x30(%rbp), %rdi
callq 0x31f0
movq -0x38(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x3540
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: ksherlock[P]wdc-utils/expression.cpp
// Function: power(unsigned int, unsigned int)
uint32_t power(uint32_t a, uint32_t b) {

	uint32_t rv = 1;
	for( ; b; b >>= 1) {
		if (b & 0x01) rv *= a;
		a = a * a;
	}
	return rv; 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl $0x1, -0xc(%rbp)
cmpl $0x0, -0x8(%rbp)
je 0x21b40
movl -0x8(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x21b2c
movl -0x4(%rbp), %eax
imull -0xc(%rbp), %eax
movl %eax, -0xc(%rbp)
movl -0x4(%rbp), %eax
imull -0x4(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x8(%rbp), %eax
shrl %eax
movl %eax, -0x8(%rbp)
jmp 0x21b11
movl -0xc(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: ksherlock[P]wdc-utils/expression.cpp
// Function: unary_op(unsigned int, std::vector<expr, std::allocator<expr>>&)
bool unary_op(unsigned op, std::vector<expr> &v) {
	if (v.size() >=1 ) {
		expr &a = v.back();
		if (a.tag == OP_VAL) {
			switch(a.tag) {
			case OP_NOT: a.value = !a.value; break;
			case OP_NEG: a.value = -a.value; break;
			case OP_FLP: a.value = ~a.value; break;
			default:
				errx(EX_SOFTWARE, "Unsupported unary op %02x", a.tag);
			}
			return true;
		}
	}
	v.emplace_back(op);
	return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0xa020
cmpq $0x1, %rax
jb 0x21c11
movq -0x10(%rbp), %rdi
callq 0x183d0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x21c0f
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x1c(%rbp)
subl $0xa, %eax
je 0x21bb0
jmp 0x21b9c
movl -0x1c(%rbp), %eax
subl $0xb, %eax
je 0x21bcb
jmp 0x21ba6
movl -0x1c(%rbp), %eax
subl $0xc, %eax
je 0x21bdd
jmp 0x21bf0
movq -0x18(%rbp), %rax
cmpl $0x0, 0x4(%rax)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x4(%rax)
jmp 0x21c09
movq -0x18(%rbp), %rax
xorl %ecx, %ecx
subl 0x4(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x4(%rax)
jmp 0x21c09
movq -0x18(%rbp), %rax
movl 0x4(%rax), %ecx
xorl $-0x1, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x4(%rax)
jmp 0x21c09
movq -0x18(%rbp), %rax
movl (%rax), %edx
movl $0x46, %edi
leaq 0x9f2e(%rip), %rsi      # 0x2bb30
movb $0x0, %al
callq 0x35b0
movb $0x1, -0x1(%rbp)
jmp 0x21c22
jmp 0x21c11
movq -0x10(%rbp), %rdi
leaq -0x8(%rbp), %rsi
callq 0x22a80
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: ksherlock[P]wdc-utils/expression.cpp
// Function: simplify_expression(expression&)
bool simplify_expression(expression &e) {
	std::vector<expr> tmp;
	bool rv = false;
	for (auto &t : e.stack) {
		if (t.tag >= OP_BIN) {
			rv = binary_op(t.tag, tmp) || rv;
		} else if (t.tag >= OP_UNA) {
			rv = unary_op(t.tag, tmp) || rv;
		} else {
			tmp.emplace_back(t);
		}
	}
	if (rv) e.stack = std::move(tmp);
	return rv;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
leaq -0x20(%rbp), %rdi
callq 0xebc0
movb $0x0, -0x21(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x9ef0
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
callq 0x9f20
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x9f50
testb $0x1, %al
jne 0x22195
jmp 0x22257
leaq -0x38(%rbp), %rdi
callq 0x9f90
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpl $0x14, (%rax)
jl 0x221f8
movq -0x48(%rbp), %rax
movl (%rax), %edi
leaq -0x20(%rbp), %rsi
callq 0x21c30
movb %al, -0x55(%rbp)
jmp 0x221bf
movb -0x55(%rbp), %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x56(%rbp)
jne 0x221d4
jmp 0x221ce
movb -0x21(%rbp), %al
movb %al, -0x56(%rbp)
movb -0x56(%rbp), %al
andb $0x1, %al
movb %al, -0x21(%rbp)
jmp 0x22247
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x20(%rbp), %rdi
callq 0xfc70
jmp 0x22288
movq -0x48(%rbp), %rax
cmpl $0xa, (%rax)
jl 0x22234
movq -0x48(%rbp), %rax
movl (%rax), %edi
leaq -0x20(%rbp), %rsi
callq 0x21b50
movb %al, -0x57(%rbp)
jmp 0x22215
movb -0x57(%rbp), %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x58(%rbp)
jne 0x2222a
jmp 0x22224
movb -0x21(%rbp), %al
movb %al, -0x58(%rbp)
movb -0x58(%rbp), %al
andb $0x1, %al
movb %al, -0x21(%rbp)
jmp 0x22245
movq -0x48(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x22b50
jmp 0x22243
jmp 0x22245
jmp 0x22247
jmp 0x22249
leaq -0x38(%rbp), %rdi
callq 0xa000
jmp 0x2217f
testb $0x1, -0x21(%rbp)
je 0x2226e
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
leaq -0x20(%rbp), %rsi
callq 0x22bd0
movb -0x21(%rbp), %al
movb %al, -0x59(%rbp)
leaq -0x20(%rbp), %rdi
callq 0xfc70
movb -0x59(%rbp), %al
andb $0x1, %al
addq $0x60, %rsp
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x3540
nopw %cs:(%rax,%rax)
// File: ksherlock[P]wdc-utils/expression.cpp
// Function: evaluate_expression(expression&, bool)
optional<uint32_t> evaluate_expression(expression &e, bool force) {
	std::vector<expr> tmp;
	for (const auto &t : e.stack) {
		if (t.tag == OP_LOC && force) {
			tmp.emplace_back(OP_VAL, t.value);
			continue;				
		}
		if (t.tag >= OP_BIN) {
			binary_op(t.tag, tmp);
		} else if (t.tag >= OP_UNA) {
			unary_op(t.tag, tmp);
		} else {
			tmp.emplace_back(t);
		}
	}

	if (tmp.size() == 1 && tmp.front().tag == OP_VAL) return optional<uint32_t>(tmp.front().value);
	return optional<uint32_t>();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x78(%rbp)
movb %dl, %al
movq %rdi, %rcx
movq %rcx, -0x70(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xebc0
movq -0x10(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
callq 0x9ef0
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
callq 0x9f20
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x9f50
testb $0x1, %al
jne 0x2230a
jmp 0x223bb
leaq -0x40(%rbp), %rdi
callq 0x9f90
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpl $0x3, (%rax)
jne 0x22360
testb $0x1, -0x11(%rbp)
je 0x22360
movl $0x2, -0x54(%rbp)
movq -0x50(%rbp), %rdx
addq $0x4, %rdx
leaq -0x30(%rbp), %rdi
leaq -0x54(%rbp), %rsi
callq 0x22440
jmp 0x22344
jmp 0x223ad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xfc70
jmp 0x22432
movq -0x50(%rbp), %rax
cmpl $0x14, (%rax)
jl 0x2237c
movq -0x50(%rbp), %rax
movl (%rax), %edi
leaq -0x30(%rbp), %rsi
callq 0x21c30
jmp 0x2237a
jmp 0x223ab
movq -0x50(%rbp), %rax
cmpl $0xa, (%rax)
jl 0x22398
movq -0x50(%rbp), %rax
movl (%rax), %edi
leaq -0x30(%rbp), %rsi
callq 0x21b50
jmp 0x22396
jmp 0x223a9
movq -0x50(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x22c00
jmp 0x223a7
jmp 0x223a9
jmp 0x223ab
jmp 0x223ad
leaq -0x40(%rbp), %rdi
callq 0xa000
jmp 0x222f4
leaq -0x30(%rbp), %rdi
callq 0xa020
cmpq $0x1, %rax
jne 0x223fc
leaq -0x30(%rbp), %rdi
callq 0x22c80
cmpl $0x2, (%rax)
jne 0x223fc
leaq -0x30(%rbp), %rdi
callq 0x22c80
movq -0x78(%rbp), %rdi
movq %rax, %rsi
addq $0x4, %rsi
callq 0x22cb0
jmp 0x223f3
movl $0x1, -0x68(%rbp)
jmp 0x2241c
movq -0x78(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x3190
movq -0x78(%rbp), %rdi
callq 0x22ce0
movl $0x1, -0x68(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xfc70
movq -0x70(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x3540
nopl (%rax,%rax)
// File: ksherlock[P]wdc-utils/omf.cpp
// Function: push(std::vector<unsigned char, std::allocator<unsigned char>>&, unsigned int)
void push(std::vector<uint8_t> &v, uint32_t x) {
	v.push_back(x & 0xff);
	x >>= 8;
	v.push_back(x & 0xff);
	x >>= 8;
	v.push_back(x & 0xff);
	x >>= 8;
	v.push_back(x & 0xff);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %eax
andl $0xff, %eax
movb %al, -0xd(%rbp)
leaq -0xd(%rbp), %rsi
callq 0x25720
movl -0xc(%rbp), %eax
shrl $0x8, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %eax
andl $0xff, %eax
movb %al, -0xe(%rbp)
leaq -0xe(%rbp), %rsi
callq 0x25720
movl -0xc(%rbp), %eax
shrl $0x8, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %eax
andl $0xff, %eax
movb %al, -0xf(%rbp)
leaq -0xf(%rbp), %rsi
callq 0x25720
movl -0xc(%rbp), %eax
shrl $0x8, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %eax
andl $0xff, %eax
movb %al, -0x10(%rbp)
leaq -0x10(%rbp), %rsi
callq 0x25720
addq $0x10, %rsp
popq %rbp
retq
// File: ksherlock[P]wdc-utils/omf.cpp
// Function: save_bin(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, omf::segment&, unsigned int)
void save_bin(const std::string &path, omf::segment &segment, uint32_t org) {

	int fd;
	fd = open(path.c_str(), O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666);
	if (fd < 0) {
		err(EX_CANTCREAT, "Unable to open %s", path.c_str());
	}

	auto &data = segment.data;

	for (auto &r : segment.relocs) {

		uint32_t value = r.value + org;
		value >>= -(int8_t)r.shift;

		unsigned offset = r.offset;
		unsigned size = r.size;
		while (size--) {
			data[offset++] = value & 0xff;
			value >>= 8;
		}
	}

	auto ok = write(fd, data.data(), data.size());
	if (ok < 0) {
		close(fd);
		err(EX_OSERR, "write %s", path.c_str());
	}
	close(fd);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3130
movq %rax, %rdi
movl $0x241, %esi            # imm = 0x241
movl $0x1b6, %edx            # imm = 0x1B6
movb $0x0, %al
callq 0x3280
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jge 0x24658
movq -0x8(%rbp), %rdi
callq 0x3130
movq %rax, %rdx
movl $0x49, %edi
leaq 0x702c(%rip), %rsi      # 0x2b67d
movb $0x0, %al
callq 0x3300
movq -0x10(%rbp), %rax
addq $0x50, %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
addq $0x80, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x1b110
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
callq 0x1af40
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x25940
testb $0x1, %al
jne 0x246a2
jmp 0x24737
leaq -0x30(%rbp), %rdi
callq 0x1b5d0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movl 0x8(%rax), %eax
addl -0x14(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0x40(%rbp), %rax
movsbl 0x1(%rax), %eax
xorl %ecx, %ecx
subl %eax, %ecx
movl -0x44(%rbp), %eax
shrl %cl, %eax
movl %eax, -0x44(%rbp)
movq -0x40(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x48(%rbp)
movq -0x40(%rbp), %rax
movzbl (%rax), %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x4c(%rbp)
cmpl $0x0, %eax
je 0x24727
movl -0x44(%rbp), %eax
andl $0xff, %eax
movb %al, -0x59(%rbp)
movq -0x20(%rbp), %rdi
movl -0x48(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x48(%rbp)
movl %eax, %eax
movl %eax, %esi
callq 0xc230
movb -0x59(%rbp), %cl
movb %cl, (%rax)
movl -0x44(%rbp), %eax
shrl $0x8, %eax
movl %eax, -0x44(%rbp)
jmp 0x246e4
jmp 0x24729
leaq -0x30(%rbp), %rdi
callq 0x25bd0
jmp 0x2468c
movl -0x18(%rbp), %eax
movl %eax, -0x6c(%rbp)
movq -0x20(%rbp), %rdi
callq 0xcbf0
movq %rax, -0x68(%rbp)
movq -0x20(%rbp), %rdi
callq 0xa700
movl -0x6c(%rbp), %edi
movq -0x68(%rbp), %rsi
movq %rax, %rdx
callq 0x30f0
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
jge 0x24794
movl -0x18(%rbp), %edi
callq 0x3600
movq -0x8(%rbp), %rdi
callq 0x3130
movq %rax, %rdx
movl $0x47, %edi
leaq 0x73d8(%rip), %rsi      # 0x2bb65
movb $0x0, %al
callq 0x3300
movl -0x18(%rbp), %edi
callq 0x3600
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: ksherlock[P]wdc-utils/omf.cpp
// Function: to_v1(omf_header&)
static void to_v1(struct omf_header &h) {

	// KIND op value used as-is, no translation.

	h.version = 1;
	// byte count -> block count
	h.bytecount = (h.bytecount + 511) >> 9;
	h.unused1 = h.kind;
	h.kind = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movb $0x1, 0xf(%rax)
movq -0x8(%rbp), %rax
movl (%rax), %ecx
addl $0x1ff, %ecx            # imm = 0x1FF
shrl $0x9, %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
movq -0x8(%rbp), %rax
movw 0x14(%rax), %ax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0xc(%rax)
movq -0x8(%rbp), %rax
movw $0x0, 0x14(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: ksherlock[P]wdc-utils/omf.cpp
// Function: super_helper::append(unsigned int)
void append(uint32_t pc) {
		unsigned offset = pc & 0xff;
		unsigned page = pc >> 8;
		assert(page >= _page);

		if (page != _page) {
			unsigned skip = page - _page;
			if (_count) --skip;
			if (skip) {
				
				while (skip >= 0x80) {
					_data.push_back(0xff);
					skip -= 0x7f;
				}
				if (skip)
					_data.push_back(0x80 | skip);
			}
			_page = page;
			_count = 0;
		}

		if (!_count) {
			_data.push_back(0); // count-1 place holder.
		} else {
			_data[_data.size() - _count - 1] = _count; // count is count - 1 at this point,
		}

		_data.push_back(offset);
		++_count;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0x28(%rbp)
movl -0xc(%rbp), %eax
andl $0xff, %eax
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %eax
shrl $0x8, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl 0x18(%rcx), %eax
jb 0x25ab5
jmp 0x25ad4
leaq 0x60bf(%rip), %rdi      # 0x2bb7b
leaq 0x60c6(%rip), %rsi      # 0x2bb89
movl $0xd0, %edx
leaq 0x60c2(%rip), %rcx      # 0x2bb91
callq 0x3220
movq -0x28(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0x18(%rcx), %eax
je 0x25b5a
movq -0x28(%rbp), %rax
movl -0x14(%rbp), %ecx
subl 0x18(%rax), %ecx
movl %ecx, -0x18(%rbp)
cmpl $0x0, 0x1c(%rax)
je 0x25afc
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0x25b49
jmp 0x25b04
cmpl $0x80, -0x18(%rbp)
jb 0x25b29
movq -0x28(%rbp), %rdi
movb $-0x1, -0x19(%rbp)
leaq -0x19(%rbp), %rsi
callq 0x25720
movl -0x18(%rbp), %eax
subl $0x7f, %eax
movl %eax, -0x18(%rbp)
jmp 0x25b04
cmpl $0x0, -0x18(%rbp)
je 0x25b47
movq -0x28(%rbp), %rdi
movl -0x18(%rbp), %eax
orl $0x80, %eax
movb %al, -0x1a(%rbp)
leaq -0x1a(%rbp), %rsi
callq 0x25720
jmp 0x25b49
movq -0x28(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %ecx, 0x18(%rax)
movl $0x0, 0x1c(%rax)
movq -0x28(%rbp), %rax
cmpl $0x0, 0x1c(%rax)
jne 0x25b77
movq -0x28(%rbp), %rdi
movb $0x0, -0x1b(%rbp)
leaq -0x1b(%rbp), %rsi
callq 0x25720
jmp 0x25ba2
movq -0x28(%rbp), %rdi
movl 0x1c(%rdi), %eax
movb %al, -0x29(%rbp)
callq 0xa700
movq -0x28(%rbp), %rdi
movq %rax, %rsi
movslq 0x1c(%rdi), %rax
subq %rax, %rsi
subq $0x1, %rsi
callq 0xc230
movb -0x29(%rbp), %cl
movb %cl, (%rax)
movq -0x28(%rbp), %rdi
movl -0x10(%rbp), %eax
movb %al, -0x1c(%rbp)
leaq -0x1c(%rbp), %rsi
callq 0x25720
movq -0x28(%rbp), %rax
movl 0x1c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x1c(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: ksherlock[P]wdc-utils/set_file_type.cpp
// Function: set_file_type(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned short, unsigned int)
int set_file_type(const std::string &path, uint16_t file_type, uint32_t aux_type) {

	afp::finder_info fi;
	std::error_code ec;

	if (!fi.open(path, afp::finder_info::read_write, ec))
		return -1;

	fi.set_prodos_file_type(file_type, aux_type);
	if (!fi.write(ec))
		return -1;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movw %si, %ax
movq %rdi, -0x10(%rbp)
movw %ax, -0x12(%rbp)
movl %edx, -0x18(%rbp)
leaq -0x44(%rbp), %rdi
movq %rdi, -0x80(%rbp)
callq 0x28fe0
leaq -0x58(%rbp), %rdi
movq %rdi, -0x78(%rbp)
callq 0x28fb0
movq -0x80(%rbp), %rdi
movq -0x78(%rbp), %rcx
movq -0x10(%rbp), %rsi
movl $0x3, %edx
callq 0x29230
movb %al, -0x69(%rbp)
jmp 0x28f0e
movb -0x69(%rbp), %al
testb $0x1, %al
jne 0x28f3e
jmp 0x28f17
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x68(%rbp)
jmp 0x28f8f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x44(%rbp), %rdi
callq 0x29200
jmp 0x28fa4
movzwl -0x12(%rbp), %esi
movl -0x18(%rbp), %edx
leaq -0x44(%rbp), %rdi
callq 0x29860
jmp 0x28f50
leaq -0x44(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x296d0
movb %al, -0x81(%rbp)
jmp 0x28f65
movb -0x81(%rbp), %al
testb $0x1, %al
jne 0x28f81
jmp 0x28f71
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x68(%rbp)
jmp 0x28f8f
movl $0x0, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
leaq -0x44(%rbp), %rdi
callq 0x29200
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x3540
nopl (%rax)
// File: ksherlock[P]wdc-utils/afp/src/finder_info.cpp
// Function: afp::finder_info::finder_info(afp::finder_info&&)
finder_info::finder_info(finder_info &&rhs) {
	std::swap(_fd, rhs._fd);
	std::memcpy(_finder_info, rhs._finder_info, sizeof(_finder_info));
	_prodos_file_type = rhs._prodos_file_type;
	_prodos_aux_type = rhs._prodos_aux_type;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movw $0x0, 0x4(%rax)
movl $0x0, 0x8(%rax)
addq $0xc, %rax
movq %rax, %rcx
addq $0x20, %rcx
movq %rcx, -0x20(%rbp)
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movb $0x0, (%rax)
addq $0x1, %rax
cmpq %rcx, %rax
movq %rax, -0x18(%rbp)
jne 0x2908e
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x29e50
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0xc(%rcx), %rdx
movq %rdx, 0xc(%rax)
movq 0x14(%rcx), %rdx
movq %rdx, 0x14(%rax)
movq 0x1c(%rcx), %rdx
movq %rdx, 0x1c(%rax)
movq 0x24(%rcx), %rcx
movq %rcx, 0x24(%rax)
movq -0x10(%rbp), %rcx
movw 0x4(%rcx), %cx
movw %cx, 0x4(%rax)
movq -0x10(%rbp), %rcx
movl 0x8(%rcx), %ecx
movl %ecx, 0x8(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: ksherlock[P]wdc-utils/afp/src/finder_info.cpp
// Function: afp::finder_info::operator=(afp::finder_info&&)
finder_info &finder_info::operator=(finder_info &&rhs) {
	if (this != &rhs) {
		close();
		std::swap(_fd, rhs._fd);
		std::memcpy(_finder_info, &rhs._finder_info, sizeof(_finder_info));
		_prodos_file_type = rhs._prodos_file_type;
		_prodos_aux_type = rhs._prodos_aux_type;
	}
	return *this;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq -0x10(%rbp), %rax
je 0x29172
movq -0x18(%rbp), %rdi
callq 0x29180
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x29e50
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0xc(%rcx), %rdx
movq %rdx, 0xc(%rax)
movq 0x14(%rcx), %rdx
movq %rdx, 0x14(%rax)
movq 0x1c(%rcx), %rdx
movq %rdx, 0x1c(%rax)
movq 0x24(%rcx), %rcx
movq %rcx, 0x24(%rax)
movq -0x10(%rbp), %rcx
movw 0x4(%rcx), %cx
movw %cx, 0x4(%rax)
movq -0x10(%rbp), %rcx
movl 0x8(%rcx), %ecx
movl %ecx, 0x8(%rax)
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: ksherlock[P]wdc-utils/afp/src/finder_info.cpp
// Function: afp::finder_info::open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, afp::finder_info::open_mode, std::error_code&)
bool finder_info::open(const std::string &path, open_mode mode, std::error_code &ec) {
	ec.clear();
	close();
	clear();

	_fd = openX(path, ec);
	if (ec) return false;

	if (mode == read_only || mode == read_write) {
		auto ok = _(::read_xattr(_fd, XATTR_FINDERINFO_NAME, _finder_info, 32), ec);
		if (mode == read_only) close();
		if (ec) {
			remap_enoattr(ec);
			if (mode == read_only) return false;
			if (ec.value() == EOPNOTSUPP) {
				close();
				return false;
			}
		}
		finder_info_to_filetype(_finder_info, &_prodos_file_type, &_prodos_aux_type);
	}
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rdi
callq 0x29e80
movq -0x38(%rbp), %rdi
callq 0x29180
movq -0x38(%rbp), %rdi
callq 0x291c0
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x29350
movl %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, (%rax)
movq -0x28(%rbp), %rdi
callq 0x29eb0
testb $0x1, %al
jne 0x2928e
jmp 0x29297
movb $0x0, -0x1(%rbp)
jmp 0x29343
cmpl $0x1, -0x1c(%rbp)
je 0x292a7
cmpl $0x3, -0x1c(%rbp)
jne 0x2933f
movq -0x38(%rbp), %rdx
movl (%rdx), %edi
addq $0xc, %rdx
leaq 0x28fd(%rip), %rsi      # 0x2bbb5
movl $0x20, %ecx
callq 0x29ff0
movq %rax, %rdi
movq -0x28(%rbp), %rsi
callq 0x293c0
movq %rax, -0x30(%rbp)
cmpl $0x1, -0x1c(%rbp)
jne 0x292e1
movq -0x38(%rbp), %rdi
callq 0x29180
movq -0x28(%rbp), %rdi
callq 0x29eb0
testb $0x1, %al
jne 0x292f0
jmp 0x29324
movq -0x28(%rbp), %rdi
callq 0x29420
cmpl $0x1, -0x1c(%rbp)
jne 0x29305
movb $0x0, -0x1(%rbp)
jmp 0x29343
movq -0x28(%rbp), %rdi
callq 0x29ed0
cmpl $0x5f, %eax
jne 0x29322
movq -0x38(%rbp), %rdi
callq 0x29180
movb $0x0, -0x1(%rbp)
jmp 0x29343
jmp 0x29324
movq -0x38(%rbp), %rdx
movq %rdx, %rdi
addq $0xc, %rdi
movq %rdx, %rsi
addq $0x4, %rsi
addq $0x8, %rdx
callq 0x29430
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nop
// File: ksherlock[P]wdc-utils/afp/src/finder_info.cpp
// Function: (anonymous namespace)::openX(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::error_code&)
int openX(const std::string &path, std::error_code &ec) {
		int fd = _(::open(path.c_str(), O_RDONLY | O_NONBLOCK), ec);
		if (fd >= 0 && !regular_file(fd, ec)) {
			::close(fd);
			fd = -1;
		}
		return fd;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3130
movq %rax, %rdi
movl $0x800, %esi            # imm = 0x800
movb $0x0, %al
callq 0x3280
movl %eax, %edi
movq -0x10(%rbp), %rsi
callq 0x29810
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jl 0x293ab
movl -0x14(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x29cf0
testb $0x1, %al
jne 0x293ab
movl -0x14(%rbp), %edi
callq 0x3600
movl $0xffffffff, -0x14(%rbp) # imm = 0xFFFFFFFF
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: ksherlock[P]wdc-utils/afp/src/finder_info.cpp
// Function: afp::finder_info::write(std::error_code&)
bool finder_info::write(std::error_code &ec) {
	ec.clear();
	// n.b. no way to differentiate closed vs opened read-only.
	auto ok = _(::write_xattr(_fd, XATTR_FINDERINFO_NAME, _finder_info, 32), ec);
	if (ec) {
		remap_enoattr(ec);
		return false;
	}
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x29e80
movq -0x28(%rbp), %rdx
movl (%rdx), %edi
addq $0xc, %rdx
leaq 0x24b3(%rip), %rsi      # 0x2bbb5
movl $0x20, %ecx
callq 0x2a030
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x293c0
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x29eb0
testb $0x1, %al
jne 0x2972b
jmp 0x2973a
movq -0x18(%rbp), %rdi
callq 0x29420
movb $0x0, -0x1(%rbp)
jmp 0x2973e
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: ksherlock[P]wdc-utils/afp/src/finder_info.cpp
// Function: afp::finder_info::write(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::error_code&)
bool finder_info::write(const std::string &path, std::error_code &ec) {
	ec.clear();

	int fd = _(::open(path.c_str(), O_RDONLY), ec);
	if (ec) return false;

	auto ok = _(::write_xattr(fd, XATTR_FINDERINFO_NAME, _finder_info, 32), ec);
	::close(fd);
	if (ec) {
		remap_enoattr(ec);
		return false;
	}

	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
callq 0x29e80
movq -0x18(%rbp), %rdi
callq 0x3130
movq %rax, %rdi
xorl %esi, %esi
movb $0x0, %al
callq 0x3280
movl %eax, %edi
movq -0x20(%rbp), %rsi
callq 0x29810
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rdi
callq 0x29eb0
testb $0x1, %al
jne 0x297a7
jmp 0x297ad
movb $0x0, -0x1(%rbp)
jmp 0x29803
movq -0x38(%rbp), %rdx
movl -0x24(%rbp), %edi
addq $0xc, %rdx
leaq 0x23f6(%rip), %rsi      # 0x2bbb5
movl $0x20, %ecx
callq 0x2a030
movq %rax, %rdi
movq -0x20(%rbp), %rsi
callq 0x293c0
movq %rax, -0x30(%rbp)
movl -0x24(%rbp), %edi
callq 0x3600
movq -0x20(%rbp), %rdi
callq 0x29eb0
testb $0x1, %al
jne 0x297f0
jmp 0x297ff
movq -0x20(%rbp), %rdi
callq 0x29420
movb $0x0, -0x1(%rbp)
jmp 0x29803
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nop
// File: ksherlock[P]wdc-utils/afp/src/finder_info.cpp
// Function: afp::finder_info::is_text() const
bool finder_info::is_text() const {
	if (memcmp(_finder_info, "TEXT", 4) == 0) return true;
	if (_prodos_file_type == 0x04) return true;
	if (_prodos_file_type == 0xb0) return true;

	return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
addq $0xc, %rax
movl (%rax), %eax
subl $0x54584554, %eax       # imm = 0x54584554
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x29acc
movb $0x1, -0x1(%rbp)
jmp 0x29af8
movq -0x18(%rbp), %rax
movzwl 0x4(%rax), %eax
cmpl $0x4, %eax
jne 0x29adf
movb $0x1, -0x1(%rbp)
jmp 0x29af8
movq -0x18(%rbp), %rax
movzwl 0x4(%rax), %eax
cmpl $0xb0, %eax
jne 0x29af4
movb $0x1, -0x1(%rbp)
jmp 0x29af8
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
popq %rbp
retq
nop
// File: ksherlock[P]wdc-utils/afp/src/finder_info.cpp
// Function: afp::finder_info::is_binary() const
bool finder_info::is_binary() const {
	if (is_text()) return false;
	if (_prodos_file_type || _prodos_aux_type) return true;

	if (memcmp(_finder_info, "\x00\x00\x00\x00\x00\x00\x00\x00", 8) == 0) return false;
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x18(%rbp)
callq 0x29aa0
testb $0x1, %al
jne 0x29b1f
jmp 0x29b25
movb $0x0, -0x1(%rbp)
jmp 0x29b63
movq -0x18(%rbp), %rax
cmpw $0x0, 0x4(%rax)
jne 0x29b3a
movq -0x18(%rbp), %rax
cmpl $0x0, 0x8(%rax)
je 0x29b40
movb $0x1, -0x1(%rbp)
jmp 0x29b63
movq -0x18(%rbp), %rax
addq $0xc, %rax
movq (%rax), %rax
testq %rax, %rax
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x29b5f
movb $0x0, -0x1(%rbp)
jmp 0x29b63
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nop
// File: ksherlock[P]wdc-utils/afp/src/finder_info.cpp
// Function: afp::finder_info::file_type() const
uint32_t finder_info::file_type() const {
	uint32_t rv = 0;
	for (unsigned i = 0; i < 4; ++i) {
		rv <<= 8;
		rv |= _finder_info[i];
	}
	return rv;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
cmpl $0x4, -0x10(%rbp)
jae 0x29bba
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
shll $0x8, %ecx
movl %ecx, -0xc(%rbp)
movl -0x10(%rbp), %ecx
movzbl 0xc(%rax,%rcx), %eax
orl -0xc(%rbp), %eax
movl %eax, -0xc(%rbp)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x29b8e
movl -0xc(%rbp), %eax
popq %rbp
retq
nop
// File: ksherlock[P]wdc-utils/afp/src/finder_info.cpp
// Function: afp::finder_info::creator_type() const
uint32_t finder_info::creator_type() const {
	uint32_t rv = 0;
	for (unsigned i = 4; i < 8; ++i) {
		rv <<= 8;
		rv |= _finder_info[i];
	}
	return rv;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0xc(%rbp)
movl $0x4, -0x10(%rbp)
cmpl $0x8, -0x10(%rbp)
jae 0x29c0a
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
shll $0x8, %ecx
movl %ecx, -0xc(%rbp)
movl -0x10(%rbp), %ecx
movzbl 0xc(%rax,%rcx), %eax
orl -0xc(%rbp), %eax
movl %eax, -0xc(%rbp)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x29bde
movl -0xc(%rbp), %eax
popq %rbp
retq
nop
// File: ksherlock[P]wdc-utils/afp/src/finder_info.cpp
// Function: afp::finder_info::set_file_type(unsigned int)
void finder_info::set_file_type(uint32_t x) {
	_finder_info[0] = x >> 24;
	_finder_info[1] = x >> 16;
	_finder_info[2] = x >> 8;
	_finder_info[3] = x >> 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
shrl $0x18, %ecx
movb %cl, 0xc(%rax)
movl -0xc(%rbp), %ecx
shrl $0x10, %ecx
movb %cl, 0xd(%rax)
movl -0xc(%rbp), %ecx
shrl $0x8, %ecx
movb %cl, 0xe(%rax)
movl -0xc(%rbp), %ecx
shrl $0x0, %ecx
movb %cl, 0xf(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: ksherlock[P]wdc-utils/afp/src/finder_info.cpp
// Function: afp::finder_info::set_creator_type(unsigned int)
void finder_info::set_creator_type(uint32_t x) {
	_finder_info[4] = x >> 24;
	_finder_info[5] = x >> 16;
	_finder_info[6] = x >> 8;
	_finder_info[7] = x >> 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
shrl $0x18, %ecx
movb %cl, 0x10(%rax)
movl -0xc(%rbp), %ecx
shrl $0x10, %ecx
movb %cl, 0x11(%rax)
movl -0xc(%rbp), %ecx
shrl $0x8, %ecx
movb %cl, 0x12(%rax)
movl -0xc(%rbp), %ecx
shrl $0x0, %ecx
movb %cl, 0x13(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: ksherlock[P]wdc-utils/afp/src/finder_info.cpp
// Function: (anonymous namespace)::regular_file(int, std::error_code&)
bool regular_file(int fd, std::error_code &ec) {
			struct stat st;
			if (_(::fstat(fd, &st), ec) < 0) {
				return false;
			}
			if (S_ISREG(st.st_mode)) return true;

			if (S_ISDIR(st.st_mode)) {
				ec = std::make_error_code(std::errc::is_a_directory);
			} else {
				ec = std::make_error_code(std::errc::invalid_seek); // ESPIPE.
			}
			return false;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x8(%rbp), %edi
leaq -0xa0(%rbp), %rsi
callq 0x3520
movl %eax, %edi
movq -0x10(%rbp), %rsi
callq 0x29810
cmpl $0x0, %eax
jge 0x29d2a
movb $0x0, -0x1(%rbp)
jmp 0x29dba
movl -0x88(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x8000, %eax           # imm = 0x8000
jne 0x29d42
movb $0x1, -0x1(%rbp)
jmp 0x29dba
movl -0x88(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x29d86
movl $0x15, %edi
callq 0x29f50
movl %eax, -0xb0(%rbp)
movq %rdx, -0xa8(%rbp)
movq -0x10(%rbp), %rax
movq -0xb0(%rbp), %rcx
movq %rcx, (%rax)
movq -0xa8(%rbp), %rcx
movq %rcx, 0x8(%rax)
jmp 0x29db6
movl $0x1d, %edi
callq 0x29f50
movl %eax, -0xc0(%rbp)
movq %rdx, -0xb8(%rbp)
movq -0x10(%rbp), %rax
movq -0xc0(%rbp), %rcx
movq %rcx, (%rax)
movq -0xb8(%rbp), %rcx
movq %rcx, 0x8(%rax)
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xc0, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: ksherlock[P]wdc-utils/afp/src/finder_info.cpp
// Function: (anonymous namespace)::hex(unsigned char)
int hex(uint8_t c)
	{
		if (c >= '0' && c <= '9') return c - '0';
		if (c >= 'a' && c <= 'f') return c + 10 - 'a';
		if (c >= 'A' && c <= 'F') return c + 10 - 'A';
		return 0;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %dil, %al
movb %al, -0x5(%rbp)
movzbl -0x5(%rbp), %eax
cmpl $0x30, %eax
jl 0x29df8
movzbl -0x5(%rbp), %eax
cmpl $0x39, %eax
jg 0x29df8
movzbl -0x5(%rbp), %eax
subl $0x30, %eax
movl %eax, -0x4(%rbp)
jmp 0x29e41
movzbl -0x5(%rbp), %eax
cmpl $0x61, %eax
jl 0x29e19
movzbl -0x5(%rbp), %eax
cmpl $0x66, %eax
jg 0x29e19
movzbl -0x5(%rbp), %eax
addl $0xa, %eax
subl $0x61, %eax
movl %eax, -0x4(%rbp)
jmp 0x29e41
movzbl -0x5(%rbp), %eax
cmpl $0x41, %eax
jl 0x29e3a
movzbl -0x5(%rbp), %eax
cmpl $0x46, %eax
jg 0x29e3a
movzbl -0x5(%rbp), %eax
addl $0xa, %eax
subl $0x41, %eax
movl %eax, -0x4(%rbp)
jmp 0x29e41
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_cpp_makefile_star2_O1/davidjosepha[P]slitherlink/src/shared/contour.cpp
// Function: Contour::Contour(int, int, int, int)
Contour::Contour(int starti, int startj, int endi, int endj) {
    start_.i = starti;
    start_.j = startj;
    end_.i = endi;
    end_.j = endj;
    length_ = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb $0x0, 0x4(%rdi)
movl %esi, 0x8(%rdi)
movl %edx, 0xc(%rdi)
movl %ecx, 0x10(%rdi)
movl %r8d, 0x14(%rdi)
movl $0x1, (%rdi)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/davidjosepha[P]slitherlink/src/shared/contour.cpp
// Function: Contour::sharesEndpoint(Contour const&) const
bool Contour::sharesEndpoint(Contour const & contour) const {
    return ((start_.i == contour.start_.i && start_.j == contour.start_.j) ||
            (start_.i == contour.end_.i && start_.j == contour.end_.j) ||
            (end_.i == contour.start_.i && end_.j == contour.start_.j) ||
            (end_.i == contour.end_.i && end_.j == contour.end_.j));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x8(%rdi), %r8d
movl 0x8(%rsi), %ecx
cmpl %ecx, %r8d
jne 0x2564
movl 0xc(%rdi), %edx
movb $0x1, %al
cmpl 0xc(%rsi), %edx
je 0x259d
movl 0x10(%rsi), %edx
cmpl %edx, %r8d
jne 0x2578
movl 0xc(%rdi), %r8d
movb $0x1, %al
cmpl 0x14(%rsi), %r8d
je 0x259d
movl 0x10(%rdi), %r8d
cmpl %ecx, %r8d
jne 0x258b
movl 0x14(%rdi), %ecx
movb $0x1, %al
cmpl 0xc(%rsi), %ecx
je 0x259d
cmpl %edx, %r8d
jne 0x259b
movl 0x14(%rdi), %eax
cmpl 0x14(%rsi), %eax
sete %al
jmp 0x259d
xorl %eax, %eax
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/davidjosepha[P]slitherlink/src/shared/contour.cpp
// Function: Contour::addContour(Contour&)
void Contour::addContour(Contour & contour) {
    if (start_.i == contour.start_.i && start_.j == contour.start_.j) {
        start_.i = contour.end_.i;
        start_.j = contour.end_.j;
        length_++;
    } else if (start_.i == contour.end_.i && start_.j == contour.end_.j) {
        start_.i = contour.start_.i;
        start_.j = contour.start_.j;
        length_++;
    } else if (end_.i == contour.start_.i && end_.j == contour.start_.j) {
        end_.i = contour.end_.i;
        end_.j = contour.end_.j;
        length_++;
    } else if (end_.i == contour.end_.i && end_.j == contour.end_.j) {
        end_.i = contour.start_.i;
        end_.j = contour.start_.j;
        length_++;
    }

    if (start_.i == end_.i && start_.j == end_.j) {
        closed_ = true;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x8(%rdi), %ecx
movl 0x8(%rsi), %eax
cmpl %eax, %ecx
jne 0x25c2
movl 0xc(%rdi), %edx
cmpl 0xc(%rsi), %edx
jne 0x25c2
leaq 0xc(%rdi), %rcx
movl 0x10(%rsi), %eax
movl %eax, 0x8(%rdi)
jmp 0x25f2
movl 0x10(%rsi), %edx
cmpl %edx, %ecx
jne 0x25da
movl 0xc(%rdi), %ecx
cmpl 0x14(%rsi), %ecx
jne 0x25da
leaq 0xc(%rdi), %rcx
movl %eax, 0x8(%rdi)
jmp 0x260c
movl 0x10(%rdi), %ecx
cmpl %eax, %ecx
jne 0x25f9
movl 0x14(%rdi), %r8d
cmpl 0xc(%rsi), %r8d
jne 0x25f9
leaq 0x14(%rdi), %rcx
movl %edx, 0x10(%rdi)
movl $0x14, %eax
jmp 0x2611
cmpl %edx, %ecx
jne 0x2618
movl 0x14(%rdi), %ecx
cmpl 0x14(%rsi), %ecx
jne 0x2618
leaq 0x14(%rdi), %rcx
movl %eax, 0x10(%rdi)
movl $0xc, %eax
movl (%rsi,%rax), %eax
movl %eax, (%rcx)
incl (%rdi)
movl 0x8(%rdi), %eax
cmpl 0x10(%rdi), %eax
jne 0x262c
movl 0xc(%rdi), %eax
cmpl 0x14(%rdi), %eax
jne 0x262c
movb $0x1, 0x4(%rdi)
popq %rbp
retq
nop