text:
# Core traits and accessor functions

"""
`alpha(p)` extracts the alpha component of a color. For a color
without an alpha channel, it will always return 1.
"""
alpha(c::TransparentColor) = c.alpha
alpha(c::Color)   = one(eltype(c))
alpha(c::RGB24)   = UFixed8(1)
alpha(c::ARGB32)  = UFixed8((c.color & 0xff000000)>>24, 0)
alpha(c::AGray32) = UFixed8((c.color & 0xff000000)>>24, 0)

"`red(c)` returns the red component of an `AbstractRGB` opaque or transparent color."
red(c::AbstractRGB   ) = c.r
red(c::TransparentRGB) = c.r
red(c::RGB24)  = UFixed8((c.color & 0x00ff0000)>>16, 0)
red(c::ARGB32) = UFixed8((c.color & 0x00ff0000)>>16, 0)

"`green(c)` returns the green component of an `AbstractRGB` opaque or transparent color."
green(c::AbstractRGB   ) = c.g
green(c::TransparentRGB) = c.g
green(c::RGB24)  = UFixed8((c.color & 0x0000ff00)>>8, 0)
green(c::ARGB32) = UFixed8((c.color & 0x0000ff00)>>8, 0)

"`blue(c)` returns the blue component of an `AbstractRGB` opaque or transparent color."
blue(c::AbstractRGB   ) = c.b
blue(c::TransparentRGB) = c.b
blue(c::RGB24)  = UFixed8(c.color & 0x000000ff, 0)
blue(c::ARGB32) = UFixed8(c.color & 0x000000ff, 0)

"`gray(c)` returns the gray component of a grayscale opaque or transparent color."
gray(c::Gray)    = c.val
gray(c::TransparentGray) = c.val
gray(c::Gray24)  = UFixed8(c.color & 0x000000ff, 0)
gray(c::AGray32) = UFixed8(c.color & 0x000000ff, 0)
gray(x::Union{Fractional,Bool}) = x

# Extract the first, second, and third arguments as you'd
# pass them to the constructor
"""
`comp1(c)` extracts the first component you'd pass to the constructor
of the corresponding object.  For most color types without an alpha
channel, this is just the first field, but for types like `BGR` that
reverse the internal storage order this provides the value that you'd
use to reconstruct the color.

Specifically, for any `Color{T,3}`,

    c == typeof(c)(comp1(c), comp2(c), comp3(c))

returns true.
"""
comp1(c::AbstractRGB) = red(c)
comp1{C<:AbstractRGB}(c::Union{AlphaColor{C},ColorAlpha{C}}) = red(c)
comp1(c::Union{Color,ColorAlpha}) = getfield(c, 1)
comp1(c::AlphaColor) = getfield(c, 2)
comp1(c::AGray32) = gray(c)

"`comp2(c)` extracts the second constructor argument (see `comp1`)."
comp2(c::AbstractRGB) = green(c)
comp2{C<:AbstractRGB}(c::Union{AlphaColor{C},ColorAlpha{C}}) = green(c)
comp2(c::Union{Color,ColorAlpha}) = getfield(c, 2)
comp2(c::AlphaColor) = getfield(c, 3)

"`comp3(c)` extracts the third constructor argument (see `comp1`)."
comp3(c::AbstractRGB) = blue(c)
comp3{C<:AbstractRGB}(c::Union{AlphaColor{C},ColorAlpha{C}}) = blue(c)
comp3(c::Union{Color,ColorAlpha}) = getfield(c, 3)
comp3(c::AlphaColor) = getfield(c, 4)

"`color(c)` extracts the opaque color component from a Colorant (e.g., omits the alpha channel, if present)."
color(c::Color) = c
color{C,T}(c::TransparentColor{C,T,4}) = C(comp1(c), comp2(c), comp3(c))
color{C,T}(c::TransparentColor{C,T,2}) = C(comp1(c))

# Some of these traits exploit a nice trick: for subtypes, walk up the
# type hierarchy until we get to a stage where we can define the
# function in general

# recurse up the type hierarchy until you get to Colorant{T,N} for
# specific T,N.
to_top{T,N}(::Type{Colorant{T,N}}) = Colorant{T,N}
@pure to_top{C<:Colorant}(::Type{C}) = to_top(supertype(C))

to_top(c::Colorant) = to_top(typeof(c))

# eltype(RGB{Float32}) -> Float32
eltype{T          }(::Type{Colorant{T}})   = T
eltype{T,N        }(::Type{Colorant{T,N}}) = T
@pure eltype{C<:Colorant}(::Type{C}) = eltype(supertype(C))

eltype(c::Colorant) = eltype(typeof(c))

# Return the number of components in the color
# Note this is different from div(sizeof(c), sizeof(eltype(c))) (e.g., RGB1)
length{T,N}(::Type{Colorant{T,N}}) = N
length{N}(::Type{Colorant{TypeVar(:T),N}}) = N   # julia #12596
@pure length{C<:Colorant}(::Type{C}) = length(supertype(C))

length(c::Colorant) = length(typeof(c))

"""
`color_type(c)` or `color_type(C)` (`c` being a color instance and `C`
being the type) returns the type of the Color object (without
alpha channel).  This, and related functions like `base_color_type`,
`base_colorant_type`, and `ccolor` are useful for manipulating types for
writing generic code.

For example,

    color_type(RGB)          == RGB
    color_type(RGB{Float32}) == RGB{Float32}
    color_type(ARGB{U8})     == RGB{U8}
"""
color_type{C<:Color}(::Type{C}) = C
@pure color_type{C<:AlphaColor}(::Type{C}) = color_type(supertype(C))
@pure color_type{C<:ColorAlpha}(::Type{C}) = color_type(supertype(C))
color_type{     }(::Type{TransparentColor})        = Color
color_type{C    }(::Type{TransparentColor{C}})     = C
color_type{C,T  }(::Type{TransparentColor{C,T}})   = C
color_type{C,T,N}(::Type{TransparentColor{C,T,N}}) = C
color_type{C,N  }(::Type{TransparentColor{C,TypeVar(:T),N}}) = C

color_type(c::Colorant) = color_type(typeof(c))

"""
`base_color_type` is similar to `color_type`, except it "strips off" the
element type.  For example,

    color_type(RGB{U8})     == RGB{U8}
    base_color_type(RGB{U8}) == RGB

This can be very handy if you want to switch element types. For example:

    c64 = base_color_type(c){Float64}(color(c))

converts `c` into a `Float64` representation (potentially discarding
any alpha-channel information).
"""
base_color_type{C<:Colorant}(::Type{C}) = base_colorant_type(color_type(C))

base_color_type(c::Colorant) = base_color_type(typeof(c))
base_color_type(x::Number)   = Gray

@generated function base_colorant_type{C<:Colorant}(::Type{C})
    name = C.name.name
    :($name)
end

"""
`base_colorant_type` is similar to `base_color_type`, but it preserves the
"alpha" portion of the type.

For example,

    base_color_type(ARGB{U8})  == RGB
    base_colorant_type(ARGB{U8})  == ARGB

If you just want to switch element types, this is the safest default
and the easiest to use:

    c64 = base_colorant_type(c){Float64}(c)
"""
base_colorant_type(c::Colorant) = base_colorant_type(typeof(c))

colorant_string{C<:Colorant}(::Type{C}) = string(C.name.name)

"""
 `ccolor` ("concrete color") helps write flexible methods. The idea is
that users may write `convert(HSV, c)` or even `convert(Array{HSV},
A)` without specifying the element type explicitly (e.g.,
`convert(HSV{Float32}, c)`). `ccolor` implements the logic "choose the
user's eltype if specified, otherwise retain the eltype of the source
object." However, when the source object has FixedPoint element type,
and the destination only supports AbstractFloat, we choose Float32.

Usage:

    ccolor(desttype, srctype) -> concrete desttype

Example:

    convert{C<:Colorant}(::Type{C}, p::Colorant) = cnvt(ccolor(C,typeof(p)), p)

where `cnvt` is the function that performs explicit conversion.
"""
ccolor{   Csrc<:Colorant}(::Type{Colorant   }, ::Type{Csrc}) = Csrc
ccolor{T, Csrc<:Colorant}(::Type{Colorant{T}}, ::Type{Csrc}) = base_colorant_type(Csrc){T}
ccolor{T, Csrc<:Color3  }(::Type{Colorant{T,3}}, ::Type{Csrc}) = Csrc
ccolor{T, Csrc<:Transparent3}(::Type{Colorant{T,3}}, ::Type{Csrc}) = base_color_type(Csrc)
ccolor{   Csrc<:Colorant}(::Type{Color   }, ::Type{Csrc}) = color_type(Csrc)
ccolor{T, Csrc<:Colorant}(::Type{Color{T}}, ::Type{Csrc}) = base_color_type(Csrc){T}

ccolor{Csrc<:Color}(::Type{TransparentColor}, ::Type{Csrc}) =
          error("Ambiguous storage order, choose AlphaColor or ColorAlpha")
ccolor{C<:Color,    Csrc<:Color}(
       ::Type{TransparentColor{C    }}, ::Type{Csrc}) =
           error("Ambiguous storage order, choose AlphaColor or ColorAlpha")
ccolor{C<:Color,T,  Csrc<:Color}(
       ::Type{TransparentColor{C,T  }}, ::Type{Csrc}) =
           error("Ambiguous storage order, choose AlphaColor or ColorAlpha")
ccolor{C<:Color,T,N,Csrc<:Color}(
       ::Type{TransparentColor{C,T,N}}, ::Type{Csrc}) =
           error("Ambiguous storage order, choose AlphaColor or ColorAlpha")

ccolor{Csrc<:TransparentColor}(::Type{TransparentColor}, ::Type{Csrc}) = Csrc

ccolor{Csrc<:Colorant}(::Type{AlphaColor}, ::Type{Csrc}) = alphacolor(Csrc)
ccolor{C<:Color,    Csrc<:Colorant}(
       ::Type{AlphaColor{C    }}, ::Type{Csrc}) = ccolor(alphacolor(C), Csrc)
ccolor{C<:Color,T,  Csrc<:Colorant}(
       ::Type{AlphaColor{C,T  }}, ::Type{Csrc}) = ccolor(alphacolor(C){T}, Csrc)
ccolor{C<:Color,T,N,Csrc<:Colorant}(
       ::Type{AlphaColor{C,T,N}}, ::Type{Csrc}) = ccolor(alphacolor(C){T}, Csrc)

ccolor{Csrc<:Colorant}(::Type{ColorAlpha}, ::Type{Csrc}) = coloralpha(Csrc)
ccolor{C<:Color,    Csrc<:Colorant}(
       ::Type{ColorAlpha{C    }}, ::Type{Csrc}) = ccolor(coloralpha(C), Csrc)
ccolor{C<:Color,T,  Csrc<:Colorant}(
       ::Type{ColorAlpha{C,T  }}, ::Type{Csrc}) = ccolor(coloralpha(C){T}, Csrc)
ccolor{C<:Color,T,N,Csrc<:Colorant}(
       ::Type{ColorAlpha{C,T,N}}, ::Type{Csrc}) = ccolor(coloralpha(C){T}, Csrc)

ccolor{  Csrc<:AbstractRGB}(::Type{AbstractRGB},    ::Type{Csrc}) = Csrc
ccolor{T,Csrc<:AbstractRGB}(::Type{AbstractRGB{T}}, ::Type{Csrc}) = base_colorant_type(Csrc){T}

# Generic concrete types
ccolor{Cdest<:Colorant,Csrc<:Colorant}(::Type{Cdest}, ::Type{Csrc}) = _ccolor(Cdest, Csrc, pick_eltype(Cdest, eltype(Cdest), eltype(Csrc)))
ccolor{Cdest<:AbstractGray,T<:Union{Bool,Fractional}}(::Type{Cdest}, ::Type{T}) = _ccolor(Cdest, Gray{T}, pick_eltype(Cdest, eltype(Cdest), T))
_ccolor{Cdest,Csrc,T<:Number}(::Type{Cdest}, ::Type{Csrc}, ::Type{T}) = base_colorant_type(Cdest){T}
_ccolor{Cdest,Csrc}(          ::Type{Cdest}, ::Type{Csrc}, ::Any)     = Cdest

