void test_pass_file(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",
              24);
  int err = dtree_open("/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");
  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",
               26,
               ((("Successful when passing "
                  "/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"
                  " as root dir"))));
    return;
  };
  if ((dtree_iserror()) != 0) {
    _test_warn(__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",
               27,
               (("Error is indicated by dtree_iserror(), but should not be")));
  };
  dtree_close();
  _test_end(__func__);
}


x86 assembly (clang, -O0):
<test_pass_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xe81(%rip),%rdi
lea    0xe89(%rip),%rsi
mov    $0x18,%edx
mov    $0x0,%al
call   1060 <_test_start@plt>
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1090 <dtree_open@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
je     11de <test_pass_file+0x6e>
lea    0xe41(%rip),%rdi
lea    0xe49(%rip),%rsi
mov    $0x1a,%edx
lea    0xecc(%rip),%rcx
mov    $0x0,%al
call   1040 <_test_fail@plt>
jmp    1224 <test_pass_file+0xb4>
mov    $0x0,%al
call   1070 <dtree_iserror@plt>
cmp    $0x0,%eax
je     120f <test_pass_file+0x9f>
lea    0xe0b(%rip),%rdi
lea    0xe13(%rip),%rsi
mov    $0x1b,%edx
lea    0xf49(%rip),%rcx
mov    $0x0,%al
call   1080 <_test_warn@plt>
mov    $0x0,%al
call   1050 <dtree_close@plt>
lea    0xde3(%rip),%rdi
mov    $0x0,%al
call   1030 <_test_end@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_pass_file>:
push   %rbx
lea    0xe88(%rip),%rdi
lea    0xe90(%rip),%rbx
mov    %rbx,%rsi
mov    $0x18,%edx
xor    %eax,%eax
call   1060 <_test_start@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1090 <dtree_open@plt>
test   %eax,%eax
je     11de <test_pass_file+0x6e>
xor    %eax,%eax
call   1070 <dtree_iserror@plt>
test   %eax,%eax
je     11c8 <test_pass_file+0x58>
lea    0xe52(%rip),%rdi
lea    0xe5a(%rip),%rsi
lea    0xf95(%rip),%rcx
mov    $0x1b,%edx
xor    %eax,%eax
call   1080 <_test_warn@plt>
xor    %eax,%eax
call   1050 <dtree_close@plt>
lea    0xe2a(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <_test_end@plt>
lea    0xe1b(%rip),%rdi
lea    0xe23(%rip),%rsi
lea    0xeab(%rip),%rcx
mov    $0x1a,%edx
xor    %eax,%eax
pop    %rbx
jmp    1040 <_test_fail@plt>

LLVM IR (-O0):
@__func__.test_pass_file = [15 x i8] c"test_pass_file\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 = [179 x i8] c"Successful when passing /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 as root dir\00"
@.str.2 = [57 x i8] c"Error is indicated by dtree_iserror(), but should not be\00"
define void @test_pass_file() {
%1 = alloca i32
%2 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @_test_start to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.test_pass_file, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0), i32 24)
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @dtree_open to i32 (i8*, ...)*)(i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, 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 ([15 x i8], [15 x i8]* @__func__.test_pass_file, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0), i32 26, i8* getelementptr inbounds ([179 x i8], [179 x i8]* @.str.1, i64 0, i64 0))
br label %18
10: ; preds = %0
%11 = call i32 (...) @dtree_iserror()
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_test_warn to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.test_pass_file, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0), i32 27, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %13, %10
%16 = call i32 (...) @dtree_close()
%17 = call i32 (i8*, ...) bitcast (i32 (...)* @_test_end to i32 (i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.test_pass_file, i64 0, i64 0))
br label %18
18: ; preds = %15, %8
ret void
}

LLVM IR (-O2):
@__func__.test_pass_file = [15 x i8] c"test_pass_file\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 = [179 x i8] c"Successful when passing /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 as root dir\00"
@.str.2 = [57 x i8] c"Error is indicated by dtree_iserror(), but should not be\00"
define void @test_pass_file() {
%1 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @_test_start to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.test_pass_file, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0), i32 24)
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @dtree_open to i32 (i8*, ...)*)(i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, 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 ([15 x i8], [15 x i8]* @__func__.test_pass_file, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0), i32 26, i8* getelementptr inbounds ([179 x i8], [179 x i8]* @.str.1, i64 0, i64 0))
br label %14
6: ; preds = %0
%7 = tail call i32 (...) @dtree_iserror()
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_test_warn to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.test_pass_file, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0), i32 27, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
%12 = tail call i32 (...) @dtree_close()
%13 = tail call i32 (i8*, ...) bitcast (i32 (...)* @_test_end to i32 (i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.test_pass_file, i64 0, i64 0))
br label %14
14: ; preds = %11, %4
ret void
}