// File: /workspace/github_cpp_makefile_star2_O2/SMT-COMP[P]scrambler/scrambler.cpp
// Function: scrambler::is_commutative(scrambler::node const*)
int is_commutative(const node *n)
{
    // *n might be a qualified identifier of the form ('as' identifier sort)
    const std::string *symbol = &(n->symbol);
    if (*symbol == "as") {
        assert(n->children.size() > 0);
        symbol = &(n->children[0]->symbol);
    }
    const std::string &s = *symbol;
    assert(!s.empty());

    // Core theory
    if (s == "and" || s == "or" || s == "xor" || s == "distinct") {
        return 0;
    }
    if (!logic_is_dl()) {
        if (s == "=") {
            return 0;
        }
    }

    // arithmetic (IA, RA, IRA) (but not difference logic)
    if (logic_is_arith()) {
        if (s == "*" || s == "+") {
            return 0;
        }
    }

    // BitVectors
    if (logic_is_bv()) {
        if (s == "bvand" || s == "bvor" || s == "bvxor" ||
            s == "bvnand" || s == "bvnor" || s == "bvcomp" ||
            s == "bvadd" || s == "bvmul") {
            return 0;
        }
    }

    // FloatingPoint
    if (logic_is_fp()) {
        if (s == "fp.eq") {
            return 0;
        }
        if (s == "fp.add" || s == "fp.mul") {
            return 1;
        }
    }

    return -1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x71fd(%rip), %rsi      # 0xb126
callq 0x5af6
testb %al, %al
je 0x3f43
movq 0x10(%r14), %rax
cmpq %rax, 0x18(%r14)
je 0x412d
movq (%rax), %r14
movq (%r14), %rax
cmpq $0x0, -0x18(%rax)
je 0x410e
leaq 0x91d4(%rip), %rsi      # 0xd12c
movq %r14, %rdi
callq 0x5af6
xorl %ebx, %ebx
testb %al, %al
jne 0x3f9f
leaq 0x7232(%rip), %rsi      # 0xb19f
movq %r14, %rdi
callq 0x5af6
testb %al, %al
jne 0x3f9f
leaq 0x7211(%rip), %rsi      # 0xb191
movq %r14, %rdi
callq 0x5af6
testb %al, %al
jne 0x3f9f
leaq 0x71e4(%rip), %rsi      # 0xb177
movq %r14, %rdi
callq 0x5af6
testb %al, %al
je 0x3fa9
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x3d37
testb %al, %al
jne 0x3fc5
leaq 0x8f1e(%rip), %rsi      # 0xced7
movq %r14, %rdi
callq 0x5af6
testb %al, %al
jne 0x3f9f
callq 0x3dc0
testb %al, %al
je 0x3ff4
leaq 0x71ab(%rip), %rsi      # 0xb180
movq %r14, %rdi
callq 0x5af6
testb %al, %al
jne 0x3f9f
leaq 0x719a(%rip), %rsi      # 0xb182
movq %r14, %rdi
callq 0x5af6
testb %al, %al
jne 0x3f9f
callq 0x3e49
testb %al, %al
je 0x40b5
leaq 0x717c(%rip), %rsi      # 0xb184
movq %r14, %rdi
callq 0x5af6
testb %al, %al
jne 0x3f9f
leaq 0x716f(%rip), %rsi      # 0xb18a
movq %r14, %rdi
callq 0x5af6
testb %al, %al
jne 0x3f9f
leaq 0x715d(%rip), %rsi      # 0xb18f
movq %r14, %rdi
callq 0x5af6
testb %al, %al
jne 0x3f9f
leaq 0x714c(%rip), %rsi      # 0xb195
movq %r14, %rdi
callq 0x5af6
testb %al, %al
jne 0x3f9f
leaq 0x713c(%rip), %rsi      # 0xb19c
movq %r14, %rdi
callq 0x5af6
testb %al, %al
jne 0x3f9f
leaq 0x712b(%rip), %rsi      # 0xb1a2
movq %r14, %rdi
callq 0x5af6
testb %al, %al
jne 0x3f9f
leaq 0x711b(%rip), %rsi      # 0xb1a9
movq %r14, %rdi
callq 0x5af6
testb %al, %al
jne 0x3f9f
leaq 0x710a(%rip), %rsi      # 0xb1af
movq %r14, %rdi
callq 0x5af6
testb %al, %al
jne 0x3f9f
callq 0x3eb2
testb %al, %al
je 0x4106
leaq 0x70f0(%rip), %rsi      # 0xb1b5
movq %r14, %rdi
callq 0x5af6
testb %al, %al
jne 0x3f9f
leaq 0x70df(%rip), %rsi      # 0xb1bb
movq %r14, %rdi
callq 0x5af6
pushq $0x1
popq %rbx
testb %al, %al
jne 0x3f9f
leaq 0x70cc(%rip), %rsi      # 0xb1c2
movq %r14, %rdi
callq 0x5af6
testb %al, %al
jne 0x3f9f
pushq $-0x1
popq %rbx
jmp 0x3f9f
leaq 0x7057(%rip), %rdi      # 0xb16c
leaq 0x6f11(%rip), %rsi      # 0xb02d
leaq 0x701d(%rip), %rcx      # 0xb140
movl $0x1c1, %edx            # imm = 0x1C1
callq 0x3160
leaq 0x6ff5(%rip), %rdi      # 0xb129
leaq 0x6ef2(%rip), %rsi      # 0xb02d
leaq 0x6ffe(%rip), %rcx      # 0xb140
movl $0x1bd, %edx            # imm = 0x1BD
callq 0x3160