# Autogenerated wrapper script for aiger_jll for aarch64-linux-gnu
export aiginfo, aigsplit, aigtoblif, aigmiter, bliftoaig, aigand, aigfuzz, aigtocnf, aigtodot, smvtoaig, wrapstim, aigreset, aigstrip, aigtosmv, aigmove, aigsim, andtoaig, soltostim, aigunroll, aigtoaig, aigunconstraint, aigdd, aigflip, aigor, aignm, aigjoin

## Global variables
PATH = ""
LIBPATH = ""
LIBPATH_env = "LD_LIBRARY_PATH"

# Relative path to `aiginfo`
const aiginfo_splitpath = ["bin", "aiginfo"]

# This will be filled out by __init__() for all products, as it must be done at runtime
aiginfo_path = ""

# aiginfo-specific global declaration
function aiginfo(f::Function; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true)
    global PATH, LIBPATH
    env_mapping = Dict{String,String}()
    if adjust_PATH
        if !isempty(get(ENV, "PATH", ""))
            env_mapping["PATH"] = string(PATH, ':', ENV["PATH"])
        else
            env_mapping["PATH"] = PATH
        end
    end
    if adjust_LIBPATH
        if !isempty(get(ENV, LIBPATH_env, ""))
            env_mapping[LIBPATH_env] = string(LIBPATH, ':', ENV[LIBPATH_env])
        else
            env_mapping[LIBPATH_env] = LIBPATH
        end
    end
    withenv(env_mapping...) do
        f(aiginfo_path)
    end
end


# Relative path to `aigsplit`
const aigsplit_splitpath = ["bin", "aigsplit"]

# This will be filled out by __init__() for all products, as it must be done at runtime
aigsplit_path = ""

# aigsplit-specific global declaration
function aigsplit(f::Function; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true)
    global PATH, LIBPATH
    env_mapping = Dict{String,String}()
    if adjust_PATH
        if !isempty(get(ENV, "PATH", ""))
            env_mapping["PATH"] = string(PATH, ':', ENV["PATH"])
        else
            env_mapping["PATH"] = PATH
        end
    end
    if adjust_LIBPATH
        if !isempty(get(ENV, LIBPATH_env, ""))
            env_mapping[LIBPATH_env] = string(LIBPATH, ':', ENV[LIBPATH_env])
        else
            env_mapping[LIBPATH_env] = LIBPATH
        end
    end
    withenv(env_mapping...) do
        f(aigsplit_path)
    end
end


# Relative path to `aigtoblif`
const aigtoblif_splitpath = ["bin", "aigtoblif"]

# This will be filled out by __init__() for all products, as it must be done at runtime
aigtoblif_path = ""

# aigtoblif-specific global declaration
function aigtoblif(f::Function; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true)
    global PATH, LIBPATH
    env_mapping = Dict{String,String}()
    if adjust_PATH
        if !isempty(get(ENV, "PATH", ""))
            env_mapping["PATH"] = string(PATH, ':', ENV["PATH"])
        else
            env_mapping["PATH"] = PATH
        end
    end
    if adjust_LIBPATH
        if !isempty(get(ENV, LIBPATH_env, ""))
            env_mapping[LIBPATH_env] = string(LIBPATH, ':', ENV[LIBPATH_env])
        else
            env_mapping[LIBPATH_env] = LIBPATH
        end
    end
    withenv(env_mapping...) do
        f(aigtoblif_path)
    end
end


# Relative path to `aigmiter`
const aigmiter_splitpath = ["bin", "aigmiter"]

# This will be filled out by __init__() for all products, as it must be done at runtime
aigmiter_path = ""

# aigmiter-specific global declaration
function aigmiter(f::Function; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true)
    global PATH, LIBPATH
    env_mapping = Dict{String,String}()
    if adjust_PATH
        if !isempty(get(ENV, "PATH", ""))
            env_mapping["PATH"] = string(PATH, ':', ENV["PATH"])
        else
            env_mapping["PATH"] = PATH
        end
    end
    if adjust_LIBPATH
        if !isempty(get(ENV, LIBPATH_env, ""))
            env_mapping[LIBPATH_env] = string(LIBPATH, ':', ENV[LIBPATH_env])
        else
            env_mapping[LIBPATH_env] = LIBPATH
        end
    end
    withenv(env_mapping...) do
        f(aigmiter_path)
    end
