// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/test/pileup_mod.c
// Function: process_pileup
void process_pileup(sam_hdr_t *h, const bam_pileup1_t *p,
                    int tid, int pos, int n) {
    kstring_t s = {0,0};
    printf("%s\t%d\t", sam_hdr_tid2name(h, tid), pos);
    int i;
    for (i = 0; i < n; i++, p++) {
        if (p->is_del) {
            putchar('*');
            continue;
        }

        uint8_t *seq = bam_get_seq(p->b);
        uint8_t *qual = bam_get_qual(p->b);
        unsigned char c = seq_nt16_str[bam_seqi(seq, p->qpos)];
        putchar(c);
        kputc(MIN('~','!'+qual[p->qpos]), &s);
    }
    putchar('\t');
    puts(s.l ? s.s : "");

    free(s.s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x4260
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0xcf90
movq %rax, %rsi
movl -0x18(%rbp), %edx
leaq 0xe0505(%rip), %rdi     # 0xe6028
movb $0x0, %al
callq 0x4060
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x5c78
movq -0x10(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x5b5b
movl $0x2a, %edi
callq 0x46a0
jmp 0x5c5e
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x38(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movl 0x14(%rcx), %ecx
shll $0x2, %ecx
movl %ecx, %ecx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movzwl 0x12(%rcx), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x38(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movl 0x14(%rcx), %ecx
shll $0x2, %ecx
movl %ecx, %ecx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movzwl 0x12(%rcx), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movl 0x18(%rcx), %ecx
addl $0x1, %ecx
sarl %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0x8(%rcx), %ecx
sarl %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movq -0x10(%rbp), %rcx
movl 0x8(%rcx), %ecx
xorl $-0x1, %ecx
andl $0x1, %ecx
shll $0x2, %ecx
sarl %cl, %eax
andl $0xf, %eax
movslq %eax, %rcx
leaq 0xe12e9(%rip), %rax     # 0xe6ef0
movb (%rax,%rcx), %al
movb %al, -0x51(%rbp)
movzbl -0x51(%rbp), %edi
callq 0x46a0
movq -0x50(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x8(%rcx), %rcx
movzbl (%rax,%rcx), %ecx
addl $0x21, %ecx
movl $0x7e, %eax
cmpl %ecx, %eax
jge 0x5c3c
movl $0x7e, %eax
movl %eax, -0x58(%rbp)
jmp 0x5c52
movq -0x50(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x8(%rcx), %rcx
movzbl (%rax,%rcx), %eax
addl $0x21, %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %edi
leaq -0x38(%rbp), %rsi
callq 0x5cc0
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
movq -0x10(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x10(%rbp)
jmp 0x5b31
movl $0x9, %edi
callq 0x46a0
cmpq $0x0, -0x38(%rbp)
je 0x5c93
movq -0x28(%rbp), %rax
movq %rax, -0x60(%rbp)
jmp 0x5ca0
leaq 0xe15a0(%rip), %rax     # 0xe723a
movq %rax, -0x60(%rbp)
jmp 0x5ca0
movq -0x60(%rbp), %rdi
callq 0x47d0
movq -0x28(%rbp), %rdi
callq 0x45b0
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)