// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movq -0x38(%rbp), %r9
callq 0x2b5b0
cmpl $0x0, %eax
je 0x2b3be
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2b59d
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x4250
movq -0x28(%rbp), %rax
cmpb $0x0, (%rax)
je 0x2b58d
movq -0x28(%rbp), %rdi
callq 0x29c80
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2a, %eax
je 0x2b41b
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
je 0x2b41b
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x25, %eax
jne 0x2b4a2
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
addq $0x1, %rcx
movq -0x30(%rbp), %r8
leaq -0x60(%rbp), %r9
callq 0x2b5b0
cmpl $0x0, %eax
je 0x2b44d
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2b59d
leaq -0x60(%rbp), %rdi
callq 0x29ce0
cmpl $0x0, %eax
je 0x2b469
movq -0x38(%rbp), %rdi
callq 0x29ce0
cmpl $0x0, %eax
jne 0x2b474
movq -0x38(%rbp), %rdi
callq 0x2a750
jmp 0x2b4a0
movsbl -0x60(%rbp), %eax
cmpl $0x0, %eax
jne 0x2b489
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x2b49e
leaq -0x60(%rbp), %rdi
callq 0x2a790
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2b59d
jmp 0x2b4a0
jmp 0x2b4a2
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2a, %eax
jne 0x2b4c3
movsd -0x40(%rbp), %xmm0
movq -0x38(%rbp), %rax
mulsd 0x20(%rax), %xmm0
movsd %xmm0, 0x20(%rax)
jmp 0x2b53c
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
jne 0x2b4e8
movsd -0x40(%rbp), %xmm1
movq -0x38(%rbp), %rax
movsd 0x20(%rax), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rax)
jmp 0x2b53a
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x25, %eax
jne 0x2b536
movsd -0x40(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x2b506
jp 0x2b506
jmp 0x2b52b
movq -0x38(%rbp), %rax
cvttsd2si 0x20(%rax), %rax
cvttsd2si -0x40(%rbp), %rcx
cqto
idivq %rcx
cvtsi2sd %rdx, %xmm0
movq -0x38(%rbp), %rax
movsd %xmm0, 0x20(%rax)
jmp 0x2b534
movq -0x38(%rbp), %rdi
callq 0x2a750
jmp 0x2b538
jmp 0x2b58d
jmp 0x2b53a
jmp 0x2b53c
movq -0x38(%rbp), %rdi
callq 0x29ce0
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x61(%rbp)
je 0x2b56c
movq -0x38(%rbp), %rax
movsd 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
setne %al
setp %cl
orb %cl, %al
movb %al, -0x61(%rbp)
movb -0x61(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movb %cl, 0x1(%rax)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x2b3d9
leaq -0x60(%rbp), %rdi
callq 0x2a790
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)