// File: joao18araujo[P]pierluigi/src/song_reader.cpp
// Function: SongReader::song_to_voice_string[abi:cxx11](Song&)
string SongReader::song_to_voice_string(Song & song){
  string counterpoint_voice = "\n\nCounterpointVoice = {\n\t" +
          song_clef_to_string(song) + " " +
          scale_to_string(song.scale) + " " +
          compass_time_to_string(song.time) + "\n\t";

  Note prev;
  int note_count = 0;
  for(auto note : song.notes){
    prev = note;
    note_count++;
    if(note_count > 1){
      if(note_count % 10 == 1) counterpoint_voice += "\n\t";
      else counterpoint_voice += " ";
    }
    counterpoint_voice += SongReader::note_to_string(note);
  }

  counterpoint_voice += "\n}\n\n";

  return counterpoint_voice;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x340, %rsp            # imm = 0x340
movq %rdi, -0x340(%rbp)
movq %rdi, %rax
movq %rax, -0x338(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
movq -0x10(%rbp), %rsi
leaq -0xd8(%rbp), %rdi
movq %rdi, -0x330(%rbp)
callq 0x2efc0
movq -0x330(%rbp), %rdx
leaq 0x3131c(%rip), %rsi     # 0x607b9
leaq -0xb8(%rbp), %rdi
callq 0x2fc80
jmp 0x2f4ab
leaq 0x30d3a(%rip), %rdx     # 0x601ec
leaq -0x98(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x1cb40
jmp 0x2f4c7
movq -0x10(%rbp), %rsi
addq $0x18, %rsi
leaq -0x1b8(%rbp), %rdi
callq 0x10110
jmp 0x2f4dd
leaq -0x108(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x2ed00
jmp 0x2f4f2
leaq -0x78(%rbp), %rdi
leaq -0x98(%rbp), %rsi
leaq -0x108(%rbp), %rdx
callq 0x1cb90
jmp 0x2f50b
leaq 0x30cda(%rip), %rdx     # 0x601ec
leaq -0x58(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x1cb40
jmp 0x2f521
movq -0x10(%rbp), %rax
movq 0xc8(%rax), %rax
movq %rax, -0x1e0(%rbp)
movq -0x1e0(%rbp), %rsi
leaq -0x1d8(%rbp), %rdi
callq 0x2ee90
jmp 0x2f548
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rsi
leaq -0x1d8(%rbp), %rdx
callq 0x1cb90
jmp 0x2f55e
movq -0x340(%rbp), %rdi
leaq 0x31264(%rip), %rdx     # 0x607d0
leaq -0x38(%rbp), %rsi
callq 0x1cb40
jmp 0x2f577
leaq -0x38(%rbp), %rdi
callq 0x62d0
leaq -0x1d8(%rbp), %rdi
callq 0x62d0
leaq -0x58(%rbp), %rdi
callq 0x62d0
leaq -0x78(%rbp), %rdi
callq 0x62d0
leaq -0x108(%rbp), %rdi
callq 0x62d0
leaq -0x1b8(%rbp), %rdi
callq 0x101b0
leaq -0x98(%rbp), %rdi
callq 0x62d0
leaq -0xb8(%rbp), %rdi
callq 0x62d0
leaq -0xd8(%rbp), %rdi
callq 0x62d0
leaq -0x238(%rbp), %rdi
callq 0x22dc0
jmp 0x2f5e8
movl $0x0, -0x23c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x248(%rbp)
movq -0x248(%rbp), %rdi
callq 0x126e0
movq %rax, -0x250(%rbp)
movq -0x248(%rbp), %rdi
callq 0x12550
movq %rax, -0x258(%rbp)
leaq -0x250(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x1cc60
testb $0x1, %al
jne 0x2f63f
jmp 0x2f902
leaq -0x250(%rbp), %rdi
callq 0x1b840
movq %rax, %rsi
leaq -0x2b0(%rbp), %rdi
callq 0x22ce0
jmp 0x2f65c
leaq -0x238(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
callq 0xfe00
jmp 0x2f671
movl -0x23c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x23c(%rbp)
cmpl $0x1, -0x23c(%rbp)
jle 0x2f842
movl -0x23c(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
cmpl $0x1, %edx
jne 0x2f829
movq -0x340(%rbp), %rdi
leaq 0x3111e(%rip), %rsi     # 0x607d0
callq 0x6450
jmp 0x2f6b9
jmp 0x2f840
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x2f7d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x2f7c7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x2f7bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x2f7af
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x2f7a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x2f79a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x2f791
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x2f785
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x62d0
leaq -0x1d8(%rbp), %rdi
callq 0x62d0
leaq -0x58(%rbp), %rdi
callq 0x62d0
leaq -0x78(%rbp), %rdi
callq 0x62d0
leaq -0x108(%rbp), %rdi
callq 0x62d0
leaq -0x1b8(%rbp), %rdi
callq 0x101b0
leaq -0x98(%rbp), %rdi
callq 0x62d0
leaq -0xb8(%rbp), %rdi
callq 0x62d0
leaq -0xd8(%rbp), %rdi
callq 0x62d0
jmp 0x2f965
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x2f959
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x2f92f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x2f8f4
movq -0x340(%rbp), %rdi
leaq 0x309b5(%rip), %rsi     # 0x601ec
callq 0x6450
jmp 0x2f83e
jmp 0x2f840
jmp 0x2f842
leaq -0x328(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
callq 0x22ce0
jmp 0x2f857
leaq -0x2d0(%rbp), %rdi
leaq -0x328(%rbp), %rsi
callq 0x2e5a0
jmp 0x2f86c
movq -0x340(%rbp), %rdi
leaq -0x2d0(%rbp), %rsi
callq 0x65f0
jmp 0x2f881
leaq -0x2d0(%rbp), %rdi
callq 0x62d0
leaq -0x328(%rbp), %rdi
callq 0xfd80
leaq -0x2b0(%rbp), %rdi
callq 0xfd80
leaq -0x250(%rbp), %rdi
callq 0x1cca0
jmp 0x2f623
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x2f8e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
leaq -0x2d0(%rbp), %rdi
callq 0x62d0
leaq -0x328(%rbp), %rdi
callq 0xfd80
leaq -0x2b0(%rbp), %rdi
callq 0xfd80
jmp 0x2f92f
movq -0x340(%rbp), %rdi
leaq 0x30ec3(%rip), %rsi     # 0x607d3
callq 0x6450
jmp 0x2f917
movb $0x1, -0x11(%rbp)
leaq -0x238(%rbp), %rdi
callq 0xfd80
testb $0x1, -0x11(%rbp)
jne 0x2f949
jmp 0x2f93d
leaq -0x238(%rbp), %rdi
callq 0xfd80
jmp 0x2f959
movq -0x340(%rbp), %rdi
callq 0x62d0
movq -0x338(%rbp), %rax
addq $0x340, %rsp            # imm = 0x340
popq %rbp
retq
movq -0x340(%rbp), %rdi
callq 0x62d0
movq -0xe0(%rbp), %rdi
callq 0x6820
nopw %cs:(%rax,%rax)