// File: /workspace/github_c_makefile_star2_O2/lh3[P]fermi2/correct.c
// Function: update_aux
static inline void update_aux(int k, fmc_aux_t *a, const echeap1_t *p, int b, int state, int penalty, int is_diff, int is_solid)
{
	ecstack1_t *q;
	echeap1_t *r;
	// update the stack
	kv_pushp(ecstack1_t, a->stack, &q);
	q->parent = p->k;
	q->i = p->i;
	q->base = b;
	q->state = state;
	q->penalty = p->penalty + penalty;
	// update the heap
	kv_pushp(echeap1_t, a->heap, &r);
	r->penalty = q->penalty;
	r->k = a->stack.n - 1;
	r->kmer[0] = p->kmer[0], r->kmer[1] = p->kmer[1];
	r->state = state;
	r->i = state == STATE_I? p->i : p->i + 1;
	r->last_solid = is_solid && is_diff? r->i : p->last_solid;
	r->ec_pos4 = is_diff? p->ec_pos4<<16 | (p->i + 1) : p->ec_pos4;
	if (fmc_verbose >= 6)fprintf(stderr, "+> [%d] (%d,%c), ipen=%d, state=%c, w=%d\n", r->k, r->i, "ACGTN"[b], penalty, "NMID"[state], q->penalty);
	if (state != STATE_D) append_to_kmer(k, r->kmer, b);
	ks_heapup_ec(a->heap.n, a->heap.a);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, %r12d
movl %ecx, %r8d
movq %rdx, %r13
movq %rsi, %rbx
movl %edi, 0x14(%rsp)
movl 0x58(%rsp), %ebp
movl 0x50(%rsp), %r15d
movq 0x90(%rsi), %rcx
pushq $0x2
popq %rax
cmpq 0x98(%rsi), %rcx
movl %r8d, 0xc(%rsp)
jne 0x9ac8
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
cmoveq %rax, %rsi
movq %rsi, 0x98(%rbx)
movq 0xa0(%rbx), %rdi
shlq $0x4, %rsi
movl %r9d, %r14d
callq 0x2260
movl %r14d, %r9d
movl 0xc(%rsp), %r8d
movq %rax, 0xa0(%rbx)
movq 0x90(%rbx), %rcx
jmp 0x9acf
movq 0xa0(%rbx), %rax
leaq 0x1(%rcx), %rdx
movq %rdx, 0x90(%rbx)
shlq $0x4, %rcx
leaq (%rax,%rcx), %r11
movq 0x14(%r13), %rsi
movq %rsi, (%rax,%rcx)
movb %r8b, 0xd(%rax,%rcx)
movb %r12b, 0xc(%rax,%rcx)
movl 0x10(%r13), %esi
addl %r9d, %esi
movl %esi, 0x8(%rax,%rcx)
movq 0x78(%rbx), %rcx
cmpq 0x80(%rbx), %rcx
jne 0x9b70
leaq (%rcx,%rcx), %rax
testq %rcx, %rcx
pushq $0x2
popq %rcx
cmoveq %rcx, %rax
movq %rax, 0x80(%rbx)
movq 0x88(%rbx), %rdi
imulq $0x28, %rax, %rsi
movl %r9d, %r14d
movl %r15d, 0x10(%rsp)
movl %r12d, %r15d
movl %ebp, %r12d
movq %r11, %rbp
callq 0x2260
movq %rbp, %r11
movl %r12d, %ebp
movl %r15d, %r12d
movl 0x10(%rsp), %r15d
movl %r14d, %r9d
movl 0xc(%rsp), %r8d
movq %rax, 0x88(%rbx)
movq 0x78(%rbx), %rcx
movq 0x90(%rbx), %rdx
movl 0x8(%r11), %esi
jmp 0x9b77
movq 0x88(%rbx), %rax
leaq 0x1(%rcx), %rdi
movq %rdi, 0x78(%rbx)
imulq $0x28, %rcx, %rdi
leaq (%rax,%rdi), %r14
movl %esi, 0x10(%rax,%rdi)
decl %edx
movl %edx, 0x14(%rax,%rdi)
movq (%r13), %rcx
movq %rcx, (%rax,%rdi)
movq 0x8(%r13), %rcx
movq %rcx, 0x8(%rax,%rdi)
movl 0x1c(%rax,%rdi), %ecx
movl %r12d, %esi
andl $0x7, %esi
andl $-0x8, %ecx
orl %esi, %ecx
movl %ecx, 0x1c(%rax,%rdi)
movl 0x18(%r13), %ecx
incl %ecx
movl %ecx, 0x18(%rax,%rdi)
testl %ebp, %ebp
sete %al
testl %r15d, %r15d
sete %dil
orb %al, %dil
jne 0x9bd9
leal (%rsi,%rcx,8), %eax
movl %eax, 0x1c(%r14)
jmp 0x9beb
movl 0x1c(%r13), %eax
andl $-0x8, %eax
orl %esi, %eax
movl %eax, 0x1c(%r14)
testl %r15d, %r15d
je 0x9c37
movq 0x20(%r13), %rsi
shlq $0x10, %rsi
movslq 0x18(%r13), %rax
incq %rax
orq %rsi, %rax
movq %rax, 0x20(%r14)
cmpl $0x6, 0x185c8(%rip)     # 0x221d0
jge 0x9c3d
movl 0x14(%rsp), %edi
movq %r14, %rsi
movl %r8d, %edx
callq 0x9591
movq 0x78(%rbx), %rdi
movq 0x88(%rbx), %rsi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6cf5
movq 0x20(%r13), %rax
jmp 0x9bfd
movq 0x183b4(%rip), %rax     # 0x21ff8
movq (%rax), %rdi
movl %r8d, %eax
leaq 0xf784(%rip), %rsi      # 0x193d5
movsbl (%rax,%rsi), %r8d
movl %r12d, %eax
leaq 0x10034(%rip), %rsi     # 0x19c94
movsbl (%rax,%rsi), %r10d
movl 0x8(%r11), %r11d
leaq 0xfffa(%rip), %rsi      # 0x19c6a
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x21c0
movl 0x1c(%rsp), %r8d
addq $0x10, %rsp
jmp 0x9c0a