// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/hts_expr.c
// Function: cmp_expr
static int cmp_expr(hts_filter_t *filt, void *data, hts_expr_sym_func *fn,
                    char *str, char **end, hts_expr_val_t *res) {
    if (bitor_expr(filt, data, fn, str, end, res)) return -1;

    str = ws(*end);
    hts_expr_val_t val = HTS_EXPR_VAL_INIT;
    int err = 0, cmp_done = 0;

    if (*str == '>' && str[1] == '=') {
        cmp_done = 1;
        err = cmp_expr(filt, data, fn, str+2, end, &val);
        if (!hts_expr_val_exists(res) || !hts_expr_val_exists(&val)) {
            hts_expr_val_undef(res);
        } else {
            res->is_true=res->d
                = res->is_str && res->s.s && val.is_str && val.s.s
                ? strcmp(res->s.s, val.s.s) >= 0
                : !res->is_str && !val.is_str && res->d >= val.d;
            res->is_str = 0;
        }
    } else if (*str == '>') {
        cmp_done = 1;
        err = cmp_expr(filt, data, fn, str+1, end, &val);
        if (!hts_expr_val_exists(res) || !hts_expr_val_exists(&val)) {
            hts_expr_val_undef(res);
        } else {
            res->is_true=res->d
                = res->is_str && res->s.s && val.is_str && val.s.s
                ? strcmp(res->s.s, val.s.s) > 0
                : !res->is_str && !val.is_str && res->d > val.d;
            res->is_str = 0;
        }
    } else if (*str == '<' && str[1] == '=') {
        cmp_done = 1;
        err = cmp_expr(filt, data, fn, str+2, end, &val);
        if (!hts_expr_val_exists(res) || !hts_expr_val_exists(&val)) {
            hts_expr_val_undef(res);
        } else {
            res->is_true=res->d
                = res->is_str && res->s.s && val.is_str && val.s.s
                ? strcmp(res->s.s, val.s.s) <= 0
                : !res->is_str && !val.is_str && res->d <= val.d;
            res->is_str = 0;
        }
    } else if (*str == '<') {
        cmp_done = 1;
        err = cmp_expr(filt, data, fn, str+1, end, &val);
        if (!hts_expr_val_exists(res) || !hts_expr_val_exists(&val)) {
            hts_expr_val_undef(res);
        } else {
            res->is_true=res->d
                = res->is_str && res->s.s && val.is_str && val.s.s
                ? strcmp(res->s.s, val.s.s) < 0
                : !res->is_str && !val.is_str && res->d < val.d;
            res->is_str = 0;
        }
    }

    if (cmp_done && (!hts_expr_val_exists(&val) || !hts_expr_val_exists(res)))
        hts_expr_val_undef(res);
    hts_expr_val_free(&val);

    return err ? -1 : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %rbx
movq %r8, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
callq 0x19a0d
pushq $-0x1
popq %rcx
testl %eax, %eax
jne 0x199cf
xorpd %xmm0, %xmm0
leaq 0x10(%rsp), %rbp
movapd %xmm0, 0x10(%rbp)
movapd %xmm0, (%rbp)
andq $0x0, 0x20(%rbp)
movb $0x1, %al
movl %eax, 0xc(%rsp)
movq (%r14), %rdi
callq 0x191b7
cmpb $0x7c, (%rax)
jne 0x196b8
cmpb $0x7c, 0x1(%rax)
je 0x196b8
incq %rax
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rax, %rcx
movq %r14, %r8
movq %rbp, %r9
callq 0x19a0d
testl %eax, %eax
jne 0x197b4
movq %rbp, %rdi
callq 0x191cd
testl %eax, %eax
je 0x196ab
movq %rbx, %rdi
callq 0x191cd
testl %eax, %eax
je 0x196ab
movb 0x10(%rsp), %al
orb (%rbx), %al
jne 0x197aa
cvttsd2si 0x20(%rbx), %rax
cvttsd2si 0x30(%rsp), %rcx
orq %rax, %rcx
cvtsi2sd %rcx, %xmm0
movsd %xmm0, 0x20(%rbx)
setne 0x1(%rbx)
jmp 0x19632
movl $0x0, 0xc(%rsp)
jmp 0x19632
leaq 0x18(%rsp), %rdi
callq 0x18e75
movabsq $0x7ff8000000000000, %rbp # imm = 0x7FF8000000000000
testb $0x1, 0xc(%rsp)
jne 0x196e0
andq $0x0, 0x8(%rbx)
andw $0x0, (%rbx)
movq %rbp, 0x20(%rbx)
movq (%r14), %rdi
callq 0x191b7
xorpd %xmm0, %xmm0
andq $0x0, 0x30(%rsp)
movapd %xmm0, 0x20(%rsp)
movapd %xmm0, 0x10(%rsp)
movzbl (%rax), %ecx
cmpl $0x3c, %ecx
je 0x197bc
movq %rbp, %rdx
xorl %ebp, %ebp
cmpl $0x3e, %ecx
jne 0x199bf
cmpb $0x3d, 0x1(%rax)
movq %rdx, %rbp
jne 0x1984b
addq $0x2, %rax
leaq 0x10(%rsp), %r9
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rax, %rcx
movq %r14, %r8
callq 0x195e7
movl %eax, %r14d
movq %rbx, %rdi
callq 0x191cd
testl %eax, %eax
je 0x19946
leaq 0x10(%rsp), %rdi
callq 0x191cd
testl %eax, %eax
je 0x19946
cmpb $0x0, (%rbx)
movb 0x10(%rsp), %al
je 0x19955
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
setne %cl
testb %al, %al
setne %al
andb %cl, %al
movq 0x28(%rsp), %rsi
testq %rsi, %rsi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x19981
callq 0x46c0
testl %eax, %eax
setns %al
jmp 0x19983
leaq 0x18(%rsp), %rdi
callq 0x18e75
pushq $-0x1
popq %rcx
jmp 0x199cf
cmpb $0x3d, 0x1(%rax)
jne 0x198cf
addq $0x2, %rax
leaq 0x10(%rsp), %r9
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rax, %rcx
movq %r14, %r8
callq 0x195e7
movl %eax, %r14d
movq %rbx, %rdi
callq 0x191cd
testl %eax, %eax
je 0x19946
leaq 0x10(%rsp), %rdi
callq 0x191cd
testl %eax, %eax
je 0x19946
cmpb $0x0, (%rbx)
movb 0x10(%rsp), %al
je 0x1997d
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
setne %cl
testb %al, %al
setne %al
andb %cl, %al
movq 0x28(%rsp), %rsi
testq %rsi, %rsi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x19981
callq 0x46c0
testl %eax, %eax
setle %al
jmp 0x19983
incq %rax
leaq 0x10(%rsp), %r9
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rax, %rcx
movq %r14, %r8
callq 0x195e7
movl %eax, %r14d
movq %rbx, %rdi
callq 0x191cd
testl %eax, %eax
je 0x19946
leaq 0x10(%rsp), %rdi
callq 0x191cd
testl %eax, %eax
je 0x19946
cmpb $0x0, (%rbx)
movb 0x10(%rsp), %al
je 0x19969
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
setne %cl
testb %al, %al
setne %al
andb %cl, %al
movq 0x28(%rsp), %rsi
testq %rsi, %rsi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x19981
callq 0x46c0
testl %eax, %eax
setg %al
jmp 0x19983
incq %rax
leaq 0x10(%rsp), %r9
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rax, %rcx
movq %r14, %r8
callq 0x195e7
movl %eax, %r14d
movq %rbx, %rdi
callq 0x191cd
testl %eax, %eax
je 0x19946
leaq 0x10(%rsp), %rdi
callq 0x191cd
testl %eax, %eax
je 0x19946
cmpb $0x0, (%rbx)
movb 0x10(%rsp), %al
je 0x199e0
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
setne %cl
testb %al, %al
setne %al
andb %cl, %al
movq 0x28(%rsp), %rsi
testq %rsi, %rsi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x199e4
callq 0x46c0
shrl $0x1f, %eax
jmp 0x19986
andq $0x0, 0x8(%rbx)
andw $0x0, (%rbx)
movq %rbp, 0x20(%rbx)
jmp 0x19995
testb %al, %al
jne 0x19981
movsd 0x20(%rbx), %xmm0
ucomisd 0x30(%rsp), %xmm0
jmp 0x199f3
testb %al, %al
jne 0x19981
movsd 0x20(%rbx), %xmm0
ucomisd 0x30(%rsp), %xmm0
seta %al
jmp 0x19983
testb %al, %al
je 0x199e8
xorl %eax, %eax
movzbl %al, %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x20(%rbx)
movb %al, 0x1(%rbx)
movb $0x0, (%rbx)
leaq 0x10(%rsp), %rdi
callq 0x191cd
testl %eax, %eax
je 0x199af
movq %rbx, %rdi
callq 0x191cd
testl %eax, %eax
jne 0x199bc
andq $0x0, 0x8(%rbx)
andw $0x0, (%rbx)
movq %rbp, 0x20(%rbx)
movl %r14d, %ebp
leaq 0x18(%rsp), %rdi
callq 0x18e75
xorl %ecx, %ecx
negl %ebp
sbbl %ecx, %ecx
movl %ecx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testb %al, %al
je 0x199f8
xorl %eax, %eax
jmp 0x19986
movsd 0x30(%rsp), %xmm0
ucomisd 0x20(%rbx), %xmm0
setae %al
jmp 0x19983
movsd 0x30(%rsp), %xmm0
xorl %eax, %eax
ucomisd 0x20(%rbx), %xmm0
seta %al
jmp 0x19986