// File: /workspace/github_c_makefile_star2_O1/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, %rbx
movq %rdi, %r15
movq %rsi, %rdi
callq 0x1080
movq %rax, %r14
testl %r14d, %r14d
je 0x47b5
movsbl (%r15), %edx
movsbl (%rbx), %esi
cmpb %sil, %dl
jne 0x47c7
cmpl $0x1, %r14d
jne 0x47e9
movl $0x1, %edi
callq 0x4959
movq %rax, %rbx
movq %r15, %rdi
callq 0x4c54
movq (%rbx), %rcx
movq %rax, (%rcx)
jmp 0x47d7
leaq 0x1c2d(%rip), %rdi      # 0x63e9
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4b44
jmp 0x47d7
leaq 0x1c44(%rip), %rdi      # 0x6412
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4b44
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsbl 0x1(%rbx), %ebp
movl $0x10, %edi
callq 0x4c71
movq %rax, %r12
movq %r15, %rdi
movl %ebp, %esi
callq 0x1090
testq %rax, %rax
je 0x483e
movq %rax, %r13
subq %r15, %r13
movq %r15, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x49a9
movq %rax, (%r12)
movq %r15, %rdi
callq 0x1080
subq %r13, %rax
movq %r15, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x49a9
movq %rax, %r15
jmp 0x484d
movq %r15, %rdi
callq 0x4c54
movq %rax, (%r12)
xorl %r15d, %r15d
movq %r15, 0x8(%r12)
testq %r15, %r15
je 0x48be
movq (%r12), %r12
decl %r14d
movslq %r14d, %rdx
movl $0x1, %esi
movq %rbx, %rdi
callq 0x49a9
movq %r15, %rdi
movq %rax, %rsi
callq 0x4765
movq %rax, %r14
movl 0x8(%rax), %edi
incl %edi
callq 0x4959
movq %rax, %rbx
movq (%rax), %rax
movq %r12, (%rax)
movslq 0x8(%rbx), %rax
cmpq $0x2, %rax
jl 0x47d7
decq %rax
xorl %ecx, %ecx
movq (%r14), %rdx
movq (%rdx,%rcx,8), %rdx
movq (%rbx), %rsi
movq %rdx, 0x8(%rsi,%rcx,8)
incq %rcx
cmpq %rcx, %rax
jne 0x48a2
jmp 0x47d7
xorl %ebx, %ebx
jmp 0x47d7