LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: 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
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movb $0x0, -0x9(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x50(%rbp), %rdi
movq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
callq 0x27270
movq %rax, %rcx
movq -0x58(%rbp), %rax
cmpq %rcx, %rax
jae 0x44c06
movq -0x50(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x276d0
movq %rax, -0x60(%rbp)
leaq -0x28(%rbp), %rdi
leaq 0x1f495(%rip), %rsi     # 0x63fd2
callq 0x58c0
movq -0x60(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x37e20
testb $0x1, %al
jne 0x44bc5
movq -0x50(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x276d0
movq %rax, -0x68(%rbp)
leaq -0x38(%rbp), %rdi
leaq 0x1f469(%rip), %rsi     # 0x63fdc
callq 0x58c0
movq -0x68(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x38070
testb $0x1, %al
jne 0x44bc5
movq -0x50(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x276d0
movq %rax, -0x70(%rbp)
leaq -0x48(%rbp), %rdi
leaq 0x1f43e(%rip), %rsi     # 0x63fe7
callq 0x58c0
movq -0x70(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0x39060
testb $0x1, %al
jne 0x44bc5
jmp 0x44bf3
movq -0x50(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x27a40
movq -0x50(%rbp), %rdi
addq $0x10, %rdi
movq -0x18(%rbp), %rsi
callq 0x45a00
movq -0x18(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x18(%rbp)
movb $0x1, -0x9(%rbp)
jmp 0x44bf5
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x44b00
movb -0x9(%rbp), %al
andb $0x1, %al
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
addq $0x10, %rdi
callq 0x45ac0
movq %rax, %rcx
movq -0x68(%rbp), %rax
cmpq %rcx, %rax
jae 0x44db6
movq -0x60(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %ecx
callq 0x45ae0
leaq -0x20(%rbp), %rdi
callq 0xc600
testb $0x1, %al
jne 0x44c92
movl $0x4, -0x24(%rbp)
jmp 0x44d8f
movq -0x60(%rbp), %rdi
addq $0x10, %rdi
movq -0x10(%rbp), %rsi
callq 0x45a80
movq %rax, -0x30(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x74b0
leaq -0x20(%rbp), %rdi
callq 0x6290
movq %rax, %rsi
leaq -0x40(%rbp), %rdi
callq 0x1ce60
leaq -0x40(%rbp), %rdi
callq 0x7490
movq %rax, -0x80(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x6290
movq %rax, -0x78(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x7490
movq %rax, -0x70(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x6290
movq -0x80(%rbp), %rdi
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq %rax, %rcx
movl $0x80, %r8d
callq 0x60260
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0x44d7f
movq -0x48(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x30(%rbp), %rdi
addq $0x8, %rdi
callq 0x6290
movq %rax, %rcx
movq -0x88(%rbp), %rax
cmpq %rcx, %rax
jae 0x44d7f
movq -0x48(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x1ce60
movq -0x30(%rbp), %rax
movw $0x8, 0x4(%rax)
leaq -0x58(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1d320
movq -0x30(%rbp), %rdi
addq $0x8, %rdi
leaq -0x58(%rbp), %rsi
callq 0x1d440
leaq -0x58(%rbp), %rdi
callq 0x1d720
leaq -0x40(%rbp), %rdi
callq 0x1d720
movl $0x0, -0x24(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x1d720
movl -0x24(%rbp), %eax
testl %eax, %eax
je 0x44da3
jmp 0x44da1
jmp 0x44da5
jmp 0x44da5
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x44c3f
addq $0x90, %rsp
popq %rbp
retq
nop
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
callq 0x27270
movq %rax, %rcx
movq -0x48(%rbp), %rax
cmpq %rcx, %rax
jae 0x44eab
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x44e74
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x276d0
movq -0x40(%rbp), %rdi
movq (%rax), %rcx
movq %rcx, -0x28(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rsi
callq 0x276d0
movq (%rax), %rcx
movq %rcx, -0x38(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x2d160
testb $0x1, %al
jne 0x44e62
jmp 0x44e64
jmp 0x44e74
jmp 0x44e66
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x44e05
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x27360
movq -0x40(%rbp), %rdi
addq $0x10, %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x45b50
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x44ddc
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: Alcaro[P]bridges/arlib/zlibhead.cpp
// Function: inflator::zlibhead::inflate(arrayview<unsigned char>)
bytearray inflator::zlibhead::inflate(bytesr in)
{
	inflator::zlibhead inf;
	inf.set_input(in, true);
	bytearray ret;
	ret.resize(max(4096, in.size()*8));
	inf.set_output_first(ret);
again:
	inflator::ret_t err = inf.inflate();
	if (err == inflator::ret_more_output)
	{
		ret.resize(ret.size()*2);
		inf.set_output_grow(ret);
		goto again;
	}
	else if (err != inflator::ret_done || inf.unused_input() != 0) ret.reset();
	else ret.resize(inf.output_in_last());
	
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1340, %rsp           # imm = 0x1340
movq %rdi, -0x1330(%rbp)
movq %rdi, %rax
movq %rax, -0x1338(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x10(%rbp)
leaq -0x12e8(%rbp), %rdi
callq 0x170c0
movq -0x18(%rbp), %rax
movq %rax, -0x12f8(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x12f0(%rbp)
movq -0x12f8(%rbp), %rsi
movq -0x12f0(%rbp), %rdx
leaq -0x12e8(%rbp), %rdi
movl $0x1, %ecx
callq 0x17130
movq -0x1330(%rbp), %rdi
movb $0x0, -0x12f9(%rbp)
callq 0x74b0
leaq -0x18(%rbp), %rdi
callq 0x6290
movq %rax, %rsi
shlq $0x3, %rsi
movl $0x1000, %edi           # imm = 0x1000
callq 0x46890
movq -0x1330(%rbp), %rdi
movslq %eax, %rsi
callq 0x1ce60
movq -0x1330(%rbp), %rsi
leaq -0x1310(%rbp), %rdi
callq 0x74f0
leaq -0x12e8(%rbp), %rdi
leaq -0x1310(%rbp), %rsi
callq 0x170f0
leaq -0x12e8(%rbp), %rdi
callq 0x46570
movl %eax, -0x1314(%rbp)
cmpl $0x3, -0x1314(%rbp)
jne 0x4681c
movq -0x1330(%rbp), %rdi
callq 0x6290
movq -0x1330(%rbp), %rdi
movq %rax, %rsi
shlq %rsi
callq 0x1ce60
movq -0x1330(%rbp), %rsi
leaq -0x1328(%rbp), %rdi
callq 0x74f0
leaq -0x12e8(%rbp), %rdi
leaq -0x1328(%rbp), %rsi
callq 0x469e0
jmp 0x467bb
cmpl $0x0, -0x1314(%rbp)
jne 0x46837
leaq -0x12e8(%rbp), %rdi
callq 0x46a20
cmpq $0x0, %rax
je 0x46845
movq -0x1330(%rbp), %rdi
callq 0x1d1f0
jmp 0x46860
leaq -0x12e8(%rbp), %rdi
callq 0x17180
movq -0x1330(%rbp), %rdi
movq %rax, %rsi
callq 0x1ce60
jmp 0x46862
movb $0x1, -0x12f9(%rbp)
testb $0x1, -0x12f9(%rbp)
jne 0x4687e
movq -0x1330(%rbp), %rdi
callq 0x1d720
movq -0x1338(%rbp), %rax
addq $0x1340, %rsp           # imm = 0x1340
popq %rbp
retq
nop
// File: Alcaro[P]bridges/arlib/zlibhead.cpp
// Function: inflator::zlibhead::inflate(arrayvieww<unsigned char>, arrayview<unsigned char>)
bool inflator::zlibhead::inflate(bytesw out, bytesr in)
{
	inflator::zlibhead inf;
	inf.set_input(in, true);
	inf.set_output_first(out);
	return (inf.inflate() == inflator::ret_done && inf.output_in_last() == out.size() && inf.unused_input() == 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1320, %rsp           # imm = 0x1320
movq %rdi, -0x1318(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x8(%rbp)
movq %rdi, -0x18(%rbp)
leaq -0x12e8(%rbp), %rdi
callq 0x170c0
movq -0x10(%rbp), %rax
movq %rax, -0x12f8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x12f0(%rbp)
movq -0x12f8(%rbp), %rsi
movq -0x12f0(%rbp), %rdx
leaq -0x12e8(%rbp), %rdi
movl $0x1, %ecx
callq 0x17130
movq -0x1318(%rbp), %rsi
leaq -0x1308(%rbp), %rdi
callq 0x74f0
leaq -0x12e8(%rbp), %rdi
leaq -0x1308(%rbp), %rsi
callq 0x170f0
leaq -0x12e8(%rbp), %rdi
callq 0x46570
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x1309(%rbp)
jne 0x469bf
leaq -0x12e8(%rbp), %rdi
callq 0x17180
movq -0x1318(%rbp), %rdi
movq %rax, -0x1320(%rbp)
callq 0x6290
movq -0x1320(%rbp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x1309(%rbp)
jne 0x469bf
leaq -0x12e8(%rbp), %rdi
callq 0x46a20
cmpq $0x0, %rax
sete %al
movb %al, -0x1309(%rbp)
movb -0x1309(%rbp), %al
andb $0x1, %al
addq $0x1320, %rsp           # imm = 0x1320
popq %rbp
retq
// File: Alcaro[P]bridges/obj/resources.cpp
// Function: resources::init_inner_core()
RUN_ONCE_FN(init_inner)
{
decomp_images((image*)&arrowh, imgbuf_inflated+152289, imgbuf_inflated+200648, images_deflate, sizeof(images_deflate));
{
smallfont.init_from_image(smallfont_raw);
smallfont.scale = 2;
smallfont.height = 9;
smallfont.width[(uint8_t)' '] += 2; // extra cast to shut up Clang
}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x3a599(%rip), %rdi     # 0x81014
leaq 0x3a9de(%rip), %rdx     # 0x81460
movq %rdx, %rsi
addq $0x252e1, %rsi          # imm = 0x252E1
addq $0x30fc8, %rdx          # imm = 0x30FC8
leaq 0x1d766(%rip), %rcx     # 0x64200
movl $0x1a36, %r8d           # imm = 0x1A36
callq 0x46ae0
leaq 0x6b97c(%rip), %rdi     # 0xb2428
leaq 0x3a7e9(%rip), %rsi     # 0x8129c
callq 0x47100
movb $0x2, 0x6bdf1(%rip)     # 0xb28b0
movb $0x9, 0x6bde2(%rip)     # 0xb28a8
movzbl 0x6bd7b(%rip), %eax     # 0xb2848
addl $0x2, %eax
movb %al, 0x6bd72(%rip)      # 0xb2848
popq %rbp
retq
nopl (%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rsi, -0x30(%rbp)
movq %rdx, -0x28(%rbp)
movq %rdi, -0x38(%rbp)
movss %xmm0, -0x3c(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x50(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x60(%rbp)
leaq -0x30(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x58(%rbp)
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5cc0
movsbl %al, %eax
cmpl $0x0, %eax
jl 0x4735d
movq -0x58(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x5cc0
movsbl %al, %eax
xorl $0xf, %eax
movzbl %al, %eax
movl %eax, -0x14(%rbp)
jmp 0x47367
movq -0x58(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x60(%rbp), %rax
movl -0x14(%rbp), %ecx
cmpq %rcx, %rax
jae 0x473e0
movq -0x48(%rbp), %rax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0xa1c0
movsbl %al, %eax
cmpl $0x20, %eax
jne 0x47399
movss -0x3c(%rbp), %xmm0
addss -0x40(%rbp), %xmm0
movss %xmm0, -0x40(%rbp)
movq -0x48(%rbp), %rax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0xa1c0
movq -0x50(%rbp), %rcx
movzbl %al, %eax
movzbl 0x400(%rcx,%rax), %eax
movzbl 0x488(%rcx), %ecx
imull %ecx, %eax
cvtsi2ss %eax, %xmm0
addss -0x40(%rbp), %xmm0
movss %xmm0, -0x40(%rbp)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x47311
cvttss2si -0x40(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
// File: Alcaro[P]bridges/game.cpp
// Function: (anonymous namespace)::game_impl::run(game::input const&, image&, bool)
int run(const input& in, image& out, bool can_skip)
	{
		if (state == st_init)
			this->in = in;
		
		this->in_press = (in.keys & ~this->in.keys);
		if (in.lmousedown && !this->in.lmousedown)
			this->in_press |= 1<<k_click;
		if (in.rmousedown && !this->in.rmousedown)
			this->in_press |= 1<<k_rclick;
		this->prev_in = this->in;
		this->in = in;
		
		this->out.init_ref(out);
		
		if (state != st_init) // don't do too much the first frame
			gamegen_step();
		
		switch (state)
		{
			case st_init:
				init();
				to_title();
				[[fallthrough]];
			case st_title:
				title();
				break;
			case st_menu:
				menu();
				break;
			case st_ingame:
				return ingame(can_skip);
		}
		return 1;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %cl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
andb $0x1, %al
movb %al, -0x21(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpl $0x0, 0x40(%rax)
jne 0x4867e
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, 0x8(%rax)
movl 0x8(%rcx), %ecx
movl %ecx, 0x10(%rax)
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
movzbl 0xa(%rcx), %ecx
movzbl 0x12(%rax), %edx
xorl $-0x1, %edx
andl %edx, %ecx
movb %cl, 0x20(%rax)
movq -0x18(%rbp), %rax
testb $0x1, 0x8(%rax)
je 0x486b8
movq -0x30(%rbp), %rax
testb $0x1, 0x10(%rax)
jne 0x486b8
movq -0x30(%rbp), %rax
movzbl 0x20(%rax), %ecx
orl $0x40, %ecx
movb %cl, 0x20(%rax)
movq -0x18(%rbp), %rax
testb $0x1, 0x9(%rax)
je 0x486dd
movq -0x30(%rbp), %rax
testb $0x1, 0x11(%rax)
jne 0x486dd
movq -0x30(%rbp), %rax
movzbl 0x20(%rax), %ecx
orl $0x80, %ecx
movb %cl, 0x20(%rax)
movq -0x30(%rbp), %rdi
movq 0x8(%rdi), %rax
movq %rax, 0x14(%rdi)
movl 0x10(%rdi), %eax
movl %eax, 0x1c(%rdi)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
movq %rcx, 0x8(%rdi)
movl 0x8(%rax), %eax
movl %eax, 0x10(%rdi)
addq $0x28, %rdi
movq -0x20(%rbp), %rsi
callq 0x1af30
movq -0x30(%rbp), %rax
cmpl $0x0, 0x40(%rax)
je 0x48720
movq -0x30(%rbp), %rdi
callq 0x48aa0
movq -0x30(%rbp), %rax
movl 0x40(%rax), %eax
movq %rax, -0x38(%rbp)
subq $0x3, %rax
ja 0x48783
movq -0x38(%rbp), %rax
leaq 0x1d4fc(%rip), %rcx     # 0x65c38
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x30(%rbp), %rdi
callq 0x48d10
movq -0x30(%rbp), %rdi
callq 0x48d30
movq -0x30(%rbp), %rdi
callq 0x48d70
jmp 0x48783
movq -0x30(%rbp), %rdi
callq 0x49500
jmp 0x48783
movq -0x30(%rbp), %rdi
movb -0x21(%rbp), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x49bd0
movl %eax, -0x4(%rbp)
jmp 0x4878a
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: Alcaro[P]bridges/game.cpp
// Function: (anonymous namespace)::game_impl::game_params(int)
gamemap::genparams game_params(int id)
	{
		gamemap::genparams p = {};
		p.width = 7;
		p.height = 7;
		p.density = 0.4;
		p.quality = 20000;
		p.use_reef = true;
		p.use_large = true;
		//p.use_castle = true;
		//p.allow_ambiguous = true;
		//p.dense = true;
		
		if (id == 100)
		{
			p.density = 0.2;
			p.difficulty = 0.75; // this is somewhat high, but the low density makes all maps easy
		}
		if (id == 101)
		{
			p.difficulty = 1.0;
		}
		if (id == 102)
		{
			//larger maps have higher probabilitiy of having multiple solutions, so the remaining ones are usually easier
			p.difficulty = 1.0;
			p.width = 9;
			p.height = 9;
		}
		
		return p;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x20(%rbp)
movq %rdi, %rax
movq %rax, -0x28(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movb $0x0, -0x15(%rbp)
movb $0x0, (%rdi)
movb $0x0, 0x1(%rdi)
xorps %xmm0, %xmm0
movss %xmm0, 0x4(%rdi)
movb $0x0, 0x8(%rdi)
movb $0x0, 0x9(%rdi)
movb $0x0, 0xa(%rdi)
movb $0x0, 0xb(%rdi)
movb $0x0, 0xc(%rdi)
xorps %xmm0, %xmm0
movss %xmm0, 0x10(%rdi)
movl $0x0, 0x14(%rdi)
addq $0x18, %rdi
callq 0x4e750
movq -0x20(%rbp), %rdi
movb $0x7, (%rdi)
movb $0x7, 0x1(%rdi)
movss 0x196d4(%rip), %xmm0    # 0x65f54
movss %xmm0, 0x4(%rdi)
movl $0x4e20, 0x14(%rdi)     # imm = 0x4E20
movb $0x1, 0x9(%rdi)
movb $0x1, 0xa(%rdi)
cmpl $0x64, -0x14(%rbp)
jne 0x4c8b8
movq -0x20(%rbp), %rax
movss 0x196b6(%rip), %xmm0    # 0x65f5c
movss %xmm0, 0x4(%rax)
movss 0x196a5(%rip), %xmm0    # 0x65f58
movss %xmm0, 0x10(%rax)
cmpl $0x65, -0x14(%rbp)
jne 0x4c8cf
movq -0x20(%rbp), %rax
movss 0x19696(%rip), %xmm0    # 0x65f60
movss %xmm0, 0x10(%rax)
cmpl $0x66, -0x14(%rbp)
jne 0x4c8ed
movq -0x20(%rbp), %rax
movss 0x1967f(%rip), %xmm0    # 0x65f60
movss %xmm0, 0x10(%rax)
movb $0x9, (%rax)
movb $0x9, 0x1(%rax)
movb $0x1, -0x15(%rbp)
testb $0x1, -0x15(%rbp)
jne 0x4c900
movq -0x20(%rbp), %rdi
callq 0x4e710
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: Alcaro[P]bridges/game.cpp
// Function: (anonymous namespace)::birds::reset(bool)
void reset(bool force)
	{
		if (frame < -800/spd) return; // approaching but not on the screen = leave them there, so they appear earlier
		
		// first, pick a center for the birds, anywhere in the screen that's at least 100px from the edge
		xmid = 100 + g_rand(640-200);
		ymid = 100 + g_rand(480-200);
		
		// then pick a random direction
		angle = (float)g_rand.rand32()/65536/65536 * M_PI*2;
		
		frame = -800/spd;
		if (!force)
		{
			frame -= 60*60 + g_rand(60*60);
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpl $0xffffff38, 0xc(%rax)  # imm = 0xFFFFFF38
jge 0x4c93a
jmp 0x4ca07
leaq 0x34aef(%rip), %rdi     # 0x81430
movq %rdi, -0x20(%rbp)
movl $0x1b8, %esi            # imm = 0x1B8
callq 0x30060
movq -0x20(%rbp), %rdi
movl %eax, %ecx
movq -0x18(%rbp), %rax
addl $0x64, %ecx
cvtsi2ss %rcx, %xmm0
movss %xmm0, (%rax)
movl $0x118, %esi            # imm = 0x118
callq 0x30060
movq -0x20(%rbp), %rdi
movl %eax, %ecx
movq -0x18(%rbp), %rax
addl $0x64, %ecx
cvtsi2ss %rcx, %xmm0
movss %xmm0, 0x4(%rax)
callq 0x2fb20
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, %ecx
cvtsi2ss %rcx, %xmm0
movss 0x195c4(%rip), %xmm1    # 0x65f64
divss %xmm1, %xmm0
movss 0x195b8(%rip), %xmm1    # 0x65f64
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x195c4(%rip), %xmm1    # 0x65f80
mulsd %xmm1, %xmm0
movsd 0x195b0(%rip), %xmm1    # 0x65f78
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x8(%rax)
movl $0xffffff38, 0xc(%rax)  # imm = 0xFFFFFF38
testb $0x1, -0x9(%rbp)
jne 0x4ca07
leaq 0x34a47(%rip), %rdi     # 0x81430
movl $0xe10, %esi            # imm = 0xE10
callq 0x30060
movl %eax, %edx
movq -0x18(%rbp), %rax
addl $0xe10, %edx            # imm = 0xE10
movl 0xc(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0xc(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: Alcaro[P]bridges/game.cpp
// Function: (anonymous namespace)::game_impl::background()
void background()
	{
		if (tileset == 0)
		{
			out.insert_tile(0, 0, 640, 480, ((bgpos/15) & 1) ? resources::bg0b : resources::bg0);
		}
		if (tileset == 1)
		{
			int off = (bgpos/6)%21;
			out.insert_tile(0, 0, 640, 480, resources::bg1, off, 21-off);
		}
		if (tileset == 2)
		{
			out.insert_tile(0, 0, 640, 480, resources::bg2);
		}
		
		bgpos++;
		//must be a multiple of
		//- 30 (bg0 animation)
		//- 6*21 (bg1 animation)
		//- 90 (castle flag animation)
		bgpos %= 630;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpl $0x0, 0x48(%rax)
jne 0x4ca82
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x28, %rcx
movq %rcx, -0x20(%rbp)
movl 0x44(%rax), %eax
movl $0xf, %ecx
cltd
idivl %ecx
andl $0x1, %eax
cmpl $0x0, %eax
je 0x4ca59
leaq 0x34609(%rip), %rax     # 0x8105c
movq %rax, -0x28(%rbp)
jmp 0x4ca66
leaq 0x345e4(%rip), %rax     # 0x81044
movq %rax, -0x28(%rbp)
jmp 0x4ca66
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %r9
xorl %edx, %edx
movl $0x280, %ecx            # imm = 0x280
movl $0x1e0, %r8d            # imm = 0x1E0
movl %edx, %esi
callq 0x186b0
movq -0x18(%rbp), %rax
cmpl $0x1, 0x48(%rax)
jne 0x4cad9
movq -0x18(%rbp), %rdi
movl 0x44(%rdi), %eax
movl $0x6, %ecx
cltd
idivl %ecx
movl $0x15, %ecx
cltd
idivl %ecx
movl %edx, -0xc(%rbp)
addq $0x28, %rdi
movl -0xc(%rbp), %r10d
movl $0x15, %eax
subl -0xc(%rbp), %eax
xorl %edx, %edx
movl $0x280, %ecx            # imm = 0x280
movl $0x1e0, %r8d            # imm = 0x1E0
leaq 0x345aa(%rip), %r9      # 0x81074
movl %edx, %esi
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x18840
movq -0x18(%rbp), %rax
cmpl $0x2, 0x48(%rax)
jne 0x4cb06
movq -0x18(%rbp), %rdi
addq $0x28, %rdi
xorl %edx, %edx
movl $0x280, %ecx            # imm = 0x280
movl $0x1e0, %r8d            # imm = 0x1E0
leaq 0x3458d(%rip), %r9      # 0x8108c
movl %edx, %esi
callq 0x186b0
movq -0x18(%rbp), %rax
movl 0x44(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x44(%rax)
movl 0x44(%rax), %eax
movl $0x276, %ecx            # imm = 0x276
cltd
idivl %ecx
movq -0x18(%rbp), %rax
movl %edx, 0x44(%rax)
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: Alcaro[P]bridges/game.cpp
// Function: (anonymous namespace)::game_impl::to_game(int, bool)
void to_game(int id, bool use_kb)
	{
		state = st_ingame;
		
		game_load(id, use_kb);
		game_menu = false;
		game_menu_pos = 480;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
andb $0x1, %al
movb %al, -0xd(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
movl $0x3, 0x40(%rdi)
movl -0xc(%rbp), %esi
movb -0xd(%rbp), %al
andb $0x1, %al
movzbl %al, %edx
callq 0x4d210
movq -0x18(%rbp), %rax
movb $0x0, 0x24a74(%rax)
movl $0x1e0, 0x24a78(%rax)   # imm = 0x1E0
addq $0x20, %rsp
popq %rbp
retq
// File: Alcaro[P]bridges/gamemap.cpp
// Function: gamemap::reset()
void gamemap::reset()
{
	for (int y=0;y<height;y++)
	for (int x=0;x<width;x++)
	{
		island& here = map[y][x];
		
		here.totbridges = 0;
		if (here.bridges[0] <= 2) here.bridges[0] = 0;
		if (here.bridges[1] <= 2) here.bridges[1] = 0;
		if (here.bridges[2] <= 2) here.bridges[2] = 0;
		if (here.bridges[3] <= 2) here.bridges[3] = 0;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x20(%rbp), %rcx
movl -0xc(%rbp), %eax
cmpl 0x4(%rcx), %eax
jge 0x4f49e
movl $0x0, -0x10(%rbp)
movq -0x20(%rbp), %rcx
movl -0x10(%rbp), %eax
cmpl (%rcx), %eax
jge 0x4f48e
movq -0x20(%rbp), %rax
addq $0xc, %rax
movslq -0xc(%rbp), %rcx
imulq $0x4b0, %rcx, %rcx      # imm = 0x4B0
addq %rcx, %rax
movslq -0x10(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movb $0x0, 0x1(%rax)
movq -0x18(%rbp), %rax
movzbl 0x8(%rax), %eax
cmpl $0x2, %eax
jg 0x4f43f
movq -0x18(%rbp), %rax
movb $0x0, 0x8(%rax)
movq -0x18(%rbp), %rax
movzbl 0x9(%rax), %eax
cmpl $0x2, %eax
jg 0x4f454
movq -0x18(%rbp), %rax
movb $0x0, 0x9(%rax)
movq -0x18(%rbp), %rax
movzbl 0xa(%rax), %eax
cmpl $0x2, %eax
jg 0x4f469
movq -0x18(%rbp), %rax
movb $0x0, 0xa(%rax)
movq -0x18(%rbp), %rax
movzbl 0xb(%rax), %eax
cmpl $0x2, %eax
jg 0x4f47e
movq -0x18(%rbp), %rax
movb $0x0, 0xb(%rax)
jmp 0x4f480
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x4f3ee
jmp 0x4f490
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x4f3d7
popq %rbp
retq
// File: Alcaro[P]bridges/generate.cpp
// Function: gamemap::generator::generator(gamemap::genparams const&)
gamemap::generator::generator(const gamemap::genparams& par) : par(par)
{
	//WARNING: Even if this one is made constant, output will still be nondeterministic,
	//  due to threads finishing in varying order, making different maps seem superior;
	//  therefore, it is not allowed to override it.
	//A fixed random seed with exactly one thread will be deterministic.
	randseed = time_us() << 16;
	
#ifdef ARLIB_THREAD
	unsigned n_threads = thread_num_cores_idle();
	// don't spin up too many shortlived threads
	if (n_threads > par.quality / 500) n_threads = par.quality / 500;
	if (n_threads > 32) n_threads = 32; // more than 32 is just excessive, such high quality is pointless
	if (n_threads < 1) n_threads = 1;
	
	n_started = n_threads;
	n_more_threads = n_threads-1;
	thread_create(bind_this(&generator::threadproc), pri_idle);
#else
	n_started = 1;
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x50(%rbp)
movq -0x10(%rbp), %rsi
callq 0x538f0
movq -0x50(%rbp), %rdi
addq $0x30, %rdi
callq 0xe0b0
movq -0x50(%rbp), %rdi
addq $0x58, %rdi
callq 0x53940
movq -0x50(%rbp), %rax
movl $0x0, 0x84(%rax)
movl $0x0, 0x88(%rax)
movl $0xf423f, 0x8c(%rax)    # imm = 0xF423F
movl $0x0, 0x90(%rax)
movl $0x0, 0xa0(%rax)
movl $0xf423f, 0xa4(%rax)    # imm = 0xF423F
movb $0x0, 0xa8(%rax)
callq 0x42bc0
movq %rax, %rcx
movq -0x50(%rbp), %rax
shlq $0x10, %rcx
movq %rcx, 0x78(%rax)
callq 0x42ae0
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0x10(%rbp), %rax
movl 0x14(%rax), %eax
movl $0x1f4, %ecx            # imm = 0x1F4
xorl %edx, %edx
divl %ecx
movl %eax, %ecx
movl -0x44(%rbp), %eax
cmpl %ecx, %eax
jbe 0x4fda0
movq -0x10(%rbp), %rax
movl 0x14(%rax), %eax
movl $0x1f4, %ecx            # imm = 0x1F4
xorl %edx, %edx
divl %ecx
movl %eax, -0x14(%rbp)
cmpl $0x20, -0x14(%rbp)
jbe 0x4fdad
movl $0x20, -0x14(%rbp)
cmpl $0x1, -0x14(%rbp)
jae 0x4fdba
movl $0x1, -0x14(%rbp)
movq -0x50(%rbp), %rsi
movl -0x14(%rbp), %eax
movl %eax, 0x80(%rsi)
movb -0x14(%rbp), %al
decb %al
movb %al, 0xa9(%rsi)
leaq 0x47(%rip), %rax        # 0x4fe20
movq %rax, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x40(%rbp), %rdx
movq -0x38(%rbp), %rcx
leaq -0x30(%rbp), %rdi
callq 0x53960
leaq -0x30(%rbp), %rdi
movl $0x3, %esi
callq 0x429a0
leaq -0x30(%rbp), %rdi
callq 0x141d0
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: Alcaro[P]bridges/generate.cpp
// Function: gamemap::generator::threadproc()
void gamemap::generator::threadproc()
{
	gamemap map; // this object is huge, cache it to avoid pointless stack probing
	
	workitem w;
	synchronized(mut)
	{
		get_work(true, w);
		
#ifdef ARLIB_THREAD
		if (n_more_threads)
		{
			thread_create(bind_this(&generator::threadproc), pri_idle);
			n_more_threads--;
		}
#endif
	}
	
	while (true)
	{
		do_work(w, map);
		
		synchronized(mut)
		{
			finish_work(w);
			
			if (!get_work(false, w))
			{
				if (n_started == n_finished) sem.release();
				return; // not break, synchronized() uses a for loop internally
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x24a70, %rsp          # imm = 0x24A70
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x24a70(%rbp)
addq $0x30, %rsi
leaq -0x24a30(%rbp), %rdi
callq 0xe0f0
movq -0x24a70(%rbp), %rdi
movl $0x1, %esi
leaq -0x24a28(%rbp), %rdx
callq 0x4ffb0
movq -0x24a70(%rbp), %rax
cmpb $0x0, 0xa9(%rax)
je 0x4fedf
movq -0x24a70(%rbp), %rsi
leaq -0x60(%rip), %rax       # 0x4fe20
movq %rax, -0x24a58(%rbp)
movq $0x0, -0x24a50(%rbp)
movq -0x24a58(%rbp), %rdx
movq -0x24a50(%rbp), %rcx
leaq -0x24a48(%rbp), %rdi
callq 0x53960
leaq -0x24a48(%rbp), %rdi
movl $0x3, %esi
callq 0x429a0
leaq -0x24a48(%rbp), %rdi
callq 0x141d0
movq -0x24a70(%rbp), %rax
movb 0xa9(%rax), %cl
addb $-0x1, %cl
movb %cl, 0xa9(%rax)
leaq -0x24a30(%rbp), %rdi
callq 0xe120
movq -0x24a70(%rbp), %rdi
leaq -0x24a28(%rbp), %rsi
leaq -0x24a10(%rbp), %rdx
callq 0x50040
movq -0x24a70(%rbp), %rsi
addq $0x30, %rsi
leaq -0x24a60(%rbp), %rdi
callq 0xe0f0
movq -0x24a70(%rbp), %rdi
leaq -0x24a28(%rbp), %rsi
callq 0x52290
movq -0x24a70(%rbp), %rdi
xorl %esi, %esi
leaq -0x24a28(%rbp), %rdx
callq 0x4ffb0
testb $0x1, %al
jne 0x4ff79
movq -0x24a70(%rbp), %rcx
movl 0x80(%rcx), %eax
cmpl 0x88(%rcx), %eax
jne 0x4ff6d
movq -0x24a70(%rbp), %rdi
addq $0x58, %rdi
callq 0x539b0
movl $0x1, -0x24a64(%rbp)
jmp 0x4ff83
movl $0x0, -0x24a64(%rbp)
leaq -0x24a60(%rbp), %rdi
callq 0xe120
movl -0x24a64(%rbp), %eax
testl %eax, %eax
je 0x4ff9d
jmp 0x4ff9b
jmp 0x4ffa2
jmp 0x4feeb
addq $0x24a70, %rsp          # imm = 0x24A70
popq %rbp
retq
nopl (%rax,%rax)
// File: Alcaro[P]bridges/generate.cpp
// Function: gamemap::generator::get_work(bool, gamemap::generator::workitem&)
bool gamemap::generator::get_work(bool first, workitem& w)
{
	if (!first)
	{
		if (stop) return false;
		if (n_valid > 0 && n_started >= par.quality) return false;
		n_started++;
	}
	
	randseed++;
	w.seed = randseed;
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %sil, %al
movq %rdi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
testb $0x1, -0x11(%rbp)
jne 0x5001a
movq -0x28(%rbp), %rax
testb $0x1, 0xa8(%rax)
je 0x4ffe5
movb $0x0, -0x1(%rbp)
jmp 0x50039
movq -0x28(%rbp), %rax
cmpl $0x0, 0x84(%rax)
jbe 0x50007
movq -0x28(%rbp), %rcx
movl 0x80(%rcx), %eax
cmpl 0x14(%rcx), %eax
jb 0x50007
movb $0x0, -0x1(%rbp)
jmp 0x50039
movq -0x28(%rbp), %rax
movl 0x80(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x80(%rax)
movq -0x28(%rbp), %rax
movq 0x78(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x78(%rax)
movq 0x78(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
popq %rbp
retq
// File: Alcaro[P]bridges/generate.cpp
// Function: gamemap::generator::do_work(gamemap::generator::workitem&, gamemap&)
void gamemap::generator::do_work(workitem& w, gamemap& map)
{
	loc_generator lgen(map, par);
	lgen.generate_one(w.seed);
	
	//if (!map.finished()) abort();
	w.valid = true;
	if (map.numislands <= 1 && par.width*par.height >= 5) w.valid = false;
	if (!par.allow_ambiguous && map.solve_another()) w.valid = false;
	
	if (w.valid)
	{
		w.diff = map.difficulty();
		
		w.penalty = 0;
		if (!par.dense)
		{
			unsigned n_close = 0;
			
			for (int y=0;y<map.height;y++)
			for (int x=0;x<map.width;x++)
			{
				int idx = y*100+x;
				gamemap::island& here = map.get(idx);
				
				if (here.population < 0) continue;
				n_close += (here.bridgelen[0] == 1) + (here.bridgelen[3] == 1);
			}
			w.penalty += (unsigned)(5 * powf(n_close, 1.5f));
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdx
movq %rdx, -0x50(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x501e0
movq -0x10(%rbp), %rax
movq (%rax), %rsi
leaq -0x30(%rbp), %rdi
callq 0x50220
movq -0x10(%rbp), %rax
movb $0x1, 0x8(%rax)
movq -0x18(%rbp), %rax
cmpl $0x1, 0x8(%rax)
jg 0x500a6
movq -0x50(%rbp), %rcx
movzbl (%rcx), %eax
movzbl 0x1(%rcx), %ecx
imull %ecx, %eax
cmpl $0x5, %eax
jl 0x500a6
movq -0x10(%rbp), %rax
movb $0x0, 0x8(%rax)
movq -0x50(%rbp), %rax
testb $0x1, 0xc(%rax)
jne 0x500c7
movq -0x18(%rbp), %rdi
callq 0x542f0
testb $0x1, %al
jne 0x500bf
jmp 0x500c7
movq -0x10(%rbp), %rax
movb $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
testb $0x1, 0x8(%rax)
je 0x501d9
movq -0x18(%rbp), %rdi
callq 0x549b0
movl %eax, %edx
movq -0x50(%rbp), %rax
movq -0x10(%rbp), %rcx
movl %edx, 0xc(%rcx)
movq -0x10(%rbp), %rcx
movl $0x0, 0x10(%rcx)
testb $0x1, 0x8(%rax)
jne 0x501d7
movl $0x0, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x501a5
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x50195
imull $0x64, -0x38(%rbp), %eax
addl -0x3c(%rbp), %eax
movl %eax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
movl -0x40(%rbp), %eax
movzwl %ax, %esi
callq 0x4e8e0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jge 0x5015b
jmp 0x5018a
movq -0x48(%rbp), %rax
movsbl 0x4(%rax), %eax
cmpl $0x1, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movq -0x48(%rbp), %rcx
movsbl 0x7(%rcx), %ecx
cmpl $0x1, %ecx
sete %cl
andb $0x1, %cl
movzbl %cl, %ecx
addl %ecx, %eax
addl -0x34(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x50125
jmp 0x50197
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x5010e
movl -0x34(%rbp), %eax
cvtsi2ss %rax, %xmm0
movss 0x1643f(%rip), %xmm1    # 0x665f4
callq 0x45a0
movss 0x16436(%rip), %xmm1    # 0x665f8
mulss %xmm1, %xmm0
cvttss2si %xmm0, %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
addl 0x10(%rax), %ecx
movl %ecx, 0x10(%rax)
jmp 0x501d9
addq $0x50, %rsp
popq %rbp
retq
nop
// File: Alcaro[P]bridges/generate.cpp
// Function: gamemap::generator::finish_work(gamemap::generator::workitem&)
void gamemap::generator::finish_work(workitem& w)
{
	n_finished++;
	
	if (w.valid)
	{
		auto absdiff = [](unsigned a, unsigned b)->unsigned { if (a > b) return a-b; else return b-a; };
		
		n_valid++;
		
		if (w.diff > diff_max) diff_max = w.diff;
		if (w.diff < diff_min) diff_min = w.diff;
		
		unsigned ideal_diff = (diff_max-diff_min)*par.difficulty + diff_min;
//printf("%u,%u,%u=%u ",w.diff,ideal_diff,w.penalty,absdiff(w.diff,ideal_diff) + w.penalty);
//printf("%u,%u,%u=%u\n",best_diff, ideal_diff, best_pen,absdiff(best_diff,ideal_diff) + best_pen);
		if (diff_max<=diff_min || absdiff(w.diff, ideal_diff) + w.penalty <= absdiff(best_diff, ideal_diff) + best_pen)
		{
			best_seed = w.seed;
			best_diff = w.diff;
			best_pen = w.penalty;
//printf("%u-%u (#%u)\n",best_diff,w.penalty,n_valid);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movl 0x88(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x88(%rax)
movq -0x10(%rbp), %rax
testb $0x1, 0x8(%rax)
je 0x523dc
movq -0x20(%rbp), %rcx
movb 0x14359(%rip), %al      # 0x66628
movb %al, -0x11(%rbp)
movl 0x84(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x84(%rcx)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
cmpl 0x90(%rcx), %eax
jbe 0x52301
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0xc(%rcx), %ecx
movl %ecx, 0x90(%rax)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
cmpl 0x8c(%rcx), %eax
jae 0x52325
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0xc(%rcx), %ecx
movl %ecx, 0x8c(%rax)
movq -0x20(%rbp), %rcx
movl 0x90(%rcx), %edx
movl 0x8c(%rcx), %eax
movl %eax, %esi
subl %esi, %edx
cvtsi2ss %rdx, %xmm0
movss 0x10(%rcx), %xmm2
cvtsi2ss %rax, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
cvttss2si %xmm0, %rax
movl %eax, -0x18(%rbp)
movl 0x90(%rcx), %eax
cmpl 0x8c(%rcx), %eax
jbe 0x523ae
movq -0x10(%rbp), %rax
movl 0xc(%rax), %esi
movl -0x18(%rbp), %edx
leaq -0x11(%rbp), %rdi
callq 0x523f0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rdx
addl 0x10(%rdx), %ecx
movl %ecx, -0x24(%rbp)
movl 0xa0(%rax), %esi
movl -0x18(%rbp), %edx
leaq -0x11(%rbp), %rdi
callq 0x523f0
movq -0x20(%rbp), %rdx
movl %eax, %ecx
movl -0x24(%rbp), %eax
addl 0xa4(%rdx), %ecx
cmpl %ecx, %eax
ja 0x523da
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movq %rcx, 0x98(%rax)
movq -0x10(%rbp), %rcx
movl 0xc(%rcx), %ecx
movl %ecx, 0xa0(%rax)
movq -0x10(%rbp), %rcx
movl 0x10(%rcx), %ecx
movl %ecx, 0xa4(%rax)
jmp 0x523dc
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: Alcaro[P]bridges/generate.cpp
// Function: gamemap::generator::done(unsigned int*)
bool gamemap::generator::done(unsigned* progress)
{
#ifdef ARLIB_THREAD
	synchronized(mut)
	{
		if (progress) *progress = n_finished;
		return n_finished == n_started;
	}
	return false; // unreachable, but gcc doesn't know that
#else
	if (progress) *progress = par.quality;
	return true;
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x20(%rbp)
addq $0x30, %rsi
leaq -0x18(%rbp), %rdi
callq 0xe0f0
cmpq $0x0, -0x10(%rbp)
je 0x5245c
movq -0x20(%rbp), %rax
movl 0x88(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rcx
movl 0x88(%rcx), %eax
cmpl 0x80(%rcx), %eax
sete %al
movb %al, -0x21(%rbp)
leaq -0x18(%rbp), %rdi
callq 0xe120
movb -0x21(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: Alcaro[P]bridges/generate.cpp
// Function: gamemap::generator::finish(gamemap&)
bool gamemap::generator::finish(gamemap& map)
{
	uint64_t seed = pack();
	if (!seed) return false;
	unpack(par, seed, map);
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x28(%rbp)
callq 0x524e0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x524be
movb $0x0, -0x1(%rbp)
jmp 0x524d3
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x52560
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nop
// File: Alcaro[P]bridges/generate.cpp
// Function: gamemap::generator::pack()
uint64_t gamemap::generator::pack()
{
#ifndef ARLIB_THREAD
	threadproc();
#endif
	sem.wait();
	
//printf("Generated %u maps (%u usable)\n", n_finished, n_valid);
//printf("Difficulty: %i (%f, desired %f), range %i-%i\n", best_diff,
//(best_diff-diff_min) / (float)(diff_max-diff_min), par.difficulty, diff_min, diff_max);
//puts(serialize());
	
	uint64_t ret;
	synchronized(mut) // must grab mutex after awaiting the semaphore, to avoid race condition on releasing vs freeing mutex
	{
		ret = n_valid ? best_seed : 0;
	}
	
	sem.release(); // in case some fool decides to call pack() multiple times
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
addq $0x58, %rdi
callq 0x539d0
movq -0x20(%rbp), %rsi
addq $0x30, %rsi
leaq -0x18(%rbp), %rdi
callq 0xe0f0
movq -0x20(%rbp), %rax
cmpl $0x0, 0x84(%rax)
je 0x5252c
movq -0x20(%rbp), %rax
movq 0x98(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x52534
xorl %eax, %eax
movq %rax, -0x28(%rbp)
jmp 0x52534
movq -0x28(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq -0x18(%rbp), %rdi
callq 0xe120
movq -0x20(%rbp), %rdi
addq $0x58, %rdi
callq 0x539b0
movq -0x10(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: Alcaro[P]bridges/generate.cpp
// Function: (anonymous namespace)::loc_generator::rand_coprime(unsigned int)
uint32_t rand_coprime(uint32_t to)
{
	uint32_t ret = rand(to-1) + 1;
	uint32_t tmp;
	do {
		tmp = gcd(ret, to);
		ret /= tmp;
	} while (tmp > 1);
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
movl -0xc(%rbp), %esi
subl $0x1, %esi
callq 0x2fe00
addl $0x1, %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %edi
movl -0xc(%rbp), %esi
callq 0x537e0
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %ecx
movl -0x10(%rbp), %eax
xorl %edx, %edx
divl %ecx
movl %eax, -0x10(%rbp)
cmpl $0x1, -0x14(%rbp)
ja 0x52b38
movl -0x10(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: Alcaro[P]bridges/solver.cpp
// Function: (anonymous namespace)::linker::join(unsigned short, unsigned short)
bool join(uint16_t a, uint16_t b)
	{
		uint16_t r1 = root(a);
		uint16_t r2 = root(b);
		
		if (r1 == r2) return true;
		
		link_t& lr1 = links[r1];
		link_t& lr2 = links[r2];
		
		links[lr1.join_last].join_next = r2;
		links[lr2.join_last].join_next = r1;
		lr1.join_last = lr2.join_last;
		lr2.join_root = r1;
		
		if (lr1.castlecolor >= 80 || lr2.castlecolor >= 80)
		{
			if (lr1.castlecolor == lr2.castlecolor) return true;
			if (lr1.castlecolor >= 80 && lr2.castlecolor >= 80) return false;
			if (lr1.castlecolor < lr2.castlecolor) lr1.castlecolor = lr2.castlecolor;
		}
		return true;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movw %dx, %ax
movw %si, %cx
movq %rdi, -0x10(%rbp)
movw %cx, -0x12(%rbp)
movw %ax, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x30(%rbp)
movzwl -0x12(%rbp), %esi
callq 0x57440
movq -0x30(%rbp), %rdi
movw %ax, -0x16(%rbp)
movzwl -0x14(%rbp), %esi
callq 0x57440
movw %ax, -0x18(%rbp)
movzwl -0x16(%rbp), %eax
movzwl -0x18(%rbp), %ecx
cmpl %ecx, %eax
jne 0x56fc5
movb $0x1, -0x1(%rbp)
jmp 0x570be
movq -0x30(%rbp), %rax
movzwl -0x16(%rbp), %ecx
movl %ecx, %edx
shlq $0x4, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x20(%rbp)
movzwl -0x18(%rbp), %ecx
movl %ecx, %edx
shlq $0x4, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x28(%rbp)
movw -0x18(%rbp), %dx
movq -0x20(%rbp), %rcx
movzwl 0xc(%rcx), %ecx
movl %ecx, %esi
shlq $0x4, %rsi
movq %rax, %rcx
addq %rsi, %rcx
movw %dx, 0xa(%rcx)
movw -0x16(%rbp), %cx
movq -0x28(%rbp), %rdx
movzwl 0xc(%rdx), %edx
shlq $0x4, %rdx
addq %rdx, %rax
movw %cx, 0xa(%rax)
movq -0x28(%rbp), %rax
movw 0xc(%rax), %cx
movq -0x20(%rbp), %rax
movw %cx, 0xc(%rax)
movw -0x16(%rbp), %cx
movq -0x28(%rbp), %rax
movw %cx, 0x8(%rax)
movq -0x20(%rbp), %rax
movzwl 0xe(%rax), %eax
cmpl $0x50, %eax
jge 0x5705a
movq -0x28(%rbp), %rax
movzwl 0xe(%rax), %eax
cmpl $0x50, %eax
jl 0x570ba
movq -0x20(%rbp), %rax
movzwl 0xe(%rax), %eax
movq -0x28(%rbp), %rcx
movzwl 0xe(%rcx), %ecx
cmpl %ecx, %eax
jne 0x57074
movb $0x1, -0x1(%rbp)
jmp 0x570be
movq -0x20(%rbp), %rax
movzwl 0xe(%rax), %eax
cmpl $0x50, %eax
jl 0x57094
movq -0x28(%rbp), %rax
movzwl 0xe(%rax), %eax
cmpl $0x50, %eax
jl 0x57094
movb $0x0, -0x1(%rbp)
jmp 0x570be
movq -0x20(%rbp), %rax
movzwl 0xe(%rax), %eax
movq -0x28(%rbp), %rcx
movzwl 0xe(%rcx), %ecx
cmpl %ecx, %eax
jge 0x570b8
movq -0x28(%rbp), %rax
movw 0xe(%rax), %cx
movq -0x20(%rbp), %rax
movw %cx, 0xe(%rax)
jmp 0x570ba
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: Alcaro[P]bridges/solver.cpp
// Function: (anonymous namespace)::linker::query(unsigned short, unsigned short)
uint16_t query(uint16_t index, uint16_t other)
	{
		if (other != (uint16_t)-1) other = root(other);
		uint16_t r = root(index);
		uint16_t ni = r;
		do {
			link_t& link = links[ni];
			
			for (int i=0;i<4;i++)
			{
				if (link.links[i] != (uint16_t)-1)
				{
					uint16_t targetroot = root(link.links[i]);
					if (targetroot == r)
						link.links[i] = -1;
					else if (targetroot == other)
						other = -1;
					else
						return link.links[i];
				}
			}
			
			ni = link.join_next;
			//if (other != (uint16_t)-1) links[r].join_firstneighbor = ni;
		} while (ni != r);
		return -1;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movw %dx, %ax
movw %si, %cx
movq %rdi, -0x10(%rbp)
movw %cx, -0x12(%rbp)
movw %ax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movzwl -0x14(%rbp), %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x5718e
movq -0x30(%rbp), %rdi
movzwl -0x14(%rbp), %esi
callq 0x57440
movw %ax, -0x14(%rbp)
movq -0x30(%rbp), %rdi
movzwl -0x12(%rbp), %esi
callq 0x57440
movw %ax, -0x16(%rbp)
movw -0x16(%rbp), %ax
movw %ax, -0x18(%rbp)
movq -0x30(%rbp), %rax
movzwl -0x18(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
cmpl $0x4, -0x24(%rbp)
jge 0x5724d
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x5723d
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movzwl (%rax,%rcx,2), %esi
callq 0x57440
movw %ax, -0x26(%rbp)
movzwl -0x26(%rbp), %eax
movzwl -0x16(%rbp), %ecx
cmpl %ecx, %eax
jne 0x57213
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movw $0xffff, (%rax,%rcx,2)  # imm = 0xFFFF
jmp 0x5723b
movzwl -0x26(%rbp), %eax
movzwl -0x14(%rbp), %ecx
cmpl %ecx, %eax
jne 0x57227
movw $0xffff, -0x14(%rbp)    # imm = 0xFFFF
jmp 0x57239
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movw (%rax,%rcx,2), %ax
movw %ax, -0x2(%rbp)
jmp 0x5726f
jmp 0x5723b
jmp 0x5723d
jmp 0x5723f
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x571c1
movq -0x20(%rbp), %rax
movw 0xa(%rax), %ax
movw %ax, -0x18(%rbp)
movzwl -0x18(%rbp), %eax
movzwl -0x16(%rbp), %ecx
cmpl %ecx, %eax
jne 0x571a7
movw $0xffff, -0x2(%rbp)     # imm = 0xFFFF
movw -0x2(%rbp), %ax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: Alcaro[P]bridges/solver.cpp
// Function: (anonymous namespace)::linker::lookback(gamemap&, unsigned short, unsigned short, unsigned short&, bool&)
void lookback(gamemap& map, uint16_t link, uint16_t orig, uint16_t& topleft, bool& down)
	{
		gamemap::island& here = map.get(link);
		link_t& lhere = links[link];
		orig = root(orig);
		
		if (lhere.links[0] != (uint16_t)-1 && root(lhere.links[0]) == orig)
		{
			topleft = link;
			down = false;
			return;
		}
		
		if (lhere.links[1] != (uint16_t)-1 && root(lhere.links[1]) == orig)
		{
			topleft = link - here.bridgelen[1]*100;
			down = true;
			return;
		}
		
		if (lhere.links[2] != (uint16_t)-1 && root(lhere.links[2]) == orig)
		{
			topleft = link - here.bridgelen[2];
			down = false;
			return;
		}
		
		if (lhere.links[3] != (uint16_t)-1 && root(lhere.links[3]) == orig)
		{
			topleft = link;
			down = true;
			return;
		}
		
		abort(); // unreachable
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movw %cx, %ax
movw %dx, %cx
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movw %cx, -0x12(%rbp)
movw %ax, -0x14(%rbp)
movq %r8, -0x20(%rbp)
movq %r9, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movzwl -0x12(%rbp), %esi
callq 0x4e8e0
movq -0x40(%rbp), %rdi
movq %rax, -0x30(%rbp)
movzwl -0x12(%rbp), %eax
movl %eax, %ecx
shlq $0x4, %rcx
movq %rdi, %rax
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movzwl -0x14(%rbp), %esi
callq 0x57440
movw %ax, -0x14(%rbp)
movq -0x38(%rbp), %rax
movzwl (%rax), %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x57324
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rax
movzwl (%rax), %esi
callq 0x57440
movzwl %ax, %eax
movzwl -0x14(%rbp), %ecx
cmpl %ecx, %eax
jne 0x57324
movw -0x12(%rbp), %cx
movq -0x20(%rbp), %rax
movw %cx, (%rax)
movq -0x28(%rbp), %rax
movb $0x0, (%rax)
jmp 0x57406
movq -0x38(%rbp), %rax
movzwl 0x2(%rax), %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x57376
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rax
movzwl 0x2(%rax), %esi
callq 0x57440
movzwl %ax, %eax
movzwl -0x14(%rbp), %ecx
cmpl %ecx, %eax
jne 0x57376
movzwl -0x12(%rbp), %eax
movq -0x30(%rbp), %rcx
movsbl 0x5(%rcx), %ecx
imull $0x64, %ecx, %ecx
subl %ecx, %eax
movw %ax, %cx
movq -0x20(%rbp), %rax
movw %cx, (%rax)
movq -0x28(%rbp), %rax
movb $0x1, (%rax)
jmp 0x57406
movq -0x38(%rbp), %rax
movzwl 0x4(%rax), %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x573c2
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rax
movzwl 0x4(%rax), %esi
callq 0x57440
movzwl %ax, %eax
movzwl -0x14(%rbp), %ecx
cmpl %ecx, %eax
jne 0x573c2
movzwl -0x12(%rbp), %eax
movq -0x30(%rbp), %rcx
movsbl 0x6(%rcx), %ecx
subl %ecx, %eax
movw %ax, %cx
movq -0x20(%rbp), %rax
movw %cx, (%rax)
movq -0x28(%rbp), %rax
movb $0x0, (%rax)
jmp 0x57406
movq -0x38(%rbp), %rax
movzwl 0x6(%rax), %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x57401
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rax
movzwl 0x6(%rax), %esi
callq 0x57440
movzwl %ax, %eax
movzwl -0x14(%rbp), %ecx
cmpl %ecx, %eax
jne 0x57401
movw -0x12(%rbp), %cx
movq -0x20(%rbp), %rax
movw %cx, (%rax)
movq -0x28(%rbp), %rax
movb $0x1, (%rax)
jmp 0x57406
callq 0x4180
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: Alcaro[P]bridges/solver.cpp
// Function: (anonymous namespace)::linker::root(unsigned short)
uint16_t root(uint16_t index)
	{
		uint16_t root = index;
		while (root != links[root].join_root)
		{
			root = links[root].join_root;
		}
		
		uint16_t ni = index;
		while (ni != root)
		{
			uint16_t tmp = links[ni].join_root;
			links[ni].join_root = root;
			ni = tmp;
		}
		
		return root;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movw -0xa(%rbp), %ax
movw %ax, -0xc(%rbp)
movq -0x18(%rbp), %rcx
movzwl -0xc(%rbp), %eax
movzwl -0xc(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movzwl 0x8(%rcx), %ecx
cmpl %ecx, %eax
je 0x57493
movq -0x18(%rbp), %rax
movzwl -0xc(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movw 0x8(%rax), %ax
movw %ax, -0xc(%rbp)
jmp 0x5745f
movw -0xa(%rbp), %ax
movw %ax, -0xe(%rbp)
movzwl -0xe(%rbp), %eax
movzwl -0xc(%rbp), %ecx
cmpl %ecx, %eax
je 0x574e0
movq -0x18(%rbp), %rax
movzwl -0xe(%rbp), %ecx
movl %ecx, %edx
shlq $0x4, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movw 0x8(%rcx), %cx
movw %cx, -0x10(%rbp)
movw -0xc(%rbp), %cx
movzwl -0xe(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rax
movw %cx, 0x8(%rax)
movw -0x10(%rbp), %ax
movw %ax, -0xe(%rbp)
jmp 0x5749b
movw -0xc(%rbp), %ax
popq %rbp
retq
nopw %cs:(%rax,%rax)