// File: /workspace/github_cpp_makefile_star2_O1/joao18araujo[P]pierluigi/src/counterpoint.cpp
// Function: Counterpoint::analyse_and_add_interval(bool, bool, std::vector<Interval, std::allocator<Interval>>&, Note, Note, Interval, Song*)
void Counterpoint::analyse_and_add_interval(bool reverse_movement, bool melodic_ascendant, vector<Interval> & possible_intervals, Note previous_counterpoint_note, Note note, Interval interval, Song *){
  Note next_note = Scale::interval_to_note_on_scale(note, interval, song->scale);
  if(!next_note.valid){
    return;
  }
  Interval melodic_interval(previous_counterpoint_note, next_note);
  bool can_jump = (reverse_movement or melodic_interval.quantitative <= 4 or melodic_interval.quantitative == 8);
  if((can_jump and (melodic_ascendant == melodic_interval.ascendant()) and note.valid) or previous_counterpoint_note.rest())
    possible_intervals.push_back(interval);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
movq %r9, %rbx
movq %r8, %r13
movq %rcx, 0x8(%rsp)
movq %rdx, %r15
movl %esi, %ebp
movl %edi, %r12d
leaq 0x78(%rsp), %rdi
movq %r8, %rsi
callq 0x1a9c6
movl (%rbx), %eax
leaq 0x20(%rsp), %rdi
movl %eax, -0x8(%rdi)
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
addq %rsi, %rdx
callq 0xb544
movl %r12d, 0x4(%rsp)
movl %ebp, (%rsp)
movq %r15, 0x10(%rsp)
movzwl 0x2c(%rbx), %eax
movw %ax, 0x44(%rsp)
movl 0x28(%rbx), %eax
movl %eax, 0x40(%rsp)
movq 0x9c07874(%rip), %r15   # 0x9c124a8
leaq 0x18(%r15), %rsi
xorl %eax, %eax
leaq 0x180(%rsp), %rdi
movq %rax, (%rdi)
movq 0x20(%r15), %rcx
movq %rcx, 0x8(%rdi)
movq %rax, 0x10(%rdi)
movq 0x30(%r15), %rcx
movq %rcx, 0x18(%rdi)
movups 0x38(%r15), %xmm0
movups %xmm0, 0x20(%rdi)
movq %rax, 0x30(%rdi)
leaq 0x48(%rsp), %rdx
movq %rdi, (%rdx)
callq 0xb2d2
leaq 0x1b8(%rsp), %r12
leaq 0x50(%r15), %rsi
movq %r12, %rdi
callq 0x1a9c6
leaq 0x210(%rsp), %rdi
leaq 0x220(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0xa8(%r15), %rsi
movq 0xb0(%r15), %rdx
addq %rsi, %rdx
callq 0xb544
leaq 0x230(%rsp), %r12
leaq 0x78(%rsp), %rsi
leaq 0x18(%rsp), %rdx
leaq 0x180(%rsp), %rcx
movq %r12, %rdi
callq 0x1de56
movq 0x210(%rsp), %rdi
cmpq %rbp, %rdi
je 0xacf0
movq 0x220(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0x1f0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xad11
movq 0x1f0(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0x1d0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xad32
movq 0x1d0(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0x180(%rsp), %rdi
callq 0xb51e
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0xad56
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0xb0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xad77
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xad98
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x5360
cmpb $0x0, 0x284(%rsp)
je 0xaecc
leaq 0x128(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x1a9c6
leaq 0xd0(%rsp), %rdi
leaq 0x230(%rsp), %rsi
callq 0x1a9c6
leaq 0x48(%rsp), %rdi
leaq 0x128(%rsp), %rsi
leaq 0xd0(%rsp), %rdx
callq 0x15216
leaq 0x108(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xae08
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0xe8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xae29
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0x160(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xae4a
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0x140(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xae6b
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x5360
cmpb $0x0, 0x4(%rsp)
jne 0xae80
movl 0x48(%rsp), %eax
cmpl $0x5, %eax
jl 0xae80
cmpl $0x8, %eax
jne 0xae96
leaq 0x48(%rsp), %rdi
callq 0x15b78
cmpb (%rsp), %al
jne 0xae96
cmpb $0x0, 0x54(%r13)
jne 0xaea4
movq 0x8(%rsp), %rdi
callq 0x1c186
testb %al, %al
je 0xaeb1
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0xb262
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xaecc
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0x268(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xaeed
movq 0x268(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0x248(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xaf0e
movq 0x248(%rsp), %rsi
incq %rsi
callq 0x5360
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0xb116
jmp 0xaf35
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0xb116
jmp 0xafbe
movq %rax, %rbx
jmp 0xafbe
movq %rax, %rbx
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xafbe
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5360
jmp 0xafbe
movq %rax, %rbx
leaq 0x180(%rsp), %rdi
callq 0xb206
jmp 0xaf9d
movq %rax, %rbx
movq %r12, %rdi
callq 0xb116
jmp 0xaf8b
movq %rax, %rbx
leaq 0x180(%rsp), %rdi
callq 0xb51e
jmp 0xaf9d
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0xafb9
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5360
jmp 0xafb9
movq %rax, %rbx
leaq 0x78(%rsp), %r12
movq %r12, %rdi
callq 0xb116
movq %rbx, %rdi
callq 0x55e0