#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*/ find_mount(char *, char *);
const char *find_debugfs(void) {
  static int debugfs_found;
  static char debugfs[1024 + 1];
  if (debugfs_found)
    return debugfs;
  if (!find_mount("debugfs", debugfs))
    return "";
  debugfs_found = 1;
  return debugfs;
}


x86 assembly (clang, -O0):
<find_debugfs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f21(%rip)
je     1135 <find_debugfs+0x25>
lea    0x2f24(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1176 <find_debugfs+0x66>
lea    0xec4(%rip),%rdi
lea    0x2f0d(%rip),%rsi
call   1030 <find_mount@plt>
cmp    $0x0,%eax
jne    1161 <find_debugfs+0x51>
lea    0xeaf(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1176 <find_debugfs+0x66>
movl   $0x1,0x2ed5(%rip)
lea    0x2ede(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_debugfs>:
push   %rbx
cmpb   $0x0,0x2f28(%rip)
je     1123 <find_debugfs+0x13>
lea    0x2f2f(%rip),%rbx
jmp    114d <find_debugfs+0x3d>
lea    0xed6(%rip),%rdi
lea    0x2f1f(%rip),%rbx
mov    %rbx,%rsi
call   1030 <find_mount@plt>
test   %eax,%eax
je     1146 <find_debugfs+0x36>
movb   $0x1,0x2efc(%rip)
jmp    114d <find_debugfs+0x3d>
lea    0xeba(%rip),%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@find_debugfs.debugfs_found = internal global i32 0
@find_debugfs.debugfs = internal global [1025 x i8] zeroinitializer
@.str = [8 x i8] c"debugfs\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @find_debugfs() {
%1 = alloca i8*
%2 = load i32, i32* @find_debugfs.debugfs_found
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i8* getelementptr inbounds ([1025 x i8], [1025 x i8]* @find_debugfs.debugfs, i64 0, i64 0), i8** %1
br label %10
5: ; preds = %0
%6 = call i32 @find_mount(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1025 x i8], [1025 x i8]* @find_debugfs.debugfs, i64 0, i64 0))
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %5
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %10
9: ; preds = %5
store i32 1, i32* @find_debugfs.debugfs_found
store i8* getelementptr inbounds ([1025 x i8], [1025 x i8]* @find_debugfs.debugfs, i64 0, i64 0), i8** %1
br label %10
10: ; preds = %9, %8, %4
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
@find_debugfs.debugfs_found = internal unnamed_addr global i1 false
@find_debugfs.debugfs = internal global [1025 x i8] zeroinitializer
@.str = [8 x i8] c"debugfs\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @find_debugfs() {
%1 = load i1, i1* @find_debugfs.debugfs_found
br i1 %1, label %6, label %2
2: ; preds = %0
%3 = tail call i32 @find_mount(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1025 x i8], [1025 x i8]* @find_debugfs.debugfs, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %2
store i1 true, i1* @find_debugfs.debugfs_found
br label %6
6: ; preds = %2, %0, %5
%7 = phi i8* [ getelementptr inbounds ([1025 x i8], [1025 x i8]* @find_debugfs.debugfs, i64 0, i64 0), %5 ], [ getelementptr inbounds ([1025 x i8], [1025 x i8]* @find_debugfs.debugfs, i64 0, i64 0), %0 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %2 ]
ret i8* %7
}