int main(void) {
  const int expect = 8;
  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_next_test.c",
               34, ((("Can not open testing device-tree"))));
    exit(1);
  };
  test_all_dev(expect);
  dtree_close();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x8,-0x4(%rbp)
lea    0xf43(%rip),%rdi
mov    $0x0,%al
call   1060 <dtree_open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
je     11b0 <main+0x60>
lea    0xe74(%rip),%rdi
lea    0xe72(%rip),%rsi
mov    $0x22,%edx
lea    0xef5(%rip),%rcx
mov    $0x0,%al
call   1030 <_test_fail@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    $0x8,%edi
mov    $0x0,%al
call   1070 <test_all_dev@plt>
mov    $0x0,%al
call   1040 <dtree_close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf51(%rip),%rdi
xor    %eax,%eax
call   1060 <dtree_open@plt>
test   %eax,%eax
jne    117a <main+0x2a>
mov    $0x8,%edi
xor    %eax,%eax
call   1070 <test_all_dev@plt>
xor    %eax,%eax
call   1040 <dtree_close@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xe7f(%rip),%rdi
lea    0xe7d(%rip),%rsi
lea    0xf05(%rip),%rcx
mov    $0x22,%edx
xor    %eax,%eax
call   1030 <_test_fail@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"device-tree\00"
@__func__.main = [5 x i8] c"main\00"
@.str.1 = [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_next_test.c\00"
@.str.2 = [33 x i8] c"Can not open testing device-tree\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 8, i32* %1
%3 = 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 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne 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 ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str.1, i64 0, i64 0), i32 34, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
unreachable
10: ; preds = %0
%11 = call i32 (i32, ...) bitcast (i32 (...)* @test_all_dev to i32 (i32, ...)*)(i32 8)
%12 = 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 = [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_next_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 ([143 x i8], [143 x i8]* @.str.1, i64 0, i64 0), i32 34, 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 (i32, ...) bitcast (i32 (...)* @test_all_dev to i32 (i32, ...)*)(i32 8)
%7 = tail call i32 (...) @dtree_close()
ret i32 0
}