# Specific concrete types
ccolor{Csrc<:Colorant}(::Type{RGB24},   ::Type{Csrc}) = RGB24
ccolor{Csrc<:Colorant}(::Type{ARGB32},  ::Type{Csrc}) = ARGB32
ccolor{Csrc<:Colorant}(::Type{Gray24},  ::Type{Csrc}) = Gray24
ccolor{Csrc<:Colorant}(::Type{AGray32}, ::Type{Csrc}) = AGray32

pick_eltype{C,T1<:Number,T2<:Number    }(::Type{C}, ::Type{T1}, ::Type{T2}) = T1
pick_eltype{C,T1<:Number,T2<:FixedPoint}(::Type{C}, ::Type{T1}, ::Type{T2}) = T1
pick_eltype{C,T2<:Number    }(::Type{C}, ::Any, ::Type{T2})     = T2
pick_eltype{C,T2<:FixedPoint}(::Type{C}, ::Any, ::Type{T2})     = pick_eltype_compat(C, eltype_default(C), T2)
pick_eltype{C               }(::Type{C}, ::Any, ::Any)          = eltype(C)
# When T2 <: FixedPoint, choosed based on whether color type supports it
pick_eltype_compat{T1            ,T2}(::Any, ::Type{T1}, ::Type{T2}) = T1
pick_eltype_compat{T1<:FixedPoint,T2}(::Any, ::Type{T1}, ::Type{T2}) = T2

### Equality
==(c1::AbstractRGB, c2::AbstractRGB) = red(c1) == red(c2) && green(c1) == green(c2) && blue(c1) == blue(c2)
==(c1::HSV, c2::HSV) = c1.h == c2.h && c1.s == c2.s && c1.v == c2.v
==(c1::HSI, c2::HSI) = c1.h == c2.h && c1.s == c2.s && c1.i == c2.i
==(c1::HSL, c2::HSL) = c1.h == c2.h && c1.s == c2.s && c1.l == c2.l
==(c1::XYZ, c2::XYZ) = c1.x == c2.x && c1.y == c2.y && c1.z == c2.z
==(c1::xyY, c2::xyY) = c1.x == c2.x && c1.y == c2.y && c1.Y == c2.Y
==(c1::Lab, c2::Lab) = c1.l == c2.l && c1.a == c2.a && c1.b == c2.b
==(c1::Luv, c2::Luv) = c1.l == c2.l && c1.u == c2.u && c1.v == c2.v
==(c1::LCHab, c2::LCHab) = c1.l == c2.l && c1.c == c2.c && c1.h == c2.h
==(c1::LCHuv, c2::LCHuv) = c1.l == c2.l && c1.c == c2.c && c1.h == c2.h
==(c1::DIN99, c2::DIN99) = c1.l == c2.l && c1.a == c2.a && c1.b == c2.b
==(c1::DIN99d, c2::DIN99d) = c1.l == c2.l && c1.a == c2.a && c1.b == c2.b
==(c1::DIN99o, c2::DIN99o) = c1.l == c2.l && c1.a == c2.a && c1.b == c2.b
==(c1::LMS, c2::LMS) = c1.l == c2.l && c1.m == c2.m && c1.s == c2.s
==(c1::YIQ, c2::YIQ) = c1.y == c2.y && c1.i == c2.i && c1.q == c2.q
==(c1::YCbCr, c2::YCbCr) = c1.y == c2.y && c1.cb == c2.cb && c1.cr == c2.cr

for T in (RGB24, ARGB32, Gray24, AGray32)
    @eval begin
        ==(x::UInt32, y::$T) = x == convert(UInt32, y)
        ==(x::$T, y::UInt32) = ==(y, x)
    end
end
==(x::Gray, y::Gray) = x.val == y.val
==(x::Number, y::Gray) = x == y.val
==(x::Gray, y::Number) = ==(y, x)

zero{T}(::Type{Gray{T}}) = Gray{T}(zero(T))
one{T}(::Type{Gray{T}}) = Gray{T}(one(T))


text:
include("../utility.jl")

"""
In this benchmark (b1), we provide a comparison between functions from
Julia, OpenBLAS and MKL that runs on a n-dim vector.
The comparison is also made between Float32 / Float64.
"""
# BENCH PARAMETERS
path = Pkg.dir("MKL") * "/benchmark/b1/"
timing = .1
α = 0.05

# N = [10,20,30,40,50,100,200,300,400,500,1_000,5_000,10_000,25_000,50_000,100_000,250_000,500_000,750_000,1_000_000]
""" attention : ibench valide pour n>1e4 en dessous, utiliser ibench2 """
N = [10_000,]
T = [Float32,Float64]

# GENERATE RAW DATA
function bench_b1()

    df = DataFrame( Generic = ASCIIString[], Implementation = ASCIIString[], Type = ASCIIString[], Method = Any[],
                    N = Int64[],
                    CPU_mean = Float64[], CPU_conf = Float64[],
                    GC_mean = Float64[], GC_conf = Float64[],
                    ALLOC_mean = Float64[], ALLOC_conf = Float64[])

    println("approx total CPU timing = ", 30*timing*length(N)*length(T), "(s)")

    for n in N

        println("#################################################################")
        println("N = $n")
        println("#################################################################")

        for t in T

            λ = convert(t,pi) # keep it to 1.0 otherwise scal is going inf
            a = rand(t,n)
            b = rand(t,n)
            y = zeros(t,n)
            z = zeros(t,n)

        # for (t,λ,a,b,y,z) in ((Float32,λ32,a32,b32,y32,z32),(Float64,λ64,a64,b64,y64,z64))

            tup = (

            ("dot(X.Y)",   "BLAS"  ,    t,  BLAS.dot   ,   (n,a,1,b,1) ),
            ("dot(X,Y)",   "MKL"   ,    t,  mkl_dot    ,   (n,a,1,b,1) ),
            ("dot(X,Y)",   "Julia" ,    t,  vj_dot     ,   (a,b)       ),

            ("aX",      "BLAS"  ,    t,  BLAS.scal! ,   (n,convert(t,0.9999),a,1)   ),
            ("aX",      "MKL"   ,    t,  mkl_scal!  ,   (n,convert(t,0.9999),a,1)   ),
            ("aX",      "Julia" ,    t,  *          ,   (λ,a)       ),

            ("X+Y",     "BLAS"  ,    t,  BLAS.axpy! ,   (1.0,a,b)   ),
            ("X+Y",     "MKL"   ,    t,  mkl_add!   ,   (n,a,b,y)   ),
            ("X+Y",     "Julia" ,    t,  +          ,   (a,b)       ),

            ("X-Y",     "BLAS"  ,    t,  BLAS.axpy! ,   (-1.0,a,b)  ),
            ("X-Y",     "MKL"   ,    t,  mkl_sub!   ,   (n,a,b,y)   ),
            ("X-Y",     "Julia" ,    t,  -          ,   (a,b)       ),
            #
            ("aX+Y",    "BLAS"  ,    t,  BLAS.axpy! ,   (λ,a,b)     ),
            ("aX+Y",    "MKL"   ,    t,  mkl_axpy!  ,   (n,λ,a,1,b,1)),
            ("aX+Y",    "Julia" ,    t,  vj_axpy    ,   (λ,a,b)     ),

            ("X.Y",     "BLAS"  ,    t,  nanf       ,   ()         ),
            ("X.Y",     "MKL"   ,    t,  mkl_mul!   ,   (n,a,b,y)   ),
            ("X.Y",     "Julia" ,    t,  .*         ,   (a,b)       ),

            ("X^2",     "BLAS"  ,    t,  nanf       ,   ()         ),
            ("X^2",     "MKL"   ,    t,  mkl_powx!  ,   (n,a,convert(t,2),y)),
            ("X^2",     "Julia" ,    t,  .^         ,   (a,convert(t,2))    ),
            #
            ("X/Y",     "BLAS"  ,    t,  nanf       ,   ()         ),
            ("X/Y",     "MKL"   ,    t,  mkl_div!   ,   (n,a,b,y)   ),
            ("X/Y",     "Julia" ,    t,  ./         ,   (a,b)       ),

            ("1/X",     "BLAS"  ,    t,  nanf       ,   ()         ),
            ("1/X",     "MKL"   ,    t,  mkl_inv!   ,   (n,a,y)   ),
            ("1/X",     "Julia" ,    t,  ./         ,   (convert(t,1),b)),

            ("|X|",     "BLAS"  ,    t,  nanf       ,   ()         ),
            ("|X|",     "MKL"   ,    t,  mkl_abs!   ,   (n,a,y)     ),
            ("|X|",     "Julia" ,    t,  abs        ,   (a,)        ),

            ("sqrt(X)", "BLAS" ,    t,  nanf        ,   ()         ),
            ("sqrt(X)", "MKL"       ,    t,  mkl_sqrt!   ,   (n,a,y)    ),
            ("sqrt(X)", "Julia"    ,    t,  sqrt        ,   (a,)       ),

            ("1/sqrt(X)", "BLAS"      ,    t,  nanf        ,   ()          ),
            ("1/sqrt(X)", "MKL"       ,    t,  mkl_invsqrt!,   (n,a,y)     ),
            ("1/sqrt(X)"  , "Julia"    ,    t,  vj_invsqrt  ,   (a,)       ),
            )

            for (gm, imp, ty, f, args) in tup
                if length(args) == 0 # void function
                    push!(df, [gm, imp, string(ty), f, n, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0])
                else
                    res_cpu, res_gc, res_alloc = ibench(f, args,timing ; α=α, print_eval=false, print_stats=true)
                    stat_cpu = bstat(res_cpu[2:end].*(1e9/n), α) # in micro second per op * (1e9/n)
                    stat_gc = bstat(res_gc[2:end].*(1e9/n), α)
                    stat_alloc = bstat(res_alloc[2:end], α)
                    push!(df, [gm, imp, string(ty), f, n, stat_cpu[1], stat_cpu[5], stat_gc[1], stat_gc[5], stat_alloc[1], stat_alloc[5]])

                    # res_cpu, res_gc, res_alloc = ibench2(f, args, n)
                    # stat_cpu = res_cpu[2]*(1e9/n)
                    # stat_gc = res_gc[2]*(1e9/n)
                    # stat_alloc = res_alloc[2]
                    # push!(df, [gm, imp, string(ty), f, n, stat_cpu, 0.0, stat_gc, 0, stat_alloc, 0])
                end
            end
        end
    end
    writetable(path * "b1_data.csv", df)
    df
end

df = bench_b1()

# a = [1.0,2.0,3.0]
# f = mkl_scal!
# args = (2,1.9999,a,1)
# ibench(f, args,1 ; print_eval=true, print_stats=true)

ext: jl


