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

    Algorithm alg_1;
    alg_1.addTurn({Layer::R, true});
    alg_1.addTurn({Layer::F, true});
    alg_1.addTurn({Layer::R, false});
    assert(!alg_1.hasHiddenInversion());

    Algorithm alg_2;
    alg_2.addTurn({Layer::R, true});
    alg_2.addTurn({Layer::L, true});
    alg_2.addTurn({Layer::R, false});
    assert(alg_2.hasHiddenInversion());

    Algorithm alg_3;
    alg_3.addTurn({Layer::R, true});
    alg_3.addTurn({Layer::L, true});
    alg_3.addTurn({Layer::L, true});
    alg_3.addTurn({Layer::R, false});
    assert(alg_3.hasHiddenInversion());

    Algorithm alg_4;
    alg_4.addTurn({Layer::R, true});
    alg_4.addTurn({Layer::F, true});
    alg_4.addTurn({Layer::R, false});
    alg_4.addTurn({Layer::R, true});
    alg_4.addTurn({Layer::L, true});
    alg_4.addTurn({Layer::L, true});
    alg_4.addTurn({Layer::R, false});
    alg_4.addTurn({Layer::R, true});
    alg_4.addTurn({Layer::F, true});
    alg_4.addTurn({Layer::R, false});
    assert(alg_4.hasHiddenInversion());

    Algorithm alg_5;
    alg_5.addTurn({Layer::R, true});
    alg_5.addTurn({Layer::F, true});
    alg_5.addTurn({Layer::R, false});
    alg_5.addTurn({Layer::R, true});
    alg_5.addTurn({Layer::L, true});
    alg_5.addTurn({Layer::L, false});
    alg_5.addTurn({Layer::R, false});
    alg_5.addTurn({Layer::R, true});
    alg_5.addTurn({Layer::F, true});
    alg_5.addTurn({Layer::R, false});
    assert(alg_5.hasHiddenInversion());

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

