int util_insmod(char *module) {
  int ret = 0;
  ret = insmod_internal(module);
  if (ret)
    hu_log(6, "hu_uti", __func__, "util_insmod module: \"%s\"  ret: %d", module,
           ret);
  else
    hu_log(3, "hu_uti", __func__, "util_insmod module: \"%s\"  success ret: %d",
           module, ret);
  return (ret);
}


x86 assembly (clang, -O0):
<util_insmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <insmod_internal@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1179 <util_insmod+0x59>
mov    -0x8(%rbp),%r8
mov    -0xc(%rbp),%r9d
mov    $0x6,%edi
lea    0xea1(%rip),%rsi
lea    0xea1(%rip),%rdx
lea    0xea6(%rip),%rcx
mov    $0x0,%al
call   1040 <hu_log@plt>
jmp    11a2 <util_insmod+0x82>
mov    -0x8(%rbp),%r8
mov    -0xc(%rbp),%r9d
mov    $0x3,%edi
lea    0xe73(%rip),%rsi
lea    0xe73(%rip),%rdx
lea    0xe9a(%rip),%rcx
mov    $0x0,%al
call   1040 <hu_log@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_insmod>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <insmod_internal@plt>
mov    %eax,%ebx
lea    0xec9(%rip),%rsi
lea    0xec9(%rip),%rdx
test   %eax,%eax
je     1156 <util_insmod+0x36>
lea    0xeca(%rip),%rcx
mov    $0x6,%edi
mov    %r14,%r8
mov    %ebx,%r9d
jmp    1168 <util_insmod+0x48>
lea    0xed8(%rip),%rcx
mov    $0x3,%edi
mov    %r14,%r8
xor    %r9d,%r9d
xor    %eax,%eax
call   1040 <hu_log@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"hu_uti\00"
@__func__.util_insmod = [12 x i8] c"util_insmod\00"
@.str.1 = [34 x i8] c"util_insmod module: \22%s\22 ret: %d\00"
@.str.2 = [42 x i8] c"util_insmod module: \22%s\22 success ret: %d\00"
define i32 @util_insmod(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @insmod_internal to i32 (i8*, ...)*)(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = load i32, i32* %3
%11 = call i32 (i32, i8*, i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, i8*, i32, ...)*)(i32 6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.util_insmod, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %9, i32 %10)
br label %16
12: ; preds = %1
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = call i32 (i32, i8*, i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, i8*, i32, ...)*)(i32 3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.util_insmod, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8* %13, i32 %14)
br label %16
16: ; preds = %12, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [7 x i8] c"hu_uti\00"
@__func__.util_insmod = [12 x i8] c"util_insmod\00"
@.str.1 = [34 x i8] c"util_insmod module: \22%s\22 ret: %d\00"
@.str.2 = [42 x i8] c"util_insmod module: \22%s\22 success ret: %d\00"
define i32 @util_insmod(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @insmod_internal to i32 (i8*, ...)*)(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (i32, i8*, i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, i8*, i32, ...)*)(i32 6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.util_insmod, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %2)
br label %8
6: ; preds = %1
%7 = tail call i32 (i32, i8*, i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, i8*, i32, ...)*)(i32 3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.util_insmod, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8* %0, i32 0)
br label %8
8: ; preds = %6, %4
ret i32 %2
}