end


# Relative path to `bliftoaig`
const bliftoaig_splitpath = ["bin", "bliftoaig"]

# This will be filled out by __init__() for all products, as it must be done at runtime
bliftoaig_path = ""

# bliftoaig-specific global declaration
function bliftoaig(f::Function; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true)
    global PATH, LIBPATH
    env_mapping = Dict{String,String}()
    if adjust_PATH
        if !isempty(get(ENV, "PATH", ""))
            env_mapping["PATH"] = string(PATH, ':', ENV["PATH"])
        else
            env_mapping["PATH"] = PATH
        end
    end
    if adjust_LIBPATH
        if !isempty(get(ENV, LIBPATH_env, ""))
            env_mapping[LIBPATH_env] = string(LIBPATH, ':', ENV[LIBPATH_env])
        else
            env_mapping[LIBPATH_env] = LIBPATH
        end
    end
    withenv(env_mapping...) do
        f(bliftoaig_path)
    end
end


# Relative path to `aigand`
const aigand_splitpath = ["bin", "aigand"]

# This will be filled out by __init__() for all products, as it must be done at runtime
aigand_path = ""

# aigand-specific global declaration
function aigand(f::Function; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true)
    global PATH, LIBPATH
    env_mapping = Dict{String,String}()
    if adjust_PATH
        if !isempty(get(ENV, "PATH", ""))
            env_mapping["PATH"] = string(PATH, ':', ENV["PATH"])
        else
            env_mapping["PATH"] = PATH
        end
    end
    if adjust_LIBPATH
        if !isempty(get(ENV, LIBPATH_env, ""))
            env_mapping[LIBPATH_env] = string(LIBPATH, ':', ENV[LIBPATH_env])
        else
            env_mapping[LIBPATH_env] = LIBPATH
        end
    end
    withenv(env_mapping...) do
        f(aigand_path)
    end
end


# Relative path to `aigfuzz`
const aigfuzz_splitpath = ["bin", "aigfuzz"]

# This will be filled out by __init__() for all products, as it must be done at runtime
aigfuzz_path = ""

# aigfuzz-specific global declaration
function aigfuzz(f::Function; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true)
    global PATH, LIBPATH
    env_mapping = Dict{String,String}()
    if adjust_PATH
        if !isempty(get(ENV, "PATH", ""))
            env_mapping["PATH"] = string(PATH, ':', ENV["PATH"])
        else
            env_mapping["PATH"] = PATH
        end
    end
    if adjust_LIBPATH
        if !isempty(get(ENV, LIBPATH_env, ""))
            env_mapping[LIBPATH_env] = string(LIBPATH, ':', ENV[LIBPATH_env])
        else
            env_mapping[LIBPATH_env] = LIBPATH
        end
    end
    withenv(env_mapping...) do
        f(aigfuzz_path)
    end
end


# Relative path to `aigtocnf`
const aigtocnf_splitpath = ["bin", "aigtocnf"]

# This will be filled out by __init__() for all products, as it must be done at runtime
aigtocnf_path = ""

# aigtocnf-specific global declaration
function aigtocnf(f::Function; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true)
    global PATH, LIBPATH
    env_mapping = Dict{String,String}()
    if adjust_PATH
        if !isempty(get(ENV, "PATH", ""))
            env_mapping["PATH"] = string(PATH, ':', ENV["PATH"])
        else
            env_mapping["PATH"] = PATH
        end
    end
    if adjust_LIBPATH
        if !isempty(get(ENV, LIBPATH_env, ""))
            env_mapping[LIBPATH_env] = string(LIBPATH, ':', ENV[LIBPATH_env])
        else
            env_mapping[LIBPATH_env] = LIBPATH
        end
    end
    withenv(env_mapping...) do
        f(aigtocnf_path)
    end
end


# Relative path to `aigtodot`
const aigtodot_splitpath = ["bin", "aigtodot"]

# This will be filled out by __init__() for all products, as it must be done at runtime
aigtodot_path = ""