text:
julia> [RpcApi.SimpleOrganism(0x000000000006140f,:(function (o::Creature.Organism,)
        function func_252(var_250::Int16=-26108,var_251::ASCIIString="uVpETpQD")
            return var_250
        end
        function func_218(var_217::Bool=true)
            local var_269::Int8 = 55
            Creature.eatLeft(o,Int(var_269))
            for i::Int8 = 1:div(var_269,_LOOP_STEPS_DIVIDER)
            end
            return var_217
        end
        function func_178(var_176::Int8=-98,var_177::Int8=99)
            local var_267::Int8 = 64
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_267))
            return var_176
        end
        local var_172::Int8 = 120
        function func_151(var_149::Int8=-11,var_150::Bool=true)
            local var_270::Bool = false
            return var_149
        end
        function func_143(var_142::Int8=72)
            local var_228::Int64 = -8205116022117027944
            local var_210::Bool = false
            local var_202::Bool = false
            local var_196::Int16 = -19989
            var_196 = if haskey(o.mem,var_196)
                    o.mem[var_196]
                else
                    var_196
                end
            Creature.stepUp(o)
            Creature.stepUp(o)
            o.mem[var_196] = var_196
            Creature.stepUp(o)
            var_196 = if haskey(o.mem,var_196)
                    o.mem[var_196]
                else
                    var_196
                end
            Creature.eatUp(o,Int(var_142))
            var_202 = var_202 * var_210
            Creature.stepLeft(o)
            Creature.eatUp(o,Int(var_142))
            Creature.stepUp(o)
            Creature.eatDown(o,Int(var_142))
            Creature.stepLeft(o)
            Creature.eatUp(o,Int(var_142))
            Creature.stepUp(o)
            Creature.eatRight(o,Int(var_142))
            Creature.eatRight(o,Int(var_142))
            Creature.stepUp(o)
            if var_196 < var_196
                local var_255::ASCIIString = "Y6fAZ5uE"
                local var_249::Int64 = -6396038557622834951
                var_255 = var_255 * var_255
                Creature.stepLeft(o)
            end
            Creature.stepUp(o)
            Creature.eatUp(o,Int(var_142))
            o.mem[var_196] = var_196
            Creature.stepLeft(o)
            var_196 = var_196 / var_196
            var_228 = var_228 * var_228
            var_196 = if haskey(o.mem,var_196)
                    o.mem[var_196]
                else
                    var_196
                end
            Creature.stepUp(o)
            Creature.eatUp(o,Int(var_142))
            Creature.stepUp(o)
            Creature.eatUp(o,Int(var_142))
            var_228 = Int(Creature.getEnergy(o,Int(var_196),Int(var_196)))
            Creature.eatLeft(o,Int(var_142))
            Creature.eatUp(o,Int(var_142))
            var_196 = var_196 / var_196
            Creature.stepLeft(o)
            Creature.eatLeft(o,Int(var_142))
            Creature.stepLeft(o)
            Creature.eatUp(o,Int(var_142))
            Creature.eatRight(o,Int(var_142))
            var_228 = Int(Creature.getEnergy(o,Int(var_196),Int(var_196)))
            Creature.eatRight(o,Int(var_142))
            return var_142
        end
        local var_136::Int16 = -24796
        local var_124::Bool = false
        function func_83(var_81::Bool=true,var_82::Int8=114)
            local var_264::ASCIIString = "IIlqsNk2"
            local var_248::Int16 = 25167
            local var_199::Bool = true
            local var_186::Int8 = 123
            if var_82 <= var_82
                Creature.stepDown(o)
            end
            Creature.eatLeft(o,Int(var_82))
            Creature.eatRight(o,Int(var_186))
            var_248 = var_248 + var_248
            Creature.stepRight(o)
            Creature.eatUp(o,Int(var_82))
            Creature.eatLeft(o,Int(var_82))
            var_81 = var_199 * var_81
            Creature.eatUp(o,Int(var_186))
            Creature.stepRight(o)
            Creature.stepDown(o)
            Creature.stepDown(o)
            Creature.eatDown(o,Int(var_82))
            Creature.stepRight(o)
            Creature.eatDown(o,Int(var_186))
            Creature.eatDown(o,Int(var_82))
            Creature.eatDown(o,Int(var_82))
            var_199 = var_199 & var_81
            Creature.stepRight(o)
            Creature.stepDown(o)
            Creature.eatRight(o,Int(var_82))
            Creature.stepDown(o)
            Creature.eatRight(o,Int(var_82))
            Creature.stepDown(o)
            Creature.eatDown(o,Int(var_186))
            Creature.eatDown(o,Int(var_82))
            Creature.eatDown(o,Int(var_82))
            Creature.eatDown(o,Int(var_186))
            Creature.eatDown(o,Int(var_186))
            Creature.eatRight(o,Int(var_186))
            Creature.stepDown(o)
            Creature.eatRight(o,Int(var_82))
            Creature.stepDown(o)
            if var_82 == var_82
                Creature.stepDown(o)
                Creature.stepDown(o)
                Creature.stepDown(o)
            end
            Creature.eatDown(o,Int(var_82))
            Creature.eatDown(o,Int(var_82))
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_186))
            Creature.eatDown(o,Int(var_82))
            var_199 = var_81 | var_199
            Creature.stepDown(o)
            Creature.stepRight(o)
            return var_81
        end
        local var_74::Int8 = 43
        function func_259(var_257::Int8=73,var_258::Int16=11866)
            o.mem[var_258] = var_258
            Creature.stepRight(o)
            for i::Int8 = 1:div(var_257,_LOOP_STEPS_DIVIDER)
            end
            return var_257
        end
        o.mem[var_136] = var_136
        Creature.stepRight(o)
        Creature.eatUp(o,Int(var_74))
        Creature.stepRight(o)
        var_111 = func_83(var_124)
        Creature.stepDown(o)
        Creature.stepRight(o)
        var_111 = Bool(abs(var_111 - var_124))
        Creature.stepDown(o)
        Creature.eatRight(o,Int(var_172))
        var_136 = if haskey(o.mem,var_136)
                o.mem[var_136]
            else
                var_136
            end
        if var_111 == var_124
            Creature.stepLeft(o)
        end
        var_136 = if haskey(o.mem,var_136)
                o.mem[var_136]
            else
                var_136
            end
        Creature.eatLeft(o,Int(var_74))
        Creature.stepLeft(o)
        Creature.stepLeft(o)
        var_111 = func_83(var_111)
        Creature.stepLeft(o)
        o.mem[var_136] = var_136
        var_136 = var_136 / var_136
        var_111 = func_83(var_111)
        Creature.stepLeft(o)
        Creature.stepUp(o)
        Creature.stepUp(o)
        if var_136 === var_136
            local var_234::Int16 = -18381
            Creature.stepUp(o)
            o.mem[var_234] = var_234
            var_234 = var_234 * var_234
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            o.mem[var_234] = var_234
        end
        Creature.stepUp(o)
        Creature.stepLeft(o)
        Creature.stepUp(o)
        Creature.eatLeft(o,Int(var_74))
        Creature.stepLeft(o)
        var_74 = func_143(var_74)
        var_111 = var_111 * var_124
        Creature.stepLeft(o)
        var_172 = func_143(var_172)
        Creature.stepLeft(o)
        if var_172 < var_172
            Creature.stepUp(o)
            Creature.stepDown(o)
            Creature.stepLeft(o)
            Creature.stepUp(o)
        end
        return true
    end),[110,300,95,0,1,1,1],14,7927,80,285646,0x00000422,Dict(0=>0,-18381=>-18381,25558=>25558,-4363=>-4363,23081=>23081,-24796=>-24796,-19989=>-19989,1=>1),[1,563],171),RpcApi.SimpleOrga
