// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1060
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jne 0x5a5d
leaq 0x29a3(%rip), %rdi      # 0x83ec
movb $0x0, %al
callq 0x63e0
movq $0x0, -0x8(%rbp)
jmp 0x5b40
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
movq -0x18(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
je 0x5a98
movq -0x18(%rbp), %rax
movsbl (%rax), %esi
movq -0x10(%rbp), %rax
movsbl (%rax), %edx
leaq 0x2991(%rip), %rdi      # 0x8415
movb $0x0, %al
callq 0x63e0
movq $0x0, -0x8(%rbp)
jmp 0x5b40
cmpl $0x1, -0x2c(%rbp)
jne 0x5acc
movl $0x1, %edi
callq 0x5df0
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x65f0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x5b40
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %esi
callq 0x5e70
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x5af6
movq $0x0, -0x8(%rbp)
jmp 0x5b40
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
movl -0x2c(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rdx
movl $0x1, %esi
callq 0x5fc0
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0x5a20
movq -0x38(%rbp), %rdi
movq %rax, %rsi
callq 0x5f40
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)