// File: /workspace/github_cpp_makefile_star2_O1/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
leaq 0x2f550(%rip), %r13     # 0x4741c
leaq 0x48e35(%rip), %r14     # 0x60d08
leaq 0x4902e(%rip), %rbp     # 0x60f08
movq (%r15), %rax
movq %r15, %rdi
callq *(%rax)
movl %eax, %r12d
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
cmpl %eax, %r12d
jne 0x1823c
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 0x48e19(%rip), %rbp     # 0x60d30
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1829a
movq %rax, %r12
movq %rbx, (%rsp)
movq %rbx, %rdi
movq %r14, %rbx
movq %r14, %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1829a
movq 0x8(%r12), %rdi
movq 0x8(%rax), %rsi
callq 0x17eb4
testb %al, %al
leaq 0x48fa4(%rip), %rbp     # 0x60f08
je 0x1823c
movq %r15, %rdi
movq %rbx, %r14
movq %rbx, %rsi
leaq 0x48db6(%rip), %r12     # 0x60d30
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1829a
movq %rax, %r15
movq (%rsp), %rdi
movq %r14, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
leaq 0x2f471(%rip), %r13     # 0x4741c
je 0x1829a
movq 0x18(%r15), %r15
movq 0x18(%rax), %rax
movq %rbx, %r14
movq %rax, %rbx
jmp 0x17eda
movq %r15, %rdi
movq %r14, %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1829a
movq %rax, %r12
movq %rbx, %rdi
movq %r14, %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1829a
movq 0x8(%r12), %rdi
movq 0x8(%rax), %rsi
callq 0x17eb4
testb %al, %al
je 0x1823c
movq %r15, %rdi
movq %r14, %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1829a
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %rbp, %rdx
jmp 0x180be
movq %r15, %rdi
movq %r14, %rsi
leaq 0x48e32(%rip), %rbp     # 0x60e78
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1829a
movq %rax, %r12
movq %rbx, %rdi
movq %r14, %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1829a
movq 0x8(%r12), %rdi
movq 0x8(%rax), %rsi
callq 0x17eb4
testb %al, %al
leaq 0x48e7c(%rip), %rbp     # 0x60f08
je 0x1823c
movq %r15, %rdi
movq %r14, %rsi
leaq 0x48dd9(%rip), %r12     # 0x60e78
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1829a
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
jne 0x1816e
jmp 0x1829a
movq %rbp, %r13
movq %r15, %rdi
movq %r14, %rsi
leaq 0x48d05(%rip), %rbp     # 0x60de8
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1829a
movq %rax, %r12
movq %rbx, %rdi
movq %r14, %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1829a
movq 0x8(%r12), %rdi
movq 0x8(%rax), %rsi
callq 0x17eb4
testb %al, %al
je 0x1823c
movq %r13, %rbp
movq %r15, %rdi
movq %r14, %rsi
leaq 0x48cb0(%rip), %r12     # 0x60de8
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1829a
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
leaq 0x2f2b4(%rip), %r13     # 0x4741c
je 0x1829a
movq 0x18(%r15), %r15
movq 0x18(%rax), %rbx
jmp 0x17eda
leaq 0x48b86(%rip), %rsi     # 0x60d08
leaq 0x48e0f(%rip), %rdx     # 0x60f98
movq %r15, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1829a
movq %rax, %r14
leaq 0x48b62(%rip), %rsi     # 0x60d08
leaq 0x48deb(%rip), %rdx     # 0x60f98
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1829a
movq 0x8(%r14), %rdi
movq 0x8(%rax), %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1829f
leaq 0x48b26(%rip), %rsi     # 0x60d08
leaq 0x48dc7(%rip), %rdx     # 0x60fb0
movq %r15, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1829a
movq %rax, %r14
leaq 0x48b02(%rip), %rsi     # 0x60d08
leaq 0x48da3(%rip), %rdx     # 0x60fb0
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1829a
movq 0x10(%r14), %rdx
cmpq 0x10(%rax), %rdx
jne 0x1823c
testq %rdx, %rdx
je 0x18296
movq 0x8(%rax), %rsi
movq 0x8(%r14), %rdi
callq 0x9300
testl %eax, %eax
jmp 0x18291
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x48ab4(%rip), %rsi     # 0x60d08
leaq 0x492e5(%rip), %rdx     # 0x61540
movq %r15, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1829a
movq %rax, %r14
leaq 0x48a94(%rip), %rsi     # 0x60d08
leaq 0x492c5(%rip), %rdx     # 0x61540
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1829a
movl 0x8(%r14), %ecx
cmpl 0x8(%rax), %ecx
sete %al
jmp 0x1823e
movb $0x1, %al
jmp 0x1823e
callq 0x9530