#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 */
struct llib_list_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ llib_list_free(struct llib_list_t **);
int /*<<< orphan*/ llib_list_strings_dump(int, struct llib_list_t *);
int /*<<< orphan*/ llib_match_files_list(struct llib_list_t **, char *, int,
                                         int /*<<< orphan*/,
                                         int /*<<< orphan*/);
int /*<<< orphan*/ llib_print_f(int, char *);
int main(int argc, char *argv[]) {
  struct llib_list_t *files = (void *)0;
  int res = 0;
  if (!argv[1]) {
    llib_print_f(1, "usage: selfile selector_string\n");
    return 1;
  }
  if (!llib_match_files_list(&files, argv[1], 1, 0, 0))
    res = 1;
  else {
    res = 0;
    llib_list_strings_dump(1, files);
  }
  llib_list_free(&files);
  return res;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
jne    1191 <main+0x51>
mov    $0x1,%edi
lea    0xe80(%rip),%rsi
call   1030 <llib_print_f@plt>
movl   $0x1,-0x4(%rbp)
jmp    11e6 <main+0xa6>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    -0x18(%rbp),%rdi
mov    $0x1,%edx
xor    %r8d,%r8d
mov    %r8d,%ecx
call   1060 <llib_match_files_list@plt>
cmp    $0x0,%eax
jne    11c2 <main+0x82>
movl   $0x1,-0x1c(%rbp)
jmp    11d7 <main+0x97>
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rsi
mov    $0x1,%edi
call   1050 <llib_list_strings_dump@plt>
lea    -0x18(%rbp),%rdi
call   1040 <llib_list_free@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
mov    0x8(%rsi),%rsi
test   %rsi,%rsi
je     1191 <main+0x51>
lea    0x8(%rsp),%rdi
mov    $0x1,%ebx
mov    $0x1,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1060 <llib_match_files_list@plt>
test   %eax,%eax
je     1185 <main+0x45>
mov    0x8(%rsp),%rsi
mov    $0x1,%edi
call   1050 <llib_list_strings_dump@plt>
xor    %ebx,%ebx
lea    0x8(%rsp),%rdi
call   1040 <llib_list_free@plt>
jmp    11a7 <main+0x67>
lea    0xe68(%rip),%rsi
mov    $0x1,%ebx
mov    $0x1,%edi
call   1030 <llib_print_f@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.llib_list_t = type { i32 }
@.str = [32 x i8] c"usage: selfile selector_string\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.llib_list_t*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.llib_list_t* null, %struct.llib_list_t** %6
store i32 0, i32* %7
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = icmp ne i8* %10, null
br i1 %11, label %14, label %12
12: ; preds = %2
%13 = call i32 @llib_print_f(i32 1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %27
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @llib_match_files_list(%struct.llib_list_t** %6, i8* %17, i32 1, i32 0, i32 0)
%19 = icmp ne i32 %18, 0
br i1 %19, label %21, label %20
20: ; preds = %14
store i32 1, i32* %7
br label %24
21: ; preds = %14
store i32 0, i32* %7
%22 = load %struct.llib_list_t*, %struct.llib_list_t** %6
%23 = call i32 @llib_list_strings_dump(i32 1, %struct.llib_list_t* %22)
br label %24
24: ; preds = %21, %20
%25 = call i32 @llib_list_free(%struct.llib_list_t** %6)
%26 = load i32, i32* %7
store i32 %26, i32* %3
br label %27
27: ; preds = %24, %12
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
%struct.llib_list_t = type { i32 }
@.str = [32 x i8] c"usage: selfile selector_string\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.llib_list_t*
%4 = bitcast %struct.llib_list_t** %3 to i8*
store %struct.llib_list_t* null, %struct.llib_list_t** %3
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @llib_print_f(i32 1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %19
10: ; preds = %2
%11 = call i32 @llib_match_files_list(%struct.llib_list_t** %3, i8* %6, i32 1, i32 0, i32 0)
%12 = icmp eq i32 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = load %struct.llib_list_t*, %struct.llib_list_t** %3
%15 = call i32 @llib_list_strings_dump(i32 1, %struct.llib_list_t* %14)
br label %16
16: ; preds = %10, %13
%17 = phi i32 [ 0, %13 ], [ 1, %10 ]
%18 = call i32 @llib_list_free(%struct.llib_list_t** %3)
br label %19
19: ; preds = %16, %8
%20 = phi i32 [ %17, %16 ], [ 1, %8 ]
ret i32 %20
}