// Assembly:
pushq %rbx
subq $0xd0, %rsp
movq 0x7ecd(%rip), %rdi      # 0xdfd8
leaq 0x3427(%rip), %rsi      # 0x9539
callq 0x2140
leaq 0xa8(%rsp), %rbx
movq %rbx, %rdi
callq 0x231c
movabsq $0x100000006, %rsi      # imm = 0x100000006
movq %rbx, %rdi
callq 0x235c
leaq 0xa8(%rsp), %rdi
movabsq $0x100000005, %rsi      # imm = 0x100000005
callq 0x235c
leaq 0xa8(%rsp), %rdi
pushq $0x6
popq %rsi
callq 0x235c
leaq 0xa8(%rsp), %rdi
callq 0x2b78
testb %al, %al
jne 0x642d
leaq 0x80(%rsp), %rdi
callq 0x231c
leaq 0x80(%rsp), %rdi
movabsq $0x100000006, %rsi      # imm = 0x100000006
callq 0x235c
leaq 0x80(%rsp), %rdi
movabsq $0x100000004, %rsi      # imm = 0x100000004
callq 0x235c
leaq 0x80(%rsp), %rdi
pushq $0x6
popq %rsi
callq 0x235c
leaq 0x80(%rsp), %rdi
callq 0x2b78
testb %al, %al
je 0x644c
leaq 0x58(%rsp), %rdi
callq 0x231c
leaq 0x58(%rsp), %rdi
movabsq $0x100000006, %rsi      # imm = 0x100000006
callq 0x235c
leaq 0x58(%rsp), %rdi
movabsq $0x100000004, %rsi      # imm = 0x100000004
callq 0x235c
leaq 0x58(%rsp), %rdi
movabsq $0x100000004, %rsi      # imm = 0x100000004
callq 0x235c
leaq 0x58(%rsp), %rdi
pushq $0x6
popq %rsi
callq 0x235c
leaq 0x58(%rsp), %rdi
callq 0x2b78
testb %al, %al
je 0x646b
leaq 0x30(%rsp), %rdi
callq 0x231c
leaq 0x30(%rsp), %rdi
movabsq $0x100000006, %rsi      # imm = 0x100000006
callq 0x235c
leaq 0x30(%rsp), %rdi
movabsq $0x100000005, %rsi      # imm = 0x100000005
callq 0x235c
leaq 0x30(%rsp), %rdi
pushq $0x6
popq %rsi
callq 0x235c
leaq 0x30(%rsp), %rdi
movabsq $0x100000006, %rsi      # imm = 0x100000006
callq 0x235c
leaq 0x30(%rsp), %rdi
movabsq $0x100000004, %rsi      # imm = 0x100000004
callq 0x235c
leaq 0x30(%rsp), %rdi
movabsq $0x100000004, %rsi      # imm = 0x100000004
callq 0x235c
leaq 0x30(%rsp), %rdi
pushq $0x6
popq %rsi
callq 0x235c
leaq 0x30(%rsp), %rdi
movabsq $0x100000006, %rsi      # imm = 0x100000006
callq 0x235c
leaq 0x30(%rsp), %rdi
movabsq $0x100000005, %rsi      # imm = 0x100000005
callq 0x235c
leaq 0x30(%rsp), %rdi
pushq $0x6
popq %rsi
callq 0x235c
leaq 0x30(%rsp), %rdi
callq 0x2b78
testb %al, %al
je 0x648a
leaq 0x8(%rsp), %rdi
callq 0x231c
leaq 0x8(%rsp), %rdi
movabsq $0x100000006, %rsi      # imm = 0x100000006
callq 0x235c
leaq 0x8(%rsp), %rdi
movabsq $0x100000005, %rsi      # imm = 0x100000005
callq 0x235c
leaq 0x8(%rsp), %rdi
pushq $0x6
popq %rsi
callq 0x235c
leaq 0x8(%rsp), %rdi
movabsq $0x100000006, %rsi      # imm = 0x100000006
callq 0x235c
leaq 0x8(%rsp), %rdi
movabsq $0x100000004, %rsi      # imm = 0x100000004
callq 0x235c
leaq 0x8(%rsp), %rdi
pushq $0x4
popq %rsi
callq 0x235c
leaq 0x8(%rsp), %rdi
pushq $0x6
popq %rsi
callq 0x235c
leaq 0x8(%rsp), %rdi
movabsq $0x100000006, %rsi      # imm = 0x100000006
callq 0x235c
leaq 0x8(%rsp), %rdi
movabsq $0x100000005, %rsi      # imm = 0x100000005
callq 0x235c
leaq 0x8(%rsp), %rdi
pushq $0x6
popq %rsi
callq 0x235c
leaq 0x8(%rsp), %rdi
callq 0x2b78
testb %al, %al
je 0x64a9
movq 0x7c00(%rip), %rdi      # 0xdfd8
leaq 0x2f8b(%rip), %rsi      # 0x936a
callq 0x2140
movq %rax, %rdi
callq 0x20b0
leaq 0x8(%rsp), %rdi
callq 0x3558
leaq 0x30(%rsp), %rdi
callq 0x3558
leaq 0x58(%rsp), %rdi
callq 0x3558
leaq 0x80(%rsp), %rdi
callq 0x3558
leaq 0xa8(%rsp), %rdi
callq 0x3558
addq $0xd0, %rsp
popq %rbx
retq
leaq 0x3123(%rip), %rdi      # 0x9557
leaq 0x2e52(%rip), %rsi      # 0x928d
leaq 0x3131(%rip), %rcx      # 0x9573
movl $0x125, %edx            # imm = 0x125
callq 0x20e0
leaq 0x313e(%rip), %rdi      # 0x9591
leaq 0x2e33(%rip), %rsi      # 0x928d
leaq 0x3112(%rip), %rcx      # 0x9573
movl $0x12b, %edx            # imm = 0x12B
callq 0x20e0
leaq 0x313a(%rip), %rdi      # 0x95ac
leaq 0x2e14(%rip), %rsi      # 0x928d
leaq 0x30f3(%rip), %rcx      # 0x9573
movl $0x132, %edx            # imm = 0x132
callq 0x20e0
leaq 0x3136(%rip), %rdi      # 0x95c7
leaq 0x2df5(%rip), %rsi      # 0x928d
leaq 0x30d4(%rip), %rcx      # 0x9573
movl $0x13f, %edx            # imm = 0x13F
callq 0x20e0
leaq 0x3132(%rip), %rdi      # 0x95e2
leaq 0x2dd6(%rip), %rsi      # 0x928d
leaq 0x30b5(%rip), %rcx      # 0x9573
movl $0x14c, %edx            # imm = 0x14C
callq 0x20e0
jmp 0x64df
jmp 0x64da
jmp 0x64d0
jmp 0x64d5
movq %rax, %rbx
jmp 0x6505
movq %rax, %rbx
jmp 0x6512
movq %rax, %rbx
jmp 0x64fb
movq %rax, %rbx
jmp 0x64f1
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3558
leaq 0x30(%rsp), %rdi
callq 0x3558
leaq 0x58(%rsp), %rdi
callq 0x3558
leaq 0x80(%rsp), %rdi
callq 0x3558
leaq 0xa8(%rsp), %rdi
callq 0x3558
movq %rbx, %rdi
callq 0x21c0