// File: /workspace/github_c_makefile_star2_O1/lh3[P]fermi-lite/bfc.c
// Function: buf_update
static void buf_update(bfc_ec1buf_t *e, const echeap1_t *prev, bfc_penalty_t pen, int cnt)
{
	ecstack1_t *q;
	echeap1_t *r;
	const bfc_opt_t *o = e->opt;
	int b = pen.b;
	// update stack
	kv_pushp(ecstack1_t, e->stack, &q);
	q->parent = prev->k;
	q->i = prev->i;
	q->b = b;
	q->pen = pen;
	q->cnt = cnt > 0? cnt&0xff : 0;
	q->tot_pen = prev->tot_pen + weighted_penalty(o, pen);
	// update heap
	kv_pushp(echeap1_t, e->heap, &r);
	r->i = prev->i + 1;
	r->k = e->stack.n - 1;
	r->x = prev->x;
	if (pen.ec_high) {
		memcpy(r->ecpos_high + 1, prev->ecpos_high, (BFC_EC_HIST_HIGH - 1) * 4);
		r->ecpos_high[0] = prev->i;
	} else memcpy(r->ecpos_high, prev->ecpos_high, BFC_EC_HIST_HIGH * 4);
	if (pen.ec) {
		memcpy(r->ecpos + 1, prev->ecpos, (BFC_EC_HIST - 1) * 4);
		r->ecpos[0] = prev->i;
	} else memcpy(r->ecpos, prev->ecpos, BFC_EC_HIST * 4);
	r->tot_pen = q->tot_pen;
	bfc_kmer_append(e->opt->k, r->x.x, b);
	ks_heapup_ec(e->heap.n, e->heap.a);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %r8
movl %ebp, %esi
shrb $0x4, %sil
movq 0x30(%rdi), %rax
cmpq %rax, 0x28(%rdi)
jne 0x7393
movl %ecx, %r13d
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl %esi, %r15d
movl $0x2, %esi
cmovneq %rcx, %rsi
movq %rsi, 0x30(%rbx)
movq 0x38(%rbx), %rdi
shlq $0x4, %rsi
movq %r8, %r12
callq 0x21d0
movl %r13d, %ecx
movq %r12, %r8
movl %r15d, %esi
movq %rax, 0x38(%rbx)
movq 0x28(%rbx), %r12
movq 0x38(%rbx), %r13
leaq 0x1(%r12), %rax
movq %rax, 0x28(%rbx)
shlq $0x4, %r12
movl 0x8(%r14), %eax
movl %eax, (%r13,%r12)
movl 0x4(%r14), %eax
movl %eax, 0x4(%r13,%r12)
movb %sil, 0xc(%r13,%r12)
movb %bpl, 0xd(%r13,%r12)
xorl %eax, %eax
testl %ecx, %ecx
movzbl %cl, %ecx
cmovlel %eax, %ecx
movw %cx, 0xe(%r13,%r12)
movl %ebp, %edi
andb $0x1, %dil
movzbl %dil, %eax
imull 0x20(%r8), %eax
movl %ebp, %r15d
shrb %r15b
andb $0x1, %r15b
movzbl %r15b, %ecx
imull 0x24(%r8), %ecx
movl %ebp, %edx
shrb $0x2, %dl
andb $0x1, %dl
movzbl %dl, %edx
imull 0x28(%r8), %edx
addl %ecx, %edx
shrb $0x3, %bpl
andb $0x1, %bpl
movzbl %bpl, %ecx
imull 0x2c(%r8), %ecx
addl (%r14), %eax
addl %edx, %eax
addl %ecx, %eax
movl %eax, 0x8(%r13,%r12)
movq 0x18(%rbx), %rax
cmpq %rax, 0x10(%rbx)
jne 0x7466
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x2, %eax
cmovneq %rcx, %rax
movq %rax, 0x18(%rbx)
movb %dil, 0x7(%rsp)
movq 0x20(%rbx), %rdi
shlq $0x3, %rax
movl %esi, %ebp
leaq (%rax,%rax,8), %rsi
callq 0x21d0
movb 0x7(%rsp), %dil
movl %ebp, %esi
movq %rax, 0x20(%rbx)
movq 0x10(%rbx), %rax
movq 0x20(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x10(%rbx)
leaq (%rax,%rax,8), %rax
leaq (%rcx,%rax,8), %rax
movl 0x4(%r14), %ecx
incl %ecx
movl %ecx, 0x4(%rax)
movl 0x28(%rbx), %ecx
decl %ecx
movl %ecx, 0x8(%rax)
movups 0x28(%r14), %xmm0
movups 0x38(%r14), %xmm1
movups %xmm0, 0x28(%rax)
movups %xmm1, 0x38(%rax)
testb %r15b, %r15b
jne 0x74b0
movq 0xc(%r14), %rcx
movq %rcx, 0xc(%rax)
jmp 0x74be
movl 0xc(%r14), %ecx
movl %ecx, 0x10(%rax)
movl 0x4(%r14), %ecx
movl %ecx, 0xc(%rax)
addq %r12, %r13
testb %dil, %dil
jne 0x74db
leaq 0x14(%rax), %rcx
movl 0x24(%r14), %edx
movl %edx, 0x10(%rcx)
movups 0x14(%r14), %xmm0
movups %xmm0, (%rcx)
jmp 0x74eb
movups 0x14(%r14), %xmm0
movups %xmm0, 0x18(%rax)
movl 0x4(%r14), %ecx
movl %ecx, 0x14(%rax)
movzbl %sil, %edx
movl 0x8(%r13), %ecx
movl %ecx, (%rax)
movq (%rbx), %rcx
movb 0x8(%rcx), %cl
movq $-0x1, %rdi
shlq %cl, %rdi
notq %rdi
movl %edx, %esi
andl $0x1, %esi
movq 0x28(%rax), %r8
movq 0x30(%rax), %r9
leaq (%rsi,%r8,2), %r8
andq %rdi, %r8
movq %r8, 0x28(%rax)
addq %r9, %r9
shrl %edx
orq %rdx, %r9
andq %rdi, %r9
movq %r9, 0x30(%rax)
movq 0x38(%rax), %rdi
xorq $0x1, %rsi
decb %cl
shlq %cl, %rsi
shrq %rdi
orq %rdi, %rsi
movq %rsi, 0x38(%rax)
xorq $0x1, %rdx
shlq %cl, %rdx
movq 0x40(%rax), %rcx
shrq %rcx
orq %rcx, %rdx
movq %rdx, 0x40(%rax)
movq 0x10(%rbx), %rdi
movq 0x20(%rbx), %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x514a
nop