#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 kmod_module {
  int dummy;
};
struct kmod_list {
  int dummy;
};
struct kmod_ctx {
  int dummy;
};

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
struct kmod_list *kmod_list_next(struct kmod_list *, struct kmod_list *);
struct kmod_list *kmod_module_get_holders(struct kmod_module *);
struct kmod_module *kmod_module_get_module(struct kmod_list *);
char *kmod_module_get_name(struct kmod_module *);
int kmod_module_get_refcnt(struct kmod_module *);
long kmod_module_get_size(struct kmod_module *);
int kmod_module_new_from_loaded(struct kmod_ctx *, struct kmod_list **);
int /*<<< orphan*/ kmod_module_unref(struct kmod_module *);
int /*<<< orphan*/ kmod_module_unref_list(struct kmod_list *);
struct kmod_ctx *kmod_new(int /*<<< orphan*/ *, char const **);
int /*<<< orphan*/ kmod_unref(struct kmod_ctx *);
int /*<<< orphan*/ printf(char *, char const *, long, int);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
char *strerror(int);
int do_lsmod(int argc, char *argv[]) {
  struct kmod_ctx *ctx;
  const char *null_config = NULL;
  struct kmod_list *list, *itr;
  int err;
  if (argc != 1) {
    fprintf(stderr, "Usage: %s\n", argv[0]);
    return EXIT_FAILURE;
  }
  ctx = kmod_new(NULL, &null_config);
  if (ctx == NULL) {
    fputs("Error: kmod_new() failed!\n", stderr);
    return EXIT_FAILURE;
  }
  err = kmod_module_new_from_loaded(ctx, &list);
  if (err < 0) {
    fprintf(stderr, "Error: could not get list of modules: %s\n",
            strerror(-err));
    kmod_unref(ctx);
    return EXIT_FAILURE;
  }
  puts("Module                  Size  Used by");
  for (itr = list; itr != NULL; itr = kmod_list_next(list, itr)) {
    struct kmod_module *mod = kmod_module_get_module(itr);
    const char *name = kmod_module_get_name(mod);
    int use_count = kmod_module_get_refcnt(mod);
    long size = kmod_module_get_size(mod);
    struct kmod_list *holders, *hitr;
    int first = 1;
    printf("%-19s %8ld  %d ", name, size, use_count);
    holders = kmod_module_get_holders(mod);
    for (hitr = holders; hitr != NULL; hitr = kmod_list_next(holders, hitr)) {
      struct kmod_module *hm = kmod_module_get_module(hitr);
      if (!first)
        putchar(',');
      else
        first = 0;
      fputs(kmod_module_get_name(hm), stdout);
      kmod_module_unref(hm);
    }
    putchar('\n');
    kmod_module_unref_list(holders);
    kmod_module_unref(mod);
  }
  kmod_module_unref_list(list);
  kmod_unref(ctx);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<do_lsmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     1261 <do_lsmod+0x51>
mov    0x2da5(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xdb5(%rip),%rsi
call   10e0 <fprintf@plt>
mov    0x2d81(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1445 <do_lsmod+0x235>
xor    %eax,%eax
mov    %eax,%edi
lea    -0x20(%rbp),%rsi
call   10d0 <kmod_new@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    12a3 <do_lsmod+0x93>
mov    0x2d5c(%rip),%rax
mov    (%rax),%esi
lea    0xd7e(%rip),%rdi
call   10a0 <fputs@plt>
mov    0x2d3f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1445 <do_lsmod+0x235>
mov    -0x18(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   10c0 <kmod_module_new_from_loaded@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jge    12ff <do_lsmod+0xef>
mov    0x2d1c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x7c(%rbp)
xor    %edi,%edi
sub    -0x34(%rbp),%edi
call   1130 <strerror@plt>
mov    -0x7c(%rbp),%edi
mov    %rax,%rdx
lea    0xd46(%rip),%rsi
call   10e0 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   10f0 <kmod_unref@plt>
mov    0x2ce3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1445 <do_lsmod+0x235>
lea    0xd4a(%rip),%rdi
call   1050 <puts@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     1427 <do_lsmod+0x217>
mov    -0x30(%rbp),%rdi
call   1030 <kmod_module_get_module@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
call   1100 <kmod_module_get_name@plt>
mov    %rax,-0x48(%rbp)
mov    -0x40(%rbp),%rdi
call   1120 <kmod_module_get_refcnt@plt>
mov    %eax,-0x4c(%rbp)
mov    -0x40(%rbp),%rdi
call   1110 <kmod_module_get_size@plt>
mov    %rax,-0x58(%rbp)
movl   $0x1,-0x6c(%rbp)
mov    -0x48(%rbp),%rsi
mov    -0x58(%rbp),%rdx
mov    -0x4c(%rbp),%ecx
lea    0xd0c(%rip),%rdi
call   1090 <printf@plt>
mov    -0x40(%rbp),%rdi
call   1070 <kmod_module_get_holders@plt>
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x68(%rbp)
je     13f5 <do_lsmod+0x1e5>
mov    -0x68(%rbp),%rdi
call   1030 <kmod_module_get_module@plt>
mov    %rax,-0x78(%rbp)
cmpl   $0x0,-0x6c(%rbp)
jne    13b5 <do_lsmod+0x1a5>
mov    $0x2c,%edi
call   1040 <putchar@plt>
jmp    13bc <do_lsmod+0x1ac>
movl   $0x0,-0x6c(%rbp)
mov    -0x78(%rbp),%rdi
call   1100 <kmod_module_get_name@plt>
mov    %rax,%rdi
mov    0x2c01(%rip),%rax
mov    (%rax),%esi
call   10a0 <fputs@plt>
mov    -0x78(%rbp),%rdi
call   1080 <kmod_module_unref@plt>
mov    -0x60(%rbp),%rdi
mov    -0x68(%rbp),%rsi
call   10b0 <kmod_list_next@plt>
mov    %rax,-0x68(%rbp)
jmp    1384 <do_lsmod+0x174>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    -0x60(%rbp),%rdi
call   1060 <kmod_module_unref_list@plt>
mov    -0x40(%rbp),%rdi
call   1080 <kmod_module_unref@plt>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   10b0 <kmod_list_next@plt>
mov    %rax,-0x30(%rbp)
jmp    1313 <do_lsmod+0x103>
mov    -0x28(%rbp),%rdi
call   1060 <kmod_module_unref_list@plt>
mov    -0x18(%rbp),%rdi
call   10f0 <kmod_unref@plt>
mov    0x2b88(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_lsmod>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
cmp    $0x1,%edi
jne    1398 <do_lsmod+0x188>
lea    0x10(%rsp),%rsi
xor    %edi,%edi
call   10d0 <kmod_new@plt>
test   %rax,%rax
je     13b9 <do_lsmod+0x1a9>
mov    %rax,%rbp
mov    %rsp,%rsi
mov    %rax,%rdi
call   10c0 <kmod_module_new_from_loaded@plt>
test   %eax,%eax
js     13e2 <do_lsmod+0x1d2>
lea    0xdee(%rip),%rdi
call   1050 <puts@plt>
mov    (%rsp),%r12
test   %r12,%r12
je     1416 <do_lsmod+0x206>
mov    %rbp,0x8(%rsp)
mov    0x2d50(%rip),%r15
jmp    12c2 <do_lsmod+0xb2>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    %rbx,%rdi
call   1060 <kmod_module_unref_list@plt>
mov    %r13,%rdi
call   1080 <kmod_module_unref@plt>
mov    (%rsp),%rdi
mov    %r12,%rsi
call   10b0 <kmod_list_next@plt>
mov    %rax,%r12
test   %rax,%rax
je     13d7 <do_lsmod+0x1c7>
mov    %r12,%rdi
call   1030 <kmod_module_get_module@plt>
mov    %rax,%r13
mov    %rax,%rdi
call   1100 <kmod_module_get_name@plt>
mov    %rax,%rbx
mov    %r13,%rdi
call   1120 <kmod_module_get_refcnt@plt>
mov    %eax,%ebp
mov    %r13,%rdi
call   1110 <kmod_module_get_size@plt>
lea    0xd85(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
mov    %ebp,%ecx
call   1090 <printf@plt>
mov    %r13,%rdi
call   1070 <kmod_module_get_holders@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1290 <do_lsmod+0x80>
mov    %rbx,%rdi
call   1030 <kmod_module_get_module@plt>
mov    %rax,%rbp
mov    %rax,%rdi
call   1100 <kmod_module_get_name@plt>
mov    (%r15),%esi
mov    %rax,%rdi
call   10a0 <fputs@plt>
mov    %rbp,%rdi
call   1080 <kmod_module_unref@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
call   10b0 <kmod_list_next@plt>
test   %rax,%rax
je     1290 <do_lsmod+0x80>
mov    %rax,%rbp
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
call   1030 <kmod_module_get_module@plt>
mov    %rax,%r14
mov    $0x2c,%edi
call   1040 <putchar@plt>
mov    %r14,%rdi
call   1100 <kmod_module_get_name@plt>
mov    (%r15),%esi
mov    %rax,%rdi
call   10a0 <fputs@plt>
mov    %r14,%rdi
call   1080 <kmod_module_unref@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   10b0 <kmod_list_next@plt>
mov    %rax,%rbp
test   %rax,%rax
jne    1350 <do_lsmod+0x140>
jmp    1290 <do_lsmod+0x80>
mov    0x2c41(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xc55(%rip),%rsi
call   10e0 <fprintf@plt>
mov    0x2c21(%rip),%rax
jmp    142c <do_lsmod+0x21c>
mov    0x2c20(%rip),%rax
mov    (%rax),%esi
lea    0xc42(%rip),%rdi
call   10a0 <fputs@plt>
mov    0x2c03(%rip),%rax
jmp    142c <do_lsmod+0x21c>
mov    (%rsp),%rdi
mov    0x8(%rsp),%rbp
jmp    1418 <do_lsmod+0x208>
mov    0x2bf7(%rip),%rcx
mov    (%rcx),%ebx
neg    %eax
mov    %eax,%edi
call   1130 <strerror@plt>
lea    0xc2b(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   10e0 <fprintf@plt>
mov    %rbp,%rdi
call   10f0 <kmod_unref@plt>
mov    0x2bc4(%rip),%rax
jmp    142c <do_lsmod+0x21c>
xor    %edi,%edi
call   1060 <kmod_module_unref_list@plt>
mov    %rbp,%rdi
call   10f0 <kmod_unref@plt>
mov    0x2b9c(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.kmod_ctx = type { i32 }
%struct.kmod_list = type { i32 }
%struct.kmod_module = type { i32 }
@stderr = global i32 0
@.str = [11 x i8] c"Usage: %s\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [27 x i8] c"Error: kmod_new() failed!\0A\00"
@.str.2 = [42 x i8] c"Error: could not get list of modules: %s\0A\00"
@.str.3 = [38 x i8] c"Module Size Used by\00"
@.str.4 = [16 x i8] c"%-19s %8ld %d \00"
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @do_lsmod(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.kmod_ctx*
%7 = alloca i8*
%8 = alloca %struct.kmod_list*
%9 = alloca %struct.kmod_list*
%10 = alloca i32
%11 = alloca %struct.kmod_module*
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i64
%15 = alloca %struct.kmod_list*
%16 = alloca %struct.kmod_list*
%17 = alloca i32
%18 = alloca %struct.kmod_module*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %7
%19 = load i32, i32* %4
%20 = icmp ne i32 %19, 1
br i1 %20, label %21, label %28
21: ; preds = %2
%22 = load i32, i32* @stderr
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 0
%25 = load i8*, i8** %24
%26 = call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %25)
%27 = load i32, i32* @EXIT_FAILURE
store i32 %27, i32* %3
br label %110
28: ; preds = %2
%29 = call %struct.kmod_ctx* @kmod_new(i32* null, i8** %7)
store %struct.kmod_ctx* %29, %struct.kmod_ctx** %6
%30 = load %struct.kmod_ctx*, %struct.kmod_ctx** %6
%31 = icmp eq %struct.kmod_ctx* %30, null
br i1 %31, label %32, label %36
32: ; preds = %28
%33 = load i32, i32* @stderr
%34 = call i32 @fputs(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %33)
%35 = load i32, i32* @EXIT_FAILURE
store i32 %35, i32* %3
br label %110
36: ; preds = %28
%37 = load %struct.kmod_ctx*, %struct.kmod_ctx** %6
%38 = call i32 @kmod_module_new_from_loaded(%struct.kmod_ctx* %37, %struct.kmod_list** %8)
store i32 %38, i32* %10
%39 = load i32, i32* %10
%40 = icmp slt i32 %39, 0
br i1 %40, label %41, label %50
41: ; preds = %36
%42 = load i32, i32* @stderr
%43 = load i32, i32* %10
%44 = sub nsw i32 0, %43
%45 = call i8* @strerror(i32 %44)
%46 = call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8* %45)
%47 = load %struct.kmod_ctx*, %struct.kmod_ctx** %6
%48 = call i32 @kmod_unref(%struct.kmod_ctx* %47)
%49 = load i32, i32* @EXIT_FAILURE
store i32 %49, i32* %3
br label %110
50: ; preds = %36
%51 = call i32 @puts(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%52 = load %struct.kmod_list*, %struct.kmod_list** %8
store %struct.kmod_list* %52, %struct.kmod_list** %9
br label %53
53: ; preds = %100, %50
%54 = load %struct.kmod_list*, %struct.kmod_list** %9
%55 = icmp ne %struct.kmod_list* %54, null
br i1 %55, label %56, label %104
56: ; preds = %53
%57 = load %struct.kmod_list*, %struct.kmod_list** %9
%58 = call %struct.kmod_module* @kmod_module_get_module(%struct.kmod_list* %57)
store %struct.kmod_module* %58, %struct.kmod_module** %11
%59 = load %struct.kmod_module*, %struct.kmod_module** %11
%60 = call i8* @kmod_module_get_name(%struct.kmod_module* %59)
store i8* %60, i8** %12
%61 = load %struct.kmod_module*, %struct.kmod_module** %11
%62 = call i32 @kmod_module_get_refcnt(%struct.kmod_module* %61)
store i32 %62, i32* %13
%63 = load %struct.kmod_module*, %struct.kmod_module** %11
%64 = call i64 @kmod_module_get_size(%struct.kmod_module* %63)
store i64 %64, i64* %14
store i32 1, i32* %17
%65 = load i8*, i8** %12
%66 = load i64, i64* %14
%67 = load i32, i32* %13
%68 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* %65, i64 %66, i32 %67)
%69 = load %struct.kmod_module*, %struct.kmod_module** %11
%70 = call %struct.kmod_list* @kmod_module_get_holders(%struct.kmod_module* %69)
store %struct.kmod_list* %70, %struct.kmod_list** %15
%71 = load %struct.kmod_list*, %struct.kmod_list** %15
store %struct.kmod_list* %71, %struct.kmod_list** %16
br label %72
72: ; preds = %90, %56
%73 = load %struct.kmod_list*, %struct.kmod_list** %16
%74 = icmp ne %struct.kmod_list* %73, null
br i1 %74, label %75, label %94
75: ; preds = %72
%76 = load %struct.kmod_list*, %struct.kmod_list** %16
%77 = call %struct.kmod_module* @kmod_module_get_module(%struct.kmod_list* %76)
store %struct.kmod_module* %77, %struct.kmod_module** %18
%78 = load i32, i32* %17
%79 = icmp ne i32 %78, 0
br i1 %79, label %82, label %80
80: ; preds = %75
%81 = call i32 @putchar(i8 signext 44)
br label %83
82: ; preds = %75
store i32 0, i32* %17
br label %83
83: ; preds = %82, %80
%84 = load %struct.kmod_module*, %struct.kmod_module** %18
%85 = call i8* @kmod_module_get_name(%struct.kmod_module* %84)
%86 = load i32, i32* @stdout
%87 = call i32 @fputs(i8* %85, i32 %86)
%88 = load %struct.kmod_module*, %struct.kmod_module** %18
%89 = call i32 @kmod_module_unref(%struct.kmod_module* %88)
br label %90
90: ; preds = %83
%91 = load %struct.kmod_list*, %struct.kmod_list** %15
%92 = load %struct.kmod_list*, %struct.kmod_list** %16
%93 = call %struct.kmod_list* @kmod_list_next(%struct.kmod_list* %91, %struct.kmod_list* %92)
store %struct.kmod_list* %93, %struct.kmod_list** %16
br label %72
94: ; preds = %72
%95 = call i32 @putchar(i8 signext 10)
%96 = load %struct.kmod_list*, %struct.kmod_list** %15
%97 = call i32 @kmod_module_unref_list(%struct.kmod_list* %96)
%98 = load %struct.kmod_module*, %struct.kmod_module** %11
%99 = call i32 @kmod_module_unref(%struct.kmod_module* %98)
br label %100
100: ; preds = %94
%101 = load %struct.kmod_list*, %struct.kmod_list** %8
%102 = load %struct.kmod_list*, %struct.kmod_list** %9
%103 = call %struct.kmod_list* @kmod_list_next(%struct.kmod_list* %101, %struct.kmod_list* %102)
store %struct.kmod_list* %103, %struct.kmod_list** %9
br label %53
104: ; preds = %53
%105 = load %struct.kmod_list*, %struct.kmod_list** %8
%106 = call i32 @kmod_module_unref_list(%struct.kmod_list* %105)
%107 = load %struct.kmod_ctx*, %struct.kmod_ctx** %6
%108 = call i32 @kmod_unref(%struct.kmod_ctx* %107)
%109 = load i32, i32* @EXIT_SUCCESS
store i32 %109, i32* %3
br label %110
110: ; preds = %104, %41, %32, %21
%111 = load i32, i32* %3
ret i32 %111
}

LLVM IR (-O2):
%struct.kmod_list = type { i32 }
%struct.kmod_ctx = type { i32 }
%struct.kmod_module = type { i32 }
@stderr = global i32 0
@.str = [11 x i8] c"Usage: %s\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [27 x i8] c"Error: kmod_new() failed!\0A\00"
@.str.2 = [42 x i8] c"Error: could not get list of modules: %s\0A\00"
@.str.3 = [38 x i8] c"Module Size Used by\00"
@.str.4 = [16 x i8] c"%-19s %8ld %d \00"
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @do_lsmod(i32 %0, i8** nocapture %1) {
%3 = alloca i8*
%4 = alloca %struct.kmod_list*
%5 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%6 = bitcast %struct.kmod_list** %4 to i8*
%7 = icmp eq i32 %0, 1
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %1
%11 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %71
12: ; preds = %2
%13 = call %struct.kmod_ctx* @kmod_new(i32* null, i8** %3)
%14 = icmp eq %struct.kmod_ctx* %13, null
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* @stderr
%17 = call i32 @fputs(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %16)
br label %71
18: ; preds = %12
%19 = call i32 @kmod_module_new_from_loaded(%struct.kmod_ctx* %13, %struct.kmod_list** %4)
%20 = icmp slt i32 %19, 0
br i1 %20, label %21, label %27
21: ; preds = %18
%22 = load i32, i32* @stderr
%23 = sub nsw i32 0, %19
%24 = call i8* @strerror(i32 %23)
%25 = call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8* %24)
%26 = call i32 @kmod_unref(%struct.kmod_ctx* %13)
br label %71
27: ; preds = %18
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%29 = load %struct.kmod_list*, %struct.kmod_list** %4
%30 = icmp eq %struct.kmod_list* %29, null
br i1 %30, label %67, label %31
31: ; preds = %27, %58
%32 = phi %struct.kmod_list* [ %63, %58 ], [ %29, %27 ]
%33 = call %struct.kmod_module* @kmod_module_get_module(%struct.kmod_list* %32)
%34 = call i8* @kmod_module_get_name(%struct.kmod_module* %33)
%35 = call i32 @kmod_module_get_refcnt(%struct.kmod_module* %33)
%36 = call i64 @kmod_module_get_size(%struct.kmod_module* %33)
%37 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* %34, i64 %36, i32 %35)
%38 = call %struct.kmod_list* @kmod_module_get_holders(%struct.kmod_module* %33)
%39 = icmp eq %struct.kmod_list* %38, null
br i1 %39, label %58, label %40
40: ; preds = %31
%41 = call %struct.kmod_module* @kmod_module_get_module(%struct.kmod_list* %38)
%42 = call i8* @kmod_module_get_name(%struct.kmod_module* %41)
%43 = load i32, i32* @stdout
%44 = call i32 @fputs(i8* %42, i32 %43)
%45 = call i32 @kmod_module_unref(%struct.kmod_module* %41)
%46 = call %struct.kmod_list* @kmod_list_next(%struct.kmod_list* %38, %struct.kmod_list* %38)
%47 = icmp eq %struct.kmod_list* %46, null
br i1 %47, label %58, label %48
48: ; preds = %40, %48
%49 = phi %struct.kmod_list* [ %56, %48 ], [ %46, %40 ]
%50 = call %struct.kmod_module* @kmod_module_get_module(%struct.kmod_list* %49)
%51 = call i32 @putchar(i8 signext 44)
%52 = call i8* @kmod_module_get_name(%struct.kmod_module* %50)
%53 = load i32, i32* @stdout
%54 = call i32 @fputs(i8* %52, i32 %53)
%55 = call i32 @kmod_module_unref(%struct.kmod_module* %50)
%56 = call %struct.kmod_list* @kmod_list_next(%struct.kmod_list* %38, %struct.kmod_list* %49)
%57 = icmp eq %struct.kmod_list* %56, null
br i1 %57, label %58, label %48
58: ; preds = %48, %40, %31
%59 = call i32 @putchar(i8 signext 10)
%60 = call i32 @kmod_module_unref_list(%struct.kmod_list* %38)
%61 = call i32 @kmod_module_unref(%struct.kmod_module* %33)
%62 = load %struct.kmod_list*, %struct.kmod_list** %4
%63 = call %struct.kmod_list* @kmod_list_next(%struct.kmod_list* %62, %struct.kmod_list* %32)
%64 = icmp eq %struct.kmod_list* %63, null
br i1 %64, label %65, label %31
65: ; preds = %58
%66 = load %struct.kmod_list*, %struct.kmod_list** %4
br label %67
67: ; preds = %65, %27
%68 = phi %struct.kmod_list* [ %66, %65 ], [ null, %27 ]
%69 = call i32 @kmod_module_unref_list(%struct.kmod_list* %68)
%70 = call i32 @kmod_unref(%struct.kmod_ctx* %13)
br label %71
71: ; preds = %67, %21, %15, %8
%72 = phi i32* [ @EXIT_FAILURE, %8 ], [ @EXIT_FAILURE, %15 ], [ @EXIT_FAILURE, %21 ], [ @EXIT_SUCCESS, %67 ]
%73 = load i32, i32* %72
ret i32 %73
}