# aigtodot-specific global declaration
function aigtodot(f::Function; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true)
    global PATH, LIBPATH
    env_mapping = Dict{String,String}()
    if adjust_PATH
        if !isempty(get(ENV, "PATH", ""))
            env_mapping["PATH"] = string(PATH, ':', ENV["PATH"])
        else
            env_mapping["PATH"] = PATH
        end
    end
    if adjust_LIBPATH
        if !isempty(get(ENV, LIBPATH_env, ""))
            env_mapping[LIBPATH_env] = string(LIBPATH, ':', ENV[LIBPATH_env])
        else
            env_mapping[LIBPATH_env] = LIBPATH
        end
    end
    withenv(env_mapping...) do
        f(aigtodot_path)
    end
end


# Relative path to `smvtoaig`
const smvtoaig_splitpath = ["bin", "smvtoaig"]

# This will be filled out by __init__() for all products, as it must be done at runtime
smvtoaig_path = ""

# smvtoaig-specific global declaration
function smvtoaig(f::Function; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true)
    global PATH, LIBPATH
    env_mapping = Dict{String,String}()
    if adjust_PATH
        if !isempty(get(ENV, "PATH", ""))
            env_mapping["PATH"] = string(PATH, ':', ENV["PATH"])
        else
            env_mapping["PATH"] = PATH
        end
    end
    if adjust_LIBPATH
        if !isempty(get(ENV, LIBPATH_env, ""))
            env_mapping[LIBPATH_env] = string(LIBPATH, ':', ENV[LIBPATH_env])
        else
            env_mapping[LIBPATH_env] = LIBPATH
        end
    end
    withenv(env_mapping...) do
        f(smvtoaig_path)
    end
end


# Relative path to `wrapstim`
const wrapstim_splitpath = ["bin", "wrapstim"]

# This will be filled out by __init__() for all products, as it must be done at runtime
wrapstim_path = ""

# wrapstim-specific global declaration
function wrapstim(f::Function; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true)
    global PATH, LIBPATH
    env_mapping = Dict{String,String}()
    if adjust_PATH
        if !isempty(get(ENV, "PATH", ""))
            env_mapping["PATH"] = string(PATH, ':', ENV["PATH"])
        else
            env_mapping["PATH"] = PATH
        end
    end
    if adjust_LIBPATH
        if !isempty(get(ENV, LIBPATH_env, ""))
            env_mapping[LIBPATH_env] = string(LIBPATH, ':', ENV[LIBPATH_env])
        else
            env_mapping[LIBPATH_env] = LIBPATH
        end
    end
    withenv(env_mapping...) do
        f(wrapstim_path)
    end
end


# Relative path to `aigreset`
const aigreset_splitpath = ["bin", "aigreset"]

# This will be filled out by __init__() for all products, as it must be done at runtime
aigreset_path = ""

# aigreset-specific global declaration
function aigreset(f::Function; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true)
    global PATH, LIBPATH
    env_mapping = Dict{String,String}()
    if adjust_PATH
        if !isempty(get(ENV, "PATH", ""))
            env_mapping["PATH"] = string(PATH, ':', ENV["PATH"])
        else
            env_mapping["PATH"] = PATH
        end
    end
    if adjust_LIBPATH
        if !isempty(get(ENV, LIBPATH_env, ""))
            env_mapping[LIBPATH_env] = string(LIBPATH, ':', ENV[LIBPATH_env])
        else
            env_mapping[LIBPATH_env] = LIBPATH
        end
    end
    withenv(env_mapping...) do
        f(aigreset_path)
    end
end


# Relative path to `aigstrip`
const aigstrip_splitpath = ["bin", "aigstrip"]

# This will be filled out by __init__() for all products, as it must be done at runtime
aigstrip_path = ""

# aigstrip-specific global declaration
function aigstrip(f::Function; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true)
    global PATH, LIBPATH
    env_mapping = Dict{String,String}()
    if adjust_PATH
        if !isempty(get(ENV, "PATH", ""))
            env_mapping["PATH"] = string(PATH, ':', ENV["PATH"])
        else
            env_mapping["PATH"] = PATH
        end
    end
    if adjust_LIBPATH
        if !isempty(get(ENV, LIBPATH_env, ""))
            env_mapping[LIBPATH_env] = string(LIBPATH, ':', ENV[LIBPATH_env])
        else
            env_mapping[LIBPATH_env] = LIBPATH
        end
    end
    withenv(env_mapping...) do
        f(aigstrip_path)
    end
end


