File: .lake/packages/lean4/src/lean/Lean/Compiler/IR/EmitC.lean

full_name: Lean.IR.EmitC.leanMainFn
code: def leanMainFn 
goal: String

full_name: Lean.IR.EmitC.Context.mainFn
code: structure Context where
  env        : Environment
  modName    : Name
  jpMap      : JPParamsMap := {}
  mainFn     : FunId := default
  mainParams : Array Param := #[]
goal: Lean.IR.FunId

full_name: Lean.IR.EmitC.Context
code: structure Context where
  env        : Environment
  modName    : Name
  jpMap      : JPParamsMap := {}
  mainFn     : FunId := default
  mainParams : Array Param := #[]
goal: Type

full_name: Lean.IR.EmitC.Context.env
code: structure Context where
  env        : Environment
  modName    : Name
  jpMap      : JPParamsMap := {}
  mainFn     : FunId := default
  mainParams : Array Param := #[]
goal: Lean.Environment

full_name: Lean.IR.EmitC.Context.mainParams
code: structure Context where
  env        : Environment
  modName    : Name
  jpMap      : JPParamsMap := {}
  mainFn     : FunId := default
  mainParams : Array Param := #[]
goal: Array Lean.IR.Param

full_name: Lean.IR.EmitC.Context.modName
code: structure Context where
  env        : Environment
  modName    : Name
  jpMap      : JPParamsMap := {}
  mainFn     : FunId := default
  mainParams : Array Param := #[]
goal: Lean.Name

full_name: Lean.IR.EmitC.Context.jpMap
code: structure Context where
  env        : Environment
  modName    : Name
  jpMap      : JPParamsMap := {}
  mainFn     : FunId := default
  mainParams : Array Param := #[]
goal: Lean.IR.JPParamsMap

full_name: Lean.IR.EmitC.M
code: abbrev M 
goal: Type

full_name: Lean.IR.EmitC.getEnv
code: def getEnv : M Environment 
goal: Lean.IR.EmitC.M Lean.Environment

full_name: Lean.IR.EmitC.getModName
code: def getModName : M Name 
goal: Lean.IR.EmitC.M Lean.Name

full_name: Lean.IR.EmitC.getDecl
code: def getDecl (n : Name) : M Decl 
goal: Lean.IR.EmitC.M Lean.IR.Decl

full_name: Lean.IR.EmitC.emit
code: @[inline] def emit {α : Type} [ToString α] (a : α) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitLn
code: @[inline] def emitLn {α : Type} [ToString α] (a : α) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitLns
code: def emitLns {α : Type} [ToString α] (as : List α) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.argToCString
code: def argToCString (x : Arg) : String 
goal: String

full_name: Lean.IR.EmitC.emitArg
code: def emitArg (x : Arg) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.toCType
code: def toCType : IRType → String
  
goal: Lean.IR.IRType → String

full_name: Lean.IR.EmitC.throwInvalidExportName
code: def throwInvalidExportName {α : Type} (n : Name) : M α 
goal: Lean.IR.EmitC.M α

full_name: Lean.IR.EmitC.toCName
code: def toCName (n : Name) : M String 
goal: Lean.IR.EmitC.M String

full_name: Lean.IR.EmitC.emitCName
code: def emitCName (n : Name) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.toCInitName
code: def toCInitName (n : Name) : M String 
goal: Lean.IR.EmitC.M String

full_name: Lean.IR.EmitC.emitCInitName
code: def emitCInitName (n : Name) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.shouldExport
code: def shouldExport (n : Name) : Bool 
goal: Bool

full_name: Lean.IR.EmitC.emitFnDeclAux
code: def emitFnDeclAux (decl : Decl) (cppBaseName : String) (isExternal : Bool) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitFnDecl
code: def emitFnDecl (decl : Decl) (isExternal : Bool) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitExternDeclAux
code: def emitExternDeclAux (decl : Decl) (cNameStr : String) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitFnDecls
code: def emitFnDecls : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitMainFn
code: def emitMainFn : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.hasMainFn
code: def hasMainFn : M Bool 
goal: Lean.IR.EmitC.M Bool

full_name: Lean.IR.EmitC.emitMainFnIfNeeded
code: def emitMainFnIfNeeded : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitFileHeader
code: def emitFileHeader : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitFileFooter
code: def emitFileFooter : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.throwUnknownVar
code: def throwUnknownVar {α : Type} (x : VarId) : M α 
goal: Lean.IR.EmitC.M α

full_name: Lean.IR.EmitC.getJPParams
code: def getJPParams (j : JoinPointId) : M (Array Param) 
goal: Lean.IR.EmitC.M (Array Lean.IR.Param)

full_name: Lean.IR.EmitC.declareVar
code: def declareVar (x : VarId) (t : IRType) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.declareParams
code: def declareParams (ps : Array Param) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.declareVars
code: partial def declareVars : FnBody → Bool → M Bool
  
goal: Lean.IR.FnBody → Bool → Lean.IR.EmitC.M Bool

