#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*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ ll_free_list(char **);
char **ll_get_config_modules();
char **ll_get_io_modules();
int /*<<< orphan*/ ll_init();
int /*<<< orphan*/ ll_list_contains(char **, char *);
int /*<<< orphan*/ ll_list_print(char **);
int /*<<< orphan*/ ll_lists_equal(char **, char **);
int /*<<< orphan*/ ll_print_module_info();
int /*<<< orphan*/ ll_stop();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  char *known_good_config_modules[] = {"flat_file.so", NULL};
  char **list;
  (void)argc;
  (void)argv;
  ll_init();
  printf("Getting the config modules: ");
  list = ll_get_config_modules();
  ll_list_print(list);
  assert(ll_lists_equal(known_good_config_modules, list));
  ll_free_list(list);
  printf("Getting the io modules: ");
  list = ll_get_io_modules();
  ll_list_print(list);
  assert(ll_list_contains(list, "stub.so"));
  assert(ll_list_contains(list, "raptor.so"));
  ll_free_list(list);
  printf("Getting module info:\n");
  ll_print_module_info();
  ll_stop();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2c43(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2c40(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   10a0 <ll_init@plt>
lea    0xe23(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <ll_get_config_modules@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   10d0 <ll_list_print@plt>
lea    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1080 <ll_lists_equal@plt>
mov    %eax,%edi
call   1070 <assert@plt>
mov    -0x28(%rbp),%rdi
call   10b0 <ll_free_list@plt>
lea    0xe03(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <ll_get_io_modules@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   10d0 <ll_list_print@plt>
mov    -0x28(%rbp),%rdi
lea    0xdf8(%rip),%rsi
call   10c0 <ll_list_contains@plt>
mov    %eax,%edi
call   1070 <assert@plt>
mov    -0x28(%rbp),%rdi
lea    0xde9(%rip),%rsi
call   10c0 <ll_list_contains@plt>
mov    %eax,%edi
call   1070 <assert@plt>
mov    -0x28(%rbp),%rdi
call   10b0 <ll_free_list@plt>
lea    0xdd7(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <ll_print_module_info@plt>
mov    $0x0,%al
call   1090 <ll_stop@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movaps 0x2c44(%rip),%xmm0
movaps %xmm0,(%rsp)
xor    %eax,%eax
call   10b0 <ll_init@plt>
lea    0xe2f(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
call   1070 <ll_get_config_modules@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   10e0 <ll_list_print@plt>
mov    %rsp,%rdi
mov    %rbx,%rsi
call   1090 <ll_lists_equal@plt>
mov    %eax,%edi
call   1080 <assert@plt>
mov    %rbx,%rdi
call   10c0 <ll_free_list@plt>
lea    0xe14(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
call   1030 <ll_get_io_modules@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   10e0 <ll_list_print@plt>
lea    0xe0f(%rip),%rsi
mov    %rbx,%rdi
call   10d0 <ll_list_contains@plt>
mov    %eax,%edi
call   1080 <assert@plt>
lea    0xe01(%rip),%rsi
mov    %rbx,%rdi
call   10d0 <ll_list_contains@plt>
mov    %eax,%edi
call   1080 <assert@plt>
mov    %rbx,%rdi
call   10c0 <ll_free_list@plt>
lea    0xded(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1040 <ll_print_module_info@plt>
xor    %eax,%eax
call   10a0 <ll_stop@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"flat_file.so\00"
@__const.main.known_good_config_modules = [2 x i8*] [i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i32 0, i32 0), i8* null]
@.str.1 = [29 x i8] c"Getting the config modules: \00"
@.str.2 = [25 x i8] c"Getting the io modules: \00"
@.str.3 = [8 x i8] c"stub.so\00"
@.str.4 = [10 x i8] c"raptor.so\00"
@.str.5 = [22 x i8] c"Getting module info:\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i8*]
%7 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [2 x i8*]* %6 to i8*
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = call i32 (...) @ll_init()
%12 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%13 = call i8** (...) @ll_get_config_modules()
store i8** %13, i8*** %7
%14 = load i8**, i8*** %7
%15 = call i32 @ll_list_print(i8** %14)
%16 = getelementptr inbounds [2 x i8*], [2 x i8*]* %6, i64 0, i64 0
%17 = load i8**, i8*** %7
%18 = call i32 @ll_lists_equal(i8** %16, i8** %17)
%19 = call i32 @assert(i32 %18)
%20 = load i8**, i8*** %7
%21 = call i32 @ll_free_list(i8** %20)
%22 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%23 = call i8** (...) @ll_get_io_modules()
store i8** %23, i8*** %7
%24 = load i8**, i8*** %7
%25 = call i32 @ll_list_print(i8** %24)
%26 = load i8**, i8*** %7
%27 = call i32 @ll_list_contains(i8** %26, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%28 = call i32 @assert(i32 %27)
%29 = load i8**, i8*** %7
%30 = call i32 @ll_list_contains(i8** %29, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%31 = call i32 @assert(i32 %30)
%32 = load i8**, i8*** %7
%33 = call i32 @ll_free_list(i8** %32)
%34 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%35 = call i32 (...) @ll_print_module_info()
%36 = call i32 (...) @ll_stop()
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"flat_file.so\00"
@__const.main.known_good_config_modules = [2 x i8*] [i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i32 0, i32 0), i8* null]
@.str.1 = [29 x i8] c"Getting the config modules: \00"
@.str.2 = [25 x i8] c"Getting the io modules: \00"
@.str.3 = [8 x i8] c"stub.so\00"
@.str.4 = [10 x i8] c"raptor.so\00"
@str = [21 x i8] c"Getting module info:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [2 x i8*]
%4 = bitcast [2 x i8*]* %3 to i8*
%5 = tail call i32 (...) @ll_init()
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i8** (...) @ll_get_config_modules()
%8 = tail call i32 @ll_list_print(i8** %7)
%9 = getelementptr inbounds [2 x i8*], [2 x i8*]* %3, i64 0, i64 0
%10 = call i32 @ll_lists_equal(i8** %9, i8** %7)
%11 = call i32 @assert(i32 %10)
%12 = call i32 @ll_free_list(i8** %7)
%13 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%14 = call i8** (...) @ll_get_io_modules()
%15 = call i32 @ll_list_print(i8** %14)
%16 = call i32 @ll_list_contains(i8** %14, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%17 = call i32 @assert(i32 %16)
%18 = call i32 @ll_list_contains(i8** %14, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%19 = call i32 @assert(i32 %18)
%20 = call i32 @ll_free_list(i8** %14)
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%22 = call i32 (...) @ll_print_module_info()
%23 = call i32 (...) @ll_stop()
ret i32 0
}