// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/test/pileup.c
// Function: print_pileup_seq
static int print_pileup_seq(const bam_pileup1_t *p, int n) {
    kstring_t ks = { 0, 0, NULL };
    int i;

    for (i = 0; i < n; i++, p++) {
        uint8_t *seq = bam_get_seq(p->b);
        int del_len, is_rev = bam_is_rev(p->b);

        if (p->is_head)
            putchar('^'), putchar('!'+MIN(p->b->core.qual,93));

        if (p->is_del)
            putchar(p->is_refskip ? (is_rev ? '<' : '>') : '*');
        else {
            unsigned char c = seq_nt16_str[bam_seqi(seq, p->qpos)];
            putchar(is_rev ? tolower(c) : toupper(c));
        }

        del_len = -p->indel;
        if (p->indel > 0) {
            int j, len = bam_plp_insertion(p, &ks, &del_len);
            if (len < 0) {
                perror("bam_plp_insertion");
                goto fail;
            }
            printf("%+d(", len);
            for (j = 0; j < len; j++)
                putchar(is_rev ?
                        tolower((uint8_t) ks.s[j]) :
                        toupper((uint8_t) ks.s[j]));
            putchar(')');
        }
        if (del_len > 0) {
            printf("-%d()", del_len);
        }
        if (p->is_tail)
            putchar('$');
    }
    free(ks.s);
    return 0;

 fail:
    free(ks.s);
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
leaq 0x10(%rsp), %rax
andq $0x0, 0x10(%rax)
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
xorl %eax, %eax
testl %esi, %esi
cmovlel %eax, %esi
movl %esi, 0xc(%rsp)
xorl %ebx, %ebx
cmpl 0xc(%rsp), %ebx
je 0x6055
movq (%r14), %rax
movl 0x14(%rax), %r13d
shll $0x2, %r13d
addq 0x38(%rax), %r13
movzwl 0x12(%rax), %r15d
movzwl 0x10(%rax), %r12d
movl 0x14(%r14), %eax
testb $0x2, %al
je 0x5f44
pushq $0x5e
popq %rdi
callq 0x46d0
movq (%r14), %rax
movb 0xe(%rax), %al
leal 0x21(%rax), %ecx
cmpb $0x5d, %al
movzbl %cl, %eax
pushq $0x7e
popq %rcx
cmovael %ecx, %eax
movzbl %al, %edi
callq 0x46d0
movl 0x14(%r14), %eax
testb $0x1, %al
jne 0x5f81
addq %r15, %r13
movl 0x8(%r14), %ecx
movl %ecx, %eax
sarl %eax
cltq
movzbl (%r13,%rax), %eax
shll $0x2, %ecx
notb %cl
andb $0x4, %cl
shrl %cl, %eax
andl $0xf, %eax
leaq 0x6b531(%rip), %rcx     # 0x714a0
movzbl (%rcx,%rax), %r15d
testb $0x10, %r12b
jne 0x5f98
callq 0x40a0
jmp 0x5f9d
xorl %ecx, %ecx
testb $0x10, %r12b
sete %cl
testb $0x8, %al
leal 0x3c(%rcx,%rcx), %edi
pushq $0x2a
popq %rax
cmovel %eax, %edi
jmp 0x5fa4
callq 0x40c0
movq (%rax), %rax
movl (%rax,%r15,4), %edi
callq 0x46d0
movl 0xc(%r14), %eax
movl %eax, %esi
negl %esi
movl %esi, 0x8(%rsp)
testl %eax, %eax
jle 0x6029
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x1c845
testl %eax, %eax
js 0x6072
movl %eax, %r13d
leaq 0x6b114(%rip), %rdi     # 0x710f1
movl %eax, %esi
xorl %eax, %eax
callq 0x4060
movl %r13d, %r13d
xorl %r15d, %r15d
cmpq %r15, %r13
je 0x601d
movq 0x20(%rsp), %rax
movzbl (%rax,%r15), %ebp
testb $0x10, %r12b
jne 0x6008
callq 0x40a0
jmp 0x600d
callq 0x40c0
movq (%rax), %rax
movl (%rax,%rbp,4), %edi
callq 0x46d0
incq %r15
jmp 0x5fec
pushq $0x29
popq %rdi
callq 0x46d0
movl 0x8(%rsp), %esi
testl %esi, %esi
jle 0x603b
leaq 0x6b0c2(%rip), %rdi     # 0x710f6
xorl %eax, %eax
callq 0x4060
testb $0x4, 0x14(%r14)
je 0x604a
pushq $0x24
popq %rdi
callq 0x46d0
incl %ebx
addq $0x28, %r14
jmp 0x5ef1
xorl %ebx, %ebx
movq 0x20(%rsp), %rdi
callq 0x45d0
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6b066(%rip), %rdi     # 0x710df
callq 0x43e0
pushq $-0x1
popq %rbx
jmp 0x6057