def qrem( a: pt.abi.Uint64, b: pt.abi.Uint64, *, output: pt.abi.Tuple2[pt.abi.Uint64, pt.abi.Uint64], ) -> pt.Expr: return pt.Seq( (q := pt.abi.Uint64()).set(a.get() / b.get()), (rem := pt.abi.Uint64()).set(a.get() % b.get()), output.set(q, rem), )
def fn_2arg_1ret( a: pt.abi.Uint64, b: pt.abi.StaticArray[pt.abi.Byte, Literal[10]], *, output: pt.abi.Byte, ) -> pt.Expr: return output.set(b[a.get() % pt.Int(10)])
def many_args( _a: pt.abi.Uint64, _b: pt.abi.Uint64, _c: pt.abi.Uint64, _d: pt.abi.Uint64, _e: pt.abi.Uint64, _f: pt.abi.Uint64, _g: pt.abi.Uint64, _h: pt.abi.Uint64, _i: pt.abi.Uint64, _j: pt.abi.Uint64, _k: pt.abi.Uint64, _l: pt.abi.Uint64, _m: pt.abi.Uint64, _n: pt.abi.Uint64, _o: pt.abi.Uint64, _p: pt.abi.Uint64, _q: pt.abi.Uint64, _r: pt.abi.Uint64, _s: pt.abi.Uint64, _t: pt.abi.Uint64, *, output: pt.abi.Uint64, ) -> pt.Expr: return output.set(_t.get())
def fn_mixed_annotation_1_with_ret(a: pt.ScratchVar, b: pt.abi.Uint64, *, output: pt.abi.Bool) -> pt.Expr: return output.set((a.load() + b.get()) % pt.Int(2))
def fn_ret_add(a: pt.abi.Uint64, b: pt.abi.Uint32, *, output: pt.abi.Uint64) -> pt.Expr: return output.set(a.get() + b.get() + pt.Int(0xA190))
def fn_log_add(a: pt.abi.Uint64, b: pt.abi.Uint32) -> pt.Expr: return pt.Seq(pt.Log(pt.Itob(a.get() + b.get())), pt.Return())
def mod(a: pt.abi.Uint64, b: pt.abi.Uint64, *, output: pt.abi.Uint64) -> pt.Expr: return output.set(a.get() % b.get())
def div(a: pt.abi.Uint64, b: pt.abi.Uint64, *, output: pt.abi.Uint64) -> pt.Expr: return output.set(a.get() / b.get())
def sub(a: pt.abi.Uint64, b: pt.abi.Uint64, *, output: pt.abi.Uint64) -> pt.Expr: """replace me""" return output.set(a.get() - b.get())
def not_registrable(lhs: pt.abi.Uint64, rhs: pt.Expr, *, output: pt.abi.Uint64): return output.set(lhs.get() * rhs)
def add(a: pt.abi.Uint64, b: pt.abi.Uint64, *, output: pt.abi.Uint64) -> pt.Expr: """add takes 2 integers a,b and adds them, returning the sum""" return output.set(a.get() + b.get())