#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 */
scalar_t__ memcmp(unsigned char const *, char *, int);
int is_fat_directory(const unsigned char *buffer) {
  return (buffer[0] == '.' && memcmp(buffer, ".          ", 8 + 3) == 0 &&
          memcmp(&buffer[0x20], "..         ", 8 + 3) == 0 &&
          buffer[0xB] != (1 | 2 | 4 | 8) && (buffer[0xB] & 16) != 0 &&
          buffer[1 * 0x20 + 0xB] != (1 | 2 | 4 | 8) &&
          (buffer[1 * 0x20 + 0xB] & 16) != 0);
}


x86 assembly (clang, -O0):
<is_fat_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2e,%ecx
mov    %al,-0x9(%rbp)
jne    11dc <is_fat_directory+0xcc>
mov    -0x8(%rbp),%rdi
lea    0xec4(%rip),%rsi
mov    $0xb,%edx
call   1030 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    11dc <is_fat_directory+0xcc>
mov    -0x8(%rbp),%rdi
add    $0x20,%rdi
lea    0xea5(%rip),%rsi
mov    $0xb,%edx
call   1030 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    11dc <is_fat_directory+0xcc>
mov    -0x8(%rbp),%rax
movzbl 0xb(%rax),%ecx
xor    %eax,%eax
cmp    $0xf,%ecx
mov    %al,-0x9(%rbp)
je     11dc <is_fat_directory+0xcc>
mov    -0x8(%rbp),%rax
movzbl 0xb(%rax),%ecx
and    $0x10,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     11dc <is_fat_directory+0xcc>
mov    -0x8(%rbp),%rax
movzbl 0x2b(%rax),%ecx
xor    %eax,%eax
cmp    $0xf,%ecx
mov    %al,-0x9(%rbp)
je     11dc <is_fat_directory+0xcc>
mov    -0x8(%rbp),%rax
movzbl 0x2b(%rax),%eax
and    $0x10,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_fat_directory>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
cmpb   $0x2e,(%rdi)
jne    114d <is_fat_directory+0x3d>
mov    %rdi,%rbx
lea    0xedc(%rip),%rsi
mov    $0xb,%edx
call   1030 <memcmp@plt>
test   %rax,%rax
jne    114d <is_fat_directory+0x3d>
lea    0x20(%rbx),%rdi
lea    0xece(%rip),%rsi
mov    $0xb,%edx
call   1030 <memcmp@plt>
test   %rax,%rax
je     1156 <is_fat_directory+0x46>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0xb(%rbx),%al
cmp    $0xf,%al
je     114d <is_fat_directory+0x3d>
and    $0x10,%al
je     114d <is_fat_directory+0x3d>
movzbl 0x2b(%rbx),%eax
cmp    $0xf,%eax
je     114d <is_fat_directory+0x3d>
shr    $0x4,%eax
and    $0x1,%eax
mov    %eax,%ebp
jmp    114d <is_fat_directory+0x3d>

LLVM IR (-O0):
@.str = [12 x i8] c". \00"
@.str.1 = [12 x i8] c".. \00"
define i32 @is_fat_directory(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = icmp eq i32 %6, 46
br i1 %7, label %8, label %43
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i64 @memcmp(i8* %9, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 11)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %43
12: ; preds = %8
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 32
%15 = call i64 @memcmp(i8* %14, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 11)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %43
17: ; preds = %12
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i64 11
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = icmp ne i32 %21, 15
br i1 %22, label %23, label %43
23: ; preds = %17
%24 = load i8*, i8** %2
%25 = getelementptr inbounds i8, i8* %24, i64 11
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = and i32 %27, 16
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %43
30: ; preds = %23
%31 = load i8*, i8** %2
%32 = getelementptr inbounds i8, i8* %31, i64 43
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = icmp ne i32 %34, 15
br i1 %35, label %36, label %43
36: ; preds = %30
%37 = load i8*, i8** %2
%38 = getelementptr inbounds i8, i8* %37, i64 43
%39 = load i8, i8* %38
%40 = zext i8 %39 to i32
%41 = and i32 %40, 16
%42 = icmp ne i32 %41, 0
br label %43
43: ; preds = %36, %30, %23, %17, %12, %8, %1
%44 = phi i1 [ false, %30 ], [ false, %23 ], [ false, %17 ], [ false, %12 ], [ false, %8 ], [ false, %1 ], [ %42, %36 ]
%45 = zext i1 %44 to i32
ret i32 %45
}

LLVM IR (-O2):
@.str = [12 x i8] c". \00"
@.str.1 = [12 x i8] c".. \00"
define i32 @is_fat_directory(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 46
br i1 %3, label %4, label %26
4: ; preds = %1
%5 = tail call i64 @memcmp(i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 11)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %26
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %0, i64 32
%9 = tail call i64 @memcmp(i8* %8, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 11)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %26
11: ; preds = %7
%12 = getelementptr inbounds i8, i8* %0, i64 11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 15
%15 = and i8 %13, 16
%16 = icmp eq i8 %15, 0
%17 = or i1 %14, %16
br i1 %17, label %26, label %18
18: ; preds = %11
%19 = getelementptr inbounds i8, i8* %0, i64 43
%20 = load i8, i8* %19
%21 = icmp eq i8 %20, 15
br i1 %21, label %26, label %22
22: ; preds = %18
%23 = lshr i8 %20, 4
%24 = and i8 %23, 1
%25 = zext i8 %24 to i32
br label %26
26: ; preds = %22, %18, %11, %7, %4, %1
%27 = phi i32 [ 0, %18 ], [ 0, %11 ], [ 0, %7 ], [ 0, %4 ], [ 0, %1 ], [ %25, %22 ]
ret i32 %27
}