// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/hts_expr.c
// Function: mul_expr
static int mul_expr(hts_filter_t *filt, void *data, hts_expr_sym_func *fn,
                    char *str, char **end, hts_expr_val_t *res) {
    if (unary_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);
        if (*str == '*' || *str == '/' || *str == '%') {
            if (unary_expr(filt, data, fn, str+1, end, &val)) return -1;
            if (!hts_expr_val_exists(&val) || !hts_expr_val_exists(res)) {
                hts_expr_val_undef(res);
            } 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 if (*str == '%') {
            if (val.d)
                res->d = (int64_t)res->d % (int64_t)val.d;
            else
                hts_expr_val_undef(res);
        } else
            break;

        res->is_true = hts_expr_val_exists(res) && (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 $0x48, %rsp
movq %r9, %rbx
movq %r8, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
callq 0x19f76
testl %eax, %eax
je 0x19dd2
pushq $-0x1
popq %rax
jmp 0x19f67
movq %r13, 0x10(%rsp)
movq %r15, 0x18(%rsp)
movq (%r14), %rdi
xorpd %xmm0, %xmm0
leaq 0x20(%rsp), %r13
movapd %xmm0, 0x10(%r13)
movapd %xmm0, (%r13)
andq $0x0, 0x20(%r13)
movl $0x0, 0x8(%rsp)
cmpb $0x0, (%rdi)
je 0x19f59
callq 0x191b7
movq %rax, %rbp
movzbl (%rax), %eax
cmpq $0x2f, %rax
ja 0x19eac
movabsq $0x842000000000, %rcx   # imm = 0x842000000000
btq %rax, %rcx
jae 0x19eac
leaq 0x1(%rbp), %rcx
movq 0x10(%rsp), %rdi
movq %r14, %r8
movq %r12, %r14
movq %r12, %rsi
movq 0x18(%rsp), %rdx
movq %r8, %r15
movq %r13, %r12
movq %r13, %r9
callq 0x19f76
testl %eax, %eax
jne 0x19dca
movq %r12, %rdi
callq 0x191cd
testl %eax, %eax
je 0x19e8c
movq %rbx, %rdi
callq 0x191cd
testl %eax, %eax
je 0x19e8c
cmpb $0x0, 0x20(%rsp)
jne 0x19f50
movq %r14, %r12
cmpb $0x0, (%rbx)
je 0x19ea6
jmp 0x19f50
andq $0x0, 0x8(%rbx)
andw $0x0, (%rbx)
movabsq $0x7ff8000000000000, %rax # imm = 0x7FF8000000000000
movq %rax, 0x20(%rbx)
movq %r14, %r12
movb (%rbp), %al
movq %r15, %r14
cmpb $0x25, %al
je 0x19edb
movzbl %al, %eax
cmpl $0x2f, %eax
je 0x19ece
cmpl $0x2a, %eax
jne 0x19f59
movsd 0x40(%rsp), %xmm0
mulsd 0x20(%rbx), %xmm0
jmp 0x19f15
movsd 0x20(%rbx), %xmm0
divsd 0x40(%rsp), %xmm0
jmp 0x19f15
movsd 0x40(%rsp), %xmm0
ucomisd 0x5b11f(%rip), %xmm0    # 0x75008
jne 0x19eed
jnp 0x19f04
cvttsd2si 0x20(%rbx), %rax
cvttsd2si %xmm0, %rcx
cqto
idivq %rcx
cvtsi2sd %rdx, %xmm0
jmp 0x19f15
andq $0x0, 0x8(%rbx)
andw $0x0, (%rbx)
movsd 0x5ed5b(%rip), %xmm0    # 0x78c70
movsd %xmm0, 0x8(%rsp)
movsd %xmm0, 0x20(%rbx)
movq %rbx, %rdi
callq 0x191cd
testl %eax, %eax
setne %al
movsd 0x8(%rsp), %xmm0
ucomisd 0x5b0cd(%rip), %xmm0    # 0x75008
setp %cl
setne %dl
orb %cl, %dl
andb %al, %dl
movb %dl, 0x1(%rbx)
movq (%r14), %rdi
jmp 0x19df9
pushq $-0x1
popq %r15
movl %r15d, 0x8(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x18e75
movl 0x8(%rsp), %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq