// File: /workspace/github_cpp_makefile_star2_O1/joao18araujo[P]pierluigi/src/second_species_counterpoint.cpp
// Function: SecondSpeciesCounterpoint::dfs_generate_counterpoint(Song&, bool, int, int)
Song SecondSpeciesCounterpoint::dfs_generate_counterpoint(Song & c_song, bool ascendant, int paralels, int same_movements){
  song = &c_song;
  Song counterpoint(c_song.scale, c_song.time);
  if(song->size() > 200 || paralels > 4 || same_movements > 600)
    return Song();

  SecondSpeciesCounterpoint::solve(0, 0, paralels, same_movements, ascendant, counterpoint);
  SecondSpeciesCounterpoint::add_trailing_rests(counterpoint);
  return counterpoint;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movl %r8d, %ebp
movl %ecx, %r14d
movl %edx, 0x4(%rsp)
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x9bf3f00(%rip), %rax   # 0x9c124a8
movq %rsi, (%rax)
addq $0x18, %rsi
xorl %eax, %eax
leaq 0xe8(%rsp), %rdi
movq %rax, (%rdi)
movq 0x20(%r12), %rcx
movq %rcx, 0x8(%rdi)
movq %rax, 0x10(%rdi)
movq 0x30(%r12), %rcx
movq %rcx, 0x18(%rdi)
movups 0x38(%r12), %xmm0
movups %xmm0, 0x20(%rdi)
movq %rax, 0x30(%rdi)
leaq 0x8(%rsp), %rdx
movq %rdi, (%rdx)
callq 0xb2d2
leaq 0x120(%rsp), %r13
leaq 0x50(%r12), %rsi
movq %r13, %rdi
callq 0x1a9c6
leaq 0x178(%rsp), %rdi
leaq 0x188(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0xa8(%r12), %rsi
movq 0xb0(%r12), %rdx
addq %rsi, %rdx
callq 0xb544
movq 0xc8(%r12), %rdx
leaq 0x10(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0xf9e8
movq 0x178(%rsp), %rdi
cmpq %r15, %rdi
je 0x1e665
movq 0x188(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0x158(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1e686
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0x138(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1e6a7
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0xe8(%rsp), %rdi
callq 0xb51e
leaq 0x9bf3ded(%rip), %rax   # 0x9c124a8
movq (%rax), %rdi
callq 0x24288
cmpl $0x258, %ebp            # imm = 0x258
jg 0x1e78a
cmpl $0x4, %r14d
jg 0x1e78a
cmpl $0xc9, %eax
jae 0x1e78a
movzbl 0x4(%rsp), %r8d
leaq 0x10(%rsp), %r9
xorl %edi, %edi
xorl %esi, %esi
movl %r14d, %edx
movl %ebp, %ecx
callq 0x1e8b6
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0xb06c
leaq 0x28(%rsp), %rdx
movq -0x18(%rdx), %rax
movq %rax, (%rbx)
movq -0x10(%rdx), %rax
movq %rax, 0x8(%rbx)
movq -0x8(%rdx), %rax
movq %rax, 0x10(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, -0x18(%rdx)
movq $0x0, -0x8(%rdx)
leaq 0x18(%rbx), %r15
movq %r15, %rdi
movq %rdx, %rsi
callq 0xfb70
leaq 0x50(%rbx), %rdi
leaq 0x60(%rsp), %rsi
callq 0x1a9c6
movl $0xb8, %edx
leaq (%rbx,%rdx), %rax
movq %rax, 0xa8(%rbx)
movq 0xb8(%rsp), %rcx
addq %rdx, %r14
cmpq %r14, %rcx
je 0x1e794
movq %rcx, 0xa8(%rbx)
movq 0xc8(%rsp), %rax
movq %rax, 0xb8(%rbx)
jmp 0x1e79b
movq %rbx, %rdi
callq 0xfabe
jmp 0x1e7d5
movups (%r14), %xmm0
movups %xmm0, (%rax)
movq 0xc0(%rsp), %rax
movq %rax, 0xb0(%rbx)
movq %r14, 0xb8(%rsp)
movq $0x0, 0xc0(%rsp)
movb $0x0, 0xc8(%rsp)
movq 0xd8(%rsp), %rax
movq %rax, 0xc8(%rbx)
leaq 0xc8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1e7f6
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1e817
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1e832
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0x28(%rsp), %rdi
callq 0xb51e
leaq 0x10(%rsp), %rdi
callq 0xb1d6
movq %rbx, %rax
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %r15, %rdi
callq 0xb51e
movq %rbx, %rdi
callq 0xb1d6
jmp 0x1e8a4
movq %rax, %r14
leaq 0xe8(%rsp), %rdi
callq 0xb206
jmp 0x1e8ae
movq %rax, %r14
movq %r13, %rdi
callq 0xb116
jmp 0x1e892
movq %rax, %r14
leaq 0xe8(%rsp), %rdi
callq 0xb51e
jmp 0x1e8ae
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0xfb08
movq %r14, %rdi
callq 0x55e0