From 7dfec3c724657c7aea93ee451bd70f4e474c1f09 Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Mon, 9 Sep 2019 07:42:06 -0700 Subject: [PATCH] feat(library/init/lean/compiler/ir): add `persistent` field to `inc/dec` If `persistent == true`, then object is known to be persistent at compilation time. `emitc` omits `inc/dec` operations to persistent objects. The interpreter does not to avoid memory leaks. --- library/init/lean/compiler/ir/basic.lean | 22 +- library/init/lean/compiler/ir/checker.lean | 4 +- library/init/lean/compiler/ir/emitc.lean | 4 +- .../lean/compiler/ir/expandresetreuse.lean | 20 +- library/init/lean/compiler/ir/format.lean | 4 +- library/init/lean/compiler/ir/freevars.lean | 12 +- library/init/lean/compiler/ir/livevars.lean | 8 +- library/init/lean/compiler/ir/normids.lean | 8 +- library/init/lean/compiler/ir/rc.lean | 34 +- src/stage0/init/lean/compiler/ir/basic.c | 722 ++++---- src/stage0/init/lean/compiler/ir/emitc.c | 688 ++++---- .../init/lean/compiler/ir/expandresetreuse.c | 664 ++++---- src/stage0/init/lean/compiler/ir/normids.c | 1462 +++++++++-------- src/stage0/init/lean/compiler/ir/rc.c | 1195 +++++++------- 14 files changed, 2597 insertions(+), 2250 deletions(-) diff --git a/library/init/lean/compiler/ir/basic.lean b/library/init/lean/compiler/ir/basic.lean index db78b51e5c..2718789166 100644 --- a/library/init/lean/compiler/ir/basic.lean +++ b/library/init/lean/compiler/ir/basic.lean @@ -226,10 +226,12 @@ inductive FnBody /- Store `y : ty` at Position `sizeof(void*)*i + offset` in `x`. `x` must be a Constructor object and `RC(x)` must be 1. `ty` must not be `object`, `tobject`, `irrelevant` nor `Usize`. -/ | sset (x : VarId) (i : Nat) (offset : Nat) (y : VarId) (ty : IRType) (b : FnBody) -/- RC increment for `object`. If c == `true`, then `inc` must check whether `x` is a tagged pointer or not. -/ -| inc (x : VarId) (n : Nat) (c : Bool) (b : FnBody) -/- RC decrement for `object`. If c == `true`, then `inc` must check whether `x` is a tagged pointer or not. -/ -| dec (x : VarId) (n : Nat) (c : Bool) (b : FnBody) +/- RC increment for `object`. If c == `true`, then `inc` must check whether `x` is a tagged pointer or not. + If `persistent == true` then `x` is statically known to be a persistent object. -/ +| inc (x : VarId) (n : Nat) (c : Bool) (persistent : Bool) (b : FnBody) +/- RC decrement for `object`. If c == `true`, then `inc` must check whether `x` is a tagged pointer or not. + If `persistent == true` then `x` is statically known to be a persistent object. -/ +| dec (x : VarId) (n : Nat) (c : Bool) (persistent : Bool) (b : FnBody) | del (x : VarId) (b : FnBody) | mdata (d : MData) (b : FnBody) | case (tid : Name) (x : VarId) (cs : Array (AltCore FnBody)) @@ -272,8 +274,8 @@ def FnBody.body : FnBody → FnBody | FnBody.uset _ _ _ b => b | FnBody.sset _ _ _ _ _ b => b | FnBody.setTag _ _ b => b -| FnBody.inc _ _ _ b => b -| FnBody.dec _ _ _ b => b +| FnBody.inc _ _ _ _ b => b +| FnBody.dec _ _ _ _ b => b | FnBody.del _ b => b | FnBody.mdata _ b => b | other => other @@ -285,8 +287,8 @@ def FnBody.setBody : FnBody → FnBody → FnBody | FnBody.uset x i y _, b => FnBody.uset x i y b | FnBody.sset x i o y t _, b => FnBody.sset x i o y t b | FnBody.setTag x i _, b => FnBody.setTag x i b -| FnBody.inc x n c _, b => FnBody.inc x n c b -| FnBody.dec x n c _, b => FnBody.dec x n c b +| FnBody.inc x n c p _, b => FnBody.inc x n c p b +| FnBody.dec x n c p _, b => FnBody.dec x n c p b | FnBody.del x _, b => FnBody.del x b | FnBody.mdata d _, b => FnBody.mdata d b | other, b => other @@ -514,8 +516,8 @@ partial def FnBody.alphaEqv : IndexRenaming → FnBody → FnBody → Bool | ρ, FnBody.sset x₁ i₁ o₁ y₁ t₁ b₁, FnBody.sset x₂ i₂ o₂ y₂ t₂ b₂ => aeqv ρ x₁ x₂ && i₁ = i₂ && o₁ = o₂ && aeqv ρ y₁ y₂ && t₁ == t₂ && FnBody.alphaEqv ρ b₁ b₂ | ρ, FnBody.setTag x₁ i₁ b₁, FnBody.setTag x₂ i₂ b₂ => aeqv ρ x₁ x₂ && i₁ == i₂ && FnBody.alphaEqv ρ b₁ b₂ -| ρ, FnBody.inc x₁ n₁ c₁ b₁, FnBody.inc x₂ n₂ c₂ b₂ => aeqv ρ x₁ x₂ && n₁ == n₂ && c₁ == c₂ && FnBody.alphaEqv ρ b₁ b₂ -| ρ, FnBody.dec x₁ n₁ c₁ b₁, FnBody.dec x₂ n₂ c₂ b₂ => aeqv ρ x₁ x₂ && n₁ == n₂ && c₁ == c₂ && FnBody.alphaEqv ρ b₁ b₂ +| ρ, FnBody.inc x₁ n₁ c₁ p₁ b₁, FnBody.inc x₂ n₂ c₂ p₂ b₂ => aeqv ρ x₁ x₂ && n₁ == n₂ && c₁ == c₂ && p₁ == p₂ && FnBody.alphaEqv ρ b₁ b₂ +| ρ, FnBody.dec x₁ n₁ c₁ p₁ b₁, FnBody.dec x₂ n₂ c₂ p₂ b₂ => aeqv ρ x₁ x₂ && n₁ == n₂ && c₁ == c₂ && p₁ == p₂ && FnBody.alphaEqv ρ b₁ b₂ | ρ, FnBody.del x₁ b₁, FnBody.del x₂ b₂ => aeqv ρ x₁ x₂ && FnBody.alphaEqv ρ b₁ b₂ | ρ, FnBody.mdata m₁ b₁, FnBody.mdata m₂ b₂ => m₁ == m₂ && FnBody.alphaEqv ρ b₁ b₂ | ρ, FnBody.case n₁ x₁ alts₁, FnBody.case n₂ x₂ alts₂ => n₁ == n₂ && aeqv ρ x₁ x₂ && Array.isEqv alts₁ alts₂ (fun alt₁ alt₂ => diff --git a/library/init/lean/compiler/ir/checker.lean b/library/init/lean/compiler/ir/checker.lean index 53ac0d91bc..00e19c6e65 100644 --- a/library/init/lean/compiler/ir/checker.lean +++ b/library/init/lean/compiler/ir/checker.lean @@ -108,8 +108,8 @@ partial def checkFnBody : FnBody → M Unit | FnBody.uset x _ y b => checkVar x *> checkVar y *> checkFnBody b | FnBody.sset x _ _ y _ b => checkVar x *> checkVar y *> checkFnBody b | FnBody.setTag x _ b => checkVar x *> checkFnBody b -| FnBody.inc x _ _ b => checkVar x *> checkFnBody b -| FnBody.dec x _ _ b => checkVar x *> checkFnBody b +| FnBody.inc x _ _ _ b => checkVar x *> checkFnBody b +| FnBody.dec x _ _ _ b => checkVar x *> checkFnBody b | FnBody.del x b => checkVar x *> checkFnBody b | FnBody.mdata _ b => checkFnBody b | FnBody.jmp j ys => checkJP j *> checkArgs ys diff --git a/library/init/lean/compiler/ir/emitc.lean b/library/init/lean/compiler/ir/emitc.lean index 845a8376ad..8c10d9477f 100644 --- a/library/init/lean/compiler/ir/emitc.lean +++ b/library/init/lean/compiler/ir/emitc.lean @@ -591,8 +591,8 @@ partial def emitBlock (emitBody : FnBody → M Unit) : FnBody → M Unit | FnBody.jdecl j xs v b => emitBlock b | d@(FnBody.vdecl x t v b) => do ctx ← read; if isTailCallTo ctx.mainFn d then emitTailCall v else emitVDecl x t v *> emitBlock b -| FnBody.inc x n c b => emitInc x n c *> emitBlock b -| FnBody.dec x n c b => emitDec x n c *> emitBlock b +| FnBody.inc x n c p b => unless p (emitInc x n c) *> emitBlock b +| FnBody.dec x n c p b => unless p (emitDec x n c) *> emitBlock b | FnBody.del x b => emitDel x *> emitBlock b | FnBody.setTag x i b => emitSetTag x i *> emitBlock b | FnBody.set x i y b => emitSet x i y *> emitBlock b diff --git a/library/init/lean/compiler/ir/expandresetreuse.lean b/library/init/lean/compiler/ir/expandresetreuse.lean index f0d34a2fb6..4ce509d464 100644 --- a/library/init/lean/compiler/ir/expandresetreuse.lean +++ b/library/init/lean/compiler/ir/expandresetreuse.lean @@ -48,7 +48,7 @@ partial def consumed (x : VarId) : FnBody → Bool match v with | Expr.reuse y _ _ _ => x == y || consumed b | _ => consumed b -| FnBody.dec y _ _ b => x == y || consumed b +| FnBody.dec y _ _ _ b => x == y || consumed b | FnBody.case _ _ alts => alts.all $ fun alt => consumed alt.body | e => !e.isTerminal && consumed e.body @@ -65,7 +65,7 @@ partial def eraseProjIncForAux (y : VarId) : Array FnBody → Mask → Array FnB match b with | (FnBody.vdecl _ _ (Expr.sproj _ _ _) _) => keepInstr b | (FnBody.vdecl _ _ (Expr.uproj _ _) _) => keepInstr b - | (FnBody.inc z n c _) => + | (FnBody.inc z n c p _) => if n == 0 then done () else let b' := bs.get (bs.size - 2); match b' with @@ -81,7 +81,7 @@ partial def eraseProjIncForAux (y : VarId) : Array FnBody → Mask → Array FnB let bs := bs.pop.pop; let mask := mask.set i (some z); let keep := keep.push b'; - let keep := if n == 1 then keep else keep.push (FnBody.inc z (n-1) c FnBody.nil); + let keep := if n == 1 then keep else keep.push (FnBody.inc z (n-1) c p FnBody.nil); eraseProjIncForAux bs mask keep else done () | other => done () @@ -94,9 +94,9 @@ eraseProjIncForAux y bs (mkArray n none) Array.empty /- Replace `reuse x ctor ...` with `ctor ...`, and remoce `dec x` -/ partial def reuseToCtor (x : VarId) : FnBody → FnBody -| FnBody.dec y n c b => +| FnBody.dec y n c p b => if x == y then b -- n must be 1 since `x := reset ...` - else FnBody.dec y n c (reuseToCtor b) + else FnBody.dec y n c p (reuseToCtor b) | FnBody.vdecl z t v b => match v with | Expr.reuse y c u xs => @@ -128,10 +128,10 @@ and `b'` is `b` where we removed `dec x` and replaced `reuse x ctor_i ...` with -/ def mkSlowPath (x y : VarId) (mask : Mask) (b : FnBody) : FnBody := let b := reuseToCtor x b; -let b := FnBody.dec y 1 true b; +let b := FnBody.dec y 1 true false b; mask.foldl (fun b m => match m with - | some z => FnBody.inc z 1 true b + | some z => FnBody.inc z 1 true false b | none => b) b @@ -146,7 +146,7 @@ mask.size.mfold | some _ => pure b -- code took ownership of this field | none => do fld ← mkFresh; - pure (FnBody.vdecl fld IRType.object (Expr.proj i y) (FnBody.dec fld 1 true b))) + pure (FnBody.vdecl fld IRType.object (Expr.proj i y) (FnBody.dec fld 1 true false b))) b def setFields (y : VarId) (zs : Array Arg) (b : FnBody) : FnBody := @@ -197,9 +197,9 @@ partial def removeSelfSet (ctx : Context) : FnBody → FnBody instr.setBody b partial def reuseToSet (ctx : Context) (x y : VarId) : FnBody → FnBody -| FnBody.dec z n c b => +| FnBody.dec z n c p b => if x == z then FnBody.del y b - else FnBody.dec z n c (reuseToSet b) + else FnBody.dec z n c p (reuseToSet b) | FnBody.vdecl z t v b => match v with | Expr.reuse w c u zs => diff --git a/library/init/lean/compiler/ir/format.lean b/library/init/lean/compiler/ir/format.lean index 5c0254e746..5898333e7e 100644 --- a/library/init/lean/compiler/ir/format.lean +++ b/library/init/lean/compiler/ir/format.lean @@ -84,8 +84,8 @@ partial def formatFnBody (indent : Nat := 2) : FnBody → Format | FnBody.uset x i y b => "uset " ++ format x ++ "[" ++ format i ++ "] := " ++ format y ++ ";" ++ Format.line ++ formatFnBody b | FnBody.sset x i o y ty b => "sset " ++ format x ++ "[" ++ format i ++ ", " ++ format o ++ "] : " ++ format ty ++ " := " ++ format y ++ ";" ++ Format.line ++ formatFnBody b | FnBody.setTag x cidx b => "setTag " ++ format x ++ " := " ++ format cidx ++ ";" ++ Format.line ++ formatFnBody b -| FnBody.inc x n c b => "inc" ++ (if n != 1 then Format.sbracket (format n) else "") ++ " " ++ format x ++ ";" ++ Format.line ++ formatFnBody b -| FnBody.dec x n c b => "dec" ++ (if n != 1 then Format.sbracket (format n) else "") ++ " " ++ format x ++ ";" ++ Format.line ++ formatFnBody b +| FnBody.inc x n c _ b => "inc" ++ (if n != 1 then Format.sbracket (format n) else "") ++ " " ++ format x ++ ";" ++ Format.line ++ formatFnBody b +| FnBody.dec x n c _ b => "dec" ++ (if n != 1 then Format.sbracket (format n) else "") ++ " " ++ format x ++ ";" ++ Format.line ++ formatFnBody b | FnBody.del x b => "del " ++ format x ++ ";" ++ Format.line ++ formatFnBody b | FnBody.mdata d b => "mdata " ++ format d ++ ";" ++ Format.line ++ formatFnBody b | FnBody.case tid x cs => "case " ++ format x ++ " of" ++ cs.foldl (fun r c => r ++ Format.line ++ formatAlt formatFnBody indent c) Format.nil diff --git a/library/init/lean/compiler/ir/freevars.lean b/library/init/lean/compiler/ir/freevars.lean index 3612884f26..2d0a6d325b 100644 --- a/library/init/lean/compiler/ir/freevars.lean +++ b/library/init/lean/compiler/ir/freevars.lean @@ -64,8 +64,8 @@ partial def collectFnBody : FnBody → Collector | FnBody.uset x _ y b => collectVar x >> collectVar y >> collectFnBody b | FnBody.sset x _ _ y _ b => collectVar x >> collectVar y >> collectFnBody b | FnBody.setTag x _ b => collectVar x >> collectFnBody b -| FnBody.inc x _ _ b => collectVar x >> collectFnBody b -| FnBody.dec x _ _ b => collectVar x >> collectFnBody b +| FnBody.inc x _ _ _ b => collectVar x >> collectFnBody b +| FnBody.dec x _ _ _ b => collectVar x >> collectFnBody b | FnBody.del x b => collectVar x >> collectFnBody b | FnBody.mdata _ b => collectFnBody b | FnBody.case _ x alts => collectVar x >> collectAlts collectFnBody alts @@ -159,8 +159,8 @@ partial def collectFnBody : FnBody → Collector | FnBody.uset x _ y b => collectVar x >> collectVar y >> collectFnBody b | FnBody.sset x _ _ y _ b => collectVar x >> collectVar y >> collectFnBody b | FnBody.setTag x _ b => collectVar x >> collectFnBody b -| FnBody.inc x _ _ b => collectVar x >> collectFnBody b -| FnBody.dec x _ _ b => collectVar x >> collectFnBody b +| FnBody.inc x _ _ _ b => collectVar x >> collectFnBody b +| FnBody.dec x _ _ _ b => collectVar x >> collectFnBody b | FnBody.del x b => collectVar x >> collectFnBody b | FnBody.mdata _ b => collectFnBody b | FnBody.case _ x alts => collectVar x >> collectAlts collectFnBody alts @@ -217,8 +217,8 @@ partial def visitFnBody (w : Index) : FnBody → Bool | FnBody.uset x _ y b => visitVar w x || visitVar w y || visitFnBody b | FnBody.sset x _ _ y _ b => visitVar w x || visitVar w y || visitFnBody b | FnBody.setTag x _ b => visitVar w x || visitFnBody b -| FnBody.inc x _ _ b => visitVar w x || visitFnBody b -| FnBody.dec x _ _ b => visitVar w x || visitFnBody b +| FnBody.inc x _ _ _ b => visitVar w x || visitFnBody b +| FnBody.dec x _ _ _ b => visitVar w x || visitFnBody b | FnBody.del x b => visitVar w x || visitFnBody b | FnBody.mdata _ b => visitFnBody b | FnBody.jmp j ys => visitJP w j || visitArgs w ys diff --git a/library/init/lean/compiler/ir/livevars.lean b/library/init/lean/compiler/ir/livevars.lean index 6abac43d24..70b98f39e3 100644 --- a/library/init/lean/compiler/ir/livevars.lean +++ b/library/init/lean/compiler/ir/livevars.lean @@ -53,8 +53,8 @@ partial def visitFnBody (w : Index) : FnBody → M Bool | FnBody.uset x _ y b => visitVar w x <||> visitVar w y <||> visitFnBody b | FnBody.sset x _ _ y _ b => visitVar w x <||> visitVar w y <||> visitFnBody b | FnBody.setTag x _ b => visitVar w x <||> visitFnBody b -| FnBody.inc x _ _ b => visitVar w x <||> visitFnBody b -| FnBody.dec x _ _ b => visitVar w x <||> visitFnBody b +| FnBody.inc x _ _ _ b => visitVar w x <||> visitFnBody b +| FnBody.dec x _ _ _ b => visitVar w x <||> visitFnBody b | FnBody.del x b => visitVar w x <||> visitFnBody b | FnBody.mdata _ b => visitFnBody b | FnBody.jmp j ys => visitArgs w ys <||> do { @@ -141,8 +141,8 @@ partial def collectFnBody : FnBody → JPLiveVarMap → Collector | FnBody.setTag x _ b, m => collectVar x ∘ collectFnBody b m | FnBody.uset x _ y b, m => collectVar x ∘ collectVar y ∘ collectFnBody b m | FnBody.sset x _ _ y _ b, m => collectVar x ∘ collectVar y ∘ collectFnBody b m -| FnBody.inc x _ _ b, m => collectVar x ∘ collectFnBody b m -| FnBody.dec x _ _ b, m => collectVar x ∘ collectFnBody b m +| FnBody.inc x _ _ _ b, m => collectVar x ∘ collectFnBody b m +| FnBody.dec x _ _ _ b, m => collectVar x ∘ collectFnBody b m | FnBody.del x b, m => collectVar x ∘ collectFnBody b m | FnBody.mdata _ b, m => collectFnBody b m | FnBody.ret x, m => collectArg x diff --git a/library/init/lean/compiler/ir/normids.lean b/library/init/lean/compiler/ir/normids.lean index f189b6e5ec..8935b74196 100644 --- a/library/init/lean/compiler/ir/normids.lean +++ b/library/init/lean/compiler/ir/normids.lean @@ -106,8 +106,8 @@ partial def normFnBody : FnBody → N FnBody | FnBody.uset x i y b => do x ← normVar x; y ← normVar y; FnBody.uset x i y <$> normFnBody b | FnBody.sset x i o y t b => do x ← normVar x; y ← normVar y; FnBody.sset x i o y t <$> normFnBody b | FnBody.setTag x i b => do x ← normVar x; FnBody.setTag x i <$> normFnBody b -| FnBody.inc x n c b => do x ← normVar x; FnBody.inc x n c <$> normFnBody b -| FnBody.dec x n c b => do x ← normVar x; FnBody.dec x n c <$> normFnBody b +| FnBody.inc x n c p b => do x ← normVar x; FnBody.inc x n c p <$> normFnBody b +| FnBody.dec x n c p b => do x ← normVar x; FnBody.dec x n c p <$> normFnBody b | FnBody.del x b => do x ← normVar x; FnBody.del x <$> normFnBody b | FnBody.mdata d b => FnBody.mdata d <$> normFnBody b | FnBody.case tid x alts => do @@ -162,8 +162,8 @@ as.map (mapArg f) | FnBody.setTag x i b => FnBody.setTag (f x) i (mapFnBody b) | FnBody.uset x i y b => FnBody.uset (f x) i (f y) (mapFnBody b) | FnBody.sset x i o y t b => FnBody.sset (f x) i o (f y) t (mapFnBody b) -| FnBody.inc x n c b => FnBody.inc (f x) n c (mapFnBody b) -| FnBody.dec x n c b => FnBody.dec (f x) n c (mapFnBody b) +| FnBody.inc x n c p b => FnBody.inc (f x) n c p (mapFnBody b) +| FnBody.dec x n c p b => FnBody.dec (f x) n c p (mapFnBody b) | FnBody.del x b => FnBody.del (f x) (mapFnBody b) | FnBody.mdata d b => FnBody.mdata d (mapFnBody b) | FnBody.case tid x alts => FnBody.case tid (f x) (alts.map (fun alt => alt.modifyBody mapFnBody)) diff --git a/library/init/lean/compiler/ir/rc.lean b/library/init/lean/compiler/ir/rc.lean index 94c1425df0..c5631e5252 100644 --- a/library/init/lean/compiler/ir/rc.lean +++ b/library/init/lean/compiler/ir/rc.lean @@ -52,13 +52,15 @@ match ctx.jpLiveVarMap.find j with def mustConsume (ctx : Context) (x : VarId) : Bool := let info := getVarInfo ctx x; -info.ref && !info.persistent && info.consume +info.ref && info.consume -@[inline] def addInc (x : VarId) (b : FnBody) (n := 1) : FnBody := -if n == 0 then b else FnBody.inc x n true b +@[inline] def addInc (ctx : Context) (x : VarId) (b : FnBody) (n := 1) : FnBody := +let info := getVarInfo ctx x; +if n == 0 then b else FnBody.inc x n true info.persistent b -@[inline] def addDec (x : VarId) (b : FnBody) : FnBody := -FnBody.dec x 1 true b +@[inline] def addDec (ctx : Context) (x : VarId) (b : FnBody) : FnBody := +let info := getVarInfo ctx x; +FnBody.dec x 1 true info.persistent b private def updateRefUsingCtorInfo (ctx : Context) (x : VarId) (c : CtorInfo) : Context := if c.isRef then ctx @@ -70,7 +72,7 @@ else let m := ctx.varMap; private def addDecForAlt (ctx : Context) (caseLiveVars altLiveVars : LiveVarSet) (b : FnBody) : FnBody := caseLiveVars.fold - (fun b x => if !altLiveVars.contains x && mustConsume ctx x then addDec x b else b) + (fun b x => if !altLiveVars.contains x && mustConsume ctx x then addDec ctx x b else b) b /- `isFirstOcc xs x i = true` if `xs[i]` is the first occurrence of `xs[i]` in `xs` -/ @@ -115,7 +117,7 @@ xs.size.fold | Arg.irrelevant => b | Arg.var x => let info := getVarInfo ctx x; - if !info.ref || info.persistent || !isFirstOcc xs i then b + if !info.ref || !isFirstOcc xs i then b else let numConsuptions := getNumConsumptions x xs consumeParamPred; -- number of times the argument is let numIncs := @@ -127,7 +129,7 @@ xs.size.fold -- dbgTrace ("addInc " ++ toString x ++ " nconsumptions: " ++ toString numConsuptions ++ " incs: " ++ toString numIncs -- ++ " consume: " ++ toString info.consume ++ " live: " ++ toString (liveVarsAfter.contains x) -- ++ " borrowParam : " ++ toString (isBorrowParamAux x xs consumeParamPred)) $ fun _ => - addInc x b numIncs) + addInc ctx x b numIncs) b private def addIncBefore (ctx : Context) (xs : Array Arg) (ps : Array Param) (b : FnBody) (liveVarsAfter : LiveVarSet) : FnBody := @@ -145,7 +147,7 @@ xs.size.fold Remark: `x` may occur multiple times in the application (e.g., `f x y x`). This is why we check whether it is the first occurrence. -/ if mustConsume ctx x && isFirstOcc xs i && isBorrowParam x xs ps && !bLiveVars.contains x then - addDec x b + addDec ctx x b else b) b @@ -154,9 +156,9 @@ addIncBeforeAux ctx xs (fun i => true) b liveVarsAfter /- Add `dec` instructions for parameters that are references, are not alive in `b`, and are not borrow. That is, we must make sure these parameters are consumed. -/ -private def addDecForDeadParams (ps : Array Param) (b : FnBody) (bLiveVars : LiveVarSet) : FnBody := +private def addDecForDeadParams (ctx : Context) (ps : Array Param) (b : FnBody) (bLiveVars : LiveVarSet) : FnBody := ps.foldl - (fun b p => if !p.borrow && p.ty.isObj && !bLiveVars.contains p.x then addDec p.x b else b) + (fun b p => if !p.borrow && p.ty.isObj && !bLiveVars.contains p.x then addDec ctx p.x b else b) b private def isPersistent : Expr → Bool @@ -186,7 +188,7 @@ private def updateVarInfo (ctx : Context) (x : VarId) (t : IRType) (v : Expr) : .. ctx } private def addDecIfNeeded (ctx : Context) (x : VarId) (b : FnBody) (bLiveVars : LiveVarSet) : FnBody := -if mustConsume ctx x && !bLiveVars.contains x then addDec x b else b +if mustConsume ctx x && !bLiveVars.contains x then addDec ctx x b else b private def processVDecl (ctx : Context) (z : VarId) (t : IRType) (v : Expr) (b : FnBody) (bLiveVars : LiveVarSet) : FnBody × LiveVarSet := -- dbgTrace ("processVDecl " ++ toString z ++ " " ++ toString (format v)) $ fun _ => @@ -195,7 +197,7 @@ let b := match v with | (Expr.reuse _ _ _ ys) => addIncBeforeConsumeAll ctx ys (FnBody.vdecl z t v b) bLiveVars | (Expr.proj _ x) => let b := addDecIfNeeded ctx x b bLiveVars; - let b := if (getVarInfo ctx x).consume then addInc z b else b; + let b := if (getVarInfo ctx x).consume then addInc ctx z b else b; (FnBody.vdecl z t v b) | (Expr.uproj _ x) => FnBody.vdecl z t v (addDecIfNeeded ctx x b bLiveVars) | (Expr.sproj _ _ x) => FnBody.vdecl z t v (addDecIfNeeded ctx x b bLiveVars) @@ -226,7 +228,7 @@ partial def visitFnBody : FnBody → Context → (FnBody × LiveVarSet) processVDecl ctx x t v b bLiveVars | FnBody.jdecl j xs v b, ctx => let (v, vLiveVars) := visitFnBody v (updateVarInfoWithParams ctx xs); - let v := addDecForDeadParams xs v vLiveVars; + let v := addDecForDeadParams ctx xs v vLiveVars; let ctx := { jpLiveVarMap := updateJPLiveVarMap j xs v ctx.jpLiveVarMap, .. ctx }; let (b, bLiveVars) := visitFnBody b ctx; (FnBody.jdecl j xs v b, bLiveVars) @@ -260,7 +262,7 @@ partial def visitFnBody : FnBody → Context → (FnBody × LiveVarSet) match x with | Arg.var x => let info := getVarInfo ctx x; - if info.ref && !info.persistent && !info.consume then (addInc x b, mkLiveVarSet x) else (b, mkLiveVarSet x) + if info.ref && !info.consume then (addInc ctx x b, mkLiveVarSet x) else (b, mkLiveVarSet x) | _ => (b, {}) | b@(FnBody.jmp j xs), ctx => let jLiveVars := getJPLiveVars ctx j; @@ -276,7 +278,7 @@ partial def visitDecl (env : Environment) (decls : Array Decl) : Decl → Decl let ctx : Context := { env := env, decls := decls }; let ctx := updateVarInfoWithParams ctx xs; let (b, bLiveVars) := visitFnBody b ctx; - let b := addDecForDeadParams xs b bLiveVars; + let b := addDecForDeadParams ctx xs b bLiveVars; Decl.fdecl f xs t b | other => other diff --git a/src/stage0/init/lean/compiler/ir/basic.c b/src/stage0/init/lean/compiler/ir/basic.c index c53220b3ab..7e246e5182 100644 --- a/src/stage0/init/lean/compiler/ir/basic.c +++ b/src/stage0/init/lean/compiler/ir/basic.c @@ -1679,96 +1679,100 @@ return x_1; } else { -lean_object* x_42; lean_object* x_43; uint8_t x_44; lean_object* x_45; +lean_object* x_42; lean_object* x_43; uint8_t x_44; uint8_t x_45; lean_object* x_46; x_42 = lean_ctor_get(x_1, 0); x_43 = lean_ctor_get(x_1, 1); x_44 = lean_ctor_get_uint8(x_1, sizeof(void*)*3); +x_45 = lean_ctor_get_uint8(x_1, sizeof(void*)*3 + 1); lean_inc(x_43); lean_inc(x_42); lean_dec(x_1); -x_45 = lean_alloc_ctor(6, 3, 1); -lean_ctor_set(x_45, 0, x_42); -lean_ctor_set(x_45, 1, x_43); -lean_ctor_set(x_45, 2, x_2); -lean_ctor_set_uint8(x_45, sizeof(void*)*3, x_44); -return x_45; +x_46 = lean_alloc_ctor(6, 3, 2); +lean_ctor_set(x_46, 0, x_42); +lean_ctor_set(x_46, 1, x_43); +lean_ctor_set(x_46, 2, x_2); +lean_ctor_set_uint8(x_46, sizeof(void*)*3, x_44); +lean_ctor_set_uint8(x_46, sizeof(void*)*3 + 1, x_45); +return x_46; } } case 7: { -uint8_t x_46; -x_46 = !lean_is_exclusive(x_1); -if (x_46 == 0) +uint8_t x_47; +x_47 = !lean_is_exclusive(x_1); +if (x_47 == 0) { -lean_object* x_47; -x_47 = lean_ctor_get(x_1, 2); -lean_dec(x_47); +lean_object* x_48; +x_48 = lean_ctor_get(x_1, 2); +lean_dec(x_48); lean_ctor_set(x_1, 2, x_2); return x_1; } else { -lean_object* x_48; lean_object* x_49; uint8_t x_50; lean_object* x_51; -x_48 = lean_ctor_get(x_1, 0); -x_49 = lean_ctor_get(x_1, 1); -x_50 = lean_ctor_get_uint8(x_1, sizeof(void*)*3); +lean_object* x_49; lean_object* x_50; uint8_t x_51; uint8_t x_52; lean_object* x_53; +x_49 = lean_ctor_get(x_1, 0); +x_50 = lean_ctor_get(x_1, 1); +x_51 = lean_ctor_get_uint8(x_1, sizeof(void*)*3); +x_52 = lean_ctor_get_uint8(x_1, sizeof(void*)*3 + 1); +lean_inc(x_50); lean_inc(x_49); -lean_inc(x_48); lean_dec(x_1); -x_51 = lean_alloc_ctor(7, 3, 1); -lean_ctor_set(x_51, 0, x_48); -lean_ctor_set(x_51, 1, x_49); -lean_ctor_set(x_51, 2, x_2); -lean_ctor_set_uint8(x_51, sizeof(void*)*3, x_50); -return x_51; +x_53 = lean_alloc_ctor(7, 3, 2); +lean_ctor_set(x_53, 0, x_49); +lean_ctor_set(x_53, 1, x_50); +lean_ctor_set(x_53, 2, x_2); +lean_ctor_set_uint8(x_53, sizeof(void*)*3, x_51); +lean_ctor_set_uint8(x_53, sizeof(void*)*3 + 1, x_52); +return x_53; } } case 8: { -uint8_t x_52; -x_52 = !lean_is_exclusive(x_1); -if (x_52 == 0) +uint8_t x_54; +x_54 = !lean_is_exclusive(x_1); +if (x_54 == 0) { -lean_object* x_53; -x_53 = lean_ctor_get(x_1, 1); -lean_dec(x_53); +lean_object* x_55; +x_55 = lean_ctor_get(x_1, 1); +lean_dec(x_55); lean_ctor_set(x_1, 1, x_2); return x_1; } else { -lean_object* x_54; lean_object* x_55; -x_54 = lean_ctor_get(x_1, 0); -lean_inc(x_54); +lean_object* x_56; lean_object* x_57; +x_56 = lean_ctor_get(x_1, 0); +lean_inc(x_56); lean_dec(x_1); -x_55 = lean_alloc_ctor(8, 2, 0); -lean_ctor_set(x_55, 0, x_54); -lean_ctor_set(x_55, 1, x_2); -return x_55; +x_57 = lean_alloc_ctor(8, 2, 0); +lean_ctor_set(x_57, 0, x_56); +lean_ctor_set(x_57, 1, x_2); +return x_57; } } case 9: { -uint8_t x_56; -x_56 = !lean_is_exclusive(x_1); -if (x_56 == 0) +uint8_t x_58; +x_58 = !lean_is_exclusive(x_1); +if (x_58 == 0) { -lean_object* x_57; -x_57 = lean_ctor_get(x_1, 1); -lean_dec(x_57); +lean_object* x_59; +x_59 = lean_ctor_get(x_1, 1); +lean_dec(x_59); lean_ctor_set(x_1, 1, x_2); return x_1; } else { -lean_object* x_58; lean_object* x_59; -x_58 = lean_ctor_get(x_1, 0); -lean_inc(x_58); +lean_object* x_60; lean_object* x_61; +x_60 = lean_ctor_get(x_1, 0); +lean_inc(x_60); lean_dec(x_1); -x_59 = lean_alloc_ctor(9, 2, 0); -lean_ctor_set(x_59, 0, x_58); -lean_ctor_set(x_59, 1, x_2); -return x_59; +x_61 = lean_alloc_ctor(9, 2, 0); +lean_ctor_set(x_61, 0, x_60); +lean_ctor_set(x_61, 1, x_2); +return x_61; } } default: @@ -12264,67 +12268,118 @@ case 6: { if (lean_obj_tag(x_3) == 6) { -lean_object* x_103; lean_object* x_104; uint8_t x_105; lean_object* x_106; lean_object* x_107; lean_object* x_108; uint8_t x_109; lean_object* x_110; uint8_t x_111; +lean_object* x_103; lean_object* x_104; uint8_t x_105; uint8_t x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; uint8_t x_110; uint8_t x_111; lean_object* x_112; uint8_t x_113; uint8_t x_120; x_103 = lean_ctor_get(x_2, 0); lean_inc(x_103); x_104 = lean_ctor_get(x_2, 1); lean_inc(x_104); x_105 = lean_ctor_get_uint8(x_2, sizeof(void*)*3); -x_106 = lean_ctor_get(x_2, 2); -lean_inc(x_106); -lean_dec(x_2); -x_107 = lean_ctor_get(x_3, 0); +x_106 = lean_ctor_get_uint8(x_2, sizeof(void*)*3 + 1); +x_107 = lean_ctor_get(x_2, 2); lean_inc(x_107); -x_108 = lean_ctor_get(x_3, 1); +lean_dec(x_2); +x_108 = lean_ctor_get(x_3, 0); lean_inc(x_108); -x_109 = lean_ctor_get_uint8(x_3, sizeof(void*)*3); -x_110 = lean_ctor_get(x_3, 2); -lean_inc(x_110); +x_109 = lean_ctor_get(x_3, 1); +lean_inc(x_109); +x_110 = lean_ctor_get_uint8(x_3, sizeof(void*)*3); +x_111 = lean_ctor_get_uint8(x_3, sizeof(void*)*3 + 1); +x_112 = lean_ctor_get(x_3, 2); +lean_inc(x_112); lean_dec(x_3); -x_111 = l_Lean_IR_VarId_alphaEqv(x_1, x_103, x_107); -lean_dec(x_107); -lean_dec(x_103); -if (x_111 == 0) -{ -uint8_t x_112; -lean_dec(x_110); +x_120 = l_Lean_IR_VarId_alphaEqv(x_1, x_103, x_108); lean_dec(x_108); -lean_dec(x_106); +lean_dec(x_103); +if (x_120 == 0) +{ +uint8_t x_121; +lean_dec(x_112); +lean_dec(x_109); +lean_dec(x_107); lean_dec(x_104); lean_dec(x_1); -x_112 = 0; -return x_112; +x_121 = 0; +return x_121; } else { -uint8_t x_113; -x_113 = lean_nat_dec_eq(x_104, x_108); -lean_dec(x_108); +uint8_t x_122; +x_122 = lean_nat_dec_eq(x_104, x_109); +lean_dec(x_109); lean_dec(x_104); +if (x_122 == 0) +{ +uint8_t x_123; +lean_dec(x_112); +lean_dec(x_107); +lean_dec(x_1); +x_123 = 0; +return x_123; +} +else +{ +if (x_105 == 0) +{ +if (x_110 == 0) +{ +uint8_t x_124; +x_124 = 1; +x_113 = x_124; +goto block_119; +} +else +{ +uint8_t x_125; +x_125 = 0; +x_113 = x_125; +goto block_119; +} +} +else +{ +if (x_110 == 0) +{ +uint8_t x_126; +x_126 = 0; +x_113 = x_126; +goto block_119; +} +else +{ +uint8_t x_127; +x_127 = 1; +x_113 = x_127; +goto block_119; +} +} +} +} +block_119: +{ if (x_113 == 0) { uint8_t x_114; -lean_dec(x_110); -lean_dec(x_106); +lean_dec(x_112); +lean_dec(x_107); lean_dec(x_1); x_114 = 0; return x_114; } else { -if (x_105 == 0) +if (x_106 == 0) { -if (x_109 == 0) +if (x_111 == 0) { -x_2 = x_106; -x_3 = x_110; +x_2 = x_107; +x_3 = x_112; goto _start; } else { uint8_t x_116; -lean_dec(x_110); -lean_dec(x_106); +lean_dec(x_112); +lean_dec(x_107); lean_dec(x_1); x_116 = 0; return x_116; @@ -12332,19 +12387,19 @@ return x_116; } else { -if (x_109 == 0) +if (x_111 == 0) { uint8_t x_117; -lean_dec(x_110); -lean_dec(x_106); +lean_dec(x_112); +lean_dec(x_107); lean_dec(x_1); x_117 = 0; return x_117; } else { -x_2 = x_106; -x_3 = x_110; +x_2 = x_107; +x_3 = x_112; goto _start; } } @@ -12353,99 +12408,150 @@ goto _start; } else { -uint8_t x_119; +uint8_t x_128; lean_dec(x_3); lean_dec(x_2); lean_dec(x_1); -x_119 = 0; -return x_119; +x_128 = 0; +return x_128; } } case 7: { if (lean_obj_tag(x_3) == 7) { -lean_object* x_120; lean_object* x_121; uint8_t x_122; lean_object* x_123; lean_object* x_124; lean_object* x_125; uint8_t x_126; lean_object* x_127; uint8_t x_128; -x_120 = lean_ctor_get(x_2, 0); -lean_inc(x_120); -x_121 = lean_ctor_get(x_2, 1); -lean_inc(x_121); -x_122 = lean_ctor_get_uint8(x_2, sizeof(void*)*3); -x_123 = lean_ctor_get(x_2, 2); -lean_inc(x_123); +lean_object* x_129; lean_object* x_130; uint8_t x_131; uint8_t x_132; lean_object* x_133; lean_object* x_134; lean_object* x_135; uint8_t x_136; uint8_t x_137; lean_object* x_138; uint8_t x_139; uint8_t x_146; +x_129 = lean_ctor_get(x_2, 0); +lean_inc(x_129); +x_130 = lean_ctor_get(x_2, 1); +lean_inc(x_130); +x_131 = lean_ctor_get_uint8(x_2, sizeof(void*)*3); +x_132 = lean_ctor_get_uint8(x_2, sizeof(void*)*3 + 1); +x_133 = lean_ctor_get(x_2, 2); +lean_inc(x_133); lean_dec(x_2); -x_124 = lean_ctor_get(x_3, 0); -lean_inc(x_124); -x_125 = lean_ctor_get(x_3, 1); -lean_inc(x_125); -x_126 = lean_ctor_get_uint8(x_3, sizeof(void*)*3); -x_127 = lean_ctor_get(x_3, 2); -lean_inc(x_127); +x_134 = lean_ctor_get(x_3, 0); +lean_inc(x_134); +x_135 = lean_ctor_get(x_3, 1); +lean_inc(x_135); +x_136 = lean_ctor_get_uint8(x_3, sizeof(void*)*3); +x_137 = lean_ctor_get_uint8(x_3, sizeof(void*)*3 + 1); +x_138 = lean_ctor_get(x_3, 2); +lean_inc(x_138); lean_dec(x_3); -x_128 = l_Lean_IR_VarId_alphaEqv(x_1, x_120, x_124); -lean_dec(x_124); -lean_dec(x_120); -if (x_128 == 0) +x_146 = l_Lean_IR_VarId_alphaEqv(x_1, x_129, x_134); +lean_dec(x_134); +lean_dec(x_129); +if (x_146 == 0) { -uint8_t x_129; -lean_dec(x_127); -lean_dec(x_125); -lean_dec(x_123); -lean_dec(x_121); +uint8_t x_147; +lean_dec(x_138); +lean_dec(x_135); +lean_dec(x_133); +lean_dec(x_130); lean_dec(x_1); -x_129 = 0; -return x_129; +x_147 = 0; +return x_147; } else { -uint8_t x_130; -x_130 = lean_nat_dec_eq(x_121, x_125); -lean_dec(x_125); -lean_dec(x_121); -if (x_130 == 0) +uint8_t x_148; +x_148 = lean_nat_dec_eq(x_130, x_135); +lean_dec(x_135); +lean_dec(x_130); +if (x_148 == 0) { -uint8_t x_131; -lean_dec(x_127); -lean_dec(x_123); +uint8_t x_149; +lean_dec(x_138); +lean_dec(x_133); lean_dec(x_1); -x_131 = 0; -return x_131; +x_149 = 0; +return x_149; } else { -if (x_122 == 0) +if (x_131 == 0) { -if (x_126 == 0) +if (x_136 == 0) { -x_2 = x_123; -x_3 = x_127; +uint8_t x_150; +x_150 = 1; +x_139 = x_150; +goto block_145; +} +else +{ +uint8_t x_151; +x_151 = 0; +x_139 = x_151; +goto block_145; +} +} +else +{ +if (x_136 == 0) +{ +uint8_t x_152; +x_152 = 0; +x_139 = x_152; +goto block_145; +} +else +{ +uint8_t x_153; +x_153 = 1; +x_139 = x_153; +goto block_145; +} +} +} +} +block_145: +{ +if (x_139 == 0) +{ +uint8_t x_140; +lean_dec(x_138); +lean_dec(x_133); +lean_dec(x_1); +x_140 = 0; +return x_140; +} +else +{ +if (x_132 == 0) +{ +if (x_137 == 0) +{ +x_2 = x_133; +x_3 = x_138; goto _start; } else { -uint8_t x_133; -lean_dec(x_127); -lean_dec(x_123); +uint8_t x_142; +lean_dec(x_138); +lean_dec(x_133); lean_dec(x_1); -x_133 = 0; -return x_133; +x_142 = 0; +return x_142; } } else { -if (x_126 == 0) +if (x_137 == 0) { -uint8_t x_134; -lean_dec(x_127); -lean_dec(x_123); +uint8_t x_143; +lean_dec(x_138); +lean_dec(x_133); lean_dec(x_1); -x_134 = 0; -return x_134; +x_143 = 0; +return x_143; } else { -x_2 = x_123; -x_3 = x_127; +x_2 = x_133; +x_3 = x_138; goto _start; } } @@ -12454,241 +12560,241 @@ goto _start; } else { -uint8_t x_136; +uint8_t x_154; lean_dec(x_3); lean_dec(x_2); lean_dec(x_1); -x_136 = 0; -return x_136; +x_154 = 0; +return x_154; } } case 8: { if (lean_obj_tag(x_3) == 8) { -lean_object* x_137; lean_object* x_138; lean_object* x_139; lean_object* x_140; uint8_t x_141; -x_137 = lean_ctor_get(x_2, 0); -lean_inc(x_137); -x_138 = lean_ctor_get(x_2, 1); -lean_inc(x_138); -lean_dec(x_2); -x_139 = lean_ctor_get(x_3, 0); -lean_inc(x_139); -x_140 = lean_ctor_get(x_3, 1); -lean_inc(x_140); -lean_dec(x_3); -x_141 = l_Lean_IR_VarId_alphaEqv(x_1, x_137, x_139); -lean_dec(x_139); -lean_dec(x_137); -if (x_141 == 0) -{ -uint8_t x_142; -lean_dec(x_140); -lean_dec(x_138); -lean_dec(x_1); -x_142 = 0; -return x_142; -} -else -{ -x_2 = x_138; -x_3 = x_140; -goto _start; -} -} -else -{ -uint8_t x_144; -lean_dec(x_3); -lean_dec(x_2); -lean_dec(x_1); -x_144 = 0; -return x_144; -} -} -case 9: -{ -if (lean_obj_tag(x_3) == 9) -{ -lean_object* x_145; lean_object* x_146; lean_object* x_147; lean_object* x_148; uint8_t x_149; -x_145 = lean_ctor_get(x_2, 0); -lean_inc(x_145); -x_146 = lean_ctor_get(x_2, 1); -lean_inc(x_146); -lean_dec(x_2); -x_147 = lean_ctor_get(x_3, 0); -lean_inc(x_147); -x_148 = lean_ctor_get(x_3, 1); -lean_inc(x_148); -lean_dec(x_3); -x_149 = l_Lean_KVMap_eqv(x_145, x_147); -lean_dec(x_147); -lean_dec(x_145); -if (x_149 == 0) -{ -uint8_t x_150; -lean_dec(x_148); -lean_dec(x_146); -lean_dec(x_1); -x_150 = 0; -return x_150; -} -else -{ -x_2 = x_146; -x_3 = x_148; -goto _start; -} -} -else -{ -uint8_t x_152; -lean_dec(x_3); -lean_dec(x_2); -lean_dec(x_1); -x_152 = 0; -return x_152; -} -} -case 10: -{ -if (lean_obj_tag(x_3) == 10) -{ -lean_object* x_153; lean_object* x_154; lean_object* x_155; lean_object* x_156; lean_object* x_157; lean_object* x_158; uint8_t x_159; -x_153 = lean_ctor_get(x_2, 0); -lean_inc(x_153); -x_154 = lean_ctor_get(x_2, 1); -lean_inc(x_154); -x_155 = lean_ctor_get(x_2, 2); +lean_object* x_155; lean_object* x_156; lean_object* x_157; lean_object* x_158; uint8_t x_159; +x_155 = lean_ctor_get(x_2, 0); lean_inc(x_155); -lean_dec(x_2); -x_156 = lean_ctor_get(x_3, 0); +x_156 = lean_ctor_get(x_2, 1); lean_inc(x_156); -x_157 = lean_ctor_get(x_3, 1); +lean_dec(x_2); +x_157 = lean_ctor_get(x_3, 0); lean_inc(x_157); -x_158 = lean_ctor_get(x_3, 2); +x_158 = lean_ctor_get(x_3, 1); lean_inc(x_158); lean_dec(x_3); -x_159 = lean_name_dec_eq(x_153, x_156); -lean_dec(x_156); -lean_dec(x_153); +x_159 = l_Lean_IR_VarId_alphaEqv(x_1, x_155, x_157); +lean_dec(x_157); +lean_dec(x_155); if (x_159 == 0) { uint8_t x_160; lean_dec(x_158); -lean_dec(x_157); -lean_dec(x_155); -lean_dec(x_154); +lean_dec(x_156); lean_dec(x_1); x_160 = 0; return x_160; } else { -uint8_t x_161; -x_161 = l_Lean_IR_VarId_alphaEqv(x_1, x_154, x_157); -lean_dec(x_157); -lean_dec(x_154); -if (x_161 == 0) +x_2 = x_156; +x_3 = x_158; +goto _start; +} +} +else { uint8_t x_162; -lean_dec(x_158); -lean_dec(x_155); +lean_dec(x_3); +lean_dec(x_2); lean_dec(x_1); x_162 = 0; return x_162; } +} +case 9: +{ +if (lean_obj_tag(x_3) == 9) +{ +lean_object* x_163; lean_object* x_164; lean_object* x_165; lean_object* x_166; uint8_t x_167; +x_163 = lean_ctor_get(x_2, 0); +lean_inc(x_163); +x_164 = lean_ctor_get(x_2, 1); +lean_inc(x_164); +lean_dec(x_2); +x_165 = lean_ctor_get(x_3, 0); +lean_inc(x_165); +x_166 = lean_ctor_get(x_3, 1); +lean_inc(x_166); +lean_dec(x_3); +x_167 = l_Lean_KVMap_eqv(x_163, x_165); +lean_dec(x_165); +lean_dec(x_163); +if (x_167 == 0) +{ +uint8_t x_168; +lean_dec(x_166); +lean_dec(x_164); +lean_dec(x_1); +x_168 = 0; +return x_168; +} else { -uint8_t x_163; -x_163 = l_Array_isEqv___at_Lean_IR_FnBody_alphaEqv___main___spec__1(x_1, x_155, x_158); -lean_dec(x_158); -lean_dec(x_155); -return x_163; -} +x_2 = x_164; +x_3 = x_166; +goto _start; } } else { -uint8_t x_164; +uint8_t x_170; lean_dec(x_3); lean_dec(x_2); lean_dec(x_1); -x_164 = 0; -return x_164; +x_170 = 0; +return x_170; +} +} +case 10: +{ +if (lean_obj_tag(x_3) == 10) +{ +lean_object* x_171; lean_object* x_172; lean_object* x_173; lean_object* x_174; lean_object* x_175; lean_object* x_176; uint8_t x_177; +x_171 = lean_ctor_get(x_2, 0); +lean_inc(x_171); +x_172 = lean_ctor_get(x_2, 1); +lean_inc(x_172); +x_173 = lean_ctor_get(x_2, 2); +lean_inc(x_173); +lean_dec(x_2); +x_174 = lean_ctor_get(x_3, 0); +lean_inc(x_174); +x_175 = lean_ctor_get(x_3, 1); +lean_inc(x_175); +x_176 = lean_ctor_get(x_3, 2); +lean_inc(x_176); +lean_dec(x_3); +x_177 = lean_name_dec_eq(x_171, x_174); +lean_dec(x_174); +lean_dec(x_171); +if (x_177 == 0) +{ +uint8_t x_178; +lean_dec(x_176); +lean_dec(x_175); +lean_dec(x_173); +lean_dec(x_172); +lean_dec(x_1); +x_178 = 0; +return x_178; +} +else +{ +uint8_t x_179; +x_179 = l_Lean_IR_VarId_alphaEqv(x_1, x_172, x_175); +lean_dec(x_175); +lean_dec(x_172); +if (x_179 == 0) +{ +uint8_t x_180; +lean_dec(x_176); +lean_dec(x_173); +lean_dec(x_1); +x_180 = 0; +return x_180; +} +else +{ +uint8_t x_181; +x_181 = l_Array_isEqv___at_Lean_IR_FnBody_alphaEqv___main___spec__1(x_1, x_173, x_176); +lean_dec(x_176); +lean_dec(x_173); +return x_181; +} +} +} +else +{ +uint8_t x_182; +lean_dec(x_3); +lean_dec(x_2); +lean_dec(x_1); +x_182 = 0; +return x_182; } } case 11: { if (lean_obj_tag(x_3) == 11) { -lean_object* x_165; lean_object* x_166; uint8_t x_167; -x_165 = lean_ctor_get(x_2, 0); -lean_inc(x_165); +lean_object* x_183; lean_object* x_184; uint8_t x_185; +x_183 = lean_ctor_get(x_2, 0); +lean_inc(x_183); lean_dec(x_2); -x_166 = lean_ctor_get(x_3, 0); -lean_inc(x_166); +x_184 = lean_ctor_get(x_3, 0); +lean_inc(x_184); lean_dec(x_3); -x_167 = l_Lean_IR_Arg_alphaEqv(x_1, x_165, x_166); -lean_dec(x_166); -lean_dec(x_165); +x_185 = l_Lean_IR_Arg_alphaEqv(x_1, x_183, x_184); +lean_dec(x_184); +lean_dec(x_183); lean_dec(x_1); -return x_167; +return x_185; } else { -uint8_t x_168; +uint8_t x_186; lean_dec(x_3); lean_dec(x_2); lean_dec(x_1); -x_168 = 0; -return x_168; +x_186 = 0; +return x_186; } } case 12: { if (lean_obj_tag(x_3) == 12) { -lean_object* x_169; lean_object* x_170; lean_object* x_171; lean_object* x_172; uint8_t x_173; -x_169 = lean_ctor_get(x_2, 0); -lean_inc(x_169); -x_170 = lean_ctor_get(x_2, 1); -lean_inc(x_170); +lean_object* x_187; lean_object* x_188; lean_object* x_189; lean_object* x_190; uint8_t x_191; +x_187 = lean_ctor_get(x_2, 0); +lean_inc(x_187); +x_188 = lean_ctor_get(x_2, 1); +lean_inc(x_188); lean_dec(x_2); -x_171 = lean_ctor_get(x_3, 0); -lean_inc(x_171); -x_172 = lean_ctor_get(x_3, 1); -lean_inc(x_172); +x_189 = lean_ctor_get(x_3, 0); +lean_inc(x_189); +x_190 = lean_ctor_get(x_3, 1); +lean_inc(x_190); lean_dec(x_3); -x_173 = lean_nat_dec_eq(x_169, x_171); -lean_dec(x_171); -lean_dec(x_169); -if (x_173 == 0) +x_191 = lean_nat_dec_eq(x_187, x_189); +lean_dec(x_189); +lean_dec(x_187); +if (x_191 == 0) { -uint8_t x_174; -lean_dec(x_172); -lean_dec(x_170); +uint8_t x_192; +lean_dec(x_190); +lean_dec(x_188); lean_dec(x_1); -x_174 = 0; -return x_174; +x_192 = 0; +return x_192; } else { -uint8_t x_175; -x_175 = l_Array_isEqv___at_Lean_IR_args_alphaEqv___spec__1(x_1, x_170, x_172); -lean_dec(x_172); -lean_dec(x_170); -return x_175; +uint8_t x_193; +x_193 = l_Array_isEqv___at_Lean_IR_args_alphaEqv___spec__1(x_1, x_188, x_190); +lean_dec(x_190); +lean_dec(x_188); +return x_193; } } else { -uint8_t x_176; +uint8_t x_194; lean_dec(x_3); lean_dec(x_2); lean_dec(x_1); -x_176 = 0; -return x_176; +x_194 = 0; +return x_194; } } default: @@ -12696,16 +12802,16 @@ default: lean_dec(x_1); if (lean_obj_tag(x_3) == 13) { -uint8_t x_177; -x_177 = 1; -return x_177; +uint8_t x_195; +x_195 = 1; +return x_195; } else { -uint8_t x_178; +uint8_t x_196; lean_dec(x_3); -x_178 = 0; -return x_178; +x_196 = 0; +return x_196; } } } diff --git a/src/stage0/init/lean/compiler/ir/emitc.c b/src/stage0/init/lean/compiler/ir/emitc.c index 2de85f0d04..5ff5dd4721 100644 --- a/src/stage0/init/lean/compiler/ir/emitc.c +++ b/src/stage0/init/lean/compiler/ir/emitc.c @@ -19592,419 +19592,493 @@ return x_111; } case 6: { -lean_object* x_112; lean_object* x_113; uint8_t x_114; lean_object* x_115; lean_object* x_116; -x_112 = lean_ctor_get(x_2, 0); -lean_inc(x_112); -x_113 = lean_ctor_get(x_2, 1); +uint8_t x_112; +x_112 = lean_ctor_get_uint8(x_2, sizeof(void*)*3 + 1); +if (x_112 == 0) +{ +lean_object* x_113; lean_object* x_114; uint8_t x_115; lean_object* x_116; lean_object* x_117; +x_113 = lean_ctor_get(x_2, 0); lean_inc(x_113); -x_114 = lean_ctor_get_uint8(x_2, sizeof(void*)*3); -x_115 = lean_ctor_get(x_2, 2); -lean_inc(x_115); +x_114 = lean_ctor_get(x_2, 1); +lean_inc(x_114); +x_115 = lean_ctor_get_uint8(x_2, sizeof(void*)*3); +x_116 = lean_ctor_get(x_2, 2); +lean_inc(x_116); lean_dec(x_2); -x_116 = l_Lean_IR_EmitC_emitInc(x_112, x_113, x_114, x_3, x_4); -if (lean_obj_tag(x_116) == 0) +x_117 = l_Lean_IR_EmitC_emitInc(x_113, x_114, x_115, x_3, x_4); +if (lean_obj_tag(x_117) == 0) { -uint8_t x_117; -x_117 = !lean_is_exclusive(x_116); -if (x_117 == 0) +uint8_t x_118; +x_118 = !lean_is_exclusive(x_117); +if (x_118 == 0) { -lean_object* x_118; lean_object* x_119; -x_118 = lean_ctor_get(x_116, 0); -lean_dec(x_118); -x_119 = lean_box(0); -lean_ctor_set(x_116, 0, x_119); -x_2 = x_115; -x_4 = x_116; +lean_object* x_119; lean_object* x_120; +x_119 = lean_ctor_get(x_117, 0); +lean_dec(x_119); +x_120 = lean_box(0); +lean_ctor_set(x_117, 0, x_120); +x_2 = x_116; +x_4 = x_117; goto _start; } else { -lean_object* x_121; lean_object* x_122; lean_object* x_123; -x_121 = lean_ctor_get(x_116, 1); -lean_inc(x_121); +lean_object* x_122; lean_object* x_123; lean_object* x_124; +x_122 = lean_ctor_get(x_117, 1); +lean_inc(x_122); +lean_dec(x_117); +x_123 = lean_box(0); +x_124 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_124, 0, x_123); +lean_ctor_set(x_124, 1, x_122); +x_2 = x_116; +x_4 = x_124; +goto _start; +} +} +else +{ +uint8_t x_126; lean_dec(x_116); -x_122 = lean_box(0); -x_123 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_123, 0, x_122); -lean_ctor_set(x_123, 1, x_121); -x_2 = x_115; -x_4 = x_123; -goto _start; -} -} -else -{ -uint8_t x_125; -lean_dec(x_115); lean_dec(x_3); lean_dec(x_1); -x_125 = !lean_is_exclusive(x_116); -if (x_125 == 0) +x_126 = !lean_is_exclusive(x_117); +if (x_126 == 0) { -return x_116; +return x_117; } else { -lean_object* x_126; lean_object* x_127; lean_object* x_128; -x_126 = lean_ctor_get(x_116, 0); -x_127 = lean_ctor_get(x_116, 1); +lean_object* x_127; lean_object* x_128; lean_object* x_129; +x_127 = lean_ctor_get(x_117, 0); +x_128 = lean_ctor_get(x_117, 1); +lean_inc(x_128); lean_inc(x_127); -lean_inc(x_126); -lean_dec(x_116); -x_128 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_128, 0, x_126); -lean_ctor_set(x_128, 1, x_127); -return x_128; +lean_dec(x_117); +x_129 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_129, 0, x_127); +lean_ctor_set(x_129, 1, x_128); +return x_129; +} +} +} +else +{ +lean_object* x_130; uint8_t x_131; +x_130 = lean_ctor_get(x_2, 2); +lean_inc(x_130); +lean_dec(x_2); +x_131 = !lean_is_exclusive(x_4); +if (x_131 == 0) +{ +lean_object* x_132; lean_object* x_133; +x_132 = lean_ctor_get(x_4, 0); +lean_dec(x_132); +x_133 = lean_box(0); +lean_ctor_set(x_4, 0, x_133); +x_2 = x_130; +goto _start; +} +else +{ +lean_object* x_135; lean_object* x_136; lean_object* x_137; +x_135 = lean_ctor_get(x_4, 1); +lean_inc(x_135); +lean_dec(x_4); +x_136 = lean_box(0); +x_137 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_137, 0, x_136); +lean_ctor_set(x_137, 1, x_135); +x_2 = x_130; +x_4 = x_137; +goto _start; } } } case 7: { -lean_object* x_129; lean_object* x_130; uint8_t x_131; lean_object* x_132; lean_object* x_133; -x_129 = lean_ctor_get(x_2, 0); -lean_inc(x_129); -x_130 = lean_ctor_get(x_2, 1); -lean_inc(x_130); -x_131 = lean_ctor_get_uint8(x_2, sizeof(void*)*3); -x_132 = lean_ctor_get(x_2, 2); -lean_inc(x_132); +uint8_t x_139; +x_139 = lean_ctor_get_uint8(x_2, sizeof(void*)*3 + 1); +if (x_139 == 0) +{ +lean_object* x_140; lean_object* x_141; uint8_t x_142; lean_object* x_143; lean_object* x_144; +x_140 = lean_ctor_get(x_2, 0); +lean_inc(x_140); +x_141 = lean_ctor_get(x_2, 1); +lean_inc(x_141); +x_142 = lean_ctor_get_uint8(x_2, sizeof(void*)*3); +x_143 = lean_ctor_get(x_2, 2); +lean_inc(x_143); lean_dec(x_2); -x_133 = l_Lean_IR_EmitC_emitDec(x_129, x_130, x_131, x_3, x_4); -if (lean_obj_tag(x_133) == 0) +x_144 = l_Lean_IR_EmitC_emitDec(x_140, x_141, x_142, x_3, x_4); +if (lean_obj_tag(x_144) == 0) { -uint8_t x_134; -x_134 = !lean_is_exclusive(x_133); -if (x_134 == 0) +uint8_t x_145; +x_145 = !lean_is_exclusive(x_144); +if (x_145 == 0) { -lean_object* x_135; lean_object* x_136; -x_135 = lean_ctor_get(x_133, 0); -lean_dec(x_135); -x_136 = lean_box(0); -lean_ctor_set(x_133, 0, x_136); -x_2 = x_132; -x_4 = x_133; +lean_object* x_146; lean_object* x_147; +x_146 = lean_ctor_get(x_144, 0); +lean_dec(x_146); +x_147 = lean_box(0); +lean_ctor_set(x_144, 0, x_147); +x_2 = x_143; +x_4 = x_144; goto _start; } else { -lean_object* x_138; lean_object* x_139; lean_object* x_140; -x_138 = lean_ctor_get(x_133, 1); -lean_inc(x_138); -lean_dec(x_133); -x_139 = lean_box(0); -x_140 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_140, 0, x_139); -lean_ctor_set(x_140, 1, x_138); -x_2 = x_132; -x_4 = x_140; +lean_object* x_149; lean_object* x_150; lean_object* x_151; +x_149 = lean_ctor_get(x_144, 1); +lean_inc(x_149); +lean_dec(x_144); +x_150 = lean_box(0); +x_151 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_151, 0, x_150); +lean_ctor_set(x_151, 1, x_149); +x_2 = x_143; +x_4 = x_151; goto _start; } } else { -uint8_t x_142; -lean_dec(x_132); +uint8_t x_153; +lean_dec(x_143); lean_dec(x_3); lean_dec(x_1); -x_142 = !lean_is_exclusive(x_133); -if (x_142 == 0) +x_153 = !lean_is_exclusive(x_144); +if (x_153 == 0) { -return x_133; +return x_144; } else { -lean_object* x_143; lean_object* x_144; lean_object* x_145; -x_143 = lean_ctor_get(x_133, 0); -x_144 = lean_ctor_get(x_133, 1); -lean_inc(x_144); -lean_inc(x_143); -lean_dec(x_133); -x_145 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_145, 0, x_143); -lean_ctor_set(x_145, 1, x_144); -return x_145; +lean_object* x_154; lean_object* x_155; lean_object* x_156; +x_154 = lean_ctor_get(x_144, 0); +x_155 = lean_ctor_get(x_144, 1); +lean_inc(x_155); +lean_inc(x_154); +lean_dec(x_144); +x_156 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_156, 0, x_154); +lean_ctor_set(x_156, 1, x_155); +return x_156; +} +} +} +else +{ +lean_object* x_157; uint8_t x_158; +x_157 = lean_ctor_get(x_2, 2); +lean_inc(x_157); +lean_dec(x_2); +x_158 = !lean_is_exclusive(x_4); +if (x_158 == 0) +{ +lean_object* x_159; lean_object* x_160; +x_159 = lean_ctor_get(x_4, 0); +lean_dec(x_159); +x_160 = lean_box(0); +lean_ctor_set(x_4, 0, x_160); +x_2 = x_157; +goto _start; +} +else +{ +lean_object* x_162; lean_object* x_163; lean_object* x_164; +x_162 = lean_ctor_get(x_4, 1); +lean_inc(x_162); +lean_dec(x_4); +x_163 = lean_box(0); +x_164 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_164, 0, x_163); +lean_ctor_set(x_164, 1, x_162); +x_2 = x_157; +x_4 = x_164; +goto _start; } } } case 8: { -lean_object* x_146; lean_object* x_147; lean_object* x_148; -x_146 = lean_ctor_get(x_2, 0); -lean_inc(x_146); -x_147 = lean_ctor_get(x_2, 1); -lean_inc(x_147); +lean_object* x_166; lean_object* x_167; lean_object* x_168; +x_166 = lean_ctor_get(x_2, 0); +lean_inc(x_166); +x_167 = lean_ctor_get(x_2, 1); +lean_inc(x_167); lean_dec(x_2); -x_148 = l_Lean_IR_EmitC_emitDel(x_146, x_3, x_4); -if (lean_obj_tag(x_148) == 0) +x_168 = l_Lean_IR_EmitC_emitDel(x_166, x_3, x_4); +if (lean_obj_tag(x_168) == 0) { -uint8_t x_149; -x_149 = !lean_is_exclusive(x_148); -if (x_149 == 0) +uint8_t x_169; +x_169 = !lean_is_exclusive(x_168); +if (x_169 == 0) { -lean_object* x_150; lean_object* x_151; -x_150 = lean_ctor_get(x_148, 0); -lean_dec(x_150); -x_151 = lean_box(0); -lean_ctor_set(x_148, 0, x_151); -x_2 = x_147; -x_4 = x_148; +lean_object* x_170; lean_object* x_171; +x_170 = lean_ctor_get(x_168, 0); +lean_dec(x_170); +x_171 = lean_box(0); +lean_ctor_set(x_168, 0, x_171); +x_2 = x_167; +x_4 = x_168; goto _start; } else { -lean_object* x_153; lean_object* x_154; lean_object* x_155; -x_153 = lean_ctor_get(x_148, 1); -lean_inc(x_153); -lean_dec(x_148); -x_154 = lean_box(0); -x_155 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_155, 0, x_154); -lean_ctor_set(x_155, 1, x_153); -x_2 = x_147; -x_4 = x_155; +lean_object* x_173; lean_object* x_174; lean_object* x_175; +x_173 = lean_ctor_get(x_168, 1); +lean_inc(x_173); +lean_dec(x_168); +x_174 = lean_box(0); +x_175 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_175, 0, x_174); +lean_ctor_set(x_175, 1, x_173); +x_2 = x_167; +x_4 = x_175; goto _start; } } else { -uint8_t x_157; -lean_dec(x_147); +uint8_t x_177; +lean_dec(x_167); lean_dec(x_3); lean_dec(x_1); -x_157 = !lean_is_exclusive(x_148); -if (x_157 == 0) +x_177 = !lean_is_exclusive(x_168); +if (x_177 == 0) { -return x_148; +return x_168; } else { -lean_object* x_158; lean_object* x_159; lean_object* x_160; -x_158 = lean_ctor_get(x_148, 0); -x_159 = lean_ctor_get(x_148, 1); -lean_inc(x_159); -lean_inc(x_158); -lean_dec(x_148); -x_160 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_160, 0, x_158); -lean_ctor_set(x_160, 1, x_159); -return x_160; +lean_object* x_178; lean_object* x_179; lean_object* x_180; +x_178 = lean_ctor_get(x_168, 0); +x_179 = lean_ctor_get(x_168, 1); +lean_inc(x_179); +lean_inc(x_178); +lean_dec(x_168); +x_180 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_180, 0, x_178); +lean_ctor_set(x_180, 1, x_179); +return x_180; } } } case 9: { -lean_object* x_161; -x_161 = lean_ctor_get(x_2, 1); -lean_inc(x_161); +lean_object* x_181; +x_181 = lean_ctor_get(x_2, 1); +lean_inc(x_181); lean_dec(x_2); -x_2 = x_161; +x_2 = x_181; goto _start; } case 10: { -lean_object* x_163; lean_object* x_164; lean_object* x_165; -x_163 = lean_ctor_get(x_2, 1); -lean_inc(x_163); -x_164 = lean_ctor_get(x_2, 2); -lean_inc(x_164); +lean_object* x_183; lean_object* x_184; lean_object* x_185; +x_183 = lean_ctor_get(x_2, 1); +lean_inc(x_183); +x_184 = lean_ctor_get(x_2, 2); +lean_inc(x_184); lean_dec(x_2); -x_165 = l_Lean_IR_EmitC_emitCase(x_1, x_163, x_164, x_3, x_4); -return x_165; +x_185 = l_Lean_IR_EmitC_emitCase(x_1, x_183, x_184, x_3, x_4); +return x_185; } case 11: { -lean_object* x_166; uint8_t x_167; +lean_object* x_186; uint8_t x_187; lean_dec(x_1); -x_166 = lean_ctor_get(x_2, 0); -lean_inc(x_166); +x_186 = lean_ctor_get(x_2, 0); +lean_inc(x_186); lean_dec(x_2); -x_167 = !lean_is_exclusive(x_4); -if (x_167 == 0) -{ -lean_object* x_168; lean_object* x_169; lean_object* x_170; lean_object* x_171; lean_object* x_172; lean_object* x_173; -x_168 = lean_ctor_get(x_4, 1); -x_169 = lean_ctor_get(x_4, 0); -lean_dec(x_169); -x_170 = l_Lean_IR_EmitC_emitBlock___main___closed__1; -x_171 = lean_string_append(x_168, x_170); -x_172 = lean_box(0); -lean_ctor_set(x_4, 1, x_171); -lean_ctor_set(x_4, 0, x_172); -x_173 = l_Lean_IR_EmitC_emitArg(x_166, x_3, x_4); -lean_dec(x_3); -if (lean_obj_tag(x_173) == 0) -{ -uint8_t x_174; -x_174 = !lean_is_exclusive(x_173); -if (x_174 == 0) -{ -lean_object* x_175; lean_object* x_176; lean_object* x_177; lean_object* x_178; lean_object* x_179; lean_object* x_180; -x_175 = lean_ctor_get(x_173, 1); -x_176 = lean_ctor_get(x_173, 0); -lean_dec(x_176); -x_177 = l_Lean_IR_formatFnBody___main___closed__3; -x_178 = lean_string_append(x_175, x_177); -x_179 = l_IO_println___rarg___closed__1; -x_180 = lean_string_append(x_178, x_179); -lean_ctor_set(x_173, 1, x_180); -lean_ctor_set(x_173, 0, x_172); -return x_173; -} -else -{ -lean_object* x_181; lean_object* x_182; lean_object* x_183; lean_object* x_184; lean_object* x_185; lean_object* x_186; -x_181 = lean_ctor_get(x_173, 1); -lean_inc(x_181); -lean_dec(x_173); -x_182 = l_Lean_IR_formatFnBody___main___closed__3; -x_183 = lean_string_append(x_181, x_182); -x_184 = l_IO_println___rarg___closed__1; -x_185 = lean_string_append(x_183, x_184); -x_186 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_186, 0, x_172); -lean_ctor_set(x_186, 1, x_185); -return x_186; -} -} -else -{ -uint8_t x_187; -x_187 = !lean_is_exclusive(x_173); +x_187 = !lean_is_exclusive(x_4); if (x_187 == 0) { -return x_173; -} -else -{ -lean_object* x_188; lean_object* x_189; lean_object* x_190; -x_188 = lean_ctor_get(x_173, 0); -x_189 = lean_ctor_get(x_173, 1); -lean_inc(x_189); -lean_inc(x_188); -lean_dec(x_173); -x_190 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_190, 0, x_188); -lean_ctor_set(x_190, 1, x_189); -return x_190; -} -} -} -else -{ -lean_object* x_191; lean_object* x_192; lean_object* x_193; lean_object* x_194; lean_object* x_195; lean_object* x_196; -x_191 = lean_ctor_get(x_4, 1); -lean_inc(x_191); -lean_dec(x_4); -x_192 = l_Lean_IR_EmitC_emitBlock___main___closed__1; -x_193 = lean_string_append(x_191, x_192); -x_194 = lean_box(0); -x_195 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_195, 0, x_194); -lean_ctor_set(x_195, 1, x_193); -x_196 = l_Lean_IR_EmitC_emitArg(x_166, x_3, x_195); +lean_object* x_188; lean_object* x_189; lean_object* x_190; lean_object* x_191; lean_object* x_192; lean_object* x_193; +x_188 = lean_ctor_get(x_4, 1); +x_189 = lean_ctor_get(x_4, 0); +lean_dec(x_189); +x_190 = l_Lean_IR_EmitC_emitBlock___main___closed__1; +x_191 = lean_string_append(x_188, x_190); +x_192 = lean_box(0); +lean_ctor_set(x_4, 1, x_191); +lean_ctor_set(x_4, 0, x_192); +x_193 = l_Lean_IR_EmitC_emitArg(x_186, x_3, x_4); lean_dec(x_3); -if (lean_obj_tag(x_196) == 0) +if (lean_obj_tag(x_193) == 0) { -lean_object* x_197; lean_object* x_198; lean_object* x_199; lean_object* x_200; lean_object* x_201; lean_object* x_202; lean_object* x_203; -x_197 = lean_ctor_get(x_196, 1); -lean_inc(x_197); -if (lean_is_exclusive(x_196)) { - lean_ctor_release(x_196, 0); - lean_ctor_release(x_196, 1); - x_198 = x_196; -} else { - lean_dec_ref(x_196); - x_198 = lean_box(0); -} -x_199 = l_Lean_IR_formatFnBody___main___closed__3; -x_200 = lean_string_append(x_197, x_199); -x_201 = l_IO_println___rarg___closed__1; -x_202 = lean_string_append(x_200, x_201); -if (lean_is_scalar(x_198)) { - x_203 = lean_alloc_ctor(0, 2, 0); -} else { - x_203 = x_198; -} -lean_ctor_set(x_203, 0, x_194); -lean_ctor_set(x_203, 1, x_202); -return x_203; +uint8_t x_194; +x_194 = !lean_is_exclusive(x_193); +if (x_194 == 0) +{ +lean_object* x_195; lean_object* x_196; lean_object* x_197; lean_object* x_198; lean_object* x_199; lean_object* x_200; +x_195 = lean_ctor_get(x_193, 1); +x_196 = lean_ctor_get(x_193, 0); +lean_dec(x_196); +x_197 = l_Lean_IR_formatFnBody___main___closed__3; +x_198 = lean_string_append(x_195, x_197); +x_199 = l_IO_println___rarg___closed__1; +x_200 = lean_string_append(x_198, x_199); +lean_ctor_set(x_193, 1, x_200); +lean_ctor_set(x_193, 0, x_192); +return x_193; } else { -lean_object* x_204; lean_object* x_205; lean_object* x_206; lean_object* x_207; -x_204 = lean_ctor_get(x_196, 0); -lean_inc(x_204); -x_205 = lean_ctor_get(x_196, 1); -lean_inc(x_205); -if (lean_is_exclusive(x_196)) { - lean_ctor_release(x_196, 0); - lean_ctor_release(x_196, 1); - x_206 = x_196; -} else { - lean_dec_ref(x_196); - x_206 = lean_box(0); +lean_object* x_201; lean_object* x_202; lean_object* x_203; lean_object* x_204; lean_object* x_205; lean_object* x_206; +x_201 = lean_ctor_get(x_193, 1); +lean_inc(x_201); +lean_dec(x_193); +x_202 = l_Lean_IR_formatFnBody___main___closed__3; +x_203 = lean_string_append(x_201, x_202); +x_204 = l_IO_println___rarg___closed__1; +x_205 = lean_string_append(x_203, x_204); +x_206 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_206, 0, x_192); +lean_ctor_set(x_206, 1, x_205); +return x_206; } -if (lean_is_scalar(x_206)) { - x_207 = lean_alloc_ctor(1, 2, 0); -} else { - x_207 = x_206; } -lean_ctor_set(x_207, 0, x_204); -lean_ctor_set(x_207, 1, x_205); -return x_207; +else +{ +uint8_t x_207; +x_207 = !lean_is_exclusive(x_193); +if (x_207 == 0) +{ +return x_193; +} +else +{ +lean_object* x_208; lean_object* x_209; lean_object* x_210; +x_208 = lean_ctor_get(x_193, 0); +x_209 = lean_ctor_get(x_193, 1); +lean_inc(x_209); +lean_inc(x_208); +lean_dec(x_193); +x_210 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_210, 0, x_208); +lean_ctor_set(x_210, 1, x_209); +return x_210; +} +} +} +else +{ +lean_object* x_211; lean_object* x_212; lean_object* x_213; lean_object* x_214; lean_object* x_215; lean_object* x_216; +x_211 = lean_ctor_get(x_4, 1); +lean_inc(x_211); +lean_dec(x_4); +x_212 = l_Lean_IR_EmitC_emitBlock___main___closed__1; +x_213 = lean_string_append(x_211, x_212); +x_214 = lean_box(0); +x_215 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_215, 0, x_214); +lean_ctor_set(x_215, 1, x_213); +x_216 = l_Lean_IR_EmitC_emitArg(x_186, x_3, x_215); +lean_dec(x_3); +if (lean_obj_tag(x_216) == 0) +{ +lean_object* x_217; lean_object* x_218; lean_object* x_219; lean_object* x_220; lean_object* x_221; lean_object* x_222; lean_object* x_223; +x_217 = lean_ctor_get(x_216, 1); +lean_inc(x_217); +if (lean_is_exclusive(x_216)) { + lean_ctor_release(x_216, 0); + lean_ctor_release(x_216, 1); + x_218 = x_216; +} else { + lean_dec_ref(x_216); + x_218 = lean_box(0); +} +x_219 = l_Lean_IR_formatFnBody___main___closed__3; +x_220 = lean_string_append(x_217, x_219); +x_221 = l_IO_println___rarg___closed__1; +x_222 = lean_string_append(x_220, x_221); +if (lean_is_scalar(x_218)) { + x_223 = lean_alloc_ctor(0, 2, 0); +} else { + x_223 = x_218; +} +lean_ctor_set(x_223, 0, x_214); +lean_ctor_set(x_223, 1, x_222); +return x_223; +} +else +{ +lean_object* x_224; lean_object* x_225; lean_object* x_226; lean_object* x_227; +x_224 = lean_ctor_get(x_216, 0); +lean_inc(x_224); +x_225 = lean_ctor_get(x_216, 1); +lean_inc(x_225); +if (lean_is_exclusive(x_216)) { + lean_ctor_release(x_216, 0); + lean_ctor_release(x_216, 1); + x_226 = x_216; +} else { + lean_dec_ref(x_216); + x_226 = lean_box(0); +} +if (lean_is_scalar(x_226)) { + x_227 = lean_alloc_ctor(1, 2, 0); +} else { + x_227 = x_226; +} +lean_ctor_set(x_227, 0, x_224); +lean_ctor_set(x_227, 1, x_225); +return x_227; } } } case 12: { -lean_object* x_208; lean_object* x_209; lean_object* x_210; +lean_object* x_228; lean_object* x_229; lean_object* x_230; lean_dec(x_1); -x_208 = lean_ctor_get(x_2, 0); -lean_inc(x_208); -x_209 = lean_ctor_get(x_2, 1); -lean_inc(x_209); +x_228 = lean_ctor_get(x_2, 0); +lean_inc(x_228); +x_229 = lean_ctor_get(x_2, 1); +lean_inc(x_229); lean_dec(x_2); -x_210 = l_Lean_IR_EmitC_emitJmp(x_208, x_209, x_3, x_4); +x_230 = l_Lean_IR_EmitC_emitJmp(x_228, x_229, x_3, x_4); lean_dec(x_3); -lean_dec(x_209); -return x_210; +lean_dec(x_229); +return x_230; } default: { -uint8_t x_211; +uint8_t x_231; lean_dec(x_3); lean_dec(x_1); -x_211 = !lean_is_exclusive(x_4); -if (x_211 == 0) +x_231 = !lean_is_exclusive(x_4); +if (x_231 == 0) { -lean_object* x_212; lean_object* x_213; lean_object* x_214; lean_object* x_215; lean_object* x_216; lean_object* x_217; lean_object* x_218; -x_212 = lean_ctor_get(x_4, 1); -x_213 = lean_ctor_get(x_4, 0); -lean_dec(x_213); -x_214 = l_Lean_IR_EmitC_emitBlock___main___closed__2; -x_215 = lean_string_append(x_212, x_214); -x_216 = l_IO_println___rarg___closed__1; -x_217 = lean_string_append(x_215, x_216); -x_218 = lean_box(0); -lean_ctor_set(x_4, 1, x_217); -lean_ctor_set(x_4, 0, x_218); +lean_object* x_232; lean_object* x_233; lean_object* x_234; lean_object* x_235; lean_object* x_236; lean_object* x_237; lean_object* x_238; +x_232 = lean_ctor_get(x_4, 1); +x_233 = lean_ctor_get(x_4, 0); +lean_dec(x_233); +x_234 = l_Lean_IR_EmitC_emitBlock___main___closed__2; +x_235 = lean_string_append(x_232, x_234); +x_236 = l_IO_println___rarg___closed__1; +x_237 = lean_string_append(x_235, x_236); +x_238 = lean_box(0); +lean_ctor_set(x_4, 1, x_237); +lean_ctor_set(x_4, 0, x_238); return x_4; } else { -lean_object* x_219; lean_object* x_220; lean_object* x_221; lean_object* x_222; lean_object* x_223; lean_object* x_224; lean_object* x_225; -x_219 = lean_ctor_get(x_4, 1); -lean_inc(x_219); +lean_object* x_239; lean_object* x_240; lean_object* x_241; lean_object* x_242; lean_object* x_243; lean_object* x_244; lean_object* x_245; +x_239 = lean_ctor_get(x_4, 1); +lean_inc(x_239); lean_dec(x_4); -x_220 = l_Lean_IR_EmitC_emitBlock___main___closed__2; -x_221 = lean_string_append(x_219, x_220); -x_222 = l_IO_println___rarg___closed__1; -x_223 = lean_string_append(x_221, x_222); -x_224 = lean_box(0); -x_225 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_225, 0, x_224); -lean_ctor_set(x_225, 1, x_223); -return x_225; +x_240 = l_Lean_IR_EmitC_emitBlock___main___closed__2; +x_241 = lean_string_append(x_239, x_240); +x_242 = l_IO_println___rarg___closed__1; +x_243 = lean_string_append(x_241, x_242); +x_244 = lean_box(0); +x_245 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_245, 0, x_244); +lean_ctor_set(x_245, 1, x_243); +return x_245; } } } diff --git a/src/stage0/init/lean/compiler/ir/expandresetreuse.c b/src/stage0/init/lean/compiler/ir/expandresetreuse.c index b6405e3851..e28641ee16 100644 --- a/src/stage0/init/lean/compiler/ir/expandresetreuse.c +++ b/src/stage0/init/lean/compiler/ir/expandresetreuse.c @@ -941,207 +941,309 @@ goto block_10; } case 6: { -lean_object* x_22; lean_object* x_23; uint8_t x_24; lean_object* x_25; uint8_t x_26; -x_22 = lean_ctor_get(x_19, 0); -lean_inc(x_22); -x_23 = lean_ctor_get(x_19, 1); -lean_inc(x_23); -x_24 = lean_ctor_get_uint8(x_19, sizeof(void*)*3); -lean_dec(x_19); -x_25 = lean_unsigned_to_nat(0u); -x_26 = lean_nat_dec_eq(x_23, x_25); -if (x_26 == 0) +uint8_t x_22; +x_22 = !lean_is_exclusive(x_19); +if (x_22 == 0) { -lean_object* x_27; lean_object* x_28; lean_object* x_29; -x_27 = lean_nat_sub(x_16, x_17); +lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; uint8_t x_27; +x_23 = lean_ctor_get(x_19, 0); +x_24 = lean_ctor_get(x_19, 1); +x_25 = lean_ctor_get(x_19, 2); +lean_dec(x_25); +x_26 = lean_unsigned_to_nat(0u); +x_27 = lean_nat_dec_eq(x_24, x_26); +if (x_27 == 0) +{ +lean_object* x_28; lean_object* x_29; lean_object* x_30; +x_28 = lean_nat_sub(x_16, x_17); lean_dec(x_16); -x_28 = l_Lean_IR_Inhabited; -x_29 = lean_array_get(x_28, x_2, x_27); -lean_dec(x_27); -if (lean_obj_tag(x_29) == 0) +x_29 = l_Lean_IR_Inhabited; +x_30 = lean_array_get(x_29, x_2, x_28); +lean_dec(x_28); +if (lean_obj_tag(x_30) == 0) { -lean_object* x_30; -x_30 = lean_ctor_get(x_29, 1); -lean_inc(x_30); -if (lean_obj_tag(x_30) == 3) -{ -lean_object* x_31; lean_object* x_32; lean_object* x_33; uint8_t x_34; -x_31 = lean_ctor_get(x_29, 0); +lean_object* x_31; +x_31 = lean_ctor_get(x_30, 1); lean_inc(x_31); +if (lean_obj_tag(x_31) == 3) +{ +lean_object* x_32; lean_object* x_33; lean_object* x_34; uint8_t x_35; x_32 = lean_ctor_get(x_30, 0); lean_inc(x_32); -x_33 = lean_ctor_get(x_30, 1); +x_33 = lean_ctor_get(x_31, 0); lean_inc(x_33); -lean_dec(x_30); -x_34 = lean_nat_dec_eq(x_31, x_22); +x_34 = lean_ctor_get(x_31, 1); +lean_inc(x_34); lean_dec(x_31); -if (x_34 == 0) +x_35 = lean_nat_dec_eq(x_32, x_23); +lean_dec(x_32); +if (x_35 == 0) { -lean_object* x_35; +lean_object* x_36; +lean_dec(x_34); lean_dec(x_33); -lean_dec(x_32); -lean_dec(x_29); -lean_dec(x_23); -lean_dec(x_22); -x_35 = lean_box(0); -x_5 = x_35; -goto block_10; -} -else -{ -uint8_t x_36; -x_36 = lean_nat_dec_eq(x_1, x_33); -lean_dec(x_33); -if (x_36 == 0) -{ -lean_object* x_37; -lean_dec(x_32); -lean_dec(x_29); -lean_dec(x_23); -lean_dec(x_22); -x_37 = lean_box(0); -x_5 = x_37; -goto block_10; -} -else -{ -lean_object* x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; uint8_t x_43; -x_38 = lean_array_pop(x_2); -x_39 = lean_array_pop(x_38); -lean_inc(x_22); -x_40 = lean_alloc_ctor(1, 1, 0); -lean_ctor_set(x_40, 0, x_22); -x_41 = lean_array_set(x_3, x_32, x_40); -lean_dec(x_32); -lean_inc(x_29); -x_42 = lean_array_push(x_4, x_29); -x_43 = !lean_is_exclusive(x_29); -if (x_43 == 0) -{ -lean_object* x_44; lean_object* x_45; lean_object* x_46; lean_object* x_47; uint8_t x_48; -x_44 = lean_ctor_get(x_29, 2); -lean_dec(x_44); -x_45 = lean_ctor_get(x_29, 1); -lean_dec(x_45); -x_46 = lean_ctor_get(x_29, 0); -lean_dec(x_46); -x_47 = lean_unsigned_to_nat(1u); -x_48 = lean_nat_dec_eq(x_23, x_47); -if (x_48 == 0) -{ -lean_object* x_49; lean_object* x_50; lean_object* x_51; -x_49 = lean_nat_sub(x_23, x_47); -lean_dec(x_23); -x_50 = lean_box(13); -lean_ctor_set_tag(x_29, 6); -lean_ctor_set(x_29, 2, x_50); -lean_ctor_set(x_29, 1, x_49); -lean_ctor_set(x_29, 0, x_22); -lean_ctor_set_uint8(x_29, sizeof(void*)*3, x_24); -x_51 = lean_array_push(x_42, x_29); -x_2 = x_39; -x_3 = x_41; -x_4 = x_51; -goto _start; -} -else -{ -lean_free_object(x_29); -lean_dec(x_23); -lean_dec(x_22); -x_2 = x_39; -x_3 = x_41; -x_4 = x_42; -goto _start; -} -} -else -{ -lean_object* x_54; uint8_t x_55; -lean_dec(x_29); -x_54 = lean_unsigned_to_nat(1u); -x_55 = lean_nat_dec_eq(x_23, x_54); -if (x_55 == 0) -{ -lean_object* x_56; lean_object* x_57; lean_object* x_58; lean_object* x_59; -x_56 = lean_nat_sub(x_23, x_54); -lean_dec(x_23); -x_57 = lean_box(13); -x_58 = lean_alloc_ctor(6, 3, 1); -lean_ctor_set(x_58, 0, x_22); -lean_ctor_set(x_58, 1, x_56); -lean_ctor_set(x_58, 2, x_57); -lean_ctor_set_uint8(x_58, sizeof(void*)*3, x_24); -x_59 = lean_array_push(x_42, x_58); -x_2 = x_39; -x_3 = x_41; -x_4 = x_59; -goto _start; -} -else -{ -lean_dec(x_23); -lean_dec(x_22); -x_2 = x_39; -x_3 = x_41; -x_4 = x_42; -goto _start; -} -} -} -} -} -else -{ -lean_object* x_62; lean_dec(x_30); -lean_dec(x_29); +lean_free_object(x_19); +lean_dec(x_24); lean_dec(x_23); -lean_dec(x_22); -x_62 = lean_box(0); -x_5 = x_62; +x_36 = lean_box(0); +x_5 = x_36; +goto block_10; +} +else +{ +uint8_t x_37; +x_37 = lean_nat_dec_eq(x_1, x_34); +lean_dec(x_34); +if (x_37 == 0) +{ +lean_object* x_38; +lean_dec(x_33); +lean_dec(x_30); +lean_free_object(x_19); +lean_dec(x_24); +lean_dec(x_23); +x_38 = lean_box(0); +x_5 = x_38; +goto block_10; +} +else +{ +lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44; uint8_t x_45; +x_39 = lean_array_pop(x_2); +x_40 = lean_array_pop(x_39); +lean_inc(x_23); +x_41 = lean_alloc_ctor(1, 1, 0); +lean_ctor_set(x_41, 0, x_23); +x_42 = lean_array_set(x_3, x_33, x_41); +lean_dec(x_33); +x_43 = lean_array_push(x_4, x_30); +x_44 = lean_unsigned_to_nat(1u); +x_45 = lean_nat_dec_eq(x_24, x_44); +if (x_45 == 0) +{ +lean_object* x_46; lean_object* x_47; lean_object* x_48; +x_46 = lean_nat_sub(x_24, x_44); +lean_dec(x_24); +x_47 = lean_box(13); +lean_ctor_set(x_19, 2, x_47); +lean_ctor_set(x_19, 1, x_46); +x_48 = lean_array_push(x_43, x_19); +x_2 = x_40; +x_3 = x_42; +x_4 = x_48; +goto _start; +} +else +{ +lean_free_object(x_19); +lean_dec(x_24); +lean_dec(x_23); +x_2 = x_40; +x_3 = x_42; +x_4 = x_43; +goto _start; +} +} +} +} +else +{ +lean_object* x_51; +lean_dec(x_31); +lean_dec(x_30); +lean_free_object(x_19); +lean_dec(x_24); +lean_dec(x_23); +x_51 = lean_box(0); +x_5 = x_51; goto block_10; } } else { +lean_object* x_52; +lean_dec(x_30); +lean_free_object(x_19); +lean_dec(x_24); +lean_dec(x_23); +x_52 = lean_box(0); +x_5 = x_52; +goto block_10; +} +} +else +{ +lean_object* x_53; +lean_free_object(x_19); +lean_dec(x_24); +lean_dec(x_23); +lean_dec(x_16); +x_53 = lean_box(0); +x_5 = x_53; +goto block_10; +} +} +else +{ +lean_object* x_54; lean_object* x_55; uint8_t x_56; uint8_t x_57; lean_object* x_58; uint8_t x_59; +x_54 = lean_ctor_get(x_19, 0); +x_55 = lean_ctor_get(x_19, 1); +x_56 = lean_ctor_get_uint8(x_19, sizeof(void*)*3); +x_57 = lean_ctor_get_uint8(x_19, sizeof(void*)*3 + 1); +lean_inc(x_55); +lean_inc(x_54); +lean_dec(x_19); +x_58 = lean_unsigned_to_nat(0u); +x_59 = lean_nat_dec_eq(x_55, x_58); +if (x_59 == 0) +{ +lean_object* x_60; lean_object* x_61; lean_object* x_62; +x_60 = lean_nat_sub(x_16, x_17); +lean_dec(x_16); +x_61 = l_Lean_IR_Inhabited; +x_62 = lean_array_get(x_61, x_2, x_60); +lean_dec(x_60); +if (lean_obj_tag(x_62) == 0) +{ lean_object* x_63; -lean_dec(x_29); -lean_dec(x_23); -lean_dec(x_22); -x_63 = lean_box(0); -x_5 = x_63; +x_63 = lean_ctor_get(x_62, 1); +lean_inc(x_63); +if (lean_obj_tag(x_63) == 3) +{ +lean_object* x_64; lean_object* x_65; lean_object* x_66; uint8_t x_67; +x_64 = lean_ctor_get(x_62, 0); +lean_inc(x_64); +x_65 = lean_ctor_get(x_63, 0); +lean_inc(x_65); +x_66 = lean_ctor_get(x_63, 1); +lean_inc(x_66); +lean_dec(x_63); +x_67 = lean_nat_dec_eq(x_64, x_54); +lean_dec(x_64); +if (x_67 == 0) +{ +lean_object* x_68; +lean_dec(x_66); +lean_dec(x_65); +lean_dec(x_62); +lean_dec(x_55); +lean_dec(x_54); +x_68 = lean_box(0); +x_5 = x_68; +goto block_10; +} +else +{ +uint8_t x_69; +x_69 = lean_nat_dec_eq(x_1, x_66); +lean_dec(x_66); +if (x_69 == 0) +{ +lean_object* x_70; +lean_dec(x_65); +lean_dec(x_62); +lean_dec(x_55); +lean_dec(x_54); +x_70 = lean_box(0); +x_5 = x_70; +goto block_10; +} +else +{ +lean_object* x_71; lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76; uint8_t x_77; +x_71 = lean_array_pop(x_2); +x_72 = lean_array_pop(x_71); +lean_inc(x_54); +x_73 = lean_alloc_ctor(1, 1, 0); +lean_ctor_set(x_73, 0, x_54); +x_74 = lean_array_set(x_3, x_65, x_73); +lean_dec(x_65); +x_75 = lean_array_push(x_4, x_62); +x_76 = lean_unsigned_to_nat(1u); +x_77 = lean_nat_dec_eq(x_55, x_76); +if (x_77 == 0) +{ +lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81; +x_78 = lean_nat_sub(x_55, x_76); +lean_dec(x_55); +x_79 = lean_box(13); +x_80 = lean_alloc_ctor(6, 3, 2); +lean_ctor_set(x_80, 0, x_54); +lean_ctor_set(x_80, 1, x_78); +lean_ctor_set(x_80, 2, x_79); +lean_ctor_set_uint8(x_80, sizeof(void*)*3, x_56); +lean_ctor_set_uint8(x_80, sizeof(void*)*3 + 1, x_57); +x_81 = lean_array_push(x_75, x_80); +x_2 = x_72; +x_3 = x_74; +x_4 = x_81; +goto _start; +} +else +{ +lean_dec(x_55); +lean_dec(x_54); +x_2 = x_72; +x_3 = x_74; +x_4 = x_75; +goto _start; +} +} +} +} +else +{ +lean_object* x_84; +lean_dec(x_63); +lean_dec(x_62); +lean_dec(x_55); +lean_dec(x_54); +x_84 = lean_box(0); +x_5 = x_84; goto block_10; } } else { -lean_object* x_64; -lean_dec(x_23); -lean_dec(x_22); -lean_dec(x_16); -x_64 = lean_box(0); -x_5 = x_64; +lean_object* x_85; +lean_dec(x_62); +lean_dec(x_55); +lean_dec(x_54); +x_85 = lean_box(0); +x_5 = x_85; goto block_10; } } +else +{ +lean_object* x_86; +lean_dec(x_55); +lean_dec(x_54); +lean_dec(x_16); +x_86 = lean_box(0); +x_5 = x_86; +goto block_10; +} +} +} default: { -lean_object* x_65; +lean_object* x_87; lean_dec(x_19); lean_dec(x_16); -x_65 = lean_box(0); -x_5 = x_65; +x_87 = lean_box(0); +x_5 = x_87; goto block_10; } } } else { -lean_object* x_66; +lean_object* x_88; lean_dec(x_16); -x_66 = lean_box(0); -x_5 = x_66; +x_88 = lean_box(0); +x_5 = x_88; goto block_10; } block_10: @@ -1439,72 +1541,74 @@ return x_44; } else { -lean_object* x_47; lean_object* x_48; uint8_t x_49; lean_object* x_50; uint8_t x_51; +lean_object* x_47; lean_object* x_48; uint8_t x_49; uint8_t x_50; lean_object* x_51; uint8_t x_52; x_47 = lean_ctor_get(x_2, 0); x_48 = lean_ctor_get(x_2, 1); x_49 = lean_ctor_get_uint8(x_2, sizeof(void*)*3); -x_50 = lean_ctor_get(x_2, 2); -lean_inc(x_50); +x_50 = lean_ctor_get_uint8(x_2, sizeof(void*)*3 + 1); +x_51 = lean_ctor_get(x_2, 2); +lean_inc(x_51); lean_inc(x_48); lean_inc(x_47); lean_dec(x_2); -x_51 = lean_nat_dec_eq(x_1, x_47); -if (x_51 == 0) +x_52 = lean_nat_dec_eq(x_1, x_47); +if (x_52 == 0) { -lean_object* x_52; lean_object* x_53; -x_52 = l_Lean_IR_ExpandResetReuse_reuseToCtor___main(x_1, x_50); -x_53 = lean_alloc_ctor(7, 3, 1); -lean_ctor_set(x_53, 0, x_47); -lean_ctor_set(x_53, 1, x_48); -lean_ctor_set(x_53, 2, x_52); -lean_ctor_set_uint8(x_53, sizeof(void*)*3, x_49); -return x_53; +lean_object* x_53; lean_object* x_54; +x_53 = l_Lean_IR_ExpandResetReuse_reuseToCtor___main(x_1, x_51); +x_54 = lean_alloc_ctor(7, 3, 2); +lean_ctor_set(x_54, 0, x_47); +lean_ctor_set(x_54, 1, x_48); +lean_ctor_set(x_54, 2, x_53); +lean_ctor_set_uint8(x_54, sizeof(void*)*3, x_49); +lean_ctor_set_uint8(x_54, sizeof(void*)*3 + 1, x_50); +return x_54; } else { lean_dec(x_48); lean_dec(x_47); -return x_50; +return x_51; } } } case 10: { -uint8_t x_54; -x_54 = !lean_is_exclusive(x_2); -if (x_54 == 0) +uint8_t x_55; +x_55 = !lean_is_exclusive(x_2); +if (x_55 == 0) { -lean_object* x_55; lean_object* x_56; lean_object* x_57; -x_55 = lean_ctor_get(x_2, 2); -x_56 = lean_unsigned_to_nat(0u); -x_57 = l_Array_ummapAux___main___at_Lean_IR_ExpandResetReuse_reuseToCtor___main___spec__1(x_1, x_56, x_55); -lean_ctor_set(x_2, 2, x_57); +lean_object* x_56; lean_object* x_57; lean_object* x_58; +x_56 = lean_ctor_get(x_2, 2); +x_57 = lean_unsigned_to_nat(0u); +x_58 = l_Array_ummapAux___main___at_Lean_IR_ExpandResetReuse_reuseToCtor___main___spec__1(x_1, x_57, x_56); +lean_ctor_set(x_2, 2, x_58); return x_2; } else { -lean_object* x_58; lean_object* x_59; lean_object* x_60; lean_object* x_61; lean_object* x_62; lean_object* x_63; -x_58 = lean_ctor_get(x_2, 0); -x_59 = lean_ctor_get(x_2, 1); -x_60 = lean_ctor_get(x_2, 2); +lean_object* x_59; lean_object* x_60; lean_object* x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64; +x_59 = lean_ctor_get(x_2, 0); +x_60 = lean_ctor_get(x_2, 1); +x_61 = lean_ctor_get(x_2, 2); +lean_inc(x_61); lean_inc(x_60); lean_inc(x_59); -lean_inc(x_58); lean_dec(x_2); -x_61 = lean_unsigned_to_nat(0u); -x_62 = l_Array_ummapAux___main___at_Lean_IR_ExpandResetReuse_reuseToCtor___main___spec__1(x_1, x_61, x_60); -x_63 = lean_alloc_ctor(10, 3, 0); -lean_ctor_set(x_63, 0, x_58); -lean_ctor_set(x_63, 1, x_59); -lean_ctor_set(x_63, 2, x_62); -return x_63; +x_62 = lean_unsigned_to_nat(0u); +x_63 = l_Array_ummapAux___main___at_Lean_IR_ExpandResetReuse_reuseToCtor___main___spec__1(x_1, x_62, x_61); +x_64 = lean_alloc_ctor(10, 3, 0); +lean_ctor_set(x_64, 0, x_59); +lean_ctor_set(x_64, 1, x_60); +lean_ctor_set(x_64, 2, x_63); +return x_64; } } default: { -lean_object* x_64; -x_64 = lean_box(0); -x_3 = x_64; +lean_object* x_65; +x_65 = lean_box(0); +x_3 = x_65; goto block_10; } } @@ -1591,18 +1695,20 @@ goto _start; } else { -lean_object* x_11; uint8_t x_12; lean_object* x_13; +lean_object* x_11; uint8_t x_12; uint8_t x_13; lean_object* x_14; x_11 = lean_ctor_get(x_7, 0); lean_inc(x_11); lean_dec(x_7); x_12 = 1; -x_13 = lean_alloc_ctor(6, 3, 1); -lean_ctor_set(x_13, 0, x_11); -lean_ctor_set(x_13, 1, x_8); -lean_ctor_set(x_13, 2, x_4); -lean_ctor_set_uint8(x_13, sizeof(void*)*3, x_12); +x_13 = 0; +x_14 = lean_alloc_ctor(6, 3, 2); +lean_ctor_set(x_14, 0, x_11); +lean_ctor_set(x_14, 1, x_8); +lean_ctor_set(x_14, 2, x_4); +lean_ctor_set_uint8(x_14, sizeof(void*)*3, x_12); +lean_ctor_set_uint8(x_14, sizeof(void*)*3 + 1, x_13); x_3 = x_9; -x_4 = x_13; +x_4 = x_14; goto _start; } } @@ -1611,18 +1717,20 @@ goto _start; lean_object* l_Lean_IR_ExpandResetReuse_mkSlowPath(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { -lean_object* x_5; lean_object* x_6; uint8_t x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; +lean_object* x_5; lean_object* x_6; uint8_t x_7; uint8_t x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; x_5 = l_Lean_IR_ExpandResetReuse_reuseToCtor___main(x_1, x_4); x_6 = lean_unsigned_to_nat(1u); x_7 = 1; -x_8 = lean_alloc_ctor(7, 3, 1); -lean_ctor_set(x_8, 0, x_2); -lean_ctor_set(x_8, 1, x_6); -lean_ctor_set(x_8, 2, x_5); -lean_ctor_set_uint8(x_8, sizeof(void*)*3, x_7); -x_9 = lean_unsigned_to_nat(0u); -x_10 = l_Array_miterateAux___main___at_Lean_IR_ExpandResetReuse_mkSlowPath___spec__1(x_3, x_3, x_9, x_8); -return x_10; +x_8 = 0; +x_9 = lean_alloc_ctor(7, 3, 2); +lean_ctor_set(x_9, 0, x_2); +lean_ctor_set(x_9, 1, x_6); +lean_ctor_set(x_9, 2, x_5); +lean_ctor_set_uint8(x_9, sizeof(void*)*3, x_7); +lean_ctor_set_uint8(x_9, sizeof(void*)*3 + 1, x_8); +x_10 = lean_unsigned_to_nat(0u); +x_11 = l_Array_miterateAux___main___at_Lean_IR_ExpandResetReuse_mkSlowPath___spec__1(x_3, x_3, x_10, x_9); +return x_11; } } lean_object* l_Array_miterateAux___main___at_Lean_IR_ExpandResetReuse_mkSlowPath___spec__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { @@ -1693,7 +1801,7 @@ x_14 = lean_box(0); x_15 = lean_array_get(x_14, x_2, x_13); if (lean_obj_tag(x_15) == 0) { -lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; uint8_t x_20; lean_object* x_21; uint8_t x_22; lean_object* x_23; +lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; uint8_t x_20; uint8_t x_21; lean_object* x_22; uint8_t x_23; lean_object* x_24; x_16 = l_Lean_IR_ExpandResetReuse_mkFresh___rarg(x_7); x_17 = lean_ctor_get(x_16, 0); lean_inc(x_17); @@ -1705,20 +1813,22 @@ x_19 = lean_alloc_ctor(3, 2, 0); lean_ctor_set(x_19, 0, x_13); lean_ctor_set(x_19, 1, x_1); x_20 = 1; +x_21 = 0; lean_inc(x_17); -x_21 = lean_alloc_ctor(7, 3, 1); -lean_ctor_set(x_21, 0, x_17); -lean_ctor_set(x_21, 1, x_10); -lean_ctor_set(x_21, 2, x_5); -lean_ctor_set_uint8(x_21, sizeof(void*)*3, x_20); -x_22 = 7; -x_23 = lean_alloc_ctor(0, 3, 1); -lean_ctor_set(x_23, 0, x_17); -lean_ctor_set(x_23, 1, x_19); -lean_ctor_set(x_23, 2, x_21); -lean_ctor_set_uint8(x_23, sizeof(void*)*3, x_22); +x_22 = lean_alloc_ctor(7, 3, 2); +lean_ctor_set(x_22, 0, x_17); +lean_ctor_set(x_22, 1, x_10); +lean_ctor_set(x_22, 2, x_5); +lean_ctor_set_uint8(x_22, sizeof(void*)*3, x_20); +lean_ctor_set_uint8(x_22, sizeof(void*)*3 + 1, x_21); +x_23 = 7; +x_24 = lean_alloc_ctor(0, 3, 1); +lean_ctor_set(x_24, 0, x_17); +lean_ctor_set(x_24, 1, x_19); +lean_ctor_set(x_24, 2, x_22); +lean_ctor_set_uint8(x_24, sizeof(void*)*3, x_23); x_4 = x_11; -x_5 = x_23; +x_5 = x_24; x_7 = x_18; goto _start; } @@ -1732,13 +1842,13 @@ goto _start; } else { -lean_object* x_26; +lean_object* x_27; lean_dec(x_4); lean_dec(x_1); -x_26 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_26, 0, x_5); -lean_ctor_set(x_26, 1, x_7); -return x_26; +x_27 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_27, 0, x_5); +lean_ctor_set(x_27, 1, x_7); +return x_27; } } } @@ -2756,76 +2866,78 @@ return x_61; } else { -lean_object* x_62; lean_object* x_63; uint8_t x_64; lean_object* x_65; uint8_t x_66; +lean_object* x_62; lean_object* x_63; uint8_t x_64; uint8_t x_65; lean_object* x_66; uint8_t x_67; x_62 = lean_ctor_get(x_4, 0); x_63 = lean_ctor_get(x_4, 1); x_64 = lean_ctor_get_uint8(x_4, sizeof(void*)*3); -x_65 = lean_ctor_get(x_4, 2); -lean_inc(x_65); +x_65 = lean_ctor_get_uint8(x_4, sizeof(void*)*3 + 1); +x_66 = lean_ctor_get(x_4, 2); +lean_inc(x_66); lean_inc(x_63); lean_inc(x_62); lean_dec(x_4); -x_66 = lean_nat_dec_eq(x_2, x_62); -if (x_66 == 0) +x_67 = lean_nat_dec_eq(x_2, x_62); +if (x_67 == 0) { -lean_object* x_67; lean_object* x_68; -x_67 = l_Lean_IR_ExpandResetReuse_reuseToSet___main(x_1, x_2, x_3, x_65); -x_68 = lean_alloc_ctor(7, 3, 1); -lean_ctor_set(x_68, 0, x_62); -lean_ctor_set(x_68, 1, x_63); -lean_ctor_set(x_68, 2, x_67); -lean_ctor_set_uint8(x_68, sizeof(void*)*3, x_64); -return x_68; +lean_object* x_68; lean_object* x_69; +x_68 = l_Lean_IR_ExpandResetReuse_reuseToSet___main(x_1, x_2, x_3, x_66); +x_69 = lean_alloc_ctor(7, 3, 2); +lean_ctor_set(x_69, 0, x_62); +lean_ctor_set(x_69, 1, x_63); +lean_ctor_set(x_69, 2, x_68); +lean_ctor_set_uint8(x_69, sizeof(void*)*3, x_64); +lean_ctor_set_uint8(x_69, sizeof(void*)*3 + 1, x_65); +return x_69; } else { -lean_object* x_69; +lean_object* x_70; lean_dec(x_63); lean_dec(x_62); -x_69 = lean_alloc_ctor(8, 2, 0); -lean_ctor_set(x_69, 0, x_3); -lean_ctor_set(x_69, 1, x_65); -return x_69; +x_70 = lean_alloc_ctor(8, 2, 0); +lean_ctor_set(x_70, 0, x_3); +lean_ctor_set(x_70, 1, x_66); +return x_70; } } } case 10: { -uint8_t x_70; -x_70 = !lean_is_exclusive(x_4); -if (x_70 == 0) +uint8_t x_71; +x_71 = !lean_is_exclusive(x_4); +if (x_71 == 0) { -lean_object* x_71; lean_object* x_72; lean_object* x_73; -x_71 = lean_ctor_get(x_4, 2); -x_72 = lean_unsigned_to_nat(0u); -x_73 = l_Array_ummapAux___main___at_Lean_IR_ExpandResetReuse_reuseToSet___main___spec__1(x_1, x_2, x_3, x_72, x_71); -lean_ctor_set(x_4, 2, x_73); +lean_object* x_72; lean_object* x_73; lean_object* x_74; +x_72 = lean_ctor_get(x_4, 2); +x_73 = lean_unsigned_to_nat(0u); +x_74 = l_Array_ummapAux___main___at_Lean_IR_ExpandResetReuse_reuseToSet___main___spec__1(x_1, x_2, x_3, x_73, x_72); +lean_ctor_set(x_4, 2, x_74); return x_4; } else { -lean_object* x_74; lean_object* x_75; lean_object* x_76; lean_object* x_77; lean_object* x_78; lean_object* x_79; -x_74 = lean_ctor_get(x_4, 0); -x_75 = lean_ctor_get(x_4, 1); -x_76 = lean_ctor_get(x_4, 2); +lean_object* x_75; lean_object* x_76; lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; +x_75 = lean_ctor_get(x_4, 0); +x_76 = lean_ctor_get(x_4, 1); +x_77 = lean_ctor_get(x_4, 2); +lean_inc(x_77); lean_inc(x_76); lean_inc(x_75); -lean_inc(x_74); lean_dec(x_4); -x_77 = lean_unsigned_to_nat(0u); -x_78 = l_Array_ummapAux___main___at_Lean_IR_ExpandResetReuse_reuseToSet___main___spec__1(x_1, x_2, x_3, x_77, x_76); -x_79 = lean_alloc_ctor(10, 3, 0); -lean_ctor_set(x_79, 0, x_74); -lean_ctor_set(x_79, 1, x_75); -lean_ctor_set(x_79, 2, x_78); -return x_79; +x_78 = lean_unsigned_to_nat(0u); +x_79 = l_Array_ummapAux___main___at_Lean_IR_ExpandResetReuse_reuseToSet___main___spec__1(x_1, x_2, x_3, x_78, x_77); +x_80 = lean_alloc_ctor(10, 3, 0); +lean_ctor_set(x_80, 0, x_75); +lean_ctor_set(x_80, 1, x_76); +lean_ctor_set(x_80, 2, x_79); +return x_80; } } default: { -lean_object* x_80; -x_80 = lean_box(0); -x_5 = x_80; +lean_object* x_81; +x_81 = lean_box(0); +x_5 = x_81; goto block_12; } } diff --git a/src/stage0/init/lean/compiler/ir/normids.c b/src/stage0/init/lean/compiler/ir/normids.c index bafd7c0f9c..f0cc1978cb 100644 --- a/src/stage0/init/lean/compiler/ir/normids.c +++ b/src/stage0/init/lean/compiler/ir/normids.c @@ -2294,427 +2294,431 @@ return x_178; } else { -lean_object* x_179; lean_object* x_180; uint8_t x_181; lean_object* x_182; lean_object* x_183; lean_object* x_184; lean_object* x_185; lean_object* x_186; lean_object* x_187; lean_object* x_188; lean_object* x_189; +lean_object* x_179; lean_object* x_180; uint8_t x_181; uint8_t x_182; lean_object* x_183; lean_object* x_184; lean_object* x_185; lean_object* x_186; lean_object* x_187; lean_object* x_188; lean_object* x_189; lean_object* x_190; x_179 = lean_ctor_get(x_1, 0); x_180 = lean_ctor_get(x_1, 1); x_181 = lean_ctor_get_uint8(x_1, sizeof(void*)*3); -x_182 = lean_ctor_get(x_1, 2); -lean_inc(x_182); +x_182 = lean_ctor_get_uint8(x_1, sizeof(void*)*3 + 1); +x_183 = lean_ctor_get(x_1, 2); +lean_inc(x_183); lean_inc(x_180); lean_inc(x_179); lean_dec(x_1); -x_183 = l_Lean_IR_NormalizeIds_normIndex(x_179, x_2); +x_184 = l_Lean_IR_NormalizeIds_normIndex(x_179, x_2); lean_dec(x_179); -x_184 = l_Lean_IR_NormalizeIds_normFnBody___main(x_182, x_2, x_3); -x_185 = lean_ctor_get(x_184, 0); -lean_inc(x_185); -x_186 = lean_ctor_get(x_184, 1); +x_185 = l_Lean_IR_NormalizeIds_normFnBody___main(x_183, x_2, x_3); +x_186 = lean_ctor_get(x_185, 0); lean_inc(x_186); -if (lean_is_exclusive(x_184)) { - lean_ctor_release(x_184, 0); - lean_ctor_release(x_184, 1); - x_187 = x_184; +x_187 = lean_ctor_get(x_185, 1); +lean_inc(x_187); +if (lean_is_exclusive(x_185)) { + lean_ctor_release(x_185, 0); + lean_ctor_release(x_185, 1); + x_188 = x_185; } else { - lean_dec_ref(x_184); - x_187 = lean_box(0); + lean_dec_ref(x_185); + x_188 = lean_box(0); } -x_188 = lean_alloc_ctor(6, 3, 1); -lean_ctor_set(x_188, 0, x_183); -lean_ctor_set(x_188, 1, x_180); -lean_ctor_set(x_188, 2, x_185); -lean_ctor_set_uint8(x_188, sizeof(void*)*3, x_181); -if (lean_is_scalar(x_187)) { - x_189 = lean_alloc_ctor(0, 2, 0); +x_189 = lean_alloc_ctor(6, 3, 2); +lean_ctor_set(x_189, 0, x_184); +lean_ctor_set(x_189, 1, x_180); +lean_ctor_set(x_189, 2, x_186); +lean_ctor_set_uint8(x_189, sizeof(void*)*3, x_181); +lean_ctor_set_uint8(x_189, sizeof(void*)*3 + 1, x_182); +if (lean_is_scalar(x_188)) { + x_190 = lean_alloc_ctor(0, 2, 0); } else { - x_189 = x_187; + x_190 = x_188; } -lean_ctor_set(x_189, 0, x_188); -lean_ctor_set(x_189, 1, x_186); -return x_189; +lean_ctor_set(x_190, 0, x_189); +lean_ctor_set(x_190, 1, x_187); +return x_190; } } case 7: { -uint8_t x_190; -x_190 = !lean_is_exclusive(x_1); -if (x_190 == 0) +uint8_t x_191; +x_191 = !lean_is_exclusive(x_1); +if (x_191 == 0) { -lean_object* x_191; lean_object* x_192; lean_object* x_193; lean_object* x_194; uint8_t x_195; -x_191 = lean_ctor_get(x_1, 0); -x_192 = lean_ctor_get(x_1, 2); -x_193 = l_Lean_IR_NormalizeIds_normIndex(x_191, x_2); -lean_dec(x_191); -x_194 = l_Lean_IR_NormalizeIds_normFnBody___main(x_192, x_2, x_3); -x_195 = !lean_is_exclusive(x_194); -if (x_195 == 0) +lean_object* x_192; lean_object* x_193; lean_object* x_194; lean_object* x_195; uint8_t x_196; +x_192 = lean_ctor_get(x_1, 0); +x_193 = lean_ctor_get(x_1, 2); +x_194 = l_Lean_IR_NormalizeIds_normIndex(x_192, x_2); +lean_dec(x_192); +x_195 = l_Lean_IR_NormalizeIds_normFnBody___main(x_193, x_2, x_3); +x_196 = !lean_is_exclusive(x_195); +if (x_196 == 0) { -lean_object* x_196; -x_196 = lean_ctor_get(x_194, 0); -lean_ctor_set(x_1, 2, x_196); -lean_ctor_set(x_1, 0, x_193); -lean_ctor_set(x_194, 0, x_1); -return x_194; -} -else -{ -lean_object* x_197; lean_object* x_198; lean_object* x_199; -x_197 = lean_ctor_get(x_194, 0); -x_198 = lean_ctor_get(x_194, 1); -lean_inc(x_198); -lean_inc(x_197); -lean_dec(x_194); +lean_object* x_197; +x_197 = lean_ctor_get(x_195, 0); lean_ctor_set(x_1, 2, x_197); -lean_ctor_set(x_1, 0, x_193); -x_199 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_199, 0, x_1); -lean_ctor_set(x_199, 1, x_198); -return x_199; +lean_ctor_set(x_1, 0, x_194); +lean_ctor_set(x_195, 0, x_1); +return x_195; +} +else +{ +lean_object* x_198; lean_object* x_199; lean_object* x_200; +x_198 = lean_ctor_get(x_195, 0); +x_199 = lean_ctor_get(x_195, 1); +lean_inc(x_199); +lean_inc(x_198); +lean_dec(x_195); +lean_ctor_set(x_1, 2, x_198); +lean_ctor_set(x_1, 0, x_194); +x_200 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_200, 0, x_1); +lean_ctor_set(x_200, 1, x_199); +return x_200; } } else { -lean_object* x_200; lean_object* x_201; uint8_t x_202; lean_object* x_203; lean_object* x_204; lean_object* x_205; lean_object* x_206; lean_object* x_207; lean_object* x_208; lean_object* x_209; lean_object* x_210; -x_200 = lean_ctor_get(x_1, 0); -x_201 = lean_ctor_get(x_1, 1); -x_202 = lean_ctor_get_uint8(x_1, sizeof(void*)*3); -x_203 = lean_ctor_get(x_1, 2); -lean_inc(x_203); +lean_object* x_201; lean_object* x_202; uint8_t x_203; uint8_t x_204; lean_object* x_205; lean_object* x_206; lean_object* x_207; lean_object* x_208; lean_object* x_209; lean_object* x_210; lean_object* x_211; lean_object* x_212; +x_201 = lean_ctor_get(x_1, 0); +x_202 = lean_ctor_get(x_1, 1); +x_203 = lean_ctor_get_uint8(x_1, sizeof(void*)*3); +x_204 = lean_ctor_get_uint8(x_1, sizeof(void*)*3 + 1); +x_205 = lean_ctor_get(x_1, 2); +lean_inc(x_205); +lean_inc(x_202); lean_inc(x_201); -lean_inc(x_200); lean_dec(x_1); -x_204 = l_Lean_IR_NormalizeIds_normIndex(x_200, x_2); -lean_dec(x_200); -x_205 = l_Lean_IR_NormalizeIds_normFnBody___main(x_203, x_2, x_3); -x_206 = lean_ctor_get(x_205, 0); -lean_inc(x_206); -x_207 = lean_ctor_get(x_205, 1); -lean_inc(x_207); -if (lean_is_exclusive(x_205)) { - lean_ctor_release(x_205, 0); - lean_ctor_release(x_205, 1); - x_208 = x_205; +x_206 = l_Lean_IR_NormalizeIds_normIndex(x_201, x_2); +lean_dec(x_201); +x_207 = l_Lean_IR_NormalizeIds_normFnBody___main(x_205, x_2, x_3); +x_208 = lean_ctor_get(x_207, 0); +lean_inc(x_208); +x_209 = lean_ctor_get(x_207, 1); +lean_inc(x_209); +if (lean_is_exclusive(x_207)) { + lean_ctor_release(x_207, 0); + lean_ctor_release(x_207, 1); + x_210 = x_207; } else { - lean_dec_ref(x_205); - x_208 = lean_box(0); + lean_dec_ref(x_207); + x_210 = lean_box(0); } -x_209 = lean_alloc_ctor(7, 3, 1); -lean_ctor_set(x_209, 0, x_204); -lean_ctor_set(x_209, 1, x_201); -lean_ctor_set(x_209, 2, x_206); -lean_ctor_set_uint8(x_209, sizeof(void*)*3, x_202); -if (lean_is_scalar(x_208)) { - x_210 = lean_alloc_ctor(0, 2, 0); +x_211 = lean_alloc_ctor(7, 3, 2); +lean_ctor_set(x_211, 0, x_206); +lean_ctor_set(x_211, 1, x_202); +lean_ctor_set(x_211, 2, x_208); +lean_ctor_set_uint8(x_211, sizeof(void*)*3, x_203); +lean_ctor_set_uint8(x_211, sizeof(void*)*3 + 1, x_204); +if (lean_is_scalar(x_210)) { + x_212 = lean_alloc_ctor(0, 2, 0); } else { - x_210 = x_208; + x_212 = x_210; } -lean_ctor_set(x_210, 0, x_209); -lean_ctor_set(x_210, 1, x_207); -return x_210; +lean_ctor_set(x_212, 0, x_211); +lean_ctor_set(x_212, 1, x_209); +return x_212; } } case 8: { -uint8_t x_211; -x_211 = !lean_is_exclusive(x_1); -if (x_211 == 0) +uint8_t x_213; +x_213 = !lean_is_exclusive(x_1); +if (x_213 == 0) { -lean_object* x_212; lean_object* x_213; lean_object* x_214; lean_object* x_215; uint8_t x_216; -x_212 = lean_ctor_get(x_1, 0); -x_213 = lean_ctor_get(x_1, 1); -x_214 = l_Lean_IR_NormalizeIds_normIndex(x_212, x_2); -lean_dec(x_212); -x_215 = l_Lean_IR_NormalizeIds_normFnBody___main(x_213, x_2, x_3); -x_216 = !lean_is_exclusive(x_215); -if (x_216 == 0) +lean_object* x_214; lean_object* x_215; lean_object* x_216; lean_object* x_217; uint8_t x_218; +x_214 = lean_ctor_get(x_1, 0); +x_215 = lean_ctor_get(x_1, 1); +x_216 = l_Lean_IR_NormalizeIds_normIndex(x_214, x_2); +lean_dec(x_214); +x_217 = l_Lean_IR_NormalizeIds_normFnBody___main(x_215, x_2, x_3); +x_218 = !lean_is_exclusive(x_217); +if (x_218 == 0) { -lean_object* x_217; -x_217 = lean_ctor_get(x_215, 0); -lean_ctor_set(x_1, 1, x_217); -lean_ctor_set(x_1, 0, x_214); -lean_ctor_set(x_215, 0, x_1); -return x_215; +lean_object* x_219; +x_219 = lean_ctor_get(x_217, 0); +lean_ctor_set(x_1, 1, x_219); +lean_ctor_set(x_1, 0, x_216); +lean_ctor_set(x_217, 0, x_1); +return x_217; } else { -lean_object* x_218; lean_object* x_219; lean_object* x_220; -x_218 = lean_ctor_get(x_215, 0); -x_219 = lean_ctor_get(x_215, 1); -lean_inc(x_219); -lean_inc(x_218); -lean_dec(x_215); -lean_ctor_set(x_1, 1, x_218); -lean_ctor_set(x_1, 0, x_214); -x_220 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_220, 0, x_1); -lean_ctor_set(x_220, 1, x_219); -return x_220; -} -} -else -{ -lean_object* x_221; lean_object* x_222; lean_object* x_223; lean_object* x_224; lean_object* x_225; lean_object* x_226; lean_object* x_227; lean_object* x_228; lean_object* x_229; -x_221 = lean_ctor_get(x_1, 0); -x_222 = lean_ctor_get(x_1, 1); -lean_inc(x_222); +lean_object* x_220; lean_object* x_221; lean_object* x_222; +x_220 = lean_ctor_get(x_217, 0); +x_221 = lean_ctor_get(x_217, 1); lean_inc(x_221); +lean_inc(x_220); +lean_dec(x_217); +lean_ctor_set(x_1, 1, x_220); +lean_ctor_set(x_1, 0, x_216); +x_222 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_222, 0, x_1); +lean_ctor_set(x_222, 1, x_221); +return x_222; +} +} +else +{ +lean_object* x_223; lean_object* x_224; lean_object* x_225; lean_object* x_226; lean_object* x_227; lean_object* x_228; lean_object* x_229; lean_object* x_230; lean_object* x_231; +x_223 = lean_ctor_get(x_1, 0); +x_224 = lean_ctor_get(x_1, 1); +lean_inc(x_224); +lean_inc(x_223); lean_dec(x_1); -x_223 = l_Lean_IR_NormalizeIds_normIndex(x_221, x_2); -lean_dec(x_221); -x_224 = l_Lean_IR_NormalizeIds_normFnBody___main(x_222, x_2, x_3); -x_225 = lean_ctor_get(x_224, 0); -lean_inc(x_225); -x_226 = lean_ctor_get(x_224, 1); -lean_inc(x_226); -if (lean_is_exclusive(x_224)) { - lean_ctor_release(x_224, 0); - lean_ctor_release(x_224, 1); - x_227 = x_224; +x_225 = l_Lean_IR_NormalizeIds_normIndex(x_223, x_2); +lean_dec(x_223); +x_226 = l_Lean_IR_NormalizeIds_normFnBody___main(x_224, x_2, x_3); +x_227 = lean_ctor_get(x_226, 0); +lean_inc(x_227); +x_228 = lean_ctor_get(x_226, 1); +lean_inc(x_228); +if (lean_is_exclusive(x_226)) { + lean_ctor_release(x_226, 0); + lean_ctor_release(x_226, 1); + x_229 = x_226; } else { - lean_dec_ref(x_224); - x_227 = lean_box(0); + lean_dec_ref(x_226); + x_229 = lean_box(0); } -x_228 = lean_alloc_ctor(8, 2, 0); -lean_ctor_set(x_228, 0, x_223); -lean_ctor_set(x_228, 1, x_225); -if (lean_is_scalar(x_227)) { - x_229 = lean_alloc_ctor(0, 2, 0); +x_230 = lean_alloc_ctor(8, 2, 0); +lean_ctor_set(x_230, 0, x_225); +lean_ctor_set(x_230, 1, x_227); +if (lean_is_scalar(x_229)) { + x_231 = lean_alloc_ctor(0, 2, 0); } else { - x_229 = x_227; + x_231 = x_229; } -lean_ctor_set(x_229, 0, x_228); -lean_ctor_set(x_229, 1, x_226); -return x_229; +lean_ctor_set(x_231, 0, x_230); +lean_ctor_set(x_231, 1, x_228); +return x_231; } } case 9: { -uint8_t x_230; -x_230 = !lean_is_exclusive(x_1); -if (x_230 == 0) +uint8_t x_232; +x_232 = !lean_is_exclusive(x_1); +if (x_232 == 0) { -lean_object* x_231; lean_object* x_232; uint8_t x_233; -x_231 = lean_ctor_get(x_1, 1); -x_232 = l_Lean_IR_NormalizeIds_normFnBody___main(x_231, x_2, x_3); -x_233 = !lean_is_exclusive(x_232); -if (x_233 == 0) +lean_object* x_233; lean_object* x_234; uint8_t x_235; +x_233 = lean_ctor_get(x_1, 1); +x_234 = l_Lean_IR_NormalizeIds_normFnBody___main(x_233, x_2, x_3); +x_235 = !lean_is_exclusive(x_234); +if (x_235 == 0) { -lean_object* x_234; -x_234 = lean_ctor_get(x_232, 0); -lean_ctor_set(x_1, 1, x_234); -lean_ctor_set(x_232, 0, x_1); -return x_232; +lean_object* x_236; +x_236 = lean_ctor_get(x_234, 0); +lean_ctor_set(x_1, 1, x_236); +lean_ctor_set(x_234, 0, x_1); +return x_234; } else { -lean_object* x_235; lean_object* x_236; lean_object* x_237; -x_235 = lean_ctor_get(x_232, 0); -x_236 = lean_ctor_get(x_232, 1); -lean_inc(x_236); -lean_inc(x_235); -lean_dec(x_232); -lean_ctor_set(x_1, 1, x_235); -x_237 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_237, 0, x_1); -lean_ctor_set(x_237, 1, x_236); -return x_237; -} -} -else -{ -lean_object* x_238; lean_object* x_239; lean_object* x_240; lean_object* x_241; lean_object* x_242; lean_object* x_243; lean_object* x_244; lean_object* x_245; -x_238 = lean_ctor_get(x_1, 0); -x_239 = lean_ctor_get(x_1, 1); -lean_inc(x_239); +lean_object* x_237; lean_object* x_238; lean_object* x_239; +x_237 = lean_ctor_get(x_234, 0); +x_238 = lean_ctor_get(x_234, 1); lean_inc(x_238); -lean_dec(x_1); -x_240 = l_Lean_IR_NormalizeIds_normFnBody___main(x_239, x_2, x_3); -x_241 = lean_ctor_get(x_240, 0); +lean_inc(x_237); +lean_dec(x_234); +lean_ctor_set(x_1, 1, x_237); +x_239 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_239, 0, x_1); +lean_ctor_set(x_239, 1, x_238); +return x_239; +} +} +else +{ +lean_object* x_240; lean_object* x_241; lean_object* x_242; lean_object* x_243; lean_object* x_244; lean_object* x_245; lean_object* x_246; lean_object* x_247; +x_240 = lean_ctor_get(x_1, 0); +x_241 = lean_ctor_get(x_1, 1); lean_inc(x_241); -x_242 = lean_ctor_get(x_240, 1); -lean_inc(x_242); -if (lean_is_exclusive(x_240)) { - lean_ctor_release(x_240, 0); - lean_ctor_release(x_240, 1); - x_243 = x_240; +lean_inc(x_240); +lean_dec(x_1); +x_242 = l_Lean_IR_NormalizeIds_normFnBody___main(x_241, x_2, x_3); +x_243 = lean_ctor_get(x_242, 0); +lean_inc(x_243); +x_244 = lean_ctor_get(x_242, 1); +lean_inc(x_244); +if (lean_is_exclusive(x_242)) { + lean_ctor_release(x_242, 0); + lean_ctor_release(x_242, 1); + x_245 = x_242; } else { - lean_dec_ref(x_240); - x_243 = lean_box(0); + lean_dec_ref(x_242); + x_245 = lean_box(0); } -x_244 = lean_alloc_ctor(9, 2, 0); -lean_ctor_set(x_244, 0, x_238); -lean_ctor_set(x_244, 1, x_241); -if (lean_is_scalar(x_243)) { - x_245 = lean_alloc_ctor(0, 2, 0); +x_246 = lean_alloc_ctor(9, 2, 0); +lean_ctor_set(x_246, 0, x_240); +lean_ctor_set(x_246, 1, x_243); +if (lean_is_scalar(x_245)) { + x_247 = lean_alloc_ctor(0, 2, 0); } else { - x_245 = x_243; + x_247 = x_245; } -lean_ctor_set(x_245, 0, x_244); -lean_ctor_set(x_245, 1, x_242); -return x_245; +lean_ctor_set(x_247, 0, x_246); +lean_ctor_set(x_247, 1, x_244); +return x_247; } } case 10: { -uint8_t x_246; -x_246 = !lean_is_exclusive(x_1); -if (x_246 == 0) +uint8_t x_248; +x_248 = !lean_is_exclusive(x_1); +if (x_248 == 0) { -lean_object* x_247; lean_object* x_248; lean_object* x_249; lean_object* x_250; lean_object* x_251; uint8_t x_252; -x_247 = lean_ctor_get(x_1, 1); -x_248 = lean_ctor_get(x_1, 2); -x_249 = l_Lean_IR_NormalizeIds_normIndex(x_247, x_2); -lean_dec(x_247); -x_250 = lean_unsigned_to_nat(0u); -x_251 = l_Array_ummapAux___main___at_Lean_IR_NormalizeIds_normFnBody___main___spec__3(x_250, x_248, x_2, x_3); -x_252 = !lean_is_exclusive(x_251); -if (x_252 == 0) +lean_object* x_249; lean_object* x_250; lean_object* x_251; lean_object* x_252; lean_object* x_253; uint8_t x_254; +x_249 = lean_ctor_get(x_1, 1); +x_250 = lean_ctor_get(x_1, 2); +x_251 = l_Lean_IR_NormalizeIds_normIndex(x_249, x_2); +lean_dec(x_249); +x_252 = lean_unsigned_to_nat(0u); +x_253 = l_Array_ummapAux___main___at_Lean_IR_NormalizeIds_normFnBody___main___spec__3(x_252, x_250, x_2, x_3); +x_254 = !lean_is_exclusive(x_253); +if (x_254 == 0) { -lean_object* x_253; -x_253 = lean_ctor_get(x_251, 0); -lean_ctor_set(x_1, 2, x_253); -lean_ctor_set(x_1, 1, x_249); -lean_ctor_set(x_251, 0, x_1); -return x_251; +lean_object* x_255; +x_255 = lean_ctor_get(x_253, 0); +lean_ctor_set(x_1, 2, x_255); +lean_ctor_set(x_1, 1, x_251); +lean_ctor_set(x_253, 0, x_1); +return x_253; } else { -lean_object* x_254; lean_object* x_255; lean_object* x_256; -x_254 = lean_ctor_get(x_251, 0); -x_255 = lean_ctor_get(x_251, 1); -lean_inc(x_255); -lean_inc(x_254); -lean_dec(x_251); -lean_ctor_set(x_1, 2, x_254); -lean_ctor_set(x_1, 1, x_249); -x_256 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_256, 0, x_1); -lean_ctor_set(x_256, 1, x_255); -return x_256; -} -} -else -{ -lean_object* x_257; lean_object* x_258; lean_object* x_259; lean_object* x_260; lean_object* x_261; lean_object* x_262; lean_object* x_263; lean_object* x_264; lean_object* x_265; lean_object* x_266; lean_object* x_267; -x_257 = lean_ctor_get(x_1, 0); -x_258 = lean_ctor_get(x_1, 1); -x_259 = lean_ctor_get(x_1, 2); -lean_inc(x_259); -lean_inc(x_258); +lean_object* x_256; lean_object* x_257; lean_object* x_258; +x_256 = lean_ctor_get(x_253, 0); +x_257 = lean_ctor_get(x_253, 1); lean_inc(x_257); +lean_inc(x_256); +lean_dec(x_253); +lean_ctor_set(x_1, 2, x_256); +lean_ctor_set(x_1, 1, x_251); +x_258 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_258, 0, x_1); +lean_ctor_set(x_258, 1, x_257); +return x_258; +} +} +else +{ +lean_object* x_259; lean_object* x_260; lean_object* x_261; lean_object* x_262; lean_object* x_263; lean_object* x_264; lean_object* x_265; lean_object* x_266; lean_object* x_267; lean_object* x_268; lean_object* x_269; +x_259 = lean_ctor_get(x_1, 0); +x_260 = lean_ctor_get(x_1, 1); +x_261 = lean_ctor_get(x_1, 2); +lean_inc(x_261); +lean_inc(x_260); +lean_inc(x_259); lean_dec(x_1); -x_260 = l_Lean_IR_NormalizeIds_normIndex(x_258, x_2); -lean_dec(x_258); -x_261 = lean_unsigned_to_nat(0u); -x_262 = l_Array_ummapAux___main___at_Lean_IR_NormalizeIds_normFnBody___main___spec__3(x_261, x_259, x_2, x_3); -x_263 = lean_ctor_get(x_262, 0); -lean_inc(x_263); -x_264 = lean_ctor_get(x_262, 1); -lean_inc(x_264); -if (lean_is_exclusive(x_262)) { - lean_ctor_release(x_262, 0); - lean_ctor_release(x_262, 1); - x_265 = x_262; +x_262 = l_Lean_IR_NormalizeIds_normIndex(x_260, x_2); +lean_dec(x_260); +x_263 = lean_unsigned_to_nat(0u); +x_264 = l_Array_ummapAux___main___at_Lean_IR_NormalizeIds_normFnBody___main___spec__3(x_263, x_261, x_2, x_3); +x_265 = lean_ctor_get(x_264, 0); +lean_inc(x_265); +x_266 = lean_ctor_get(x_264, 1); +lean_inc(x_266); +if (lean_is_exclusive(x_264)) { + lean_ctor_release(x_264, 0); + lean_ctor_release(x_264, 1); + x_267 = x_264; } else { - lean_dec_ref(x_262); - x_265 = lean_box(0); + lean_dec_ref(x_264); + x_267 = lean_box(0); } -x_266 = lean_alloc_ctor(10, 3, 0); -lean_ctor_set(x_266, 0, x_257); -lean_ctor_set(x_266, 1, x_260); -lean_ctor_set(x_266, 2, x_263); -if (lean_is_scalar(x_265)) { - x_267 = lean_alloc_ctor(0, 2, 0); +x_268 = lean_alloc_ctor(10, 3, 0); +lean_ctor_set(x_268, 0, x_259); +lean_ctor_set(x_268, 1, x_262); +lean_ctor_set(x_268, 2, x_265); +if (lean_is_scalar(x_267)) { + x_269 = lean_alloc_ctor(0, 2, 0); } else { - x_267 = x_265; + x_269 = x_267; } -lean_ctor_set(x_267, 0, x_266); -lean_ctor_set(x_267, 1, x_264); -return x_267; +lean_ctor_set(x_269, 0, x_268); +lean_ctor_set(x_269, 1, x_266); +return x_269; } } case 11: { -uint8_t x_268; -x_268 = !lean_is_exclusive(x_1); -if (x_268 == 0) +uint8_t x_270; +x_270 = !lean_is_exclusive(x_1); +if (x_270 == 0) { -lean_object* x_269; lean_object* x_270; lean_object* x_271; -x_269 = lean_ctor_get(x_1, 0); -x_270 = l_Lean_IR_NormalizeIds_normArg(x_269, x_2); +lean_object* x_271; lean_object* x_272; lean_object* x_273; +x_271 = lean_ctor_get(x_1, 0); +x_272 = l_Lean_IR_NormalizeIds_normArg(x_271, x_2); lean_dec(x_2); -lean_ctor_set(x_1, 0, x_270); -x_271 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_271, 0, x_1); -lean_ctor_set(x_271, 1, x_3); -return x_271; +lean_ctor_set(x_1, 0, x_272); +x_273 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_273, 0, x_1); +lean_ctor_set(x_273, 1, x_3); +return x_273; } else { -lean_object* x_272; lean_object* x_273; lean_object* x_274; lean_object* x_275; -x_272 = lean_ctor_get(x_1, 0); -lean_inc(x_272); +lean_object* x_274; lean_object* x_275; lean_object* x_276; lean_object* x_277; +x_274 = lean_ctor_get(x_1, 0); +lean_inc(x_274); lean_dec(x_1); -x_273 = l_Lean_IR_NormalizeIds_normArg(x_272, x_2); +x_275 = l_Lean_IR_NormalizeIds_normArg(x_274, x_2); lean_dec(x_2); -x_274 = lean_alloc_ctor(11, 1, 0); -lean_ctor_set(x_274, 0, x_273); -x_275 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_275, 0, x_274); -lean_ctor_set(x_275, 1, x_3); -return x_275; +x_276 = lean_alloc_ctor(11, 1, 0); +lean_ctor_set(x_276, 0, x_275); +x_277 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_277, 0, x_276); +lean_ctor_set(x_277, 1, x_3); +return x_277; } } case 12: { -uint8_t x_276; -x_276 = !lean_is_exclusive(x_1); -if (x_276 == 0) +uint8_t x_278; +x_278 = !lean_is_exclusive(x_1); +if (x_278 == 0) { -lean_object* x_277; lean_object* x_278; lean_object* x_279; lean_object* x_280; lean_object* x_281; lean_object* x_282; -x_277 = lean_ctor_get(x_1, 0); -x_278 = lean_ctor_get(x_1, 1); -x_279 = l_Lean_IR_NormalizeIds_normIndex(x_277, x_2); -lean_dec(x_277); -x_280 = lean_unsigned_to_nat(0u); -x_281 = l_Array_ummapAux___main___at_Lean_IR_NormalizeIds_normArgs___spec__1(x_2, x_280, x_278); +lean_object* x_279; lean_object* x_280; lean_object* x_281; lean_object* x_282; lean_object* x_283; lean_object* x_284; +x_279 = lean_ctor_get(x_1, 0); +x_280 = lean_ctor_get(x_1, 1); +x_281 = l_Lean_IR_NormalizeIds_normIndex(x_279, x_2); +lean_dec(x_279); +x_282 = lean_unsigned_to_nat(0u); +x_283 = l_Array_ummapAux___main___at_Lean_IR_NormalizeIds_normArgs___spec__1(x_2, x_282, x_280); lean_dec(x_2); -lean_ctor_set(x_1, 1, x_281); -lean_ctor_set(x_1, 0, x_279); -x_282 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_282, 0, x_1); -lean_ctor_set(x_282, 1, x_3); -return x_282; +lean_ctor_set(x_1, 1, x_283); +lean_ctor_set(x_1, 0, x_281); +x_284 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_284, 0, x_1); +lean_ctor_set(x_284, 1, x_3); +return x_284; } else { -lean_object* x_283; lean_object* x_284; lean_object* x_285; lean_object* x_286; lean_object* x_287; lean_object* x_288; lean_object* x_289; -x_283 = lean_ctor_get(x_1, 0); -x_284 = lean_ctor_get(x_1, 1); -lean_inc(x_284); -lean_inc(x_283); +lean_object* x_285; lean_object* x_286; lean_object* x_287; lean_object* x_288; lean_object* x_289; lean_object* x_290; lean_object* x_291; +x_285 = lean_ctor_get(x_1, 0); +x_286 = lean_ctor_get(x_1, 1); +lean_inc(x_286); +lean_inc(x_285); lean_dec(x_1); -x_285 = l_Lean_IR_NormalizeIds_normIndex(x_283, x_2); -lean_dec(x_283); -x_286 = lean_unsigned_to_nat(0u); -x_287 = l_Array_ummapAux___main___at_Lean_IR_NormalizeIds_normArgs___spec__1(x_2, x_286, x_284); +x_287 = l_Lean_IR_NormalizeIds_normIndex(x_285, x_2); +lean_dec(x_285); +x_288 = lean_unsigned_to_nat(0u); +x_289 = l_Array_ummapAux___main___at_Lean_IR_NormalizeIds_normArgs___spec__1(x_2, x_288, x_286); lean_dec(x_2); -x_288 = lean_alloc_ctor(12, 2, 0); -lean_ctor_set(x_288, 0, x_285); -lean_ctor_set(x_288, 1, x_287); -x_289 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_289, 0, x_288); -lean_ctor_set(x_289, 1, x_3); -return x_289; +x_290 = lean_alloc_ctor(12, 2, 0); +lean_ctor_set(x_290, 0, x_287); +lean_ctor_set(x_290, 1, x_289); +x_291 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_291, 0, x_290); +lean_ctor_set(x_291, 1, x_3); +return x_291; } } default: { -lean_object* x_290; +lean_object* x_292; lean_dec(x_2); -x_290 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_290, 0, x_1); -lean_ctor_set(x_290, 1, x_3); -return x_290; +x_292 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_292, 0, x_1); +lean_ctor_set(x_292, 1, x_3); +return x_292; } } } @@ -3843,192 +3847,196 @@ return x_2; } else { -lean_object* x_99; lean_object* x_100; uint8_t x_101; lean_object* x_102; lean_object* x_103; lean_object* x_104; lean_object* x_105; +lean_object* x_99; lean_object* x_100; uint8_t x_101; uint8_t x_102; lean_object* x_103; lean_object* x_104; lean_object* x_105; lean_object* x_106; x_99 = lean_ctor_get(x_2, 0); x_100 = lean_ctor_get(x_2, 1); x_101 = lean_ctor_get_uint8(x_2, sizeof(void*)*3); -x_102 = lean_ctor_get(x_2, 2); -lean_inc(x_102); +x_102 = lean_ctor_get_uint8(x_2, sizeof(void*)*3 + 1); +x_103 = lean_ctor_get(x_2, 2); +lean_inc(x_103); lean_inc(x_100); lean_inc(x_99); lean_dec(x_2); lean_inc(x_1); -x_103 = lean_apply_1(x_1, x_99); -x_104 = l_Lean_IR_MapVars_mapFnBody___main(x_1, x_102); -x_105 = lean_alloc_ctor(6, 3, 1); -lean_ctor_set(x_105, 0, x_103); -lean_ctor_set(x_105, 1, x_100); -lean_ctor_set(x_105, 2, x_104); -lean_ctor_set_uint8(x_105, sizeof(void*)*3, x_101); -return x_105; +x_104 = lean_apply_1(x_1, x_99); +x_105 = l_Lean_IR_MapVars_mapFnBody___main(x_1, x_103); +x_106 = lean_alloc_ctor(6, 3, 2); +lean_ctor_set(x_106, 0, x_104); +lean_ctor_set(x_106, 1, x_100); +lean_ctor_set(x_106, 2, x_105); +lean_ctor_set_uint8(x_106, sizeof(void*)*3, x_101); +lean_ctor_set_uint8(x_106, sizeof(void*)*3 + 1, x_102); +return x_106; } } case 7: { -uint8_t x_106; -x_106 = !lean_is_exclusive(x_2); -if (x_106 == 0) +uint8_t x_107; +x_107 = !lean_is_exclusive(x_2); +if (x_107 == 0) { -lean_object* x_107; lean_object* x_108; lean_object* x_109; lean_object* x_110; -x_107 = lean_ctor_get(x_2, 0); -x_108 = lean_ctor_get(x_2, 2); +lean_object* x_108; lean_object* x_109; lean_object* x_110; lean_object* x_111; +x_108 = lean_ctor_get(x_2, 0); +x_109 = lean_ctor_get(x_2, 2); lean_inc(x_1); -x_109 = lean_apply_1(x_1, x_107); -x_110 = l_Lean_IR_MapVars_mapFnBody___main(x_1, x_108); -lean_ctor_set(x_2, 2, x_110); -lean_ctor_set(x_2, 0, x_109); +x_110 = lean_apply_1(x_1, x_108); +x_111 = l_Lean_IR_MapVars_mapFnBody___main(x_1, x_109); +lean_ctor_set(x_2, 2, x_111); +lean_ctor_set(x_2, 0, x_110); return x_2; } else { -lean_object* x_111; lean_object* x_112; uint8_t x_113; lean_object* x_114; lean_object* x_115; lean_object* x_116; lean_object* x_117; -x_111 = lean_ctor_get(x_2, 0); -x_112 = lean_ctor_get(x_2, 1); -x_113 = lean_ctor_get_uint8(x_2, sizeof(void*)*3); -x_114 = lean_ctor_get(x_2, 2); -lean_inc(x_114); +lean_object* x_112; lean_object* x_113; uint8_t x_114; uint8_t x_115; lean_object* x_116; lean_object* x_117; lean_object* x_118; lean_object* x_119; +x_112 = lean_ctor_get(x_2, 0); +x_113 = lean_ctor_get(x_2, 1); +x_114 = lean_ctor_get_uint8(x_2, sizeof(void*)*3); +x_115 = lean_ctor_get_uint8(x_2, sizeof(void*)*3 + 1); +x_116 = lean_ctor_get(x_2, 2); +lean_inc(x_116); +lean_inc(x_113); lean_inc(x_112); -lean_inc(x_111); lean_dec(x_2); lean_inc(x_1); -x_115 = lean_apply_1(x_1, x_111); -x_116 = l_Lean_IR_MapVars_mapFnBody___main(x_1, x_114); -x_117 = lean_alloc_ctor(7, 3, 1); -lean_ctor_set(x_117, 0, x_115); -lean_ctor_set(x_117, 1, x_112); -lean_ctor_set(x_117, 2, x_116); -lean_ctor_set_uint8(x_117, sizeof(void*)*3, x_113); -return x_117; +x_117 = lean_apply_1(x_1, x_112); +x_118 = l_Lean_IR_MapVars_mapFnBody___main(x_1, x_116); +x_119 = lean_alloc_ctor(7, 3, 2); +lean_ctor_set(x_119, 0, x_117); +lean_ctor_set(x_119, 1, x_113); +lean_ctor_set(x_119, 2, x_118); +lean_ctor_set_uint8(x_119, sizeof(void*)*3, x_114); +lean_ctor_set_uint8(x_119, sizeof(void*)*3 + 1, x_115); +return x_119; } } case 8: { -uint8_t x_118; -x_118 = !lean_is_exclusive(x_2); -if (x_118 == 0) +uint8_t x_120; +x_120 = !lean_is_exclusive(x_2); +if (x_120 == 0) { -lean_object* x_119; lean_object* x_120; lean_object* x_121; lean_object* x_122; -x_119 = lean_ctor_get(x_2, 0); -x_120 = lean_ctor_get(x_2, 1); +lean_object* x_121; lean_object* x_122; lean_object* x_123; lean_object* x_124; +x_121 = lean_ctor_get(x_2, 0); +x_122 = lean_ctor_get(x_2, 1); lean_inc(x_1); -x_121 = lean_apply_1(x_1, x_119); -x_122 = l_Lean_IR_MapVars_mapFnBody___main(x_1, x_120); -lean_ctor_set(x_2, 1, x_122); -lean_ctor_set(x_2, 0, x_121); +x_123 = lean_apply_1(x_1, x_121); +x_124 = l_Lean_IR_MapVars_mapFnBody___main(x_1, x_122); +lean_ctor_set(x_2, 1, x_124); +lean_ctor_set(x_2, 0, x_123); return x_2; } else { -lean_object* x_123; lean_object* x_124; lean_object* x_125; lean_object* x_126; lean_object* x_127; -x_123 = lean_ctor_get(x_2, 0); -x_124 = lean_ctor_get(x_2, 1); -lean_inc(x_124); -lean_inc(x_123); +lean_object* x_125; lean_object* x_126; lean_object* x_127; lean_object* x_128; lean_object* x_129; +x_125 = lean_ctor_get(x_2, 0); +x_126 = lean_ctor_get(x_2, 1); +lean_inc(x_126); +lean_inc(x_125); lean_dec(x_2); lean_inc(x_1); -x_125 = lean_apply_1(x_1, x_123); -x_126 = l_Lean_IR_MapVars_mapFnBody___main(x_1, x_124); -x_127 = lean_alloc_ctor(8, 2, 0); -lean_ctor_set(x_127, 0, x_125); -lean_ctor_set(x_127, 1, x_126); -return x_127; +x_127 = lean_apply_1(x_1, x_125); +x_128 = l_Lean_IR_MapVars_mapFnBody___main(x_1, x_126); +x_129 = lean_alloc_ctor(8, 2, 0); +lean_ctor_set(x_129, 0, x_127); +lean_ctor_set(x_129, 1, x_128); +return x_129; } } case 9: { -uint8_t x_128; -x_128 = !lean_is_exclusive(x_2); -if (x_128 == 0) +uint8_t x_130; +x_130 = !lean_is_exclusive(x_2); +if (x_130 == 0) { -lean_object* x_129; lean_object* x_130; -x_129 = lean_ctor_get(x_2, 1); -x_130 = l_Lean_IR_MapVars_mapFnBody___main(x_1, x_129); -lean_ctor_set(x_2, 1, x_130); +lean_object* x_131; lean_object* x_132; +x_131 = lean_ctor_get(x_2, 1); +x_132 = l_Lean_IR_MapVars_mapFnBody___main(x_1, x_131); +lean_ctor_set(x_2, 1, x_132); return x_2; } else { -lean_object* x_131; lean_object* x_132; lean_object* x_133; lean_object* x_134; -x_131 = lean_ctor_get(x_2, 0); -x_132 = lean_ctor_get(x_2, 1); -lean_inc(x_132); -lean_inc(x_131); +lean_object* x_133; lean_object* x_134; lean_object* x_135; lean_object* x_136; +x_133 = lean_ctor_get(x_2, 0); +x_134 = lean_ctor_get(x_2, 1); +lean_inc(x_134); +lean_inc(x_133); lean_dec(x_2); -x_133 = l_Lean_IR_MapVars_mapFnBody___main(x_1, x_132); -x_134 = lean_alloc_ctor(9, 2, 0); -lean_ctor_set(x_134, 0, x_131); -lean_ctor_set(x_134, 1, x_133); -return x_134; +x_135 = l_Lean_IR_MapVars_mapFnBody___main(x_1, x_134); +x_136 = lean_alloc_ctor(9, 2, 0); +lean_ctor_set(x_136, 0, x_133); +lean_ctor_set(x_136, 1, x_135); +return x_136; } } case 10: { -uint8_t x_135; -x_135 = !lean_is_exclusive(x_2); -if (x_135 == 0) +uint8_t x_137; +x_137 = !lean_is_exclusive(x_2); +if (x_137 == 0) { -lean_object* x_136; lean_object* x_137; lean_object* x_138; lean_object* x_139; lean_object* x_140; -x_136 = lean_ctor_get(x_2, 1); -x_137 = lean_ctor_get(x_2, 2); +lean_object* x_138; lean_object* x_139; lean_object* x_140; lean_object* x_141; lean_object* x_142; +x_138 = lean_ctor_get(x_2, 1); +x_139 = lean_ctor_get(x_2, 2); lean_inc(x_1); -x_138 = lean_apply_1(x_1, x_136); -x_139 = lean_unsigned_to_nat(0u); -x_140 = l_Array_ummapAux___main___at_Lean_IR_MapVars_mapFnBody___main___spec__1(x_1, x_139, x_137); -lean_ctor_set(x_2, 2, x_140); -lean_ctor_set(x_2, 1, x_138); +x_140 = lean_apply_1(x_1, x_138); +x_141 = lean_unsigned_to_nat(0u); +x_142 = l_Array_ummapAux___main___at_Lean_IR_MapVars_mapFnBody___main___spec__1(x_1, x_141, x_139); +lean_ctor_set(x_2, 2, x_142); +lean_ctor_set(x_2, 1, x_140); return x_2; } else { -lean_object* x_141; lean_object* x_142; lean_object* x_143; lean_object* x_144; lean_object* x_145; lean_object* x_146; lean_object* x_147; -x_141 = lean_ctor_get(x_2, 0); -x_142 = lean_ctor_get(x_2, 1); -x_143 = lean_ctor_get(x_2, 2); +lean_object* x_143; lean_object* x_144; lean_object* x_145; lean_object* x_146; lean_object* x_147; lean_object* x_148; lean_object* x_149; +x_143 = lean_ctor_get(x_2, 0); +x_144 = lean_ctor_get(x_2, 1); +x_145 = lean_ctor_get(x_2, 2); +lean_inc(x_145); +lean_inc(x_144); lean_inc(x_143); -lean_inc(x_142); -lean_inc(x_141); lean_dec(x_2); lean_inc(x_1); -x_144 = lean_apply_1(x_1, x_142); -x_145 = lean_unsigned_to_nat(0u); -x_146 = l_Array_ummapAux___main___at_Lean_IR_MapVars_mapFnBody___main___spec__1(x_1, x_145, x_143); -x_147 = lean_alloc_ctor(10, 3, 0); -lean_ctor_set(x_147, 0, x_141); -lean_ctor_set(x_147, 1, x_144); -lean_ctor_set(x_147, 2, x_146); -return x_147; +x_146 = lean_apply_1(x_1, x_144); +x_147 = lean_unsigned_to_nat(0u); +x_148 = l_Array_ummapAux___main___at_Lean_IR_MapVars_mapFnBody___main___spec__1(x_1, x_147, x_145); +x_149 = lean_alloc_ctor(10, 3, 0); +lean_ctor_set(x_149, 0, x_143); +lean_ctor_set(x_149, 1, x_146); +lean_ctor_set(x_149, 2, x_148); +return x_149; } } case 11: { -uint8_t x_148; -x_148 = !lean_is_exclusive(x_2); -if (x_148 == 0) -{ -lean_object* x_149; -x_149 = lean_ctor_get(x_2, 0); -if (lean_obj_tag(x_149) == 0) -{ uint8_t x_150; -x_150 = !lean_is_exclusive(x_149); +x_150 = !lean_is_exclusive(x_2); if (x_150 == 0) { -lean_object* x_151; lean_object* x_152; -x_151 = lean_ctor_get(x_149, 0); -x_152 = lean_apply_1(x_1, x_151); -lean_ctor_set(x_149, 0, x_152); -return x_2; -} -else +lean_object* x_151; +x_151 = lean_ctor_get(x_2, 0); +if (lean_obj_tag(x_151) == 0) { -lean_object* x_153; lean_object* x_154; lean_object* x_155; -x_153 = lean_ctor_get(x_149, 0); -lean_inc(x_153); -lean_dec(x_149); +uint8_t x_152; +x_152 = !lean_is_exclusive(x_151); +if (x_152 == 0) +{ +lean_object* x_153; lean_object* x_154; +x_153 = lean_ctor_get(x_151, 0); x_154 = lean_apply_1(x_1, x_153); -x_155 = lean_alloc_ctor(0, 1, 0); -lean_ctor_set(x_155, 0, x_154); -lean_ctor_set(x_2, 0, x_155); +lean_ctor_set(x_151, 0, x_154); +return x_2; +} +else +{ +lean_object* x_155; lean_object* x_156; lean_object* x_157; +x_155 = lean_ctor_get(x_151, 0); +lean_inc(x_155); +lean_dec(x_151); +x_156 = lean_apply_1(x_1, x_155); +x_157 = lean_alloc_ctor(0, 1, 0); +lean_ctor_set(x_157, 0, x_156); +lean_ctor_set(x_2, 0, x_157); return x_2; } } @@ -4040,70 +4048,70 @@ return x_2; } else { -lean_object* x_156; -x_156 = lean_ctor_get(x_2, 0); -lean_inc(x_156); +lean_object* x_158; +x_158 = lean_ctor_get(x_2, 0); +lean_inc(x_158); lean_dec(x_2); -if (lean_obj_tag(x_156) == 0) +if (lean_obj_tag(x_158) == 0) { -lean_object* x_157; lean_object* x_158; lean_object* x_159; lean_object* x_160; lean_object* x_161; -x_157 = lean_ctor_get(x_156, 0); -lean_inc(x_157); -if (lean_is_exclusive(x_156)) { - lean_ctor_release(x_156, 0); - x_158 = x_156; -} else { - lean_dec_ref(x_156); - x_158 = lean_box(0); -} -x_159 = lean_apply_1(x_1, x_157); -if (lean_is_scalar(x_158)) { - x_160 = lean_alloc_ctor(0, 1, 0); -} else { +lean_object* x_159; lean_object* x_160; lean_object* x_161; lean_object* x_162; lean_object* x_163; +x_159 = lean_ctor_get(x_158, 0); +lean_inc(x_159); +if (lean_is_exclusive(x_158)) { + lean_ctor_release(x_158, 0); x_160 = x_158; +} else { + lean_dec_ref(x_158); + x_160 = lean_box(0); } -lean_ctor_set(x_160, 0, x_159); -x_161 = lean_alloc_ctor(11, 1, 0); -lean_ctor_set(x_161, 0, x_160); -return x_161; +x_161 = lean_apply_1(x_1, x_159); +if (lean_is_scalar(x_160)) { + x_162 = lean_alloc_ctor(0, 1, 0); +} else { + x_162 = x_160; +} +lean_ctor_set(x_162, 0, x_161); +x_163 = lean_alloc_ctor(11, 1, 0); +lean_ctor_set(x_163, 0, x_162); +return x_163; } else { -lean_object* x_162; +lean_object* x_164; lean_dec(x_1); -x_162 = lean_alloc_ctor(11, 1, 0); -lean_ctor_set(x_162, 0, x_156); -return x_162; +x_164 = lean_alloc_ctor(11, 1, 0); +lean_ctor_set(x_164, 0, x_158); +return x_164; } } } case 12: { -uint8_t x_163; -x_163 = !lean_is_exclusive(x_2); -if (x_163 == 0) +uint8_t x_165; +x_165 = !lean_is_exclusive(x_2); +if (x_165 == 0) { -lean_object* x_164; lean_object* x_165; lean_object* x_166; -x_164 = lean_ctor_get(x_2, 1); -x_165 = lean_unsigned_to_nat(0u); -x_166 = l_Array_ummapAux___main___at_Lean_IR_MapVars_mapArgs___spec__1(x_1, x_165, x_164); -lean_ctor_set(x_2, 1, x_166); +lean_object* x_166; lean_object* x_167; lean_object* x_168; +x_166 = lean_ctor_get(x_2, 1); +x_167 = lean_unsigned_to_nat(0u); +x_168 = l_Array_ummapAux___main___at_Lean_IR_MapVars_mapArgs___spec__1(x_1, x_167, x_166); +lean_ctor_set(x_2, 1, x_168); return x_2; } else { -lean_object* x_167; lean_object* x_168; lean_object* x_169; lean_object* x_170; lean_object* x_171; -x_167 = lean_ctor_get(x_2, 0); -x_168 = lean_ctor_get(x_2, 1); -lean_inc(x_168); -lean_inc(x_167); +lean_object* x_169; lean_object* x_170; lean_object* x_171; lean_object* x_172; lean_object* x_173; +x_169 = lean_ctor_get(x_2, 0); +x_170 = lean_ctor_get(x_2, 1); +lean_inc(x_170); +lean_inc(x_169); lean_dec(x_2); -x_169 = lean_unsigned_to_nat(0u); -x_170 = l_Array_ummapAux___main___at_Lean_IR_MapVars_mapArgs___spec__1(x_1, x_169, x_168); -x_171 = lean_alloc_ctor(12, 2, 0); -lean_ctor_set(x_171, 0, x_167); -lean_ctor_set(x_171, 1, x_170); -return x_171; +x_171 = lean_unsigned_to_nat(0u); +x_172 = l_Array_ummapAux___main___at_Lean_IR_MapVars_mapArgs___spec__1(x_1, x_171, x_170); +x_173 = lean_alloc_ctor(12, 2, 0); +lean_ctor_set(x_173, 0, x_169); +lean_ctor_set(x_173, 1, x_172); +return x_173; } } default: @@ -5996,400 +6004,406 @@ return x_3; } else { -lean_object* x_125; lean_object* x_126; uint8_t x_127; lean_object* x_128; uint8_t x_129; lean_object* x_130; +lean_object* x_125; lean_object* x_126; uint8_t x_127; uint8_t x_128; lean_object* x_129; uint8_t x_130; lean_object* x_131; x_125 = lean_ctor_get(x_3, 0); x_126 = lean_ctor_get(x_3, 1); x_127 = lean_ctor_get_uint8(x_3, sizeof(void*)*3); -x_128 = lean_ctor_get(x_3, 2); -lean_inc(x_128); +x_128 = lean_ctor_get_uint8(x_3, sizeof(void*)*3 + 1); +x_129 = lean_ctor_get(x_3, 2); +lean_inc(x_129); lean_inc(x_126); lean_inc(x_125); lean_dec(x_3); -x_129 = lean_nat_dec_eq(x_1, x_125); +x_130 = lean_nat_dec_eq(x_1, x_125); lean_inc(x_2); -x_130 = l_Lean_IR_MapVars_mapFnBody___main___at_Lean_IR_FnBody_replaceVar___spec__1(x_1, x_2, x_128); -if (x_129 == 0) +x_131 = l_Lean_IR_MapVars_mapFnBody___main___at_Lean_IR_FnBody_replaceVar___spec__1(x_1, x_2, x_129); +if (x_130 == 0) { -lean_object* x_131; +lean_object* x_132; lean_dec(x_2); -x_131 = lean_alloc_ctor(6, 3, 1); -lean_ctor_set(x_131, 0, x_125); -lean_ctor_set(x_131, 1, x_126); -lean_ctor_set(x_131, 2, x_130); -lean_ctor_set_uint8(x_131, sizeof(void*)*3, x_127); -return x_131; +x_132 = lean_alloc_ctor(6, 3, 2); +lean_ctor_set(x_132, 0, x_125); +lean_ctor_set(x_132, 1, x_126); +lean_ctor_set(x_132, 2, x_131); +lean_ctor_set_uint8(x_132, sizeof(void*)*3, x_127); +lean_ctor_set_uint8(x_132, sizeof(void*)*3 + 1, x_128); +return x_132; } else { -lean_object* x_132; +lean_object* x_133; lean_dec(x_125); -x_132 = lean_alloc_ctor(6, 3, 1); -lean_ctor_set(x_132, 0, x_2); -lean_ctor_set(x_132, 1, x_126); -lean_ctor_set(x_132, 2, x_130); -lean_ctor_set_uint8(x_132, sizeof(void*)*3, x_127); -return x_132; +x_133 = lean_alloc_ctor(6, 3, 2); +lean_ctor_set(x_133, 0, x_2); +lean_ctor_set(x_133, 1, x_126); +lean_ctor_set(x_133, 2, x_131); +lean_ctor_set_uint8(x_133, sizeof(void*)*3, x_127); +lean_ctor_set_uint8(x_133, sizeof(void*)*3 + 1, x_128); +return x_133; } } } case 7: { -uint8_t x_133; -x_133 = !lean_is_exclusive(x_3); -if (x_133 == 0) +uint8_t x_134; +x_134 = !lean_is_exclusive(x_3); +if (x_134 == 0) { -lean_object* x_134; lean_object* x_135; uint8_t x_136; lean_object* x_137; -x_134 = lean_ctor_get(x_3, 0); -x_135 = lean_ctor_get(x_3, 2); -x_136 = lean_nat_dec_eq(x_1, x_134); +lean_object* x_135; lean_object* x_136; uint8_t x_137; lean_object* x_138; +x_135 = lean_ctor_get(x_3, 0); +x_136 = lean_ctor_get(x_3, 2); +x_137 = lean_nat_dec_eq(x_1, x_135); lean_inc(x_2); -x_137 = l_Lean_IR_MapVars_mapFnBody___main___at_Lean_IR_FnBody_replaceVar___spec__1(x_1, x_2, x_135); -if (x_136 == 0) +x_138 = l_Lean_IR_MapVars_mapFnBody___main___at_Lean_IR_FnBody_replaceVar___spec__1(x_1, x_2, x_136); +if (x_137 == 0) { lean_dec(x_2); -lean_ctor_set(x_3, 2, x_137); +lean_ctor_set(x_3, 2, x_138); return x_3; } else { -lean_dec(x_134); -lean_ctor_set(x_3, 2, x_137); +lean_dec(x_135); +lean_ctor_set(x_3, 2, x_138); lean_ctor_set(x_3, 0, x_2); return x_3; } } else { -lean_object* x_138; lean_object* x_139; uint8_t x_140; lean_object* x_141; uint8_t x_142; lean_object* x_143; -x_138 = lean_ctor_get(x_3, 0); -x_139 = lean_ctor_get(x_3, 1); -x_140 = lean_ctor_get_uint8(x_3, sizeof(void*)*3); -x_141 = lean_ctor_get(x_3, 2); -lean_inc(x_141); +lean_object* x_139; lean_object* x_140; uint8_t x_141; uint8_t x_142; lean_object* x_143; uint8_t x_144; lean_object* x_145; +x_139 = lean_ctor_get(x_3, 0); +x_140 = lean_ctor_get(x_3, 1); +x_141 = lean_ctor_get_uint8(x_3, sizeof(void*)*3); +x_142 = lean_ctor_get_uint8(x_3, sizeof(void*)*3 + 1); +x_143 = lean_ctor_get(x_3, 2); +lean_inc(x_143); +lean_inc(x_140); lean_inc(x_139); -lean_inc(x_138); lean_dec(x_3); -x_142 = lean_nat_dec_eq(x_1, x_138); +x_144 = lean_nat_dec_eq(x_1, x_139); lean_inc(x_2); -x_143 = l_Lean_IR_MapVars_mapFnBody___main___at_Lean_IR_FnBody_replaceVar___spec__1(x_1, x_2, x_141); -if (x_142 == 0) +x_145 = l_Lean_IR_MapVars_mapFnBody___main___at_Lean_IR_FnBody_replaceVar___spec__1(x_1, x_2, x_143); +if (x_144 == 0) { -lean_object* x_144; +lean_object* x_146; lean_dec(x_2); -x_144 = lean_alloc_ctor(7, 3, 1); -lean_ctor_set(x_144, 0, x_138); -lean_ctor_set(x_144, 1, x_139); -lean_ctor_set(x_144, 2, x_143); -lean_ctor_set_uint8(x_144, sizeof(void*)*3, x_140); -return x_144; +x_146 = lean_alloc_ctor(7, 3, 2); +lean_ctor_set(x_146, 0, x_139); +lean_ctor_set(x_146, 1, x_140); +lean_ctor_set(x_146, 2, x_145); +lean_ctor_set_uint8(x_146, sizeof(void*)*3, x_141); +lean_ctor_set_uint8(x_146, sizeof(void*)*3 + 1, x_142); +return x_146; } else { -lean_object* x_145; -lean_dec(x_138); -x_145 = lean_alloc_ctor(7, 3, 1); -lean_ctor_set(x_145, 0, x_2); -lean_ctor_set(x_145, 1, x_139); -lean_ctor_set(x_145, 2, x_143); -lean_ctor_set_uint8(x_145, sizeof(void*)*3, x_140); -return x_145; +lean_object* x_147; +lean_dec(x_139); +x_147 = lean_alloc_ctor(7, 3, 2); +lean_ctor_set(x_147, 0, x_2); +lean_ctor_set(x_147, 1, x_140); +lean_ctor_set(x_147, 2, x_145); +lean_ctor_set_uint8(x_147, sizeof(void*)*3, x_141); +lean_ctor_set_uint8(x_147, sizeof(void*)*3 + 1, x_142); +return x_147; } } } case 8: { -uint8_t x_146; -x_146 = !lean_is_exclusive(x_3); -if (x_146 == 0) +uint8_t x_148; +x_148 = !lean_is_exclusive(x_3); +if (x_148 == 0) { -lean_object* x_147; lean_object* x_148; uint8_t x_149; lean_object* x_150; -x_147 = lean_ctor_get(x_3, 0); -x_148 = lean_ctor_get(x_3, 1); -x_149 = lean_nat_dec_eq(x_1, x_147); +lean_object* x_149; lean_object* x_150; uint8_t x_151; lean_object* x_152; +x_149 = lean_ctor_get(x_3, 0); +x_150 = lean_ctor_get(x_3, 1); +x_151 = lean_nat_dec_eq(x_1, x_149); lean_inc(x_2); -x_150 = l_Lean_IR_MapVars_mapFnBody___main___at_Lean_IR_FnBody_replaceVar___spec__1(x_1, x_2, x_148); -if (x_149 == 0) +x_152 = l_Lean_IR_MapVars_mapFnBody___main___at_Lean_IR_FnBody_replaceVar___spec__1(x_1, x_2, x_150); +if (x_151 == 0) { lean_dec(x_2); -lean_ctor_set(x_3, 1, x_150); +lean_ctor_set(x_3, 1, x_152); return x_3; } else { -lean_dec(x_147); -lean_ctor_set(x_3, 1, x_150); +lean_dec(x_149); +lean_ctor_set(x_3, 1, x_152); lean_ctor_set(x_3, 0, x_2); return x_3; } } else { -lean_object* x_151; lean_object* x_152; uint8_t x_153; lean_object* x_154; -x_151 = lean_ctor_get(x_3, 0); -x_152 = lean_ctor_get(x_3, 1); -lean_inc(x_152); -lean_inc(x_151); +lean_object* x_153; lean_object* x_154; uint8_t x_155; lean_object* x_156; +x_153 = lean_ctor_get(x_3, 0); +x_154 = lean_ctor_get(x_3, 1); +lean_inc(x_154); +lean_inc(x_153); lean_dec(x_3); -x_153 = lean_nat_dec_eq(x_1, x_151); +x_155 = lean_nat_dec_eq(x_1, x_153); lean_inc(x_2); -x_154 = l_Lean_IR_MapVars_mapFnBody___main___at_Lean_IR_FnBody_replaceVar___spec__1(x_1, x_2, x_152); -if (x_153 == 0) +x_156 = l_Lean_IR_MapVars_mapFnBody___main___at_Lean_IR_FnBody_replaceVar___spec__1(x_1, x_2, x_154); +if (x_155 == 0) { -lean_object* x_155; +lean_object* x_157; lean_dec(x_2); -x_155 = lean_alloc_ctor(8, 2, 0); -lean_ctor_set(x_155, 0, x_151); -lean_ctor_set(x_155, 1, x_154); -return x_155; +x_157 = lean_alloc_ctor(8, 2, 0); +lean_ctor_set(x_157, 0, x_153); +lean_ctor_set(x_157, 1, x_156); +return x_157; } else { -lean_object* x_156; -lean_dec(x_151); -x_156 = lean_alloc_ctor(8, 2, 0); -lean_ctor_set(x_156, 0, x_2); -lean_ctor_set(x_156, 1, x_154); -return x_156; +lean_object* x_158; +lean_dec(x_153); +x_158 = lean_alloc_ctor(8, 2, 0); +lean_ctor_set(x_158, 0, x_2); +lean_ctor_set(x_158, 1, x_156); +return x_158; } } } case 9: { -uint8_t x_157; -x_157 = !lean_is_exclusive(x_3); -if (x_157 == 0) +uint8_t x_159; +x_159 = !lean_is_exclusive(x_3); +if (x_159 == 0) { -lean_object* x_158; lean_object* x_159; -x_158 = lean_ctor_get(x_3, 1); -x_159 = l_Lean_IR_MapVars_mapFnBody___main___at_Lean_IR_FnBody_replaceVar___spec__1(x_1, x_2, x_158); -lean_ctor_set(x_3, 1, x_159); +lean_object* x_160; lean_object* x_161; +x_160 = lean_ctor_get(x_3, 1); +x_161 = l_Lean_IR_MapVars_mapFnBody___main___at_Lean_IR_FnBody_replaceVar___spec__1(x_1, x_2, x_160); +lean_ctor_set(x_3, 1, x_161); return x_3; } else { -lean_object* x_160; lean_object* x_161; lean_object* x_162; lean_object* x_163; -x_160 = lean_ctor_get(x_3, 0); -x_161 = lean_ctor_get(x_3, 1); -lean_inc(x_161); -lean_inc(x_160); +lean_object* x_162; lean_object* x_163; lean_object* x_164; lean_object* x_165; +x_162 = lean_ctor_get(x_3, 0); +x_163 = lean_ctor_get(x_3, 1); +lean_inc(x_163); +lean_inc(x_162); lean_dec(x_3); -x_162 = l_Lean_IR_MapVars_mapFnBody___main___at_Lean_IR_FnBody_replaceVar___spec__1(x_1, x_2, x_161); -x_163 = lean_alloc_ctor(9, 2, 0); -lean_ctor_set(x_163, 0, x_160); -lean_ctor_set(x_163, 1, x_162); -return x_163; +x_164 = l_Lean_IR_MapVars_mapFnBody___main___at_Lean_IR_FnBody_replaceVar___spec__1(x_1, x_2, x_163); +x_165 = lean_alloc_ctor(9, 2, 0); +lean_ctor_set(x_165, 0, x_162); +lean_ctor_set(x_165, 1, x_164); +return x_165; } } case 10: { -uint8_t x_164; -x_164 = !lean_is_exclusive(x_3); -if (x_164 == 0) +uint8_t x_166; +x_166 = !lean_is_exclusive(x_3); +if (x_166 == 0) { -lean_object* x_165; lean_object* x_166; uint8_t x_167; lean_object* x_168; lean_object* x_169; -x_165 = lean_ctor_get(x_3, 1); -x_166 = lean_ctor_get(x_3, 2); -x_167 = lean_nat_dec_eq(x_1, x_165); -x_168 = lean_unsigned_to_nat(0u); +lean_object* x_167; lean_object* x_168; uint8_t x_169; lean_object* x_170; lean_object* x_171; +x_167 = lean_ctor_get(x_3, 1); +x_168 = lean_ctor_get(x_3, 2); +x_169 = lean_nat_dec_eq(x_1, x_167); +x_170 = lean_unsigned_to_nat(0u); lean_inc(x_2); -x_169 = l_Array_ummapAux___main___at_Lean_IR_FnBody_replaceVar___spec__13(x_1, x_2, x_168, x_166); -if (x_167 == 0) +x_171 = l_Array_ummapAux___main___at_Lean_IR_FnBody_replaceVar___spec__13(x_1, x_2, x_170, x_168); +if (x_169 == 0) { lean_dec(x_2); -lean_ctor_set(x_3, 2, x_169); +lean_ctor_set(x_3, 2, x_171); return x_3; } else { -lean_dec(x_165); -lean_ctor_set(x_3, 2, x_169); +lean_dec(x_167); +lean_ctor_set(x_3, 2, x_171); lean_ctor_set(x_3, 1, x_2); return x_3; } } else { -lean_object* x_170; lean_object* x_171; lean_object* x_172; uint8_t x_173; lean_object* x_174; lean_object* x_175; -x_170 = lean_ctor_get(x_3, 0); -x_171 = lean_ctor_get(x_3, 1); -x_172 = lean_ctor_get(x_3, 2); +lean_object* x_172; lean_object* x_173; lean_object* x_174; uint8_t x_175; lean_object* x_176; lean_object* x_177; +x_172 = lean_ctor_get(x_3, 0); +x_173 = lean_ctor_get(x_3, 1); +x_174 = lean_ctor_get(x_3, 2); +lean_inc(x_174); +lean_inc(x_173); lean_inc(x_172); -lean_inc(x_171); -lean_inc(x_170); lean_dec(x_3); -x_173 = lean_nat_dec_eq(x_1, x_171); -x_174 = lean_unsigned_to_nat(0u); +x_175 = lean_nat_dec_eq(x_1, x_173); +x_176 = lean_unsigned_to_nat(0u); lean_inc(x_2); -x_175 = l_Array_ummapAux___main___at_Lean_IR_FnBody_replaceVar___spec__13(x_1, x_2, x_174, x_172); -if (x_173 == 0) +x_177 = l_Array_ummapAux___main___at_Lean_IR_FnBody_replaceVar___spec__13(x_1, x_2, x_176, x_174); +if (x_175 == 0) { -lean_object* x_176; +lean_object* x_178; lean_dec(x_2); -x_176 = lean_alloc_ctor(10, 3, 0); -lean_ctor_set(x_176, 0, x_170); -lean_ctor_set(x_176, 1, x_171); -lean_ctor_set(x_176, 2, x_175); -return x_176; +x_178 = lean_alloc_ctor(10, 3, 0); +lean_ctor_set(x_178, 0, x_172); +lean_ctor_set(x_178, 1, x_173); +lean_ctor_set(x_178, 2, x_177); +return x_178; } else { -lean_object* x_177; -lean_dec(x_171); -x_177 = lean_alloc_ctor(10, 3, 0); -lean_ctor_set(x_177, 0, x_170); -lean_ctor_set(x_177, 1, x_2); -lean_ctor_set(x_177, 2, x_175); -return x_177; +lean_object* x_179; +lean_dec(x_173); +x_179 = lean_alloc_ctor(10, 3, 0); +lean_ctor_set(x_179, 0, x_172); +lean_ctor_set(x_179, 1, x_2); +lean_ctor_set(x_179, 2, x_177); +return x_179; } } } case 11: { -uint8_t x_178; -x_178 = !lean_is_exclusive(x_3); -if (x_178 == 0) -{ -lean_object* x_179; -x_179 = lean_ctor_get(x_3, 0); -if (lean_obj_tag(x_179) == 0) -{ uint8_t x_180; -x_180 = !lean_is_exclusive(x_179); +x_180 = !lean_is_exclusive(x_3); if (x_180 == 0) { -lean_object* x_181; uint8_t x_182; -x_181 = lean_ctor_get(x_179, 0); -x_182 = lean_nat_dec_eq(x_1, x_181); +lean_object* x_181; +x_181 = lean_ctor_get(x_3, 0); +if (lean_obj_tag(x_181) == 0) +{ +uint8_t x_182; +x_182 = !lean_is_exclusive(x_181); if (x_182 == 0) { -lean_dec(x_2); -return x_3; -} -else -{ -lean_dec(x_181); -lean_ctor_set(x_179, 0, x_2); -return x_3; -} -} -else -{ lean_object* x_183; uint8_t x_184; -x_183 = lean_ctor_get(x_179, 0); -lean_inc(x_183); -lean_dec(x_179); +x_183 = lean_ctor_get(x_181, 0); x_184 = lean_nat_dec_eq(x_1, x_183); if (x_184 == 0) { -lean_object* x_185; lean_dec(x_2); -x_185 = lean_alloc_ctor(0, 1, 0); -lean_ctor_set(x_185, 0, x_183); -lean_ctor_set(x_3, 0, x_185); return x_3; } else { -lean_object* x_186; lean_dec(x_183); -x_186 = lean_alloc_ctor(0, 1, 0); -lean_ctor_set(x_186, 0, x_2); -lean_ctor_set(x_3, 0, x_186); +lean_ctor_set(x_181, 0, x_2); return x_3; } } -} else { -lean_dec(x_2); -return x_3; -} -} -else +lean_object* x_185; uint8_t x_186; +x_185 = lean_ctor_get(x_181, 0); +lean_inc(x_185); +lean_dec(x_181); +x_186 = lean_nat_dec_eq(x_1, x_185); +if (x_186 == 0) { lean_object* x_187; -x_187 = lean_ctor_get(x_3, 0); -lean_inc(x_187); -lean_dec(x_3); -if (lean_obj_tag(x_187) == 0) -{ -lean_object* x_188; lean_object* x_189; uint8_t x_190; -x_188 = lean_ctor_get(x_187, 0); -lean_inc(x_188); -if (lean_is_exclusive(x_187)) { - lean_ctor_release(x_187, 0); - x_189 = x_187; -} else { - lean_dec_ref(x_187); - x_189 = lean_box(0); -} -x_190 = lean_nat_dec_eq(x_1, x_188); -if (x_190 == 0) -{ -lean_object* x_191; lean_object* x_192; lean_dec(x_2); -if (lean_is_scalar(x_189)) { - x_191 = lean_alloc_ctor(0, 1, 0); -} else { - x_191 = x_189; -} -lean_ctor_set(x_191, 0, x_188); -x_192 = lean_alloc_ctor(11, 1, 0); -lean_ctor_set(x_192, 0, x_191); -return x_192; +x_187 = lean_alloc_ctor(0, 1, 0); +lean_ctor_set(x_187, 0, x_185); +lean_ctor_set(x_3, 0, x_187); +return x_3; } else { +lean_object* x_188; +lean_dec(x_185); +x_188 = lean_alloc_ctor(0, 1, 0); +lean_ctor_set(x_188, 0, x_2); +lean_ctor_set(x_3, 0, x_188); +return x_3; +} +} +} +else +{ +lean_dec(x_2); +return x_3; +} +} +else +{ +lean_object* x_189; +x_189 = lean_ctor_get(x_3, 0); +lean_inc(x_189); +lean_dec(x_3); +if (lean_obj_tag(x_189) == 0) +{ +lean_object* x_190; lean_object* x_191; uint8_t x_192; +x_190 = lean_ctor_get(x_189, 0); +lean_inc(x_190); +if (lean_is_exclusive(x_189)) { + lean_ctor_release(x_189, 0); + x_191 = x_189; +} else { + lean_dec_ref(x_189); + x_191 = lean_box(0); +} +x_192 = lean_nat_dec_eq(x_1, x_190); +if (x_192 == 0) +{ lean_object* x_193; lean_object* x_194; -lean_dec(x_188); -if (lean_is_scalar(x_189)) { +lean_dec(x_2); +if (lean_is_scalar(x_191)) { x_193 = lean_alloc_ctor(0, 1, 0); } else { - x_193 = x_189; + x_193 = x_191; } -lean_ctor_set(x_193, 0, x_2); +lean_ctor_set(x_193, 0, x_190); x_194 = lean_alloc_ctor(11, 1, 0); lean_ctor_set(x_194, 0, x_193); return x_194; } +else +{ +lean_object* x_195; lean_object* x_196; +lean_dec(x_190); +if (lean_is_scalar(x_191)) { + x_195 = lean_alloc_ctor(0, 1, 0); +} else { + x_195 = x_191; +} +lean_ctor_set(x_195, 0, x_2); +x_196 = lean_alloc_ctor(11, 1, 0); +lean_ctor_set(x_196, 0, x_195); +return x_196; +} } else { -lean_object* x_195; +lean_object* x_197; lean_dec(x_2); -x_195 = lean_alloc_ctor(11, 1, 0); -lean_ctor_set(x_195, 0, x_187); -return x_195; +x_197 = lean_alloc_ctor(11, 1, 0); +lean_ctor_set(x_197, 0, x_189); +return x_197; } } } case 12: { -uint8_t x_196; -x_196 = !lean_is_exclusive(x_3); -if (x_196 == 0) +uint8_t x_198; +x_198 = !lean_is_exclusive(x_3); +if (x_198 == 0) { -lean_object* x_197; lean_object* x_198; lean_object* x_199; -x_197 = lean_ctor_get(x_3, 1); -x_198 = lean_unsigned_to_nat(0u); -x_199 = l_Array_ummapAux___main___at_Lean_IR_FnBody_replaceVar___spec__15(x_1, x_2, x_198, x_197); -lean_ctor_set(x_3, 1, x_199); +lean_object* x_199; lean_object* x_200; lean_object* x_201; +x_199 = lean_ctor_get(x_3, 1); +x_200 = lean_unsigned_to_nat(0u); +x_201 = l_Array_ummapAux___main___at_Lean_IR_FnBody_replaceVar___spec__15(x_1, x_2, x_200, x_199); +lean_ctor_set(x_3, 1, x_201); return x_3; } else { -lean_object* x_200; lean_object* x_201; lean_object* x_202; lean_object* x_203; lean_object* x_204; -x_200 = lean_ctor_get(x_3, 0); -x_201 = lean_ctor_get(x_3, 1); -lean_inc(x_201); -lean_inc(x_200); +lean_object* x_202; lean_object* x_203; lean_object* x_204; lean_object* x_205; lean_object* x_206; +x_202 = lean_ctor_get(x_3, 0); +x_203 = lean_ctor_get(x_3, 1); +lean_inc(x_203); +lean_inc(x_202); lean_dec(x_3); -x_202 = lean_unsigned_to_nat(0u); -x_203 = l_Array_ummapAux___main___at_Lean_IR_FnBody_replaceVar___spec__15(x_1, x_2, x_202, x_201); -x_204 = lean_alloc_ctor(12, 2, 0); -lean_ctor_set(x_204, 0, x_200); -lean_ctor_set(x_204, 1, x_203); -return x_204; +x_204 = lean_unsigned_to_nat(0u); +x_205 = l_Array_ummapAux___main___at_Lean_IR_FnBody_replaceVar___spec__15(x_1, x_2, x_204, x_203); +x_206 = lean_alloc_ctor(12, 2, 0); +lean_ctor_set(x_206, 0, x_202); +lean_ctor_set(x_206, 1, x_205); +return x_206; } } default: diff --git a/src/stage0/init/lean/compiler/ir/rc.c b/src/stage0/init/lean/compiler/ir/rc.c index 6bdf28399f..f95397bb7e 100644 --- a/src/stage0/init/lean/compiler/ir/rc.c +++ b/src/stage0/init/lean/compiler/ir/rc.c @@ -14,7 +14,7 @@ extern "C" { #endif lean_object* l_unsafeCast(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l___private_init_lean_compiler_ir_rc_11__addDecForDeadParams___boxed(lean_object*, lean_object*, lean_object*); +lean_object* l___private_init_lean_compiler_ir_rc_11__addDecForDeadParams___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_init_lean_compiler_ir_rc_8__addIncBefore(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_init_lean_compiler_ir_rc_9__addDecAfterFullApp(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_IR_explicitRC___boxed(lean_object*, lean_object*, lean_object*); @@ -23,10 +23,12 @@ lean_object* lean_nat_sub(lean_object*, lean_object*); lean_object* l_Lean_IR_ExplicitRC_getJPParams(lean_object*, lean_object*); lean_object* l_Lean_IR_ExplicitRC_getVarInfo___boxed(lean_object*, lean_object*); lean_object* l_RBNode_find___main___at___private_init_lean_compiler_ir_livevars_7__collectJP___spec__1(lean_object*, lean_object*); +lean_object* l_Lean_IR_ExplicitRC_addDec___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_IR_ExplicitRC_visitFnBody___main(lean_object*, lean_object*); lean_object* l_Nat_anyAux___main___at___private_init_lean_compiler_ir_rc_10__addIncBeforeConsumeAll___spec__5___boxed(lean_object*, lean_object*); lean_object* l___private_init_lean_compiler_ir_rc_7__addIncBeforeAux___at___private_init_lean_compiler_ir_rc_10__addIncBeforeConsumeAll___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Nat_foldAux___main___at___private_init_lean_compiler_ir_rc_7__addIncBeforeAux___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_IR_ExplicitRC_addInc___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_init_lean_compiler_ir_rc_2__addDecForAlt___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_init_lean_compiler_ir_rc_7__addIncBeforeAux___at___private_init_lean_compiler_ir_rc_8__addIncBefore___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Nat_anyAux___main___at___private_init_lean_compiler_ir_rc_5__isBorrowParam___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -47,7 +49,7 @@ lean_object* l___private_init_lean_compiler_ir_rc_7__addIncBeforeAux(lean_object lean_object* l_Array_miterateAux___main___at_Lean_IR_ExplicitRC_updateVarInfoWithParams___spec__1(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Array_ummapAux___main___at_Lean_IR_ExplicitRC_visitFnBody___main___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_init_lean_compiler_ir_rc_8__addIncBefore___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_Lean_IR_ExplicitRC_addDec(lean_object*, lean_object*); +lean_object* l_Lean_IR_ExplicitRC_addDec(lean_object*, lean_object*, lean_object*); uint8_t l___private_init_lean_compiler_ir_rc_4__isBorrowParamAux___at___private_init_lean_compiler_ir_rc_8__addIncBefore___spec__4(lean_object*, lean_object*, lean_object*); lean_object* l_RBNode_fold___main___at___private_init_lean_compiler_ir_rc_2__addDecForAlt___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_init_lean_compiler_ir_rc_7__addIncBeforeAux___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -83,7 +85,7 @@ lean_object* l___private_init_lean_compiler_ir_rc_12__isPersistent___boxed(lean_ lean_object* l___private_init_lean_compiler_ir_rc_4__isBorrowParamAux___at___private_init_lean_compiler_ir_rc_10__addIncBeforeConsumeAll___spec__4___boxed(lean_object*); lean_object* l___private_init_lean_compiler_ir_rc_6__getNumConsumptions___boxed(lean_object*, lean_object*, lean_object*); lean_object* l___private_init_lean_compiler_ir_rc_6__getNumConsumptions___at___private_init_lean_compiler_ir_rc_10__addIncBeforeConsumeAll___spec__2___boxed(lean_object*, lean_object*); -lean_object* l___private_init_lean_compiler_ir_rc_11__addDecForDeadParams(lean_object*, lean_object*, lean_object*); +lean_object* l___private_init_lean_compiler_ir_rc_11__addDecForDeadParams(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Nat_foldAux___main___at___private_init_lean_compiler_ir_rc_9__addDecAfterFullApp___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_init_lean_compiler_ir_rc_4__isBorrowParamAux___boxed(lean_object*, lean_object*, lean_object*); lean_object* l___private_init_lean_compiler_ir_rc_7__addIncBeforeAux___at___private_init_lean_compiler_ir_rc_8__addIncBefore___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -102,7 +104,7 @@ uint8_t l___private_init_lean_compiler_ir_rc_4__isBorrowParamAux___at___private_ lean_object* l_Nat_anyAux___main___at___private_init_lean_compiler_ir_rc_8__addIncBefore___spec__5___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_RBNode_ins___main___at___private_init_lean_compiler_ir_rc_1__updateRefUsingCtorInfo___spec__2(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_IR_ExplicitRC_getJPParams___boxed(lean_object*, lean_object*); -lean_object* l_Lean_IR_ExplicitRC_addInc(lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_IR_ExplicitRC_addInc(lean_object*, lean_object*, lean_object*, lean_object*); uint8_t l___private_init_lean_compiler_ir_rc_4__isBorrowParamAux(lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_maxSmallNat; lean_object* l_Lean_IR_LiveVars_collectFnBody___main(lean_object*, lean_object*, lean_object*); @@ -119,7 +121,7 @@ lean_object* l_Nat_foldAux___main___at___private_init_lean_compiler_ir_rc_6__get lean_object* l_Array_get(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Array_miterateAux___main___at_Lean_IR_ExplicitRC_updateVarInfoWithParams___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_init_lean_compiler_ir_rc_9__addDecAfterFullApp___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_Array_miterateAux___main___at___private_init_lean_compiler_ir_rc_11__addDecForDeadParams___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Array_miterateAux___main___at___private_init_lean_compiler_ir_rc_11__addDecForDeadParams___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_init_lean_compiler_ir_rc_2__addDecForAlt(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_init_lean_compiler_ir_rc_6__getNumConsumptions___at___private_init_lean_compiler_ir_rc_10__addIncBeforeConsumeAll___spec__2(lean_object*, lean_object*); lean_object* l_RBNode_setBlack___rarg(lean_object*); @@ -152,7 +154,7 @@ lean_object* l_Lean_IR_ExplicitRC_getJPLiveVars(lean_object*, lean_object*); uint8_t l_Lean_IR_IRType_isObj(uint8_t); lean_object* l_Nat_foldAux___main___at___private_init_lean_compiler_ir_rc_8__addIncBefore___spec__6___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_IR_ExplicitRC_getVarInfo(lean_object*, lean_object*); -lean_object* l_Array_miterateAux___main___at___private_init_lean_compiler_ir_rc_11__addDecForDeadParams___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Array_miterateAux___main___at___private_init_lean_compiler_ir_rc_11__addDecForDeadParams___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_IR_Arg_Inhabited; lean_object* l_RBNode_findCore___main___at___private_init_lean_compiler_ir_rc_2__addDecForAlt___spec__1(lean_object*, lean_object*); lean_object* l_Array_ummapAux___main___at_Lean_IR_explicitRC___spec__1(lean_object*, lean_object*, lean_object*, lean_object*); @@ -367,21 +369,9 @@ return x_5; else { uint8_t x_6; -x_6 = lean_ctor_get_uint8(x_3, 1); -if (x_6 == 0) -{ -uint8_t x_7; -x_7 = lean_ctor_get_uint8(x_3, 2); +x_6 = lean_ctor_get_uint8(x_3, 2); lean_dec(x_3); -return x_7; -} -else -{ -uint8_t x_8; -lean_dec(x_3); -x_8 = 0; -return x_8; -} +return x_6; } } } @@ -396,45 +386,72 @@ x_4 = lean_box(x_3); return x_4; } } -lean_object* l_Lean_IR_ExplicitRC_addInc(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +lean_object* l_Lean_IR_ExplicitRC_addInc(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { -lean_object* x_4; uint8_t x_5; -x_4 = lean_unsigned_to_nat(0u); -x_5 = lean_nat_dec_eq(x_3, x_4); -if (x_5 == 0) +lean_object* x_5; lean_object* x_6; uint8_t x_7; +x_5 = l_Lean_IR_ExplicitRC_getVarInfo(x_1, x_2); +x_6 = lean_unsigned_to_nat(0u); +x_7 = lean_nat_dec_eq(x_4, x_6); +if (x_7 == 0) { -uint8_t x_6; lean_object* x_7; -x_6 = 1; -x_7 = lean_alloc_ctor(6, 3, 1); -lean_ctor_set(x_7, 0, x_1); -lean_ctor_set(x_7, 1, x_3); -lean_ctor_set(x_7, 2, x_2); -lean_ctor_set_uint8(x_7, sizeof(void*)*3, x_6); -return x_7; +uint8_t x_8; uint8_t x_9; lean_object* x_10; +x_8 = lean_ctor_get_uint8(x_5, 1); +lean_dec(x_5); +x_9 = 1; +x_10 = lean_alloc_ctor(6, 3, 2); +lean_ctor_set(x_10, 0, x_2); +lean_ctor_set(x_10, 1, x_4); +lean_ctor_set(x_10, 2, x_3); +lean_ctor_set_uint8(x_10, sizeof(void*)*3, x_9); +lean_ctor_set_uint8(x_10, sizeof(void*)*3 + 1, x_8); +return x_10; } else { -lean_dec(x_3); -lean_dec(x_1); -return x_2; +lean_dec(x_5); +lean_dec(x_4); +lean_dec(x_2); +return x_3; } } } -lean_object* l_Lean_IR_ExplicitRC_addDec(lean_object* x_1, lean_object* x_2) { +lean_object* l_Lean_IR_ExplicitRC_addInc___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { -lean_object* x_3; uint8_t x_4; lean_object* x_5; -x_3 = lean_unsigned_to_nat(1u); -x_4 = 1; -x_5 = lean_alloc_ctor(7, 3, 1); -lean_ctor_set(x_5, 0, x_1); -lean_ctor_set(x_5, 1, x_3); -lean_ctor_set(x_5, 2, x_2); -lean_ctor_set_uint8(x_5, sizeof(void*)*3, x_4); +lean_object* x_5; +x_5 = l_Lean_IR_ExplicitRC_addInc(x_1, x_2, x_3, x_4); +lean_dec(x_1); return x_5; } } +lean_object* l_Lean_IR_ExplicitRC_addDec(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; uint8_t x_5; lean_object* x_6; uint8_t x_7; lean_object* x_8; +x_4 = l_Lean_IR_ExplicitRC_getVarInfo(x_1, x_2); +x_5 = lean_ctor_get_uint8(x_4, 1); +lean_dec(x_4); +x_6 = lean_unsigned_to_nat(1u); +x_7 = 1; +x_8 = lean_alloc_ctor(7, 3, 2); +lean_ctor_set(x_8, 0, x_2); +lean_ctor_set(x_8, 1, x_6); +lean_ctor_set(x_8, 2, x_3); +lean_ctor_set_uint8(x_8, sizeof(void*)*3, x_7); +lean_ctor_set_uint8(x_8, sizeof(void*)*3 + 1, x_5); +return x_8; +} +} +lean_object* l_Lean_IR_ExplicitRC_addDec___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; +x_4 = l_Lean_IR_ExplicitRC_addDec(x_1, x_2, x_3); +lean_dec(x_1); +return x_4; +} +} lean_object* l_RBNode_ins___main___at___private_init_lean_compiler_ir_rc_1__updateRefUsingCtorInfo___spec__2(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { @@ -3089,16 +3106,20 @@ goto _start; } else { -lean_object* x_13; uint8_t x_14; lean_object* x_15; -x_13 = lean_unsigned_to_nat(1u); -x_14 = 1; +lean_object* x_13; uint8_t x_14; lean_object* x_15; uint8_t x_16; lean_object* x_17; +x_13 = l_Lean_IR_ExplicitRC_getVarInfo(x_1, x_7); +x_14 = lean_ctor_get_uint8(x_13, 1); +lean_dec(x_13); +x_15 = lean_unsigned_to_nat(1u); +x_16 = 1; lean_inc(x_7); -x_15 = lean_alloc_ctor(7, 3, 1); -lean_ctor_set(x_15, 0, x_7); -lean_ctor_set(x_15, 1, x_13); -lean_ctor_set(x_15, 2, x_9); -lean_ctor_set_uint8(x_15, sizeof(void*)*3, x_14); -x_4 = x_15; +x_17 = lean_alloc_ctor(7, 3, 2); +lean_ctor_set(x_17, 0, x_7); +lean_ctor_set(x_17, 1, x_15); +lean_ctor_set(x_17, 2, x_9); +lean_ctor_set_uint8(x_17, sizeof(void*)*3, x_16); +lean_ctor_set_uint8(x_17, sizeof(void*)*3 + 1, x_14); +x_4 = x_17; x_5 = x_8; goto _start; } @@ -3600,13 +3621,9 @@ goto _start; else { uint8_t x_19; -x_19 = lean_ctor_get_uint8(x_16, 1); +x_19 = l___private_init_lean_compiler_ir_rc_3__isFirstOcc(x_2, x_12); if (x_19 == 0) { -uint8_t x_20; -x_20 = l___private_init_lean_compiler_ir_rc_3__isFirstOcc(x_2, x_12); -if (x_20 == 0) -{ lean_dec(x_16); lean_dec(x_15); x_6 = x_11; @@ -3614,31 +3631,34 @@ goto _start; } else { -lean_object* x_22; uint8_t x_23; +lean_object* x_21; uint8_t x_22; lean_inc(x_3); -x_22 = l___private_init_lean_compiler_ir_rc_6__getNumConsumptions(x_15, x_2, x_3); -x_23 = lean_ctor_get_uint8(x_16, 2); -lean_dec(x_16); +x_21 = l___private_init_lean_compiler_ir_rc_6__getNumConsumptions(x_15, x_2, x_3); +x_22 = lean_ctor_get_uint8(x_16, 2); +if (x_22 == 0) +{ +uint8_t x_23; +x_23 = lean_nat_dec_eq(x_21, x_8); if (x_23 == 0) { -uint8_t x_24; -x_24 = lean_nat_dec_eq(x_22, x_8); -if (x_24 == 0) -{ -uint8_t x_25; lean_object* x_26; +uint8_t x_24; uint8_t x_25; lean_object* x_26; +x_24 = lean_ctor_get_uint8(x_16, 1); +lean_dec(x_16); x_25 = 1; -x_26 = lean_alloc_ctor(6, 3, 1); +x_26 = lean_alloc_ctor(6, 3, 2); lean_ctor_set(x_26, 0, x_15); -lean_ctor_set(x_26, 1, x_22); +lean_ctor_set(x_26, 1, x_21); lean_ctor_set(x_26, 2, x_7); lean_ctor_set_uint8(x_26, sizeof(void*)*3, x_25); +lean_ctor_set_uint8(x_26, sizeof(void*)*3 + 1, x_24); x_6 = x_11; x_7 = x_26; goto _start; } else { -lean_dec(x_22); +lean_dec(x_21); +lean_dec(x_16); lean_dec(x_15); x_6 = x_11; goto _start; @@ -3656,94 +3676,97 @@ x_30 = l___private_init_lean_compiler_ir_rc_4__isBorrowParamAux(x_15, x_2, x_3); if (x_30 == 0) { lean_object* x_31; uint8_t x_32; -x_31 = lean_nat_sub(x_22, x_10); -lean_dec(x_22); +x_31 = lean_nat_sub(x_21, x_10); +lean_dec(x_21); x_32 = lean_nat_dec_eq(x_31, x_8); if (x_32 == 0) { -uint8_t x_33; lean_object* x_34; -x_33 = 1; -x_34 = lean_alloc_ctor(6, 3, 1); -lean_ctor_set(x_34, 0, x_15); -lean_ctor_set(x_34, 1, x_31); -lean_ctor_set(x_34, 2, x_7); -lean_ctor_set_uint8(x_34, sizeof(void*)*3, x_33); +uint8_t x_33; uint8_t x_34; lean_object* x_35; +x_33 = lean_ctor_get_uint8(x_16, 1); +lean_dec(x_16); +x_34 = 1; +x_35 = lean_alloc_ctor(6, 3, 2); +lean_ctor_set(x_35, 0, x_15); +lean_ctor_set(x_35, 1, x_31); +lean_ctor_set(x_35, 2, x_7); +lean_ctor_set_uint8(x_35, sizeof(void*)*3, x_34); +lean_ctor_set_uint8(x_35, sizeof(void*)*3 + 1, x_33); x_6 = x_11; -x_7 = x_34; +x_7 = x_35; goto _start; } else { lean_dec(x_31); -lean_dec(x_15); -x_6 = x_11; -goto _start; -} -} -else -{ -uint8_t x_37; -x_37 = lean_nat_dec_eq(x_22, x_8); -if (x_37 == 0) -{ -uint8_t x_38; lean_object* x_39; -x_38 = 1; -x_39 = lean_alloc_ctor(6, 3, 1); -lean_ctor_set(x_39, 0, x_15); -lean_ctor_set(x_39, 1, x_22); -lean_ctor_set(x_39, 2, x_7); -lean_ctor_set_uint8(x_39, sizeof(void*)*3, x_38); -x_6 = x_11; -x_7 = x_39; -goto _start; -} -else -{ -lean_dec(x_22); -lean_dec(x_15); -x_6 = x_11; -goto _start; -} -} -} -else -{ -uint8_t x_42; -lean_dec(x_29); -x_42 = lean_nat_dec_eq(x_22, x_8); -if (x_42 == 0) -{ -uint8_t x_43; lean_object* x_44; -x_43 = 1; -x_44 = lean_alloc_ctor(6, 3, 1); -lean_ctor_set(x_44, 0, x_15); -lean_ctor_set(x_44, 1, x_22); -lean_ctor_set(x_44, 2, x_7); -lean_ctor_set_uint8(x_44, sizeof(void*)*3, x_43); -x_6 = x_11; -x_7 = x_44; -goto _start; -} -else -{ -lean_dec(x_22); -lean_dec(x_15); -x_6 = x_11; -goto _start; -} -} -} -} -} -else -{ lean_dec(x_16); lean_dec(x_15); -lean_dec(x_12); x_6 = x_11; goto _start; } } +else +{ +uint8_t x_38; +x_38 = lean_nat_dec_eq(x_21, x_8); +if (x_38 == 0) +{ +uint8_t x_39; uint8_t x_40; lean_object* x_41; +x_39 = lean_ctor_get_uint8(x_16, 1); +lean_dec(x_16); +x_40 = 1; +x_41 = lean_alloc_ctor(6, 3, 2); +lean_ctor_set(x_41, 0, x_15); +lean_ctor_set(x_41, 1, x_21); +lean_ctor_set(x_41, 2, x_7); +lean_ctor_set_uint8(x_41, sizeof(void*)*3, x_40); +lean_ctor_set_uint8(x_41, sizeof(void*)*3 + 1, x_39); +x_6 = x_11; +x_7 = x_41; +goto _start; +} +else +{ +lean_dec(x_21); +lean_dec(x_16); +lean_dec(x_15); +x_6 = x_11; +goto _start; +} +} +} +else +{ +uint8_t x_44; +lean_dec(x_29); +x_44 = lean_nat_dec_eq(x_21, x_8); +if (x_44 == 0) +{ +uint8_t x_45; uint8_t x_46; lean_object* x_47; +x_45 = lean_ctor_get_uint8(x_16, 1); +lean_dec(x_16); +x_46 = 1; +x_47 = lean_alloc_ctor(6, 3, 2); +lean_ctor_set(x_47, 0, x_15); +lean_ctor_set(x_47, 1, x_21); +lean_ctor_set(x_47, 2, x_7); +lean_ctor_set_uint8(x_47, sizeof(void*)*3, x_46); +lean_ctor_set_uint8(x_47, sizeof(void*)*3 + 1, x_45); +x_6 = x_11; +x_7 = x_47; +goto _start; +} +else +{ +lean_dec(x_21); +lean_dec(x_16); +lean_dec(x_15); +x_6 = x_11; +goto _start; +} +} +} +} +} } else { @@ -3985,13 +4008,9 @@ goto _start; else { uint8_t x_19; -x_19 = lean_ctor_get_uint8(x_16, 1); +x_19 = l___private_init_lean_compiler_ir_rc_3__isFirstOcc(x_3, x_12); if (x_19 == 0) { -uint8_t x_20; -x_20 = l___private_init_lean_compiler_ir_rc_3__isFirstOcc(x_3, x_12); -if (x_20 == 0) -{ lean_dec(x_16); lean_dec(x_15); x_6 = x_11; @@ -3999,30 +4018,33 @@ goto _start; } else { -lean_object* x_22; uint8_t x_23; -x_22 = l___private_init_lean_compiler_ir_rc_6__getNumConsumptions___at___private_init_lean_compiler_ir_rc_8__addIncBefore___spec__2(x_1, x_15, x_3); -x_23 = lean_ctor_get_uint8(x_16, 2); -lean_dec(x_16); +lean_object* x_21; uint8_t x_22; +x_21 = l___private_init_lean_compiler_ir_rc_6__getNumConsumptions___at___private_init_lean_compiler_ir_rc_8__addIncBefore___spec__2(x_1, x_15, x_3); +x_22 = lean_ctor_get_uint8(x_16, 2); +if (x_22 == 0) +{ +uint8_t x_23; +x_23 = lean_nat_dec_eq(x_21, x_8); if (x_23 == 0) { -uint8_t x_24; -x_24 = lean_nat_dec_eq(x_22, x_8); -if (x_24 == 0) -{ -uint8_t x_25; lean_object* x_26; +uint8_t x_24; uint8_t x_25; lean_object* x_26; +x_24 = lean_ctor_get_uint8(x_16, 1); +lean_dec(x_16); x_25 = 1; -x_26 = lean_alloc_ctor(6, 3, 1); +x_26 = lean_alloc_ctor(6, 3, 2); lean_ctor_set(x_26, 0, x_15); -lean_ctor_set(x_26, 1, x_22); +lean_ctor_set(x_26, 1, x_21); lean_ctor_set(x_26, 2, x_7); lean_ctor_set_uint8(x_26, sizeof(void*)*3, x_25); +lean_ctor_set_uint8(x_26, sizeof(void*)*3 + 1, x_24); x_6 = x_11; x_7 = x_26; goto _start; } else { -lean_dec(x_22); +lean_dec(x_21); +lean_dec(x_16); lean_dec(x_15); x_6 = x_11; goto _start; @@ -4039,94 +4061,97 @@ x_30 = l___private_init_lean_compiler_ir_rc_4__isBorrowParamAux___at___private_i if (x_30 == 0) { lean_object* x_31; uint8_t x_32; -x_31 = lean_nat_sub(x_22, x_10); -lean_dec(x_22); +x_31 = lean_nat_sub(x_21, x_10); +lean_dec(x_21); x_32 = lean_nat_dec_eq(x_31, x_8); if (x_32 == 0) { -uint8_t x_33; lean_object* x_34; -x_33 = 1; -x_34 = lean_alloc_ctor(6, 3, 1); -lean_ctor_set(x_34, 0, x_15); -lean_ctor_set(x_34, 1, x_31); -lean_ctor_set(x_34, 2, x_7); -lean_ctor_set_uint8(x_34, sizeof(void*)*3, x_33); +uint8_t x_33; uint8_t x_34; lean_object* x_35; +x_33 = lean_ctor_get_uint8(x_16, 1); +lean_dec(x_16); +x_34 = 1; +x_35 = lean_alloc_ctor(6, 3, 2); +lean_ctor_set(x_35, 0, x_15); +lean_ctor_set(x_35, 1, x_31); +lean_ctor_set(x_35, 2, x_7); +lean_ctor_set_uint8(x_35, sizeof(void*)*3, x_34); +lean_ctor_set_uint8(x_35, sizeof(void*)*3 + 1, x_33); x_6 = x_11; -x_7 = x_34; +x_7 = x_35; goto _start; } else { lean_dec(x_31); -lean_dec(x_15); -x_6 = x_11; -goto _start; -} -} -else -{ -uint8_t x_37; -x_37 = lean_nat_dec_eq(x_22, x_8); -if (x_37 == 0) -{ -uint8_t x_38; lean_object* x_39; -x_38 = 1; -x_39 = lean_alloc_ctor(6, 3, 1); -lean_ctor_set(x_39, 0, x_15); -lean_ctor_set(x_39, 1, x_22); -lean_ctor_set(x_39, 2, x_7); -lean_ctor_set_uint8(x_39, sizeof(void*)*3, x_38); -x_6 = x_11; -x_7 = x_39; -goto _start; -} -else -{ -lean_dec(x_22); -lean_dec(x_15); -x_6 = x_11; -goto _start; -} -} -} -else -{ -uint8_t x_42; -lean_dec(x_29); -x_42 = lean_nat_dec_eq(x_22, x_8); -if (x_42 == 0) -{ -uint8_t x_43; lean_object* x_44; -x_43 = 1; -x_44 = lean_alloc_ctor(6, 3, 1); -lean_ctor_set(x_44, 0, x_15); -lean_ctor_set(x_44, 1, x_22); -lean_ctor_set(x_44, 2, x_7); -lean_ctor_set_uint8(x_44, sizeof(void*)*3, x_43); -x_6 = x_11; -x_7 = x_44; -goto _start; -} -else -{ -lean_dec(x_22); -lean_dec(x_15); -x_6 = x_11; -goto _start; -} -} -} -} -} -else -{ lean_dec(x_16); lean_dec(x_15); -lean_dec(x_12); x_6 = x_11; goto _start; } } +else +{ +uint8_t x_38; +x_38 = lean_nat_dec_eq(x_21, x_8); +if (x_38 == 0) +{ +uint8_t x_39; uint8_t x_40; lean_object* x_41; +x_39 = lean_ctor_get_uint8(x_16, 1); +lean_dec(x_16); +x_40 = 1; +x_41 = lean_alloc_ctor(6, 3, 2); +lean_ctor_set(x_41, 0, x_15); +lean_ctor_set(x_41, 1, x_21); +lean_ctor_set(x_41, 2, x_7); +lean_ctor_set_uint8(x_41, sizeof(void*)*3, x_40); +lean_ctor_set_uint8(x_41, sizeof(void*)*3 + 1, x_39); +x_6 = x_11; +x_7 = x_41; +goto _start; +} +else +{ +lean_dec(x_21); +lean_dec(x_16); +lean_dec(x_15); +x_6 = x_11; +goto _start; +} +} +} +else +{ +uint8_t x_44; +lean_dec(x_29); +x_44 = lean_nat_dec_eq(x_21, x_8); +if (x_44 == 0) +{ +uint8_t x_45; uint8_t x_46; lean_object* x_47; +x_45 = lean_ctor_get_uint8(x_16, 1); +lean_dec(x_16); +x_46 = 1; +x_47 = lean_alloc_ctor(6, 3, 2); +lean_ctor_set(x_47, 0, x_15); +lean_ctor_set(x_47, 1, x_21); +lean_ctor_set(x_47, 2, x_7); +lean_ctor_set_uint8(x_47, sizeof(void*)*3, x_46); +lean_ctor_set_uint8(x_47, sizeof(void*)*3 + 1, x_45); +x_6 = x_11; +x_7 = x_47; +goto _start; +} +else +{ +lean_dec(x_21); +lean_dec(x_16); +lean_dec(x_15); +x_6 = x_11; +goto _start; +} +} +} +} +} } else { @@ -4301,15 +4326,19 @@ lean_object* x_22; x_22 = l_RBNode_findCore___main___at___private_init_lean_compiler_ir_rc_2__addDecForAlt___spec__1(x_4, x_15); if (lean_obj_tag(x_22) == 0) { -uint8_t x_23; lean_object* x_24; -x_23 = 1; -x_24 = lean_alloc_ctor(7, 3, 1); -lean_ctor_set(x_24, 0, x_15); -lean_ctor_set(x_24, 1, x_10); -lean_ctor_set(x_24, 2, x_7); -lean_ctor_set_uint8(x_24, sizeof(void*)*3, x_23); +lean_object* x_23; uint8_t x_24; uint8_t x_25; lean_object* x_26; +x_23 = l_Lean_IR_ExplicitRC_getVarInfo(x_1, x_15); +x_24 = lean_ctor_get_uint8(x_23, 1); +lean_dec(x_23); +x_25 = 1; +x_26 = lean_alloc_ctor(7, 3, 2); +lean_ctor_set(x_26, 0, x_15); +lean_ctor_set(x_26, 1, x_10); +lean_ctor_set(x_26, 2, x_7); +lean_ctor_set_uint8(x_26, sizeof(void*)*3, x_25); +lean_ctor_set_uint8(x_26, sizeof(void*)*3 + 1, x_24); x_6 = x_11; -x_7 = x_24; +x_7 = x_26; goto _start; } else @@ -4514,13 +4543,9 @@ goto _start; else { uint8_t x_18; -x_18 = lean_ctor_get_uint8(x_15, 1); +x_18 = l___private_init_lean_compiler_ir_rc_3__isFirstOcc(x_2, x_11); if (x_18 == 0) { -uint8_t x_19; -x_19 = l___private_init_lean_compiler_ir_rc_3__isFirstOcc(x_2, x_11); -if (x_19 == 0) -{ lean_dec(x_15); lean_dec(x_14); x_5 = x_10; @@ -4528,30 +4553,33 @@ goto _start; } else { -lean_object* x_21; uint8_t x_22; -x_21 = l___private_init_lean_compiler_ir_rc_6__getNumConsumptions___at___private_init_lean_compiler_ir_rc_10__addIncBeforeConsumeAll___spec__2(x_14, x_2); -x_22 = lean_ctor_get_uint8(x_15, 2); -lean_dec(x_15); +lean_object* x_20; uint8_t x_21; +x_20 = l___private_init_lean_compiler_ir_rc_6__getNumConsumptions___at___private_init_lean_compiler_ir_rc_10__addIncBeforeConsumeAll___spec__2(x_14, x_2); +x_21 = lean_ctor_get_uint8(x_15, 2); +if (x_21 == 0) +{ +uint8_t x_22; +x_22 = lean_nat_dec_eq(x_20, x_7); if (x_22 == 0) { -uint8_t x_23; -x_23 = lean_nat_dec_eq(x_21, x_7); -if (x_23 == 0) -{ -uint8_t x_24; lean_object* x_25; +uint8_t x_23; uint8_t x_24; lean_object* x_25; +x_23 = lean_ctor_get_uint8(x_15, 1); +lean_dec(x_15); x_24 = 1; -x_25 = lean_alloc_ctor(6, 3, 1); +x_25 = lean_alloc_ctor(6, 3, 2); lean_ctor_set(x_25, 0, x_14); -lean_ctor_set(x_25, 1, x_21); +lean_ctor_set(x_25, 1, x_20); lean_ctor_set(x_25, 2, x_6); lean_ctor_set_uint8(x_25, sizeof(void*)*3, x_24); +lean_ctor_set_uint8(x_25, sizeof(void*)*3 + 1, x_23); x_5 = x_10; x_6 = x_25; goto _start; } else { -lean_dec(x_21); +lean_dec(x_20); +lean_dec(x_15); lean_dec(x_14); x_5 = x_10; goto _start; @@ -4568,94 +4596,97 @@ x_29 = l___private_init_lean_compiler_ir_rc_4__isBorrowParamAux___at___private_i if (x_29 == 0) { lean_object* x_30; uint8_t x_31; -x_30 = lean_nat_sub(x_21, x_9); -lean_dec(x_21); +x_30 = lean_nat_sub(x_20, x_9); +lean_dec(x_20); x_31 = lean_nat_dec_eq(x_30, x_7); if (x_31 == 0) { -uint8_t x_32; lean_object* x_33; -x_32 = 1; -x_33 = lean_alloc_ctor(6, 3, 1); -lean_ctor_set(x_33, 0, x_14); -lean_ctor_set(x_33, 1, x_30); -lean_ctor_set(x_33, 2, x_6); -lean_ctor_set_uint8(x_33, sizeof(void*)*3, x_32); +uint8_t x_32; uint8_t x_33; lean_object* x_34; +x_32 = lean_ctor_get_uint8(x_15, 1); +lean_dec(x_15); +x_33 = 1; +x_34 = lean_alloc_ctor(6, 3, 2); +lean_ctor_set(x_34, 0, x_14); +lean_ctor_set(x_34, 1, x_30); +lean_ctor_set(x_34, 2, x_6); +lean_ctor_set_uint8(x_34, sizeof(void*)*3, x_33); +lean_ctor_set_uint8(x_34, sizeof(void*)*3 + 1, x_32); x_5 = x_10; -x_6 = x_33; +x_6 = x_34; goto _start; } else { lean_dec(x_30); -lean_dec(x_14); -x_5 = x_10; -goto _start; -} -} -else -{ -uint8_t x_36; -x_36 = lean_nat_dec_eq(x_21, x_7); -if (x_36 == 0) -{ -uint8_t x_37; lean_object* x_38; -x_37 = 1; -x_38 = lean_alloc_ctor(6, 3, 1); -lean_ctor_set(x_38, 0, x_14); -lean_ctor_set(x_38, 1, x_21); -lean_ctor_set(x_38, 2, x_6); -lean_ctor_set_uint8(x_38, sizeof(void*)*3, x_37); -x_5 = x_10; -x_6 = x_38; -goto _start; -} -else -{ -lean_dec(x_21); -lean_dec(x_14); -x_5 = x_10; -goto _start; -} -} -} -else -{ -uint8_t x_41; -lean_dec(x_28); -x_41 = lean_nat_dec_eq(x_21, x_7); -if (x_41 == 0) -{ -uint8_t x_42; lean_object* x_43; -x_42 = 1; -x_43 = lean_alloc_ctor(6, 3, 1); -lean_ctor_set(x_43, 0, x_14); -lean_ctor_set(x_43, 1, x_21); -lean_ctor_set(x_43, 2, x_6); -lean_ctor_set_uint8(x_43, sizeof(void*)*3, x_42); -x_5 = x_10; -x_6 = x_43; -goto _start; -} -else -{ -lean_dec(x_21); -lean_dec(x_14); -x_5 = x_10; -goto _start; -} -} -} -} -} -else -{ lean_dec(x_15); lean_dec(x_14); -lean_dec(x_11); x_5 = x_10; goto _start; } } +else +{ +uint8_t x_37; +x_37 = lean_nat_dec_eq(x_20, x_7); +if (x_37 == 0) +{ +uint8_t x_38; uint8_t x_39; lean_object* x_40; +x_38 = lean_ctor_get_uint8(x_15, 1); +lean_dec(x_15); +x_39 = 1; +x_40 = lean_alloc_ctor(6, 3, 2); +lean_ctor_set(x_40, 0, x_14); +lean_ctor_set(x_40, 1, x_20); +lean_ctor_set(x_40, 2, x_6); +lean_ctor_set_uint8(x_40, sizeof(void*)*3, x_39); +lean_ctor_set_uint8(x_40, sizeof(void*)*3 + 1, x_38); +x_5 = x_10; +x_6 = x_40; +goto _start; +} +else +{ +lean_dec(x_20); +lean_dec(x_15); +lean_dec(x_14); +x_5 = x_10; +goto _start; +} +} +} +else +{ +uint8_t x_43; +lean_dec(x_28); +x_43 = lean_nat_dec_eq(x_20, x_7); +if (x_43 == 0) +{ +uint8_t x_44; uint8_t x_45; lean_object* x_46; +x_44 = lean_ctor_get_uint8(x_15, 1); +lean_dec(x_15); +x_45 = 1; +x_46 = lean_alloc_ctor(6, 3, 2); +lean_ctor_set(x_46, 0, x_14); +lean_ctor_set(x_46, 1, x_20); +lean_ctor_set(x_46, 2, x_6); +lean_ctor_set_uint8(x_46, sizeof(void*)*3, x_45); +lean_ctor_set_uint8(x_46, sizeof(void*)*3 + 1, x_44); +x_5 = x_10; +x_6 = x_46; +goto _start; +} +else +{ +lean_dec(x_20); +lean_dec(x_15); +lean_dec(x_14); +x_5 = x_10; +goto _start; +} +} +} +} +} } else { @@ -4774,103 +4805,109 @@ lean_dec(x_1); return x_5; } } -lean_object* l_Array_miterateAux___main___at___private_init_lean_compiler_ir_rc_11__addDecForDeadParams___spec__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { +lean_object* l_Array_miterateAux___main___at___private_init_lean_compiler_ir_rc_11__addDecForDeadParams___spec__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { _start: { -lean_object* x_6; uint8_t x_7; -x_6 = lean_array_get_size(x_3); -x_7 = lean_nat_dec_lt(x_4, x_6); -lean_dec(x_6); -if (x_7 == 0) +lean_object* x_7; uint8_t x_8; +x_7 = lean_array_get_size(x_4); +x_8 = lean_nat_dec_lt(x_5, x_7); +lean_dec(x_7); +if (x_8 == 0) { -lean_dec(x_4); -return x_5; +lean_dec(x_5); +return x_6; } else { -lean_object* x_8; lean_object* x_9; uint8_t x_10; uint8_t x_11; lean_object* x_12; lean_object* x_13; -x_8 = lean_array_fget(x_3, x_4); -x_9 = lean_ctor_get(x_8, 0); -lean_inc(x_9); -x_10 = lean_ctor_get_uint8(x_8, sizeof(void*)*1); -x_11 = lean_ctor_get_uint8(x_8, sizeof(void*)*1 + 1); -lean_dec(x_8); -x_12 = lean_unsigned_to_nat(1u); -x_13 = lean_nat_add(x_4, x_12); -lean_dec(x_4); -if (x_10 == 0) -{ -uint8_t x_14; -x_14 = l_Lean_IR_IRType_isObj(x_11); -if (x_14 == 0) -{ +lean_object* x_9; lean_object* x_10; uint8_t x_11; uint8_t x_12; lean_object* x_13; lean_object* x_14; +x_9 = lean_array_fget(x_4, x_5); +x_10 = lean_ctor_get(x_9, 0); +lean_inc(x_10); +x_11 = lean_ctor_get_uint8(x_9, sizeof(void*)*1); +x_12 = lean_ctor_get_uint8(x_9, sizeof(void*)*1 + 1); lean_dec(x_9); -x_4 = x_13; +x_13 = lean_unsigned_to_nat(1u); +x_14 = lean_nat_add(x_5, x_13); +lean_dec(x_5); +if (x_11 == 0) +{ +uint8_t x_15; +x_15 = l_Lean_IR_IRType_isObj(x_12); +if (x_15 == 0) +{ +lean_dec(x_10); +x_5 = x_14; goto _start; } else { -lean_object* x_16; -x_16 = l_RBNode_findCore___main___at___private_init_lean_compiler_ir_rc_2__addDecForAlt___spec__1(x_2, x_9); -if (lean_obj_tag(x_16) == 0) +lean_object* x_17; +x_17 = l_RBNode_findCore___main___at___private_init_lean_compiler_ir_rc_2__addDecForAlt___spec__1(x_3, x_10); +if (lean_obj_tag(x_17) == 0) { -uint8_t x_17; lean_object* x_18; -x_17 = 1; -x_18 = lean_alloc_ctor(7, 3, 1); -lean_ctor_set(x_18, 0, x_9); -lean_ctor_set(x_18, 1, x_12); -lean_ctor_set(x_18, 2, x_5); -lean_ctor_set_uint8(x_18, sizeof(void*)*3, x_17); -x_4 = x_13; -x_5 = x_18; +lean_object* x_18; uint8_t x_19; uint8_t x_20; lean_object* x_21; +x_18 = l_Lean_IR_ExplicitRC_getVarInfo(x_1, x_10); +x_19 = lean_ctor_get_uint8(x_18, 1); +lean_dec(x_18); +x_20 = 1; +x_21 = lean_alloc_ctor(7, 3, 2); +lean_ctor_set(x_21, 0, x_10); +lean_ctor_set(x_21, 1, x_13); +lean_ctor_set(x_21, 2, x_6); +lean_ctor_set_uint8(x_21, sizeof(void*)*3, x_20); +lean_ctor_set_uint8(x_21, sizeof(void*)*3 + 1, x_19); +x_5 = x_14; +x_6 = x_21; goto _start; } else { -lean_dec(x_16); -lean_dec(x_9); -x_4 = x_13; +lean_dec(x_17); +lean_dec(x_10); +x_5 = x_14; goto _start; } } } else { -lean_dec(x_9); -x_4 = x_13; +lean_dec(x_10); +x_5 = x_14; goto _start; } } } } -lean_object* l___private_init_lean_compiler_ir_rc_11__addDecForDeadParams(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +lean_object* l___private_init_lean_compiler_ir_rc_11__addDecForDeadParams(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { -lean_object* x_4; lean_object* x_5; -x_4 = lean_unsigned_to_nat(0u); -x_5 = l_Array_miterateAux___main___at___private_init_lean_compiler_ir_rc_11__addDecForDeadParams___spec__1(x_1, x_3, x_1, x_4, x_2); -return x_5; -} -} -lean_object* l_Array_miterateAux___main___at___private_init_lean_compiler_ir_rc_11__addDecForDeadParams___spec__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { -_start: -{ -lean_object* x_6; -x_6 = l_Array_miterateAux___main___at___private_init_lean_compiler_ir_rc_11__addDecForDeadParams___spec__1(x_1, x_2, x_3, x_4, x_5); -lean_dec(x_3); -lean_dec(x_2); -lean_dec(x_1); +lean_object* x_5; lean_object* x_6; +x_5 = lean_unsigned_to_nat(0u); +x_6 = l_Array_miterateAux___main___at___private_init_lean_compiler_ir_rc_11__addDecForDeadParams___spec__1(x_1, x_2, x_4, x_2, x_5, x_3); return x_6; } } -lean_object* l___private_init_lean_compiler_ir_rc_11__addDecForDeadParams___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +lean_object* l_Array_miterateAux___main___at___private_init_lean_compiler_ir_rc_11__addDecForDeadParams___spec__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { _start: { -lean_object* x_4; -x_4 = l___private_init_lean_compiler_ir_rc_11__addDecForDeadParams(x_1, x_2, x_3); +lean_object* x_7; +x_7 = l_Array_miterateAux___main___at___private_init_lean_compiler_ir_rc_11__addDecForDeadParams___spec__1(x_1, x_2, x_3, x_4, x_5, x_6); +lean_dec(x_4); lean_dec(x_3); +lean_dec(x_2); lean_dec(x_1); -return x_4; +return x_7; +} +} +lean_object* l___private_init_lean_compiler_ir_rc_11__addDecForDeadParams___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +_start: +{ +lean_object* x_5; +x_5 = l___private_init_lean_compiler_ir_rc_11__addDecForDeadParams(x_1, x_2, x_3, x_4); +lean_dec(x_4); +lean_dec(x_2); +lean_dec(x_1); +return x_5; } } uint8_t l___private_init_lean_compiler_ir_rc_12__isPersistent(lean_object* x_1) { @@ -5175,15 +5212,19 @@ lean_object* x_6; x_6 = l_RBNode_findCore___main___at___private_init_lean_compiler_ir_rc_2__addDecForAlt___spec__1(x_4, x_2); if (lean_obj_tag(x_6) == 0) { -lean_object* x_7; uint8_t x_8; lean_object* x_9; -x_7 = lean_unsigned_to_nat(1u); -x_8 = 1; -x_9 = lean_alloc_ctor(7, 3, 1); -lean_ctor_set(x_9, 0, x_2); -lean_ctor_set(x_9, 1, x_7); -lean_ctor_set(x_9, 2, x_3); -lean_ctor_set_uint8(x_9, sizeof(void*)*3, x_8); -return x_9; +lean_object* x_7; uint8_t x_8; lean_object* x_9; uint8_t x_10; lean_object* x_11; +x_7 = l_Lean_IR_ExplicitRC_getVarInfo(x_1, x_2); +x_8 = lean_ctor_get_uint8(x_7, 1); +lean_dec(x_7); +x_9 = lean_unsigned_to_nat(1u); +x_10 = 1; +x_11 = lean_alloc_ctor(7, 3, 2); +lean_ctor_set(x_11, 0, x_2); +lean_ctor_set(x_11, 1, x_9); +lean_ctor_set(x_11, 2, x_3); +lean_ctor_set_uint8(x_11, sizeof(void*)*3, x_10); +lean_ctor_set_uint8(x_11, sizeof(void*)*3 + 1, x_8); +return x_11; } else { @@ -5284,181 +5325,185 @@ return x_24; } else { -lean_object* x_25; uint8_t x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; -x_25 = lean_unsigned_to_nat(1u); -x_26 = 1; +lean_object* x_25; uint8_t x_26; lean_object* x_27; uint8_t x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; +x_25 = l_Lean_IR_ExplicitRC_getVarInfo(x_1, x_2); +x_26 = lean_ctor_get_uint8(x_25, 1); +lean_dec(x_25); +x_27 = lean_unsigned_to_nat(1u); +x_28 = 1; lean_inc(x_2); -x_27 = lean_alloc_ctor(6, 3, 1); -lean_ctor_set(x_27, 0, x_2); -lean_ctor_set(x_27, 1, x_25); -lean_ctor_set(x_27, 2, x_19); -lean_ctor_set_uint8(x_27, sizeof(void*)*3, x_26); +x_29 = lean_alloc_ctor(6, 3, 2); +lean_ctor_set(x_29, 0, x_2); +lean_ctor_set(x_29, 1, x_27); +lean_ctor_set(x_29, 2, x_19); +lean_ctor_set_uint8(x_29, sizeof(void*)*3, x_28); +lean_ctor_set_uint8(x_29, sizeof(void*)*3 + 1, x_26); lean_inc(x_2); -x_28 = lean_alloc_ctor(0, 3, 1); -lean_ctor_set(x_28, 0, x_2); -lean_ctor_set(x_28, 1, x_4); -lean_ctor_set(x_28, 2, x_27); -lean_ctor_set_uint8(x_28, sizeof(void*)*3, x_3); -x_29 = l_RBNode_erase___at___private_init_lean_compiler_ir_livevars_8__bindVar___spec__1(x_2, x_7); +x_30 = lean_alloc_ctor(0, 3, 1); +lean_ctor_set(x_30, 0, x_2); +lean_ctor_set(x_30, 1, x_4); +lean_ctor_set(x_30, 2, x_29); +lean_ctor_set_uint8(x_30, sizeof(void*)*3, x_3); +x_31 = l_RBNode_erase___at___private_init_lean_compiler_ir_livevars_8__bindVar___spec__1(x_2, x_7); lean_dec(x_2); -x_30 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_30, 0, x_28); -lean_ctor_set(x_30, 1, x_29); -return x_30; +x_32 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_32, 0, x_30); +lean_ctor_set(x_32, 1, x_31); +return x_32; } } case 4: { -lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; -x_31 = lean_ctor_get(x_4, 1); -lean_inc(x_31); -x_32 = l___private_init_lean_compiler_ir_rc_16__addDecIfNeeded(x_1, x_31, x_5, x_6); +lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; +x_33 = lean_ctor_get(x_4, 1); +lean_inc(x_33); +x_34 = l___private_init_lean_compiler_ir_rc_16__addDecIfNeeded(x_1, x_33, x_5, x_6); lean_dec(x_6); lean_inc(x_2); -x_33 = lean_alloc_ctor(0, 3, 1); -lean_ctor_set(x_33, 0, x_2); -lean_ctor_set(x_33, 1, x_4); -lean_ctor_set(x_33, 2, x_32); -lean_ctor_set_uint8(x_33, sizeof(void*)*3, x_3); -x_34 = l_RBNode_erase___at___private_init_lean_compiler_ir_livevars_8__bindVar___spec__1(x_2, x_7); +x_35 = lean_alloc_ctor(0, 3, 1); +lean_ctor_set(x_35, 0, x_2); +lean_ctor_set(x_35, 1, x_4); +lean_ctor_set(x_35, 2, x_34); +lean_ctor_set_uint8(x_35, sizeof(void*)*3, x_3); +x_36 = l_RBNode_erase___at___private_init_lean_compiler_ir_livevars_8__bindVar___spec__1(x_2, x_7); lean_dec(x_2); -x_35 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_35, 0, x_33); -lean_ctor_set(x_35, 1, x_34); -return x_35; +x_37 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_37, 0, x_35); +lean_ctor_set(x_37, 1, x_36); +return x_37; } case 5: { -lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; -x_36 = lean_ctor_get(x_4, 2); -lean_inc(x_36); -x_37 = l___private_init_lean_compiler_ir_rc_16__addDecIfNeeded(x_1, x_36, x_5, x_6); +lean_object* x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; +x_38 = lean_ctor_get(x_4, 2); +lean_inc(x_38); +x_39 = l___private_init_lean_compiler_ir_rc_16__addDecIfNeeded(x_1, x_38, x_5, x_6); lean_dec(x_6); lean_inc(x_2); -x_38 = lean_alloc_ctor(0, 3, 1); -lean_ctor_set(x_38, 0, x_2); -lean_ctor_set(x_38, 1, x_4); -lean_ctor_set(x_38, 2, x_37); -lean_ctor_set_uint8(x_38, sizeof(void*)*3, x_3); -x_39 = l_RBNode_erase___at___private_init_lean_compiler_ir_livevars_8__bindVar___spec__1(x_2, x_7); +x_40 = lean_alloc_ctor(0, 3, 1); +lean_ctor_set(x_40, 0, x_2); +lean_ctor_set(x_40, 1, x_4); +lean_ctor_set(x_40, 2, x_39); +lean_ctor_set_uint8(x_40, sizeof(void*)*3, x_3); +x_41 = l_RBNode_erase___at___private_init_lean_compiler_ir_livevars_8__bindVar___spec__1(x_2, x_7); lean_dec(x_2); -x_40 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_40, 0, x_38); -lean_ctor_set(x_40, 1, x_39); -return x_40; +x_42 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_42, 0, x_40); +lean_ctor_set(x_42, 1, x_41); +return x_42; } case 6: { -lean_object* x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44; lean_object* x_45; lean_object* x_46; lean_object* x_47; lean_object* x_48; lean_object* x_49; -x_41 = lean_ctor_get(x_4, 0); -lean_inc(x_41); -x_42 = lean_ctor_get(x_4, 1); -lean_inc(x_42); -x_43 = l_Lean_IR_ExplicitRC_getDecl(x_1, x_41); -lean_dec(x_41); -x_44 = l_Lean_IR_Decl_params(x_43); +lean_object* x_43; lean_object* x_44; lean_object* x_45; lean_object* x_46; lean_object* x_47; lean_object* x_48; lean_object* x_49; lean_object* x_50; lean_object* x_51; +x_43 = lean_ctor_get(x_4, 0); +lean_inc(x_43); +x_44 = lean_ctor_get(x_4, 1); +lean_inc(x_44); +x_45 = l_Lean_IR_ExplicitRC_getDecl(x_1, x_43); lean_dec(x_43); -x_45 = l___private_init_lean_compiler_ir_rc_9__addDecAfterFullApp(x_1, x_42, x_44, x_5, x_6); +x_46 = l_Lean_IR_Decl_params(x_45); +lean_dec(x_45); +x_47 = l___private_init_lean_compiler_ir_rc_9__addDecAfterFullApp(x_1, x_44, x_46, x_5, x_6); lean_inc(x_2); -x_46 = lean_alloc_ctor(0, 3, 1); -lean_ctor_set(x_46, 0, x_2); -lean_ctor_set(x_46, 1, x_4); -lean_ctor_set(x_46, 2, x_45); -lean_ctor_set_uint8(x_46, sizeof(void*)*3, x_3); -x_47 = l___private_init_lean_compiler_ir_rc_7__addIncBeforeAux___at___private_init_lean_compiler_ir_rc_8__addIncBefore___spec__1(x_44, x_1, x_42, x_46, x_6); +x_48 = lean_alloc_ctor(0, 3, 1); +lean_ctor_set(x_48, 0, x_2); +lean_ctor_set(x_48, 1, x_4); +lean_ctor_set(x_48, 2, x_47); +lean_ctor_set_uint8(x_48, sizeof(void*)*3, x_3); +x_49 = l___private_init_lean_compiler_ir_rc_7__addIncBeforeAux___at___private_init_lean_compiler_ir_rc_8__addIncBefore___spec__1(x_46, x_1, x_44, x_48, x_6); lean_dec(x_6); -lean_dec(x_42); lean_dec(x_44); -x_48 = l_RBNode_erase___at___private_init_lean_compiler_ir_livevars_8__bindVar___spec__1(x_2, x_7); +lean_dec(x_46); +x_50 = l_RBNode_erase___at___private_init_lean_compiler_ir_livevars_8__bindVar___spec__1(x_2, x_7); lean_dec(x_2); -x_49 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_49, 0, x_47); -lean_ctor_set(x_49, 1, x_48); -return x_49; +x_51 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_51, 0, x_49); +lean_ctor_set(x_51, 1, x_50); +return x_51; } case 7: { -lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; -x_50 = lean_ctor_get(x_4, 1); -lean_inc(x_50); +lean_object* x_52; lean_object* x_53; lean_object* x_54; lean_object* x_55; lean_object* x_56; +x_52 = lean_ctor_get(x_4, 1); +lean_inc(x_52); lean_inc(x_2); -x_51 = lean_alloc_ctor(0, 3, 1); -lean_ctor_set(x_51, 0, x_2); -lean_ctor_set(x_51, 1, x_4); -lean_ctor_set(x_51, 2, x_5); -lean_ctor_set_uint8(x_51, sizeof(void*)*3, x_3); -x_52 = l___private_init_lean_compiler_ir_rc_7__addIncBeforeAux___at___private_init_lean_compiler_ir_rc_10__addIncBeforeConsumeAll___spec__1(x_1, x_50, x_51, x_6); +x_53 = lean_alloc_ctor(0, 3, 1); +lean_ctor_set(x_53, 0, x_2); +lean_ctor_set(x_53, 1, x_4); +lean_ctor_set(x_53, 2, x_5); +lean_ctor_set_uint8(x_53, sizeof(void*)*3, x_3); +x_54 = l___private_init_lean_compiler_ir_rc_7__addIncBeforeAux___at___private_init_lean_compiler_ir_rc_10__addIncBeforeConsumeAll___spec__1(x_1, x_52, x_53, x_6); lean_dec(x_6); -lean_dec(x_50); -x_53 = l_RBNode_erase___at___private_init_lean_compiler_ir_livevars_8__bindVar___spec__1(x_2, x_7); +lean_dec(x_52); +x_55 = l_RBNode_erase___at___private_init_lean_compiler_ir_livevars_8__bindVar___spec__1(x_2, x_7); lean_dec(x_2); -x_54 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_54, 0, x_52); -lean_ctor_set(x_54, 1, x_53); -return x_54; +x_56 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_56, 0, x_54); +lean_ctor_set(x_56, 1, x_55); +return x_56; } case 8: { -lean_object* x_55; lean_object* x_56; lean_object* x_57; lean_object* x_58; lean_object* x_59; lean_object* x_60; lean_object* x_61; lean_object* x_62; -x_55 = lean_ctor_get(x_4, 0); -lean_inc(x_55); -x_56 = lean_ctor_get(x_4, 1); -lean_inc(x_56); -x_57 = lean_alloc_ctor(0, 1, 0); -lean_ctor_set(x_57, 0, x_55); -x_58 = lean_array_push(x_56, x_57); +lean_object* x_57; lean_object* x_58; lean_object* x_59; lean_object* x_60; lean_object* x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64; +x_57 = lean_ctor_get(x_4, 0); +lean_inc(x_57); +x_58 = lean_ctor_get(x_4, 1); +lean_inc(x_58); +x_59 = lean_alloc_ctor(0, 1, 0); +lean_ctor_set(x_59, 0, x_57); +x_60 = lean_array_push(x_58, x_59); lean_inc(x_2); -x_59 = lean_alloc_ctor(0, 3, 1); -lean_ctor_set(x_59, 0, x_2); -lean_ctor_set(x_59, 1, x_4); -lean_ctor_set(x_59, 2, x_5); -lean_ctor_set_uint8(x_59, sizeof(void*)*3, x_3); -x_60 = l___private_init_lean_compiler_ir_rc_7__addIncBeforeAux___at___private_init_lean_compiler_ir_rc_10__addIncBeforeConsumeAll___spec__1(x_1, x_58, x_59, x_6); +x_61 = lean_alloc_ctor(0, 3, 1); +lean_ctor_set(x_61, 0, x_2); +lean_ctor_set(x_61, 1, x_4); +lean_ctor_set(x_61, 2, x_5); +lean_ctor_set_uint8(x_61, sizeof(void*)*3, x_3); +x_62 = l___private_init_lean_compiler_ir_rc_7__addIncBeforeAux___at___private_init_lean_compiler_ir_rc_10__addIncBeforeConsumeAll___spec__1(x_1, x_60, x_61, x_6); lean_dec(x_6); -lean_dec(x_58); -x_61 = l_RBNode_erase___at___private_init_lean_compiler_ir_livevars_8__bindVar___spec__1(x_2, x_7); +lean_dec(x_60); +x_63 = l_RBNode_erase___at___private_init_lean_compiler_ir_livevars_8__bindVar___spec__1(x_2, x_7); lean_dec(x_2); -x_62 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_62, 0, x_60); -lean_ctor_set(x_62, 1, x_61); -return x_62; +x_64 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_64, 0, x_62); +lean_ctor_set(x_64, 1, x_63); +return x_64; } case 10: { -lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; -x_63 = lean_ctor_get(x_4, 0); -lean_inc(x_63); -x_64 = l___private_init_lean_compiler_ir_rc_16__addDecIfNeeded(x_1, x_63, x_5, x_6); +lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; +x_65 = lean_ctor_get(x_4, 0); +lean_inc(x_65); +x_66 = l___private_init_lean_compiler_ir_rc_16__addDecIfNeeded(x_1, x_65, x_5, x_6); lean_dec(x_6); lean_inc(x_2); -x_65 = lean_alloc_ctor(0, 3, 1); -lean_ctor_set(x_65, 0, x_2); -lean_ctor_set(x_65, 1, x_4); -lean_ctor_set(x_65, 2, x_64); -lean_ctor_set_uint8(x_65, sizeof(void*)*3, x_3); -x_66 = l_RBNode_erase___at___private_init_lean_compiler_ir_livevars_8__bindVar___spec__1(x_2, x_7); +x_67 = lean_alloc_ctor(0, 3, 1); +lean_ctor_set(x_67, 0, x_2); +lean_ctor_set(x_67, 1, x_4); +lean_ctor_set(x_67, 2, x_66); +lean_ctor_set_uint8(x_67, sizeof(void*)*3, x_3); +x_68 = l_RBNode_erase___at___private_init_lean_compiler_ir_livevars_8__bindVar___spec__1(x_2, x_7); lean_dec(x_2); -x_67 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_67, 0, x_65); -lean_ctor_set(x_67, 1, x_66); -return x_67; +x_69 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_69, 0, x_67); +lean_ctor_set(x_69, 1, x_68); +return x_69; } default: { -lean_object* x_68; lean_object* x_69; lean_object* x_70; +lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_dec(x_6); lean_inc(x_2); -x_68 = lean_alloc_ctor(0, 3, 1); -lean_ctor_set(x_68, 0, x_2); -lean_ctor_set(x_68, 1, x_4); -lean_ctor_set(x_68, 2, x_5); -lean_ctor_set_uint8(x_68, sizeof(void*)*3, x_3); -x_69 = l_RBNode_erase___at___private_init_lean_compiler_ir_livevars_8__bindVar___spec__1(x_2, x_7); +x_70 = lean_alloc_ctor(0, 3, 1); +lean_ctor_set(x_70, 0, x_2); +lean_ctor_set(x_70, 1, x_4); +lean_ctor_set(x_70, 2, x_5); +lean_ctor_set_uint8(x_70, sizeof(void*)*3, x_3); +x_71 = l_RBNode_erase___at___private_init_lean_compiler_ir_livevars_8__bindVar___spec__1(x_2, x_7); lean_dec(x_2); -x_70 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_70, 0, x_68); -lean_ctor_set(x_70, 1, x_69); -return x_70; +x_72 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_72, 0, x_70); +lean_ctor_set(x_72, 1, x_71); +return x_72; } } } @@ -5721,7 +5766,7 @@ x_20 = lean_ctor_get(x_18, 1); lean_inc(x_20); lean_dec(x_18); x_21 = lean_unsigned_to_nat(0u); -x_22 = l_Array_miterateAux___main___at___private_init_lean_compiler_ir_rc_11__addDecForDeadParams___spec__1(x_14, x_20, x_14, x_21, x_19); +x_22 = l_Array_miterateAux___main___at___private_init_lean_compiler_ir_rc_11__addDecForDeadParams___spec__1(x_2, x_14, x_20, x_14, x_21, x_19); lean_dec(x_20); x_23 = !lean_is_exclusive(x_2); if (x_23 == 0) @@ -5828,7 +5873,7 @@ x_51 = lean_ctor_get(x_49, 1); lean_inc(x_51); lean_dec(x_49); x_52 = lean_unsigned_to_nat(0u); -x_53 = l_Array_miterateAux___main___at___private_init_lean_compiler_ir_rc_11__addDecForDeadParams___spec__1(x_45, x_51, x_45, x_52, x_50); +x_53 = l_Array_miterateAux___main___at___private_init_lean_compiler_ir_rc_11__addDecForDeadParams___spec__1(x_2, x_45, x_51, x_45, x_52, x_50); lean_dec(x_51); x_54 = lean_ctor_get(x_2, 0); lean_inc(x_54); @@ -6211,23 +6256,21 @@ return x_160; else { uint8_t x_161; -x_161 = lean_ctor_get_uint8(x_157, 1); +x_161 = lean_ctor_get_uint8(x_157, 2); if (x_161 == 0) { -uint8_t x_162; -x_162 = lean_ctor_get_uint8(x_157, 2); +uint8_t x_162; lean_object* x_163; uint8_t x_164; lean_object* x_165; lean_object* x_166; lean_object* x_167; +x_162 = lean_ctor_get_uint8(x_157, 1); lean_dec(x_157); -if (x_162 == 0) -{ -lean_object* x_163; uint8_t x_164; lean_object* x_165; lean_object* x_166; lean_object* x_167; x_163 = lean_unsigned_to_nat(1u); x_164 = 1; lean_inc(x_156); -x_165 = lean_alloc_ctor(6, 3, 1); +x_165 = lean_alloc_ctor(6, 3, 2); lean_ctor_set(x_165, 0, x_156); lean_ctor_set(x_165, 1, x_163); lean_ctor_set(x_165, 2, x_1); lean_ctor_set_uint8(x_165, sizeof(void*)*3, x_164); +lean_ctor_set_uint8(x_165, sizeof(void*)*3 + 1, x_162); x_166 = l_Lean_IR_mkLiveVarSet(x_156); x_167 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_167, 0, x_165); @@ -6237,6 +6280,7 @@ return x_167; else { lean_object* x_168; lean_object* x_169; +lean_dec(x_157); x_168 = l_Lean_IR_mkLiveVarSet(x_156); x_169 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_169, 0, x_1); @@ -6244,63 +6288,52 @@ lean_ctor_set(x_169, 1, x_168); return x_169; } } +} else { lean_object* x_170; lean_object* x_171; -lean_dec(x_157); -x_170 = l_Lean_IR_mkLiveVarSet(x_156); +lean_dec(x_2); +x_170 = lean_box(0); x_171 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_171, 0, x_1); lean_ctor_set(x_171, 1, x_170); return x_171; } } -} -else -{ -lean_object* x_172; lean_object* x_173; -lean_dec(x_2); -x_172 = lean_box(0); -x_173 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_173, 0, x_1); -lean_ctor_set(x_173, 1, x_172); -return x_173; -} -} case 12: { -lean_object* x_174; lean_object* x_175; lean_object* x_176; lean_object* x_177; lean_object* x_178; lean_object* x_179; lean_object* x_180; lean_object* x_181; lean_object* x_182; -x_174 = lean_ctor_get(x_1, 0); -lean_inc(x_174); -x_175 = lean_ctor_get(x_1, 1); -lean_inc(x_175); -x_176 = l_Lean_IR_ExplicitRC_getJPLiveVars(x_2, x_174); -x_177 = l_Lean_IR_ExplicitRC_getJPParams(x_2, x_174); +lean_object* x_172; lean_object* x_173; lean_object* x_174; lean_object* x_175; lean_object* x_176; lean_object* x_177; lean_object* x_178; lean_object* x_179; lean_object* x_180; +x_172 = lean_ctor_get(x_1, 0); +lean_inc(x_172); +x_173 = lean_ctor_get(x_1, 1); +lean_inc(x_173); +x_174 = l_Lean_IR_ExplicitRC_getJPLiveVars(x_2, x_172); +x_175 = l_Lean_IR_ExplicitRC_getJPParams(x_2, x_172); +lean_dec(x_172); +x_176 = l___private_init_lean_compiler_ir_rc_7__addIncBeforeAux___at___private_init_lean_compiler_ir_rc_8__addIncBefore___spec__1(x_175, x_2, x_173, x_1, x_174); lean_dec(x_174); -x_178 = l___private_init_lean_compiler_ir_rc_7__addIncBeforeAux___at___private_init_lean_compiler_ir_rc_8__addIncBefore___spec__1(x_177, x_2, x_175, x_1, x_176); -lean_dec(x_176); +lean_dec(x_173); lean_dec(x_175); -lean_dec(x_177); -x_179 = lean_ctor_get(x_2, 3); -lean_inc(x_179); +x_177 = lean_ctor_get(x_2, 3); +lean_inc(x_177); lean_dec(x_2); -x_180 = lean_box(0); -lean_inc(x_178); -x_181 = l_Lean_IR_LiveVars_collectFnBody___main(x_178, x_179, x_180); -x_182 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_182, 0, x_178); -lean_ctor_set(x_182, 1, x_181); -return x_182; +x_178 = lean_box(0); +lean_inc(x_176); +x_179 = l_Lean_IR_LiveVars_collectFnBody___main(x_176, x_177, x_178); +x_180 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_180, 0, x_176); +lean_ctor_set(x_180, 1, x_179); +return x_180; } default: { -lean_object* x_183; lean_object* x_184; +lean_object* x_181; lean_object* x_182; lean_dec(x_2); -x_183 = lean_box(0); -x_184 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_184, 0, x_1); -lean_ctor_set(x_184, 1, x_183); -return x_184; +x_181 = lean_box(0); +x_182 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_182, 0, x_1); +lean_ctor_set(x_182, 1, x_181); +return x_182; } } } @@ -6342,6 +6375,7 @@ lean_ctor_set(x_8, 2, x_7); lean_ctor_set(x_8, 3, x_7); lean_ctor_set(x_8, 4, x_7); x_9 = l_Lean_IR_ExplicitRC_updateVarInfoWithParams(x_8, x_5); +lean_inc(x_9); x_10 = l_Lean_IR_ExplicitRC_visitFnBody___main(x_6, x_9); x_11 = lean_ctor_get(x_10, 0); lean_inc(x_11); @@ -6349,8 +6383,9 @@ x_12 = lean_ctor_get(x_10, 1); lean_inc(x_12); lean_dec(x_10); x_13 = lean_unsigned_to_nat(0u); -x_14 = l_Array_miterateAux___main___at___private_init_lean_compiler_ir_rc_11__addDecForDeadParams___spec__1(x_5, x_12, x_5, x_13, x_11); +x_14 = l_Array_miterateAux___main___at___private_init_lean_compiler_ir_rc_11__addDecForDeadParams___spec__1(x_9, x_5, x_12, x_5, x_13, x_11); lean_dec(x_12); +lean_dec(x_9); lean_ctor_set(x_3, 2, x_14); return x_3; } @@ -6373,6 +6408,7 @@ lean_ctor_set(x_20, 2, x_19); lean_ctor_set(x_20, 3, x_19); lean_ctor_set(x_20, 4, x_19); x_21 = l_Lean_IR_ExplicitRC_updateVarInfoWithParams(x_20, x_16); +lean_inc(x_21); x_22 = l_Lean_IR_ExplicitRC_visitFnBody___main(x_18, x_21); x_23 = lean_ctor_get(x_22, 0); lean_inc(x_23); @@ -6380,8 +6416,9 @@ x_24 = lean_ctor_get(x_22, 1); lean_inc(x_24); lean_dec(x_22); x_25 = lean_unsigned_to_nat(0u); -x_26 = l_Array_miterateAux___main___at___private_init_lean_compiler_ir_rc_11__addDecForDeadParams___spec__1(x_16, x_24, x_16, x_25, x_23); +x_26 = l_Array_miterateAux___main___at___private_init_lean_compiler_ir_rc_11__addDecForDeadParams___spec__1(x_21, x_16, x_24, x_16, x_25, x_23); lean_dec(x_24); +lean_dec(x_21); x_27 = lean_alloc_ctor(0, 3, 1); lean_ctor_set(x_27, 0, x_15); lean_ctor_set(x_27, 1, x_16);