// File: /workspace/github_cpp_makefile_star2_O1/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 $0x158, %rsp            # imm = 0x158
movq %rsi, -0x40(%rbp)
movq (%rdi), %r13
movl $0x1, %eax
movq %rax, -0x38(%rbp)
leaq -0x180(%rbp), %r15
leaq -0xe0(%rbp), %rbx
leaq -0xc0(%rbp), %r14
leaq -0x140(%rbp), %r12
testq %r13, %r13
je 0x34db
leaq -0x170(%rbp), %rax
movq %rax, -0x180(%rbp)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x37d8
leaq -0x150(%rbp), %rax
movq %rax, -0x160(%rbp)
movq 0x20(%r13), %rsi
movq 0x28(%r13), %rdx
addq %rsi, %rdx
leaq -0x160(%rbp), %rdi
callq 0x37d8
movq %rbx, %rdi
movq %r15, %rsi
callq 0x99fc
leaq -0xa0(%rbp), %rdi
movq %rbx, %rsi
callq 0x9a70
movq %r14, %rdi
movq -0x40(%rbp), %rsi
callq 0x99fc
leaq -0x80(%rbp), %rdi
movq %r14, %rsi
callq 0x9a70
movq -0x98(%rbp), %rdx
cmpq -0x78(%rbp), %rdx
jne 0x336c
testq %rdx, %rdx
je 0x3370
movq -0x80(%rbp), %rsi
movq -0xa0(%rbp), %rdi
callq 0x2110
testl %eax, %eax
sete %bl
jmp 0x3372
xorl %ebx, %ebx
jmp 0x3372
movb $0x1, %bl
testb %bl, %bl
je 0x33e0
movq %r12, %r14
movq %r12, %rdi
movq %r15, %rsi
callq 0x9a28
leaq -0x60(%rbp), %rdi
movq %r14, %rsi
callq 0x9a70
leaq -0x100(%rbp), %r14
movq %r14, %rdi
movq -0x40(%rbp), %rsi
callq 0x9a28
leaq -0x120(%rbp), %rdi
movq %r14, %rsi
callq 0x9a70
movq -0x58(%rbp), %rdx
cmpq -0x118(%rbp), %rdx
jne 0x33e0
testq %rdx, %rdx
je 0x34d3
movq -0x120(%rbp), %rsi
movq -0x60(%rbp), %rdi
callq 0x2110
testl %eax, %eax
sete %r14b
jmp 0x33e3
xorl %r14d, %r14d
testb %bl, %bl
je 0x3441
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x33ff
callq 0x20e0
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x3417
callq 0x20e0
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x3429
callq 0x20e0
movq -0x140(%rbp), %rdi
leaq -0x130(%rbp), %rax
cmpq %rax, %rdi
je 0x3441
callq 0x20e0
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x3453
callq 0x20e0
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x346b
callq 0x20e0
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x3483
callq 0x20e0
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x349b
callq 0x20e0
testb %r14b, %r14b
je 0x34aa
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x34b2
movq 0x40(%r13), %r13
incq -0x38(%rbp)
movq %r15, %rdi
callq 0x99c6
testb %r14b, %r14b
leaq -0xe0(%rbp), %rbx
leaq -0xc0(%rbp), %r14
je 0x32c2
jmp 0x34e3
movb $0x1, %r14b
jmp 0x33e3
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x3519
callq 0x20e0
jmp 0x3519
movq %rax, %rbx
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x3530
callq 0x20e0
jmp 0x3530
movq %rax, %rbx
movq -0x140(%rbp), %rdi
leaq -0x130(%rbp), %rax
cmpq %rax, %rdi
je 0x354d
callq 0x20e0
jmp 0x354d
movq %rax, %rbx
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x3590
callq 0x20e0
jmp 0x3590
movq %rax, %rbx
jmp 0x35d8
movq %rax, %rbx
jmp 0x35a8
movq %rax, %rbx
movq -0x180(%rbp), %rdi
leaq -0x170(%rbp), %rax
cmpq %rax, %rdi
je 0x35e4
callq 0x20e0
jmp 0x35e4
movq %rax, %rbx
jmp 0x35c0
movq %rax, %rbx
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x35a8
callq 0x20e0
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x35c0
callq 0x20e0
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x35d8
callq 0x20e0
leaq -0x180(%rbp), %rdi
callq 0x99c6
movq %rbx, %rdi
callq 0x2170