// File: /workspace/github_cpp_makefile_star2_O1/joao18araujo[P]pierluigi/src/first_species_counterpoint.cpp
// Function: FirstSpeciesCounterpoint::dfs_generate_counterpoint(Song&, bool, int, int)
Song FirstSpeciesCounterpoint::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();

  FirstSpeciesCounterpoint::solve(0, paralels, same_movements, counterpoint, ascendant);
  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 0x9c06780(%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 0xbde5
movq 0x188(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0x158(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xbe06
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0x138(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xbe27
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0xe8(%rsp), %rdi
callq 0xb51e
leaq 0x9c0666d(%rip), %rax   # 0x9c124a8
movq (%rax), %rdi
callq 0x24288
cmpl $0x258, %ebp            # imm = 0x258
jg 0xbefe
cmpl $0x4, %r14d
jg 0xbefe
cmpl $0xc9, %eax
jae 0xbefe
movzbl 0x4(%rsp), %r8d
leaq 0x10(%rsp), %r15
xorl %edi, %edi
movl %r14d, %esi
movl %ebp, %edx
movq %r15, %rcx
callq 0xc02a
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), %r12
movq %r12, %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, %r15
cmpq %r15, %rcx
je 0xbf08
movq %rcx, 0xa8(%rbx)
movq 0xc8(%rsp), %rax
movq %rax, 0xb8(%rbx)
jmp 0xbf0f
movq %rbx, %rdi
callq 0xfabe
jmp 0xbf49
movups (%r15), %xmm0
movups %xmm0, (%rax)
movq 0xc0(%rsp), %rax
movq %rax, 0xb0(%rbx)
movq %r15, 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 0xbf6a
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xbf8b
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xbfa6
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 %r12, %rdi
callq 0xb51e
movq %rbx, %rdi
callq 0xb1d6
jmp 0xc018
movq %rax, %r14
leaq 0xe8(%rsp), %rdi
callq 0xb206
jmp 0xc022
movq %rax, %r14
movq %r13, %rdi
callq 0xb116
jmp 0xc006
movq %rax, %r14
leaq 0xe8(%rsp), %rdi
callq 0xb51e
jmp 0xc022
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0xfb08
movq %r14, %rdi
callq 0x55e0