# Relative path to `aigtosmv`
const aigtosmv_splitpath = ["bin", "aigtosmv"]

# This will be filled out by __init__() for all products, as it must be done at runtime
aigtosmv_path = ""

# aigtosmv-specific global declaration
function aigtosmv(f::Function; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true)
    global PATH, LIBPATH
    env_mapping = Dict{String,String}()
    if adjust_PATH
        if !isempty(get(ENV, "PATH", ""))
            env_mapping["PATH"] = string(PATH, ':', ENV["PATH"])
        else
            env_mapping["PATH"] = PATH
        end
    end
    if adjust_LIBPATH
        if !isempty(get(ENV, LIBPATH_env, ""))
            env_mapping[LIBPATH_env] = string(LIBPATH, ':', ENV[LIBPATH_env])
        else
            env_mapping[LIBPATH_env] = LIBPATH
        end
    end
    withenv(env_mapping...) do
        f(aigtosmv_path)
    end
end


# Relative path to `aigmove`
const aigmove_splitpath = ["bin", "aigmove"]

# This will be filled out by __init__() for all products, as it must be done at runtime
aigmove_path = ""

# aigmove-specific global declaration
function aigmove(f::Function; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true)
    global PATH, LIBPATH
    env_mapping = Dict{String,String}()
    if adjust_PATH
        if !isempty(get(ENV, "PATH", ""))
            env_mapping["PATH"] = string(PATH, ':', ENV["PATH"])
        else
            env_mapping["PATH"] = PATH
        end
    end
    if adjust_LIBPATH
        if !isempty(get(ENV, LIBPATH_env, ""))
            env_mapping[LIBPATH_env] = string(LIBPATH, ':', ENV[LIBPATH_env])
        else
            env_mapping[LIBPATH_env] = LIBPATH
        end
    end
    withenv(env_mapping...) do
        f(aigmove_path)
    end
end


# Relative path to `aigsim`
const aigsim_splitpath = ["bin", "aigsim"]

# This will be filled out by __init__() for all products, as it must be done at runtime
aigsim_path = ""

# aigsim-specific global declaration
function aigsim(f::Function; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true)
    global PATH, LIBPATH
    env_mapping = Dict{String,String}()
    if adjust_PATH
        if !isempty(get(ENV, "PATH", ""))
            env_mapping["PATH"] = string(PATH, ':', ENV["PATH"])
        else
            env_mapping["PATH"] = PATH
        end
    end
    if adjust_LIBPATH
        if !isempty(get(ENV, LIBPATH_env, ""))
            env_mapping[LIBPATH_env] = string(LIBPATH, ':', ENV[LIBPATH_env])
        else
            env_mapping[LIBPATH_env] = LIBPATH
        end
    end
    withenv(env_mapping...) do
        f(aigsim_path)
    end
end


# Relative path to `andtoaig`
const andtoaig_splitpath = ["bin", "andtoaig"]

# This will be filled out by __init__() for all products, as it must be done at runtime
andtoaig_path = ""

# andtoaig-specific global declaration
function andtoaig(f::Function; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true)
    global PATH, LIBPATH
    env_mapping = Dict{String,String}()
    if adjust_PATH
        if !isempty(get(ENV, "PATH", ""))
            env_mapping["PATH"] = string(PATH, ':', ENV["PATH"])
        else
            env_mapping["PATH"] = PATH
        end
    end
    if adjust_LIBPATH
        if !isempty(get(ENV, LIBPATH_env, ""))
            env_mapping[LIBPATH_env] = string(LIBPATH, ':', ENV[LIBPATH_env])
        else
            env_mapping[LIBPATH_env] = LIBPATH
        end
    end
    withenv(env_mapping...) do
        f(andtoaig_path)
    end
end


# Relative path to `soltostim`
const soltostim_splitpath = ["bin", "soltostim"]

# This will be filled out by __init__() for all products, as it must be done at runtime
soltostim_path = ""

# soltostim-specific global declaration
function soltostim(f::Function; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true)
    global PATH, LIBPATH
    env_mapping = Dict{String,String}()
    if adjust_PATH
        if !isempty(get(ENV, "PATH", ""))
            env_mapping["PATH"] = string(PATH, ':', ENV["PATH"])
        else
            env_mapping["PATH"] = PATH
        end
    end
    if adjust_LIBPATH
        if !isempty(get(ENV, LIBPATH_env, ""))
            env_mapping[LIBPATH_env] = string(LIBPATH, ':', ENV[LIBPATH_env])
        else
            env_mapping[LIBPATH_env] = LIBPATH
        end
    end
    withenv(env_mapping...) do
        f(soltostim_path)
    end
end


# Relative path to `aigunroll`
const aigunroll_splitpath = ["bin", "aigunroll"]

# This will be filled out by __init__() for all products, as it must be done at runtime
aigunroll_path = ""

# aigunroll-specific global declaration
function aigunroll(f::Function; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true)
    global PATH, LIBPATH
    env_mapping = Dict{String,String}()
    if adjust_PATH
        if !isempty(get(ENV, "PATH", ""))
            env_mapping["PATH"] = string(PATH, ':', ENV["PATH"])
        else
            env_mapping["PATH"] = PATH
        end
    end
    if adjust_LIBPATH
        if !isempty(get(ENV, LIBPATH_env, ""))
            env_mapping[LIBPATH_env] = string(LIBPATH, ':', ENV[LIBPATH_env])
        else
            env_mapping[LIBPATH_env] = LIBPATH
        end
    end
    withenv(env_mapping...) do
        f(aigunroll_path)
    end
end


# Relative path to `aigtoaig`
const aigtoaig_splitpath = ["bin", "aigtoaig"]

# This will be filled out by __init__() for all products, as it must be done at runtime
aigtoaig_path = ""

# aigtoaig-specific global declaration
function aigtoaig(f::Function; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true)
    global PATH, LIBPATH
    env_mapping = Dict{String,String}()
    if adjust_PATH
        if !isempty(get(ENV, "PATH", ""))
            env_mapping["PATH"] = string(PATH, ':', ENV["PATH"])
        else
            env_mapping["PATH"] = PATH
        end
    end
    if adjust_LIBPATH
        if !isempty(get(ENV, LIBPATH_env, ""))
            env_mapping[LIBPATH_env] = string(LIBPATH, ':', ENV[LIBPATH_env])
        else
            env_mapping[LIBPATH_env] = LIBPATH
        end
    end
    withenv(env_mapping...) do
        f(aigtoaig_path)
    end
end


# Relative path to `aigunconstraint`
const aigunconstraint_splitpath = ["bin", "aigunconstraint"]

# This will be filled out by __init__() for all products, as it must be done at runtime
aigunconstraint_path = ""

# aigunconstraint-specific global declaration
function aigunconstraint(f::Function; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true)
    global PATH, LIBPATH
    env_mapping = Dict{String,String}()
    if adjust_PATH
        if !isempty(get(ENV, "PATH", ""))
            env_mapping["PATH"] = string(PATH, ':', ENV["PATH"])
        else
            env_mapping["PATH"] = PATH
        end
    end
    if adjust_LIBPATH
        if !isempty(get(ENV, LIBPATH_env, ""))
            env_mapping[LIBPATH_env] = string(LIBPATH, ':', ENV[LIBPATH_env])
        else
            env_mapping[LIBPATH_env] = LIBPATH
        end
    end
    withenv(env_mapping...) do
        f(aigunconstraint_path)
    end
end


# Relative path to `aigdd`
const aigdd_splitpath = ["bin", "aigdd"]

# This will be filled out by __init__() for all products, as it must be done at runtime
aigdd_path = ""

# aigdd-specific global declaration
function aigdd(f::Function; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true)
    global PATH, LIBPATH
    env_mapping = Dict{String,String}()
    if adjust_PATH
        if !isempty(get(ENV, "PATH", ""))
            env_mapping["PATH"] = string(PATH, ':', ENV["PATH"])
        else
            env_mapping["PATH"] = PATH
        end
    end
    if adjust_LIBPATH
        if !isempty(get(ENV, LIBPATH_env, ""))
            env_mapping[LIBPATH_env] = string(LIBPATH, ':', ENV[LIBPATH_env])
        else
            env_mapping[LIBPATH_env] = LIBPATH
        end
    end
    withenv(env_mapping...) do
        f(aigdd_path)
    end
end


# Relative path to `aigflip`
const aigflip_splitpath = ["bin", "aigflip"]

# This will be filled out by __init__() for all products, as it must be done at runtime
aigflip_path = ""

