LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/string.cpp
// Function: cstring::crsplit(cstring, unsigned long) const
array<cstring> cstring::crsplit(cstring sep, size_t limit) const
{
	array<cstring> ret;
	const uint8_t * datastart = ptr();
	const uint8_t * data = ptr()+length();
	
	const uint8_t * sepp = sep.ptr();
	size_t sepl = sep.length();
	
	while (ret.size() < limit)
	{
		if (datastart+sepl > data) break;
		const uint8_t * next = data-sepl;
		while (memcmp(next, sepp, sepl) != 0)
		{
			if (datastart==next) goto done;
			next--;
		}
		ret.insert(0, arrayview<uint8_t>(next+sepl, data-(next+sepl)));
		data = next;
	}
done:
	ret.insert(0, arrayview<uint8_t>(datastart, data-datastart));
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %r15
leaq 0x48(%rsp), %rax
movq %rdx, (%rax)
movq %rcx, 0x8(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movzbl 0xf(%rsi), %ecx
movl %ecx, %ebp
xorl $0xf, %ebp
testb %cl, %cl
movq (%rsi), %r14
cmovnsq %rsi, %r14
cmovsl 0x8(%rsi), %ebp
addq %r14, %rbp
movzbl 0xf(%rax), %ecx
movl %ecx, %r13d
xorl $0xf, %r13d
testb %cl, %cl
cmovnsq %rax, %r15
movq %r8, 0x30(%rsp)
cmovsl 0x8(%rax), %r13d
leaq (%r14,%r13), %rax
movq %rax, 0x28(%rsp)
movq %r13, %rax
negq %rax
movq %rax, 0x20(%rsp)
movq %rdi, 0x8(%rsp)
movq 0x30(%rsp), %rax
cmpq %rax, 0x8(%rdi)
jae 0x19f5d
cmpq %rbp, 0x28(%rsp)
ja 0x19f5d
movq 0x20(%rsp), %rax
leaq (%rax,%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x3380
testl %eax, %eax
je 0x19ee3
cmpq %r14, %r12
je 0x19f46
decq %r12
jmp 0x19ec7
leaq (%r12,%r13), %rsi
subq %rsi, %rbp
xorl %ebx, %ebx
leaq 0x38(%rsp), %rdi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x5040
movups 0x38(%rsp), %xmm0
movaps %xmm0, 0x10(%rsp)
movq 0x8(%rsp), %rbp
movq 0x8(%rbp), %rsi
incq %rsi
movq %rbp, %rdi
callq 0x124e8
movq (%rbp), %rsi
movq 0x8(%rbp), %rdx
leaq 0x10(%rsi), %rdi
shlq $0x4, %rdx
addq $-0x10, %rdx
callq 0x3600
movq %rbp, %rdi
movq (%rbp), %rax
movaps 0x10(%rsp), %xmm0
movups %xmm0, (%rax)
movq %r12, %rbp
jmp 0x19f50
movl $0x6, %ebx
movq 0x8(%rsp), %rdi
testl %ebx, %ebx
je 0x19ea4
cmpl $0x6, %ebx
jne 0x19fc8
subq %r14, %rbp
leaq 0x38(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x5040
movups (%r15), %xmm0
movaps %xmm0, 0x10(%rsp)
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rsi
incq %rsi
movq 0x8(%rsp), %rdi
callq 0x124e8
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdx
leaq 0x10(%rsi), %rdi
shlq $0x4, %rdx
addq $-0x10, %rdx
callq 0x3600
movq 0x8(%rsp), %rax
movq (%rax), %rcx
movaps 0x10(%rsp), %xmm0
movups %xmm0, (%rcx)
jmp 0x19fda
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x3430
movq 0x8(%rsp), %rax
addq $0x58, %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/string.cpp
// Function: cstring::cspliti(cstring, unsigned long) const
array<cstring> cstring::cspliti(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+sep.length()));
		data = next+sep.length();
	}
	if (dataend != data)
		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, 0x10(%rsp)
movq %rdi, %rbx
movq %rsp, %rax
movq %rdx, (%rax)
movq %rcx, 0x8(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movzbl 0xf(%rsi), %eax
movl %eax, %r14d
xorl $0xf, %r14d
testb %al, %al
movq (%rsi), %r12
cmovsl 0x8(%rsi), %r14d
cmovnsq %rsi, %r12
addq %r12, %r14
movq 0x10(%rsp), %rax
cmpq %rax, 0x8(%rbx)
jae 0x1a0ca
movq %r14, %rsi
subq %r12, %rsi
movzbl 0xf(%rsp), %r15d
movl %r15d, %r13d
xorl $0xf, %r13d
testb %r15b, %r15b
movq (%rsp), %rdx
movq %rsp, %rax
cmovnsq %rax, %rdx
movl 0x8(%rsp), %ecx
cmovnsl %r13d, %ecx
movq %r12, %rdi
callq 0x3b51
movq %rax, %rbp
testq %rax, %rax
je 0x1a0c1
movq %rbp, %rax
subq %r12, %rax
testb %r15b, %r15b
cmovsl 0x8(%rsp), %r13d
addq %rax, %r13
leaq 0x18(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x5040
movq 0x8(%rbx), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x12632
movzbl 0xf(%rsp), %eax
movl %eax, %r12d
xorl $0xf, %r12d
testb %al, %al
cmovsl 0x8(%rsp), %r12d
addq %rbp, %r12
testq %rbp, %rbp
jne 0x1a02c
subq %r12, %r14
je 0x1a0f3
leaq 0x18(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x5040
movq 0x8(%rbx), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x12632
movq %rbx, %rax
addq $0x28, %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/string.cpp
// Function: cstring::csplit(bool (*)(unsigned char const*, unsigned char const*&, unsigned char const*&), unsigned long) const
array<cstring> cstring::csplit(bool(*find)(const uint8_t * start, const uint8_t * & at, const uint8_t * & end), size_t limit) const
{
	array<cstring> ret;
	
	const uint8_t * data = ptr();
	const uint8_t * dataend = ptr()+length();
	
	const uint8_t * gstart = data;
	const uint8_t * at = gstart;
	
	while (ret.size() < limit && at < dataend)
	{
		const uint8_t * mat = at;
		const uint8_t * mend = dataend;
		if (!find(data, mat, mend) || (gstart == mat && mat == mend))
		{
			at++;
			continue;
		}
		
		ret.append(arrayview<uint8_t>(gstart, mat-gstart));
		gstart = mend;
		at = gstart;
	}
	ret.append(arrayview<uint8_t>(gstart, dataend-gstart));
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movzbl 0xf(%rsi), %edi
movl %edi, %eax
xorl $0xf, %eax
testb %dil, %dil
movq (%rsi), %r13
cmovnsq %rsi, %r13
cmovsl 0x8(%rsi), %eax
movq %rdx, 0x10(%rsp)
leaq (%rax,%r13), %r14
cmpq %rcx, 0x8(%rbx)
jae 0x1a3c1
testl %eax, %eax
je 0x1a3c1
movq %rcx, %r12
movq %r13, %r15
movq %r13, %rbp
movq %r15, 0x8(%rsp)
movq %r14, (%rsp)
movq %r13, %rdi
leaq 0x8(%rsp), %rsi
movq %rsp, %rdx
callq *0x10(%rsp)
testb %al, %al
je 0x1a384
movq 0x8(%rsp), %rdx
cmpq %rdx, %rbp
jne 0x1a389
cmpq (%rsp), %rdx
jne 0x1a389
incq %r15
jmp 0x1a3b4
subq %rbp, %rdx
leaq 0x18(%rsp), %r15
movq %r15, %rdi
movq %rbp, %rsi
xorl %ecx, %ecx
callq 0x5040
movq 0x8(%rbx), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x12632
movq (%rsp), %rbp
movq %rbp, %r15
cmpq %r12, 0x8(%rbx)
jae 0x1a3c4
cmpq %r14, %r15
jb 0x1a358
jmp 0x1a3c4
movq %r13, %rbp
subq %rbp, %r14
leaq 0x18(%rsp), %r12
movq %r12, %rdi
movq %rbp, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x5040
movq 0x8(%rbx), %rsi
movq %rbx, %rdi
movq %r12, %rdx
callq 0x12632
movq %rbx, %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/string.cpp
// Function: string::compare3(cstring, cstring)
int string::compare3(cstring a, cstring b)
{
	size_t cmplen = min(a.length(), b.length());
	int ret = memcmp(a.bytes().ptr(), b.bytes().ptr(), cmplen);
	
	if (ret) return ret;
	else return a.length() - b.length();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rax
movq %rsi, %rdx
leaq 0x18(%rsp), %r8
movq %rdi, (%r8)
movq %rsi, 0x8(%r8)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %rcx, 0x8(%rsi)
movzbl 0xf(%r8), %r15d
movl %r15d, %ebx
xorl $0xf, %ebx
movzbl 0xf(%rsi), %r14d
movl %r14d, %ebp
xorl $0xf, %ebp
testb %r14b, %r14b
cmovnsl %ebp, %ecx
cmovsq %rax, %rsi
testb %r15b, %r15b
cmovnsl %ebx, %edx
cmovnsq %r8, %rdi
cmpl %edx, %ecx
cmovbl %ecx, %edx
callq 0x3100
testl %eax, %eax
jne 0x1a4f4
testb %r15b, %r15b
jns 0x1a4e7
movl 0x20(%rsp), %ebx
testb %r14b, %r14b
jns 0x1a4f0
movl 0x10(%rsp), %ebp
subl %ebp, %ebx
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/string.cpp
// Function: string::icompare3(cstring, cstring)
int string::icompare3(cstring a, cstring b)
{
	int ret_i = a.length() - b.length();
	
	size_t cmplen = min(a.length(), b.length());
	const uint8_t* ab = a.bytes().ptr();
	const uint8_t* bb = b.bytes().ptr();
	for (size_t n=0; n<cmplen; n++)
	{
		if (ab[n] != bb[n])
		{
			if (ret_i == 0) ret_i = ab[n] - bb[n];
			
			uint8_t ac = toupper(ab[n]);
			uint8_t bc = toupper(bb[n]);
			if (ac != bc) return ac - bc;
		}
	}
	
	return ret_i;
}

// Assembly:
pushq %rbp
pushq %rbx
leaq -0x10(%rsp), %rax
movq %rdi, (%rax)
movq %rsi, 0x8(%rax)
leaq -0x20(%rsp), %r8
movq %rdx, (%r8)
movq %rcx, 0x8(%r8)
movzbl 0xf(%rax), %r9d
movl %r9d, %r10d
xorl $0xf, %r10d
movzbl 0xf(%r8), %r11d
movl %r11d, %ebx
xorl $0xf, %ebx
testb %r11b, %r11b
cmovnsl %ebx, %ecx
cmovnsq %r8, %rdx
testb %r9b, %r9b
cmovnsl %r10d, %esi
cmovnsq %rax, %rdi
movl %ecx, %r8d
subl %esi, %r8d
cmovbl %ecx, %esi
negl %r8d
testl %esi, %esi
je 0x1a5bf
xorl %ecx, %ecx
leaq 0x157b1(%rip), %r9      # 0x2fd10
movzbl (%rdi,%rcx), %r11d
movzbl (%rdx,%rcx), %eax
cmpb %al, %r11b
je 0x1a5b2
movl %r11d, %ebx
movl %r11d, %ebp
subl %eax, %ebp
testl %r8d, %r8d
cmovel %ebp, %r8d
movb (%rbx,%r9), %bl
notb %bl
orb $-0x21, %bl
andb %r11b, %bl
movl %eax, %r11d
movb (%r11,%r9), %r11b
notb %r11b
orb $-0x21, %r11b
andb %al, %r11b
movzbl %r11b, %eax
movzbl %bl, %r11d
movl %r11d, %ebx
subl %eax, %ebx
cmpb %al, %r11b
cmovnel %ebx, %r10d
movl %r10d, %eax
jne 0x1a5c2
incq %rcx
movl %r8d, %eax
cmpq %rcx, %rsi
jne 0x1a55f
jmp 0x1a5c2
movl %r8d, %eax
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/string.cpp
// Function: cstring::upper() const
string cstring::upper() const
{
	string ret = *this;
	bytesw by = ret.bytes();
	for (size_t i=0;i<by.size();i++) by[i] = toupper(by[i]);
	return ret;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movups (%rsi), %xmm0
movq %rsp, %rsi
movups %xmm0, (%rsi)
callq 0x19372
movzbl 0xf(%rbx), %eax
testb %al, %al
jns 0x1a832
movl 0x8(%rbx), %eax
movq (%rbx), %rcx
jmp 0x1a839
xorq $0xf, %rax
movq %rbx, %rcx
testq %rax, %rax
je 0x1a865
xorl %edx, %edx
leaq 0x154c9(%rip), %rsi     # 0x2fd10
movzbl (%rcx,%rdx), %edi
movb (%rdi,%rsi), %r8b
notb %r8b
orb $-0x21, %r8b
andb %dil, %r8b
movb %r8b, (%rcx,%rdx)
incq %rdx
cmpq %rdx, %rax
jne 0x1a847
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/string.cpp
// Function: cstring::lower() const
string cstring::lower() const
{
	string ret = *this;
	bytesw by = ret.bytes();
	for (size_t i=0;i<by.size();i++) by[i] = tolower(by[i]);
	return ret;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movups (%rsi), %xmm0
movq %rsp, %rsi
movups %xmm0, (%rsi)
callq 0x19372
movzbl 0xf(%rbx), %eax
testb %al, %al
jns 0x1a894
movl 0x8(%rbx), %eax
movq (%rbx), %rcx
jmp 0x1a89b
xorq $0xf, %rax
movq %rbx, %rcx
testq %rax, %rax
je 0x1a8c4
xorl %edx, %edx
leaq 0x15467(%rip), %rsi     # 0x2fd10
movzbl (%rcx,%rdx), %edi
movb (%rdi,%rsi), %r8b
andb $0x20, %r8b
orb %dil, %r8b
movb %r8b, (%rcx,%rdx)
incq %rdx
cmpq %rdx, %rax
jne 0x1a8a9
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/string.cpp
// Function: cstring::matches_glob(cstring, bool) const
bool cstring::matches_glob(cstring pat, bool case_insensitive) const
{
	const uint8_t * s = ptr();
	const uint8_t * p = pat.ptr();
	const uint8_t * se = s + length();
	const uint8_t * pe = p + pat.length();
	
	const uint8_t * sp = se; // weirdo trick to not need a special case for the part before first asterisk
	const uint8_t * pp = p;
	if (p == pe)
		return (s == se);
	while (s < se)
	{
		if (p < pe && *p == '*')
		{
			p++;
			if (p == pe) return true;
			pp = p;
			sp = s+1;
		}
		else if (p < pe && s < se && (*p == *s || *p == '?' || (case_insensitive && tolower(*p) == tolower(*s))))
		{
			p++;
			s++;
		}
		else
		{
			p = pp;
			s = sp;
			sp++;
		}
	}
	while (p < pe && *p == '*') p++;
	return (p == pe);
}

// Assembly:
pushq %rbp
pushq %rbx
leaq -0x10(%rsp), %rax
movq %rsi, (%rax)
movq %rdx, 0x8(%rax)
movzbl 0xf(%rdi), %r9d
movl %r9d, %r8d
xorl $0xf, %r8d
testb %r9b, %r9b
movq (%rdi), %r9
cmovnsq %rdi, %r9
cmovsl 0x8(%rdi), %r8d
movzbl 0xf(%rax), %edi
movl %edi, %r10d
xorl $0xf, %r10d
testb %dil, %dil
cmovnsq %rax, %rsi
cmovnsl %r10d, %edx
testl %r8d, %r8d
sete %al
testl %edx, %edx
je 0x1aca1
addq %rsi, %rdx
testl %r8d, %r8d
je 0x1ac89
addq %r9, %r8
leaq 0x150f5(%rip), %rdi     # 0x2fd10
movq %r8, %r10
movq %rsi, %rax
cmpq %rdx, %rax
jae 0x1ac79
movzbl (%rax), %r11d
cmpq $0x2a, %r11
jne 0x1ac41
incq %rax
cmpq %rdx, %rax
je 0x1aca4
leaq 0x1(%r9), %r10
movq %rax, %rsi
jmp 0x1ac82
cmpq $0x3f, %r11
je 0x1ac71
movb (%r9), %bl
cmpb %bl, %r11b
je 0x1ac71
testb %cl, %cl
je 0x1ac79
movzbl %bl, %ebx
movb (%r11,%rdi), %bpl
andb $0x20, %bpl
orb %r11b, %bpl
movb (%rbx,%rdi), %r11b
andb $0x20, %r11b
orb %bl, %r11b
cmpb %r11b, %bpl
jne 0x1ac79
incq %rax
incq %r9
jmp 0x1ac82
movq %r10, %r9
incq %r10
movq %rsi, %rax
cmpq %r8, %r9
jb 0x1ac21
jmp 0x1ac96
movq %rsi, %rax
jmp 0x1ac96
cmpb $0x2a, (%rax)
jne 0x1ac9b
incq %rax
cmpq %rdx, %rax
jb 0x1ac8e
cmpq %rdx, %rax
sete %al
popq %rbx
popq %rbp
retq
movb $0x1, %al
jmp 0x1aca1
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/string.cpp
// Function: cstring::leftPad(unsigned long, unsigned char) const
string cstring::leftPad (size_t len, uint8_t ch) const {
	if (len >= length()) return *this;
	len -= length();
	
	array<uint8_t> pad;
	pad.resize(len);
	memset(pad.ptr(), ch, len);
	return cstring(pad) + *this;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %ecx, %ebp
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbx
movzbl 0xf(%rsi), %ecx
movl %ecx, %eax
xorl $0xf, %eax
testb %cl, %cl
movl 0x8(%rsi), %edx
cmovnsl %eax, %edx
cmpq %r12, %rdx
jbe 0x1ad73
testb %cl, %cl
cmovsl 0x8(%r15), %eax
subq %rax, %r12
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r14
movaps %xmm0, (%r14)
movq %r14, %rdi
movq %r12, %rsi
callq 0xda72
movq (%r14), %rdi
movzbl %bpl, %esi
movq %r12, %rdx
callq 0x3170
movq (%r14), %rsi
movq 0x8(%r14), %rdx
leaq 0x28(%rsp), %r12
movq %r12, %rdi
xorl %ecx, %ecx
callq 0x5040
movq (%r15), %r13
movq 0x8(%r15), %rbp
movups (%r12), %xmm0
movq %rsp, %r15
movups %xmm0, (%r15)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x19372
movq %r13, (%r15)
movq %rbp, 0x8(%r15)
movzbl 0xf(%r15), %eax
movq %rax, %rcx
xorq $0xf, %rcx
testb %al, %al
movl %ebp, %edx
cmovnsq %r15, %r13
cmovnsq %rcx, %rdx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x19466
movq (%r14), %rdi
callq 0x3430
jmp 0x1ad85
movups (%r15), %xmm0
movq %rsp, %rsi
movups %xmm0, (%rsi)
movq %rbx, %rdi
callq 0x19372
movq %rbx, %rax
addq $0x38, %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/stringconv-float.cpp
// Function: string tostring_float<float>(float)
string tostring_float(T f)
{
	// to_chars is quite close to my desired output format
	static_assert(std::numeric_limits<T>::is_iec559);
	
	// can be replaced with if (isnan(f)) f = fabs(f); under libstdc++,
	// but it's implementation defined if the weird ones are nan or nan(123), or inf or infinity, so let's just hardcode them
	if (UNLIKELY(isnan(f))) return "nan";
	if (UNLIKELY(isinf(f))) return signbit(f) ? "-inf" : "inf";
	
	bool fixed = ((fabs(f) >= (T)0.0001 && fabs(f) < (T)10000000000000000.0) || f == 0);
	
	char buf[32]; // longest possible is 24, give it a little extra
	char* end;
	if (fixed)
	{
		auto ret = std::to_chars(buf, buf+sizeof(buf), f, std::chars_format::fixed);
		end = ret.ptr;
	}
	else
	{
		auto ret = std::to_chars(buf, buf+sizeof(buf), f, std::chars_format::scientific);
		end = ret.ptr;
		if (end[-2] == '0' && end[-4] == 'e') // can't underflow, shortest possible output in scientific is 1e+01
		{
			end[-2] = end[-1];
			end--;
		}
	}
	return bytesr((uint8_t*)buf, end-buf);
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
ucomiss %xmm0, %xmm0
jp 0x1b696
movd %xmm0, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpl $0x7f800000, %eax       # imm = 0x7F800000
je 0x1b6a0
movaps 0x14842(%rip), %xmm1    # 0x2fe60
andps %xmm0, %xmm1
ucomiss 0x14870(%rip), %xmm1    # 0x2fe98
jb 0x1b637
movss 0x1486a(%rip), %xmm2    # 0x2fe9c
ucomiss %xmm1, %xmm2
ja 0x1b641
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x1b66d
jp 0x1b66d
leaq 0x20(%rsp), %rsi
movq %rsp, %rdi
movl $0x2, %edx
callq 0x3350
movq %rsp, %rsi
subq %rsi, %rax
movq %rbx, %rdi
movq %rax, %rdx
callq 0x1929c
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
retq
leaq 0x20(%rsp), %rsi
movq %rsp, %rdi
movl $0x1, %edx
callq 0x3350
cmpb $0x30, -0x2(%rax)
jne 0x1b653
cmpb $0x65, -0x4(%rax)
jne 0x1b653
movb -0x1(%rax), %cl
movb %cl, -0x2(%rax)
decq %rax
jmp 0x1b653
movq %rbx, %rdi
callq 0x3de2
jmp 0x1b664
movq %rbx, %rdi
callq 0x3dbc
jmp 0x1b664
nop
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/stringconv.cpp
// Function: tostring_ptr(char*, unsigned long long, unsigned long)
size_t tostring_ptr(char* buf, unsigned long long val, size_t len)
{
	char* iter = buf+len;
	while (iter > buf)
	{
		*--iter = '0'+val%10;
		val /= 10;
	}
	return len;
}

// Assembly:
movq %rdx, %rcx
testq %rdx, %rdx
jle 0x1b747
leaq (%rdi,%rcx), %r8
movabsq $-0x3333333333333333, %r9 # imm = 0xCCCCCCCCCCCCCCCD
movq %rsi, %rax
mulq %r9
shrq $0x3, %rdx
leal (%rdx,%rdx), %eax
leal (%rax,%rax,4), %eax
subl %eax, %esi
orb $0x30, %sil
movb %sil, -0x1(%r8)
decq %r8
movq %rdx, %rsi
cmpq %rdi, %r8
ja 0x1b722
movq %rcx, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/stringconv.cpp
// Function: tostringhex(arrayview<unsigned char>)
string tostringhex(arrayview<uint8_t> val)
{
	string ret;
	arrayvieww<uint8_t> retb = ret.construct(val.size()*2);
	for (size_t i=0;i<val.size();i++)
	{
		retb[i*2+0] = hexdigits[val[i]>>4];
		retb[i*2+1] = hexdigits[val[i]&15];
	}
	return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movb $0xf, 0xf(%rdi)
movb $0x0, (%rdi)
leaq (%rdx,%rdx), %rsi
callq 0x191a4
cmpb $0x0, 0xf(%r14)
movq %r14, %rax
jns 0x1b824
movq (%r14), %rax
testq %rbx, %rbx
je 0x1b85b
xorl %ecx, %ecx
leaq 0x1469e(%rip), %rdx     # 0x2fed0
movzbl (%r15,%rcx), %esi
shrl $0x4, %esi
movb (%rsi,%rdx), %sil
movb %sil, (%rax,%rcx,2)
movzbl (%r15,%rcx), %esi
andl $0xf, %esi
movb (%rsi,%rdx), %sil
movb %sil, 0x1(%rax,%rcx,2)
incq %rcx
cmpq %rcx, %rbx
jne 0x1b832
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/stringconv.cpp
// Function: tostringhex_ptr(char*, unsigned long long, unsigned long)
size_t tostringhex_ptr(char* buf, unsigned long long val, size_t len)
{
	char* iter = buf+len;
	while (iter > buf)
	{
		*--iter = hexdigits[val%16];
		val /= 16;
	}
	return len;
}

// Assembly:
movq %rdx, %rax
testq %rdx, %rdx
jle 0x1b892
leaq (%rdi,%rax), %rcx
leaq 0x14659(%rip), %rdx     # 0x2fed0
movl %esi, %r8d
andl $0xf, %r8d
movb (%r8,%rdx), %r8b
movb %r8b, -0x1(%rcx)
decq %rcx
shrq $0x4, %rsi
cmpq %rdi, %rcx
ja 0x1b877
retq
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/stringconv.cpp
// Function: fromstring(cstring, bool&)
bool fromstring(cstring s, bool& out)
{
	if (s == "false" || s == "0")
	{
		out = false;
		return true;
	}
	
	if (s == "true" || s == "1")
	{
		out = true;
		return true;
	}
	
	out = false;
	return false;
}

// Assembly:
shrq $0x38, %rsi
cmpq $0xa, %rsi
jne 0x1bb81
movl %edi, %eax
xorq $0x736c6166, %rax       # imm = 0x736C6166
movabsq $0xff00000000, %rcx     # imm = 0xFF00000000
andq %rdi, %rcx
movabsq $0x6500000000, %r8      # imm = 0x6500000000
xorq %rcx, %r8
orq %rax, %r8
je 0x1bb95
movq %rsi, %rcx
xorq $0xe, %rcx
movzbl %dil, %eax
xorq $0x30, %rax
orq %rcx, %rax
jne 0x1bb9c
movb $0x1, %al
xorl %r8d, %r8d
jmp 0x1bbc4
xorq $0xb, %rsi
movl %edi, %eax
xorq $0x65757274, %rax       # imm = 0x65757274
movb $0x1, %r8b
orq %rsi, %rax
movb $0x1, %al
je 0x1bbc4
movzbl %dil, %eax
xorq $0x31, %rax
orq %rax, %rcx
sete %r8b
movl %r8d, %eax
movb %r8b, (%rdx)
retq
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/stringconv.cpp
// Function: fromstringhex(cstring, arrayvieww<unsigned char>)
bool fromstringhex(cstring s, arrayvieww<uint8_t> val)
{
	if (val.size()*2 != s.length()) return false;
	bool ok = true;
	for (size_t i=0;i<val.size();i++)
	{
		ok &= fromstringhex(s.substr(i*2, i*2+2), val[i]);
	}
	return ok;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rdi, (%rsp)
movq %rsi, 0x8(%rsp)
movq 0x8(%rdx), %rax
addq %rax, %rax
movzbl 0xf(%rsp), %ecx
movl %ecx, %edx
xorl $0xf, %edx
testb %cl, %cl
cmovnsl %edx, %esi
cmpq %rsi, %rax
jne 0x1bc41
cmpq $0x0, 0x8(%rbx)
je 0x1bc45
movb $0x1, %bpl
xorl %esi, %esi
movq %rsp, %r14
xorl %r12d, %r12d
leal 0x2(%rsi), %r15d
movq %r14, %rdi
movl %r15d, %edx
callq 0x658a
movq (%rbx), %rcx
addq %r12, %rcx
movq %rax, %rdi
movq %rdx, %rsi
movq %rcx, %rdx
callq 0x1b8be
andb %al, %bpl
incq %r12
movl %r15d, %esi
cmpq 0x8(%rbx), %r12
jb 0x1bc0d
jmp 0x1bc48
xorl %ebp, %ebp
jmp 0x1bc48
movb $0x1, %bpl
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/stringconv.cpp
// Function: string tostring_inner<unsigned long long>(unsigned long long)
string tostring_inner(T val)
{
	size_t len = tostring_len(val);
	string ret;
	char* ptr = (char*)ret.construct(len).ptr();
	tostring_ptr(ptr, val, len);
	return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rsi, %r15
orq $0x1, %r15
bsrq %r15, %rax
leal (%rax,%rax,8), %ecx
leal (%rax,%rcx,2), %ecx
shrl $0x6, %ecx
shrq %cl, %r15
movq %rdi, %r14
leaq 0x14191(%rip), %rax     # 0x2fee0
addq (%rax,%rcx,8), %r15
shrq $0x38, %r15
leaq 0x1(%r15), %rsi
movb $0xf, 0xf(%rdi)
movb $0x0, (%rdi)
callq 0x191a4
cmpb $0x0, 0xf(%r14)
movq %r14, %rcx
jns 0x1bd74
movq (%r14), %rcx
leaq (%rcx,%r15), %rsi
incq %rsi
movabsq $-0x3333333333333333, %rdi # imm = 0xCCCCCCCCCCCCCCCD
movq %rbx, %rax
mulq %rdi
shrq $0x3, %rdx
leal (%rdx,%rdx), %eax
leal (%rax,%rax,4), %eax
subl %eax, %ebx
orb $0x30, %bl
movb %bl, -0x1(%rsi)
decq %rsi
movq %rdx, %rbx
cmpq %rcx, %rsi
ja 0x1bd85
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/stringconv.cpp
// Function: string tostringhex_inner<unsigned long long>(unsigned long long, unsigned long)
string tostringhex_inner(T val, size_t mindigits)
{
	uint8_t buf[16];
	uint8_t* bufend = buf+sizeof(buf);
	uint8_t* iter = bufend;
	do {
		*--iter = hexdigits[val%16];
		val /= 16;
	} while (val);
	while ((size_t)(bufend-iter) < mindigits) *--iter = '0';
	return string(bytesr(iter, bufend-iter));
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r15
movq %rdi, %rbx
movl $0xf, %eax
leaq 0x10(%rsp), %r14
xorl %edx, %edx
leaq 0x140fd(%rip), %rcx     # 0x2fed0
movq %rsi, %rdi
movl %esi, %r8d
andl $0xf, %r8d
movb (%r8,%rcx), %r8b
movb %r8b, (%rsp,%rax)
shrq $0x4, %rdi
incq %rdx
decq %rax
cmpq $0xf, %rsi
movq %rdi, %rsi
ja 0x1bdd6
movq %r15, %rax
subq %rdx, %rax
jbe 0x1be1f
movq %rsp, %r14
subq %r15, %r14
addq $0x10, %r14
movq %r14, %rdi
movl $0x30, %esi
movq %rax, %rdx
callq 0x3170
movq %r15, %rdx
jmp 0x1be22
subq %rdx, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1929c
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/strtoken.cpp
// Function: strtoken(char const*, char const*, char)
bool strtoken(const char * haystack, const char * needle, char separator)
{
	//token lists are annoyingly complex to parse
	//I suspect 'people using fixed-size buffers, then extension list grows and app explodes'
	// isn't the only reason GL_EXTENSIONS string was deprecated from OpenGL
	size_t nlen = strlen(needle);
	
	while (true)
	{
		const char * found = strstr(haystack, needle);
		if (!found) break;
		
		if ((found==haystack || found[-1]==separator) && // ensure the match is the start of a word
				(found[nlen]==separator || found[nlen]=='\0')) // ensure the match is the end of a word
		{
			return true;
		}
		
		haystack = strchr(found, separator); // try again, could've found GL_foobar_limited when looking for GL_foobar
		if (!haystack) return false;
	}
	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r12
movq %rsi, %rdi
callq 0x30f0
movq %rax, %r15
movq %r12, %rdi
movq %r14, %rsi
callq 0x30b0
testq %rax, %rax
je 0x1beaa
cmpq %r12, %rax
je 0x1be71
cmpb %bl, -0x1(%rax)
jne 0x1be8d
movb (%rax,%r15), %cl
cmpb %bl, %cl
sete %dl
testb %cl, %cl
sete %cl
orb %dl, %cl
je 0x1be8d
movl $0x1, %eax
movb $0x1, %bpl
jmp 0x1beaf
movq %rax, %rdi
movl %ebx, %esi
callq 0x30e0
movq %rax, %r12
xorl %eax, %eax
testq %r12, %r12
sete %al
setne %cl
andb %cl, %bpl
jmp 0x1beaf
movl $0x3, %eax
testl %eax, %eax
je 0x1be57
cmpl $0x3, %eax
jne 0x1beba
xorl %ebp, %ebp
andb $0x1, %bpl
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/thread/pthread-thr.cpp
// Function: thread_create(function<void ()>&&, priority_t)
void thread_create(function<void()>&& start, priority_t pri)
{
	pthread_attr_t attr;
	if (pthread_attr_init(&attr) < 0) abort();
	
	sched_param sched;
	if (pthread_attr_getschedparam(&attr, &sched) >= 0)
	{
		static const int8_t prios[] = { 0, -10, 10, 19 };
		sched.sched_priority = prios[pri];
		pthread_attr_setschedparam(&attr, &sched);
	}
	
	thread_create_inner(std::move(start), &attr);
	pthread_attr_destroy(&attr);
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x48, %rsp
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3450
testl %eax, %eax
js 0x1c272
leaq 0x10(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x3710
testl %eax, %eax
js 0x1c212
movl %ebp, %eax
leaq 0x13d7b(%rip), %rcx     # 0x2ff78
movsbl (%rax,%rcx), %eax
leaq 0x4(%rsp), %rsi
movl %eax, (%rsi)
leaq 0x10(%rsp), %rdi
callq 0x3160
movl $0x18, %edi
callq 0x1573c
movq (%rbx), %rcx
movq %rcx, (%rax)
movq 0x8(%rbx), %rcx
movq %rcx, 0x8(%rax)
movq 0x10(%rbx), %rcx
movq %rcx, 0x10(%rax)
movq $0x0, 0x10(%rbx)
leaq 0x8e(%rip), %rdx        # 0x1c2cf
leaq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movq %rax, %rcx
callq 0x36b0
testl %eax, %eax
jne 0x1c272
movq 0x8(%rsp), %rdi
callq 0x3220
leaq 0x10(%rsp), %rdi
callq 0x3630
addq $0x48, %rsp
popq %rbx
popq %rbp
retq
callq 0x3180
nop
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/thread/pthread-thr.cpp
// Function: mutex_rec::mutex_rec()
mutex_rec::mutex_rec() : mutex(noinit())
{
	pthread_mutexattr_t attr;
	pthread_mutexattr_init(&attr);
	pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
	pthread_mutex_init(&mut, &attr);
	pthread_mutexattr_destroy(&attr);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x4(%rsp), %r14
movq %r14, %rdi
callq 0x3060
movq %r14, %rdi
movl $0x1, %esi
callq 0x3540
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3560
movq %r14, %rdi
callq 0x3550
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/zip.cpp
// Function: zip::getendofcdr(arrayview<unsigned char>)
zip::endofcdr* zip::getendofcdr(arrayview<uint8_t> data)
{
	//must be somewhere in zip::, they're private
	static_assert(sizeof(zip::locfhead)==30);
	static_assert(sizeof(zip::centdirrec)==46);
	static_assert(sizeof(zip::endofcdr)==22);
	
	for (size_t commentlen=0;commentlen<65536;commentlen++)
	{
		if (data.size() < sizeof(endofcdr)+commentlen) return nullptr;
		
		size_t trystart = data.size()-sizeof(endofcdr)-commentlen;
		endofcdr* ret = (endofcdr*)data.slice(trystart, sizeof(endofcdr)).ptr();
		if (ret->signature == ret->signature_expected)
		{
			if (ret->diskid_this != 0) return nullptr;
			return ret;
		}
	}
	
	return nullptr;
}

// Assembly:
cmpq $0x16, %rdx
jb 0x1c42c
leaq -0x16(%rdx), %rax
movl $0xffff, %ecx           # imm = 0xFFFF
cmpq %rcx, %rax
cmovbq %rax, %rcx
incq %rcx
addq %rsi, %rdx
addq $-0x16, %rdx
movl (%rdx), %esi
cmpl $0x6054b50, %esi        # imm = 0x6054B50
jne 0x1c41c
cmpw $0x0, 0x4(%rdx)
movl $0x0, %eax
cmoveq %rdx, %rax
cmpl $0x6054b50, %esi        # imm = 0x6054B50
je 0x1c42e
decq %rdx
decq %rcx
jne 0x1c404
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/zip.cpp
// Function: zip::fh_data(arrayview<unsigned char>, zip::locfhead*, zip::centdirrec*)
arrayview<uint8_t> zip::fh_data(arrayview<uint8_t> data, locfhead* fh, centdirrec* cdr)
{
	size_t start = (uint8_t*)fh - data.ptr();
	size_t headlen = sizeof(locfhead) + fh->len_fname + fh->len_exfield;
	if (start+headlen > data.size()) return nullptr;
	return data.slice(start+headlen, cdr->size_comp);
}

// Assembly:
movq %rdx, %rdi
movzwl 0x1a(%rcx), %eax
movzwl 0x1c(%rcx), %edx
subq %rsi, %rcx
addq %rcx, %rax
leaq (%rdx,%rax), %rcx
addq $0x1e, %rcx
xorl %edx, %edx
movl $0x0, %eax
cmpq %rdi, %rcx
ja 0x1c7e5
movl 0x14(%r8), %edx
addq %rcx, %rsi
movq %rsi, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/zip.cpp
// Function: zip::replace_idx(unsigned long, arrayview<unsigned char>, long)
void zip::replace_idx(size_t id, arrayview<uint8_t> data, time_t date)
{
	if (!data)
	{
		filenames.remove(id);
		filedat.remove(id);
		return;
	}
	
	file& f = filedat[id];
	f.decomplen = data.size();
	f.crc32 = crc32(data);
	if (date) f.dosdate = todosdate(date); // else leave unchanged, or leave as 0
	
	array<uint8_t> comp;
	comp.resize(data.size());
	size_t complen = tdefl_compress_mem_to_mem(comp.ptr(), comp.size(), data.ptr(), data.size(), TDEFL_DEFAULT_MAX_PROBES);
	if (complen != 0 && complen < data.size())
	{
		comp.resize(complen);
		f.method = 8;
		f.data = std::move(comp);
	}
	else
	{
		f.method = 0;
		f.data = data;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r12
movq %rdi, %r14
testq %rcx, %rcx
je 0x1cebc
movq %r8, %r13
movq %rcx, %rbx
movq %rdx, %r15
movq 0x10(%r14), %rbp
shlq $0x5, %r12
leaq (%r12,%rbp), %r14
movl %ebx, (%rbp,%r12)
movq %rdx, %rdi
movq %rcx, %rsi
xorl %edx, %edx
callq 0x7990
movl %eax, 0x18(%rbp,%r12)
testq %r13, %r13
je 0x1ce4a
leaq 0x8(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x10(%rsp), %r12
movq %r12, %rsi
callq 0x3720
movl 0x14(%r12), %eax
movl 0x10(%r12), %ecx
movl 0xc(%r12), %edx
movl 0x8(%r12), %esi
movl (%r12), %edi
movl 0x4(%r12), %r8d
shll $0x19, %eax
addl $0x60000000, %eax       # imm = 0x60000000
shll $0x15, %ecx
addl $0x200000, %ecx         # imm = 0x200000
orl %eax, %ecx
shll $0x10, %edx
shll $0xb, %esi
orl %edx, %esi
shll $0x5, %r8d
orl %esi, %r8d
orl %ecx, %r8d
sarl %edi
orl %r8d, %edi
movl %edi, 0x1c(%r14)
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r12
movaps %xmm0, (%r12)
movq %r12, %rdi
movq %rbx, %rsi
callq 0xda72
movq (%r12), %rdi
movq 0x8(%r12), %rsi
movq %r15, %rdx
movq %rbx, %rcx
movl $0x80, %r8d
callq 0x2ce44
testq %rax, %rax
sete %cl
cmpq %rbx, %rax
setae %dl
orb %cl, %dl
jne 0x1cee4
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0xda72
movw $0x8, 0x4(%r14)
movaps (%rbx), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%rbx)
movq 0x8(%r14), %rdi
movups %xmm0, 0x8(%r14)
callq 0x3430
jmp 0x1cefd
movq %r14, %rdi
movq %r12, %rsi
callq 0x12f92
addq $0x10, %r14
movq %r14, %rdi
movq %r12, %rsi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1d646
movw $0x0, 0x4(%r14)
addq $0x8, %r14
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0xdf26
movq 0x10(%rsp), %rdi
callq 0x3430
addq $0x48, %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/zip.cpp
// Function: zip::write(cstring, arrayview<unsigned char>, long)
void zip::write(cstring name, arrayview<uint8_t> data, time_t date)
{
	size_t id = find_file(name);
	
	if (id == (size_t)-1)
	{
		if (!data) return;
		
		id = filenames.size();
		filenames.append(name);
		filedat.append();
		if (!date) date = time(NULL);
	}
	
	replace_idx(id, data, date);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %r15
movq %r8, %rbx
movq %rcx, (%rsp)
movq %rdx, %rbp
movq %rsi, %r14
movq %rdi, %r12
callq 0x1ca52
cmpq $-0x1, %rax
je 0x1cf69
movq %rax, %r13
movq %r12, %rdi
movq %r13, %rsi
movq (%rsp), %rdx
movq %rbx, %rcx
movq %r15, %r8
callq 0x1cd9c
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %rbx, %rbx
je 0x1cf5a
movq 0x8(%r12), %r13
leaq 0x18(%rsp), %rsi
movq %r14, (%rsi)
movq %rbp, 0x8(%rsi)
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x19372
movq 0x8(%r12), %rsi
movq %r12, %rdi
movq %r14, %rdx
callq 0x12e34
cmpb $0x0, 0xf(%r14)
jns 0x1cfad
movq 0x8(%rsp), %rdi
callq 0x3430
leaq 0x10(%r12), %rdi
callq 0x1d69c
testq %r15, %r15
jne 0x1cf45
xorl %edi, %edi
callq 0x3310
movq %rax, %r15
jmp 0x1cf45
nop
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/zip.cpp
// Function: zip::clean()
bool zip::clean()
{
	bool any = false;
	for (size_t i=0;i<filenames.size();i++)
	{
		if (filenames[i].startswith("__MACOSX/") || filenames[i].endswith("/.DS_Store") || filenames[i].iendswith("/thumbs.db"))
		{
			filenames.remove(i);
			filedat.remove(i);
			i--;
			any = true;
		}
	}
	return any;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
cmpq $0x0, 0x8(%rdi)
je 0x1d12d
movq %rdi, %rbx
leaq 0x10(%rdi), %r14
xorl %r15d, %r15d
xorl %ebp, %ebp
movq %r15, %r12
shlq $0x4, %r12
movq (%rbx), %r13
addq %r12, %r13
movl $0x9, %edx
leaq 0x28(%rsp), %rdi
leaq 0x12f51(%rip), %rsi     # 0x2ffc8
movl $0x1, %ecx
callq 0x5040
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %r13, %rdi
callq 0x196de
testb %al, %al
jne 0x1d102
movq (%rbx), %r13
addq %r12, %r13
movl $0xa, %edx
leaq 0x18(%rsp), %rdi
leaq 0x12f24(%rip), %rsi     # 0x2ffd2
movl $0x1, %ecx
callq 0x5040
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq %r13, %rdi
callq 0x19744
testb %al, %al
jne 0x1d102
addq (%rbx), %r12
movl $0xa, %edx
leaq 0x8(%rsp), %rdi
leaq 0x12efb(%rip), %rsi     # 0x2ffdd
movl $0x1, %ecx
callq 0x5040
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r12, %rdi
callq 0x19a44
testb %al, %al
je 0x1d11e
movq %rbx, %rdi
movq %r15, %rsi
callq 0x12f92
movq %r14, %rdi
movq %r15, %rsi
callq 0x1d646
decq %r15
movb $0x1, %bpl
incq %r15
cmpq 0x8(%rbx), %r15
jb 0x1d059
jmp 0x1d12f
xorl %ebp, %ebp
andb $0x1, %bpl
movl %ebp, %eax
addq $0x38, %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/zip.cpp
// Function: zip::repack()
void zip::repack()
{
	for (size_t i=0;i<filedat.size();i++)
	{
		array<uint8_t> data = read_idx(i);
		if (!data) continue;
		
		file& f = filedat[i];
		array<uint8_t> comp;
		comp.resize(data.size());
		size_t complen = tdefl_compress_mem_to_mem(comp.ptr(), comp.size(), data.ptr(), data.size(), TDEFL_DEFAULT_MAX_PROBES);
		if (complen != 0 && complen < f.data.size())
		{
			comp.resize(complen);
			f.method = 8;
			f.data = std::move(comp);
		}
	}
}

// Assembly:
cmpq $0x0, 0x18(%rdi)
je 0x1d236
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl $0x10, %r13d
xorl %r14d, %r14d
leaq 0x10(%rsp), %r15
movq %rsp, %r12
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x1cab8
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
je 0x1d20d
movq 0x10(%rbx), %rbp
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq %r12, %rdi
callq 0xda72
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
movl $0x80, %r8d
callq 0x2ce44
testq %rax, %rax
je 0x1d204
cmpq (%rbp,%r13), %rax
jae 0x1d204
movq %r12, %rdi
movq %rax, %rsi
callq 0xda72
movw $0x8, -0xc(%rbp,%r13)
movaps (%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%rsp)
movq -0x8(%rbp,%r13), %rdi
movups %xmm0, -0x8(%rbp,%r13)
callq 0x3430
movq (%rsp), %rdi
callq 0x3430
movq 0x10(%rsp), %rdi
callq 0x3430
incq %r14
addq $0x20, %r13
cmpq 0x18(%rbx), %r14
jb 0x1d171
addq $0x28, %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/zip.cpp
// Function: zip::sort()
void zip::sort()
{
	for (size_t a=0;a<filenames.size();a++)
	{
		size_t b;
		for (b=0;b<a;b++)
		{
			if (string::less(filenames[a], filenames[b])) break;
		}
		filenames.swap(a, b);
		filedat.swap(a, b);
	}
}

// Assembly:
cmpq $0x0, 0x8(%rdi)
je 0x1d332
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
xorl %r14d, %r14d
testq %r14, %r14
je 0x1d297
movl $0x8, %r12d
movq %r14, %r13
shlq $0x4, %r13
xorl %r15d, %r15d
movq (%rbx), %rax
movq (%rax,%r13), %rdi
movq 0x8(%rax,%r13), %rsi
movq -0x8(%rax,%r12), %rdx
movq (%rax,%r12), %rcx
callq 0x1a47e
testl %eax, %eax
js 0x1d29a
incq %r15
addq $0x10, %r12
cmpq %r15, %r14
jne 0x1d26b
jmp 0x1d29a
xorl %r15d, %r15d
cmpq %r15, %r14
je 0x1d318
movq (%rbx), %rax
movq %r14, %rcx
shlq $0x4, %rcx
movups (%rax,%rcx), %xmm0
movaps %xmm0, (%rsp)
movq %r15, %rdx
shlq $0x4, %rdx
movups (%rax,%rdx), %xmm0
movups %xmm0, (%rax,%rcx)
movq (%rbx), %rax
movaps (%rsp), %xmm0
movups %xmm0, (%rax,%rdx)
movq 0x10(%rbx), %rax
movq %r14, %rcx
shlq $0x5, %rcx
movups (%rax,%rcx), %xmm0
movups 0x10(%rax,%rcx), %xmm1
movaps %xmm1, 0x10(%rsp)
movaps %xmm0, (%rsp)
shlq $0x5, %r15
movups (%rax,%r15), %xmm0
movups 0x10(%rax,%r15), %xmm1
movups %xmm0, (%rax,%rcx)
movups %xmm1, 0x10(%rax,%rcx)
movq 0x10(%rbx), %rax
movaps (%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
movups %xmm1, 0x10(%rax,%r15)
movups %xmm0, (%rax,%r15)
incq %r14
cmpq 0x8(%rbx), %r14
jb 0x1d256
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/zlibhead.cpp
// Function: inflator::zlibhead::adler32(arrayview<unsigned char>, unsigned int)
uint32_t inflator::zlibhead::adler32(bytesr by, uint32_t adler_prev)
{
	// could simd this, but not much point, it's not a bottleneck
	uint32_t a = adler_prev&0xFFFF;
	uint32_t b = adler_prev>>16;
	
	size_t i = 0;
	while (i < (by.size()&~4095)) // 5552 is safe, but 4096 is easier to deal with
	{
		do {
			a += by[i++]; b += a;
			a += by[i++]; b += a;
			a += by[i++]; b += a;
			a += by[i++]; b += a;
		} while (i&4095);
		a %= 65521;
		b %= 65521;
	}
	while (i < (by.size()&~3))
	{
		a += by[i++]; b += a;
		a += by[i++]; b += a;
		a += by[i++]; b += a;
		a += by[i++]; b += a;
	}
	while (i < by.size())
	{
		a += by[i++];
		b += a;
	}
	a %= 65521;
	b %= 65521;
	
	return a | (b<<16);
}

// Assembly:
movl %edx, %eax
movzwl %ax, %ecx
shrl $0x10, %eax
movq %rsi, %r8
andq $-0x1000, %r8           # imm = 0xF000
je 0x1d968
movl $0x4, %edx
movl $0x80078071, %r9d       # imm = 0x80078071
movzbl -0x4(%rdi,%rdx), %r10d
addl %ecx, %r10d
addl %r10d, %eax
movzbl -0x3(%rdi,%rdx), %ecx
addl %r10d, %ecx
addl %ecx, %eax
movzbl -0x2(%rdi,%rdx), %r10d
addl %ecx, %r10d
addl %r10d, %eax
movzbl -0x1(%rdi,%rdx), %ecx
addl %r10d, %ecx
addl %ecx, %eax
testl $0xffc, %edx            # imm = 0xFFC
jne 0x1d962
movl %ecx, %r10d
imulq %r9, %r10
shrq $0x2f, %r10
imull $0xfff1, %r10d, %r10d   # imm = 0xFFF1
subl %r10d, %ecx
movl %eax, %r10d
imulq %r9, %r10
shrq $0x2f, %r10
imull $0xfff1, %r10d, %r10d   # imm = 0xFFF1
subl %r10d, %eax
cmpq %r8, %rdx
jae 0x1d96a
addq $0x4, %rdx
jmp 0x1d8ff
xorl %edx, %edx
movq %rsi, %r8
andq $-0x4, %r8
cmpq %r8, %rdx
jae 0x1d9a7
movzbl (%rdi,%rdx), %r9d
addl %ecx, %r9d
addl %r9d, %eax
movzbl 0x1(%rdi,%rdx), %ecx
addl %r9d, %ecx
addl %ecx, %eax
movzbl 0x2(%rdi,%rdx), %r9d
addl %ecx, %r9d
addl %r9d, %eax
movzbl 0x3(%rdi,%rdx), %ecx
addq $0x4, %rdx
addl %r9d, %ecx
addl %ecx, %eax
jmp 0x1d971
cmpq %rsi, %rdx
jae 0x1d9be
movzbl (%rdi,%rdx), %r8d
incq %rdx
addl %r8d, %ecx
addl %ecx, %eax
cmpq %rdx, %rsi
jne 0x1d9ac
movl %ecx, %edx
movl $0x80078071, %esi       # imm = 0x80078071
imulq %rsi, %rdx
shrq $0x2f, %rdx
imull $0xfff1, %edx, %edx     # imm = 0xFFF1
subl %edx, %ecx
movl %eax, %edx
imulq %rsi, %rdx
shrq $0x2f, %rdx
imull $0xfff1, %edx, %edx     # imm = 0xFFF1
subl %edx, %eax
shll $0x10, %eax
orl %ecx, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/arlib/zlibhead.cpp
// Function: inflator::zlibhead::inflate()
inflator::ret_t inflator::zlibhead::inflate()
{
	if (inf.m_state >= 254)
	{
	process_tail:
		inf.bits_refill_fast();
		if (inf.m_in_nbits < 32) return ret_more_input; // state 254 only needs 16 bits, but the other 16 will be used soon anyways
		if (inf.m_state == 254) // zlib header
		{
			uint32_t head = inf.bits_extract(16);
			if ((head&0x000F) != 0x0008 || // CMF.CF == DEFLATE (ZIP supports 8=DEFLATE and 0=uncompressed, but zlib only supports 8)
			// ignore 00F0 CMF.CINFO, inflator ignores window size (and it's almost always 7, the maximum)
			// ignore C000 FLG.FLEVEL, it's just informational, and there are too many compressors for it to make sense anymore
			    (head&0x2000) != 0x0000 || // FLG.FDICT, not supported
			    (__builtin_bswap16(head)%31) != 0) return ret_error; // FLG.FCHECK (1F00 bits), must be a multiple of 31
			// (are both 0 and 31 allowed in FCHECK if 0 is the correct checksum? I think they are)
			
			inf.m_state = 0;
		}
		else // zlib footer
		{
			inf.m_in_bits_buf >>= inf.m_in_nbits&7;
			inf.m_in_nbits &= ~7;
			uint32_t adler_head = __builtin_bswap32(inf.bits_extract(32)); // zlib header is big endian, even though DEFLATE is little...
			if (adler_head != adler) return ret_error;
			return ret_done;
		}
	}
	
	const uint8_t * out_prev = inf.m_out_at;
	ret_t ret = inf.inflate();
	adler = adler32(bytesr(out_prev, inf.m_out_at - out_prev), adler);
	if (ret != ret_done) return ret;
	
	inf.m_state = 255;
	goto process_tail;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
cmpb $-0x2, 0x8(%rdi)
jb 0x1da66
movq %r14, %rdi
callq 0x811c
movl 0xc(%rbx), %eax
cmpq $0x20, %rax
jb 0x1daa5
cmpb $-0x2, (%r14)
jne 0x1daac
movq %r14, %rdi
movl $0x10, %esi
callq 0x8192
movl %eax, %edx
andl $0x200f, %edx           # imm = 0x200F
movl $0x1, %ebp
xorl %ecx, %ecx
cmpl $0x8, %edx
jne 0x1da62
rolw $0x8, %ax
imull $0x7bdf, %eax, %eax     # imm = 0x7BDF
movzwl %ax, %eax
xorl %ecx, %ecx
cmpl $0x842, %eax            # imm = 0x842
ja 0x1da62
movb $0x0, (%r14)
movb $0x1, %cl
movl %r12d, %ebp
testb %cl, %cl
je 0x1dad2
movq 0x38(%rbx), %r12
movq %r14, %rdi
callq 0x8200
movl %eax, %r15d
movq 0x38(%rbx), %rsi
subq %r12, %rsi
movl (%rbx), %edx
movq %r12, %rdi
callq 0x1d8e0
movl %eax, (%rbx)
movl %r15d, %r12d
testl %r15d, %r15d
jne 0x1da97
movb $-0x1, (%r14)
movl %ebp, %r12d
movl %r12d, %ebp
testl %r15d, %r15d
je 0x1da03
jmp 0x1dad2
movl $0x2, %ebp
jmp 0x1dad2
movl %eax, %ecx
andb $0x7, %cl
shrq %cl, 0x10(%rbx)
andl $-0x8, %eax
movl %eax, 0xc(%rbx)
movq %r14, %rdi
movl $0x20, %esi
callq 0x8192
bswapl %eax
xorl %ebp, %ebp
cmpl (%rbx), %eax
setne %bpl
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/font.cpp
// Function: font::init_from_image(image const&)
void font::init_from_image(const image& img)
{
	memset(characters, 0, sizeof(characters));
	memset(width, 0, sizeof(uint8_t)*32);
	
	int cw = img.width/16;
	int ch = img.height/6;
	
	for (int cy=0;cy<6;cy++)
	for (int cx=0;cx<16;cx++)
	{
		uint8_t charid = 32 + cy*16 + cx;
		
		uint8_t maxbits = 1;
		for (int y=0;y<ch;y++)
		{
			int ty = cy*ch + y;
			uint32_t* pixels = img.pixels32 + img.stride/sizeof(uint32_t)*ty;
			
			uint8_t bits = 0;
			for (int x=0;x<cw;x++)
			{
				int tx = cx*cw + x;
				bits |= !(pixels[tx]&1) << x;
			}
			characters[charid][y] = bits;
			maxbits |= bits;
		}
		
		width[charid] = ilog2(maxbits)+2; // +1 because maxbits=1 has width 1 but log2(1)=0, +1 because letter spacing
	}
	
	height = ch;
	scale = 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq $0x0, 0x8(%rsp)
movl $0x420, %edx            # imm = 0x420
movq %rdi, (%rsp)
xorl %esi, %esi
callq 0x3170
movl (%r14), %eax
movl 0x4(%r14), %ecx
movl %eax, %esi
shrl $0x4, %esi
movl $0xaaaaaaab, %edx       # imm = 0xAAAAAAAB
movq %rcx, 0x28(%rsp)
imulq %rcx, %rdx
movq %rdx, %r8
shrq $0x22, %r8
shrq $0x20, %rdx
movl %esi, %ecx
shll $0x2, %ecx
movq %rcx, 0x20(%rsp)
andl $-0x4, %edx
movq %rdx, 0x10(%rsp)
xorl %edx, %edx
movq %rdx, 0x18(%rsp)
shlq $0x4, %rdx
addq $0x20, %rdx
movq %rdx, 0x30(%rsp)
xorl %r12d, %r12d
xorl %r13d, %r13d
movq 0x30(%rsp), %rcx
leaq (%rcx,%r13), %rbp
movb $0x1, %dil
cmpl $0x6, 0x28(%rsp)
jb 0x1e0b0
movq (%rsp), %rcx
leaq (%rcx,%rbp,8), %r10
movq 0x8(%rsp), %r15
xorl %edx, %edx
cmpl $0x10, %eax
jae 0x1e06a
xorl %ebx, %ebx
jmp 0x1e09d
movl 0xc(%r14), %r9d
shrl $0x2, %r9d
movq 0x10(%r14), %rcx
addq %r12, %rcx
imulq %r15, %r9
addq %rcx, %r9
xorl %ecx, %ecx
xorl %ebx, %ebx
movl (%r9,%rcx,4), %r11d
notl %r11d
andl $0x1, %r11d
shll %cl, %r11d
orb %r11b, %bl
incq %rcx
cmpq %rcx, %rsi
jne 0x1e084
movb %bl, (%rdx,%r10)
orb %bl, %dil
incq %rdx
addq $0x4, %r15
cmpq %r8, %rdx
jne 0x1e061
movzbl %dil, %ecx
bsrl %ecx, %ecx
xorl $0x7, %ecx
movb $0x9, %dl
subb %cl, %dl
movq (%rsp), %rcx
movb %dl, 0x400(%rcx,%rbp)
incq %r13
addq 0x20(%rsp), %r12
cmpq $0x10, %r13
jne 0x1e03f
movq 0x18(%rsp), %rdx
incq %rdx
movq 0x10(%rsp), %rcx
addq %rcx, 0x8(%rsp)
cmpq $0x6, %rdx
jne 0x1e027
movq (%rsp), %rax
movb %r8b, 0x480(%rax)
movb $0x1, 0x488(%rax)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Alcaro[P]bridges/font.cpp
// Function: font::measure(cstring, float)
uint32_t font::measure(cstring text, float spacesize)
{
	float ret = 0;
	for (size_t i=0;i<text.length();i++)
	{
		if (text[i] == ' ') ret += spacesize;
		ret += width[(uint8_t)text[i]] * scale;
	}
	return ret;
}

// 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
testl %edx, %edx
je 0x1e196
testb %al, %al
leaq -0x10(%rsp), %rax
cmovsq %rsi, %rax
movzbl 0x488(%rdi), %ecx
xorps %xmm1, %xmm1
xorl %esi, %esi
movabsq $0x100000000, %r8       # imm = 0x100000000
movq %rsi, %r9
sarq $0x20, %r9
movzbl (%rax,%r9), %r9d
cmpq $0x20, %r9
jne 0x1e16c
addss %xmm0, %xmm1
movaps %xmm1, %xmm2
movzbl 0x400(%rdi,%r9), %r9d
imull %ecx, %r9d
xorps %xmm1, %xmm1
cvtsi2ss %r9d, %xmm1
addss %xmm2, %xmm1
addq %r8, %rsi
decq %rdx
jne 0x1e156
cvttss2si %xmm1, %rax
retq
xorl %eax, %eax
retq
nop