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

    Algorithm alg_1;
    alg_1.addTurn({Layer::R, true});
    alg_1.addTurn({Layer::R, true});
    alg_1.addTurn({Layer::R, true});
    alg_1.addTurn({Layer::R, true});
    assert(alg_1.hasTriple());

    Algorithm alg_2;
    alg_2.addTurn({Layer::R, false});
    alg_2.addTurn({Layer::R, false});
    alg_2.addTurn({Layer::R, true});
    alg_2.addTurn({Layer::R, true});
    assert(!alg_2.hasTriple());
    alg_2.addTurn({Layer::R, true});
    alg_2.addTurn({Layer::F, true});
    alg_2.addTurn({Layer::U, true});
    alg_2.addTurn({Layer::B, true});
    assert(alg_2.hasTriple());

    Algorithm alg_3;
    alg_3.addTurn({Layer::R, false});
    alg_3.addTurn({Layer::U, true});
    alg_3.addTurn({Layer::R, false});
    alg_3.addTurn({Layer::B, true});
    alg_3.addTurn({Layer::R, false});
    alg_3.addTurn({Layer::F, true});
    alg_3.addTurn({Layer::U, false});
    alg_3.addTurn({Layer::B, false});
    assert(!alg_3.hasTriple());

    alg_3.addTurn({Layer::U, true});
    alg_3.addTurn({Layer::U, true});
    alg_3.addTurn({Layer::U, true});
    alg_3.addTurn({Layer::U, true});

    alg_3.addTurn({Layer::R, false});
    alg_3.addTurn({Layer::F, true});
    alg_3.addTurn({Layer::U, false});
    alg_3.addTurn({Layer::B, true});
    assert(alg_3.hasTriple());

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

// Assembly:
pushq %rbx
subq $0x80, %rsp
movq 0x7aa2(%rip), %rdi      # 0xdfd8
leaq 0x30c0(%rip), %rsi      # 0x95fd
callq 0x2140
leaq 0x58(%rsp), %rbx
movq %rbx, %rdi
callq 0x231c
movabsq $0x100000006, %rsi      # imm = 0x100000006
movq %rbx, %rdi
callq 0x235c
leaq 0x58(%rsp), %rdi
movabsq $0x100000006, %rsi      # imm = 0x100000006
callq 0x235c
leaq 0x58(%rsp), %rdi
movabsq $0x100000006, %rsi      # imm = 0x100000006
callq 0x235c
leaq 0x58(%rsp), %rdi
movabsq $0x100000006, %rsi      # imm = 0x100000006
callq 0x235c
leaq 0x58(%rsp), %rdi
callq 0x2dbe
testb %al, %al
je 0x67ee
leaq 0x30(%rsp), %rdi
callq 0x231c
leaq 0x30(%rsp), %rdi
pushq $0x6
popq %rsi
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 $0x100000006, %rsi      # imm = 0x100000006
callq 0x235c
leaq 0x30(%rsp), %rdi
callq 0x2dbe
testb %al, %al
jne 0x680d
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
movabsq $0x100000001, %rsi      # imm = 0x100000001
callq 0x235c
leaq 0x30(%rsp), %rdi
movabsq $0x100000007, %rsi      # imm = 0x100000007
callq 0x235c
leaq 0x30(%rsp), %rdi
callq 0x2dbe
testb %al, %al
je 0x682c
leaq 0x8(%rsp), %rdi
callq 0x231c
leaq 0x8(%rsp), %rdi
pushq $0x6
popq %rsi
callq 0x235c
leaq 0x8(%rsp), %rdi
movabsq $0x100000001, %rsi      # imm = 0x100000001
callq 0x235c
leaq 0x8(%rsp), %rdi
pushq $0x6
popq %rsi
callq 0x235c
leaq 0x8(%rsp), %rdi
movabsq $0x100000007, %rsi      # imm = 0x100000007
callq 0x235c
leaq 0x8(%rsp), %rdi
pushq $0x6
popq %rsi
callq 0x235c
leaq 0x8(%rsp), %rdi
movabsq $0x100000005, %rsi      # imm = 0x100000005
callq 0x235c
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0x235c
leaq 0x8(%rsp), %rdi
pushq $0x7
popq %rsi
callq 0x235c
leaq 0x8(%rsp), %rdi
callq 0x2dbe
testb %al, %al
jne 0x684b
leaq 0x8(%rsp), %rdi
movabsq $0x100000001, %rsi      # imm = 0x100000001
callq 0x235c
leaq 0x8(%rsp), %rdi
movabsq $0x100000001, %rsi      # imm = 0x100000001
callq 0x235c
leaq 0x8(%rsp), %rdi
movabsq $0x100000001, %rsi      # imm = 0x100000001
callq 0x235c
leaq 0x8(%rsp), %rdi
movabsq $0x100000001, %rsi      # imm = 0x100000001
callq 0x235c
leaq 0x8(%rsp), %rdi
pushq $0x6
popq %rsi
callq 0x235c
leaq 0x8(%rsp), %rdi
movabsq $0x100000005, %rsi      # imm = 0x100000005
callq 0x235c
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0x235c
leaq 0x8(%rsp), %rdi
movabsq $0x100000007, %rsi      # imm = 0x100000007
callq 0x235c
leaq 0x8(%rsp), %rdi
callq 0x2dbe
testb %al, %al
je 0x686a
movq 0x7825(%rip), %rdi      # 0xdfd8
leaq 0x2bb0(%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
addq $0x80, %rsp
popq %rbx
retq
leaq 0x2e1c(%rip), %rdi      # 0x9611
leaq 0x2a91(%rip), %rsi      # 0x928d
leaq 0x2e20(%rip), %rcx      # 0x9623
movl $0x159, %edx            # imm = 0x159
callq 0x20e0
leaq 0x2e23(%rip), %rdi      # 0x9637
leaq 0x2a72(%rip), %rsi      # 0x928d
leaq 0x2e01(%rip), %rcx      # 0x9623
movl $0x160, %edx            # imm = 0x160
callq 0x20e0
leaq 0x2e05(%rip), %rdi      # 0x9638
leaq 0x2a53(%rip), %rsi      # 0x928d
leaq 0x2de2(%rip), %rcx      # 0x9623
movl $0x165, %edx            # imm = 0x165
callq 0x20e0
leaq 0x2df8(%rip), %rdi      # 0x964a
leaq 0x2a34(%rip), %rsi      # 0x928d
leaq 0x2dc3(%rip), %rcx      # 0x9623
movl $0x170, %edx            # imm = 0x170
callq 0x20e0
leaq 0x2dda(%rip), %rdi      # 0x964b
leaq 0x2a15(%rip), %rsi      # 0x928d
leaq 0x2da4(%rip), %rcx      # 0x9623
movl $0x17b, %edx            # imm = 0x17B
callq 0x20e0
jmp 0x6892
jmp 0x688d
movq %rax, %rbx
jmp 0x68ae
movq %rax, %rbx
jmp 0x68a4
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3558
leaq 0x30(%rsp), %rdi
callq 0x3558
leaq 0x58(%rsp), %rdi
callq 0x3558
movq %rbx, %rdi
callq 0x21c0