int param_get_autosanity(char *buffer, const struct kernel_param *kp) {
  printk("[autosanity] failed!\n");
  panic("%s[%s] autosanity failed!!!\n",
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/CryToCry96/android_kernel_mt6572/refs/heads/"
        "master/mediatek/kernel/drivers/autosanity/autosanity.c",
        __FUNCTION__);
  return 0;
}


x86 assembly (clang, -O0):
<param_get_autosanity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
lea    0xed1(%rip),%rdi
lea    0xee7(%rip),%rsi
lea    0xf9d(%rip),%rdx
mov    $0x0,%al
call   1040 <panic@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<param_get_autosanity>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printk@plt>
lea    0xee0(%rip),%rdi
lea    0xef6(%rip),%rsi
lea    0xfac(%rip),%rdx
xor    %eax,%eax
call   1040 <panic@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.kernel_param = type opaque
@.str = [22 x i8] c"[autosanity] failed!\0A\00"
@.str.1 = [29 x i8] c"%s[%s] autosanity failed!!!\0A\00"
@.str.2 = [189 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CryToCry96/android_kernel_mt6572/refs/heads/master/mediatek/kernel/drivers/autosanity/autosanity.c\00"
@__FUNCTION__.param_get_autosanity = [21 x i8] c"param_get_autosanity\00"
define i32 @param_get_autosanity(i8* %0, %struct.kernel_param* %1) {
%3 = alloca i8*
%4 = alloca %struct.kernel_param*
store i8* %0, i8** %3
store %struct.kernel_param* %1, %struct.kernel_param** %4
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @panic to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([189 x i8], [189 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__FUNCTION__.param_get_autosanity, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.kernel_param = type opaque
@.str = [22 x i8] c"[autosanity] failed!\0A\00"
@.str.1 = [29 x i8] c"%s[%s] autosanity failed!!!\0A\00"
@.str.2 = [189 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CryToCry96/android_kernel_mt6572/refs/heads/master/mediatek/kernel/drivers/autosanity/autosanity.c\00"
@__FUNCTION__.param_get_autosanity = [21 x i8] c"param_get_autosanity\00"
define i32 @param_get_autosanity(i8* nocapture readnone %0, %struct.kernel_param* nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @panic to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([189 x i8], [189 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__FUNCTION__.param_get_autosanity, i64 0, i64 0))
ret i32 0
}