#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*/ getFilePath(char *, char *);
scalar_t__ isFile(char *);
int /*<<< orphan*/ printf(char *, char *);
int pageIsDefined(char *page) {
  char path[128] = {0};
  getFilePath(page, path);
  if (isFile(path)) {
    return 1;
  }
  printf("%s Is Not Defined Page \n", path);
  return 0;
}


x86 assembly (clang, -O0):
<pageIsDefined>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1050 <memset@plt>
mov    -0x10(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1030 <getFilePath@plt>
lea    -0x90(%rbp),%rdi
call   1060 <isFile@plt>
cmp    $0x0,%rax
je     1194 <pageIsDefined+0x54>
movl   $0x1,-0x4(%rbp)
jmp    11ae <pageIsDefined+0x6e>
lea    -0x90(%rbp),%rsi
lea    0xe5e(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pageIsDefined>:
push   %rbx
sub    $0x80,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <getFilePath@plt>
mov    %rbx,%rdi
call   1050 <isFile@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    1193 <pageIsDefined+0x63>
lea    0xe77(%rip),%rdi
mov    %rsp,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"%s Is Not Defined Page \0A\00"
define i32 @pageIsDefined(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [128 x i8]
store i8* %0, i8** %3
%5 = bitcast [128 x i8]* %4 to i8*
%6 = load i8*, i8** %3
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%8 = call i32 @getFilePath(i8* %6, i8* %7)
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%10 = call i64 @isFile(i8* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 1, i32* %2
br label %16
13: ; preds = %1
%14 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%15 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %14)
store i32 0, i32* %2
br label %16
16: ; preds = %13, %12
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@.str = [25 x i8] c"%s Is Not Defined Page \0A\00"
define i32 @pageIsDefined(i8* %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @getFilePath(i8* %0, i8* %3)
%5 = call i64 @isFile(i8* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %9
9: ; preds = %1, %7
%10 = phi i32 [ 0, %7 ], [ 1, %1 ]
ret i32 %10
}