// File: /workspace/github_cpp_makefile_star2_O2/acliusBackHome[P]kamaya/dist/ParseExpressionConstCalculate.cpp
// Function: ParseExpression::calculate_const_mod(ConstValueType, ParseConstant const&, ParseConstant const&)
void ParseExpression::
calculate_const_mod(ConstValueType cal_type,
                    const ParseConstant &const1, const ParseConstant &const2) {
    switch (cal_type) {
        case C_BOOL:
        case C_SIGNED: {
            auto divisor = const2.get_signed();
            if (divisor == 0) {
                string info = "ParseExpression::calculate_const() expr_id=" + to_string(get_id());
                throw ParseException(EX_EXPRESSION_DIVIDE_ZERO, info);
            }
            const_value = (size_t)
                    new ParseConstant(ParseConstant(const1.get_signed() % divisor));
            return;
        }
        case C_UNSIGNED: {
            auto divisor = const2.get_unsigned();
            if (divisor == 0) {
                string info = "ParseExpression::calculate_const() expr_id=" + to_string(get_id());
                throw ParseException(EX_EXPRESSION_DIVIDE_ZERO, info);
            }
            const_value = (size_t)
                    new ParseConstant(ParseConstant(const1.get_unsigned() % divisor));
            return;
        }
        case C_FLOAT:
        case C_STRING:
        default:
            break;
    }
    const_value = (size_t) -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdx, %r15
movq %rdi, %rbx
cmpl $0x4, %esi
je 0x2c3c0
cmpl $0x2, %esi
je 0x2c3f5
cmpl $0x1, %esi
jne 0x2c42e
movq %rcx, %rdi
callq 0x27b16
testq %rax, %rax
je 0x2c443
movq %rax, %r12
pushq $0x10
popq %rdi
callq 0x42a0
movq %rax, %r14
movq %r15, %rdi
callq 0x27b16
cqto
idivq %r12
movq %r14, %rdi
movq %rdx, %rsi
callq 0x27a24
jmp 0x2c432
movq %rcx, %rdi
callq 0x27b82
testq %rax, %rax
je 0x2c4a8
movq %rax, %r12
pushq $0x10
popq %rdi
callq 0x42a0
movq %rax, %r14
movq %r15, %rdi
callq 0x27b82
xorl %edx, %edx
divq %r12
movq %r14, %rdi
movq %rdx, %rsi
callq 0x27a4c
jmp 0x2c432
pushq $-0x1
popq %r14
movq %r14, 0x18(%rbx)
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x25a2e
leaq -0x40(%rbp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0xc865
leaq 0x10247(%rip), %rsi     # 0x3c6a8
leaq -0x60(%rbp), %rdi
movq %rbx, %rdx
callq 0xc837
leaq -0x40(%rbp), %rdi
callq 0x4598
pushq $0x28
popq %rdi
callq 0x4180
movq %rax, %r14
pushq $0xe
popq %rsi
leaq -0x60(%rbp), %rdx
movq %rax, %rdi
callq 0x2b53c
leaq 0x268d9(%rip), %rsi     # 0x52d70
leaq -0x1fbf6(%rip), %rdx    # 0xc8a8
movq %r14, %rdi
callq 0x44e0
jmp 0x2c50b
movq %rbx, %rdi
callq 0x25a2e
leaq -0x40(%rbp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0xc865
leaq 0x101e2(%rip), %rsi     # 0x3c6a8
leaq -0x60(%rbp), %rdi
movq %rbx, %rdx
callq 0xc837
leaq -0x40(%rbp), %rdi
callq 0x4598
pushq $0x28
popq %rdi
callq 0x4180
movq %rax, %r14
pushq $0xe
popq %rsi
leaq -0x60(%rbp), %rdx
movq %rax, %rdi
callq 0x2b53c
leaq 0x26874(%rip), %rsi     # 0x52d70
leaq -0x1fc5b(%rip), %rdx    # 0xc8a8
movq %r14, %rdi
callq 0x44e0
jmp 0x2c50f
jmp 0x2c514
movq %rax, %rbx
jmp 0x2c51f
movq %rax, %rbx
movq %r14, %rdi
callq 0x4220
leaq -0x60(%rbp), %rdi
jmp 0x2c52e
jmp 0x2c527
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x4598
jmp 0x2c542
jmp 0x2c537
movq %rax, %rbx
movq %r14, %rdi
callq 0x4270
movq %rbx, %rdi
callq 0x4500