// File: eniac[P]Mantis/src/compile/compile_c.cpp
// Function: generateMacroXorVersionBits(std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char>>&, std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char>>&, int, int)
void generateMacroXorVersionBits(ostringstream& oss_reaction_mirror, ostringstream& oss_preprocessor, int ing_iso_opt, int egr_iso_opt) {
    // Remember the current version bit values for reaction and measurement
    // We always pack field args and use mantis_mv_bit to index the replicas
    oss_reaction_mirror << "  static unsigned int __mantis__mv_ing = 0;\n";
    oss_reaction_mirror << "  static unsigned int __mantis__mv_egr = 0;\n";
    if(((unsigned int)ing_iso_opt) & 0b1) {
        // Create macros for flip version bit
        oss_preprocessor << "\n#define "
                        << "__mantis__flip_mv_ing "
                        << "__mantis__mv_ing=__mantis__mv_ing^0x1"
                        << "\n";        
    } 
    if (((unsigned int)ing_iso_opt) & 0b10) {
        oss_reaction_mirror << "  static unsigned int __mantis__vv_ing = 0x0;\n";
        oss_preprocessor << "\n#define "
                        << "__mantis__flip_vv_ing "
                        << "__mantis__vv_ing=__mantis__vv_ing^0x1"
                        << "\n";         
    }
    if(((unsigned int)egr_iso_opt) & 0b1) {
        oss_preprocessor << "\n#define "
                        << "__mantis__flip_mv_egr "
                        << "__mantis__mv_egr=__mantis__mv_egr^0x1"
                        << "\n";        
    } 
    if (((unsigned int)egr_iso_opt) & 0b10) {
        oss_reaction_mirror << "  static unsigned int __mantis__vv_egr = 0x0;\n";
        oss_preprocessor << "\n#define "
                        << "__mantis__flip_vv_egr "
                        << "__mantis__vv_egr=__mantis__vv_egr^0x1"
                        << "\n";         
    }    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x651a7(%rip), %rsi     # 0x13b878
callq 0xaa540
movq -0x8(%rbp), %rdi
leaq 0x651c4(%rip), %rsi     # 0x13b8a5
callq 0xaa540
movl -0x14(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xd672e
movq -0x10(%rbp), %rdi
leaq 0x651d6(%rip), %rsi     # 0x13b8d2
callq 0xaa540
movq %rax, %rdi
leaq 0x651d1(%rip), %rsi     # 0x13b8dc
callq 0xaa540
movq %rax, %rdi
leaq 0x651d9(%rip), %rsi     # 0x13b8f3
callq 0xaa540
movq %rax, %rdi
leaq 0x636ab(%rip), %rsi     # 0x139dd4
callq 0xaa540
movl -0x14(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0xd6786
movq -0x8(%rbp), %rdi
leaq 0x651d5(%rip), %rsi     # 0x13b919
callq 0xaa540
movq -0x10(%rbp), %rdi
leaq 0x6517e(%rip), %rsi     # 0x13b8d2
callq 0xaa540
movq %rax, %rdi
leaq 0x651e5(%rip), %rsi     # 0x13b948
callq 0xaa540
movq %rax, %rdi
leaq 0x651ed(%rip), %rsi     # 0x13b95f
callq 0xaa540
movq %rax, %rdi
leaq 0x63653(%rip), %rsi     # 0x139dd4
callq 0xaa540
movl -0x18(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xd67ce
movq -0x10(%rbp), %rdi
leaq 0x65136(%rip), %rsi     # 0x13b8d2
callq 0xaa540
movq %rax, %rdi
leaq 0x651da(%rip), %rsi     # 0x13b985
callq 0xaa540
movq %rax, %rdi
leaq 0x651e2(%rip), %rsi     # 0x13b99c
callq 0xaa540
movq %rax, %rdi
leaq 0x6360b(%rip), %rsi     # 0x139dd4
callq 0xaa540
movl -0x18(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0xd6826
movq -0x8(%rbp), %rdi
leaq 0x651de(%rip), %rsi     # 0x13b9c2
callq 0xaa540
movq -0x10(%rbp), %rdi
leaq 0x650de(%rip), %rsi     # 0x13b8d2
callq 0xaa540
movq %rax, %rdi
leaq 0x651ee(%rip), %rsi     # 0x13b9f1
callq 0xaa540
movq %rax, %rdi
leaq 0x651f6(%rip), %rsi     # 0x13ba08
callq 0xaa540
movq %rax, %rdi
leaq 0x635b3(%rip), %rsi     # 0x139dd4
callq 0xaa540
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)