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_bycompat_test.c",
               85, ((("Can not open testing device-tree"))));
    exit(1);
  };
  test_find_existent();
  dtree_reset();
  test_find_non_existent();
  dtree_reset();
  test_find_null();
  dtree_reset();
  test_find_empty();
  dtree_reset();
  test_find_serial_1_00_a();
  dtree_reset();
  dtree_close();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xefe(%rip),%rdi
mov    $0x0,%al
call   10b0 <dtree_open@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
je     11f9 <main+0x59>
lea    0xe2b(%rip),%rdi
lea    0xe29(%rip),%rsi
mov    $0x55,%edx
lea    0xeb0(%rip),%rcx
mov    $0x0,%al
call   1060 <_test_fail@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    $0x0,%al
call   1050 <test_find_existent@plt>
mov    $0x0,%al
call   1090 <dtree_reset@plt>
mov    $0x0,%al
call   10c0 <test_find_non_existent@plt>
mov    $0x0,%al
call   1090 <dtree_reset@plt>
mov    $0x0,%al
call   1070 <test_find_null@plt>
mov    $0x0,%al
call   1090 <dtree_reset@plt>
mov    $0x0,%al
call   1030 <test_find_empty@plt>
mov    $0x0,%al
call   1090 <dtree_reset@plt>
mov    $0x0,%al
call   1040 <test_find_serial_1_00_a@plt>
mov    $0x0,%al
call   1090 <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    0xf05(%rip),%rdi
xor    %eax,%eax
call   10b0 <dtree_open@plt>
test   %eax,%eax
jne    1204 <main+0x64>
xor    %eax,%eax
call   1050 <test_find_existent@plt>
xor    %eax,%eax
call   1090 <dtree_reset@plt>
xor    %eax,%eax
call   10c0 <test_find_non_existent@plt>
xor    %eax,%eax
call   1090 <dtree_reset@plt>
xor    %eax,%eax
call   1070 <test_find_null@plt>
xor    %eax,%eax
call   1090 <dtree_reset@plt>
xor    %eax,%eax
call   1030 <test_find_empty@plt>
xor    %eax,%eax
call   1090 <dtree_reset@plt>
xor    %eax,%eax
call   1040 <test_find_serial_1_00_a@plt>
xor    %eax,%eax
call   1090 <dtree_reset@plt>
xor    %eax,%eax
call   1080 <dtree_close@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xdf5(%rip),%rdi
lea    0xdf3(%rip),%rsi
lea    0xe7f(%rip),%rcx
mov    $0x55,%edx
xor    %eax,%eax
call   1060 <_test_fail@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"device-tree\00"
@__func__.main = [5 x i8] c"main\00"
@.str.1 = [147 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_bycompat_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 ([147 x i8], [147 x i8]* @.str.1, i64 0, i64 0), i32 85, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
unreachable
9: ; preds = %0
%10 = call i32 (...) @test_find_existent()
%11 = call i32 (...) @dtree_reset()
%12 = call i32 (...) @test_find_non_existent()
%13 = call i32 (...) @dtree_reset()
%14 = call i32 (...) @test_find_null()
%15 = call i32 (...) @dtree_reset()
%16 = call i32 (...) @test_find_empty()
%17 = call i32 (...) @dtree_reset()
%18 = call i32 (...) @test_find_serial_1_00_a()
%19 = call i32 (...) @dtree_reset()
%20 = 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 = [147 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_bycompat_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 ([147 x i8], [147 x i8]* @.str.1, i64 0, i64 0), i32 85, 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_find_existent()
%7 = tail call i32 (...) @dtree_reset()
%8 = tail call i32 (...) @test_find_non_existent()
%9 = tail call i32 (...) @dtree_reset()
%10 = tail call i32 (...) @test_find_null()
%11 = tail call i32 (...) @dtree_reset()
%12 = tail call i32 (...) @test_find_empty()
%13 = tail call i32 (...) @dtree_reset()
%14 = tail call i32 (...) @test_find_serial_1_00_a()
%15 = tail call i32 (...) @dtree_reset()
%16 = tail call i32 (...) @dtree_close()
ret i32 0
}