// File: /workspace/github_c_makefile_star2_O2/pipde[P]deos-songlib/utils/processtab/tabchecker.c
// Function: splitTimingEvents
static StringArray *
splitTimingEvents(char *timingEvents, char *expectedEvents)
    {
//printf("[splitTimingEvents] 1 (timingEvents: '%s', expectedEvents '%s'\n", timingEvents, expectedEvents);
    SplitString *splitString;
    StringArray *sa;
    int expectedEventsCount = strlen(expectedEvents);
    
    /* if there are no expected events, error */
    if (expectedEventsCount == 0)
        {
        Fatal("No expected timing events were supplied\n");
        return 0;
        }
        
    /* the first event should be the same as the first expected event */
    if (timingEvents[0] != expectedEvents[0])
        {
        Fatal("Timing event '%c' expected; found '%c'\n", expectedEvents[0], timingEvents[0]);
        return 0;
        }
        
    /* if there is only one expected event, then timingEvents represents all of the event */
    if (expectedEventsCount == 1)
        {
        sa = newStringArray(1);
        sa->values[0] = StringDup(timingEvents);
        return sa;
        }
    
//printf("[splitTimingEvents] 2\n");
    /* otherwise, split */
    splitString = split(timingEvents, expectedEvents[1]);
    
//printf("[splitTimingEvents] 3\n");
    /* the expected event should be found, otherwise error */
    if (splitString->second == 0)
        {
        //Warning("Timing event '%c' not found\n", expectedEvents[1]);
        return 0;
        }
        
//printf("[splitTimingEvents] 4\n");
    /* otherwise recurse and concatenate the first */
    return cons_strarr(splitString->first, splitTimingEvents(splitString->second, substring(expectedEvents, 1, expectedEventsCount - 1)));
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r12
movq %rsi, %rdi
callq 0x1080
movq %rax, %r15
testl %r15d, %r15d
je 0x4293
movsbl (%r12), %edx
movsbl (%r14), %esi
cmpb %sil, %dl
jne 0x42a5
cmpl $0x1, %r15d
jne 0x42c7
pushq $0x1
popq %rdi
callq 0x443a
movq %rax, %rbx
movq %r12, %rdi
callq 0x47a8
movq (%rbx), %rcx
movq %rax, (%rcx)
jmp 0x42b5
leaq 0x2131(%rip), %rdi      # 0x63cb
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4610
jmp 0x42b5
leaq 0x2148(%rip), %rdi      # 0x63f4
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4610
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsbl 0x1(%r14), %ebx
pushq $0x10
popq %rdi
callq 0x47c5
movq %rax, %r13
movq %r12, %rdi
movl %ebx, %esi
callq 0x1090
testq %rax, %rax
je 0x4383
movq %rax, %rbp
subq %r12, %rbp
xorl %ebx, %ebx
movq %r12, %rdi
xorl %esi, %esi
movq %rbp, %rdx
callq 0x4482
movq %rax, (%r13)
movq %r12, %rdi
callq 0x1080
subq %rbp, %rax
movq %r12, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x4482
movq %rax, 0x8(%r13)
testq %rax, %rax
je 0x42b5
movq %rax, %r12
movq (%r13), %r13
decl %r15d
movslq %r15d, %rdx
pushq $0x1
popq %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x4482
movq %r12, %rdi
movq %rax, %rsi
callq 0x4243
movq %rax, %r14
movl 0x8(%rax), %edi
incl %edi
callq 0x443a
movq %rax, %rbx
movq (%rax), %rax
movq %r13, (%rax)
movslq 0x8(%rbx), %rax
cmpq %rax, %r15
jge 0x42b5
movq (%r14), %rcx
movq -0x8(%rcx,%r15,8), %rcx
movq (%rbx), %rdx
movq %rcx, (%rdx,%r15,8)
incq %r15
jmp 0x4366
movq %r12, %rdi
callq 0x47a8
movq %rax, (%r13)
andq $0x0, 0x8(%r13)
xorl %ebx, %ebx
jmp 0x42b5