// File: 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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x42d0
movl -0x4(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x210f9
movq -0x20(%rbp), %rcx
leaq 0x5b3fb(%rip), %rdx     # 0x7c4cc
leaq 0x5a78a(%rip), %rax     # 0x7b862
cmpq $0x0, %rcx
cmovneq %rax, %rdx
leaq -0x20(%rbp), %rdi
leaq 0x5a772(%rip), %rsi     # 0x7b85d
leaq 0x5a719(%rip), %rcx     # 0x7b80b
movb $0x0, %al
callq 0x620e0
movl -0x4(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x21137
movq -0x20(%rbp), %rcx
leaq 0x5b3bd(%rip), %rdx     # 0x7c4cc
leaq 0x5a74c(%rip), %rax     # 0x7b862
cmpq $0x0, %rcx
cmovneq %rax, %rdx
leaq -0x20(%rbp), %rdi
leaq 0x5a734(%rip), %rsi     # 0x7b85d
leaq 0x5a6e2(%rip), %rcx     # 0x7b812
movb $0x0, %al
callq 0x620e0
movl -0x4(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x21175
movq -0x20(%rbp), %rcx
leaq 0x5b37f(%rip), %rdx     # 0x7c4cc
leaq 0x5a70e(%rip), %rax     # 0x7b862
cmpq $0x0, %rcx
cmovneq %rax, %rdx
leaq -0x20(%rbp), %rdi
leaq 0x5a6f6(%rip), %rsi     # 0x7b85d
leaq 0x5a6b1(%rip), %rcx     # 0x7b81f
movb $0x0, %al
callq 0x620e0
movl -0x4(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x211b3
movq -0x20(%rbp), %rcx
leaq 0x5b341(%rip), %rdx     # 0x7c4cc
leaq 0x5a6d0(%rip), %rax     # 0x7b862
cmpq $0x0, %rcx
cmovneq %rax, %rdx
leaq -0x20(%rbp), %rdi
leaq 0x5a6b8(%rip), %rsi     # 0x7b85d
leaq 0x5a672(%rip), %rcx     # 0x7b81e
movb $0x0, %al
callq 0x620e0
movl -0x4(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x211f1
movq -0x20(%rbp), %rcx
leaq 0x5b303(%rip), %rdx     # 0x7c4cc
leaq 0x5a692(%rip), %rax     # 0x7b862
cmpq $0x0, %rcx
cmovneq %rax, %rdx
leaq -0x20(%rbp), %rdi
leaq 0x5a67a(%rip), %rsi     # 0x7b85d
leaq 0x5a63c(%rip), %rcx     # 0x7b826
movb $0x0, %al
callq 0x620e0
movl -0x4(%rbp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x2122f
movq -0x20(%rbp), %rcx
leaq 0x5b2c5(%rip), %rdx     # 0x7c4cc
leaq 0x5a654(%rip), %rax     # 0x7b862
cmpq $0x0, %rcx
cmovneq %rax, %rdx
leaq -0x20(%rbp), %rdi
leaq 0x5a63c(%rip), %rsi     # 0x7b85d
leaq 0x5a5fd(%rip), %rcx     # 0x7b825
movb $0x0, %al
callq 0x620e0
movl -0x4(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x2126d
movq -0x20(%rbp), %rcx
leaq 0x5b287(%rip), %rdx     # 0x7c4cc
leaq 0x5a616(%rip), %rax     # 0x7b862
cmpq $0x0, %rcx
cmovneq %rax, %rdx
leaq -0x20(%rbp), %rdi
leaq 0x5a5fe(%rip), %rsi     # 0x7b85d
leaq 0x5a5c8(%rip), %rcx     # 0x7b82e
movb $0x0, %al
callq 0x620e0
movl -0x4(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x212ad
movq -0x20(%rbp), %rcx
leaq 0x5b247(%rip), %rdx     # 0x7c4cc
leaq 0x5a5d6(%rip), %rax     # 0x7b862
cmpq $0x0, %rcx
cmovneq %rax, %rdx
leaq -0x20(%rbp), %rdi
leaq 0x5a5be(%rip), %rsi     # 0x7b85d
leaq 0x5a58e(%rip), %rcx     # 0x7b834
movb $0x0, %al
callq 0x620e0
movl -0x4(%rbp), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x212ed
movq -0x20(%rbp), %rcx
leaq 0x5b207(%rip), %rdx     # 0x7c4cc
leaq 0x5a596(%rip), %rax     # 0x7b862
cmpq $0x0, %rcx
cmovneq %rax, %rdx
leaq -0x20(%rbp), %rdi
leaq 0x5a57e(%rip), %rsi     # 0x7b85d
leaq 0x5a554(%rip), %rcx     # 0x7b83a
movb $0x0, %al
callq 0x620e0
movl -0x4(%rbp), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
je 0x2132d
movq -0x20(%rbp), %rcx
leaq 0x5b1c7(%rip), %rdx     # 0x7c4cc
leaq 0x5a556(%rip), %rax     # 0x7b862
cmpq $0x0, %rcx
cmovneq %rax, %rdx
leaq -0x20(%rbp), %rdi
leaq 0x5a53e(%rip), %rsi     # 0x7b85d
leaq 0x5a51e(%rip), %rcx     # 0x7b844
movb $0x0, %al
callq 0x620e0
movl -0x4(%rbp), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x2136d
movq -0x20(%rbp), %rcx
leaq 0x5b187(%rip), %rdx     # 0x7c4cc
leaq 0x5a516(%rip), %rax     # 0x7b862
cmpq $0x0, %rcx
cmovneq %rax, %rdx
leaq -0x20(%rbp), %rdi
leaq 0x5a4fe(%rip), %rsi     # 0x7b85d
leaq 0x5a4e5(%rip), %rcx     # 0x7b84b
movb $0x0, %al
callq 0x620e0
movl -0x4(%rbp), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x213ad
movq -0x20(%rbp), %rcx
leaq 0x5b147(%rip), %rdx     # 0x7c4cc
leaq 0x5a4d6(%rip), %rax     # 0x7b862
cmpq $0x0, %rcx
cmovneq %rax, %rdx
leaq -0x20(%rbp), %rdi
leaq 0x5a4be(%rip), %rsi     # 0x7b85d
leaq 0x5a4a9(%rip), %rcx     # 0x7b84f
movb $0x0, %al
callq 0x620e0
cmpq $0x0, -0x20(%rbp)
jne 0x213c6
leaq 0x5b111(%rip), %rdi     # 0x7c4cc
xorl %esi, %esi
leaq -0x20(%rbp), %rdx
callq 0x1d230
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq