// File: fondoger[P]C0-Compiler/src/grammar.cpp
// Function: pTerm(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, DataType&)
static void pTerm(std::string &res, DataType &res_dtype)
{
    std::string temp_var;
    DataType temp_dtype;
    pFactor(res, res_dtype);
    while (g_sym == STAR || g_sym == SLASH) {
        OpCode op = (g_sym == STAR ? MUL : DIV);
        readSymbol();
        pFactor(temp_var, temp_dtype);
        int t1, t2;
        if (isConstValue(res, t1) && isConstValue(temp_var, t2)) {
            res = std::to_string( op == MUL ? t1 * t2 : t1 / t2 );
            res_dtype = DT_INT;
        }
        else {
            std::string new_res = genTempVar();
            genMidCode(TEMP, "int", new_res, NONE);
            genMidCode(op, res, temp_var, new_res);
            res = new_res;
            res_dtype = DT_INT;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3450
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x1fdf0
jmp 0x1fb9b
jmp 0x1fb9d
movb $0x1, %al
leaq 0x2bb0a(%rip), %rcx     # 0x4b6b0
cmpl $0x15, (%rcx)
movb %al, -0xba(%rbp)
je 0x1fbc4
leaq 0x2baf8(%rip), %rax     # 0x4b6b0
cmpl $0x16, (%rax)
sete %al
movb %al, -0xba(%rbp)
movb -0xba(%rbp), %al
testb $0x1, %al
jne 0x1fbd3
jmp 0x1fdc8
leaq 0x2bad6(%rip), %rax     # 0x4b6b0
movl (%rax), %eax
subl $0x15, %eax
setne %al
movzbl %al, %eax
addl $0x3, %eax
movl %eax, -0x48(%rbp)
callq 0x2e050
jmp 0x1fbf2
leaq -0x30(%rbp), %rdi
leaq -0x34(%rbp), %rsi
callq 0x1fdf0
jmp 0x1fc01
movq -0x8(%rbp), %rdi
leaq -0x4c(%rbp), %rsi
callq 0x27780
movb %al, -0xbb(%rbp)
jmp 0x1fc16
movb -0xbb(%rbp), %al
testb $0x1, %al
jne 0x1fc25
jmp 0x1fcaf
leaq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x27780
movb %al, -0xbc(%rbp)
jmp 0x1fc3a
movb -0xbc(%rbp), %al
testb $0x1, %al
jne 0x1fc46
jmp 0x1fcaf
cmpl $0x3, -0x48(%rbp)
jne 0x1fc5b
movl -0x4c(%rbp), %eax
imull -0x50(%rbp), %eax
movl %eax, -0xc0(%rbp)
jmp 0x1fc68
movl -0x4c(%rbp), %eax
cltd
idivl -0x50(%rbp)
movl %eax, -0xc0(%rbp)
movl -0xc0(%rbp), %esi
leaq -0x70(%rbp), %rdi
callq 0x22950
jmp 0x1fc79
movq -0x8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x33d0
leaq -0x70(%rbp), %rdi
callq 0x35e8
movq -0x10(%rbp), %rax
movl $0x1, (%rax)
jmp 0x1fdc3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1fdda
leaq -0x90(%rbp), %rdi
callq 0x271d0
jmp 0x1fcbd
movl $0x17, -0x94(%rbp)
leaq -0xb9(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x3570
movq -0xc8(%rbp), %rdx
leaq 0x15ac1(%rip), %rsi     # 0x357a9
leaq -0xb8(%rbp), %rdi
callq 0x3440
jmp 0x1fcf6
leaq 0x27303(%rip), %rcx     # 0x47000
leaq -0x94(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
leaq -0x90(%rbp), %rdx
callq 0x26340
jmp 0x1fd19
leaq -0xb8(%rbp), %rdi
callq 0x35e8
leaq -0xb9(%rbp), %rdi
callq 0x3370
movq -0x8(%rbp), %rsi
leaq -0x48(%rbp), %rdi
leaq -0x30(%rbp), %rdx
leaq -0x90(%rbp), %rcx
callq 0x26340
jmp 0x1fd4b
movq -0x8(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x3040
jmp 0x1fd5d
movq -0x10(%rbp), %rax
movl $0x1, (%rax)
leaq -0x90(%rbp), %rdi
callq 0x35e8
jmp 0x1fdc3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1fd9b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x35e8
leaq -0xb9(%rbp), %rdi
callq 0x3370
jmp 0x1fdb5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x35e8
jmp 0x1fdda
jmp 0x1fb9d
leaq -0x30(%rbp), %rdi
callq 0x35e8
addq $0xd0, %rsp
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x35e8
movq -0x40(%rbp), %rdi
callq 0x3560
nopl (%rax)