int itsdir(name) const char *const name;
{
  register char *myname;
  register int accres;
  myname = memcheck(icpyalloc(name));
  myname = memcheck(icatalloc(myname, "/."));
  accres = access(myname, 0);
  ifree(myname);
  return accres == 0;
}


x86 assembly (clang, -O0):
<itsdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <icpyalloc@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1070 <memcheck@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe7f(%rip),%rsi
mov    $0x0,%al
call   1040 <icatalloc@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1070 <memcheck@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1060 <access@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1050 <ifree@plt>
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itsdir>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <icpyalloc@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1070 <memcheck@plt>
movslq %eax,%rdi
lea    0xe93(%rip),%rsi
xor    %eax,%eax
call   1040 <icatalloc@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1070 <memcheck@plt>
movslq %eax,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1060 <access@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <ifree@plt>
xor    %eax,%eax
test   %ebp,%ebp
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"/.\00"
define i32 @itsdir(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @icpyalloc to i32 (i8*, ...)*)(i8* %5)
%7 = call i32 (i32, ...) bitcast (i32 (...)* @memcheck to i32 (i32, ...)*)(i32 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @icatalloc to i32 (i8*, i8*, ...)*)(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (i32, ...) bitcast (i32 (...)* @memcheck to i32 (i32, ...)*)(i32 %11)
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %3
%15 = load i8*, i8** %3
%16 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @access to i32 (i8*, i32, ...)*)(i8* %15, i32 0)
store i32 %16, i32* %4
%17 = load i8*, i8** %3
%18 = call i32 (i8*, ...) bitcast (i32 (...)* @ifree to i32 (i8*, ...)*)(i8* %17)
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, 0
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
@.str = [3 x i8] c"/.\00"
define i32 @itsdir(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @icpyalloc to i32 (i8*, ...)*)(i8* %0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @memcheck to i32 (i32, ...)*)(i32 %2)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @icatalloc to i32 (i8*, i8*, ...)*)(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @memcheck to i32 (i32, ...)*)(i32 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @access to i32 (i8*, i32, ...)*)(i8* %9, i32 0)
%11 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ifree to i32 (i8*, ...)*)(i8* %9)
%12 = icmp eq i32 %10, 0
%13 = zext i1 %12 to i32
ret i32 %13
}