void arch_reset(int mode, const char *cmd) {
  printk("RESTART_DEBUG : "
         "%s->%s->%d->mode=%c cmd=%s"
         "\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/crewrktablets/rk29_kernel_2.6/refs/heads/"
         "master/arch/arm/mach-rk2818/include/mach/system.h",
         __FUNCTION__, 48, mode, cmd);
  printk("Can't reboot. Please open rk2818 power manage!!\n");
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<arch_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%r8d
mov    -0x10(%rbp),%r9
lea    0xed2(%rip),%rdi
lea    0xef7(%rip),%rsi
lea    0xfa5(%rip),%rdx
mov    $0x30,%ecx
mov    $0x0,%al
call   1030 <printk@plt>
lea    0xf9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
jmp    1156 <arch_reset+0x46>

x86 assembly (clang, -O2):
<arch_reset>:
push   %rax
mov    %rsi,%r9
mov    %edi,%r8d
lea    0xee2(%rip),%rdi
lea    0xf07(%rip),%rsi
lea    0xfb5(%rip),%rdx
mov    $0x30,%ecx
xor    %eax,%eax
call   1030 <printk@plt>
lea    0xfad(%rip),%rdi
xor    %eax,%eax
call   1030 <printk@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    1150 <arch_reset+0x40>

LLVM IR (-O0):
@.str = [44 x i8] c"RESTART_DEBUG : %s->%s->%d->mode=%c cmd=%s\0A\00"
@.str.1 = [181 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/crewrktablets/rk29_kernel_2.6/refs/heads/master/arch/arm/mach-rk2818/include/mach/system.h\00"
@__FUNCTION__.arch_reset = [11 x i8] c"arch_reset\00"
@.str.2 = [49 x i8] c"Can't reboot. Please open rk2818 power manage!!\0A\00"
define void @arch_reset(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 (i8*, i8*, i8*, i32, i32, i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, i8*, i8*, i32, i32, i8*, ...)*)(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([181 x i8], [181 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.arch_reset, i64 0, i64 0), i32 48, i32 %5, i8* %6)
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %9, %2
br label %9
}

LLVM IR (-O2):
@.str = [44 x i8] c"RESTART_DEBUG : %s->%s->%d->mode=%c cmd=%s\0A\00"
@.str.1 = [181 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/crewrktablets/rk29_kernel_2.6/refs/heads/master/arch/arm/mach-rk2818/include/mach/system.h\00"
@__FUNCTION__.arch_reset = [11 x i8] c"arch_reset\00"
@.str.2 = [49 x i8] c"Can't reboot. Please open rk2818 power manage!!\0A\00"
define void @arch_reset(i32 %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, i8*, i32, i32, i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, i8*, i8*, i32, i32, i8*, ...)*)(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([181 x i8], [181 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.arch_reset, i64 0, i64 0), i32 48, i32 %0, i8* %1)
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
br label %5
5: ; preds = %5, %2
br label %5
}