nism(0x0000000000061301,:(function (o::Creature.Organism,)
        function func_218(var_217::Bool=true)
            return var_217
        end
        function func_178(var_176::Int8=-98,var_177::Int8=99)
            Creature.stepUp(o)
            for i::Int8 = 1:div(var_176,_LOOP_STEPS_DIVIDER)
                Creature.stepDown(o)
                Creature.stepUp(o)
            end
            Creature.stepRight(o)
            return var_176
        end
        local var_172::Int8 = 120
        function func_151(var_149::Int8=-11,var_150::Bool=true)
            Creature.stepRight(o)
            Creature.stepUp(o)
            var_150 = var_150 | var_150
            Creature.stepLeft(o)
            Creature.eatLeft(o,Int(var_149))
            return var_149
        end
        function func_143(var_142::Int8=72)
            local var_228::Int64 = -8205116022117027944
            local var_210::Bool = false
            local var_202::Bool = false
            local var_196::Int16 = -19989
            if var_210 > var_202
            end
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.eatRight(o,Int(var_142))
            Creature.stepUp(o)
            if var_210 !== var_202
            end
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.eatUp(o,Int(var_142))
            Creature.stepLeft(o)
            var_196 = var_196 / var_196
            var_202 = var_202 & var_202
            Creature.eatLeft(o,Int(var_142))
            Creature.stepUp(o)
            var_228 = Int(Creature.getEnergy(o,Int(var_196),Int(var_196)))
            Creature.eatRight(o,Int(var_142))
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.eatUp(o,Int(var_142))
            Creature.eatUp(o,Int(var_142))
            Creature.stepLeft(o)
            Creature.eatLeft(o,Int(var_142))
            o.mem[var_196] = var_196
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            Creature.eatLeft(o,Int(var_142))
            return var_142
        end
        local var_136::Int16 = -24796
        local var_124::Bool = false
        function func_83(var_81::Bool=true,var_82::Int8=114)
            local var_246::Int8 = 121
            local var_199::Bool = true
            local var_186::Int8 = 123
            Creature.eatRight(o,Int(var_82))
            if var_82 <= var_82
                Creature.stepRight(o)
            end
            Creature.eatUp(o,Int(var_186))
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_82))
            var_81 = var_199 * var_81
            Creature.eatRight(o,Int(var_246))
            Creature.eatUp(o,Int(var_186))
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_186))
            Creature.stepDown(o)
            Creature.eatDown(o,Int(var_246))
            Creature.eatUp(o,Int(var_82))
            Creature.eatDown(o,Int(var_82))
            Creature.stepRight(o)
            var_199 = var_199 | var_81
            Creature.eatUp(o,Int(var_82))
            Creature.eatRight(o,Int(var_82))
            Creature.eatUp(o,Int(var_82))
            Creature.eatRight(o,Int(var_186))
            Creature.stepRight(o)
            Creature.eatUp(o,Int(var_186))
            Creature.stepDown(o)
            Creature.eatRight(o,Int(var_82))
            Creature.stepDown(o)
            if var_81 >= var_199
                Creature.stepRight(o)
            end
            Creature.stepDown(o)
            Creature.eatDown(o,Int(var_186))
            Creature.eatDown(o,Int(var_82))
            Creature.eatDown(o,Int(var_186))
            Creature.eatDown(o,Int(var_246))
            Creature.eatLeft(o,Int(var_186))
            Creature.stepDown(o)
            Creature.eatDown(o,Int(var_186))
            Creature.eatRight(o,Int(var_82))
            Creature.stepDown(o)
            if var_82 == var_82
                Creature.stepDown(o)
                Creature.stepDown(o)
            end
            Creature.stepDown(o)
            Creature.eatLeft(o,Int(var_186))
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_186))
            Creature.stepRight(o)
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_246))
            Creature.stepRight(o)
            return var_81
        end
        local var_74::Int8 = 43
        var_136 = if haskey(o.mem,var_136)
                o.mem[var_136]
            else
                var_136
            end
        o.mem[var_136] = var_136
        Creature.stepRight(o)
        Creature.eatUp(o,Int(var_172))
        var_111 = func_83(var_124)
        var_136 = var_136 / var_136
        Creature.stepRight(o)
        var_111 = Bool(abs(var_111 - var_124))
        Creature.stepDown(o)
        Creature.eatRight(o,Int(var_172))
        Creature.stepRight(o)
        if var_111 == var_124
            Creature.stepLeft(o)
        end
        if var_172 == var_172
            Creature.stepUp(o)
            Creature.stepDown(o)
        end
        Creature.stepLeft(o)
        Creature.stepUp(o)
        Creature.stepLeft(o)
        var_111 = func_83(var_111)
        if var_136 >= var_136
        end
        var_136 = var_136 / var_136
        var_111 = func_83(var_111)
        Creature.stepLeft(o)
        var_136 = if haskey(o.mem,var_136)
                o.mem[var_136]
            else
                var_136
            end
        Creature.stepUp(o)
        Creature.stepUp(o)
        Creature.stepRight(o)
        if var_136 === var_136
            local var_234::Int16 = -18381
            local var_175::Int64 = 5596248123125959202
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            var_175 = Int(Creature.getEnergy(o,Int(var_234),Int(var_234)))
            Creature.stepLeft(o)
            o.mem[var_234] = var_234
        end
        Creature.stepUp(o)
        Creature.stepLeft(o)
        Creature.stepUp(o)
        Creature.stepLeft(o)
        var_74 = func_143(var_74)
        Creature.stepLeft(o)
        var_172 = func_143(var_172)
        Creature.stepLeft(o)
        Creature.eatUp(o,Int(var_74))
        return true
    end),[110,300,95,0,1,1,1],14,3989,78,237437,0x0000040c,Dict(0=>0,-18381=>-18381,25558=>25558,-4363=>-4363,-24796=>-24796,-19989=>-19989,1=>1),[828,551],157),RpcApi.SimpleOrganism(0x0000
000000061501,:(function (o::Creature.Organism,)
        function func_254(var_253::Int16=1168)
            return var_253
        end
        function func_218(var_217::Bool=true)
            Creature.stepDown(o)
            return var_217
        end
        function func_178(var_176::Int8=-98,var_177::Int8=99)
            local var_255::Int16 = 16468
            return var_176
        end
        local var_172::Int8 = 120
        function func_151(var_149::Int8=-11,var_150::Bool=true)
            local var_250::ASCIIString = "1L3FevPp"
            Creature.stepRight(o)
            Creature.stepRight(o)
            Creature.stepUp(o)
            Creature.stepDown(o)
            Creature.eatLeft(o,Int(var_149))
            return var_149
        end
        function func_143(var_142::Int8=72)
            local var_228::Int64 = -8205116022117027944
            local var_210::Bool = false
            local var_202::Bool = false
            local var_196::Int16 = -19989
            if var_210 > var_202
            end
            o.mem[var_196] = var_196
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.eatUp(o,Int(var_142))
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.eatUp(o,Int(var_142))
            Creature.stepLeft(o)
            var_196 = var_196 / var_196
            var_202 = var_202 & var_202
            Creature.eatLeft(o,Int(var_142))
            Creature.stepUp(o)
            Creature.eatRight(o,Int(var_142))
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.eatUp(o,Int(var_142))
            Creature.stepLeft(o)
            Creature.eatLeft(o,Int(var_142))
            o.mem[var_196] = var_196
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            Creature.eatLeft(o,Int(var_142))
            return var_142
        end
        local var_136::Int16 = -24796
        local var_124::Bool = false
        function func_83(var_81::Bool=true,var_82::Int8=114)
            local var_246::Int8 = 121
            local var_199::Bool = true
            local var_186::Int8 = 123
            Creature.eatRight(o,Int(var_82))
            if var_82 <= var_82
                Creature.stepRight(o)
            end
            Creature.eatUp(o,Int(var_186))
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_82))
            var_81 = var_199 * var_81
            Creature.eatRight(o,Int(var_246))
            Creature.eatUp(o,Int(var_186))
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_186))
            Creature.stepDown(o)
            Creature.eatDown(o,Int(var_246))
            Creature.eatUp(o,Int(var_246))
            Creature.eatUp(o,Int(var_82))
            Creature.eatDown(o,Int(var_82))
            Creature.stepRight(o)
            var_199 = var_199 | var_81
            Creature.eatUp(o,Int(var_82))
            Creature.eatDown(o,Int(var_82))
            Creature.eatDown(o,Int(var_82))
            Creature.eatRight(o,Int(var_186))
            Creature.stepRight(o)
            Creature.eatUp(o,Int(var_186))
            Creature.stepDown(o)
            Creature.eatRight(o,Int(var_82))
            Creature.stepDown(o)
            if var_81 >= var_199
                Creature.stepRight(o)
            end
            Creature.stepDown(o)
            Creature.eatDown(o,Int(var_186))
            Creature.eatLeft(o,Int(var_186))
            Creature.eatDown(o,Int(var_82))
            Creature.eatDown(o,Int(var_186))
            Creature.eatDown(o,Int(var_186))
            Creature.eatLeft(o,Int(var_186))
            Creature.stepDown(o)
            Creature.eatDown(o,Int(var_186))
            Creature.eatRight(o,Int(var_82))
            Creature.stepDown(o)
            if var_82 == var_82
                Creature.stepDown(o)
                Creature.stepDown(o)
            end
            Creature.stepDown(o)
            Creature.eatLeft(o,Int(var_186))
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_186))
            Creature.stepRight(o)
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_246))
            Creature.stepRight(o)
            return var_81
        end
        local var_74::Int8 = 43
        var_136 = if haskey(o.mem,var_136)
                o.mem[var_136]
            else
                var_136
            end
        o.mem[var_136] = var_136
        Creature.stepRight(o)
        Creature.eatUp(o,Int(var_172))
        var_111 = func_83(var_124)
        var_136 = var_136 / var_136
        Creature.stepRight(o)
        var_111 = Bool(abs(var_111 - var_124))
        var_111 = func_83(var_111,var_74)
        Creature.eatRight(o,Int(var_172))
        Creature.stepRight(o)
        if var_111 == var_124
            Creature.stepLeft(o)
        end
        if var_172 == var_172
            local var_224::ASCIIString = "LodVS4RL"
            Creature.stepUp(o)
            Creature.stepDown(o)
        end
        Creature.stepLeft(o)
        Creature.stepUp(o)
        Creature.stepLeft(o)
        var_111 = func_83(var_111)
        if var_136 >= var_136
        end
        var_136 = var_136 / var_136
        var_111 = func_83(var_111)
        Creature.stepLeft(o)
        var_74 = var_74 - var_74
        Creature.stepUp(o)
        Creature.stepUp(o)
        Creature.stepRight(o)
        if var_136 === var_136
            local var_234::Int16 = -18381
            local var_175::Int64 = 5596248123125959202
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            var_234 = if haskey(o.mem,var_234)
                    o.mem[var_234]
                else
                    var_234
                end
            Creature.stepLeft(o)
            o.mem[var_234] = var_234
        end
        Creature.stepUp(o)
        Creature.stepLeft(o)
        Creature.stepUp(o)
        Creature.stepUp(o)
        var_74 = func_143(var_74)
        Creature.stepLeft(o)
        var_172 = func_143(var_172)
        Creature.stepLeft(o)
        Creature.eatUp(o,Int(var_74))
        return true
    end),[110,300,95,0,1,1,1],14,7696,78,234931,0x00000404,Dict(0=>0,-18381=>-18381,25558=>25558,-4363=>-4363,-24796=>-24796,-19989=>-19989,1=>1),[875,576],157),RpcApi.SimpleOrganism(0x0000
000000061274,:(function (o::Creature.Organism,)
        function func_218(var_217::Bool=true)
            local var_253::ASCIIString = "qjAHzKT0"
            return var_217
        end
        function func_178(var_176::Int8=-98,var_177::Int8=99)
            local var_254::ASCIIString = "QXeY5H4W"
            return var_176
        end
        local var_172::Int8 = 120
        function func_151(var_149::Int8=-11,var_150::Bool=true)
            Creature.stepRight(o)
            Creature.stepRight(o)
            Creature.eatDown(o,Int(var_149))
            Creature.stepDown(o)
            return var_149
        end
        function func_143(var_142::Int8=72)
            local var_228::Int64 = -8205116022117027944
            local var_210::Bool = false
            local var_202::Bool = false
            local var_196::Int16 = -19989
            if var_210 > var_202
                Creature.stepUp(o)
            end
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.eatRight(o,Int(var_142))
            Creature.stepUp(o)
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.eatUp(o,Int(var_142))
            Creature.stepLeft(o)
            var_196 = var_196 / var_196
            var_202 = var_202 & var_202
            Creature.eatLeft(o,Int(var_142))
            Creature.stepUp(o)
            var_228 = Int(Creature.getEnergy(o,Int(var_196),Int(var_196)))
            Creature.eatRight(o,Int(var_142))
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.eatUp(o,Int(var_142))
            Creature.stepLeft(o)
            Creature.eatLeft(o,Int(var_142))
            o.mem[var_196] = var_196
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            Creature.eatLeft(o,Int(var_142))
            return var_142
        end
        local var_136::Int16 = -24796
        local var_124::Bool = false
        function func_83(var_81::Bool=true,var_82::Int8=114)
            local var_246::Int8 = 121
            local var_199::Bool = true
            local var_186::Int8 = 123
            Creature.eatRight(o,Int(var_82))
            if var_82 <= var_82
                Creature.stepRight(o)
            end
            Creature.eatUp(o,Int(var_186))
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_82))
            var_81 = var_199 * var_81
            Creature.eatRight(o,Int(var_246))
            Creature.eatUp(o,Int(var_186))
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_186))
            Creature.stepDown(o)
            Creature.eatDown(o,Int(var_246))
            Creature.eatUp(o,Int(var_82))
            Creature.eatDown(o,Int(var_82))
            Creature.eatDown(o,Int(var_186))
            Creature.stepRight(o)
            var_199 = var_199 | var_81
            Creature.eatUp(o,Int(var_82))
            Creature.eatDown(o,Int(var_82))
            Creature.eatDown(o,Int(var_82))
            Creature.eatRight(o,Int(var_186))
            Creature.stepRight(o)
            Creature.eatUp(o,Int(var_186))
            Creature.stepDown(o)
            Creature.eatRight(o,Int(var_82))
            Creature.stepDown(o)
            if var_81 >= var_199
                Creature.stepRight(o)
            end
            Creature.stepDown(o)
            Creature.eatDown(o,Int(var_186))
            Creature.eatLeft(o,Int(var_186))
            Creature.eatDown(o,Int(var_82))
            Creature.eatDown(o,Int(var_186))
            Creature.eatDown(o,Int(var_186))
            Creature.eatLeft(o,Int(var_186))
            Creature.stepDown(o)
            Creature.eatDown(o,Int(var_186))
            Creature.eatRight(o,Int(var_82))
            Creature.stepDown(o)
            if var_82 == var_82
                Creature.stepDown(o)
                Creature.stepDown(o)
            end
            Creature.stepDown(o)
            Creature.eatLeft(o,Int(var_186))
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_186))
            Creature.stepRight(o)
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_246))
            Creature.stepRight(o)
            return var_81
        end
        local var_74::Int8 = 43
        var_136 = if haskey(o.mem,var_136)
                o.mem[var_136]
            else
                var_136
            end
        o.mem[var_136] = var_136
        Creature.stepRight(o)
        Creature.eatUp(o,Int(var_172))
        var_111 = func_83(var_124)
        var_136 = var_136 / var_136
        Creature.stepRight(o)
        var_111 = Bool(abs(var_111 - var_124))
        Creature.stepDown(o)
        Creature.eatRight(o,Int(var_172))
        Creature.stepRight(o)
        if var_111 == var_124
            Creature.stepLeft(o)
        end
        if var_172 == var_172
            Creature.stepUp(o)
            Creature.stepDown(o)
        end
        Creature.stepLeft(o)
        Creature.stepUp(o)
        Creature.stepLeft(o)
        var_111 = func_83(var_111)
        if var_136 >= var_136
        end
        var_136 = var_136 / var_136
        var_111 = func_83(var_111)
        Creature.stepLeft(o)
        Creature.eatUp(o,Int(var_172))
        Creature.stepUp(o)
        Creature.stepUp(o)
        Creature.stepRight(o)
        if var_136 === var_136
            local var_234::Int16 = -18381
            local var_175::Int64 = 5596248123125959202
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            var_234 = if haskey(o.mem,var_234)
                    o.mem[var_234]
                else
                    var_234
                end
            Creature.stepLeft(o)
            o.mem[var_234] = var_234
        end
        Creature.stepUp(o)
        Creature.stepLeft(o)
        Creature.stepUp(o)
        Creature.stepLeft(o)
        var_74 = func_143(var_74)
        Creature.stepLeft(o)
        var_172 = func_143(var_172)
        Creature.stepLeft(o)
        Creature.eatUp(o,Int(var_74))
        return true
    end),[110,300,95,0,1,1,1],11,7696,78,233782,0x0000040b,Dict(0=>0,-18381=>-18381,25558=>25558,-4363=>-4363,-24796=>-24796,-19989=>-19989,1=>1),[815,542],154),RpcApi.SimpleOrganism(0x0000
00000006152a,:(function (o::Creature.Organism,)
        function func_273(var_272::ASCIIString="M0sIg1Tu")
            Creature.stepDown(o)
            return var_272
        end
        function func_252(var_250::Int16=-26108,var_251::ASCIIString="uVpETpQD")
            var_251 = var_251[1:if length(var_251) > length(var_251)
                            0
                        else
                            length(var_251) - length(var_251)
                        end]
            return var_250
        end
        function func_218(var_217::Bool=true)
            return var_217
        end
        function func_178(var_176::Int8=-98,var_177::Int8=99)
            local var_267::Int8 = 64
            local var_274::Int64 = 7555246081134316456
            Creature.eatLeft(o,Int(var_177))
            return var_176
        end
        local var_172::Int8 = 120
        function func_151(var_149::Int8=-11,var_150::Bool=true)
            local var_270::Int64 = 2423730536341254631
            return var_149
        end
        function func_143(var_142::Int8=72)
            local var_228::Int64 = -8205116022117027944
            local var_210::Bool = false
            local var_202::Bool = false
            local var_196::Int16 = -19989
            var_196 = if haskey(o.mem,var_196)
                    o.mem[var_196]
                else
                    var_196
                end
            Creature.stepUp(o)
            Creature.stepUp(o)
            o.mem[var_196] = var_196
            Creature.stepUp(o)
            var_196 = if haskey(o.mem,var_196)
                    o.mem[var_196]
                else
                    var_196
                end
            var_228 = Int(Creature.getEnergy(o,Int(var_196),Int(var_196)))
            Creature.stepLeft(o)
            Creature.eatUp(o,Int(var_142))
            Creature.stepUp(o)
            Creature.eatDown(o,Int(var_142))
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.eatRight(o,Int(var_142))
            Creature.eatRight(o,Int(var_142))
            Creature.stepUp(o)
            if var_196 < var_196
                local var_255::ASCIIString = "Y6fAZ5uE"
                local var_249::Int64 = -6396038557622834951
                Creature.stepLeft(o)
            end
            Creature.stepUp(o)
            Creature.eatUp(o,Int(var_142))
            o.mem[var_196] = var_196
            Creature.stepLeft(o)
            Creature.eatUp(o,Int(var_142))
            var_228 = var_228 * var_228
            var_196 = if haskey(o.mem,var_196)
                    o.mem[var_196]
                else
                    var_196
                end
            Creature.stepUp(o)
            Creature.eatUp(o,Int(var_142))
            Creature.stepUp(o)
            Creature.eatUp(o,Int(var_142))
            var_228 = Int(Creature.getEnergy(o,Int(var_196),Int(var_196)))
            Creature.eatLeft(o,Int(var_142))
            Creature.eatUp(o,Int(var_142))
            var_196 = var_196 / var_196
            Creature.stepLeft(o)
            Creature.eatLeft(o,Int(var_142))
            Creature.stepLeft(o)
            Creature.eatUp(o,Int(var_142))
            Creature.eatRight(o,Int(var_142))
            var_228 = Int(Creature.getEnergy(o,Int(var_196),Int(var_196)))
            return var_142
        end
        local var_136::Int16 = -24796
        local var_124::Bool = false
        function func_83(var_81::Bool=true,var_82::Int8=114)
            local var_264::ASCIIString = "IIlqsNk2"
            local var_248::Int16 = 25167
            local var_199::Bool = true
            local var_186::Int8 = 123
            if var_82 <= var_82
                Creature.stepDown(o)
            end
            Creature.eatLeft(o,Int(var_82))
            Creature.eatUp(o,Int(var_186))
            Creature.eatRight(o,Int(var_186))
            var_248 = var_248 + var_248
            Creature.stepRight(o)
            Creature.eatUp(o,Int(var_82))
            Creature.eatLeft(o,Int(var_82))
            var_81 = var_199 * var_81
            Creature.eatUp(o,Int(var_186))
            Creature.stepRight(o)
            Creature.stepDown(o)
            Creature.stepDown(o)
            Creature.eatDown(o,Int(var_82))
            Creature.stepRight(o)
            Creature.eatDown(o,Int(var_186))
            Creature.eatDown(o,Int(var_82))
            Creature.eatDown(o,Int(var_82))
            var_199 = var_199 & var_81
            Creature.stepRight(o)
            Creature.eatDown(o,Int(var_82))
            Creature.eatRight(o,Int(var_82))
            Creature.stepDown(o)
            Creature.eatRight(o,Int(var_82))
            Creature.stepDown(o)
            Creature.eatDown(o,Int(var_186))
            Creature.eatDown(o,Int(var_82))
            Creature.eatDown(o,Int(var_82))
            Creature.eatDown(o,Int(var_186))
            Creature.eatDown(o,Int(var_186))
            Creature.eatRight(o,Int(var_186))
            Creature.stepDown(o)
            Creature.eatRight(o,Int(var_82))
            Creature.stepDown(o)
            if var_82 == var_82
                Creature.stepDown(o)
                Creature.stepDown(o)
                Creature.stepDown(o)
            end
            Creature.eatDown(o,Int(var_82))
            Creature.eatDown(o,Int(var_82))
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_186))
            Creature.eatDown(o,Int(var_82))
            var_199 = var_81 | var_199
            Creature.stepDown(o)
            Creature.stepRight(o)
            return var_81
        end
        local var_74::Int8 = 43
        function func_259(var_257::Int8=73,var_258::Int16=11866)
            local var_271::Bool = false
            return var_257
        end
        o.mem[var_136] = var_136
        Creature.stepRight(o)
        Creature.eatUp(o,Int(var_74))
        Creature.stepRight(o)
        var_111 = func_83(var_124)
        Creature.stepDown(o)
        Creature.stepRight(o)
        var_111 = Bool(abs(var_111 - var_124))
        Creature.stepDown(o)
        Creature.eatRight(o,Int(var_172))
        var_136 = if haskey(o.mem,var_136)
                o.mem[var_136]
            else
                var_136
            end
        if var_111 == var_124
            Creature.stepDown(o)
            Creature.stepLeft(o)
        end
        var_136 = if haskey(o.mem,var_136)
                o.mem[var_136]
            else
                var_136
            end
        Creature.eatLeft(o,Int(var_74))
        Creature.stepLeft(o)
        Creature.stepLeft(o)
        var_111 = func_83(var_111)
        Creature.stepLeft(o)
        var_136 = var_136 / var_136
        var_111 = func_83(var_111)
        Creature.stepLeft(o)
        Creature.stepUp(o)
        Creature.stepUp(o)
        if var_136 === var_136
            local var_234::Int16 = -18381
            Creature.stepUp(o)
            var_234 = var_234 * var_234
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            o.mem[var_234] = var_234
        end
        Creature.stepUp(o)
        Creature.stepLeft(o)
        Creature.stepUp(o)
        Creature.eatLeft(o,Int(var_74))
        Creature.stepLeft(o)
        var_74 = func_143(var_74)
        var_111 = var_111 * var_124
        Creature.stepLeft(o)
        var_172 = func_143(var_172)
        Creature.stepLeft(o)
        if var_172 < var_172
            local var_263::Bool = false
            Creature.stepUp(o)
            Creature.stepDown(o)
            Creature.stepLeft(o)
            Creature.stepUp(o)
        end
        return true
    end),[110,300,95,0,1,1,1],14,7927,80,215988,0x00000431,Dict(0=>0,-18381=>-18381,25558=>25558,-4363=>-4363,23081=>23081,-24796=>-24796,-19989=>-19989,1=>1),[1,575],166),RpcApi.SimpleOrga
nism(0x0000000000061468,:(function (o::Creature.Organism,)
        local var_255::Bool = true
        function func_254(var_253::Int16=1168)
            return var_253
        end
        function func_218(var_217::Bool=true)
            return var_217
        end
        function func_178(var_176::Int8=-98,var_177::Int8=99)
            var_177 = var_176 - var_177
            return var_176
        end
        local var_172::Int8 = 120
        function func_151(var_149::Int8=-11,var_150::Bool=true)
            local var_250::ASCIIString = "1L3FevPp"
            Creature.stepRight(o)
            Creature.stepRight(o)
            var_250 = var_250 * var_250
            Creature.stepUp(o)
            Creature.eatDown(o,Int(var_149))
            Creature.eatRight(o,Int(var_149))
            Creature.eatLeft(o,Int(var_149))
            return var_149
        end
        function func_143(var_142::Int8=72)
            local var_228::Int64 = -8205116022117027944
            local var_210::Bool = false
            local var_202::Bool = false
            local var_196::Int16 = -19989
            if var_210 > var_202
            end
            o.mem[var_196] = var_196
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.eatUp(o,Int(var_142))
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.eatUp(o,Int(var_142))
            Creature.stepLeft(o)
            var_196 = var_196 / var_196
            var_202 = var_202 & var_202
            Creature.eatLeft(o,Int(var_142))
            Creature.stepUp(o)
            Creature.eatRight(o,Int(var_142))
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.eatUp(o,Int(var_142))
            Creature.stepLeft(o)
            Creature.eatLeft(o,Int(var_142))
            o.mem[var_196] = var_196
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            Creature.eatLeft(o,Int(var_142))
            return var_142
        end
        local var_136::Int16 = -24796
        local var_124::Bool = false
        function func_83(var_81::Bool=true,var_82::Int8=114)
            local var_246::Int8 = 121
            local var_199::Bool = true
            local var_186::Int8 = 123
            Creature.eatRight(o,Int(var_82))
            if var_82 <= var_82
                Creature.stepRight(o)
            end
            Creature.eatUp(o,Int(var_186))
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_82))
            var_81 = var_199 * var_81
            Creature.eatRight(o,Int(var_246))
            Creature.eatUp(o,Int(var_186))
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_186))
            Creature.stepDown(o)
            Creature.eatDown(o,Int(var_246))
            Creature.eatUp(o,Int(var_246))
            Creature.eatUp(o,Int(var_82))
            Creature.eatDown(o,Int(var_82))
            Creature.stepRight(o)
            var_199 = var_199 | var_81
            Creature.eatUp(o,Int(var_82))
            Creature.eatDown(o,Int(var_82))
            Creature.eatDown(o,Int(var_82))
            Creature.eatRight(o,Int(var_186))
            Creature.stepRight(o)
            Creature.eatUp(o,Int(var_186))
            Creature.stepDown(o)
            Creature.eatRight(o,Int(var_82))
            Creature.stepDown(o)
            if var_81 >= var_199
                Creature.stepRight(o)
            end
            Creature.stepDown(o)
            Creature.eatDown(o,Int(var_186))
            Creature.eatLeft(o,Int(var_186))
            Creature.eatDown(o,Int(var_82))
            Creature.eatDown(o,Int(var_186))
            Creature.eatDown(o,Int(var_186))
            Creature.eatLeft(o,Int(var_186))
            Creature.stepDown(o)
            Creature.eatDown(o,Int(var_186))
            Creature.eatRight(o,Int(var_82))
            Creature.stepDown(o)
            if var_82 == var_82
                Creature.stepDown(o)
                Creature.stepDown(o)
            end
            Creature.stepDown(o)
            Creature.eatLeft(o,Int(var_186))
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_186))
            Creature.stepRight(o)
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_246))
            Creature.stepRight(o)
            return var_81
        end
        local var_74::Int8 = 43
        var_136 = if haskey(o.mem,var_136)
                o.mem[var_136]
            else
                var_136
            end
        o.mem[var_136] = var_136
        Creature.stepRight(o)
        Creature.eatUp(o,Int(var_172))
        var_111 = func_83(var_124)
        var_136 = var_136 / var_136
        Creature.stepRight(o)
        var_111 = Bool(abs(var_111 - var_124))
        var_111 = func_83(var_111,var_74)
        Creature.eatRight(o,Int(var_172))
        Creature.stepRight(o)
        if var_111 == var_124
            Creature.stepLeft(o)
        end
        if var_172 == var_172
            local var_224::ASCIIString = "LodVS4RL"
            Creature.stepUp(o)
            Creature.stepDown(o)
        end
        Creature.stepLeft(o)
        Creature.stepUp(o)
        Creature.stepLeft(o)
        var_111 = func_83(var_111)
        if var_136 >= var_136
        end
        var_136 = var_136 / var_136
        var_111 = func_83(var_111)
        Creature.stepLeft(o)
        var_74 = var_74 - var_74
        Creature.stepUp(o)
        Creature.stepUp(o)
        Creature.stepRight(o)
        if var_136 === var_136
            local var_234::Int16 = -18381
            local var_175::Int64 = 5596248123125959202
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            var_234 = if haskey(o.mem,var_234)
                    o.mem[var_234]
                else
                    var_234
                end
            Creature.stepLeft(o)
            o.mem[var_234] = var_234
        end
        Creature.stepUp(o)
        Creature.stepLeft(o)
        Creature.stepUp(o)
        Creature.stepUp(o)
        var_74 = func_143(var_74)
        Creature.stepLeft(o)
        var_172 = func_143(var_172)
        Creature.stepLeft(o)
        Creature.eatUp(o,Int(var_74))
        return true
    end),[110,300,95,0,1,1,1],14,7696,78,203902,0x00000404,Dict(0=>0,-18381=>-18381,25558=>25558,-4363=>-4363,-24796=>-24796,-19989=>-19989,1=>1),[850,548],159),RpcApi.SimpleOrganism(0x0000
0000000614be,:(function (o::Creature.Organism,)
        function func_218(var_217::Bool=true)
            return var_217
        end
        function func_178(var_176::Int8=-98,var_177::Int8=99)
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            Creature.stepRight(o)
            return var_176
        end
        local var_172::Int8 = 120
        function func_151(var_149::Int8=-11,var_150::Bool=true)
            Creature.stepRight(o)
            Creature.stepUp(o)
            Creature.stepLeft(o)
            Creature.eatLeft(o,Int(var_149))
            return var_149
        end
        function func_143(var_142::Int8=72)
            local var_228::Int64 = -8205116022117027944
            local var_210::Bool = false
            local var_202::Bool = false
            local var_196::Int16 = -19989
            if var_210 > var_202
            end
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.eatRight(o,Int(var_142))
            Creature.stepUp(o)
            if var_210 !== var_202
            end
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.eatUp(o,Int(var_142))
            Creature.stepLeft(o)
            var_196 = var_196 / var_196
            var_202 = var_202 & var_202
            Creature.eatLeft(o,Int(var_142))
            Creature.stepUp(o)
            var_228 = Int(Creature.getEnergy(o,Int(var_196),Int(var_196)))
            Creature.eatRight(o,Int(var_142))
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.eatUp(o,Int(var_142))
            Creature.eatUp(o,Int(var_142))
            Creature.stepLeft(o)
            Creature.eatLeft(o,Int(var_142))
            o.mem[var_196] = var_196
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            Creature.eatLeft(o,Int(var_142))
            return var_142
        end
        local var_136::Int16 = -24796
        local var_124::Bool = false
        function func_83(var_81::Bool=true,var_82::Int8=114)
            local var_246::Int8 = 121
            local var_199::Bool = true
            local var_186::Int8 = 123
            Creature.eatRight(o,Int(var_82))
            if var_82 <= var_82
                Creature.stepRight(o)
            end
            Creature.eatUp(o,Int(var_186))
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_82))
            var_81 = var_199 * var_81
            Creature.eatRight(o,Int(var_246))
            Creature.eatUp(o,Int(var_186))
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_186))
            Creature.stepDown(o)
            Creature.eatDown(o,Int(var_246))
            Creature.eatUp(o,Int(var_82))
            Creature.eatDown(o,Int(var_82))
            Creature.stepRight(o)
            var_199 = var_199 | var_81
            Creature.eatUp(o,Int(var_82))
            Creature.eatRight(o,Int(var_82))
            Creature.eatUp(o,Int(var_82))
            Creature.eatRight(o,Int(var_186))
            Creature.stepRight(o)
            Creature.eatUp(o,Int(var_186))
            Creature.stepDown(o)
            Creature.eatRight(o,Int(var_82))
            Creature.stepDown(o)
            if var_81 >= var_199
                Creature.stepRight(o)
            end
            Creature.stepDown(o)
            Creature.eatDown(o,Int(var_186))
            Creature.eatLeft(o,Int(var_186))
            Creature.eatDown(o,Int(var_82))
            Creature.eatDown(o,Int(var_186))
            Creature.eatDown(o,Int(var_246))
            Creature.eatLeft(o,Int(var_186))
            Creature.stepDown(o)
            Creature.eatDown(o,Int(var_186))
            Creature.eatRight(o,Int(var_82))
            Creature.stepDown(o)
            if var_82 == var_82
                Creature.stepDown(o)
                Creature.stepDown(o)
            end
            Creature.stepDown(o)
            Creature.eatLeft(o,Int(var_186))
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_186))
            Creature.stepRight(o)
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_246))
            Creature.stepRight(o)
            return var_81
        end
        local var_74::Int8 = 43
        var_136 = if haskey(o.mem,var_136)
                o.mem[var_136]
            else
                var_136
            end
        o.mem[var_136] = var_136
        Creature.stepRight(o)
        Creature.eatUp(o,Int(var_172))
        var_111 = func_83(var_124)
        var_136 = var_136 / var_136
        Creature.stepRight(o)
        var_111 = Bool(abs(var_111 - var_124))
        Creature.stepDown(o)
        Creature.eatRight(o,Int(var_172))
        Creature.stepRight(o)
        if var_111 == var_124
            Creature.stepLeft(o)
        end
        if var_172 == var_172
            Creature.stepUp(o)
            Creature.stepDown(o)
        end
        Creature.stepLeft(o)
        Creature.stepUp(o)
        Creature.stepLeft(o)
        var_111 = func_83(var_111)
        if var_136 >= var_136
        end
        var_136 = var_136 / var_136
        var_111 = func_83(var_111)
        Creature.stepLeft(o)
        var_136 = if haskey(o.mem,var_136)
                o.mem[var_136]
            else
                var_136
            end
        Creature.stepUp(o)
        Creature.stepUp(o)
        Creature.stepRight(o)
        if var_136 === var_136
            local var_234::Int16 = -18381
            local var_175::Int64 = 5596248123125959202
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            var_175 = Int(Creature.getEnergy(o,Int(var_234),Int(var_234)))
            Creature.stepLeft(o)
            o.mem[var_234] = var_234
        end
        Creature.stepUp(o)
        Creature.stepLeft(o)
        Creature.stepUp(o)
        Creature.stepLeft(o)
        var_74 = func_143(var_74)
        Creature.stepLeft(o)
        var_172 = func_143(var_172)
        Creature.stepLeft(o)
        Creature.eatUp(o,Int(var_74))
        return true
    end),[110,300,95,0,1,1,1],14,3989,78,200870,0x00000408,Dict(0=>0,-18381=>-18381,25558=>25558,-4363=>-4363,-24796=>-24796,-19989=>-19989,1=>1),[821,574],155),RpcApi.SimpleOrganism(0x0000
000000060fa5,:(function (o::Creature.Organism,)
        function func_218(var_217::Bool=true)
            return var_217
        end
        function func_178(var_176::Int8=-98,var_177::Int8=99)
            Creature.stepLeft(o)
            for i::Int8 = 1:div(var_176,_LOOP_STEPS_DIVIDER)
                Creature.stepDown(o)
                Creature.stepUp(o)
            end
            Creature.stepRight(o)
            return var_176
        end
        local var_172::Int8 = 120
        function func_151(var_149::Int8=-11,var_150::Bool=true)
            Creature.stepRight(o)
            Creature.stepUp(o)
            Creature.stepLeft(o)
            Creature.eatLeft(o,Int(var_149))
            return var_149
        end
        function func_143(var_142::Int8=72)
            local var_228::Int64 = -8205116022117027944
            local var_210::Bool = false
            local var_202::Bool = false
            local var_196::Int16 = -19989
            if var_210 > var_202
            end
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.eatRight(o,Int(var_142))
            Creature.stepUp(o)
            if var_210 !== var_202
            end
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.eatUp(o,Int(var_142))
            Creature.stepLeft(o)
            var_196 = var_196 / var_196
            var_202 = var_202 & var_202
            Creature.eatLeft(o,Int(var_142))
            Creature.stepUp(o)
            var_228 = Int(Creature.getEnergy(o,Int(var_196),Int(var_196)))
            Creature.eatRight(o,Int(var_142))
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.eatUp(o,Int(var_142))
            Creature.eatUp(o,Int(var_142))
            Creature.stepLeft(o)
            Creature.eatLeft(o,Int(var_142))
            o.mem[var_196] = var_196
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            Creature.eatLeft(o,Int(var_142))
            return var_142
        end
        local var_136::Int16 = -24796
        local var_124::Bool = false
        function func_83(var_81::Bool=true,var_82::Int8=114)
            local var_246::Int8 = 121
            local var_199::Bool = true
            local var_186::Int8 = 123
            Creature.eatRight(o,Int(var_82))
            if var_82 <= var_82
                Creature.stepRight(o)
            end
            Creature.eatUp(o,Int(var_186))
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_82))
            var_81 = var_199 * var_81
            Creature.eatRight(o,Int(var_246))
            Creature.eatUp(o,Int(var_186))
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_186))
            Creature.stepDown(o)
            Creature.eatDown(o,Int(var_246))
            Creature.eatUp(o,Int(var_82))
            Creature.eatDown(o,Int(var_82))
            Creature.stepRight(o)
            var_199 = var_199 | var_81
            Creature.eatUp(o,Int(var_82))
            Creature.eatRight(o,Int(var_82))
            Creature.eatUp(o,Int(var_82))
            Creature.eatRight(o,Int(var_186))
            Creature.stepRight(o)
            Creature.eatUp(o,Int(var_186))
            Creature.stepDown(o)
            Creature.eatRight(o,Int(var_82))
            Creature.stepDown(o)
            if var_81 >= var_199
                Creature.stepRight(o)
            end
            Creature.stepDown(o)
            Creature.eatDown(o,Int(var_186))
            Creature.eatLeft(o,Int(var_186))
            Creature.eatDown(o,Int(var_82))
            Creature.eatDown(o,Int(var_186))
            Creature.eatDown(o,Int(var_246))
            Creature.eatLeft(o,Int(var_186))
            Creature.stepDown(o)
            Creature.eatDown(o,Int(var_186))
            Creature.eatRight(o,Int(var_82))
            Creature.stepDown(o)
            if var_82 == var_82
                Creature.stepDown(o)
                Creature.stepDown(o)
            end
            Creature.stepDown(o)
            Creature.eatLeft(o,Int(var_186))
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_186))
            Creature.stepRight(o)
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_246))
            Creature.stepRight(o)
            return var_81
        end
        local var_74::Int8 = 43
        var_136 = if haskey(o.mem,var_136)
                o.mem[var_136]
            else
                var_136
            end
        o.mem[var_136] = var_136
        Creature.stepRight(o)
        Creature.eatUp(o,Int(var_172))
        var_111 = func_83(var_124)
        var_136 = var_136 / var_136
        Creature.stepRight(o)
        var_111 = Bool(abs(var_111 - var_124))
        Creature.stepDown(o)
        Creature.eatRight(o,Int(var_172))
        Creature.stepRight(o)
        if var_111 == var_124
            Creature.stepLeft(o)
        end
        if var_172 == var_172
            Creature.stepUp(o)
            Creature.stepDown(o)
        end
        Creature.stepLeft(o)
        Creature.stepUp(o)
        Creature.stepLeft(o)
        var_111 = func_83(var_111)
        if var_136 >= var_136
        end
        var_136 = var_136 / var_136
        var_111 = func_83(var_111)
        Creature.stepLeft(o)
        var_136 = if haskey(o.mem,var_136)
                o.mem[var_136]
            else
                var_136
            end
        Creature.stepUp(o)
        Creature.stepUp(o)
        Creature.stepRight(o)
        if var_136 === var_136
            local var_234::Int16 = -18381
            local var_175::Int64 = 5596248123125959202
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            var_175 = Int(Creature.getEnergy(o,Int(var_234),Int(var_234)))
            Creature.stepLeft(o)
            o.mem[var_234] = var_234
        end
        Creature.stepUp(o)
        Creature.stepLeft(o)
        Creature.stepUp(o)
        Creature.stepLeft(o)
        var_74 = func_143(var_74)
        Creature.stepLeft(o)
        var_172 = func_143(var_172)
        Creature.stepLeft(o)
        Creature.eatUp(o,Int(var_74))
        return true
    end),[110,300,95,0,1,1,1],14,3989,78,190747,0x00000407,Dict(0=>0,-18381=>-18381,25558=>25558,-4363=>-4363,-24796=>-24796,-19989=>-19989,1=>1),[819,512],157),RpcApi.SimpleOrganism(0x0000
000000061419,:(function (o::Creature.Organism,)
        function func_218(var_217::Bool=true)
            return var_217
        end
        function func_178(var_176::Int8=-98,var_177::Int8=99)
            if var_176 !== var_177
            end
            Creature.eatUp(o,Int(var_177))
            return var_176
        end
        local var_172::Int8 = 120
        function func_151(var_149::Int8=-11,var_150::Bool=true)
            local var_250::ASCIIString = "1L3FevPp"
            Creature.eatRight(o,Int(var_149))
            Creature.stepRight(o)
            Creature.stepUp(o)
            for i::Int8 = 1:div(var_149,_LOOP_STEPS_DIVIDER)
            end
            return var_149
        end
        function func_143(var_142::Int8=72)
            local var_228::Int64 = -8205116022117027944
            local var_210::Bool = false
            local var_202::Bool = false
            local var_196::Int16 = -19989
            if var_210 > var_202
                Creature.stepLeft(o)
            end
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.eatRight(o,Int(var_142))
            Creature.stepUp(o)
            Creature.eatRight(o,Int(var_142))
            Creature.stepUp(o)
            Creature.eatUp(o,Int(var_142))
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.eatUp(o,Int(var_142))
            Creature.stepLeft(o)
            var_196 = var_196 / var_196
            var_202 = var_202 & var_202
            Creature.eatLeft(o,Int(var_142))
            Creature.stepUp(o)
            var_196 = var_196 * var_196
            Creature.eatRight(o,Int(var_142))
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepLeft(o)
            Creature.eatLeft(o,Int(var_142))
            o.mem[var_196] = var_196
            var_228 = Int(Creature.getEnergy(o,Int(var_196),Int(var_196)))
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            Creature.eatLeft(o,Int(var_142))
            return var_142
        end
        local var_136::Int16 = -24796
        local var_124::Bool = false
        function func_83(var_81::Bool=true,var_82::Int8=114)
            local var_246::Int8 = 121
            local var_199::Bool = true
            local var_186::Int8 = 123
            if var_82 <= var_82
                Creature.stepRight(o)
            end
            Creature.eatUp(o,Int(var_186))
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_82))
            Creature.eatRight(o,Int(var_246))
            Creature.eatUp(o,Int(var_186))
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_186))
            Creature.stepDown(o)
            Creature.eatDown(o,Int(var_246))
            Creature.eatUp(o,Int(var_82))
            Creature.eatDown(o,Int(var_82))
            Creature.stepRight(o)
            var_199 = var_199 | var_81
            Creature.eatLeft(o,Int(var_82))
            Creature.eatDown(o,Int(var_82))
            Creature.eatDown(o,Int(var_82))
            Creature.eatRight(o,Int(var_186))
            Creature.stepRight(o)
            Creature.eatUp(o,Int(var_186))
            Creature.stepDown(o)
            Creature.eatRight(o,Int(var_82))
            Creature.stepDown(o)
            if var_81 >= var_199
                Creature.stepRight(o)
            end
            Creature.stepDown(o)
            Creature.eatDown(o,Int(var_186))
            Creature.eatLeft(o,Int(var_186))
            Creature.eatDown(o,Int(var_82))
            Creature.eatDown(o,Int(var_186))
            Creature.eatDown(o,Int(var_186))
            Creature.eatLeft(o,Int(var_186))
            Creature.stepDown(o)
            Creature.eatDown(o,Int(var_186))
            Creature.eatRight(o,Int(var_82))
            Creature.stepDown(o)
            if var_82 == var_82
                Creature.stepLeft(o)
                Creature.stepDown(o)
            end
            Creature.stepDown(o)
            Creature.eatLeft(o,Int(var_186))
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_186))
            Creature.stepRight(o)
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_246))
            Creature.stepRight(o)
            return var_81
        end
        local var_74::Int8 = 43
        var_136 = if haskey(o.mem,var_136)
                o.mem[var_136]
            else
                var_136
            end
        o.mem[var_136] = var_136
        Creature.stepRight(o)
        Creature.eatUp(o,Int(var_172))
        var_111 = func_83(var_124)
        var_136 = var_136 / var_136
        Creature.stepRight(o)
        var_111 = Bool(abs(var_111 - var_124))
        Creature.stepDown(o)
        Creature.eatRight(o,Int(var_172))
        Creature.stepRight(o)
        if var_111 == var_124
            Creature.stepLeft(o)
        end
        var_136 = if haskey(o.mem,var_136)
                o.mem[var_136]
            else
                var_136
            end
        Creature.stepLeft(o)
        Creature.stepUp(o)
        Creature.stepLeft(o)
        var_111 = func_83(var_111)
        if var_136 >= var_136
        end
        var_136 = var_136 / var_136
        var_111 = func_83(var_111)
        Creature.stepLeft(o)
        var_74 = var_74 - var_74
        Creature.stepUp(o)
        Creature.stepUp(o)
        Creature.stepRight(o)
        if var_136 === var_136
            local var_234::Int16 = -18381
            local var_175::Int64 = 5596248123125959202
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            var_234 = if haskey(o.mem,var_234)
                    o.mem[var_234]
                else
                    var_234
                end
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            o.mem[var_234] = var_234
        end
        Creature.stepUp(o)
        Creature.stepLeft(o)
        Creature.stepUp(o)
        Creature.stepLeft(o)
        var_74 = func_143(var_74)
        Creature.stepLeft(o)
        var_172 = func_143(var_172)
        Creature.stepLeft(o)
        Creature.eatUp(o,Int(var_74))
        return true
    end),[110,300,95,0,1,1,1],14,7696,9,188331,0x0000040f,Dict(0=>0,-18381=>-18381,25558=>25558,-4363=>-4363,-24796=>-24796,-19989=>-19989,1=>1),[1,1],152),RpcApi.SimpleOrganism(0x000000000
00614a0,:(function (o::Creature.Organism,)
        function func_254(var_253::Int16=1168)
            local var_255::Int64 = 2444956016187290455
            return var_253
        end
        function func_218(var_217::Bool=true)
            Creature.stepDown(o)
            return var_217
        end
        function func_178(var_176::Int8=-98,var_177::Int8=99)
            Creature.eatDown(o,Int(var_177))
            Creature.eatLeft(o,Int(var_177))
            for i::Int8 = 1:div(var_177,_LOOP_STEPS_DIVIDER)
            end
            Creature.stepUp(o)
            return var_176
        end
        local var_172::Int8 = 120
        function func_151(var_149::Int8=-11,var_150::Bool=true)
            local var_250::ASCIIString = "1L3FevPp"
            Creature.stepRight(o)
            var_250 = var_250 * var_250
            Creature.stepUp(o)
            var_150 = Bool(abs(var_150 - var_150))
            Creature.eatLeft(o,Int(var_149))
            return var_149
        end
        function func_143(var_142::Int8=72)
            local var_228::Int64 = -8205116022117027944
            local var_210::Bool = false
            local var_202::Bool = false
            local var_196::Int16 = -19989
            if var_210 > var_202
            end
            o.mem[var_196] = var_196
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.eatUp(o,Int(var_142))
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.eatUp(o,Int(var_142))
            Creature.stepLeft(o)
            var_196 = var_196 / var_196
            var_202 = var_202 & var_202
            Creature.eatLeft(o,Int(var_142))
            Creature.stepUp(o)
            Creature.eatRight(o,Int(var_142))
            Creature.stepLeft(o)
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.eatUp(o,Int(var_142))
            Creature.stepLeft(o)
            Creature.eatLeft(o,Int(var_142))
            o.mem[var_196] = var_196
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            Creature.eatLeft(o,Int(var_142))
            return var_142
        end
        local var_136::Int16 = -24796
        local var_124::Bool = false
        function func_83(var_81::Bool=true,var_82::Int8=114)
            local var_246::Int8 = 121
            local var_199::Bool = true
            local var_186::Int8 = 123
            Creature.eatRight(o,Int(var_82))
            if var_82 <= var_82
                Creature.stepRight(o)
            end
            Creature.eatUp(o,Int(var_186))
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_82))
            var_81 = var_199 * var_81
            Creature.eatRight(o,Int(var_246))
            Creature.stepLeft(o)
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_186))
            Creature.stepDown(o)
            Creature.eatUp(o,Int(var_82))
            Creature.eatUp(o,Int(var_246))
            Creature.eatUp(o,Int(var_82))
            Creature.eatDown(o,Int(var_82))
            Creature.stepRight(o)
            var_199 = var_199 | var_81
            Creature.eatUp(o,Int(var_82))
            Creature.eatDown(o,Int(var_82))
            Creature.eatDown(o,Int(var_82))
            Creature.eatRight(o,Int(var_186))
            Creature.stepRight(o)
            Creature.stepDown(o)
            Creature.eatRight(o,Int(var_82))
            Creature.stepDown(o)
            if var_81 >= var_199
                Creature.stepRight(o)
            end
            Creature.stepDown(o)
            Creature.eatDown(o,Int(var_186))
            Creature.eatLeft(o,Int(var_186))
            Creature.eatDown(o,Int(var_82))
            Creature.eatDown(o,Int(var_186))
            Creature.eatDown(o,Int(var_186))
            Creature.eatLeft(o,Int(var_186))
            Creature.stepDown(o)
            Creature.eatDown(o,Int(var_186))
            Creature.eatRight(o,Int(var_82))
            Creature.stepDown(o)
            if var_82 == var_82
                Creature.stepDown(o)
                Creature.stepDown(o)
            end
            Creature.stepDown(o)
            Creature.eatLeft(o,Int(var_186))
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_186))
            Creature.stepRight(o)
            Creature.stepRight(o)
            Creature.eatRight(o,Int(var_246))
            Creature.stepRight(o)
            return var_81
        end
        local var_74::Int8 = 43
        var_136 = if haskey(o.mem,var_136)
                o.mem[var_136]
            else
                var_136
            end
        o.mem[var_136] = var_136
        Creature.stepRight(o)
        Creature.eatUp(o,Int(var_172))
        var_111 = func_83(var_124)
        var_136 = var_136 / var_136
        Creature.stepRight(o)
        var_111 = Bool(abs(var_111 - var_124))
        var_111 = func_83(var_111,var_74)
        Creature.eatRight(o,Int(var_172))
        Creature.stepRight(o)
        if var_111 == var_124
            Creature.stepLeft(o)
        end
        if var_172 == var_172
            local var_224::ASCIIString = "LodVS4RL"
            Creature.stepUp(o)
            Creature.stepDown(o)
        end
        Creature.stepLeft(o)
        Creature.stepUp(o)
        Creature.stepLeft(o)
        var_111 = func_83(var_111)
        if var_136 >= var_136
        end
        var_136 = var_136 / var_136
        var_111 = func_83(var_111)
        Creature.stepLeft(o)
        var_74 = var_74 - var_74
        Creature.stepUp(o)
        Creature.stepUp(o)
        Creature.stepRight(o)
        if var_136 === var_136
            local var_234::Int16 = -18381
            local var_175::Int64 = 5596248123125959202
            o.mem[var_234] = var_234
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepUp(o)
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            Creature.stepLeft(o)
            var_234 = if haskey(o.mem,var_234)
                    o.mem[var_234]
                else
                    var_234
                end
            Creature.stepLeft(o)
            o.mem[var_234] = var_234
        end
        Creature.stepUp(o)
        Creature.stepLeft(o)
        Creature.stepUp(o)
        Creature.stepUp(o)
        var_74 = func_143(var_74)
        Creature.stepLeft(o)
        var_172 = func_143(var_172)
        Creature.stepLeft(o)
        return true
    end),[110,300,95,0,1,1,1],14,7696,78,187340,0x00000409,Dict(0=>0,-18381=>-18381,25558=>25558,-4363=>-4363,-24796=>-24796,-19989=>-19989,1=>1),[877,576],160)]

max_stars_repo_name: tmptrash/jevo

max_issues_repo_name: tmptrash/jevo

max_forks_repo_name: tmptrash/jevo


text:
@testset "MOMA" begin
    model = test_toyModel()

    sol = [looks_like_biomass_reaction(rid) ? 0.5 : 0.0 for rid in reactions(model)]

    moma = minimize_metabolic_adjustment_analysis_dict(
        model,
        sol,
        OSQP.Optimizer;
        modifications = [silence, change_optimizer_attribute("polish", true)],
    )

    @test isapprox(moma["biomass1"], 0.07692307692307691, atol = QP_TEST_TOLERANCE)
end


text:
# functions related to the logical operations on patterns
# and predicate functions.
#
"""
    Pattern syntactic sugar

the logical operators `|`, `&`, and `~`
 may be applied to all kind of `Pattern`s with the usual meaning.
+ `~` : unary negation operator - pattern does not match (highest priority)
+ `&` : binary logical and - both patterns match
+ `|` : binary logical or - any of the pattern match (lowest priority)

+ parentheses can be used to overrule operator precedence.

+ `[p...]` is the same as `p[1] | p[2] ...`

+ `(p...)` is the same as `p[1] & p[2] ...`

+ `~(p...) === ~((p...))` - that is `~(p[1] & p[2] ...)`

+ Precedence of '*' is higher that `~` for character and string objects:
 so `~ "a" * "b"  === ~("a" * "b") === ~"ab"`  also `~'a'^2*"b" === ~"aab"`
"""
function logical end

