// File: /workspace/github_cpp_makefile_star2_O2/Wombozo[P]harmony/src/Triad.cpp
// Function: Triad::Triad(Note*, std::vector<Interval, std::allocator<Interval>>)
Triad::Triad(Note *n, std::vector<Interval> ints) : root(n), bass(n), inversion(0)
{
    std::string str;
    if (ints.size() < 2)
        throw E_CHORD_UNKNOWN;
    
    intervals = {ints.at(0), ints.at(1)};
    if (!ints.at(0).getName().compare("major third") && !ints.at(1).getName().compare("perfect fifth"))
    {
        str = triads[0];
    }
    else if (!ints.at(0).getName().compare("minor third") && !ints.at(1).getName().compare("perfect fifth"))
    {
        str = triads[1];
    }
    else if (!ints.at(0).getName().compare("major third") && !ints.at(1).getName().compare("augmtented fifth"))
    {
        str = triads[2];
    }
    else if (!ints.at(0).getName().compare("minor third") && !ints.at(1).getName().compare("diminished fifth"))
    {
        str = triads[3];
    }
    else if (!ints.at(0).getName().compare("perfect fourth") && !ints.at(1).getName().compare("perfect fifth"))
    {
        str = triads[4];
    }
    else if (!ints.at(0).getName().compare("major second") && !ints.at(1).getName().compare("perfect fifth"))
    {
        str = triads[5];
    }
    else if (!ints.at(0).getName().compare("major third") && !ints.at(1).getName().compare("diminished fifth"))
    {
        str = triads[6];
    }
    else if (!ints.at(0).getName().compare("minor third") && !ints.at(1).getName().compare("augmented fifth"))
    {
        str = triads[7];
    }
    else
        throw E_CHORD_UNKNOWN;
    _setNotes(this, &ints);
    name = n->display() + str;
    typeName = str;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdx, %rbx
movq %rdi, %r14
movq %rsi, (%rdi)
movq %rsi, 0x8(%rdi)
leaq 0x10(%rdi), %rax
movq %rax, -0xa8(%rbp)
leaq 0x20(%rdi), %rax
movq %rax, 0x10(%rdi)
andq $0x0, 0x18(%rdi)
xorl %eax, %eax
movb %al, 0x20(%rdi)
leaq 0x40(%rdi), %rcx
movq %rcx, 0x30(%rdi)
andq $0x0, 0x38(%rdi)
movb %al, 0x40(%rdi)
andl $0x0, 0x50(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x58(%rdi)
movups %xmm0, 0x68(%rdi)
movups %xmm0, 0x78(%rdi)
leaq -0xc0(%rbp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
leaq 0x30(%rdi), %rdx
movq %rdx, -0xa0(%rbp)
leaq 0x58(%rdi), %rdx
movq %rdx, -0xb0(%rbp)
movb %al, (%rcx)
movq 0x8(%rbx), %rax
subq (%rbx), %rax
pushq $0x28
popq %r15
cqto
idivq %r15
cmpq $0x2, %rax
jb 0x9ade
movq %rsi, %r13
movq %rbx, %rdi
xorl %esi, %esi
callq 0x7e02
leaq -0x98(%rbp), %rdi
movq %rax, %rsi
callq 0x7e20
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x7e02
leaq -0x70(%rbp), %rdi
movq %rax, %rsi
callq 0x7e20
leaq -0x48(%rbp), %rdx
leaq -0x98(%rbp), %rsi
movq -0xb0(%rbp), %rdi
callq 0x9e80
leaq (%r15,%rbp), %rdi
addq $-0x98, %rdi
callq 0x6ab4
addq $-0x28, %r15
cmpq $-0x28, %r15
jne 0x95a9
movq %rbx, %rdi
xorl %esi, %esi
callq 0x7e02
leaq -0x98(%rbp), %rdi
movq %rax, %rsi
callq 0x6abe
leaq 0x2c1a(%rip), %rsi      # 0xc1fd
leaq -0x98(%rbp), %rdi
callq 0x3080
testl %eax, %eax
je 0x9601
leaq -0x98(%rbp), %rdi
callq 0x30d0
jmp 0x964b
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x7e02
leaq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x6abe
leaq 0x2c3d(%rip), %rsi      # 0xc25c
leaq -0x48(%rbp), %r15
movq %r15, %rdi
callq 0x3080
movl %eax, %r12d
movq %r15, %rdi
callq 0x30d0
leaq -0x98(%rbp), %rdi
callq 0x30d0
testl %r12d, %r12d
je 0x9a02
movq %rbx, %rdi
xorl %esi, %esi
callq 0x7e02
leaq -0x98(%rbp), %rdi
movq %rax, %rsi
callq 0x6abe
leaq 0x2b86(%rip), %rsi      # 0xc1f1
leaq -0x98(%rbp), %rdi
callq 0x3080
testl %eax, %eax
je 0x9689
leaq -0x98(%rbp), %rdi
callq 0x30d0
jmp 0x96d3
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x7e02
leaq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x6abe
leaq 0x2bb5(%rip), %rsi      # 0xc25c
leaq -0x48(%rbp), %r15
movq %r15, %rdi
callq 0x3080
movl %eax, %r12d
movq %r15, %rdi
callq 0x30d0
leaq -0x98(%rbp), %rdi
callq 0x30d0
testl %r12d, %r12d
je 0x9a0b
movq %rbx, %rdi
xorl %esi, %esi
callq 0x7e02
leaq -0x98(%rbp), %rdi
movq %rax, %rsi
callq 0x6abe
leaq 0x2b0a(%rip), %rsi      # 0xc1fd
leaq -0x98(%rbp), %rdi
callq 0x3080
testl %eax, %eax
je 0x9711
leaq -0x98(%rbp), %rdi
callq 0x30d0
jmp 0x975b
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x7e02
leaq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x6abe
leaq 0x2d39(%rip), %rsi      # 0xc468
leaq -0x48(%rbp), %r15
movq %r15, %rdi
callq 0x3080
movl %eax, %r12d
movq %r15, %rdi
callq 0x30d0
leaq -0x98(%rbp), %rdi
callq 0x30d0
testl %r12d, %r12d
je 0x9a14
movq %rbx, %rdi
xorl %esi, %esi
callq 0x7e02
leaq -0x98(%rbp), %rdi
movq %rax, %rsi
callq 0x6abe
leaq 0x2a76(%rip), %rsi      # 0xc1f1
leaq -0x98(%rbp), %rdi
callq 0x3080
testl %eax, %eax
je 0x9799
leaq -0x98(%rbp), %rdi
callq 0x30d0
jmp 0x97e3
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x7e02
leaq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x6abe
leaq 0x2a94(%rip), %rsi      # 0xc24b
leaq -0x48(%rbp), %r15
movq %r15, %rdi
callq 0x3080
movl %eax, %r12d
movq %r15, %rdi
callq 0x30d0
leaq -0x98(%rbp), %rdi
callq 0x30d0
testl %r12d, %r12d
je 0x9a1d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x7e02
leaq -0x98(%rbp), %rdi
movq %rax, %rsi
callq 0x6abe
leaq 0x2a28(%rip), %rsi      # 0xc22b
leaq -0x98(%rbp), %rdi
callq 0x3080
testl %eax, %eax
je 0x9821
leaq -0x98(%rbp), %rdi
callq 0x30d0
jmp 0x986b
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x7e02
leaq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x6abe
leaq 0x2a1d(%rip), %rsi      # 0xc25c
leaq -0x48(%rbp), %r15
movq %r15, %rdi
callq 0x3080
movl %eax, %r12d
movq %r15, %rdi
callq 0x30d0
leaq -0x98(%rbp), %rdi
callq 0x30d0
testl %r12d, %r12d
je 0x9a26
movq %rbx, %rdi
xorl %esi, %esi
callq 0x7e02
leaq -0x98(%rbp), %rdi
movq %rax, %rsi
callq 0x6abe
leaq 0x2937(%rip), %rsi      # 0xc1c2
leaq -0x98(%rbp), %rdi
callq 0x3080
testl %eax, %eax
je 0x98a9
leaq -0x98(%rbp), %rdi
callq 0x30d0
jmp 0x98f3
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x7e02
leaq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x6abe
leaq 0x2995(%rip), %rsi      # 0xc25c
leaq -0x48(%rbp), %r15
movq %r15, %rdi
callq 0x3080
movl %eax, %r12d
movq %r15, %rdi
callq 0x30d0
leaq -0x98(%rbp), %rdi
callq 0x30d0
testl %r12d, %r12d
je 0x9a2f
movq %rbx, %rdi
xorl %esi, %esi
callq 0x7e02
leaq -0x98(%rbp), %rdi
movq %rax, %rsi
callq 0x6abe
leaq 0x28ea(%rip), %rsi      # 0xc1fd
leaq -0x98(%rbp), %rdi
callq 0x3080
testl %eax, %eax
je 0x9931
leaq -0x98(%rbp), %rdi
callq 0x30d0
jmp 0x997b
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x7e02
leaq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x6abe
leaq 0x28fc(%rip), %rsi      # 0xc24b
leaq -0x48(%rbp), %r15
movq %r15, %rdi
callq 0x3080
movl %eax, %r12d
movq %r15, %rdi
callq 0x30d0
leaq -0x98(%rbp), %rdi
callq 0x30d0
testl %r12d, %r12d
je 0x9a38
movq %rbx, %rdi
xorl %esi, %esi
callq 0x7e02
leaq -0x98(%rbp), %rdi
movq %rax, %rsi
callq 0x6abe
leaq 0x2856(%rip), %rsi      # 0xc1f1
leaq -0x98(%rbp), %rdi
callq 0x3080
testl %eax, %eax
jne 0x9ad2
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x7e02
leaq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x6abe
leaq 0x289d(%rip), %rsi      # 0xc26a
leaq -0x48(%rbp), %r15
movq %r15, %rdi
callq 0x3080
movl %eax, %r12d
movq %r15, %rdi
callq 0x30d0
leaq -0x98(%rbp), %rdi
callq 0x30d0
testl %r12d, %r12d
jne 0x9ade
leaq 0x8b30(%rip), %rsi      # 0x12530
jmp 0x9a3f
leaq 0x8a47(%rip), %rsi      # 0x12450
jmp 0x9a3f
leaq 0x8a5e(%rip), %rsi      # 0x12470
jmp 0x9a3f
leaq 0x8a75(%rip), %rsi      # 0x12490
jmp 0x9a3f
leaq 0x8a8c(%rip), %rsi      # 0x124b0
jmp 0x9a3f
leaq 0x8aa3(%rip), %rsi      # 0x124d0
jmp 0x9a3f
leaq 0x8aba(%rip), %rsi      # 0x124f0
jmp 0x9a3f
leaq 0x8ad1(%rip), %rsi      # 0x12510
leaq -0xd0(%rbp), %rdi
callq 0x3110
movq %r14, %rdi
movq %rbx, %rsi
callq 0x9bb0
movq (%r13), %rax
leaq -0x48(%rbp), %rdi
movq %r13, %rsi
callq *(%rax)
leaq -0x98(%rbp), %rdi
leaq -0x48(%rbp), %rsi
leaq -0xd0(%rbp), %rdx
callq 0x7f1e
leaq -0x98(%rbp), %rbx
movq -0xa8(%rbp), %rdi
movq %rbx, %rsi
callq 0x31c0
movq %rbx, %rdi
callq 0x30d0
leaq -0x48(%rbp), %rdi
callq 0x30d0
leaq -0xd0(%rbp), %rsi
movq -0xa0(%rbp), %rdi
callq 0x3110
leaq -0xd0(%rbp), %rdi
callq 0x30d0
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x98(%rbp), %rdi
callq 0x30d0
pushq $0x4
popq %rdi
callq 0x30f0
movl $0x1, (%rax)
leaq 0x7d85(%rip), %rsi      # 0x11878
movq %rax, %rdi
xorl %edx, %edx
callq 0x3290
jmp 0x9b0d
jmp 0x9b0d
jmp 0x9b0d
jmp 0x9b0d
jmp 0x9b0d
jmp 0x9b0d
jmp 0x9b0d
jmp 0x9b69
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
callq 0x30d0
jmp 0x9b6c
jmp 0x9b69
jmp 0x9b69
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
jmp 0x9b17
jmp 0x9b69
movq %rax, %rbx
leaq (%r15,%rbp), %rdi
addq $-0x98, %rdi
callq 0x6ab4
addq $-0x28, %r15
cmpq $-0x28, %r15
jne 0x9b30
jmp 0x9b6c
jmp 0x9b69
jmp 0x9b69
jmp 0x9b69
jmp 0x9b69
jmp 0x9b69
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
callq 0x6ab4
jmp 0x9b6c
jmp 0x9b69
movq %rax, %rbx
addq $0x70, %r14
leaq -0xd0(%rbp), %rdi
callq 0x30d0
movq %r14, %rdi
callq 0x4d7a
movq -0xb0(%rbp), %rdi
callq 0x7d02
movq -0xa0(%rbp), %rdi
callq 0x30d0
movq -0xa8(%rbp), %rdi
callq 0x30d0
movq %rbx, %rdi
callq 0x32b0