# aigflip-specific global declaration
function aigflip(f::Function; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true)
    global PATH, LIBPATH
    env_mapping = Dict{String,String}()
    if adjust_PATH
        if !isempty(get(ENV, "PATH", ""))
            env_mapping["PATH"] = string(PATH, ':', ENV["PATH"])
        else
            env_mapping["PATH"] = PATH
        end
    end
    if adjust_LIBPATH
        if !isempty(get(ENV, LIBPATH_env, ""))
            env_mapping[LIBPATH_env] = string(LIBPATH, ':', ENV[LIBPATH_env])
        else
            env_mapping[LIBPATH_env] = LIBPATH
        end
    end
    withenv(env_mapping...) do
        f(aigflip_path)
    end
end


# Relative path to `aigor`
const aigor_splitpath = ["bin", "aigor"]

# This will be filled out by __init__() for all products, as it must be done at runtime
aigor_path = ""

# aigor-specific global declaration
function aigor(f::Function; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true)
    global PATH, LIBPATH
    env_mapping = Dict{String,String}()
    if adjust_PATH
        if !isempty(get(ENV, "PATH", ""))
            env_mapping["PATH"] = string(PATH, ':', ENV["PATH"])
        else
            env_mapping["PATH"] = PATH
        end
    end
    if adjust_LIBPATH
        if !isempty(get(ENV, LIBPATH_env, ""))
            env_mapping[LIBPATH_env] = string(LIBPATH, ':', ENV[LIBPATH_env])
        else
            env_mapping[LIBPATH_env] = LIBPATH
        end
    end
    withenv(env_mapping...) do
        f(aigor_path)
    end
end


# Relative path to `aignm`
const aignm_splitpath = ["bin", "aignm"]

# This will be filled out by __init__() for all products, as it must be done at runtime
aignm_path = ""

# aignm-specific global declaration
function aignm(f::Function; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true)
    global PATH, LIBPATH
    env_mapping = Dict{String,String}()
    if adjust_PATH
        if !isempty(get(ENV, "PATH", ""))
            env_mapping["PATH"] = string(PATH, ':', ENV["PATH"])
        else
            env_mapping["PATH"] = PATH
        end
    end
    if adjust_LIBPATH
        if !isempty(get(ENV, LIBPATH_env, ""))
            env_mapping[LIBPATH_env] = string(LIBPATH, ':', ENV[LIBPATH_env])
        else
            env_mapping[LIBPATH_env] = LIBPATH
        end
    end
    withenv(env_mapping...) do
        f(aignm_path)
    end
end


# Relative path to `aigjoin`
const aigjoin_splitpath = ["bin", "aigjoin"]

# This will be filled out by __init__() for all products, as it must be done at runtime
aigjoin_path = ""

# aigjoin-specific global declaration
function aigjoin(f::Function; adjust_PATH::Bool = true, adjust_LIBPATH::Bool = true)
    global PATH, LIBPATH
    env_mapping = Dict{String,String}()
    if adjust_PATH
        if !isempty(get(ENV, "PATH", ""))
            env_mapping["PATH"] = string(PATH, ':', ENV["PATH"])
        else
            env_mapping["PATH"] = PATH
        end
    end
    if adjust_LIBPATH
        if !isempty(get(ENV, LIBPATH_env, ""))
            env_mapping[LIBPATH_env] = string(LIBPATH, ':', ENV[LIBPATH_env])
        else
            env_mapping[LIBPATH_env] = LIBPATH
        end
    end
    withenv(env_mapping...) do
        f(aigjoin_path)
    end
end


