// File: /workspace/github_cpp_makefile_star2_O1/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, %r11
movabsq $0x1ffffffffffffff8, %rax # imm = 0x1FFFFFFFFFFFFFF8
movabsq $0x3ffffffffffffff, %rbx # imm = 0x3FFFFFFFFFFFFFF
leaq 0x3f(%rsi), %rcx
testq %rsi, %rsi
cmovnsq %rsi, %rcx
movq %rcx, %r14
sarq $0x6, %r14
andq $-0x40, %rcx
subq %rcx, %rsi
leaq (%r11,%rdx), %r10
incq %r10
movq %r10, %r13
shrq $0x6, %r13
andl $0x3f, %r10d
cmpq %r14, %r13
jne 0x135f3
movq %rax, %rcx
jmp 0x136f1
addq %r11, %rdx
addq $-0x3f, %rdx
shrq $0x6, %rdx
movq 0x8(%rdi), %r15
movq %rdi, -0x10(%rsp)
movq 0x10(%rdi), %r12
movq 0x38(%r15), %r8
shlq $0x3, %r8
andq %rax, %r8
addq $0x11, %r8
imulq %r8, %rdx
movq 0x9(%r12,%rdx), %rdx
movq $-0x1, %r9
movl %r10d, %ecx
shlq %cl, %r9
imulq %r13, %r8
movq %rax, %rdi
movq 0x9(%r12,%r8), %rax
movl %r11d, %ecx
negl %ecx
shrq %cl, %rdx
movq %r9, %rbp
notq %rbp
movq %rax, %r10
andq %rbp, %r10
movl %r11d, %ecx
shlq %cl, %r10
andq %rax, %r9
andq %rbp, %r10
orq %rdx, %r9
orq %r10, %r9
movq %r9, 0x9(%r12,%r8)
leaq -0x1(%r13), %rdx
movl $0x40, %r10d
cmpq %r14, %rdx
jne 0x1367e
movq %rdi, %rcx
movq %rdx, %r13
jmp 0x136ec
movl $0x40, %r8d
subl %r11d, %r8d
movq %r11, -0x8(%rsp)
movl %r11d, %r9d
addq %rbx, %r13
decq %r13
movq %r13, %rax
andq %rbx, %rax
movq 0x38(%r15), %rcx
shlq $0x3, %rcx
andq %rdi, %rcx
addq $0x11, %rcx
imulq %rcx, %rax
movq 0x9(%r12,%rax), %rax
movq %rdx, %rbp
andq %rbx, %rbp
imulq %rcx, %rbp
movq 0x9(%r12,%rbp), %r11
movl %r8d, %ecx
shrq %cl, %rax
movl %r9d, %ecx
shlq %cl, %r11
orq %rax, %r11
movq %r11, 0x9(%r12,%rbp)
decq %rdx
decq %r13
cmpq %rdx, %r14
jne 0x13695
movq %rdi, %rcx
movq %r14, %r13
movq -0x8(%rsp), %r11
movq -0x10(%rsp), %rdi
andq %rbx, %r13
movq 0x8(%rdi), %rax
movq 0x38(%rax), %rdx
shlq $0x3, %rdx
andq %rcx, %rdx
addq $0x11, %rdx
imulq %r13, %rdx
subl %esi, %r10d
movq $-0x1, %rax
movq $-0x1, %r9
movl %r10d, %ecx
shlq %cl, %r9
cmpl $0x40, %r10d
notq %r9
cmoveq %rax, %r9
movl %esi, %ecx
shlq %cl, %r9
movq 0x10(%rdi), %rax
movq 0x9(%rax,%rdx), %rsi
movq %r9, %r8
andq %rsi, %r8
movl %r11d, %ecx
shlq %cl, %r8
xorq %rsi, %r8
andq %r9, %r8
xorq %rsi, %r8
movq %r8, 0x9(%rax,%rdx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq