#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ sleep(int);
int main(void) {
  FILE *fp;
  fp = fopen("/dev/kmsg", "w");
  fputs("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/cirosantilli/linux-kernel-module-cheat/refs/"
        "heads/master/userland/linux/time_boot.c"
        "\n",
        fp);
  fclose(fp);
  while (1)
    sleep(0xFFFFFFFF);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    0xead(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe9b(%rip),%rdi
call   1040 <fputs@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    $0xffffffff,%edi
call   1060 <sleep@plt>
jmp    117f <main+0x3f>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rdi
lea    0xebb(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
lea    0xeae(%rip),%rdi
mov    $0xae,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
nopl   0x0(%rax,%rax,1)
mov    $0xffffffff,%edi
call   1060 <sleep@plt>
jmp    1180 <main+0x40>

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/kmsg\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [175 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cirosantilli/linux-kernel-module-cheat/refs/heads/master/userland/linux/time_boot.c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fputs(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @fclose(i32* %6)
br label %8
8: ; preds = %0, %8
%9 = call i32 @sleep(i32 -1)
br label %8
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/kmsg\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [175 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cirosantilli/linux-kernel-module-cheat/refs/heads/master/userland/linux/time_boot.c\0A\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str.2, i64 0, i64 0), i64 174, i64 1, i32* %1)
%3 = tail call i32 @fclose(i32* %1)
br label %4
4: ; preds = %4, %0
%5 = tail call i32 @sleep(i32 -1)
br label %4
}