// File: /workspace/github_cpp_makefile_star2_O3/splatlab[P]debgr/threadsafe-gqf/gqf.c
// Function: shift_runends(quotient_filter*, long, unsigned long, unsigned long)
static inline void shift_runends(QF *qf, int64_t first, uint64_t last,
																 uint64_t distance)
{
	assert(last < qf->metadata->xnslots && distance < 64);
	uint64_t first_word = first / 64;
	uint64_t bstart = first % 64;
	uint64_t last_word = (last + distance + 1) / 64;
	uint64_t bend = (last + distance + 1) % 64;

	if (last_word != first_word) {
		METADATA_WORD(qf, runends, 64*last_word) = shift_into_b(METADATA_WORD(qf, runends, 64*(last_word-1)), 
																														METADATA_WORD(qf, runends, 64*last_word),
																														0, bend, distance);
		bend = 64;
		last_word--;
		while (last_word != first_word) {
			METADATA_WORD(qf, runends, 64*last_word) = shift_into_b(METADATA_WORD(qf, runends, 64*(last_word-1)), 
																															METADATA_WORD(qf, runends, 64*last_word),
																															0, bend, distance);
			last_word--;
		}
	}
	METADATA_WORD(qf, runends, 64*last_word) = shift_into_b(0, METADATA_WORD(qf,
																																					 runends,
																																					 64*last_word),
																													bstart, bend, distance);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r8
movabsq $0x1ffffffffffffff8, %rbp # imm = 0x1FFFFFFFFFFFFFF8
movabsq $0x3ffffffffffffff, %rbx # imm = 0x3FFFFFFFFFFFFFF
leaq 0x3f(%rsi), %rax
testq %rsi, %rsi
cmovnsq %rsi, %rax
movq %rax, %r11
sarq $0x6, %r11
andq $-0x40, %rax
subq %rax, %rsi
leaq (%rcx,%rdx), %r15
incq %r15
movq %r15, %r10
shrq $0x6, %r10
andl $0x3f, %r15d
cmpq %r11, %r10
jne 0x13280
movq 0x8(%rdi), %r14
movq 0x10(%rdi), %r9
movl %r8d, %edx
jmp 0x1336a
addq %r8, %rdx
addq $-0x3f, %rdx
shrq $0x6, %rdx
movq 0x8(%rdi), %r14
movq 0x10(%rdi), %r9
movq 0x38(%r14), %rdi
shlq $0x3, %rdi
andq %rbp, %rdi
addq $0x11, %rdi
imulq %rdi, %rdx
movq 0x9(%r9,%rdx), %r12
imulq %r10, %rdi
movq $-0x1, %r13
movl %r15d, %ecx
shlq %cl, %r13
movq 0x9(%r9,%rdi), %rax
movq %r13, %rbp
movl %r8d, %ecx
negl %ecx
shrq %cl, %r12
notq %rbp
andq %rax, %r13
andq %rbp, %rax
movl %r8d, %ecx
shlq %cl, %rax
movl $0x40, %r15d
movl %r8d, %edx
andq %rbp, %rax
orq %r12, %r13
orq %rax, %r13
movq %r13, 0x9(%r9,%rdi)
leaq -0x1(%r10), %r12
cmpq %r11, %r12
jne 0x13307
movabsq $0x1ffffffffffffff8, %rbp # imm = 0x1FFFFFFFFFFFFFF8
jmp 0x1336a
movl $0x40, %edi
subl %r8d, %edi
leaq (%rbx,%r10), %r8
decq %r8
movabsq $0x1ffffffffffffff8, %rbp # imm = 0x1FFFFFFFFFFFFFF8
movq %r8, %rax
andq %rbx, %rax
movq 0x38(%r14), %rcx
shlq $0x3, %rcx
andq %rbp, %rcx
addq $0x11, %rcx
imulq %rcx, %rax
movq 0x9(%r9,%rax), %rax
movq %r12, %r10
andq %rbx, %r10
imulq %rcx, %r10
movq 0x9(%r9,%r10), %r13
movl %edi, %ecx
shrq %cl, %rax
movl %edx, %ecx
shlq %cl, %r13
orq %rax, %r13
movq %r13, 0x9(%r9,%r10)
decq %r12
decq %r8
cmpq %r12, %r11
jne 0x13320
andq %rbx, %r11
movq 0x38(%r14), %rdi
shlq $0x3, %rdi
andq %rbp, %rdi
addq $0x11, %rdi
imulq %r11, %rdi
subl %esi, %r15d
movq $-0x1, %rax
movq $-0x1, %r8
movl %r15d, %ecx
shlq %cl, %r8
cmpl $0x40, %r15d
notq %r8
cmoveq %rax, %r8
movl %esi, %ecx
shlq %cl, %r8
movq 0x9(%r9,%rdi), %rax
movq %r8, %rsi
andq %rax, %rsi
movl %edx, %ecx
shlq %cl, %rsi
xorq %rax, %rsi
andq %r8, %rsi
xorq %rax, %rsi
movq %rsi, 0x9(%r9,%rdi)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq