#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 */
scalar_t__ geteuid();
int /*<<< orphan*/ ksft_exit_fail();
int /*<<< orphan*/ ksft_exit_pass();
int /*<<< orphan*/ ksft_exit_skip(char *);
scalar_t__ ksft_get_error_cnt();
scalar_t__ ksft_get_fail_cnt();
int /*<<< orphan*/ ksft_print_header();
int /*<<< orphan*/ ksft_set_plan(int);
int /*<<< orphan*/ test_openat2_opath_tests();
int main(int argc, char **argv) {
  ksft_print_header();
  ksft_set_plan(88);
  if (geteuid() != 0)
    ksft_exit_skip("all tests require euid == 0\n");
  test_openat2_opath_tests();
  if (ksft_get_fail_cnt() + ksft_get_error_cnt() > 0)
    ksft_exit_fail();
  else
    ksft_exit_pass();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   10b0 <ksft_print_header@plt>
mov    $0x58,%edi
call   1030 <ksft_set_plan@plt>
mov    $0x0,%al
call   1070 <geteuid@plt>
cmp    $0x0,%rax
je     11d4 <main+0x44>
lea    0xe31(%rip),%rdi
call   1060 <ksft_exit_skip@plt>
mov    $0x0,%al
call   10a0 <test_openat2_opath_tests@plt>
mov    $0x0,%al
call   1090 <ksft_get_fail_cnt@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1080 <ksft_get_error_cnt@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
cmp    $0x0,%rax
jle    120d <main+0x7d>
mov    $0x0,%al
call   1050 <ksft_exit_fail@plt>
jmp    1214 <main+0x84>
mov    $0x0,%al
call   1040 <ksft_exit_pass@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   10b0 <ksft_print_header@plt>
mov    $0x58,%edi
call   1030 <ksft_set_plan@plt>
xor    %eax,%eax
call   1070 <geteuid@plt>
test   %rax,%rax
je     11ba <main+0x2a>
lea    0xe4b(%rip),%rdi
call   1060 <ksft_exit_skip@plt>
xor    %eax,%eax
call   10a0 <test_openat2_opath_tests@plt>
xor    %eax,%eax
call   1090 <ksft_get_fail_cnt@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1080 <ksft_get_error_cnt@plt>
add    %rbx,%rax
jle    11e0 <main+0x50>
xor    %eax,%eax
call   1050 <ksft_exit_fail@plt>
jmp    11e7 <main+0x57>
xor    %eax,%eax
call   1040 <ksft_exit_pass@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"all tests require euid == 0\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @ksft_print_header()
%7 = call i32 @ksft_set_plan(i32 88)
%8 = call i64 (...) @geteuid()
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @ksft_exit_skip(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
%13 = call i32 (...) @test_openat2_opath_tests()
%14 = call i64 (...) @ksft_get_fail_cnt()
%15 = call i64 (...) @ksft_get_error_cnt()
%16 = add nsw i64 %14, %15
%17 = icmp sgt i64 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %12
%19 = call i32 (...) @ksft_exit_fail()
br label %22
20: ; preds = %12
%21 = call i32 (...) @ksft_exit_pass()
br label %22
22: ; preds = %20, %18
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@.str = [29 x i8] c"all tests require euid == 0\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @ksft_print_header()
%4 = tail call i32 @ksft_set_plan(i32 88)
%5 = tail call i64 (...) @geteuid()
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @ksft_exit_skip(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
%10 = tail call i32 (...) @test_openat2_opath_tests()
%11 = tail call i64 (...) @ksft_get_fail_cnt()
%12 = tail call i64 (...) @ksft_get_error_cnt()
%13 = add nsw i64 %12, %11
%14 = icmp sgt i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %9
%16 = tail call i32 (...) @ksft_exit_fail()
br label %19
17: ; preds = %9
%18 = tail call i32 (...) @ksft_exit_pass()
br label %19
19: ; preds = %17, %15
ret i32 0
}