// File: /workspace/github_c_makefile_star2_O3/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
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movl %esi, 0xc(%rsp)
testl %esi, %esi
jle 0x64b3
movq %rdi, %r14
xorl %r12d, %r12d
movq (%r14), %rax
movl 0x14(%rax), %r15d
shll $0x2, %r15d
addq 0x38(%rax), %r15
movzwl 0x12(%rax), %ebp
movzwl 0x10(%rax), %r13d
movl 0x14(%r14), %eax
testb $0x2, %al
je 0x638c
movl $0x5e, %edi
callq 0x46d0
movq (%r14), %rax
movb 0xe(%rax), %al
leal 0x21(%rax), %ecx
cmpb $0x5d, %al
movzbl %cl, %eax
movl $0x7e, %ecx
cmovael %ecx, %eax
movzbl %al, %edi
callq 0x46d0
movl 0x14(%r14), %eax
testb $0x1, %al
jne 0x63c8
addq %rbp, %r15
movl 0x8(%r14), %ecx
movl %ecx, %eax
sarl %eax
cltq
movzbl (%r15,%rax), %eax
shll $0x2, %ecx
notb %cl
andb $0x4, %cl
shrl %cl, %eax
andl $0xf, %eax
leaq 0x890ea(%rip), %rcx     # 0x8f4a0
movzbl (%rcx,%rax), %r15d
testb $0x10, %r13b
jne 0x63e1
callq 0x40a0
jmp 0x63e6
xorl %ecx, %ecx
testb $0x10, %r13b
sete %cl
testb $0x8, %al
leal 0x3c(%rcx,%rcx), %edi
movl $0x2a, %eax
cmovel %eax, %edi
jmp 0x63ed
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 0x6475
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x23475
testl %eax, %eax
js 0x64cd
movl %eax, %r15d
leaq 0x88ccb(%rip), %rdi     # 0x8f0f1
movl %eax, %esi
xorl %eax, %eax
callq 0x4060
testl %r15d, %r15d
je 0x6467
movl %r15d, %r15d
xorl %ebp, %ebp
movq 0x20(%rsp), %rax
movzbl (%rax,%rbp), %ebx
testb $0x10, %r13b
jne 0x644f
callq 0x40a0
jmp 0x6454
callq 0x40c0
movq (%rax), %rax
movl (%rax,%rbx,4), %edi
callq 0x46d0
incq %rbp
cmpq %rbp, %r15
jne 0x6439
movl $0x29, %edi
callq 0x46d0
movl 0x8(%rsp), %esi
testl %esi, %esi
jle 0x6487
leaq 0x88c76(%rip), %rdi     # 0x8f0f6
xorl %eax, %eax
callq 0x4060
testb $0x4, 0x14(%r14)
je 0x6498
movl $0x24, %edi
callq 0x46d0
incl %r12d
addq $0x28, %r14
cmpl 0xc(%rsp), %r12d
jne 0x6340
xorl %ebx, %ebx
movq 0x20(%rsp), %rdi
jmp 0x64b7
xorl %edi, %edi
xorl %ebx, %ebx
callq 0x45d0
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x88c0b(%rip), %rdi     # 0x8f0df
callq 0x43e0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x64ac