// File: /workspace/github_c_makefile_star2_O1/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 0x64c1
movq %rdi, %r14
xorl %r13d, %r13d
movq (%r14), %rax
movl 0x14(%rax), %ebp
shll $0x2, %ebp
movzwl 0x12(%rax), %ebx
movzwl 0x10(%rax), %r15d
addq 0x38(%rax), %rbp
testb $0x2, 0x14(%r14)
je 0x637e
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 0x63bd
addq %rbx, %rbp
movl 0x8(%r14), %ecx
movl %ecx, %eax
sarl %eax
cltq
movzbl (%rbp,%rax), %eax
shll $0x2, %ecx
notb %cl
andb $0x4, %cl
shrl %cl, %eax
andl $0xf, %eax
leaq 0x8b084(%rip), %rcx     # 0x91430
movzbl (%rcx,%rax), %ebx
testb $0x10, %r15b
jne 0x63d6
callq 0x40a0
jmp 0x63db
xorl %ecx, %ecx
testb $0x10, %r15b
sete %cl
testb $0x8, %al
leal 0x3c(%rcx,%rcx), %edi
movl $0x2a, %eax
cmovel %eax, %edi
jmp 0x63e1
callq 0x40c0
movq (%rax), %rax
movl (%rax,%rbx,4), %edi
callq 0x46d0
movl 0xc(%r14), %eax
movl %eax, %ecx
negl %ecx
movl %ecx, 0x8(%rsp)
testl %eax, %eax
jle 0x646a
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x23e49
movl %eax, %ebp
testl %eax, %eax
js 0x64ad
leaq 0x8acd8(%rip), %rdi     # 0x910f1
movl %ebp, %esi
xorl %eax, %eax
callq 0x4060
testl %ebp, %ebp
je 0x6459
movl %ebp, %r12d
xorl %ebx, %ebx
testb $0x10, %r15b
jne 0x6438
callq 0x40a0
jmp 0x643d
callq 0x40c0
movq (%rax), %rax
movq 0x20(%rsp), %rcx
movzbl (%rcx,%rbx), %ecx
movl (%rax,%rcx,4), %edi
callq 0x46d0
incq %rbx
cmpq %rbx, %r12
jne 0x642b
movl $0x29, %edi
callq 0x46d0
xorl %r15d, %r15d
testl %ebp, %ebp
js 0x6494
movl 0x8(%rsp), %esi
testl %esi, %esi
jle 0x6480
leaq 0x8ac7d(%rip), %rdi     # 0x910f6
xorl %eax, %eax
callq 0x4060
xorl %r15d, %r15d
testb $0x4, 0x14(%r14)
je 0x6494
movl $0x24, %edi
callq 0x46d0
testl %r15d, %r15d
jne 0x64c5
incl %r13d
addq $0x28, %r14
cmpl 0xc(%rsp), %r13d
jne 0x6339
jmp 0x64c1
leaq 0x8ac2b(%rip), %rdi     # 0x910df
callq 0x43e0
movl $0x5, %r15d
jmp 0x6466
xorl %ebx, %ebx
jmp 0x64d0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x5, %r15d
jne 0x64dc
movq 0x20(%rsp), %rdi
callq 0x45d0
jmp 0x64dc
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq