#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*/ cleanup();
int /*<<< orphan*/ exit(int);
int hugetlbfs_test_path(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_init(int, char **);
int main(int argc, char *argv[]) {
  int val;
  test_init(argc, argv);
  val = hugetlbfs_test_path("/");
  if (val)
    do {
      cleanup();
      printf("FAIL\t"
             "/ reports as hugetlbfs"
             "\n");
      exit(2);
    } while (0);
  do {
    cleanup();
    printf("PASS\n");
    exit(0);
  } while (0);
}


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <test_init@plt>
lea    0xe87(%rip),%rdi
call   1060 <hugetlbfs_test_path@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     11ad <main+0x5d>
jmp    1190 <main+0x40>
mov    $0x0,%al
call   1050 <cleanup@plt>
lea    0xe64(%rip),%rdi
call   1040 <printf@plt>
mov    $0x2,%edi
call   1070 <exit@plt>
jmp    11b2 <main+0x62>
mov    $0x0,%al
call   1050 <cleanup@plt>
lea    0xe5f(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
call   1030 <test_init@plt>
lea    0xea3(%rip),%rdi
call   1060 <hugetlbfs_test_path@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <cleanup@plt>
test   %ebx,%ebx
jne    1182 <main+0x32>
lea    0xe8c(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1070 <exit@plt>
lea    0xe7e(%rip),%rdi
call   1040 <puts@plt>
mov    $0x2,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
@.str.1 = [29 x i8] c"FAIL\09/ reports as hugetlbfs\0A\00"
@.str.2 = [6 x i8] c"PASS\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @test_init(i32 %7, i8** %8)
%10 = call i32 @hugetlbfs_test_path(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %2
br label %14
14: ; preds = %13
%15 = call i32 (...) @cleanup()
%16 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 @exit(i32 2)
unreachable
18: ; No predecessors!
br label %19
19: ; preds = %18, %2
br label %20
20: ; preds = %19
%21 = call i32 (...) @cleanup()
%22 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%23 = call i32 @exit(i32 0)
unreachable
24: ; No predecessors!
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
@str = [5 x i8] c"PASS\00"
@str.3 = [28 x i8] c"FAIL\09/ reports as hugetlbfs\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @test_init(i32 %0, i8** %1)
%4 = tail call i32 @hugetlbfs_test_path(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
%6 = tail call i32 (...) @cleanup()
br i1 %5, label %10, label %7
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.3, i64 0, i64 0))
%9 = tail call i32 @exit(i32 2)
unreachable
10: ; preds = %2
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%12 = tail call i32 @exit(i32 0)
unreachable
}