// File: /workspace/github_c_makefile_star2_O1/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 $0x38, %rsp
movq %r9, %rbx
movq %r8, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
callq 0x1e9ff
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x1e9e7
movq %r15, 0x30(%rsp)
movq (%r14), %r15
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movapd %xmm0, (%rsp)
movq $0x0, 0x20(%rsp)
cmpb $0x0, (%r15)
je 0x1e9c8
movzbl (%r15), %eax
cmpq $0x2f, %rax
ja 0x1e8f6
movabsq $0x842000000000, %rcx   # imm = 0x842000000000
btq %rax, %rcx
jae 0x1e87c
leaq 0x1(%r15), %rcx
movq %r13, %rdi
movq %r12, %rsi
movq 0x30(%rsp), %rdx
movq %r14, %r8
movq %rsp, %r9
callq 0x1e9ff
testl %eax, %eax
jne 0x1e9f8
movzbl (%rsp), %eax
testl %eax, %eax
je 0x1e891
cmpl $0x1, %eax
jne 0x1e875
cmpq $0x0, 0x18(%rsp)
je 0x1e8db
testb %al, %al
je 0x1e891
testq %rbx, %rbx
jne 0x1e8a2
jmp 0x1e8db
movabsq $0x100000200, %rcx      # imm = 0x100000200
btq %rax, %rcx
jae 0x1e8f6
incq %r15
jmp 0x1e81c
testq %rbx, %rbx
je 0x1e8db
movsd 0x20(%rsp), %xmm0
ucomisd %xmm0, %xmm0
jp 0x1e8db
movzbl (%rbx), %ecx
testl %ecx, %ecx
je 0x1e8b9
cmpl $0x1, %ecx
jne 0x1e8c4
cmpq $0x0, 0x18(%rbx)
je 0x1e8db
testb %cl, %cl
jne 0x1e8c4
movsd 0x20(%rbx), %xmm0
ucomisd %xmm0, %xmm0
jp 0x1e8db
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testb %al, %al
jne 0x1e9ca
cmpb $0x0, (%rbx)
je 0x1e8f6
jmp 0x1e9ca
movq $0x0, 0x8(%rbx)
movw $0x0, (%rbx)
movabsq $0x7ff8000000000000, %rax # imm = 0x7FF8000000000000
movq %rax, 0x20(%rbx)
movzbl (%r15), %eax
cmpl $0x25, %eax
je 0x1e927
cmpl $0x2f, %eax
je 0x1e91a
cmpl $0x2a, %eax
jne 0x1e9c8
movsd 0x20(%rsp), %xmm0
mulsd 0x20(%rbx), %xmm0
jmp 0x1e951
movsd 0x20(%rbx), %xmm0
divsd 0x20(%rsp), %xmm0
jmp 0x1e951
movsd 0x20(%rsp), %xmm0
ucomisd 0x776d3(%rip), %xmm0    # 0x96008
jne 0x1e939
jnp 0x1e9ab
cvttsd2si 0x20(%rbx), %rax
cvttsd2si %xmm0, %rcx
cqto
idivq %rcx
xorps %xmm0, %xmm0
cvtsi2sd %rdx, %xmm0
movsd %xmm0, 0x20(%rbx)
xorl %ebp, %ebp
testq %rbx, %rbx
je 0x1e997
movzbl (%rbx), %eax
testl %eax, %eax
je 0x1e974
cmpl $0x1, %eax
jne 0x1e97f
cmpq $0x0, 0x18(%rbx)
je 0x1e997
testb %al, %al
jne 0x1e97f
movsd 0x20(%rbx), %xmm0
ucomisd %xmm0, %xmm0
jp 0x1e997
movsd 0x20(%rbx), %xmm0
cmpneqsd 0x7767b(%rip), %xmm0    # 0x96008
movq %xmm0, %rax
andl $0x1, %eax
jmp 0x1e999
xorl %eax, %eax
movb %al, 0x1(%rbx)
movq (%r14), %r15
cmpb $0x0, (%r15)
jne 0x1e81c
jmp 0x1e9ca
movq $0x0, 0x8(%rbx)
movw $0x0, (%rbx)
movabsq $0x7ff8000000000000, %rax # imm = 0x7FF8000000000000
movq %rax, 0x20(%rbx)
jmp 0x1e956
xorl %ebp, %ebp
movq 0x18(%rsp), %rdi
callq 0x45c0
xorpd %xmm0, %xmm0
movupd %xmm0, 0x8(%rsp)
movq $0x0, 0x18(%rsp)
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x1e9e7