// File: /workspace/github_c_makefile_star2_O3/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 $0x68, %rsp
movq %r8, %r14
movq %rcx, %r13
movq %rcx, %r15
negq %r15
xorl %r12d, %r12d
movq %r15, %rbp
movzbl (%r13,%r12), %eax
cmpl $0x9, %eax
je 0x1e533
cmpl $0x20, %eax
jne 0x1e53b
incq %r12
decq %rbp
jmp 0x1e523
cmpl $0x28, %eax
jne 0x1e581
leaq (%r12,%r13), %rcx
incq %rcx
movq %r14, %r8
callq 0x1ccf4
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x1e6f5
movq (%r14), %rax
incq %rax
movzbl -0x1(%rax), %ecx
cmpl $0x9, %ecx
je 0x1e55f
cmpl $0x20, %ecx
je 0x1e55f
cmpl $0x29, %ecx
jne 0x1ea77
movq %rax, (%r14)
jmp 0x1e6f3
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq %rdx, 0x18(%rsp)
movq %r9, (%rsp)
callq 0x4510
movq (%rax), %rsi
leaq (%r12,%r13), %rbx
leaq (%r12,%r13), %rdx
addq $-0x2, %rdx
movq %rdx, %rcx
movzbl 0x2(%rcx), %eax
incq %rcx
incq %rdx
testb $0x20, 0x1(%rsi,%rax,2)
jne 0x1e5ab
leal -0x2b(%rax), %edi
xorl %esi, %esi
testb $-0x3, %dil
sete %sil
movzbl 0x1(%rcx,%rsi), %edi
leal -0x31(%rdi), %r8d
cmpl $0x9, %r8d
jae 0x1e69e
addq %rsi, %rdx
addq %rsi, %rcx
movb 0x1(%rcx), %r9b
incq %rcx
incq %rdx
cmpb $0x30, %r9b
je 0x1e5e2
leal -0x30(%r9), %esi
cmpb $0x9, %sil
ja 0x1e651
xorl %edi, %edi
movq %rdx, %r8
xorl %esi, %esi
cmpl $0xd, %edi
je 0x1e6d7
leaq (%rsi,%rsi,4), %rsi
movzbl %r9b, %r9d
leaq (%r9,%rsi,2), %rsi
addq $-0x30, %rsi
movb 0x1(%rcx), %r9b
incq %rcx
leal -0x30(%r9), %r10d
incq %r8
incq %rdi
cmpb $0x9, %r10b
jbe 0x1e603
cmpb $0x2e, %r9b
jne 0x1e6c5
cmpl $0xd, %edi
je 0x1e6d7
movl $0xd, %r10d
subq %rdi, %r10
jmp 0x1e667
movl $0xd, %r10d
xorl %esi, %esi
movl $0x0, %edi
movq %rdx, %r8
cmpb $0x2e, %r9b
jne 0x1e6c5
leaq 0x1(%rcx), %r9
notq %rcx
movq %rcx, %r8
movq %r9, %rcx
movb (%rcx), %r9b
leal -0x30(%r9), %r11d
cmpb $0x9, %r11b
ja 0x1e6b5
movzbl %r9b, %r9d
leaq (%rsi,%rsi,4), %rsi
leaq (%r9,%rsi,2), %rsi
addq $-0x30, %rsi
incq %rcx
decq %r8
decl %r10d
jne 0x1e674
jmp 0x1e6d7
cmpl $0x30, %edi
jne 0x1e6d7
movzbl 0x2(%rcx,%rsi), %edi
orl $0x20, %edi
cmpl $0x78, %edi
je 0x1e6d7
jmp 0x1e5dc
leaq (%rdx,%r8), %r10
negq %r8
negq %r10
testl %edi, %edi
cmovsq %r10, %rdi
movzbl %r9b, %r9d
orl $0x20, %r9d
cmpl $0x65, %r9d
jne 0x1e840
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4350
movq (%rsp), %rcx
cmpq (%r14), %rbx
je 0x1e706
movb $0x0, (%rcx)
movsd %xmm0, 0x20(%rcx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpb $0x22, (%rbx)
jne 0x1e757
movq %r14, 0x18(%rsp)
movb $0x1, (%rcx)
leaq (%r12,%r13), %rsi
incq %rsi
xorl %r14d, %r14d
movq %rsi, %rbx
movzbl (%rbx), %edx
cmpl $0x5c, %edx
je 0x1e73f
testl %edx, %edx
je 0x1e818
movl $0x1, %eax
cmpl $0x22, %edx
jne 0x1e752
jmp 0x1e818
cmpb $0x1, 0x1(%rbx)
movl $0x2, %eax
sbbq $0x0, %rax
movl $0x1, %r14d
addq %rax, %rbx
jmp 0x1e720
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x1e6f5
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *%rax
testl %eax, %eax
je 0x1e6f3
movzbl (%rbx), %eax
cmpl $0x6b, %eax
jle 0x1e9e7
addl $-0x6c, %eax
cmpl $0x7, %eax
ja 0x1e6f5
leaq 0x784f6(%rip), %rcx     # 0x96c90
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x78666(%rip), %rsi     # 0x96e10
movl $0x7, %edx
movq %rbx, %rdi
callq 0x4210
testl %eax, %eax
je 0x1ecd1
leaq 0x78652(%rip), %rsi     # 0x96e18
movl $0x4, %edx
movq %rbx, %rdi
callq 0x4210
testl %eax, %eax
jne 0x1e6f5
leaq (%r12,%r13), %rcx
addq $0x4, %rcx
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r14, %r8
movq (%rsp), %rbx
movq %rbx, %r9
callq 0x1ccf4
testl %eax, %eax
jne 0x1e6f5
movsd 0x20(%rbx), %xmm0
callq 0x4390
jmp 0x1ee1d
movq $0x0, 0x8(%rcx)
leaq (%rbx,%r15), %rax
incq %rax
cmpq %r12, %rax
jne 0x1e88f
callq 0x4050
movq (%rsp), %r10
movl $0x4b, (%rax)
jmp 0x1e92f
movslq %edi, %rdi
addq %rdx, %rdi
subq %rdi, %r8
movq %rsi, %xmm1
punpckldq 0x76f5a(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x76f62(%rip), %xmm1    # 0x957c0
movq %rcx, (%r14)
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
leaq 0x7843c(%rip), %rcx     # 0x96cb0
divsd (%rcx,%r8,8), %xmm0
cmpb $0x2d, %al
jne 0x1e6e2
xorpd 0x75fd6(%rip), %xmm0    # 0x94860
jmp 0x1e6e2
addq %rbx, %r15
movq %r15, %rdx
subq %r12, %rdx
leaq 0x1(%rdx), %rax
cmpq %rax, 0x10(%rcx)
jae 0x1e8f8
movq %rdx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq %rax, %rsi
shrq $0x3e, %rsi
shrq %rax
xorl %edx, %edx
testq %rsi, %rsi
cmoveq %rax, %rdx
addq %rdx, %r15
subq %r12, %r15
incq %r15
movq 0x18(%rcx), %rdi
movq %r15, %rsi
callq 0x4840
movq (%rsp), %r10
testq %rax, %rax
je 0x1e92f
movq %rax, 0x18(%r10)
movq %r15, 0x10(%r10)
movq 0x8(%r10), %rdi
movq %r10, %r15
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
jmp 0x1e901
movq 0x18(%rcx), %rax
xorl %edi, %edi
movq %rcx, %r15
addq %rax, %rdi
decq %rdx
callq 0x43c0
movq 0x8(%r15), %rax
addq %rbx, %rax
movq %rax, %rcx
subq %r13, %rcx
notq %r12
addq %rcx, %r12
movq %r12, 0x8(%r15)
addq 0x18(%r15), %rax
movb $0x0, -0x1(%rbp,%rax)
movq %r15, %r10
testl %r14d, %r14d
movq 0x18(%rsp), %r9
je 0x1e9ce
cmpq $0x0, 0x8(%r10)
je 0x1e9c0
xorl %edx, %edx
xorl %eax, %eax
movq 0x18(%r10), %rsi
movb (%rsi,%rax), %dil
leaq 0x1(%rdx), %rcx
movb %dil, (%rsi,%rdx)
movq 0x18(%r10), %rsi
cmpb $0x5c, (%rsi,%rax)
jne 0x1e9b2
movb 0x1(%rsi,%rax), %dil
movzbl %dil, %r8d
cmpl $0x6d, %r8d
jle 0x1e988
cmpl $0x6e, %r8d
je 0x1e9a3
cmpl $0x72, %r8d
je 0x1e9a8
cmpl $0x74, %r8d
jne 0x1e994
movb $0x9, %dil
jmp 0x1e9ab
cmpl $0x22, %r8d
je 0x1e9ab
cmpl $0x5c, %r8d
je 0x1e9ab
movq %rdx, %r8
addq $0x2, %r8
movq %rcx, %rdx
movq %r8, %rcx
jmp 0x1e9ab
movb $0xa, %dil
jmp 0x1e9ab
movb $0xd, %dil
incq %rax
movb %dil, (%rsi,%rdx)
incq %rax
movq %rcx, %rdx
cmpq 0x8(%r10), %rax
jb 0x1e948
jmp 0x1e9c2
xorl %ecx, %ecx
movq 0x18(%r10), %rax
movb $0x0, (%rax,%rcx)
movq %rcx, 0x8(%r10)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpb $0x22, (%rbx)
jne 0x1e6f5
incq %rbx
movq %rbx, (%r9)
jmp 0x1e6f3
cmpl $0x61, %eax
je 0x1ebea
cmpl $0x64, %eax
je 0x1ec41
cmpl $0x65, %eax
jne 0x1e6f5
leaq 0x783fa(%rip), %rsi     # 0x96e03
movl $0x7, %edx
movq %rbx, %rdi
callq 0x4210
testl %eax, %eax
je 0x1ed78
leaq 0x783e6(%rip), %rsi     # 0x96e0b
movl $0x4, %edx
movq %rbx, %rdi
callq 0x4210
testl %eax, %eax
jne 0x1e6f5
leaq (%r12,%r13), %rcx
addq $0x4, %rcx
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r14, %r8
movq (%rsp), %rbx
movq %rbx, %r9
callq 0x1ccf4
testl %eax, %eax
jne 0x1e6f5
movsd 0x20(%rbx), %xmm0
callq 0x4900
jmp 0x1ee1d
callq 0x4a04
jmp 0x1e6f5
leaq 0x7839f(%rip), %rsi     # 0x96e27
movl $0x4, %edx
movq %rbx, %rdi
callq 0x4210
testl %eax, %eax
jne 0x1e6f5
leaq (%r12,%r13), %rcx
addq $0x4, %rcx
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x18(%rsp), %rbx
movq %rbx, %rdx
movq %r14, %r8
movq (%rsp), %r9
callq 0x1ccf4
testl %eax, %eax
jne 0x1e6f5
movq (%r14), %rcx
cmpb $0x2c, (%rcx)
jne 0x1e6f5
incq %rcx
movq %rcx, (%r14)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
movapd %xmm0, 0x20(%rsp)
movq $0x0, 0x40(%rsp)
movq 0x10(%rsp), %rdi
movzbl (%rcx), %eax
cmpl $0x20, %eax
je 0x1eb0c
cmpl $0x9, %eax
jne 0x1edc2
incq %rcx
jmp 0x1eafb
leaq 0x78314(%rip), %rsi     # 0x96e2c
movl $0x5, %edx
movq %rbx, %rdi
callq 0x4210
testl %eax, %eax
jne 0x1e6f5
leaq (%r12,%r13), %rcx
addq $0x5, %rcx
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r14, %r8
movq (%rsp), %rbx
movq %rbx, %r9
callq 0x1ccf4
testl %eax, %eax
jne 0x1e6f5
movsd 0x20(%rbx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x1ee14
sqrtsd %xmm0, %xmm0
jmp 0x1ee1d
leaq 0x7829f(%rip), %rsi     # 0x96e1d
movl $0x4, %edx
movq %rbx, %rdi
callq 0x4210
testl %eax, %eax
je 0x1ed35
leaq 0x78288(%rip), %rsi     # 0x96e22
movl $0x4, %edx
movq %rbx, %rdi
callq 0x4210
testl %eax, %eax
jne 0x1e6f5
leaq (%r12,%r13), %rcx
addq $0x4, %rcx
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r14, %r8
movq (%rsp), %rbx
movq %rbx, %r9
callq 0x1ccf4
testl %eax, %eax
jne 0x1e6f5
movq %rbx, %rdi
callq 0x1f062
jmp 0x1ed6b
leaq 0x78204(%rip), %rsi     # 0x96df5
movl $0x4, %edx
movq %rbx, %rdi
callq 0x4210
testl %eax, %eax
jne 0x1e6f5
leaq (%r12,%r13), %rcx
addq $0x4, %rcx
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r14, %r8
movq (%rsp), %rbx
movq %rbx, %r9
callq 0x1ccf4
testl %eax, %eax
jne 0x1e6f5
movq %rbx, %rdi
callq 0x1efa2
jmp 0x1ed6b
leaq 0x781b2(%rip), %rsi     # 0x96dfa
movl $0x8, %edx
movq %rbx, %rdi
callq 0x4210
testl %eax, %eax
jne 0x1e6f5
leaq (%r12,%r13), %rcx
addq $0x8, %rcx
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x18(%rsp), %rbx
movq %rbx, %rdx
movq %r14, %r8
movq (%rsp), %r9
callq 0x1ccf4
testl %eax, %eax
jne 0x1e6f5
movq (%r14), %rcx
cmpb $0x2c, (%rcx)
jne 0x1e6f5
incq %rcx
movq %rcx, (%r14)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
movapd %xmm0, 0x20(%rsp)
movq $0x0, 0x40(%rsp)
movq 0x10(%rsp), %rdi
movzbl (%rcx), %eax
cmpl $0x20, %eax
je 0x1eccc
cmpl $0x9, %eax
jne 0x1ee56
incq %rcx
jmp 0x1ecbb
leaq (%r12,%r13), %rcx
addq $0x7, %rcx
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r14, %r8
movq (%rsp), %rbx
movq %rbx, %r9
callq 0x1ccf4
testl %eax, %eax
jne 0x1e6f5
cmpb $0x0, (%rbx)
je 0x1e6f5
movb $0x0, (%rbx)
movsd 0x8(%rbx), %xmm0
unpcklps 0x76a99(%rip), %xmm0    # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x76aa1(%rip), %xmm0    # 0x957c0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movsd %xmm1, 0x20(%rbx)
jmp 0x1ee2f
leaq (%r12,%r13), %rcx
addq $0x4, %rcx
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r14, %r8
movq (%rsp), %rbx
movq %rbx, %r9
callq 0x1ccf4
testl %eax, %eax
jne 0x1e6f5
movq %rbx, %rdi
callq 0x1f00d
testl %eax, %eax
jns 0x1ee2f
jmp 0x1e6f5
leaq (%r12,%r13), %rcx
addq $0x7, %rcx
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r14, %r8
movq (%rsp), %rbx
movq %rbx, %r9
callq 0x1ccf4
testl %eax, %eax
jne 0x1e6f5
movq %rbx, %rdi
callq 0x1d53f
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x20(%rbx)
movb %al, 0x1(%rbx)
movb $0x0, (%rbx)
jmp 0x1ee2f
leaq 0x20(%rsp), %r9
movq 0x8(%rsp), %rsi
movq %rbx, %rdx
movq %r14, %r8
callq 0x1ccf4
testl %eax, %eax
jne 0x1e6f5
movq (%rsp), %rdx
testq %rdx, %rdx
je 0x1ef63
movzbl (%rdx), %eax
cmpl $0x1, %eax
je 0x1eed1
testl %eax, %eax
jne 0x1eedc
movsd 0x20(%rdx), %xmm0
ucomisd %xmm0, %xmm0
jnp 0x1eedc
jmp 0x1ef63
callq 0x4370
movq (%rsp), %rbx
movsd %xmm0, 0x20(%rbx)
movb $0x0, (%rbx)
ucomisd %xmm0, %xmm0
jp 0x1ef83
movq (%r14), %rax
incq %rax
movzbl -0x1(%rax), %ecx
cmpl $0x9, %ecx
je 0x1ee32
cmpl $0x20, %ecx
je 0x1ee32
cmpl $0x29, %ecx
je 0x1e579
callq 0x4a20
jmp 0x1e6f5
leaq 0x20(%rsp), %r9
movq 0x8(%rsp), %rsi
movq %rbx, %rdx
movq %r14, %r8
callq 0x1ccf4
testl %eax, %eax
jne 0x1e6f5
movq (%rsp), %rbx
movq %rbx, %rdi
callq 0x1d53f
testl %eax, %eax
jne 0x1ee2f
movq 0x18(%rbx), %rax
movq %rax, 0x60(%rsp)
movups 0x8(%rbx), %xmm0
movaps %xmm0, 0x50(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x20(%rbx)
movaps 0x20(%rsp), %xmm0
movapd 0x30(%rsp), %xmm1
movupd %xmm1, 0x10(%rbx)
movups %xmm0, (%rbx)
movq 0x60(%rsp), %rdi
movq %rdi, 0x38(%rsp)
movapd 0x50(%rsp), %xmm0
movupd %xmm0, 0x28(%rsp)
callq 0x45c0
jmp 0x1ee2f
cmpq $0x0, 0x18(%rdx)
je 0x1ef63
movq %r14, %rbx
movzbl 0x20(%rsp), %ecx
cmpl $0x1, %ecx
je 0x1ef02
testl %ecx, %ecx
jne 0x1ef15
movsd 0x40(%rsp), %xmm0
ucomisd %xmm0, %xmm0
movq %rbx, %r14
movq (%rsp), %rdx
jnp 0x1ef11
jmp 0x1ef63
cmpq $0x0, 0x38(%rsp)
movq %rbx, %r14
movq (%rsp), %rdx
je 0x1ef63
orb %al, %cl
je 0x1ef24
movq 0x38(%rsp), %rdi
callq 0x45c0
jmp 0x1e6f5
movq (%rsp), %r14
movsd 0x20(%r14), %xmm0
movsd 0x40(%rsp), %xmm1
callq 0x48e0
movsd %xmm0, 0x20(%r14)
movq 0x38(%rsp), %rdi
callq 0x45c0
movq %r14, %rdx
movb $0x0, (%r14)
movsd 0x20(%r14), %xmm0
ucomisd %xmm0, %xmm0
movq %rbx, %r14
jnp 0x1ee2f
movq $0x0, 0x8(%rdx)
movw $0x0, (%rdx)
movabsq $0x7ff8000000000000, %rax # imm = 0x7FF8000000000000
movq %rax, 0x20(%rdx)
jmp 0x1ee2f
movq $0x0, 0x8(%rbx)
movb $0x0, 0x1(%rbx)
movabsq $0x7ff8000000000000, %rax # imm = 0x7FF8000000000000
movq %rax, 0x20(%rbx)
jmp 0x1ee2f