// File: /workspace/github_cpp_makefile_star2_O3/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 0x1aa22
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 0xb50a
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 0x9c0789a(%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 0xb29e
leaq 0x1b8(%rsp), %r12
leaq 0x50(%r15), %rsi
movq %r12, %rdi
callq 0x1aa22
leaq 0x210(%rsp), %rdi
leaq 0x220(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0xa8(%r15), %rsi
movq 0xb0(%r15), %rdx
addq %rsi, %rdx
callq 0xb50a
leaq 0x230(%rsp), %r12
leaq 0x78(%rsp), %rsi
leaq 0x18(%rsp), %rdx
leaq 0x180(%rsp), %rcx
movq %r12, %rdi
callq 0x1de5a
movq 0x210(%rsp), %rdi
cmpq %rbp, %rdi
je 0xacca
movq 0x220(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0x1f0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xaceb
movq 0x1f0(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0x1d0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xad0c
movq 0x1d0(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0x180(%rsp), %rdi
callq 0xb4e4
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0xad30
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0xb0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xad51
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xad72
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x5360
cmpb $0x0, 0x284(%rsp)
je 0xaea6
leaq 0x128(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x1aa22
leaq 0xd0(%rsp), %rdi
leaq 0x230(%rsp), %rsi
callq 0x1aa22
leaq 0x48(%rsp), %rdi
leaq 0x128(%rsp), %rsi
leaq 0xd0(%rsp), %rdx
callq 0x1528a
leaq 0x108(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xade2
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0xe8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xae03
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0x160(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xae24
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0x140(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xae45
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x5360
cmpb $0x0, 0x4(%rsp)
jne 0xae5a
movl 0x48(%rsp), %eax
cmpl $0x5, %eax
jl 0xae5a
cmpl $0x8, %eax
jne 0xae70
leaq 0x48(%rsp), %rdi
callq 0x15be4
cmpb (%rsp), %al
jne 0xae70
cmpb $0x0, 0x54(%r13)
jne 0xae7e
movq 0x8(%rsp), %rdi
callq 0x1c1fa
testb %al, %al
je 0xae8b
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0xb22e
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xaea6
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0x268(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xaec7
movq 0x268(%rsp), %rsi
incq %rsi
callq 0x5360
leaq 0x248(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xaee8
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 0xb0e0
jmp 0xaf0f
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0xb0e0
jmp 0xaf98
movq %rax, %rbx
jmp 0xaf98
movq %rax, %rbx
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xaf98
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5360
jmp 0xaf98
movq %rax, %rbx
leaq 0x180(%rsp), %rdi
callq 0xb1d2
jmp 0xaf77
movq %rax, %rbx
movq %r12, %rdi
callq 0xb0e0
jmp 0xaf65
movq %rax, %rbx
leaq 0x180(%rsp), %rdi
callq 0xb4e4
jmp 0xaf77
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0xaf93
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5360
jmp 0xaf93
movq %rax, %rbx
leaq 0x78(%rsp), %r12
movq %r12, %rdi
callq 0xb0e0
movq %rbx, %rdi
callq 0x55e0