// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/sam.c
// Function: bam_flag2str
char *bam_flag2str(int flag)
{
    kstring_t str = {0,0,0};
    if ( flag&BAM_FPAIRED ) ksprintf(&str,"%s%s", str.l?",":"","PAIRED");
    if ( flag&BAM_FPROPER_PAIR ) ksprintf(&str,"%s%s", str.l?",":"","PROPER_PAIR");
    if ( flag&BAM_FUNMAP ) ksprintf(&str,"%s%s", str.l?",":"","UNMAP");
    if ( flag&BAM_FMUNMAP ) ksprintf(&str,"%s%s", str.l?",":"","MUNMAP");
    if ( flag&BAM_FREVERSE ) ksprintf(&str,"%s%s", str.l?",":"","REVERSE");
    if ( flag&BAM_FMREVERSE ) ksprintf(&str,"%s%s", str.l?",":"","MREVERSE");
    if ( flag&BAM_FREAD1 ) ksprintf(&str,"%s%s", str.l?",":"","READ1");
    if ( flag&BAM_FREAD2 ) ksprintf(&str,"%s%s", str.l?",":"","READ2");
    if ( flag&BAM_FSECONDARY ) ksprintf(&str,"%s%s", str.l?",":"","SECONDARY");
    if ( flag&BAM_FQCFAIL ) ksprintf(&str,"%s%s", str.l?",":"","QCFAIL");
    if ( flag&BAM_FDUP ) ksprintf(&str,"%s%s", str.l?",":"","DUP");
    if ( flag&BAM_FSUPPLEMENTARY ) ksprintf(&str,"%s%s", str.l?",":"","SUPPLEMENTARY");
    if ( str.l == 0 ) kputsn("", 0, &str);
    return str.s;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movl %edi, %ebx
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
testb $0x1, %bl
je 0x1a913
movq %rsp, %rdi
cmpq $0x0, (%rdi)
leaq 0x3828c(%rip), %rax     # 0x52b7f
leaq 0x38e92(%rip), %rdx     # 0x5378c
cmoveq %rax, %rdx
leaq 0x38e82(%rip), %rsi     # 0x53787
leaq 0x38e29(%rip), %rcx     # 0x53735
xorl %eax, %eax
callq 0x42f92
testb $0x2, %bl
je 0x1a946
movq %rsp, %rdi
cmpq $0x0, (%rdi)
leaq 0x38259(%rip), %rax     # 0x52b7f
leaq 0x38e5f(%rip), %rdx     # 0x5378c
cmoveq %rax, %rdx
leaq 0x38e4f(%rip), %rsi     # 0x53787
leaq 0x38dfd(%rip), %rcx     # 0x5373c
xorl %eax, %eax
callq 0x42f92
testb $0x4, %bl
je 0x1a979
movq %rsp, %rdi
cmpq $0x0, (%rdi)
leaq 0x38226(%rip), %rax     # 0x52b7f
leaq 0x38e2c(%rip), %rdx     # 0x5378c
cmoveq %rax, %rdx
leaq 0x38e1c(%rip), %rsi     # 0x53787
leaq 0x38dd7(%rip), %rcx     # 0x53749
xorl %eax, %eax
callq 0x42f92
testb $0x8, %bl
je 0x1a9ac
movq %rsp, %rdi
cmpq $0x0, (%rdi)
leaq 0x381f3(%rip), %rax     # 0x52b7f
leaq 0x38df9(%rip), %rdx     # 0x5378c
cmoveq %rax, %rdx
leaq 0x38de9(%rip), %rsi     # 0x53787
leaq 0x38da3(%rip), %rcx     # 0x53748
xorl %eax, %eax
callq 0x42f92
testb $0x10, %bl
je 0x1a9df
movq %rsp, %rdi
cmpq $0x0, (%rdi)
leaq 0x381c0(%rip), %rax     # 0x52b7f
leaq 0x38dc6(%rip), %rdx     # 0x5378c
cmoveq %rax, %rdx
leaq 0x38db6(%rip), %rsi     # 0x53787
leaq 0x38d78(%rip), %rcx     # 0x53750
xorl %eax, %eax
callq 0x42f92
testb $0x20, %bl
je 0x1aa12
movq %rsp, %rdi
cmpq $0x0, (%rdi)
leaq 0x3818d(%rip), %rax     # 0x52b7f
leaq 0x38d93(%rip), %rdx     # 0x5378c
cmoveq %rax, %rdx
leaq 0x38d83(%rip), %rsi     # 0x53787
leaq 0x38d44(%rip), %rcx     # 0x5374f
xorl %eax, %eax
callq 0x42f92
testb $0x40, %bl
je 0x1aa45
movq %rsp, %rdi
cmpq $0x0, (%rdi)
leaq 0x3815a(%rip), %rax     # 0x52b7f
leaq 0x38d60(%rip), %rdx     # 0x5378c
cmoveq %rax, %rdx
leaq 0x38d50(%rip), %rsi     # 0x53787
leaq 0x38d1a(%rip), %rcx     # 0x53758
xorl %eax, %eax
callq 0x42f92
testb %bl, %bl
jns 0x1aa77
movq %rsp, %rdi
cmpq $0x0, (%rdi)
leaq 0x38128(%rip), %rax     # 0x52b7f
leaq 0x38d2e(%rip), %rdx     # 0x5378c
cmoveq %rax, %rdx
leaq 0x38d1e(%rip), %rsi     # 0x53787
leaq 0x38cee(%rip), %rcx     # 0x5375e
xorl %eax, %eax
callq 0x42f92
btl $0x8, %ebx
jae 0x1aaab
movq %rsp, %rdi
cmpq $0x0, (%rdi)
leaq 0x380f4(%rip), %rax     # 0x52b7f
leaq 0x38cfa(%rip), %rdx     # 0x5378c
cmoveq %rax, %rdx
leaq 0x38cea(%rip), %rsi     # 0x53787
leaq 0x38cc0(%rip), %rcx     # 0x53764
xorl %eax, %eax
callq 0x42f92
btl $0x9, %ebx
jae 0x1aadf
movq %rsp, %rdi
cmpq $0x0, (%rdi)
leaq 0x380c0(%rip), %rax     # 0x52b7f
leaq 0x38cc6(%rip), %rdx     # 0x5378c
cmoveq %rax, %rdx
leaq 0x38cb6(%rip), %rsi     # 0x53787
leaq 0x38c96(%rip), %rcx     # 0x5376e
xorl %eax, %eax
callq 0x42f92
btl $0xa, %ebx
jae 0x1ab13
movq %rsp, %rdi
cmpq $0x0, (%rdi)
leaq 0x3808c(%rip), %rax     # 0x52b7f
leaq 0x38c92(%rip), %rdx     # 0x5378c
cmoveq %rax, %rdx
leaq 0x38c82(%rip), %rsi     # 0x53787
leaq 0x38c69(%rip), %rcx     # 0x53775
xorl %eax, %eax
callq 0x42f92
btl $0xb, %ebx
jae 0x1ab47
movq %rsp, %rdi
cmpq $0x0, (%rdi)
leaq 0x38058(%rip), %rax     # 0x52b7f
leaq 0x38c5e(%rip), %rdx     # 0x5378c
cmoveq %rax, %rdx
leaq 0x38c4e(%rip), %rsi     # 0x53787
leaq 0x38c39(%rip), %rcx     # 0x53779
xorl %eax, %eax
callq 0x42f92
cmpq $0x0, (%rsp)
jne 0x1ab85
cmpq $0x1, 0x8(%rsp)
ja 0x1ab78
movq 0x10(%rsp), %rdi
movl $0x2, %esi
callq 0x48d0
testq %rax, %rax
je 0x1ab85
movq %rax, 0x10(%rsp)
movq $0x2, 0x8(%rsp)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
movb $0x0, (%rcx,%rax)
movq 0x10(%rsp), %rax
addq $0x20, %rsp
popq %rbx
retq