LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/file-unix.cpp
// Function: (anonymous namespace)::file_unix::mmap(bool, unsigned long, unsigned long)
arrayvieww<uint8_t> mmap(bool writable, size_t start, size_t len)
		{
			//TODO: for small things (64KB? 1MB?), use malloc, it's faster
			//http://lkml.iu.edu/hypermail/linux/kernel/0004.0/0728.html
			size_t offset = start % pagesize;
			void* data = ::mmap(NULL, len+offset, writable ? PROT_WRITE|PROT_READ : PROT_READ, MAP_SHARED, this->fd, start-offset);
			if (data == MAP_FAILED) return NULL;
			return arrayvieww<uint8_t>((uint8_t*)data+offset, len);
		}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %r8, %r14
movq %rcx, %r9
movq %rdi, %rbx
movl %r9d, %r15d
andl $0xfff, %r15d           # imm = 0xFFF
leaq (%r15,%r8), %rax
leal 0x1(,%rdx,2), %edx
movl 0x8(%rsi), %r8d
andq $-0x1000, %r9           # imm = 0xF000
pushq $0x1
popq %rcx
xorl %edi, %edi
movq %rax, %rsi
callq 0x3680
cmpq $-0x1, %rax
je 0x7fe7
addq %r15, %rax
movq %rax, (%rbx)
movq %r14, 0x8(%rbx)
jmp 0x7fed
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/string.h
// Function: cstring::c_string::c_string(arrayview<unsigned char>, bool)
c_string(arrayview<uint8_t> data, bool has_term)
		{
			if (has_term)
			{
				ptr = (char*)data.ptr();
				do_free = false;
			}
			else
			{
				ptr = (char*)xmalloc(data.size()+1);
				memcpy(ptr, data.ptr(), data.size());
				ptr[data.size()] = '\0';
				do_free = true;
			}
		}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
