LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/misc.cpp
// Function: hash(unsigned char const*, unsigned long)
size_t hash(const uint8_t * val, size_t n)
{
	// update staticmap.cpp if changing this
	
	size_t hash = 5381;
	while (n >= sizeof(size_t))
	{
		size_t tmp;
		memcpy(&tmp, val, sizeof(size_t));        // extra >>7 because otherwise bottom byte of output would
		hash = (hash^(hash>>7)^tmp) * 2546270801; //  only be affected by every 8th byte of input
		val += sizeof(size_t);                    // the number is just a random prime between 2^31 and 2^32
		n -= sizeof(size_t);
	}
	while (n)
	{
		hash = (hash ^ *val) * 31; // 31 is a quite common multiplier, don't know why
		val++;
		n--;
	}
	return hash;
}

// Assembly:
movl $0x1505, %eax           # imm = 0x1505
cmpq $0x8, %rsi
jb 0x158ce
movl $0x1505, %edx           # imm = 0x1505
movl $0x97c50251, %ecx       # imm = 0x97C50251
movq %rdx, %rax
shrq $0x7, %rax
xorq (%rdi), %rax
xorq %rdx, %rax
imulq %rcx, %rax
addq $0x8, %rdi
addq $-0x8, %rsi
movq %rax, %rdx
cmpq $0x7, %rsi
ja 0x158af
testq %rsi, %rsi
je 0x158ee
xorl %ecx, %ecx
movzbl (%rdi,%rcx), %edx
xorq %rax, %rdx
movq %rdx, %rax
shlq $0x5, %rax
subq %rdx, %rax
incq %rcx
cmpq %rcx, %rsi
jne 0x158d5
retq
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/misc.cpp
// Function: debugf64(double vector[2] const&)
void debugc8(const __m128i& vals)
{
	char inner[sizeof(__m128i)/sizeof(char)];
	memcpy(inner, &vals, sizeof(__m128i));
	for (size_t i : range(ARRAY_SIZE(inner)))
		printf("%c%c", inner[i], (i == ARRAY_SIZE(inner)-1 ? '\n' : ' '));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movaps (%rdi), %xmm0
movaps %xmm0, 0x10(%rsp)
movq %rsp, %rbx
movl $0xa, %ebp
leaq 0x19a35(%rip), %r14     # 0x2fb0c
xorl %r15d, %r15d
movsd 0x10(%rsp,%r15,8), %xmm0
movq %rbx, %rdi
callq 0x1b50e
cmpb $0x0, 0xf(%rsp)
movq %rbx, %rsi
jns 0x160f7
movq (%rsp), %rsi
cmpq $0x1, %r15
movl $0x20, %edx
cmovel %ebp, %edx
movq %r14, %rdi
xorl %eax, %eax
callq 0x3050
cmpb $0x0, 0xf(%rsp)
jns 0x1611d
movq (%rsp), %rdi
callq 0x3430
incq %r15
cmpq $0x1, %r15
je 0x160da
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/opengl/helpers.cpp
// Function: aropengl_base::create(aropengl_base::context*, char const*, void (**)())
bool aropengl_base::create(context* core, const char * symNames, funcptr* symDest)
{
	destroy();
	
	this->core = core;
#ifdef ARLIB_GUI
	this->port = NULL;
#endif
	if (!core) return false;
	
	while (*symNames)
	{
		*symDest = core->getProcAddress(symNames);
		//nulls here are fine, don't worry about them
		symDest++;
		symNames += strlen(symNames)+1;
	}
	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %r12
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x1655e
movq (%rdi), %rax
callq *0x30(%rax)
movq %r14, (%r12)
testq %r14, %r14
je 0x16590
cmpb $0x0, (%r15)
je 0x16590
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x18(%rax)
movq %rax, (%rbx)
addq $0x8, %rbx
movq %r15, %rdi
callq 0x30f0
addq %rax, %r15
incq %r15
jmp 0x16567
testq %r14, %r14
setne %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/random.cpp
// Function: random_base_t<true>::rand_mod(unsigned int)
uint32_t random_base_t<is_global>::rand_mod(uint32_t limit)
{
	// if RAND_MAX+1 is not a multiple of 'limit', rand() mod limit becomes biased towards lower values
	// to avoid that, find the highest multiple of limit <= RAND_MAX+1,
	// and if the returned value is higher than that, discard it and create a new one
	// alternatively and equivalently, that many values can be discarded from the lower end of the results
	// the size of the discarded section must be (RAND_MAX+1) mod limit, and discarding low ones is easier
	
	// unfortunately, RAND_MAX+1 is 2^32, which won't fit in a uint32
	// however, for a >= b, a%b equals (a-b)%b, and UINT32_MAX+1 is always greater than limit
	// the extra -1 +1 needed to avoid an overflow can also be avoided, by using how unsigned integer overflow is defined
	// so the calculation needed is simply
	uint32_t minvalid = -limit % limit;
	
	while (true)
	{
		uint32_t candidate = rand32();
		if (candidate < minvalid) continue;
		return candidate%limit;
	}
}

// Assembly:
movl %esi, %eax
negl %eax
xorl %edx, %edx
divl %esi
movl %edx, %r8d
movabsq $0x5851f42d4c957f2d, %r10 # imm = 0x5851F42D4C957F2D
movabsq $0x14057b7ef767814f, %r11 # imm = 0x14057B7EF767814F
movq (%rdi), %rcx
movq %rcx, %r9
imulq %r10, %r9
addq %r11, %r9
movq %rcx, %rax
lock
cmpxchgq %r9, (%rdi)
cmpq %rax, %rcx
movq %rax, %rcx
jne 0x1695c
movq %rax, %r9
shrq $0x2d, %r9
movq %rax, %rcx
shrq $0x1b, %rcx
xorl %ecx, %r9d
shrq $0x3b, %rax
movl %eax, %ecx
rorl %cl, %r9d
cmpl %r8d, %r9d
jb 0x1699c
movl %r9d, %eax
xorl %edx, %edx
divl %esi
cmpl %r8d, %r9d
jb 0x16959
movl %edx, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/random.cpp
// Function: random_base_t<true>::rand_mod(unsigned long)
uint64_t random_base_t<is_global>::rand_mod(uint64_t limit)
{
	if (LIKELY(limit <= 0xFFFFFFFF)) return rand_mod((uint32_t)limit);
	uint64_t minvalid = -limit % limit;
	
	while (true)
	{
		uint64_t candidate = rand64();
		if (candidate < minvalid) continue;
		return candidate%limit;
	}
}

// Assembly:
movq %rdi, %r8
movq %rsi, %rax
shrq $0x20, %rax
jne 0x16a19
movl %esi, %eax
negl %eax
xorl %edx, %edx
divl %esi
movl %edx, %edi
movabsq $0x5851f42d4c957f2d, %r10 # imm = 0x5851F42D4C957F2D
movabsq $0x14057b7ef767814f, %r11 # imm = 0x14057B7EF767814F
movq (%r8), %rcx
movq %rcx, %r9
imulq %r10, %r9
addq %r11, %r9
movq %rcx, %rax
lock
cmpxchgq %r9, (%r8)
cmpq %rax, %rcx
movq %rax, %rcx
jne 0x169d1
movq %rax, %r9
shrq $0x2d, %r9
movq %rax, %rcx
shrq $0x1b, %rcx
xorl %ecx, %r9d
shrq $0x3b, %rax
movl %eax, %ecx
rorl %cl, %r9d
cmpl %edi, %r9d
jb 0x16a11
movl %r9d, %eax
xorl %edx, %edx
divl %esi
cmpl %edi, %r9d
jb 0x169ce
movl %edx, %eax
retq
pushq %rbx
subq $0x10, %rsp
leaq 0x8(%rsp), %rbx
movq %rsi, %rdi
movq %r8, %rsi
movq %rbx, %rdx
callq 0x3c3c
movq (%rbx), %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/runloop-poll.cpp
// Function: runloop2::run(async<void>)
void run(async<void> event)
	{
		waiter<void, void> wait;
		event.then(&wait);
		auto& loop = get_loop();
		while (wait.is_waiting())
			loop.step(true);
	}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsp, %rsi
movq $0x0, (%rsi)
leaq 0x73d(%rip), %rax       # 0x175c4
movq %rax, 0x8(%rsi)
callq 0xa29c
cmpb $0x0, %fs:-0x8
je 0x16ecc
cmpq $0x0, (%rsp)
je 0x16ec6
movq %fs:0x0, %rax
leaq -0x68(%rax), %rbx
movq %rbx, %rdi
movl $0x1, %esi
callq 0x16c20
cmpq $0x0, (%rsp)
jne 0x16eb2
addq $0x10, %rsp
popq %rbx
retq
movb $0x1, %fs:-0x8
callq 0x4515
jmp 0x16e9b
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/runloop-poll.cpp
// Function: (anonymous namespace)::runloop2_poll::fds_t::reallocate(unsigned long)
void reallocate(size_t newsize)
		{
#ifdef EXTRA_POLLFDS
			size_t cursize = max_used;
#else
			size_t cursize = waiting.size();
#endif
			waiting.resize(newsize);
			wait_fd.resize(newsize);
			for (size_t i=0;i<cursize;i++)
				waiting[i].prod.moved();
#ifndef EXTRA_POLLFDS
			for (size_t i=cursize;i<newsize;i++)
				wait_fd[i].fd = ~(i+1);
#endif
		}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rdi), %r12
movq %rsi, %r15
subq %r12, %r15
jbe 0x17108
leaq -0x1(%r12), %rax
bsrq %rax, %rcx
movl $0x2, %eax
shlq %cl, %rax
cmpq $0x8, %r12
movl $0x8, %ecx
cmovaeq %rax, %rcx
cmpq %rbx, %rcx
setb %al
movq (%r14), %rdi
testq %rdi, %rdi
sete %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x170d8
leaq -0x1(%rbx), %rax
bsrq %rax, %rcx
movl $0x20, %eax
shlq %cl, %rax
cmpq $0x8, %rbx
movl $0x80, %esi
cmovaeq %rax, %rsi
callq 0x157b7
movq %rax, (%r14)
movq %rbx, 0x8(%r14)
movq %r12, %rax
shlq $0x4, %rax
orq $0x8, %rax
xorps %xmm0, %xmm0
leaq 0xe1(%rip), %rcx        # 0x171d2
movq (%r14), %rdx
movups %xmm0, -0x8(%rdx,%rax)
movq %rcx, (%rdx,%rax)
addq $0x10, %rax
decq %r15
jne 0x170f1
jmp 0x17177
jae 0x17177
movq %rbx, %r13
shlq $0x4, %r13
leaq 0x18b40(%rip), %r15     # 0x2fc58
movq %rbx, %rbp
movq (%r14), %rax
cmpq $0x0, (%rax,%r13)
je 0x1712d
movq %r15, %rdi
callq 0x80fb
incq %rbp
movq 0x8(%r14), %rax
addq $0x10, %r13
cmpq %rax, %rbp
jb 0x1711b
cmpq %rbx, %rax
jbe 0x17177
leaq -0x1(%rbx), %rcx
bsrq %rcx, %rcx
movl $0x2, %edx
shlq %cl, %rdx
cmpq $0x8, %rbx
movl $0x8, %esi
cmovaeq %rdx, %rsi
cmpq %rsi, %rax
jbe 0x17173
movq (%r14), %rdi
shlq $0x4, %rsi
callq 0x157b7
movq %rax, (%r14)
movq %rbx, 0x8(%r14)
leaq 0x10(%r14), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1741c
testq %r12, %r12
je 0x171a5
movq (%r14), %rax
movq %r12, %rcx
movq (%rax), %rdx
testq %rdx, %rdx
je 0x1719c
movq %rax, (%rdx)
addq $0x10, %rax
decq %rcx
jne 0x17191
cmpq %r12, %rbx
jbe 0x171c3
movq (%r15), %rax
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
subl %r12d, %ecx
movl %ecx, (%rax,%r12,8)
incq %r12
decl %ecx
cmpq %r12, %rbx
jne 0x171b5
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/runloop2.h
// Function: producer<void, (anonymous namespace)::runloop2_poll::fds_t::waiter_node::prod_t>::cancel_s(producer_base<void>*)
static void cancel_s(producer_base<T>* self)
	{
		if (self->wait)
			self->wait->prod = nullptr;
		self->wait = nullptr;
		if constexpr (!std::is_same_v<T2, void>)
		{
			static_assert(std::is_base_of_v<producer, T2>);
			((T2*)self)->cancel();
		}
	}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
testq %rax, %rax
je 0x171e5
movq $0x0, (%rax)
movq $0x0, (%rbx)
cmpb $0x0, %fs:-0x8
je 0x1722b
subq %fs:-0x68, %rbx
movq %rbx, %rax
sarq $0x4, %rax
movl %fs:-0x48, %ecx
notl %ecx
movq %fs:-0x58, %rdx
sarq %rbx
movl %ecx, (%rdx,%rbx)
movq %rax, %fs:-0x48
popq %rbx
retq
movb $0x1, %fs:-0x8
callq 0x4515
jmp 0x171f7
nop
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/runloop2.h
// Function: allocatable_array<(anonymous namespace)::runloop2_poll::timeout_t::waiter_node, (anonymous namespace)::runloop2_poll::timeout_t::$_0{}, (anonymous namespace)::runloop2_poll::timeout_t::$_1{}>::reallocate(unsigned long)
void reallocate(size_t newsize)
	{
		size_t cursize = inner.size();
		inner.resize(newsize);
		for (size_t i=0;i<cursize;i++)
		{
			if constexpr (!std::is_same_v<decltype(on_move), nullptr_t>)
				on_move(&inner[i]);
		}
		for (size_t i=cursize;i<newsize;i++)
			get_freelist(&inner[i])[0] = i+1;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rdi), %r12
movq %rsi, %r15
subq %r12, %r15
jbe 0x172eb
leaq -0x1(%r12), %rax
bsrq %rax, %rcx
movl $0x2, %eax
shlq %cl, %rax
cmpq $0x4, %r12
movl $0x4, %ecx
cmovaeq %rax, %rcx
cmpq %rbx, %rcx
setb %al
movq (%r14), %rdi
testq %rdi, %rdi
sete %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x172b6
leaq -0x1(%rbx), %rax
bsrq %rax, %rcx
movl $0x40, %eax
shlq %cl, %rax
cmpq $0x4, %rbx
movl $0x80, %esi
cmovaeq %rax, %rsi
callq 0x157b7
movq %rax, (%r14)
movq %rbx, 0x8(%r14)
movq %r12, %rax
shlq $0x5, %rax
orq $0x8, %rax
xorps %xmm0, %xmm0
leaq 0xeb(%rip), %rcx        # 0x173ba
movq (%r14), %rdx
movups %xmm0, -0x8(%rdx,%rax)
movups %xmm0, 0x8(%rdx,%rax)
movq %rcx, (%rdx,%rax)
addq $0x20, %rax
decq %r15
jne 0x172cf
jmp 0x1735a
jae 0x1735a
movq %rbx, %r13
shlq $0x5, %r13
leaq 0x1895d(%rip), %r15     # 0x2fc58
movq %rbx, %rbp
movq (%r14), %rax
cmpq $0x0, (%rax,%r13)
je 0x17310
movq %r15, %rdi
callq 0x80fb
incq %rbp
movq 0x8(%r14), %rax
addq $0x20, %r13
cmpq %rax, %rbp
jb 0x172fe
cmpq %rbx, %rax
jbe 0x1735a
leaq -0x1(%rbx), %rcx
bsrq %rcx, %rcx
movl $0x2, %edx
shlq %cl, %rdx
cmpq $0x4, %rbx
movl $0x4, %esi
cmovaeq %rdx, %rsi
cmpq %rsi, %rax
jbe 0x17356
movq (%r14), %rdi
shlq $0x5, %rsi
callq 0x157b7
movq %rax, (%r14)
movq %rbx, 0x8(%r14)
testq %r12, %r12
je 0x17379
movq (%r14), %rax
movq %r12, %rcx
movq (%rax), %rdx
testq %rdx, %rdx
je 0x17370
movq %rax, (%rdx)
addq $0x20, %rax
decq %rcx
jne 0x17365
cmpq %r12, %rbx
jbe 0x173ab
movq (%r14), %rcx
negq %rbx
leaq 0x1(%r12), %rax
shlq $0x5, %r12
addq %r12, %rcx
addq $0x10, %rcx
movq %rax, (%rcx)
leaq (%rbx,%rax), %rdx
incq %rdx
incq %rax
addq $0x20, %rcx
cmpq $0x1, %rdx
jne 0x17394
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/array.h
// Function: fifo<std::__n4861::coroutine_handle<void>>::push(std::__n4861::coroutine_handle<void>)
void push(T item)
	{
		if (wr == capacity)
		{
			if (rd <= capacity/2)
			{
				if (capacity == 0)
					capacity = 8;
				else
					capacity *= 2;
				items = xrealloc(items, sizeof(T)*capacity);
			}
			for (size_t n=0;n<rd;n++)
				items[n].~T();
			memmove(items, items+rd, sizeof(T)*(wr-rd));
			wr -= rd;
			rd = 0;
		}
		new(&items[wr]) T(std::move(item));
		wr++;
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %rax
cmpq %rax, 0x18(%rdi)
jne 0x175a0
movq %rax, %rcx
shrq %rcx
cmpq %rcx, 0x10(%rbx)
ja 0x17575
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x8, %esi
cmovneq %rcx, %rsi
movq %rsi, 0x8(%rbx)
movq (%rbx), %rdi
shlq $0x3, %rsi
callq 0x157b7
movq %rax, (%rbx)
movq (%rbx), %rdi
movq 0x10(%rbx), %rax
leaq (%rdi,%rax,8), %rsi
movq 0x18(%rbx), %rdx
subq %rax, %rdx
shlq $0x3, %rdx
callq 0x3600
movq 0x10(%rbx), %rax
subq %rax, 0x18(%rbx)
movq $0x0, 0x10(%rbx)
movq (%rbx), %rax
movq 0x18(%rbx), %rcx
movq %r14, (%rax,%rcx,8)
incq %rcx
movq %rcx, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/staticmap.cpp
// Function: staticmap::open(cstrnul, bool)
bool staticmap::open(cstrnul fn, bool map_writable)
{
	if (!f.open(fn, (file2::mode)(file2::m_write | file2::m_exclusive))) return false;
	this->map_writable = map_writable;
	this->sector_size = f.sector_size();
	
	mmap = f.mmapw(map_writable);
	if (mmap.size() == 0)
		create();
	else if (rd64(off_header) == t_meta+off_r_objsize && rd64(off_r_sig) == sig_passive)
		{} // do nothing
	else if (rd64(off_header) == t_meta+off_r_objsize && rd64(off_r_sig) == sig_active)
	{
		if (mmap.size() <= 1024 || rd64(off_r_entries) == 0)
			create();
		else
			recover();
	}
	else
		f.close();
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %ecx, %ebp
movq %rdi, %r14
leaq 0x4(%rdi), %r15
movq %r15, %rdi
movl $0x9, %ecx
callq 0x93e0
movl %eax, %ebx
testb %al, %al
je 0x17706
movb %bpl, 0x18(%r14)
movl 0x4(%r14), %edi
movq %rsp, %r12
movq %r12, %rsi
callq 0x3640
movl 0x38(%r12), %eax
movl %eax, 0x1c(%r14)
xorps %xmm0, %xmm0
movaps %xmm0, (%r12)
movzbl %bpl, %edx
movq %rsp, %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x947e
leaq 0x8(%r14), %r12
movq %r12, %rdi
callq 0x94ec
movaps (%r13), %xmm0
movups %xmm0, 0x8(%r14)
xorps %xmm0, %xmm0
movaps %xmm0, (%r13)
movq %r13, %rdi
callq 0x94ec
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x176fe
movq (%r12), %rcx
movq (%rcx), %rdx
cmpq $0x202, %rdx            # imm = 0x202
jne 0x176e8
movabsq $0x70616d736c7261, %rsi # imm = 0x70616D736C7261
cmpq %rsi, 0x8(%rcx)
je 0x17706
cmpq $0x202, %rdx            # imm = 0x202
jne 0x176e8
movabsq $0x170616d736c7261, %rdx # imm = 0x170616D736C7261
cmpq %rdx, 0x8(%rcx)
jne 0x176e8
cmpq $0x401, %rax            # imm = 0x401
jb 0x176fe
cmpq $0x0, 0x20(%rcx)
je 0x176fe
movq %r14, %rdi
callq 0x17848
jmp 0x17706
movl (%r15), %edi
cmpl $-0x1, %edi
je 0x176f5
callq 0x3700
movl $0xffffffff, (%r15)     # imm = 0xFFFFFFFF
jmp 0x17706
movq %r14, %rdi
callq 0x1771a
movl %ebx, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/staticmap.cpp
// Function: staticmap::create()
void staticmap::create()
{
	mmap = nullptr;
	uint8_t buf[off_r_objsize + 512];
	
	writeu_le64(buf+off_header, off_r_objsize+t_meta);
	writeu_le64(buf+off_r_sig, sig_active);
	writeu_le64(buf+off_r_hm_ptr, 512); // hashmap pointer
	writeu_le64(buf+off_r_hm_load, 0); // number of used hashmap slots
	writeu_le64(buf+off_r_entries, 0); // number of object members
	for (int i=5;i<=9;i++) writeu_le64(buf+off_r_freespace(i), 0); // no freespaces of size 32 to 512
	for (int i=10;i<=15;i++) writeu_le64(buf+off_r_freespace(i), 1<<i); // have freespaces of size 1024 to 32768
	for (int i=16;i<=63;i++) writeu_le64(buf+off_r_freespace(i), 1); // no freespaces of size 65536 to 9223372036854775808
	
	writeu_le64(buf+512, 512+t_meta); // hashmap header
	for (int i=2;i<=63;i++) writeu_le64(buf+512+i*8, 0); // fill the hashmap
	f.pwrite(0, buf);
	
	f.resize(65536, mmap, map_writable);
	
	for (int i=10;i<=15;i++)
		wr64(1<<i, (1<<i)+t_free, 0, off_r_freespace(i)); // header, next_obj, prev_ptr
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x428, %rsp            # imm = 0x428
movq %rdi, %r14
leaq 0x8(%rdi), %rbx
movq %rbx, %rdi
callq 0x94ec
movq $0x202, 0x20(%rsp)      # imm = 0x202
movabsq $0x170616d736c7261, %rax # imm = 0x170616D736C7261
movq %rax, 0x28(%rsp)
movq $0x200, 0x30(%rsp)      # imm = 0x200
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rsp)
movups %xmm0, 0x48(%rsp)
movups %xmm0, 0x58(%rsp)
movq $0x0, 0x68(%rsp)
movl $0xa, %ecx
movl $0x1, %eax
shll %cl, %eax
movq %rax, 0x20(%rsp,%rcx,8)
incq %rcx
cmpq $0x10, %rcx
jne 0x17778
movl $0x10, %eax
movq $0x1, 0x20(%rsp,%rax,8)
incq %rax
cmpq $0x40, %rax
jne 0x17792
leaq 0x230(%rsp), %rdi
movq $0x202, -0x10(%rdi)     # imm = 0x202
movl $0x1f0, %edx            # imm = 0x1F0
xorl %esi, %esi
callq 0x3170
leaq 0x4(%r14), %r15
movl 0x4(%r14), %edi
leaq 0x20(%rsp), %rsi
movl $0x400, %edx            # imm = 0x400
xorl %ecx, %ecx
callq 0x30d0
movzbl 0x18(%r14), %ecx
movl $0x10000, %esi          # imm = 0x10000
movq %r15, %rdi
movq %rbx, %rdx
callq 0x9e2c
movl $0xa, %ebx
movl $0x50, %r12d
movq %rsp, %r14
movl $0x1, %eax
movl %ebx, %ecx
shll %cl, %eax
movq %rax, (%rsp)
movq $0x0, 0x8(%rsp)
movq %r12, 0x10(%rsp)
movl (%r15), %edi
movl $0x18, %edx
movq %r14, %rsi
movq %rax, %rcx
callq 0x30d0
incl %ebx
addq $0x8, %r12
cmpq $0x80, %r12
jne 0x177fc
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/staticmap.cpp
// Function: staticmap::free(unsigned long)
void staticmap::free(uint64_t addr)
{
//printf("free %lu\n", addr);
	uint64_t size = rd64(addr+off_header) & ~t_typemask;
again:
	uint64_t other = addr ^ size;
	if (rd64(other+off_header) == size + t_free)
	{
		uint64_t next_obj = rd64(other+off_f_nextobj);
		f.pwrite(rd64(other+off_f_prevptr), mmap.slice(other+off_f_nextobj, 8));  // *(other.prev_ptr) = other.next_obj;
		if (next_obj)                                                             // if (other.next_obj)
			f.pwrite(next_obj+off_f_prevptr, mmap.slice(other+off_f_prevptr, 8)); //   other.next_obj->prev_ptr = other.prev_ptr;
		
		addr &= ~size;
		size *= 2;
		goto again;
	}
	
	uint64_t bucket_pos = off_r_freespace(ilog2(size));
	// bucket_pos can be 1 if the freed space is combined with a sibling, such that the entire right half of the file is now free
	uint64_t prev_free = rd64(bucket_pos) & ~1;
	if (prev_free > 1)
		wr64(prev_free+off_f_prevptr, addr+off_f_nextobj);
	wr64(addr, size+t_free, prev_free, bucket_pos);
	wr64(bucket_pos, addr);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rdi), %rax
movq (%rax,%rsi), %rbp
andq $-0x10, %rbp
movq %rbx, %r12
xorq %rbp, %r12
movq 0x8(%r14), %rax
movq (%rax,%r12), %r15
cmpq %rbp, %r15
jne 0x17be5
leaq (%rax,%r12), %rsi
addq $0x8, %rsi
movq (%rsi), %r13
movq 0x8(%rsi), %rcx
movl 0x4(%r14), %edi
movl $0x8, %edx
callq 0x30d0
testq %r13, %r13
je 0x17bcf
addq $0x10, %r12
addq $0x10, %r13
addq 0x8(%r14), %r12
movl 0x4(%r14), %edi
movl $0x8, %edx
movq %r12, %rsi
movq %r13, %rcx
callq 0x30d0
movq %rbp, %rax
notq %rax
andq %rax, %rbx
leaq (,%rbp,2), %rax
jmp 0x17c66
bsrq %rbp, %r12
xorl $0x3f, %r12d
shll $0x3, %r12d
xorq $0x1f8, %r12            # imm = 0x1F8
movq (%rax,%r12), %rax
movq %rax, %r13
andq $-0x2, %r13
cmpq $0x2, %rax
jb 0x17c26
leaq 0x10(%r13), %rcx
leaq 0x8(%rbx), %rax
movq %rax, (%rsp)
movl 0x4(%r14), %edi
movl $0x8, %edx
movq %rsp, %rsi
callq 0x30d0
movq %rbp, (%rsp)
movq %r13, 0x8(%rsp)
movq %r12, 0x10(%rsp)
movl 0x4(%r14), %edi
movl $0x18, %edx
movq %rsp, %r13
movq %r13, %rsi
movq %rbx, %rcx
callq 0x30d0
movq %rbx, (%rsp)
movl 0x4(%r14), %edi
movl $0x8, %edx
movq %r13, %rsi
movq %r12, %rcx
callq 0x30d0
movq %rbp, %rax
cmpq %rbp, %r15
movq %rax, %rbp
je 0x17b7a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/staticmap.cpp
// Function: staticmap::hashmap_locate(unsigned long, arrayview<unsigned char>)
uint64_t staticmap::hashmap_locate(uint64_t hash, bytesr key)
{
	uint64_t ret = 0;
	uint64_t hashmap_pos = rd64(off_r_hm_ptr);
	uint64_t hashmap_size = rd64(hashmap_pos+off_header) & ~t_typemask;
	
	// ignore bottom 4 bits of hash
	uint64_t off = hash & (hashmap_size-off_h_nodesize);
	while (true)
	{
		if (off == 0)
			off = off_h_nodesize;
		uint64_t node_addr = rd64(hashmap_pos+off+off_h_ptr);
		uint64_t node_hash = rd64(hashmap_pos+off+off_h_hash);
		if (node_addr <= 1)
		{
			if (ret == 0)
				ret = hashmap_pos+off;
			if (node_addr == 0)
				return ret;
		}
		if (node_addr > 1 && node_hash == hash)
		{
			bytesr node_key = mmap.slice(node_addr+off_d_keystart, rd64(node_addr+off_d_keysz));
			if (key == node_key)
				return hashmap_pos+off;
		}
		off = (off+off_h_nodesize) & (hashmap_size-off_h_nodesize);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %rbp
movq %rdx, 0x18(%rsp)
movq %rsi, %rdx
movq 0x8(%rdi), %r13
movq 0x10(%r13), %rdi
movq (%r13,%rdi), %r12
andq $-0x10, %r12
addq $-0x10, %r12
movq %r12, %r14
andq %rsi, %r14
leaq 0x18(%r13), %rax
movq %rax, 0x8(%rsp)
xorl %r15d, %r15d
movl $0x10, %r10d
movq %rdi, 0x10(%rsp)
movq %rsi, (%rsp)
testq %r14, %r14
cmoveq %r10, %r14
leaq (%r14,%rdi), %rbx
movq (%r13,%rbx), %rsi
movq 0x8(%r13,%rbx), %rax
cmpq $0x1, %rsi
ja 0x17eea
testq %r15, %r15
cmoveq %rbx, %r15
testq %rsi, %rsi
je 0x17f47
cmpq $0x2, %rsi
jb 0x17f3c
cmpq %rdx, %rax
jne 0x17f3c
cmpq %rbp, 0x8(%r13,%rsi)
jne 0x17f2e
addq 0x8(%rsp), %rsi
movq 0x18(%rsp), %rdi
movq %rbp, %rdx
movq %r11, 0x20(%rsp)
callq 0x3380
movq 0x20(%rsp), %r11
movl $0x10, %r10d
movq 0x10(%rsp), %rdi
movq (%rsp), %rdx
testl %eax, %eax
sete %al
jmp 0x17f30
xorl %eax, %eax
testb %al, %al
cmovneq %rbx, %r11
je 0x17f3c
xorl %eax, %eax
jmp 0x17f4c
addq $0x10, %r14
andq %r12, %r14
movb $0x1, %al
jmp 0x17f4c
xorl %eax, %eax
movq %r15, %r11
testb %al, %al
jne 0x17ec3
movq %r11, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/staticmap.cpp
// Function: staticmap::get_or_empty(arrayview<unsigned char>, bool*)
bytesw staticmap::get_or_empty(bytesr key, bool* found)
{
//puts("GET "+tostringhex(key));
	uint64_t hash = sm_hash(key);
	uint64_t hashmap_pos = hashmap_locate(hash, key);
	
	uint64_t ptr = rd64(hashmap_pos+off_h_ptr);
	if (found)
		*found = (ptr > 1);
	if (ptr > 1)
		return mmap.slice(ptr+off_d_keystart+key.size(), rd64(ptr+off_d_valsz));
	return {};
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r8, %r15
movq %rcx, %r14
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %rbx
movq %rdx, %rdi
movq %rcx, %rsi
callq 0x15897
movq %rax, %rcx
shrq $0x1e, %rcx
xorq %rax, %rcx
movabsq $-0x40a7b892e31b1a47, %rax # imm = 0xBF58476D1CE4E5B9
imulq %rcx, %rax
movq %rax, %rcx
shrq $0x1b, %rcx
xorq %rax, %rcx
movabsq $-0x6b2fb644ecceee15, %rax # imm = 0x94D049BB133111EB
imulq %rcx, %rax
movq %rax, %rsi
shrq $0x1f, %rsi
xorq %rax, %rsi
movq %r12, %rdi
movq %r13, %rdx
movq %r14, %rcx
callq 0x17e74
movq 0x8(%r12), %rcx
movq (%rcx,%rax), %rax
testq %r15, %r15
je 0x1814f
cmpq $0x2, %rax
setae (%r15)
cmpq $0x2, %rax
jb 0x18175
leaq (%rcx,%rax), %rdx
movq 0x10(%rcx,%rax), %rax
leaq (%r14,%rdx), %rcx
addq $0x18, %rcx
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq %rcx, (%rbx)
movq %rax, 0x8(%rbx)
jmp 0x1817b
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/staticmap.cpp
// Function: staticmap::desync()
void staticmap::desync()
{
	if (!f) return;
	if (*synced)
		f.pwrite(off_r_sigactive, synced);
	*synced = false;
}

// Assembly:
movq %rdi, %rax
movl 0x4(%rdi), %edi
cmpl $-0x1, %edi
je 0x1842a
pushq %rbx
leaq 0x19(%rax), %rbx
cmpb $0x0, 0x19(%rax)
je 0x18426
movl $0x1, %edx
movl $0xf, %ecx
movq %rbx, %rsi
callq 0x30d0
movb $0x0, (%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/staticmap.cpp
// Function: staticmap::remove(arrayview<unsigned char>)
void staticmap::remove(bytesr key)
{
//puts("REMOVE "+tostringhex(key));
	desync();
	
	uint64_t hash = sm_hash(key);
	uint64_t hashmap_pos = hashmap_locate(hash, key);
	
	uint64_t ptr = rd64(hashmap_pos+off_h_ptr);
	if (ptr > 1)
	{
		free(ptr);
		wr64(hashmap_pos+off_h_ptr, 1);
		wr64(off_r_entries, rd64(off_r_entries)-1);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
callq 0x183fe
movq %r15, %rdi
movq %r14, %rsi
callq 0x15897
movq %rax, %rcx
shrq $0x1e, %rcx
xorq %rax, %rcx
movabsq $-0x40a7b892e31b1a47, %rax # imm = 0xBF58476D1CE4E5B9
imulq %rcx, %rax
movq %rax, %rcx
shrq $0x1b, %rcx
xorq %rax, %rcx
movabsq $-0x6b2fb644ecceee15, %rax # imm = 0x94D049BB133111EB
imulq %rcx, %rax
movq %rax, %rsi
shrq $0x1f, %rsi
xorq %rax, %rsi
movq %rbx, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x17e74
movq %rax, %r14
movq 0x8(%rbx), %rax
movq (%rax,%r14), %rsi
cmpq $0x2, %rsi
jb 0x184f3
movq %rbx, %rdi
callq 0x17b5a
leaq 0x8(%rsp), %r15
movq $0x1, (%r15)
movl 0x4(%rbx), %edi
movl $0x8, %edx
movq %r15, %rsi
movq %r14, %rcx
callq 0x30d0
movq 0x8(%rbx), %rax
movq 0x20(%rax), %rax
decq %rax
movq %rax, (%r15)
movl 0x4(%rbx), %edi
leaq 0x8(%rsp), %rsi
movl $0x8, %edx
movl $0x20, %ecx
callq 0x30d0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/staticmap.cpp
// Function: staticmap::sync()
void staticmap::sync()
{
	if (!*synced)
	{
		f.pwrite(off_r_sigactive, synced);
		f.sync();
	}
	*synced = true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x19(%rdi), %rbx
cmpb $0x0, 0x19(%rdi)
jne 0x18545
movq %rdi, %r14
movl 0x4(%rdi), %edi
movl $0x1, %edx
movl $0xf, %ecx
movq %rbx, %rsi
callq 0x30d0
movl 0x4(%r14), %edi
callq 0x3140
movb $0x1, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/staticmap.cpp
// Function: staticmap::iterator::operator*()
staticmap::node staticmap::iterator::operator*()
{
	it = next(it, nullptr);
	uint64_t keylen = readu_le64(it+off_d_keysz);
	uint64_t vallen = readu_le64(it+off_d_valsz);
	return { bytesr(it+off_d_keystart, keylen), bytesw(it+off_d_keystart+keylen, vallen) };
}

// Assembly:
movq %rdi, %rax
movq (%rsi), %rcx
testq %rcx, %rcx
je 0x1858a
movq (%rcx), %rdx
movl %edx, %edi
andl $0xf, %edi
cmpl $0x1, %edi
jne 0x1858f
movq %rcx, %rdi
jmp 0x185ab
andq $-0x10, %rdx
leaq (%rcx,%rdx), %rdi
movq (%rcx,%rdx), %rdx
movl %edx, %r8d
andl $0xf, %r8d
movq %rdi, %rcx
cmpl $0x1, %r8d
jne 0x1858f
movq %rdi, (%rsi)
movq 0x8(%rdi), %rcx
movq 0x10(%rdi), %rdx
leaq 0x18(%rdi), %rsi
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rsi, (%rax)
movq %rcx, 0x8(%rax)
leaq 0x18(%rdi,%rcx), %rcx
movups %xmm0, 0x10(%rax)
movq %rcx, 0x10(%rax)
movq %rdx, 0x18(%rax)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/staticmap.cpp
// Function: staticmap::iterator::operator!=(staticmap::iterator const&)
bool staticmap::iterator::operator!=(const iterator& other)
{
	uint8_t* a = it;
	uint8_t* b = other.it;
	if (it < other.it) a = next(a, b);
	else b = next(b, a);
	return (a != b);
}

// Assembly:
movq (%rdi), %rax
movq (%rsi), %rcx
cmpq %rcx, %rax
jae 0x18648
movq (%rax), %rdx
movl %edx, %esi
andl $0xf, %esi
cmpl $0x1, %esi
je 0x18663
andq $-0x10, %rdx
addq %rdx, %rax
cmpq %rcx, %rax
jne 0x1862d
jmp 0x18663
je 0x18663
movq (%rcx), %rdx
movl %edx, %esi
andl $0xf, %esi
cmpl $0x1, %esi
je 0x18663
andq $-0x10, %rdx
addq %rdx, %rcx
cmpq %rax, %rcx
jne 0x1864a
cmpq %rcx, %rax
setne %al
retq
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/string.cpp
// Function: string::resize(unsigned long)
void string::resize(size_t newlen)
{
	switch (!inlined()<<1 | (newlen>max_inline()))
	{
	case 0: // small->small
		{
			m_inline[newlen] = '\0';
			m_inline_len_w() = max_inline()-newlen;
		}
		break;
	case 1: // small->big
		{
			uint8_t* newptr = xmalloc(bytes_for(newlen));
			memcpy(newptr, m_inline, max_inline());
			newptr[newlen] = '\0';
			m_data = newptr;
			m_len = newlen;
			m_nul = true;
			
			m_inline_len_w() = -1;
		}
		break;
	case 2: // big->small
		{
			uint8_t* oldptr = m_data;
			memcpy(m_inline, oldptr, newlen);
			free(oldptr);
			m_inline[newlen] = '\0';
			m_inline_len_w() = max_inline()-newlen;
		}
		break;
	case 3: // big->big
		{
			if (bytes_for(newlen) != bytes_for(m_len))
				m_data = xrealloc(m_data, bytes_for(newlen));
			m_data[newlen] = '\0';
			m_len = newlen;
		}
		break;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movzbl 0xf(%rdi), %eax
shrl $0x6, %eax
andl $0x2, %eax
xorl %ecx, %ecx
cmpq $0x10, %rsi
setae %cl
orl %eax, %ecx
leaq 0x16b35(%rip), %rax     # 0x2fd00
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
bsrq %r14, %rcx
movl $0x2, %eax
shlq %cl, %rax
leaq -0x1(%r14), %rcx
cmpq $-0x2, %rcx
movl $0x1, %edi
cmovbq %rax, %rdi
callq 0x1573c
movq (%rbx), %rcx
movq 0x7(%rbx), %rdx
movq %rcx, (%rax)
movq %rdx, 0x7(%rax)
movb $0x0, (%rax,%r14)
movq %rax, (%rbx)
movl %r14d, 0x8(%rbx)
movb $0x1, 0xc(%rbx)
movb $-0x1, 0xf(%rbx)
jmp 0x19295
movq (%rbx), %r15
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3280
movq %r15, %rdi
callq 0x3430
movb $0x0, (%rbx,%r14)
movb $0xf, %al
subb %r14b, %al
movb %al, 0xf(%rbx)
jmp 0x19295
bsrq %r14, %rcx
movl $0x2, %esi
shlq %cl, %rsi
leaq -0x1(%r14), %rax
cmpq $-0x2, %rax
movl $0x1, %eax
cmovaeq %rax, %rsi
movl $0x2, %edx
movl 0x8(%rbx), %edi
bsrq %rdi, %rcx
shlq %cl, %rdx
decq %rdi
cmpq $-0x2, %rdi
cmovaeq %rax, %rdx
cmpq %rdx, %rsi
je 0x19289
movq (%rbx), %rdi
callq 0x157b7
movq %rax, (%rbx)
movq (%rbx), %rax
movb $0x0, (%rax,%r14)
movl %r14d, 0x8(%rbx)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/string.cpp
// Function: string::init_from_outline(unsigned char const*, unsigned long)
void string::init_from_outline(const uint8_t * str, size_t len)
{
	if (len <= max_inline())
	{
		memcpy(m_inline, str, len);
		m_inline[len] = '\0';
		m_inline_len_w() = max_inline()-len;
	}
	else
	{
		init_from_large(str, len);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
cmpq $0xf, %rdx
jbe 0x192f5
movb $-0x1, 0xf(%rbx)
bsrq %r14, %rcx
movl $0x2, %eax
shlq %cl, %rax
cmpq $-0x1, %r14
movl $0x1, %edi
cmovneq %rax, %rdi
callq 0x1573c
movq %rax, (%rbx)
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3280
movq (%rbx), %rax
movb $0x0, (%rax,%r14)
movl %r14d, 0x8(%rbx)
movb $0x1, 0xc(%rbx)
jmp 0x19310
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3280
movb $0x0, (%rbx,%r14)
movb $0xf, %al
subb %r14b, %al
movb %al, 0xf(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/string.cpp
// Function: string::init_from_large(unsigned char const*, unsigned long)
void string::init_from_large(const uint8_t * str, size_t len)
{
	m_inline_len_w() = -1;
	
	m_data = xmalloc(bytes_for(len));
	memcpy(m_data, str, len);
	m_data[len]='\0';
	
	m_len = len;
	m_nul = true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movb $-0x1, 0xf(%rdi)
bsrq %rdx, %rcx
movl $0x2, %eax
shlq %cl, %rax
leaq -0x1(%rdx), %rcx
cmpq $-0x2, %rcx
movl $0x1, %edi
cmovbq %rax, %rdi
callq 0x1573c
movq %rax, (%r15)
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3280
movq (%r15), %rax
movb $0x0, (%rax,%rbx)
movl %ebx, 0x8(%r15)
movb $0x1, 0xc(%r15)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/string.cpp
// Function: string::init_from(cstring const&)
void string::init_from(const cstring& other)
{
	if (other.inlined())
		memcpy((void*)this, (void*)&other, sizeof(*this));
	else
		init_from_large(other.m_data, other.m_len);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpb $0x0, 0xf(%rsi)
js 0x19388
movups (%rsi), %xmm0
movups %xmm0, (%rbx)
jmp 0x193d6
movq (%rsi), %r14
movl 0x8(%rsi), %r15d
movb $-0x1, 0xf(%rbx)
bsrq %r15, %rcx
movl $0x2, %eax
shlq %cl, %rax
leaq -0x1(%r15), %rcx
cmpq $-0x2, %rcx
movl $0x1, %edi
cmovbq %rax, %rdi
callq 0x1573c
movq %rax, (%rbx)
movq %rax, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x3280
movq (%rbx), %rax
movb $0x0, (%rax,%r15)
movl %r15d, 0x8(%rbx)
movb $0x1, 0xc(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/string.cpp
// Function: string::reinit_from(arrayview<unsigned char>)
void string::reinit_from(arrayview<uint8_t> data)
{
	const uint8_t * str = data.ptr();
	size_t len = data.size();
	
	if (str >= this->ptr() && str <= this->ptr()+this->length())
	{
		if (str == this->ptr() && len == this->length()) return;
		
		memmove(this->ptr(), str, len);
		resize(len);
	}
	else
	{
		deinit();
		init_from(data);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movzbl 0xf(%rdi), %ecx
testb %cl, %cl
movq (%rdi), %rax
movq %rax, %rdi
cmovnsq %r14, %rdi
cmpq %rsi, %rdi
ja 0x19415
movl %ecx, %edx
xorl $0xf, %edx
testb %cl, %cl
movl 0x8(%r14), %esi
cmovnsl %edx, %esi
addq %rdi, %rsi
cmpq %r15, %rsi
jae 0x19434
testb %cl, %cl
jns 0x19421
movq %rax, %rdi
callq 0x3430
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x1929c
cmpq %r15, %rdi
jne 0x1944b
testb %cl, %cl
cmovsl 0x8(%r14), %edx
cmpq %rbx, %rdx
jne 0x1944b
popq %rbx
popq %r14
popq %r15
retq
movq %r15, %rsi
movq %rbx, %rdx
callq 0x3600
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x191a4
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/string.cpp
// Function: string::append(arrayview<unsigned char>)
void string::append(arrayview<uint8_t> newdat)
{
	// cache these four, for performance
	uint8_t* p1 = ptr();
	const uint8_t* p2 = newdat.ptr();
	uint32_t l1 = length();
	uint32_t l2 = newdat.size();
	
	if (UNLIKELY(p2 >= p1 && p2 < p1+l1))
	{
		uint32_t offset = p2-p1;
		resize(l1+l2);
		p1 = ptr();
		memcpy(p1+l1, p1+offset, l2);
	}
	else
	{
		resize(l1+l2);
		memcpy(ptr()+l1, p2, l2);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movzbl 0xf(%rdi), %eax
movl %eax, %r12d
xorl $0xf, %r12d
testb %al, %al
movq (%rdi), %rax
cmovnsq %rdi, %rax
cmovsl 0x8(%rdi), %r12d
cmpq %rsi, %rax
ja 0x1949e
leaq (%rax,%r12), %rcx
cmpq %rbx, %rcx
ja 0x194d0
leal (%r12,%r14), %esi
movq %r15, %rdi
callq 0x191a4
cmpb $0x0, 0xf(%r15)
jns 0x194b4
movq (%r15), %r15
addq %r12, %r15
movl %r14d, %edx
movq %r15, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3280
subl %eax, %ebx
leal (%r12,%r14), %esi
movq %r15, %rdi
callq 0x191a4
cmpb $0x0, 0xf(%r15)
jns 0x194e8
movq (%r15), %r15
addq %r15, %r12
addq %r15, %rbx
movl %r14d, %edx
movq %r12, %rdi
jmp 0x194bd
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/string.cpp
// Function: string::create_usurp(char*)
string string::create_usurp(char * str)
{
	cstring tmp(str);
	string ret;
	memcpy((void*)&ret, (void*)&tmp, sizeof(string));
	if (tmp.inlined()) free(str);
	else ret.m_data = xrealloc(ret.m_data, bytes_for(ret.m_len));
	return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x30f0
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
movl $0x1, %ecx
callq 0x5040
movb $0xf, 0xf(%rbx)
movb $0x0, (%rbx)
movups (%r15), %xmm0
movups %xmm0, (%rbx)
cmpb $0x0, 0xf(%r15)
js 0x19542
movq %r14, %rdi
callq 0x3430
jmp 0x1956c
movq (%rbx), %rdi
movl 0x8(%rbx), %eax
bsrq %rax, %rcx
movl $0x2, %edx
shlq %cl, %rdx
decq %rax
cmpq $-0x2, %rax
movl $0x1, %esi
cmovbq %rdx, %rsi
callq 0x157b7
movq %rax, (%rbx)
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/string.cpp
// Function: string::string(array<unsigned char>&&)
string::string(array<uint8_t>&& bytes) : cstrnul(noinit())
{
	cstring tmp(bytes);
	memcpy((void*)this, (void*)&tmp, sizeof(string));
	
	uint8_t* ptr = bytes.release().ptr();
	if (tmp.inlined()) free(ptr);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %rsi
movq 0x8(%rbx), %rdx
movq %rsp, %r15
movq %r15, %rdi
xorl %ecx, %ecx
callq 0x5040
movups (%r15), %xmm0
movups %xmm0, (%r14)
movq (%rbx), %rdi
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
cmpb $0x0, 0xf(%r15)
js 0x195ba
callq 0x3430
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/string.cpp
// Function: cstring::lastindexof(cstring) const
size_t cstring::lastindexof(cstring other) const
{
	size_t ret = -1;
	const uint8_t* start = this->ptr();
	const uint8_t* find = start;
	const uint8_t* find_end = find + this->length();
	if (!other) return this->length();
	
	while (true)
	{
		find = (uint8_t*)memmem(find, find_end-find, other.ptr(), other.length());
		if (!find) return ret;
		ret = find-start;
		find += 1;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rsi, (%rsp)
movq %rdx, 0x8(%rsp)
movzbl 0xf(%rdi), %ecx
movzbl 0xf(%rsp), %eax
movl %eax, %r15d
xorl $0xf, %r15d
testb %al, %al
movl %r15d, %esi
cmovsl %edx, %esi
movl %ecx, %r14d
xorl $0xf, %r14d
testb %cl, %cl
movq (%rdi), %r12
cmovnsq %rdi, %r12
cmovsl 0x8(%rdi), %r14d
testl %esi, %esi
je 0x196cc
testb %al, %al
movq %rsp, %rax
cmovnsq %rax, %rbx
cmovsl %edx, %r15d
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x3b51
testq %rax, %rax
je 0x196c5
addq %r12, %r14
movq %rax, %r13
leaq 0x1(%rax), %rdi
movq %r14, %rsi
subq %rdi, %rsi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x3b51
testq %rax, %rax
jne 0x196a0
subq %r12, %r13
movq %r13, %r14
jmp 0x196cc
movq $-0x1, %r14
movq %r14, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/string.cpp
// Function: cstring::iindexof(cstring, unsigned long) const
size_t cstring::iindexof(cstring other, size_t start) const
{
	if (start+other.length() > this->length()) return -1;
	const char* a = (char*)this->ptr();
	const char* b = (char*)other.ptr();
	while (start <= this->length()-other.length())
	{
		size_t i;
		for (i=0;i<other.length();i++)
		{
			if (tolower(a[start+i]) != tolower(b[i])) break;
		}
		if (i==other.length()) return start;
		start++;
	}
	return -1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, -0x10(%rsp)
movq %rdx, -0x8(%rsp)
movzbl -0x1(%rsp), %eax
movl %eax, %r8d
xorl $0xf, %r8d
testb %al, %al
cmovnsl %r8d, %edx
addq %rcx, %rdx
movzbl 0xf(%rdi), %r10d
movl %r10d, %r9d
xorl $0xf, %r9d
testb %r10b, %r10b
movl 0x8(%rdi), %r11d
cmovnsl %r9d, %r11d
cmpq %r11, %rdx
jbe 0x1980b
movq $-0x1, %rax
jmp 0x1989a
movl %eax, %edx
xorb $0xf, %dl
testb %al, %al
leaq -0x10(%rsp), %rax
movl 0x8(%rax), %r11d
movzbl %dl, %edx
cmovsl %r11d, %edx
cmovsl %r11d, %r8d
cmovnsq %rax, %rsi
testb %r10b, %r10b
jns 0x19836
movl 0x8(%rdi), %r9d
movq (%rdi), %rdi
subl %r8d, %r9d
addq %rcx, %rdi
leaq 0x164cd(%rip), %r10     # 0x2fd10
cmpq %r9, %rcx
ja 0x197ff
xorl %r11d, %r11d
testq %r8, %r8
je 0x19880
movzbl (%rdi,%r11), %ebx
movb (%rbx,%r10), %bpl
andb $0x20, %bpl
orb %bl, %bpl
movzbl (%rsi,%r11), %ebx
movb (%rbx,%r10), %r14b
andb $0x20, %r14b
orb %bl, %r14b
cmpb %r14b, %bpl
jne 0x19880
incq %r11
cmpq %r11, %r8
jne 0x19850
movq %r8, %r11
xorl %ebx, %ebx
cmpq %rdx, %r11
setne %bl
addq %rcx, %rbx
incq %rdi
cmpq %rdx, %r11
cmoveq %rcx, %rax
movq %rbx, %rcx
jne 0x19843
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/string.cpp
// Function: cstring::ilastindexof(cstring) const
size_t cstring::ilastindexof(cstring other) const
{
	if (other.length() > this->length()) return -1;
	const char* a = (char*)this->ptr();
	const char* b = (char*)other.ptr();
	
	size_t start=this->length()-other.length();
	while (true)
	{
		size_t i;
		for (i=0;i<other.length();i++)
		{
			if (tolower(a[start+i]) != tolower(b[i])) break;
		}
		if (i==other.length()) return start;
		
		if (start == 0) return -1;
		start--;
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, -0x10(%rsp)
movq %rdx, -0x8(%rsp)
movzbl -0x1(%rsp), %r9d
movl %r9d, %ecx
xorl $0xf, %ecx
testb %r9b, %r9b
cmovnsl %ecx, %edx
movzbl 0xf(%rdi), %r8d
testb %r8b, %r8b
jns 0x198d0
movl 0x8(%rdi), %r10d
jmp 0x198d7
movl %r8d, %r10d
xorl $0xf, %r10d
movq $-0x1, %rax
cmpl %r10d, %edx
ja 0x1999c
movl %r9d, %eax
xorb $0xf, %al
testb %r9b, %r9b
leaq -0x10(%rsp), %r9
movl 0x8(%r9), %r10d
movzbl %al, %edx
cmovsl %r10d, %edx
cmovsl %r10d, %ecx
cmovnsq %r9, %rsi
testb %r8b, %r8b
jns 0x19915
movl 0x8(%rdi), %r8d
movq (%rdi), %rdi
jmp 0x19919
xorl $0xf, %r8d
subl %ecx, %r8d
leaq 0x163ed(%rip), %r9      # 0x2fd10
testq %rcx, %rcx
je 0x19961
leaq (%rdi,%r8), %r11
xorl %r10d, %r10d
movzbl (%r11,%r10), %ebx
movb (%rbx,%r9), %bpl
andb $0x20, %bpl
orb %bl, %bpl
movzbl (%rsi,%r10), %ebx
movb (%rbx,%r9), %r14b
andb $0x20, %r14b
orb %bl, %r14b
cmpb %r14b, %bpl
jne 0x19964
incq %r10
cmpq %r10, %rcx
jne 0x1992f
movq %rcx, %r10
jmp 0x19964
xorl %r10d, %r10d
cmpq %rdx, %r10
jne 0x19971
xorl %r11d, %r11d
movq %r8, %r10
jmp 0x19991
testq %r8, %r8
je 0x19984
movq %r8, %r10
decq %r10
movb $0x1, %r11b
movq %rax, %r8
jmp 0x19991
movq $-0x1, %r8
xorl %r10d, %r10d
xorl %r11d, %r11d
movq %r8, %rax
movq %r10, %r8
testb %r11b, %r11b
jne 0x19923
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/string.cpp
// Function: cstring::istartswith(cstring) const
bool cstring::istartswith(cstring other) const
{
	if (other.length() > this->length()) return false;
	const char* a = (char*)this->ptr();
	const char* b = (char*)other.ptr();
	for (size_t i=0;i<other.length();i++)
	{
		if (tolower(a[i]) != tolower(b[i])) return false;
	}
	return true;
}

// Assembly:
movq %rsi, -0x10(%rsp)
movq %rdx, -0x8(%rsp)
movzbl -0x1(%rsp), %eax
movl %eax, %ecx
xorl $0xf, %ecx
testb %al, %al
cmovnsl %ecx, %edx
movzbl 0xf(%rdi), %r8d
testb %r8b, %r8b
jns 0x199dd
movl 0x8(%rdi), %r9d
jmp 0x199e4
movl %r8d, %r9d
xorl $0xf, %r9d
cmpl %r9d, %edx
jbe 0x199ec
xorl %eax, %eax
retq
testb %r8b, %r8b
jns 0x199f4
movq (%rdi), %rdi
testb %al, %al
leaq -0x10(%rsp), %rax
cmovsl 0x8(%rax), %ecx
cmovnsq %rax, %rsi
testl %ecx, %ecx
sete %al
je 0x199eb
xorl %eax, %eax
leaq 0x162fd(%rip), %rdx     # 0x2fd10
movzbl (%rdi,%rax), %r8d
movb (%r8,%rdx), %r9b
andb $0x20, %r9b
orb %r8b, %r9b
movzbl (%rsi,%rax), %r8d
movb (%r8,%rdx), %r10b
andb $0x20, %r10b
orb %r8b, %r10b
cmpb %r10b, %r9b
jne 0x199e9
incq %rax
cmpq %rax, %rcx
jne 0x19a13
movb $0x1, %al
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/string.cpp
// Function: cstring::iendswith(cstring) const
bool cstring::iendswith(cstring other) const
{
	if (other.length() > this->length()) return false;
	const char* a = (char*)this->ptr()+this->length()-other.length();
	const char* b = (char*)other.ptr();
	for (size_t i=0;i<other.length();i++)
	{
		if (tolower(a[i]) != tolower(b[i])) return false;
	}
	return true;
}

// Assembly:
movq %rsi, -0x10(%rsp)
movq %rdx, -0x8(%rsp)
movzbl -0x1(%rsp), %eax
movl %eax, %ecx
xorl $0xf, %ecx
testb %al, %al
cmovnsl %ecx, %edx
movzbl 0xf(%rdi), %r8d
testb %r8b, %r8b
jns 0x19a6d
movl 0x8(%rdi), %r9d
jmp 0x19a74
movl %r8d, %r9d
xorl $0xf, %r9d
cmpl %r9d, %edx
jbe 0x19a7c
xorl %eax, %eax
retq
movl %r8d, %r9d
xorl $0xf, %r9d
testb %r8b, %r8b
movq (%rdi), %rdx
cmovnsq %rdi, %rdx
cmovsl 0x8(%rdi), %r9d
testb %al, %al
leaq -0x10(%rsp), %rax
cmovsl 0x8(%rax), %ecx
cmovnsq %rax, %rsi
testl %ecx, %ecx
sete %al
je 0x19a7b
addq %r9, %rdx
subq %rcx, %rdx
xorl %eax, %eax
leaq 0x16259(%rip), %rdi     # 0x2fd10
movzbl (%rdx,%rax), %r8d
movb (%r8,%rdi), %r9b
andb $0x20, %r9b
orb %r8b, %r9b
movzbl (%rsi,%rax), %r8d
movb (%r8,%rdi), %r10b
andb $0x20, %r10b
orb %r8b, %r10b
cmpb %r10b, %r9b
jne 0x19a79
incq %rax
cmpq %rax, %rcx
jne 0x19ab7
movb $0x1, %al
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/string.cpp
// Function: cstring::csplit(cstring, unsigned long) const
array<cstring> cstring::csplit(cstring sep, size_t limit) const
{
	array<cstring> ret;
	const uint8_t * data = ptr();
	const uint8_t * dataend = ptr()+length();
	
	while (ret.size() < limit)
	{
		const uint8_t * next = (uint8_t*)memmem(data, dataend-data, sep.ptr(), sep.length());
		if (!next) break;
		ret.append(arrayview<uint8_t>(data, next-data));
		data = next+sep.length();
	}
	ret.append(arrayview<uint8_t>(data, dataend-data));
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %rax
movq %rdx, (%rax)
movq %rcx, 0x8(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movzbl 0xf(%rsi), %eax
movl %eax, %r15d
xorl $0xf, %r15d
testb %al, %al
movq (%rsi), %r12
cmovsl 0x8(%rsi), %r15d
cmovnsq %rsi, %r12
addq %r12, %r15
leaq 0x18(%rsp), %r13
cmpq %r14, 0x8(%rbx)
jae 0x19dfa
movq %r15, %rsi
subq %r12, %rsi
movzbl 0x17(%rsp), %eax
movl %eax, %ecx
xorl $0xf, %ecx
testb %al, %al
movq 0x8(%rsp), %rdx
leaq 0x8(%rsp), %rax
cmovnsq %rax, %rdx
cmovsl 0x10(%rsp), %ecx
movq %r12, %rdi
callq 0x3b51
movq %rax, %rbp
testq %rax, %rax
je 0x19df5
movq %rbp, %rdx
subq %r12, %rdx
movq %r13, %rdi
movq %r12, %rsi
xorl %ecx, %ecx
callq 0x5040
movq 0x8(%rbx), %rsi
movq %rbx, %rdi
movq %r13, %rdx
callq 0x12632
movzbl 0x17(%rsp), %eax
movl %eax, %r12d
xorl $0xf, %r12d
testb %al, %al
cmovsl 0x10(%rsp), %r12d
addq %rbp, %r12
testq %rbp, %rbp
jne 0x19d81
subq %r12, %r15
leaq 0x18(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x5040
movq 0x8(%rbx), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x12632
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop