// File: /workspace/github_c_makefile_star2_O3/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 0x4d9e
movsbl (%r12), %edx
movsbl (%r14), %esi
cmpb %sil, %dl
jne 0x4db0
cmpl $0x1, %r15d
jne 0x4dd2
movl $0x1, %edi
callq 0x4f4b
movq %rax, %rbx
movq %r12, %rdi
callq 0x523a
movq (%rbx), %rcx
movq %rax, (%rcx)
jmp 0x4dc0
leaq 0x26d4(%rip), %rdi      # 0x7479
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x5138
jmp 0x4dc0
leaq 0x26eb(%rip), %rdi      # 0x74a2
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x5138
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsbl 0x1(%r14), %ebx
movl $0x10, %edi
callq 0x5257
movq %rax, %r13
movq %r12, %rdi
movl %ebx, %esi
callq 0x1090
testq %rax, %rax
je 0x4e9c
movq %rax, %rbp
subq %r12, %rbp
xorl %ebx, %ebx
movq %r12, %rdi
xorl %esi, %esi
movq %rbp, %rdx
callq 0x4f9b
movq %rax, (%r13)
movq %r12, %rdi
callq 0x1080
subq %rbp, %rax
movq %r12, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x4f9b
movq %rax, 0x8(%r13)
testq %rax, %rax
je 0x4dc0
movq %rax, %r12
movq (%r13), %r13
decl %r15d
movslq %r15d, %rdx
movl $0x1, %esi
movq %r14, %rdi
callq 0x4f9b
movq %r12, %rdi
movq %rax, %rsi
callq 0x4d4c
movq %rax, %r14
movl 0x8(%rax), %edi
incl %edi
callq 0x4f4b
movq %rax, %rbx
movq (%rax), %rax
movq %r13, (%rax)
movslq 0x8(%rbx), %rax
cmpq $0x2, %rax
jl 0x4dc0
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 0x4e80
jmp 0x4dc0
movq %r12, %rdi
callq 0x523a
movq %rax, (%r13)
movq $0x0, 0x8(%r13)
xorl %ebx, %ebx
jmp 0x4dc0