#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__ EBUSY;
scalar_t__ EEXIST;
scalar_t__ ENOENT;
scalar_t__ ENOTEMPTY;
scalar_t__ access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ assert(int);
scalar_t__ errno;
int mkdir(char *, int /*<<< orphan*/);
int rmdir(char *);
int test_vfs_dir(void) {
  assert(mkdir("/", 0) == -1 && errno == EEXIST);
  assert(mkdir("/tmp"
               "/test",
               0) == 0);
  assert(mkdir("/tmp"
               "/test",
               0) == -1 &&
         errno == EEXIST);
  assert(mkdir("/tmp"
               "//test///",
               0) == -1 &&
         errno == EEXIST);
  assert(rmdir("/tmp"
               "/test") == 0);
  assert(mkdir("/tmp"
               "/test",
               0) == 0);
  assert(mkdir("/tmp"
               "//test2///",
               0) == 0);
  assert(access("/tmp"
                "/test2",
                0) == 0);
  assert(mkdir("/tmp"
               "/test3",
               0) == 0);
  assert(mkdir("/tmp"
               "/test3/subdir1",
               0) == 0);
  assert(mkdir("/tmp"
               "/test3/subdir2",
               0) == 0);
  assert(mkdir("/tmp"
               "/test3/subdir3",
               0) == 0);
  assert(mkdir("/tmp"
               "/test3/subdir1",
               0) == -1 &&
         errno == EEXIST);
  assert(access("/tmp"
                "/test3/subdir2",
                0) == 0);
  assert(mkdir("/tmp"
               "/test4/subdir4",
               0) == -1 &&
         errno == ENOENT);
  assert(rmdir("/tmp"
               "/test/") == 0);
  assert(rmdir("/tmp"
               "/test2") == 0);
  assert(rmdir("/tmp"
               "/test3") == -1 &&
         errno == ENOTEMPTY);
  assert(rmdir("/tmp"
               "/test3/subdir1") == 0);
  assert(rmdir("/tmp"
               "/test3/subdir2") == 0);
  assert(rmdir("/tmp"
               "/test3/subdir3") == 0);
  assert(rmdir("/tmp"
               "/test3") == 0);
  assert(rmdir("/tmp"
               "/test3") == -1 &&
         errno == ENOENT);
  assert(rmdir("/tmp"
               "/test4/subdir4") == -1 &&
         errno == ENOENT);
  assert(mkdir("/tmp"
               "/test3/subdir1",
               0) == -1 &&
         errno == ENOENT);
  assert(mkdir("/", 0) == -1 && errno == EEXIST);
  assert(rmdir("/tmp") == -1 && errno == EBUSY);
  return 0;
}