"""
Open all libraries
"""
function __init__()
    global artifact_dir = abspath(artifact"aiger")

    # Initialize PATH and LIBPATH environment variable listings
    global PATH_list, LIBPATH_list
    # We first need to add to LIBPATH_list the libraries provided by Julia
    append!(LIBPATH_list, [joinpath(Sys.BINDIR, Base.LIBDIR, "julia"), joinpath(Sys.BINDIR, Base.LIBDIR)])
    global aiginfo_path = normpath(joinpath(artifact_dir, aiginfo_splitpath...))

    push!(PATH_list, dirname(aiginfo_path))
    global aigsplit_path = normpath(joinpath(artifact_dir, aigsplit_splitpath...))

    push!(PATH_list, dirname(aigsplit_path))
    global aigtoblif_path = normpath(joinpath(artifact_dir, aigtoblif_splitpath...))

    push!(PATH_list, dirname(aigtoblif_path))
    global aigmiter_path = normpath(joinpath(artifact_dir, aigmiter_splitpath...))

    push!(PATH_list, dirname(aigmiter_path))
    global bliftoaig_path = normpath(joinpath(artifact_dir, bliftoaig_splitpath...))

    push!(PATH_list, dirname(bliftoaig_path))
    global aigand_path = normpath(joinpath(artifact_dir, aigand_splitpath...))

    push!(PATH_list, dirname(aigand_path))
    global aigfuzz_path = normpath(joinpath(artifact_dir, aigfuzz_splitpath...))

    push!(PATH_list, dirname(aigfuzz_path))
    global aigtocnf_path = normpath(joinpath(artifact_dir, aigtocnf_splitpath...))

    push!(PATH_list, dirname(aigtocnf_path))
    global aigtodot_path = normpath(joinpath(artifact_dir, aigtodot_splitpath...))

    push!(PATH_list, dirname(aigtodot_path))
    global smvtoaig_path = normpath(joinpath(artifact_dir, smvtoaig_splitpath...))

    push!(PATH_list, dirname(smvtoaig_path))
    global wrapstim_path = normpath(joinpath(artifact_dir, wrapstim_splitpath...))

    push!(PATH_list, dirname(wrapstim_path))
    global aigreset_path = normpath(joinpath(artifact_dir, aigreset_splitpath...))

    push!(PATH_list, dirname(aigreset_path))
    global aigstrip_path = normpath(joinpath(artifact_dir, aigstrip_splitpath...))

    push!(PATH_list, dirname(aigstrip_path))
    global aigtosmv_path = normpath(joinpath(artifact_dir, aigtosmv_splitpath...))

    push!(PATH_list, dirname(aigtosmv_path))
    global aigmove_path = normpath(joinpath(artifact_dir, aigmove_splitpath...))

    push!(PATH_list, dirname(aigmove_path))
    global aigsim_path = normpath(joinpath(artifact_dir, aigsim_splitpath...))

    push!(PATH_list, dirname(aigsim_path))
    global andtoaig_path = normpath(joinpath(artifact_dir, andtoaig_splitpath...))

    push!(PATH_list, dirname(andtoaig_path))
    global soltostim_path = normpath(joinpath(artifact_dir, soltostim_splitpath...))

    push!(PATH_list, dirname(soltostim_path))
    global aigunroll_path = normpath(joinpath(artifact_dir, aigunroll_splitpath...))

    push!(PATH_list, dirname(aigunroll_path))
    global aigtoaig_path = normpath(joinpath(artifact_dir, aigtoaig_splitpath...))

    push!(PATH_list, dirname(aigtoaig_path))
    global aigunconstraint_path = normpath(joinpath(artifact_dir, aigunconstraint_splitpath...))

    push!(PATH_list, dirname(aigunconstraint_path))
    global aigdd_path = normpath(joinpath(artifact_dir, aigdd_splitpath...))

    push!(PATH_list, dirname(aigdd_path))
    global aigflip_path = normpath(joinpath(artifact_dir, aigflip_splitpath...))

    push!(PATH_list, dirname(aigflip_path))
    global aigor_path = normpath(joinpath(artifact_dir, aigor_splitpath...))

    push!(PATH_list, dirname(aigor_path))
    global aignm_path = normpath(joinpath(artifact_dir, aignm_splitpath...))

    push!(PATH_list, dirname(aignm_path))
    global aigjoin_path = normpath(joinpath(artifact_dir, aigjoin_splitpath...))

    push!(PATH_list, dirname(aigjoin_path))
    # Filter out duplicate and empty entries in our PATH and LIBPATH entries
    filter!(!isempty, unique!(PATH_list))
    filter!(!isempty, unique!(LIBPATH_list))
    global PATH = join(PATH_list, ':')
    global LIBPATH = join(LIBPATH_list, ':')

    # Add each element of LIBPATH to our DL_LOAD_PATH (necessary on platforms
    # that don't honor our "already opened" trick)
    #for lp in LIBPATH_list
    #    push!(DL_LOAD_PATH, lp)
    #end
end  # __init__()

