// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/hts_expr.c
// Function: simple_expr
static int simple_expr(hts_filter_t *filt, void *data, hts_expr_sym_func *fn,
                       char *str, char **end, hts_expr_val_t *res) {
    // Main recursion step
    str = ws(str);
    if (*str == '(') {
        if (expression(filt, data, fn, str+1, end, res)) return -1;
        str = ws(*end);
        if (*str != ')') {
            fprintf(stderr, "Missing ')'\n");
            return -1;
        }
        *end = str+1;

        return 0;
    }

    // Otherwise a basic element.
    int fail = 0;
    double d = hts_str2dbl(str, end, &fail);
    if (str != *end) {
        res->is_str = 0;
        res->d = d;
    } else {
        // Not valid floating point syntax.
        // TODO: add function call names in here; len(), sqrt(), pow(), etc
        if (*str == '"') {
            res->is_str = 1;
            char *e = str+1;
            int backslash = 0;
            while (*e && *e != '"') {
                if (*e == '\\')
                    backslash=1, e+=1+(e[1]!='\0');
                else
                    e++;
            }

            kputsn(str+1, e-(str+1), ks_clear(&res->s));
            if (backslash) {
                size_t i, j;
                for (i = j = 0; i < res->s.l; i++) {
                    res->s.s[j++] = res->s.s[i];
                    if (res->s.s[i] == '\\') {
                        switch (res->s.s[++i]) {
                        case '"': res->s.s[j-1] = '"'; break;
                        case '\\':res->s.s[j-1] = '\\'; break;
                        case 't': res->s.s[j-1] = '\t'; break;
                        case 'n': res->s.s[j-1] = '\n'; break;
                        case 'r': res->s.s[j-1] = '\r'; break;
                        default:  res->s.s[j++] = res->s.s[i];
                        }
                    }
                }
                res->s.s[j] = 0;
                res->s.l = j;
            }
            if (*e != '"')
                return -1;
            *end = e+1;
        } else if (fn) {
            // Try lookup as variable, if not as function
            if (fn(data, str, end, res) == 0)
                return 0;
            else
                return func_expr(filt, data, fn, str, end, res);
        } else {
            return -1;
        }
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r9, %r15
movq %r8, %r14
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %rbx
movq %rcx, %rdi
callq 0x191b7
movq %rax, %r12
cmpb $0x28, (%rax)
jne 0x1a1af
incq %r12
movq %rbx, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r12, %rcx
movq %r14, %r8
movq %r15, %r9
callq 0x18e94
testl %eax, %eax
je 0x1a289
pushq $-0x1
popq %r14
jmp 0x1a2fe
movq %rbx, 0x8(%rsp)
movq %r14, (%rsp)
callq 0x4510
movq (%rax), %rcx
movq %r12, %rsi
movq %r12, %rdi
movzbl (%rdi), %eax
incq %rdi
incq %rsi
testb $0x20, 0x1(%rcx,%rax,2)
jne 0x1a1c6
leal -0x2b(%rax), %edx
xorl %ecx, %ecx
testb $-0x3, %dl
sete %cl
movzbl -0x1(%rdi,%rcx), %edx
leal -0x31(%rdx), %r8d
cmpl $0x9, %r8d
jae 0x1a2ae
leaq (%rdi,%rcx), %r8
decq %r8
addq %rcx, %rdi
addq %rcx, %rsi
movq %r8, %rdx
movq %rsi, %rcx
incq %r8
incq %rdi
incq %rsi
cmpb $0x30, (%rdx)
je 0x1a201
pushq $0x1
popq %r8
xorl %esi, %esi
cmpl $0xf, %r8d
je 0x1a2dd
movb -0x3(%rdi,%r8), %r10b
leal -0x30(%r10), %r9d
cmpb $0x9, %r9b
ja 0x1a24b
movzbl %r10b, %r9d
imulq $0xa, %rsi, %rsi
addq %r9, %rsi
addq $-0x30, %rsi
incq %r8
incq %rcx
jmp 0x1a21b
leaq -0x1(%r8), %r9
cmpb $0x2e, %r10b
jne 0x1a2a2
addq %r8, %rdi
addq $-0x2, %rdi
cmpl $0xe, %r8d
je 0x1a2dd
movb (%rdi), %r10b
leal -0x30(%r10), %r11d
cmpb $0x9, %r11b
ja 0x1a2c4
movzbl %r10b, %r10d
imulq $0xa, %rsi, %rsi
addq %r10, %rsi
addq $-0x30, %rsi
incq %r8
incq %rdi
incq %rcx
jmp 0x1a25c
movq (%r14), %rdi
callq 0x191b7
cmpb $0x29, (%rax)
jne 0x1a61e
incq %rax
movq %rax, (%r14)
jmp 0x1a2fb
decq %rcx
addq %r8, %rdi
addq $-0x3, %rdi
jmp 0x1a2cb
cmpl $0x30, %edx
jne 0x1a2dd
movzbl (%rdi,%rcx), %edx
orl $0x20, %edx
cmpl $0x78, %edx
je 0x1a2dd
jmp 0x1a1f4
testl %r9d, %r9d
cmovsq %r8, %r9
movzbl %r10b, %r8d
orl $0x20, %r8d
cmpl $0x65, %r8d
jne 0x1a471
movq %r12, %rdi
movq (%rsp), %r14
movq %r14, %rsi
callq 0x4350
cmpq (%r14), %r12
je 0x1a310
movb $0x0, (%r15)
movsd %xmm0, 0x20(%r15)
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpb $0x22, (%r12)
jne 0x1a35f
pushq $0x1
popq %rax
movb $0x1, (%r15)
incq %r12
xorl %r14d, %r14d
pushq $0x2
popq %rcx
pushq $0x1
popq %rdx
movq %r12, %rbp
movzbl (%rbp), %esi
cmpl $0x5c, %esi
je 0x1a34c
testl %esi, %esi
je 0x1a412
cmpl $0x22, %esi
je 0x1a412
movq %rax, %rsi
jmp 0x1a35a
cmpb $0x1, 0x1(%rbp)
movq %rcx, %rsi
sbbq $0x0, %rsi
movl %edx, %r14d
addq %rsi, %rbp
jmp 0x1a32d
testq %r13, %r13
je 0x1a1a6
movq %rbp, %rdi
movq %r12, %rsi
movq (%rsp), %rdx
movq %r15, %rcx
callq *%r13
testl %eax, %eax
pushq $-0x1
popq %r14
je 0x1a2fb
movzbl (%r12), %eax
leal -0x6c(%rax), %ecx
cmpl $0x7, %ecx
ja 0x1a58b
leaq 0x5e8e4(%rip), %rax     # 0x78c80
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x5ea54(%rip), %rsi     # 0x78e00
pushq $0x7
popq %rdx
movq %r12, %rdi
callq 0x4210
testl %eax, %eax
je 0x1a9c0
leaq 0x5ea42(%rip), %rsi     # 0x78e08
pushq $0x4
popq %rdx
movq %r12, %rdi
callq 0x4210
testl %eax, %eax
movq 0x8(%rsp), %rdi
jne 0x1a2fe
addq $0x4, %r12
movq %rbp, %rsi
movq %r13, %rdx
movq %r12, %rcx
movq (%rsp), %r12
movq %r12, %r8
movq %r15, %r9
callq 0x18e94
testl %eax, %eax
jne 0x1a2fe
movsd 0x20(%r15), %xmm0
callq 0x4390
jmp 0x1aab5
andq $0x0, 0x8(%r15)
movq %rbp, %rbx
subq %r12, %rbx
movq %rbx, %rax
addq $0x2, %rax
je 0x1a4c3
cmpq %rax, 0x10(%r15)
jae 0x1a4d0
movq %rax, %rcx
shrq $0x3e, %rcx
movq %rax, %rdx
shrq %rdx
xorl %r13d, %r13d
testq %rcx, %rcx
cmoveq %rdx, %r13
addq %rax, %r13
movq 0x18(%r15), %rdi
movq %r13, %rsi
callq 0x4840
testq %rax, %rax
je 0x1a4f4
movq %rax, 0x18(%r15)
movq %r13, 0x10(%r15)
movq 0x8(%r15), %rdi
jmp 0x1a4d6
movslq %r9d, %r8
addq %rdx, %r8
subq %r8, %rcx
movq %rsi, %xmm1
punpckldq 0x5d2d9(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x5d2e1(%rip), %xmm1    # 0x77770
movq (%rsp), %rdx
movq %rdi, (%rdx)
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
leaq 0x5e7f7(%rip), %rdx     # 0x78ca0
divsd (%rdx,%rcx,8), %xmm0
cmpb $0x2d, %al
jne 0x1a4ba
xorpd 0x5c3a6(%rip), %xmm0    # 0x76860
movq (%rsp), %r14
jmp 0x1a2ec
callq 0x4050
movl $0x4b, (%rax)
jmp 0x1a4f4
movq 0x18(%r15), %rax
xorl %edi, %edi
addq %rax, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x43c0
addq 0x8(%r15), %rbx
movq %rbx, 0x8(%r15)
movq 0x18(%r15), %rax
movb $0x0, (%rax,%rbx)
testl %r14d, %r14d
pushq $-0x1
popq %r14
je 0x1a572
xorl %eax, %eax
xorl %ecx, %ecx
movq 0x18(%r15), %rsi
cmpq 0x8(%r15), %rax
jae 0x1a56a
movb (%rsi,%rax), %dil
leaq 0x1(%rcx), %rdx
movb %dil, (%rsi,%rcx)
movq 0x18(%r15), %rsi
cmpb $0x5c, (%rsi,%rax)
jne 0x1a562
movzbl 0x1(%rsi,%rax), %edi
cmpl $0x22, %edi
je 0x1a55b
cmpl $0x5c, %edi
je 0x1a55b
cmpl $0x6e, %edi
je 0x1a549
cmpl $0x72, %edi
je 0x1a544
cmpl $0x74, %edi
jne 0x1a54e
movb $0x9, %dil
jmp 0x1a55b
movb $0xd, %dil
jmp 0x1a55b
movb $0xa, %dil
jmp 0x1a55b
movq %rcx, %r8
addq $0x2, %r8
movq %rdx, %rcx
movq %r8, %rdx
incq %rax
movb %dil, (%rsi,%rcx)
incq %rax
movq %rdx, %rcx
jmp 0x1a501
movb $0x0, (%rsi,%rcx)
movq %rcx, 0x8(%r15)
cmpb $0x22, (%rbp)
jne 0x1a2fe
incq %rbp
movq (%rsp), %rax
movq %rbp, (%rax)
jmp 0x1a2fb
cmpl $0x65, %eax
je 0x1a8fa
cmpl $0x64, %eax
je 0x1a804
cmpl $0x61, %eax
movq 0x8(%rsp), %rbx
jne 0x1a2fe
leaq 0x5e833(%rip), %rsi     # 0x78de5
pushq $0x4
popq %rdx
movq %r12, %rdi
callq 0x4210
testl %eax, %eax
jne 0x1a2fe
addq $0x4, %r12
movq %rbx, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r12, %rcx
movq (%rsp), %r12
movq %r12, %r8
movq %r15, %r9
callq 0x18e94
testl %eax, %eax
jne 0x1a2fe
cmpb $0x0, (%r15)
je 0x1a2fe
movq 0x8(%r15), %rax
movq 0x18(%r15), %rcx
xorpd %xmm0, %xmm0
xorl %edx, %edx
cmpq %rdx, %rax
je 0x1aa80
movzbl (%rcx,%rdx), %esi
cvtsi2sd %esi, %xmm1
addsd %xmm1, %xmm0
incq %rdx
jmp 0x1a604
movq 0x839b3(%rip), %rax     # 0x9dfd8
movq (%rax), %rcx
leaq 0x5e7a9(%rip), %rdi     # 0x78dd8
pushq $0xc
popq %rsi
pushq $0x1
popq %rdx
callq 0x49b0
jmp 0x1a1a6
leaq 0x5e7c7(%rip), %rsi     # 0x78e0d
pushq $0x4
popq %rdx
movq %r12, %rdi
callq 0x4210
testl %eax, %eax
je 0x1a967
leaq 0x5e7b2(%rip), %rsi     # 0x78e12
pushq $0x4
popq %rdx
movq %r12, %rdi
callq 0x4210
testl %eax, %eax
movq 0x8(%rsp), %rdi
jne 0x1a2fe
addq $0x4, %r12
movq %rbp, %rsi
movq %r13, %rdx
movq %r12, %rcx
movq (%rsp), %r12
movq %r12, %r8
movq %r15, %r9
callq 0x18e94
testl %eax, %eax
jne 0x1a2fe
cmpb $0x0, (%r15)
je 0x1a2fe
movq 0x8(%r15), %rcx
movq 0x18(%r15), %rdx
movl $0x80000000, %eax       # imm = 0x80000000
xorl %esi, %esi
cmpq %rsi, %rcx
je 0x1aad4
movzbl (%rdx,%rsi), %edi
cmpl %edi, %eax
cmovlel %edi, %eax
incq %rsi
jmp 0x1a6b5
leaq 0x5e749(%rip), %rsi     # 0x78e1c
pushq $0x5
popq %rdx
movq %r12, %rdi
callq 0x4210
testl %eax, %eax
jne 0x1a2fe
addq $0x5, %r12
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r12, %rcx
movq (%rsp), %r12
movq %r12, %r8
movq %r15, %r9
callq 0x18e94
testl %eax, %eax
jne 0x1a2fe
movsd 0x20(%r15), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x1aab0
sqrtsd %xmm0, %xmm0
jmp 0x1aab5
leaq 0x5e6e4(%rip), %rsi     # 0x78e17
pushq $0x4
popq %rdx
movq %r12, %rdi
callq 0x4210
testl %eax, %eax
jne 0x1a2fe
addq $0x4, %r12
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r12, %rcx
movq (%rsp), %r12
movq %r12, %r8
movq %r15, %r9
callq 0x18e94
testl %eax, %eax
jne 0x1a2fe
movq (%r12), %rdi
cmpb $0x2c, (%rdi)
jne 0x1a2fe
incq %rdi
movq %rdi, (%r12)
xorpd %xmm0, %xmm0
leaq 0x10(%rsp), %r14
movapd %xmm0, 0x10(%r14)
movapd %xmm0, (%r14)
andq $0x0, 0x20(%r14)
callq 0x191b7
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %rax, %rcx
movq %r12, %r8
movq %r14, %r9
callq 0x18e94
testl %eax, %eax
jne 0x1a1a6
movq %r15, %rdi
callq 0x191cd
testl %eax, %eax
pushq $-0x1
popq %r14
je 0x1ab5e
leaq 0x10(%rsp), %rdi
callq 0x191cd
testl %eax, %eax
je 0x1ab5e
movb 0x10(%rsp), %al
orb (%r15), %al
je 0x1ab27
leaq 0x18(%rsp), %rdi
callq 0x18e75
jmp 0x1a1a6
leaq 0x5e5df(%rip), %rsi     # 0x78dea
pushq $0x8
popq %rdx
movq %r12, %rdi
callq 0x4210
testl %eax, %eax
jne 0x1a2fe
addq $0x8, %r12
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r12, %rcx
movq (%rsp), %r12
movq %r12, %r8
movq %r15, %r9
callq 0x18e94
testl %eax, %eax
jne 0x1a2fe
movq (%r12), %rdi
cmpb $0x2c, (%rdi)
jne 0x1a2fe
incq %rdi
movq %rdi, (%r12)
xorpd %xmm0, %xmm0
leaq 0x10(%rsp), %r14
movapd %xmm0, 0x10(%r14)
movapd %xmm0, (%r14)
andq $0x0, 0x20(%r14)
callq 0x191b7
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %rax, %rcx
movq %r12, %r8
movq %r14, %r9
callq 0x18e94
testl %eax, %eax
jne 0x1a1a6
movq %r15, %rdi
callq 0x195d0
testl %eax, %eax
jne 0x1a8f1
movq 0x18(%r15), %rax
movq %rax, 0x50(%rsp)
movups 0x8(%r15), %xmm0
movaps %xmm0, 0x40(%rsp)
leaq 0x18(%rsp), %rdi
movq 0x18(%rdi), %rax
movq %rax, 0x20(%r15)
movaps -0x8(%rdi), %xmm0
movapd 0x8(%rdi), %xmm1
movupd %xmm1, 0x10(%r15)
movups %xmm0, (%r15)
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rdi)
movapd 0x40(%rsp), %xmm0
movupd %xmm0, (%rdi)
callq 0x18e75
pushq $-0x1
popq %r14
jmp 0x1aaec
leaq 0x5e4f2(%rip), %rsi     # 0x78df3
pushq $0x7
popq %rdx
movq %r12, %rdi
callq 0x4210
testl %eax, %eax
je 0x1aa23
leaq 0x5e4e0(%rip), %rsi     # 0x78dfb
pushq $0x4
popq %rdx
movq %r12, %rdi
callq 0x4210
testl %eax, %eax
movq 0x8(%rsp), %rdi
jne 0x1a2fe
addq $0x4, %r12
movq %rbp, %rsi
movq %r13, %rdx
movq %r12, %rcx
movq (%rsp), %r12
movq %r12, %r8
movq %r15, %r9
callq 0x18e94
testl %eax, %eax
jne 0x1a2fe
movsd 0x20(%r15), %xmm0
callq 0x4900
jmp 0x1aab5
addq $0x4, %r12
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r12, %rcx
movq (%rsp), %r12
movq %r12, %r8
movq %r15, %r9
callq 0x18e94
testl %eax, %eax
jne 0x1a2fe
cmpb $0x0, (%r15)
je 0x1a2fe
movq 0x8(%r15), %rcx
movq 0x18(%r15), %rdx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %esi, %esi
cmpq %rsi, %rcx
je 0x1aa6b
movzbl (%rdx,%rsi), %edi
cmpl %edi, %eax
cmovgel %edi, %eax
incq %rsi
jmp 0x1a9a9
addq $0x7, %r12
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r12, %rcx
movq (%rsp), %r12
movq %r12, %r8
movq %r15, %r9
callq 0x18e94
testl %eax, %eax
jne 0x1a2fe
cmpb $0x0, (%r15)
je 0x1a2fe
movb $0x0, (%r15)
movsd 0x8(%r15), %xmm0
unpcklps 0x5cd5c(%rip), %xmm0    # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x5cd64(%rip), %xmm0    # 0x77770
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movsd %xmm1, 0x20(%r15)
jmp 0x1aaec
addq $0x7, %r12
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r12, %rcx
movq (%rsp), %r12
movq %r12, %r8
movq %r15, %r9
callq 0x18e94
testl %eax, %eax
jne 0x1a2fe
movq %r15, %rdi
callq 0x195d0
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x20(%r15)
movb %al, 0x1(%r15)
movb $0x0, (%r15)
jmp 0x1aaec
movb $0x0, (%r15)
cmpl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
je 0x1aade
cvtsi2ss %eax, %xmm0
cvtss2sd %xmm0, %xmm0
jmp 0x1aae6
testq %rax, %rax
je 0x1aaaa
movq %rax, %xmm1
punpckldq 0x5ccce(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x5ccd6(%rip), %xmm1    # 0x77770
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movb $0x0, (%r15)
jmp 0x1aae6
callq 0x4370
movsd %xmm0, 0x20(%r15)
movb $0x0, (%r15)
ucomisd %xmm0, %xmm0
jnp 0x1aaec
andq $0x0, 0x8(%r15)
movb $0x0, 0x1(%r15)
jmp 0x1ab68
movb $0x0, (%r15)
movl %eax, %ecx
negl %ecx
jno 0x1aa76
movsd 0x5e18a(%rip), %xmm0    # 0x78c70
movsd %xmm0, 0x20(%r15)
movq (%r12), %rdi
callq 0x191b7
cmpb $0x29, (%rax)
jne 0x1ab06
incq %rax
movq %rax, (%r12)
jmp 0x1a2fb
movq 0x834cb(%rip), %rax     # 0x9dfd8
movq (%rax), %rcx
leaq 0x5e2c1(%rip), %rdi     # 0x78dd8
pushq $0xc
popq %rsi
pushq $0x1
popq %rdx
callq 0x49b0
jmp 0x1a2fe
movsd 0x20(%r15), %xmm0
leaq 0x18(%rsp), %rbx
movsd 0x18(%rbx), %xmm1
callq 0x48e0
movsd %xmm0, 0x20(%r15)
movq %rbx, %rdi
callq 0x18e75
movb $0x0, (%r15)
movsd 0x20(%r15), %xmm0
ucomisd %xmm0, %xmm0
movq (%rsp), %r12
jnp 0x1aaec
andq $0x0, 0x8(%r15)
andw $0x0, (%r15)
movabsq $0x7ff8000000000000, %rax # imm = 0x7FF8000000000000
movq %rax, 0x20(%r15)
jmp 0x1aaec
nop