full_name: Lean.IR.EmitC.emitTag
code: def emitTag (x : VarId) (xType : IRType) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.isIf
code: def isIf (alts : Array Alt) : Option (Nat × FnBody × FnBody) 
goal: Option (Nat × Lean.IR.FnBody × Lean.IR.FnBody)

full_name: Lean.IR.EmitC.emitInc
code: def emitInc (x : VarId) (n : Nat) (checkRef : Bool) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitDec
code: def emitDec (x : VarId) (n : Nat) (checkRef : Bool) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitDel
code: def emitDel (x : VarId) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitSetTag
code: def emitSetTag (x : VarId) (i : Nat) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitSet
code: def emitSet (x : VarId) (i : Nat) (y : Arg) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitOffset
code: def emitOffset (n : Nat) (offset : Nat) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitUSet
code: def emitUSet (x : VarId) (n : Nat) (y : VarId) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitSSet
code: def emitSSet (x : VarId) (n : Nat) (offset : Nat) (y : VarId) (t : IRType) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitJmp
code: def emitJmp (j : JoinPointId) (xs : Array Arg) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitLhs
code: def emitLhs (z : VarId) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitArgs
code: def emitArgs (ys : Array Arg) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitCtorScalarSize
code: def emitCtorScalarSize (usize : Nat) (ssize : Nat) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitAllocCtor
code: def emitAllocCtor (c : CtorInfo) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitCtorSetArgs
code: def emitCtorSetArgs (z : VarId) (ys : Array Arg) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitCtor
code: def emitCtor (z : VarId) (c : CtorInfo) (ys : Array Arg) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitReset
code: def emitReset (z : VarId) (n : Nat) (x : VarId) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitReuse
code: def emitReuse (z : VarId) (x : VarId) (c : CtorInfo) (updtHeader : Bool) (ys : Array Arg) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitProj
code: def emitProj (z : VarId) (i : Nat) (x : VarId) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitUProj
code: def emitUProj (z : VarId) (i : Nat) (x : VarId) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitSProj
code: def emitSProj (z : VarId) (t : IRType) (n offset : Nat) (x : VarId) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.toStringArgs
code: def toStringArgs (ys : Array Arg) : List String 
goal: List String

full_name: Lean.IR.EmitC.emitSimpleExternalCall
code: def emitSimpleExternalCall (f : String) (ps : Array Param) (ys : Array Arg) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitExternCall
code: def emitExternCall (f : FunId) (ps : Array Param) (extData : ExternAttrData) (ys : Array Arg) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitFullApp
code: def emitFullApp (z : VarId) (f : FunId) (ys : Array Arg) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitPartialApp
code: def emitPartialApp (z : VarId) (f : FunId) (ys : Array Arg) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitApp
code: def emitApp (z : VarId) (f : VarId) (ys : Array Arg) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitBoxFn
code: def emitBoxFn (xType : IRType) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitBox
code: def emitBox (z : VarId) (x : VarId) (xType : IRType) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitUnbox
code: def emitUnbox (z : VarId) (t : IRType) (x : VarId) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitIsShared
code: def emitIsShared (z : VarId) (x : VarId) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.toHexDigit
code: def toHexDigit (c : Nat) : String 
goal: String

full_name: Lean.IR.EmitC.quoteString
code: def quoteString (s : String) : String 
goal: String

full_name: Lean.IR.EmitC.emitNumLit
code: def emitNumLit (t : IRType) (v : Nat) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitLit
code: def emitLit (z : VarId) (t : IRType) (v : LitVal) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitVDecl
code: def emitVDecl (z : VarId) (t : IRType) (v : Expr) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.isTailCall
code: def isTailCall (x : VarId) (v : Expr) (b : FnBody) : M Bool 
goal: Lean.IR.EmitC.M Bool

full_name: Lean.IR.EmitC.paramEqArg
code: def paramEqArg (p : Param) (x : Arg) : Bool 
goal: Bool

full_name: Lean.IR.EmitC.overwriteParam
code: /--
Given `[p_0, ..., p_{n-1}]`, `[y_0, ..., y_{n-1}]`, representing the assignments
```
p_0 := y_0,
...
p_{n-1} := y_{n-1}
```
Return true iff we have `(i, j)` where `j > i`, and `y_j == p_i`.
That is, we have
```
      p_i := y_i,
      ...
      p_j := p_i, -- p_i was overwritten above
```
-/
def overwriteParam (ps : Array Param) (ys : Array Arg) : Bool 
goal: Bool

full_name: Lean.IR.EmitC.emitTailCall
code: def emitTailCall (v : Expr) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitDeclAux
code: def emitDeclAux (d : Decl) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitDecl
code: def emitDecl (d : Decl) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitFns
code: def emitFns : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitMarkPersistent
code: def emitMarkPersistent (d : Decl) (n : Name) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitDeclInit
code: def emitDeclInit (d : Decl) : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.emitInitFn
code: def emitInitFn : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.EmitC.main
code: def main : M Unit 
goal: Lean.IR.EmitC.M Unit

full_name: Lean.IR.emitC
code: @[export lean_ir_emit_c]
def emitC (env : Environment) (modName : Name) : Except String String 
goal: Except String String