// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/tbx.c
// Function: tbx_parse1
int tbx_parse1(const tbx_conf_t *conf, int len, char *line, tbx_intv_t *intv)
{
    int i, b = 0, id = 1, ncols = 0;
    char *s;
    intv->ss = intv->se = 0; intv->beg = intv->end = -1;
    for (i = 0; i <= len; ++i) {
        if (line[i] == '\t' || line[i] == 0) {
            ++ncols;
            if (id == conf->sc) {
                intv->ss = line + b; intv->se = line + i;
            } else if (id == conf->bc) {
                // here ->beg is 0-based.
                intv->beg = intv->end = strtol(line + b, &s, 0);
                if ( s==line+b ) return -1; // expected int
                if (!(conf->preset&TBX_UCSC)) --intv->beg;
                else ++intv->end;
                if (intv->beg < 0) intv->beg = 0;
                if (intv->end < 1) intv->end = 1;
            } else {
                if ((conf->preset&0xffff) == TBX_GENERIC) {
                    if (id == conf->ec)
                    {
                        intv->end = strtol(line + b, &s, 0);
                        if ( s==line+b ) return -1; // expected int
                    }
                } else if ((conf->preset&0xffff) == TBX_SAM) {
                    if (id == 6) { // CIGAR
                        int l = 0, op;
                        char *t;
                        for (s = line + b; s < line + i;) {
                            long x = strtol(s, &t, 10);
                            op = toupper(*t);
                            if (op == 'M' || op == 'D' || op == 'N') l += x;
                            s = t + 1;
                        }
                        if (l == 0) l = 1;
                        intv->end = intv->beg + l;
                    }
                } else if ((conf->preset&0xffff) == TBX_VCF) {
                    if (id == 4) {
                        if (b < i) intv->end = intv->beg + (i - b);
                    } else if (id == 8) { // look for "END="
                        int c = line[i];
                        line[i] = 0;
                        s = strstr(line + b, "END=");
                        if (s == line + b) s += 4;
                        else if (s) {
                            s = strstr(line + b, ";END=");
                            if (s) s += 5;
                        }
                        if (s) intv->end = strtol(s, &s, 0);
                        line[i] = c;
                    }
                }
            }
            b = i + 1;
            ++id;
        }
    }
    if (intv->ss == 0 || intv->se == 0 || intv->beg < 0 || intv->end < 0) return -1;
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl $0x0, -0x30(%rbp)
movl $0x1, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
movq -0x28(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x28(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x28(%rbp), %rax
movq $-0x1, 0x8(%rax)
movq -0x28(%rbp), %rax
movq $-0x1, (%rax)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jg 0x790df
movq -0x20(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x9, %eax
je 0x78d84
movq -0x20(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x790cf
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
movl -0x34(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jne 0x78dc4
movq -0x20(%rbp), %rcx
movslq -0x30(%rbp), %rax
addq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rcx
movslq -0x2c(%rbp), %rax
addq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x790bd
movl -0x34(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x78e7d
movq -0x20(%rbp), %rdi
movslq -0x30(%rbp), %rax
addq %rax, %rdi
leaq -0x40(%rbp), %rsi
xorl %edx, %edx
callq 0x6a50
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq -0x30(%rbp), %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jne 0x78e1c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7911a
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0x10000, %eax          # imm = 0x10000
cmpl $0x0, %eax
jne 0x78e3c
movq -0x28(%rbp), %rax
movq (%rax), %rcx
addq $-0x1, %rcx
movq %rcx, (%rax)
jmp 0x78e4c
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
cmpq $0x0, (%rax)
jge 0x78e61
movq -0x28(%rbp), %rax
movq $0x0, (%rax)
movq -0x28(%rbp), %rax
cmpq $0x1, 0x8(%rax)
jge 0x78e78
movq -0x28(%rbp), %rax
movq $0x1, 0x8(%rax)
jmp 0x790bb
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0xffff, %eax           # imm = 0xFFFF
cmpl $0x0, %eax
jne 0x78ee1
movl -0x34(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jne 0x78edc
movq -0x20(%rbp), %rdi
movslq -0x30(%rbp), %rax
addq %rax, %rdi
leaq -0x40(%rbp), %rsi
xorl %edx, %edx
callq 0x6a50
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x40(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq -0x30(%rbp), %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jne 0x78eda
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7911a
jmp 0x78edc
jmp 0x790b9
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0xffff, %eax           # imm = 0xFFFF
cmpl $0x1, %eax
jne 0x78fa4
cmpl $0x6, -0x34(%rbp)
jne 0x78f9f
movl $0x0, -0x44(%rbp)
movq -0x20(%rbp), %rax
movslq -0x30(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq -0x2c(%rbp), %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jae 0x78f7c
movq -0x40(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0xa, %edx
callq 0x6a50
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
movsbl (%rax), %edi
callq 0x6de0
movl %eax, -0x48(%rbp)
cmpl $0x4d, -0x48(%rbp)
je 0x78f60
cmpl $0x44, -0x48(%rbp)
je 0x78f60
cmpl $0x4e, -0x48(%rbp)
jne 0x78f6e
movq -0x58(%rbp), %rcx
movslq -0x44(%rbp), %rax
addq %rcx, %rax
movl %eax, -0x44(%rbp)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x78f15
cmpl $0x0, -0x44(%rbp)
jne 0x78f89
movl $0x1, -0x44(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rcx
movslq -0x44(%rbp), %rax
addq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x790b7
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0xffff, %eax           # imm = 0xFFFF
cmpl $0x2, %eax
jne 0x790b5
cmpl $0x4, -0x34(%rbp)
jne 0x78fe5
movl -0x30(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x78fe0
movq -0x28(%rbp), %rax
movq (%rax), %rcx
movl -0x2c(%rbp), %eax
subl -0x30(%rbp), %eax
cltq
addq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x790b3
cmpl $0x8, -0x34(%rbp)
jne 0x790b1
movq -0x20(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x5c(%rbp)
movq -0x20(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x20(%rbp), %rdi
movslq -0x30(%rbp), %rax
addq %rax, %rdi
leaq 0x696c4(%rip), %rsi     # 0xe26e0
callq 0x6170
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq -0x30(%rbp), %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jne 0x79047
movq -0x40(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x40(%rbp)
jmp 0x79080
cmpq $0x0, -0x40(%rbp)
je 0x7907e
movq -0x20(%rbp), %rdi
movslq -0x30(%rbp), %rax
addq %rax, %rdi
leaq 0x6967f(%rip), %rsi     # 0xe26df
callq 0x6170
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x7907c
movq -0x40(%rbp), %rax
addq $0x5, %rax
movq %rax, -0x40(%rbp)
jmp 0x7907e
jmp 0x79080
cmpq $0x0, -0x40(%rbp)
je 0x790a1
movq -0x40(%rbp), %rdi
leaq -0x40(%rbp), %rsi
xorl %edx, %edx
callq 0x6a50
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movl -0x5c(%rbp), %eax
movb %al, %dl
movq -0x20(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x790b3
jmp 0x790b5
jmp 0x790b7
jmp 0x790b9
jmp 0x790bb
jmp 0x790bd
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x790d1
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x78d52
movq -0x28(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x7910a
movq -0x28(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x7910a
movq -0x28(%rbp), %rax
cmpq $0x0, (%rax)
jl 0x7910a
movq -0x28(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jge 0x79113
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7911a
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)