// File: /workspace/github_c_makefile_star2_O0/aparrish[P]rwet-examples-c/ut_string_helpers.c
// Function: split_new
UT_array* split_new(const char* src, const char* delimiter) {
	char* src_copy;
	char* word;
	UT_array* tokens;

	utarray_new(tokens, &ut_str_icd);

	/* don't modify original string */
	src_copy = (char*)malloc(strlen(src)+1);
	strcpy(src_copy, src);
	if (src_copy == NULL) return NULL;

	word = strtok(src_copy, delimiter);
	while (word != NULL) {
		/* utarray_push_back copies the string */
		utarray_push_back(tokens, &word);
		word = strtok(NULL, delimiter);
	}

	free(src_copy);
	return tokens;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x30, %edi
callq 0x10b0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x1070
movq -0x30(%rbp), %rax
movq 0x2eb7(%rip), %rcx      # 0x5dd0
movq %rcx, 0x8(%rax)
movq 0x2eb4(%rip), %rcx      # 0x5dd8
movq %rcx, 0x10(%rax)
movq 0x2eb1(%rip), %rcx      # 0x5de0
movq %rcx, 0x18(%rax)
movq 0x2eae(%rip), %rcx      # 0x5de8
movq %rcx, 0x20(%rax)
jmp 0x2f40
movq -0x10(%rbp), %rdi
callq 0x1050
movq %rax, %rdi
addq $0x1, %rdi
callq 0x10b0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x1040
cmpq $0x0, -0x20(%rbp)
jne 0x2f7a
movq $0x0, -0x8(%rbp)
jmp 0x30cd
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x10d0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x30bc
jmp 0x2f98
jmp 0x2f9a
movq -0x30(%rbp), %rax
movl (%rax), %eax
addl $0x1, %eax
movq -0x30(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jbe 0x3027
jmp 0x2fae
movq -0x30(%rbp), %rax
movl (%rax), %eax
addl $0x1, %eax
movq -0x30(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jbe 0x2fee
movq -0x30(%rbp), %rax
cmpl $0x0, 0x4(%rax)
je 0x2fd8
movq -0x30(%rbp), %rax
movl 0x4(%rax), %eax
shll %eax
movl %eax, -0x34(%rbp)
jmp 0x2fe2
movl $0x8, %eax
movl %eax, -0x34(%rbp)
jmp 0x2fe2
movl -0x34(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x4(%rax)
jmp 0x2fae
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x30(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, %esi
movq -0x30(%rbp), %rax
imulq 0x8(%rax), %rsi
callq 0x10c0
movq -0x30(%rbp), %rcx
movq %rax, 0x28(%rcx)
cmpq $0x0, %rax
jne 0x3025
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x10f0
jmp 0x3027
jmp 0x3029
movq -0x30(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x306d
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x30(%rbp), %rcx
movq 0x28(%rcx), %rdi
movq -0x30(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq -0x30(%rbp), %rsi
movl (%rsi), %edx
movl %edx, %r8d
addl $0x1, %r8d
movl %r8d, (%rsi)
movl %edx, %edx
imulq %rdx, %rcx
addq %rcx, %rdi
leaq -0x28(%rbp), %rsi
callq *%rax
jmp 0x30a4
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x30(%rbp), %rdx
movl (%rdx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, (%rdx)
movl %ecx, %ecx
imulq %rcx, %rax
addq %rax, %rdi
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdx
leaq -0x28(%rbp), %rsi
callq 0x10a0
jmp 0x30a6
movq -0x18(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
callq 0x10d0
movq %rax, -0x28(%rbp)
jmp 0x2f8b
movq -0x20(%rbp), %rdi
callq 0x1030
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)