// File: /workspace/github_c_makefile_star2_O2/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), %al
addb $0x30, %al
movsbl %al, %r13d
cmpb $0x30, %r13b
jg 0x3fa2
leaq 0x248c(%rip), %rdi      # 0x641c
xorl %r12d, %r12d
pushq $0x31
popq %rsi
movl %r13d, %edx
xorl %eax, %eax
callq 0x4610
jmp 0x3fc9
leal -0x2f(%r13), %edi
callq 0x47c5
movq %rax, %r12
movslq %r13d, %rax
pushq $0x31
popq %rcx
cmpq %rax, %rcx
ja 0x3fc3
movb %cl, -0x31(%r12,%rcx)
incq %rcx
jmp 0x3fb4
movb $0x0, -0x30(%r12,%rax)
movq %r15, %rdi
movq %r12, %rsi
callq 0x4243
xorl %r15d, %r15d
xorl %ebp, %ebp
movq %rax, 0x10(%rsp)
movslq 0x8(%rax), %rcx
cmpq %rcx, %r15
jge 0x416f
movq %rbp, 0x8(%rsp)
movq (%rax), %rax
movq (%rax,%r15,8), %r13
movsbl (%r13), %edi
leaq 0x244a(%rip), %rsi      # 0x644d
callq 0x4530
movq %r13, %rdi
movq %rax, %rsi
callq 0x4243
testq %rax, %rax
je 0x4095
movq %rax, %rbp
cmpl $0x2, 0x8(%rax)
jne 0x4095
movq (%rbp), %rax
movq (%rax), %r12
movsbl (%r12), %edi
leaq 0x112d(%rip), %rsi      # 0x5161
callq 0x4530
movq %r12, %rdi
movq %rax, %rsi
callq 0x4243
testq %rax, %rax
je 0x40af
movq %rax, %r13
cmpl $0x2, 0x8(%rax)
jne 0x40af
movq (%r13), %rax
movq (%rax), %rdi
movsd 0x101f(%rip), %xmm0     # 0x5080
callq 0x4588
xorl %edi, %edi
movq %rax, %rsi
callq 0x439b
movq %rax, %r12
movq (%r13), %rax
movq 0x8(%rax), %rdi
movsd 0xffd(%rip), %xmm0      # 0x5080
callq 0x4588
movq %r12, %rdi
movq %rax, %rsi
callq 0x439b
jmp 0x40bf
movq %r13, %rdi
movsd 0xff0(%rip), %xmm0      # 0x5090
callq 0x4588
movq 0x8(%rsp), %r12
jmp 0x4154
movq %r12, %rdi
movsd 0xfce(%rip), %xmm0      # 0x5088
callq 0x4588
xorl %edi, %edi
movq %rax, %rsi
callq 0x439b
movq %rax, %r13
movq (%rbp), %rax
movq 0x8(%rax), %r12
movq %r12, %rdi
leaq 0x2392(%rip), %rsi      # 0x6470
callq 0x4243
testq %rax, %rax
je 0x4134
movq %rax, %rbp
cmpl $0x2, 0x8(%rax)
jne 0x4134
movq (%rbp), %rax
movq (%rax), %rdi
movsd 0xf80(%rip), %xmm0      # 0x5080
callq 0x4588
xorl %edi, %edi
movq %rax, %rsi
callq 0x439b
movq %rax, %r12
movq (%rbp), %rax
movq 0x8(%rax), %rdi
movsd 0xf5e(%rip), %xmm0      # 0x5080
callq 0x4588
movq %r12, %rdi
movq %rax, %rsi
callq 0x439b
jmp 0x4144
movq %r12, %rdi
movsd 0xf49(%rip), %xmm0      # 0x5088
callq 0x4588
movq 0x8(%rsp), %r12
movq %r13, %rdi
movq %rax, %rsi
callq 0x439b
movq %r12, %rdi
movq %rax, %rsi
callq 0x439b
movq %rax, %rbp
incq %r15
movq 0x10(%rsp), %rax
jmp 0x3fde
xorl %r15d, %r15d
cmpl 0x8(%rbp), %r15d
jge 0x4234
callq 0x3a98
movq %rax, %r12
movslq %r15d, %rax
testq %rbx, %rbx
je 0x41a0
movzbl (%rbx,%rax), %edx
xorl %ecx, %ecx
cmpl $0x20, %edx
je 0x41a2
cmpl $0x2d, %edx
je 0x41a2
movl %edx, %ecx
jmp 0x41a2
xorl %ecx, %ecx
movb %cl, (%r12)
movq (%rbp), %rcx
movsd (%rcx,%rax,8), %xmm0
movslq 0x8(%rbp), %rdx
decq %rdx
cmpl %edx, %r15d
cmovlel %edx, %r15d
cmpq %rdx, %rax
jge 0x41dc
testq %rbx, %rbx
je 0x41ce
cmpb $0x20, 0x1(%rbx,%rax)
jne 0x41d9
addsd 0x8(%rcx,%rax,8), %xmm0
incq %rax
jmp 0x41bd
movl %eax, %r15d
movsd %xmm0, 0x8(%r12)
movq (%r14), %r13
movl 0x8(%r14), %eax
leal 0x8(,%rax,8), %edi
callq 0x47c5
movq %rax, (%r14)
movslq 0x8(%r14), %rax
testl %eax, %eax
movl $0x0, %ecx
cmovgl %eax, %ecx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x421f
movq (%r13,%rdx,8), %rsi
movq (%r14), %rdi
movq %rsi, (%rdi,%rdx,8)
incq %rdx
jmp 0x4209
movq (%r14), %rcx
movq %r12, (%rcx,%rax,8)
incl %eax
movl %eax, 0x8(%r14)
incl %r15d
jmp 0x4172
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq