LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/dragazo[P]cpp-gc/GarbageCollection.cpp
// Function: GC::disjoint_module::__raw_schedule_handle_repoint(GC::smart_handle&, GC::info*)
void GC::disjoint_module::__raw_schedule_handle_repoint(smart_handle &handle, info *target)
{
	// if there's no collector thread, we MUST apply the change immediately
	if (collector_thread == std::thread::id())
	{
		// if this branch was selected, the caches should be empty
		assert(handle_repoint_cache.empty());

		// immediately repoint handle to target
		handle.raw = target;
	}
	// otherwise we need to cache the request
	else handle_repoint_cache[&handle.raw] = target;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
cmpq $0x0, 0x28(%rdi)
je 0x6491
addq $0x1b0, %rdi            # imm = 0x1B0
leaq 0x8(%rsp), %rax
movq %rsi, (%rax)
movq %rax, %rsi
callq 0x81ba
movq %rbx, (%rax)
jmp 0x649e
cmpq $0x0, 0x1c8(%rdi)
jne 0x64a4
movq %rbx, (%rsi)
addq $0x10, %rsp
popq %rbx
retq
leaq 0x17d18(%rip), %rdi     # 0x1e1c3
leaq 0x17ca4(%rip), %rsi     # 0x1e156
leaq 0x17ec1(%rip), %rcx     # 0x1e37a
movl $0x299, %edx            # imm = 0x299
callq 0x51b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/dragazo[P]cpp-gc/GarbageCollection.cpp
// Function: GC::disjoint_module::schedule_handle_repoint(GC::smart_handle&, GC::smart_handle const&)
void GC::disjoint_module::schedule_handle_repoint(smart_handle &handle, const smart_handle &new_value)
{
	std::unique_lock<std::mutex> internal_lock(internal_mutex);
	
	// get the old/new targets
	info *old_target = __get_current_target(handle);
	info *new_target = __get_current_target(new_value);

	#if DRAGAZO_GARBAGE_COLLECT_DISJUNCTION_SAFETY_CHECKS

	// if we're going to repoint outside the disjunction of the handle, that's a disjunction violation
	if (new_target && handle.disjunction != new_target->disjunction)
	{
		throw GC::disjunction_error("attempt to repoint GC::ptr outside of the current disjunction");
	}

	#endif

	// only do the remaining logic if it's an actual repoint
	if (old_target != new_target)
	{
		// repoint handle to the new target
		__raw_schedule_handle_repoint(handle, new_target);

		// increment new target reference count
		if (new_target) ++new_target->ref_count;

		// decrement old target reference count
		__MUST_BE_LAST_ref_count_dec(old_target, std::move(internal_lock));
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x710c
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6112
movq %rax, %r14
movq %rbx, %rdi
movq %r12, %rsi
callq 0x6112
movq %rax, %r12
testq %rax, %rax
je 0x6511
movq 0x8(%r15), %rax
cmpq 0x18(%r12), %rax
jne 0x6578
cmpq %r12, %r14
je 0x6562
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x6466
testq %r12, %r12
je 0x652e
incq 0x20(%r12)
movq 0x8(%rsp), %rax
leaq 0x18(%rsp), %rdx
movq %rax, (%rdx)
movb 0x10(%rsp), %al
movb %al, 0x8(%rdx)
andq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x62a8
leaq 0x18(%rsp), %rdi
callq 0x7122
leaq 0x8(%rsp), %rdi
callq 0x7122
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
pushq $0x10
popq %rdi
callq 0x5140
movq %rax, %r14
leaq 0x17cd9(%rip), %rsi     # 0x1e263
movq %rax, %rdi
callq 0x70f6
leaq 0x2cd1f(%rip), %rsi     # 0x332b8
movq 0x2da00(%rip), %rdx     # 0x33fa0
movq %r14, %rdi
callq 0x5410
movq %rax, %rbx
movq %r14, %rdi
callq 0x5210
jmp 0x65c9
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x7122
jmp 0x65c9
jmp 0x65c6
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x7122
movq %rbx, %rdi
callq 0x5450
nop
// File: /workspace/github_cpp_makefile_star2_O2/dragazo[P]cpp-gc/GarbageCollection.cpp
// Function: GC::disjoint_module::schedule_handle_repoint_swap(GC::smart_handle&, GC::smart_handle&)
void GC::disjoint_module::schedule_handle_repoint_swap(smart_handle &handle_a, smart_handle &handle_b)
{
	std::lock_guard<std::mutex> internal_lock(internal_mutex);

	// get their current repoint targets
	info *target_a = __get_current_target(handle_a);
	info *target_b = __get_current_target(handle_b);

	#if DRAGAZO_GARBAGE_COLLECT_DISJUNCTION_SAFETY_CHECKS

	// if we're going to repoint outside the disjunction of either handle, that's a disjunction violation
	if ((target_b && handle_a.disjunction != target_b->disjunction) || (target_a && handle_b.disjunction != target_a->disjunction))
	{
		throw GC::disjunction_error("attempt to repoint GC::ptr outside of the current disjunction");
	}

	#endif

	// only perform the swap if they point to different things
	if (target_a != target_b)
	{
		// schedule repoint actions to swap them
		__raw_schedule_handle_repoint(handle_a, target_b);
		__raw_schedule_handle_repoint(handle_b, target_a);

		// there's no need for reference counting logic in a swap operation
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
callq 0x7694
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6112
movq %rax, %r12
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6112
testq %rax, %rax
je 0x661a
movq 0x8(%r15), %rcx
cmpq 0x18(%rax), %rcx
jne 0x665e
testq %r12, %r12
je 0x662a
movq 0x8(%r14), %rcx
cmpq 0x18(%r12), %rcx
jne 0x665e
cmpq %rax, %r12
je 0x664b
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x6466
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x6466
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5220
pushq $0x10
popq %rdi
callq 0x5140
movq %rax, %r15
leaq 0x17bf3(%rip), %rsi     # 0x1e263
movq %rax, %rdi
callq 0x70f6
leaq 0x2cc39(%rip), %rsi     # 0x332b8
movq 0x2d91a(%rip), %rdx     # 0x33fa0
movq %r15, %rdi
callq 0x5410
movq %rax, %r14
movq %r15, %rdi
callq 0x5210
jmp 0x66a0
jmp 0x669d
movq %rax, %r14
movq %rbx, %rdi
callq 0x5220
movq %r14, %rdi
callq 0x5450
// File: /workspace/github_cpp_makefile_star2_O2/dragazo[P]cpp-gc/GarbageCollection.cpp
// Function: GC::disjoint_module::local_handle()
GC::shared_disjoint_handle &GC::disjoint_module::local_handle()
{
	// thread_local because this is a thread-specific owning handle.
	// the default value points the current thread to use the primary disjunction.
	thread_local struct local_handle_t
	{
		shared_disjoint_handle m = primary_handle();

		#if DRAGAZO_GARBAGE_COLLECT_DISJUNCTION_HANDLE_LOGGING
		struct _
		{
			_() { std::cerr << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ctor local handle " << std::this_thread::get_id() << '\n'; }
			~_() { std::cerr << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ dtor local handle " << std::this_thread::get_id() << '\n'; }
		} __;
		#endif
	} local_handle;

	#if DRAGAZO_GARBAGE_COLLECT_DISJUNCTION_HANDLE_LOGGING
	std::cerr << "                                ~~~~ local handle access " << std::this_thread::get_id() << '\n';
	#endif

	// if local detour is non-null it means we're in the static dtors (from primary() dtor handler), which means the thread_local handle has already been destroyed.
	// this would be und access of a destroyed object, but would theoretically only happen if a static dtor tried to make a thread for some reason.
	assert(local_detour == nullptr);

	return local_handle.m;
}

// Assembly:
pushq %rbx
cmpb $0x0, %fs:-0x50
je 0x67e6
cmpq $0x0, 0x2dace(%rip)     # 0x342a0
jne 0x682b
movq %fs:0x0, %rax
leaq -0x60(%rax), %rax
popq %rbx
retq
callq 0x671e
movq %fs:0x0, %rax
leaq -0x60(%rax), %rbx
leaq 0x2daa6(%rip), %rsi     # 0x342a8
movq %rbx, %rdi
callq 0x6d5c
leaq 0x39(%rip), %rdi        # 0x684a
leaq 0x2da40(%rip), %rdx     # 0x34258
movq %rbx, %rsi
callq 0x5430
movb $0x1, %fs:-0x50
jmp 0x67ca
leaq 0x17c1b(%rip), %rdi     # 0x1e44d
leaq 0x1791d(%rip), %rsi     # 0x1e156
leaq 0x17c25(%rip), %rcx     # 0x1e465
movl $0x323, %edx            # imm = 0x323
callq 0x51b0
// File: /workspace/github_cpp_makefile_star2_O2/dragazo[P]cpp-gc/GarbageCollection.cpp
// Function: GC::disjoint_module::local()
GC::disjoint_module *GC::disjoint_module::local()
{
	// get the local detour
	disjoint_module *detour = local_detour;

	// if we're taking a detour, use that, otherwise the handle is alive and we should read that instead
	return detour ? detour : local_handle().get();
}

// Assembly:
movq 0x2da39(%rip), %rax     # 0x342a0
testq %rax, %rax
je 0x686d
retq
pushq %rax
callq 0x67be
movq (%rax), %rax
addq $0x8, %rsp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/dragazo[P]cpp-gc/GarbageCollection.cpp
// Function: GC::disjoint_module_container::create_new_disjunction(GC::shared_disjoint_handle&)
void GC::disjoint_module_container::create_new_disjunction(shared_disjoint_handle &dest)
{
	// create a new disjoint module handle data block
	auto m = std::make_unique<handle_data>();
	// and construct its module in-place
	new (m->get()) disjoint_module;

	// repoint dest to the new disjunction
	dest.reset(m.release());

	// add it to the disjunction database
	{
		std::lock_guard<std::mutex> internal_lock(internal_mutex);

		// if we're not collecting, we need to put it immediately in the disjunction list
		if (!collecting) disjunctions.emplace_back(dest);
		// otherwise we need to cache the add action
		else disjunction_add_cache.emplace_back(dest);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x715d
movq (%r15), %rdi
callq 0x718e
movq 0x8(%rsp), %rsi
andq $0x0, 0x8(%rsp)
movq %r14, %rdi
callq 0x6914
movq %rbx, %rdi
callq 0x7694
leaq 0x30(%rbx), %rdi
leaq 0x48(%rbx), %rax
cmpb $0x0, 0x28(%rbx)
cmovneq %rax, %rdi
movq %r14, %rsi
callq 0x72ca
movq %rbx, %rdi
callq 0x5220
leaq 0x8(%rsp), %rdi
callq 0x72e4
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x5220
jmp 0x6901
jmp 0x68fe
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x72e4
movq %r14, %rdi
callq 0x5450
nop
// File: /workspace/github_cpp_makefile_star2_O2/dragazo[P]cpp-gc/GarbageCollection.cpp
// Function: GC::shared_disjoint_handle::reset(GC::handle_data*)
void GC::shared_disjoint_handle::reset(handle_data *other)
{
	// handle redundant assignment as no-op
	if (data == other) return;

	// if we pointed at something
	if (data)
	{
		// drop a strong reference and get the previous tag
		auto prev = data->tag_sub(handle_data::strong_1, std::memory_order_acq_rel);

		// if we were the last strong reference, there are no longer any strong references - destroy the object
		// we include the lock strong refs because those locks succeeded - i.e. our very existence as a non-lock strong owner proves those locks succeeded.
		if ((prev & handle_data::strong_mask) == handle_data::strong_1)
		{
			__module->blocking_collect(); // perform one final collection to make sure everything's collected
			__module->~disjoint_module(); // then destroy the module itself - its dtor asserts that all objects were collected

			// if there were also no more weak references, delete the handle
			if ((prev & handle_data::weak_mask) == 0) delete data;
			// otherwise we're not deleting it but the weak ref count might have fallen to zero in the meantime and could be waiting - alert that we're done destroying
			else data->destroyed_flag.store(true, std::memory_order_release);
		}
	}

	// repoint and test for null - must come after destruction logic to ensure the collection can potentially alias this handle
	data = other;
	if (data)
	{
		__module = data->get(); // cache the module pointer
		data->tag_add(handle_data::strong_1, std::memory_order_acq_rel); // bump up the strong ref count
	}
	else __module = nullptr; // cache the module pointer (in this case null)
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movq 0x8(%rdi), %rdi
cmpq %rsi, %rdi
je 0x69ab
movq %rsi, %rbx
testq %rdi, %rdi
je 0x6988
pushq $0x1
popq %rsi
pushq $0x4
popq %rdx
callq 0x6bfa
movq %rax, %r15
movabsq $0xffffffffffffff, %rax # imm = 0xFFFFFFFFFFFFFF
andq %r15, %rax
cmpq $0x1, %rax
jne 0x6988
movq (%r14), %rdi
callq 0x5e86
movq (%r14), %rdi
callq 0x57ba
movabsq $0xf00000000000000, %rax # imm = 0xF00000000000000
movq 0x8(%r14), %rdi
testq %rax, %r15
je 0x697e
movb $0x1, 0x1f0(%rdi)
jmp 0x6988
movl $0x1f8, %esi            # imm = 0x1F8
callq 0x52d0
movq %rbx, 0x8(%r14)
testq %rbx, %rbx
je 0x69a7
movq %rbx, (%r14)
pushq $0x1
popq %rsi
pushq $0x4
popq %rdx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x6b2e
andq $0x0, (%r14)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/dragazo[P]cpp-gc/GarbageCollection.cpp
// Function: GC::weak_disjoint_handle::expired() const
bool GC::weak_disjoint_handle::expired() const noexcept
{
	// get the current tag
	auto tag = data ? data->tag.load(std::memory_order_acq_rel) : 0;

	// this weak ptr is expired if there are no strong refs remaining.
	// we include lock strong refs because otherwise it's possible for a series of atomic steps to result in a successful lock but intermediately no non-lock strong refs.
	// due to locking, however, this approach could report false negatives (but never false positives).
	return (tag & handle_data::strong_mask) == 0;
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x6b2b
movq 0x1e8(%rax), %rax
shlq $0x8, %rax
sete %al
retq
movb $0x1, %al
retq
// File: /workspace/github_cpp_makefile_star2_O2/dragazo[P]cpp-gc/GarbageCollection.cpp
// Function: GC::handle_data::tag_add(unsigned long, std::memory_order)
GC::handle_data::tag_t GC::handle_data::tag_add(tag_t v, std::memory_order order)
{
	const auto prev = tag.fetch_add(v, order);

	#if DRAGAZO_GARBAGE_COLLECT_DISJUNCTION_HANDLE_DATA_UND_SAFETY

	const auto cur = prev + v; // compute current value from previous

	// make sure we didn't overflow any of the fields
	assert((cur & strong_mask) >= (prev & strong_mask));
	assert((cur & weak_mask) >= (prev & weak_mask));
	assert((cur & lock_mask) >= (prev & lock_mask));

	#endif

	return prev;
}

// Assembly:
pushq %rax
decl %edx
cmpl $0x4, %edx
ja 0x6b46
leaq 0x174c7(%rip), %rax     # 0x1e004
movslq (%rax,%rdx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq %rsi, %rax
lock
xaddq %rax, 0x1e8(%rdi)
addq %rax, %rsi
movabsq $0xffffffffffffff, %rcx # imm = 0xFFFFFFFFFFFFFF
movq %rsi, %rdx
andq %rcx, %rdx
andq %rax, %rcx
cmpq %rcx, %rdx
jb 0x6b9c
movabsq $0xf00000000000000, %rcx # imm = 0xF00000000000000
movq %rsi, %rdx
andq %rcx, %rdx
andq %rax, %rcx
cmpq %rcx, %rdx
jb 0x6bbb
movabsq $-0x1000000000000000, %rcx # imm = 0xF000000000000000
andq %rcx, %rsi
andq %rax, %rcx
cmpq %rcx, %rsi
jb 0x6bda
popq %rcx
retq
leaq 0x17981(%rip), %rdi     # 0x1e524
leaq 0x175ac(%rip), %rsi     # 0x1e156
leaq 0x1799f(%rip), %rcx     # 0x1e550
movl $0x39b, %edx            # imm = 0x39B
callq 0x51b0
leaq 0x179d8(%rip), %rdi     # 0x1e59a
leaq 0x1758d(%rip), %rsi     # 0x1e156
leaq 0x17980(%rip), %rcx     # 0x1e550
movl $0x39c, %edx            # imm = 0x39C
callq 0x51b0
leaq 0x179e1(%rip), %rdi     # 0x1e5c2
leaq 0x1756e(%rip), %rsi     # 0x1e156
leaq 0x17961(%rip), %rcx     # 0x1e550
movl $0x39d, %edx            # imm = 0x39D
callq 0x51b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/dragazo[P]cpp-gc/GarbageCollection.cpp
// Function: GC::handle_data::tag_sub(unsigned long, std::memory_order)
GC::handle_data::tag_t GC::handle_data::tag_sub(tag_t v, std::memory_order order)
{
	const auto prev = tag.fetch_sub(v, order);

	#if DRAGAZO_GARBAGE_COLLECT_DISJUNCTION_HANDLE_DATA_UND_SAFETY

	const auto cur = prev - v; // compute current value from previous

	// make sure we didn't overflow any of the fields
	assert((cur & strong_mask) <= (prev & strong_mask));
	assert((cur & weak_mask) <= (prev & weak_mask));
	assert((cur & lock_mask) <= (prev & lock_mask));

	#endif

	return prev;
}

// Assembly:
pushq %rax
decl %edx
cmpl $0x4, %edx
ja 0x6c12
leaq 0x1740f(%rip), %rax     # 0x1e018
movslq (%rax,%rdx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq %rsi, %rax
negq %rax
lock
xaddq %rax, 0x1e8(%rdi)
movq %rax, %rcx
subq %rsi, %rcx
movabsq $0xffffffffffffff, %rdx # imm = 0xFFFFFFFFFFFFFF
movq %rcx, %rsi
andq %rdx, %rsi
andq %rax, %rdx
cmpq %rdx, %rsi
ja 0x6c6e
movabsq $0xf00000000000000, %rdx # imm = 0xF00000000000000
movq %rcx, %rsi
andq %rdx, %rsi
andq %rax, %rdx
cmpq %rdx, %rsi
ja 0x6c8d
movabsq $-0x1000000000000000, %rdx # imm = 0xF000000000000000
andq %rdx, %rcx
andq %rax, %rdx
cmpq %rdx, %rcx
ja 0x6cac
popq %rcx
retq
leaq 0x17975(%rip), %rdi     # 0x1e5ea
leaq 0x174da(%rip), %rsi     # 0x1e156
leaq 0x17993(%rip), %rcx     # 0x1e616
movl $0x3ac, %edx            # imm = 0x3AC
callq 0x51b0
leaq 0x179cc(%rip), %rdi     # 0x1e660
leaq 0x174bb(%rip), %rsi     # 0x1e156
leaq 0x17974(%rip), %rcx     # 0x1e616
movl $0x3ad, %edx            # imm = 0x3AD
callq 0x51b0
leaq 0x179d5(%rip), %rdi     # 0x1e688
leaq 0x1749c(%rip), %rsi     # 0x1e156
leaq 0x17955(%rip), %rcx     # 0x1e616
movl $0x3ae, %edx            # imm = 0x3AE
callq 0x51b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/dragazo[P]cpp-gc/GarbageCollection.cpp
// Function: GC::shared_disjoint_handle::lock(GC::handle_data*)
void GC::shared_disjoint_handle::lock(handle_data *other)
{
	// we need to start out null
	reset();

	// if the relock target is non-null
	if (other)
	{
		// bump up the strong and lock counts
		auto prev = other->tag_add(handle_data::lock_1 | handle_data::strong_1, std::memory_order_acq_rel);

		// if there was at least 1 non-lock strong reference, the lock is successful and the object is still alive.
		// we exclude lock strong refs because otherwise 2 locks back-to-back from 2 threads could trick the latter into thinking it succeeded.
		if (handle_data::non_lock_strongs(prev) != 0)
		{
			// unmark the lock ref (success keeps only the strong ref because we're a non-lock strong owner type)
			other->tag_sub(handle_data::lock_1, std::memory_order_acq_rel);

			// we now own a reference - do the raw repoint
			data = other;
			__module = other->get();
		}
		// otherwise the object is expired
		else
		{
			// unmark the lock ref and strong ref (failure to lock a strong ref)
			other->tag_sub(handle_data::lock_1 | handle_data::strong_1, std::memory_order_acq_rel);
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %esi, %esi
callq 0x6914
testq %rbx, %rbx
je 0x6d3c
movabsq $0x1000000000000001, %r15 # imm = 0x1000000000000001
pushq $0x4
popq %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6b2e
movabsq $0xffffffffffffff, %rcx # imm = 0xFFFFFFFFFFFFFF
andq %rax, %rcx
shrq $0x3c, %rax
cmpq %rax, %rcx
jne 0x6d24
pushq $0x4
popq %rdx
movq %rbx, %rdi
movq %r15, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x6bfa
decq %r15
pushq $0x4
popq %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6bfa
movq %rbx, 0x8(%r14)
movq %rbx, (%r14)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/dragazo[P]cpp-gc/GarbageCollection.cpp
// Function: GC::shared_disjoint_handle::shared_disjoint_handle(GC::shared_disjoint_handle const&)
GC::shared_disjoint_handle::shared_disjoint_handle(const shared_disjoint_handle &other)
{
	// alias the same disjunction
	data = other.data;
	__module = other.__module;

	// bump up the strong ref count to account for our aliasing
	if (data) data->tag_add(handle_data::strong_1, std::memory_order_acq_rel);
}

// Assembly:
movq %rdi, %rax
movq 0x8(%rsi), %rdi
movq %rdi, 0x8(%rax)
movq (%rsi), %rcx
movq %rcx, (%rax)
testq %rdi, %rdi
je 0x6d7d
pushq $0x1
popq %rsi
pushq $0x4
popq %rdx
jmp 0x6b2e
retq
// File: /workspace/github_cpp_makefile_star2_O2/dragazo[P]cpp-gc/GarbageCollection.cpp
// Function: GC::shared_disjoint_handle::operator=(GC::shared_disjoint_handle&&)
GC::shared_disjoint_handle &GC::shared_disjoint_handle::operator=(shared_disjoint_handle &&other)
{
	if (&other != this)
	{
		// repoint to null with the ref count logic
		reset();

		// then steal disjunction ownership - ref count change is net zero
		data = std::exchange(other.data, nullptr);
		__module = std::exchange(other.__module, nullptr);
	}

	return *this;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq %rdi, %rsi
je 0x6dd8
movq %rsi, %r14
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6914
movq 0x8(%r14), %rax
andq $0x0, 0x8(%r14)
movq %rax, 0x8(%rbx)
movq (%r14), %rax
andq $0x0, (%r14)
movq %rax, (%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/dragazo[P]cpp-gc/GarbageCollection.cpp
// Function: GC::weak_disjoint_handle::reset(GC::handle_data*)
void GC::weak_disjoint_handle::reset(handle_data *other)
{
	// handle redundant assignment as no-op
	if (data == other) return;

	// if we pointed at something
	if (data)
	{
		// drop a weak ref and get the previous tag
		auto prev = data->tag_sub(handle_data::weak_1, std::memory_order_acq_rel);

		// if we were the last weak ref and there were no strong refs, the object is already destroyed and needs to be deleted.
		// being the last weak ref implies there are no locks at the moment because without unsynchronized read/write to the same variable from several threads that's impossible.
		// therefore we don't need to bother about strong vs. non-lock strong references in this context because strong == non-lock strong
		if ((prev & handle_data::weak_mask) == handle_data::weak_1 && (prev & handle_data::strong_mask) == 0)
		{
			// in this case the strong count fell to zero, so the object is potentially being destroyed by the strong ref count logic.
			// however, that strong ref count logic won't delete the data block because our existence proves there was a weak reference prior to the strong ref dec logic.
			// therefore we just need to wait until the object is destroyed so we can delete the data block
			while (!data->destroyed_flag.load(std::memory_order_acquire));
			delete data;
		}
	}

	// repoint - if non-null bump up weak ref count
	data = other;
	if (data) data->tag_add(handle_data::weak_1, std::memory_order_acq_rel);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r15
movq (%rdi), %rdi
cmpq %rsi, %rdi
je 0x6e58
movq %rsi, %rbx
movabsq $0x100000000000000, %r14 # imm = 0x100000000000000
testq %rdi, %rdi
je 0x6e3d
pushq $0x4
popq %rdx
movq %r14, %rsi
callq 0x6bfa
movabsq $0xfffffffffffffff, %rcx # imm = 0xFFFFFFFFFFFFFFF
andq %rax, %rcx
cmpq %r14, %rcx
jne 0x6e3d
movq (%r15), %rax
movb 0x1f0(%rax), %al
testb $0x1, %al
je 0x6e23
movq (%r15), %rdi
movl $0x1f8, %esi            # imm = 0x1F8
callq 0x52d0
movq %rbx, (%r15)
testq %rbx, %rbx
je 0x6e58
pushq $0x4
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x6b2e
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/dragazo[P]cpp-gc/GarbageCollection.cpp
// Function: GC::weak_disjoint_handle::operator=(GC::weak_disjoint_handle&&)
GC::weak_disjoint_handle &GC::weak_disjoint_handle::operator=(weak_disjoint_handle &&other)
{
	if (&other != this)
	{
		reset(); // repoint to null with the ref count logic
		data = std::exchange(other.data, nullptr); // then unsafe repoint to other and disconnect other - the ref count change is net zero
	}
	return *this;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq %rdi, %rsi
je 0x6ecf
movq %rsi, %r14
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6de4
movq (%r14), %rax
andq $0x0, (%r14)
movq %rax, (%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/dragazo[P]cpp-gc/GarbageCollection.cpp
// Function: GC::start_timed_collect()
void GC::start_timed_collect()
{
	static struct _
	{
		_()
		{
			std::thread([]
			{
				// begin sever ties to the default disjunction.
				// this is because we're going to be a detached thread and we don't want to impede object deletion.
				disjoint_module::local_handle() = nullptr;

				#if DRAGAZO_GARBAGE_COLLECT_DISJUNCTION_HANDLE_LOGGING
				std::cerr << "start timed collect thread: " << std::this_thread::get_id() << '\n';
				#endif

				// try the operation
				try
				{
					// we'll run forever
					while (true)
					{
						// sleep the sleep time
						std::this_thread::sleep_for(sleep_time());

						// if we're using timed strategy
						if ((int)strategy() & (int)strategies::timed)
						{
							// run a collect pass for all the dynamic disjunctions
							disjoint_module_container::get().BACKGROUND_COLLECTOR_ONLY___collect(true);
						}
						// otherwise perform any other relevant logic
						else
						{
							// even if we don't perform a dynamic disjunction collection, we need to cull dangling references
							disjoint_module_container::get().BACKGROUND_COLLECTOR_ONLY___collect(false);
						}
					}
				}
				// if we ever hit an error, something terrible happened
				catch (...)
				{
					// print error message and terminate with a nonzero code
					std::cerr << "CRITICAL ERROR: garbage collection threw an exception\n";
					std::abort();
				}
			}).detach();
		}
	} __;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movb 0x2d35b(%rip), %al      # 0x342c0
testb %al, %al
je 0x6f6f
addq $0x10, %rsp
popq %rbx
retq
leaq 0x2d34a(%rip), %rdi     # 0x342c0
callq 0x5470
testl %eax, %eax
je 0x6f69
andq $0x0, (%rsp)
pushq $0x10
popq %rdi
callq 0x52c0
leaq 0x2c375(%rip), %rcx     # 0x33308
movq %rcx, (%rax)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %rsp, %rdi
xorl %edx, %edx
callq 0x5290
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x6fb8
movq (%rdi), %rax
callq *0x8(%rax)
movq %rsp, %rdi
callq 0x5440
movq %rsp, %rdi
callq 0x7632
leaq 0x2d2f1(%rip), %rdi     # 0x342c0
callq 0x51a0
jmp 0x6f69
movq %rax, %rbx
movq %rsp, %rdi
callq 0x7632
jmp 0x6ffb
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x6ffb
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x6ffb
movq %rax, %rbx
leaq 0x2d2be(%rip), %rdi     # 0x342c0
callq 0x5190
movq %rbx, %rdi
callq 0x5450
nop
// File: /workspace/github_cpp_makefile_star2_O2/dragazo[P]cpp-gc/test.cpp
// Function: foo()
void foo()
{
	{
		//GC::collect();
		
		// create the first node
		GC::ptr<ListNode> root = GC::make<ListNode>();

		// we'll make 10 links in the chain
		GC::ptr<ListNode> *prev = &root;
		for (int i = 0; i < 10; ++i)
		{
			(*prev)->next = GC::make<ListNode>();
			(*prev)->next->prev = *prev;

			prev = &(*prev)->next;
		}

		// then we'll merege the ends into a cycle
		root->prev = *prev;
		(*prev)->next = root;

		using std::swap;

		root.swap(*prev);
		swap(root, *prev);

		//GC::collect();
		//std::cerr << "\n\n";
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rsp, %rbx
movq %rbx, %rdi
callq 0xf3a8
pushq $0xa
popq %rbp
leaq 0x18(%rsp), %r14
subl $0x1, %ebp
jb 0x866f
movq %r14, %rdi
callq 0xf3a8
movq (%rbx), %rdi
addq $0x18, %rdi
movq %r14, %rsi
callq 0xf4ce
movq %r14, %rdi
callq 0xf4ea
movq (%rbx), %rax
movq 0x18(%rax), %rdi
movq %rbx, %rsi
callq 0xf4ce
movq (%rbx), %rbx
addq $0x18, %rbx
jmp 0x8633
movq (%rsp), %rdi
movq %rbx, %rsi
callq 0xf4ce
movq (%rbx), %rdi
addq $0x18, %rdi
movq %rsp, %rsi
callq 0xf4ce
movq %rsp, %rdi
movq %rbx, %rsi
callq 0xf4f8
movq %rsp, %rdi
movq %rbx, %rsi
callq 0xf4f8
movq %rsp, %rdi
callq 0xf4ea
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x86c4
jmp 0x86c4
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0xf4ea
jmp 0x86c7
movq %rax, %rbx
movq %rsp, %rdi
callq 0xf4ea
movq %rbx, %rdi
callq 0x5450
// File: /workspace/github_cpp_makefile_star2_O2/dragazo[P]cpp-gc/./GarbageCollection.h
// Function: GC::ptr<int []> GC::adopt<int, std::default_delete<int []>>(int*, unsigned long)
[[nodiscard]]
	static ptr<T[]> adopt(T obj[], std::size_t count)
	{
		// -- verification -- //

		// if obj is null, return an null ptr
		if (!obj) return {};

		// -- normalize T -- //

		// get the allocator
		typedef checked_aligned_allocator_for<info> allocator_t;

		// -- create the vtable -- //

		// use lambda to conveniently create the set of all router functions for type T
		auto router_set = [](info &handle, auto func) { for (std::size_t i = 0; i < handle.count; ++i) GC::route(reinterpret_cast<T*>(handle.obj)[i], func); };

		static const info_vtable _vtable(
			[](info &handle) { Deleter()(reinterpret_cast<T*>(handle.obj)); },
			[](info &handle) { allocator_t::dealloc(&handle); },
			router_set,
			router_set
		);

		// -- create the info object for management -- //

		info *handle;

		// allocate the buffer space for the info object
		try { handle = reinterpret_cast<info*>(allocator_t::alloc(sizeof(info))); }
		// on failure, delete the object and rethrow whatever killed us
		catch (...) { Deleter()(obj); throw; }

		// construct the info object
		new (handle) info(obj, count, &_vtable);

		// -- do the garbage collection aspects -- //

		// claim its children
		handle->route(GC::router_unroot);

		// create the ptr first - this roots obj
		ptr<T[]> res(obj, handle, GC::bind_new_obj);

		// begin timed collection (if it's not already)
		GC::start_timed_collect();

		// return the now-initialized ptr
		return res;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rsi, %rsi
je 0x157be
movq %rdx, %r15
movq %rsi, %r14
movb 0x1ecd6(%rip), %al      # 0x34440
testb %al, %al
je 0x157d7
pushq $0x40
popq %rdi
callq 0x15e54
movq %rax, %r12
movq %r14, (%rax)
movq %r15, 0x8(%rax)
leaq 0x1ec99(%rip), %rax     # 0x34420
movq %rax, 0x10(%r12)
callq 0x6860
movq %rax, 0x18(%r12)
movq 0x10(%r12), %rax
leaq -0xe874(%rip), %rsi     # 0x6f2e
movq %r12, %rdi
callq *0x10(%rax)
movq %r14, (%rbx)
leaq 0x8(%rbx), %rdi
movq %r12, %rsi
callq 0x15f72
callq 0x6f5a
jmp 0x157c8
movq %rbx, %rdi
xorl %esi, %esi
callq 0x155f6
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1ec62(%rip), %rdi     # 0x34440
callq 0x5470
testl %eax, %eax
je 0x1576e
leaq 0x7e2(%rip), %rax       # 0x15fd0
movq %rax, 0x1ec2b(%rip)     # 0x34420
leaq 0x7f4(%rip), %rax       # 0x15ff0
movq %rax, 0x1ec25(%rip)     # 0x34428
leaq 0x7ec(%rip), %rax       # 0x15ff6
movq %rax, 0x1ec1f(%rip)     # 0x34430
leaq 0x7e0(%rip), %rax       # 0x15ff8
movq %rax, 0x1ec19(%rip)     # 0x34438
leaq 0x1ec1a(%rip), %rdi     # 0x34440
callq 0x51a0
jmp 0x1576e
movq %rax, %r14
movq %rbx, %rdi
callq 0x10af8
jmp 0x1585a
movq %rax, %rdi
callq 0x50f0
movq %r14, %rdi
callq 0x5330
callq 0x5390
movq %rax, %r14
callq 0x53f0
movq %r14, %rdi
callq 0x5450
movq %rax, %rdi
callq 0x70ea
// File: /workspace/github_cpp_makefile_star2_O2/dragazo[P]cpp-gc/./GarbageCollection.h
// Function: GC::checked_allocator<GC::raw_aligned_allocator<8ul>>::alloc(unsigned long)
static void *alloc(std::size_t size)
		{
			// allocate the space
			void *buf = allocator_t::alloc(size);

			// if that failed but we have allocfail collect mode enabled
			if (!buf && (int)strategy() & (int)strategies::allocfail)
			{
				// collect and retry the allocation
				GC::collect();
				buf = allocator_t::alloc(size);
			}

			// if that failed, throw bad alloc
			if (!buf) throw std::bad_alloc();

			return buf;
		}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x5350
testq %rax, %rax
jne 0x15e7d
callq 0x6f3a
testb $0x2, %al
je 0x15e7f
callq 0x6f1e
movq %rbx, %rdi
callq 0x5350
testq %rax, %rax
je 0x15e7f
popq %rbx
retq
pushq $0x8
popq %rdi
callq 0x5140
movq 0x1e10a(%rip), %rcx     # 0x33f98
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x1e11c(%rip), %rsi     # 0x33fb8
movq 0x1e0e5(%rip), %rdx     # 0x33f88
movq %rax, %rdi
callq 0x5410
nop
// File: /workspace/github_cpp_makefile_star2_O2/dragazo[P]cpp-gc/test.cpp
// Function: void GC::router<router_allocator>::route<GC::router_fn>(router_allocator const&, GC::router_fn)
static void route(const router_allocator &r, F func)
	{
		// simulate router locking a mutex and a mutator in the class locking and allocating
		r.p = GC::make<int>(45);

		GC::route(r.p, func);
		GC::route(r.self, func);
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x4(%rsp), %rsi
movl $0x2d, (%rsi)
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x131fe
movq %r14, %rdi
movq %r15, %rsi
callq 0x132ec
leaq 0x8(%rsp), %rdi
callq 0x10c56
leaq 0x8(%r14), %rdi
callq *%rbx
addq $0x20, %r14
movq %r14, %rdi
callq *%rbx
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x10c56
movq %rbx, %rdi
callq 0x5450
// File: /workspace/github_cpp_makefile_star2_O2/dragazo[P]cpp-gc/test.cpp
// Function: void GC::router<atomic_container>::route<GC::router_fn>(atomic_container const&, GC::router_fn)
static void route(const atomic_container &atomic, F func)
	{
		GC::route(atomic.atomic_1, func);
		GC::route(atomic.atomic_2, func);
		GC::route(atomic.atomic_3, func);
		GC::route(atomic.atomic_4, func);
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x17298
leaq 0x40(%r14), %rdi
movq %rbx, %rsi
callq 0x17298
leaq 0x80(%r14), %rdi
movq %rbx, %rsi
callq 0x17298
addq $0xc0, %r14
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x17298
nop
// File: /workspace/github_cpp_makefile_star2_O2/dragazo[P]cpp-gc/test.cpp
// Function: SymbolTable::operator=(SymbolTable const&)
SymbolTable &operator=(const SymbolTable &other)
	{
		if (this != &other)
		{
			{
				std::lock_guard lock(symbols_mutex);
				symbols = other.symbols;
			}
			better_symbols = other.better_symbols;
		}
		return *this;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq %rsi, %rdi
je 0x19af9
movq %rsi, %r14
leaq 0x38(%rbx), %r15
movq %r15, %rdi
callq 0x7694
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19b84
movq %r15, %rdi
callq 0x5220
addq $0x60, %r14
leaq 0x60(%rbx), %rdi
movq %r14, %rsi
callq 0x19b3e
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %r15, %rdi
callq 0x5220
movq %rbx, %rdi
callq 0x5450
nop
// File: /workspace/github_cpp_makefile_star2_O2/dragazo[P]cpp-gc/test.cpp
// Function: SymbolTable::operator=(SymbolTable&&)
SymbolTable &operator=(SymbolTable &&other)
	{
		if (this != &other)
		{
			{
				std::scoped_lock locks(symbols_mutex, other.symbols_mutex);
				symbols = std::move(other.symbols);
			}
			better_symbols = std::move(other.better_symbols);
		}
		return *this;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
cmpq %rsi, %rdi
je 0x19f5e
movq %rsi, %r14
leaq 0x38(%rbx), %rdi
addq $0x38, %rsi
movq %rsp, %r15
movq %rsi, (%r15)
movq %rdi, 0x8(%r15)
callq 0x19ff9
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1a0c4
movq %r15, %rdi
callq 0x19f96
addq $0x60, %r14
leaq 0x60(%rbx), %rdi
movq %r14, %rsi
callq 0x19fae
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/dragazo[P]cpp-gc/./GarbageCollection.h
// Function: _gc_unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, GC::ptr<TreeNode>, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, GC::ptr<TreeNode>>>, std::recursive_mutex>::operator=(__gc_unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, GC::ptr<TreeNode>, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, GC::ptr<TreeNode>>>, std::recursive_mutex>&&)
__gc_unordered_map &operator=(__gc_unordered_map &&other)
	{
		if (this != &other)
		{
			std::scoped_lock locks(this->mutex, other.mutex);
			wrapped() = std::move(other.wrapped());
		}
		return *this;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
cmpq %rsi, %rdi
je 0x19fec
movq %rsi, %r14
leaq 0x38(%rbx), %rdi
addq $0x38, %rsi
movq %rsp, %r15
movq %rsi, (%r15)
movq %rdi, 0x8(%r15)
callq 0x1a194
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1a0c4
movq %r15, %rdi
callq 0x1a17c
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/dragazo[P]cpp-gc/test.cpp
// Function: void GC::router<SymbolTable>::route<GC::router_fn>(SymbolTable const&, GC::router_fn)
static void route(const SymbolTable &table, F func)
    {
		{
			// modification of the mutable collection of GC::ptr and router must be mutually exclusive
			std::lock_guard<std::mutex> lock(table.symbols_mutex);
			GC::route(table.symbols, func);
		}
		GC::route(table.better_symbols, func);
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x38(%rdi), %r15
movq %r15, %rdi
callq 0x7694
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1a52c
movq %r15, %rdi
callq 0x5220
addq $0x60, %r14
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x1a55e
movq %rax, %rbx
movq %r15, %rdi
callq 0x5220
movq %rbx, %rdi
callq 0x5450
nop
// File: /workspace/github_cpp_makefile_star2_O2/dragazo[P]cpp-gc/test.cpp
// Function: void GC::router<MaybeTreeNode>::route<GC::router_fn>(MaybeTreeNode const&, GC::router_fn)
static void route(const MaybeTreeNode &maybe, F func)
    {
        // this must be synchronized with constructing/destucting the buffer object.
        std::lock_guard<std::mutex> lock(maybe.buf_mutex);
        
        // because TreeNode contains GC::ptr objects, we need to route to it,
        // but only if the MaybeTreeNode actually has it constructed in the buffer.
        if (maybe.contains_tree_node) GC::route(*reinterpret_cast<const TreeNode*>(maybe.buf), func);
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x48(%rdi), %rbx
movq %rbx, %rdi
callq 0x7694
cmpb $0x1, 0x40(%r15)
jne 0x1bf0b
leaq 0x8(%r15), %rdi
callq *%r14
addq $0x20, %r15
movq %r15, %rdi
callq *%r14
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x5220
movq %rax, %r14
movq %rbx, %rdi
callq 0x5220
movq %r14, %rdi
callq 0x5450
nop
// File: /workspace/github_cpp_makefile_star2_O2/vividvilla[P]hackerrank/src/insertionsort1.cpp
// Function: outputSteps(std::vector<int, std::allocator<int>>)
void outputSteps(vector<int> ar) {
    int N = ar.size();
    int el = ar[N - 1];

    for (int i = N - 1; i >= 0; i--) {
        if (i > 0 && ar[i - 1] > el)
            ar[i] = ar[i - 1];
        else
            ar[i] = el;

        for (int j = 0; j < N; j++) {
            cout << ar[j];
            if (j + 1 < N)
                cout << " ";
            else
                cout << endl;
        }

        if (ar[i] <= el)
            break;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq (%rdi), %rax
movq 0x8(%rdi), %r12
subq %rax, %r12
shrq $0x2, %r12
leal -0x1(%r12), %edx
movslq %r12d, %rcx
movl -0x4(%rax,%rcx,4), %esi
xorl %r13d, %r13d
testl %ecx, %ecx
cmovgl %r12d, %r13d
movq 0x2d49(%rip), %r14      # 0x3fd0
leaq 0xd76(%rip), %r15       # 0x2004
movl %esi, 0x8(%rsp)
testl %edx, %edx
js 0x1306
movl %edx, %edi
subl $0x1, %edx
movl %edx, 0xc(%rsp)
movq %rdi, 0x10(%rsp)
jae 0x12aa
xorl %ecx, %ecx
jmp 0x12ba
movl -0x4(%rax,%rdi,4), %ecx
cmpl %esi, %ecx
jle 0x12b7
movl %ecx, (%rax,%rdi,4)
jmp 0x12bd
movq %rdi, %rcx
movl %esi, (%rax,%rcx,4)
xorl %ebp, %ebp
cmpq %rbp, %r13
je 0x12f1
movq (%rbx), %rax
movl (%rax,%rbp,4), %esi
movq %r14, %rdi
callq 0x1100
leal 0x1(%rbp), %eax
movq %r14, %rdi
cmpl %r12d, %eax
jge 0x12e7
movq %r15, %rsi
callq 0x10b0
jmp 0x12ec
callq 0x1060
incq %rbp
jmp 0x12bf
movq (%rbx), %rax
movl 0x8(%rsp), %esi
movq 0x10(%rsp), %rcx
cmpl %esi, (%rax,%rcx,4)
movl 0xc(%rsp), %edx
jg 0x1292
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chrischute[P]are-you-the-one/src/ayto.cpp
// Function: getRandomPerfectMatching[abi:cxx11]()
Pm getRandomPerfectMatching() {
    Pm p = DIGITS;
    int last = (int) p.size();
    while (--last > 0) {
        int i = rand() % last;
        char tmp = p[last];
        p[last] = p[i];
        p[i] = tmp;
    }
    return p;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x3a71(%rip), %rsi      # 0x7025
leaq 0xf(%rsp), %rdx
callq 0x4034
movl 0x8(%rbx), %r14d
leal -0x1(%r14), %r15d
cmpl $0x2, %r14d
jl 0x35f5
callq 0x2080
cltd
idivl %r15d
movq (%rbx), %rax
movb (%rax,%r15), %cl
movslq %edx, %rdx
movb (%rax,%rdx), %sil
movb %sil, (%rax,%r15)
movq (%rbx), %rax
movb %cl, (%rax,%rdx)
decl %r14d
decq %r15
jmp 0x35c6
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/chrischute[P]are-you-the-one/src/ayto.cpp
// Function: getNextPerfectMatchingGuess[abi:cxx11](PerfectMatchingSet const*, PerfectMatchingSet const*)
Pm getNextPerfectMatchingGuess(const PmSet* possibleAnswers, const PmSet* guessesAlreadyMade)
{
    if (possibleAnswers->size() == 1) {
        return possibleAnswers->get(0);
    }

    switch (guessesAlreadyMade->size()) {
        case 0:
            return DIGITS;
        case 1:
            return GUESS;
        default:
            return getNextGuessUsingMinimax(possibleAnswers, guessesAlreadyMade);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x5b24
cmpq $0x1, %rax
jne 0x3639
movq %r14, %rdi
xorl %esi, %esi
callq 0x5a00
movq %rbx, %rdi
movq %rax, %rsi
callq 0x22c0
jmp 0x367e
movq %r15, %rdi
callq 0x5b24
cmpq $0x1, %rax
je 0x365a
testq %rax, %rax
jne 0x3670
leaq 0x39d2(%rip), %rsi      # 0x7025
leaq 0xf(%rsp), %rdx
jmp 0x3666
leaq 0x3b7f(%rip), %rsi      # 0x71e0
leaq 0xe(%rsp), %rdx
movq %rbx, %rdi
callq 0x4034
jmp 0x367e
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x368b
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/chrischute[P]are-you-the-one/src/ayto.cpp
// Function: getPrintableNames(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::map<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<int>, std::allocator<std::pair<int const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>> const*, std::map<char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<char>, std::allocator<std::pair<char const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>> const*)
string getPrintableNames(const PerfectMatching& p,
                         const map<int, string>* femaleNames,
                         const map<char, string>* maleNames) {
    stringstream printableNamesBuilder;

    int i = 0;
    for (PerfectMatching::const_iterator it = p.begin(); it != p.end(); it++) {
        printableNamesBuilder << "    " <<  femaleNames->at(i++)
                              << " + " << maleNames->at(*it);
        if (it != p.end() - 1)
            printableNamesBuilder << endl;
    }

    return printableNamesBuilder.str();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rcx, 0x18(%rsp)
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, 0x10(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x2190
movq (%r12), %r13
xorl %r14d, %r14d
movq %r13, %rax
leaq (%r14,%r13), %rbx
addq 0x8(%r12), %rax
cmpq %rax, %rbx
je 0x3e23
leaq 0x30(%rsp), %rdi
leaq 0x3481(%rip), %rsi      # 0x722b
callq 0x2240
movq %rax, %rbp
movl %r14d, 0xc(%rsp)
movq %r15, %rdi
leaq 0xc(%rsp), %rsi
callq 0x443c
movq %rbp, %rdi
movq %rax, %rsi
callq 0x2200
movq %rax, %rdi
leaq 0x3457(%rip), %rsi      # 0x7230
callq 0x2240
movq %rax, %rbp
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
callq 0x4474
movq %rbp, %rdi
movq %rax, %rsi
callq 0x2200
movq (%r12), %rax
movq 0x8(%r12), %rcx
addq %rax, %rcx
decq %rcx
cmpq %rcx, %rbx
je 0x3e1b
leaq 0x30(%rsp), %rdi
callq 0x2100
movq (%r12), %rax
incq %r14
jmp 0x3d8c
leaq 0x38(%rsp), %rsi
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x2320
leaq 0x20(%rsp), %rdi
callq 0x21b0
movq %rbx, %rax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3e58
jmp 0x3e58
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x21b0
movq %rbx, %rdi
callq 0x2380
// File: /workspace/github_cpp_makefile_star2_O2/chrischute[P]are-you-the-one/src/ayto.cpp
// Function: getPrintableNames(TruthBooth const&, std::map<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<int>, std::allocator<std::pair<int const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>> const*, std::map<char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<char>, std::allocator<std::pair<char const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>> const*)
string getPrintableNames(const TruthBooth& truthBooth,
                         const map<int, string>* femaleNames,
                         const map<char, string>* maleNames) {
    stringstream printableNamesBuilder;

    printableNamesBuilder << "(" << femaleNames->at(truthBooth.index) << ", "
                          << maleNames->at(truthBooth.charAtIndex) << ")";

    return printableNamesBuilder.str();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2190
leaq 0x18(%rsp), %rdi
leaq 0x3395(%rip), %rsi      # 0x7234
callq 0x2240
movq %rax, %r13
movq %r12, %rdi
movq %r15, %rsi
callq 0x443c
movq %r13, %rdi
movq %rax, %rsi
callq 0x2200
leaq 0x3372(%rip), %rsi      # 0x7236
movq %rax, %rdi
callq 0x2240
movq %rax, %r12
addq $0x4, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x4474
movq %r12, %rdi
movq %rax, %rsi
callq 0x2200
leaq 0x3562(%rip), %rsi      # 0x7452
movq %rax, %rdi
callq 0x2240
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x2320
leaq 0x8(%rsp), %rdi
callq 0x21b0
movq %rbx, %rax
addq $0x190, %rsp            # imm = 0x190
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x21b0
movq %rbx, %rdi
callq 0x2380
// File: /workspace/github_cpp_makefile_star2_O2/chrischute[P]are-you-the-one/src/ayto.cpp
// Function: getPrintableNumbers(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
string getPrintableNumbers(const PerfectMatching& p) {
    stringstream printableNumbersBuilder;

    printableNumbersBuilder << "(";
    for (PerfectMatching::const_iterator i = p.begin(); i != p.end(); i++) {
        printableNumbersBuilder << *i;
        if (i != p.end() - 1)
            printableNumbersBuilder << ", ";
    }
    printableNumbersBuilder << ")";

    return printableNumbersBuilder.str();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2190
leaq 0x18(%rsp), %r15
leaq 0x32d0(%rip), %rsi      # 0x7234
movq %r15, %rdi
callq 0x2240
movq (%r14), %rax
leaq 0x32c0(%rip), %r12      # 0x7236
movq %rax, %r13
addq 0x8(%r14), %rax
cmpq %rax, %r13
je 0x3fb4
movsbl (%r13), %esi
movq %r15, %rdi
callq 0x2290
movq (%r14), %rax
movq 0x8(%r14), %rcx
addq %rax, %rcx
decq %rcx
cmpq %rcx, %r13
je 0x3faf
movq %r15, %rdi
movq %r12, %rsi
callq 0x2240
movq (%r14), %rax
incq %r13
jmp 0x3f79
leaq 0x3497(%rip), %rsi      # 0x7452
movq %r15, %rdi
callq 0x2240
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x2320
leaq 0x8(%rsp), %rdi
callq 0x21b0
movq %rbx, %rax
addq $0x190, %rsp            # imm = 0x190
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x3ff0
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x21b0
movq %rbx, %rdi
callq 0x2380
nop
// File: /workspace/github_cpp_makefile_star2_O2/chrischute[P]are-you-the-one/src/PerfectMatching.cpp
// Function: numInCommon(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
int numInCommon(PerfectMatching const& pm1, PerfectMatching const& pm2) {
    int numInCommon = 0;
    for (unsigned int i = 0; i < pm1.size() && i < pm2.size(); ++i)
        if (pm1[i] == pm2[i])
            ++numInCommon;
    return numInCommon;
}

// Assembly:
movq (%rdi), %rcx
movq 0x8(%rdi), %rax
movq (%rsi), %rdx
movq 0x8(%rsi), %rsi
cmpq %rsi, %rax
cmovbq %rax, %rsi
xorl %eax, %eax
xorl %edi, %edi
movl %edi, %edi
cmpq %rdi, %rsi
jbe 0x5832
movb (%rcx,%rdi), %r8b
xorl %r9d, %r9d
cmpb (%rdx,%rdi), %r8b
sete %r9b
addl %r9d, %eax
incl %edi
jmp 0x5815
retq
nop