#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 /*<<< 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 1;
  }
  ctx = kmod_new(NULL, &null_config);
  if (ctx == NULL) {
    fputs("Error: kmod_new() failed!\n", stderr);
    return 1;
  }
  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 1;
  }
  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 0;
}


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     125c <do_lsmod+0x4c>
mov    0x2da5(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xdb5(%rip),%rsi
call   10e0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1431 <do_lsmod+0x221>
xor    %eax,%eax
mov    %eax,%edi
lea    -0x20(%rbp),%rsi
call   10d0 <kmod_new@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1299 <do_lsmod+0x89>
mov    0x2d61(%rip),%rax
mov    (%rax),%esi
lea    0xd83(%rip),%rdi
call   10a0 <fputs@plt>
movl   $0x1,-0x4(%rbp)
jmp    1431 <do_lsmod+0x221>
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    12f0 <do_lsmod+0xe0>
mov    0x2d26(%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    0xd50(%rip),%rsi
call   10e0 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   10f0 <kmod_unref@plt>
movl   $0x1,-0x4(%rbp)
jmp    1431 <do_lsmod+0x221>
lea    0xd59(%rip),%rdi
call   1050 <puts@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     1418 <do_lsmod+0x208>
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    0xd1b(%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     13e6 <do_lsmod+0x1d6>
mov    -0x68(%rbp),%rdi
call   1030 <kmod_module_get_module@plt>
mov    %rax,-0x78(%rbp)
cmpl   $0x0,-0x6c(%rbp)
jne    13a6 <do_lsmod+0x196>
mov    $0x2c,%edi
call   1040 <putchar@plt>
jmp    13ad <do_lsmod+0x19d>
movl   $0x0,-0x6c(%rbp)
mov    -0x78(%rbp),%rdi
call   1100 <kmod_module_get_name@plt>
mov    %rax,%rdi
mov    0x2c18(%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    1375 <do_lsmod+0x165>
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    1304 <do_lsmod+0xf4>
mov    -0x28(%rbp),%rdi
call   1060 <kmod_module_unref_list@plt>
mov    -0x18(%rbp),%rdi
call   10f0 <kmod_unref@plt>
movl   $0x0,-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    1399 <do_lsmod+0x189>
lea    0x10(%rsp),%rsi
xor    %edi,%edi
call   10d0 <kmod_new@plt>
test   %rax,%rax
je     13b8 <do_lsmod+0x1a8>
mov    %rax,%rbp
mov    %rsp,%rsi
mov    %rax,%rdi
call   10c0 <kmod_module_new_from_loaded@plt>
test   %eax,%eax
js     13e1 <do_lsmod+0x1d1>
lea    0xdee(%rip),%rdi
call   1050 <puts@plt>
mov    (%rsp),%r13
xor    %ebx,%ebx
test   %r13,%r13
je     1413 <do_lsmod+0x203>
mov    %rbp,0x8(%rsp)
mov    0x2d56(%rip),%r12
jmp    12c2 <do_lsmod+0xb2>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    %rbp,%rdi
call   1060 <kmod_module_unref_list@plt>
mov    %r15,%rdi
call   1080 <kmod_module_unref@plt>
mov    (%rsp),%rdi
mov    %r13,%rsi
call   10b0 <kmod_list_next@plt>
mov    %rax,%r13
test   %rax,%rax
je     13d4 <do_lsmod+0x1c4>
mov    %r13,%rdi
call   1030 <kmod_module_get_module@plt>
mov    %rax,%r15
mov    %rax,%rdi
call   1100 <kmod_module_get_name@plt>
mov    %rax,%rbp
mov    %r15,%rdi
call   1120 <kmod_module_get_refcnt@plt>
mov    %eax,%ebx
mov    %r15,%rdi
call   1110 <kmod_module_get_size@plt>
lea    0xd85(%rip),%rdi
mov    %rbp,%rsi
mov    %rax,%rdx
mov    %ebx,%ecx
call   1090 <printf@plt>
mov    %r15,%rdi
call   1070 <kmod_module_get_holders@plt>
mov    %rax,%rbp
test   %rax,%rax
je     1290 <do_lsmod+0x80>
mov    %rbp,%rdi
call   1030 <kmod_module_get_module@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1100 <kmod_module_get_name@plt>
mov    (%r12),%esi
mov    %rax,%rdi
call   10a0 <fputs@plt>
mov    %rbx,%rdi
call   1080 <kmod_module_unref@plt>
mov    %rbp,%rdi
mov    %rbp,%rsi
call   10b0 <kmod_list_next@plt>
test   %rax,%rax
je     1290 <do_lsmod+0x80>
mov    %rax,%r14
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <kmod_module_get_module@plt>
mov    %rax,%rbx
mov    $0x2c,%edi
call   1040 <putchar@plt>
mov    %rbx,%rdi
call   1100 <kmod_module_get_name@plt>
mov    (%r12),%esi
mov    %rax,%rdi
call   10a0 <fputs@plt>
mov    %rbx,%rdi
call   1080 <kmod_module_unref@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
call   10b0 <kmod_list_next@plt>
mov    %rax,%r14
test   %rax,%rax
jne    1350 <do_lsmod+0x140>
jmp    1290 <do_lsmod+0x80>
mov    0x2c40(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xc54(%rip),%rsi
call   10e0 <fprintf@plt>
mov    $0x1,%ebx
jmp    1422 <do_lsmod+0x212>
mov    0x2c21(%rip),%rax
mov    (%rax),%esi
lea    0xc43(%rip),%rdi
call   10a0 <fputs@plt>
mov    $0x1,%ebx
jmp    1422 <do_lsmod+0x212>
mov    (%rsp),%rdi
mov    0x8(%rsp),%rbp
xor    %ebx,%ebx
jmp    1415 <do_lsmod+0x205>
mov    0x2bf8(%rip),%rcx
mov    (%rcx),%ebx
neg    %eax
mov    %eax,%edi
call   1130 <strerror@plt>
lea    0xc2c(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   10e0 <fprintf@plt>
mov    %rbp,%rdi
call   10f0 <kmod_unref@plt>
mov    $0x1,%ebx
jmp    1422 <do_lsmod+0x212>
xor    %edi,%edi
call   1060 <kmod_module_unref_list@plt>
mov    %rbp,%rdi
call   10f0 <kmod_unref@plt>
mov    %ebx,%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"
@.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
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 %27
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)
store i32 1, i32* %3
br label %106
27: ; preds = %2
%28 = call %struct.kmod_ctx* @kmod_new(i32* null, i8** %7)
store %struct.kmod_ctx* %28, %struct.kmod_ctx** %6
%29 = load %struct.kmod_ctx*, %struct.kmod_ctx** %6
%30 = icmp eq %struct.kmod_ctx* %29, null
br i1 %30, label %31, label %34
31: ; preds = %27
%32 = load i32, i32* @stderr
%33 = call i32 @fputs(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %32)
store i32 1, i32* %3
br label %106
34: ; preds = %27
%35 = load %struct.kmod_ctx*, %struct.kmod_ctx** %6
%36 = call i32 @kmod_module_new_from_loaded(%struct.kmod_ctx* %35, %struct.kmod_list** %8)
store i32 %36, i32* %10
%37 = load i32, i32* %10
%38 = icmp slt i32 %37, 0
br i1 %38, label %39, label %47
39: ; preds = %34
%40 = load i32, i32* @stderr
%41 = load i32, i32* %10
%42 = sub nsw i32 0, %41
%43 = call i8* @strerror(i32 %42)
%44 = call i32 @fprintf(i32 %40, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8* %43)
%45 = load %struct.kmod_ctx*, %struct.kmod_ctx** %6
%46 = call i32 @kmod_unref(%struct.kmod_ctx* %45)
store i32 1, i32* %3
br label %106
47: ; preds = %34
%48 = call i32 @puts(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%49 = load %struct.kmod_list*, %struct.kmod_list** %8
store %struct.kmod_list* %49, %struct.kmod_list** %9
br label %50
50: ; preds = %97, %47
%51 = load %struct.kmod_list*, %struct.kmod_list** %9
%52 = icmp ne %struct.kmod_list* %51, null
br i1 %52, label %53, label %101
53: ; preds = %50
%54 = load %struct.kmod_list*, %struct.kmod_list** %9
%55 = call %struct.kmod_module* @kmod_module_get_module(%struct.kmod_list* %54)
store %struct.kmod_module* %55, %struct.kmod_module** %11
%56 = load %struct.kmod_module*, %struct.kmod_module** %11
%57 = call i8* @kmod_module_get_name(%struct.kmod_module* %56)
store i8* %57, i8** %12
%58 = load %struct.kmod_module*, %struct.kmod_module** %11
%59 = call i32 @kmod_module_get_refcnt(%struct.kmod_module* %58)
store i32 %59, i32* %13
%60 = load %struct.kmod_module*, %struct.kmod_module** %11
%61 = call i64 @kmod_module_get_size(%struct.kmod_module* %60)
store i64 %61, i64* %14
store i32 1, i32* %17
%62 = load i8*, i8** %12
%63 = load i64, i64* %14
%64 = load i32, i32* %13
%65 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* %62, i64 %63, i32 %64)
%66 = load %struct.kmod_module*, %struct.kmod_module** %11
%67 = call %struct.kmod_list* @kmod_module_get_holders(%struct.kmod_module* %66)
store %struct.kmod_list* %67, %struct.kmod_list** %15
%68 = load %struct.kmod_list*, %struct.kmod_list** %15
store %struct.kmod_list* %68, %struct.kmod_list** %16
br label %69
69: ; preds = %87, %53
%70 = load %struct.kmod_list*, %struct.kmod_list** %16
%71 = icmp ne %struct.kmod_list* %70, null
br i1 %71, label %72, label %91
72: ; preds = %69
%73 = load %struct.kmod_list*, %struct.kmod_list** %16
%74 = call %struct.kmod_module* @kmod_module_get_module(%struct.kmod_list* %73)
store %struct.kmod_module* %74, %struct.kmod_module** %18
%75 = load i32, i32* %17
%76 = icmp ne i32 %75, 0
br i1 %76, label %79, label %77
77: ; preds = %72
%78 = call i32 @putchar(i8 signext 44)
br label %80
79: ; preds = %72
store i32 0, i32* %17
br label %80
80: ; preds = %79, %77
%81 = load %struct.kmod_module*, %struct.kmod_module** %18
%82 = call i8* @kmod_module_get_name(%struct.kmod_module* %81)
%83 = load i32, i32* @stdout
%84 = call i32 @fputs(i8* %82, i32 %83)
%85 = load %struct.kmod_module*, %struct.kmod_module** %18
%86 = call i32 @kmod_module_unref(%struct.kmod_module* %85)
br label %87
87: ; preds = %80
%88 = load %struct.kmod_list*, %struct.kmod_list** %15
%89 = load %struct.kmod_list*, %struct.kmod_list** %16
%90 = call %struct.kmod_list* @kmod_list_next(%struct.kmod_list* %88, %struct.kmod_list* %89)
store %struct.kmod_list* %90, %struct.kmod_list** %16
br label %69
91: ; preds = %69
%92 = call i32 @putchar(i8 signext 10)
%93 = load %struct.kmod_list*, %struct.kmod_list** %15
%94 = call i32 @kmod_module_unref_list(%struct.kmod_list* %93)
%95 = load %struct.kmod_module*, %struct.kmod_module** %11
%96 = call i32 @kmod_module_unref(%struct.kmod_module* %95)
br label %97
97: ; preds = %91
%98 = load %struct.kmod_list*, %struct.kmod_list** %8
%99 = load %struct.kmod_list*, %struct.kmod_list** %9
%100 = call %struct.kmod_list* @kmod_list_next(%struct.kmod_list* %98, %struct.kmod_list* %99)
store %struct.kmod_list* %100, %struct.kmod_list** %9
br label %50
101: ; preds = %50
%102 = load %struct.kmod_list*, %struct.kmod_list** %8
%103 = call i32 @kmod_module_unref_list(%struct.kmod_list* %102)
%104 = load %struct.kmod_ctx*, %struct.kmod_ctx** %6
%105 = call i32 @kmod_unref(%struct.kmod_ctx* %104)
store i32 0, i32* %3
br label %106
106: ; preds = %101, %39, %31, %21
%107 = load i32, i32* %3
ret i32 %107
}

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"
@.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
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 [ 1, %8 ], [ 1, %15 ], [ 1, %21 ], [ 0, %67 ]
ret i32 %72
}