#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*/ ksft_exit_fail();
int /*<<< orphan*/ ksft_exit_pass();
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_flags();
int /*<<< orphan*/ test_openat2_struct();
int main(int argc, char **argv) {
  ksft_print_header();
  ksft_set_plan((13 * 7 + 24));
  test_openat2_struct();
  test_openat2_flags();
  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   10a0 <ksft_print_header@plt>
mov    $0x73,%edi
call   1030 <ksft_set_plan@plt>
mov    $0x0,%al
call   1080 <test_openat2_struct@plt>
mov    $0x0,%al
call   1090 <test_openat2_flags@plt>
mov    $0x0,%al
call   1070 <ksft_get_fail_cnt@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1060 <ksft_get_error_cnt@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
cmp    $0x0,%rax
jle    11e7 <main+0x67>
mov    $0x0,%al
call   1050 <ksft_exit_fail@plt>
jmp    11ee <main+0x6e>
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   10a0 <ksft_print_header@plt>
mov    $0x73,%edi
call   1030 <ksft_set_plan@plt>
xor    %eax,%eax
call   1080 <test_openat2_struct@plt>
xor    %eax,%eax
call   1090 <test_openat2_flags@plt>
xor    %eax,%eax
call   1070 <ksft_get_fail_cnt@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <ksft_get_error_cnt@plt>
add    %rbx,%rax
jle    11bf <main+0x3f>
xor    %eax,%eax
call   1050 <ksft_exit_fail@plt>
jmp    11c6 <main+0x46>
xor    %eax,%eax
call   1040 <ksft_exit_pass@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
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 115)
%8 = call i32 (...) @test_openat2_struct()
%9 = call i32 (...) @test_openat2_flags()
%10 = call i64 (...) @ksft_get_fail_cnt()
%11 = call i64 (...) @ksft_get_error_cnt()
%12 = add nsw i64 %10, %11
%13 = icmp sgt i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = call i32 (...) @ksft_exit_fail()
br label %18
16: ; preds = %2
%17 = call i32 (...) @ksft_exit_pass()
br label %18
18: ; preds = %16, %14
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @ksft_print_header()
%4 = tail call i32 @ksft_set_plan(i32 115)
%5 = tail call i32 (...) @test_openat2_struct()
%6 = tail call i32 (...) @test_openat2_flags()
%7 = tail call i64 (...) @ksft_get_fail_cnt()
%8 = tail call i64 (...) @ksft_get_error_cnt()
%9 = add nsw i64 %8, %7
%10 = icmp sgt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = tail call i32 (...) @ksft_exit_fail()
br label %15
13: ; preds = %2
%14 = tail call i32 (...) @ksft_exit_pass()
br label %15
15: ; preds = %13, %11
ret i32 0
}