// File: chuckwolber[P]Cube/test/test_algorithm.cpp
// Function: test_constructors()
void test_constructors() {
    std::cout << "Testing constructors... ";

    std::vector<Turn> init_alg = {{Layer::D,  true}, 
                                  {Layer::F, false}, 
                                  {Layer::R, false}};

    Algorithm alg1;
    assert(alg1.getAlgorithm().size() == 1);

    Algorithm alg2(init_alg);
    assert(alg2.getAlgorithm().size() == init_alg.size());
    verify_turns(init_alg, alg2.getAlgorithm());

    Algorithm alg3(alg2);
    assert(alg3.getAlgorithm().size() == init_alg.size());
    verify_turns(init_alg, alg3.getAlgorithm());

    alg2.reset();
    assert(alg3 != alg2);

    Algorithm alg4 = alg3;
    assert(alg4.getAlgorithm().size() == init_alg.size());
    verify_turns(init_alg, alg4.getAlgorithm());

    alg3.reset();
    assert(alg4 != alg3);

    alg3 = alg2;
    assert(alg3 == alg2);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x240, %rsp            # imm = 0x240
movq 0xbfd6(%rip), %rdi      # 0x15fd8
leaq 0x6297(%rip), %rsi      # 0x102a0
callq 0x2190
movups 0x69fb(%rip), %xmm0     # 0x10a10
movaps %xmm0, -0x40(%rbp)
movq $0x6, -0x30(%rbp)
leaq -0x40(%rbp), %rax
movq %rax, -0x28(%rbp)
movq $0x3, -0x20(%rbp)
leaq -0x41(%rbp), %rdi
movq %rdi, -0x208(%rbp)
callq 0x51f0
movq -0x208(%rbp), %rcx
movq -0x28(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x18(%rbp), %rdi
callq 0xf130
jmp 0xa05b
leaq -0x41(%rbp), %rdi
callq 0x54d0
leaq -0x80(%rbp), %rdi
callq 0x2420
jmp 0xa06f
leaq -0x98(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x33e0
jmp 0xa081
leaq -0x98(%rbp), %rdi
callq 0x5410
cmpq $0x1, %rax
jne 0xa095
jmp 0xa0f0
leaq 0x621d(%rip), %rdi      # 0x102b9
leaq 0x6236(%rip), %rsi      # 0x102d9
movl $0x45, %edx
leaq 0x623d(%rip), %rcx      # 0x102ec
callq 0x2100
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x41(%rbp), %rdi
callq 0x54d0
jmp 0xa640
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xa637
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xa62e
leaq -0x98(%rbp), %rdi
callq 0x4920
leaq -0xd8(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x4830
jmp 0xa10e
leaq -0xc0(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x2630
jmp 0xa123
leaq -0xd8(%rbp), %rdi
callq 0x4920
leaq -0xf0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x33e0
jmp 0xa144
leaq -0xf0(%rbp), %rdi
callq 0x5410
movq %rax, -0x210(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x5410
movq %rax, %rcx
movq -0x210(%rbp), %rax
cmpq %rcx, %rax
jne 0xa171
jmp 0xa1be
leaq 0x618d(%rip), %rdi      # 0x10305
leaq 0x615a(%rip), %rsi      # 0x102d9
movl $0x48, %edx
leaq 0x6161(%rip), %rcx      # 0x102ec
callq 0x2100
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x4920
jmp 0xa62e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xa622
leaq -0xf0(%rbp), %rdi
callq 0x4920
leaq -0x108(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x4830
jmp 0xa1dc
leaq -0x120(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x33e0
jmp 0xa1f1
leaq -0x108(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0xecb0
jmp 0xa206
leaq -0x120(%rbp), %rdi
callq 0x4920
leaq -0x108(%rbp), %rdi
callq 0x4920
leaq -0x148(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x2770
jmp 0xa233
leaq -0x160(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x33e0
jmp 0xa248
leaq -0x160(%rbp), %rdi
callq 0x5410
movq %rax, -0x218(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x5410
movq %rax, %rcx
movq -0x218(%rbp), %rax
cmpq %rcx, %rax
jne 0xa275
jmp 0xa2dc
leaq 0x60b7(%rip), %rdi      # 0x10333
leaq 0x6056(%rip), %rsi      # 0x102d9
movl $0x4c, %edx
leaq 0x605d(%rip), %rcx      # 0x102ec
callq 0x2100
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xa2ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x4920
leaq -0x108(%rbp), %rdi
callq 0x4920
jmp 0xa622
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xa616
leaq -0x160(%rbp), %rdi
callq 0x4920
leaq -0x178(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x4830
jmp 0xa2fa
leaq -0x190(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x33e0
jmp 0xa30f
leaq -0x178(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0xecb0
jmp 0xa324
leaq -0x190(%rbp), %rdi
callq 0x4920
leaq -0x178(%rbp), %rdi
callq 0x4920
leaq -0xc0(%rbp), %rdi
callq 0x3030
jmp 0xa34a
leaq -0x148(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x2c30
movb %al, -0x219(%rbp)
jmp 0xa365
movb -0x219(%rbp), %al
testb $0x1, %al
jne 0xa371
jmp 0xa373
jmp 0xa3c9
leaq 0x5fe7(%rip), %rdi      # 0x10361
leaq 0x5f58(%rip), %rsi      # 0x102d9
movl $0x50, %edx
leaq 0x5f5f(%rip), %rcx      # 0x102ec
callq 0x2100
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xa3b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x4920
leaq -0x178(%rbp), %rdi
callq 0x4920
jmp 0xa616
leaq -0x1b8(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x2770
jmp 0xa3de
leaq -0x1d0(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x33e0
jmp 0xa3f3
leaq -0x1d0(%rbp), %rdi
callq 0x5410
movq %rax, -0x228(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x5410
movq %rax, %rcx
movq -0x228(%rbp), %rax
cmpq %rcx, %rax
jne 0xa420
jmp 0xa450
leaq 0x5f47(%rip), %rdi      # 0x1036e
leaq 0x5eab(%rip), %rsi      # 0x102d9
movl $0x53, %edx
leaq 0x5eb2(%rip), %rcx      # 0x102ec
callq 0x2100
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xa60a
leaq -0x1d0(%rbp), %rdi
callq 0x4920
leaq -0x1e8(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x4830
jmp 0xa46e
leaq -0x200(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x33e0
jmp 0xa483
leaq -0x1e8(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0xecb0
jmp 0xa498
leaq -0x200(%rbp), %rdi
callq 0x4920
leaq -0x1e8(%rbp), %rdi
callq 0x4920
leaq -0x148(%rbp), %rdi
callq 0x3030
jmp 0xa4be
leaq -0x1b8(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x2c30
movb %al, -0x229(%rbp)
jmp 0xa4d9
movb -0x229(%rbp), %al
testb $0x1, %al
jne 0xa4e5
jmp 0xa4e7
jmp 0xa53d
leaq 0x5eae(%rip), %rdi      # 0x1039c
leaq 0x5de4(%rip), %rsi      # 0x102d9
movl $0x57, %edx
leaq 0x5deb(%rip), %rcx      # 0x102ec
callq 0x2100
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xa52c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x4920
leaq -0x1e8(%rbp), %rdi
callq 0x4920
jmp 0xa60a
leaq -0x148(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x2980
jmp 0xa552
leaq -0x148(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x2c00
movb %al, -0x22a(%rbp)
jmp 0xa56d
movb -0x22a(%rbp), %al
testb $0x1, %al
jne 0xa579
jmp 0xa57b
jmp 0xa59a
leaq 0x5e27(%rip), %rdi      # 0x103a9
leaq 0x5d50(%rip), %rsi      # 0x102d9
movl $0x5a, %edx
leaq 0x5d57(%rip), %rcx      # 0x102ec
callq 0x2100
movq 0xba37(%rip), %rdi      # 0x15fd8
leaq 0x5e0e(%rip), %rsi      # 0x103b6
callq 0x2190
movq %rax, -0x238(%rbp)
jmp 0xa5b6
movq -0x238(%rbp), %rdi
movq 0xba04(%rip), %rsi      # 0x15fc8
callq 0x21c0
jmp 0xa5cb
leaq -0x1b8(%rbp), %rdi
callq 0x4bd0
leaq -0x148(%rbp), %rdi
callq 0x4bd0
leaq -0xc0(%rbp), %rdi
callq 0x4bd0
leaq -0x80(%rbp), %rdi
callq 0x4bd0
leaq -0x18(%rbp), %rdi
callq 0x4920
addq $0x240, %rsp            # imm = 0x240
popq %rbp
retq
leaq -0x1b8(%rbp), %rdi
callq 0x4bd0
leaq -0x148(%rbp), %rdi
callq 0x4bd0
leaq -0xc0(%rbp), %rdi
callq 0x4bd0
leaq -0x80(%rbp), %rdi
callq 0x4bd0
leaq -0x18(%rbp), %rdi
callq 0x4920
movq -0x50(%rbp), %rdi
callq 0x22a0
nopl (%rax)