// File: /workspace/github_cpp_makefile_star2_O2/chuckwolber[P]Cube/test/test_algorithm.cpp
// Function: test_inversions()
void test_inversions() {
    std::cout << "Testing inversions... ";

    Algorithm alg_1({{Layer::L, true}, {Layer::F, true}});
   
    assert(!alg_1.hasInversion());
    alg_1 += 9;
    assert(alg_1.hasInversion());
    verify_turns(alg_1.getAlgorithm(), {{Layer::L, true}, {Layer::L, false}});

    Algorithm alg_2({{Layer::L, true}, {Layer::L, true}, {Layer::F, true}});
    assert(!alg_2.hasInversion());
    alg_2 += 12;
    assert(alg_2.hasInversion());
    verify_turns(alg_2.getAlgorithm(), 
                    {{Layer::L, true}, {Layer::L, false}, {Layer::F, true}});

    Algorithm alg_3({{Layer::F, true}, {Layer::F, false}}); 
    assert(alg_3.hasInversion());

    Algorithm alg_4({{Layer::F, false}, {Layer::F, true}}); 
    assert(alg_4.hasInversion());

    Algorithm alg_5({{Layer::B, true}, {Layer::B, false}}); 
    assert(alg_5.hasInversion());

    Algorithm alg_6({{Layer::B, false}, {Layer::B, true}}); 
    assert(alg_6.hasInversion());

    std::cout << "Passed" << std::endl;
}

