// File: /workspace/github_c_makefile_star2_O1/pipde[P]deos-songlib/utils/processtab/tabchecker.c
// Function: buildMeasureFromASTEvents
static void
buildMeasureFromASTEvents(Measure *measure, char *astEvents, char *astTimingEvents)
    {
    int i;
    DoubleArray *eventDurations = parseMeasureEventDurations(astTimingEvents, (int)measure->beatsInMeasure);
    NoteInstance *ni;
    double currentDuration;
    
    for (i = 0; i < eventDurations->length; i++)
        {
        ni = newNoteInstance();
        /* ni->noteName == 0 is rest */
        ni->noteName = astEvents == 0 ? 0 : ((astEvents[i] == '-' || astEvents[i] == ' ') ? 0 : astEvents[i]);
        
        /* spaces ' ' hold the note length.  Loop through them, adding to the current duration. */
        currentDuration = eventDurations->values[i]; 
        for (; i < (eventDurations->length - 1) && (astEvents == 0 || astEvents[i+1] == ' '); i++)
            {
            currentDuration += eventDurations->values[i+1];
            }
        
        ni->duration = currentDuration;
        addNoteInstanceToMeasure(ni, measure);
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movb 0xc(%rdi), %bpl
leal 0x30(%rbp), %eax
movsbl %al, %r12d
cmpb $0x30, %r12b
jg 0x4491
leaq 0x1fbd(%rip), %rdi      # 0x643a
xorl %r13d, %r13d
movl $0x31, %esi
movl %r12d, %edx
xorl %eax, %eax
callq 0x4b44
jmp 0x44ce
leal -0x2f(%r12), %edi
callq 0x4c71
movq %rax, %r13
addb $0x31, %bpl
movzbl %bpl, %eax
cmpb $0x33, %al
movl $0x32, %ecx
cmovgel %eax, %ecx
movzbl %cl, %eax
movl $0x31, %ecx
movb %cl, -0x31(%r13,%rcx)
incq %rcx
cmpq %rcx, %rax
jne 0x44b8
movslq %r12d, %rax
movb $0x0, -0x30(%r13,%rax)
movq %r15, %rdi
movq %r13, %rsi
callq 0x4765
cmpl $0x0, 0x8(%rax)
jle 0x467b
xorl %r15d, %r15d
xorl %ebp, %ebp
movq %rax, 0x10(%rsp)
movq %rbp, 0x8(%rsp)
movq (%rax), %rax
movq (%rax,%r15,8), %r13
movsbl (%r13), %edi
leaq 0x1f66(%rip), %rsi      # 0x646b
callq 0x4a5b
movq %r13, %rdi
movq %rax, %rsi
callq 0x4765
testq %rax, %rax
je 0x4597
movq %rax, %rbp
cmpl $0x2, 0x8(%rax)
jne 0x4597
movq (%rbp), %rax
movq (%rax), %r12
movsbl (%r12), %edi
leaq 0xc2b(%rip), %rsi       # 0x5161
callq 0x4a5b
movq %r12, %rdi
movq %rax, %rsi
callq 0x4765
testq %rax, %rax
je 0x45b1
movq %rax, %r13
cmpl $0x2, 0x8(%rax)
jne 0x45b1
movq (%r13), %rax
movq (%rax), %rdi
movsd 0xb1d(%rip), %xmm0      # 0x5080
callq 0x4ab7
xorl %edi, %edi
movq %rax, %rsi
callq 0x48c5
movq %rax, %r12
movq (%r13), %rax
movq 0x8(%rax), %rdi
movsd 0xafb(%rip), %xmm0      # 0x5080
callq 0x4ab7
movq %r12, %rdi
movq %rax, %rsi
callq 0x48c5
jmp 0x45c1
movq %r13, %rdi
movsd 0xaee(%rip), %xmm0      # 0x5090
callq 0x4ab7
movq 0x8(%rsp), %r12
jmp 0x4656
movq %r12, %rdi
movsd 0xacc(%rip), %xmm0      # 0x5088
callq 0x4ab7
xorl %edi, %edi
movq %rax, %rsi
callq 0x48c5
movq %rax, %r13
movq (%rbp), %rax
movq 0x8(%rax), %r12
movq %r12, %rdi
leaq 0x1eae(%rip), %rsi      # 0x648e
callq 0x4765
testq %rax, %rax
je 0x4636
movq %rax, %rbp
cmpl $0x2, 0x8(%rax)
jne 0x4636
movq (%rbp), %rax
movq (%rax), %rdi
movsd 0xa7e(%rip), %xmm0      # 0x5080
callq 0x4ab7
xorl %edi, %edi
movq %rax, %rsi
callq 0x48c5
movq %rax, %r12
movq (%rbp), %rax
movq 0x8(%rax), %rdi
movsd 0xa5c(%rip), %xmm0      # 0x5080
callq 0x4ab7
movq %r12, %rdi
movq %rax, %rsi
callq 0x48c5
jmp 0x4646
movq %r12, %rdi
movsd 0xa47(%rip), %xmm0      # 0x5088
callq 0x4ab7
movq 0x8(%rsp), %r12
movq %r13, %rdi
movq %rax, %rsi
callq 0x48c5
movq %r12, %rdi
movq %rax, %rsi
callq 0x48c5
movq %rax, %rbp
incq %r15
movq 0x10(%rsp), %rax
movslq 0x8(%rax), %rcx
cmpq %rcx, %r15
jl 0x44ed
jmp 0x467d
xorl %ebp, %ebp
cmpl $0x0, 0x8(%rbp)
jle 0x4756
xorl %r13d, %r13d
movl $0x10, %edi
callq 0x4c71
movq %rax, %r12
movb $0x0, (%rax)
movq $0x0, 0x8(%rax)
movslq %r13d, %rax
testq %rbx, %rbx
je 0x46be
movzbl (%rbx,%rax), %edx
xorl %ecx, %ecx
cmpl $0x20, %edx
je 0x46c0
cmpl $0x2d, %edx
je 0x46c0
movl %edx, %ecx
jmp 0x46c0
xorl %ecx, %ecx
movb %cl, (%r12)
movq (%rbp), %rcx
movsd (%rcx,%rax,8), %xmm0
movslq 0x8(%rbp), %r15
decq %r15
cmpl %r15d, %eax
jge 0x46f5
testq %rbx, %rbx
je 0x46e5
cmpb $0x20, 0x1(%rbx,%rax)
jne 0x46fa
addsd 0x8(%rcx,%rax,8), %xmm0
incq %rax
cmpq %r15, %rax
jl 0x46d9
jmp 0x46fd
movl %r13d, %r15d
jmp 0x46fd
movl %eax, %r15d
movsd %xmm0, 0x8(%r12)
movq (%r14), %r13
movl 0x8(%r14), %eax
leal 0x8(,%rax,8), %edi
callq 0x4c71
movq %rax, (%r14)
movslq 0x8(%r14), %rax
testq %rax, %rax
jle 0x4739
xorl %ecx, %ecx
movq (%r13,%rcx,8), %rdx
movq (%r14), %rsi
movq %rdx, (%rsi,%rcx,8)
incq %rcx
cmpq %rcx, %rax
jne 0x4725
movq (%r14), %rcx
movq %r12, (%rcx,%rax,8)
incl %eax
movl %eax, 0x8(%r14)
incl %r15d
movl %r15d, %r13d
cmpl 0x8(%rbp), %r15d
jl 0x468a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq