// File: /workspace/github_cpp_makefile_star2_O3/lorenatoscano[P]musify/src/linkedList.cpp
// Function: LinkedList::getPosition(Song)
size_t LinkedList::getPosition(Song searchSong) {
  node* temp = head;
  size_t pos = 1;

  while (temp != nullptr) {
    Song s = temp->data;

    // Compara os títulos e artistas desconsiderando maiúsculas
    if ( toLowercase(s.getTitle()) == toLowercase(searchSong.getTitle()) && 
        toLowercase(s.getArtist()) == toLowercase(searchSong.getArtist()) ) {
      // Retorna a posição correspondente
      return pos; 
    }

    temp = temp->next;
    ++pos;
  }
  // Caso não encontre, retorna 0
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rsi, -0x30(%rbp)
movq (%rdi), %r15
testq %r15, %r15
je 0x347c
movl $0x1, %r14d
leaq -0x80(%rbp), %r13
leaq -0x170(%rbp), %r12
leaq -0x90(%rbp), %rbx
leaq -0x160(%rbp), %rax
movq %rax, -0x170(%rbp)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x377e
leaq -0x140(%rbp), %rax
movq %rax, -0x150(%rbp)
movq 0x20(%r15), %rsi
movq 0x28(%r15), %rdx
addq %rsi, %rdx
leaq -0x150(%rbp), %rdi
callq 0x377e
movq %rbx, %rdi
movq %r12, %rsi
callq 0x99bc
leaq -0xb0(%rbp), %rdi
movq %rbx, %rsi
callq 0x9a30
leaq -0x130(%rbp), %rbx
movq %rbx, %rdi
movq -0x30(%rbp), %rsi
callq 0x99bc
leaq -0x70(%rbp), %rdi
movq %rbx, %rsi
callq 0x9a30
movq -0xa8(%rbp), %rdx
cmpq -0x68(%rbp), %rdx
jne 0x332c
testq %rdx, %rdx
je 0x3333
movq -0x70(%rbp), %rsi
movq -0xb0(%rbp), %rdi
callq 0x2110
testl %eax, %eax
je 0x3333
xorl %ebx, %ebx
jmp 0x3406
leaq -0x110(%rbp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x99e8
leaq -0x50(%rbp), %rdi
movq %rbx, %rsi
callq 0x9a30
leaq -0xd0(%rbp), %rbx
movq %rbx, %rdi
movq -0x30(%rbp), %rsi
callq 0x99e8
leaq -0xf0(%rbp), %rdi
movq %rbx, %rsi
callq 0x9a30
movq -0x48(%rbp), %rdx
cmpq -0xe8(%rbp), %rdx
jne 0x339f
movq -0xf0(%rbp), %r13
testq %rdx, %rdx
je 0x33aa
movq -0x50(%rbp), %rdi
movq %r13, %rsi
callq 0x2110
testl %eax, %eax
sete %bl
jmp 0x33ac
movq -0xf0(%rbp), %r13
xorl %ebx, %ebx
jmp 0x33ac
movb $0x1, %bl
leaq -0xe0(%rbp), %rax
cmpq %rax, %r13
je 0x33c0
movq %r13, %rdi
callq 0x20e0
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0x33d8
callq 0x20e0
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
leaq -0x80(%rbp), %r13
je 0x33ee
callq 0x20e0
movq -0x110(%rbp), %rdi
leaq -0x100(%rbp), %rax
cmpq %rax, %rdi
je 0x3406
callq 0x20e0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x3418
callq 0x20e0
movq -0x130(%rbp), %rdi
leaq -0x120(%rbp), %rax
cmpq %rax, %rdi
je 0x3430
callq 0x20e0
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x3448
callq 0x20e0
movq -0x90(%rbp), %rdi
cmpq %r13, %rdi
je 0x3459
callq 0x20e0
testb %bl, %bl
jne 0x3481
movq 0x40(%r15), %r15
incq %r14
movq %r12, %rdi
callq 0x9986
testq %r15, %r15
leaq -0x90(%rbp), %rbx
jne 0x3288
xorl %r14d, %r14d
jmp 0x348d
leaq -0x170(%rbp), %rdi
callq 0x9986
movq %r14, %rax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0x34c2
callq 0x20e0
jmp 0x34c2
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x34d9
callq 0x20e0
jmp 0x34d9
movq %rax, %rbx
movq -0x110(%rbp), %rdi
leaq -0x100(%rbp), %rax
cmpq %rax, %rdi
je 0x34f6
callq 0x20e0
jmp 0x34f6
movq %rax, %rbx
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x350d
callq 0x20e0
jmp 0x350d
movq %rax, %rbx
movq -0x130(%rbp), %rdi
leaq -0x120(%rbp), %rax
cmpq %rax, %rdi
je 0x354c
callq 0x20e0
jmp 0x354c
movq %rax, %rbx
jmp 0x3564
movq %rax, %rbx
movq -0x170(%rbp), %rdi
leaq -0x160(%rbp), %rax
cmpq %rax, %rdi
je 0x358a
callq 0x20e0
jmp 0x358a
movq %rax, %rbx
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x3564
callq 0x20e0
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x357e
callq 0x20e0
jmp 0x357e
movq %rax, %rbx
leaq -0x170(%rbp), %rdi
callq 0x9986
movq %rbx, %rdi
callq 0x2170