import Base: ~
import LinearAlgebra: isposdef

(&)(p::Tuple, q::Tuple) = tuple(p..., q...)
(&)(p::Tuple, q::Pattern...) = tuple(p..., q...)
(&)(p::Pattern, q::Tuple) = tuple(p, q...)
(&)(p::Pattern, q::Pattern...) = tuple(p, q...)
(|)(p::Pattern, q::Pattern...) = vcat(p, q...)
(~)(p::Pattern) = Not(p)
(~)(c::AbstractChar) = Not(string(c))
(~)(p::Not) = p.pattern
Not(p::Not) = p.pattern
(*)(a::Not{<:AbstractString}, b::Union{AbstractString,AbstractChar}) = Not(a.pattern * b)
(~)(p::Pattern...) = Not(tuple(p...))
(~)() = EMPTY_PATTERN
(~)(p::Vector) = length(p) == 0 ? ALL_PATTERN : Not(p)

const EMPTY_PATTERN = []
const ALL_PATTERN = ()

###
# simplification of patterns
###
is_pure_string(p::AbstractString) = !occursin(r"[]*?]", p)
is_pure_string(p::Pattern) = false
is_pure_vector(p::Vector) = all(is_pure_string.(p))
is_pure_vector(p::Pattern) = false

###
# Alias resolution
###

