// File: /workspace/github_cpp_makefile_star2_O3/pfnet-research[P]pml/src/logic.cpp
// Function: logic::operator==(logic::term_t const&, logic::term_t const&)
bool operator==(term_t const& lhs, term_t const& rhs) {
    if (lhs.kind() != rhs.kind())
        return false;
    switch (lhs.kind()) {
    case term_kind_t::Var:
        return cast<var_term_t>(lhs).name == cast<var_term_t>(rhs).name;
    case term_kind_t::Int:
        return cast<int_term_t>(lhs).n == cast<int_term_t>(rhs).n;
    case term_kind_t::Add:
        return
            *cast<add_term_t>(lhs).lhs == *cast<add_term_t>(rhs).lhs &&
            *cast<add_term_t>(lhs).rhs == *cast<add_term_t>(rhs).rhs;
    case term_kind_t::Sub:
        return
            *cast<sub_term_t>(lhs).lhs == *cast<sub_term_t>(rhs).lhs &&
            *cast<sub_term_t>(lhs).rhs == *cast<sub_term_t>(rhs).rhs;
    case term_kind_t::Mul:
        return
            *cast<mul_term_t>(lhs).lhs == *cast<mul_term_t>(rhs).lhs &&
            *cast<mul_term_t>(lhs).rhs == *cast<mul_term_t>(rhs).rhs;
    case term_kind_t::Div:
        return
            *cast<div_term_t>(lhs).lhs == *cast<div_term_t>(rhs).lhs &&
            *cast<div_term_t>(lhs).rhs == *cast<div_term_t>(rhs).rhs;
    case term_kind_t::Prob:
        return
            *cast<prob_term_t>(lhs).inner == *cast<prob_term_t>(rhs).inner;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
movq (%rdi), %rax
callq *(%rax)
movl %eax, %ebp
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
cmpl %eax, %ebp
jne 0x17f88
leaq 0x2f72f(%rip), %r13     # 0x4741c
leaq 0x4803c(%rip), %r14     # 0x5fd30
leaq 0x48235(%rip), %rbp     # 0x5ff30
movq (%r15), %rax
movq %r15, %rdi
callq *(%rax)
movl %eax, %eax
movslq (%r13,%rax,4), %rax
addq %r13, %rax
jmpq *%rax
movq %r15, %rdi
movq %r14, %rsi
leaq 0x4803c(%rip), %rbp     # 0x5fd58
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x180b1
movq %rax, %r12
movq %rbx, %rdi
movq %r14, %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x180b1
movq 0x8(%r12), %rdi
movq 0x8(%rax), %rsi
callq 0x17cbe
testb %al, %al
leaq 0x481ce(%rip), %rbp     # 0x5ff30
je 0x17f88
movq %r15, %rdi
leaq 0x47fbe(%rip), %r14     # 0x5fd30
movq %r14, %rsi
leaq 0x47fdc(%rip), %r12     # 0x5fd58
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x180b1
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
leaq 0x2f670(%rip), %r13     # 0x4741c
je 0x180b1
leaq 0x47f77(%rip), %r14     # 0x5fd30
jmp 0x17f64
movq %r15, %rdi
movq %r14, %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x180b1
movq %rax, %r12
movq %rbx, %rdi
movq %r14, %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x180b1
movq 0x8(%r12), %rdi
movq 0x8(%rax), %rsi
callq 0x17cbe
testb %al, %al
je 0x17f88
movq %r15, %rdi
movq %r14, %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x180b1
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %rbp, %rdx
jmp 0x17eb8
movq %r15, %rdi
movq %r14, %rsi
leaq 0x48060(%rip), %rbp     # 0x5fea0
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x180b1
movq %rax, %r12
movq %rbx, %rdi
movq %r14, %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x180b1
movq 0x8(%r12), %rdi
movq 0x8(%rax), %rsi
callq 0x17cbe
testb %al, %al
leaq 0x480aa(%rip), %rbp     # 0x5ff30
je 0x17f88
movq %r15, %rdi
movq %r14, %rsi
leaq 0x48007(%rip), %r12     # 0x5fea0
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x180b1
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
jne 0x17f64
jmp 0x180b1
movq %rbp, %r13
movq %r15, %rdi
movq %r14, %rsi
leaq 0x47f33(%rip), %rbp     # 0x5fe10
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x180b1
movq %rax, %r12
movq %rbx, %rdi
movq %r14, %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x180b1
movq 0x8(%r12), %rdi
movq 0x8(%rax), %rsi
callq 0x17cbe
testb %al, %al
je 0x17f88
movq %r13, %rbp
movq %r15, %rdi
movq %r14, %rsi
leaq 0x47ee2(%rip), %r12     # 0x5fe10
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x180b1
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
leaq 0x2f4be(%rip), %r13     # 0x4741c
je 0x180b1
movq 0x18(%rax), %rbx
movq 0x18(%r15), %r15
movq (%r15), %rax
movq %r15, %rdi
callq *(%rax)
movl %eax, %r12d
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
cmpl %eax, %r12d
je 0x17cfb
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x47d90(%rip), %rsi     # 0x5fd30
leaq 0x48031(%rip), %rdx     # 0x5ffd8
movq %r15, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x180b1
movq %rax, %r14
leaq 0x47d6c(%rip), %rsi     # 0x5fd30
leaq 0x4800d(%rip), %rdx     # 0x5ffd8
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x180b1
movq 0x10(%r14), %rdx
cmpq 0x10(%rax), %rdx
jne 0x17f88
testq %rdx, %rdx
je 0x180aa
movq 0x8(%rax), %rsi
movq 0x8(%r14), %rdi
callq 0x9300
testl %eax, %eax
jmp 0x1804a
leaq 0x47d27(%rip), %rsi     # 0x5fd30
leaq 0x48558(%rip), %rdx     # 0x60568
movq %r15, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x180b1
movq %rax, %r14
leaq 0x47d03(%rip), %rsi     # 0x5fd30
leaq 0x48534(%rip), %rdx     # 0x60568
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x180b1
movl 0x8(%r14), %ecx
cmpl 0x8(%rax), %ecx
sete %al
jmp 0x17f8a
leaq 0x47cd7(%rip), %rsi     # 0x5fd30
leaq 0x47f60(%rip), %rdx     # 0x5ffc0
movq %r15, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x180b1
movq %rax, %r14
leaq 0x47cb7(%rip), %rsi     # 0x5fd30
leaq 0x47f40(%rip), %rdx     # 0x5ffc0
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x180b1
movq 0x8(%r14), %rdi
movq 0x8(%rax), %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x180b6
movb $0x1, %al
jmp 0x17f8a
callq 0x9530