#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 */

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int query_module(const char *name, int which, void *buf, size_t bufsize,
                 size_t *ret) {
  fprintf(stderr,
          "\n\nTo make this application work, you will need to recompile\n");
  fprintf(stderr,
          "with a kernel supporting the query_module system call. -Erik\n\n");
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<query_module>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    0xeed(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%ecx
mov    0x2e6b(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<query_module>:
push   %rbx
mov    0x2ec0(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf0e(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    0x2e8c(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [61 x i8] c"\0A\0ATo make this application work, you will need to recompile\0A\00"
@.str.1 = [63 x i8] c"with a kernel supporting the query_module system call. -Erik\0A\0A\00"
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @query_module(i8* %0, i32 %1, i8* %2, i64 %3, i64* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i64*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i64* %4, i64** %10
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
%15 = load i32, i32* @ENOSYS
store i32 %15, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [61 x i8] c"\0A\0ATo make this application work, you will need to recompile\0A\00"
@.str.1 = [63 x i8] c"with a kernel supporting the query_module system call. -Erik\0A\0A\00"
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @query_module(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i64 %3, i64* nocapture readnone %4) {
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* @ENOSYS
store i32 %10, i32* @errno
ret i32 -1
}