int main(void) {
  int err = dtree_open("device-tree");
  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_byname_test.c",
               113, ((("Can not open testing device-tree"))));
    exit(1);
  };
  test_list_all();
  dtree_reset();
  test_find_existent();
  dtree_reset();
  test_find_non_existent();
  dtree_reset();
  test_find_null();
  dtree_reset();
  test_find_empty();
  dtree_reset();
  test_find_with_discriminator();
  dtree_reset();
  test_find_debug();
  dtree_reset();
  dtree_close();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   10d0 <dtree_open@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
je     1219 <main+0x59>
lea    0xe0b(%rip),%rdi
lea    0xe09(%rip),%rsi
mov    $0x71,%edx
lea    0xe8e(%rip),%rcx
mov    $0x0,%al
call   1050 <_test_fail@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    $0x0,%al
call   10a0 <test_list_all@plt>
mov    $0x0,%al
call   10b0 <dtree_reset@plt>
mov    $0x0,%al
call   1040 <test_find_existent@plt>
mov    $0x0,%al
call   10b0 <dtree_reset@plt>
mov    $0x0,%al
call   10e0 <test_find_non_existent@plt>
mov    $0x0,%al
call   10b0 <dtree_reset@plt>
mov    $0x0,%al
call   1070 <test_find_null@plt>
mov    $0x0,%al
call   10b0 <dtree_reset@plt>
mov    $0x0,%al
call   1030 <test_find_empty@plt>
mov    $0x0,%al
call   10b0 <dtree_reset@plt>
mov    $0x0,%al
call   1060 <test_find_with_discriminator@plt>
mov    $0x0,%al
call   10b0 <dtree_reset@plt>
mov    $0x0,%al
call   1090 <test_find_debug@plt>
mov    $0x0,%al
call   10b0 <dtree_reset@plt>
mov    $0x0,%al
call   1080 <dtree_close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee3(%rip),%rdi
xor    %eax,%eax
call   10d0 <dtree_open@plt>
test   %eax,%eax
jne    1240 <main+0x80>
xor    %eax,%eax
call   10a0 <test_list_all@plt>
xor    %eax,%eax
call   10b0 <dtree_reset@plt>
xor    %eax,%eax
call   1040 <test_find_existent@plt>
xor    %eax,%eax
call   10b0 <dtree_reset@plt>
xor    %eax,%eax
call   10e0 <test_find_non_existent@plt>
xor    %eax,%eax
call   10b0 <dtree_reset@plt>
xor    %eax,%eax
call   1070 <test_find_null@plt>
xor    %eax,%eax
call   10b0 <dtree_reset@plt>
xor    %eax,%eax
call   1030 <test_find_empty@plt>
xor    %eax,%eax
call   10b0 <dtree_reset@plt>
xor    %eax,%eax
call   1060 <test_find_with_discriminator@plt>
xor    %eax,%eax
call   10b0 <dtree_reset@plt>
xor    %eax,%eax
call   1090 <test_find_debug@plt>
xor    %eax,%eax
call   10b0 <dtree_reset@plt>
xor    %eax,%eax
call   1080 <dtree_close@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xdb9(%rip),%rdi
lea    0xdb7(%rip),%rsi
lea    0xe41(%rip),%rcx
mov    $0x71,%edx
xor    %eax,%eax
call   1050 <_test_fail@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"device-tree\00"
@__func__.main = [5 x i8] c"main\00"
@.str.1 = [145 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_byname_test.c\00"
@.str.2 = [33 x i8] c"Can not open testing device-tree\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @dtree_open to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_test_fail to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0), i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str.1, i64 0, i64 0), i32 113, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
unreachable
9: ; preds = %0
%10 = call i32 (...) @test_list_all()
%11 = call i32 (...) @dtree_reset()
%12 = call i32 (...) @test_find_existent()
%13 = call i32 (...) @dtree_reset()
%14 = call i32 (...) @test_find_non_existent()
%15 = call i32 (...) @dtree_reset()
%16 = call i32 (...) @test_find_null()
%17 = call i32 (...) @dtree_reset()
%18 = call i32 (...) @test_find_empty()
%19 = call i32 (...) @dtree_reset()
%20 = call i32 (...) @test_find_with_discriminator()
%21 = call i32 (...) @dtree_reset()
%22 = call i32 (...) @test_find_debug()
%23 = call i32 (...) @dtree_reset()
%24 = call i32 (...) @dtree_close()
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"device-tree\00"
@__func__.main = [5 x i8] c"main\00"
@.str.1 = [145 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_byname_test.c\00"
@.str.2 = [33 x i8] c"Can not open testing device-tree\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @dtree_open to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_test_fail to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0), i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str.1, i64 0, i64 0), i32 113, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
tail call void @exit(i32 1)
unreachable
5: ; preds = %0
%6 = tail call i32 (...) @test_list_all()
%7 = tail call i32 (...) @dtree_reset()
%8 = tail call i32 (...) @test_find_existent()
%9 = tail call i32 (...) @dtree_reset()
%10 = tail call i32 (...) @test_find_non_existent()
%11 = tail call i32 (...) @dtree_reset()
%12 = tail call i32 (...) @test_find_null()
%13 = tail call i32 (...) @dtree_reset()
%14 = tail call i32 (...) @test_find_empty()
%15 = tail call i32 (...) @dtree_reset()
%16 = tail call i32 (...) @test_find_with_discriminator()
%17 = tail call i32 (...) @dtree_reset()
%18 = tail call i32 (...) @test_find_debug()
%19 = tail call i32 (...) @dtree_reset()
%20 = tail call i32 (...) @dtree_close()
ret i32 0
}