#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*/ _globdir_split_pattern(char *);
int /*<<< orphan*/ is(int /*<<< orphan*/, char *, int, char *, char *, char *,
                      ...);
int tap_finish();
int /*<<< orphan*/ tap_plan(int);
int main(void) {
  tap_plan(4);
  is(_globdir_split_pattern("foo/bar"), "_globdir_split_pattern(\"foo/bar\")",
     41, "foo", "bar", NULL);
  is(_globdir_split_pattern("foo/bar/"), "_globdir_split_pattern(\"foo/bar/\")",
     42, "foo", "bar", "/", NULL);
  is(_globdir_split_pattern("/foo/bar/"),
     "_globdir_split_pattern(\"/foo/bar/\")", 43, "/", "foo", "bar", "/", NULL);
  is(_globdir_split_pattern("//foo//bar//"),
     "_globdir_split_pattern(\"//foo//bar//\")", 44, "/", "foo", "bar", "/",
     NULL);
  return tap_finish();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <tap_plan@plt>
lea    0xea0(%rip),%rdi
call   1030 <_globdir_split_pattern@plt>
mov    %eax,%edi
lea    0xe9a(%rip),%rsi
mov    $0x29,%edx
lea    0xeb0(%rip),%rcx
lea    0xe83(%rip),%r8
xor    %eax,%eax
mov    %eax,%r9d
mov    $0x0,%al
call   1050 <is@plt>
lea    0xebe(%rip),%rdi
call   1030 <_globdir_split_pattern@plt>
mov    %eax,%edi
lea    0xe8c(%rip),%rsi
mov    $0x2a,%edx
lea    0xe7c(%rip),%rcx
lea    0xe4f(%rip),%r8
lea    0xece(%rip),%r9
xor    %eax,%eax
movq   $0x0,(%rsp)
mov    $0x0,%al
call   1050 <is@plt>
lea    0xe7d(%rip),%rdi
call   1030 <_globdir_split_pattern@plt>
mov    %eax,%edi
lea    0xe79(%rip),%rsi
mov    $0x2b,%edx
lea    0xe9c(%rip),%rax
lea    0xe35(%rip),%r8
lea    0xe08(%rip),%r9
xor    %ecx,%ecx
mov    %rax,%rcx
mov    %rax,(%rsp)
movq   $0x0,0x8(%rsp)
mov    $0x0,%al
call   1050 <is@plt>
lea    0xe63(%rip),%rdi
call   1030 <_globdir_split_pattern@plt>
mov    %eax,%edi
lea    0xe62(%rip),%rsi
mov    $0x2c,%edx
lea    0xe54(%rip),%rax
lea    0xded(%rip),%r8
lea    0xdc0(%rip),%r9
xor    %ecx,%ecx
mov    %rax,%rcx
mov    %rax,(%rsp)
movq   $0x0,0x8(%rsp)
mov    $0x0,%al
call   1050 <is@plt>
mov    $0x0,%al
call   1060 <tap_finish@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x4,%edi
call   1040 <tap_plan@plt>
lea    0xeaa(%rip),%rdi
call   1030 <_globdir_split_pattern@plt>
lea    0xea6(%rip),%rsi
lea    0xec1(%rip),%r15
lea    0xe94(%rip),%r14
mov    %eax,%edi
mov    $0x29,%edx
mov    %r15,%rcx
mov    %r14,%r8
xor    %r9d,%r9d
xor    %eax,%eax
call   1050 <is@plt>
lea    0xec4(%rip),%rdi
call   1030 <_globdir_split_pattern@plt>
sub    $0x8,%rsp
lea    0xe90(%rip),%rsi
lea    0xee5(%rip),%rbx
mov    %eax,%edi
mov    $0x2a,%edx
mov    %r15,%rcx
mov    %r14,%r8
mov    %rbx,%r9
xor    %eax,%eax
push   $0x0
call   1050 <is@plt>
add    $0x10,%rsp
lea    0xe88(%rip),%rdi
call   1030 <_globdir_split_pattern@plt>
lea    0xe86(%rip),%rsi
mov    %eax,%edi
mov    $0x2b,%edx
mov    %rbx,%rcx
mov    %r15,%r8
mov    %r14,%r9
xor    %eax,%eax
push   $0x0
push   %rbx
call   1050 <is@plt>
add    $0x10,%rsp
lea    0xe85(%rip),%rdi
call   1030 <_globdir_split_pattern@plt>
lea    0xe86(%rip),%rsi
mov    %eax,%edi
mov    $0x2c,%edx
mov    %rbx,%rcx
mov    %r15,%r8
mov    %r14,%r9
xor    %eax,%eax
push   $0x0
push   %rbx
call   1050 <is@plt>
add    $0x10,%rsp
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <tap_finish@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"foo/bar\00"
@.str.1 = [34 x i8] c"_globdir_split_pattern(\22foo/bar\22)\00"
@.str.2 = [4 x i8] c"foo\00"
@.str.3 = [4 x i8] c"bar\00"
@.str.4 = [9 x i8] c"foo/bar/\00"
@.str.5 = [35 x i8] c"_globdir_split_pattern(\22foo/bar/\22)\00"
@.str.6 = [2 x i8] c"/\00"
@.str.7 = [10 x i8] c"/foo/bar/\00"
@.str.8 = [36 x i8] c"_globdir_split_pattern(\22/foo/bar/\22)\00"
@.str.9 = [13 x i8] c"//foo//bar//\00"
@.str.10 = [39 x i8] c"_globdir_split_pattern(\22//foo//bar//\22)\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @tap_plan(i32 4)
%3 = call i32 @_globdir_split_pattern(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i32, i8*, i32, i8*, i8*, i8*, ...) @is(i32 %3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 41, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* null)
%5 = call i32 @_globdir_split_pattern(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 (i32, i8*, i32, i8*, i8*, i8*, ...) @is(i32 %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), i32 42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8* null)
%7 = call i32 @_globdir_split_pattern(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%8 = call i32 (i32, i8*, i32, i8*, i8*, i8*, ...) @is(i32 %7, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.8, i64 0, i64 0), i32 43, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8* null)
%9 = call i32 @_globdir_split_pattern(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0))
%10 = call i32 (i32, i8*, i32, i8*, i8*, i8*, ...) @is(i32 %9, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.10, i64 0, i64 0), i32 44, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8* null)
%11 = call i32 (...) @tap_finish()
ret i32 %11
}

