#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ UnixfsQueryOpen(void ***, void *, size_t, int, void *, size_t);
scalar_t__ pmlstate_query_open(void ***, void *, size_t, int, void *, size_t);
int pml_query_open(void ***objptr, void *atrp, size_t alen, int op, void *valp,
                   size_t vlen) {
  if ((alen == 0) && (vlen == 0))
    return (int)UnixfsQueryOpen(objptr, atrp, alen, op, valp, vlen);
  else
    return (int)pmlstate_query_open(objptr, atrp, alen, op, valp, vlen);
}


x86 assembly (clang, -O0):
<pml_query_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1179 <pml_query_open+0x59>
cmpq   $0x0,-0x38(%rbp)
jne    1179 <pml_query_open+0x59>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
call   1040 <UnixfsQueryOpen@plt>
mov    %eax,-0x4(%rbp)
jmp    1198 <pml_query_open+0x78>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
call   1030 <pmlstate_query_open@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pml_query_open>:
push   %rax
mov    %r9,%rax
or     %rdx,%rax
je     1130 <pml_query_open+0x10>
call   1030 <pmlstate_query_open@plt>
pop    %rcx
ret
xor    %edx,%edx
xor    %r9d,%r9d
call   1040 <UnixfsQueryOpen@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pml_query_open(i8*** %0, i8* %1, i64 %2, i32 %3, i8* %4, i64 %5) {
%7 = alloca i32
%8 = alloca i8***
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i64
store i8*** %0, i8**** %8
store i8* %1, i8** %9
store i64 %2, i64* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i64 %5, i64* %13
%14 = load i64, i64* %10
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %28
16: ; preds = %6
%17 = load i64, i64* %13
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %28
19: ; preds = %16
%20 = load i8***, i8**** %8
%21 = load i8*, i8** %9
%22 = load i64, i64* %10
%23 = load i32, i32* %11
%24 = load i8*, i8** %12
%25 = load i64, i64* %13
%26 = call i64 @UnixfsQueryOpen(i8*** %20, i8* %21, i64 %22, i32 %23, i8* %24, i64 %25)
%27 = trunc i64 %26 to i32
store i32 %27, i32* %7
br label %37
28: ; preds = %16, %6
%29 = load i8***, i8**** %8
%30 = load i8*, i8** %9
%31 = load i64, i64* %10
%32 = load i32, i32* %11
%33 = load i8*, i8** %12
%34 = load i64, i64* %13
%35 = call i64 @pmlstate_query_open(i8*** %29, i8* %30, i64 %31, i32 %32, i8* %33, i64 %34)
%36 = trunc i64 %35 to i32
store i32 %36, i32* %7
br label %37
37: ; preds = %28, %19
%38 = load i32, i32* %7
ret i32 %38
}

LLVM IR (-O2):
define i32 @pml_query_open(i8*** %0, i8* %1, i64 %2, i32 %3, i8* %4, i64 %5) {
%7 = or i64 %5, %2
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i64 @UnixfsQueryOpen(i8*** %0, i8* %1, i64 0, i32 %3, i8* %4, i64 0)
br label %13
11: ; preds = %6
%12 = tail call i64 @pmlstate_query_open(i8*** %0, i8* %1, i64 %2, i32 %3, i8* %4, i64 %5)
br label %13
13: ; preds = %11, %9
%14 = phi i64 [ %10, %9 ], [ %12, %11 ]
%15 = trunc i64 %14 to i32
ret i32 %15
}