// File: chhylp123[P]hifiasm/anchor.cpp
// Function: reset_k_mer_hit(k_mer_hit*, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long*)
void inline reset_k_mer_hit(k_mer_hit *a, uint64_t a_n, uint64_t xl, uint64_t yl, uint64_t rev, uint64_t *nid)
{
	uint64_t z, han = a_n>>1; k_mer_hit *ai, *aj, ka;
	if(rev) {
		for (z = 0; z < han; z++) {
			ai = &(a[z]); aj = &(a[a_n-z-1]); 
			ka = (*ai); (*ai) = (*aj); (*aj) = ka;

			ai->self_offset = xl-ai->self_offset-1;
			ai->offset = yl-ai->offset-1;

			aj->self_offset = xl-aj->self_offset-1;
			aj->offset = yl-aj->offset-1;
			if(nid) ai->readID = aj->readID = (*nid);
		}
		if(a_n&1) {
			a[z].self_offset = xl-a[z].self_offset-1;
			a[z].offset = yl-a[z].offset-1;
			if(nid) a[z].readID = (*nid);
		}
	} else if(nid) {
		for (z = 0; z < a_n; z++) a[z].readID = (*nid);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x10(%rbp), %rax
shrq %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x1b48d6
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x40(%rbp), %rax
jae 0x1b482d
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
subq -0x38(%rbp), %rcx
subq $0x1, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x60(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq -0x50(%rbp), %rax
movq -0x60(%rbp), %rcx
movq %rcx, (%rax)
movq -0x58(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq -0x48(%rbp), %rcx
movl 0x8(%rcx), %ecx
subq %rcx, %rax
subq $0x1, %rax
movl %eax, %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x20(%rbp), %rax
movq -0x48(%rbp), %rcx
movl 0x4(%rcx), %ecx
subq %rcx, %rax
subq $0x1, %rax
movl %eax, %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x18(%rbp), %rax
movq -0x50(%rbp), %rcx
movl 0x8(%rcx), %ecx
subq %rcx, %rax
subq $0x1, %rax
movl %eax, %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x20(%rbp), %rax
movq -0x50(%rbp), %rcx
movl 0x4(%rcx), %ecx
subq %rcx, %rax
subq $0x1, %rax
movl %eax, %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x4(%rax)
cmpq $0x0, -0x30(%rbp)
je 0x1b481a
movq -0x30(%rbp), %rax
movq (%rax), %rax
movl %eax, %edx
movq -0x50(%rbp), %rax
movl (%rax), %ecx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl $0x80000000, %ecx       # imm = 0x80000000
orl %edx, %ecx
movl %ecx, (%rax)
movq -0x48(%rbp), %rax
movl (%rax), %ecx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl $0x80000000, %ecx       # imm = 0x80000000
orl %edx, %ecx
movl %ecx, (%rax)
jmp 0x1b481c
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x1b46fa
movq -0x10(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x1b48d4
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
movq -0x38(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
subq %rcx, %rax
subq $0x1, %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rcx
movq -0x38(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movl 0x4(%rcx), %ecx
subq %rcx, %rax
subq $0x1, %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
cmpq $0x0, -0x30(%rbp)
je 0x1b48d2
movq -0x30(%rbp), %rax
movq (%rax), %rax
movl %eax, %edx
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %ecx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl $0x80000000, %ecx       # imm = 0x80000000
orl %edx, %ecx
movl %ecx, (%rax)
jmp 0x1b48d4
jmp 0x1b492b
cmpq $0x0, -0x30(%rbp)
je 0x1b4929
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x1b4927
movq -0x30(%rbp), %rax
movq (%rax), %rax
movl %eax, %edx
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %ecx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl $0x80000000, %ecx       # imm = 0x80000000
orl %edx, %ecx
movl %ecx, (%rax)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x1b48e5
jmp 0x1b4929
jmp 0x1b492b
popq %rbp
retq
nopl (%rax)