#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 FindMatches(char *, char *, char ***);
scalar_t__ SplitPath(char *, char **, char **);
int /*<<< orphan*/ free(char *);
int rl_list_possib(char *pathname, char ***avp) {
  int ac;
  char *dir;
  char *file;
  if (SplitPath(pathname, &dir, &file) < 0)
    return 0;
  ac = FindMatches(dir, file, avp);
  free(dir);
  free(file);
  return ac;
}


x86 assembly (clang, -O0):
<rl_list_possib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x28(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1050 <SplitPath@plt>
cmp    $0x0,%rax
jge    1167 <rl_list_possib+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1193 <rl_list_possib+0x63>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <FindMatches@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rl_list_possib>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <SplitPath@plt>
test   %rax,%rax
js     1172 <rl_list_possib+0x42>
mov    0x8(%rsp),%rdi
mov    (%rsp),%rsi
mov    %rbx,%rdx
call   1040 <FindMatches@plt>
mov    %eax,%ebx
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
jmp    1174 <rl_list_possib+0x44>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rl_list_possib(i8* %0, i8*** %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8***
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %4
store i8*** %1, i8**** %5
%9 = load i8*, i8** %4
%10 = call i64 @SplitPath(i8* %9, i8** %7, i8** %8)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 0, i32* %3
br label %23
13: ; preds = %2
%14 = load i8*, i8** %7
%15 = load i8*, i8** %8
%16 = load i8***, i8**** %5
%17 = call i32 @FindMatches(i8* %14, i8* %15, i8*** %16)
store i32 %17, i32* %6
%18 = load i8*, i8** %7
%19 = call i32 @free(i8* %18)
%20 = load i8*, i8** %8
%21 = call i32 @free(i8* %20)
%22 = load i32, i32* %6
store i32 %22, i32* %3
br label %23
23: ; preds = %13, %12
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @rl_list_possib(i8* %0, i8*** %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = bitcast i8** %3 to i8*
%6 = bitcast i8** %4 to i8*
%7 = call i64 @SplitPath(i8* %0, i8** %3, i8** %4)
%8 = icmp slt i64 %7, 0
br i1 %8, label %17, label %9
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = call i32 @FindMatches(i8* %10, i8* %11, i8*** %1)
%13 = load i8*, i8** %3
%14 = call i32 @free(i8* %13)
%15 = load i8*, i8** %4
%16 = call i32 @free(i8* %15)
br label %17
17: ; preds = %2, %9
%18 = phi i32 [ %12, %9 ], [ 0, %2 ]
ret i32 %18
}