// File: /workspace/github_cpp_makefile_star2_O1/diegofilbal[P]YourJam/src/playlist.cpp
// Function: Playlist::operator-(Musica const&) const
Playlist* Playlist::operator-(Musica const &musica) const{

    // Insere todas as músicas da playlist local utilizando o método sobrecarregado de inserção
    Playlist* playlist_final = new Playlist(*this);

    if(playlist_final->getLista()->buscaMusica(musica)){ // Verifica se a música recebida por parâmetro está na playlist
        for(int i = 0; i < playlist_final->getLista()->getTamanho(); i++){ // Percorre a lista e procura a posição em que a música a ser removida está posicionada
            if(playlist_final->getLista()->buscaMusicaPos(i)->getNome() == musica.getNome() && playlist_final->getLista()->buscaMusicaPos(i)->getArtista() == musica.getArtista()){
                playlist_final->remove(i); // Remove a música
            }
        }
    }

    return playlist_final;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %r14
movq %rdi, %r15
movl $0x30, %edi
callq 0x2110
movq %rax, %rbx
movq %rax, %rdi
movq %r15, %rsi
callq 0x107b8
movq 0x20(%rbx), %r15
leaq -0xd8(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0xe8(%rbp), %rdi
callq 0x38da
leaq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
movq %rax, -0x10(%rax)
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
addq %rsi, %rdx
callq 0x38da
leaq -0xe8(%rbp), %rsi
movq %r15, %rdi
callq 0x32b8
movq %rax, %r15
leaq -0xe8(%rbp), %rdi
callq 0x10692
testq %r15, %r15
je 0x110d8
movq 0x20(%rbx), %rdi
callq 0x2c08
testl %eax, %eax
jle 0x110d8
xorl %r15d, %r15d
movq 0x20(%rbx), %rdi
movl %r15d, %esi
callq 0x2c12
leaq -0x88(%rbp), %rdi
movq %rax, %rsi
callq 0x106c8
leaq -0x68(%rbp), %rdi
movq %r14, %rsi
callq 0x106c8
movq -0x80(%rbp), %rdx
cmpq -0x60(%rbp), %rdx
jne 0x10fed
testq %rdx, %rdx
je 0x10ff2
movq -0x68(%rbp), %rsi
movq -0x88(%rbp), %rdi
callq 0x2120
testl %eax, %eax
sete %r12b
jmp 0x10ff5
xorl %r12d, %r12d
jmp 0x10ff5
movb $0x1, %r12b
testb %r12b, %r12b
je 0x1104f
movq 0x20(%rbx), %rdi
movl %r15d, %esi
callq 0x2c12
leaq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x106fe
leaq -0xa8(%rbp), %rdi
movq %r14, %rsi
callq 0x106fe
movq -0x40(%rbp), %rdx
cmpq -0xa0(%rbp), %rdx
jne 0x1104f
testq %rdx, %rdx
je 0x110d0
movq -0xa8(%rbp), %rsi
movq -0x48(%rbp), %rdi
callq 0x2120
testl %eax, %eax
sete %r13b
jmp 0x11052
xorl %r13d, %r13d
testb %r12b, %r12b
je 0x11081
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x1106f
callq 0x20f0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x11081
callq 0x20f0
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x11093
callq 0x20f0
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x110a8
callq 0x20f0
testb %r13b, %r13b
je 0x110b9
movq 0x20(%rbx), %rdi
movl %r15d, %esi
callq 0x2f6e
incl %r15d
movq 0x20(%rbx), %rdi
callq 0x2c08
cmpl %eax, %r15d
jl 0x10f9f
jmp 0x110d8
movb $0x1, %r13b
jmp 0x11052
movq %rbx, %rax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq -0xe8(%rbp), %rdi
callq 0x10692
jmp 0x1115d
movq %rax, %r14
movq -0xe8(%rbp), %rdi
cmpq %r12, %rdi
jne 0x11158
jmp 0x1115d
movq %rax, %r14
movq %rbx, %rdi
jmp 0x11158
movq %rax, %r14
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x11136
callq 0x20f0
jmp 0x11136
movq %rax, %r14
jmp 0x11148
movq %rax, %r14
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x11148
callq 0x20f0
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x1115d
callq 0x20f0
movq %r14, %rdi
callq 0x21a0
nop