void create_empty_nested_dir(const char dir[], const char nested_dir[]) {
  create_empty_dir(dir);
  do {
    seatest_assert_int_equal(0, chdir(dir), __FUNCTION__, 27);
  } while (0);
  create_empty_dir(nested_dir);
  do {
    seatest_assert_int_equal(0, chdir(".."), __FUNCTION__, 29);
  } while (0);
}


x86 assembly (clang, -O0):
<create_empty_nested_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <create_empty_dir@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <chdir@plt>
mov    %eax,%esi
xor    %edi,%edi
lea    0xe9f(%rip),%rdx
mov    $0x1b,%ecx
mov    $0x0,%al
call   1050 <seatest_assert_int_equal@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <create_empty_dir@plt>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <chdir@plt>
mov    %eax,%esi
xor    %edi,%edi
lea    0xe6f(%rip),%rdx
mov    $0x1d,%ecx
mov    $0x0,%al
call   1050 <seatest_assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_empty_nested_dir>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <create_empty_dir@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <chdir@plt>
lea    0xeae(%rip),%rbx
xor    %edi,%edi
mov    %eax,%esi
mov    %rbx,%rdx
mov    $0x1b,%ecx
xor    %eax,%eax
call   1050 <seatest_assert_int_equal@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <create_empty_dir@plt>
lea    0xea2(%rip),%rdi
xor    %eax,%eax
call   1030 <chdir@plt>
xor    %edi,%edi
mov    %eax,%esi
mov    %rbx,%rdx
mov    $0x1d,%ecx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <seatest_assert_int_equal@plt>

LLVM IR (-O0):
@__FUNCTION__.create_empty_nested_dir = [24 x i8] c"create_empty_nested_dir\00"
@.str = [3 x i8] c"..\00"
define void @create_empty_nested_dir(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @create_empty_dir to i32 (i8*, ...)*)(i8* %5)
br label %7
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @chdir to i32 (i8*, ...)*)(i8* %8)
%10 = call i32 (i32, i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_int_equal to i32 (i32, i32, i8*, i32, ...)*)(i32 0, i32 %9, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__FUNCTION__.create_empty_nested_dir, i64 0, i64 0), i32 27)
br label %11
11: ; preds = %7
%12 = load i8*, i8** %4
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @create_empty_dir to i32 (i8*, ...)*)(i8* %12)
br label %14
14: ; preds = %11
%15 = call i32 (i8*, ...) bitcast (i32 (...)* @chdir to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%16 = call i32 (i32, i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_int_equal to i32 (i32, i32, i8*, i32, ...)*)(i32 0, i32 %15, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__FUNCTION__.create_empty_nested_dir, i64 0, i64 0), i32 29)
br label %17
17: ; preds = %14
ret void
}

LLVM IR (-O2):
@__FUNCTION__.create_empty_nested_dir = [24 x i8] c"create_empty_nested_dir\00"
@.str = [3 x i8] c"..\00"
define void @create_empty_nested_dir(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @create_empty_dir to i32 (i8*, ...)*)(i8* %0)
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @chdir to i32 (i8*, ...)*)(i8* %0)
%5 = tail call i32 (i32, i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_int_equal to i32 (i32, i32, i8*, i32, ...)*)(i32 0, i32 %4, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__FUNCTION__.create_empty_nested_dir, i64 0, i64 0), i32 27)
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @create_empty_dir to i32 (i8*, ...)*)(i8* %1)
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @chdir to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (i32, i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_int_equal to i32 (i32, i32, i8*, i32, ...)*)(i32 0, i32 %7, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__FUNCTION__.create_empty_nested_dir, i64 0, i64 0), i32 29)
ret void
}