#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ _test_split(char *, char *);
void test_split() {
  _test_split("/", "a/b");
  _test_split("/", "/");
  _test_split("/", "/b");
  _test_split("/", "a/");
  _test_split("/", "asdf");
  _test_split("/", "");
  _test_split("", "asdf");
  _test_split("", "");
}


x86 assembly (clang, -O0):
<test_split>:
push   %rbp
mov    %rsp,%rbp
lea    0xeea(%rip),%rdi
lea    0xede(%rip),%rsi
call   1030 <_test_split@plt>
lea    0xed7(%rip),%rsi
mov    %rsi,%rdi
call   1030 <_test_split@plt>
lea    0xec8(%rip),%rdi
lea    0xebd(%rip),%rsi
call   1030 <_test_split@plt>
lea    0xeb5(%rip),%rdi
lea    0xead(%rip),%rsi
call   1030 <_test_split@plt>
lea    0xea2(%rip),%rdi
lea    0xe9d(%rip),%rsi
call   1030 <_test_split@plt>
lea    0xe8f(%rip),%rdi
lea    0xe89(%rip),%rsi
call   1030 <_test_split@plt>
lea    0xe7d(%rip),%rdi
lea    0xe77(%rip),%rsi
call   1030 <_test_split@plt>
lea    0xe6a(%rip),%rsi
mov    %rsi,%rdi
call   1030 <_test_split@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_split>:
push   %r15
push   %r14
push   %rbx
lea    0xee9(%rip),%rbx
lea    0xedd(%rip),%rsi
mov    %rbx,%rdi
call   1030 <_test_split@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1030 <_test_split@plt>
lea    0xec4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <_test_split@plt>
lea    0xeb8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <_test_split@plt>
lea    0xeac(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <_test_split@plt>
lea    0xe99(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <_test_split@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <_test_split@plt>
mov    %r15,%rdi
mov    %r15,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <_test_split@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
@.str.1 = [4 x i8] c"a/b\00"
@.str.2 = [3 x i8] c"/b\00"
@.str.3 = [3 x i8] c"a/\00"
@.str.4 = [5 x i8] c"asdf\00"
@.str.5 = [1 x i8] zeroinitializer
define void @test_split() {
%1 = call i32 @_test_split(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @_test_split(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @_test_split(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @_test_split(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @_test_split(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 @_test_split(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0))
%7 = call i32 @_test_split(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%8 = call i32 @_test_split(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
@.str.1 = [4 x i8] c"a/b\00"
@.str.2 = [3 x i8] c"/b\00"
@.str.3 = [3 x i8] c"a/\00"
@.str.4 = [5 x i8] c"asdf\00"
@.str.5 = [1 x i8] zeroinitializer
define void @test_split() {
%1 = tail call i32 @_test_split(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @_test_split(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @_test_split(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @_test_split(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @_test_split(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%6 = tail call i32 @_test_split(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0))
%7 = tail call i32 @_test_split(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%8 = tail call i32 @_test_split(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0))
ret void
}