function aliasresolve(db::MatrixDatabase, k::AbstractString)
    haskey(db.aliases, k) ? [db.aliases[k]] : String[]
end
function aliasresolve(db::MatrixDatabase, a::Alias{T,<:Integer}) where T
    aliasresolve(db, aliasname(a))
end
function aliasresolve(db::MatrixDatabase, a::Alias{T,<:AbstractVector{<:IntOrVec}}) where T
    aliasr2(x) = aliasresolve(db, x)
    collect(Iterators.flatten(aliasr2.(aliasname(a))))
end
aliasresolve(db::MatrixDatabase, a::Alias{RemoteMatrixData{TURemoteType},Colon}, ) = "*/*"
aliasresolve(db::MatrixDatabase, a::Alias{RemoteMatrixData{MMRemoteType},Colon}) = "*/*/*"
aliasresolve(db::MatrixDatabase, a::Alias{GeneratedMatrixData{:B},Colon}) = :builtin
aliasresolve(db::MatrixDatabase, a::Alias{GeneratedMatrixData{:U},Colon}) = :user

###
# Predefined predicates for MatrixData
###

builtin(p...) = Alias{GeneratedMatrixData{:B}}(p...)
user(p...) = Alias{GeneratedMatrixData{:U}}(p...)
sp(p...) = Alias{RemoteMatrixData{TURemoteType}}(p...)
mm(p...) = Alias{RemoteMatrixData{MMRemoteType}}(p...)

function _issymmetry(data::RemoteMatrixData, T::Type{<:MMSymmetry})
    data.properties[] !== nothing && data.properties[].symmetry isa T
end
function _isfield(data::RemoteMatrixData, T::Type{<:MMField})
    data.properties[] !== nothing && data.properties[].field isa T
end

isgeneral(data::RemoteMatrixData) = _issymmetry(data, MMSymmetryGeneral)
issymmetric(data::RemoteMatrixData) = _issymmetry(data, MMSymmetrySymmetric)
isskew(data::RemoteMatrixData) = _issymmetry(data, MMSymmetrySkewSymmetric)
ishermitian(data::RemoteMatrixData) = _issymmetry(data, MMSymmetryHermitian)
isgeneral(data::MatrixData) = !issymmetric(data) && !isskew(data) && !ishermitian(data)
issymmetric(data::MatrixData) = data.name in mdlist(:symmetric)
isskew(data::MatrixData) = false
ishermitian(data::MatrixData) = false
issparse(data::RemoteMatrixData) = true
issparse(data::MatrixData) = data.name in mdlist(:sparse)
isposdef(data::RemoteMatrixData) = hasinfo(data) && data.posdef
isposdef(data::MatrixData) = data.name in mdlist(:posdef)

iscomplex(data::RemoteMatrixData) = _isfield(data, MMFieldComplex)
isreal(data::RemoteMatrixData) = _isfield(data, MMFieldReal)
isinteger(data::RemoteMatrixData) = _isfield(data, MMFieldInteger)
isboolean(data::RemoteMatrixData) = _isfield(data, MMFieldPattern)
iscomplex(data::MatrixData) = false
isreal(data::MatrixData) = false
isinteger(data::MatrixData) = false
isboolean(data::MatrixData) = false

hasinfo(data::RemoteMatrixData) = data.header.m > 0 && data.header.n > 0
hasinfo(data::MatrixData) = false
isremote(data::RemoteMatrixData) = true
isremote(data::MatrixData) = false
isloaded(data::RemoteMatrixData) = !isempty(data.metadata)
isloaded(data::MatrixData) = false
isunloaded(data::RemoteMatrixData) = isempty(data.metadata)
isunloaded(data::MatrixData) = false
isuser(data::GeneratedMatrixData{:U}) = true
isuser(data::MatrixData) = false
isbuiltin(data::GeneratedMatrixData{:B}) = true
isbuiltin(data::MatrixData) = false
islocal(data::GeneratedMatrixData) = true
islocal(data::MatrixData) = false

"""
    pred(f::Function, s::Symbol...)

Return a predicate function, which assigns to a each `data::MatrixData`
iff
*    `hasdata(data)` and
*    all symbols `s` are property names of `data` and
*    `f` applied to the tuple of values of those properties returns `true`
"""
function pred(f::Function, s::Symbol...)
    data::MatrixData -> hasinfo(data) &&
    s ⊆ propertynames(data) &&
    f(getproperty.(Ref(data), s)...)
end

"""
    prednzdev(deviation)

Test predicate - does number of stored (structural) non-zeros deviate from nnz
by more than `deviation`?
"""
function prednzdev(dev::AbstractFloat=0.1)
    function f(data::RemoteMatrixData)
        n1, n2 = extremnnz(data)
        n1 -= Int(floor(n1 * dev))
        n2 += Int(floor(n2 * dev))
        isloaded(data) && ! ( n1 <= data.dnz <= n2 )
    end
    f(::MatrixData) = false
    f
end

"""
    keyword(word::Union{AbstractString,Tuple,Vector})

Predicate function checks, if `word` is contained in on to the textual
metadata fields `[:notes, :title, :kind, :author]`.
Tuples and Vectors are interpreted as `AND` resp. `OR`.
"""
function keyword(s::AbstractString)
    function f(data::RemoteMatrixData)
        text = join([data.notes, data.title, data.author, data.kind], ' ')
        match(Regex("\\b$s\\b", "i"), text) !== nothing
    end
    f(::MatrixData) = false
    f
end
# this is to translate `keyword("a" & "b")` to `keyword("a") & keyword("b")`
keyword(t::Tuple) = Tuple(keyword.(t))
keyword(t::AbstractVector{<:AbstractString}) = [keyword(x) for x in t]

"""
    hasdata(meta::Union{Symbol,Tuple,Vector})

Predicate function checks, if matrix data have metadata symbol `meta`.
Tuples and Vectors are interpreted as `AND` resp. `OR`.
"""
function hasdata(s::Symbol, s2::Symbol...)
    function f(data::MatrixData)
        ms = metasymbols(data)
        s in ms && issubset(s2, metasymbols(data))
    end
    f
end
hasdata(t::NTuple{N,Symbol} where N) = hasdata(t...)
hasdata(t::Tuple) = Tuple(hasdata.(t))
hasdata(t::AbstractVector) = [hasdata(x) for x in t]

"""
    check_symbols(p::Pattern)

throw `ArgumentError` if pattern uses unknown symbol as a group name.
"""
function check_symbols(p::Pattern)
    s = setdiff(filter(x->x isa Symbol, flatten_pattern(p)), listgroups())
    isempty(s) || argerr("The following symbols are no group names: $s")
end

############################
# Predicate generating macro
############################
# extract all symbols from an expression
function extract_symbols(ex)
    s = Set{Symbol}()
    append_symbols!(::Any) = s
    append_symbols!(ex::Symbol) = push!(s, ex)
    function append_symbols!(ex::Expr)
        append_symbols!(ex.head)
        append_symbols!.(ex.args)
        s
    end
    collect(append_symbols!(ex))
end

# construct a function definition from a list of symbols and expression
function make_func(sli::AbstractVector{Symbol}, ex)
    res = :( () -> $ex )
    append!(res.args[1].args, sli)
    res
end

"""
    PROPS

The symbols, which are naming properties of `MatrixData`
"""
const PROPS = (:name, :id, :metadata, fieldnames(MetaInfo)...)

function make_pred(ex)
    syms = extract_symbols(ex) ∩ PROPS
    :(MatrixDepot.pred($(make_func(syms, ex)), $(QuoteNode.(syms)...)))
end

"""
    @pred(expression)

Generate a predicate function using the expression as function body. Variable names
within the expression, which are properties of `RemoteMatrixData` (e.g. `title`, `m`, `nnz`)
are used to access `data.title` etc. Other variable names, are used from the outer scope.

example: `maxnnz = 1_000; listnames(@pred(n <= maxnnz))` would produce a list of all
data with less than `maxnnz` structural non-zeros.
"""
macro pred(ex)
    esc(make_pred(ex))
end


text:
# Autogenerated wrapper script for FFMPEG_jll for aarch64-apple-darwin
export ffmpeg, ffprobe, libavcodec, libavdevice, libavfilter, libavformat, libavresample, libavutil, libpostproc, libswresample, libswscale

using libass_jll
using libfdk_aac_jll
using FriBidi_jll
using FreeType2_jll
using LAME_jll
using libvorbis_jll
using Ogg_jll
using x264_jll
using x265_jll
using Bzip2_jll
using Zlib_jll
using OpenSSL_jll
using Opus_jll
JLLWrappers.@generate_wrapper_header("FFMPEG")
JLLWrappers.@declare_executable_product(ffmpeg)
JLLWrappers.@declare_executable_product(ffprobe)
JLLWrappers.@declare_library_product(libavcodec, "@rpath/libavcodec.58.dylib")
JLLWrappers.@declare_library_product(libavdevice, "@rpath/libavdevice.58.dylib")
JLLWrappers.@declare_library_product(libavfilter, "@rpath/libavfilter.7.dylib")
JLLWrappers.@declare_library_product(libavformat, "@rpath/libavformat.58.dylib")
JLLWrappers.@declare_library_product(libavresample, "@rpath/libavresample.4.dylib")
JLLWrappers.@declare_library_product(libavutil, "@rpath/libavutil.56.dylib")
JLLWrappers.@declare_library_product(libpostproc, "@rpath/libpostproc.55.dylib")
JLLWrappers.@declare_library_product(libswresample, "@rpath/libswresample.3.dylib")
JLLWrappers.@declare_library_product(libswscale, "@rpath/libswscale.5.dylib")
function __init__()
    JLLWrappers.@generate_init_header(libass_jll, libfdk_aac_jll, FriBidi_jll, FreeType2_jll, LAME_jll, libvorbis_jll, Ogg_jll, x264_jll, x265_jll, Bzip2_jll, Zlib_jll, OpenSSL_jll, Opus_jll)
    JLLWrappers.@init_executable_product(
        ffmpeg,
        "bin/ffmpeg",
    )

    JLLWrappers.@init_executable_product(
        ffprobe,
        "bin/ffprobe",
    )

    JLLWrappers.@init_library_product(
        libavcodec,
        "lib/libavcodec.58.134.100.dylib",
        RTLD_LAZY | RTLD_DEEPBIND,
    )

    JLLWrappers.@init_library_product(
        libavdevice,
        "lib/libavdevice.58.13.100.dylib",
        RTLD_LAZY | RTLD_DEEPBIND,
    )

    JLLWrappers.@init_library_product(
        libavfilter,
        "lib/libavfilter.7.110.100.dylib",
        RTLD_LAZY | RTLD_DEEPBIND,
    )

    JLLWrappers.@init_library_product(
        libavformat,
        "lib/libavformat.58.76.100.dylib",
        RTLD_LAZY | RTLD_DEEPBIND,
    )

    JLLWrappers.@init_library_product(
        libavresample,
        "lib/libavresample.4.0.0.dylib",
        RTLD_LAZY | RTLD_DEEPBIND,
    )

    JLLWrappers.@init_library_product(
        libavutil,
        "lib/libavutil.56.70.100.dylib",
        RTLD_LAZY | RTLD_DEEPBIND,
    )

    JLLWrappers.@init_library_product(
        libpostproc,
        "lib/libpostproc.55.9.100.dylib",
        RTLD_LAZY | RTLD_DEEPBIND,
    )

    JLLWrappers.@init_library_product(
        libswresample,
        "lib/libswresample.3.9.100.dylib",
        RTLD_LAZY | RTLD_DEEPBIND,
    )

    JLLWrappers.@init_library_product(
        libswscale,
        "lib/libswscale.5.9.100.dylib",
        RTLD_LAZY | RTLD_DEEPBIND,
    )

    JLLWrappers.@generate_init_footer()
end  # __init__()