// File: /workspace/github_c_makefile_star2_O0/c-zhou[P]oatk/levdist.c
// Function: wf_traceback
static uint32_t *wf_traceback(int32_t t_end, const char *ts, int32_t q_end, const char *qs, wf_tb_t *tb, int32_t *n_cigar)
{
    wf_cigar_t cigar = {0,0,0};
    int32_t i = q_end, k = t_end, s = tb->n - 1;
    for (;;) {
        int32_t k0 = k, j, pre;
        while (i >= 0 && k >= 0 && qs[i] == ts[k])
            --i, --k;
        if (k0 - k > 0)    
            wf_cigar_push1(&cigar, 7, k0 - k);
        if (i < 0 || k < 0) break;
        assert(s >= 0);
        j = i - k - tb->a[s].d0;
        assert(j < tb->a[s].n);
        pre = (int32_t)(tb->a[s].a[j>>5] >> (j&0x1f)*2 & 0x3) - 1;
        if (pre == 0) {
            wf_cigar_push1(&cigar, 8, 1);
            --i, --k;
        } else if (pre < 0) {
            wf_cigar_push1(&cigar, 1, 1);
            --i;
        } else {
            wf_cigar_push1(&cigar, 2, 1);
            --k;
        }
        --s;
    }
    if (i >= 0) wf_cigar_push1(&cigar, 1, i + 1);
    else if (k >= 0) wf_cigar_push1(&cigar, 2, k + 1);
    for (i = 0; i < cigar.n>>1; ++i) {
        uint32_t t = cigar.cigar[i];
        cigar.cigar[i] = cigar.cigar[cigar.n - i - 1];
        cigar.cigar[cigar.n - i - 1] = t;
    }
    *n_cigar = cigar.n;
    return cigar.cigar;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x21f0
movl -0x14(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0x48(%rbp)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
subq $0x1, %rax
movl %eax, -0x4c(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x50(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x44(%rbp)
movb %al, -0x5d(%rbp)
jl 0x1e7d5
xorl %eax, %eax
cmpl $0x0, -0x48(%rbp)
movb %al, -0x5d(%rbp)
jl 0x1e7d5
movq -0x20(%rbp), %rax
movslq -0x44(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movq -0x10(%rbp), %rcx
movslq -0x48(%rbp), %rdx
movsbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
sete %al
movb %al, -0x5d(%rbp)
movb -0x5d(%rbp), %al
testb $0x1, %al
jne 0x1e7de
jmp 0x1e7f2
movl -0x44(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x44(%rbp)
movl -0x48(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x1e79f
movl -0x50(%rbp), %eax
subl -0x48(%rbp), %eax
cmpl $0x0, %eax
jle 0x1e811
movl -0x50(%rbp), %edx
subl -0x48(%rbp), %edx
leaq -0x40(%rbp), %rdi
movl $0x7, %esi
callq 0x1f8c0
cmpl $0x0, -0x44(%rbp)
jl 0x1e81d
cmpl $0x0, -0x48(%rbp)
jge 0x1e822
jmp 0x1e958
cmpl $0x0, -0x4c(%rbp)
jl 0x1e82a
jmp 0x1e849
leaq 0x10280(%rip), %rdi     # 0x2eab1
leaq 0x10129(%rip), %rsi     # 0x2e961
movl $0xee, %edx
leaq 0x10274(%rip), %rcx     # 0x2eab8
callq 0x21e0
movl -0x44(%rbp), %eax
subl -0x48(%rbp), %eax
movq -0x28(%rbp), %rcx
movq 0x10(%rcx), %rcx
movslq -0x4c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
subl 0x4(%rcx), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
movq -0x28(%rbp), %rcx
movq 0x10(%rcx), %rcx
movslq -0x4c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jge 0x1e884
jmp 0x1e8a3
leaq 0x10288(%rip), %rdi     # 0x2eb13
leaq 0x100cf(%rip), %rsi     # 0x2e961
movl $0xf0, %edx
leaq 0x1021a(%rip), %rcx     # 0x2eab8
callq 0x21e0
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x4c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl -0x54(%rbp), %ecx
sarl $0x5, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl -0x54(%rbp), %ecx
andl $0x1f, %ecx
shll %ecx
movl %ecx, %ecx
shrq %cl, %rax
andq $0x3, %rax
subl $0x1, %eax
movl %eax, -0x58(%rbp)
cmpl $0x0, -0x58(%rbp)
jne 0x1e90b
leaq -0x40(%rbp), %rdi
movl $0x8, %esi
movl $0x1, %edx
callq 0x1f8c0
movl -0x44(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x44(%rbp)
movl -0x48(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x1e94a
cmpl $0x0, -0x58(%rbp)
jge 0x1e92c
leaq -0x40(%rbp), %rdi
movl $0x1, %edx
movl %edx, %esi
callq 0x1f8c0
movl -0x44(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x1e948
leaq -0x40(%rbp), %rdi
movl $0x2, %esi
movl $0x1, %edx
callq 0x1f8c0
movl -0x48(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x1e94a
movl -0x4c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x1e799
cmpl $0x0, -0x44(%rbp)
jl 0x1e974
movl -0x44(%rbp), %edx
addl $0x1, %edx
leaq -0x40(%rbp), %rdi
movl $0x1, %esi
callq 0x1f8c0
jmp 0x1e990
cmpl $0x0, -0x48(%rbp)
jl 0x1e98e
movl -0x48(%rbp), %edx
addl $0x1, %edx
leaq -0x40(%rbp), %rdi
movl $0x2, %esi
callq 0x1f8c0
jmp 0x1e990
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
movl -0x3c(%rbp), %ecx
sarl %ecx
cmpl %ecx, %eax
jge 0x1e9f0
movq -0x38(%rbp), %rax
movslq -0x44(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x5c(%rbp)
movq -0x38(%rbp), %rax
movl -0x3c(%rbp), %ecx
subl -0x44(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
movq -0x38(%rbp), %rax
movslq -0x44(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x5c(%rbp), %edx
movq -0x38(%rbp), %rax
movl -0x3c(%rbp), %ecx
subl -0x44(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x1e997
movl -0x3c(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movq -0x38(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)