LLVM IR (-O2):
@.str = [8 x i8] c"foo/bar\00"
@.str.1 = [34 x i8] c"_globdir_split_pattern(\22foo/bar\22)\00"
@.str.2 = [4 x i8] c"foo\00"
@.str.3 = [4 x i8] c"bar\00"
@.str.4 = [9 x i8] c"foo/bar/\00"
@.str.5 = [35 x i8] c"_globdir_split_pattern(\22foo/bar/\22)\00"
@.str.6 = [2 x i8] c"/\00"
@.str.7 = [10 x i8] c"/foo/bar/\00"
@.str.8 = [36 x i8] c"_globdir_split_pattern(\22/foo/bar/\22)\00"
@.str.9 = [13 x i8] c"//foo//bar//\00"
@.str.10 = [39 x i8] c"_globdir_split_pattern(\22//foo//bar//\22)\00"
define i32 @main() {
%1 = tail call i32 @tap_plan(i32 4)
%2 = tail call i32 @_globdir_split_pattern(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i32, i8*, i32, i8*, i8*, i8*, ...) @is(i32 %2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 41, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* null)
%4 = tail call i32 @_globdir_split_pattern(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%5 = tail call i32 (i32, i8*, i32, i8*, i8*, i8*, ...) @is(i32 %4, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), i32 42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8* null)
%6 = tail call i32 @_globdir_split_pattern(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%7 = tail call i32 (i32, i8*, i32, i8*, i8*, i8*, ...) @is(i32 %6, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.8, i64 0, i64 0), i32 43, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8* null)
%8 = tail call i32 @_globdir_split_pattern(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0))
%9 = tail call i32 (i32, i8*, i32, i8*, i8*, i8*, ...) @is(i32 %8, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.10, i64 0, i64 0), i32 44, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8* null)
%10 = tail call i32 (...) @tap_finish()
ret i32 %10
}