// File: joao18araujo[P]pierluigi/src/song_reader.cpp
// Function: SongReader::string_to_scale(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Scale SongReader::string_to_scale(string line){
  if(!regex_match(line, regex("\\\\key [a-g] \\\\(major|minor)")))
    return Scale();

  stringstream scale_line(line);
  string identificator, key, mode;
  scale_line >> identificator >> key >> mode;
  mode.erase(mode.begin());
  return Scale(key, mode);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x370, %rsp            # imm = 0x370
movq %rsi, -0x318(%rbp)
movq %rdi, -0x328(%rbp)
movq %rdi, %rax
movq %rax, -0x320(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x31dc0(%rip), %rsi     # 0x60762
leaq -0x30(%rbp), %rdi
movq %rdi, -0x310(%rbp)
movl $0x10, %edx
callq 0x2fab0
movq -0x318(%rbp), %rdi
movq -0x310(%rbp), %rsi
xorl %edx, %edx
callq 0x2fa60
movb %al, -0x301(%rbp)
jmp 0x2e9d4
movb -0x301(%rbp), %al
xorb $-0x1, %al
movb %al, -0x329(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x2fb50
movb -0x329(%rbp), %al
testb $0x1, %al
jne 0x2e9f7
jmp 0x2ea22
movq -0x328(%rbp), %rdi
callq 0x26500
jmp 0x2ecd9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x2fb50
jmp 0x2ece9
movl $0x10, %edi
movl $0x8, %esi
callq 0x20d40
movq -0x318(%rbp), %rsi
movl %eax, %edx
leaq -0x1c8(%rbp), %rdi
movq %rdi, -0x348(%rbp)
callq 0x6710
leaq -0x1e8(%rbp), %rdi
movq %rdi, -0x340(%rbp)
callq 0x6650
leaq -0x208(%rbp), %rdi
callq 0x6650
leaq -0x228(%rbp), %rdi
callq 0x6650
movq -0x348(%rbp), %rdi
movq -0x340(%rbp), %rsi
callq 0x65e0
movq %rax, -0x338(%rbp)
jmp 0x2ea94
movq -0x338(%rbp), %rdi
leaq -0x208(%rbp), %rsi
callq 0x65e0
movq %rax, -0x350(%rbp)
jmp 0x2eab0
movq -0x350(%rbp), %rdi
leaq -0x228(%rbp), %rsi
callq 0x65e0
jmp 0x2eac5
leaq -0x228(%rbp), %rdi
movq %rdi, -0x360(%rbp)
callq 0x63f0
movq %rax, -0x238(%rbp)
leaq -0x230(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0x24050
movq -0x360(%rbp), %rdi
movq -0x230(%rbp), %rsi
callq 0x6590
movq %rax, -0x358(%rbp)
jmp 0x2eb0e
movq -0x358(%rbp), %rax
movq %rax, -0x240(%rbp)
leaq -0x2b8(%rbp), %rdi
leaq -0x208(%rbp), %rsi
callq 0x61f0
jmp 0x2eb31
leaq -0x2d9(%rbp), %rdi
movq %rdi, -0x368(%rbp)
callq 0x6830
movq -0x368(%rbp), %rdx
leaq 0x31c80(%rip), %rsi     # 0x607d2
leaq -0x2d8(%rbp), %rdi
callq 0xfb20
jmp 0x2eb60
leaq -0x298(%rbp), %rdi
leaq -0x2b8(%rbp), %rsi
leaq -0x2d8(%rbp), %rdx
xorl %r9d, %r9d
movl %r9d, %ecx
movl %r9d, %r8d
callq 0x22ac0
jmp 0x2eb85
leaq -0x300(%rbp), %rdi
leaq -0x228(%rbp), %rsi
callq 0x61f0
jmp 0x2eb9a
movq -0x328(%rbp), %rdi
leaq -0x298(%rbp), %rsi
leaq -0x300(%rbp), %rdx
callq 0x26990
jmp 0x2ebb6
leaq -0x300(%rbp), %rdi
callq 0x62d0
leaq -0x298(%rbp), %rdi
callq 0xfd80
leaq -0x2d8(%rbp), %rdi
callq 0x62d0
leaq -0x2d9(%rbp), %rdi
callq 0x64f0
leaq -0x2b8(%rbp), %rdi
callq 0x62d0
leaq -0x228(%rbp), %rdi
callq 0x62d0
leaq -0x208(%rbp), %rdi
callq 0x62d0
leaq -0x1e8(%rbp), %rdi
callq 0x62d0
leaq -0x1c8(%rbp), %rdi
callq 0x6390
jmp 0x2ecd9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x2eca7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x2ec8f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x2ec83
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x2ec77
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x300(%rbp), %rdi
callq 0x62d0
leaq -0x298(%rbp), %rdi
callq 0xfd80
leaq -0x2d8(%rbp), %rdi
callq 0x62d0
leaq -0x2d9(%rbp), %rdi
callq 0x64f0
leaq -0x2b8(%rbp), %rdi
callq 0x62d0
leaq -0x228(%rbp), %rdi
callq 0x62d0
leaq -0x208(%rbp), %rdi
callq 0x62d0
leaq -0x1e8(%rbp), %rdi
callq 0x62d0
leaq -0x1c8(%rbp), %rdi
callq 0x6390
jmp 0x2ece9
movq -0x320(%rbp), %rax
addq $0x370, %rsp            # imm = 0x370
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x6820
nopw %cs:(%rax,%rax)