// File: /workspace/github_c_makefile_star2_O1/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 %r9d, %r15d
movl %r8d, %r9d
movl %ecx, %r14d
movq %rdx, %r13
movq %rsi, %rbx
movl %edi, 0x14(%rsp)
movl 0x58(%rsp), %eax
movl %eax, 0x10(%rsp)
movl 0x50(%rsp), %ebp
movq 0x98(%rsi), %rax
cmpq %rax, 0x90(%rsi)
jne 0xadbc
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x2, %esi
cmovneq %rcx, %rsi
movq %rsi, 0x98(%rbx)
movq 0xa0(%rbx), %rdi
shlq $0x4, %rsi
movl %r14d, %r12d
movl %r9d, %r14d
callq 0x2260
movl %r14d, %r9d
movl %r12d, %r14d
movq %rax, 0xa0(%rbx)
movq 0x90(%rbx), %rax
movq 0xa0(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x90(%rbx)
shlq $0x4, %rax
leaq (%rcx,%rax), %r11
movl 0x14(%r13), %edx
movl %edx, (%rcx,%rax)
movl 0x18(%r13), %edx
movl %edx, 0x4(%rcx,%rax)
movb %r14b, 0xd(%rcx,%rax)
movb %r9b, 0xc(%rcx,%rax)
movl 0x10(%r13), %edx
movl %r15d, 0xc(%rsp)
addl %r15d, %edx
movl %edx, 0x8(%rcx,%rax)
movq 0x80(%rbx), %rax
cmpq %rax, 0x78(%rbx)
jne 0xae57
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x2, %eax
cmovneq %rcx, %rax
movq %rax, 0x80(%rbx)
movq 0x88(%rbx), %rdi
shlq $0x3, %rax
leaq (%rax,%rax,4), %rsi
movl %r14d, %r15d
movl %r9d, %r14d
movq %r11, %r12
callq 0x2260
movq %r12, %r11
movl %r14d, %r9d
movl %r15d, %r14d
movq %rax, 0x88(%rbx)
movq 0x78(%rbx), %rax
movq 0x88(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x78(%rbx)
leaq (%rax,%rax,4), %rax
leaq (%rcx,%rax,8), %r15
movl 0x8(%r11), %eax
movl %eax, 0x10(%r15)
movl 0x90(%rbx), %edx
decl %edx
movl %edx, 0x14(%r15)
movq (%r13), %rax
movq %rax, (%r15)
movq 0x8(%r13), %rax
movq %rax, 0x8(%r15)
movl 0x1c(%r15), %ecx
movl %r9d, %eax
andl $0x7, %eax
andl $-0x8, %ecx
orl %eax, %ecx
movl %ecx, 0x1c(%r15)
movl 0x18(%r13), %ecx
incl %ecx
movl %ecx, 0x18(%r15)
cmpl $0x0, 0x10(%rsp)
sete %sil
testl %ebp, %ebp
sete %dil
orb %sil, %dil
jne 0xaed0
movl %ecx, %esi
andl $0x1fffffff, %esi       # imm = 0x1FFFFFFF
jmp 0xaed7
movl 0x1c(%r13), %esi
shrl $0x3, %esi
leal (%rax,%rsi,8), %eax
movl %eax, 0x1c(%r15)
movq 0x20(%r13), %rax
testl %ebp, %ebp
je 0xaef4
shlq $0x10, %rax
movslq 0x18(%r13), %rsi
incq %rsi
orq %rsi, %rax
movq %rax, 0x20(%r15)
cmpl $0x6, 0x192d1(%rip)     # 0x241d0
movl %r14d, %r12d
jge 0xaf65
movq (%r15), %rdx
movq 0x8(%r15), %rax
movl 0x14(%rsp), %ecx
addl %ecx, %ecx
movq $-0x1, %rsi
shlq %cl, %rsi
shlq $0x2, %rdx
notq %rsi
andq %rdx, %rsi
orq %rsi, %r12
movl $0x3, %edx
subl %r14d, %edx
movslq %edx, %rdx
addb $-0x2, %cl
shlq %cl, %rdx
movq %r12, (%r15)
shrq $0x2, %rax
orq %rax, %rdx
movq %rdx, 0x8(%r15)
movq 0x78(%rbx), %rdi
movq 0x88(%rbx), %rsi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x81b2
movq 0x1908c(%rip), %rax     # 0x23ff8
movq (%rax), %rdi
leaq 0x1143f(%rip), %rax     # 0x1c3b5
movsbl (%r12,%rax), %r8d
movl %r9d, %eax
leaq 0x11c47(%rip), %rsi     # 0x1cbcc
movsbl (%rax,%rsi), %r10d
movl 0x8(%r11), %r11d
leaq 0x11c0d(%rip), %rsi     # 0x1cba2
movl 0xc(%rsp), %r9d
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x21c0
addq $0x10, %rsp
jmp 0xaf04