testl %ecx, %ecx
je 0x808c
movq %r15, (%rbx)
xorl %eax, %eax
jmp 0x80b3
movq %rdx, %r14
leaq 0x1(%rdx), %rdi
callq 0x11544
movq %rax, (%rbx)
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3280
movq (%rbx), %rax
movb $0x0, (%rax,%r14)
movb $0x1, %al
movb %al, 0x8(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/file.h
// Function: file::impl::readall()
virtual array<uint8_t> readall()
		{
			array<uint8_t> ret;
			ret.reserve_noinit(this->size());
			size_t actual = this->pread(ret, 0);
			ret.resize(actual);
			return ret;
		}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq (%rsi), %rax
movq %rsi, %rdi
callq *(%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0xb9fa
movq (%rbx), %rax
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq 0x8(%rbx), %rax
movq %rax, 0x8(%rsi)
movq (%r14), %rax
movq %r14, %rdi
xorl %edx, %edx
callq *0x10(%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0xbaee
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/file.cpp
// Function: file::impl::default_mmapw(unsigned long, unsigned long)
arrayvieww<uint8_t> file::impl::default_mmapw(size_t start, size_t len)
{
	uint8_t* ptr = xmalloc(sizeof(size_t) + len);
	*(size_t*)ptr = start;
	
	arrayvieww<uint8_t> ret(ptr+sizeof(size_t), len);
	size_t actual = this->pread(ret, start);
	return ret.slice(0, actual);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x8(%rcx), %rdi
callq 0x11544
movq %rax, %r13
movq %r14, (%rax)
addq $0x8, %r13
movq %rsp, %rsi
movq %r13, (%rsi)
movq %rbx, 0x8(%rsi)
movq (%r15), %rax
movq %r15, %rdi
movq %r14, %rdx
callq *0x10(%rax)
movq %r13, (%r12)
movq %rax, 0x8(%r12)
movq %r12, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/file.cpp
// Function: file::resolve(cstring)
string file::resolve(cstring path)
{
	array<cstring> parts = path.csplit("/");
	for (size_t i=0;i<parts.size();i++)
	{
		if (parts[i] == "" && i>0 && parts[i-1] != "")
		{
			parts.remove(i);
			i--;
			continue;
		}
		
		if (parts[i] == ".")
		{
			parts.remove(i);
			i--;
			continue;
		}
		
		if (parts[i] == ".." && i>0 && parts[i-1] != "..")
		{
			parts.remove(i);
			if (i>0) parts.remove(i-1);
			i-=2;
			continue;
		}
	}
	if (!parts) return ".";
	return parts.join("/");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
leaq 0x28(%rsp), %r15
movq %rsi, (%r15)
movq %rdx, 0x8(%r15)
leaq 0x20d02(%rip), %rsi     # 0x28f60
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x42ce
movq (%r14), %rdx
movq 0x8(%r14), %rcx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x86aa
xorl %r12d, %r12d
leaq 0x2314d(%rip), %r15     # 0x2b3d9
movq 0x10(%rsp), %rax
cmpq %rax, %r12
jae 0x8372
movq 0x8(%rsp), %rdi
movq %r12, %rbp
shlq $0x4, %rbp
movb 0xf(%rdi,%rbp), %al
cmpb $0xf, %al
jne 0x82de
testq %r12, %r12
je 0x82e6
leaq -0x1(%r12), %r13
movq %r13, %rax
shlq $0x4, %rax
addq %rax, %rdi
movq %r15, %rsi
callq 0x41ee
testb %al, %al
je 0x82eb
movq %r14, %rdi
movq %r12, %rsi
callq 0xed00
jmp 0x8367
testq %r12, %r12
setne %cl
jmp 0x82f6
xorl %r13d, %r13d
jmp 0x8367
movq 0x8(%rsp), %rdi
movb 0xf(%rdi,%rbp), %al
movb $0x1, %cl
addq %rdi, %rbp
cmpb $0xd, %al
je 0x831b
movzbl %al, %eax
cmpl $0xe, %eax
jne 0x8364
cmpb $0x2e, (%rbp)
jne 0x8364
movq %r14, %rdi
movq %r12, %rsi
callq 0xed00
decq %r12
jmp 0x8364
cmpw $0x2e2e, (%rbp)         # imm = 0x2E2E
setne %al
xorb $0x1, %cl
orb %al, %cl
jne 0x8364
leaq -0x1(%r12), %rbp
movq %rbp, %rax
shlq $0x4, %rax
addq %rax, %rdi
leaq 0x22d30(%rip), %rsi     # 0x2b071
callq 0x41ee
testb %al, %al
je 0x8364
movq %r14, %rdi
movq %r12, %rsi
callq 0xed00
movq %r14, %rdi
movq %rbp, %rsi
callq 0xed00
addq $-0x2, %r12
movq %r12, %r13
incq %r13
movq %r13, %r12
jmp 0x828c
testq %rax, %rax
je 0x838d
leaq 0x20be2(%rip), %rdx     # 0x28f60
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x86bc
jmp 0x839c
leaq 0x22cde(%rip), %rsi     # 0x2b072
movq %rbx, %rdi
callq 0x4242
movq 0x8(%rsp), %rdi
callq 0x3430
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/file.cpp
// Function: file::change_ext(cstring, cstring)
string file::change_ext(cstring path, cstring new_ext)
{
	array<cstring> dir_name = path.crspliti<1>("/");
	if (dir_name.size() == 1)
		return dir_name[0].crsplit<1>(".")[0] + new_ext;
	else
		return dir_name[0] + dir_name[1].crsplit<1>(".")[0] + new_ext;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %r8, %r14
movq %rcx, %r15
movq %rdi, %rbx
leaq 0x68(%rsp), %r12
movq %rsi, (%r12)
movq %rdx, 0x8(%r12)
leaq 0x20b7c(%rip), %rsi     # 0x28f60
leaq 0x58(%rsp), %r13
movq %r13, %rdi
callq 0x42ce
movq (%r13), %rdx
movq 0x8(%r13), %rcx
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x873c
cmpq $0x1, 0x8(%r13)
jne 0x8460
movq 0x8(%rsp), %r12
leaq 0x22c56(%rip), %rsi     # 0x2b072
leaq 0x48(%rsp), %r13
movq %r13, %rdi
callq 0x42ce
movq (%r13), %rdx
movq 0x8(%r13), %rcx
leaq 0x18(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x874e
movq (%r13), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %rbx, %rdi
movq %r15, %rcx
movq %r14, %r8
callq 0x5f1a
movq (%r13), %rdi
jmp 0x84db
movq 0x8(%rsp), %r12
movq (%r12), %r13
movq 0x8(%r12), %rbp
addq $0x10, %r12
leaq 0x22bf9(%rip), %rsi     # 0x2b072
movq %r14, (%rsp)
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0x42ce
movq (%r14), %rdx
movq 0x8(%r14), %rcx
leaq 0x38(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x874e
movq (%r14), %rax
movq (%rax), %rcx
movq 0x8(%rax), %r8
leaq 0x18(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x5f1a
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq (%rsp), %rcx
callq 0x5eb2
movq %r12, %rdi
callq 0x56b4
movq (%r14), %rdi
callq 0x3430
movq 0x8(%rsp), %rdi
callq 0x3430
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/file.cpp
// Function: file::sanitize_rel_path(string)
string file::sanitize_rel_path(string path)
{
	// this one currently leaves consecutive slashes alone
	// this means sanitized filename inequality does not mean they point to different files,
	//  but case insensitive FS means that already so no harm done
again:
	uint8_t * start = path.bytes().ptr();
	uint8_t * end = start + path.length();
	uint8_t * iter = start;
	
	size_t ndot = 0; // 0 - none seen, just after a slash; 1, 2 - obvious; 3+ - either 3+ seen, or a non-dot
	while (iter < end)
	{
		uint8_t& byte = *iter;
#ifdef _WIN32
		if (byte == '\\') byte = '/';
		if (byte == ':') byte = '_'; // no NTFS ADS allowed, nor C:/
#endif
		if (byte < ' ' || byte == '\x7F') byte = '_';
		
		if (byte == '/')
		{
			if (UNLIKELY(ndot == 1 || ndot == 2))
			{
				if (iter == start+1)
				{
					path = path.substr(2, ~0);
					goto again;
				}
				iter[-1] = '_';
			}
			ndot = 0;
		}
		else if (byte == '.') ndot++;
		else ndot = 3;
		
		if (byte >= 0x80)
		{
			uint32_t index = iter-start;
			uint32_t cp = path.codepoint_at(index);
			if (cp >= 0xDC80 && cp <= 0xDCFF) byte = '_';
			iter = start+index;
		}
		else iter++;
	}
	
	if (UNLIKELY(ndot == 1 || ndot == 2))
		iter[-1] = '_';
	
	if (path[0] == '/') path[0] = '_';
	if (!path) return "_";
	return path;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbp
movq %rdi, %rbx
pushq $0x3
popq %r13
movzbl 0xf(%rbp), %eax
testb %al, %al
js 0x8521
xorl $0xf, %eax
movq %rbp, %r14
jmp 0x8528
movq (%rbp), %r14
movl 0x8(%rbp), %eax
movl %eax, %r12d
xorl %eax, %eax
xorl %r15d, %r15d
cmpq %r12, %r15
jge 0x85d9
movzbl (%r14,%r15), %ecx
cmpl $0x7f, %ecx
setne %dl
cmpl $0x20, %ecx
setae %sil
testb %dl, %sil
jne 0x855a
movb $0x5f, (%r14,%r15)
movq %r13, %rax
jmp 0x857d
cmpl $0x2e, %ecx
je 0x8571
cmpl $0x2f, %ecx
jne 0x8576
decq %rax
cmpq $0x1, %rax
jbe 0x85ad
xorl %eax, %eax
jmp 0x857d
incq %rax
jmp 0x857d
movq %r13, %rax
testb %cl, %cl
js 0x8582
incq %r15
jmp 0x8530
movl %r15d, 0x4(%rsp)
movq %rbp, %rdi
leaq 0x4(%rsp), %rsi
callq 0x15b7e
andl $-0x80, %eax
cmpl $0xdc80, %eax           # imm = 0xDC80
jne 0x85a3
movb $0x5f, (%r14,%r15)
movl 0x4(%rsp), %r15d
movq %r13, %rax
jmp 0x8530
cmpq $0x1, %r15
je 0x85bb
movb $0x5f, -0x1(%r14,%r15)
jmp 0x856d
movq %rbp, %rdi
pushq $0x2
popq %rsi
pushq $-0x1
popq %rdx
callq 0x55aa
movq %rbp, %rdi
movq %rax, %rsi
callq 0x5682
jmp 0x8511
decq %rax
cmpq $0x1, %rax
jbe 0x863f
movb 0xf(%rbp), %al
movq %rbp, %rcx
testb %al, %al
jns 0x85f0
movq (%rbp), %rcx
cmpb $0x2f, (%rcx)
jne 0x85fb
movb $0x5f, (%rcx)
movb 0xf(%rbp), %al
testb %al, %al
jns 0x8604
movl 0x8(%rbp), %eax
jmp 0x8609
xorb $0xf, %al
movzbl %al, %eax
testl %eax, %eax
je 0x861e
movups (%rbp), %xmm0
movups %xmm0, (%rbx)
movb $0xf, 0xf(%rbp)
movb $0x0, (%rbp)
jmp 0x862d
leaq 0x1fe9f(%rip), %rsi     # 0x284c4
movq %rbx, %rdi
callq 0x4242
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x5f, -0x1(%r14,%r15)
jmp 0x85e2
nop
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/file.cpp
// Function: file2::resize(long, arrayview<unsigned char>&, bool)
bool file2::resize(off_t newsize, bytesr& map, bool writable)
{
	mmap_t::unmap(map);
	if (!resize(newsize)) return false;
	mmap_t::map(map, *this, writable);
	return (map.size() != 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq %rdx, %rdi
callq 0x7ea0
movq %r14, %rdi
movq %r15, %rsi
callq 0x8760
testb %al, %al
je 0x869c
movzbl %bpl, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7e44
cmpq $0x0, 0x8(%rbx)
setne %al
jmp 0x869e
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/array.h
// Function: decltype(decltype(__declval<cstring>(0)) std::declval<cstring>()() + std::declval<cstring>()) arrayview<cstring>::join<char const*>(cstring) const
decltype(std::declval<T>() + std::declval<T2>()) join(T2 between) const
	{
		if (!this->count) return decltype(T() + T2())();
		
		decltype(T() + T2()) out = this->items[0];
		for (size_t n=1;n < this->count;n++)
		{
			out += between;
			out += this->items[n];
		}
		return out;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
cmpq $0x0, 0x8(%rsi)
je 0x8723
movq %rdx, %r14
movq %rsi, %r15
movq (%rsi), %rax
movups (%rax), %xmm0
movq %rsp, %rsi
movups %xmm0, (%rsi)
movq %rbx, %rdi
callq 0x14754
pushq $0x1
popq %r12
pushq $0x18
popq %r13
cmpq 0x8(%r15), %r12
jae 0x872a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x426a
movq (%r15), %rax
movq -0x8(%rax,%r13), %rsi
movq (%rax,%r13), %rdx
movq %rbx, %rdi
callq 0x4296
incq %r12
addq $0x10, %r13
jmp 0x86f5
movb $0xf, 0xf(%rbx)
movb $0x0, (%rbx)
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/runloop2.h
// Function: async<void>::then(waiter_base<void>*)
void then(waiter_base<T>* next)
	{
		if (is_complete())
		{
			consume_sync();
			if constexpr (std::is_same_v<T, void>)
				next->complete(next);
			else
				next->complete(next, get_value());
		}
		else
		{
#ifndef ARLIB_OPT
			if (next->prod)
			{
				debug_warn_stack("attempted to assign a producer to an already-busy waiter");
				next->cancel();
			}
#endif
			next->prod = this->prod;
			this->prod->wait = next;
			this->prod = nullptr;
		}
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, 0x8(%rdi)
je 0x8b05
cmpq $0x0, (%rsi)
je 0x8af0
leaq 0x1faaf(%rip), %rdi     # 0x28586
movq %rsi, %r14
callq 0x6c4d
movq %r14, %rsi
movq (%r14), %rdi
testq %rdi, %rdi
je 0x8af0
callq *0x8(%rdi)
movq %r14, %rsi
movq (%rbx), %rax
movq %rax, (%rsi)
movq %rsi, (%rax)
andq $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq $0x1, 0x8(%rbx)
movq %rsi, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *0x8(%rsi)
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/runloop2.h
// Function: async<void>::~async()
~async()
	{
#ifndef ARLIB_OPT
		if (is_complete() || this->prod)
			debug_fatal_stack("can't discard an async without calling .then()");
#endif
		this->prod = nullptr; // null it out, in case the return value is here (nulling here allows parent's dtor to be optimized out)
	}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x8(%rdi)
je 0x8b2b
cmpq $0x0, (%rbx)
je 0x8b37
leaq 0x1fa8d(%rip), %rdi     # 0x285bf
callq 0x6c65
andq $0x0, (%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/game-x11.cpp
// Function: gameview_x11::step(bool)
void step(bool wait)
{
	got_event = false;
	process_events(); // in case someone else (for example ctx-x11.cpp) did synchronous X calls behind our back
	runloop2::step(false);
	while (wait && !got_event)
		runloop2::step(true);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movb $0x0, 0x1a(%rdi)
callq 0x8c2e
xorl %edi, %edi
callq 0x12699
testl %ebp, %ebp
je 0x8bdc
pushq $0x1
popq %rbp
cmpb $0x0, 0x1a(%rbx)
jne 0x8bdc
movl %ebp, %edi
callq 0x12699
jmp 0x8bcd
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/game-x11.cpp
// Function: gameview_x11::process_events()
void process_events()
{
	while (XPending(window_x11.display))
	{
		XEvent ev;
		XNextEvent(window_x11.display, &ev);
		if (ev.xany.window == this->window)
			this->process_event(&ev);
	}
	
	runloop2::await_read(ConnectionNumber(window_x11.display)).then(&wait);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xc8, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %r14
movq 0x38701(%rip), %rdi     # 0x41348
callq 0x32e0
testl %eax, %eax
je 0x8c77
movq 0x386f1(%rip), %rdi     # 0x41348
movq %r14, %rsi
callq 0x34d0
movq 0x28(%rsp), %rax
cmpq 0x10(%rbx), %rax
jne 0x8c40
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8cb0
jmp 0x8c40
movq 0x386ca(%rip), %rax     # 0x41348
movl 0x10(%rax), %esi
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x8aac
addq $0x50, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8abc
movq %r14, %rdi
callq 0x8b1a
addq $0xc8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/game-x11.cpp
// Function: gameview_x11::set_all_keys()
void set_all_keys()
{
	uint8_t state[32];
	XQueryKeymap(display, (char*)state);
	for (int i=0;i<256/8;i++)
	{
		if (current_scans[i] == state[i]) continue;
		for (int bit=0;bit<8;bit++)
		{
			set_key((i<<3)|bit, state[i] & (1<<bit));
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
movq %rsp, %rsi
callq 0x3460
xorl %r14d, %r14d
xorl %r15d, %r15d
cmpq $0x20, %r15
je 0x8e76
movb 0x278(%rbx,%r15), %al
cmpb (%rsp,%r15), %al
jne 0x8e4b
incq %r15
addl $0x8, %r14d
jmp 0x8e2e
xorl %r12d, %r12d
cmpl $0x8, %r12d
je 0x8e42
leal (%r14,%r12), %eax
movzbl (%rsp,%r15), %ecx
xorl %edx, %edx
btl %r12d, %ecx
setb %dl
movzbl %al, %esi
movq %rbx, %rdi
callq 0x8e82
incl %r12d
jmp 0x8e4e
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/function.h
// Function: function<void ()>::unref()
void unref()
	{
		if (LIKELY(!ref)) return;
		if (!--ref->count)
		{
			ref->destruct(ctx);
			delete ref;
		}
		ref = NULL;
	}

// Assembly:
movq 0x10(%rdi), %rax
testq %rax, %rax
jne 0x8f46
retq
pushq %rbx
movq %rdi, %rbx
decq (%rax)
jne 0x8f61
movq (%rbx), %rdi
callq *0x8(%rax)
movq 0x10(%rbx), %rdi
pushq $0x10
popq %rsi
callq 0x3370
andq $0x0, 0x10(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/game-x11.cpp
// Function: gameview_x11::global_init()
static void global_init()
{
	if (window_x11.display) return;
	
	window_x11.display = XOpenDisplay(NULL);
	if (!window_x11.display)
	{
		perror("XOpenDisplay");
		exit(1);
	}
	window_x11.screen = DefaultScreen(window_x11.display);
	
	XkbSetDetectableAutoRepeat(window_x11.display, true, NULL);
	
	// this may be useful on Solaris, but I can't find any trace of it doing anything anywhere else
	// https://bugzilla.gnome.org/show_bug.cgi?id=76681
	//if (!XAddConnectionWatch(display,
	//	[](Display* display, char* g_userdata, int fd, Bool opening, char* * l_userdata) {
	//		printf("connwatch: %d %d\n",fd,opening);
	//		if (opening) runloop::global()->set_fd(fd, [](uintptr_t fd){ XProcessInternalConnection(display, fd); });
	//		else runloop::global()->set_fd(fd, NULL);
	//	}, NULL)) abort();
}

// Assembly:
pushq %rax
cmpq $0x0, 0x38317(%rip)     # 0x41348
je 0x9035
popq %rax
retq
xorl %edi, %edi
callq 0x34a0
movq %rax, 0x38305(%rip)     # 0x41348
testq %rax, %rax
je 0x9062
movl 0xe0(%rax), %ecx
movl %ecx, 0x382fc(%rip)     # 0x41350
pushq $0x1
popq %rsi
movq %rax, %rdi
xorl %edx, %edx
popq %rax
jmp 0x3690
leaq 0x1f585(%rip), %rdi     # 0x285ee
callq 0x3290
pushq $0x1
popq %rdi
callq 0x3440
nop
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/image-png-decode.cpp
// Function: oimage::init_decode_png(arrayview<unsigned char>)::pngreader::chunk_raw()
pngchunk chunk_raw()
		{
			pngchunk ret;
			ret.type = 0; // invalid value, looks like an unrecognized critical chunk and will propagate outwards
			
			if (remaining() < 12) return ret;
			ret.len = u32b();
			
			if (ret.len >= 0x80000000 || remaining()-8 < ret.len) return ret;
			
			uint32_t crc32_actual = crc32(peekbytes(4+ret.len));
			
			ret.type = u32b();
			ret.init(bytes(ret.len));
			
			uint32_t crc32_exp = u32b();
			if (crc32_actual != crc32_exp) ret.type = 0;
			
			return ret;
		}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0xc(%rdi)
movups %xmm0, (%rdi)
movq 0x8(%rsi), %rcx
movq 0x10(%rsi), %rax
movq %rax, %rdx
subq %rcx, %rdx
cmpq $0xc, %rdx
jb 0x9940
movq %rsi, %r14
leaq 0x4(%rcx), %rdi
movq %rdi, 0x8(%rsi)
movl (%rcx), %esi
bswapl %esi
movl %esi, 0x1c(%rbx)
testl %esi, %esi
js 0x9940
subq %rdi, %rax
addq $-0x8, %rax
movl %esi, %r15d
cmpq %r15, %rax
jb 0x9940
addl $0x4, %esi
xorl %edx, %edx
callq 0x646c
movq 0x8(%r14), %rcx
leaq 0x4(%rcx), %rdx
movq %rdx, 0x8(%r14)
movl (%rcx), %esi
bswapl %esi
movl %esi, 0x18(%rbx)
leaq 0x4(%rcx,%r15), %rsi
movq %rdx, (%rbx)
movq %rdx, 0x8(%rbx)
movq %rsi, 0x10(%rbx)
leaq 0x8(%rcx,%r15), %rcx
movq %rcx, 0x8(%r14)
movl -0x4(%rcx), %ecx
bswapl %ecx
cmpl %ecx, %eax
je 0x9940
andl $0x0, 0x18(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/image-png-decode.cpp
// Function: void image::png_unpack_rgb<6>(unsigned char const*, unsigned long) const
void image::png_unpack_rgb(const uint8_t * source, size_t srcstride) const
{
	uint32_t * pixels = this->pixels32;
	uint32_t width = this->width;
	uint32_t height = this->height;
	
	size_t nsamp;
	if (color_type == 0) nsamp = 1; // gray
	if (color_type == 2) nsamp = 3; // rgb
	if (color_type == 4) nsamp = 2; // gray+alpha
	if (color_type == 6) nsamp = 4; // rgba
	
	for (uint32_t y=0;y<height;y++)
	{
		uint32_t x = 0;
		if (color_type == 2)
		{
			image::convert_scanline<ifmt_rgb888_by, ifmt_bargb8888>(pixels, source, width);
			x = width;
		}
		
#ifdef __SSE2__
		if (color_type == 6)
		{
			while (x+3 < width)
			{
				const uint8_t * sourceat = source + x*nsamp;
				__m128i rgba = _mm_loadu_si128((__m128i*)sourceat);
				__m128i _g_a = _mm_and_si128(rgba, _mm_set1_epi32(0xFF00FF00));
				__m128i bxgx = _mm_shufflehi_epi16(_mm_shufflelo_epi16(rgba, _MM_SHUFFLE(2,3,0,1)), _MM_SHUFFLE(2,3,0,1));
				__m128i bgra = _mm_or_si128(_g_a, _mm_and_si128(bxgx, _mm_set1_epi32(0x00FF00FF)));
				_mm_storeu_si128((__m128i*)(pixels+x), bgra);
				x += 4;
			}
		}
		SIMD_LOOP_TAIL
#endif
		
		while (x < width)
		{
			const uint8_t * sourceat = source + x*nsamp;
			
			if (color_type == 0)
				pixels[x] = 0xFF000000 | sourceat[0]*0x010101;
			// type 2 fully handled above
			if (color_type == 4)
				pixels[x] = (uint32_t)sourceat[1]<<24 | sourceat[0]*0x010101;
			if (color_type == 6)
				pixels[x] = (uint32_t)sourceat[3]<<24 | sourceat[0]<<16 | sourceat[1]<<8 | sourceat[2]<<0;
			x++;
		}
		
		pixels += width;
		source += srcstride;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movq 0x10(%rdi), %rax
movl (%rdi), %ecx
movl 0x4(%rdi), %edi
leaq (,%rcx,4), %r8
leaq 0x3(%rsi), %r9
xorl %r10d, %r10d
movdqa 0x1e7d0(%rip), %xmm0    # 0x288d0
cmpl %edi, %r10d
je 0xa199
movq %r9, %r11
movq %rax, %rbx
xorl %r14d, %r14d
leaq 0x3(%r14), %r15
cmpq %rcx, %r15
jae 0xa183
movdqu (%rsi,%r14,4), %xmm1
pshuflw $0xb1, %xmm1, %xmm2     # xmm2 = xmm1[1,0,3,2,4,5,6,7]
pshufhw $0xb1, %xmm2, %xmm2     # xmm2 = xmm2[0,1,2,3,5,4,7,6]
movdqa %xmm0, %xmm3
pandn %xmm1, %xmm3
pand %xmm0, %xmm2
por %xmm3, %xmm2
movdqu %xmm2, (%rax,%r14,4)
addq $0x4, %r14
addq $0x10, %rbx
addq $0x10, %r11
jmp 0xa112
movzbl (%r11), %ebp
shll $0x18, %ebp
movzbl -0x3(%r11), %r15d
shll $0x10, %r15d
orl %ebp, %r15d
movzbl -0x2(%r11), %ebp
shll $0x8, %ebp
orl %r15d, %ebp
movzbl -0x1(%r11), %r15d
orl %ebp, %r15d
movl %r15d, (%rbx)
incq %r14
addq $0x4, %rbx
addq $0x4, %r11
cmpq %rcx, %r14
jb 0xa14f
addq %rdx, %rsi
incl %r10d
addq %r8, %rax
addq %rdx, %r9
jmp 0xa100
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/image.cpp
// Function: oimage::init_new(unsigned int, unsigned int, imagefmt)
void oimage::init_new(uint32_t width, uint32_t height, imagefmt fmt)
{
	size_t stride = byteperpix(fmt)*width;
	size_t nbytes = stride*height;
	storage = xmalloc(nbytes);
	init_ptr(storage, width, height, stride, fmt);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebx
movl %edx, %ebp
movl %esi, %r15d
movq %rdi, %r14
leal (%rbx,%rbx), %ecx
movl $0x157fff8, %r12d       # imm = 0x157FFF8
shrl %cl, %r12d
andl $0x3, %r12d
incl %r12d
imull %esi, %r12d
movl %edx, %edi
imulq %r12, %rdi
callq 0x11544
leaq 0x18(%r14), %rdi
movq %rax, %rsi
callq 0x9d30
movq 0x18(%r14), %rax
movq %rax, 0x10(%r14)
movl %r15d, (%r14)
movl %ebp, 0x4(%r14)
movl %r12d, 0xc(%r14)
movl %ebx, 0x8(%r14)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/image.cpp
// Function: image::insert(int, int, image const&)
void image::insert(int32_t x, int32_t y, const image& other)
{
	if (UNLIKELY(x < 0 || y < 0 || x+other.width > width || y+other.height > height))
	{
		struct image part;
		part.init_ref(other);
		if (x < 0)
		{
			part.pixels8 = part.pixels8 + (-x)*byteperpix(part.fmt);
			if ((uint32_t)-x >= part.width) return;
			part.width -= -x;
			x = 0;
		}
		if (y < 0)
		{
			part.pixels8 = part.pixels8 + (-y)*part.stride;
			if ((uint32_t)-y >= part.height) return;
			part.height -= -y;
			y = 0;
		}
		if (x+part.width > width)
		{
			if ((uint32_t)x >= width) return;
			part.width = width-x;
		}
		if (y+part.height > height)
		{
			if ((uint32_t)y >= height) return;
			part.height = height-y;
		}
		image_insert_noov(*this, x, y, part);
	}
	else
	{
		image_insert_noov(*this, x, y, other);
	}
}

// Assembly:
movl %edx, %eax
orl %esi, %eax
movl (%rcx), %r8d
js 0xa220
leal (%r8,%rsi), %eax
cmpl (%rdi), %eax
ja 0xa220
movl 0x4(%rcx), %eax
addl %edx, %eax
cmpl 0x4(%rdi), %eax
ja 0xa220
jmp 0xa2d6
pushq %rbx
subq $0x20, %rsp
movl %r8d, 0x8(%rsp)
movl 0x4(%rcx), %r9d
movl %r9d, 0xc(%rsp)
movl 0x8(%rcx), %eax
movl %eax, 0x10(%rsp)
movl 0xc(%rcx), %r10d
movl %r10d, 0x14(%rsp)
movq 0x10(%rcx), %r11
movq %r11, 0x18(%rsp)
testl %esi, %esi
jns 0xa27e
addl %eax, %eax
movl $0x157fff8, %ebx        # imm = 0x157FFF8
movl %eax, %ecx
shrl %cl, %ebx
movl %esi, %eax
negl %eax
notl %ebx
orl $-0x4, %ebx
imull %esi, %ebx
addq %rbx, %r11
movq %r11, 0x18(%rsp)
cmpl %eax, %r8d
jbe 0xa2d0
addl %esi, %r8d
movl %r8d, 0x8(%rsp)
xorl %esi, %esi
testl %edx, %edx
jns 0xa2a1
movl %edx, %eax
negl %eax
imull %eax, %r10d
addq %r10, %r11
movq %r11, 0x18(%rsp)
cmpl %eax, %r9d
jbe 0xa2d0
addl %edx, %r9d
movl %r9d, 0xc(%rsp)
xorl %edx, %edx
addl %esi, %r8d
movl (%rdi), %eax
cmpl %eax, %r8d
jbe 0xa2b3
subl %esi, %eax
jbe 0xa2d0
movl %eax, 0x8(%rsp)
addl %edx, %r9d
movl 0x4(%rdi), %eax
cmpl %eax, %r9d
jbe 0xa2c6
subl %edx, %eax
jbe 0xa2d0
movl %eax, 0xc(%rsp)
leaq 0x8(%rsp), %rcx
callq 0xa2d6
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/image.cpp
// Function: image::insert_tile(int, int, unsigned int, unsigned int, image const&)
void image::insert_tile(int32_t x, int32_t y, uint32_t width, uint32_t height, const image& other)
{
	uint32_t yy = 0;
	if (height >= other.height)
	{
		for (yy = 0; yy < height-other.height; yy += other.height)
		{
			image_insert_tile_row(*this, x, y+yy, width, other.height, other);
		}
	}
	
	if (yy < height)
	{
		image_insert_tile_row(*this, x, y+yy, width, height-yy, other);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movl %r8d, %ebp
movl %ecx, 0x4(%rsp)
movl %edx, %r12d
movl %esi, %r15d
movq %rdi, %r13
movl 0x4(%r9), %r8d
xorl %r14d, %r14d
cmpl %ebp, %r8d
jbe 0xa7f7
subl %r14d, %ebp
jbe 0xa823
addl %r12d, %r14d
movq %r13, %rdi
movl %r15d, %esi
movl %r14d, %edx
movl 0x4(%rsp), %ecx
movl %ebp, %r8d
movq %rbx, %r9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa832
xorl %r14d, %r14d
movl %ebp, %eax
subl %r8d, %eax
cmpl %eax, %r14d
jae 0xa7cc
leal (%r14,%r12), %edx
movq %r13, %rdi
movl %r15d, %esi
movl 0x4(%rsp), %ecx
movq %rbx, %r9
callq 0xa832
movl 0x4(%rbx), %r8d
addl %r8d, %r14d
jmp 0xa7fa
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/image.cpp
// Function: image_insert_tile_row(image&, int, int, unsigned int, unsigned int, image const&)
static void image_insert_tile_row(image& target, int32_t x, int32_t y, uint32_t width, uint32_t height, const image& other)
{
	uint32_t xx = 0;
	if (width >= other.width)
	{
		for (xx = 0; xx < width-other.width; xx += other.width)
		{
			target.insert_sub(x+xx, y, other, 0, 0, other.width, height);
		}
	}
	if (xx < width)
	{
		target.insert_sub(x+xx, y, other, 0, 0, width-xx, height);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r15
movq %r8, (%rsp)
movl %ecx, %ebx
movl %edx, %ebp
movl %esi, %r13d
movq %rdi, %r12
movl (%r9), %eax
xorl %r14d, %r14d
cmpl %ecx, %eax
jbe 0xa880
subl %r14d, %ebx
jbe 0xa8b1
addl %r13d, %r14d
movq %r12, %rdi
movl %r14d, %esi
movl %ebp, %edx
movq %r15, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq (%rsp)
pushq %rbx
callq 0xb0f2
addq $0x18, %rsp
jmp 0xa8b5
xorl %r14d, %r14d
movl %ebx, %ecx
subl %eax, %ecx
cmpl %ecx, %r14d
jae 0xa858
leal (%r14,%r13), %esi
movq %r12, %rdi
movl %ebp, %edx
movq %r15, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq (%rsp)
pushq %rax
callq 0xb0f2
popq %rax
popq %rcx
movl (%r15), %eax
addl %eax, %r14d
jmp 0xa883
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/image.cpp
// Function: image::insert_tile(int, int, unsigned int, unsigned int, image const&, int, int)
void image::insert_tile(int32_t x, int32_t y, uint32_t width, uint32_t height,
                        const image& other, int32_t offx, int32_t offy)
{
	if (offx < 0) { offx = -offx; offx %= other.width;  offx = -offx; offx += other.width;  }
	if (offy < 0) { offy = -offy; offy %= other.height; offy = -offy; offx += other.height; }
	if ((uint32_t)offx > other.width)  { offx %= other.width;  }
	if ((uint32_t)offy > other.height) { offy %= other.height; }
	
	if (offy + height <= other.height)
	{
		image_insert_tile_row(*this, x, y, width, height, other, offx, offy);
		return;
	}
	
	if (offy != 0)
	{
		image_insert_tile_row(*this, x, y, width, other.height-offy, other, offx, offy);
		y += other.height-offy;
		height -= other.height-offy;
	}
	
	uint32_t yy = 0;
	if (height >= other.height)
	{
		for (yy = 0; yy < height-other.height; yy += other.height)
		{
			image_insert_tile_row(*this, x, y+yy, width, other.height, other, offx, 0);
		}
	}
	
	if (yy < height)
	{
		image_insert_tile_row(*this, x, y+yy, width, height-yy, other, offx, 0);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movl %r8d, %r14d
movl %ecx, 0x4(%rsp)
movl %edx, %r13d
movl %esi, (%rsp)
movq %rdi, %rbp
movl 0x48(%rsp), %r12d
movl 0x40(%rsp), %r15d
testl %r15d, %r15d
jns 0xa8fe
negl %r15d
movl (%rbx), %ecx
movl %r15d, %eax
xorl %edx, %edx
divl %ecx
subl %edx, %ecx
movl %ecx, %r15d
testl %r12d, %r12d
jns 0xa919
negl %r12d
movl 0x4(%rbx), %ecx
movl %r12d, %eax
xorl %edx, %edx
divl %ecx
movl %edx, %r12d
negl %r12d
addl %ecx, %r15d
movl (%rbx), %ecx
cmpl %ecx, %r15d
jbe 0xa92a
movl %r15d, %eax
xorl %edx, %edx
divl %ecx
movl %edx, %r15d
movl 0x4(%rbx), %r8d
cmpl %r8d, %r12d
jbe 0xa93e
movl %r12d, %eax
xorl %edx, %edx
divl %r8d
movl %edx, %r12d
leal (%r12,%r14), %eax
cmpl %r8d, %eax
jbe 0xa9a1
testl %r12d, %r12d
je 0xa97a
subl %r12d, %r8d
movq %rbp, %rdi
movl (%rsp), %esi
movl %r13d, %edx
movl 0x4(%rsp), %ecx
movq %rbx, %r9
pushq %r12
pushq %r15
callq 0xaa05
popq %rax
popq %rcx
movl 0x4(%rbx), %r8d
movl %r8d, %eax
subl %r12d, %eax
addl %eax, %r13d
subl %eax, %r14d
xorl %r12d, %r12d
cmpl %r8d, %r14d
jae 0xa9c3
subl %r12d, %r14d
jbe 0xa9f6
addl %r13d, %r12d
movq %rbp, %rdi
movl (%rsp), %esi
movl %r12d, %edx
movl 0x4(%rsp), %ecx
movl %r14d, %r8d
movq %rbx, %r9
pushq $0x0
jmp 0xa9b6
movq %rbp, %rdi
movl (%rsp), %esi
movl %r13d, %edx
movl 0x4(%rsp), %ecx
movl %r14d, %r8d
movq %rbx, %r9
pushq %r12
pushq %r15
callq 0xaa05
addq $0x18, %rsp
jmp 0xa9fa
xorl %r12d, %r12d
movl %r14d, %eax
subl %r8d, %eax
cmpl %eax, %r12d
jae 0xa982
leal (%r12,%r13), %edx
movq %rbp, %rdi
movl (%rsp), %esi
movl 0x4(%rsp), %ecx
movq %rbx, %r9
pushq $0x0
pushq %r15
callq 0xaa05
popq %rax
popq %rcx
movl 0x4(%rbx), %r8d
addl %r8d, %r12d
jmp 0xa9c6
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/image.cpp
// Function: image_insert_tile_row(image&, int, int, unsigned int, unsigned int, image const&, unsigned int, unsigned int)
static void image_insert_tile_row(image& target, int32_t x, int32_t y, uint32_t width, uint32_t height,
                                  const image& other, uint32_t offx, uint32_t offy)
{
	if (offx + width <= other.width)
	{
		target.insert_sub(x, y, other, offx, offy, width, height);
		return;
	}
	
	if (offx != 0)
	{
		target.insert_sub(x, y, other, offx, offy, other.width-offx, height);
		x += other.width-offx;
		width -= other.width-offx;
	}
	uint32_t xx = 0;
	if (width >= other.width)
	{
		for (xx = 0; xx < width-other.width; xx += other.width)
		{
			target.insert_sub(x+xx, y, other, 0, offy, other.width, height);
		}
	}
	if (xx < width)
	{
		target.insert_sub(x+xx, y, other, 0, offy, width-xx, height);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r15
movl %r8d, %r10d
movl %ecx, %ebx
movl %esi, %r12d
movl 0x58(%rsp), %r9d
movl 0x50(%rsp), %r14d
leal (%r14,%rbx), %ecx
movl (%r15), %eax
cmpl %eax, %ecx
jbe 0xaaa1
testl %r14d, %r14d
movq %r10, 0x10(%rsp)
movl %edx, %ebp
movq %rdi, %r13
je 0xaa87
subl %r14d, %eax
movq %r13, %rdi
movq %r12, 0x8(%rsp)
movq 0x8(%rsp), %rsi
movl %ebp, %edx
movq %r15, %rcx
movl %r14d, %r8d
pushq %r10
pushq %rax
callq 0xb0f2
movq 0x18(%rsp), %r12
movq %r13, %rdi
movl %ebp, %edx
movl 0x68(%rsp), %r9d
movq 0x20(%rsp), %r10
addq $0x10, %rsp
movl (%r15), %eax
movl %eax, %ecx
subl %r14d, %ecx
addl %ecx, %r12d
subl %ecx, %ebx
xorl %r14d, %r14d
cmpl %eax, %ebx
jae 0xaab8
subl %r14d, %ebx
jbe 0xaafb
addl %r12d, %r14d
movl %r14d, %esi
movq %r15, %rcx
xorl %r8d, %r8d
jmp 0xaaaa
movl %r12d, %esi
movq %r15, %rcx
movl %r14d, %r8d
pushq %r10
pushq %rbx
callq 0xb0f2
addq $0x28, %rsp
jmp 0xaaff
xorl %r14d, %r14d
movl %ebx, %ecx
subl %eax, %ecx
cmpl %ecx, %r14d
jae 0xaa8e
leal (%r14,%r12), %esi
movq %r13, %rdi
movl %ebp, %edx
movq %r15, %rcx
xorl %r8d, %r8d
movl 0x58(%rsp), %r9d
pushq %r10
pushq %rax
callq 0xb0f2
movq %r13, %rdi
movl %ebp, %edx
movl 0x68(%rsp), %r9d
movq 0x20(%rsp), %r10
addq $0x10, %rsp
movl (%r15), %eax
addl %eax, %r14d
jmp 0xaabb
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/image.cpp
// Function: oimage::init_clone(image const&, int, int)
void oimage::init_clone(const image& other, int32_t scalex, int32_t scaley)
{
	init_new(other.width * (scalex<0 ? -scalex : scalex), other.height * (scaley<0 ? -scaley : scaley), other.fmt);
	
	bool flipx = (scalex<0);
	bool flipy = (scaley<0);
	scalex = abs(scalex);
	scaley = abs(scaley);
	
	for (uint32_t sy=0;sy<other.height;sy++)
	{
		int ty = sy*scaley;
		if (flipy) ty = (height-1-sy)*scaley;
		uint32_t* targetpx = this->pixels32 + ty*this->stride/sizeof(uint32_t);
		uint32_t* sourcepx = other.pixels32 + sy*other.stride/sizeof(uint32_t);
		uint32_t* targetpxorg = targetpx;
		
		if (flipx)
		{
			sourcepx += width;
			for (uint32_t sx=0;sx<other.width;sx++)
			{
				sourcepx--;
				for (int32_t xx=0;xx<scalex;xx++)
				{
					*(targetpx++) = *sourcepx;
				}
			}
		}
		else
		{
			for (uint32_t sx=0;sx<other.width;sx++)
			{
				for (int32_t xx=0;xx<scalex;xx++)
				{
					*(targetpx++) = *sourcepx;
				}
				sourcepx++;
			}
		}
		
		for (int32_t yy=1;yy<scaley;yy++)
		{
			memcpy(targetpxorg+yy*stride/sizeof(uint32_t), targetpxorg, sizeof(uint32_t)*width);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movl %edx, %r13d
negl %r13d
movl %edx, 0xc(%rsp)
cmovsl %edx, %r13d
movl (%rsi), %esi
imull %r13d, %esi
movl %ecx, %ebx
negl %ebx
movl %ecx, 0x10(%rsp)
cmovsl %ecx, %ebx
movq %rdi, %r15
movl 0x4(%r14), %edx
imull %ebx, %edx
movl 0x8(%r14), %ecx
callq 0xa1a0
xorl %ecx, %ecx
cmpl 0x4(%r14), %ecx
jae 0xb091
movl %ecx, %r12d
notl %r12d
addl 0x4(%r15), %r12d
cmpl $0x0, 0x10(%rsp)
cmovnsl %ecx, %r12d
imull %ebx, %r12d
imull 0xc(%r15), %r12d
andl $-0x4, %r12d
addq 0x10(%r15), %r12
movl 0xc(%r14), %eax
movl %ecx, 0x14(%rsp)
imull %ecx, %eax
andl $-0x4, %eax
addq 0x10(%r14), %rax
cmpl $0x0, 0xc(%rsp)
js 0xb034
xorl %ecx, %ecx
movq %r12, %rdx
cmpl (%r14), %ecx
jae 0xb05f
movl %r13d, %esi
subl $0x1, %esi
jb 0xb02c
movl (%rax), %edi
movl %edi, (%rdx)
addq $0x4, %rdx
jmp 0xb01d
addq $0x4, %rax
incl %ecx
jmp 0xb015
movl (%r15), %ecx
leaq (%rax,%rcx,4), %rax
xorl %ecx, %ecx
movq %r12, %rdx
cmpl (%r14), %ecx
jae 0xb05f
addq $-0x4, %rax
movl %r13d, %esi
subl $0x1, %esi
jb 0xb05b
movl (%rax), %edi
movl %edi, (%rdx)
addq $0x4, %rdx
jmp 0xb04c
incl %ecx
jmp 0xb040
pushq $0x1
popq %rbp
cmpl %ebx, %ebp
jae 0xb086
movl 0xc(%r15), %edi
imull %ebp, %edi
andl $-0x4, %edi
addq %r12, %rdi
movl (%r15), %edx
shlq $0x2, %rdx
movq %r12, %rsi
callq 0x3280
incl %ebp
jmp 0xb062
movl 0x14(%rsp), %ecx
incl %ecx
jmp 0xafc9
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/image.cpp
// Function: oimage::init_decode_permissive(arrayview<unsigned char>)
bool oimage::init_decode_permissive(arrayview<uint8_t> data)
{
	this->fmt = ifmt_none;
	return
		init_decode(data) ||
		init_decode_extern(data) ||
		false;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
andl $0x0, 0x8(%rdi)
callq 0xb0b8
testb %al, %al
jne 0xb0df
andl $0x0, 0x8(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/image.h
// Function: image::init_ref_sub(image const&, unsigned int, unsigned int, unsigned int, unsigned int)
void init_ref_sub(const image& other, uint32_t x, uint32_t y, uint32_t width, uint32_t height)
	{
		init_ref(other);
		pixels8 += x*byteperpix(fmt) + y*stride;
		this->width = width;
		this->height = height;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r9d, %ebx
movl %r8d, %ebp
movl %ecx, %r14d
movl %edx, %r15d
movq %rdi, %r12
callq 0xb0e2
movb 0x8(%r12), %cl
addb %cl, %cl
movl $0x157fff8, %eax        # imm = 0x157FFF8
shrl %cl, %eax
andl $0x3, %eax
incl %eax
imull %r15d, %eax
imull 0xc(%r12), %r14d
addl %eax, %r14d
addq %r14, 0x10(%r12)
movl %ebp, (%r12)
movl %ebx, 0x4(%r12)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/array.h
// Function: array<string>::clone(arrayview<string> const&)
void clone(const arrayview<T>& other)
	{
		this->count = other.size(); // I can't access non-this instances of my base class, so let's just use the public interface
		this->items = xmalloc(sizeof(T)*capacity_for(this->count));
		if (this->trivial_copy())
		{
			memcpy((void*)this->items, (void*)other.ptr(), sizeof(T)*this->count);
		}
		else
		{
			for (size_t i=0;i<this->count;i++)
			{
				new(&this->items[i]) T(other.ptr()[i]);
			}
		}
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rsi), %rax
movq %rax, 0x8(%rdi)
leaq -0x1(%rax), %rcx
bsrq %rcx, %rcx
pushq $0x20
popq %rdx
shlq %cl, %rdx
cmpq $0x8, %rax
movl $0x80, %edi
cmovaeq %rdx, %rdi
callq 0x11544
movq %rax, (%r14)
xorl %r15d, %r15d
xorl %r12d, %r12d
cmpq 0x8(%r14), %r12
jae 0xf017
movq (%r14), %rdi
addq %r15, %rdi
movq (%rbx), %rsi
addq %r15, %rsi
callq 0x14754
incq %r12
addq $0x10, %r15
jmp 0xeff7
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/array.h
// Function: array<signed char>::swap(unsigned long, unsigned long)
void swap(size_t a, size_t b)
	{
		if (a == b) return;
		
		char tmp[sizeof(T)];
		memcpy(tmp, (void*)(this->items+a), sizeof(T));
		memcpy((void*)(this->items+a), (void*)(this->items+b), sizeof(T));
		memcpy((void*)(this->items+b), tmp, sizeof(T));
	}

// Assembly:
cmpq %rdx, %rsi
je 0xb4f3
movq (%rdi), %rax
movb (%rax,%rsi), %cl
movb (%rax,%rdx), %r8b
movb %r8b, (%rax,%rsi)
movq (%rdi), %rax
movb %cl, (%rax,%rdx)
retq
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/array.h
// Function: array<signed char>::resize_shrink_noinit(unsigned long)
void resize_shrink_noinit(size_t newcount)
	{
		if (this->count <= newcount) return;
		size_t new_bufsize = capacity_for(newcount);
		if (this->count > new_bufsize) this->items = xrealloc(this->items, sizeof(T)*new_bufsize);
		this->count = newcount;
	}

// Assembly:
movq 0x8(%rdi), %rax
cmpq %rsi, %rax
jbe 0xb5a7
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x1(%rsi), %rcx
bsrq %rcx, %rcx
pushq $0x2
popq %rdx
shlq %cl, %rdx
cmpq $0x8, %rsi
pushq $0x8
popq %rsi
cmovaeq %rdx, %rsi
cmpq %rsi, %rax
jbe 0xb59c
movq (%r14), %rdi
callq 0x115b4
movq %rax, (%r14)
movq %rbx, 0x8(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/array.h
// Function: array<signed char>::insert(unsigned long, signed char const&)
T& insert(size_t index, const T& item)
	{
		char tmp[sizeof(T)];
		new(&tmp) T(item);
		
		resize_grow_noinit(this->count+1);
		memmove((void*)(this->items+index+1), (void*)(this->items+index), sizeof(T)*(this->count-1-index));
		memcpy((void*)(&this->items[index]), tmp, sizeof(T));
		return this->items[index];
	}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movb (%rdx), %bpl
movq 0x8(%rdi), %rsi
incq %rsi
callq 0xb4f4
movq (%r14), %rsi
leaq (%rsi,%rbx), %rdi
incq %rdi
addq %rbx, %rsi
movq %rbx, %rdx
notq %rdx
addq 0x8(%r14), %rdx
callq 0x3600
movq (%r14), %rax
movb %bpl, (%rax,%rbx)
addq (%r14), %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/array.h
// Function: array<cstring>::insert(unsigned long)
T& insert(size_t index)
	{
		resize_grow_noinit(this->count+1);
		memmove((void*)(this->items+index+1), (void*)(this->items+index), sizeof(T)*(this->count-1-index));
		new(&this->items[index]) T();
		return this->items[index];
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %rsi
incq %rsi
callq 0xea74
movq (%rbx), %rsi
movq %r14, %r15
shlq $0x4, %r15
leaq (%rsi,%r15), %rdi
addq $0x10, %rdi
addq %r15, %rsi
notq %r14
addq 0x8(%rbx), %r14
shlq $0x4, %r14
movq %r14, %rdx
callq 0x3600
movq (%rbx), %rax
movb $0xf, 0xf(%rax,%r15)
movb $0x0, (%rax,%r15)
addq (%rbx), %r15
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/array.h
// Function: array<string>::operator=(arrayview<string>)
array<T>& operator=(arrayview<T> other)
	{
		if (other.ptr() >= this->ptr() && other.ptr() < this->ptr()+this->size())
		{
			size_t start = other.ptr()-this->ptr();
			size_t len = other.size();
			
			for (size_t i=0;i<start;i++) this->items[i].~T();
			memmove((void*)this->ptr(), (void*)(this->ptr()+start), sizeof(T)*len);
			for (size_t i=start+len;i<this->count;i++) this->items[i].~T();
			
			resize_shrink_noinit(len);
		}
		else
		{
			for (size_t i=0;i<this->count;i++) this->items[i].~T();
			free(this->items);
			clone(other);
		}
		return *this;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq %rsi, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
movq (%rdi), %rax
cmpq %rsi, %rax
ja 0xf562
movq %rsi, %r15
movq 0x8(%rbx), %rcx
shlq $0x4, %rcx
addq %rax, %rcx
cmpq %rsi, %rcx
jbe 0xf562
movq %rdx, %r14
subq %rax, %r15
movq %r15, %r12
sarq $0x4, %r12
xorl %r13d, %r13d
movq %r12, %rbp
movq (%rbx), %rdi
subq $0x1, %rbp
jb 0xf596
addq %r13, %rdi
callq 0x56b4
addq $0x10, %r13
jmp 0xf54b
xorl %r14d, %r14d
xorl %r15d, %r15d
movq (%rbx), %rdi
cmpq 0x8(%rbx), %r15
jae 0xf582
addq %r14, %rdi
callq 0x56b4
incq %r15
addq $0x10, %r14
jmp 0xf568
callq 0x3430
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xefb8
jmp 0xf5d7
addq %rdi, %r15
movq %r14, %rdx
shlq $0x4, %rdx
movq %r15, %rsi
callq 0x3600
addq %r14, %r12
movq %r12, %r15
shlq $0x4, %r15
cmpq 0x8(%rbx), %r12
jae 0xf5cc
movq (%rbx), %rdi
addq %r15, %rdi
callq 0x56b4
incq %r12
addq $0x10, %r15
jmp 0xf5b2
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf0e0
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/array.h
// Function: array<string>::operator+=(arrayview<string>)
array<T>& operator+=(arrayview<T> other)
	{
		size_t prevcount = this->size();
		size_t othercount = other.size();
		
		const T* src;
		T* dst;
		
		if (other.ptr() >= this->ptr() && other.ptr() < this->ptr()+this->size())
		{
			size_t start = other.ptr()-this->ptr();
			
			resize_grow_noinit(prevcount + othercount);
			src = this->items+start;
			dst = this->items+prevcount;
		}
		else
		{
			resize_grow_noinit(prevcount + othercount);
			src = other.ptr();
			dst = this->items+prevcount;
		}
		
		if constexpr (arrayview<T>::trivial_copy())
		{
			memcpy(dst, src, sizeof(T)*othercount);
		}
		else
		{
			for (size_t i=0;i<othercount;i++)
			{
				new(&dst[i]) T(src[i]);
			}
		}
		
		return *this;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq (%rdi), %rax
movq 0x8(%rdi), %rsi
cmpq %r15, %rax
setbe %cl
movq %rsi, %r13
shlq $0x4, %r13
leaq (%rax,%r13), %rdx
cmpq %r15, %rdx
seta %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0xf637
subq %rax, %r15
addq %rbx, %rsi
movq %r14, %rdi
callq 0xf06e
movq (%r14), %r12
addq %r12, %r15
jmp 0xf645
addq %rbx, %rsi
movq %r14, %rdi
callq 0xf06e
movq (%r14), %r12
addq %r13, %r12
subq $0x1, %rbx
jb 0xf663
movq %r12, %rdi
movq %r15, %rsi
callq 0x14754
addq $0x10, %r12
addq $0x10, %r15
jmp 0xf648
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/array.h
// Function: array<short>::create_usurp(arrayvieww<short>)
static array<T> create_usurp(arrayvieww<T> data)
	{
		array<T> ret;
		ret.items = xrealloc(data.ptr(), sizeof(T)*capacity_for(data.size()));
		ret.count = data.size();
		return ret;
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %rdi
movq 0x8(%rsi), %rax
leaq -0x1(%rax), %rcx
bsrq %rcx, %rcx
pushq $0x4
popq %rdx
shlq %cl, %rdx
cmpq $0x8, %rax
pushq $0x10
popq %rsi
cmovaeq %rdx, %rsi
callq 0x115b4
movq %rax, (%r14)
movq 0x8(%rbx), %rax
movq %rax, 0x8(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/array.h
// Function: array<signed char>::release()
arrayvieww<T> release()
	{
		arrayvieww<T> ret = *this;
		this->items = NULL;
		this->count = 0;
		return ret;
	}

// Assembly:
movq %rdi, %rax
movq (%rsi), %rcx
movq %rcx, (%rdi)
movq 0x8(%rsi), %rcx
movq %rcx, 0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rsi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/array.h
// Function: array<cstring>::resize_grow(unsigned long)
void resize_grow(size_t newcount)
	{
		if (this->count >= newcount) return;
		size_t prevcount = this->count;
		resize_grow_noinit(newcount);
		if constexpr (arrayview<T>::trivial_cons())
		{
			memset(this->items+prevcount, 0, sizeof(T)*(newcount-prevcount));
		}
		else
		{
			for (size_t i=prevcount;i<newcount;i++)
			{
				new(&this->items[i]) T();
			}
		}
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x8(%rdi), %r15
cmpq %rsi, %r15
jae 0xeb6c
movq %rsi, %rbx
movq %rdi, %r14
callq 0xea74
movq %r15, %rax
shlq $0x4, %rax
cmpq %rbx, %r15
jae 0xeb6c
movq (%r14), %rcx
movb $0xf, 0xf(%rcx,%rax)
movb $0x0, (%rcx,%rax)
incq %r15
addq $0x10, %rax
jmp 0xeb52
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/Alcaro[P]bridges/arlib/array.h
// Function: array<string>::resize_shrink(unsigned long)
void resize_shrink(size_t newcount)
	{
		if (this->count <= newcount) return;
		for (size_t i=newcount;i<this->count;i++)
		{
			this->items[i].~T();
		}
		resize_shrink_noinit(newcount);
	}

// Assembly:
movq 0x8(%rdi), %rax
cmpq %rsi, %rax
jbe 0xf1c0
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %r15
shlq $0x4, %r15
movq %rsi, %r12
cmpq %rax, %r12
jae 0xf1aa
movq (%r14), %rdi
addq %r15, %rdi
callq 0x56b4
incq %r12
movq 0x8(%r14), %rax
addq $0x10, %r15
jmp 0xf18d
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xf0e0
retq
nop