// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/sam.c
// Function: bam_str2flag
int bam_str2flag(const char *str)
{
    char *end, *beg = (char*) str;
    long int flag = strtol(str, &end, 0);
    if ( end!=str ) return flag;    // the conversion was successful
    flag = 0;
    while ( *str )
    {
        end = beg;
        while ( *end && *end!=',' ) end++;
        if ( !STRNCMP("PAIRED",beg,end-beg) ) flag |= BAM_FPAIRED;
        else if ( !STRNCMP("PROPER_PAIR",beg,end-beg) ) flag |= BAM_FPROPER_PAIR;
        else if ( !STRNCMP("UNMAP",beg,end-beg) ) flag |= BAM_FUNMAP;
        else if ( !STRNCMP("MUNMAP",beg,end-beg) ) flag |= BAM_FMUNMAP;
        else if ( !STRNCMP("REVERSE",beg,end-beg) ) flag |= BAM_FREVERSE;
        else if ( !STRNCMP("MREVERSE",beg,end-beg) ) flag |= BAM_FMREVERSE;
        else if ( !STRNCMP("READ1",beg,end-beg) ) flag |= BAM_FREAD1;
        else if ( !STRNCMP("READ2",beg,end-beg) ) flag |= BAM_FREAD2;
        else if ( !STRNCMP("SECONDARY",beg,end-beg) ) flag |= BAM_FSECONDARY;
        else if ( !STRNCMP("QCFAIL",beg,end-beg) ) flag |= BAM_FQCFAIL;
        else if ( !STRNCMP("DUP",beg,end-beg) ) flag |= BAM_FDUP;
        else if ( !STRNCMP("SUPPLEMENTARY",beg,end-beg) ) flag |= BAM_FSUPPLEMENTARY;
        else return -1;
        if ( !*end ) break;
        beg = end + 1;
    }
    return flag;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
xorl %edx, %edx
callq 0x46a0
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x10(%rbp), %rax
je 0x426ad
movq -0x28(%rbp), %rax
movl %eax, -0x4(%rbp)
jmp 0x42a90
movq $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x42a89
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x29(%rbp)
je 0x426eb
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2c, %eax
setne %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
testb $0x1, %al
jne 0x426f4
jmp 0x42702
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x426ca
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rax
subq %rax, %rdx
leaq 0xafc7f(%rip), %rdi     # 0xf2397
callq 0x4620
cmpl $0x0, %eax
jne 0x42748
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
subq %rax, %rcx
movl $0x6, %eax
cmpq %rcx, %rax
jne 0x42748
movq -0x28(%rbp), %rax
orq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x42a6d
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rax
subq %rax, %rdx
leaq 0xafc40(%rip), %rdi     # 0xf239e
callq 0x4620
cmpl $0x0, %eax
jne 0x4278e
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
subq %rax, %rcx
movl $0xb, %eax
cmpq %rcx, %rax
jne 0x4278e
movq -0x28(%rbp), %rax
orq $0x2, %rax
movq %rax, -0x28(%rbp)
jmp 0x42a6b
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rax
subq %rax, %rdx
leaq 0xafc07(%rip), %rdi     # 0xf23ab
callq 0x4620
cmpl $0x0, %eax
jne 0x427d4
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
subq %rax, %rcx
movl $0x5, %eax
cmpq %rcx, %rax
jne 0x427d4
movq -0x28(%rbp), %rax
orq $0x4, %rax
movq %rax, -0x28(%rbp)
jmp 0x42a69
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rax
subq %rax, %rdx
leaq 0xafbc0(%rip), %rdi     # 0xf23aa
callq 0x4620
cmpl $0x0, %eax
jne 0x4281a
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
subq %rax, %rcx
movl $0x6, %eax
cmpq %rcx, %rax
jne 0x4281a
movq -0x28(%rbp), %rax
orq $0x8, %rax
movq %rax, -0x28(%rbp)
jmp 0x42a67
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rax
subq %rax, %rdx
leaq 0xafb82(%rip), %rdi     # 0xf23b2
callq 0x4620
cmpl $0x0, %eax
jne 0x42860
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
subq %rax, %rcx
movl $0x7, %eax
cmpq %rcx, %rax
jne 0x42860
movq -0x28(%rbp), %rax
orq $0x10, %rax
movq %rax, -0x28(%rbp)
jmp 0x42a65
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rax
subq %rax, %rdx
leaq 0xafb3b(%rip), %rdi     # 0xf23b1
callq 0x4620
cmpl $0x0, %eax
jne 0x428a6
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
subq %rax, %rcx
movl $0x8, %eax
cmpq %rcx, %rax
jne 0x428a6
movq -0x28(%rbp), %rax
orq $0x20, %rax
movq %rax, -0x28(%rbp)
jmp 0x42a63
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rax
subq %rax, %rdx
leaq 0xafafe(%rip), %rdi     # 0xf23ba
callq 0x4620
cmpl $0x0, %eax
jne 0x428ec
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
subq %rax, %rcx
movl $0x5, %eax
cmpq %rcx, %rax
jne 0x428ec
movq -0x28(%rbp), %rax
orq $0x40, %rax
movq %rax, -0x28(%rbp)
jmp 0x42a61
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rax
subq %rax, %rdx
leaq 0xafabe(%rip), %rdi     # 0xf23c0
callq 0x4620
cmpl $0x0, %eax
jne 0x42934
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
subq %rax, %rcx
movl $0x5, %eax
cmpq %rcx, %rax
jne 0x42934
movq -0x28(%rbp), %rax
orq $0x80, %rax
movq %rax, -0x28(%rbp)
jmp 0x42a5f
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rax
subq %rax, %rdx
leaq 0xafa7c(%rip), %rdi     # 0xf23c6
callq 0x4620
cmpl $0x0, %eax
jne 0x4297c
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
subq %rax, %rcx
movl $0x9, %eax
cmpq %rcx, %rax
jne 0x4297c
movq -0x28(%rbp), %rax
orq $0x100, %rax            # imm = 0x100
movq %rax, -0x28(%rbp)
jmp 0x42a5d
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rax
subq %rax, %rdx
leaq 0xafa3e(%rip), %rdi     # 0xf23d0
callq 0x4620
cmpl $0x0, %eax
jne 0x429c4
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
subq %rax, %rcx
movl $0x6, %eax
cmpq %rcx, %rax
jne 0x429c4
movq -0x28(%rbp), %rax
orq $0x200, %rax            # imm = 0x200
movq %rax, -0x28(%rbp)
jmp 0x42a5b
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rax
subq %rax, %rdx
leaq 0xaf9fd(%rip), %rdi     # 0xf23d7
callq 0x4620
cmpl $0x0, %eax
jne 0x42a09
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
subq %rax, %rcx
movl $0x3, %eax
cmpq %rcx, %rax
jne 0x42a09
movq -0x28(%rbp), %rax
orq $0x400, %rax            # imm = 0x400
movq %rax, -0x28(%rbp)
jmp 0x42a59
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rax
subq %rax, %rdx
leaq 0xaf9bc(%rip), %rdi     # 0xf23db
callq 0x4620
cmpl $0x0, %eax
jne 0x42a4e
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
subq %rax, %rcx
movl $0xd, %eax
cmpq %rcx, %rax
jne 0x42a4e
movq -0x28(%rbp), %rax
orq $0x800, %rax            # imm = 0x800
movq %rax, -0x28(%rbp)
jmp 0x42a57
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x42a90
jmp 0x42a59
jmp 0x42a5b
jmp 0x42a5d
jmp 0x42a5f
jmp 0x42a61
jmp 0x42a63
jmp 0x42a65
jmp 0x42a67
jmp 0x42a69
jmp 0x42a6b
jmp 0x42a6d
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x42a78
jmp 0x42a89
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x426b5
movq -0x28(%rbp), %rax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)