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

    str = *end;
    hts_expr_val_t val = HTS_EXPR_VAL_INIT;
    while (*str) {
        str = ws(str);
        int undef = 0;
        if (*str == '+' || *str == '-') {
            if (mul_expr(filt, data, fn, str+1, end, &val)) return -1;
            if (!hts_expr_val_exists(&val) || !hts_expr_val_exists(res)) {
                undef = 1;
            } else if (val.is_str || res->is_str) {
                hts_expr_val_free(&val);
                return -1; // arith on strings
            }
        }

        if (*str == '+')
            res->d += val.d;
        else if (*str == '-')
            res->d -= val.d;
        else
            break;

        if (undef)
            hts_expr_val_undef(res);
        else
            res->is_true = res->d != 0;

        str = *end;
    }

    hts_expr_val_free(&val);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %r14
movq %r8, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
callq 0x1e0b2
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x1e08e
movq (%r15), %rbx
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movapd %xmm0, (%rsp)
movq $0x0, 0x20(%rsp)
movb (%rbx), %al
testb %al, %al
je 0x1e085
movzbl %al, %ecx
movb $0x1, %al
cmpl $0x2a, %ecx
jg 0x1df6c
cmpl $0x9, %ecx
je 0x1df64
movb $0x1, %al
cmpl $0x20, %ecx
jne 0x1e00e
movb 0x1(%rbx), %al
incq %rbx
jmp 0x1df4a
cmpl $0x2b, %ecx
je 0x1df7a
cmpl $0x2d, %ecx
jne 0x1e00e
leaq 0x1(%rbx), %rcx
movq %rbp, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %r8
movq %rsp, %r9
callq 0x1e0b2
testl %eax, %eax
jne 0x1e09f
movzbl (%rsp), %ecx
testl %ecx, %ecx
je 0x1dfb2
cmpl $0x1, %ecx
jne 0x1dfcc
cmpq $0x0, 0x18(%rsp)
setne %dl
jmp 0x1dfbf
movsd 0x20(%rsp), %xmm0
ucomisd %xmm0, %xmm0
setnp %dl
xorl %eax, %eax
testq %r14, %r14
je 0x1e00e
testb %dl, %dl
jne 0x1dfd1
jmp 0x1e00e
testq %r14, %r14
je 0x1e000
movzbl (%r14), %eax
cmpl $0x1, %eax
je 0x1dff5
testl %eax, %eax
jne 0x1e004
movsd 0x20(%r14), %xmm0
ucomisd %xmm0, %xmm0
jp 0x1e000
movb $0x1, %al
testb %cl, %cl
je 0x1e00e
jmp 0x1e0a6
cmpq $0x0, 0x18(%r14)
jne 0x1e0a6
xorl %eax, %eax
jmp 0x1e00e
orb %al, %cl
movb $0x1, %al
jne 0x1e0a6
movzbl (%rbx), %ecx
cmpl $0x2d, %ecx
je 0x1e029
cmpl $0x2b, %ecx
jne 0x1e07e
movsd 0x20(%rsp), %xmm0
addsd 0x20(%r14), %xmm0
jmp 0x1e035
movsd 0x20(%r14), %xmm0
subsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x20(%r14)
testb %al, %al
je 0x1e055
ucomisd 0x74fc1(%rip), %xmm0    # 0x93008
setp %al
setne %cl
orb %al, %cl
movb %cl, 0x1(%r14)
jmp 0x1e071
movq $0x0, 0x8(%r14)
movw $0x0, (%r14)
movabsq $0x7ff8000000000000, %rax # imm = 0x7FF8000000000000
movq %rax, 0x20(%r14)
movq (%r15), %rbx
movb (%rbx), %al
testb %al, %al
jne 0x1df4a
movq 0x18(%rsp), %rdi
jmp 0x1e087
xorl %edi, %edi
xorl %ebx, %ebx
callq 0x45c0
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x1e08e
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq 0x18(%rsp), %rdi
jmp 0x1e089