// File: /workspace/github_cpp_makefile_star2_O2/pfnet-research[P]pml/src/logic.cpp
// Function: logic::operator==(logic::formula_t const&, logic::formula_t const&)
bool operator==(formula_t const& lhs, formula_t const& rhs) {
    if (lhs.kind() != rhs.kind())
        return false;
    switch (lhs.kind()) {
    case formula_kind_t::Var:
        return cast<var_formula_t>(lhs).name == cast<var_formula_t>(rhs).name;
    case formula_kind_t::Bot:
    case formula_kind_t::Top:
        return true;
    case formula_kind_t::Neg:
        return *cast<neg_formula_t>(lhs).inner == *cast<neg_formula_t>(rhs).inner;
    case formula_kind_t::And:
        return *cast<and_formula_t>(lhs).lhs == *cast<and_formula_t>(rhs).lhs &&
            *cast<and_formula_t>(lhs).rhs == *cast<and_formula_t>(rhs).rhs;
    case formula_kind_t::Or:
        return *cast<or_formula_t>(lhs).lhs == *cast<or_formula_t>(rhs).lhs &&
            *cast<or_formula_t>(lhs).rhs == *cast<or_formula_t>(rhs).rhs;
    case formula_kind_t::Impl:
        return *cast<impl_formula_t>(lhs).lhs == *cast<impl_formula_t>(rhs).lhs &&
            *cast<impl_formula_t>(lhs).rhs == *cast<impl_formula_t>(rhs).rhs;
    case formula_kind_t::Eq:
        return *cast<eq_formula_t>(lhs).lhs == *cast<eq_formula_t>(rhs).lhs &&
            *cast<eq_formula_t>(lhs).rhs == *cast<eq_formula_t>(rhs).rhs;
    case formula_kind_t::Lt:
        return *cast<less_formula_t>(lhs).lhs == *cast<less_formula_t>(rhs).lhs &&
            *cast<less_formula_t>(lhs).rhs == *cast<less_formula_t>(rhs).rhs;
    case formula_kind_t::Leq:
        return *cast<leq_formula_t>(lhs).lhs == *cast<leq_formula_t>(rhs).lhs &&
            *cast<leq_formula_t>(lhs).rhs == *cast<leq_formula_t>(rhs).rhs;
    case formula_kind_t::Geq:
        return *cast<geq_formula_t>(lhs).lhs == *cast<geq_formula_t>(rhs).lhs &&
            *cast<geq_formula_t>(lhs).rhs == *cast<geq_formula_t>(rhs).rhs;
    case formula_kind_t::Gt:
        return *cast<greater_formula_t>(lhs).lhs == *cast<greater_formula_t>(rhs).lhs &&
            *cast<greater_formula_t>(lhs).rhs == *cast<greater_formula_t>(rhs).rhs;
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x26d8c(%rip), %r12     # 0x38758
movq (%r14), %rax
movq %r14, %rdi
callq *(%rax)
movl %eax, %ebp
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
cmpl %eax, %ebp
jne 0x11c58
movq (%r14), %rax
movq %r14, %rdi
callq *(%rax)
movl %eax, %ecx
movb $0x1, %al
cmpl $0xb, %ecx
ja 0x11c5a
movl %ecx, %ecx
movslq (%r12,%rcx,4), %rcx
addq %r12, %rcx
jmpq *%rcx
movq %r14, %rdi
callq 0x1066d
movq 0x8(%rax), %r14
movq %rbx, %rdi
callq 0x1066d
addq $0x8, %rax
jmp 0x11adf
movq %r14, %rdi
callq 0x106b1
movq 0x8(%rax), %r15
movq %rbx, %rdi
callq 0x106b1
movq 0x8(%rax), %rsi
movq %r15, %rdi
callq 0x119b7
testb %al, %al
je 0x11c58
movq %r14, %rdi
callq 0x106b1
movq 0x18(%rax), %r14
movq %rbx, %rdi
callq 0x106b1
jmp 0x11adb
movq %r14, %rdi
callq 0x1068f
movq 0x8(%rax), %r15
movq %rbx, %rdi
callq 0x1068f
movq 0x8(%rax), %rsi
movq %r15, %rdi
callq 0x119b7
testb %al, %al
je 0x11c58
movq %r14, %rdi
callq 0x1068f
movq 0x18(%rax), %r14
movq %rbx, %rdi
callq 0x1068f
jmp 0x11adb
movq %r14, %rdi
callq 0x106d3
movq 0x8(%rax), %r15
movq %rbx, %rdi
callq 0x106d3
movq 0x8(%rax), %rsi
movq %r15, %rdi
callq 0x119b7
testb %al, %al
je 0x11c58
movq %r14, %rdi
callq 0x106d3
movq 0x18(%rax), %r14
movq %rbx, %rdi
callq 0x106d3
addq $0x18, %rax
movq (%rax), %rbx
jmp 0x119cc
movq %r14, %rdi
callq 0x10739
movq 0x8(%rax), %r15
movq %rbx, %rdi
callq 0x10739
movq 0x8(%rax), %rsi
movq %r15, %rdi
callq 0x11805
testb %al, %al
je 0x11c58
movq %r14, %rdi
callq 0x10739
movq 0x18(%rax), %r14
movq %rbx, %rdi
callq 0x10739
jmp 0x11c44
movq %r14, %rdi
callq 0x10717
movq 0x8(%rax), %r15
movq %rbx, %rdi
callq 0x10717
movq 0x8(%rax), %rsi
movq %r15, %rdi
callq 0x11805
testb %al, %al
je 0x11c58
movq %r14, %rdi
callq 0x10717
movq 0x18(%rax), %r14
movq %rbx, %rdi
callq 0x10717
jmp 0x11c44
movq %r14, %rdi
callq 0x106f5
movq 0x8(%rax), %r15
movq %rbx, %rdi
callq 0x106f5
movq 0x8(%rax), %rsi
movq %r15, %rdi
callq 0x11805
testb %al, %al
je 0x11c58
movq %r14, %rdi
callq 0x106f5
movq 0x18(%rax), %r14
movq %rbx, %rdi
callq 0x106f5
jmp 0x11c44
movq %r14, %rdi
callq 0x1064b
leaq 0x8(%rax), %r14
movq %rbx, %rdi
callq 0x1064b
leaq 0x8(%rax), %rsi
movq %r14, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xa5de
movq %r14, %rdi
callq 0x1075b
movq 0x8(%rax), %r15
movq %rbx, %rdi
callq 0x1075b
movq 0x8(%rax), %rsi
movq %r15, %rdi
callq 0x11805
testb %al, %al
je 0x11c58
movq %r14, %rdi
callq 0x1075b
movq 0x18(%rax), %r14
movq %rbx, %rdi
callq 0x1075b
jmp 0x11c44
movq %r14, %rdi
callq 0x1077d
movq 0x8(%rax), %r15
movq %rbx, %rdi
callq 0x1077d
movq 0x8(%rax), %rsi
movq %r15, %rdi
callq 0x11805
testb %al, %al
je 0x11c58
movq %r14, %rdi
callq 0x1077d
movq 0x18(%rax), %r14
movq %rbx, %rdi
callq 0x1077d
movq 0x18(%rax), %rsi
movq %r14, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x11805
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq