#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*/ printf(char *);
int /*<<< orphan*/ test_str_sep(char *, char);
int main(int argc, const char *argv[]) {
  printf("\nWorking\n");
  test_str_sep("hi:this", ':');
  printf("\nWorking (long)\n");
  test_str_sep("hi:this:is:a:string", ':');
  printf("\nNo Seperators\n");
  test_str_sep("hi this is a string", ':');
  printf("\nOnly Seperators\n");
  test_str_sep("::::", ':');
  printf("\nNull Between\n");
  test_str_sep("Hi:::h:", ':');
  printf("\nStarts with\n");
  test_str_sep(":hi:this:is:a:string", ':');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
mov    $0x3a,%esi
call   1040 <test_str_sep@plt>
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
lea    0xf25(%rip),%rdi
mov    $0x3a,%esi
call   1040 <test_str_sep@plt>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
mov    $0x3a,%esi
call   1040 <test_str_sep@plt>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
mov    $0x3a,%esi
call   1040 <test_str_sep@plt>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
mov    $0x3a,%esi
call   1040 <test_str_sep@plt>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
mov    $0x3a,%esi
call   1040 <test_str_sep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf16(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
mov    $0x3a,%esi
call   1040 <test_str_sep@plt>
lea    0xf02(%rip),%rdi
call   1030 <puts@plt>
lea    0xed9(%rip),%rdi
mov    $0x3a,%esi
call   1040 <test_str_sep@plt>
lea    0xef5(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9a(%rip),%rdi
mov    $0x3a,%esi
call   1040 <test_str_sep@plt>
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
lea    0xe91(%rip),%rdi
mov    $0x3a,%esi
call   1040 <test_str_sep@plt>
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xe79(%rip),%rdi
mov    $0x3a,%esi
call   1040 <test_str_sep@plt>
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
lea    0xe64(%rip),%rdi
mov    $0x3a,%esi
call   1040 <test_str_sep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"\0AWorking\0A\00"
@.str.1 = [8 x i8] c"hi:this\00"
@.str.2 = [17 x i8] c"\0AWorking (long)\0A\00"
@.str.3 = [20 x i8] c"hi:this:is:a:string\00"
@.str.4 = [16 x i8] c"\0ANo Seperators\0A\00"
@.str.5 = [20 x i8] c"hi this is a string\00"
@.str.6 = [18 x i8] c"\0AOnly Seperators\0A\00"
@.str.7 = [5 x i8] c"::::\00"
@.str.8 = [15 x i8] c"\0ANull Between\0A\00"
@.str.9 = [8 x i8] c"Hi:::h:\00"
@.str.10 = [14 x i8] c"\0AStarts with\0A\00"
@.str.11 = [21 x i8] c":hi:this:is:a:string\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @test_str_sep(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8 signext 58)
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @test_str_sep(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8 signext 58)
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%10 = call i32 @test_str_sep(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i8 signext 58)
%11 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
%12 = call i32 @test_str_sep(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8 signext 58)
%13 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
%14 = call i32 @test_str_sep(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i8 signext 58)
%15 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
%16 = call i32 @test_str_sep(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i8 signext 58)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"hi:this\00"
@.str.3 = [20 x i8] c"hi:this:is:a:string\00"
@.str.5 = [20 x i8] c"hi this is a string\00"
@.str.7 = [5 x i8] c"::::\00"
@.str.9 = [8 x i8] c"Hi:::h:\00"
@.str.11 = [21 x i8] c":hi:this:is:a:string\00"
@str = [9 x i8] c"\0AWorking\00"
@str.12 = [16 x i8] c"\0AWorking (long)\00"
@str.13 = [15 x i8] c"\0ANo Seperators\00"
@str.14 = [17 x i8] c"\0AOnly Seperators\00"
@str.15 = [14 x i8] c"\0ANull Between\00"
@str.16 = [13 x i8] c"\0AStarts with\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @test_str_sep(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8 signext 58)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.12, i64 0, i64 0))
%6 = tail call i32 @test_str_sep(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8 signext 58)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.13, i64 0, i64 0))
%8 = tail call i32 @test_str_sep(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i8 signext 58)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.14, i64 0, i64 0))
%10 = tail call i32 @test_str_sep(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8 signext 58)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.15, i64 0, i64 0))
%12 = tail call i32 @test_str_sep(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i8 signext 58)
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.16, i64 0, i64 0))
%14 = tail call i32 @test_str_sep(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i8 signext 58)
ret i32 0
}