x86 assembly (clang, -O0):
<test_vfs_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed6(%rip),%rdi
xor    %esi,%esi
call   1030 <mkdir@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
mov    %al,-0x1(%rbp)
jne    1180 <test_vfs_dir+0x40>
mov    0x2e6b(%rip),%rax
mov    (%rax),%rax
mov    0x2e69(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xe6c(%rip),%rdi
xor    %esi,%esi
call   1030 <mkdir@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xe4e(%rip),%rdi
xor    %esi,%esi
call   1030 <mkdir@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
mov    %al,-0x2(%rbp)
jne    11e3 <test_vfs_dir+0xa3>
mov    0x2e08(%rip),%rax
mov    (%rax),%rax
mov    0x2e06(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xe13(%rip),%rdi
xor    %esi,%esi
call   1030 <mkdir@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
mov    %al,-0x3(%rbp)
jne    1228 <test_vfs_dir+0xe8>
mov    0x2dc3(%rip),%rax
mov    (%rax),%rax
mov    0x2dc1(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xdc4(%rip),%rdi
call   1040 <rmdir@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xda8(%rip),%rdi
xor    %esi,%esi
call   1030 <mkdir@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xda2(%rip),%rdi
xor    %esi,%esi
call   1030 <mkdir@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xd93(%rip),%rdi
xor    %esi,%esi
call   1060 <access@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xd7f(%rip),%rdi
xor    %esi,%esi
call   1030 <mkdir@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xd6c(%rip),%rdi
xor    %esi,%esi
call   1030 <mkdir@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xd61(%rip),%rdi
xor    %esi,%esi
call   1030 <mkdir@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xd56(%rip),%rdi
xor    %esi,%esi
call   1030 <mkdir@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xd12(%rip),%rdi
xor    %esi,%esi
call   1030 <mkdir@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
mov    %al,-0x4(%rbp)
jne    135c <test_vfs_dir+0x21c>
mov    0x2c8f(%rip),%rax
mov    (%rax),%rax
mov    0x2c8d(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x4(%rbp)
mov    -0x4(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xce0(%rip),%rdi
xor    %esi,%esi
call   1060 <access@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xce7(%rip),%rdi
xor    %esi,%esi
call   1030 <mkdir@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
mov    %al,-0x5(%rbp)
jne    13c0 <test_vfs_dir+0x280>
mov    0x2c2b(%rip),%rax
mov    (%rax),%rax
mov    0x2c09(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xcb5(%rip),%rdi
call   1040 <rmdir@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xc37(%rip),%rdi
call   1040 <rmdir@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xc26(%rip),%rdi
call   1040 <rmdir@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
mov    %al,-0x6(%rbp)
jne    143b <test_vfs_dir+0x2fb>
mov    0x2bb0(%rip),%rax
mov    (%rax),%rax
mov    0x2b86(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xbee(%rip),%rdi
call   1040 <rmdir@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xbe5(%rip),%rdi
call   1040 <rmdir@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xbdc(%rip),%rdi
call   1040 <rmdir@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xb8f(%rip),%rdi
call   1040 <rmdir@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xb73(%rip),%rdi
call   1040 <rmdir@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
mov    %al,-0x7(%rbp)
jne    14ee <test_vfs_dir+0x3ae>
mov    0x2afd(%rip),%rax
mov    (%rax),%rax
mov    0x2adb(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x7(%rbp)
mov    -0x7(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xb74(%rip),%rdi
call   1040 <rmdir@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
mov    %al,-0x8(%rbp)
jne    1531 <test_vfs_dir+0x3f1>
mov    0x2aba(%rip),%rax
mov    (%rax),%rax
mov    0x2a98(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x8(%rbp)
mov    -0x8(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xaf8(%rip),%rdi
xor    %esi,%esi
call   1030 <mkdir@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
mov    %al,-0x9(%rbp)
jne    1576 <test_vfs_dir+0x436>
mov    0x2a75(%rip),%rax
mov    (%rax),%rax
mov    0x2a53(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xa9b(%rip),%rdi
xor    %esi,%esi
call   1030 <mkdir@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
mov    %al,-0xa(%rbp)
jne    15bb <test_vfs_dir+0x47b>
mov    0x2a30(%rip),%rax
mov    (%rax),%rax
mov    0x2a2e(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xac5(%rip),%rdi
call   1040 <rmdir@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
mov    %al,-0xb(%rbp)
jne    15fe <test_vfs_dir+0x4be>
mov    0x29ed(%rip),%rax
mov    (%rax),%rax
mov    0x29db(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_vfs_dir>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xed3(%rip),%rdi
xor    %esi,%esi
call   1030 <mkdir@plt>
cmp    $0xffffffff,%eax
sete   %al
mov    0x2e72(%rip),%r12
mov    (%r12),%rcx
mov    0x2e6f(%rip),%rdx
cmp    (%rdx),%rcx
mov    %rdx,%rbp
sete   %cl
and    %al,%cl
movzbl %cl,%edi
call   1050 <assert@plt>
lea    0xe75(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <mkdir@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <mkdir@plt>
cmp    $0xffffffff,%eax
sete   %al
mov    (%r12),%rcx
cmp    0x0(%rbp),%rcx
sete   %cl
and    %al,%cl
movzbl %cl,%edi
call   1050 <assert@plt>
lea    0xe3c(%rip),%rdi
xor    %esi,%esi
call   1030 <mkdir@plt>
cmp    $0xffffffff,%eax
sete   %al
mov    (%r12),%rcx
cmp    0x0(%rbp),%rcx
sete   %cl
and    %al,%cl
movzbl %cl,%edi
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1040 <rmdir@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <mkdir@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xdf5(%rip),%rdi
xor    %esi,%esi
call   1030 <mkdir@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xde9(%rip),%rdi
xor    %esi,%esi
call   1060 <access@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
lea    0xdd8(%rip),%r13
mov    %r13,%rdi
xor    %esi,%esi
call   1030 <mkdir@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xdc5(%rip),%r15
mov    %r15,%rdi
xor    %esi,%esi
call   1030 <mkdir@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xdba(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <mkdir@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xdaf(%rip),%rdi
xor    %esi,%esi
call   1030 <mkdir@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    %r15,%rdi
xor    %esi,%esi
call   1030 <mkdir@plt>
cmp    $0xffffffff,%eax
sete   %al
mov    (%r12),%rcx
cmp    0x0(%rbp),%rcx
sete   %cl
and    %al,%cl
movzbl %cl,%edi
call   1050 <assert@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1060 <access@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
lea    0xd6a(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <mkdir@plt>
cmp    $0xffffffff,%eax
sete   %al
mov    (%r12),%rcx
mov    0x2c99(%rip),%rbp
cmp    0x0(%rbp),%rcx
sete   %cl
and    %al,%cl
movzbl %cl,%edi
call   1050 <assert@plt>
lea    0xd4a(%rip),%rdi
call   1040 <rmdir@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xccf(%rip),%rdi
call   1040 <rmdir@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    %r13,%rdi
call   1040 <rmdir@plt>
cmp    $0xffffffff,%eax
sete   %al
mov    (%r12),%rcx
mov    0x2c35(%rip),%rdx
cmp    (%rdx),%rcx
sete   %cl
and    %al,%cl
movzbl %cl,%edi
call   1050 <assert@plt>
mov    %r15,%rdi
call   1040 <rmdir@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1040 <rmdir@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xc9f(%rip),%rdi
call   1040 <rmdir@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    %r13,%rdi
call   1040 <rmdir@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    %r13,%rdi
call   1040 <rmdir@plt>
cmp    $0xffffffff,%eax
sete   %al
mov    (%r12),%rcx
cmp    0x0(%rbp),%rcx
sete   %cl
and    %al,%cl
movzbl %cl,%edi
call   1050 <assert@plt>
mov    %r14,%rdi
call   1040 <rmdir@plt>
cmp    $0xffffffff,%eax
sete   %al
mov    (%r12),%rcx
cmp    0x0(%rbp),%rcx
sete   %cl
and    %al,%cl
movzbl %cl,%edi
call   1050 <assert@plt>
mov    %r15,%rdi
xor    %esi,%esi
call   1030 <mkdir@plt>
cmp    $0xffffffff,%eax
sete   %al
mov    (%r12),%rcx
cmp    0x0(%rbp),%rcx
sete   %cl
and    %al,%cl
movzbl %cl,%edi
call   1050 <assert@plt>
lea    0xbc8(%rip),%rdi
xor    %esi,%esi
call   1030 <mkdir@plt>
cmp    $0xffffffff,%eax
sete   %al
mov    (%r12),%rcx
mov    0x2b6b(%rip),%rdx
cmp    (%rdx),%rcx
sete   %cl
and    %al,%cl
movzbl %cl,%edi
call   1050 <assert@plt>
lea    0xc08(%rip),%rdi
call   1040 <rmdir@plt>
cmp    $0xffffffff,%eax
sete   %al
mov    (%r12),%rcx
mov    0x2b2e(%rip),%rdx
cmp    (%rdx),%rcx
sete   %cl
and    %al,%cl
movzbl %cl,%edi
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
@errno = global i64 0
@EEXIST = global i64 0
@.str.1 = [10 x i8] c"/tmp/test\00"
@.str.2 = [14 x i8] c"/tmp//test///\00"
@.str.3 = [15 x i8] c"/tmp//test2///\00"
@.str.4 = [11 x i8] c"/tmp/test2\00"
@.str.5 = [11 x i8] c"/tmp/test3\00"
@.str.6 = [19 x i8] c"/tmp/test3/subdir1\00"
@.str.7 = [19 x i8] c"/tmp/test3/subdir2\00"
@.str.8 = [19 x i8] c"/tmp/test3/subdir3\00"
@.str.9 = [19 x i8] c"/tmp/test4/subdir4\00"
@ENOENT = global i64 0
@.str.10 = [11 x i8] c"/tmp/test/\00"
@ENOTEMPTY = global i64 0
@.str.11 = [5 x i8] c"/tmp\00"
@EBUSY = global i64 0
define i32 @test_vfs_dir() {
%1 = call i32 @mkdir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = load i64, i64* @errno
%5 = load i64, i64* @EEXIST
%6 = icmp eq i64 %4, %5
br label %7
7: ; preds = %3, %0
%8 = phi i1 [ false, %0 ], [ %6, %3 ]
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = call i32 @mkdir(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 0)
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = call i32 @mkdir(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 0)
%16 = icmp eq i32 %15, -1
br i1 %16, label %17, label %21
17: ; preds = %7
%18 = load i64, i64* @errno
%19 = load i64, i64* @EEXIST
%20 = icmp eq i64 %18, %19
br label %21
21: ; preds = %17, %7
%22 = phi i1 [ false, %7 ], [ %20, %17 ]
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
%25 = call i32 @mkdir(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 0)
%26 = icmp eq i32 %25, -1
br i1 %26, label %27, label %31
27: ; preds = %21
%28 = load i64, i64* @errno
%29 = load i64, i64* @EEXIST
%30 = icmp eq i64 %28, %29
br label %31
31: ; preds = %27, %21
%32 = phi i1 [ false, %21 ], [ %30, %27 ]
%33 = zext i1 %32 to i32
%34 = call i32 @assert(i32 %33)
%35 = call i32 @rmdir(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%36 = icmp eq i32 %35, 0
%37 = zext i1 %36 to i32
%38 = call i32 @assert(i32 %37)
%39 = call i32 @mkdir(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 0)
%40 = icmp eq i32 %39, 0
%41 = zext i1 %40 to i32
%42 = call i32 @assert(i32 %41)
%43 = call i32 @mkdir(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 0)
%44 = icmp eq i32 %43, 0
%45 = zext i1 %44 to i32
%46 = call i32 @assert(i32 %45)
%47 = call i64 @access(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 0)
%48 = icmp eq i64 %47, 0
%49 = zext i1 %48 to i32
%50 = call i32 @assert(i32 %49)
%51 = call i32 @mkdir(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 0)
%52 = icmp eq i32 %51, 0
%53 = zext i1 %52 to i32
%54 = call i32 @assert(i32 %53)
%55 = call i32 @mkdir(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32 0)
%56 = icmp eq i32 %55, 0
%57 = zext i1 %56 to i32
%58 = call i32 @assert(i32 %57)
%59 = call i32 @mkdir(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i32 0)
%60 = icmp eq i32 %59, 0
%61 = zext i1 %60 to i32
%62 = call i32 @assert(i32 %61)
%63 = call i32 @mkdir(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i32 0)
%64 = icmp eq i32 %63, 0
%65 = zext i1 %64 to i32
%66 = call i32 @assert(i32 %65)
%67 = call i32 @mkdir(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32 0)
%68 = icmp eq i32 %67, -1
br i1 %68, label %69, label %73
69: ; preds = %31
%70 = load i64, i64* @errno
%71 = load i64, i64* @EEXIST
%72 = icmp eq i64 %70, %71
br label %73
73: ; preds = %69, %31
%74 = phi i1 [ false, %31 ], [ %72, %69 ]
%75 = zext i1 %74 to i32
%76 = call i32 @assert(i32 %75)
%77 = call i64 @access(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i32 0)
%78 = icmp eq i64 %77, 0
%79 = zext i1 %78 to i32
%80 = call i32 @assert(i32 %79)
%81 = call i32 @mkdir(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i32 0)
%82 = icmp eq i32 %81, -1
br i1 %82, label %83, label %87
83: ; preds = %73
%84 = load i64, i64* @errno
%85 = load i64, i64* @ENOENT
%86 = icmp eq i64 %84, %85
br label %87
87: ; preds = %83, %73
%88 = phi i1 [ false, %73 ], [ %86, %83 ]
%89 = zext i1 %88 to i32
%90 = call i32 @assert(i32 %89)
%91 = call i32 @rmdir(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
%92 = icmp eq i32 %91, 0
%93 = zext i1 %92 to i32
%94 = call i32 @assert(i32 %93)
%95 = call i32 @rmdir(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%96 = icmp eq i32 %95, 0
%97 = zext i1 %96 to i32
%98 = call i32 @assert(i32 %97)
%99 = call i32 @rmdir(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%100 = icmp eq i32 %99, -1
br i1 %100, label %101, label %105
101: ; preds = %87
%102 = load i64, i64* @errno
%103 = load i64, i64* @ENOTEMPTY
%104 = icmp eq i64 %102, %103
br label %105
105: ; preds = %101, %87
%106 = phi i1 [ false, %87 ], [ %104, %101 ]
%107 = zext i1 %106 to i32
%108 = call i32 @assert(i32 %107)
%109 = call i32 @rmdir(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%110 = icmp eq i32 %109, 0
%111 = zext i1 %110 to i32
%112 = call i32 @assert(i32 %111)
%113 = call i32 @rmdir(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
%114 = icmp eq i32 %113, 0
%115 = zext i1 %114 to i32
%116 = call i32 @assert(i32 %115)
%117 = call i32 @rmdir(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
%118 = icmp eq i32 %117, 0
%119 = zext i1 %118 to i32
%120 = call i32 @assert(i32 %119)
%121 = call i32 @rmdir(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%122 = icmp eq i32 %121, 0
%123 = zext i1 %122 to i32
%124 = call i32 @assert(i32 %123)
%125 = call i32 @rmdir(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%126 = icmp eq i32 %125, -1
br i1 %126, label %127, label %131
127: ; preds = %105
%128 = load i64, i64* @errno
%129 = load i64, i64* @ENOENT
%130 = icmp eq i64 %128, %129
br label %131
131: ; preds = %127, %105
%132 = phi i1 [ false, %105 ], [ %130, %127 ]
%133 = zext i1 %132 to i32
%134 = call i32 @assert(i32 %133)
%135 = call i32 @rmdir(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0))
%136 = icmp eq i32 %135, -1
br i1 %136, label %137, label %141
137: ; preds = %131
%138 = load i64, i64* @errno
%139 = load i64, i64* @ENOENT
%140 = icmp eq i64 %138, %139
br label %141
141: ; preds = %137, %131
%142 = phi i1 [ false, %131 ], [ %140, %137 ]
%143 = zext i1 %142 to i32
%144 = call i32 @assert(i32 %143)
%145 = call i32 @mkdir(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32 0)
%146 = icmp eq i32 %145, -1
br i1 %146, label %147, label %151
147: ; preds = %141
%148 = load i64, i64* @errno
%149 = load i64, i64* @ENOENT
%150 = icmp eq i64 %148, %149
br label %151
151: ; preds = %147, %141
%152 = phi i1 [ false, %141 ], [ %150, %147 ]
%153 = zext i1 %152 to i32
%154 = call i32 @assert(i32 %153)
%155 = call i32 @mkdir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 0)
%156 = icmp eq i32 %155, -1
br i1 %156, label %157, label %161
157: ; preds = %151
%158 = load i64, i64* @errno
%159 = load i64, i64* @EEXIST
%160 = icmp eq i64 %158, %159
br label %161
161: ; preds = %157, %151
%162 = phi i1 [ false, %151 ], [ %160, %157 ]
%163 = zext i1 %162 to i32
%164 = call i32 @assert(i32 %163)
%165 = call i32 @rmdir(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%166 = icmp eq i32 %165, -1
br i1 %166, label %167, label %171
167: ; preds = %161
%168 = load i64, i64* @errno
%169 = load i64, i64* @EBUSY
%170 = icmp eq i64 %168, %169
br label %171
171: ; preds = %167, %161
%172 = phi i1 [ false, %161 ], [ %170, %167 ]
%173 = zext i1 %172 to i32
%174 = call i32 @assert(i32 %173)
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
@errno = global i64 0
@EEXIST = global i64 0
@.str.1 = [10 x i8] c"/tmp/test\00"
@.str.2 = [14 x i8] c"/tmp//test///\00"
@.str.3 = [15 x i8] c"/tmp//test2///\00"
@.str.4 = [11 x i8] c"/tmp/test2\00"
@.str.5 = [11 x i8] c"/tmp/test3\00"
@.str.6 = [19 x i8] c"/tmp/test3/subdir1\00"
@.str.7 = [19 x i8] c"/tmp/test3/subdir2\00"
@.str.8 = [19 x i8] c"/tmp/test3/subdir3\00"
@.str.9 = [19 x i8] c"/tmp/test4/subdir4\00"
@ENOENT = global i64 0
@.str.10 = [11 x i8] c"/tmp/test/\00"
@ENOTEMPTY = global i64 0
@.str.11 = [5 x i8] c"/tmp\00"
@EBUSY = global i64 0
define i32 @test_vfs_dir() {
%1 = tail call i32 @mkdir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = icmp eq i32 %1, -1
%3 = load i64, i64* @errno
%4 = load i64, i64* @EEXIST
%5 = icmp eq i64 %3, %4
%6 = select i1 %2, i1 %5, i1 false
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @mkdir(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 0)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 @mkdir(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 0)
%14 = icmp eq i32 %13, -1
%15 = load i64, i64* @errno
%16 = load i64, i64* @EEXIST
%17 = icmp eq i64 %15, %16
%18 = select i1 %14, i1 %17, i1 false
%19 = zext i1 %18 to i32
%20 = tail call i32 @assert(i32 %19)
%21 = tail call i32 @mkdir(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 0)
%22 = icmp eq i32 %21, -1
%23 = load i64, i64* @errno
%24 = load i64, i64* @EEXIST
%25 = icmp eq i64 %23, %24
%26 = select i1 %22, i1 %25, i1 false
%27 = zext i1 %26 to i32
%28 = tail call i32 @assert(i32 %27)
%29 = tail call i32 @rmdir(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%30 = icmp eq i32 %29, 0
%31 = zext i1 %30 to i32
%32 = tail call i32 @assert(i32 %31)
%33 = tail call i32 @mkdir(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 0)
%34 = icmp eq i32 %33, 0
%35 = zext i1 %34 to i32
%36 = tail call i32 @assert(i32 %35)
%37 = tail call i32 @mkdir(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 0)
%38 = icmp eq i32 %37, 0
%39 = zext i1 %38 to i32
%40 = tail call i32 @assert(i32 %39)
%41 = tail call i64 @access(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 0)
%42 = icmp eq i64 %41, 0
%43 = zext i1 %42 to i32
%44 = tail call i32 @assert(i32 %43)
%45 = tail call i32 @mkdir(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 0)
%46 = icmp eq i32 %45, 0
%47 = zext i1 %46 to i32
%48 = tail call i32 @assert(i32 %47)
%49 = tail call i32 @mkdir(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32 0)
%50 = icmp eq i32 %49, 0
%51 = zext i1 %50 to i32
%52 = tail call i32 @assert(i32 %51)
%53 = tail call i32 @mkdir(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i32 0)
%54 = icmp eq i32 %53, 0
%55 = zext i1 %54 to i32
%56 = tail call i32 @assert(i32 %55)
%57 = tail call i32 @mkdir(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i32 0)
%58 = icmp eq i32 %57, 0
%59 = zext i1 %58 to i32
%60 = tail call i32 @assert(i32 %59)
%61 = tail call i32 @mkdir(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32 0)
%62 = icmp eq i32 %61, -1
%63 = load i64, i64* @errno
%64 = load i64, i64* @EEXIST
%65 = icmp eq i64 %63, %64
%66 = select i1 %62, i1 %65, i1 false
%67 = zext i1 %66 to i32
%68 = tail call i32 @assert(i32 %67)
%69 = tail call i64 @access(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i32 0)
%70 = icmp eq i64 %69, 0
%71 = zext i1 %70 to i32
%72 = tail call i32 @assert(i32 %71)
%73 = tail call i32 @mkdir(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i32 0)
%74 = icmp eq i32 %73, -1
%75 = load i64, i64* @errno
%76 = load i64, i64* @ENOENT
%77 = icmp eq i64 %75, %76
%78 = select i1 %74, i1 %77, i1 false
%79 = zext i1 %78 to i32
%80 = tail call i32 @assert(i32 %79)
%81 = tail call i32 @rmdir(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
%82 = icmp eq i32 %81, 0
%83 = zext i1 %82 to i32
%84 = tail call i32 @assert(i32 %83)
%85 = tail call i32 @rmdir(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%86 = icmp eq i32 %85, 0
%87 = zext i1 %86 to i32
%88 = tail call i32 @assert(i32 %87)
%89 = tail call i32 @rmdir(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%90 = icmp eq i32 %89, -1
%91 = load i64, i64* @errno
%92 = load i64, i64* @ENOTEMPTY
%93 = icmp eq i64 %91, %92
%94 = select i1 %90, i1 %93, i1 false
%95 = zext i1 %94 to i32
%96 = tail call i32 @assert(i32 %95)
%97 = tail call i32 @rmdir(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%98 = icmp eq i32 %97, 0
%99 = zext i1 %98 to i32
%100 = tail call i32 @assert(i32 %99)
%101 = tail call i32 @rmdir(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
%102 = icmp eq i32 %101, 0
%103 = zext i1 %102 to i32
%104 = tail call i32 @assert(i32 %103)
%105 = tail call i32 @rmdir(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
%106 = icmp eq i32 %105, 0
%107 = zext i1 %106 to i32
%108 = tail call i32 @assert(i32 %107)
%109 = tail call i32 @rmdir(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%110 = icmp eq i32 %109, 0
%111 = zext i1 %110 to i32
%112 = tail call i32 @assert(i32 %111)
%113 = tail call i32 @rmdir(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%114 = icmp eq i32 %113, -1
%115 = load i64, i64* @errno
%116 = load i64, i64* @ENOENT
%117 = icmp eq i64 %115, %116
%118 = select i1 %114, i1 %117, i1 false
%119 = zext i1 %118 to i32
%120 = tail call i32 @assert(i32 %119)
%121 = tail call i32 @rmdir(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0))
%122 = icmp eq i32 %121, -1
%123 = load i64, i64* @errno
%124 = load i64, i64* @ENOENT
%125 = icmp eq i64 %123, %124
%126 = select i1 %122, i1 %125, i1 false
%127 = zext i1 %126 to i32
%128 = tail call i32 @assert(i32 %127)
%129 = tail call i32 @mkdir(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32 0)
%130 = icmp eq i32 %129, -1
%131 = load i64, i64* @errno
%132 = load i64, i64* @ENOENT
%133 = icmp eq i64 %131, %132
%134 = select i1 %130, i1 %133, i1 false
%135 = zext i1 %134 to i32
%136 = tail call i32 @assert(i32 %135)
%137 = tail call i32 @mkdir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 0)
%138 = icmp eq i32 %137, -1
%139 = load i64, i64* @errno
%140 = load i64, i64* @EEXIST
%141 = icmp eq i64 %139, %140
%142 = select i1 %138, i1 %141, i1 false
%143 = zext i1 %142 to i32
%144 = tail call i32 @assert(i32 %143)
%145 = tail call i32 @rmdir(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%146 = icmp eq i32 %145, -1
%147 = load i64, i64* @errno
%148 = load i64, i64* @EBUSY
%149 = icmp eq i64 %147, %148
%150 = select i1 %146, i1 %149, i1 false
%151 = zext i1 %150 to i32
%152 = tail call i32 @assert(i32 %151)
ret i32 0
}