void test_nonexistent_dir(void) {
  _test_start(__func__,
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/jviki/dtree/refs/heads/master/test/"
              "dtree_open_test.c",
              15);
  int err = dtree_open("/xxx/yyy/zzz");
  if (((err) == 0) != 0) {
    _test_fail(__func__,
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/jviki/dtree/refs/heads/"
               "master/test/dtree_open_test.c",
               17,
               ((("Successful when passing non-existent dir: /xxx/yyy/zzz"))));
    return;
  };
  if ((!(dtree_iserror())) != 0) {
    _test_fail(__func__,
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/jviki/dtree/refs/heads/"
               "master/test/dtree_open_test.c",
               18, ((("Error is not indicated by dtree_iserror()"))));
    return;
  };
  _test_end(__func__);
}


x86 assembly (clang, -O0):
<test_nonexistent_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea1(%rip),%rdi
lea    0xeaf(%rip),%rsi
mov    $0xf,%edx
mov    $0x0,%al
call   1050 <_test_start@plt>
lea    0xf55(%rip),%rdi
mov    $0x0,%al
call   1070 <dtree_open@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
je     11be <test_nonexistent_dir+0x6e>
lea    0xe61(%rip),%rdi
lea    0xe6f(%rip),%rsi
mov    $0x11,%edx
lea    0xef2(%rip),%rcx
mov    $0x0,%al
call   1040 <_test_fail@plt>
jmp    120f <test_nonexistent_dir+0xbf>
mov    $0x0,%al
call   1060 <dtree_iserror@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
je     1201 <test_nonexistent_dir+0xb1>
lea    0xe1e(%rip),%rdi
lea    0xe2c(%rip),%rsi
mov    $0x12,%edx
lea    0xee6(%rip),%rcx
mov    $0x0,%al
call   1040 <_test_fail@plt>
jmp    120f <test_nonexistent_dir+0xbf>
lea    0xdf8(%rip),%rdi
mov    $0x0,%al
call   1030 <_test_end@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_nonexistent_dir>:
push   %rax
lea    0xea8(%rip),%rdi
lea    0xeb6(%rip),%rsi
mov    $0xf,%edx
xor    %eax,%eax
call   1050 <_test_start@plt>
lea    0xf5c(%rip),%rdi
xor    %eax,%eax
call   1070 <dtree_open@plt>
test   %eax,%eax
je     1197 <test_nonexistent_dir+0x47>
xor    %eax,%eax
call   1060 <dtree_iserror@plt>
lea    0xe75(%rip),%rdi
test   %eax,%eax
je     11b3 <test_nonexistent_dir+0x63>
xor    %eax,%eax
pop    %rcx
jmp    1030 <_test_end@plt>
lea    0xe62(%rip),%rdi
lea    0xe70(%rip),%rsi
lea    0xef8(%rip),%rcx
mov    $0x11,%edx
jmp    11c6 <test_nonexistent_dir+0x76>
lea    0xe5b(%rip),%rsi
lea    0xf1a(%rip),%rcx
mov    $0x12,%edx
xor    %eax,%eax
pop    %r8
jmp    1040 <_test_fail@plt>

LLVM IR (-O0):
@__func__.test_nonexistent_dir = [21 x i8] c"test_nonexistent_dir\00"
@.str = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jviki/dtree/refs/heads/master/test/dtree_open_test.c\00"
@.str.1 = [13 x i8] c"/xxx/yyy/zzz\00"
@.str.2 = [55 x i8] c"Successful when passing non-existent dir: /xxx/yyy/zzz\00"
@.str.3 = [42 x i8] c"Error is not indicated by dtree_iserror()\00"
define void @test_nonexistent_dir() {
%1 = alloca i32
%2 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @_test_start to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.test_nonexistent_dir, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0), i32 15)
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @dtree_open to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_test_fail to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.test_nonexistent_dir, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0), i32 17, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0))
br label %20
10: ; preds = %0
%11 = call i32 (...) @dtree_iserror()
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_test_fail to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.test_nonexistent_dir, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0), i32 18, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0))
br label %20
18: ; preds = %10
%19 = call i32 (i8*, ...) bitcast (i32 (...)* @_test_end to i32 (i8*, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.test_nonexistent_dir, i64 0, i64 0))
br label %20
20: ; preds = %18, %16, %8
ret void
}

LLVM IR (-O2):
@__func__.test_nonexistent_dir = [21 x i8] c"test_nonexistent_dir\00"
@.str = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jviki/dtree/refs/heads/master/test/dtree_open_test.c\00"
@.str.1 = [13 x i8] c"/xxx/yyy/zzz\00"
@.str.2 = [55 x i8] c"Successful when passing non-existent dir: /xxx/yyy/zzz\00"
@.str.3 = [42 x i8] c"Error is not indicated by dtree_iserror()\00"
define void @test_nonexistent_dir() {
%1 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @_test_start to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.test_nonexistent_dir, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0), i32 15)
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @dtree_open to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_test_fail to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.test_nonexistent_dir, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0), i32 17, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0))
br label %13
6: ; preds = %0
%7 = tail call i32 (...) @dtree_iserror()
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_test_fail to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.test_nonexistent_dir, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0), i32 18, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0))
br label %13
11: ; preds = %6
%12 = tail call i32 (i8*, ...) bitcast (i32 (...)* @_test_end to i32 (i8*, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.test_nonexistent_dir, i64 0, i64 0))
br label %13
13: ; preds = %11, %9, %4
ret void
}