#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 check_paranoid_setting(int, int);
int /*<<< orphan*/ test_fail(char *);
int /*<<< orphan*/ test_pass(char *);
int test_quiet();
int main(int argc, char **argv) {
  int quiet;
  int result = 0;
  char test_string[] =
      "Checking /proc/sys/kernel/perf_event_paranoid setting...";
  quiet = test_quiet();
  result = check_paranoid_setting(2, quiet);
  if (result < 0) {
    test_fail(test_string);
  }
  test_pass(test_string);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xe88(%rip),%rsi
mov    $0x39,%edx
call   1050 <memcpy@plt>
mov    $0x0,%al
call   1060 <test_quiet@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    $0x2,%edi
call   1040 <check_paranoid_setting@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    11af <main+0x5f>
lea    -0x60(%rbp),%rdi
call   1070 <test_fail@plt>
lea    -0x60(%rbp),%rdi
call   1030 <test_pass@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movups 0xede(%rip),%xmm0
movups %xmm0,0x29(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xead(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe91(%rip),%xmm0
movaps %xmm0,(%rsp)
xor    %eax,%eax
call   1050 <test_quiet@plt>
mov    $0x2,%edi
mov    %eax,%esi
call   1040 <check_paranoid_setting@plt>
test   %eax,%eax
jns    1192 <main+0x52>
mov    %rsp,%rdi
call   1060 <test_fail@plt>
mov    %rsp,%rdi
call   1030 <test_pass@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.test_string = [57 x i8] c"Checking /proc/sys/kernel/perf_event_paranoid setting...\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca [57 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
%9 = bitcast [57 x i8]* %8 to i8*
%10 = call i32 (...) @test_quiet()
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = call i32 @check_paranoid_setting(i32 2, i32 %11)
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = getelementptr inbounds [57 x i8], [57 x i8]* %8, i64 0, i64 0
%17 = call i32 @test_fail(i8* %16)
br label %18
18: ; preds = %15, %2
%19 = getelementptr inbounds [57 x i8], [57 x i8]* %8, i64 0, i64 0
%20 = call i32 @test_pass(i8* %19)
ret i32 0
}

LLVM IR (-O2):
@__const.main.test_string = [57 x i8] c"Checking /proc/sys/kernel/perf_event_paranoid setting...\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [57 x i8]
%4 = getelementptr inbounds [57 x i8], [57 x i8]* %3, i64 0, i64 0
%5 = tail call i32 (...) @test_quiet()
%6 = tail call i32 @check_paranoid_setting(i32 2, i32 %5)
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @test_fail(i8* %4)
br label %10
10: ; preds = %8, %2
%11 = call i32 @test_pass(i8* %4)
ret i32 0
}