// Assembly:
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movq 0x84eb(%rip), %rdi      # 0xdfd8
leaq 0x3997(%rip), %rsi      # 0x948b
callq 0x2140
leaq 0x8(%rsp), %rsi
movl $0x4, (%rsi)
movb $0x1, %al
movb %al, 0x4(%rsi)
movl $0x5, 0x8(%rsi)
movb %al, 0xc(%rsi)
leaq 0x188(%rsp), %rdi
pushq $0x2
popq %rdx
leaq 0x30(%rsp), %rcx
callq 0x7e30
leaq 0x88(%rsp), %rdi
leaq 0x188(%rsp), %rsi
callq 0x242a
leaq 0x188(%rsp), %rdi
callq 0x358c
leaq 0x88(%rsp), %rdi
callq 0x2aaa
testb %al, %al
jne 0x5eca
leaq 0x88(%rsp), %rdi
pushq $0x9
popq %rsi
callq 0x2740
leaq 0x88(%rsp), %rdi
callq 0x2aaa
testb %al, %al
je 0x5ee9
leaq 0x170(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x2a0c
pushq $0x4
popq %rax
leaq 0x8(%rsp), %rsi
movl %eax, (%rsi)
movb $0x1, 0x4(%rsi)
movl %eax, 0x8(%rsi)
movb $0x0, 0xc(%rsi)
leaq 0x158(%rsp), %rdi
pushq $0x2
popq %rdx
leaq 0x30(%rsp), %rcx
callq 0x7e30
leaq 0x170(%rsp), %rdi
leaq 0x158(%rsp), %rsi
callq 0x7afb
leaq 0x158(%rsp), %rdi
callq 0x358c
leaq 0x170(%rsp), %rdi
callq 0x358c
movups 0x4093(%rip), %xmm0     # 0x9c8c
leaq 0x30(%rsp), %rsi
movaps %xmm0, (%rsi)
movabsq $0x100000005, %rbx      # imm = 0x100000005
movq %rbx, 0x10(%rsi)
leaq 0x140(%rsp), %rdi
pushq $0x3
popq %rdx
leaq 0x60(%rsp), %rcx
callq 0x7e30
leaq 0x8(%rsp), %rdi
leaq 0x140(%rsp), %rsi
callq 0x242a
leaq 0x140(%rsp), %rdi
callq 0x358c
leaq 0x8(%rsp), %rdi
callq 0x2aaa
testb %al, %al
jne 0x5f08
leaq 0x8(%rsp), %rdi
pushq $0xc
popq %rsi
callq 0x2740
leaq 0x8(%rsp), %rdi
callq 0x2aaa
testb %al, %al
je 0x5f27
leaq 0x128(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x2a0c
movups 0x4017(%rip), %xmm0     # 0x9ca4
leaq 0x30(%rsp), %rsi
movaps %xmm0, (%rsi)
movq %rbx, 0x10(%rsi)
leaq 0x110(%rsp), %rdi
pushq $0x3
popq %rdx
leaq 0x60(%rsp), %rcx
callq 0x7e30
leaq 0x128(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0x7afb
leaq 0x110(%rsp), %rdi
callq 0x358c
leaq 0x128(%rsp), %rdi
callq 0x358c
pushq $0x5
popq %rbx
leaq 0x60(%rsp), %rsi
movl %ebx, (%rsi)
movb $0x1, 0x4(%rsi)
movl %ebx, 0x8(%rsi)
movb $0x0, 0xc(%rsi)
leaq 0xf8(%rsp), %rdi
pushq $0x2
popq %rdx
leaq 0x1c8(%rsp), %rcx
callq 0x7e30
leaq 0x30(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x242a
leaq 0xf8(%rsp), %rdi
callq 0x358c
leaq 0x30(%rsp), %rdi
callq 0x2aaa
testb %al, %al
je 0x5f46
leaq 0x1c8(%rsp), %rsi
movl %ebx, (%rsi)
movb $0x0, 0x4(%rsi)
movl %ebx, 0x8(%rsi)
movb $0x1, 0xc(%rsi)
leaq 0xe0(%rsp), %rdi
pushq $0x2
popq %rdx
leaq 0x1a0(%rsp), %rcx
callq 0x7e30
leaq 0x60(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0x242a
leaq 0xe0(%rsp), %rdi
callq 0x358c
leaq 0x60(%rsp), %rdi
callq 0x2aaa
testb %al, %al
je 0x5f65
pushq $0x7
popq %rbx
leaq 0x1a0(%rsp), %rsi
movl %ebx, (%rsi)
movb $0x1, 0x4(%rsi)
movl %ebx, 0x8(%rsi)
movb $0x0, 0xc(%rsi)
leaq 0xc8(%rsp), %rdi
pushq $0x2
popq %rdx
leaq 0x1f0(%rsp), %rcx
callq 0x7e30
leaq 0x1c8(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x242a
leaq 0xc8(%rsp), %rdi
callq 0x358c
leaq 0x1c8(%rsp), %rdi
callq 0x2aaa
testb %al, %al
je 0x5f84
leaq 0x1f0(%rsp), %rsi
movl %ebx, (%rsi)
movb $0x0, 0x4(%rsi)
movl %ebx, 0x8(%rsi)
movb $0x1, 0xc(%rsi)
leaq 0xb0(%rsp), %rdi
pushq $0x2
popq %rdx
leaq 0x7(%rsp), %rcx
callq 0x7e30
leaq 0x1a0(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x242a
leaq 0xb0(%rsp), %rdi
callq 0x358c
leaq 0x1a0(%rsp), %rdi
callq 0x2aaa
testb %al, %al
je 0x5fa3
movq 0x8170(%rip), %rdi      # 0xdfd8
leaq 0x34fb(%rip), %rsi      # 0x936a
callq 0x2140
movq %rax, %rdi
callq 0x20b0
leaq 0x1a0(%rsp), %rdi
callq 0x3558
leaq 0x1c8(%rsp), %rdi
callq 0x3558
leaq 0x60(%rsp), %rdi
callq 0x3558
leaq 0x30(%rsp), %rdi
callq 0x3558
leaq 0x8(%rsp), %rdi
callq 0x3558
leaq 0x88(%rsp), %rdi
callq 0x3558
addq $0x200, %rsp            # imm = 0x200
popq %rbx
retq
leaq 0x35d1(%rip), %rdi      # 0x94a2
leaq 0x33b5(%rip), %rsi      # 0x928d
leaq 0x35d9(%rip), %rcx      # 0x94b8
movl $0x103, %edx            # imm = 0x103
callq 0x20e0
leaq 0x35b3(%rip), %rdi      # 0x94a3
leaq 0x3396(%rip), %rsi      # 0x928d
leaq 0x35ba(%rip), %rcx      # 0x94b8
movl $0x105, %edx            # imm = 0x105
callq 0x20e0
leaq 0x35c0(%rip), %rdi      # 0x94cf
leaq 0x3377(%rip), %rsi      # 0x928d
leaq 0x359b(%rip), %rcx      # 0x94b8
movl $0x109, %edx            # imm = 0x109
callq 0x20e0
leaq 0x35a2(%rip), %rdi      # 0x94d0
leaq 0x3358(%rip), %rsi      # 0x928d
leaq 0x357c(%rip), %rcx      # 0x94b8
movl $0x10b, %edx            # imm = 0x10B
callq 0x20e0
leaq 0x3598(%rip), %rdi      # 0x94e5
leaq 0x3339(%rip), %rsi      # 0x928d
leaq 0x355d(%rip), %rcx      # 0x94b8
movl $0x110, %edx            # imm = 0x110
callq 0x20e0
leaq 0x358e(%rip), %rdi      # 0x94fa
leaq 0x331a(%rip), %rsi      # 0x928d
leaq 0x353e(%rip), %rcx      # 0x94b8
movl $0x113, %edx            # imm = 0x113
callq 0x20e0
leaq 0x3584(%rip), %rdi      # 0x950f
leaq 0x32fb(%rip), %rsi      # 0x928d
leaq 0x351f(%rip), %rcx      # 0x94b8
movl $0x116, %edx            # imm = 0x116
callq 0x20e0
leaq 0x357a(%rip), %rdi      # 0x9524
leaq 0x32dc(%rip), %rsi      # 0x928d
leaq 0x3500(%rip), %rcx      # 0x94b8
movl $0x119, %edx            # imm = 0x119
callq 0x20e0
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x358c
jmp 0x60b2
jmp 0x5fd9
movq %rax, %rbx
jmp 0x60b2
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0x358c
jmp 0x60bf
jmp 0x5ff8
movq %rax, %rbx
jmp 0x60bf
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0x358c
jmp 0x60c9
jmp 0x6017
movq %rax, %rbx
jmp 0x60c9
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
jmp 0x604e
jmp 0x60d5
movq %rax, %rbx
leaq 0x110(%rsp), %rdi
callq 0x358c
jmp 0x6046
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0x358c
jmp 0x60d8
movq %rax, %rbx
leaq 0x140(%rsp), %rdi
jmp 0x6084
jmp 0x60e4
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
callq 0x358c
jmp 0x607c
movq %rax, %rbx
leaq 0x170(%rsp), %rdi
callq 0x358c
jmp 0x60e7
movq %rax, %rbx
leaq 0x188(%rsp), %rdi
callq 0x358c
jmp 0x60f4
movq %rax, %rbx
jmp 0x60f4
movq %rax, %rbx
leaq 0x1a0(%rsp), %rdi
callq 0x3558
leaq 0x1c8(%rsp), %rdi
callq 0x3558
leaq 0x60(%rsp), %rdi
callq 0x3558
leaq 0x30(%rsp), %rdi
callq 0x3558
jmp 0x60d8
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3558
jmp 0x60e7
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x3558
movq %rbx, %rdi
callq 0x21c0