text: // Lean compiler output
  // Module: Lean.Elab.Deriving.FromToJson
  // Imports: Init Lean.Meta.Transform Lean.Elab.Deriving.Basic Lean.Elab.Deriving.Util Lean.Data.Json.FromToJson
  #include <lean/lean.h>
  #if defined(__clang__)
  #pragma clang diagnostic ignored "-Wunused-parameter"
  #pragma clang diagnostic ignored "-Wunused-label"
  #elif defined(__GNUC__) && !defined(__CLANG__)
  #pragma GCC diagnostic ignored "-Wunused-parameter"
  #pragma GCC diagnostic ignored "-Wunused-label"
  #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  #endif
  #ifdef __cplusplus
  extern "C" {
  #endif
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__14;
  lean_object* l_Lean_getConstInfo___at_Lean_Elab_Term_mkConst___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__33;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__5;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__6;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__28;
  static lean_object* l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1___closed__3;
  size_t lean_usize_add(size_t, size_t);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__14;
  LEAN_EXPORT lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__2___boxed(lean_object*, lean_object*, lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__12;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__13;
  lean_object* l_Lean_stringToMessageData(lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__8;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___closed__2;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__20;
  lean_object* lean_mk_empty_array_with_capacity(lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__21;
  lean_object* lean_nat_div(lean_object*, lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__13;
  lean_object* l_Lean_getConstInfo___at_Lean_Elab_elabDeriving___spec__14(lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__11;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__23;
  lean_object* l_Lean_LocalDecl_userName(lean_object*);
  LEAN_EXPORT lean_object* l_Lean_throwError___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
  lean_object* l_Lean_Elab_Command_liftTermElabM___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Elab_Command_elabCommand___spec__10(lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*);
  lean_object* lean_name_mk_string(lean_object*, lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__13;
  uint8_t lean_usize_dec_eq(size_t, size_t);
  lean_object* lean_array_uget(lean_object*, size_t);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__6;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__15;
  lean_object* l_Array_append___rarg(lean_object*, lean_object*);
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__6(lean_object*, lean_object*, lean_object*, lean_object*, size_t, size_t, lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_6077____closed__2;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__10;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__29;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__13;
  lean_object* lean_array_uset(lean_object*, size_t, lean_object*);
  LEAN_EXPORT lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1___closed__4;
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__7;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__25;
  static lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__11;
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__13;
  size_t lean_usize_sub(size_t, size_t);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__24;
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5(lean_object*, lean_object*, size_t, size_t, lean_object*);
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__4;
  lean_object* lean_st_ref_get(lean_object*, lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__3;
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___boxed__const__1;
  LEAN_EXPORT lean_object* l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___boxed__const__1;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__22;
  LEAN_EXPORT lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__2;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__16;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__8;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__5;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__7;
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  extern lean_object* l_instInhabitedNat;
  uint8_t l_Lean_Expr_isAppOf(lean_object*, lean_object*);
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler(lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__12;
  static lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__1;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__6;
  lean_object* lean_array_push(lean_object*, lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__16;
  lean_object* lean_array_get_size(lean_object*);
  lean_object* lean_string_append(lean_object*, lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__3;
  LEAN_EXPORT lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___boxed(lean_object**);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__5;
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__30;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___closed__3;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__6;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__2;
  static lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__12;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__15;
  static lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__18;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___closed__3;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__2;
  lean_object* lean_string_utf8_byte_size(lean_object*);
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  lean_object* l_Lean_Elab_Term_getMainModule___rarg(lean_object*, lean_object*);
  uint8_t lean_usize_dec_lt(size_t, size_t);
  extern lean_object* l_Lean_nameLitKind;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__12;
  lean_object* l_Lean_Elab_Deriving_mkLocalInstanceLetDecls(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__3;
  LEAN_EXPORT lean_object* l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  LEAN_EXPORT lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__2;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__1;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__1;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__11;
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler(lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__10;
  lean_object* lean_nat_add(lean_object*, lean_object*);
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__9___boxed(lean_object*, lean_object*, lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__1;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__3;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__7;
  lean_object* l_Lean_Syntax_SepArray_ofElems(lean_object*, lean_object*);
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__3;
  lean_object* l_Array_zip___rarg(lean_object*, lean_object*);
  LEAN_EXPORT lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__34;
  static lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__16;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__9;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__1;
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5(lean_object*, lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__4;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__10;
  lean_object* l_Lean_Elab_Deriving_mkDiscrs(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Lean_getConstInfoInduct___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__1___closed__1;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__19;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__4;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__5;
  LEAN_EXPORT lean_object* l_Lean_getConstInfoInduct___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__9;
  uint8_t l_Lean_Name_hasMacroScopes(lean_object*);
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, size_t, size_t, lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__3;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__4;
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkJsonField___lambda__1___boxed(lean_object*);
  static lean_object* l_Lean_getConstInfoInduct___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__1___closed__2;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___closed__4;
  lean_object* lean_array_fget(lean_object*, lean_object*);
  lean_object* l___private_Lean_CoreM_0__Lean_Core_mkFreshNameImp(lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___closed__1;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__6;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__3;
  static lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__13;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__12;
  uint8_t lean_nat_dec_eq(lean_object*, lean_object*);
  LEAN_EXPORT lean_object* l_Lean_throwError___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__2(lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__2;
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__3___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__4(size_t, size_t, lean_object*);
  lean_object* l___private_Init_Meta_0__Lean_getEscapedNameParts_x3f(lean_object*, lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__5;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__3;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__8;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___closed__1;
  extern lean_object* l_Lean_numLitKind;
  static lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__10;
  lean_object* l_Lean_Elab_Deriving_mkInstanceCmds(lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  LEAN_EXPORT lean_object* l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__2___boxed(lean_object**);
  lean_object* lean_nat_sub(lean_object*, lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__31;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__2;
  lean_object* lean_array_swap(lean_object*, lean_object*, lean_object*);
  lean_object* l_Lean_getStructureFieldsFlattened(lean_object*, lean_object*, uint8_t);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__1;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__1;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__14;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__2;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__10;
  LEAN_EXPORT lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  lean_object* l_Lean_Name_toString(lean_object*, uint8_t);
  lean_object* l_Lean_Elab_Deriving_mkLet(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  lean_object* lean_array_get(lean_object*, lean_object*, lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__20;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__3;
  LEAN_EXPORT lean_object* l_Array_qsort_sort___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__7___lambda__1___boxed(lean_object*, lean_object*);
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, size_t, size_t, lean_object*);
  lean_object* l_Lean_Expr_fvarId_x21(lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__7;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__15;
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__26;
  static lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__5;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__7;
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__11;
  static lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__3;
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__5;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__24;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__1;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__7;
  static lean_object* l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1___closed__2;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__9;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__18;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__16;
  lean_object* l_Nat_repr(lean_object*);
  LEAN_EXPORT lean_object* l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1___boxed(lean_object**);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__30;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__9;
  static lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__7;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__5;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__4;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__4;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__16;
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_6077_(lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__8;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__7;
  lean_object* l_Lean_Elab_addMacroStack___at_Lean_Elab_Term_instAddErrorMessageContextTermElabM___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  lean_object* l___private_Init_Meta_0__Lean_quoteNameMk(lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__5;
  static lean_object* l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1___closed__1;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__9;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__17;
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  LEAN_EXPORT lean_object* l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  lean_object* l_Lean_addMessageContextPartial___at_Lean_Elab_Command_instAddMessageContextCommandElabM___spec__1(lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__5;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__18;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__4;
  lean_object* l_Lean_Elab_Term_getCurrMacroScope(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__14;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_6077____closed__1;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__15;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__5;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__2;
  lean_object* l_Lean_Syntax_mkStrLit(lean_object*, lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__7;
  LEAN_EXPORT uint8_t l_Lean_Elab_Deriving_FromToJson_mkJsonField___lambda__1(uint32_t);
  extern lean_object* l_Lean_instInhabitedExpr;
  static lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__4___lambda__1___closed__2;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__1;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__11;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__6___closed__4;
  extern lean_object* l_Lean_instInhabitedSyntax;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__4;
  LEAN_EXPORT lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__4___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  LEAN_EXPORT lean_object* l_Lean_getConstInfoInduct___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__1(lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6;
  lean_object* l_Lean_mkSepArray(lean_object*, lean_object*);
  static lean_object* l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1___closed__3;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__11;
  LEAN_EXPORT lean_object* l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__23;
  LEAN_EXPORT lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  lean_object* l_Lean_Elab_Deriving_mkHeader___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1___closed__1;
  lean_object* l_Lean_Elab_Deriving_mkContext(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__14;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__12;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__13;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__12;
  size_t lean_usize_of_nat(lean_object*);
  lean_object* l_Lean_addMacroScope(lean_object*, lean_object*, lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__27;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__2;
  static lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__4___lambda__1___closed__1;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__6___closed__1;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__4;
  static lean_object* l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1___closed__2;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__9;
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6(lean_object*, lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__6;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__8;
  static lean_object* l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1___closed__4;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__1;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__9;
  lean_object* l_Lean_LocalDecl_type(lean_object*);
  LEAN_EXPORT lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__3___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__4___boxed(lean_object*, lean_object*, lean_object*);
  static lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__15;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__6;
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___boxed__const__1;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__6___closed__3;
  uint8_t lean_uint32_dec_eq(uint32_t, uint32_t);
  lean_object* l_Lean_Name_getString_x21(lean_object*);
  lean_object* l_String_intercalate(lean_object*, lean_object*);
  static lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__4;
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  lean_object* l_List_redLength___rarg(lean_object*);
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  LEAN_EXPORT lean_object* l_Array_qpartition_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__8(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__31;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__11;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__6;
  lean_object* l_Lean_Meta_getLocalDecl(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__27;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__15;
  lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_mkInductiveApp___spec__1(size_t, size_t, lean_object*);
  lean_object* l_Lean_Elab_addMacroStack___at_Lean_Elab_Command_instAddErrorMessageContextCommandElabM___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__13;
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__6___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__17;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__4;
  uint8_t lean_nat_dec_le(lean_object*, lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___closed__2;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  LEAN_EXPORT lean_object* l_Lean_throwError___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  lean_object* l_Lean_Name_append(lean_object*, lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__2;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__10;
  static lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__6;
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkJsonField(lean_object*);
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3(lean_object*, lean_object*, lean_object*, lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__3(lean_object*, size_t, size_t, lean_object*);
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  LEAN_EXPORT lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__12;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__19;
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__12;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__8;
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6(lean_object*, lean_object*, lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__28;
  lean_object* l_Lean_Elab_Command_getRef(lean_object*, lean_object*, lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__2;
  static lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__3;
  static lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3;
  LEAN_EXPORT lean_object* l_Array_qsort_sort___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__7___boxed(lean_object*, lean_object*, lean_object*);
  static lean_object* l_Array_qsort_sort___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__7___closed__1;
  static lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__1;
  static lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5;
  lean_object* l_Lean_addMessageContextFull___at_Lean_Meta_instAddMessageContextMetaM___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__13;
  extern lean_object* l_Lean_instInhabitedName;
  lean_object* l_List_toArrayAux___rarg(lean_object*, lean_object*);
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___boxed(lean_object**);
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___boxed__const__1;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__1;
  lean_object* l_Lean_Elab_registerBuiltinDerivingHandler(lean_object*, lean_object*, lean_object*);
  LEAN_EXPORT lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__4___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__9;
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__2(size_t, size_t, lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__3;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__4;
  static lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__4;
  static lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__7;
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__6;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__1;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__7;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__14;
  static lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__8;
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  LEAN_EXPORT lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__17;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__5;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__9;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__25;
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__1;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__29;
  lean_object* l_Lean_Meta_forallTelescopeReducing___at_Lean_Elab_Deriving_mkInductArgNames___spec__2___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__15;
  LEAN_EXPORT uint8_t l_Array_qsort_sort___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__7___lambda__1(lean_object*, lean_object*);
  static lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__2;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__19;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__3;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__22;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__12;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__20;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__11;
  lean_object* lean_mk_syntax_ident(lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__7;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__16;
  extern lean_object* l_Lean_instInhabitedInductiveVal;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__10;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__32;
  static lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__2;
  LEAN_EXPORT lean_object* l_Lean_throwError___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__10;
  LEAN_EXPORT lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__4;
  lean_object* l_unsafeCast(lean_object*, lean_object*, lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkJsonField___closed__1;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__8;
  static lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__8;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__17;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__9;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__2;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__6;
  lean_object* l_Array_mapMUnsafe_map___at___aux__Init__NotationExtra______macroRules___xabterm_x25_x5b___x7c___x5d_xbb__1___spec__3(size_t, size_t, lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__9;
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__6___closed__2;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__26;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__36;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__14;
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
  lean_object* l_Lean_mkConst(lean_object*, lean_object*);
  static lean_object* l_Array_qpartition_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__8___closed__1;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__8;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__11;
  LEAN_EXPORT lean_object* l_Array_qsort_sort___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__7(lean_object*, lean_object*, lean_object*);
  LEAN_EXPORT lean_object* l_Array_qpartition_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__8___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__8;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__35;
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__21;
  static lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__9;
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__17;
  LEAN_EXPORT lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__5___boxed(lean_object**);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__10;
  lean_object* l_String_dropRightWhile(lean_object*, lean_object*);
  lean_object* l_Lean_Elab_Deriving_mkInductiveApp(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  LEAN_EXPORT lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__5(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
  lean_object* l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(lean_object*, lean_object*, lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__11;
  uint8_t l_Lean_isStructure(lean_object*, lean_object*);
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__9(size_t, size_t, lean_object*);
  static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__4;
  lean_object* l_Lean_Elab_getBetterRef(lean_object*, lean_object*);
  uint8_t lean_string_dec_eq(lean_object*, lean_object*);
  lean_object* l_Lean_Syntax_mkLit(lean_object*, lean_object*, lean_object*);
  uint8_t lean_nat_dec_lt(lean_object*, lean_object*);
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__2;
  static lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__1;
  static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__16;
  LEAN_EXPORT uint8_t l_Lean_Elab_Deriving_FromToJson_mkJsonField___lambda__1(uint32_t x_1) {
  _start:
  {
  uint32_t x_2; uint8_t x_3; 
  x_2 = 63;
  x_3 = lean_uint32_dec_eq(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkJsonField___closed__1() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_alloc_closure((void*)(l_Lean_Elab_Deriving_FromToJson_mkJsonField___lambda__1___boxed), 1, 0);
  return x_1;
  }
  }
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkJsonField(lean_object* x_1) {
  _start:
  {
  uint8_t x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; uint8_t x_6; lean_object* x_7; lean_object* x_8; 
  x_2 = 1;
  x_3 = l_Lean_Name_toString(x_1, x_2);
  x_4 = l_Lean_Elab_Deriving_FromToJson_mkJsonField___closed__1;
  x_5 = l_String_dropRightWhile(x_3, x_4);
  x_6 = lean_string_dec_eq(x_3, x_5);
  lean_dec(x_3);
  x_7 = lean_box(2);
  x_8 = l_Lean_Syntax_mkStrLit(x_5, x_7);
  lean_dec(x_5);
  if (x_6 == 0)
  {
  lean_object* x_9; lean_object* x_10; 
  x_9 = lean_box(x_2);
  x_10 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_10, 0, x_9);
  lean_ctor_set(x_10, 1, x_8);
  return x_10;
  }
  else
  {
  uint8_t x_11; lean_object* x_12; lean_object* x_13; 
  x_11 = 0;
  x_12 = lean_box(x_11);
  x_13 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_13, 0, x_12);
  lean_ctor_set(x_13, 1, x_8);
  return x_13;
  }
  }
  }
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkJsonField___lambda__1___boxed(lean_object* x_1) {
  _start:
  {
  uint32_t x_2; uint8_t x_3; lean_object* x_4; 
  x_2 = lean_unbox_uint32(x_1);
  lean_dec(x_1);
  x_3 = l_Lean_Elab_Deriving_FromToJson_mkJsonField___lambda__1(x_2);
  x_4 = lean_box(x_3);
  return x_4;
  }
  }
  LEAN_EXPORT lean_object* l_Lean_throwError___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8) {
  _start:
  {
  lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; uint8_t x_16; 
  x_9 = lean_ctor_get(x_6, 3);
  x_10 = lean_ctor_get(x_2, 3);
  lean_inc(x_10);
  lean_inc(x_10);
  x_11 = l_Lean_Elab_getBetterRef(x_9, x_10);
  x_12 = l_Lean_addMessageContextFull___at_Lean_Meta_instAddMessageContextMetaM___spec__1(x_1, x_4, x_5, x_6, x_7, x_8);
  x_13 = lean_ctor_get(x_12, 0);
  lean_inc(x_13);
  x_14 = lean_ctor_get(x_12, 1);
  lean_inc(x_14);
  lean_dec(x_12);
  x_15 = l_Lean_Elab_addMacroStack___at_Lean_Elab_Term_instAddErrorMessageContextTermElabM___spec__1(x_13, x_10, x_2, x_3, x_4, x_5, x_6, x_7, x_14);
  lean_dec(x_2);
  lean_dec(x_10);
  x_16 = !lean_is_exclusive(x_15);
  if (x_16 == 0)
  {
  lean_object* x_17; lean_object* x_18; 
  x_17 = lean_ctor_get(x_15, 0);
  x_18 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_18, 0, x_11);
  lean_ctor_set(x_18, 1, x_17);
  lean_ctor_set_tag(x_15, 1);
  lean_ctor_set(x_15, 0, x_18);
  return x_15;
  }
  else
  {
  lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; 
  x_19 = lean_ctor_get(x_15, 0);
  x_20 = lean_ctor_get(x_15, 1);
  lean_inc(x_20);
  lean_inc(x_19);
  lean_dec(x_15);
  x_21 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_21, 0, x_11);
  lean_ctor_set(x_21, 1, x_19);
  x_22 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_22, 0, x_21);
  lean_ctor_set(x_22, 1, x_20);
  return x_22;
  }
  }
  }
  static lean_object* _init_l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1___closed__1() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("'");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1___closed__2() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1___closed__1;
  x_2 = l_Lean_stringToMessageData(x_1);
  return x_2;
  }
  }
  static lean_object* _init_l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1___closed__3() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("' is not a constructor");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1___closed__4() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1___closed__3;
  x_2 = l_Lean_stringToMessageData(x_1);
  return x_2;
  }
  }
  LEAN_EXPORT lean_object* l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___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, lean_object* x_7, lean_object* x_8) {
  _start:
  {
  lean_object* x_9; 
  lean_inc(x_2);
  lean_inc(x_1);
  x_9 = l_Lean_getConstInfo___at_Lean_Elab_Term_mkConst___spec__1(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8);
  if (lean_obj_tag(x_9) == 0)
  {
  lean_object* x_10; 
  x_10 = lean_ctor_get(x_9, 0);
  lean_inc(x_10);
  if (lean_obj_tag(x_10) == 6)
  {
  uint8_t x_11; 
  lean_dec(x_2);
  lean_dec(x_1);
  x_11 = !lean_is_exclusive(x_9);
  if (x_11 == 0)
  {
  lean_object* x_12; lean_object* x_13; 
  x_12 = lean_ctor_get(x_9, 0);
  lean_dec(x_12);
  x_13 = lean_ctor_get(x_10, 0);
  lean_inc(x_13);
  lean_dec(x_10);
  lean_ctor_set(x_9, 0, x_13);
  return x_9;
  }
  else
  {
  lean_object* x_14; lean_object* x_15; lean_object* x_16; 
  x_14 = lean_ctor_get(x_9, 1);
  lean_inc(x_14);
  lean_dec(x_9);
  x_15 = lean_ctor_get(x_10, 0);
  lean_inc(x_15);
  lean_dec(x_10);
  x_16 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_16, 0, x_15);
  lean_ctor_set(x_16, 1, x_14);
  return x_16;
  }
  }
  else
  {
  lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; 
  lean_dec(x_10);
  x_17 = lean_ctor_get(x_9, 1);
  lean_inc(x_17);
  lean_dec(x_9);
  x_18 = lean_box(0);
  x_19 = l_Lean_mkConst(x_1, x_18);
  x_20 = lean_alloc_ctor(2, 1, 0);
  lean_ctor_set(x_20, 0, x_19);
  x_21 = l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1___closed__2;
  x_22 = lean_alloc_ctor(10, 2, 0);
  lean_ctor_set(x_22, 0, x_21);
  lean_ctor_set(x_22, 1, x_20);
  x_23 = l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1___closed__4;
  x_24 = lean_alloc_ctor(10, 2, 0);
  lean_ctor_set(x_24, 0, x_22);
  lean_ctor_set(x_24, 1, x_23);
  x_25 = l_Lean_throwError___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__2(x_24, x_2, x_3, x_4, x_5, x_6, x_7, x_17);
  return x_25;
  }
  }
  else
  {
  uint8_t x_26; 
  lean_dec(x_2);
  lean_dec(x_1);
  x_26 = !lean_is_exclusive(x_9);
  if (x_26 == 0)
  {
  return x_9;
  }
  else
  {
  lean_object* x_27; lean_object* x_28; lean_object* x_29; 
  x_27 = lean_ctor_get(x_9, 0);
  x_28 = lean_ctor_get(x_9, 1);
  lean_inc(x_28);
  lean_inc(x_27);
  lean_dec(x_9);
  x_29 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_29, 0, x_27);
  lean_ctor_set(x_29, 1, x_28);
  return x_29;
  }
  }
  }
  }
  static lean_object* _init_l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__1() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("Lean");
  return x_1;
  }
  }
  static lean_object* _init_l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__2() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__1;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("Parser");
  return x_1;
  }
  }
  static lean_object* _init_l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__4() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__2;
  x_2 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("Term");
  return x_1;
  }
  }
  static lean_object* _init_l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__4;
  x_2 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__7() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("hole");
  return x_1;
  }
  }
  static lean_object* _init_l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__8() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6;
  x_2 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__7;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__9() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("_");
  return x_1;
  }
  }
  static lean_object* _init_l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = lean_unsigned_to_nat(1u);
  x_2 = lean_mk_empty_array_with_capacity(x_1);
  return x_2;
  }
  }
  LEAN_EXPORT lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11) {
  _start:
  {
  lean_object* x_12; uint8_t x_13; 
  x_12 = lean_ctor_get(x_1, 1);
  x_13 = lean_nat_dec_le(x_12, x_3);
  if (x_13 == 0)
  {
  lean_object* x_14; uint8_t x_15; 
  x_14 = lean_unsigned_to_nat(0u);
  x_15 = lean_nat_dec_eq(x_2, x_14);
  if (x_15 == 0)
  {
  lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; 
  x_16 = lean_unsigned_to_nat(1u);
  x_17 = lean_nat_sub(x_2, x_16);
  lean_dec(x_2);
  lean_inc(x_9);
  x_18 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_9, x_10, x_11);
  x_19 = lean_ctor_get(x_18, 0);
  lean_inc(x_19);
  x_20 = lean_ctor_get(x_18, 1);
  lean_inc(x_20);
  lean_dec(x_18);
  x_21 = l_Lean_Elab_Term_getCurrMacroScope(x_5, x_6, x_7, x_8, x_9, x_10, x_20);
  x_22 = lean_ctor_get(x_21, 1);
  lean_inc(x_22);
  lean_dec(x_21);
  x_23 = l_Lean_Elab_Term_getMainModule___rarg(x_10, x_22);
  x_24 = lean_ctor_get(x_23, 1);
  lean_inc(x_24);
  lean_dec(x_23);
  x_25 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__9;
  x_26 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_26, 0, x_19);
  lean_ctor_set(x_26, 1, x_25);
  x_27 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_28 = lean_array_push(x_27, x_26);
  x_29 = lean_box(2);
  x_30 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__8;
  x_31 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_31, 0, x_29);
  lean_ctor_set(x_31, 1, x_30);
  lean_ctor_set(x_31, 2, x_28);
  x_32 = lean_array_push(x_4, x_31);
  x_33 = lean_ctor_get(x_1, 2);
  x_34 = lean_nat_add(x_3, x_33);
  lean_dec(x_3);
  x_2 = x_17;
  x_3 = x_34;
  x_4 = x_32;
  x_11 = x_24;
  goto _start;
  }
  else
  {
  lean_object* x_36; 
  lean_dec(x_9);
  lean_dec(x_3);
  lean_dec(x_2);
  x_36 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_36, 0, x_4);
  lean_ctor_set(x_36, 1, x_11);
  return x_36;
  }
  }
  else
  {
  lean_object* x_37; 
  lean_dec(x_9);
  lean_dec(x_3);
  lean_dec(x_2);
  x_37 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_37, 0, x_4);
  lean_ctor_set(x_37, 1, x_11);
  return x_37;
  }
  }
  }
  static lean_object* _init_l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__4___lambda__1___closed__1() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("a");
  return x_1;
  }
  }
  static lean_object* _init_l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__4___lambda__1___closed__2() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__4___lambda__1___closed__1;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  LEAN_EXPORT lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__4___lambda__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, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12) {
  _start:
  {
  lean_object* x_13; lean_object* x_14; uint8_t x_15; 
  x_13 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__4___lambda__1___closed__2;
  x_14 = l___private_Lean_CoreM_0__Lean_Core_mkFreshNameImp(x_13, x_10, x_11, x_12);
  x_15 = !lean_is_exclusive(x_14);
  if (x_15 == 0)
  {
  lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; 
  x_16 = lean_ctor_get(x_14, 0);
  x_17 = lean_mk_syntax_ident(x_16);
  x_18 = l_Lean_LocalDecl_type(x_1);
  lean_inc(x_17);
  x_19 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_19, 0, x_17);
  lean_ctor_set(x_19, 1, x_18);
  x_20 = lean_array_push(x_4, x_19);
  x_21 = lean_array_push(x_2, x_17);
  x_22 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_22, 0, x_3);
  lean_ctor_set(x_22, 1, x_20);
  x_23 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_23, 0, x_21);
  lean_ctor_set(x_23, 1, x_22);
  x_24 = lean_alloc_ctor(1, 1, 0);
  lean_ctor_set(x_24, 0, x_23);
  lean_ctor_set(x_14, 0, x_24);
  return x_14;
  }
  else
  {
  lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; 
  x_25 = lean_ctor_get(x_14, 0);
  x_26 = lean_ctor_get(x_14, 1);
  lean_inc(x_26);
  lean_inc(x_25);
  lean_dec(x_14);
  x_27 = lean_mk_syntax_ident(x_25);
  x_28 = l_Lean_LocalDecl_type(x_1);
  lean_inc(x_27);
  x_29 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_29, 0, x_27);
  lean_ctor_set(x_29, 1, x_28);
  x_30 = lean_array_push(x_4, x_29);
  x_31 = lean_array_push(x_2, x_27);
  x_32 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_32, 0, x_3);
  lean_ctor_set(x_32, 1, x_30);
  x_33 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_33, 0, x_31);
  lean_ctor_set(x_33, 1, x_32);
  x_34 = lean_alloc_ctor(1, 1, 0);
  lean_ctor_set(x_34, 0, x_33);
  x_35 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_35, 0, x_34);
  lean_ctor_set(x_35, 1, x_26);
  return x_35;
  }
  }
  }
  LEAN_EXPORT lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__4(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13) {
  _start:
  {
  lean_object* x_14; uint8_t x_15; 
  x_14 = lean_ctor_get(x_3, 1);
  x_15 = lean_nat_dec_le(x_14, x_5);
  if (x_15 == 0)
  {
  lean_object* x_16; uint8_t x_17; 
  x_16 = lean_unsigned_to_nat(0u);
  x_17 = lean_nat_dec_eq(x_4, x_16);
  if (x_17 == 0)
  {
  lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; 
  x_18 = lean_unsigned_to_nat(1u);
  x_19 = lean_nat_sub(x_4, x_18);
  lean_dec(x_4);
  x_20 = lean_ctor_get(x_6, 0);
  lean_inc(x_20);
  x_21 = lean_ctor_get(x_6, 1);
  lean_inc(x_21);
  lean_dec(x_6);
  x_22 = lean_ctor_get(x_21, 0);
  lean_inc(x_22);
  x_23 = lean_ctor_get(x_21, 1);
  lean_inc(x_23);
  lean_dec(x_21);
  x_24 = lean_nat_add(x_2, x_5);
  x_25 = l_Lean_instInhabitedExpr;
  x_26 = lean_array_get(x_25, x_1, x_24);
  lean_dec(x_24);
  x_27 = l_Lean_Expr_fvarId_x21(x_26);
  lean_inc(x_9);
  x_28 = l_Lean_Meta_getLocalDecl(x_27, x_9, x_10, x_11, x_12, x_13);
  if (lean_obj_tag(x_28) == 0)
  {
  lean_object* x_29; lean_object* x_30; lean_object* x_31; uint8_t x_32; 
  x_29 = lean_ctor_get(x_28, 0);
  lean_inc(x_29);
  x_30 = lean_ctor_get(x_28, 1);
  lean_inc(x_30);
  lean_dec(x_28);
  x_31 = l_Lean_LocalDecl_userName(x_29);
  x_32 = l_Lean_Name_hasMacroScopes(x_31);
  if (x_32 == 0)
  {
  lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; 
  x_33 = lean_array_push(x_22, x_31);
  x_34 = lean_box(0);
  x_35 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__4___lambda__1(x_29, x_20, x_33, x_23, x_34, x_7, x_8, x_9, x_10, x_11, x_12, x_30);
  lean_dec(x_29);
  x_36 = lean_ctor_get(x_35, 0);
  lean_inc(x_36);
  x_37 = lean_ctor_get(x_35, 1);
  lean_inc(x_37);
  lean_dec(x_35);
  x_38 = lean_ctor_get(x_36, 0);
  lean_inc(x_38);
  lean_dec(x_36);
  x_39 = lean_ctor_get(x_3, 2);
  x_40 = lean_nat_add(x_5, x_39);
  lean_dec(x_5);
  x_4 = x_19;
  x_5 = x_40;
  x_6 = x_38;
  x_13 = x_37;
  goto _start;
  }
  else
  {
  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_dec(x_31);
  x_42 = lean_box(0);
  x_43 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__4___lambda__1(x_29, x_20, x_22, x_23, x_42, x_7, x_8, x_9, x_10, x_11, x_12, x_30);
  lean_dec(x_29);
  x_44 = lean_ctor_get(x_43, 0);
  lean_inc(x_44);
  x_45 = lean_ctor_get(x_43, 1);
  lean_inc(x_45);
  lean_dec(x_43);
  x_46 = lean_ctor_get(x_44, 0);
  lean_inc(x_46);
  lean_dec(x_44);
  x_47 = lean_ctor_get(x_3, 2);
  x_48 = lean_nat_add(x_5, x_47);
  lean_dec(x_5);
  x_4 = x_19;
  x_5 = x_48;
  x_6 = x_46;
  x_13 = x_45;
  goto _start;
  }
  }
  else
  {
  uint8_t x_50; 
  lean_dec(x_23);
  lean_dec(x_22);
  lean_dec(x_20);
  lean_dec(x_19);
  lean_dec(x_9);
  lean_dec(x_5);
  x_50 = !lean_is_exclusive(x_28);
  if (x_50 == 0)
  {
  return x_28;
  }
  else
  {
  lean_object* x_51; lean_object* x_52; lean_object* x_53; 
  x_51 = lean_ctor_get(x_28, 0);
  x_52 = lean_ctor_get(x_28, 1);
  lean_inc(x_52);
  lean_inc(x_51);
  lean_dec(x_28);
  x_53 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_53, 0, x_51);
  lean_ctor_set(x_53, 1, x_52);
  return x_53;
  }
  }
  }
  else
  {
  lean_object* x_54; 
  lean_dec(x_9);
  lean_dec(x_5);
  lean_dec(x_4);
  x_54 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_54, 0, x_6);
  lean_ctor_set(x_54, 1, x_13);
  return x_54;
  }
  }
  else
  {
  lean_object* x_55; 
  lean_dec(x_9);
  lean_dec(x_5);
  lean_dec(x_4);
  x_55 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_55, 0, x_6);
  lean_ctor_set(x_55, 1, x_13);
  return x_55;
  }
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__1() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = lean_unsigned_to_nat(0u);
  x_2 = lean_mk_empty_array_with_capacity(x_1);
  return x_2;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__2() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__1;
  x_2 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_2, 0, x_1);
  lean_ctor_set(x_2, 1, x_1);
  return x_2;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("app");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__4() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6;
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__5() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("explicit");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__6() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6;
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__5;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__7() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("@");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = lean_unsigned_to_nat(2u);
  x_2 = lean_mk_empty_array_with_capacity(x_1);
  return x_2;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__9() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("null");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__9;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__11() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("matchAlt");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__12() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6;
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__11;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__13() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("|");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__14() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string(",");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__15() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(2);
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__14;
  x_3 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_3, 0, x_1);
  lean_ctor_set(x_3, 1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__16() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("=>");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__17() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = lean_unsigned_to_nat(4u);
  x_2 = lean_mk_empty_array_with_capacity(x_1);
  return x_2;
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__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, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13) {
  _start:
  {
  lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; 
  x_14 = lean_ctor_get(x_1, 1);
  lean_inc(x_14);
  x_15 = lean_ctor_get(x_1, 2);
  lean_inc(x_15);
  lean_dec(x_1);
  x_16 = lean_unsigned_to_nat(0u);
  x_17 = lean_unsigned_to_nat(1u);
  lean_inc(x_15);
  x_18 = lean_alloc_ctor(0, 3, 0);
  lean_ctor_set(x_18, 0, x_16);
  lean_ctor_set(x_18, 1, x_15);
  lean_ctor_set(x_18, 2, x_17);
  x_19 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__1;
  lean_inc(x_11);
  x_20 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3(x_18, x_15, x_16, x_19, x_7, x_8, x_9, x_10, x_11, x_12, x_13);
  lean_dec(x_18);
  x_21 = lean_ctor_get(x_20, 0);
  lean_inc(x_21);
  x_22 = lean_ctor_get(x_20, 1);
  lean_inc(x_22);
  lean_dec(x_20);
  lean_inc(x_14);
  x_23 = lean_alloc_ctor(0, 3, 0);
  lean_ctor_set(x_23, 0, x_16);
  lean_ctor_set(x_23, 1, x_14);
  lean_ctor_set(x_23, 2, x_17);
  lean_inc(x_11);
  lean_inc(x_14);
  x_24 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3(x_23, x_14, x_16, x_19, x_7, x_8, x_9, x_10, x_11, x_12, x_22);
  lean_dec(x_23);
  x_25 = lean_ctor_get(x_24, 0);
  lean_inc(x_25);
  x_26 = lean_ctor_get(x_24, 1);
  lean_inc(x_26);
  lean_dec(x_24);
  x_27 = lean_ctor_get(x_2, 4);
  lean_inc(x_27);
  lean_inc(x_27);
  x_28 = lean_alloc_ctor(0, 3, 0);
  lean_ctor_set(x_28, 0, x_16);
  lean_ctor_set(x_28, 1, x_27);
  lean_ctor_set(x_28, 2, x_17);
  x_29 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__2;
  x_30 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_30, 0, x_25);
  lean_ctor_set(x_30, 1, x_29);
  lean_inc(x_9);
  x_31 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__4(x_5, x_14, x_28, x_27, x_16, x_30, x_7, x_8, x_9, x_10, x_11, x_12, x_26);
  lean_dec(x_28);
  lean_dec(x_14);
  if (lean_obj_tag(x_31) == 0)
  {
  lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; 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; lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; 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; lean_object* x_63; lean_object* x_124; lean_object* x_125; uint8_t x_126; 
  x_32 = lean_ctor_get(x_31, 0);
  lean_inc(x_32);
  x_33 = lean_ctor_get(x_32, 1);
  lean_inc(x_33);
  x_34 = lean_ctor_get(x_31, 1);
  lean_inc(x_34);
  lean_dec(x_31);
  x_35 = lean_ctor_get(x_32, 0);
  lean_inc(x_35);
  lean_dec(x_32);
  x_36 = lean_ctor_get(x_33, 0);
  lean_inc(x_36);
  x_37 = lean_ctor_get(x_33, 1);
  lean_inc(x_37);
  lean_dec(x_33);
  lean_inc(x_11);
  x_38 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_11, x_12, x_34);
  x_39 = lean_ctor_get(x_38, 0);
  lean_inc(x_39);
  x_40 = lean_ctor_get(x_38, 1);
  lean_inc(x_40);
  lean_dec(x_38);
  x_41 = l_Lean_Elab_Term_getCurrMacroScope(x_7, x_8, x_9, x_10, x_11, x_12, x_40);
  x_42 = lean_ctor_get(x_41, 1);
  lean_inc(x_42);
  lean_dec(x_41);
  x_43 = l_Lean_Elab_Term_getMainModule___rarg(x_12, x_42);
  x_44 = lean_ctor_get(x_43, 1);
  lean_inc(x_44);
  lean_dec(x_43);
  x_45 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__7;
  x_46 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_46, 0, x_39);
  lean_ctor_set(x_46, 1, x_45);
  x_47 = lean_ctor_get(x_3, 0);
  lean_inc(x_47);
  lean_dec(x_3);
  x_48 = lean_mk_syntax_ident(x_47);
  x_49 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_50 = lean_array_push(x_49, x_46);
  x_51 = lean_array_push(x_50, x_48);
  x_52 = lean_box(2);
  x_53 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__6;
  x_54 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_54, 0, x_52);
  lean_ctor_set(x_54, 1, x_53);
  lean_ctor_set(x_54, 2, x_51);
  x_55 = l_Array_append___rarg(x_19, x_35);
  x_56 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_57 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_57, 0, x_52);
  lean_ctor_set(x_57, 1, x_56);
  lean_ctor_set(x_57, 2, x_55);
  x_58 = lean_array_push(x_49, x_54);
  x_59 = lean_array_push(x_58, x_57);
  x_60 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__4;
  x_61 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_61, 0, x_52);
  lean_ctor_set(x_61, 1, x_60);
  lean_ctor_set(x_61, 2, x_59);
  x_62 = lean_array_push(x_21, x_61);
  x_124 = lean_array_get_size(x_36);
  x_125 = lean_array_get_size(x_37);
  x_126 = lean_nat_dec_eq(x_124, x_125);
  lean_dec(x_125);
  lean_dec(x_124);
  if (x_126 == 0)
  {
  lean_object* x_127; 
  lean_dec(x_36);
  x_127 = lean_box(0);
  x_63 = x_127;
  goto block_123;
  }
  else
  {
  lean_object* x_128; 
  x_128 = lean_alloc_ctor(1, 1, 0);
  lean_ctor_set(x_128, 0, x_36);
  x_63 = x_128;
  goto block_123;
  }
  block_123:
  {
  lean_object* x_64; 
  lean_inc(x_12);
  lean_inc(x_11);
  lean_inc(x_10);
  lean_inc(x_9);
  lean_inc(x_8);
  lean_inc(x_7);
  x_64 = lean_apply_10(x_4, x_2, x_37, x_63, x_7, x_8, x_9, x_10, x_11, x_12, x_44);
  if (lean_obj_tag(x_64) == 0)
  {
  lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72; uint8_t x_73; 
  x_65 = lean_ctor_get(x_64, 0);
  lean_inc(x_65);
  x_66 = lean_ctor_get(x_64, 1);
  lean_inc(x_66);
  lean_dec(x_64);
  lean_inc(x_11);
  x_67 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_11, x_12, x_66);
  x_68 = lean_ctor_get(x_67, 0);
  lean_inc(x_68);
  x_69 = lean_ctor_get(x_67, 1);
  lean_inc(x_69);
  lean_dec(x_67);
  x_70 = l_Lean_Elab_Term_getCurrMacroScope(x_7, x_8, x_9, x_10, x_11, x_12, x_69);
  lean_dec(x_11);
  lean_dec(x_10);
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_7);
  x_71 = lean_ctor_get(x_70, 1);
  lean_inc(x_71);
  lean_dec(x_70);
  x_72 = l_Lean_Elab_Term_getMainModule___rarg(x_12, x_71);
  lean_dec(x_12);
  x_73 = !lean_is_exclusive(x_72);
  if (x_73 == 0)
  {
  lean_object* x_74; lean_object* x_75; lean_object* x_76; lean_object* x_77; size_t x_78; size_t x_79; lean_object* x_80; lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_object* x_94; lean_object* x_95; 
  x_74 = lean_ctor_get(x_72, 0);
  lean_dec(x_74);
  x_75 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__13;
  lean_inc(x_68);
  x_76 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_76, 0, x_68);
  lean_ctor_set(x_76, 1, x_75);
  x_77 = lean_array_get_size(x_62);
  x_78 = lean_usize_of_nat(x_77);
  lean_dec(x_77);
  x_79 = 0;
  x_80 = x_62;
  x_81 = l_Array_mapMUnsafe_map___at___aux__Init__NotationExtra______macroRules___xabterm_x25_x5b___x7c___x5d_xbb__1___spec__3(x_78, x_79, x_80);
  x_82 = x_81;
  x_83 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__15;
  x_84 = l_Lean_mkSepArray(x_82, x_83);
  lean_dec(x_82);
  x_85 = l_Array_append___rarg(x_19, x_84);
  x_86 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_86, 0, x_52);
  lean_ctor_set(x_86, 1, x_56);
  lean_ctor_set(x_86, 2, x_85);
  x_87 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__16;
  x_88 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_88, 0, x_68);
  lean_ctor_set(x_88, 1, x_87);
  x_89 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__17;
  x_90 = lean_array_push(x_89, x_76);
  x_91 = lean_array_push(x_90, x_86);
  x_92 = lean_array_push(x_91, x_88);
  x_93 = lean_array_push(x_92, x_65);
  x_94 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__12;
  x_95 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_95, 0, x_52);
  lean_ctor_set(x_95, 1, x_94);
  lean_ctor_set(x_95, 2, x_93);
  lean_ctor_set(x_72, 0, x_95);
  return x_72;
  }
  else
  {
  lean_object* x_96; lean_object* x_97; lean_object* x_98; lean_object* x_99; size_t x_100; size_t x_101; lean_object* x_102; lean_object* x_103; lean_object* x_104; lean_object* x_105; lean_object* x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; lean_object* x_110; lean_object* x_111; lean_object* x_112; lean_object* x_113; lean_object* x_114; lean_object* x_115; lean_object* x_116; lean_object* x_117; lean_object* x_118; 
  x_96 = lean_ctor_get(x_72, 1);
  lean_inc(x_96);
  lean_dec(x_72);
  x_97 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__13;
  lean_inc(x_68);
  x_98 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_98, 0, x_68);
  lean_ctor_set(x_98, 1, x_97);
  x_99 = lean_array_get_size(x_62);
  x_100 = lean_usize_of_nat(x_99);
  lean_dec(x_99);
  x_101 = 0;
  x_102 = x_62;
  x_103 = l_Array_mapMUnsafe_map___at___aux__Init__NotationExtra______macroRules___xabterm_x25_x5b___x7c___x5d_xbb__1___spec__3(x_100, x_101, x_102);
  x_104 = x_103;
  x_105 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__15;
  x_106 = l_Lean_mkSepArray(x_104, x_105);
  lean_dec(x_104);
  x_107 = l_Array_append___rarg(x_19, x_106);
  x_108 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_108, 0, x_52);
  lean_ctor_set(x_108, 1, x_56);
  lean_ctor_set(x_108, 2, x_107);
  x_109 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__16;
  x_110 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_110, 0, x_68);
  lean_ctor_set(x_110, 1, x_109);
  x_111 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__17;
  x_112 = lean_array_push(x_111, x_98);
  x_113 = lean_array_push(x_112, x_108);
  x_114 = lean_array_push(x_113, x_110);
  x_115 = lean_array_push(x_114, x_65);
  x_116 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__12;
  x_117 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_117, 0, x_52);
  lean_ctor_set(x_117, 1, x_116);
  lean_ctor_set(x_117, 2, x_115);
  x_118 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_118, 0, x_117);
  lean_ctor_set(x_118, 1, x_96);
  return x_118;
  }
  }
  else
  {
  uint8_t x_119; 
  lean_dec(x_62);
  lean_dec(x_12);
  lean_dec(x_11);
  lean_dec(x_10);
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_7);
  x_119 = !lean_is_exclusive(x_64);
  if (x_119 == 0)
  {
  return x_64;
  }
  else
  {
  lean_object* x_120; lean_object* x_121; lean_object* x_122; 
  x_120 = lean_ctor_get(x_64, 0);
  x_121 = lean_ctor_get(x_64, 1);
  lean_inc(x_121);
  lean_inc(x_120);
  lean_dec(x_64);
  x_122 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_122, 0, x_120);
  lean_ctor_set(x_122, 1, x_121);
  return x_122;
  }
  }
  }
  }
  else
  {
  uint8_t x_129; 
  lean_dec(x_21);
  lean_dec(x_12);
  lean_dec(x_11);
  lean_dec(x_10);
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_4);
  lean_dec(x_3);
  lean_dec(x_2);
  x_129 = !lean_is_exclusive(x_31);
  if (x_129 == 0)
  {
  return x_31;
  }
  else
  {
  lean_object* x_130; lean_object* x_131; lean_object* x_132; 
  x_130 = lean_ctor_get(x_31, 0);
  x_131 = lean_ctor_get(x_31, 1);
  lean_inc(x_131);
  lean_inc(x_130);
  lean_dec(x_31);
  x_132 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_132, 0, x_130);
  lean_ctor_set(x_132, 1, x_131);
  return x_132;
  }
  }
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5(lean_object* x_1, lean_object* x_2, size_t x_3, size_t x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12) {
  _start:
  {
  uint8_t x_13; 
  x_13 = lean_usize_dec_lt(x_4, x_3);
  if (x_13 == 0)
  {
  lean_object* x_14; lean_object* x_15; 
  lean_dec(x_11);
  lean_dec(x_10);
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_2);
  lean_dec(x_1);
  x_14 = x_5;
  x_15 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_15, 0, x_14);
  lean_ctor_set(x_15, 1, x_12);
  return x_15;
  }
  else
  {
  lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; 
  x_16 = lean_array_uget(x_5, x_4);
  x_17 = lean_unsigned_to_nat(0u);
  x_18 = lean_array_uset(x_5, x_4, x_17);
  x_19 = x_16;
  lean_inc(x_6);
  x_20 = l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1(x_19, x_6, x_7, x_8, x_9, x_10, x_11, x_12);
  if (lean_obj_tag(x_20) == 0)
  {
  lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; 
  x_21 = lean_ctor_get(x_20, 0);
  lean_inc(x_21);
  x_22 = lean_ctor_get(x_20, 1);
  lean_inc(x_22);
  lean_dec(x_20);
  x_23 = lean_ctor_get(x_21, 0);
  lean_inc(x_23);
  x_24 = lean_ctor_get(x_23, 2);
  lean_inc(x_24);
  lean_inc(x_2);
  lean_inc(x_1);
  x_25 = lean_alloc_closure((void*)(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___boxed), 13, 4);
  lean_closure_set(x_25, 0, x_1);
  lean_closure_set(x_25, 1, x_21);
  lean_closure_set(x_25, 2, x_23);
  lean_closure_set(x_25, 3, x_2);
  lean_inc(x_11);
  lean_inc(x_10);
  lean_inc(x_9);
  lean_inc(x_8);
  lean_inc(x_7);
  lean_inc(x_6);
  x_26 = l_Lean_Meta_forallTelescopeReducing___at_Lean_Elab_Deriving_mkInductArgNames___spec__2___rarg(x_24, x_25, x_6, x_7, x_8, x_9, x_10, x_11, x_22);
  if (lean_obj_tag(x_26) == 0)
  {
  lean_object* x_27; lean_object* x_28; size_t x_29; size_t x_30; lean_object* x_31; lean_object* x_32; 
  x_27 = lean_ctor_get(x_26, 0);
  lean_inc(x_27);
  x_28 = lean_ctor_get(x_26, 1);
  lean_inc(x_28);
  lean_dec(x_26);
  x_29 = 1;
  x_30 = lean_usize_add(x_4, x_29);
  x_31 = x_27;
  x_32 = lean_array_uset(x_18, x_4, x_31);
  x_4 = x_30;
  x_5 = x_32;
  x_12 = x_28;
  goto _start;
  }
  else
  {
  uint8_t x_34; 
  lean_dec(x_18);
  lean_dec(x_11);
  lean_dec(x_10);
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_2);
  lean_dec(x_1);
  x_34 = !lean_is_exclusive(x_26);
  if (x_34 == 0)
  {
  return x_26;
  }
  else
  {
  lean_object* x_35; lean_object* x_36; lean_object* x_37; 
  x_35 = lean_ctor_get(x_26, 0);
  x_36 = lean_ctor_get(x_26, 1);
  lean_inc(x_36);
  lean_inc(x_35);
  lean_dec(x_26);
  x_37 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_37, 0, x_35);
  lean_ctor_set(x_37, 1, x_36);
  return x_37;
  }
  }
  }
  else
  {
  uint8_t x_38; 
  lean_dec(x_18);
  lean_dec(x_11);
  lean_dec(x_10);
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_2);
  lean_dec(x_1);
  x_38 = !lean_is_exclusive(x_20);
  if (x_38 == 0)
  {
  return x_20;
  }
  else
  {
  lean_object* x_39; lean_object* x_40; lean_object* x_41; 
  x_39 = lean_ctor_get(x_20, 0);
  x_40 = lean_ctor_get(x_20, 1);
  lean_inc(x_40);
  lean_inc(x_39);
  lean_dec(x_20);
  x_41 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_41, 0, x_39);
  lean_ctor_set(x_41, 1, x_40);
  return x_41;
  }
  }
  }
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___boxed__const__1() {
  _start:
  {
  size_t x_1; lean_object* x_2; 
  x_1 = 0;
  x_2 = lean_box_usize(x_1);
  return x_2;
  }
  }
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9) {
  _start:
  {
  lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; size_t x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; 
  x_10 = lean_ctor_get(x_1, 4);
  lean_inc(x_10);
  x_11 = l_List_redLength___rarg(x_10);
  x_12 = lean_mk_empty_array_with_capacity(x_11);
  lean_dec(x_11);
  x_13 = l_List_toArrayAux___rarg(x_10, x_12);
  x_14 = lean_array_get_size(x_13);
  x_15 = lean_usize_of_nat(x_14);
  lean_dec(x_14);
  x_16 = x_13;
  x_17 = lean_box_usize(x_15);
  x_18 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___boxed__const__1;
  x_19 = lean_alloc_closure((void*)(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___boxed), 12, 5);
  lean_closure_set(x_19, 0, x_1);
  lean_closure_set(x_19, 1, x_2);
  lean_closure_set(x_19, 2, x_17);
  lean_closure_set(x_19, 3, x_18);
  lean_closure_set(x_19, 4, x_16);
  x_20 = x_19;
  x_21 = lean_apply_7(x_20, x_3, x_4, x_5, x_6, x_7, x_8, x_9);
  return x_21;
  }
  }
  LEAN_EXPORT lean_object* l_Lean_throwError___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__2___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, lean_object* x_7, lean_object* x_8) {
  _start:
  {
  lean_object* x_9; 
  x_9 = l_Lean_throwError___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__2(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_5);
  lean_dec(x_4);
  lean_dec(x_3);
  return x_9;
  }
  }
  LEAN_EXPORT lean_object* l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___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, lean_object* x_7, lean_object* x_8) {
  _start:
  {
  lean_object* x_9; 
  x_9 = l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_5);
  lean_dec(x_4);
  lean_dec(x_3);
  return x_9;
  }
  }
  LEAN_EXPORT lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___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, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11) {
  _start:
  {
  lean_object* x_12; 
  x_12 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11);
  lean_dec(x_10);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_5);
  lean_dec(x_1);
  return x_12;
  }
  }
  LEAN_EXPORT lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__4___lambda__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, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12) {
  _start:
  {
  lean_object* x_13; 
  x_13 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__4___lambda__1(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12);
  lean_dec(x_11);
  lean_dec(x_10);
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_5);
  lean_dec(x_1);
  return x_13;
  }
  }
  LEAN_EXPORT lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__4___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, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13) {
  _start:
  {
  lean_object* x_14; 
  x_14 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__4(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12, x_13);
  lean_dec(x_12);
  lean_dec(x_11);
  lean_dec(x_10);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_3);
  lean_dec(x_2);
  lean_dec(x_1);
  return x_14;
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__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, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13) {
  _start:
  {
  lean_object* x_14; 
  x_14 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12, x_13);
  lean_dec(x_6);
  lean_dec(x_5);
  return x_14;
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___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, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12) {
  _start:
  {
  size_t x_13; size_t x_14; lean_object* x_15; 
  x_13 = lean_unbox_usize(x_3);
  lean_dec(x_3);
  x_14 = lean_unbox_usize(x_4);
  lean_dec(x_4);
  x_15 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5(x_1, x_2, x_13, x_14, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12);
  return x_15;
  }
  }
  LEAN_EXPORT lean_object* l_Lean_throwError___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__2(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; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; uint8_t x_14; 
  x_5 = l_Lean_Elab_Command_getRef(x_2, x_3, x_4);
  x_6 = lean_ctor_get(x_5, 0);
  lean_inc(x_6);
  x_7 = lean_ctor_get(x_5, 1);
  lean_inc(x_7);
  lean_dec(x_5);
  x_8 = lean_ctor_get(x_2, 4);
  lean_inc(x_8);
  lean_inc(x_8);
  x_9 = l_Lean_Elab_getBetterRef(x_6, x_8);
  lean_dec(x_6);
  x_10 = l_Lean_addMessageContextPartial___at_Lean_Elab_Command_instAddMessageContextCommandElabM___spec__1(x_1, x_2, x_3, x_7);
  x_11 = lean_ctor_get(x_10, 0);
  lean_inc(x_11);
  x_12 = lean_ctor_get(x_10, 1);
  lean_inc(x_12);
  lean_dec(x_10);
  x_13 = l_Lean_Elab_addMacroStack___at_Lean_Elab_Command_instAddErrorMessageContextCommandElabM___spec__1(x_11, x_8, x_2, x_3, x_12);
  lean_dec(x_2);
  lean_dec(x_8);
  x_14 = !lean_is_exclusive(x_13);
  if (x_14 == 0)
  {
  lean_object* x_15; lean_object* x_16; 
  x_15 = lean_ctor_get(x_13, 0);
  x_16 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_16, 0, x_9);
  lean_ctor_set(x_16, 1, x_15);
  lean_ctor_set_tag(x_13, 1);
  lean_ctor_set(x_13, 0, x_16);
  return x_13;
  }
  else
  {
  lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; 
  x_17 = lean_ctor_get(x_13, 0);
  x_18 = lean_ctor_get(x_13, 1);
  lean_inc(x_18);
  lean_inc(x_17);
  lean_dec(x_13);
  x_19 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_19, 0, x_9);
  lean_ctor_set(x_19, 1, x_17);
  x_20 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_20, 0, x_19);
  lean_ctor_set(x_20, 1, x_18);
  return x_20;
  }
  }
  }
  static lean_object* _init_l_Lean_getConstInfoInduct___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__1___closed__1() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("' is not a inductive type");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_getConstInfoInduct___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__1___closed__2() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = l_Lean_getConstInfoInduct___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__1___closed__1;
  x_2 = l_Lean_stringToMessageData(x_1);
  return x_2;
  }
  }
  LEAN_EXPORT lean_object* l_Lean_getConstInfoInduct___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
  _start:
  {
  lean_object* x_5; 
  lean_inc(x_2);
  lean_inc(x_1);
  x_5 = l_Lean_getConstInfo___at_Lean_Elab_elabDeriving___spec__14(x_1, x_2, x_3, x_4);
  if (lean_obj_tag(x_5) == 0)
  {
  lean_object* x_6; 
  x_6 = lean_ctor_get(x_5, 0);
  lean_inc(x_6);
  if (lean_obj_tag(x_6) == 5)
  {
  uint8_t x_7; 
  lean_dec(x_2);
  lean_dec(x_1);
  x_7 = !lean_is_exclusive(x_5);
  if (x_7 == 0)
  {
  lean_object* x_8; lean_object* x_9; 
  x_8 = lean_ctor_get(x_5, 0);
  lean_dec(x_8);
  x_9 = lean_ctor_get(x_6, 0);
  lean_inc(x_9);
  lean_dec(x_6);
  lean_ctor_set(x_5, 0, x_9);
  return x_5;
  }
  else
  {
  lean_object* x_10; lean_object* x_11; lean_object* x_12; 
  x_10 = lean_ctor_get(x_5, 1);
  lean_inc(x_10);
  lean_dec(x_5);
  x_11 = lean_ctor_get(x_6, 0);
  lean_inc(x_11);
  lean_dec(x_6);
  x_12 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_12, 0, x_11);
  lean_ctor_set(x_12, 1, x_10);
  return x_12;
  }
  }
  else
  {
  lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; 
  lean_dec(x_6);
  x_13 = lean_ctor_get(x_5, 1);
  lean_inc(x_13);
  lean_dec(x_5);
  x_14 = lean_box(0);
  x_15 = l_Lean_mkConst(x_1, x_14);
  x_16 = lean_alloc_ctor(2, 1, 0);
  lean_ctor_set(x_16, 0, x_15);
  x_17 = l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1___closed__2;
  x_18 = lean_alloc_ctor(10, 2, 0);
  lean_ctor_set(x_18, 0, x_17);
  lean_ctor_set(x_18, 1, x_16);
  x_19 = l_Lean_getConstInfoInduct___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__1___closed__2;
  x_20 = lean_alloc_ctor(10, 2, 0);
  lean_ctor_set(x_20, 0, x_18);
  lean_ctor_set(x_20, 1, x_19);
  x_21 = l_Lean_throwError___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__2(x_20, x_2, x_3, x_13);
  return x_21;
  }
  }
  else
  {
  uint8_t x_22; 
  lean_dec(x_2);
  lean_dec(x_1);
  x_22 = !lean_is_exclusive(x_5);
  if (x_22 == 0)
  {
  return x_5;
  }
  else
  {
  lean_object* x_23; lean_object* x_24; lean_object* x_25; 
  x_23 = lean_ctor_get(x_5, 0);
  x_24 = lean_ctor_get(x_5, 1);
  lean_inc(x_24);
  lean_inc(x_23);
  lean_dec(x_5);
  x_25 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_25, 0, x_23);
  lean_ctor_set(x_25, 1, x_24);
  return x_25;
  }
  }
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__1() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("toJson");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__2() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__1;
  x_2 = lean_string_utf8_byte_size(x_1);
  return x_2;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__3() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; 
  x_1 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__1;
  x_2 = lean_unsigned_to_nat(0u);
  x_3 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__2;
  x_4 = lean_alloc_ctor(0, 3, 0);
  lean_ctor_set(x_4, 0, x_1);
  lean_ctor_set(x_4, 1, x_2);
  lean_ctor_set(x_4, 2, x_3);
  return x_4;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__4() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__1;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, size_t x_5, size_t x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13, lean_object* x_14) {
  _start:
  {
  uint8_t x_15; 
  x_15 = lean_usize_dec_lt(x_6, x_5);
  if (x_15 == 0)
  {
  lean_object* x_16; lean_object* x_17; 
  lean_dec(x_12);
  lean_dec(x_4);
  lean_dec(x_3);
  lean_dec(x_2);
  x_16 = x_7;
  x_17 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_17, 0, x_16);
  lean_ctor_set(x_17, 1, x_14);
  return x_17;
  }
  else
  {
  lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; uint8_t x_30; 
  x_18 = lean_array_uget(x_7, x_6);
  x_19 = lean_unsigned_to_nat(0u);
  x_20 = lean_array_uset(x_7, x_6, x_19);
  x_21 = x_18;
  x_30 = !lean_is_exclusive(x_21);
  if (x_30 == 0)
  {
  lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; uint8_t x_35; 
  x_31 = lean_ctor_get(x_21, 0);
  x_32 = lean_ctor_get(x_21, 1);
  x_33 = lean_ctor_get(x_1, 0);
  x_34 = lean_ctor_get(x_33, 0);
  x_35 = l_Lean_Expr_isAppOf(x_32, x_34);
  lean_dec(x_32);
  if (x_35 == 0)
  {
  lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; 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; lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; 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; lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; 
  lean_inc(x_12);
  x_36 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_12, x_13, x_14);
  x_37 = lean_ctor_get(x_36, 0);
  lean_inc(x_37);
  x_38 = lean_ctor_get(x_36, 1);
  lean_inc(x_38);
  lean_dec(x_36);
  x_39 = l_Lean_Elab_Term_getCurrMacroScope(x_8, x_9, x_10, x_11, x_12, x_13, x_38);
  x_40 = lean_ctor_get(x_39, 0);
  lean_inc(x_40);
  x_41 = lean_ctor_get(x_39, 1);
  lean_inc(x_41);
  lean_dec(x_39);
  x_42 = l_Lean_Elab_Term_getMainModule___rarg(x_13, x_41);
  x_43 = lean_ctor_get(x_42, 0);
  lean_inc(x_43);
  x_44 = lean_ctor_get(x_42, 1);
  lean_inc(x_44);
  lean_dec(x_42);
  x_45 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3;
  lean_inc(x_3);
  x_46 = lean_name_mk_string(x_3, x_45);
  x_47 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5;
  x_48 = lean_name_mk_string(x_46, x_47);
  x_49 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3;
  x_50 = lean_name_mk_string(x_48, x_49);
  x_51 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__4;
  x_52 = l_Lean_addMacroScope(x_43, x_51, x_40);
  x_53 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__1;
  lean_inc(x_4);
  x_54 = lean_name_mk_string(x_4, x_53);
  x_55 = lean_box(0);
  lean_ctor_set(x_21, 1, x_55);
  lean_ctor_set(x_21, 0, x_54);
  x_56 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_56, 0, x_21);
  lean_ctor_set(x_56, 1, x_55);
  x_57 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__3;
  x_58 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_58, 0, x_37);
  lean_ctor_set(x_58, 1, x_57);
  lean_ctor_set(x_58, 2, x_52);
  lean_ctor_set(x_58, 3, x_56);
  x_59 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_60 = lean_array_push(x_59, x_31);
  x_61 = lean_box(2);
  x_62 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_63 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_63, 0, x_61);
  lean_ctor_set(x_63, 1, x_62);
  lean_ctor_set(x_63, 2, x_60);
  x_64 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_65 = lean_array_push(x_64, x_58);
  x_66 = lean_array_push(x_65, x_63);
  x_67 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_67, 0, x_61);
  lean_ctor_set(x_67, 1, x_50);
  lean_ctor_set(x_67, 2, x_66);
  x_22 = x_67;
  x_23 = x_44;
  goto block_29;
  }
  else
  {
  lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76; lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; 
  lean_free_object(x_21);
  lean_inc(x_12);
  x_68 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_12, x_13, x_14);
  x_69 = lean_ctor_get(x_68, 1);
  lean_inc(x_69);
  lean_dec(x_68);
  x_70 = l_Lean_Elab_Term_getCurrMacroScope(x_8, x_9, x_10, x_11, x_12, x_13, x_69);
  x_71 = lean_ctor_get(x_70, 1);
  lean_inc(x_71);
  lean_dec(x_70);
  x_72 = l_Lean_Elab_Term_getMainModule___rarg(x_13, x_71);
  x_73 = lean_ctor_get(x_72, 1);
  lean_inc(x_73);
  lean_dec(x_72);
  x_74 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3;
  lean_inc(x_3);
  x_75 = lean_name_mk_string(x_3, x_74);
  x_76 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5;
  x_77 = lean_name_mk_string(x_75, x_76);
  x_78 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3;
  x_79 = lean_name_mk_string(x_77, x_78);
  x_80 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_81 = lean_array_push(x_80, x_31);
  x_82 = lean_box(2);
  x_83 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_84 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_84, 0, x_82);
  lean_ctor_set(x_84, 1, x_83);
  lean_ctor_set(x_84, 2, x_81);
  x_85 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  lean_inc(x_2);
  x_86 = lean_array_push(x_85, x_2);
  x_87 = lean_array_push(x_86, x_84);
  x_88 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_88, 0, x_82);
  lean_ctor_set(x_88, 1, x_79);
  lean_ctor_set(x_88, 2, x_87);
  x_22 = x_88;
  x_23 = x_73;
  goto block_29;
  }
  }
  else
  {
  lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; uint8_t x_93; 
  x_89 = lean_ctor_get(x_21, 0);
  x_90 = lean_ctor_get(x_21, 1);
  lean_inc(x_90);
  lean_inc(x_89);
  lean_dec(x_21);
  x_91 = lean_ctor_get(x_1, 0);
  x_92 = lean_ctor_get(x_91, 0);
  x_93 = l_Lean_Expr_isAppOf(x_90, x_92);
  lean_dec(x_90);
  if (x_93 == 0)
  {
  lean_object* x_94; lean_object* x_95; lean_object* x_96; lean_object* x_97; lean_object* x_98; lean_object* x_99; lean_object* x_100; lean_object* x_101; lean_object* x_102; lean_object* x_103; lean_object* x_104; lean_object* x_105; lean_object* x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; lean_object* x_110; lean_object* x_111; lean_object* x_112; lean_object* x_113; lean_object* x_114; lean_object* x_115; lean_object* x_116; lean_object* x_117; lean_object* x_118; lean_object* x_119; lean_object* x_120; lean_object* x_121; lean_object* x_122; lean_object* x_123; lean_object* x_124; lean_object* x_125; lean_object* x_126; 
  lean_inc(x_12);
  x_94 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_12, x_13, x_14);
  x_95 = lean_ctor_get(x_94, 0);
  lean_inc(x_95);
  x_96 = lean_ctor_get(x_94, 1);
  lean_inc(x_96);
  lean_dec(x_94);
  x_97 = l_Lean_Elab_Term_getCurrMacroScope(x_8, x_9, x_10, x_11, x_12, x_13, x_96);
  x_98 = lean_ctor_get(x_97, 0);
  lean_inc(x_98);
  x_99 = lean_ctor_get(x_97, 1);
  lean_inc(x_99);
  lean_dec(x_97);
  x_100 = l_Lean_Elab_Term_getMainModule___rarg(x_13, x_99);
  x_101 = lean_ctor_get(x_100, 0);
  lean_inc(x_101);
  x_102 = lean_ctor_get(x_100, 1);
  lean_inc(x_102);
  lean_dec(x_100);
  x_103 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3;
  lean_inc(x_3);
  x_104 = lean_name_mk_string(x_3, x_103);
  x_105 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5;
  x_106 = lean_name_mk_string(x_104, x_105);
  x_107 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3;
  x_108 = lean_name_mk_string(x_106, x_107);
  x_109 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__4;
  x_110 = l_Lean_addMacroScope(x_101, x_109, x_98);
  x_111 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__1;
  lean_inc(x_4);
  x_112 = lean_name_mk_string(x_4, x_111);
  x_113 = lean_box(0);
  x_114 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_114, 0, x_112);
  lean_ctor_set(x_114, 1, x_113);
  x_115 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_115, 0, x_114);
  lean_ctor_set(x_115, 1, x_113);
  x_116 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__3;
  x_117 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_117, 0, x_95);
  lean_ctor_set(x_117, 1, x_116);
  lean_ctor_set(x_117, 2, x_110);
  lean_ctor_set(x_117, 3, x_115);
  x_118 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_119 = lean_array_push(x_118, x_89);
  x_120 = lean_box(2);
  x_121 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_122 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_122, 0, x_120);
  lean_ctor_set(x_122, 1, x_121);
  lean_ctor_set(x_122, 2, x_119);
  x_123 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_124 = lean_array_push(x_123, x_117);
  x_125 = lean_array_push(x_124, x_122);
  x_126 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_126, 0, x_120);
  lean_ctor_set(x_126, 1, x_108);
  lean_ctor_set(x_126, 2, x_125);
  x_22 = x_126;
  x_23 = x_102;
  goto block_29;
  }
  else
  {
  lean_object* x_127; lean_object* x_128; lean_object* x_129; lean_object* x_130; lean_object* x_131; lean_object* x_132; lean_object* x_133; lean_object* x_134; lean_object* x_135; lean_object* x_136; lean_object* x_137; lean_object* x_138; lean_object* x_139; lean_object* x_140; 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; 
  lean_inc(x_12);
  x_127 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_12, x_13, x_14);
  x_128 = lean_ctor_get(x_127, 1);
  lean_inc(x_128);
  lean_dec(x_127);
  x_129 = l_Lean_Elab_Term_getCurrMacroScope(x_8, x_9, x_10, x_11, x_12, x_13, x_128);
  x_130 = lean_ctor_get(x_129, 1);
  lean_inc(x_130);
  lean_dec(x_129);
  x_131 = l_Lean_Elab_Term_getMainModule___rarg(x_13, x_130);
  x_132 = lean_ctor_get(x_131, 1);
  lean_inc(x_132);
  lean_dec(x_131);
  x_133 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3;
  lean_inc(x_3);
  x_134 = lean_name_mk_string(x_3, x_133);
  x_135 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5;
  x_136 = lean_name_mk_string(x_134, x_135);
  x_137 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3;
  x_138 = lean_name_mk_string(x_136, x_137);
  x_139 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_140 = lean_array_push(x_139, x_89);
  x_141 = lean_box(2);
  x_142 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_143 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_143, 0, x_141);
  lean_ctor_set(x_143, 1, x_142);
  lean_ctor_set(x_143, 2, x_140);
  x_144 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  lean_inc(x_2);
  x_145 = lean_array_push(x_144, x_2);
  x_146 = lean_array_push(x_145, x_143);
  x_147 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_147, 0, x_141);
  lean_ctor_set(x_147, 1, x_138);
  lean_ctor_set(x_147, 2, x_146);
  x_22 = x_147;
  x_23 = x_132;
  goto block_29;
  }
  }
  block_29:
  {
  size_t x_24; size_t x_25; lean_object* x_26; lean_object* x_27; 
  x_24 = 1;
  x_25 = lean_usize_add(x_6, x_24);
  x_26 = x_22;
  x_27 = lean_array_uset(x_20, x_6, x_26);
  x_6 = x_25;
  x_7 = x_27;
  x_14 = x_23;
  goto _start;
  }
  }
  }
  }
  static lean_object* _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__1() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("paren");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__2() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("(");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__3() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("tupleTail");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__4() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string(")");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = lean_unsigned_to_nat(3u);
  x_2 = lean_mk_empty_array_with_capacity(x_1);
  return x_2;
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13, lean_object* x_14, lean_object* x_15, lean_object* x_16, lean_object* x_17, lean_object* x_18) {
  _start:
  {
  lean_object* x_19; uint8_t x_20; 
  x_19 = lean_unsigned_to_nat(0u);
  x_20 = lean_nat_dec_eq(x_8, x_19);
  if (x_20 == 0)
  {
  lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_74; lean_object* x_75; lean_object* x_76; lean_object* x_77; lean_object* x_78; uint8_t x_79; uint8_t x_80; 
  x_21 = lean_unsigned_to_nat(1u);
  x_22 = lean_nat_sub(x_8, x_21);
  lean_dec(x_8);
  x_23 = lean_array_fget(x_7, x_9);
  x_74 = lean_ctor_get(x_23, 0);
  lean_inc(x_74);
  x_75 = lean_ctor_get(x_23, 1);
  lean_inc(x_75);
  if (lean_is_exclusive(x_23)) {
   lean_ctor_release(x_23, 0);
   lean_ctor_release(x_23, 1);
   x_76 = x_23;
  } else {
   lean_dec_ref(x_23);
   x_76 = lean_box(0);
  }
  x_77 = lean_ctor_get(x_1, 0);
  x_78 = lean_ctor_get(x_77, 0);
  x_79 = l_Lean_Expr_isAppOf(x_75, x_78);
  lean_dec(x_75);
  if (x_79 == 0)
  {
  uint8_t x_136; 
  x_136 = 0;
  x_80 = x_136;
  goto block_135;
  }
  else
  {
  uint8_t x_137; 
  x_137 = 1;
  x_80 = x_137;
  goto block_135;
  }
  block_73:
  {
  lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; 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; lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; 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; lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; 
  lean_inc(x_16);
  x_26 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_16, x_17, x_25);
  x_27 = lean_ctor_get(x_26, 0);
  lean_inc(x_27);
  x_28 = lean_ctor_get(x_26, 1);
  lean_inc(x_28);
  lean_dec(x_26);
  x_29 = l_Lean_Elab_Term_getCurrMacroScope(x_12, x_13, x_14, x_15, x_16, x_17, x_28);
  x_30 = lean_ctor_get(x_29, 1);
  lean_inc(x_30);
  lean_dec(x_29);
  x_31 = l_Lean_Elab_Term_getMainModule___rarg(x_17, x_30);
  x_32 = lean_ctor_get(x_31, 1);
  lean_inc(x_32);
  lean_dec(x_31);
  x_33 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3;
  lean_inc(x_3);
  x_34 = lean_name_mk_string(x_3, x_33);
  x_35 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5;
  x_36 = lean_name_mk_string(x_34, x_35);
  x_37 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__1;
  lean_inc(x_36);
  x_38 = lean_name_mk_string(x_36, x_37);
  x_39 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__2;
  lean_inc(x_27);
  x_40 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_40, 0, x_27);
  lean_ctor_set(x_40, 1, x_39);
  x_41 = l_Lean_instInhabitedName;
  x_42 = lean_array_get(x_41, x_6, x_9);
  x_43 = l_Lean_Name_getString_x21(x_42);
  x_44 = lean_box(2);
  x_45 = l_Lean_Syntax_mkStrLit(x_43, x_44);
  lean_dec(x_43);
  x_46 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__3;
  x_47 = lean_name_mk_string(x_36, x_46);
  x_48 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__14;
  lean_inc(x_27);
  x_49 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_49, 0, x_27);
  lean_ctor_set(x_49, 1, x_48);
  x_50 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_51 = lean_array_push(x_50, x_24);
  x_52 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_53 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_53, 0, x_44);
  lean_ctor_set(x_53, 1, x_52);
  lean_ctor_set(x_53, 2, x_51);
  x_54 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_55 = lean_array_push(x_54, x_49);
  x_56 = lean_array_push(x_55, x_53);
  x_57 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_57, 0, x_44);
  lean_ctor_set(x_57, 1, x_47);
  lean_ctor_set(x_57, 2, x_56);
  x_58 = lean_array_push(x_50, x_57);
  x_59 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_59, 0, x_44);
  lean_ctor_set(x_59, 1, x_52);
  lean_ctor_set(x_59, 2, x_58);
  x_60 = lean_array_push(x_54, x_45);
  x_61 = lean_array_push(x_60, x_59);
  x_62 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_62, 0, x_44);
  lean_ctor_set(x_62, 1, x_52);
  lean_ctor_set(x_62, 2, x_61);
  x_63 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__4;
  x_64 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_64, 0, x_27);
  lean_ctor_set(x_64, 1, x_63);
  x_65 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5;
  x_66 = lean_array_push(x_65, x_40);
  x_67 = lean_array_push(x_66, x_62);
  x_68 = lean_array_push(x_67, x_64);
  x_69 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_69, 0, x_44);
  lean_ctor_set(x_69, 1, x_38);
  lean_ctor_set(x_69, 2, x_68);
  x_70 = lean_nat_add(x_9, x_21);
  lean_dec(x_9);
  x_71 = lean_array_push(x_11, x_69);
  x_8 = x_22;
  x_9 = x_70;
  x_10 = lean_box(0);
  x_11 = x_71;
  x_18 = x_32;
  goto _start;
  }
  block_135:
  {
  if (x_80 == 0)
  {
  lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_object* x_94; lean_object* x_95; lean_object* x_96; lean_object* x_97; lean_object* x_98; lean_object* x_99; lean_object* x_100; lean_object* x_101; lean_object* x_102; lean_object* x_103; lean_object* x_104; lean_object* x_105; lean_object* x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; lean_object* x_110; lean_object* x_111; lean_object* x_112; lean_object* x_113; 
  lean_inc(x_16);
  x_81 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_16, x_17, x_18);
  x_82 = lean_ctor_get(x_81, 0);
  lean_inc(x_82);
  x_83 = lean_ctor_get(x_81, 1);
  lean_inc(x_83);
  lean_dec(x_81);
  x_84 = l_Lean_Elab_Term_getCurrMacroScope(x_12, x_13, x_14, x_15, x_16, x_17, x_83);
  x_85 = lean_ctor_get(x_84, 0);
  lean_inc(x_85);
  x_86 = lean_ctor_get(x_84, 1);
  lean_inc(x_86);
  lean_dec(x_84);
  x_87 = l_Lean_Elab_Term_getMainModule___rarg(x_17, x_86);
  x_88 = lean_ctor_get(x_87, 0);
  lean_inc(x_88);
  x_89 = lean_ctor_get(x_87, 1);
  lean_inc(x_89);
  lean_dec(x_87);
  x_90 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3;
  lean_inc(x_3);
  x_91 = lean_name_mk_string(x_3, x_90);
  x_92 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5;
  x_93 = lean_name_mk_string(x_91, x_92);
  x_94 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3;
  x_95 = lean_name_mk_string(x_93, x_94);
  x_96 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__4;
  x_97 = l_Lean_addMacroScope(x_88, x_96, x_85);
  x_98 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__1;
  lean_inc(x_4);
  x_99 = lean_name_mk_string(x_4, x_98);
  x_100 = lean_box(0);
  if (lean_is_scalar(x_76)) {
   x_101 = lean_alloc_ctor(0, 2, 0);
  } else {
   x_101 = x_76;
  }
  lean_ctor_set(x_101, 0, x_99);
  lean_ctor_set(x_101, 1, x_100);
  x_102 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_102, 0, x_101);
  lean_ctor_set(x_102, 1, x_100);
  x_103 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__3;
  x_104 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_104, 0, x_82);
  lean_ctor_set(x_104, 1, x_103);
  lean_ctor_set(x_104, 2, x_97);
  lean_ctor_set(x_104, 3, x_102);
  x_105 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_106 = lean_array_push(x_105, x_74);
  x_107 = lean_box(2);
  x_108 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_109 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_109, 0, x_107);
  lean_ctor_set(x_109, 1, x_108);
  lean_ctor_set(x_109, 2, x_106);
  x_110 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_111 = lean_array_push(x_110, x_104);
  x_112 = lean_array_push(x_111, x_109);
  x_113 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_113, 0, x_107);
  lean_ctor_set(x_113, 1, x_95);
  lean_ctor_set(x_113, 2, x_112);
  x_24 = x_113;
  x_25 = x_89;
  goto block_73;
  }
  else
  {
  lean_object* x_114; lean_object* x_115; lean_object* x_116; lean_object* x_117; lean_object* x_118; lean_object* x_119; lean_object* x_120; lean_object* x_121; lean_object* x_122; lean_object* x_123; lean_object* x_124; lean_object* x_125; lean_object* x_126; lean_object* x_127; lean_object* x_128; lean_object* x_129; lean_object* x_130; lean_object* x_131; lean_object* x_132; lean_object* x_133; lean_object* x_134; 
  lean_dec(x_76);
  lean_inc(x_16);
  x_114 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_16, x_17, x_18);
  x_115 = lean_ctor_get(x_114, 1);
  lean_inc(x_115);
  lean_dec(x_114);
  x_116 = l_Lean_Elab_Term_getCurrMacroScope(x_12, x_13, x_14, x_15, x_16, x_17, x_115);
  x_117 = lean_ctor_get(x_116, 1);
  lean_inc(x_117);
  lean_dec(x_116);
  x_118 = l_Lean_Elab_Term_getMainModule___rarg(x_17, x_117);
  x_119 = lean_ctor_get(x_118, 1);
  lean_inc(x_119);
  lean_dec(x_118);
  x_120 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3;
  lean_inc(x_3);
  x_121 = lean_name_mk_string(x_3, x_120);
  x_122 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5;
  x_123 = lean_name_mk_string(x_121, x_122);
  x_124 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3;
  x_125 = lean_name_mk_string(x_123, x_124);
  x_126 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_127 = lean_array_push(x_126, x_74);
  x_128 = lean_box(2);
  x_129 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_130 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_130, 0, x_128);
  lean_ctor_set(x_130, 1, x_129);
  lean_ctor_set(x_130, 2, x_127);
  x_131 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  lean_inc(x_2);
  x_132 = lean_array_push(x_131, x_2);
  x_133 = lean_array_push(x_132, x_130);
  x_134 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_134, 0, x_128);
  lean_ctor_set(x_134, 1, x_125);
  lean_ctor_set(x_134, 2, x_133);
  x_24 = x_134;
  x_25 = x_119;
  goto block_73;
  }
  }
  }
  else
  {
  lean_object* x_138; 
  lean_dec(x_16);
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_4);
  lean_dec(x_3);
  lean_dec(x_2);
  x_138 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_138, 0, x_11);
  lean_ctor_set(x_138, 1, x_18);
  return x_138;
  }
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__5(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13, lean_object* x_14, lean_object* x_15, lean_object* x_16, lean_object* x_17, lean_object* x_18) {
  _start:
  {
  lean_object* x_19; uint8_t x_20; 
  x_19 = lean_unsigned_to_nat(0u);
  x_20 = lean_nat_dec_eq(x_8, x_19);
  if (x_20 == 0)
  {
  lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_74; lean_object* x_75; lean_object* x_76; lean_object* x_77; lean_object* x_78; uint8_t x_79; uint8_t x_80; 
  x_21 = lean_unsigned_to_nat(1u);
  x_22 = lean_nat_sub(x_8, x_21);
  lean_dec(x_8);
  x_23 = lean_array_fget(x_7, x_9);
  x_74 = lean_ctor_get(x_23, 0);
  lean_inc(x_74);
  x_75 = lean_ctor_get(x_23, 1);
  lean_inc(x_75);
  if (lean_is_exclusive(x_23)) {
   lean_ctor_release(x_23, 0);
   lean_ctor_release(x_23, 1);
   x_76 = x_23;
  } else {
   lean_dec_ref(x_23);
   x_76 = lean_box(0);
  }
  x_77 = lean_ctor_get(x_1, 0);
  x_78 = lean_ctor_get(x_77, 0);
  x_79 = l_Lean_Expr_isAppOf(x_75, x_78);
  lean_dec(x_75);
  if (x_79 == 0)
  {
  uint8_t x_136; 
  x_136 = 0;
  x_80 = x_136;
  goto block_135;
  }
  else
  {
  uint8_t x_137; 
  x_137 = 1;
  x_80 = x_137;
  goto block_135;
  }
  block_73:
  {
  lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; 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; lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; 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; lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; 
  lean_inc(x_16);
  x_26 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_16, x_17, x_25);
  x_27 = lean_ctor_get(x_26, 0);
  lean_inc(x_27);
  x_28 = lean_ctor_get(x_26, 1);
  lean_inc(x_28);
  lean_dec(x_26);
  x_29 = l_Lean_Elab_Term_getCurrMacroScope(x_12, x_13, x_14, x_15, x_16, x_17, x_28);
  x_30 = lean_ctor_get(x_29, 1);
  lean_inc(x_30);
  lean_dec(x_29);
  x_31 = l_Lean_Elab_Term_getMainModule___rarg(x_17, x_30);
  x_32 = lean_ctor_get(x_31, 1);
  lean_inc(x_32);
  lean_dec(x_31);
  x_33 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3;
  lean_inc(x_3);
  x_34 = lean_name_mk_string(x_3, x_33);
  x_35 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5;
  x_36 = lean_name_mk_string(x_34, x_35);
  x_37 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__1;
  lean_inc(x_36);
  x_38 = lean_name_mk_string(x_36, x_37);
  x_39 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__2;
  lean_inc(x_27);
  x_40 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_40, 0, x_27);
  lean_ctor_set(x_40, 1, x_39);
  x_41 = l_Lean_instInhabitedName;
  x_42 = lean_array_get(x_41, x_5, x_9);
  x_43 = l_Lean_Name_getString_x21(x_42);
  x_44 = lean_box(2);
  x_45 = l_Lean_Syntax_mkStrLit(x_43, x_44);
  lean_dec(x_43);
  x_46 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__3;
  x_47 = lean_name_mk_string(x_36, x_46);
  x_48 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__14;
  lean_inc(x_27);
  x_49 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_49, 0, x_27);
  lean_ctor_set(x_49, 1, x_48);
  x_50 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_51 = lean_array_push(x_50, x_24);
  x_52 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_53 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_53, 0, x_44);
  lean_ctor_set(x_53, 1, x_52);
  lean_ctor_set(x_53, 2, x_51);
  x_54 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_55 = lean_array_push(x_54, x_49);
  x_56 = lean_array_push(x_55, x_53);
  x_57 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_57, 0, x_44);
  lean_ctor_set(x_57, 1, x_47);
  lean_ctor_set(x_57, 2, x_56);
  x_58 = lean_array_push(x_50, x_57);
  x_59 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_59, 0, x_44);
  lean_ctor_set(x_59, 1, x_52);
  lean_ctor_set(x_59, 2, x_58);
  x_60 = lean_array_push(x_54, x_45);
  x_61 = lean_array_push(x_60, x_59);
  x_62 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_62, 0, x_44);
  lean_ctor_set(x_62, 1, x_52);
  lean_ctor_set(x_62, 2, x_61);
  x_63 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__4;
  x_64 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_64, 0, x_27);
  lean_ctor_set(x_64, 1, x_63);
  x_65 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5;
  x_66 = lean_array_push(x_65, x_40);
  x_67 = lean_array_push(x_66, x_62);
  x_68 = lean_array_push(x_67, x_64);
  x_69 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_69, 0, x_44);
  lean_ctor_set(x_69, 1, x_38);
  lean_ctor_set(x_69, 2, x_68);
  x_70 = lean_nat_add(x_9, x_21);
  lean_dec(x_9);
  x_71 = lean_array_push(x_11, x_69);
  x_8 = x_22;
  x_9 = x_70;
  x_10 = lean_box(0);
  x_11 = x_71;
  x_18 = x_32;
  goto _start;
  }
  block_135:
  {
  if (x_80 == 0)
  {
  lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_object* x_94; lean_object* x_95; lean_object* x_96; lean_object* x_97; lean_object* x_98; lean_object* x_99; lean_object* x_100; lean_object* x_101; lean_object* x_102; lean_object* x_103; lean_object* x_104; lean_object* x_105; lean_object* x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; lean_object* x_110; lean_object* x_111; lean_object* x_112; lean_object* x_113; 
  lean_inc(x_16);
  x_81 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_16, x_17, x_18);
  x_82 = lean_ctor_get(x_81, 0);
  lean_inc(x_82);
  x_83 = lean_ctor_get(x_81, 1);
  lean_inc(x_83);
  lean_dec(x_81);
  x_84 = l_Lean_Elab_Term_getCurrMacroScope(x_12, x_13, x_14, x_15, x_16, x_17, x_83);
  x_85 = lean_ctor_get(x_84, 0);
  lean_inc(x_85);
  x_86 = lean_ctor_get(x_84, 1);
  lean_inc(x_86);
  lean_dec(x_84);
  x_87 = l_Lean_Elab_Term_getMainModule___rarg(x_17, x_86);
  x_88 = lean_ctor_get(x_87, 0);
  lean_inc(x_88);
  x_89 = lean_ctor_get(x_87, 1);
  lean_inc(x_89);
  lean_dec(x_87);
  x_90 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3;
  lean_inc(x_3);
  x_91 = lean_name_mk_string(x_3, x_90);
  x_92 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5;
  x_93 = lean_name_mk_string(x_91, x_92);
  x_94 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3;
  x_95 = lean_name_mk_string(x_93, x_94);
  x_96 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__4;
  x_97 = l_Lean_addMacroScope(x_88, x_96, x_85);
  x_98 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__1;
  lean_inc(x_4);
  x_99 = lean_name_mk_string(x_4, x_98);
  x_100 = lean_box(0);
  if (lean_is_scalar(x_76)) {
   x_101 = lean_alloc_ctor(0, 2, 0);
  } else {
   x_101 = x_76;
  }
  lean_ctor_set(x_101, 0, x_99);
  lean_ctor_set(x_101, 1, x_100);
  x_102 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_102, 0, x_101);
  lean_ctor_set(x_102, 1, x_100);
  x_103 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__3;
  x_104 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_104, 0, x_82);
  lean_ctor_set(x_104, 1, x_103);
  lean_ctor_set(x_104, 2, x_97);
  lean_ctor_set(x_104, 3, x_102);
  x_105 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_106 = lean_array_push(x_105, x_74);
  x_107 = lean_box(2);
  x_108 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_109 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_109, 0, x_107);
  lean_ctor_set(x_109, 1, x_108);
  lean_ctor_set(x_109, 2, x_106);
  x_110 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_111 = lean_array_push(x_110, x_104);
  x_112 = lean_array_push(x_111, x_109);
  x_113 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_113, 0, x_107);
  lean_ctor_set(x_113, 1, x_95);
  lean_ctor_set(x_113, 2, x_112);
  x_24 = x_113;
  x_25 = x_89;
  goto block_73;
  }
  else
  {
  lean_object* x_114; lean_object* x_115; lean_object* x_116; lean_object* x_117; lean_object* x_118; lean_object* x_119; lean_object* x_120; lean_object* x_121; lean_object* x_122; lean_object* x_123; lean_object* x_124; lean_object* x_125; lean_object* x_126; lean_object* x_127; lean_object* x_128; lean_object* x_129; lean_object* x_130; lean_object* x_131; lean_object* x_132; lean_object* x_133; lean_object* x_134; 
  lean_dec(x_76);
  lean_inc(x_16);
  x_114 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_16, x_17, x_18);
  x_115 = lean_ctor_get(x_114, 1);
  lean_inc(x_115);
  lean_dec(x_114);
  x_116 = l_Lean_Elab_Term_getCurrMacroScope(x_12, x_13, x_14, x_15, x_16, x_17, x_115);
  x_117 = lean_ctor_get(x_116, 1);
  lean_inc(x_117);
  lean_dec(x_116);
  x_118 = l_Lean_Elab_Term_getMainModule___rarg(x_17, x_117);
  x_119 = lean_ctor_get(x_118, 1);
  lean_inc(x_119);
  lean_dec(x_118);
  x_120 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3;
  lean_inc(x_3);
  x_121 = lean_name_mk_string(x_3, x_120);
  x_122 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5;
  x_123 = lean_name_mk_string(x_121, x_122);
  x_124 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3;
  x_125 = lean_name_mk_string(x_123, x_124);
  x_126 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_127 = lean_array_push(x_126, x_74);
  x_128 = lean_box(2);
  x_129 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_130 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_130, 0, x_128);
  lean_ctor_set(x_130, 1, x_129);
  lean_ctor_set(x_130, 2, x_127);
  x_131 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  lean_inc(x_2);
  x_132 = lean_array_push(x_131, x_2);
  x_133 = lean_array_push(x_132, x_130);
  x_134 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_134, 0, x_128);
  lean_ctor_set(x_134, 1, x_125);
  lean_ctor_set(x_134, 2, x_133);
  x_24 = x_134;
  x_25 = x_119;
  goto block_73;
  }
  }
  }
  else
  {
  lean_object* x_138; 
  lean_dec(x_16);
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_4);
  lean_dec(x_3);
  lean_dec(x_2);
  x_138 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_138, 0, x_11);
  lean_ctor_set(x_138, 1, x_18);
  return x_138;
  }
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__1() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("term[_]");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__2() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__1;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__3() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("[");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__4() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("]");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__5() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("opt");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__6() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__5;
  x_2 = lean_string_utf8_byte_size(x_1);
  return x_2;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__7() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; 
  x_1 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__5;
  x_2 = lean_unsigned_to_nat(0u);
  x_3 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__6;
  x_4 = lean_alloc_ctor(0, 3, 0);
  lean_ctor_set(x_4, 0, x_1);
  lean_ctor_set(x_4, 1, x_2);
  lean_ctor_set(x_4, 2, x_3);
  return x_4;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__8() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__5;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__9() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("Json");
  return x_1;
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6(lean_object* x_1, lean_object* x_2, lean_object* x_3, size_t x_4, size_t x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13) {
  _start:
  {
  uint8_t x_14; 
  x_14 = lean_usize_dec_lt(x_5, x_4);
  if (x_14 == 0)
  {
  lean_object* x_15; lean_object* x_16; 
  lean_dec(x_11);
  lean_dec(x_2);
  lean_dec(x_1);
  x_15 = x_6;
  x_16 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_16, 0, x_15);
  lean_ctor_set(x_16, 1, x_13);
  return x_16;
  }
  else
  {
  lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_29; lean_object* x_30; uint8_t x_31; 
  x_17 = lean_array_uget(x_6, x_5);
  x_18 = lean_unsigned_to_nat(0u);
  x_19 = lean_array_uset(x_6, x_5, x_18);
  x_20 = x_17;
  lean_inc(x_20);
  x_29 = l_Lean_Elab_Deriving_FromToJson_mkJsonField(x_20);
  x_30 = lean_ctor_get(x_29, 0);
  lean_inc(x_30);
  x_31 = lean_unbox(x_30);
  lean_dec(x_30);
  if (x_31 == 0)
  {
  uint8_t x_32; 
  x_32 = !lean_is_exclusive(x_29);
  if (x_32 == 0)
  {
  lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; 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; lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; 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; lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76; lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_object* x_94; lean_object* x_95; lean_object* x_96; lean_object* x_97; lean_object* x_98; lean_object* x_99; lean_object* x_100; lean_object* x_101; lean_object* x_102; lean_object* x_103; lean_object* x_104; lean_object* x_105; lean_object* x_106; lean_object* x_107; 
  x_33 = lean_ctor_get(x_29, 1);
  x_34 = lean_ctor_get(x_29, 0);
  lean_dec(x_34);
  lean_inc(x_11);
  x_35 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_11, x_12, x_13);
  x_36 = lean_ctor_get(x_35, 0);
  lean_inc(x_36);
  x_37 = lean_ctor_get(x_35, 1);
  lean_inc(x_37);
  lean_dec(x_35);
  x_38 = l_Lean_Elab_Term_getCurrMacroScope(x_7, x_8, x_9, x_10, x_11, x_12, x_37);
  x_39 = lean_ctor_get(x_38, 0);
  lean_inc(x_39);
  x_40 = lean_ctor_get(x_38, 1);
  lean_inc(x_40);
  lean_dec(x_38);
  x_41 = l_Lean_Elab_Term_getMainModule___rarg(x_12, x_40);
  x_42 = lean_ctor_get(x_41, 0);
  lean_inc(x_42);
  x_43 = lean_ctor_get(x_41, 1);
  lean_inc(x_43);
  lean_dec(x_41);
  x_44 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__3;
  lean_inc(x_36);
  x_45 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_45, 0, x_36);
  lean_ctor_set(x_45, 1, x_44);
  x_46 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3;
  lean_inc(x_1);
  x_47 = lean_name_mk_string(x_1, x_46);
  x_48 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5;
  x_49 = lean_name_mk_string(x_47, x_48);
  x_50 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__1;
  lean_inc(x_49);
  x_51 = lean_name_mk_string(x_49, x_50);
  x_52 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__2;
  lean_inc(x_36);
  x_53 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_53, 0, x_36);
  lean_ctor_set(x_53, 1, x_52);
  x_54 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__3;
  lean_inc(x_49);
  x_55 = lean_name_mk_string(x_49, x_54);
  x_56 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__14;
  lean_inc(x_36);
  x_57 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_57, 0, x_36);
  lean_ctor_set(x_57, 1, x_56);
  x_58 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3;
  x_59 = lean_name_mk_string(x_49, x_58);
  x_60 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__4;
  x_61 = l_Lean_addMacroScope(x_42, x_60, x_39);
  x_62 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__1;
  lean_inc(x_2);
  x_63 = lean_name_mk_string(x_2, x_62);
  x_64 = lean_box(0);
  lean_ctor_set(x_29, 1, x_64);
  lean_ctor_set(x_29, 0, x_63);
  x_65 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_65, 0, x_29);
  lean_ctor_set(x_65, 1, x_64);
  x_66 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__3;
  lean_inc(x_36);
  x_67 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_67, 0, x_36);
  lean_ctor_set(x_67, 1, x_66);
  lean_ctor_set(x_67, 2, x_61);
  lean_ctor_set(x_67, 3, x_65);
  x_68 = lean_ctor_get(x_3, 2);
  x_69 = l_Lean_instInhabitedName;
  x_70 = lean_array_get(x_69, x_68, x_18);
  x_71 = l_Lean_Name_append(x_70, x_20);
  lean_dec(x_70);
  x_72 = lean_mk_syntax_ident(x_71);
  x_73 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_74 = lean_array_push(x_73, x_72);
  x_75 = lean_box(2);
  x_76 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_77 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_77, 0, x_75);
  lean_ctor_set(x_77, 1, x_76);
  lean_ctor_set(x_77, 2, x_74);
  x_78 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_79 = lean_array_push(x_78, x_67);
  x_80 = lean_array_push(x_79, x_77);
  x_81 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_81, 0, x_75);
  lean_ctor_set(x_81, 1, x_59);
  lean_ctor_set(x_81, 2, x_80);
  x_82 = lean_array_push(x_73, x_81);
  x_83 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_83, 0, x_75);
  lean_ctor_set(x_83, 1, x_76);
  lean_ctor_set(x_83, 2, x_82);
  x_84 = lean_array_push(x_78, x_57);
  x_85 = lean_array_push(x_84, x_83);
  x_86 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_86, 0, x_75);
  lean_ctor_set(x_86, 1, x_55);
  lean_ctor_set(x_86, 2, x_85);
  x_87 = lean_array_push(x_73, x_86);
  x_88 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_88, 0, x_75);
  lean_ctor_set(x_88, 1, x_76);
  lean_ctor_set(x_88, 2, x_87);
  x_89 = lean_array_push(x_78, x_33);
  x_90 = lean_array_push(x_89, x_88);
  x_91 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_91, 0, x_75);
  lean_ctor_set(x_91, 1, x_76);
  lean_ctor_set(x_91, 2, x_90);
  x_92 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__4;
  lean_inc(x_36);
  x_93 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_93, 0, x_36);
  lean_ctor_set(x_93, 1, x_92);
  x_94 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5;
  x_95 = lean_array_push(x_94, x_53);
  x_96 = lean_array_push(x_95, x_91);
  x_97 = lean_array_push(x_96, x_93);
  x_98 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_98, 0, x_75);
  lean_ctor_set(x_98, 1, x_51);
  lean_ctor_set(x_98, 2, x_97);
  x_99 = lean_array_push(x_73, x_98);
  x_100 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_100, 0, x_75);
  lean_ctor_set(x_100, 1, x_76);
  lean_ctor_set(x_100, 2, x_99);
  x_101 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__4;
  x_102 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_102, 0, x_36);
  lean_ctor_set(x_102, 1, x_101);
  x_103 = lean_array_push(x_94, x_45);
  x_104 = lean_array_push(x_103, x_100);
  x_105 = lean_array_push(x_104, x_102);
  x_106 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__2;
  x_107 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_107, 0, x_75);
  lean_ctor_set(x_107, 1, x_106);
  lean_ctor_set(x_107, 2, x_105);
  x_21 = x_107;
  x_22 = x_43;
  goto block_28;
  }
  else
  {
  lean_object* x_108; lean_object* x_109; lean_object* x_110; lean_object* x_111; lean_object* x_112; lean_object* x_113; lean_object* x_114; lean_object* x_115; lean_object* x_116; lean_object* x_117; lean_object* x_118; lean_object* x_119; lean_object* x_120; lean_object* x_121; lean_object* x_122; lean_object* x_123; lean_object* x_124; lean_object* x_125; lean_object* x_126; lean_object* x_127; lean_object* x_128; lean_object* x_129; lean_object* x_130; lean_object* x_131; lean_object* x_132; lean_object* x_133; lean_object* x_134; lean_object* x_135; lean_object* x_136; lean_object* x_137; lean_object* x_138; lean_object* x_139; lean_object* x_140; 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; lean_object* x_148; lean_object* x_149; lean_object* x_150; lean_object* x_151; lean_object* x_152; lean_object* x_153; lean_object* x_154; lean_object* x_155; lean_object* x_156; lean_object* x_157; lean_object* x_158; lean_object* x_159; lean_object* x_160; lean_object* x_161; lean_object* x_162; lean_object* x_163; lean_object* x_164; lean_object* x_165; lean_object* x_166; lean_object* x_167; lean_object* x_168; lean_object* x_169; lean_object* x_170; lean_object* x_171; 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; lean_object* x_181; lean_object* x_182; 
  x_108 = lean_ctor_get(x_29, 1);
  lean_inc(x_108);
  lean_dec(x_29);
  lean_inc(x_11);
  x_109 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_11, x_12, x_13);
  x_110 = lean_ctor_get(x_109, 0);
  lean_inc(x_110);
  x_111 = lean_ctor_get(x_109, 1);
  lean_inc(x_111);
  lean_dec(x_109);
  x_112 = l_Lean_Elab_Term_getCurrMacroScope(x_7, x_8, x_9, x_10, x_11, x_12, x_111);
  x_113 = lean_ctor_get(x_112, 0);
  lean_inc(x_113);
  x_114 = lean_ctor_get(x_112, 1);
  lean_inc(x_114);
  lean_dec(x_112);
  x_115 = l_Lean_Elab_Term_getMainModule___rarg(x_12, x_114);
  x_116 = lean_ctor_get(x_115, 0);
  lean_inc(x_116);
  x_117 = lean_ctor_get(x_115, 1);
  lean_inc(x_117);
  lean_dec(x_115);
  x_118 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__3;
  lean_inc(x_110);
  x_119 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_119, 0, x_110);
  lean_ctor_set(x_119, 1, x_118);
  x_120 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3;
  lean_inc(x_1);
  x_121 = lean_name_mk_string(x_1, x_120);
  x_122 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5;
  x_123 = lean_name_mk_string(x_121, x_122);
  x_124 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__1;
  lean_inc(x_123);
  x_125 = lean_name_mk_string(x_123, x_124);
  x_126 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__2;
  lean_inc(x_110);
  x_127 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_127, 0, x_110);
  lean_ctor_set(x_127, 1, x_126);
  x_128 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__3;
  lean_inc(x_123);
  x_129 = lean_name_mk_string(x_123, x_128);
  x_130 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__14;
  lean_inc(x_110);
  x_131 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_131, 0, x_110);
  lean_ctor_set(x_131, 1, x_130);
  x_132 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3;
  x_133 = lean_name_mk_string(x_123, x_132);
  x_134 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__4;
  x_135 = l_Lean_addMacroScope(x_116, x_134, x_113);
  x_136 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__1;
  lean_inc(x_2);
  x_137 = lean_name_mk_string(x_2, x_136);
  x_138 = lean_box(0);
  x_139 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_139, 0, x_137);
  lean_ctor_set(x_139, 1, x_138);
  x_140 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_140, 0, x_139);
  lean_ctor_set(x_140, 1, x_138);
  x_141 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__3;
  lean_inc(x_110);
  x_142 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_142, 0, x_110);
  lean_ctor_set(x_142, 1, x_141);
  lean_ctor_set(x_142, 2, x_135);
  lean_ctor_set(x_142, 3, x_140);
  x_143 = lean_ctor_get(x_3, 2);
  x_144 = l_Lean_instInhabitedName;
  x_145 = lean_array_get(x_144, x_143, x_18);
  x_146 = l_Lean_Name_append(x_145, x_20);
  lean_dec(x_145);
  x_147 = lean_mk_syntax_ident(x_146);
  x_148 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_149 = lean_array_push(x_148, x_147);
  x_150 = lean_box(2);
  x_151 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_152 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_152, 0, x_150);
  lean_ctor_set(x_152, 1, x_151);
  lean_ctor_set(x_152, 2, x_149);
  x_153 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_154 = lean_array_push(x_153, x_142);
  x_155 = lean_array_push(x_154, x_152);
  x_156 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_156, 0, x_150);
  lean_ctor_set(x_156, 1, x_133);
  lean_ctor_set(x_156, 2, x_155);
  x_157 = lean_array_push(x_148, x_156);
  x_158 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_158, 0, x_150);
  lean_ctor_set(x_158, 1, x_151);
  lean_ctor_set(x_158, 2, x_157);
  x_159 = lean_array_push(x_153, x_131);
  x_160 = lean_array_push(x_159, x_158);
  x_161 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_161, 0, x_150);
  lean_ctor_set(x_161, 1, x_129);
  lean_ctor_set(x_161, 2, x_160);
  x_162 = lean_array_push(x_148, x_161);
  x_163 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_163, 0, x_150);
  lean_ctor_set(x_163, 1, x_151);
  lean_ctor_set(x_163, 2, x_162);
  x_164 = lean_array_push(x_153, x_108);
  x_165 = lean_array_push(x_164, x_163);
  x_166 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_166, 0, x_150);
  lean_ctor_set(x_166, 1, x_151);
  lean_ctor_set(x_166, 2, x_165);
  x_167 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__4;
  lean_inc(x_110);
  x_168 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_168, 0, x_110);
  lean_ctor_set(x_168, 1, x_167);
  x_169 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5;
  x_170 = lean_array_push(x_169, x_127);
  x_171 = lean_array_push(x_170, x_166);
  x_172 = lean_array_push(x_171, x_168);
  x_173 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_173, 0, x_150);
  lean_ctor_set(x_173, 1, x_125);
  lean_ctor_set(x_173, 2, x_172);
  x_174 = lean_array_push(x_148, x_173);
  x_175 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_175, 0, x_150);
  lean_ctor_set(x_175, 1, x_151);
  lean_ctor_set(x_175, 2, x_174);
  x_176 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__4;
  x_177 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_177, 0, x_110);
  lean_ctor_set(x_177, 1, x_176);
  x_178 = lean_array_push(x_169, x_119);
  x_179 = lean_array_push(x_178, x_175);
  x_180 = lean_array_push(x_179, x_177);
  x_181 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__2;
  x_182 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_182, 0, x_150);
  lean_ctor_set(x_182, 1, x_181);
  lean_ctor_set(x_182, 2, x_180);
  x_21 = x_182;
  x_22 = x_117;
  goto block_28;
  }
  }
  else
  {
  uint8_t x_183; 
  x_183 = !lean_is_exclusive(x_29);
  if (x_183 == 0)
  {
  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; lean_object* x_191; lean_object* x_192; lean_object* x_193; lean_object* x_194; lean_object* x_195; lean_object* x_196; 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; 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; lean_object* x_211; 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; lean_object* x_219; lean_object* x_220; lean_object* x_221; lean_object* x_222; lean_object* x_223; lean_object* x_224; 
  x_184 = lean_ctor_get(x_29, 1);
  x_185 = lean_ctor_get(x_29, 0);
  lean_dec(x_185);
  lean_inc(x_11);
  x_186 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_11, x_12, x_13);
  x_187 = lean_ctor_get(x_186, 0);
  lean_inc(x_187);
  x_188 = lean_ctor_get(x_186, 1);
  lean_inc(x_188);
  lean_dec(x_186);
  x_189 = l_Lean_Elab_Term_getCurrMacroScope(x_7, x_8, x_9, x_10, x_11, x_12, x_188);
  x_190 = lean_ctor_get(x_189, 0);
  lean_inc(x_190);
  x_191 = lean_ctor_get(x_189, 1);
  lean_inc(x_191);
  lean_dec(x_189);
  x_192 = l_Lean_Elab_Term_getMainModule___rarg(x_12, x_191);
  x_193 = lean_ctor_get(x_192, 0);
  lean_inc(x_193);
  x_194 = lean_ctor_get(x_192, 1);
  lean_inc(x_194);
  lean_dec(x_192);
  x_195 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3;
  lean_inc(x_1);
  x_196 = lean_name_mk_string(x_1, x_195);
  x_197 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5;
  x_198 = lean_name_mk_string(x_196, x_197);
  x_199 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3;
  x_200 = lean_name_mk_string(x_198, x_199);
  x_201 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__8;
  x_202 = l_Lean_addMacroScope(x_193, x_201, x_190);
  x_203 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__9;
  lean_inc(x_1);
  x_204 = lean_name_mk_string(x_1, x_203);
  x_205 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__5;
  x_206 = lean_name_mk_string(x_204, x_205);
  x_207 = lean_box(0);
  lean_ctor_set(x_29, 1, x_207);
  lean_ctor_set(x_29, 0, x_206);
  x_208 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_208, 0, x_29);
  lean_ctor_set(x_208, 1, x_207);
  x_209 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__7;
  x_210 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_210, 0, x_187);
  lean_ctor_set(x_210, 1, x_209);
  lean_ctor_set(x_210, 2, x_202);
  lean_ctor_set(x_210, 3, x_208);
  x_211 = lean_ctor_get(x_3, 2);
  x_212 = l_Lean_instInhabitedName;
  x_213 = lean_array_get(x_212, x_211, x_18);
  x_214 = l_Lean_Name_append(x_213, x_20);
  lean_dec(x_213);
  x_215 = lean_mk_syntax_ident(x_214);
  x_216 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_217 = lean_array_push(x_216, x_184);
  x_218 = lean_array_push(x_217, x_215);
  x_219 = lean_box(2);
  x_220 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_221 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_221, 0, x_219);
  lean_ctor_set(x_221, 1, x_220);
  lean_ctor_set(x_221, 2, x_218);
  x_222 = lean_array_push(x_216, x_210);
  x_223 = lean_array_push(x_222, x_221);
  x_224 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_224, 0, x_219);
  lean_ctor_set(x_224, 1, x_200);
  lean_ctor_set(x_224, 2, x_223);
  x_21 = x_224;
  x_22 = x_194;
  goto block_28;
  }
  else
  {
  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; 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; 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; lean_object* x_246; lean_object* x_247; lean_object* x_248; lean_object* x_249; lean_object* x_250; lean_object* x_251; lean_object* x_252; lean_object* x_253; lean_object* x_254; lean_object* x_255; lean_object* x_256; 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; 
  x_225 = lean_ctor_get(x_29, 1);
  lean_inc(x_225);
  lean_dec(x_29);
  lean_inc(x_11);
  x_226 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_11, x_12, x_13);
  x_227 = lean_ctor_get(x_226, 0);
  lean_inc(x_227);
  x_228 = lean_ctor_get(x_226, 1);
  lean_inc(x_228);
  lean_dec(x_226);
  x_229 = l_Lean_Elab_Term_getCurrMacroScope(x_7, x_8, x_9, x_10, x_11, x_12, x_228);
  x_230 = lean_ctor_get(x_229, 0);
  lean_inc(x_230);
  x_231 = lean_ctor_get(x_229, 1);
  lean_inc(x_231);
  lean_dec(x_229);
  x_232 = l_Lean_Elab_Term_getMainModule___rarg(x_12, x_231);
  x_233 = lean_ctor_get(x_232, 0);
  lean_inc(x_233);
  x_234 = lean_ctor_get(x_232, 1);
  lean_inc(x_234);
  lean_dec(x_232);
  x_235 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3;
  lean_inc(x_1);
  x_236 = lean_name_mk_string(x_1, x_235);
  x_237 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5;
  x_238 = lean_name_mk_string(x_236, x_237);
  x_239 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3;
  x_240 = lean_name_mk_string(x_238, x_239);
  x_241 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__8;
  x_242 = l_Lean_addMacroScope(x_233, x_241, x_230);
  x_243 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__9;
  lean_inc(x_1);
  x_244 = lean_name_mk_string(x_1, x_243);
  x_245 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__5;
  x_246 = lean_name_mk_string(x_244, x_245);
  x_247 = lean_box(0);
  x_248 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_248, 0, x_246);
  lean_ctor_set(x_248, 1, x_247);
  x_249 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_249, 0, x_248);
  lean_ctor_set(x_249, 1, x_247);
  x_250 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__7;
  x_251 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_251, 0, x_227);
  lean_ctor_set(x_251, 1, x_250);
  lean_ctor_set(x_251, 2, x_242);
  lean_ctor_set(x_251, 3, x_249);
  x_252 = lean_ctor_get(x_3, 2);
  x_253 = l_Lean_instInhabitedName;
  x_254 = lean_array_get(x_253, x_252, x_18);
  x_255 = l_Lean_Name_append(x_254, x_20);
  lean_dec(x_254);
  x_256 = lean_mk_syntax_ident(x_255);
  x_257 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_258 = lean_array_push(x_257, x_225);
  x_259 = lean_array_push(x_258, x_256);
  x_260 = lean_box(2);
  x_261 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_262 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_262, 0, x_260);
  lean_ctor_set(x_262, 1, x_261);
  lean_ctor_set(x_262, 2, x_259);
  x_263 = lean_array_push(x_257, x_251);
  x_264 = lean_array_push(x_263, x_262);
  x_265 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_265, 0, x_260);
  lean_ctor_set(x_265, 1, x_240);
  lean_ctor_set(x_265, 2, x_264);
  x_21 = x_265;
  x_22 = x_234;
  goto block_28;
  }
  }
  block_28:
  {
  size_t x_23; size_t x_24; lean_object* x_25; lean_object* x_26; 
  x_23 = 1;
  x_24 = lean_usize_add(x_5, x_23);
  x_25 = x_21;
  x_26 = lean_array_uset(x_19, x_5, x_25);
  x_5 = x_24;
  x_6 = x_26;
  x_13 = x_22;
  goto _start;
  }
  }
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__1() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("mkObj");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__2() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__1;
  x_2 = lean_string_utf8_byte_size(x_1);
  return x_2;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__3() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; 
  x_1 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__1;
  x_2 = lean_unsigned_to_nat(0u);
  x_3 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__2;
  x_4 = lean_alloc_ctor(0, 3, 0);
  lean_ctor_set(x_4, 0, x_1);
  lean_ctor_set(x_4, 1, x_2);
  lean_ctor_set(x_4, 2, x_3);
  return x_4;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__4() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__1;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__5() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("Json.arr");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__6() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__5;
  x_2 = lean_string_utf8_byte_size(x_1);
  return x_2;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__7() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; 
  x_1 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__5;
  x_2 = lean_unsigned_to_nat(0u);
  x_3 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__6;
  x_4 = lean_alloc_ctor(0, 3, 0);
  lean_ctor_set(x_4, 0, x_1);
  lean_ctor_set(x_4, 1, x_2);
  lean_ctor_set(x_4, 2, x_3);
  return x_4;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__8() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__9;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__9() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("arr");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__10() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__8;
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__9;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__11() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("term#[_,]");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__12() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__11;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__13() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("#[");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___boxed__const__1() {
  _start:
  {
  size_t x_1; lean_object* x_2; 
  x_1 = 0;
  x_2 = lean_box_usize(x_1);
  return x_2;
  }
  }
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__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, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13, lean_object* x_14) {
  _start:
  {
  lean_object* x_15; lean_object* x_16; uint8_t x_17; 
  x_15 = lean_array_get_size(x_6);
  x_16 = lean_unsigned_to_nat(0u);
  x_17 = lean_nat_dec_eq(x_15, x_16);
  if (x_17 == 0)
  {
  lean_object* x_18; uint8_t x_19; 
  x_18 = lean_unsigned_to_nat(1u);
  x_19 = lean_nat_dec_eq(x_15, x_18);
  if (x_19 == 0)
  {
  if (lean_obj_tag(x_7) == 0)
  {
  size_t x_20; size_t x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; 
  x_20 = lean_usize_of_nat(x_15);
  lean_dec(x_15);
  x_21 = 0;
  x_22 = x_6;
  x_23 = lean_box_usize(x_20);
  x_24 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___boxed__const__1;
  lean_inc(x_3);
  x_25 = lean_alloc_closure((void*)(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___boxed), 14, 7);
  lean_closure_set(x_25, 0, x_1);
  lean_closure_set(x_25, 1, x_2);
  lean_closure_set(x_25, 2, x_3);
  lean_closure_set(x_25, 3, x_4);
  lean_closure_set(x_25, 4, x_23);
  lean_closure_set(x_25, 5, x_24);
  lean_closure_set(x_25, 6, x_22);
  x_26 = x_25;
  lean_inc(x_13);
  lean_inc(x_12);
  lean_inc(x_11);
  lean_inc(x_10);
  lean_inc(x_9);
  lean_inc(x_8);
  x_27 = lean_apply_7(x_26, x_8, x_9, x_10, x_11, x_12, x_13, x_14);
  if (lean_obj_tag(x_27) == 0)
  {
  lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; uint8_t x_37; 
  x_28 = lean_ctor_get(x_27, 0);
  lean_inc(x_28);
  x_29 = lean_ctor_get(x_27, 1);
  lean_inc(x_29);
  lean_dec(x_27);
  lean_inc(x_12);
  x_30 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_12, x_13, x_29);
  x_31 = lean_ctor_get(x_30, 0);
  lean_inc(x_31);
  x_32 = lean_ctor_get(x_30, 1);
  lean_inc(x_32);
  lean_dec(x_30);
  x_33 = l_Lean_Elab_Term_getCurrMacroScope(x_8, x_9, x_10, x_11, x_12, x_13, x_32);
  lean_dec(x_12);
  lean_dec(x_11);
  lean_dec(x_10);
  lean_dec(x_9);
  lean_dec(x_8);
  x_34 = lean_ctor_get(x_33, 0);
  lean_inc(x_34);
  x_35 = lean_ctor_get(x_33, 1);
  lean_inc(x_35);
  lean_dec(x_33);
  x_36 = l_Lean_Elab_Term_getMainModule___rarg(x_13, x_35);
  lean_dec(x_13);
  x_37 = !lean_is_exclusive(x_36);
  if (x_37 == 0)
  {
  lean_object* x_38; lean_object* x_39; lean_object* x_40; 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; lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; 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; lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76; lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81; size_t x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_object* x_94; lean_object* x_95; lean_object* x_96; lean_object* x_97; lean_object* x_98; lean_object* x_99; lean_object* x_100; lean_object* x_101; lean_object* x_102; lean_object* x_103; lean_object* x_104; lean_object* x_105; lean_object* x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; lean_object* x_110; lean_object* x_111; lean_object* x_112; lean_object* x_113; lean_object* x_114; lean_object* x_115; lean_object* x_116; lean_object* x_117; lean_object* x_118; lean_object* x_119; lean_object* x_120; lean_object* x_121; lean_object* x_122; lean_object* x_123; lean_object* x_124; lean_object* x_125; lean_object* x_126; lean_object* x_127; lean_object* x_128; lean_object* x_129; lean_object* x_130; lean_object* x_131; lean_object* x_132; lean_object* x_133; lean_object* x_134; 
  x_38 = lean_ctor_get(x_36, 0);
  x_39 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3;
  lean_inc(x_3);
  x_40 = lean_name_mk_string(x_3, x_39);
  x_41 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5;
  x_42 = lean_name_mk_string(x_40, x_41);
  x_43 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3;
  lean_inc(x_42);
  x_44 = lean_name_mk_string(x_42, x_43);
  x_45 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__4;
  lean_inc(x_34);
  lean_inc(x_38);
  x_46 = l_Lean_addMacroScope(x_38, x_45, x_34);
  x_47 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__9;
  x_48 = lean_name_mk_string(x_3, x_47);
  x_49 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__1;
  lean_inc(x_48);
  x_50 = lean_name_mk_string(x_48, x_49);
  x_51 = lean_box(0);
  x_52 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_52, 0, x_50);
  lean_ctor_set(x_52, 1, x_51);
  x_53 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_53, 0, x_52);
  lean_ctor_set(x_53, 1, x_51);
  x_54 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__3;
  lean_inc(x_31);
  x_55 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_55, 0, x_31);
  lean_ctor_set(x_55, 1, x_54);
  lean_ctor_set(x_55, 2, x_46);
  lean_ctor_set(x_55, 3, x_53);
  x_56 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__3;
  lean_inc(x_31);
  x_57 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_57, 0, x_31);
  lean_ctor_set(x_57, 1, x_56);
  x_58 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__1;
  lean_inc(x_42);
  x_59 = lean_name_mk_string(x_42, x_58);
  x_60 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__2;
  lean_inc(x_31);
  x_61 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_61, 0, x_31);
  lean_ctor_set(x_61, 1, x_60);
  x_62 = lean_ctor_get(x_5, 0);
  lean_inc(x_62);
  lean_dec(x_5);
  x_63 = lean_ctor_get(x_62, 0);
  lean_inc(x_63);
  lean_dec(x_62);
  x_64 = l_Lean_Name_getString_x21(x_63);
  x_65 = lean_box(2);
  x_66 = l_Lean_Syntax_mkStrLit(x_64, x_65);
  lean_dec(x_64);
  x_67 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__3;
  x_68 = lean_name_mk_string(x_42, x_67);
  x_69 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__14;
  lean_inc(x_31);
  x_70 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_70, 0, x_31);
  lean_ctor_set(x_70, 1, x_69);
  x_71 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__10;
  x_72 = l_Lean_addMacroScope(x_38, x_71, x_34);
  x_73 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__9;
  x_74 = lean_name_mk_string(x_48, x_73);
  x_75 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_75, 0, x_74);
  lean_ctor_set(x_75, 1, x_51);
  x_76 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_76, 0, x_75);
  lean_ctor_set(x_76, 1, x_51);
  x_77 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__7;
  lean_inc(x_31);
  x_78 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_78, 0, x_31);
  lean_ctor_set(x_78, 1, x_77);
  lean_ctor_set(x_78, 2, x_72);
  lean_ctor_set(x_78, 3, x_76);
  x_79 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__13;
  lean_inc(x_31);
  x_80 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_80, 0, x_31);
  lean_ctor_set(x_80, 1, x_79);
  x_81 = lean_array_get_size(x_28);
  x_82 = lean_usize_of_nat(x_81);
  lean_dec(x_81);
  x_83 = x_28;
  x_84 = l_Array_mapMUnsafe_map___at___aux__Init__NotationExtra______macroRules___xabterm_x25_x5b___x7c___x5d_xbb__1___spec__3(x_82, x_21, x_83);
  x_85 = x_84;
  x_86 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__15;
  x_87 = l_Lean_mkSepArray(x_85, x_86);
  lean_dec(x_85);
  x_88 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__1;
  x_89 = l_Array_append___rarg(x_88, x_87);
  x_90 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_91 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_91, 0, x_65);
  lean_ctor_set(x_91, 1, x_90);
  lean_ctor_set(x_91, 2, x_89);
  x_92 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__4;
  lean_inc(x_31);
  x_93 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_93, 0, x_31);
  lean_ctor_set(x_93, 1, x_92);
  x_94 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5;
  x_95 = lean_array_push(x_94, x_80);
  x_96 = lean_array_push(x_95, x_91);
  lean_inc(x_93);
  x_97 = lean_array_push(x_96, x_93);
  x_98 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__12;
  x_99 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_99, 0, x_65);
  lean_ctor_set(x_99, 1, x_98);
  lean_ctor_set(x_99, 2, x_97);
  x_100 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_101 = lean_array_push(x_100, x_99);
  x_102 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_102, 0, x_65);
  lean_ctor_set(x_102, 1, x_90);
  lean_ctor_set(x_102, 2, x_101);
  x_103 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_104 = lean_array_push(x_103, x_78);
  x_105 = lean_array_push(x_104, x_102);
  lean_inc(x_44);
  x_106 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_106, 0, x_65);
  lean_ctor_set(x_106, 1, x_44);
  lean_ctor_set(x_106, 2, x_105);
  x_107 = lean_array_push(x_100, x_106);
  x_108 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_108, 0, x_65);
  lean_ctor_set(x_108, 1, x_90);
  lean_ctor_set(x_108, 2, x_107);
  x_109 = lean_array_push(x_103, x_70);
  x_110 = lean_array_push(x_109, x_108);
  x_111 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_111, 0, x_65);
  lean_ctor_set(x_111, 1, x_68);
  lean_ctor_set(x_111, 2, x_110);
  x_112 = lean_array_push(x_100, x_111);
  x_113 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_113, 0, x_65);
  lean_ctor_set(x_113, 1, x_90);
  lean_ctor_set(x_113, 2, x_112);
  x_114 = lean_array_push(x_103, x_66);
  x_115 = lean_array_push(x_114, x_113);
  x_116 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_116, 0, x_65);
  lean_ctor_set(x_116, 1, x_90);
  lean_ctor_set(x_116, 2, x_115);
  x_117 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__4;
  x_118 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_118, 0, x_31);
  lean_ctor_set(x_118, 1, x_117);
  x_119 = lean_array_push(x_94, x_61);
  x_120 = lean_array_push(x_119, x_116);
  x_121 = lean_array_push(x_120, x_118);
  x_122 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_122, 0, x_65);
  lean_ctor_set(x_122, 1, x_59);
  lean_ctor_set(x_122, 2, x_121);
  x_123 = lean_array_push(x_100, x_122);
  x_124 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_124, 0, x_65);
  lean_ctor_set(x_124, 1, x_90);
  lean_ctor_set(x_124, 2, x_123);
  x_125 = lean_array_push(x_94, x_57);
  x_126 = lean_array_push(x_125, x_124);
  x_127 = lean_array_push(x_126, x_93);
  x_128 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__2;
  x_129 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_129, 0, x_65);
  lean_ctor_set(x_129, 1, x_128);
  lean_ctor_set(x_129, 2, x_127);
  x_130 = lean_array_push(x_100, x_129);
  x_131 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_131, 0, x_65);
  lean_ctor_set(x_131, 1, x_90);
  lean_ctor_set(x_131, 2, x_130);
  x_132 = lean_array_push(x_103, x_55);
  x_133 = lean_array_push(x_132, x_131);
  x_134 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_134, 0, x_65);
  lean_ctor_set(x_134, 1, x_44);
  lean_ctor_set(x_134, 2, x_133);
  lean_ctor_set(x_36, 0, x_134);
  return x_36;
  }
  else
  {
  lean_object* x_135; lean_object* x_136; lean_object* x_137; lean_object* x_138; lean_object* x_139; lean_object* x_140; 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; lean_object* x_148; lean_object* x_149; lean_object* x_150; lean_object* x_151; lean_object* x_152; lean_object* x_153; lean_object* x_154; lean_object* x_155; lean_object* x_156; lean_object* x_157; lean_object* x_158; lean_object* x_159; lean_object* x_160; lean_object* x_161; lean_object* x_162; lean_object* x_163; lean_object* x_164; lean_object* x_165; lean_object* x_166; lean_object* x_167; lean_object* x_168; lean_object* x_169; lean_object* x_170; lean_object* x_171; 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; size_t x_180; lean_object* 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_190; lean_object* x_191; lean_object* x_192; lean_object* x_193; lean_object* x_194; lean_object* x_195; lean_object* x_196; 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; 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; lean_object* x_211; 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; 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; lean_object* x_226; lean_object* x_227; lean_object* x_228; lean_object* x_229; lean_object* x_230; lean_object* x_231; lean_object* x_232; lean_object* x_233; 
  x_135 = lean_ctor_get(x_36, 0);
  x_136 = lean_ctor_get(x_36, 1);
  lean_inc(x_136);
  lean_inc(x_135);
  lean_dec(x_36);
  x_137 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3;
  lean_inc(x_3);
  x_138 = lean_name_mk_string(x_3, x_137);
  x_139 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5;
  x_140 = lean_name_mk_string(x_138, x_139);
  x_141 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3;
  lean_inc(x_140);
  x_142 = lean_name_mk_string(x_140, x_141);
  x_143 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__4;
  lean_inc(x_34);
  lean_inc(x_135);
  x_144 = l_Lean_addMacroScope(x_135, x_143, x_34);
  x_145 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__9;
  x_146 = lean_name_mk_string(x_3, x_145);
  x_147 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__1;
  lean_inc(x_146);
  x_148 = lean_name_mk_string(x_146, x_147);
  x_149 = lean_box(0);
  x_150 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_150, 0, x_148);
  lean_ctor_set(x_150, 1, x_149);
  x_151 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_151, 0, x_150);
  lean_ctor_set(x_151, 1, x_149);
  x_152 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__3;
  lean_inc(x_31);
  x_153 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_153, 0, x_31);
  lean_ctor_set(x_153, 1, x_152);
  lean_ctor_set(x_153, 2, x_144);
  lean_ctor_set(x_153, 3, x_151);
  x_154 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__3;
  lean_inc(x_31);
  x_155 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_155, 0, x_31);
  lean_ctor_set(x_155, 1, x_154);
  x_156 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__1;
  lean_inc(x_140);
  x_157 = lean_name_mk_string(x_140, x_156);
  x_158 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__2;
  lean_inc(x_31);
  x_159 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_159, 0, x_31);
  lean_ctor_set(x_159, 1, x_158);
  x_160 = lean_ctor_get(x_5, 0);
  lean_inc(x_160);
  lean_dec(x_5);
  x_161 = lean_ctor_get(x_160, 0);
  lean_inc(x_161);
  lean_dec(x_160);
  x_162 = l_Lean_Name_getString_x21(x_161);
  x_163 = lean_box(2);
  x_164 = l_Lean_Syntax_mkStrLit(x_162, x_163);
  lean_dec(x_162);
  x_165 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__3;
  x_166 = lean_name_mk_string(x_140, x_165);
  x_167 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__14;
  lean_inc(x_31);
  x_168 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_168, 0, x_31);
  lean_ctor_set(x_168, 1, x_167);
  x_169 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__10;
  x_170 = l_Lean_addMacroScope(x_135, x_169, x_34);
  x_171 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__9;
  x_172 = lean_name_mk_string(x_146, x_171);
  x_173 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_173, 0, x_172);
  lean_ctor_set(x_173, 1, x_149);
  x_174 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_174, 0, x_173);
  lean_ctor_set(x_174, 1, x_149);
  x_175 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__7;
  lean_inc(x_31);
  x_176 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_176, 0, x_31);
  lean_ctor_set(x_176, 1, x_175);
  lean_ctor_set(x_176, 2, x_170);
  lean_ctor_set(x_176, 3, x_174);
  x_177 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__13;
  lean_inc(x_31);
  x_178 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_178, 0, x_31);
  lean_ctor_set(x_178, 1, x_177);
  x_179 = lean_array_get_size(x_28);
  x_180 = lean_usize_of_nat(x_179);
  lean_dec(x_179);
  x_181 = x_28;
  x_182 = l_Array_mapMUnsafe_map___at___aux__Init__NotationExtra______macroRules___xabterm_x25_x5b___x7c___x5d_xbb__1___spec__3(x_180, x_21, x_181);
  x_183 = x_182;
  x_184 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__15;
  x_185 = l_Lean_mkSepArray(x_183, x_184);
  lean_dec(x_183);
  x_186 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__1;
  x_187 = l_Array_append___rarg(x_186, x_185);
  x_188 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_189 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_189, 0, x_163);
  lean_ctor_set(x_189, 1, x_188);
  lean_ctor_set(x_189, 2, x_187);
  x_190 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__4;
  lean_inc(x_31);
  x_191 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_191, 0, x_31);
  lean_ctor_set(x_191, 1, x_190);
  x_192 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5;
  x_193 = lean_array_push(x_192, x_178);
  x_194 = lean_array_push(x_193, x_189);
  lean_inc(x_191);
  x_195 = lean_array_push(x_194, x_191);
  x_196 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__12;
  x_197 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_197, 0, x_163);
  lean_ctor_set(x_197, 1, x_196);
  lean_ctor_set(x_197, 2, x_195);
  x_198 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_199 = lean_array_push(x_198, x_197);
  x_200 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_200, 0, x_163);
  lean_ctor_set(x_200, 1, x_188);
  lean_ctor_set(x_200, 2, x_199);
  x_201 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_202 = lean_array_push(x_201, x_176);
  x_203 = lean_array_push(x_202, x_200);
  lean_inc(x_142);
  x_204 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_204, 0, x_163);
  lean_ctor_set(x_204, 1, x_142);
  lean_ctor_set(x_204, 2, x_203);
  x_205 = lean_array_push(x_198, x_204);
  x_206 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_206, 0, x_163);
  lean_ctor_set(x_206, 1, x_188);
  lean_ctor_set(x_206, 2, x_205);
  x_207 = lean_array_push(x_201, x_168);
  x_208 = lean_array_push(x_207, x_206);
  x_209 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_209, 0, x_163);
  lean_ctor_set(x_209, 1, x_166);
  lean_ctor_set(x_209, 2, x_208);
  x_210 = lean_array_push(x_198, x_209);
  x_211 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_211, 0, x_163);
  lean_ctor_set(x_211, 1, x_188);
  lean_ctor_set(x_211, 2, x_210);
  x_212 = lean_array_push(x_201, x_164);
  x_213 = lean_array_push(x_212, x_211);
  x_214 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_214, 0, x_163);
  lean_ctor_set(x_214, 1, x_188);
  lean_ctor_set(x_214, 2, x_213);
  x_215 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__4;
  x_216 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_216, 0, x_31);
  lean_ctor_set(x_216, 1, x_215);
  x_217 = lean_array_push(x_192, x_159);
  x_218 = lean_array_push(x_217, x_214);
  x_219 = lean_array_push(x_218, x_216);
  x_220 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_220, 0, x_163);
  lean_ctor_set(x_220, 1, x_157);
  lean_ctor_set(x_220, 2, x_219);
  x_221 = lean_array_push(x_198, x_220);
  x_222 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_222, 0, x_163);
  lean_ctor_set(x_222, 1, x_188);
  lean_ctor_set(x_222, 2, x_221);
  x_223 = lean_array_push(x_192, x_155);
  x_224 = lean_array_push(x_223, x_222);
  x_225 = lean_array_push(x_224, x_191);
  x_226 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__2;
  x_227 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_227, 0, x_163);
  lean_ctor_set(x_227, 1, x_226);
  lean_ctor_set(x_227, 2, x_225);
  x_228 = lean_array_push(x_198, x_227);
  x_229 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_229, 0, x_163);
  lean_ctor_set(x_229, 1, x_188);
  lean_ctor_set(x_229, 2, x_228);
  x_230 = lean_array_push(x_201, x_153);
  x_231 = lean_array_push(x_230, x_229);
  x_232 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_232, 0, x_163);
  lean_ctor_set(x_232, 1, x_142);
  lean_ctor_set(x_232, 2, x_231);
  x_233 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_233, 0, x_232);
  lean_ctor_set(x_233, 1, x_136);
  return x_233;
  }
  }
  else
  {
  uint8_t x_234; 
  lean_dec(x_13);
  lean_dec(x_12);
  lean_dec(x_11);
  lean_dec(x_10);
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_5);
  lean_dec(x_3);
  x_234 = !lean_is_exclusive(x_27);
  if (x_234 == 0)
  {
  return x_27;
  }
  else
  {
  lean_object* x_235; lean_object* x_236; lean_object* x_237; 
  x_235 = lean_ctor_get(x_27, 0);
  x_236 = lean_ctor_get(x_27, 1);
  lean_inc(x_236);
  lean_inc(x_235);
  lean_dec(x_27);
  x_237 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_237, 0, x_235);
  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; lean_object* x_246; lean_object* x_247; lean_object* x_248; lean_object* x_249; uint8_t x_250; 
  x_238 = lean_ctor_get(x_7, 0);
  x_239 = lean_mk_empty_array_with_capacity(x_15);
  lean_inc(x_12);
  lean_inc(x_3);
  x_240 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4(x_1, x_2, x_3, x_4, x_6, x_238, x_6, x_15, x_16, lean_box(0), x_239, x_8, x_9, x_10, x_11, x_12, x_13, x_14);
  lean_dec(x_6);
  lean_dec(x_1);
  x_241 = lean_ctor_get(x_240, 0);
  lean_inc(x_241);
  x_242 = lean_ctor_get(x_240, 1);
  lean_inc(x_242);
  lean_dec(x_240);
  lean_inc(x_12);
  x_243 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_12, x_13, x_242);
  x_244 = lean_ctor_get(x_243, 0);
  lean_inc(x_244);
  x_245 = lean_ctor_get(x_243, 1);
  lean_inc(x_245);
  lean_dec(x_243);
  x_246 = l_Lean_Elab_Term_getCurrMacroScope(x_8, x_9, x_10, x_11, x_12, x_13, x_245);
  lean_dec(x_12);
  lean_dec(x_11);
  lean_dec(x_10);
  lean_dec(x_9);
  lean_dec(x_8);
  x_247 = lean_ctor_get(x_246, 0);
  lean_inc(x_247);
  x_248 = lean_ctor_get(x_246, 1);
  lean_inc(x_248);
  lean_dec(x_246);
  x_249 = l_Lean_Elab_Term_getMainModule___rarg(x_13, x_248);
  lean_dec(x_13);
  x_250 = !lean_is_exclusive(x_249);
  if (x_250 == 0)
  {
  lean_object* x_251; lean_object* x_252; lean_object* x_253; lean_object* x_254; lean_object* x_255; lean_object* x_256; 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; lean_object* x_268; lean_object* x_269; lean_object* x_270; lean_object* x_271; lean_object* x_272; lean_object* x_273; lean_object* x_274; lean_object* x_275; lean_object* x_276; lean_object* x_277; lean_object* 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; size_t x_285; size_t x_286; lean_object* x_287; lean_object* x_288; lean_object* x_289; lean_object* x_290; lean_object* x_291; lean_object* x_292; lean_object* x_293; lean_object* x_294; lean_object* x_295; lean_object* x_296; lean_object* x_297; lean_object* x_298; lean_object* x_299; lean_object* x_300; lean_object* x_301; lean_object* x_302; lean_object* x_303; lean_object* x_304; lean_object* x_305; lean_object* x_306; lean_object* x_307; lean_object* x_308; lean_object* x_309; lean_object* x_310; lean_object* x_311; lean_object* x_312; lean_object* x_313; lean_object* x_314; lean_object* x_315; lean_object* x_316; lean_object* x_317; lean_object* x_318; lean_object* x_319; lean_object* x_320; lean_object* x_321; lean_object* x_322; lean_object* x_323; lean_object* x_324; lean_object* x_325; lean_object* x_326; lean_object* x_327; lean_object* x_328; lean_object* x_329; lean_object* x_330; lean_object* x_331; lean_object* x_332; lean_object* x_333; lean_object* x_334; lean_object* x_335; 
  x_251 = lean_ctor_get(x_249, 0);
  x_252 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3;
  lean_inc(x_3);
  x_253 = lean_name_mk_string(x_3, x_252);
  x_254 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5;
  x_255 = lean_name_mk_string(x_253, x_254);
  x_256 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3;
  lean_inc(x_255);
  x_257 = lean_name_mk_string(x_255, x_256);
  x_258 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__4;
  x_259 = l_Lean_addMacroScope(x_251, x_258, x_247);
  x_260 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__9;
  x_261 = lean_name_mk_string(x_3, x_260);
  x_262 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__1;
  x_263 = lean_name_mk_string(x_261, x_262);
  x_264 = lean_box(0);
  x_265 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_265, 0, x_263);
  lean_ctor_set(x_265, 1, x_264);
  x_266 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_266, 0, x_265);
  lean_ctor_set(x_266, 1, x_264);
  x_267 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__3;
  lean_inc(x_244);
  x_268 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_268, 0, x_244);
  lean_ctor_set(x_268, 1, x_267);
  lean_ctor_set(x_268, 2, x_259);
  lean_ctor_set(x_268, 3, x_266);
  x_269 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__3;
  lean_inc(x_244);
  x_270 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_270, 0, x_244);
  lean_ctor_set(x_270, 1, x_269);
  x_271 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__1;
  lean_inc(x_255);
  x_272 = lean_name_mk_string(x_255, x_271);
  x_273 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__2;
  lean_inc(x_244);
  x_274 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_274, 0, x_244);
  lean_ctor_set(x_274, 1, x_273);
  x_275 = lean_ctor_get(x_5, 0);
  lean_inc(x_275);
  lean_dec(x_5);
  x_276 = lean_ctor_get(x_275, 0);
  lean_inc(x_276);
  lean_dec(x_275);
  x_277 = l_Lean_Name_getString_x21(x_276);
  x_278 = lean_box(2);
  x_279 = l_Lean_Syntax_mkStrLit(x_277, x_278);
  lean_dec(x_277);
  x_280 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__3;
  x_281 = lean_name_mk_string(x_255, x_280);
  x_282 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__14;
  lean_inc(x_244);
  x_283 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_283, 0, x_244);
  lean_ctor_set(x_283, 1, x_282);
  x_284 = lean_array_get_size(x_241);
  x_285 = lean_usize_of_nat(x_284);
  lean_dec(x_284);
  x_286 = 0;
  x_287 = x_241;
  x_288 = l_Array_mapMUnsafe_map___at___aux__Init__NotationExtra______macroRules___xabterm_x25_x5b___x7c___x5d_xbb__1___spec__3(x_285, x_286, x_287);
  x_289 = x_288;
  x_290 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__15;
  x_291 = l_Lean_mkSepArray(x_289, x_290);
  lean_dec(x_289);
  x_292 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__1;
  x_293 = l_Array_append___rarg(x_292, x_291);
  x_294 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_295 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_295, 0, x_278);
  lean_ctor_set(x_295, 1, x_294);
  lean_ctor_set(x_295, 2, x_293);
  x_296 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__4;
  lean_inc(x_244);
  x_297 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_297, 0, x_244);
  lean_ctor_set(x_297, 1, x_296);
  x_298 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5;
  x_299 = lean_array_push(x_298, x_270);
  lean_inc(x_299);
  x_300 = lean_array_push(x_299, x_295);
  lean_inc(x_297);
  x_301 = lean_array_push(x_300, x_297);
  x_302 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__2;
  x_303 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_303, 0, x_278);
  lean_ctor_set(x_303, 1, x_302);
  lean_ctor_set(x_303, 2, x_301);
  x_304 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_305 = lean_array_push(x_304, x_303);
  x_306 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_306, 0, x_278);
  lean_ctor_set(x_306, 1, x_294);
  lean_ctor_set(x_306, 2, x_305);
  x_307 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_308 = lean_array_push(x_307, x_268);
  lean_inc(x_308);
  x_309 = lean_array_push(x_308, x_306);
  lean_inc(x_257);
  x_310 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_310, 0, x_278);
  lean_ctor_set(x_310, 1, x_257);
  lean_ctor_set(x_310, 2, x_309);
  x_311 = lean_array_push(x_304, x_310);
  x_312 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_312, 0, x_278);
  lean_ctor_set(x_312, 1, x_294);
  lean_ctor_set(x_312, 2, x_311);
  x_313 = lean_array_push(x_307, x_283);
  x_314 = lean_array_push(x_313, x_312);
  x_315 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_315, 0, x_278);
  lean_ctor_set(x_315, 1, x_281);
  lean_ctor_set(x_315, 2, x_314);
  x_316 = lean_array_push(x_304, x_315);
  x_317 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_317, 0, x_278);
  lean_ctor_set(x_317, 1, x_294);
  lean_ctor_set(x_317, 2, x_316);
  x_318 = lean_array_push(x_307, x_279);
  x_319 = lean_array_push(x_318, x_317);
  x_320 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_320, 0, x_278);
  lean_ctor_set(x_320, 1, x_294);
  lean_ctor_set(x_320, 2, x_319);
  x_321 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__4;
  x_322 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_322, 0, x_244);
  lean_ctor_set(x_322, 1, x_321);
  x_323 = lean_array_push(x_298, x_274);
  x_324 = lean_array_push(x_323, x_320);
  x_325 = lean_array_push(x_324, x_322);
  x_326 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_326, 0, x_278);
  lean_ctor_set(x_326, 1, x_272);
  lean_ctor_set(x_326, 2, x_325);
  x_327 = lean_array_push(x_304, x_326);
  x_328 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_328, 0, x_278);
  lean_ctor_set(x_328, 1, x_294);
  lean_ctor_set(x_328, 2, x_327);
  x_329 = lean_array_push(x_299, x_328);
  x_330 = lean_array_push(x_329, x_297);
  x_331 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_331, 0, x_278);
  lean_ctor_set(x_331, 1, x_302);
  lean_ctor_set(x_331, 2, x_330);
  x_332 = lean_array_push(x_304, x_331);
  x_333 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_333, 0, x_278);
  lean_ctor_set(x_333, 1, x_294);
  lean_ctor_set(x_333, 2, x_332);
  x_334 = lean_array_push(x_308, x_333);
  x_335 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_335, 0, x_278);
  lean_ctor_set(x_335, 1, x_257);
  lean_ctor_set(x_335, 2, x_334);
  lean_ctor_set(x_249, 0, x_335);
  return x_249;
  }
  else
  {
  lean_object* x_336; lean_object* x_337; lean_object* x_338; lean_object* x_339; lean_object* x_340; lean_object* x_341; lean_object* x_342; lean_object* x_343; lean_object* x_344; lean_object* x_345; lean_object* x_346; lean_object* x_347; lean_object* x_348; lean_object* x_349; lean_object* x_350; lean_object* x_351; lean_object* x_352; lean_object* x_353; lean_object* x_354; lean_object* x_355; lean_object* x_356; lean_object* x_357; lean_object* x_358; lean_object* x_359; lean_object* x_360; lean_object* x_361; lean_object* x_362; lean_object* x_363; lean_object* x_364; lean_object* x_365; lean_object* x_366; lean_object* x_367; lean_object* x_368; lean_object* x_369; lean_object* x_370; size_t x_371; size_t x_372; lean_object* x_373; lean_object* x_374; lean_object* x_375; lean_object* x_376; lean_object* x_377; lean_object* x_378; lean_object* x_379; lean_object* x_380; lean_object* x_381; lean_object* x_382; lean_object* x_383; lean_object* x_384; lean_object* x_385; lean_object* x_386; lean_object* x_387; lean_object* x_388; lean_object* x_389; lean_object* x_390; lean_object* x_391; lean_object* x_392; lean_object* x_393; lean_object* x_394; lean_object* x_395; lean_object* x_396; lean_object* x_397; lean_object* x_398; lean_object* x_399; lean_object* x_400; lean_object* x_401; lean_object* x_402; lean_object* x_403; lean_object* x_404; lean_object* x_405; lean_object* x_406; lean_object* x_407; lean_object* x_408; lean_object* x_409; lean_object* x_410; lean_object* x_411; lean_object* x_412; lean_object* x_413; lean_object* x_414; lean_object* x_415; lean_object* x_416; lean_object* x_417; lean_object* x_418; lean_object* x_419; lean_object* x_420; lean_object* x_421; lean_object* x_422; 
  x_336 = lean_ctor_get(x_249, 0);
  x_337 = lean_ctor_get(x_249, 1);
  lean_inc(x_337);
  lean_inc(x_336);
  lean_dec(x_249);
  x_338 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3;
  lean_inc(x_3);
  x_339 = lean_name_mk_string(x_3, x_338);
  x_340 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5;
  x_341 = lean_name_mk_string(x_339, x_340);
  x_342 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3;
  lean_inc(x_341);
  x_343 = lean_name_mk_string(x_341, x_342);
  x_344 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__4;
  x_345 = l_Lean_addMacroScope(x_336, x_344, x_247);
  x_346 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__9;
  x_347 = lean_name_mk_string(x_3, x_346);
  x_348 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__1;
  x_349 = lean_name_mk_string(x_347, x_348);
  x_350 = lean_box(0);
  x_351 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_351, 0, x_349);
  lean_ctor_set(x_351, 1, x_350);
  x_352 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_352, 0, x_351);
  lean_ctor_set(x_352, 1, x_350);
  x_353 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__3;
  lean_inc(x_244);
  x_354 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_354, 0, x_244);
  lean_ctor_set(x_354, 1, x_353);
  lean_ctor_set(x_354, 2, x_345);
  lean_ctor_set(x_354, 3, x_352);
  x_355 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__3;
  lean_inc(x_244);
  x_356 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_356, 0, x_244);
  lean_ctor_set(x_356, 1, x_355);
  x_357 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__1;
  lean_inc(x_341);
  x_358 = lean_name_mk_string(x_341, x_357);
  x_359 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__2;
  lean_inc(x_244);
  x_360 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_360, 0, x_244);
  lean_ctor_set(x_360, 1, x_359);
  x_361 = lean_ctor_get(x_5, 0);
  lean_inc(x_361);
  lean_dec(x_5);
  x_362 = lean_ctor_get(x_361, 0);
  lean_inc(x_362);
  lean_dec(x_361);
  x_363 = l_Lean_Name_getString_x21(x_362);
  x_364 = lean_box(2);
  x_365 = l_Lean_Syntax_mkStrLit(x_363, x_364);
  lean_dec(x_363);
  x_366 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__3;
  x_367 = lean_name_mk_string(x_341, x_366);
  x_368 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__14;
  lean_inc(x_244);
  x_369 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_369, 0, x_244);
  lean_ctor_set(x_369, 1, x_368);
  x_370 = lean_array_get_size(x_241);
  x_371 = lean_usize_of_nat(x_370);
  lean_dec(x_370);
  x_372 = 0;
  x_373 = x_241;
  x_374 = l_Array_mapMUnsafe_map___at___aux__Init__NotationExtra______macroRules___xabterm_x25_x5b___x7c___x5d_xbb__1___spec__3(x_371, x_372, x_373);
  x_375 = x_374;
  x_376 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__15;
  x_377 = l_Lean_mkSepArray(x_375, x_376);
  lean_dec(x_375);
  x_378 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__1;
  x_379 = l_Array_append___rarg(x_378, x_377);
  x_380 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_381 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_381, 0, x_364);
  lean_ctor_set(x_381, 1, x_380);
  lean_ctor_set(x_381, 2, x_379);
  x_382 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__4;
  lean_inc(x_244);
  x_383 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_383, 0, x_244);
  lean_ctor_set(x_383, 1, x_382);
  x_384 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5;
  x_385 = lean_array_push(x_384, x_356);
  lean_inc(x_385);
  x_386 = lean_array_push(x_385, x_381);
  lean_inc(x_383);
  x_387 = lean_array_push(x_386, x_383);
  x_388 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__2;
  x_389 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_389, 0, x_364);
  lean_ctor_set(x_389, 1, x_388);
  lean_ctor_set(x_389, 2, x_387);
  x_390 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_391 = lean_array_push(x_390, x_389);
  x_392 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_392, 0, x_364);
  lean_ctor_set(x_392, 1, x_380);
  lean_ctor_set(x_392, 2, x_391);
  x_393 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_394 = lean_array_push(x_393, x_354);
  lean_inc(x_394);
  x_395 = lean_array_push(x_394, x_392);
  lean_inc(x_343);
  x_396 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_396, 0, x_364);
  lean_ctor_set(x_396, 1, x_343);
  lean_ctor_set(x_396, 2, x_395);
  x_397 = lean_array_push(x_390, x_396);
  x_398 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_398, 0, x_364);
  lean_ctor_set(x_398, 1, x_380);
  lean_ctor_set(x_398, 2, x_397);
  x_399 = lean_array_push(x_393, x_369);
  x_400 = lean_array_push(x_399, x_398);
  x_401 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_401, 0, x_364);
  lean_ctor_set(x_401, 1, x_367);
  lean_ctor_set(x_401, 2, x_400);
  x_402 = lean_array_push(x_390, x_401);
  x_403 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_403, 0, x_364);
  lean_ctor_set(x_403, 1, x_380);
  lean_ctor_set(x_403, 2, x_402);
  x_404 = lean_array_push(x_393, x_365);
  x_405 = lean_array_push(x_404, x_403);
  x_406 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_406, 0, x_364);
  lean_ctor_set(x_406, 1, x_380);
  lean_ctor_set(x_406, 2, x_405);
  x_407 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__4;
  x_408 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_408, 0, x_244);
  lean_ctor_set(x_408, 1, x_407);
  x_409 = lean_array_push(x_384, x_360);
  x_410 = lean_array_push(x_409, x_406);
  x_411 = lean_array_push(x_410, x_408);
  x_412 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_412, 0, x_364);
  lean_ctor_set(x_412, 1, x_358);
  lean_ctor_set(x_412, 2, x_411);
  x_413 = lean_array_push(x_390, x_412);
  x_414 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_414, 0, x_364);
  lean_ctor_set(x_414, 1, x_380);
  lean_ctor_set(x_414, 2, x_413);
  x_415 = lean_array_push(x_385, x_414);
  x_416 = lean_array_push(x_415, x_383);
  x_417 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_417, 0, x_364);
  lean_ctor_set(x_417, 1, x_388);
  lean_ctor_set(x_417, 2, x_416);
  x_418 = lean_array_push(x_390, x_417);
  x_419 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_419, 0, x_364);
  lean_ctor_set(x_419, 1, x_380);
  lean_ctor_set(x_419, 2, x_418);
  x_420 = lean_array_push(x_394, x_419);
  x_421 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_421, 0, x_364);
  lean_ctor_set(x_421, 1, x_343);
  lean_ctor_set(x_421, 2, x_420);
  x_422 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_422, 0, x_421);
  lean_ctor_set(x_422, 1, x_337);
  return x_422;
  }
  }
  }
  else
  {
  lean_object* x_423; 
  lean_dec(x_15);
  x_423 = lean_array_fget(x_6, x_16);
  lean_dec(x_6);
  if (lean_obj_tag(x_7) == 0)
  {
  lean_object* x_424; lean_object* x_425; lean_object* x_426; lean_object* x_427; lean_object* x_428; uint8_t x_429; uint8_t x_430; 
  x_424 = lean_ctor_get(x_423, 0);
  lean_inc(x_424);
  x_425 = lean_ctor_get(x_423, 1);
  lean_inc(x_425);
  if (lean_is_exclusive(x_423)) {
   lean_ctor_release(x_423, 0);
   lean_ctor_release(x_423, 1);
   x_426 = x_423;
  } else {
   lean_dec_ref(x_423);
   x_426 = lean_box(0);
  }
  x_427 = lean_ctor_get(x_1, 0);
  lean_inc(x_427);
  lean_dec(x_1);
  x_428 = lean_ctor_get(x_427, 0);
  lean_inc(x_428);
  lean_dec(x_427);
  x_429 = l_Lean_Expr_isAppOf(x_425, x_428);
  lean_dec(x_428);
  lean_dec(x_425);
  if (x_429 == 0)
  {
  uint8_t x_633; 
  x_633 = 0;
  x_430 = x_633;
  goto block_632;
  }
  else
  {
  uint8_t x_634; 
  x_634 = 1;
  x_430 = x_634;
  goto block_632;
  }
  block_632:
  {
  lean_object* x_431; lean_object* x_432; 
  if (x_430 == 0)
  {
  lean_object* x_578; lean_object* x_579; lean_object* x_580; lean_object* x_581; lean_object* x_582; lean_object* x_583; lean_object* x_584; lean_object* x_585; lean_object* x_586; lean_object* x_587; lean_object* x_588; lean_object* x_589; lean_object* x_590; lean_object* x_591; lean_object* x_592; lean_object* x_593; lean_object* x_594; lean_object* x_595; lean_object* x_596; lean_object* x_597; lean_object* x_598; lean_object* x_599; lean_object* x_600; lean_object* x_601; lean_object* x_602; lean_object* x_603; lean_object* x_604; lean_object* x_605; lean_object* x_606; lean_object* x_607; lean_object* x_608; lean_object* x_609; lean_object* x_610; 
  lean_dec(x_2);
  lean_inc(x_12);
  x_578 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_12, x_13, x_14);
  x_579 = lean_ctor_get(x_578, 0);
  lean_inc(x_579);
  x_580 = lean_ctor_get(x_578, 1);
  lean_inc(x_580);
  lean_dec(x_578);
  x_581 = l_Lean_Elab_Term_getCurrMacroScope(x_8, x_9, x_10, x_11, x_12, x_13, x_580);
  x_582 = lean_ctor_get(x_581, 0);
  lean_inc(x_582);
  x_583 = lean_ctor_get(x_581, 1);
  lean_inc(x_583);
  lean_dec(x_581);
  x_584 = l_Lean_Elab_Term_getMainModule___rarg(x_13, x_583);
  x_585 = lean_ctor_get(x_584, 0);
  lean_inc(x_585);
  x_586 = lean_ctor_get(x_584, 1);
  lean_inc(x_586);
  lean_dec(x_584);
  x_587 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3;
  lean_inc(x_3);
  x_588 = lean_name_mk_string(x_3, x_587);
  x_589 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5;
  x_590 = lean_name_mk_string(x_588, x_589);
  x_591 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3;
  x_592 = lean_name_mk_string(x_590, x_591);
  x_593 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__4;
  x_594 = l_Lean_addMacroScope(x_585, x_593, x_582);
  x_595 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__1;
  x_596 = lean_name_mk_string(x_4, x_595);
  x_597 = lean_box(0);
  x_598 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_598, 0, x_596);
  lean_ctor_set(x_598, 1, x_597);
  x_599 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_599, 0, x_598);
  lean_ctor_set(x_599, 1, x_597);
  x_600 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__3;
  x_601 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_601, 0, x_579);
  lean_ctor_set(x_601, 1, x_600);
  lean_ctor_set(x_601, 2, x_594);
  lean_ctor_set(x_601, 3, x_599);
  x_602 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_603 = lean_array_push(x_602, x_424);
  x_604 = lean_box(2);
  x_605 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_606 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_606, 0, x_604);
  lean_ctor_set(x_606, 1, x_605);
  lean_ctor_set(x_606, 2, x_603);
  x_607 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_608 = lean_array_push(x_607, x_601);
  x_609 = lean_array_push(x_608, x_606);
  x_610 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_610, 0, x_604);
  lean_ctor_set(x_610, 1, x_592);
  lean_ctor_set(x_610, 2, x_609);
  x_431 = x_610;
  x_432 = x_586;
  goto block_577;
  }
  else
  {
  lean_object* x_611; lean_object* x_612; lean_object* x_613; lean_object* x_614; lean_object* x_615; lean_object* x_616; lean_object* x_617; lean_object* x_618; lean_object* x_619; lean_object* x_620; lean_object* x_621; lean_object* x_622; lean_object* x_623; lean_object* x_624; lean_object* x_625; lean_object* x_626; lean_object* x_627; lean_object* x_628; lean_object* x_629; lean_object* x_630; lean_object* x_631; 
  lean_dec(x_4);
  lean_inc(x_12);
  x_611 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_12, x_13, x_14);
  x_612 = lean_ctor_get(x_611, 1);
  lean_inc(x_612);
  lean_dec(x_611);
  x_613 = l_Lean_Elab_Term_getCurrMacroScope(x_8, x_9, x_10, x_11, x_12, x_13, x_612);
  x_614 = lean_ctor_get(x_613, 1);
  lean_inc(x_614);
  lean_dec(x_613);
  x_615 = l_Lean_Elab_Term_getMainModule___rarg(x_13, x_614);
  x_616 = lean_ctor_get(x_615, 1);
  lean_inc(x_616);
  lean_dec(x_615);
  x_617 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3;
  lean_inc(x_3);
  x_618 = lean_name_mk_string(x_3, x_617);
  x_619 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5;
  x_620 = lean_name_mk_string(x_618, x_619);
  x_621 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3;
  x_622 = lean_name_mk_string(x_620, x_621);
  x_623 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_624 = lean_array_push(x_623, x_424);
  x_625 = lean_box(2);
  x_626 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_627 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_627, 0, x_625);
  lean_ctor_set(x_627, 1, x_626);
  lean_ctor_set(x_627, 2, x_624);
  x_628 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_629 = lean_array_push(x_628, x_2);
  x_630 = lean_array_push(x_629, x_627);
  x_631 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_631, 0, x_625);
  lean_ctor_set(x_631, 1, x_622);
  lean_ctor_set(x_631, 2, x_630);
  x_431 = x_631;
  x_432 = x_616;
  goto block_577;
  }
  block_577:
  {
  lean_object* x_433; lean_object* x_434; lean_object* x_435; lean_object* x_436; lean_object* x_437; lean_object* x_438; lean_object* x_439; uint8_t x_440; 
  lean_inc(x_12);
  x_433 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_12, x_13, x_432);
  x_434 = lean_ctor_get(x_433, 0);
  lean_inc(x_434);
  x_435 = lean_ctor_get(x_433, 1);
  lean_inc(x_435);
  lean_dec(x_433);
  x_436 = l_Lean_Elab_Term_getCurrMacroScope(x_8, x_9, x_10, x_11, x_12, x_13, x_435);
  lean_dec(x_12);
  lean_dec(x_11);
  lean_dec(x_10);
  lean_dec(x_9);
  lean_dec(x_8);
  x_437 = lean_ctor_get(x_436, 0);
  lean_inc(x_437);
  x_438 = lean_ctor_get(x_436, 1);
  lean_inc(x_438);
  lean_dec(x_436);
  x_439 = l_Lean_Elab_Term_getMainModule___rarg(x_13, x_438);
  lean_dec(x_13);
  x_440 = !lean_is_exclusive(x_439);
  if (x_440 == 0)
  {
  lean_object* x_441; lean_object* x_442; lean_object* x_443; lean_object* x_444; lean_object* x_445; lean_object* x_446; lean_object* x_447; lean_object* x_448; lean_object* x_449; lean_object* x_450; lean_object* x_451; lean_object* x_452; lean_object* x_453; lean_object* x_454; lean_object* x_455; lean_object* x_456; lean_object* x_457; lean_object* x_458; lean_object* x_459; lean_object* x_460; lean_object* x_461; lean_object* x_462; lean_object* x_463; lean_object* x_464; lean_object* x_465; lean_object* x_466; lean_object* x_467; lean_object* x_468; lean_object* x_469; lean_object* x_470; lean_object* x_471; lean_object* x_472; lean_object* x_473; lean_object* x_474; lean_object* x_475; lean_object* x_476; lean_object* x_477; lean_object* x_478; lean_object* x_479; lean_object* x_480; lean_object* x_481; lean_object* x_482; lean_object* x_483; lean_object* x_484; lean_object* x_485; lean_object* x_486; lean_object* x_487; lean_object* x_488; lean_object* x_489; lean_object* x_490; lean_object* x_491; lean_object* x_492; lean_object* x_493; lean_object* x_494; lean_object* x_495; lean_object* x_496; lean_object* x_497; lean_object* x_498; lean_object* x_499; lean_object* x_500; lean_object* x_501; lean_object* x_502; lean_object* x_503; lean_object* x_504; lean_object* x_505; lean_object* x_506; lean_object* x_507; 
  x_441 = lean_ctor_get(x_439, 0);
  x_442 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3;
  lean_inc(x_3);
  x_443 = lean_name_mk_string(x_3, x_442);
  x_444 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5;
  x_445 = lean_name_mk_string(x_443, x_444);
  x_446 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3;
  lean_inc(x_445);
  x_447 = lean_name_mk_string(x_445, x_446);
  x_448 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__4;
  x_449 = l_Lean_addMacroScope(x_441, x_448, x_437);
  x_450 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__9;
  x_451 = lean_name_mk_string(x_3, x_450);
  x_452 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__1;
  x_453 = lean_name_mk_string(x_451, x_452);
  x_454 = lean_box(0);
  if (lean_is_scalar(x_426)) {
   x_455 = lean_alloc_ctor(0, 2, 0);
  } else {
   x_455 = x_426;
  }
  lean_ctor_set(x_455, 0, x_453);
  lean_ctor_set(x_455, 1, x_454);
  x_456 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_456, 0, x_455);
  lean_ctor_set(x_456, 1, x_454);
  x_457 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__3;
  lean_inc(x_434);
  x_458 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_458, 0, x_434);
  lean_ctor_set(x_458, 1, x_457);
  lean_ctor_set(x_458, 2, x_449);
  lean_ctor_set(x_458, 3, x_456);
  x_459 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__3;
  lean_inc(x_434);
  x_460 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_460, 0, x_434);
  lean_ctor_set(x_460, 1, x_459);
  x_461 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__1;
  lean_inc(x_445);
  x_462 = lean_name_mk_string(x_445, x_461);
  x_463 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__2;
  lean_inc(x_434);
  x_464 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_464, 0, x_434);
  lean_ctor_set(x_464, 1, x_463);
  x_465 = lean_ctor_get(x_5, 0);
  lean_inc(x_465);
  lean_dec(x_5);
  x_466 = lean_ctor_get(x_465, 0);
  lean_inc(x_466);
  lean_dec(x_465);
  x_467 = l_Lean_Name_getString_x21(x_466);
  x_468 = lean_box(2);
  x_469 = l_Lean_Syntax_mkStrLit(x_467, x_468);
  lean_dec(x_467);
  x_470 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__3;
  x_471 = lean_name_mk_string(x_445, x_470);
  x_472 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__14;
  lean_inc(x_434);
  x_473 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_473, 0, x_434);
  lean_ctor_set(x_473, 1, x_472);
  x_474 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_475 = lean_array_push(x_474, x_431);
  x_476 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_477 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_477, 0, x_468);
  lean_ctor_set(x_477, 1, x_476);
  lean_ctor_set(x_477, 2, x_475);
  x_478 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_479 = lean_array_push(x_478, x_473);
  x_480 = lean_array_push(x_479, x_477);
  x_481 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_481, 0, x_468);
  lean_ctor_set(x_481, 1, x_471);
  lean_ctor_set(x_481, 2, x_480);
  x_482 = lean_array_push(x_474, x_481);
  x_483 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_483, 0, x_468);
  lean_ctor_set(x_483, 1, x_476);
  lean_ctor_set(x_483, 2, x_482);
  x_484 = lean_array_push(x_478, x_469);
  x_485 = lean_array_push(x_484, x_483);
  x_486 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_486, 0, x_468);
  lean_ctor_set(x_486, 1, x_476);
  lean_ctor_set(x_486, 2, x_485);
  x_487 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__4;
  lean_inc(x_434);
  x_488 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_488, 0, x_434);
  lean_ctor_set(x_488, 1, x_487);
  x_489 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5;
  x_490 = lean_array_push(x_489, x_464);
  x_491 = lean_array_push(x_490, x_486);
  x_492 = lean_array_push(x_491, x_488);
  x_493 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_493, 0, x_468);
  lean_ctor_set(x_493, 1, x_462);
  lean_ctor_set(x_493, 2, x_492);
  x_494 = lean_array_push(x_474, x_493);
  x_495 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_495, 0, x_468);
  lean_ctor_set(x_495, 1, x_476);
  lean_ctor_set(x_495, 2, x_494);
  x_496 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__4;
  x_497 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_497, 0, x_434);
  lean_ctor_set(x_497, 1, x_496);
  x_498 = lean_array_push(x_489, x_460);
  x_499 = lean_array_push(x_498, x_495);
  x_500 = lean_array_push(x_499, x_497);
  x_501 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__2;
  x_502 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_502, 0, x_468);
  lean_ctor_set(x_502, 1, x_501);
  lean_ctor_set(x_502, 2, x_500);
  x_503 = lean_array_push(x_474, x_502);
  x_504 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_504, 0, x_468);
  lean_ctor_set(x_504, 1, x_476);
  lean_ctor_set(x_504, 2, x_503);
  x_505 = lean_array_push(x_478, x_458);
  x_506 = lean_array_push(x_505, x_504);
  x_507 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_507, 0, x_468);
  lean_ctor_set(x_507, 1, x_447);
  lean_ctor_set(x_507, 2, x_506);
  lean_ctor_set(x_439, 0, x_507);
  return x_439;
  }
  else
  {
  lean_object* x_508; lean_object* x_509; lean_object* x_510; lean_object* x_511; lean_object* x_512; lean_object* x_513; lean_object* x_514; lean_object* x_515; lean_object* x_516; lean_object* x_517; lean_object* x_518; lean_object* x_519; lean_object* x_520; lean_object* x_521; lean_object* x_522; lean_object* x_523; lean_object* x_524; lean_object* x_525; lean_object* x_526; lean_object* x_527; lean_object* x_528; lean_object* x_529; lean_object* x_530; lean_object* x_531; lean_object* x_532; lean_object* x_533; lean_object* x_534; lean_object* x_535; lean_object* x_536; lean_object* x_537; lean_object* x_538; lean_object* x_539; lean_object* x_540; lean_object* x_541; lean_object* x_542; lean_object* x_543; lean_object* x_544; lean_object* x_545; lean_object* x_546; lean_object* x_547; lean_object* x_548; lean_object* x_549; lean_object* x_550; lean_object* x_551; lean_object* x_552; lean_object* x_553; lean_object* x_554; lean_object* x_555; lean_object* x_556; lean_object* x_557; lean_object* x_558; lean_object* x_559; lean_object* x_560; lean_object* x_561; lean_object* x_562; lean_object* x_563; lean_object* x_564; lean_object* x_565; lean_object* x_566; lean_object* x_567; lean_object* x_568; lean_object* x_569; lean_object* x_570; lean_object* x_571; lean_object* x_572; lean_object* x_573; lean_object* x_574; lean_object* x_575; lean_object* x_576; 
  x_508 = lean_ctor_get(x_439, 0);
  x_509 = lean_ctor_get(x_439, 1);
  lean_inc(x_509);
  lean_inc(x_508);
  lean_dec(x_439);
  x_510 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3;
  lean_inc(x_3);
  x_511 = lean_name_mk_string(x_3, x_510);
  x_512 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5;
  x_513 = lean_name_mk_string(x_511, x_512);
  x_514 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3;
  lean_inc(x_513);
  x_515 = lean_name_mk_string(x_513, x_514);
  x_516 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__4;
  x_517 = l_Lean_addMacroScope(x_508, x_516, x_437);
  x_518 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__9;
  x_519 = lean_name_mk_string(x_3, x_518);
  x_520 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__1;
  x_521 = lean_name_mk_string(x_519, x_520);
  x_522 = lean_box(0);
  if (lean_is_scalar(x_426)) {
   x_523 = lean_alloc_ctor(0, 2, 0);
  } else {
   x_523 = x_426;
  }
  lean_ctor_set(x_523, 0, x_521);
  lean_ctor_set(x_523, 1, x_522);
  x_524 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_524, 0, x_523);
  lean_ctor_set(x_524, 1, x_522);
  x_525 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__3;
  lean_inc(x_434);
  x_526 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_526, 0, x_434);
  lean_ctor_set(x_526, 1, x_525);
  lean_ctor_set(x_526, 2, x_517);
  lean_ctor_set(x_526, 3, x_524);
  x_527 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__3;
  lean_inc(x_434);
  x_528 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_528, 0, x_434);
  lean_ctor_set(x_528, 1, x_527);
  x_529 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__1;
  lean_inc(x_513);
  x_530 = lean_name_mk_string(x_513, x_529);
  x_531 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__2;
  lean_inc(x_434);
  x_532 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_532, 0, x_434);
  lean_ctor_set(x_532, 1, x_531);
  x_533 = lean_ctor_get(x_5, 0);
  lean_inc(x_533);
  lean_dec(x_5);
  x_534 = lean_ctor_get(x_533, 0);
  lean_inc(x_534);
  lean_dec(x_533);
  x_535 = l_Lean_Name_getString_x21(x_534);
  x_536 = lean_box(2);
  x_537 = l_Lean_Syntax_mkStrLit(x_535, x_536);
  lean_dec(x_535);
  x_538 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__3;
  x_539 = lean_name_mk_string(x_513, x_538);
  x_540 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__14;
  lean_inc(x_434);
  x_541 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_541, 0, x_434);
  lean_ctor_set(x_541, 1, x_540);
  x_542 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_543 = lean_array_push(x_542, x_431);
  x_544 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_545 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_545, 0, x_536);
  lean_ctor_set(x_545, 1, x_544);
  lean_ctor_set(x_545, 2, x_543);
  x_546 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_547 = lean_array_push(x_546, x_541);
  x_548 = lean_array_push(x_547, x_545);
  x_549 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_549, 0, x_536);
  lean_ctor_set(x_549, 1, x_539);
  lean_ctor_set(x_549, 2, x_548);
  x_550 = lean_array_push(x_542, x_549);
  x_551 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_551, 0, x_536);
  lean_ctor_set(x_551, 1, x_544);
  lean_ctor_set(x_551, 2, x_550);
  x_552 = lean_array_push(x_546, x_537);
  x_553 = lean_array_push(x_552, x_551);
  x_554 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_554, 0, x_536);
  lean_ctor_set(x_554, 1, x_544);
  lean_ctor_set(x_554, 2, x_553);
  x_555 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__4;
  lean_inc(x_434);
  x_556 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_556, 0, x_434);
  lean_ctor_set(x_556, 1, x_555);
  x_557 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5;
  x_558 = lean_array_push(x_557, x_532);
  x_559 = lean_array_push(x_558, x_554);
  x_560 = lean_array_push(x_559, x_556);
  x_561 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_561, 0, x_536);
  lean_ctor_set(x_561, 1, x_530);
  lean_ctor_set(x_561, 2, x_560);
  x_562 = lean_array_push(x_542, x_561);
  x_563 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_563, 0, x_536);
  lean_ctor_set(x_563, 1, x_544);
  lean_ctor_set(x_563, 2, x_562);
  x_564 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__4;
  x_565 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_565, 0, x_434);
  lean_ctor_set(x_565, 1, x_564);
  x_566 = lean_array_push(x_557, x_528);
  x_567 = lean_array_push(x_566, x_563);
  x_568 = lean_array_push(x_567, x_565);
  x_569 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__2;
  x_570 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_570, 0, x_536);
  lean_ctor_set(x_570, 1, x_569);
  lean_ctor_set(x_570, 2, x_568);
  x_571 = lean_array_push(x_542, x_570);
  x_572 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_572, 0, x_536);
  lean_ctor_set(x_572, 1, x_544);
  lean_ctor_set(x_572, 2, x_571);
  x_573 = lean_array_push(x_546, x_526);
  x_574 = lean_array_push(x_573, x_572);
  x_575 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_575, 0, x_536);
  lean_ctor_set(x_575, 1, x_515);
  lean_ctor_set(x_575, 2, x_574);
  x_576 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_576, 0, x_575);
  lean_ctor_set(x_576, 1, x_509);
  return x_576;
  }
  }
  }
  }
  else
  {
  lean_object* x_635; lean_object* x_636; lean_object* x_637; uint8_t x_638; 
  x_635 = lean_ctor_get(x_7, 0);
  x_636 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  lean_inc(x_423);
  x_637 = lean_array_push(x_636, x_423);
  x_638 = !lean_is_exclusive(x_423);
  if (x_638 == 0)
  {
  lean_object* x_639; lean_object* x_640; lean_object* x_641; lean_object* x_642; lean_object* x_643; lean_object* x_644; lean_object* x_645; lean_object* x_646; lean_object* x_647; lean_object* x_648; lean_object* x_649; lean_object* x_650; lean_object* x_651; lean_object* x_652; uint8_t x_653; 
  x_639 = lean_ctor_get(x_423, 1);
  lean_dec(x_639);
  x_640 = lean_ctor_get(x_423, 0);
  lean_dec(x_640);
  x_641 = lean_array_get_size(x_637);
  x_642 = lean_mk_empty_array_with_capacity(x_641);
  lean_inc(x_12);
  lean_inc(x_3);
  x_643 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__5(x_1, x_2, x_3, x_4, x_635, x_637, x_637, x_641, x_16, lean_box(0), x_642, x_8, x_9, x_10, x_11, x_12, x_13, x_14);
  lean_dec(x_637);
  lean_dec(x_1);
  x_644 = lean_ctor_get(x_643, 0);
  lean_inc(x_644);
  x_645 = lean_ctor_get(x_643, 1);
  lean_inc(x_645);
  lean_dec(x_643);
  lean_inc(x_12);
  x_646 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_12, x_13, x_645);
  x_647 = lean_ctor_get(x_646, 0);
  lean_inc(x_647);
  x_648 = lean_ctor_get(x_646, 1);
  lean_inc(x_648);
  lean_dec(x_646);
  x_649 = l_Lean_Elab_Term_getCurrMacroScope(x_8, x_9, x_10, x_11, x_12, x_13, x_648);
  lean_dec(x_12);
  lean_dec(x_11);
  lean_dec(x_10);
  lean_dec(x_9);
  lean_dec(x_8);
  x_650 = lean_ctor_get(x_649, 0);
  lean_inc(x_650);
  x_651 = lean_ctor_get(x_649, 1);
  lean_inc(x_651);
  lean_dec(x_649);
  x_652 = l_Lean_Elab_Term_getMainModule___rarg(x_13, x_651);
  lean_dec(x_13);
  x_653 = !lean_is_exclusive(x_652);
  if (x_653 == 0)
  {
  lean_object* x_654; lean_object* x_655; lean_object* x_656; lean_object* x_657; lean_object* x_658; lean_object* x_659; lean_object* x_660; lean_object* x_661; lean_object* x_662; lean_object* x_663; lean_object* x_664; lean_object* x_665; lean_object* x_666; lean_object* x_667; lean_object* x_668; lean_object* x_669; lean_object* x_670; lean_object* x_671; lean_object* x_672; lean_object* x_673; lean_object* x_674; lean_object* x_675; lean_object* x_676; lean_object* x_677; lean_object* x_678; lean_object* x_679; lean_object* x_680; lean_object* x_681; lean_object* x_682; lean_object* x_683; lean_object* x_684; lean_object* x_685; lean_object* x_686; size_t x_687; size_t x_688; lean_object* x_689; lean_object* x_690; lean_object* x_691; lean_object* x_692; lean_object* x_693; lean_object* x_694; lean_object* x_695; lean_object* x_696; lean_object* x_697; lean_object* x_698; lean_object* x_699; lean_object* x_700; lean_object* x_701; lean_object* x_702; lean_object* x_703; lean_object* x_704; lean_object* x_705; lean_object* x_706; lean_object* x_707; lean_object* x_708; lean_object* x_709; lean_object* x_710; lean_object* x_711; lean_object* x_712; lean_object* x_713; lean_object* x_714; lean_object* x_715; lean_object* x_716; lean_object* x_717; lean_object* x_718; lean_object* x_719; lean_object* x_720; lean_object* x_721; lean_object* x_722; lean_object* x_723; lean_object* x_724; lean_object* x_725; lean_object* x_726; lean_object* x_727; lean_object* x_728; lean_object* x_729; lean_object* x_730; lean_object* x_731; lean_object* x_732; lean_object* x_733; lean_object* x_734; lean_object* x_735; lean_object* x_736; 
  x_654 = lean_ctor_get(x_652, 0);
  x_655 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3;
  lean_inc(x_3);
  x_656 = lean_name_mk_string(x_3, x_655);
  x_657 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5;
  x_658 = lean_name_mk_string(x_656, x_657);
  x_659 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3;
  lean_inc(x_658);
  x_660 = lean_name_mk_string(x_658, x_659);
  x_661 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__4;
  x_662 = l_Lean_addMacroScope(x_654, x_661, x_650);
  x_663 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__9;
  x_664 = lean_name_mk_string(x_3, x_663);
  x_665 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__1;
  x_666 = lean_name_mk_string(x_664, x_665);
  x_667 = lean_box(0);
  lean_ctor_set(x_423, 1, x_667);
  lean_ctor_set(x_423, 0, x_666);
  x_668 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_668, 0, x_423);
  lean_ctor_set(x_668, 1, x_667);
  x_669 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__3;
  lean_inc(x_647);
  x_670 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_670, 0, x_647);
  lean_ctor_set(x_670, 1, x_669);
  lean_ctor_set(x_670, 2, x_662);
  lean_ctor_set(x_670, 3, x_668);
  x_671 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__3;
  lean_inc(x_647);
  x_672 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_672, 0, x_647);
  lean_ctor_set(x_672, 1, x_671);
  x_673 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__1;
  lean_inc(x_658);
  x_674 = lean_name_mk_string(x_658, x_673);
  x_675 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__2;
  lean_inc(x_647);
  x_676 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_676, 0, x_647);
  lean_ctor_set(x_676, 1, x_675);
  x_677 = lean_ctor_get(x_5, 0);
  lean_inc(x_677);
  lean_dec(x_5);
  x_678 = lean_ctor_get(x_677, 0);
  lean_inc(x_678);
  lean_dec(x_677);
  x_679 = l_Lean_Name_getString_x21(x_678);
  x_680 = lean_box(2);
  x_681 = l_Lean_Syntax_mkStrLit(x_679, x_680);
  lean_dec(x_679);
  x_682 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__3;
  x_683 = lean_name_mk_string(x_658, x_682);
  x_684 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__14;
  lean_inc(x_647);
  x_685 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_685, 0, x_647);
  lean_ctor_set(x_685, 1, x_684);
  x_686 = lean_array_get_size(x_644);
  x_687 = lean_usize_of_nat(x_686);
  lean_dec(x_686);
  x_688 = 0;
  x_689 = x_644;
  x_690 = l_Array_mapMUnsafe_map___at___aux__Init__NotationExtra______macroRules___xabterm_x25_x5b___x7c___x5d_xbb__1___spec__3(x_687, x_688, x_689);
  x_691 = x_690;
  x_692 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__15;
  x_693 = l_Lean_mkSepArray(x_691, x_692);
  lean_dec(x_691);
  x_694 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__1;
  x_695 = l_Array_append___rarg(x_694, x_693);
  x_696 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_697 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_697, 0, x_680);
  lean_ctor_set(x_697, 1, x_696);
  lean_ctor_set(x_697, 2, x_695);
  x_698 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__4;
  lean_inc(x_647);
  x_699 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_699, 0, x_647);
  lean_ctor_set(x_699, 1, x_698);
  x_700 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5;
  x_701 = lean_array_push(x_700, x_672);
  lean_inc(x_701);
  x_702 = lean_array_push(x_701, x_697);
  lean_inc(x_699);
  x_703 = lean_array_push(x_702, x_699);
  x_704 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__2;
  x_705 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_705, 0, x_680);
  lean_ctor_set(x_705, 1, x_704);
  lean_ctor_set(x_705, 2, x_703);
  x_706 = lean_array_push(x_636, x_705);
  x_707 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_707, 0, x_680);
  lean_ctor_set(x_707, 1, x_696);
  lean_ctor_set(x_707, 2, x_706);
  x_708 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_709 = lean_array_push(x_708, x_670);
  lean_inc(x_709);
  x_710 = lean_array_push(x_709, x_707);
  lean_inc(x_660);
  x_711 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_711, 0, x_680);
  lean_ctor_set(x_711, 1, x_660);
  lean_ctor_set(x_711, 2, x_710);
  x_712 = lean_array_push(x_636, x_711);
  x_713 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_713, 0, x_680);
  lean_ctor_set(x_713, 1, x_696);
  lean_ctor_set(x_713, 2, x_712);
  x_714 = lean_array_push(x_708, x_685);
  x_715 = lean_array_push(x_714, x_713);
  x_716 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_716, 0, x_680);
  lean_ctor_set(x_716, 1, x_683);
  lean_ctor_set(x_716, 2, x_715);
  x_717 = lean_array_push(x_636, x_716);
  x_718 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_718, 0, x_680);
  lean_ctor_set(x_718, 1, x_696);
  lean_ctor_set(x_718, 2, x_717);
  x_719 = lean_array_push(x_708, x_681);
  x_720 = lean_array_push(x_719, x_718);
  x_721 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_721, 0, x_680);
  lean_ctor_set(x_721, 1, x_696);
  lean_ctor_set(x_721, 2, x_720);
  x_722 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__4;
  x_723 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_723, 0, x_647);
  lean_ctor_set(x_723, 1, x_722);
  x_724 = lean_array_push(x_700, x_676);
  x_725 = lean_array_push(x_724, x_721);
  x_726 = lean_array_push(x_725, x_723);
  x_727 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_727, 0, x_680);
  lean_ctor_set(x_727, 1, x_674);
  lean_ctor_set(x_727, 2, x_726);
  x_728 = lean_array_push(x_636, x_727);
  x_729 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_729, 0, x_680);
  lean_ctor_set(x_729, 1, x_696);
  lean_ctor_set(x_729, 2, x_728);
  x_730 = lean_array_push(x_701, x_729);
  x_731 = lean_array_push(x_730, x_699);
  x_732 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_732, 0, x_680);
  lean_ctor_set(x_732, 1, x_704);
  lean_ctor_set(x_732, 2, x_731);
  x_733 = lean_array_push(x_636, x_732);
  x_734 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_734, 0, x_680);
  lean_ctor_set(x_734, 1, x_696);
  lean_ctor_set(x_734, 2, x_733);
  x_735 = lean_array_push(x_709, x_734);
  x_736 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_736, 0, x_680);
  lean_ctor_set(x_736, 1, x_660);
  lean_ctor_set(x_736, 2, x_735);
  lean_ctor_set(x_652, 0, x_736);
  return x_652;
  }
  else
  {
  lean_object* x_737; lean_object* x_738; lean_object* x_739; lean_object* x_740; lean_object* x_741; lean_object* x_742; lean_object* x_743; lean_object* x_744; lean_object* x_745; lean_object* x_746; lean_object* x_747; lean_object* x_748; lean_object* x_749; lean_object* x_750; lean_object* x_751; lean_object* x_752; lean_object* x_753; lean_object* x_754; lean_object* x_755; lean_object* x_756; lean_object* x_757; lean_object* x_758; lean_object* x_759; lean_object* x_760; lean_object* x_761; lean_object* x_762; lean_object* x_763; lean_object* x_764; lean_object* x_765; lean_object* x_766; lean_object* x_767; lean_object* x_768; lean_object* x_769; lean_object* x_770; size_t x_771; size_t x_772; lean_object* x_773; lean_object* x_774; lean_object* x_775; lean_object* x_776; lean_object* x_777; lean_object* x_778; lean_object* x_779; lean_object* x_780; lean_object* x_781; lean_object* x_782; lean_object* x_783; lean_object* x_784; lean_object* x_785; lean_object* x_786; lean_object* x_787; lean_object* x_788; lean_object* x_789; lean_object* x_790; lean_object* x_791; lean_object* x_792; lean_object* x_793; lean_object* x_794; lean_object* x_795; lean_object* x_796; lean_object* x_797; lean_object* x_798; lean_object* x_799; lean_object* x_800; lean_object* x_801; lean_object* x_802; lean_object* x_803; lean_object* x_804; lean_object* x_805; lean_object* x_806; lean_object* x_807; lean_object* x_808; lean_object* x_809; lean_object* x_810; lean_object* x_811; lean_object* x_812; lean_object* x_813; lean_object* x_814; lean_object* x_815; lean_object* x_816; lean_object* x_817; lean_object* x_818; lean_object* x_819; lean_object* x_820; lean_object* x_821; 
  x_737 = lean_ctor_get(x_652, 0);
  x_738 = lean_ctor_get(x_652, 1);
  lean_inc(x_738);
  lean_inc(x_737);
  lean_dec(x_652);
  x_739 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3;
  lean_inc(x_3);
  x_740 = lean_name_mk_string(x_3, x_739);
  x_741 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5;
  x_742 = lean_name_mk_string(x_740, x_741);
  x_743 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3;
  lean_inc(x_742);
  x_744 = lean_name_mk_string(x_742, x_743);
  x_745 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__4;
  x_746 = l_Lean_addMacroScope(x_737, x_745, x_650);
  x_747 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__9;
  x_748 = lean_name_mk_string(x_3, x_747);
  x_749 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__1;
  x_750 = lean_name_mk_string(x_748, x_749);
  x_751 = lean_box(0);
  lean_ctor_set(x_423, 1, x_751);
  lean_ctor_set(x_423, 0, x_750);
  x_752 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_752, 0, x_423);
  lean_ctor_set(x_752, 1, x_751);
  x_753 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__3;
  lean_inc(x_647);
  x_754 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_754, 0, x_647);
  lean_ctor_set(x_754, 1, x_753);
  lean_ctor_set(x_754, 2, x_746);
  lean_ctor_set(x_754, 3, x_752);
  x_755 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__3;
  lean_inc(x_647);
  x_756 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_756, 0, x_647);
  lean_ctor_set(x_756, 1, x_755);
  x_757 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__1;
  lean_inc(x_742);
  x_758 = lean_name_mk_string(x_742, x_757);
  x_759 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__2;
  lean_inc(x_647);
  x_760 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_760, 0, x_647);
  lean_ctor_set(x_760, 1, x_759);
  x_761 = lean_ctor_get(x_5, 0);
  lean_inc(x_761);
  lean_dec(x_5);
  x_762 = lean_ctor_get(x_761, 0);
  lean_inc(x_762);
  lean_dec(x_761);
  x_763 = l_Lean_Name_getString_x21(x_762);
  x_764 = lean_box(2);
  x_765 = l_Lean_Syntax_mkStrLit(x_763, x_764);
  lean_dec(x_763);
  x_766 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__3;
  x_767 = lean_name_mk_string(x_742, x_766);
  x_768 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__14;
  lean_inc(x_647);
  x_769 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_769, 0, x_647);
  lean_ctor_set(x_769, 1, x_768);
  x_770 = lean_array_get_size(x_644);
  x_771 = lean_usize_of_nat(x_770);
  lean_dec(x_770);
  x_772 = 0;
  x_773 = x_644;
  x_774 = l_Array_mapMUnsafe_map___at___aux__Init__NotationExtra______macroRules___xabterm_x25_x5b___x7c___x5d_xbb__1___spec__3(x_771, x_772, x_773);
  x_775 = x_774;
  x_776 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__15;
  x_777 = l_Lean_mkSepArray(x_775, x_776);
  lean_dec(x_775);
  x_778 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__1;
  x_779 = l_Array_append___rarg(x_778, x_777);
  x_780 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_781 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_781, 0, x_764);
  lean_ctor_set(x_781, 1, x_780);
  lean_ctor_set(x_781, 2, x_779);
  x_782 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__4;
  lean_inc(x_647);
  x_783 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_783, 0, x_647);
  lean_ctor_set(x_783, 1, x_782);
  x_784 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5;
  x_785 = lean_array_push(x_784, x_756);
  lean_inc(x_785);
  x_786 = lean_array_push(x_785, x_781);
  lean_inc(x_783);
  x_787 = lean_array_push(x_786, x_783);
  x_788 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__2;
  x_789 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_789, 0, x_764);
  lean_ctor_set(x_789, 1, x_788);
  lean_ctor_set(x_789, 2, x_787);
  x_790 = lean_array_push(x_636, x_789);
  x_791 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_791, 0, x_764);
  lean_ctor_set(x_791, 1, x_780);
  lean_ctor_set(x_791, 2, x_790);
  x_792 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_793 = lean_array_push(x_792, x_754);
  lean_inc(x_793);
  x_794 = lean_array_push(x_793, x_791);
  lean_inc(x_744);
  x_795 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_795, 0, x_764);
  lean_ctor_set(x_795, 1, x_744);
  lean_ctor_set(x_795, 2, x_794);
  x_796 = lean_array_push(x_636, x_795);
  x_797 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_797, 0, x_764);
  lean_ctor_set(x_797, 1, x_780);
  lean_ctor_set(x_797, 2, x_796);
  x_798 = lean_array_push(x_792, x_769);
  x_799 = lean_array_push(x_798, x_797);
  x_800 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_800, 0, x_764);
  lean_ctor_set(x_800, 1, x_767);
  lean_ctor_set(x_800, 2, x_799);
  x_801 = lean_array_push(x_636, x_800);
  x_802 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_802, 0, x_764);
  lean_ctor_set(x_802, 1, x_780);
  lean_ctor_set(x_802, 2, x_801);
  x_803 = lean_array_push(x_792, x_765);
  x_804 = lean_array_push(x_803, x_802);
  x_805 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_805, 0, x_764);
  lean_ctor_set(x_805, 1, x_780);
  lean_ctor_set(x_805, 2, x_804);
  x_806 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__4;
  x_807 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_807, 0, x_647);
  lean_ctor_set(x_807, 1, x_806);
  x_808 = lean_array_push(x_784, x_760);
  x_809 = lean_array_push(x_808, x_805);
  x_810 = lean_array_push(x_809, x_807);
  x_811 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_811, 0, x_764);
  lean_ctor_set(x_811, 1, x_758);
  lean_ctor_set(x_811, 2, x_810);
  x_812 = lean_array_push(x_636, x_811);
  x_813 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_813, 0, x_764);
  lean_ctor_set(x_813, 1, x_780);
  lean_ctor_set(x_813, 2, x_812);
  x_814 = lean_array_push(x_785, x_813);
  x_815 = lean_array_push(x_814, x_783);
  x_816 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_816, 0, x_764);
  lean_ctor_set(x_816, 1, x_788);
  lean_ctor_set(x_816, 2, x_815);
  x_817 = lean_array_push(x_636, x_816);
  x_818 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_818, 0, x_764);
  lean_ctor_set(x_818, 1, x_780);
  lean_ctor_set(x_818, 2, x_817);
  x_819 = lean_array_push(x_793, x_818);
  x_820 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_820, 0, x_764);
  lean_ctor_set(x_820, 1, x_744);
  lean_ctor_set(x_820, 2, x_819);
  x_821 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_821, 0, x_820);
  lean_ctor_set(x_821, 1, x_738);
  return x_821;
  }
  }
  else
  {
  lean_object* x_822; lean_object* x_823; lean_object* x_824; lean_object* x_825; lean_object* x_826; lean_object* x_827; lean_object* x_828; lean_object* x_829; lean_object* x_830; lean_object* x_831; lean_object* x_832; lean_object* x_833; lean_object* x_834; lean_object* x_835; lean_object* x_836; lean_object* x_837; lean_object* x_838; lean_object* x_839; lean_object* x_840; lean_object* x_841; lean_object* x_842; lean_object* x_843; lean_object* x_844; lean_object* x_845; lean_object* x_846; lean_object* x_847; lean_object* x_848; lean_object* x_849; lean_object* x_850; lean_object* x_851; lean_object* x_852; lean_object* x_853; lean_object* x_854; lean_object* x_855; lean_object* x_856; lean_object* x_857; lean_object* x_858; lean_object* x_859; lean_object* x_860; lean_object* x_861; lean_object* x_862; lean_object* x_863; lean_object* x_864; lean_object* x_865; lean_object* x_866; lean_object* x_867; lean_object* x_868; lean_object* x_869; size_t x_870; size_t x_871; lean_object* x_872; lean_object* x_873; lean_object* x_874; lean_object* x_875; lean_object* x_876; lean_object* x_877; lean_object* x_878; lean_object* x_879; lean_object* x_880; lean_object* x_881; lean_object* x_882; lean_object* x_883; lean_object* x_884; lean_object* x_885; lean_object* x_886; lean_object* x_887; lean_object* x_888; lean_object* x_889; lean_object* x_890; lean_object* x_891; lean_object* x_892; lean_object* x_893; lean_object* x_894; lean_object* x_895; lean_object* x_896; lean_object* x_897; lean_object* x_898; lean_object* x_899; lean_object* x_900; lean_object* x_901; lean_object* x_902; lean_object* x_903; lean_object* x_904; lean_object* x_905; lean_object* x_906; lean_object* x_907; lean_object* x_908; lean_object* x_909; lean_object* x_910; lean_object* x_911; lean_object* x_912; lean_object* x_913; lean_object* x_914; lean_object* x_915; lean_object* x_916; lean_object* x_917; lean_object* x_918; lean_object* x_919; lean_object* x_920; 
  lean_dec(x_423);
  x_822 = lean_array_get_size(x_637);
  x_823 = lean_mk_empty_array_with_capacity(x_822);
  lean_inc(x_12);
  lean_inc(x_3);
  x_824 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__5(x_1, x_2, x_3, x_4, x_635, x_637, x_637, x_822, x_16, lean_box(0), x_823, x_8, x_9, x_10, x_11, x_12, x_13, x_14);
  lean_dec(x_637);
  lean_dec(x_1);
  x_825 = lean_ctor_get(x_824, 0);
  lean_inc(x_825);
  x_826 = lean_ctor_get(x_824, 1);
  lean_inc(x_826);
  lean_dec(x_824);
  lean_inc(x_12);
  x_827 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_12, x_13, x_826);
  x_828 = lean_ctor_get(x_827, 0);
  lean_inc(x_828);
  x_829 = lean_ctor_get(x_827, 1);
  lean_inc(x_829);
  lean_dec(x_827);
  x_830 = l_Lean_Elab_Term_getCurrMacroScope(x_8, x_9, x_10, x_11, x_12, x_13, x_829);
  lean_dec(x_12);
  lean_dec(x_11);
  lean_dec(x_10);
  lean_dec(x_9);
  lean_dec(x_8);
  x_831 = lean_ctor_get(x_830, 0);
  lean_inc(x_831);
  x_832 = lean_ctor_get(x_830, 1);
  lean_inc(x_832);
  lean_dec(x_830);
  x_833 = l_Lean_Elab_Term_getMainModule___rarg(x_13, x_832);
  lean_dec(x_13);
  x_834 = lean_ctor_get(x_833, 0);
  lean_inc(x_834);
  x_835 = lean_ctor_get(x_833, 1);
  lean_inc(x_835);
  if (lean_is_exclusive(x_833)) {
   lean_ctor_release(x_833, 0);
   lean_ctor_release(x_833, 1);
   x_836 = x_833;
  } else {
   lean_dec_ref(x_833);
   x_836 = lean_box(0);
  }
  x_837 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3;
  lean_inc(x_3);
  x_838 = lean_name_mk_string(x_3, x_837);
  x_839 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5;
  x_840 = lean_name_mk_string(x_838, x_839);
  x_841 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3;
  lean_inc(x_840);
  x_842 = lean_name_mk_string(x_840, x_841);
  x_843 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__4;
  x_844 = l_Lean_addMacroScope(x_834, x_843, x_831);
  x_845 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__9;
  x_846 = lean_name_mk_string(x_3, x_845);
  x_847 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__1;
  x_848 = lean_name_mk_string(x_846, x_847);
  x_849 = lean_box(0);
  x_850 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_850, 0, x_848);
  lean_ctor_set(x_850, 1, x_849);
  x_851 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_851, 0, x_850);
  lean_ctor_set(x_851, 1, x_849);
  x_852 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__3;
  lean_inc(x_828);
  x_853 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_853, 0, x_828);
  lean_ctor_set(x_853, 1, x_852);
  lean_ctor_set(x_853, 2, x_844);
  lean_ctor_set(x_853, 3, x_851);
  x_854 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__3;
  lean_inc(x_828);
  x_855 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_855, 0, x_828);
  lean_ctor_set(x_855, 1, x_854);
  x_856 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__1;
  lean_inc(x_840);
  x_857 = lean_name_mk_string(x_840, x_856);
  x_858 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__2;
  lean_inc(x_828);
  x_859 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_859, 0, x_828);
  lean_ctor_set(x_859, 1, x_858);
  x_860 = lean_ctor_get(x_5, 0);
  lean_inc(x_860);
  lean_dec(x_5);
  x_861 = lean_ctor_get(x_860, 0);
  lean_inc(x_861);
  lean_dec(x_860);
  x_862 = l_Lean_Name_getString_x21(x_861);
  x_863 = lean_box(2);
  x_864 = l_Lean_Syntax_mkStrLit(x_862, x_863);
  lean_dec(x_862);
  x_865 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__3;
  x_866 = lean_name_mk_string(x_840, x_865);
  x_867 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__14;
  lean_inc(x_828);
  x_868 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_868, 0, x_828);
  lean_ctor_set(x_868, 1, x_867);
  x_869 = lean_array_get_size(x_825);
  x_870 = lean_usize_of_nat(x_869);
  lean_dec(x_869);
  x_871 = 0;
  x_872 = x_825;
  x_873 = l_Array_mapMUnsafe_map___at___aux__Init__NotationExtra______macroRules___xabterm_x25_x5b___x7c___x5d_xbb__1___spec__3(x_870, x_871, x_872);
  x_874 = x_873;
  x_875 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__15;
  x_876 = l_Lean_mkSepArray(x_874, x_875);
  lean_dec(x_874);
  x_877 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__1;
  x_878 = l_Array_append___rarg(x_877, x_876);
  x_879 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_880 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_880, 0, x_863);
  lean_ctor_set(x_880, 1, x_879);
  lean_ctor_set(x_880, 2, x_878);
  x_881 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__4;
  lean_inc(x_828);
  x_882 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_882, 0, x_828);
  lean_ctor_set(x_882, 1, x_881);
  x_883 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5;
  x_884 = lean_array_push(x_883, x_855);
  lean_inc(x_884);
  x_885 = lean_array_push(x_884, x_880);
  lean_inc(x_882);
  x_886 = lean_array_push(x_885, x_882);
  x_887 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__2;
  x_888 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_888, 0, x_863);
  lean_ctor_set(x_888, 1, x_887);
  lean_ctor_set(x_888, 2, x_886);
  x_889 = lean_array_push(x_636, x_888);
  x_890 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_890, 0, x_863);
  lean_ctor_set(x_890, 1, x_879);
  lean_ctor_set(x_890, 2, x_889);
  x_891 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_892 = lean_array_push(x_891, x_853);
  lean_inc(x_892);
  x_893 = lean_array_push(x_892, x_890);
  lean_inc(x_842);
  x_894 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_894, 0, x_863);
  lean_ctor_set(x_894, 1, x_842);
  lean_ctor_set(x_894, 2, x_893);
  x_895 = lean_array_push(x_636, x_894);
  x_896 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_896, 0, x_863);
  lean_ctor_set(x_896, 1, x_879);
  lean_ctor_set(x_896, 2, x_895);
  x_897 = lean_array_push(x_891, x_868);
  x_898 = lean_array_push(x_897, x_896);
  x_899 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_899, 0, x_863);
  lean_ctor_set(x_899, 1, x_866);
  lean_ctor_set(x_899, 2, x_898);
  x_900 = lean_array_push(x_636, x_899);
  x_901 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_901, 0, x_863);
  lean_ctor_set(x_901, 1, x_879);
  lean_ctor_set(x_901, 2, x_900);
  x_902 = lean_array_push(x_891, x_864);
  x_903 = lean_array_push(x_902, x_901);
  x_904 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_904, 0, x_863);
  lean_ctor_set(x_904, 1, x_879);
  lean_ctor_set(x_904, 2, x_903);
  x_905 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__4;
  x_906 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_906, 0, x_828);
  lean_ctor_set(x_906, 1, x_905);
  x_907 = lean_array_push(x_883, x_859);
  x_908 = lean_array_push(x_907, x_904);
  x_909 = lean_array_push(x_908, x_906);
  x_910 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_910, 0, x_863);
  lean_ctor_set(x_910, 1, x_857);
  lean_ctor_set(x_910, 2, x_909);
  x_911 = lean_array_push(x_636, x_910);
  x_912 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_912, 0, x_863);
  lean_ctor_set(x_912, 1, x_879);
  lean_ctor_set(x_912, 2, x_911);
  x_913 = lean_array_push(x_884, x_912);
  x_914 = lean_array_push(x_913, x_882);
  x_915 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_915, 0, x_863);
  lean_ctor_set(x_915, 1, x_887);
  lean_ctor_set(x_915, 2, x_914);
  x_916 = lean_array_push(x_636, x_915);
  x_917 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_917, 0, x_863);
  lean_ctor_set(x_917, 1, x_879);
  lean_ctor_set(x_917, 2, x_916);
  x_918 = lean_array_push(x_892, x_917);
  x_919 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_919, 0, x_863);
  lean_ctor_set(x_919, 1, x_842);
  lean_ctor_set(x_919, 2, x_918);
  if (lean_is_scalar(x_836)) {
   x_920 = lean_alloc_ctor(0, 2, 0);
  } else {
   x_920 = x_836;
  }
  lean_ctor_set(x_920, 0, x_919);
  lean_ctor_set(x_920, 1, x_835);
  return x_920;
  }
  }
  }
  }
  else
  {
  lean_object* x_921; lean_object* x_922; lean_object* x_923; lean_object* x_924; lean_object* x_925; lean_object* x_926; lean_object* x_927; uint8_t x_928; 
  lean_dec(x_15);
  lean_dec(x_6);
  lean_dec(x_2);
  lean_dec(x_1);
  lean_inc(x_12);
  x_921 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_12, x_13, x_14);
  x_922 = lean_ctor_get(x_921, 0);
  lean_inc(x_922);
  x_923 = lean_ctor_get(x_921, 1);
  lean_inc(x_923);
  lean_dec(x_921);
  x_924 = l_Lean_Elab_Term_getCurrMacroScope(x_8, x_9, x_10, x_11, x_12, x_13, x_923);
  lean_dec(x_12);
  lean_dec(x_11);
  lean_dec(x_10);
  lean_dec(x_9);
  lean_dec(x_8);
  x_925 = lean_ctor_get(x_924, 0);
  lean_inc(x_925);
  x_926 = lean_ctor_get(x_924, 1);
  lean_inc(x_926);
  lean_dec(x_924);
  x_927 = l_Lean_Elab_Term_getMainModule___rarg(x_13, x_926);
  lean_dec(x_13);
  x_928 = !lean_is_exclusive(x_927);
  if (x_928 == 0)
  {
  lean_object* x_929; lean_object* x_930; lean_object* x_931; lean_object* x_932; lean_object* x_933; lean_object* x_934; lean_object* x_935; lean_object* x_936; lean_object* x_937; lean_object* x_938; lean_object* x_939; lean_object* x_940; lean_object* x_941; lean_object* x_942; lean_object* x_943; lean_object* x_944; lean_object* x_945; lean_object* x_946; lean_object* x_947; lean_object* x_948; lean_object* x_949; lean_object* x_950; lean_object* x_951; lean_object* x_952; lean_object* x_953; lean_object* x_954; lean_object* x_955; lean_object* x_956; lean_object* x_957; 
  x_929 = lean_ctor_get(x_927, 0);
  x_930 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3;
  x_931 = lean_name_mk_string(x_3, x_930);
  x_932 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5;
  x_933 = lean_name_mk_string(x_931, x_932);
  x_934 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3;
  x_935 = lean_name_mk_string(x_933, x_934);
  x_936 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__4;
  x_937 = l_Lean_addMacroScope(x_929, x_936, x_925);
  x_938 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__1;
  x_939 = lean_name_mk_string(x_4, x_938);
  x_940 = lean_box(0);
  x_941 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_941, 0, x_939);
  lean_ctor_set(x_941, 1, x_940);
  x_942 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_942, 0, x_941);
  lean_ctor_set(x_942, 1, x_940);
  x_943 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__3;
  x_944 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_944, 0, x_922);
  lean_ctor_set(x_944, 1, x_943);
  lean_ctor_set(x_944, 2, x_937);
  lean_ctor_set(x_944, 3, x_942);
  x_945 = lean_ctor_get(x_5, 0);
  lean_inc(x_945);
  lean_dec(x_5);
  x_946 = lean_ctor_get(x_945, 0);
  lean_inc(x_946);
  lean_dec(x_945);
  x_947 = l_Lean_Name_getString_x21(x_946);
  x_948 = lean_box(2);
  x_949 = l_Lean_Syntax_mkStrLit(x_947, x_948);
  lean_dec(x_947);
  x_950 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_951 = lean_array_push(x_950, x_949);
  x_952 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_953 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_953, 0, x_948);
  lean_ctor_set(x_953, 1, x_952);
  lean_ctor_set(x_953, 2, x_951);
  x_954 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_955 = lean_array_push(x_954, x_944);
  x_956 = lean_array_push(x_955, x_953);
  x_957 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_957, 0, x_948);
  lean_ctor_set(x_957, 1, x_935);
  lean_ctor_set(x_957, 2, x_956);
  lean_ctor_set(x_927, 0, x_957);
  return x_927;
  }
  else
  {
  lean_object* x_958; lean_object* x_959; lean_object* x_960; lean_object* x_961; lean_object* x_962; lean_object* x_963; lean_object* x_964; lean_object* x_965; lean_object* x_966; lean_object* x_967; lean_object* x_968; lean_object* x_969; lean_object* x_970; lean_object* x_971; lean_object* x_972; lean_object* x_973; lean_object* x_974; lean_object* x_975; lean_object* x_976; lean_object* x_977; lean_object* x_978; lean_object* x_979; lean_object* x_980; lean_object* x_981; lean_object* x_982; lean_object* x_983; lean_object* x_984; lean_object* x_985; lean_object* x_986; lean_object* x_987; lean_object* x_988; 
  x_958 = lean_ctor_get(x_927, 0);
  x_959 = lean_ctor_get(x_927, 1);
  lean_inc(x_959);
  lean_inc(x_958);
  lean_dec(x_927);
  x_960 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3;
  x_961 = lean_name_mk_string(x_3, x_960);
  x_962 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5;
  x_963 = lean_name_mk_string(x_961, x_962);
  x_964 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3;
  x_965 = lean_name_mk_string(x_963, x_964);
  x_966 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__4;
  x_967 = l_Lean_addMacroScope(x_958, x_966, x_925);
  x_968 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__1;
  x_969 = lean_name_mk_string(x_4, x_968);
  x_970 = lean_box(0);
  x_971 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_971, 0, x_969);
  lean_ctor_set(x_971, 1, x_970);
  x_972 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_972, 0, x_971);
  lean_ctor_set(x_972, 1, x_970);
  x_973 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__3;
  x_974 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_974, 0, x_922);
  lean_ctor_set(x_974, 1, x_973);
  lean_ctor_set(x_974, 2, x_967);
  lean_ctor_set(x_974, 3, x_972);
  x_975 = lean_ctor_get(x_5, 0);
  lean_inc(x_975);
  lean_dec(x_5);
  x_976 = lean_ctor_get(x_975, 0);
  lean_inc(x_976);
  lean_dec(x_975);
  x_977 = l_Lean_Name_getString_x21(x_976);
  x_978 = lean_box(2);
  x_979 = l_Lean_Syntax_mkStrLit(x_977, x_978);
  lean_dec(x_977);
  x_980 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_981 = lean_array_push(x_980, x_979);
  x_982 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_983 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_983, 0, x_978);
  lean_ctor_set(x_983, 1, x_982);
  lean_ctor_set(x_983, 2, x_981);
  x_984 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_985 = lean_array_push(x_984, x_974);
  x_986 = lean_array_push(x_985, x_983);
  x_987 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_987, 0, x_978);
  lean_ctor_set(x_987, 1, x_965);
  lean_ctor_set(x_987, 2, x_986);
  x_988 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_988, 0, x_987);
  lean_ctor_set(x_988, 1, x_959);
  return x_988;
  }
  }
  }
  }
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13) {
  _start:
  {
  uint8_t x_14; lean_object* x_15; 
  x_14 = 1;
  x_15 = l_Lean_Elab_Deriving_mkInstanceCmds(x_1, x_2, x_3, x_14, x_7, x_8, x_9, x_10, x_11, x_12, x_13);
  if (lean_obj_tag(x_15) == 0)
  {
  uint8_t x_16; 
  x_16 = !lean_is_exclusive(x_15);
  if (x_16 == 0)
  {
  lean_object* x_17; lean_object* x_18; lean_object* x_19; 
  x_17 = lean_ctor_get(x_15, 0);
  x_18 = lean_array_push(x_4, x_5);
  x_19 = l_Array_append___rarg(x_18, x_17);
  lean_ctor_set(x_15, 0, x_19);
  return x_15;
  }
  else
  {
  lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; 
  x_20 = lean_ctor_get(x_15, 0);
  x_21 = lean_ctor_get(x_15, 1);
  lean_inc(x_21);
  lean_inc(x_20);
  lean_dec(x_15);
  x_22 = lean_array_push(x_4, x_5);
  x_23 = l_Array_append___rarg(x_22, x_20);
  x_24 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_24, 0, x_23);
  lean_ctor_set(x_24, 1, x_21);
  return x_24;
  }
  }
  else
  {
  uint8_t x_25; 
  lean_dec(x_5);
  lean_dec(x_4);
  x_25 = !lean_is_exclusive(x_15);
  if (x_25 == 0)
  {
  return x_15;
  }
  else
  {
  lean_object* x_26; lean_object* x_27; lean_object* x_28; 
  x_26 = lean_ctor_get(x_15, 0);
  x_27 = lean_ctor_get(x_15, 1);
  lean_inc(x_27);
  lean_inc(x_26);
  lean_dec(x_15);
  x_28 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_28, 0, x_26);
  lean_ctor_set(x_28, 1, x_27);
  return x_28;
  }
  }
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__1() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("ToJson");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__2() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__2;
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__1;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__3() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("match");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__4() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6;
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__3;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__5() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; 
  x_1 = lean_box(2);
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_3 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__1;
  x_4 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_4, 0, x_1);
  lean_ctor_set(x_4, 1, x_2);
  lean_ctor_set(x_4, 2, x_3);
  return x_4;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__6() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("with");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__7() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("matchAlts");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__8() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6;
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__7;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__9() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = lean_unsigned_to_nat(6u);
  x_2 = lean_mk_empty_array_with_capacity(x_1);
  return x_2;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__10() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("Command");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__11() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__4;
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__10;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__12() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("declaration");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__13() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__11;
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__12;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__14() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("declModifiers");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__15() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__11;
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__14;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__16() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("private");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__17() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__11;
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__16;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__18() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__9;
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__5;
  x_3 = lean_array_push(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__19() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__18;
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__5;
  x_3 = lean_array_push(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__20() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("def");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__21() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__11;
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__20;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__22() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("declId");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__23() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__11;
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__22;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__24() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("optDeclSig");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__25() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__11;
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__24;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__26() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("declValSimple");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__27() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__11;
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__26;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__28() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string(":=");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__29() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = lean_unsigned_to_nat(7u);
  x_2 = lean_mk_empty_array_with_capacity(x_1);
  return x_2;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__30() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("partial");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__31() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__11;
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__30;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10) {
  _start:
  {
  lean_object* x_11; lean_object* x_12; 
  x_11 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__1;
  lean_inc(x_9);
  lean_inc(x_8);
  lean_inc(x_7);
  lean_inc(x_6);
  lean_inc(x_5);
  lean_inc(x_4);
  x_12 = l_Lean_Elab_Deriving_mkContext(x_11, x_1, x_4, x_5, x_6, x_7, x_8, x_9, x_10);
  if (lean_obj_tag(x_12) == 0)
  {
  lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; 
  x_13 = lean_ctor_get(x_12, 0);
  lean_inc(x_13);
  x_14 = lean_ctor_get(x_12, 1);
  lean_inc(x_14);
  lean_dec(x_12);
  x_15 = lean_ctor_get(x_13, 1);
  lean_inc(x_15);
  x_16 = l_Lean_instInhabitedName;
  x_17 = lean_unsigned_to_nat(0u);
  x_18 = lean_array_get(x_16, x_15, x_17);
  lean_dec(x_15);
  x_19 = lean_mk_syntax_ident(x_18);
  x_20 = lean_ctor_get(x_13, 0);
  lean_inc(x_20);
  x_21 = l_Lean_instInhabitedInductiveVal;
  x_22 = lean_array_get(x_21, x_20, x_17);
  lean_dec(x_20);
  x_23 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__2;
  x_24 = lean_unsigned_to_nat(1u);
  lean_inc(x_9);
  lean_inc(x_8);
  lean_inc(x_7);
  lean_inc(x_6);
  lean_inc(x_5);
  lean_inc(x_4);
  x_25 = l_Lean_Elab_Deriving_mkHeader___rarg(x_23, x_24, x_22, x_4, x_5, x_6, x_7, x_8, x_9, x_14);
  if (lean_obj_tag(x_25) == 0)
  {
  lean_object* x_26; lean_object* x_27; lean_object* x_28; 
  x_26 = lean_ctor_get(x_25, 0);
  lean_inc(x_26);
  x_27 = lean_ctor_get(x_25, 1);
  lean_inc(x_27);
  lean_dec(x_25);
  lean_inc(x_9);
  lean_inc(x_8);
  lean_inc(x_7);
  lean_inc(x_6);
  lean_inc(x_5);
  lean_inc(x_4);
  lean_inc(x_2);
  lean_inc(x_26);
  x_28 = l_Lean_Elab_Deriving_mkDiscrs(x_26, x_2, x_4, x_5, x_6, x_7, x_8, x_9, x_27);
  if (lean_obj_tag(x_28) == 0)
  {
  lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; 
  x_29 = lean_ctor_get(x_28, 0);
  lean_inc(x_29);
  x_30 = lean_ctor_get(x_28, 1);
  lean_inc(x_30);
  lean_dec(x_28);
  x_31 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__2;
  lean_inc(x_19);
  lean_inc(x_2);
  x_32 = lean_alloc_closure((void*)(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___boxed), 14, 4);
  lean_closure_set(x_32, 0, x_2);
  lean_closure_set(x_32, 1, x_19);
  lean_closure_set(x_32, 2, x_31);
  lean_closure_set(x_32, 3, x_23);
  lean_inc(x_9);
  lean_inc(x_8);
  lean_inc(x_7);
  lean_inc(x_6);
  lean_inc(x_5);
  lean_inc(x_4);
  x_33 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts(x_2, x_32, x_4, x_5, x_6, x_7, x_8, x_9, x_30);
  if (lean_obj_tag(x_33) == 0)
  {
  lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44; lean_object* x_45; size_t x_46; size_t x_47; lean_object* x_48; lean_object* x_49; lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; 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; lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; uint8_t x_76; 
  x_34 = lean_ctor_get(x_33, 0);
  lean_inc(x_34);
  x_35 = lean_ctor_get(x_33, 1);
  lean_inc(x_35);
  lean_dec(x_33);
  lean_inc(x_8);
  x_36 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_8, x_9, x_35);
  x_37 = lean_ctor_get(x_36, 0);
  lean_inc(x_37);
  x_38 = lean_ctor_get(x_36, 1);
  lean_inc(x_38);
  lean_dec(x_36);
  x_39 = l_Lean_Elab_Term_getCurrMacroScope(x_4, x_5, x_6, x_7, x_8, x_9, x_38);
  x_40 = lean_ctor_get(x_39, 1);
  lean_inc(x_40);
  lean_dec(x_39);
  x_41 = l_Lean_Elab_Term_getMainModule___rarg(x_9, x_40);
  x_42 = lean_ctor_get(x_41, 1);
  lean_inc(x_42);
  lean_dec(x_41);
  x_43 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__3;
  lean_inc(x_37);
  x_44 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_44, 0, x_37);
  lean_ctor_set(x_44, 1, x_43);
  x_45 = lean_array_get_size(x_29);
  x_46 = lean_usize_of_nat(x_45);
  lean_dec(x_45);
  x_47 = 0;
  x_48 = x_29;
  x_49 = l_Array_mapMUnsafe_map___at___aux__Init__NotationExtra______macroRules___xabterm_x25_x5b___x7c___x5d_xbb__1___spec__3(x_46, x_47, x_48);
  x_50 = x_49;
  x_51 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__15;
  x_52 = l_Lean_mkSepArray(x_50, x_51);
  lean_dec(x_50);
  x_53 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__1;
  x_54 = l_Array_append___rarg(x_53, x_52);
  x_55 = lean_box(2);
  x_56 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_57 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_57, 0, x_55);
  lean_ctor_set(x_57, 1, x_56);
  lean_ctor_set(x_57, 2, x_54);
  x_58 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__6;
  x_59 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_59, 0, x_37);
  lean_ctor_set(x_59, 1, x_58);
  x_60 = l_Array_append___rarg(x_53, x_34);
  x_61 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_61, 0, x_55);
  lean_ctor_set(x_61, 1, x_56);
  lean_ctor_set(x_61, 2, x_60);
  x_62 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_63 = lean_array_push(x_62, x_61);
  x_64 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__8;
  x_65 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_65, 0, x_55);
  lean_ctor_set(x_65, 1, x_64);
  lean_ctor_set(x_65, 2, x_63);
  x_66 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__9;
  x_67 = lean_array_push(x_66, x_44);
  x_68 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__5;
  x_69 = lean_array_push(x_67, x_68);
  x_70 = lean_array_push(x_69, x_57);
  x_71 = lean_array_push(x_70, x_68);
  x_72 = lean_array_push(x_71, x_59);
  x_73 = lean_array_push(x_72, x_65);
  x_74 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__4;
  x_75 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_75, 0, x_55);
  lean_ctor_set(x_75, 1, x_74);
  lean_ctor_set(x_75, 2, x_73);
  x_76 = lean_ctor_get_uint8(x_13, sizeof(void*)*2);
  if (x_76 == 0)
  {
  lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_object* x_94; lean_object* x_95; lean_object* x_96; lean_object* x_97; lean_object* x_98; lean_object* x_99; lean_object* x_100; lean_object* x_101; lean_object* x_102; lean_object* x_103; lean_object* x_104; lean_object* x_105; lean_object* x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; lean_object* x_110; lean_object* x_111; lean_object* x_112; lean_object* x_113; lean_object* x_114; lean_object* x_115; lean_object* x_116; lean_object* x_117; lean_object* x_118; lean_object* x_119; lean_object* x_120; lean_object* x_121; lean_object* x_122; lean_object* x_123; lean_object* x_124; lean_object* x_125; lean_object* x_126; lean_object* x_127; lean_object* x_128; lean_object* x_129; lean_object* x_130; lean_object* x_131; lean_object* x_132; lean_object* x_133; lean_object* x_134; lean_object* x_135; 
  lean_inc(x_8);
  x_77 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_8, x_9, x_42);
  x_78 = lean_ctor_get(x_77, 0);
  lean_inc(x_78);
  x_79 = lean_ctor_get(x_77, 1);
  lean_inc(x_79);
  lean_dec(x_77);
  x_80 = l_Lean_Elab_Term_getCurrMacroScope(x_4, x_5, x_6, x_7, x_8, x_9, x_79);
  x_81 = lean_ctor_get(x_80, 1);
  lean_inc(x_81);
  lean_dec(x_80);
  x_82 = l_Lean_Elab_Term_getMainModule___rarg(x_9, x_81);
  x_83 = lean_ctor_get(x_82, 1);
  lean_inc(x_83);
  lean_dec(x_82);
  x_84 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__16;
  lean_inc(x_78);
  x_85 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_85, 0, x_78);
  lean_ctor_set(x_85, 1, x_84);
  x_86 = lean_array_push(x_62, x_85);
  x_87 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__17;
  x_88 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_88, 0, x_55);
  lean_ctor_set(x_88, 1, x_87);
  lean_ctor_set(x_88, 2, x_86);
  x_89 = lean_array_push(x_62, x_88);
  x_90 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_90, 0, x_55);
  lean_ctor_set(x_90, 1, x_56);
  lean_ctor_set(x_90, 2, x_89);
  x_91 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__19;
  x_92 = lean_array_push(x_91, x_90);
  x_93 = lean_array_push(x_92, x_68);
  x_94 = lean_array_push(x_93, x_68);
  x_95 = lean_array_push(x_94, x_68);
  x_96 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__15;
  x_97 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_97, 0, x_55);
  lean_ctor_set(x_97, 1, x_96);
  lean_ctor_set(x_97, 2, x_95);
  x_98 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__20;
  lean_inc(x_78);
  x_99 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_99, 0, x_78);
  lean_ctor_set(x_99, 1, x_98);
  x_100 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_101 = lean_array_push(x_100, x_19);
  x_102 = lean_array_push(x_101, x_68);
  x_103 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__23;
  x_104 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_104, 0, x_55);
  lean_ctor_set(x_104, 1, x_103);
  lean_ctor_set(x_104, 2, x_102);
  x_105 = lean_ctor_get(x_26, 0);
  lean_inc(x_105);
  lean_dec(x_26);
  x_106 = l_Array_append___rarg(x_53, x_105);
  x_107 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_107, 0, x_55);
  lean_ctor_set(x_107, 1, x_56);
  lean_ctor_set(x_107, 2, x_106);
  x_108 = lean_array_push(x_100, x_107);
  x_109 = lean_array_push(x_108, x_68);
  x_110 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__25;
  x_111 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_111, 0, x_55);
  lean_ctor_set(x_111, 1, x_110);
  lean_ctor_set(x_111, 2, x_109);
  x_112 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__28;
  x_113 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_113, 0, x_78);
  lean_ctor_set(x_113, 1, x_112);
  x_114 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5;
  x_115 = lean_array_push(x_114, x_113);
  x_116 = lean_array_push(x_115, x_75);
  x_117 = lean_array_push(x_116, x_68);
  x_118 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__27;
  x_119 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_119, 0, x_55);
  lean_ctor_set(x_119, 1, x_118);
  lean_ctor_set(x_119, 2, x_117);
  x_120 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__29;
  x_121 = lean_array_push(x_120, x_99);
  x_122 = lean_array_push(x_121, x_104);
  x_123 = lean_array_push(x_122, x_111);
  x_124 = lean_array_push(x_123, x_119);
  x_125 = lean_array_push(x_124, x_68);
  x_126 = lean_array_push(x_125, x_68);
  x_127 = lean_array_push(x_126, x_68);
  x_128 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__21;
  x_129 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_129, 0, x_55);
  lean_ctor_set(x_129, 1, x_128);
  lean_ctor_set(x_129, 2, x_127);
  x_130 = lean_array_push(x_100, x_97);
  x_131 = lean_array_push(x_130, x_129);
  x_132 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__13;
  x_133 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_133, 0, x_55);
  lean_ctor_set(x_133, 1, x_132);
  lean_ctor_set(x_133, 2, x_131);
  x_134 = lean_box(0);
  x_135 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__2(x_13, x_23, x_3, x_62, x_133, x_134, x_4, x_5, x_6, x_7, x_8, x_9, x_83);
  lean_dec(x_13);
  return x_135;
  }
  else
  {
  lean_object* x_136; lean_object* x_137; 
  x_136 = lean_ctor_get(x_26, 1);
  lean_inc(x_136);
  lean_inc(x_9);
  lean_inc(x_8);
  lean_inc(x_7);
  lean_inc(x_6);
  lean_inc(x_5);
  lean_inc(x_4);
  x_137 = l_Lean_Elab_Deriving_mkLocalInstanceLetDecls(x_13, x_23, x_136, x_4, x_5, x_6, x_7, x_8, x_9, x_42);
  if (lean_obj_tag(x_137) == 0)
  {
  lean_object* x_138; lean_object* x_139; lean_object* x_140; 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; lean_object* x_148; lean_object* x_149; lean_object* x_150; lean_object* x_151; lean_object* x_152; lean_object* x_153; lean_object* x_154; lean_object* x_155; lean_object* x_156; lean_object* x_157; lean_object* x_158; lean_object* x_159; lean_object* x_160; lean_object* x_161; lean_object* x_162; lean_object* x_163; lean_object* x_164; lean_object* x_165; lean_object* x_166; lean_object* x_167; lean_object* x_168; lean_object* x_169; lean_object* x_170; lean_object* x_171; 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; lean_object* 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_190; lean_object* x_191; lean_object* x_192; lean_object* x_193; lean_object* x_194; lean_object* x_195; lean_object* x_196; 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; lean_object* x_204; lean_object* x_205; lean_object* x_206; lean_object* x_207; lean_object* x_208; 
  x_138 = lean_ctor_get(x_137, 0);
  lean_inc(x_138);
  x_139 = lean_ctor_get(x_137, 1);
  lean_inc(x_139);
  lean_dec(x_137);
  lean_inc(x_9);
  lean_inc(x_8);
  lean_inc(x_7);
  lean_inc(x_6);
  lean_inc(x_5);
  lean_inc(x_4);
  x_140 = l_Lean_Elab_Deriving_mkLet(x_138, x_75, x_4, x_5, x_6, x_7, x_8, x_9, x_139);
  lean_dec(x_138);
  x_141 = lean_ctor_get(x_140, 0);
  lean_inc(x_141);
  x_142 = lean_ctor_get(x_140, 1);
  lean_inc(x_142);
  lean_dec(x_140);
  lean_inc(x_8);
  x_143 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_8, x_9, x_142);
  x_144 = lean_ctor_get(x_143, 0);
  lean_inc(x_144);
  x_145 = lean_ctor_get(x_143, 1);
  lean_inc(x_145);
  lean_dec(x_143);
  x_146 = l_Lean_Elab_Term_getCurrMacroScope(x_4, x_5, x_6, x_7, x_8, x_9, x_145);
  x_147 = lean_ctor_get(x_146, 1);
  lean_inc(x_147);
  lean_dec(x_146);
  x_148 = l_Lean_Elab_Term_getMainModule___rarg(x_9, x_147);
  x_149 = lean_ctor_get(x_148, 1);
  lean_inc(x_149);
  lean_dec(x_148);
  x_150 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__16;
  lean_inc(x_144);
  x_151 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_151, 0, x_144);
  lean_ctor_set(x_151, 1, x_150);
  x_152 = lean_array_push(x_62, x_151);
  x_153 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__17;
  x_154 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_154, 0, x_55);
  lean_ctor_set(x_154, 1, x_153);
  lean_ctor_set(x_154, 2, x_152);
  x_155 = lean_array_push(x_62, x_154);
  x_156 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_156, 0, x_55);
  lean_ctor_set(x_156, 1, x_56);
  lean_ctor_set(x_156, 2, x_155);
  x_157 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__30;
  lean_inc(x_144);
  x_158 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_158, 0, x_144);
  lean_ctor_set(x_158, 1, x_157);
  x_159 = lean_array_push(x_62, x_158);
  x_160 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__31;
  x_161 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_161, 0, x_55);
  lean_ctor_set(x_161, 1, x_160);
  lean_ctor_set(x_161, 2, x_159);
  x_162 = lean_array_push(x_62, x_161);
  x_163 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_163, 0, x_55);
  lean_ctor_set(x_163, 1, x_56);
  lean_ctor_set(x_163, 2, x_162);
  x_164 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__19;
  x_165 = lean_array_push(x_164, x_156);
  x_166 = lean_array_push(x_165, x_68);
  x_167 = lean_array_push(x_166, x_68);
  x_168 = lean_array_push(x_167, x_163);
  x_169 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__15;
  x_170 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_170, 0, x_55);
  lean_ctor_set(x_170, 1, x_169);
  lean_ctor_set(x_170, 2, x_168);
  x_171 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__20;
  lean_inc(x_144);
  x_172 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_172, 0, x_144);
  lean_ctor_set(x_172, 1, x_171);
  x_173 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_174 = lean_array_push(x_173, x_19);
  x_175 = lean_array_push(x_174, x_68);
  x_176 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__23;
  x_177 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_177, 0, x_55);
  lean_ctor_set(x_177, 1, x_176);
  lean_ctor_set(x_177, 2, x_175);
  x_178 = lean_ctor_get(x_26, 0);
  lean_inc(x_178);
  lean_dec(x_26);
  x_179 = l_Array_append___rarg(x_53, x_178);
  x_180 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_180, 0, x_55);
  lean_ctor_set(x_180, 1, x_56);
  lean_ctor_set(x_180, 2, x_179);
  x_181 = lean_array_push(x_173, x_180);
  x_182 = lean_array_push(x_181, x_68);
  x_183 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__25;
  x_184 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_184, 0, x_55);
  lean_ctor_set(x_184, 1, x_183);
  lean_ctor_set(x_184, 2, x_182);
  x_185 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__28;
  x_186 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_186, 0, x_144);
  lean_ctor_set(x_186, 1, x_185);
  x_187 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5;
  x_188 = lean_array_push(x_187, x_186);
  x_189 = lean_array_push(x_188, x_141);
  x_190 = lean_array_push(x_189, x_68);
  x_191 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__27;
  x_192 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_192, 0, x_55);
  lean_ctor_set(x_192, 1, x_191);
  lean_ctor_set(x_192, 2, x_190);
  x_193 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__29;
  x_194 = lean_array_push(x_193, x_172);
  x_195 = lean_array_push(x_194, x_177);
  x_196 = lean_array_push(x_195, x_184);
  x_197 = lean_array_push(x_196, x_192);
  x_198 = lean_array_push(x_197, x_68);
  x_199 = lean_array_push(x_198, x_68);
  x_200 = lean_array_push(x_199, x_68);
  x_201 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__21;
  x_202 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_202, 0, x_55);
  lean_ctor_set(x_202, 1, x_201);
  lean_ctor_set(x_202, 2, x_200);
  x_203 = lean_array_push(x_173, x_170);
  x_204 = lean_array_push(x_203, x_202);
  x_205 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__13;
  x_206 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_206, 0, x_55);
  lean_ctor_set(x_206, 1, x_205);
  lean_ctor_set(x_206, 2, x_204);
  x_207 = lean_box(0);
  x_208 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__2(x_13, x_23, x_3, x_62, x_206, x_207, x_4, x_5, x_6, x_7, x_8, x_9, x_149);
  lean_dec(x_13);
  return x_208;
  }
  else
  {
  uint8_t x_209; 
  lean_dec(x_75);
  lean_dec(x_26);
  lean_dec(x_19);
  lean_dec(x_13);
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_5);
  lean_dec(x_4);
  x_209 = !lean_is_exclusive(x_137);
  if (x_209 == 0)
  {
  return x_137;
  }
  else
  {
  lean_object* x_210; lean_object* x_211; lean_object* x_212; 
  x_210 = lean_ctor_get(x_137, 0);
  x_211 = lean_ctor_get(x_137, 1);
  lean_inc(x_211);
  lean_inc(x_210);
  lean_dec(x_137);
  x_212 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_212, 0, x_210);
  lean_ctor_set(x_212, 1, x_211);
  return x_212;
  }
  }
  }
  }
  else
  {
  uint8_t x_213; 
  lean_dec(x_29);
  lean_dec(x_26);
  lean_dec(x_19);
  lean_dec(x_13);
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_5);
  lean_dec(x_4);
  x_213 = !lean_is_exclusive(x_33);
  if (x_213 == 0)
  {
  return x_33;
  }
  else
  {
  lean_object* x_214; lean_object* x_215; lean_object* x_216; 
  x_214 = lean_ctor_get(x_33, 0);
  x_215 = lean_ctor_get(x_33, 1);
  lean_inc(x_215);
  lean_inc(x_214);
  lean_dec(x_33);
  x_216 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_216, 0, x_214);
  lean_ctor_set(x_216, 1, x_215);
  return x_216;
  }
  }
  }
  else
  {
  uint8_t x_217; 
  lean_dec(x_26);
  lean_dec(x_19);
  lean_dec(x_13);
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_5);
  lean_dec(x_4);
  lean_dec(x_2);
  x_217 = !lean_is_exclusive(x_28);
  if (x_217 == 0)
  {
  return x_28;
  }
  else
  {
  lean_object* x_218; lean_object* x_219; lean_object* x_220; 
  x_218 = lean_ctor_get(x_28, 0);
  x_219 = lean_ctor_get(x_28, 1);
  lean_inc(x_219);
  lean_inc(x_218);
  lean_dec(x_28);
  x_220 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_220, 0, x_218);
  lean_ctor_set(x_220, 1, x_219);
  return x_220;
  }
  }
  }
  else
  {
  uint8_t x_221; 
  lean_dec(x_19);
  lean_dec(x_13);
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_5);
  lean_dec(x_4);
  lean_dec(x_2);
  x_221 = !lean_is_exclusive(x_25);
  if (x_221 == 0)
  {
  return x_25;
  }
  else
  {
  lean_object* x_222; lean_object* x_223; lean_object* x_224; 
  x_222 = lean_ctor_get(x_25, 0);
  x_223 = lean_ctor_get(x_25, 1);
  lean_inc(x_223);
  lean_inc(x_222);
  lean_dec(x_25);
  x_224 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_224, 0, x_222);
  lean_ctor_set(x_224, 1, x_223);
  return x_224;
  }
  }
  }
  else
  {
  uint8_t x_225; 
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_5);
  lean_dec(x_4);
  lean_dec(x_2);
  x_225 = !lean_is_exclusive(x_12);
  if (x_225 == 0)
  {
  return x_12;
  }
  else
  {
  lean_object* x_226; lean_object* x_227; lean_object* x_228; 
  x_226 = lean_ctor_get(x_12, 0);
  x_227 = lean_ctor_get(x_12, 1);
  lean_inc(x_227);
  lean_inc(x_226);
  lean_dec(x_12);
  x_228 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_228, 0, x_226);
  lean_ctor_set(x_228, 1, x_227);
  return x_228;
  }
  }
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__1() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("term_<|_");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__2() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__1;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__3() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__2;
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__9;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__4() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__3;
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__1;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__5() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__4;
  x_3 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_3, 0, x_2);
  lean_ctor_set(x_3, 1, x_1);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__6() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__5;
  x_3 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_3, 0, x_2);
  lean_ctor_set(x_3, 1, x_1);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__7() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("<|");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__8() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("List.join");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__9() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__8;
  x_2 = lean_string_utf8_byte_size(x_1);
  return x_2;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__10() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; 
  x_1 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__8;
  x_2 = lean_unsigned_to_nat(0u);
  x_3 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__9;
  x_4 = lean_alloc_ctor(0, 3, 0);
  lean_ctor_set(x_4, 0, x_1);
  lean_ctor_set(x_4, 1, x_2);
  lean_ctor_set(x_4, 2, x_3);
  return x_4;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__11() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("List");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__12() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__11;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__13() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("join");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__14() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__12;
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__13;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__15() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__14;
  x_3 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_3, 0, x_2);
  lean_ctor_set(x_3, 1, x_1);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__16() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__15;
  x_3 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_3, 0, x_2);
  lean_ctor_set(x_3, 1, x_1);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___boxed__const__1() {
  _start:
  {
  size_t x_1; lean_object* x_2; 
  x_1 = 0;
  x_2 = lean_box_usize(x_1);
  return x_2;
  }
  }
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9) {
  _start:
  {
  lean_object* x_10; lean_object* x_11; 
  x_10 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__1;
  lean_inc(x_8);
  lean_inc(x_7);
  lean_inc(x_6);
  lean_inc(x_5);
  lean_inc(x_4);
  lean_inc(x_3);
  lean_inc(x_1);
  x_11 = l_Lean_Elab_Deriving_mkContext(x_10, x_1, x_3, x_4, x_5, x_6, x_7, x_8, x_9);
  if (lean_obj_tag(x_11) == 0)
  {
  lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; 
  x_12 = lean_ctor_get(x_11, 0);
  lean_inc(x_12);
  x_13 = lean_ctor_get(x_11, 1);
  lean_inc(x_13);
  lean_dec(x_11);
  x_14 = lean_ctor_get(x_12, 0);
  lean_inc(x_14);
  x_15 = l_Lean_instInhabitedInductiveVal;
  x_16 = lean_unsigned_to_nat(0u);
  x_17 = lean_array_get(x_15, x_14, x_16);
  lean_dec(x_14);
  x_18 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__2;
  x_19 = lean_unsigned_to_nat(1u);
  lean_inc(x_8);
  lean_inc(x_7);
  lean_inc(x_6);
  lean_inc(x_5);
  lean_inc(x_4);
  lean_inc(x_3);
  x_20 = l_Lean_Elab_Deriving_mkHeader___rarg(x_18, x_19, x_17, x_3, x_4, x_5, x_6, x_7, x_8, x_13);
  if (lean_obj_tag(x_20) == 0)
  {
  lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; uint8_t x_27; lean_object* x_28; lean_object* x_29; size_t x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; 
  x_21 = lean_ctor_get(x_20, 0);
  lean_inc(x_21);
  x_22 = lean_ctor_get(x_20, 1);
  lean_inc(x_22);
  lean_dec(x_20);
  x_23 = lean_st_ref_get(x_8, x_22);
  x_24 = lean_ctor_get(x_23, 0);
  lean_inc(x_24);
  x_25 = lean_ctor_get(x_23, 1);
  lean_inc(x_25);
  lean_dec(x_23);
  x_26 = lean_ctor_get(x_24, 0);
  lean_inc(x_26);
  lean_dec(x_24);
  x_27 = 0;
  x_28 = l_Lean_getStructureFieldsFlattened(x_26, x_1, x_27);
  x_29 = lean_array_get_size(x_28);
  x_30 = lean_usize_of_nat(x_29);
  lean_dec(x_29);
  x_31 = x_28;
  x_32 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__2;
  x_33 = lean_box_usize(x_30);
  x_34 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___boxed__const__1;
  lean_inc(x_21);
  x_35 = lean_alloc_closure((void*)(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___boxed), 13, 6);
  lean_closure_set(x_35, 0, x_32);
  lean_closure_set(x_35, 1, x_18);
  lean_closure_set(x_35, 2, x_21);
  lean_closure_set(x_35, 3, x_33);
  lean_closure_set(x_35, 4, x_34);
  lean_closure_set(x_35, 5, x_31);
  x_36 = x_35;
  lean_inc(x_8);
  lean_inc(x_7);
  lean_inc(x_6);
  lean_inc(x_5);
  lean_inc(x_4);
  lean_inc(x_3);
  x_37 = lean_apply_7(x_36, x_3, x_4, x_5, x_6, x_7, x_8, x_25);
  if (lean_obj_tag(x_37) == 0)
  {
  lean_object* x_38; lean_object* x_39; lean_object* x_40; 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; lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; 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; lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76; lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_object* x_94; lean_object* x_95; lean_object* x_96; lean_object* x_97; lean_object* x_98; lean_object* x_99; lean_object* x_100; lean_object* x_101; lean_object* x_102; lean_object* x_103; lean_object* x_104; lean_object* x_105; lean_object* x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; lean_object* x_110; lean_object* x_111; lean_object* x_112; lean_object* x_113; lean_object* x_114; lean_object* x_115; lean_object* x_116; lean_object* x_117; lean_object* x_118; lean_object* x_119; lean_object* x_120; lean_object* x_121; lean_object* x_122; lean_object* x_123; lean_object* x_124; lean_object* x_125; lean_object* x_126; lean_object* x_127; lean_object* x_128; lean_object* x_129; lean_object* x_130; lean_object* x_131; lean_object* x_132; lean_object* x_133; lean_object* x_134; lean_object* x_135; lean_object* x_136; lean_object* x_137; lean_object* x_138; lean_object* x_139; lean_object* x_140; lean_object* x_141; lean_object* x_142; lean_object* x_143; uint8_t x_144; lean_object* x_145; 
  x_38 = lean_ctor_get(x_37, 0);
  lean_inc(x_38);
  x_39 = lean_ctor_get(x_37, 1);
  lean_inc(x_39);
  lean_dec(x_37);
  lean_inc(x_7);
  x_40 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_7, x_8, x_39);
  x_41 = lean_ctor_get(x_40, 0);
  lean_inc(x_41);
  x_42 = lean_ctor_get(x_40, 1);
  lean_inc(x_42);
  lean_dec(x_40);
  x_43 = l_Lean_Elab_Term_getCurrMacroScope(x_3, x_4, x_5, x_6, x_7, x_8, x_42);
  x_44 = lean_ctor_get(x_43, 0);
  lean_inc(x_44);
  x_45 = lean_ctor_get(x_43, 1);
  lean_inc(x_45);
  lean_dec(x_43);
  x_46 = l_Lean_Elab_Term_getMainModule___rarg(x_8, x_45);
  x_47 = lean_ctor_get(x_46, 0);
  lean_inc(x_47);
  x_48 = lean_ctor_get(x_46, 1);
  lean_inc(x_48);
  lean_dec(x_46);
  x_49 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__16;
  lean_inc(x_41);
  x_50 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_50, 0, x_41);
  lean_ctor_set(x_50, 1, x_49);
  x_51 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_52 = lean_array_push(x_51, x_50);
  x_53 = lean_box(2);
  x_54 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__17;
  x_55 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_55, 0, x_53);
  lean_ctor_set(x_55, 1, x_54);
  lean_ctor_set(x_55, 2, x_52);
  x_56 = lean_array_push(x_51, x_55);
  x_57 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_58 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_58, 0, x_53);
  lean_ctor_set(x_58, 1, x_57);
  lean_ctor_set(x_58, 2, x_56);
  x_59 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__19;
  x_60 = lean_array_push(x_59, x_58);
  x_61 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__5;
  x_62 = lean_array_push(x_60, x_61);
  x_63 = lean_array_push(x_62, x_61);
  x_64 = lean_array_push(x_63, x_61);
  x_65 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__15;
  x_66 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_66, 0, x_53);
  lean_ctor_set(x_66, 1, x_65);
  lean_ctor_set(x_66, 2, x_64);
  x_67 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__20;
  lean_inc(x_41);
  x_68 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_68, 0, x_41);
  lean_ctor_set(x_68, 1, x_67);
  x_69 = lean_ctor_get(x_12, 1);
  lean_inc(x_69);
  x_70 = l_Lean_instInhabitedName;
  x_71 = lean_array_get(x_70, x_69, x_16);
  lean_dec(x_69);
  x_72 = lean_mk_syntax_ident(x_71);
  x_73 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_74 = lean_array_push(x_73, x_72);
  x_75 = lean_array_push(x_74, x_61);
  x_76 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__23;
  x_77 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_77, 0, x_53);
  lean_ctor_set(x_77, 1, x_76);
  lean_ctor_set(x_77, 2, x_75);
  x_78 = lean_ctor_get(x_21, 0);
  lean_inc(x_78);
  lean_dec(x_21);
  x_79 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__1;
  x_80 = l_Array_append___rarg(x_79, x_78);
  x_81 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_81, 0, x_53);
  lean_ctor_set(x_81, 1, x_57);
  lean_ctor_set(x_81, 2, x_80);
  x_82 = lean_array_push(x_73, x_81);
  x_83 = lean_array_push(x_82, x_61);
  x_84 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__25;
  x_85 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_85, 0, x_53);
  lean_ctor_set(x_85, 1, x_84);
  lean_ctor_set(x_85, 2, x_83);
  x_86 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__28;
  lean_inc(x_41);
  x_87 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_87, 0, x_41);
  lean_ctor_set(x_87, 1, x_86);
  x_88 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__4;
  lean_inc(x_44);
  lean_inc(x_47);
  x_89 = l_Lean_addMacroScope(x_47, x_88, x_44);
  x_90 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__3;
  x_91 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__6;
  lean_inc(x_41);
  x_92 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_92, 0, x_41);
  lean_ctor_set(x_92, 1, x_90);
  lean_ctor_set(x_92, 2, x_89);
  lean_ctor_set(x_92, 3, x_91);
  x_93 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__7;
  lean_inc(x_41);
  x_94 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_94, 0, x_41);
  lean_ctor_set(x_94, 1, x_93);
  x_95 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__14;
  x_96 = l_Lean_addMacroScope(x_47, x_95, x_44);
  x_97 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__10;
  x_98 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__16;
  lean_inc(x_41);
  x_99 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_99, 0, x_41);
  lean_ctor_set(x_99, 1, x_97);
  lean_ctor_set(x_99, 2, x_96);
  lean_ctor_set(x_99, 3, x_98);
  x_100 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__3;
  lean_inc(x_41);
  x_101 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_101, 0, x_41);
  lean_ctor_set(x_101, 1, x_100);
  x_102 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__14;
  x_103 = l_Lean_Syntax_SepArray_ofElems(x_102, x_38);
  lean_dec(x_38);
  x_104 = l_Array_append___rarg(x_79, x_103);
  x_105 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_105, 0, x_53);
  lean_ctor_set(x_105, 1, x_57);
  lean_ctor_set(x_105, 2, x_104);
  x_106 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__4;
  x_107 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_107, 0, x_41);
  lean_ctor_set(x_107, 1, x_106);
  x_108 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5;
  x_109 = lean_array_push(x_108, x_101);
  x_110 = lean_array_push(x_109, x_105);
  x_111 = lean_array_push(x_110, x_107);
  x_112 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__2;
  x_113 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_113, 0, x_53);
  lean_ctor_set(x_113, 1, x_112);
  lean_ctor_set(x_113, 2, x_111);
  x_114 = lean_array_push(x_51, x_113);
  x_115 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_115, 0, x_53);
  lean_ctor_set(x_115, 1, x_57);
  lean_ctor_set(x_115, 2, x_114);
  x_116 = lean_array_push(x_73, x_99);
  x_117 = lean_array_push(x_116, x_115);
  x_118 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__4;
  x_119 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_119, 0, x_53);
  lean_ctor_set(x_119, 1, x_118);
  lean_ctor_set(x_119, 2, x_117);
  x_120 = lean_array_push(x_108, x_92);
  x_121 = lean_array_push(x_120, x_94);
  x_122 = lean_array_push(x_121, x_119);
  x_123 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__2;
  x_124 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_124, 0, x_53);
  lean_ctor_set(x_124, 1, x_123);
  lean_ctor_set(x_124, 2, x_122);
  x_125 = lean_array_push(x_108, x_87);
  x_126 = lean_array_push(x_125, x_124);
  x_127 = lean_array_push(x_126, x_61);
  x_128 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__27;
  x_129 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_129, 0, x_53);
  lean_ctor_set(x_129, 1, x_128);
  lean_ctor_set(x_129, 2, x_127);
  x_130 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__29;
  x_131 = lean_array_push(x_130, x_68);
  x_132 = lean_array_push(x_131, x_77);
  x_133 = lean_array_push(x_132, x_85);
  x_134 = lean_array_push(x_133, x_129);
  x_135 = lean_array_push(x_134, x_61);
  x_136 = lean_array_push(x_135, x_61);
  x_137 = lean_array_push(x_136, x_61);
  x_138 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__21;
  x_139 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_139, 0, x_53);
  lean_ctor_set(x_139, 1, x_138);
  lean_ctor_set(x_139, 2, x_137);
  x_140 = lean_array_push(x_73, x_66);
  x_141 = lean_array_push(x_140, x_139);
  x_142 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__13;
  x_143 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_143, 0, x_53);
  lean_ctor_set(x_143, 1, x_142);
  lean_ctor_set(x_143, 2, x_141);
  x_144 = 1;
  x_145 = l_Lean_Elab_Deriving_mkInstanceCmds(x_12, x_18, x_2, x_144, x_3, x_4, x_5, x_6, x_7, x_8, x_48);
  lean_dec(x_12);
  if (lean_obj_tag(x_145) == 0)
  {
  uint8_t x_146; 
  x_146 = !lean_is_exclusive(x_145);
  if (x_146 == 0)
  {
  lean_object* x_147; lean_object* x_148; lean_object* x_149; 
  x_147 = lean_ctor_get(x_145, 0);
  x_148 = lean_array_push(x_51, x_143);
  x_149 = l_Array_append___rarg(x_148, x_147);
  lean_ctor_set(x_145, 0, x_149);
  return x_145;
  }
  else
  {
  lean_object* x_150; lean_object* x_151; lean_object* x_152; lean_object* x_153; lean_object* x_154; 
  x_150 = lean_ctor_get(x_145, 0);
  x_151 = lean_ctor_get(x_145, 1);
  lean_inc(x_151);
  lean_inc(x_150);
  lean_dec(x_145);
  x_152 = lean_array_push(x_51, x_143);
  x_153 = l_Array_append___rarg(x_152, x_150);
  x_154 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_154, 0, x_153);
  lean_ctor_set(x_154, 1, x_151);
  return x_154;
  }
  }
  else
  {
  uint8_t x_155; 
  lean_dec(x_143);
  x_155 = !lean_is_exclusive(x_145);
  if (x_155 == 0)
  {
  return x_145;
  }
  else
  {
  lean_object* x_156; lean_object* x_157; lean_object* x_158; 
  x_156 = lean_ctor_get(x_145, 0);
  x_157 = lean_ctor_get(x_145, 1);
  lean_inc(x_157);
  lean_inc(x_156);
  lean_dec(x_145);
  x_158 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_158, 0, x_156);
  lean_ctor_set(x_158, 1, x_157);
  return x_158;
  }
  }
  }
  else
  {
  uint8_t x_159; 
  lean_dec(x_21);
  lean_dec(x_12);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_5);
  lean_dec(x_4);
  lean_dec(x_3);
  x_159 = !lean_is_exclusive(x_37);
  if (x_159 == 0)
  {
  return x_37;
  }
  else
  {
  lean_object* x_160; lean_object* x_161; lean_object* x_162; 
  x_160 = lean_ctor_get(x_37, 0);
  x_161 = lean_ctor_get(x_37, 1);
  lean_inc(x_161);
  lean_inc(x_160);
  lean_dec(x_37);
  x_162 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_162, 0, x_160);
  lean_ctor_set(x_162, 1, x_161);
  return x_162;
  }
  }
  }
  else
  {
  uint8_t x_163; 
  lean_dec(x_12);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_5);
  lean_dec(x_4);
  lean_dec(x_3);
  lean_dec(x_1);
  x_163 = !lean_is_exclusive(x_20);
  if (x_163 == 0)
  {
  return x_20;
  }
  else
  {
  lean_object* x_164; lean_object* x_165; lean_object* x_166; 
  x_164 = lean_ctor_get(x_20, 0);
  x_165 = lean_ctor_get(x_20, 1);
  lean_inc(x_165);
  lean_inc(x_164);
  lean_dec(x_20);
  x_166 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_166, 0, x_164);
  lean_ctor_set(x_166, 1, x_165);
  return x_166;
  }
  }
  }
  else
  {
  uint8_t x_167; 
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_5);
  lean_dec(x_4);
  lean_dec(x_3);
  lean_dec(x_1);
  x_167 = !lean_is_exclusive(x_11);
  if (x_167 == 0)
  {
  return x_11;
  }
  else
  {
  lean_object* x_168; lean_object* x_169; lean_object* x_170; 
  x_168 = lean_ctor_get(x_11, 0);
  x_169 = lean_ctor_get(x_11, 1);
  lean_inc(x_169);
  lean_inc(x_168);
  lean_dec(x_11);
  x_170 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_170, 0, x_168);
  lean_ctor_set(x_170, 1, x_169);
  return x_170;
  }
  }
  }
  }
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler(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; 
  x_5 = lean_array_get_size(x_1);
  x_6 = lean_unsigned_to_nat(1u);
  x_7 = lean_nat_dec_eq(x_5, x_6);
  lean_dec(x_5);
  if (x_7 == 0)
  {
  uint8_t x_8; lean_object* x_9; lean_object* x_10; 
  lean_dec(x_3);
  lean_dec(x_2);
  lean_dec(x_1);
  x_8 = 0;
  x_9 = lean_box(x_8);
  x_10 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_10, 0, x_9);
  lean_ctor_set(x_10, 1, x_4);
  return x_10;
  }
  else
  {
  lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; uint8_t x_18; 
  x_11 = lean_st_ref_get(x_3, x_4);
  x_12 = lean_ctor_get(x_11, 0);
  lean_inc(x_12);
  x_13 = lean_ctor_get(x_11, 1);
  lean_inc(x_13);
  lean_dec(x_11);
  x_14 = lean_ctor_get(x_12, 0);
  lean_inc(x_14);
  lean_dec(x_12);
  x_15 = l_Lean_instInhabitedName;
  x_16 = lean_unsigned_to_nat(0u);
  x_17 = lean_array_get(x_15, x_1, x_16);
  lean_inc(x_17);
  x_18 = l_Lean_isStructure(x_14, x_17);
  if (x_18 == 0)
  {
  lean_object* x_19; 
  lean_inc(x_2);
  lean_inc(x_17);
  x_19 = l_Lean_getConstInfoInduct___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__1(x_17, x_2, x_3, x_13);
  if (lean_obj_tag(x_19) == 0)
  {
  lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; 
  x_20 = lean_ctor_get(x_19, 0);
  lean_inc(x_20);
  x_21 = lean_ctor_get(x_19, 1);
  lean_inc(x_21);
  lean_dec(x_19);
  x_22 = lean_box(0);
  x_23 = lean_alloc_closure((void*)(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___boxed), 10, 3);
  lean_closure_set(x_23, 0, x_17);
  lean_closure_set(x_23, 1, x_20);
  lean_closure_set(x_23, 2, x_1);
  lean_inc(x_2);
  x_24 = l_Lean_Elab_Command_liftTermElabM___rarg(x_22, x_23, x_2, x_3, x_21);
  if (lean_obj_tag(x_24) == 0)
  {
  uint8_t x_25; 
  x_25 = !lean_is_exclusive(x_24);
  if (x_25 == 0)
  {
  lean_object* x_26; lean_object* x_27; lean_object* x_28; uint8_t x_29; 
  x_26 = lean_ctor_get(x_24, 0);
  x_27 = lean_ctor_get(x_24, 1);
  x_28 = lean_array_get_size(x_26);
  x_29 = lean_nat_dec_lt(x_16, x_28);
  if (x_29 == 0)
  {
  uint8_t x_30; lean_object* x_31; 
  lean_dec(x_28);
  lean_dec(x_26);
  lean_dec(x_3);
  lean_dec(x_2);
  x_30 = 1;
  x_31 = lean_box(x_30);
  lean_ctor_set(x_24, 0, x_31);
  return x_24;
  }
  else
  {
  uint8_t x_32; 
  x_32 = lean_nat_dec_le(x_28, x_28);
  if (x_32 == 0)
  {
  uint8_t x_33; lean_object* x_34; 
  lean_dec(x_28);
  lean_dec(x_26);
  lean_dec(x_3);
  lean_dec(x_2);
  x_33 = 1;
  x_34 = lean_box(x_33);
  lean_ctor_set(x_24, 0, x_34);
  return x_24;
  }
  else
  {
  size_t x_35; size_t x_36; lean_object* x_37; lean_object* x_38; 
  lean_free_object(x_24);
  x_35 = 0;
  x_36 = lean_usize_of_nat(x_28);
  lean_dec(x_28);
  x_37 = lean_box(0);
  x_38 = l_Array_foldlMUnsafe_fold___at_Lean_Elab_Command_elabCommand___spec__10(x_26, x_35, x_36, x_37, x_2, x_3, x_27);
  lean_dec(x_26);
  if (lean_obj_tag(x_38) == 0)
  {
  uint8_t x_39; 
  x_39 = !lean_is_exclusive(x_38);
  if (x_39 == 0)
  {
  lean_object* x_40; uint8_t x_41; lean_object* x_42; 
  x_40 = lean_ctor_get(x_38, 0);
  lean_dec(x_40);
  x_41 = 1;
  x_42 = lean_box(x_41);
  lean_ctor_set(x_38, 0, x_42);
  return x_38;
  }
  else
  {
  lean_object* x_43; uint8_t x_44; lean_object* x_45; lean_object* x_46; 
  x_43 = lean_ctor_get(x_38, 1);
  lean_inc(x_43);
  lean_dec(x_38);
  x_44 = 1;
  x_45 = lean_box(x_44);
  x_46 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_46, 0, x_45);
  lean_ctor_set(x_46, 1, x_43);
  return x_46;
  }
  }
  else
  {
  uint8_t x_47; 
  x_47 = !lean_is_exclusive(x_38);
  if (x_47 == 0)
  {
  return x_38;
  }
  else
  {
  lean_object* x_48; lean_object* x_49; lean_object* x_50; 
  x_48 = lean_ctor_get(x_38, 0);
  x_49 = lean_ctor_get(x_38, 1);
  lean_inc(x_49);
  lean_inc(x_48);
  lean_dec(x_38);
  x_50 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_50, 0, x_48);
  lean_ctor_set(x_50, 1, x_49);
  return x_50;
  }
  }
  }
  }
  }
  else
  {
  lean_object* x_51; lean_object* x_52; lean_object* x_53; uint8_t x_54; 
  x_51 = lean_ctor_get(x_24, 0);
  x_52 = lean_ctor_get(x_24, 1);
  lean_inc(x_52);
  lean_inc(x_51);
  lean_dec(x_24);
  x_53 = lean_array_get_size(x_51);
  x_54 = lean_nat_dec_lt(x_16, x_53);
  if (x_54 == 0)
  {
  uint8_t x_55; lean_object* x_56; lean_object* x_57; 
  lean_dec(x_53);
  lean_dec(x_51);
  lean_dec(x_3);
  lean_dec(x_2);
  x_55 = 1;
  x_56 = lean_box(x_55);
  x_57 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_57, 0, x_56);
  lean_ctor_set(x_57, 1, x_52);
  return x_57;
  }
  else
  {
  uint8_t x_58; 
  x_58 = lean_nat_dec_le(x_53, x_53);
  if (x_58 == 0)
  {
  uint8_t x_59; lean_object* x_60; lean_object* x_61; 
  lean_dec(x_53);
  lean_dec(x_51);
  lean_dec(x_3);
  lean_dec(x_2);
  x_59 = 1;
  x_60 = lean_box(x_59);
  x_61 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_61, 0, x_60);
  lean_ctor_set(x_61, 1, x_52);
  return x_61;
  }
  else
  {
  size_t x_62; size_t x_63; lean_object* x_64; lean_object* x_65; 
  x_62 = 0;
  x_63 = lean_usize_of_nat(x_53);
  lean_dec(x_53);
  x_64 = lean_box(0);
  x_65 = l_Array_foldlMUnsafe_fold___at_Lean_Elab_Command_elabCommand___spec__10(x_51, x_62, x_63, x_64, x_2, x_3, x_52);
  lean_dec(x_51);
  if (lean_obj_tag(x_65) == 0)
  {
  lean_object* x_66; lean_object* x_67; uint8_t x_68; lean_object* x_69; lean_object* x_70; 
  x_66 = lean_ctor_get(x_65, 1);
  lean_inc(x_66);
  if (lean_is_exclusive(x_65)) {
   lean_ctor_release(x_65, 0);
   lean_ctor_release(x_65, 1);
   x_67 = x_65;
  } else {
   lean_dec_ref(x_65);
   x_67 = lean_box(0);
  }
  x_68 = 1;
  x_69 = lean_box(x_68);
  if (lean_is_scalar(x_67)) {
   x_70 = lean_alloc_ctor(0, 2, 0);
  } else {
   x_70 = x_67;
  }
  lean_ctor_set(x_70, 0, x_69);
  lean_ctor_set(x_70, 1, x_66);
  return x_70;
  }
  else
  {
  lean_object* x_71; lean_object* x_72; lean_object* x_73; lean_object* x_74; 
  x_71 = lean_ctor_get(x_65, 0);
  lean_inc(x_71);
  x_72 = lean_ctor_get(x_65, 1);
  lean_inc(x_72);
  if (lean_is_exclusive(x_65)) {
   lean_ctor_release(x_65, 0);
   lean_ctor_release(x_65, 1);
   x_73 = x_65;
  } else {
   lean_dec_ref(x_65);
   x_73 = lean_box(0);
  }
  if (lean_is_scalar(x_73)) {
   x_74 = lean_alloc_ctor(1, 2, 0);
  } else {
   x_74 = x_73;
  }
  lean_ctor_set(x_74, 0, x_71);
  lean_ctor_set(x_74, 1, x_72);
  return x_74;
  }
  }
  }
  }
  }
  else
  {
  uint8_t x_75; 
  lean_dec(x_3);
  lean_dec(x_2);
  x_75 = !lean_is_exclusive(x_24);
  if (x_75 == 0)
  {
  return x_24;
  }
  else
  {
  lean_object* x_76; lean_object* x_77; lean_object* x_78; 
  x_76 = lean_ctor_get(x_24, 0);
  x_77 = lean_ctor_get(x_24, 1);
  lean_inc(x_77);
  lean_inc(x_76);
  lean_dec(x_24);
  x_78 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_78, 0, x_76);
  lean_ctor_set(x_78, 1, x_77);
  return x_78;
  }
  }
  }
  else
  {
  uint8_t x_79; 
  lean_dec(x_17);
  lean_dec(x_3);
  lean_dec(x_2);
  lean_dec(x_1);
  x_79 = !lean_is_exclusive(x_19);
  if (x_79 == 0)
  {
  return x_19;
  }
  else
  {
  lean_object* x_80; lean_object* x_81; lean_object* x_82; 
  x_80 = lean_ctor_get(x_19, 0);
  x_81 = lean_ctor_get(x_19, 1);
  lean_inc(x_81);
  lean_inc(x_80);
  lean_dec(x_19);
  x_82 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_82, 0, x_80);
  lean_ctor_set(x_82, 1, x_81);
  return x_82;
  }
  }
  }
  else
  {
  lean_object* x_83; lean_object* x_84; lean_object* x_85; 
  x_83 = lean_box(0);
  x_84 = lean_alloc_closure((void*)(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___boxed), 9, 2);
  lean_closure_set(x_84, 0, x_17);
  lean_closure_set(x_84, 1, x_1);
  lean_inc(x_2);
  x_85 = l_Lean_Elab_Command_liftTermElabM___rarg(x_83, x_84, x_2, x_3, x_13);
  if (lean_obj_tag(x_85) == 0)
  {
  uint8_t x_86; 
  x_86 = !lean_is_exclusive(x_85);
  if (x_86 == 0)
  {
  lean_object* x_87; lean_object* x_88; lean_object* x_89; uint8_t x_90; 
  x_87 = lean_ctor_get(x_85, 0);
  x_88 = lean_ctor_get(x_85, 1);
  x_89 = lean_array_get_size(x_87);
  x_90 = lean_nat_dec_lt(x_16, x_89);
  if (x_90 == 0)
  {
  uint8_t x_91; lean_object* x_92; 
  lean_dec(x_89);
  lean_dec(x_87);
  lean_dec(x_3);
  lean_dec(x_2);
  x_91 = 1;
  x_92 = lean_box(x_91);
  lean_ctor_set(x_85, 0, x_92);
  return x_85;
  }
  else
  {
  uint8_t x_93; 
  x_93 = lean_nat_dec_le(x_89, x_89);
  if (x_93 == 0)
  {
  uint8_t x_94; lean_object* x_95; 
  lean_dec(x_89);
  lean_dec(x_87);
  lean_dec(x_3);
  lean_dec(x_2);
  x_94 = 1;
  x_95 = lean_box(x_94);
  lean_ctor_set(x_85, 0, x_95);
  return x_85;
  }
  else
  {
  size_t x_96; size_t x_97; lean_object* x_98; lean_object* x_99; 
  lean_free_object(x_85);
  x_96 = 0;
  x_97 = lean_usize_of_nat(x_89);
  lean_dec(x_89);
  x_98 = lean_box(0);
  x_99 = l_Array_foldlMUnsafe_fold___at_Lean_Elab_Command_elabCommand___spec__10(x_87, x_96, x_97, x_98, x_2, x_3, x_88);
  lean_dec(x_87);
  if (lean_obj_tag(x_99) == 0)
  {
  uint8_t x_100; 
  x_100 = !lean_is_exclusive(x_99);
  if (x_100 == 0)
  {
  lean_object* x_101; uint8_t x_102; lean_object* x_103; 
  x_101 = lean_ctor_get(x_99, 0);
  lean_dec(x_101);
  x_102 = 1;
  x_103 = lean_box(x_102);
  lean_ctor_set(x_99, 0, x_103);
  return x_99;
  }
  else
  {
  lean_object* x_104; uint8_t x_105; lean_object* x_106; lean_object* x_107; 
  x_104 = lean_ctor_get(x_99, 1);
  lean_inc(x_104);
  lean_dec(x_99);
  x_105 = 1;
  x_106 = lean_box(x_105);
  x_107 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_107, 0, x_106);
  lean_ctor_set(x_107, 1, x_104);
  return x_107;
  }
  }
  else
  {
  uint8_t x_108; 
  x_108 = !lean_is_exclusive(x_99);
  if (x_108 == 0)
  {
  return x_99;
  }
  else
  {
  lean_object* x_109; lean_object* x_110; lean_object* x_111; 
  x_109 = lean_ctor_get(x_99, 0);
  x_110 = lean_ctor_get(x_99, 1);
  lean_inc(x_110);
  lean_inc(x_109);
  lean_dec(x_99);
  x_111 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_111, 0, x_109);
  lean_ctor_set(x_111, 1, x_110);
  return x_111;
  }
  }
  }
  }
  }
  else
  {
  lean_object* x_112; lean_object* x_113; lean_object* x_114; uint8_t x_115; 
  x_112 = lean_ctor_get(x_85, 0);
  x_113 = lean_ctor_get(x_85, 1);
  lean_inc(x_113);
  lean_inc(x_112);
  lean_dec(x_85);
  x_114 = lean_array_get_size(x_112);
  x_115 = lean_nat_dec_lt(x_16, x_114);
  if (x_115 == 0)
  {
  uint8_t x_116; lean_object* x_117; lean_object* x_118; 
  lean_dec(x_114);
  lean_dec(x_112);
  lean_dec(x_3);
  lean_dec(x_2);
  x_116 = 1;
  x_117 = lean_box(x_116);
  x_118 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_118, 0, x_117);
  lean_ctor_set(x_118, 1, x_113);
  return x_118;
  }
  else
  {
  uint8_t x_119; 
  x_119 = lean_nat_dec_le(x_114, x_114);
  if (x_119 == 0)
  {
  uint8_t x_120; lean_object* x_121; lean_object* x_122; 
  lean_dec(x_114);
  lean_dec(x_112);
  lean_dec(x_3);
  lean_dec(x_2);
  x_120 = 1;
  x_121 = lean_box(x_120);
  x_122 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_122, 0, x_121);
  lean_ctor_set(x_122, 1, x_113);
  return x_122;
  }
  else
  {
  size_t x_123; size_t x_124; lean_object* x_125; lean_object* x_126; 
  x_123 = 0;
  x_124 = lean_usize_of_nat(x_114);
  lean_dec(x_114);
  x_125 = lean_box(0);
  x_126 = l_Array_foldlMUnsafe_fold___at_Lean_Elab_Command_elabCommand___spec__10(x_112, x_123, x_124, x_125, x_2, x_3, x_113);
  lean_dec(x_112);
  if (lean_obj_tag(x_126) == 0)
  {
  lean_object* x_127; lean_object* x_128; uint8_t x_129; lean_object* x_130; lean_object* x_131; 
  x_127 = lean_ctor_get(x_126, 1);
  lean_inc(x_127);
  if (lean_is_exclusive(x_126)) {
   lean_ctor_release(x_126, 0);
   lean_ctor_release(x_126, 1);
   x_128 = x_126;
  } else {
   lean_dec_ref(x_126);
   x_128 = lean_box(0);
  }
  x_129 = 1;
  x_130 = lean_box(x_129);
  if (lean_is_scalar(x_128)) {
   x_131 = lean_alloc_ctor(0, 2, 0);
  } else {
   x_131 = x_128;
  }
  lean_ctor_set(x_131, 0, x_130);
  lean_ctor_set(x_131, 1, x_127);
  return x_131;
  }
  else
  {
  lean_object* x_132; lean_object* x_133; lean_object* x_134; lean_object* x_135; 
  x_132 = lean_ctor_get(x_126, 0);
  lean_inc(x_132);
  x_133 = lean_ctor_get(x_126, 1);
  lean_inc(x_133);
  if (lean_is_exclusive(x_126)) {
   lean_ctor_release(x_126, 0);
   lean_ctor_release(x_126, 1);
   x_134 = x_126;
  } else {
   lean_dec_ref(x_126);
   x_134 = lean_box(0);
  }
  if (lean_is_scalar(x_134)) {
   x_135 = lean_alloc_ctor(1, 2, 0);
  } else {
   x_135 = x_134;
  }
  lean_ctor_set(x_135, 0, x_132);
  lean_ctor_set(x_135, 1, x_133);
  return x_135;
  }
  }
  }
  }
  }
  else
  {
  uint8_t x_136; 
  lean_dec(x_3);
  lean_dec(x_2);
  x_136 = !lean_is_exclusive(x_85);
  if (x_136 == 0)
  {
  return x_85;
  }
  else
  {
  lean_object* x_137; lean_object* x_138; lean_object* x_139; 
  x_137 = lean_ctor_get(x_85, 0);
  x_138 = lean_ctor_get(x_85, 1);
  lean_inc(x_138);
  lean_inc(x_137);
  lean_dec(x_85);
  x_139 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_139, 0, x_137);
  lean_ctor_set(x_139, 1, x_138);
  return x_139;
  }
  }
  }
  }
  }
  }
  LEAN_EXPORT lean_object* l_Lean_throwError___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__2___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_Lean_throwError___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__2(x_1, x_2, x_3, x_4);
  lean_dec(x_3);
  return x_5;
  }
  }
  LEAN_EXPORT lean_object* l_Lean_getConstInfoInduct___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__1___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_Lean_getConstInfoInduct___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__1(x_1, x_2, x_3, x_4);
  lean_dec(x_3);
  return x_5;
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___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, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13, lean_object* x_14) {
  _start:
  {
  size_t x_15; size_t x_16; lean_object* x_17; 
  x_15 = lean_unbox_usize(x_5);
  lean_dec(x_5);
  x_16 = lean_unbox_usize(x_6);
  lean_dec(x_6);
  x_17 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3(x_1, x_2, x_3, x_4, x_15, x_16, x_7, x_8, x_9, x_10, x_11, x_12, x_13, x_14);
  lean_dec(x_13);
  lean_dec(x_11);
  lean_dec(x_10);
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_1);
  return x_17;
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___boxed(lean_object** _args) {
  lean_object* x_1 = _args[0];
  lean_object* x_2 = _args[1];
  lean_object* x_3 = _args[2];
  lean_object* x_4 = _args[3];
  lean_object* x_5 = _args[4];
  lean_object* x_6 = _args[5];
  lean_object* x_7 = _args[6];
  lean_object* x_8 = _args[7];
  lean_object* x_9 = _args[8];
  lean_object* x_10 = _args[9];
  lean_object* x_11 = _args[10];
  lean_object* x_12 = _args[11];
  lean_object* x_13 = _args[12];
  lean_object* x_14 = _args[13];
  lean_object* x_15 = _args[14];
  lean_object* x_16 = _args[15];
  lean_object* x_17 = _args[16];
  lean_object* x_18 = _args[17];
  _start:
  {
  lean_object* x_19; 
  x_19 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12, x_13, x_14, x_15, x_16, x_17, x_18);
  lean_dec(x_17);
  lean_dec(x_15);
  lean_dec(x_14);
  lean_dec(x_13);
  lean_dec(x_12);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_5);
  lean_dec(x_1);
  return x_19;
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__5___boxed(lean_object** _args) {
  lean_object* x_1 = _args[0];
  lean_object* x_2 = _args[1];
  lean_object* x_3 = _args[2];
  lean_object* x_4 = _args[3];
  lean_object* x_5 = _args[4];
  lean_object* x_6 = _args[5];
  lean_object* x_7 = _args[6];
  lean_object* x_8 = _args[7];
  lean_object* x_9 = _args[8];
  lean_object* x_10 = _args[9];
  lean_object* x_11 = _args[10];
  lean_object* x_12 = _args[11];
  lean_object* x_13 = _args[12];
  lean_object* x_14 = _args[13];
  lean_object* x_15 = _args[14];
  lean_object* x_16 = _args[15];
  lean_object* x_17 = _args[16];
  lean_object* x_18 = _args[17];
  _start:
  {
  lean_object* x_19; 
  x_19 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__5(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12, x_13, x_14, x_15, x_16, x_17, x_18);
  lean_dec(x_17);
  lean_dec(x_15);
  lean_dec(x_14);
  lean_dec(x_13);
  lean_dec(x_12);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_5);
  lean_dec(x_1);
  return x_19;
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___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, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13) {
  _start:
  {
  size_t x_14; size_t x_15; lean_object* x_16; 
  x_14 = lean_unbox_usize(x_4);
  lean_dec(x_4);
  x_15 = lean_unbox_usize(x_5);
  lean_dec(x_5);
  x_16 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6(x_1, x_2, x_3, x_14, x_15, x_6, x_7, x_8, x_9, x_10, x_11, x_12, x_13);
  lean_dec(x_12);
  lean_dec(x_10);
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_3);
  return x_16;
  }
  }
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__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, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13, lean_object* x_14) {
  _start:
  {
  lean_object* x_15; 
  x_15 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12, x_13, x_14);
  lean_dec(x_7);
  return x_15;
  }
  }
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__2___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, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13) {
  _start:
  {
  lean_object* x_14; 
  x_14 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__2(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12, x_13);
  lean_dec(x_6);
  lean_dec(x_3);
  lean_dec(x_1);
  return x_14;
  }
  }
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___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, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10) {
  _start:
  {
  lean_object* x_11; 
  x_11 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10);
  lean_dec(x_3);
  return x_11;
  }
  }
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___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, lean_object* x_7, lean_object* x_8, lean_object* x_9) {
  _start:
  {
  lean_object* x_10; 
  x_10 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9);
  lean_dec(x_2);
  return x_10;
  }
  }
  LEAN_EXPORT lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1___lambda__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, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11) {
  _start:
  {
  lean_object* x_12; lean_object* x_13; uint8_t x_14; 
  x_12 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__4___lambda__1___closed__2;
  x_13 = l___private_Lean_CoreM_0__Lean_Core_mkFreshNameImp(x_12, x_9, x_10, x_11);
  x_14 = !lean_is_exclusive(x_13);
  if (x_14 == 0)
  {
  lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; 
  x_15 = lean_ctor_get(x_13, 0);
  x_16 = lean_mk_syntax_ident(x_15);
  x_17 = l_Lean_LocalDecl_type(x_1);
  x_18 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_18, 0, x_16);
  lean_ctor_set(x_18, 1, x_17);
  x_19 = lean_array_push(x_3, x_18);
  x_20 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_20, 0, x_2);
  lean_ctor_set(x_20, 1, x_19);
  x_21 = lean_alloc_ctor(1, 1, 0);
  lean_ctor_set(x_21, 0, x_20);
  lean_ctor_set(x_13, 0, x_21);
  return x_13;
  }
  else
  {
  lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; 
  x_22 = lean_ctor_get(x_13, 0);
  x_23 = lean_ctor_get(x_13, 1);
  lean_inc(x_23);
  lean_inc(x_22);
  lean_dec(x_13);
  x_24 = lean_mk_syntax_ident(x_22);
  x_25 = l_Lean_LocalDecl_type(x_1);
  x_26 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_26, 0, x_24);
  lean_ctor_set(x_26, 1, x_25);
  x_27 = lean_array_push(x_3, x_26);
  x_28 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_28, 0, x_2);
  lean_ctor_set(x_28, 1, x_27);
  x_29 = lean_alloc_ctor(1, 1, 0);
  lean_ctor_set(x_29, 0, x_28);
  x_30 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_30, 0, x_29);
  lean_ctor_set(x_30, 1, x_23);
  return x_30;
  }
  }
  }
  LEAN_EXPORT lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___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, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13) {
  _start:
  {
  lean_object* x_14; uint8_t x_15; 
  x_14 = lean_ctor_get(x_3, 1);
  x_15 = lean_nat_dec_le(x_14, x_5);
  if (x_15 == 0)
  {
  lean_object* x_16; uint8_t x_17; 
  x_16 = lean_unsigned_to_nat(0u);
  x_17 = lean_nat_dec_eq(x_4, x_16);
  if (x_17 == 0)
  {
  lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; 
  x_18 = lean_unsigned_to_nat(1u);
  x_19 = lean_nat_sub(x_4, x_18);
  lean_dec(x_4);
  x_20 = lean_ctor_get(x_6, 0);
  lean_inc(x_20);
  x_21 = lean_ctor_get(x_6, 1);
  lean_inc(x_21);
  lean_dec(x_6);
  x_22 = lean_ctor_get(x_1, 1);
  x_23 = lean_nat_add(x_22, x_5);
  x_24 = l_Lean_instInhabitedExpr;
  x_25 = lean_array_get(x_24, x_2, x_23);
  lean_dec(x_23);
  x_26 = l_Lean_Expr_fvarId_x21(x_25);
  lean_inc(x_9);
  x_27 = l_Lean_Meta_getLocalDecl(x_26, x_9, x_10, x_11, x_12, x_13);
  if (lean_obj_tag(x_27) == 0)
  {
  lean_object* x_28; lean_object* x_29; lean_object* x_30; uint8_t x_31; 
  x_28 = lean_ctor_get(x_27, 0);
  lean_inc(x_28);
  x_29 = lean_ctor_get(x_27, 1);
  lean_inc(x_29);
  lean_dec(x_27);
  x_30 = l_Lean_LocalDecl_userName(x_28);
  x_31 = l_Lean_Name_hasMacroScopes(x_30);
  if (x_31 == 0)
  {
  lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; 
  x_32 = lean_array_push(x_20, x_30);
  x_33 = lean_box(0);
  x_34 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1___lambda__1(x_28, x_32, x_21, x_33, x_7, x_8, x_9, x_10, x_11, x_12, x_29);
  lean_dec(x_28);
  x_35 = lean_ctor_get(x_34, 0);
  lean_inc(x_35);
  x_36 = lean_ctor_get(x_34, 1);
  lean_inc(x_36);
  lean_dec(x_34);
  x_37 = lean_ctor_get(x_35, 0);
  lean_inc(x_37);
  lean_dec(x_35);
  x_38 = lean_ctor_get(x_3, 2);
  x_39 = lean_nat_add(x_5, x_38);
  lean_dec(x_5);
  x_4 = x_19;
  x_5 = x_39;
  x_6 = x_37;
  x_13 = x_36;
  goto _start;
  }
  else
  {
  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_dec(x_30);
  x_41 = lean_box(0);
  x_42 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1___lambda__1(x_28, x_20, x_21, x_41, x_7, x_8, x_9, x_10, x_11, x_12, x_29);
  lean_dec(x_28);
  x_43 = lean_ctor_get(x_42, 0);
  lean_inc(x_43);
  x_44 = lean_ctor_get(x_42, 1);
  lean_inc(x_44);
  lean_dec(x_42);
  x_45 = lean_ctor_get(x_43, 0);
  lean_inc(x_45);
  lean_dec(x_43);
  x_46 = lean_ctor_get(x_3, 2);
  x_47 = lean_nat_add(x_5, x_46);
  lean_dec(x_5);
  x_4 = x_19;
  x_5 = x_47;
  x_6 = x_45;
  x_13 = x_44;
  goto _start;
  }
  }
  else
  {
  uint8_t x_49; 
  lean_dec(x_21);
  lean_dec(x_20);
  lean_dec(x_19);
  lean_dec(x_9);
  lean_dec(x_5);
  x_49 = !lean_is_exclusive(x_27);
  if (x_49 == 0)
  {
  return x_27;
  }
  else
  {
  lean_object* x_50; lean_object* x_51; lean_object* x_52; 
  x_50 = lean_ctor_get(x_27, 0);
  x_51 = lean_ctor_get(x_27, 1);
  lean_inc(x_51);
  lean_inc(x_50);
  lean_dec(x_27);
  x_52 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_52, 0, x_50);
  lean_ctor_set(x_52, 1, x_51);
  return x_52;
  }
  }
  }
  else
  {
  lean_object* x_53; 
  lean_dec(x_9);
  lean_dec(x_5);
  lean_dec(x_4);
  x_53 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_53, 0, x_6);
  lean_ctor_set(x_53, 1, x_13);
  return x_53;
  }
  }
  else
  {
  lean_object* x_54; 
  lean_dec(x_9);
  lean_dec(x_5);
  lean_dec(x_4);
  x_54 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_54, 0, x_6);
  lean_ctor_set(x_54, 1, x_13);
  return x_54;
  }
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__2(size_t x_1, size_t x_2, lean_object* x_3) {
  _start:
  {
  uint8_t x_4; 
  x_4 = lean_usize_dec_lt(x_2, x_1);
  if (x_4 == 0)
  {
  lean_object* x_5; 
  x_5 = x_3;
  return x_5;
  }
  else
  {
  lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; size_t x_11; size_t x_12; lean_object* x_13; lean_object* x_14; 
  x_6 = lean_array_uget(x_3, x_2);
  x_7 = lean_unsigned_to_nat(0u);
  x_8 = lean_array_uset(x_3, x_2, x_7);
  x_9 = x_6;
  x_10 = lean_ctor_get(x_9, 0);
  lean_inc(x_10);
  lean_dec(x_9);
  x_11 = 1;
  x_12 = lean_usize_add(x_2, x_11);
  x_13 = x_10;
  x_14 = lean_array_uset(x_8, x_2, x_13);
  x_2 = x_12;
  x_3 = x_14;
  goto _start;
  }
  }
  }
  static lean_object* _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__1() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("doExpr");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__2() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6;
  x_2 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__1;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__3() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("fromJson?");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__4() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__3;
  x_2 = lean_string_utf8_byte_size(x_1);
  return x_2;
  }
  }
  static lean_object* _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__5() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; 
  x_1 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__3;
  x_2 = lean_unsigned_to_nat(0u);
  x_3 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__4;
  x_4 = lean_alloc_ctor(0, 3, 0);
  lean_ctor_set(x_4, 0, x_1);
  lean_ctor_set(x_4, 1, x_2);
  lean_ctor_set(x_4, 2, x_3);
  return x_4;
  }
  }
  static lean_object* _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__6() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__3;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__7() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("FromJson");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__8() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__2;
  x_2 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__7;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__9() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__8;
  x_2 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__3;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__10() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__9;
  x_3 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_3, 0, x_2);
  lean_ctor_set(x_3, 1, x_1);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__11() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_3 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_3, 0, x_2);
  lean_ctor_set(x_3, 1, x_1);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__12() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("arrayRef");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__13() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6;
  x_2 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__12;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__14() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("jsons");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__15() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__14;
  x_2 = lean_string_utf8_byte_size(x_1);
  return x_2;
  }
  }
  static lean_object* _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__16() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; 
  x_1 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__14;
  x_2 = lean_unsigned_to_nat(0u);
  x_3 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__15;
  x_4 = lean_alloc_ctor(0, 3, 0);
  lean_ctor_set(x_4, 0, x_1);
  lean_ctor_set(x_4, 1, x_2);
  lean_ctor_set(x_4, 2, x_3);
  return x_4;
  }
  }
  static lean_object* _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__17() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__14;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13, lean_object* x_14, lean_object* x_15) {
  _start:
  {
  lean_object* x_16; uint8_t x_17; 
  x_16 = lean_unsigned_to_nat(0u);
  x_17 = lean_nat_dec_eq(x_5, x_16);
  if (x_17 == 0)
  {
  lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_27; lean_object* x_28; lean_object* x_29; uint8_t x_30; 
  x_18 = lean_unsigned_to_nat(1u);
  x_19 = lean_nat_sub(x_5, x_18);
  lean_dec(x_5);
  x_20 = lean_array_fget(x_4, x_6);
  x_27 = lean_ctor_get(x_20, 1);
  lean_inc(x_27);
  lean_dec(x_20);
  x_28 = lean_ctor_get(x_1, 0);
  x_29 = lean_ctor_get(x_28, 0);
  x_30 = l_Lean_Expr_isAppOf(x_27, x_29);
  lean_dec(x_27);
  if (x_30 == 0)
  {
  lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; 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; lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; 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; lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76; 
  lean_inc(x_13);
  x_31 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_13, x_14, x_15);
  x_32 = lean_ctor_get(x_31, 0);
  lean_inc(x_32);
  x_33 = lean_ctor_get(x_31, 1);
  lean_inc(x_33);
  lean_dec(x_31);
  x_34 = l_Lean_Elab_Term_getCurrMacroScope(x_9, x_10, x_11, x_12, x_13, x_14, x_33);
  x_35 = lean_ctor_get(x_34, 0);
  lean_inc(x_35);
  x_36 = lean_ctor_get(x_34, 1);
  lean_inc(x_36);
  lean_dec(x_34);
  x_37 = l_Lean_Elab_Term_getMainModule___rarg(x_14, x_36);
  x_38 = lean_ctor_get(x_37, 0);
  lean_inc(x_38);
  x_39 = lean_ctor_get(x_37, 1);
  lean_inc(x_39);
  lean_dec(x_37);
  x_40 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__6;
  lean_inc(x_35);
  lean_inc(x_38);
  x_41 = l_Lean_addMacroScope(x_38, x_40, x_35);
  x_42 = lean_box(0);
  x_43 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__5;
  x_44 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__11;
  lean_inc(x_32);
  x_45 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_45, 0, x_32);
  lean_ctor_set(x_45, 1, x_43);
  lean_ctor_set(x_45, 2, x_41);
  lean_ctor_set(x_45, 3, x_44);
  x_46 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__17;
  x_47 = l_Lean_addMacroScope(x_38, x_46, x_35);
  x_48 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__16;
  lean_inc(x_32);
  x_49 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_49, 0, x_32);
  lean_ctor_set(x_49, 1, x_48);
  lean_ctor_set(x_49, 2, x_47);
  lean_ctor_set(x_49, 3, x_42);
  x_50 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__3;
  lean_inc(x_32);
  x_51 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_51, 0, x_32);
  lean_ctor_set(x_51, 1, x_50);
  lean_inc(x_6);
  x_52 = l_Nat_repr(x_6);
  x_53 = l_Lean_numLitKind;
  x_54 = lean_box(2);
  x_55 = l_Lean_Syntax_mkLit(x_53, x_52, x_54);
  x_56 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__4;
  x_57 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_57, 0, x_32);
  lean_ctor_set(x_57, 1, x_56);
  x_58 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__17;
  x_59 = lean_array_push(x_58, x_49);
  x_60 = lean_array_push(x_59, x_51);
  x_61 = lean_array_push(x_60, x_55);
  x_62 = lean_array_push(x_61, x_57);
  x_63 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__13;
  x_64 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_64, 0, x_54);
  lean_ctor_set(x_64, 1, x_63);
  lean_ctor_set(x_64, 2, x_62);
  x_65 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_66 = lean_array_push(x_65, x_64);
  x_67 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_68 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_68, 0, x_54);
  lean_ctor_set(x_68, 1, x_67);
  lean_ctor_set(x_68, 2, x_66);
  x_69 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_70 = lean_array_push(x_69, x_45);
  x_71 = lean_array_push(x_70, x_68);
  x_72 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__4;
  x_73 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_73, 0, x_54);
  lean_ctor_set(x_73, 1, x_72);
  lean_ctor_set(x_73, 2, x_71);
  x_74 = lean_array_push(x_65, x_73);
  x_75 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__2;
  x_76 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_76, 0, x_54);
  lean_ctor_set(x_76, 1, x_75);
  lean_ctor_set(x_76, 2, x_74);
  x_21 = x_76;
  x_22 = x_39;
  goto block_26;
  }
  else
  {
  lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_object* x_94; lean_object* x_95; lean_object* x_96; lean_object* x_97; lean_object* x_98; lean_object* x_99; lean_object* x_100; lean_object* x_101; lean_object* x_102; lean_object* x_103; lean_object* x_104; lean_object* x_105; lean_object* x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; lean_object* x_110; lean_object* x_111; lean_object* x_112; lean_object* x_113; lean_object* x_114; lean_object* x_115; lean_object* x_116; lean_object* x_117; 
  lean_inc(x_13);
  x_77 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_13, x_14, x_15);
  x_78 = lean_ctor_get(x_77, 0);
  lean_inc(x_78);
  x_79 = lean_ctor_get(x_77, 1);
  lean_inc(x_79);
  lean_dec(x_77);
  x_80 = l_Lean_Elab_Term_getCurrMacroScope(x_9, x_10, x_11, x_12, x_13, x_14, x_79);
  x_81 = lean_ctor_get(x_80, 0);
  lean_inc(x_81);
  x_82 = lean_ctor_get(x_80, 1);
  lean_inc(x_82);
  lean_dec(x_80);
  x_83 = l_Lean_Elab_Term_getMainModule___rarg(x_14, x_82);
  x_84 = lean_ctor_get(x_83, 0);
  lean_inc(x_84);
  x_85 = lean_ctor_get(x_83, 1);
  lean_inc(x_85);
  lean_dec(x_83);
  x_86 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__17;
  x_87 = l_Lean_addMacroScope(x_84, x_86, x_81);
  x_88 = lean_box(0);
  x_89 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__16;
  lean_inc(x_78);
  x_90 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_90, 0, x_78);
  lean_ctor_set(x_90, 1, x_89);
  lean_ctor_set(x_90, 2, x_87);
  lean_ctor_set(x_90, 3, x_88);
  x_91 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__3;
  lean_inc(x_78);
  x_92 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_92, 0, x_78);
  lean_ctor_set(x_92, 1, x_91);
  lean_inc(x_6);
  x_93 = l_Nat_repr(x_6);
  x_94 = l_Lean_numLitKind;
  x_95 = lean_box(2);
  x_96 = l_Lean_Syntax_mkLit(x_94, x_93, x_95);
  x_97 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__4;
  x_98 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_98, 0, x_78);
  lean_ctor_set(x_98, 1, x_97);
  x_99 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__17;
  x_100 = lean_array_push(x_99, x_90);
  x_101 = lean_array_push(x_100, x_92);
  x_102 = lean_array_push(x_101, x_96);
  x_103 = lean_array_push(x_102, x_98);
  x_104 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__13;
  x_105 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_105, 0, x_95);
  lean_ctor_set(x_105, 1, x_104);
  lean_ctor_set(x_105, 2, x_103);
  x_106 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_107 = lean_array_push(x_106, x_105);
  x_108 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_109 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_109, 0, x_95);
  lean_ctor_set(x_109, 1, x_108);
  lean_ctor_set(x_109, 2, x_107);
  x_110 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  lean_inc(x_2);
  x_111 = lean_array_push(x_110, x_2);
  x_112 = lean_array_push(x_111, x_109);
  x_113 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__4;
  x_114 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_114, 0, x_95);
  lean_ctor_set(x_114, 1, x_113);
  lean_ctor_set(x_114, 2, x_112);
  x_115 = lean_array_push(x_106, x_114);
  x_116 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__2;
  x_117 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_117, 0, x_95);
  lean_ctor_set(x_117, 1, x_116);
  lean_ctor_set(x_117, 2, x_115);
  x_21 = x_117;
  x_22 = x_85;
  goto block_26;
  }
  block_26:
  {
  lean_object* x_23; lean_object* x_24; 
  x_23 = lean_nat_add(x_6, x_18);
  lean_dec(x_6);
  x_24 = lean_array_push(x_8, x_21);
  x_5 = x_19;
  x_6 = x_23;
  x_7 = lean_box(0);
  x_8 = x_24;
  x_15 = x_22;
  goto _start;
  }
  }
  else
  {
  lean_object* x_118; 
  lean_dec(x_13);
  lean_dec(x_6);
  lean_dec(x_5);
  lean_dec(x_2);
  x_118 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_118, 0, x_8);
  lean_ctor_set(x_118, 1, x_15);
  return x_118;
  }
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__1() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("doSeqItem");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__2() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("doLetArrow");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__3() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("let");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__4() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("doIdDecl");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__5() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("←");
  return x_1;
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, size_t x_7, size_t x_8, lean_object* x_9) {
  _start:
  {
  uint8_t x_10; 
  x_10 = lean_usize_dec_lt(x_8, x_7);
  if (x_10 == 0)
  {
  lean_object* x_11; 
  lean_dec(x_6);
  lean_dec(x_5);
  lean_dec(x_4);
  lean_dec(x_3);
  lean_dec(x_2);
  lean_dec(x_1);
  x_11 = x_9;
  return x_11;
  }
  else
  {
  lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; size_t x_16; size_t x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44; 
  x_12 = lean_array_uget(x_9, x_8);
  x_13 = lean_unsigned_to_nat(0u);
  x_14 = lean_array_uset(x_9, x_8, x_13);
  x_15 = x_12;
  x_16 = 1;
  x_17 = lean_usize_add(x_8, x_16);
  x_18 = lean_ctor_get(x_15, 0);
  lean_inc(x_18);
  x_19 = lean_ctor_get(x_15, 1);
  lean_inc(x_19);
  lean_dec(x_15);
  x_20 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__1;
  lean_inc(x_2);
  x_21 = lean_name_mk_string(x_2, x_20);
  x_22 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__2;
  lean_inc(x_2);
  x_23 = lean_name_mk_string(x_2, x_22);
  x_24 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__3;
  lean_inc(x_1);
  x_25 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_25, 0, x_1);
  lean_ctor_set(x_25, 1, x_24);
  x_26 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__4;
  lean_inc(x_2);
  x_27 = lean_name_mk_string(x_2, x_26);
  x_28 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__5;
  lean_inc(x_1);
  x_29 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_29, 0, x_1);
  lean_ctor_set(x_29, 1, x_28);
  lean_inc(x_3);
  x_30 = lean_array_push(x_3, x_18);
  lean_inc(x_5);
  x_31 = lean_array_push(x_30, x_5);
  x_32 = lean_array_push(x_31, x_29);
  x_33 = lean_array_push(x_32, x_19);
  x_34 = lean_box(2);
  x_35 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_35, 0, x_34);
  lean_ctor_set(x_35, 1, x_27);
  lean_ctor_set(x_35, 2, x_33);
  lean_inc(x_6);
  x_36 = lean_array_push(x_6, x_25);
  lean_inc(x_5);
  x_37 = lean_array_push(x_36, x_5);
  x_38 = lean_array_push(x_37, x_35);
  x_39 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_39, 0, x_34);
  lean_ctor_set(x_39, 1, x_23);
  lean_ctor_set(x_39, 2, x_38);
  lean_inc(x_4);
  x_40 = lean_array_push(x_4, x_39);
  lean_inc(x_5);
  x_41 = lean_array_push(x_40, x_5);
  x_42 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_42, 0, x_34);
  lean_ctor_set(x_42, 1, x_21);
  lean_ctor_set(x_42, 2, x_41);
  x_43 = x_42;
  x_44 = lean_array_uset(x_14, x_8, x_43);
  x_8 = x_17;
  x_9 = x_44;
  goto _start;
  }
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___closed__1() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("quotedName");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___closed__2() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string(".");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___closed__3() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("`");
  return x_1;
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5(lean_object* x_1, lean_object* x_2, size_t x_3, size_t x_4, lean_object* x_5) {
  _start:
  {
  uint8_t x_6; 
  x_6 = lean_usize_dec_lt(x_4, x_3);
  if (x_6 == 0)
  {
  lean_object* x_7; 
  lean_dec(x_2);
  lean_dec(x_1);
  x_7 = x_5;
  return x_7;
  }
  else
  {
  lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; size_t x_13; size_t x_14; 
  x_8 = lean_array_uget(x_5, x_4);
  x_9 = lean_unsigned_to_nat(0u);
  x_10 = lean_array_uset(x_5, x_4, x_9);
  x_11 = x_8;
  lean_inc(x_11);
  lean_inc(x_2);
  x_12 = l___private_Init_Meta_0__Lean_getEscapedNameParts_x3f(x_2, x_11);
  x_13 = 1;
  x_14 = lean_usize_add(x_4, x_13);
  if (lean_obj_tag(x_12) == 0)
  {
  lean_object* x_15; lean_object* x_16; lean_object* x_17; 
  x_15 = l___private_Init_Meta_0__Lean_quoteNameMk(x_11);
  x_16 = x_15;
  x_17 = lean_array_uset(x_10, x_4, x_16);
  x_4 = x_14;
  x_5 = x_17;
  goto _start;
  }
  else
  {
  lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; 
  lean_dec(x_11);
  x_19 = lean_ctor_get(x_12, 0);
  lean_inc(x_19);
  lean_dec(x_12);
  x_20 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___closed__1;
  lean_inc(x_1);
  x_21 = lean_name_mk_string(x_1, x_20);
  x_22 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___closed__2;
  x_23 = l_String_intercalate(x_22, x_19);
  x_24 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___closed__3;
  x_25 = lean_string_append(x_24, x_23);
  lean_dec(x_23);
  x_26 = l_Lean_nameLitKind;
  x_27 = lean_box(2);
  x_28 = l_Lean_Syntax_mkLit(x_26, x_25, x_27);
  x_29 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_30 = lean_array_push(x_29, x_28);
  x_31 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_31, 0, x_27);
  lean_ctor_set(x_31, 1, x_21);
  lean_ctor_set(x_31, 2, x_30);
  x_32 = x_31;
  x_33 = lean_array_uset(x_10, x_4, x_32);
  x_4 = x_14;
  x_5 = x_33;
  goto _start;
  }
  }
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__1() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("proj");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__2() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6;
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__1;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__3() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6;
  x_2 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__1;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__4() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("Json.parseTagged");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__5() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__4;
  x_2 = lean_string_utf8_byte_size(x_1);
  return x_2;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__6() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; 
  x_1 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__4;
  x_2 = lean_unsigned_to_nat(0u);
  x_3 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__5;
  x_4 = lean_alloc_ctor(0, 3, 0);
  lean_ctor_set(x_4, 0, x_1);
  lean_ctor_set(x_4, 1, x_2);
  lean_ctor_set(x_4, 2, x_3);
  return x_4;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__7() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("parseTagged");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__8() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__8;
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__7;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__9() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__3;
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__7;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__10() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__9;
  x_3 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_3, 0, x_2);
  lean_ctor_set(x_3, 1, x_1);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__11() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__10;
  x_3 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_3, 0, x_2);
  lean_ctor_set(x_3, 1, x_1);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__12() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("json");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__13() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__12;
  x_2 = lean_string_utf8_byte_size(x_1);
  return x_2;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__14() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; 
  x_1 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__12;
  x_2 = lean_unsigned_to_nat(0u);
  x_3 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__13;
  x_4 = lean_alloc_ctor(0, 3, 0);
  lean_ctor_set(x_4, 0, x_1);
  lean_ctor_set(x_4, 1, x_2);
  lean_ctor_set(x_4, 2, x_3);
  return x_4;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__15() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__12;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__16() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("bind");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__17() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__16;
  x_2 = lean_string_utf8_byte_size(x_1);
  return x_2;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__18() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; 
  x_1 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__16;
  x_2 = lean_unsigned_to_nat(0u);
  x_3 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__17;
  x_4 = lean_alloc_ctor(0, 3, 0);
  lean_ctor_set(x_4, 0, x_1);
  lean_ctor_set(x_4, 1, x_2);
  lean_ctor_set(x_4, 2, x_3);
  return x_4;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__19() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__16;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__20() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("Bind");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__21() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__20;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__22() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__21;
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__16;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__23() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__22;
  x_3 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_3, 0, x_2);
  lean_ctor_set(x_3, 1, x_1);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__24() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__23;
  x_3 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_3, 0, x_2);
  lean_ctor_set(x_3, 1, x_1);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__25() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("fun");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__26() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6;
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__25;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__27() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("basicFun");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__28() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6;
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__27;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__29() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("do");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__30() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6;
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__29;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__31() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("doSeqIndent");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__32() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6;
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__31;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__33() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6;
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__1;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__34() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("doReturn");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__35() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6;
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__34;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__36() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("return");
  return x_1;
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, size_t x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13, lean_object* x_14) {
  _start:
  {
  lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; uint8_t x_22; 
  lean_inc(x_12);
  x_15 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_12, x_13, x_14);
  x_16 = lean_ctor_get(x_15, 0);
  lean_inc(x_16);
  x_17 = lean_ctor_get(x_15, 1);
  lean_inc(x_17);
  lean_dec(x_15);
  x_18 = l_Lean_Elab_Term_getCurrMacroScope(x_8, x_9, x_10, x_11, x_12, x_13, x_17);
  lean_dec(x_12);
  x_19 = lean_ctor_get(x_18, 0);
  lean_inc(x_19);
  x_20 = lean_ctor_get(x_18, 1);
  lean_inc(x_20);
  lean_dec(x_18);
  x_21 = l_Lean_Elab_Term_getMainModule___rarg(x_13, x_20);
  x_22 = !lean_is_exclusive(x_21);
  if (x_22 == 0)
  {
  lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; 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; lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; 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; lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76; lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; size_t x_93; lean_object* x_94; lean_object* x_95; lean_object* x_96; lean_object* x_97; lean_object* x_98; lean_object* x_99; lean_object* x_100; lean_object* x_101; lean_object* x_102; lean_object* x_103; lean_object* x_104; lean_object* x_105; lean_object* x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; lean_object* x_110; lean_object* x_111; lean_object* x_112; lean_object* x_113; lean_object* x_114; lean_object* x_115; lean_object* x_116; lean_object* x_117; lean_object* x_118; lean_object* x_119; lean_object* x_120; lean_object* x_121; lean_object* x_122; lean_object* x_123; lean_object* x_124; lean_object* x_125; lean_object* x_126; lean_object* x_127; lean_object* x_128; lean_object* x_129; lean_object* x_130; lean_object* x_131; lean_object* x_132; lean_object* x_133; lean_object* x_134; lean_object* x_135; lean_object* x_136; lean_object* x_137; lean_object* x_138; lean_object* x_139; lean_object* x_140; lean_object* x_141; lean_object* x_142; lean_object* x_143; lean_object* x_144; lean_object* x_145; lean_object* x_146; 
  x_23 = lean_ctor_get(x_21, 0);
  x_24 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__2;
  lean_inc(x_16);
  x_25 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_25, 0, x_16);
  lean_ctor_set(x_25, 1, x_24);
  x_26 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__8;
  lean_inc(x_19);
  lean_inc(x_23);
  x_27 = l_Lean_addMacroScope(x_23, x_26, x_19);
  x_28 = lean_box(0);
  x_29 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__6;
  x_30 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__11;
  lean_inc(x_16);
  x_31 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_31, 0, x_16);
  lean_ctor_set(x_31, 1, x_29);
  lean_ctor_set(x_31, 2, x_27);
  lean_ctor_set(x_31, 3, x_30);
  x_32 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__15;
  lean_inc(x_19);
  lean_inc(x_23);
  x_33 = l_Lean_addMacroScope(x_23, x_32, x_19);
  x_34 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__14;
  lean_inc(x_16);
  x_35 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_35, 0, x_16);
  lean_ctor_set(x_35, 1, x_34);
  lean_ctor_set(x_35, 2, x_33);
  lean_ctor_set(x_35, 3, x_28);
  lean_inc(x_1);
  x_36 = l_Lean_Name_getString_x21(x_1);
  x_37 = lean_box(2);
  x_38 = l_Lean_Syntax_mkStrLit(x_36, x_37);
  lean_dec(x_36);
  lean_inc(x_2);
  x_39 = l_Nat_repr(x_2);
  x_40 = l_Lean_numLitKind;
  x_41 = l_Lean_Syntax_mkLit(x_40, x_39, x_37);
  x_42 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__17;
  x_43 = lean_array_push(x_42, x_35);
  x_44 = lean_array_push(x_43, x_38);
  x_45 = lean_array_push(x_44, x_41);
  x_46 = lean_array_push(x_45, x_7);
  x_47 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_48 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_48, 0, x_37);
  lean_ctor_set(x_48, 1, x_47);
  lean_ctor_set(x_48, 2, x_46);
  x_49 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_50 = lean_array_push(x_49, x_31);
  x_51 = lean_array_push(x_50, x_48);
  x_52 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__4;
  x_53 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_53, 0, x_37);
  lean_ctor_set(x_53, 1, x_52);
  lean_ctor_set(x_53, 2, x_51);
  lean_inc(x_3);
  x_54 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_54, 0, x_37);
  lean_ctor_set(x_54, 1, x_47);
  lean_ctor_set(x_54, 2, x_3);
  x_55 = lean_array_push(x_49, x_53);
  lean_inc(x_54);
  x_56 = lean_array_push(x_55, x_54);
  x_57 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_57, 0, x_37);
  lean_ctor_set(x_57, 1, x_47);
  lean_ctor_set(x_57, 2, x_56);
  x_58 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__4;
  lean_inc(x_16);
  x_59 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_59, 0, x_16);
  lean_ctor_set(x_59, 1, x_58);
  x_60 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5;
  x_61 = lean_array_push(x_60, x_25);
  lean_inc(x_61);
  x_62 = lean_array_push(x_61, x_57);
  lean_inc(x_59);
  x_63 = lean_array_push(x_62, x_59);
  x_64 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__3;
  x_65 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_65, 0, x_37);
  lean_ctor_set(x_65, 1, x_64);
  lean_ctor_set(x_65, 2, x_63);
  x_66 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___closed__2;
  lean_inc(x_16);
  x_67 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_67, 0, x_16);
  lean_ctor_set(x_67, 1, x_66);
  x_68 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__19;
  lean_inc(x_19);
  lean_inc(x_23);
  x_69 = l_Lean_addMacroScope(x_23, x_68, x_19);
  x_70 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__18;
  x_71 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__24;
  lean_inc(x_16);
  x_72 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_72, 0, x_16);
  lean_ctor_set(x_72, 1, x_70);
  lean_ctor_set(x_72, 2, x_69);
  lean_ctor_set(x_72, 3, x_71);
  x_73 = lean_array_push(x_60, x_65);
  x_74 = lean_array_push(x_73, x_67);
  x_75 = lean_array_push(x_74, x_72);
  x_76 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__2;
  x_77 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_77, 0, x_37);
  lean_ctor_set(x_77, 1, x_76);
  lean_ctor_set(x_77, 2, x_75);
  x_78 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__25;
  lean_inc(x_16);
  x_79 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_79, 0, x_16);
  lean_ctor_set(x_79, 1, x_78);
  x_80 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__17;
  x_81 = l_Lean_addMacroScope(x_23, x_80, x_19);
  x_82 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__16;
  lean_inc(x_16);
  x_83 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_83, 0, x_16);
  lean_ctor_set(x_83, 1, x_82);
  lean_ctor_set(x_83, 2, x_81);
  lean_ctor_set(x_83, 3, x_28);
  x_84 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_85 = lean_array_push(x_84, x_83);
  x_86 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_86, 0, x_37);
  lean_ctor_set(x_86, 1, x_47);
  lean_ctor_set(x_86, 2, x_85);
  x_87 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__16;
  lean_inc(x_16);
  x_88 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_88, 0, x_16);
  lean_ctor_set(x_88, 1, x_87);
  x_89 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__29;
  lean_inc(x_16);
  x_90 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_90, 0, x_16);
  lean_ctor_set(x_90, 1, x_89);
  x_91 = l_Array_zip___rarg(x_4, x_5);
  x_92 = lean_array_get_size(x_91);
  x_93 = lean_usize_of_nat(x_92);
  lean_dec(x_92);
  x_94 = x_91;
  x_95 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6;
  lean_inc(x_54);
  lean_inc(x_16);
  x_96 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4(x_16, x_95, x_42, x_49, x_54, x_60, x_93, x_6, x_94);
  x_97 = x_96;
  lean_inc(x_3);
  x_98 = l_Array_append___rarg(x_3, x_97);
  x_99 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__36;
  x_100 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_100, 0, x_16);
  lean_ctor_set(x_100, 1, x_99);
  x_101 = lean_mk_syntax_ident(x_1);
  x_102 = l_Array_append___rarg(x_3, x_4);
  x_103 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_103, 0, x_37);
  lean_ctor_set(x_103, 1, x_47);
  lean_ctor_set(x_103, 2, x_102);
  x_104 = lean_array_push(x_49, x_101);
  x_105 = lean_array_push(x_104, x_103);
  x_106 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_106, 0, x_37);
  lean_ctor_set(x_106, 1, x_52);
  lean_ctor_set(x_106, 2, x_105);
  x_107 = lean_array_push(x_84, x_106);
  x_108 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_108, 0, x_37);
  lean_ctor_set(x_108, 1, x_47);
  lean_ctor_set(x_108, 2, x_107);
  x_109 = lean_array_push(x_49, x_100);
  x_110 = lean_array_push(x_109, x_108);
  x_111 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__35;
  x_112 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_112, 0, x_37);
  lean_ctor_set(x_112, 1, x_111);
  lean_ctor_set(x_112, 2, x_110);
  x_113 = lean_array_push(x_49, x_112);
  lean_inc(x_54);
  x_114 = lean_array_push(x_113, x_54);
  x_115 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__33;
  x_116 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_116, 0, x_37);
  lean_ctor_set(x_116, 1, x_115);
  lean_ctor_set(x_116, 2, x_114);
  x_117 = lean_array_push(x_98, x_116);
  x_118 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_118, 0, x_37);
  lean_ctor_set(x_118, 1, x_47);
  lean_ctor_set(x_118, 2, x_117);
  x_119 = lean_array_push(x_84, x_118);
  x_120 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__32;
  x_121 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_121, 0, x_37);
  lean_ctor_set(x_121, 1, x_120);
  lean_ctor_set(x_121, 2, x_119);
  x_122 = lean_array_push(x_49, x_90);
  x_123 = lean_array_push(x_122, x_121);
  x_124 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__30;
  x_125 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_125, 0, x_37);
  lean_ctor_set(x_125, 1, x_124);
  lean_ctor_set(x_125, 2, x_123);
  x_126 = lean_array_push(x_60, x_86);
  x_127 = lean_array_push(x_126, x_88);
  x_128 = lean_array_push(x_127, x_125);
  x_129 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__28;
  x_130 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_130, 0, x_37);
  lean_ctor_set(x_130, 1, x_129);
  lean_ctor_set(x_130, 2, x_128);
  x_131 = lean_array_push(x_49, x_79);
  x_132 = lean_array_push(x_131, x_130);
  x_133 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__26;
  x_134 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_134, 0, x_37);
  lean_ctor_set(x_134, 1, x_133);
  lean_ctor_set(x_134, 2, x_132);
  x_135 = lean_array_push(x_49, x_134);
  x_136 = lean_array_push(x_135, x_54);
  x_137 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_137, 0, x_37);
  lean_ctor_set(x_137, 1, x_47);
  lean_ctor_set(x_137, 2, x_136);
  x_138 = lean_array_push(x_61, x_137);
  x_139 = lean_array_push(x_138, x_59);
  x_140 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_140, 0, x_37);
  lean_ctor_set(x_140, 1, x_64);
  lean_ctor_set(x_140, 2, x_139);
  x_141 = lean_array_push(x_84, x_140);
  x_142 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_142, 0, x_37);
  lean_ctor_set(x_142, 1, x_47);
  lean_ctor_set(x_142, 2, x_141);
  x_143 = lean_array_push(x_49, x_77);
  x_144 = lean_array_push(x_143, x_142);
  x_145 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_145, 0, x_37);
  lean_ctor_set(x_145, 1, x_52);
  lean_ctor_set(x_145, 2, x_144);
  x_146 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_146, 0, x_145);
  lean_ctor_set(x_146, 1, x_2);
  lean_ctor_set(x_21, 0, x_146);
  return x_21;
  }
  else
  {
  lean_object* x_147; lean_object* x_148; lean_object* x_149; lean_object* x_150; lean_object* x_151; lean_object* x_152; lean_object* x_153; lean_object* x_154; lean_object* x_155; lean_object* x_156; lean_object* x_157; lean_object* x_158; lean_object* x_159; lean_object* x_160; lean_object* x_161; lean_object* x_162; lean_object* x_163; lean_object* x_164; lean_object* x_165; lean_object* x_166; lean_object* x_167; lean_object* x_168; lean_object* x_169; lean_object* x_170; lean_object* x_171; 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; lean_object* 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_190; lean_object* x_191; lean_object* x_192; lean_object* x_193; lean_object* x_194; lean_object* x_195; lean_object* x_196; 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; 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; lean_object* x_211; lean_object* x_212; lean_object* x_213; lean_object* x_214; lean_object* x_215; lean_object* x_216; lean_object* x_217; size_t x_218; 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; lean_object* x_226; lean_object* x_227; lean_object* x_228; lean_object* x_229; lean_object* x_230; lean_object* x_231; 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; 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; lean_object* x_246; lean_object* x_247; lean_object* x_248; lean_object* x_249; lean_object* x_250; lean_object* x_251; lean_object* x_252; lean_object* x_253; lean_object* x_254; lean_object* x_255; lean_object* x_256; 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; lean_object* x_268; lean_object* x_269; lean_object* x_270; lean_object* x_271; lean_object* x_272; 
  x_147 = lean_ctor_get(x_21, 0);
  x_148 = lean_ctor_get(x_21, 1);
  lean_inc(x_148);
  lean_inc(x_147);
  lean_dec(x_21);
  x_149 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__2;
  lean_inc(x_16);
  x_150 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_150, 0, x_16);
  lean_ctor_set(x_150, 1, x_149);
  x_151 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__8;
  lean_inc(x_19);
  lean_inc(x_147);
  x_152 = l_Lean_addMacroScope(x_147, x_151, x_19);
  x_153 = lean_box(0);
  x_154 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__6;
  x_155 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__11;
  lean_inc(x_16);
  x_156 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_156, 0, x_16);
  lean_ctor_set(x_156, 1, x_154);
  lean_ctor_set(x_156, 2, x_152);
  lean_ctor_set(x_156, 3, x_155);
  x_157 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__15;
  lean_inc(x_19);
  lean_inc(x_147);
  x_158 = l_Lean_addMacroScope(x_147, x_157, x_19);
  x_159 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__14;
  lean_inc(x_16);
  x_160 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_160, 0, x_16);
  lean_ctor_set(x_160, 1, x_159);
  lean_ctor_set(x_160, 2, x_158);
  lean_ctor_set(x_160, 3, x_153);
  lean_inc(x_1);
  x_161 = l_Lean_Name_getString_x21(x_1);
  x_162 = lean_box(2);
  x_163 = l_Lean_Syntax_mkStrLit(x_161, x_162);
  lean_dec(x_161);
  lean_inc(x_2);
  x_164 = l_Nat_repr(x_2);
  x_165 = l_Lean_numLitKind;
  x_166 = l_Lean_Syntax_mkLit(x_165, x_164, x_162);
  x_167 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__17;
  x_168 = lean_array_push(x_167, x_160);
  x_169 = lean_array_push(x_168, x_163);
  x_170 = lean_array_push(x_169, x_166);
  x_171 = lean_array_push(x_170, x_7);
  x_172 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_173 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_173, 0, x_162);
  lean_ctor_set(x_173, 1, x_172);
  lean_ctor_set(x_173, 2, x_171);
  x_174 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_175 = lean_array_push(x_174, x_156);
  x_176 = lean_array_push(x_175, x_173);
  x_177 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__4;
  x_178 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_178, 0, x_162);
  lean_ctor_set(x_178, 1, x_177);
  lean_ctor_set(x_178, 2, x_176);
  lean_inc(x_3);
  x_179 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_179, 0, x_162);
  lean_ctor_set(x_179, 1, x_172);
  lean_ctor_set(x_179, 2, x_3);
  x_180 = lean_array_push(x_174, x_178);
  lean_inc(x_179);
  x_181 = lean_array_push(x_180, x_179);
  x_182 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_182, 0, x_162);
  lean_ctor_set(x_182, 1, x_172);
  lean_ctor_set(x_182, 2, x_181);
  x_183 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__4;
  lean_inc(x_16);
  x_184 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_184, 0, x_16);
  lean_ctor_set(x_184, 1, x_183);
  x_185 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5;
  x_186 = lean_array_push(x_185, x_150);
  lean_inc(x_186);
  x_187 = lean_array_push(x_186, x_182);
  lean_inc(x_184);
  x_188 = lean_array_push(x_187, x_184);
  x_189 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__3;
  x_190 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_190, 0, x_162);
  lean_ctor_set(x_190, 1, x_189);
  lean_ctor_set(x_190, 2, x_188);
  x_191 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___closed__2;
  lean_inc(x_16);
  x_192 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_192, 0, x_16);
  lean_ctor_set(x_192, 1, x_191);
  x_193 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__19;
  lean_inc(x_19);
  lean_inc(x_147);
  x_194 = l_Lean_addMacroScope(x_147, x_193, x_19);
  x_195 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__18;
  x_196 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__24;
  lean_inc(x_16);
  x_197 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_197, 0, x_16);
  lean_ctor_set(x_197, 1, x_195);
  lean_ctor_set(x_197, 2, x_194);
  lean_ctor_set(x_197, 3, x_196);
  x_198 = lean_array_push(x_185, x_190);
  x_199 = lean_array_push(x_198, x_192);
  x_200 = lean_array_push(x_199, x_197);
  x_201 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__2;
  x_202 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_202, 0, x_162);
  lean_ctor_set(x_202, 1, x_201);
  lean_ctor_set(x_202, 2, x_200);
  x_203 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__25;
  lean_inc(x_16);
  x_204 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_204, 0, x_16);
  lean_ctor_set(x_204, 1, x_203);
  x_205 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__17;
  x_206 = l_Lean_addMacroScope(x_147, x_205, x_19);
  x_207 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__16;
  lean_inc(x_16);
  x_208 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_208, 0, x_16);
  lean_ctor_set(x_208, 1, x_207);
  lean_ctor_set(x_208, 2, x_206);
  lean_ctor_set(x_208, 3, x_153);
  x_209 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_210 = lean_array_push(x_209, x_208);
  x_211 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_211, 0, x_162);
  lean_ctor_set(x_211, 1, x_172);
  lean_ctor_set(x_211, 2, x_210);
  x_212 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__16;
  lean_inc(x_16);
  x_213 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_213, 0, x_16);
  lean_ctor_set(x_213, 1, x_212);
  x_214 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__29;
  lean_inc(x_16);
  x_215 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_215, 0, x_16);
  lean_ctor_set(x_215, 1, x_214);
  x_216 = l_Array_zip___rarg(x_4, x_5);
  x_217 = lean_array_get_size(x_216);
  x_218 = lean_usize_of_nat(x_217);
  lean_dec(x_217);
  x_219 = x_216;
  x_220 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6;
  lean_inc(x_179);
  lean_inc(x_16);
  x_221 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4(x_16, x_220, x_167, x_174, x_179, x_185, x_218, x_6, x_219);
  x_222 = x_221;
  lean_inc(x_3);
  x_223 = l_Array_append___rarg(x_3, x_222);
  x_224 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__36;
  x_225 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_225, 0, x_16);
  lean_ctor_set(x_225, 1, x_224);
  x_226 = lean_mk_syntax_ident(x_1);
  x_227 = l_Array_append___rarg(x_3, x_4);
  x_228 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_228, 0, x_162);
  lean_ctor_set(x_228, 1, x_172);
  lean_ctor_set(x_228, 2, x_227);
  x_229 = lean_array_push(x_174, x_226);
  x_230 = lean_array_push(x_229, x_228);
  x_231 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_231, 0, x_162);
  lean_ctor_set(x_231, 1, x_177);
  lean_ctor_set(x_231, 2, x_230);
  x_232 = lean_array_push(x_209, x_231);
  x_233 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_233, 0, x_162);
  lean_ctor_set(x_233, 1, x_172);
  lean_ctor_set(x_233, 2, x_232);
  x_234 = lean_array_push(x_174, x_225);
  x_235 = lean_array_push(x_234, x_233);
  x_236 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__35;
  x_237 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_237, 0, x_162);
  lean_ctor_set(x_237, 1, x_236);
  lean_ctor_set(x_237, 2, x_235);
  x_238 = lean_array_push(x_174, x_237);
  lean_inc(x_179);
  x_239 = lean_array_push(x_238, x_179);
  x_240 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__33;
  x_241 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_241, 0, x_162);
  lean_ctor_set(x_241, 1, x_240);
  lean_ctor_set(x_241, 2, x_239);
  x_242 = lean_array_push(x_223, x_241);
  x_243 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_243, 0, x_162);
  lean_ctor_set(x_243, 1, x_172);
  lean_ctor_set(x_243, 2, x_242);
  x_244 = lean_array_push(x_209, x_243);
  x_245 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__32;
  x_246 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_246, 0, x_162);
  lean_ctor_set(x_246, 1, x_245);
  lean_ctor_set(x_246, 2, x_244);
  x_247 = lean_array_push(x_174, x_215);
  x_248 = lean_array_push(x_247, x_246);
  x_249 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__30;
  x_250 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_250, 0, x_162);
  lean_ctor_set(x_250, 1, x_249);
  lean_ctor_set(x_250, 2, x_248);
  x_251 = lean_array_push(x_185, x_211);
  x_252 = lean_array_push(x_251, x_213);
  x_253 = lean_array_push(x_252, x_250);
  x_254 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__28;
  x_255 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_255, 0, x_162);
  lean_ctor_set(x_255, 1, x_254);
  lean_ctor_set(x_255, 2, x_253);
  x_256 = lean_array_push(x_174, x_204);
  x_257 = lean_array_push(x_256, x_255);
  x_258 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__26;
  x_259 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_259, 0, x_162);
  lean_ctor_set(x_259, 1, x_258);
  lean_ctor_set(x_259, 2, x_257);
  x_260 = lean_array_push(x_174, x_259);
  x_261 = lean_array_push(x_260, x_179);
  x_262 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_262, 0, x_162);
  lean_ctor_set(x_262, 1, x_172);
  lean_ctor_set(x_262, 2, x_261);
  x_263 = lean_array_push(x_186, x_262);
  x_264 = lean_array_push(x_263, x_184);
  x_265 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_265, 0, x_162);
  lean_ctor_set(x_265, 1, x_189);
  lean_ctor_set(x_265, 2, x_264);
  x_266 = lean_array_push(x_209, x_265);
  x_267 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_267, 0, x_162);
  lean_ctor_set(x_267, 1, x_172);
  lean_ctor_set(x_267, 2, x_266);
  x_268 = lean_array_push(x_174, x_202);
  x_269 = lean_array_push(x_268, x_267);
  x_270 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_270, 0, x_162);
  lean_ctor_set(x_270, 1, x_177);
  lean_ctor_set(x_270, 2, x_269);
  x_271 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_271, 0, x_270);
  lean_ctor_set(x_271, 1, x_2);
  x_272 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_272, 0, x_271);
  lean_ctor_set(x_272, 1, x_148);
  return x_272;
  }
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__1() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("none");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__2() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__1;
  x_2 = lean_string_utf8_byte_size(x_1);
  return x_2;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__3() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; 
  x_1 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__1;
  x_2 = lean_unsigned_to_nat(0u);
  x_3 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__2;
  x_4 = lean_alloc_ctor(0, 3, 0);
  lean_ctor_set(x_4, 0, x_1);
  lean_ctor_set(x_4, 1, x_2);
  lean_ctor_set(x_4, 2, x_3);
  return x_4;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__4() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__1;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__5() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("Option");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__6() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__5;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__7() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__6;
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__1;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__8() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__7;
  x_3 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_3, 0, x_2);
  lean_ctor_set(x_3, 1, x_1);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__9() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__8;
  x_3 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_3, 0, x_2);
  lean_ctor_set(x_3, 1, x_1);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__10() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("some");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__11() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__10;
  x_2 = lean_string_utf8_byte_size(x_1);
  return x_2;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__12() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; 
  x_1 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__10;
  x_2 = lean_unsigned_to_nat(0u);
  x_3 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__11;
  x_4 = lean_alloc_ctor(0, 3, 0);
  lean_ctor_set(x_4, 0, x_1);
  lean_ctor_set(x_4, 1, x_2);
  lean_ctor_set(x_4, 2, x_3);
  return x_4;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__13() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__10;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__14() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__6;
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__10;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__15() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__14;
  x_3 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_3, 0, x_2);
  lean_ctor_set(x_3, 1, x_1);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__16() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__15;
  x_3 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_3, 0, x_2);
  lean_ctor_set(x_3, 1, x_1);
  return x_3;
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13) {
  _start:
  {
  lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; 
  lean_dec(x_6);
  x_14 = lean_ctor_get(x_1, 4);
  lean_inc(x_14);
  lean_dec(x_1);
  x_15 = lean_unsigned_to_nat(0u);
  x_16 = lean_unsigned_to_nat(1u);
  lean_inc(x_14);
  x_17 = lean_alloc_ctor(0, 3, 0);
  lean_ctor_set(x_17, 0, x_15);
  lean_ctor_set(x_17, 1, x_14);
  lean_ctor_set(x_17, 2, x_16);
  x_18 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__2;
  lean_inc(x_9);
  lean_inc(x_14);
  x_19 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1(x_2, x_5, x_17, x_14, x_15, x_18, x_7, x_8, x_9, x_10, x_11, x_12, x_13);
  lean_dec(x_17);
  lean_dec(x_5);
  if (lean_obj_tag(x_19) == 0)
  {
  lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; size_t x_25; size_t x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; uint8_t x_35; 
  x_20 = lean_ctor_get(x_19, 0);
  lean_inc(x_20);
  x_21 = lean_ctor_get(x_19, 1);
  lean_inc(x_21);
  lean_dec(x_19);
  x_22 = lean_ctor_get(x_20, 0);
  lean_inc(x_22);
  x_23 = lean_ctor_get(x_20, 1);
  lean_inc(x_23);
  lean_dec(x_20);
  x_24 = lean_array_get_size(x_23);
  x_25 = lean_usize_of_nat(x_24);
  x_26 = 0;
  lean_inc(x_23);
  x_27 = x_23;
  x_28 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__2(x_25, x_26, x_27);
  x_29 = x_28;
  x_30 = lean_mk_empty_array_with_capacity(x_24);
  lean_inc(x_11);
  lean_inc(x_24);
  x_31 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3(x_2, x_3, x_23, x_23, x_24, x_15, lean_box(0), x_30, x_7, x_8, x_9, x_10, x_11, x_12, x_21);
  lean_dec(x_23);
  lean_dec(x_2);
  x_32 = lean_ctor_get(x_31, 0);
  lean_inc(x_32);
  x_33 = lean_ctor_get(x_31, 1);
  lean_inc(x_33);
  lean_dec(x_31);
  x_34 = lean_array_get_size(x_22);
  x_35 = lean_nat_dec_eq(x_24, x_34);
  lean_dec(x_24);
  if (x_35 == 0)
  {
  lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; 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; lean_object* x_50; lean_object* x_51; 
  lean_dec(x_34);
  lean_dec(x_22);
  lean_inc(x_11);
  x_36 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_11, x_12, x_33);
  x_37 = lean_ctor_get(x_36, 0);
  lean_inc(x_37);
  x_38 = lean_ctor_get(x_36, 1);
  lean_inc(x_38);
  lean_dec(x_36);
  x_39 = l_Lean_Elab_Term_getCurrMacroScope(x_7, x_8, x_9, x_10, x_11, x_12, x_38);
  x_40 = lean_ctor_get(x_39, 0);
  lean_inc(x_40);
  x_41 = lean_ctor_get(x_39, 1);
  lean_inc(x_41);
  lean_dec(x_39);
  x_42 = l_Lean_Elab_Term_getMainModule___rarg(x_12, x_41);
  x_43 = lean_ctor_get(x_42, 0);
  lean_inc(x_43);
  x_44 = lean_ctor_get(x_42, 1);
  lean_inc(x_44);
  lean_dec(x_42);
  x_45 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__4;
  x_46 = l_Lean_addMacroScope(x_43, x_45, x_40);
  x_47 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__3;
  x_48 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__9;
  x_49 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_49, 0, x_37);
  lean_ctor_set(x_49, 1, x_47);
  lean_ctor_set(x_49, 2, x_46);
  lean_ctor_set(x_49, 3, x_48);
  x_50 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__1;
  x_51 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1(x_4, x_14, x_50, x_29, x_32, x_26, x_49, x_7, x_8, x_9, x_10, x_11, x_12, x_44);
  lean_dec(x_12);
  lean_dec(x_10);
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_32);
  return x_51;
  }
  else
  {
  lean_object* x_52; lean_object* x_53; lean_object* x_54; 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; lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; size_t x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; lean_object* x_74; size_t x_75; lean_object* x_76; lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_object* x_94; lean_object* x_95; lean_object* x_96; lean_object* x_97; lean_object* x_98; lean_object* x_99; lean_object* x_100; lean_object* x_101; lean_object* x_102; 
  lean_inc(x_11);
  x_52 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_11, x_12, x_33);
  x_53 = lean_ctor_get(x_52, 0);
  lean_inc(x_53);
  x_54 = lean_ctor_get(x_52, 1);
  lean_inc(x_54);
  lean_dec(x_52);
  x_55 = l_Lean_Elab_Term_getCurrMacroScope(x_7, x_8, x_9, x_10, x_11, x_12, x_54);
  x_56 = lean_ctor_get(x_55, 0);
  lean_inc(x_56);
  x_57 = lean_ctor_get(x_55, 1);
  lean_inc(x_57);
  lean_dec(x_55);
  x_58 = l_Lean_Elab_Term_getMainModule___rarg(x_12, x_57);
  x_59 = lean_ctor_get(x_58, 0);
  lean_inc(x_59);
  x_60 = lean_ctor_get(x_58, 1);
  lean_inc(x_60);
  lean_dec(x_58);
  x_61 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__13;
  x_62 = l_Lean_addMacroScope(x_59, x_61, x_56);
  x_63 = lean_box(0);
  x_64 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__12;
  x_65 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__16;
  lean_inc(x_53);
  x_66 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_66, 0, x_53);
  lean_ctor_set(x_66, 1, x_64);
  lean_ctor_set(x_66, 2, x_62);
  lean_ctor_set(x_66, 3, x_65);
  x_67 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__13;
  lean_inc(x_53);
  x_68 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_68, 0, x_53);
  lean_ctor_set(x_68, 1, x_67);
  x_69 = lean_usize_of_nat(x_34);
  lean_dec(x_34);
  x_70 = x_22;
  x_71 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6;
  x_72 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5(x_71, x_63, x_69, x_26, x_70);
  x_73 = x_72;
  x_74 = lean_array_get_size(x_73);
  x_75 = lean_usize_of_nat(x_74);
  lean_dec(x_74);
  x_76 = x_73;
  x_77 = l_Array_mapMUnsafe_map___at___aux__Init__NotationExtra______macroRules___xabterm_x25_x5b___x7c___x5d_xbb__1___spec__3(x_75, x_26, x_76);
  x_78 = x_77;
  x_79 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__15;
  x_80 = l_Lean_mkSepArray(x_78, x_79);
  lean_dec(x_78);
  x_81 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__1;
  x_82 = l_Array_append___rarg(x_81, x_80);
  x_83 = lean_box(2);
  x_84 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_85 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_85, 0, x_83);
  lean_ctor_set(x_85, 1, x_84);
  lean_ctor_set(x_85, 2, x_82);
  x_86 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__4;
  x_87 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_87, 0, x_53);
  lean_ctor_set(x_87, 1, x_86);
  x_88 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5;
  x_89 = lean_array_push(x_88, x_68);
  x_90 = lean_array_push(x_89, x_85);
  x_91 = lean_array_push(x_90, x_87);
  x_92 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__12;
  x_93 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_93, 0, x_83);
  lean_ctor_set(x_93, 1, x_92);
  lean_ctor_set(x_93, 2, x_91);
  x_94 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_95 = lean_array_push(x_94, x_93);
  x_96 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_96, 0, x_83);
  lean_ctor_set(x_96, 1, x_84);
  lean_ctor_set(x_96, 2, x_95);
  x_97 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_98 = lean_array_push(x_97, x_66);
  x_99 = lean_array_push(x_98, x_96);
  x_100 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__4;
  x_101 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_101, 0, x_83);
  lean_ctor_set(x_101, 1, x_100);
  lean_ctor_set(x_101, 2, x_99);
  x_102 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1(x_4, x_14, x_81, x_29, x_32, x_26, x_101, x_7, x_8, x_9, x_10, x_11, x_12, x_60);
  lean_dec(x_12);
  lean_dec(x_10);
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_32);
  return x_102;
  }
  }
  else
  {
  uint8_t x_103; 
  lean_dec(x_14);
  lean_dec(x_12);
  lean_dec(x_11);
  lean_dec(x_10);
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_4);
  lean_dec(x_3);
  lean_dec(x_2);
  x_103 = !lean_is_exclusive(x_19);
  if (x_103 == 0)
  {
  return x_19;
  }
  else
  {
  lean_object* x_104; lean_object* x_105; lean_object* x_106; 
  x_104 = lean_ctor_get(x_19, 0);
  x_105 = lean_ctor_get(x_19, 1);
  lean_inc(x_105);
  lean_inc(x_104);
  lean_dec(x_19);
  x_106 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_106, 0, x_104);
  lean_ctor_set(x_106, 1, x_105);
  return x_106;
  }
  }
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6(lean_object* x_1, lean_object* x_2, size_t x_3, size_t x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12) {
  _start:
  {
  uint8_t x_13; 
  x_13 = lean_usize_dec_lt(x_4, x_3);
  if (x_13 == 0)
  {
  lean_object* x_14; lean_object* x_15; 
  lean_dec(x_11);
  lean_dec(x_10);
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_2);
  lean_dec(x_1);
  x_14 = x_5;
  x_15 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_15, 0, x_14);
  lean_ctor_set(x_15, 1, x_12);
  return x_15;
  }
  else
  {
  lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; 
  x_16 = lean_array_uget(x_5, x_4);
  x_17 = lean_unsigned_to_nat(0u);
  x_18 = lean_array_uset(x_5, x_4, x_17);
  x_19 = x_16;
  lean_inc(x_6);
  lean_inc(x_19);
  x_20 = l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1(x_19, x_6, x_7, x_8, x_9, x_10, x_11, x_12);
  if (lean_obj_tag(x_20) == 0)
  {
  lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; 
  x_21 = lean_ctor_get(x_20, 0);
  lean_inc(x_21);
  x_22 = lean_ctor_get(x_20, 1);
  lean_inc(x_22);
  lean_dec(x_20);
  x_23 = lean_ctor_get(x_21, 0);
  lean_inc(x_23);
  x_24 = lean_ctor_get(x_23, 2);
  lean_inc(x_24);
  lean_dec(x_23);
  lean_inc(x_2);
  lean_inc(x_1);
  x_25 = lean_alloc_closure((void*)(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2), 13, 4);
  lean_closure_set(x_25, 0, x_21);
  lean_closure_set(x_25, 1, x_1);
  lean_closure_set(x_25, 2, x_2);
  lean_closure_set(x_25, 3, x_19);
  lean_inc(x_11);
  lean_inc(x_10);
  lean_inc(x_9);
  lean_inc(x_8);
  lean_inc(x_7);
  lean_inc(x_6);
  x_26 = l_Lean_Meta_forallTelescopeReducing___at_Lean_Elab_Deriving_mkInductArgNames___spec__2___rarg(x_24, x_25, x_6, x_7, x_8, x_9, x_10, x_11, x_22);
  if (lean_obj_tag(x_26) == 0)
  {
  lean_object* x_27; lean_object* x_28; size_t x_29; size_t x_30; lean_object* x_31; lean_object* x_32; 
  x_27 = lean_ctor_get(x_26, 0);
  lean_inc(x_27);
  x_28 = lean_ctor_get(x_26, 1);
  lean_inc(x_28);
  lean_dec(x_26);
  x_29 = 1;
  x_30 = lean_usize_add(x_4, x_29);
  x_31 = x_27;
  x_32 = lean_array_uset(x_18, x_4, x_31);
  x_4 = x_30;
  x_5 = x_32;
  x_12 = x_28;
  goto _start;
  }
  else
  {
  uint8_t x_34; 
  lean_dec(x_18);
  lean_dec(x_11);
  lean_dec(x_10);
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_2);
  lean_dec(x_1);
  x_34 = !lean_is_exclusive(x_26);
  if (x_34 == 0)
  {
  return x_26;
  }
  else
  {
  lean_object* x_35; lean_object* x_36; lean_object* x_37; 
  x_35 = lean_ctor_get(x_26, 0);
  x_36 = lean_ctor_get(x_26, 1);
  lean_inc(x_36);
  lean_inc(x_35);
  lean_dec(x_26);
  x_37 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_37, 0, x_35);
  lean_ctor_set(x_37, 1, x_36);
  return x_37;
  }
  }
  }
  else
  {
  uint8_t x_38; 
  lean_dec(x_19);
  lean_dec(x_18);
  lean_dec(x_11);
  lean_dec(x_10);
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_2);
  lean_dec(x_1);
  x_38 = !lean_is_exclusive(x_20);
  if (x_38 == 0)
  {
  return x_20;
  }
  else
  {
  lean_object* x_39; lean_object* x_40; lean_object* x_41; 
  x_39 = lean_ctor_get(x_20, 0);
  x_40 = lean_ctor_get(x_20, 1);
  lean_inc(x_40);
  lean_inc(x_39);
  lean_dec(x_20);
  x_41 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_41, 0, x_39);
  lean_ctor_set(x_41, 1, x_40);
  return x_41;
  }
  }
  }
  }
  }
  static lean_object* _init_l_Array_qpartition_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__8___closed__1() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Lean_instInhabitedSyntax;
  x_2 = l_instInhabitedNat;
  x_3 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_3, 0, x_1);
  lean_ctor_set(x_3, 1, x_2);
  return x_3;
  }
  }
  LEAN_EXPORT lean_object* l_Array_qpartition_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__8(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:
  {
  uint8_t x_7; 
  x_7 = lean_nat_dec_lt(x_6, x_2);
  if (x_7 == 0)
  {
  lean_object* x_8; lean_object* x_9; 
  lean_dec(x_6);
  lean_dec(x_3);
  lean_dec(x_1);
  x_8 = lean_array_swap(x_4, x_5, x_2);
  x_9 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_9, 0, x_5);
  lean_ctor_set(x_9, 1, x_8);
  return x_9;
  }
  else
  {
  lean_object* x_10; lean_object* x_11; lean_object* x_12; uint8_t x_13; 
  x_10 = l_Array_qpartition_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__8___closed__1;
  x_11 = lean_array_get(x_10, x_4, x_6);
  lean_inc(x_1);
  lean_inc(x_3);
  x_12 = lean_apply_2(x_1, x_11, x_3);
  x_13 = lean_unbox(x_12);
  lean_dec(x_12);
  if (x_13 == 0)
  {
  lean_object* x_14; lean_object* x_15; 
  x_14 = lean_unsigned_to_nat(1u);
  x_15 = lean_nat_add(x_6, x_14);
  lean_dec(x_6);
  x_6 = x_15;
  goto _start;
  }
  else
  {
  lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; 
  x_17 = lean_array_swap(x_4, x_5, x_6);
  x_18 = lean_unsigned_to_nat(1u);
  x_19 = lean_nat_add(x_5, x_18);
  lean_dec(x_5);
  x_20 = lean_nat_add(x_6, x_18);
  lean_dec(x_6);
  x_4 = x_17;
  x_5 = x_19;
  x_6 = x_20;
  goto _start;
  }
  }
  }
  }
  LEAN_EXPORT uint8_t l_Array_qsort_sort___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__7___lambda__1(lean_object* x_1, lean_object* x_2) {
  _start:
  {
  lean_object* x_3; lean_object* x_4; uint8_t x_5; 
  x_3 = lean_ctor_get(x_1, 1);
  x_4 = lean_ctor_get(x_2, 1);
  x_5 = lean_nat_dec_lt(x_3, x_4);
  return x_5;
  }
  }
  static lean_object* _init_l_Array_qsort_sort___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__7___closed__1() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_alloc_closure((void*)(l_Array_qsort_sort___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__7___lambda__1___boxed), 2, 0);
  return x_1;
  }
  }
  LEAN_EXPORT lean_object* l_Array_qsort_sort___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__7(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
  _start:
  {
  lean_object* x_4; uint8_t x_13; 
  x_13 = lean_nat_dec_lt(x_2, x_3);
  if (x_13 == 0)
  {
  lean_dec(x_2);
  return x_1;
  }
  else
  {
  lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_46; lean_object* x_47; lean_object* x_48; lean_object* x_49; lean_object* x_50; uint8_t x_51; 
  x_14 = lean_nat_add(x_2, x_3);
  x_15 = lean_unsigned_to_nat(2u);
  x_16 = lean_nat_div(x_14, x_15);
  lean_dec(x_14);
  x_46 = l_Array_qpartition_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__8___closed__1;
  x_47 = lean_array_get(x_46, x_1, x_16);
  x_48 = lean_array_get(x_46, x_1, x_2);
  x_49 = lean_ctor_get(x_47, 1);
  lean_inc(x_49);
  lean_dec(x_47);
  x_50 = lean_ctor_get(x_48, 1);
  lean_inc(x_50);
  lean_dec(x_48);
  x_51 = lean_nat_dec_lt(x_49, x_50);
  lean_dec(x_50);
  lean_dec(x_49);
  if (x_51 == 0)
  {
  x_17 = x_1;
  goto block_45;
  }
  else
  {
  lean_object* x_52; 
  x_52 = lean_array_swap(x_1, x_2, x_16);
  x_17 = x_52;
  goto block_45;
  }
  block_45:
  {
  lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; uint8_t x_23; 
  x_18 = l_Array_qpartition_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__8___closed__1;
  x_19 = lean_array_get(x_18, x_17, x_3);
  x_20 = lean_array_get(x_18, x_17, x_2);
  x_21 = lean_ctor_get(x_19, 1);
  lean_inc(x_21);
  x_22 = lean_ctor_get(x_20, 1);
  lean_inc(x_22);
  lean_dec(x_20);
  x_23 = lean_nat_dec_lt(x_21, x_22);
  lean_dec(x_22);
  if (x_23 == 0)
  {
  lean_object* x_24; lean_object* x_25; uint8_t x_26; 
  x_24 = lean_array_get(x_18, x_17, x_16);
  x_25 = lean_ctor_get(x_24, 1);
  lean_inc(x_25);
  lean_dec(x_24);
  x_26 = lean_nat_dec_lt(x_25, x_21);
  lean_dec(x_21);
  lean_dec(x_25);
  if (x_26 == 0)
  {
  lean_object* x_27; lean_object* x_28; 
  lean_dec(x_16);
  x_27 = l_Array_qsort_sort___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__7___closed__1;
  lean_inc_n(x_2, 2);
  x_28 = l_Array_qpartition_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__8(x_27, x_3, x_19, x_17, x_2, x_2);
  x_4 = x_28;
  goto block_12;
  }
  else
  {
  lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; 
  lean_dec(x_19);
  x_29 = lean_array_swap(x_17, x_16, x_3);
  lean_dec(x_16);
  x_30 = lean_array_get(x_18, x_29, x_3);
  x_31 = l_Array_qsort_sort___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__7___closed__1;
  lean_inc_n(x_2, 2);
  x_32 = l_Array_qpartition_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__8(x_31, x_3, x_30, x_29, x_2, x_2);
  x_4 = x_32;
  goto block_12;
  }
  }
  else
  {
  lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; uint8_t x_38; 
  lean_dec(x_21);
  lean_dec(x_19);
  x_33 = lean_array_swap(x_17, x_2, x_3);
  x_34 = lean_array_get(x_18, x_33, x_16);
  x_35 = lean_array_get(x_18, x_33, x_3);
  x_36 = lean_ctor_get(x_34, 1);
  lean_inc(x_36);
  lean_dec(x_34);
  x_37 = lean_ctor_get(x_35, 1);
  lean_inc(x_37);
  x_38 = lean_nat_dec_lt(x_36, x_37);
  lean_dec(x_37);
  lean_dec(x_36);
  if (x_38 == 0)
  {
  lean_object* x_39; lean_object* x_40; 
  lean_dec(x_16);
  x_39 = l_Array_qsort_sort___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__7___closed__1;
  lean_inc_n(x_2, 2);
  x_40 = l_Array_qpartition_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__8(x_39, x_3, x_35, x_33, x_2, x_2);
  x_4 = x_40;
  goto block_12;
  }
  else
  {
  lean_object* x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44; 
  lean_dec(x_35);
  x_41 = lean_array_swap(x_33, x_16, x_3);
  lean_dec(x_16);
  x_42 = lean_array_get(x_18, x_41, x_3);
  x_43 = l_Array_qsort_sort___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__7___closed__1;
  lean_inc_n(x_2, 2);
  x_44 = l_Array_qpartition_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__8(x_43, x_3, x_42, x_41, x_2, x_2);
  x_4 = x_44;
  goto block_12;
  }
  }
  }
  }
  block_12:
  {
  lean_object* x_5; lean_object* x_6; uint8_t x_7; 
  x_5 = lean_ctor_get(x_4, 0);
  lean_inc(x_5);
  x_6 = lean_ctor_get(x_4, 1);
  lean_inc(x_6);
  lean_dec(x_4);
  x_7 = lean_nat_dec_le(x_3, x_5);
  if (x_7 == 0)
  {
  lean_object* x_8; lean_object* x_9; lean_object* x_10; 
  x_8 = l_Array_qsort_sort___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__7(x_6, x_2, x_5);
  x_9 = lean_unsigned_to_nat(1u);
  x_10 = lean_nat_add(x_5, x_9);
  lean_dec(x_5);
  x_1 = x_8;
  x_2 = x_10;
  goto _start;
  }
  else
  {
  lean_dec(x_5);
  lean_dec(x_2);
  return x_6;
  }
  }
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__9(size_t x_1, size_t x_2, lean_object* x_3) {
  _start:
  {
  uint8_t x_4; 
  x_4 = lean_usize_dec_lt(x_2, x_1);
  if (x_4 == 0)
  {
  lean_object* x_5; 
  x_5 = x_3;
  return x_5;
  }
  else
  {
  lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; size_t x_11; size_t x_12; lean_object* x_13; lean_object* x_14; 
  x_6 = lean_array_uget(x_3, x_2);
  x_7 = lean_unsigned_to_nat(0u);
  x_8 = lean_array_uset(x_3, x_2, x_7);
  x_9 = x_6;
  x_10 = lean_ctor_get(x_9, 0);
  lean_inc(x_10);
  lean_dec(x_9);
  x_11 = 1;
  x_12 = lean_usize_add(x_2, x_11);
  x_13 = x_10;
  x_14 = lean_array_uset(x_8, x_2, x_13);
  x_2 = x_12;
  x_3 = x_14;
  goto _start;
  }
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___boxed__const__1() {
  _start:
  {
  size_t x_1; lean_object* x_2; 
  x_1 = 0;
  x_2 = lean_box_usize(x_1);
  return x_2;
  }
  }
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9) {
  _start:
  {
  lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; size_t x_15; size_t x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; 
  x_10 = lean_ctor_get(x_1, 4);
  lean_inc(x_10);
  x_11 = l_List_redLength___rarg(x_10);
  x_12 = lean_mk_empty_array_with_capacity(x_11);
  lean_dec(x_11);
  x_13 = l_List_toArrayAux___rarg(x_10, x_12);
  x_14 = lean_array_get_size(x_13);
  x_15 = lean_usize_of_nat(x_14);
  lean_dec(x_14);
  x_16 = 0;
  x_17 = x_13;
  x_18 = lean_box_usize(x_15);
  x_19 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___boxed__const__1;
  x_20 = lean_alloc_closure((void*)(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___boxed), 12, 5);
  lean_closure_set(x_20, 0, x_1);
  lean_closure_set(x_20, 1, x_2);
  lean_closure_set(x_20, 2, x_18);
  lean_closure_set(x_20, 3, x_19);
  lean_closure_set(x_20, 4, x_17);
  x_21 = x_20;
  x_22 = lean_apply_7(x_21, x_3, x_4, x_5, x_6, x_7, x_8, x_9);
  if (lean_obj_tag(x_22) == 0)
  {
  uint8_t x_23; 
  x_23 = !lean_is_exclusive(x_22);
  if (x_23 == 0)
  {
  lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; size_t x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; 
  x_24 = lean_ctor_get(x_22, 0);
  x_25 = lean_array_get_size(x_24);
  x_26 = lean_unsigned_to_nat(1u);
  x_27 = lean_nat_sub(x_25, x_26);
  lean_dec(x_25);
  x_28 = lean_unsigned_to_nat(0u);
  x_29 = l_Array_qsort_sort___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__7(x_24, x_28, x_27);
  lean_dec(x_27);
  x_30 = lean_array_get_size(x_29);
  x_31 = lean_usize_of_nat(x_30);
  lean_dec(x_30);
  x_32 = x_29;
  x_33 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__9(x_31, x_16, x_32);
  x_34 = x_33;
  lean_ctor_set(x_22, 0, x_34);
  return x_22;
  }
  else
  {
  lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; size_t x_43; lean_object* x_44; lean_object* x_45; lean_object* x_46; lean_object* x_47; 
  x_35 = lean_ctor_get(x_22, 0);
  x_36 = lean_ctor_get(x_22, 1);
  lean_inc(x_36);
  lean_inc(x_35);
  lean_dec(x_22);
  x_37 = lean_array_get_size(x_35);
  x_38 = lean_unsigned_to_nat(1u);
  x_39 = lean_nat_sub(x_37, x_38);
  lean_dec(x_37);
  x_40 = lean_unsigned_to_nat(0u);
  x_41 = l_Array_qsort_sort___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__7(x_35, x_40, x_39);
  lean_dec(x_39);
  x_42 = lean_array_get_size(x_41);
  x_43 = lean_usize_of_nat(x_42);
  lean_dec(x_42);
  x_44 = x_41;
  x_45 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__9(x_43, x_16, x_44);
  x_46 = x_45;
  x_47 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_47, 0, x_46);
  lean_ctor_set(x_47, 1, x_36);
  return x_47;
  }
  }
  else
  {
  uint8_t x_48; 
  x_48 = !lean_is_exclusive(x_22);
  if (x_48 == 0)
  {
  return x_22;
  }
  else
  {
  lean_object* x_49; lean_object* x_50; lean_object* x_51; 
  x_49 = lean_ctor_get(x_22, 0);
  x_50 = lean_ctor_get(x_22, 1);
  lean_inc(x_50);
  lean_inc(x_49);
  lean_dec(x_22);
  x_51 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_51, 0, x_49);
  lean_ctor_set(x_51, 1, x_50);
  return x_51;
  }
  }
  }
  }
  LEAN_EXPORT lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1___lambda__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, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11) {
  _start:
  {
  lean_object* x_12; 
  x_12 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1___lambda__1(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11);
  lean_dec(x_10);
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_5);
  lean_dec(x_4);
  lean_dec(x_1);
  return x_12;
  }
  }
  LEAN_EXPORT lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___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, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13) {
  _start:
  {
  lean_object* x_14; 
  x_14 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12, x_13);
  lean_dec(x_12);
  lean_dec(x_11);
  lean_dec(x_10);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_3);
  lean_dec(x_2);
  lean_dec(x_1);
  return x_14;
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__2___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
  _start:
  {
  size_t x_4; size_t x_5; lean_object* x_6; 
  x_4 = lean_unbox_usize(x_1);
  lean_dec(x_1);
  x_5 = lean_unbox_usize(x_2);
  lean_dec(x_2);
  x_6 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__2(x_4, x_5, x_3);
  return x_6;
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___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, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13, lean_object* x_14, lean_object* x_15) {
  _start:
  {
  lean_object* x_16; 
  x_16 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12, x_13, x_14, x_15);
  lean_dec(x_14);
  lean_dec(x_12);
  lean_dec(x_11);
  lean_dec(x_10);
  lean_dec(x_9);
  lean_dec(x_4);
  lean_dec(x_3);
  lean_dec(x_1);
  return x_16;
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___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, lean_object* x_7, lean_object* x_8, lean_object* x_9) {
  _start:
  {
  size_t x_10; size_t x_11; lean_object* x_12; 
  x_10 = lean_unbox_usize(x_7);
  lean_dec(x_7);
  x_11 = lean_unbox_usize(x_8);
  lean_dec(x_8);
  x_12 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4(x_1, x_2, x_3, x_4, x_5, x_6, x_10, x_11, x_9);
  return x_12;
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
  _start:
  {
  size_t x_6; size_t x_7; lean_object* x_8; 
  x_6 = lean_unbox_usize(x_3);
  lean_dec(x_3);
  x_7 = lean_unbox_usize(x_4);
  lean_dec(x_4);
  x_8 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5(x_1, x_2, x_6, x_7, x_5);
  return x_8;
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__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, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13, lean_object* x_14) {
  _start:
  {
  size_t x_15; lean_object* x_16; 
  x_15 = lean_unbox_usize(x_6);
  lean_dec(x_6);
  x_16 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1(x_1, x_2, x_3, x_4, x_5, x_15, x_7, x_8, x_9, x_10, x_11, x_12, x_13, x_14);
  lean_dec(x_13);
  lean_dec(x_11);
  lean_dec(x_10);
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_5);
  return x_16;
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___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, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12) {
  _start:
  {
  size_t x_13; size_t x_14; lean_object* x_15; 
  x_13 = lean_unbox_usize(x_3);
  lean_dec(x_3);
  x_14 = lean_unbox_usize(x_4);
  lean_dec(x_4);
  x_15 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6(x_1, x_2, x_13, x_14, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12);
  return x_15;
  }
  }
  LEAN_EXPORT lean_object* l_Array_qpartition_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__8___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_7; 
  x_7 = l_Array_qpartition_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__8(x_1, x_2, x_3, x_4, x_5, x_6);
  lean_dec(x_2);
  return x_7;
  }
  }
  LEAN_EXPORT lean_object* l_Array_qsort_sort___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__7___lambda__1___boxed(lean_object* x_1, lean_object* x_2) {
  _start:
  {
  uint8_t x_3; lean_object* x_4; 
  x_3 = l_Array_qsort_sort___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__7___lambda__1(x_1, x_2);
  lean_dec(x_2);
  lean_dec(x_1);
  x_4 = lean_box(x_3);
  return x_4;
  }
  }
  LEAN_EXPORT lean_object* l_Array_qsort_sort___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__7___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
  _start:
  {
  lean_object* x_4; 
  x_4 = l_Array_qsort_sort___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__7(x_1, x_2, x_3);
  lean_dec(x_3);
  return x_4;
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__9___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
  _start:
  {
  size_t x_4; size_t x_5; lean_object* x_6; 
  x_4 = lean_unbox_usize(x_1);
  lean_dec(x_1);
  x_5 = lean_unbox_usize(x_2);
  lean_dec(x_2);
  x_6 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__9(x_4, x_5, x_3);
  return x_6;
  }
  }
  static lean_object* _init_l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1___closed__1() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("Except.orElseLazy");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1___closed__2() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1___closed__1;
  x_2 = lean_string_utf8_byte_size(x_1);
  return x_2;
  }
  }
  static lean_object* _init_l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1___closed__3() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; 
  x_1 = l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1___closed__1;
  x_2 = lean_unsigned_to_nat(0u);
  x_3 = l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1___closed__2;
  x_4 = lean_alloc_ctor(0, 3, 0);
  lean_ctor_set(x_4, 0, x_1);
  lean_ctor_set(x_4, 1, x_2);
  lean_ctor_set(x_4, 2, x_3);
  return x_4;
  }
  }
  static lean_object* _init_l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1___closed__4() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("orElseLazy");
  return x_1;
  }
  }
  LEAN_EXPORT lean_object* l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___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, lean_object* x_7, lean_object* x_8, lean_object* x_9, size_t x_10, size_t x_11, lean_object* x_12, lean_object* x_13, lean_object* x_14, lean_object* x_15, lean_object* x_16, lean_object* x_17, lean_object* x_18, lean_object* x_19) {
  _start:
  {
  uint8_t x_20; 
  x_20 = lean_usize_dec_eq(x_10, x_11);
  if (x_20 == 0)
  {
  size_t x_21; size_t x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; 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; lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; 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; lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76; lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; 
  x_21 = 1;
  x_22 = lean_usize_sub(x_10, x_21);
  x_23 = lean_array_uget(x_9, x_22);
  lean_inc(x_17);
  x_24 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_17, x_18, x_19);
  x_25 = lean_ctor_get(x_24, 0);
  lean_inc(x_25);
  x_26 = lean_ctor_get(x_24, 1);
  lean_inc(x_26);
  lean_dec(x_24);
  x_27 = l_Lean_Elab_Term_getCurrMacroScope(x_13, x_14, x_15, x_16, x_17, x_18, x_26);
  x_28 = lean_ctor_get(x_27, 0);
  lean_inc(x_28);
  x_29 = lean_ctor_get(x_27, 1);
  lean_inc(x_29);
  lean_dec(x_27);
  x_30 = l_Lean_Elab_Term_getMainModule___rarg(x_18, x_29);
  x_31 = lean_ctor_get(x_30, 0);
  lean_inc(x_31);
  x_32 = lean_ctor_get(x_30, 1);
  lean_inc(x_32);
  lean_dec(x_30);
  x_33 = l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1___closed__4;
  lean_inc(x_3);
  x_34 = lean_name_mk_string(x_3, x_33);
  lean_inc(x_34);
  x_35 = l_Lean_addMacroScope(x_31, x_34, x_28);
  lean_inc(x_4);
  x_36 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_36, 0, x_34);
  lean_ctor_set(x_36, 1, x_4);
  lean_inc(x_5);
  x_37 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_37, 0, x_36);
  lean_ctor_set(x_37, 1, x_5);
  x_38 = l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1___closed__3;
  lean_inc(x_25);
  x_39 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_39, 0, x_25);
  lean_ctor_set(x_39, 1, x_38);
  lean_ctor_set(x_39, 2, x_35);
  lean_ctor_set(x_39, 3, x_37);
  x_40 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__1;
  lean_inc(x_1);
  x_41 = lean_name_mk_string(x_1, x_40);
  x_42 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__2;
  lean_inc(x_25);
  x_43 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_43, 0, x_25);
  lean_ctor_set(x_43, 1, x_42);
  x_44 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__25;
  lean_inc(x_1);
  x_45 = lean_name_mk_string(x_1, x_44);
  lean_inc(x_25);
  x_46 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_46, 0, x_25);
  lean_ctor_set(x_46, 1, x_44);
  x_47 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__27;
  lean_inc(x_1);
  x_48 = lean_name_mk_string(x_1, x_47);
  x_49 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__7;
  lean_inc(x_1);
  x_50 = lean_name_mk_string(x_1, x_49);
  x_51 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__9;
  lean_inc(x_25);
  x_52 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_52, 0, x_25);
  lean_ctor_set(x_52, 1, x_51);
  lean_inc(x_7);
  x_53 = lean_array_push(x_7, x_52);
  x_54 = lean_box(2);
  x_55 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_55, 0, x_54);
  lean_ctor_set(x_55, 1, x_50);
  lean_ctor_set(x_55, 2, x_53);
  lean_inc(x_7);
  x_56 = lean_array_push(x_7, x_55);
  lean_inc(x_6);
  x_57 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_57, 0, x_54);
  lean_ctor_set(x_57, 1, x_6);
  lean_ctor_set(x_57, 2, x_56);
  x_58 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__16;
  lean_inc(x_25);
  x_59 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_59, 0, x_25);
  lean_ctor_set(x_59, 1, x_58);
  x_60 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5;
  x_61 = lean_array_push(x_60, x_57);
  x_62 = lean_array_push(x_61, x_59);
  x_63 = lean_array_push(x_62, x_12);
  x_64 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_64, 0, x_54);
  lean_ctor_set(x_64, 1, x_48);
  lean_ctor_set(x_64, 2, x_63);
  lean_inc(x_8);
  x_65 = lean_array_push(x_8, x_46);
  x_66 = lean_array_push(x_65, x_64);
  x_67 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_67, 0, x_54);
  lean_ctor_set(x_67, 1, x_45);
  lean_ctor_set(x_67, 2, x_66);
  x_68 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__1;
  lean_inc(x_6);
  x_69 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_69, 0, x_54);
  lean_ctor_set(x_69, 1, x_6);
  lean_ctor_set(x_69, 2, x_68);
  lean_inc(x_8);
  x_70 = lean_array_push(x_8, x_67);
  x_71 = lean_array_push(x_70, x_69);
  lean_inc(x_6);
  x_72 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_72, 0, x_54);
  lean_ctor_set(x_72, 1, x_6);
  lean_ctor_set(x_72, 2, x_71);
  x_73 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__4;
  x_74 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_74, 0, x_25);
  lean_ctor_set(x_74, 1, x_73);
  x_75 = lean_array_push(x_60, x_43);
  x_76 = lean_array_push(x_75, x_72);
  x_77 = lean_array_push(x_76, x_74);
  x_78 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_78, 0, x_54);
  lean_ctor_set(x_78, 1, x_41);
  lean_ctor_set(x_78, 2, x_77);
  lean_inc(x_8);
  x_79 = lean_array_push(x_8, x_23);
  x_80 = lean_array_push(x_79, x_78);
  lean_inc(x_6);
  x_81 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_81, 0, x_54);
  lean_ctor_set(x_81, 1, x_6);
  lean_ctor_set(x_81, 2, x_80);
  lean_inc(x_8);
  x_82 = lean_array_push(x_8, x_39);
  x_83 = lean_array_push(x_82, x_81);
  lean_inc(x_2);
  x_84 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_84, 0, x_54);
  lean_ctor_set(x_84, 1, x_2);
  lean_ctor_set(x_84, 2, x_83);
  x_10 = x_22;
  x_12 = x_84;
  x_19 = x_32;
  goto _start;
  }
  else
  {
  lean_object* x_86; 
  lean_dec(x_17);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_5);
  lean_dec(x_4);
  lean_dec(x_3);
  lean_dec(x_2);
  lean_dec(x_1);
  x_86 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_86, 0, x_12);
  lean_ctor_set(x_86, 1, x_19);
  return x_86;
  }
  }
  }
  LEAN_EXPORT lean_object* l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, size_t x_10, size_t x_11, lean_object* x_12, lean_object* x_13, lean_object* x_14, lean_object* x_15, lean_object* x_16, lean_object* x_17, lean_object* x_18, lean_object* x_19) {
  _start:
  {
  uint8_t x_20; 
  x_20 = lean_usize_dec_eq(x_10, x_11);
  if (x_20 == 0)
  {
  size_t x_21; size_t x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; 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; lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; 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; lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76; lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; 
  x_21 = 1;
  x_22 = lean_usize_sub(x_10, x_21);
  x_23 = lean_array_uget(x_9, x_22);
  lean_inc(x_17);
  x_24 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_17, x_18, x_19);
  x_25 = lean_ctor_get(x_24, 0);
  lean_inc(x_25);
  x_26 = lean_ctor_get(x_24, 1);
  lean_inc(x_26);
  lean_dec(x_24);
  x_27 = l_Lean_Elab_Term_getCurrMacroScope(x_13, x_14, x_15, x_16, x_17, x_18, x_26);
  x_28 = lean_ctor_get(x_27, 0);
  lean_inc(x_28);
  x_29 = lean_ctor_get(x_27, 1);
  lean_inc(x_29);
  lean_dec(x_27);
  x_30 = l_Lean_Elab_Term_getMainModule___rarg(x_18, x_29);
  x_31 = lean_ctor_get(x_30, 0);
  lean_inc(x_31);
  x_32 = lean_ctor_get(x_30, 1);
  lean_inc(x_32);
  lean_dec(x_30);
  x_33 = l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1___closed__4;
  lean_inc(x_3);
  x_34 = lean_name_mk_string(x_3, x_33);
  lean_inc(x_34);
  x_35 = l_Lean_addMacroScope(x_31, x_34, x_28);
  lean_inc(x_4);
  x_36 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_36, 0, x_34);
  lean_ctor_set(x_36, 1, x_4);
  lean_inc(x_5);
  x_37 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_37, 0, x_36);
  lean_ctor_set(x_37, 1, x_5);
  x_38 = l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1___closed__3;
  lean_inc(x_25);
  x_39 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_39, 0, x_25);
  lean_ctor_set(x_39, 1, x_38);
  lean_ctor_set(x_39, 2, x_35);
  lean_ctor_set(x_39, 3, x_37);
  x_40 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__1;
  lean_inc(x_1);
  x_41 = lean_name_mk_string(x_1, x_40);
  x_42 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__2;
  lean_inc(x_25);
  x_43 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_43, 0, x_25);
  lean_ctor_set(x_43, 1, x_42);
  x_44 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__25;
  lean_inc(x_1);
  x_45 = lean_name_mk_string(x_1, x_44);
  lean_inc(x_25);
  x_46 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_46, 0, x_25);
  lean_ctor_set(x_46, 1, x_44);
  x_47 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__27;
  lean_inc(x_1);
  x_48 = lean_name_mk_string(x_1, x_47);
  x_49 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__7;
  lean_inc(x_1);
  x_50 = lean_name_mk_string(x_1, x_49);
  x_51 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__9;
  lean_inc(x_25);
  x_52 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_52, 0, x_25);
  lean_ctor_set(x_52, 1, x_51);
  lean_inc(x_7);
  x_53 = lean_array_push(x_7, x_52);
  x_54 = lean_box(2);
  x_55 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_55, 0, x_54);
  lean_ctor_set(x_55, 1, x_50);
  lean_ctor_set(x_55, 2, x_53);
  lean_inc(x_7);
  x_56 = lean_array_push(x_7, x_55);
  lean_inc(x_6);
  x_57 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_57, 0, x_54);
  lean_ctor_set(x_57, 1, x_6);
  lean_ctor_set(x_57, 2, x_56);
  x_58 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__16;
  lean_inc(x_25);
  x_59 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_59, 0, x_25);
  lean_ctor_set(x_59, 1, x_58);
  x_60 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5;
  x_61 = lean_array_push(x_60, x_57);
  x_62 = lean_array_push(x_61, x_59);
  x_63 = lean_array_push(x_62, x_12);
  x_64 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_64, 0, x_54);
  lean_ctor_set(x_64, 1, x_48);
  lean_ctor_set(x_64, 2, x_63);
  lean_inc(x_8);
  x_65 = lean_array_push(x_8, x_46);
  x_66 = lean_array_push(x_65, x_64);
  x_67 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_67, 0, x_54);
  lean_ctor_set(x_67, 1, x_45);
  lean_ctor_set(x_67, 2, x_66);
  x_68 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__1;
  lean_inc(x_6);
  x_69 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_69, 0, x_54);
  lean_ctor_set(x_69, 1, x_6);
  lean_ctor_set(x_69, 2, x_68);
  lean_inc(x_8);
  x_70 = lean_array_push(x_8, x_67);
  x_71 = lean_array_push(x_70, x_69);
  lean_inc(x_6);
  x_72 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_72, 0, x_54);
  lean_ctor_set(x_72, 1, x_6);
  lean_ctor_set(x_72, 2, x_71);
  x_73 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__4;
  x_74 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_74, 0, x_25);
  lean_ctor_set(x_74, 1, x_73);
  x_75 = lean_array_push(x_60, x_43);
  x_76 = lean_array_push(x_75, x_72);
  x_77 = lean_array_push(x_76, x_74);
  x_78 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_78, 0, x_54);
  lean_ctor_set(x_78, 1, x_41);
  lean_ctor_set(x_78, 2, x_77);
  lean_inc(x_8);
  x_79 = lean_array_push(x_8, x_23);
  x_80 = lean_array_push(x_79, x_78);
  lean_inc(x_6);
  x_81 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_81, 0, x_54);
  lean_ctor_set(x_81, 1, x_6);
  lean_ctor_set(x_81, 2, x_80);
  lean_inc(x_8);
  x_82 = lean_array_push(x_8, x_39);
  x_83 = lean_array_push(x_82, x_81);
  lean_inc(x_2);
  x_84 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_84, 0, x_54);
  lean_ctor_set(x_84, 1, x_2);
  lean_ctor_set(x_84, 2, x_83);
  x_10 = x_22;
  x_12 = x_84;
  x_19 = x_32;
  goto _start;
  }
  else
  {
  lean_object* x_86; 
  lean_dec(x_17);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_5);
  lean_dec(x_4);
  lean_dec(x_3);
  lean_dec(x_2);
  lean_dec(x_1);
  x_86 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_86, 0, x_12);
  lean_ctor_set(x_86, 1, x_19);
  return x_86;
  }
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__3(lean_object* x_1, size_t x_2, size_t x_3, lean_object* x_4) {
  _start:
  {
  uint8_t x_5; 
  x_5 = lean_usize_dec_lt(x_3, x_2);
  if (x_5 == 0)
  {
  lean_object* x_6; 
  lean_dec(x_1);
  x_6 = x_4;
  return x_6;
  }
  else
  {
  lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; size_t x_13; size_t x_14; lean_object* x_15; lean_object* x_16; 
  x_7 = lean_array_uget(x_4, x_3);
  x_8 = lean_unsigned_to_nat(0u);
  x_9 = lean_array_uset(x_4, x_3, x_8);
  x_10 = x_7;
  x_11 = l_Lean_Elab_Deriving_FromToJson_mkJsonField(x_10);
  lean_inc(x_1);
  x_12 = lean_apply_1(x_1, x_11);
  x_13 = 1;
  x_14 = lean_usize_add(x_3, x_13);
  x_15 = x_12;
  x_16 = lean_array_uset(x_9, x_3, x_15);
  x_3 = x_14;
  x_4 = x_16;
  goto _start;
  }
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__3___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__4(size_t x_1, size_t x_2, lean_object* x_3) {
  _start:
  {
  uint8_t x_4; 
  x_4 = lean_usize_dec_lt(x_2, x_1);
  if (x_4 == 0)
  {
  lean_object* x_5; 
  x_5 = x_3;
  return x_5;
  }
  else
  {
  lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; size_t x_12; size_t x_13; lean_object* x_14; lean_object* x_15; 
  x_6 = lean_array_uget(x_3, x_2);
  x_7 = lean_unsigned_to_nat(0u);
  x_8 = lean_array_uset(x_3, x_2, x_7);
  x_9 = x_6;
  x_10 = l_Lean_Elab_Deriving_FromToJson_mkJsonField(x_9);
  x_11 = lean_ctor_get(x_10, 1);
  lean_inc(x_11);
  lean_dec(x_10);
  x_12 = 1;
  x_13 = lean_usize_add(x_2, x_12);
  x_14 = x_11;
  x_15 = lean_array_uset(x_8, x_2, x_14);
  x_2 = x_13;
  x_3 = x_15;
  goto _start;
  }
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___closed__1() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("getObjValAs?");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___closed__2() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___closed__1;
  x_2 = lean_string_utf8_byte_size(x_1);
  return x_2;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___closed__3() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; 
  x_1 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___closed__1;
  x_2 = lean_unsigned_to_nat(0u);
  x_3 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___closed__2;
  x_4 = lean_alloc_ctor(0, 3, 0);
  lean_ctor_set(x_4, 0, x_1);
  lean_ctor_set(x_4, 1, x_2);
  lean_ctor_set(x_4, 2, x_3);
  return x_4;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___closed__4() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___closed__1;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13, size_t x_14, size_t x_15, lean_object* x_16) {
  _start:
  {
  uint8_t x_17; 
  x_17 = lean_usize_dec_lt(x_15, x_14);
  if (x_17 == 0)
  {
  lean_object* x_18; 
  lean_dec(x_13);
  lean_dec(x_12);
  lean_dec(x_11);
  lean_dec(x_10);
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_5);
  lean_dec(x_4);
  lean_dec(x_3);
  lean_dec(x_2);
  lean_dec(x_1);
  x_18 = x_16;
  return x_18;
  }
  else
  {
  lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; size_t x_23; size_t x_24; uint8_t x_25; 
  x_19 = lean_array_uget(x_16, x_15);
  x_20 = lean_unsigned_to_nat(0u);
  x_21 = lean_array_uset(x_16, x_15, x_20);
  x_22 = x_19;
  x_23 = 1;
  x_24 = lean_usize_add(x_15, x_23);
  x_25 = !lean_is_exclusive(x_22);
  if (x_25 == 0)
  {
  lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; 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; lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; 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; lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76; lean_object* x_77; lean_object* x_78; 
  x_26 = lean_ctor_get(x_22, 0);
  x_27 = lean_ctor_get(x_22, 1);
  x_28 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__1;
  lean_inc(x_8);
  x_29 = lean_name_mk_string(x_8, x_28);
  x_30 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__2;
  lean_inc(x_8);
  x_31 = lean_name_mk_string(x_8, x_30);
  x_32 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__3;
  lean_inc(x_1);
  x_33 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_33, 0, x_1);
  lean_ctor_set(x_33, 1, x_32);
  x_34 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__4;
  lean_inc(x_8);
  x_35 = lean_name_mk_string(x_8, x_34);
  x_36 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__5;
  lean_inc(x_1);
  x_37 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_37, 0, x_1);
  lean_ctor_set(x_37, 1, x_36);
  x_38 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__1;
  lean_inc(x_8);
  x_39 = lean_name_mk_string(x_8, x_38);
  x_40 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___closed__4;
  lean_inc(x_2);
  lean_inc(x_3);
  x_41 = l_Lean_addMacroScope(x_3, x_40, x_2);
  x_42 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___closed__1;
  lean_inc(x_11);
  x_43 = lean_name_mk_string(x_11, x_42);
  lean_inc(x_12);
  lean_ctor_set(x_22, 1, x_12);
  lean_ctor_set(x_22, 0, x_43);
  lean_inc(x_9);
  x_44 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_44, 0, x_22);
  lean_ctor_set(x_44, 1, x_9);
  x_45 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___closed__3;
  lean_inc(x_1);
  x_46 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_46, 0, x_1);
  lean_ctor_set(x_46, 1, x_45);
  lean_ctor_set(x_46, 2, x_41);
  lean_ctor_set(x_46, 3, x_44);
  x_47 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__7;
  lean_inc(x_8);
  x_48 = lean_name_mk_string(x_8, x_47);
  x_49 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__9;
  lean_inc(x_1);
  x_50 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_50, 0, x_1);
  lean_ctor_set(x_50, 1, x_49);
  lean_inc(x_6);
  x_51 = lean_array_push(x_6, x_50);
  x_52 = lean_box(2);
  x_53 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_53, 0, x_52);
  lean_ctor_set(x_53, 1, x_48);
  lean_ctor_set(x_53, 2, x_51);
  x_54 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5;
  lean_inc(x_10);
  x_55 = lean_array_push(x_54, x_10);
  x_56 = lean_array_push(x_55, x_53);
  x_57 = lean_array_push(x_56, x_27);
  lean_inc(x_4);
  x_58 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_58, 0, x_52);
  lean_ctor_set(x_58, 1, x_4);
  lean_ctor_set(x_58, 2, x_57);
  lean_inc(x_7);
  x_59 = lean_array_push(x_7, x_46);
  x_60 = lean_array_push(x_59, x_58);
  lean_inc(x_13);
  x_61 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_61, 0, x_52);
  lean_ctor_set(x_61, 1, x_13);
  lean_ctor_set(x_61, 2, x_60);
  lean_inc(x_6);
  x_62 = lean_array_push(x_6, x_61);
  x_63 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_63, 0, x_52);
  lean_ctor_set(x_63, 1, x_39);
  lean_ctor_set(x_63, 2, x_62);
  x_64 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__17;
  x_65 = lean_array_push(x_64, x_26);
  lean_inc(x_5);
  x_66 = lean_array_push(x_65, x_5);
  x_67 = lean_array_push(x_66, x_37);
  x_68 = lean_array_push(x_67, x_63);
  x_69 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_69, 0, x_52);
  lean_ctor_set(x_69, 1, x_35);
  lean_ctor_set(x_69, 2, x_68);
  x_70 = lean_array_push(x_54, x_33);
  lean_inc(x_5);
  x_71 = lean_array_push(x_70, x_5);
  x_72 = lean_array_push(x_71, x_69);
  x_73 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_73, 0, x_52);
  lean_ctor_set(x_73, 1, x_31);
  lean_ctor_set(x_73, 2, x_72);
  lean_inc(x_7);
  x_74 = lean_array_push(x_7, x_73);
  lean_inc(x_5);
  x_75 = lean_array_push(x_74, x_5);
  x_76 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_76, 0, x_52);
  lean_ctor_set(x_76, 1, x_29);
  lean_ctor_set(x_76, 2, x_75);
  x_77 = x_76;
  x_78 = lean_array_uset(x_21, x_15, x_77);
  x_15 = x_24;
  x_16 = x_78;
  goto _start;
  }
  else
  {
  lean_object* x_80; lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_object* x_94; lean_object* x_95; lean_object* x_96; lean_object* x_97; lean_object* x_98; lean_object* x_99; lean_object* x_100; lean_object* x_101; lean_object* x_102; lean_object* x_103; lean_object* x_104; lean_object* x_105; lean_object* x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; lean_object* x_110; lean_object* x_111; lean_object* x_112; lean_object* x_113; lean_object* x_114; lean_object* x_115; lean_object* x_116; lean_object* x_117; lean_object* x_118; lean_object* x_119; lean_object* x_120; lean_object* x_121; lean_object* x_122; lean_object* x_123; lean_object* x_124; lean_object* x_125; lean_object* x_126; lean_object* x_127; lean_object* x_128; lean_object* x_129; lean_object* x_130; lean_object* x_131; lean_object* x_132; lean_object* x_133; 
  x_80 = lean_ctor_get(x_22, 0);
  x_81 = lean_ctor_get(x_22, 1);
  lean_inc(x_81);
  lean_inc(x_80);
  lean_dec(x_22);
  x_82 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__1;
  lean_inc(x_8);
  x_83 = lean_name_mk_string(x_8, x_82);
  x_84 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__2;
  lean_inc(x_8);
  x_85 = lean_name_mk_string(x_8, x_84);
  x_86 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__3;
  lean_inc(x_1);
  x_87 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_87, 0, x_1);
  lean_ctor_set(x_87, 1, x_86);
  x_88 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__4;
  lean_inc(x_8);
  x_89 = lean_name_mk_string(x_8, x_88);
  x_90 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__5;
  lean_inc(x_1);
  x_91 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_91, 0, x_1);
  lean_ctor_set(x_91, 1, x_90);
  x_92 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__1;
  lean_inc(x_8);
  x_93 = lean_name_mk_string(x_8, x_92);
  x_94 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___closed__4;
  lean_inc(x_2);
  lean_inc(x_3);
  x_95 = l_Lean_addMacroScope(x_3, x_94, x_2);
  x_96 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___closed__1;
  lean_inc(x_11);
  x_97 = lean_name_mk_string(x_11, x_96);
  lean_inc(x_12);
  x_98 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_98, 0, x_97);
  lean_ctor_set(x_98, 1, x_12);
  lean_inc(x_9);
  x_99 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_99, 0, x_98);
  lean_ctor_set(x_99, 1, x_9);
  x_100 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___closed__3;
  lean_inc(x_1);
  x_101 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_101, 0, x_1);
  lean_ctor_set(x_101, 1, x_100);
  lean_ctor_set(x_101, 2, x_95);
  lean_ctor_set(x_101, 3, x_99);
  x_102 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__7;
  lean_inc(x_8);
  x_103 = lean_name_mk_string(x_8, x_102);
  x_104 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__9;
  lean_inc(x_1);
  x_105 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_105, 0, x_1);
  lean_ctor_set(x_105, 1, x_104);
  lean_inc(x_6);
  x_106 = lean_array_push(x_6, x_105);
  x_107 = lean_box(2);
  x_108 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_108, 0, x_107);
  lean_ctor_set(x_108, 1, x_103);
  lean_ctor_set(x_108, 2, x_106);
  x_109 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5;
  lean_inc(x_10);
  x_110 = lean_array_push(x_109, x_10);
  x_111 = lean_array_push(x_110, x_108);
  x_112 = lean_array_push(x_111, x_81);
  lean_inc(x_4);
  x_113 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_113, 0, x_107);
  lean_ctor_set(x_113, 1, x_4);
  lean_ctor_set(x_113, 2, x_112);
  lean_inc(x_7);
  x_114 = lean_array_push(x_7, x_101);
  x_115 = lean_array_push(x_114, x_113);
  lean_inc(x_13);
  x_116 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_116, 0, x_107);
  lean_ctor_set(x_116, 1, x_13);
  lean_ctor_set(x_116, 2, x_115);
  lean_inc(x_6);
  x_117 = lean_array_push(x_6, x_116);
  x_118 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_118, 0, x_107);
  lean_ctor_set(x_118, 1, x_93);
  lean_ctor_set(x_118, 2, x_117);
  x_119 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__17;
  x_120 = lean_array_push(x_119, x_80);
  lean_inc(x_5);
  x_121 = lean_array_push(x_120, x_5);
  x_122 = lean_array_push(x_121, x_91);
  x_123 = lean_array_push(x_122, x_118);
  x_124 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_124, 0, x_107);
  lean_ctor_set(x_124, 1, x_89);
  lean_ctor_set(x_124, 2, x_123);
  x_125 = lean_array_push(x_109, x_87);
  lean_inc(x_5);
  x_126 = lean_array_push(x_125, x_5);
  x_127 = lean_array_push(x_126, x_124);
  x_128 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_128, 0, x_107);
  lean_ctor_set(x_128, 1, x_85);
  lean_ctor_set(x_128, 2, x_127);
  lean_inc(x_7);
  x_129 = lean_array_push(x_7, x_128);
  lean_inc(x_5);
  x_130 = lean_array_push(x_129, x_5);
  x_131 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_131, 0, x_107);
  lean_ctor_set(x_131, 1, x_83);
  lean_ctor_set(x_131, 2, x_130);
  x_132 = x_131;
  x_133 = lean_array_uset(x_21, x_15, x_132);
  x_15 = x_24;
  x_16 = x_133;
  goto _start;
  }
  }
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__6___closed__1() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("group");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__6___closed__2() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__6___closed__1;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__6___closed__3() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("structInstField");
  return x_1;
  }
  }
  static lean_object* _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__6___closed__4() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("structInstLVal");
  return x_1;
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__6(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, size_t x_5, size_t x_6, lean_object* x_7) {
  _start:
  {
  uint8_t x_8; 
  x_8 = lean_usize_dec_lt(x_6, x_5);
  if (x_8 == 0)
  {
  lean_object* x_9; 
  lean_dec(x_4);
  lean_dec(x_3);
  lean_dec(x_2);
  lean_dec(x_1);
  x_9 = x_7;
  return x_9;
  }
  else
  {
  lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; size_t x_14; size_t x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; 
  x_10 = lean_array_uget(x_7, x_6);
  x_11 = lean_unsigned_to_nat(0u);
  x_12 = lean_array_uset(x_7, x_6, x_11);
  x_13 = x_10;
  x_14 = 1;
  x_15 = lean_usize_add(x_6, x_14);
  x_16 = lean_ctor_get(x_13, 0);
  lean_inc(x_16);
  x_17 = lean_ctor_get(x_13, 1);
  lean_inc(x_17);
  lean_dec(x_13);
  x_18 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__6___closed__3;
  lean_inc(x_3);
  x_19 = lean_name_mk_string(x_3, x_18);
  x_20 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__6___closed__4;
  lean_inc(x_3);
  x_21 = lean_name_mk_string(x_3, x_20);
  lean_inc(x_2);
  x_22 = lean_array_push(x_2, x_16);
  lean_inc(x_1);
  x_23 = lean_array_push(x_22, x_1);
  x_24 = lean_box(2);
  x_25 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_25, 0, x_24);
  lean_ctor_set(x_25, 1, x_21);
  lean_ctor_set(x_25, 2, x_23);
  x_26 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5;
  x_27 = lean_array_push(x_26, x_25);
  lean_inc(x_4);
  x_28 = lean_array_push(x_27, x_4);
  x_29 = lean_array_push(x_28, x_17);
  x_30 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_30, 0, x_24);
  lean_ctor_set(x_30, 1, x_19);
  lean_ctor_set(x_30, 2, x_29);
  lean_inc(x_2);
  x_31 = lean_array_push(x_2, x_30);
  lean_inc(x_1);
  x_32 = lean_array_push(x_31, x_1);
  x_33 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__6___closed__2;
  x_34 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_34, 0, x_24);
  lean_ctor_set(x_34, 1, x_33);
  lean_ctor_set(x_34, 2, x_32);
  x_35 = x_34;
  x_36 = lean_array_uset(x_12, x_6, x_35);
  x_6 = x_15;
  x_7 = x_36;
  goto _start;
  }
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__1() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("explicitBinder");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__2() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string(":");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__3() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__9;
  x_2 = lean_string_utf8_byte_size(x_1);
  return x_2;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__4() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; 
  x_1 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__9;
  x_2 = lean_unsigned_to_nat(0u);
  x_3 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__3;
  x_4 = lean_alloc_ctor(0, 3, 0);
  lean_ctor_set(x_4, 0, x_1);
  lean_ctor_set(x_4, 1, x_2);
  lean_ctor_set(x_4, 2, x_3);
  return x_4;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__5() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = lean_unsigned_to_nat(5u);
  x_2 = lean_mk_empty_array_with_capacity(x_1);
  return x_2;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__6() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("typeSpec");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__7() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("Except");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__8() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__7;
  x_2 = lean_string_utf8_byte_size(x_1);
  return x_2;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__9() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; 
  x_1 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__7;
  x_2 = lean_unsigned_to_nat(0u);
  x_3 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__8;
  x_4 = lean_alloc_ctor(0, 3, 0);
  lean_ctor_set(x_4, 0, x_1);
  lean_ctor_set(x_4, 1, x_2);
  lean_ctor_set(x_4, 2, x_3);
  return x_4;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__10() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("String");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__11() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__10;
  x_2 = lean_string_utf8_byte_size(x_1);
  return x_2;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__12() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; 
  x_1 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__10;
  x_2 = lean_unsigned_to_nat(0u);
  x_3 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__11;
  x_4 = lean_alloc_ctor(0, 3, 0);
  lean_ctor_set(x_4, 0, x_1);
  lean_ctor_set(x_4, 1, x_2);
  lean_ctor_set(x_4, 2, x_3);
  return x_4;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__13() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__10;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__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, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13, lean_object* x_14, lean_object* x_15, lean_object* x_16, lean_object* x_17, lean_object* x_18, lean_object* x_19, lean_object* x_20, lean_object* x_21, lean_object* x_22, lean_object* x_23, lean_object* x_24, lean_object* x_25) {
  _start:
  {
  lean_object* x_26; uint8_t x_167; 
  x_167 = lean_ctor_get_uint8(x_1, sizeof(void*)*2);
  if (x_167 == 0)
  {
  uint8_t x_168; 
  x_168 = lean_ctor_get_uint8(x_16, sizeof(void*)*5);
  if (x_168 == 0)
  {
  lean_object* x_169; lean_object* x_170; lean_object* x_171; 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; lean_object* 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_190; lean_object* x_191; lean_object* x_192; lean_object* x_193; lean_object* x_194; lean_object* x_195; lean_object* x_196; 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; 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; lean_object* x_211; 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; 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; lean_object* x_226; lean_object* x_227; lean_object* x_228; lean_object* x_229; lean_object* x_230; lean_object* x_231; 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; 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; lean_object* x_246; lean_object* x_247; lean_object* x_248; lean_object* x_249; lean_object* x_250; lean_object* x_251; lean_object* x_252; lean_object* x_253; lean_object* x_254; lean_object* x_255; lean_object* x_256; 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; lean_object* x_268; lean_object* x_269; lean_object* x_270; lean_object* x_271; lean_object* x_272; lean_object* x_273; lean_object* x_274; lean_object* x_275; lean_object* x_276; lean_object* x_277; lean_object* 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; 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; lean_object* x_292; lean_object* x_293; lean_object* x_294; lean_object* x_295; lean_object* x_296; lean_object* x_297; lean_object* x_298; lean_object* x_299; lean_object* x_300; 
  x_169 = lean_ctor_get(x_5, 1);
  lean_inc(x_169);
  lean_inc(x_23);
  x_170 = l_Lean_Elab_Deriving_mkInductiveApp(x_6, x_169, x_19, x_20, x_21, x_22, x_23, x_24, x_25);
  x_171 = lean_ctor_get(x_170, 0);
  lean_inc(x_171);
  x_172 = lean_ctor_get(x_170, 1);
  lean_inc(x_172);
  lean_dec(x_170);
  lean_inc(x_23);
  x_173 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_23, x_24, x_172);
  x_174 = lean_ctor_get(x_173, 0);
  lean_inc(x_174);
  x_175 = lean_ctor_get(x_173, 1);
  lean_inc(x_175);
  lean_dec(x_173);
  x_176 = l_Lean_Elab_Term_getCurrMacroScope(x_19, x_20, x_21, x_22, x_23, x_24, x_175);
  x_177 = lean_ctor_get(x_176, 0);
  lean_inc(x_177);
  x_178 = lean_ctor_get(x_176, 1);
  lean_inc(x_178);
  lean_dec(x_176);
  x_179 = l_Lean_Elab_Term_getMainModule___rarg(x_24, x_178);
  x_180 = lean_ctor_get(x_179, 0);
  lean_inc(x_180);
  x_181 = lean_ctor_get(x_179, 1);
  lean_inc(x_181);
  lean_dec(x_179);
  x_182 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__10;
  x_183 = lean_name_mk_string(x_7, x_182);
  x_184 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__12;
  lean_inc(x_183);
  x_185 = lean_name_mk_string(x_183, x_184);
  x_186 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__14;
  lean_inc(x_183);
  x_187 = lean_name_mk_string(x_183, x_186);
  x_188 = lean_box(2);
  x_189 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__1;
  lean_inc(x_8);
  x_190 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_190, 0, x_188);
  lean_ctor_set(x_190, 1, x_8);
  lean_ctor_set(x_190, 2, x_189);
  x_191 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__16;
  lean_inc(x_183);
  x_192 = lean_name_mk_string(x_183, x_191);
  lean_inc(x_174);
  x_193 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_193, 0, x_174);
  lean_ctor_set(x_193, 1, x_191);
  lean_inc(x_4);
  x_194 = lean_array_push(x_4, x_193);
  x_195 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_195, 0, x_188);
  lean_ctor_set(x_195, 1, x_192);
  lean_ctor_set(x_195, 2, x_194);
  lean_inc(x_4);
  x_196 = lean_array_push(x_4, x_195);
  lean_inc(x_8);
  x_197 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_197, 0, x_188);
  lean_ctor_set(x_197, 1, x_8);
  lean_ctor_set(x_197, 2, x_196);
  x_198 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__9;
  lean_inc(x_190);
  x_199 = lean_array_push(x_198, x_190);
  lean_inc(x_190);
  x_200 = lean_array_push(x_199, x_190);
  x_201 = lean_array_push(x_200, x_197);
  lean_inc(x_190);
  x_202 = lean_array_push(x_201, x_190);
  lean_inc(x_190);
  x_203 = lean_array_push(x_202, x_190);
  lean_inc(x_190);
  x_204 = lean_array_push(x_203, x_190);
  x_205 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_205, 0, x_188);
  lean_ctor_set(x_205, 1, x_187);
  lean_ctor_set(x_205, 2, x_204);
  x_206 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__20;
  lean_inc(x_183);
  x_207 = lean_name_mk_string(x_183, x_206);
  lean_inc(x_174);
  x_208 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_208, 0, x_174);
  lean_ctor_set(x_208, 1, x_206);
  x_209 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__22;
  lean_inc(x_183);
  x_210 = lean_name_mk_string(x_183, x_209);
  lean_inc(x_9);
  x_211 = lean_array_push(x_9, x_10);
  lean_inc(x_190);
  x_212 = lean_array_push(x_211, x_190);
  x_213 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_213, 0, x_188);
  lean_ctor_set(x_213, 1, x_210);
  lean_ctor_set(x_213, 2, x_212);
  x_214 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__24;
  lean_inc(x_183);
  x_215 = lean_name_mk_string(x_183, x_214);
  x_216 = lean_ctor_get(x_5, 0);
  lean_inc(x_216);
  lean_dec(x_5);
  x_217 = l_Array_append___rarg(x_189, x_216);
  x_218 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__1;
  lean_inc(x_11);
  x_219 = lean_name_mk_string(x_11, x_218);
  x_220 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__2;
  lean_inc(x_174);
  x_221 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_221, 0, x_174);
  lean_ctor_set(x_221, 1, x_220);
  x_222 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__15;
  lean_inc(x_177);
  lean_inc(x_180);
  x_223 = l_Lean_addMacroScope(x_180, x_222, x_177);
  x_224 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__14;
  lean_inc(x_12);
  lean_inc(x_174);
  x_225 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_225, 0, x_174);
  lean_ctor_set(x_225, 1, x_224);
  lean_ctor_set(x_225, 2, x_223);
  lean_ctor_set(x_225, 3, x_12);
  lean_inc(x_4);
  x_226 = lean_array_push(x_4, x_225);
  lean_inc(x_8);
  x_227 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_227, 0, x_188);
  lean_ctor_set(x_227, 1, x_8);
  lean_ctor_set(x_227, 2, x_226);
  x_228 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__2;
  lean_inc(x_174);
  x_229 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_229, 0, x_174);
  lean_ctor_set(x_229, 1, x_228);
  x_230 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__8;
  lean_inc(x_177);
  lean_inc(x_180);
  x_231 = l_Lean_addMacroScope(x_180, x_230, x_177);
  x_232 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__9;
  x_233 = lean_name_mk_string(x_13, x_232);
  lean_inc(x_12);
  x_234 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_234, 0, x_233);
  lean_ctor_set(x_234, 1, x_12);
  lean_inc(x_12);
  x_235 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_235, 0, x_234);
  lean_ctor_set(x_235, 1, x_12);
  x_236 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__4;
  lean_inc(x_174);
  x_237 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_237, 0, x_174);
  lean_ctor_set(x_237, 1, x_236);
  lean_ctor_set(x_237, 2, x_231);
  lean_ctor_set(x_237, 3, x_235);
  lean_inc(x_9);
  x_238 = lean_array_push(x_9, x_229);
  lean_inc(x_238);
  x_239 = lean_array_push(x_238, x_237);
  lean_inc(x_8);
  x_240 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_240, 0, x_188);
  lean_ctor_set(x_240, 1, x_8);
  lean_ctor_set(x_240, 2, x_239);
  x_241 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__4;
  lean_inc(x_174);
  x_242 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_242, 0, x_174);
  lean_ctor_set(x_242, 1, x_241);
  x_243 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__5;
  x_244 = lean_array_push(x_243, x_221);
  x_245 = lean_array_push(x_244, x_227);
  x_246 = lean_array_push(x_245, x_240);
  lean_inc(x_190);
  x_247 = lean_array_push(x_246, x_190);
  x_248 = lean_array_push(x_247, x_242);
  x_249 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_249, 0, x_188);
  lean_ctor_set(x_249, 1, x_219);
  lean_ctor_set(x_249, 2, x_248);
  x_250 = lean_array_push(x_217, x_249);
  lean_inc(x_8);
  x_251 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_251, 0, x_188);
  lean_ctor_set(x_251, 1, x_8);
  lean_ctor_set(x_251, 2, x_250);
  x_252 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__6;
  x_253 = lean_name_mk_string(x_11, x_252);
  lean_inc(x_177);
  lean_inc(x_14);
  lean_inc(x_180);
  x_254 = l_Lean_addMacroScope(x_180, x_14, x_177);
  lean_inc(x_12);
  x_255 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_255, 0, x_14);
  lean_ctor_set(x_255, 1, x_12);
  lean_inc(x_12);
  x_256 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_256, 0, x_255);
  lean_ctor_set(x_256, 1, x_12);
  x_257 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__9;
  lean_inc(x_174);
  x_258 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_258, 0, x_174);
  lean_ctor_set(x_258, 1, x_257);
  lean_ctor_set(x_258, 2, x_254);
  lean_ctor_set(x_258, 3, x_256);
  x_259 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__13;
  x_260 = l_Lean_addMacroScope(x_180, x_259, x_177);
  lean_inc(x_12);
  x_261 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_261, 0, x_259);
  lean_ctor_set(x_261, 1, x_12);
  x_262 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_262, 0, x_261);
  lean_ctor_set(x_262, 1, x_12);
  x_263 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__12;
  lean_inc(x_174);
  x_264 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_264, 0, x_174);
  lean_ctor_set(x_264, 1, x_263);
  lean_ctor_set(x_264, 2, x_260);
  lean_ctor_set(x_264, 3, x_262);
  lean_inc(x_9);
  x_265 = lean_array_push(x_9, x_264);
  x_266 = lean_array_push(x_265, x_171);
  lean_inc(x_8);
  x_267 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_267, 0, x_188);
  lean_ctor_set(x_267, 1, x_8);
  lean_ctor_set(x_267, 2, x_266);
  lean_inc(x_9);
  x_268 = lean_array_push(x_9, x_258);
  x_269 = lean_array_push(x_268, x_267);
  x_270 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_270, 0, x_188);
  lean_ctor_set(x_270, 1, x_15);
  lean_ctor_set(x_270, 2, x_269);
  x_271 = lean_array_push(x_238, x_270);
  x_272 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_272, 0, x_188);
  lean_ctor_set(x_272, 1, x_253);
  lean_ctor_set(x_272, 2, x_271);
  lean_inc(x_4);
  x_273 = lean_array_push(x_4, x_272);
  x_274 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_274, 0, x_188);
  lean_ctor_set(x_274, 1, x_8);
  lean_ctor_set(x_274, 2, x_273);
  lean_inc(x_9);
  x_275 = lean_array_push(x_9, x_251);
  x_276 = lean_array_push(x_275, x_274);
  x_277 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_277, 0, x_188);
  lean_ctor_set(x_277, 1, x_215);
  lean_ctor_set(x_277, 2, x_276);
  x_278 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__26;
  x_279 = lean_name_mk_string(x_183, x_278);
  x_280 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__28;
  x_281 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_281, 0, x_174);
  lean_ctor_set(x_281, 1, x_280);
  x_282 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5;
  x_283 = lean_array_push(x_282, x_281);
  x_284 = lean_array_push(x_283, x_17);
  lean_inc(x_190);
  x_285 = lean_array_push(x_284, x_190);
  x_286 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_286, 0, x_188);
  lean_ctor_set(x_286, 1, x_279);
  lean_ctor_set(x_286, 2, x_285);
  x_287 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__29;
  x_288 = lean_array_push(x_287, x_208);
  x_289 = lean_array_push(x_288, x_213);
  x_290 = lean_array_push(x_289, x_277);
  x_291 = lean_array_push(x_290, x_286);
  lean_inc(x_190);
  x_292 = lean_array_push(x_291, x_190);
  lean_inc(x_190);
  x_293 = lean_array_push(x_292, x_190);
  x_294 = lean_array_push(x_293, x_190);
  x_295 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_295, 0, x_188);
  lean_ctor_set(x_295, 1, x_207);
  lean_ctor_set(x_295, 2, x_294);
  x_296 = lean_array_push(x_9, x_205);
  x_297 = lean_array_push(x_296, x_295);
  x_298 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_298, 0, x_188);
  lean_ctor_set(x_298, 1, x_185);
  lean_ctor_set(x_298, 2, x_297);
  x_299 = lean_box(0);
  x_300 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__2(x_1, x_2, x_3, x_4, x_298, x_299, x_19, x_20, x_21, x_22, x_23, x_24, x_181);
  return x_300;
  }
  else
  {
  lean_object* x_301; 
  x_301 = lean_box(0);
  x_26 = x_301;
  goto block_166;
  }
  }
  else
  {
  lean_object* x_302; 
  x_302 = lean_box(0);
  x_26 = x_302;
  goto block_166;
  }
  block_166:
  {
  lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; 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; lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; 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; lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76; lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_object* x_94; lean_object* x_95; lean_object* x_96; lean_object* x_97; lean_object* x_98; lean_object* x_99; lean_object* x_100; lean_object* x_101; lean_object* x_102; lean_object* x_103; lean_object* x_104; lean_object* x_105; lean_object* x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; lean_object* x_110; lean_object* x_111; lean_object* x_112; lean_object* x_113; lean_object* x_114; lean_object* x_115; lean_object* x_116; lean_object* x_117; lean_object* x_118; lean_object* x_119; lean_object* x_120; lean_object* x_121; lean_object* x_122; lean_object* x_123; lean_object* x_124; lean_object* x_125; lean_object* x_126; lean_object* x_127; lean_object* x_128; lean_object* x_129; lean_object* x_130; lean_object* x_131; lean_object* x_132; lean_object* x_133; lean_object* x_134; lean_object* x_135; lean_object* x_136; lean_object* x_137; lean_object* x_138; lean_object* x_139; lean_object* x_140; 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; lean_object* x_148; lean_object* x_149; lean_object* x_150; lean_object* x_151; lean_object* x_152; lean_object* x_153; lean_object* x_154; lean_object* x_155; lean_object* x_156; lean_object* x_157; lean_object* x_158; lean_object* x_159; lean_object* x_160; lean_object* x_161; lean_object* x_162; lean_object* x_163; lean_object* x_164; lean_object* x_165; 
  lean_dec(x_26);
  x_27 = lean_ctor_get(x_5, 1);
  lean_inc(x_27);
  lean_inc(x_23);
  x_28 = l_Lean_Elab_Deriving_mkInductiveApp(x_6, x_27, x_19, x_20, x_21, x_22, x_23, x_24, x_25);
  x_29 = lean_ctor_get(x_28, 0);
  lean_inc(x_29);
  x_30 = lean_ctor_get(x_28, 1);
  lean_inc(x_30);
  lean_dec(x_28);
  lean_inc(x_23);
  x_31 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_23, x_24, x_30);
  x_32 = lean_ctor_get(x_31, 0);
  lean_inc(x_32);
  x_33 = lean_ctor_get(x_31, 1);
  lean_inc(x_33);
  lean_dec(x_31);
  x_34 = l_Lean_Elab_Term_getCurrMacroScope(x_19, x_20, x_21, x_22, x_23, x_24, x_33);
  x_35 = lean_ctor_get(x_34, 0);
  lean_inc(x_35);
  x_36 = lean_ctor_get(x_34, 1);
  lean_inc(x_36);
  lean_dec(x_34);
  x_37 = l_Lean_Elab_Term_getMainModule___rarg(x_24, x_36);
  x_38 = lean_ctor_get(x_37, 0);
  lean_inc(x_38);
  x_39 = lean_ctor_get(x_37, 1);
  lean_inc(x_39);
  lean_dec(x_37);
  x_40 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__10;
  x_41 = lean_name_mk_string(x_7, x_40);
  x_42 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__12;
  lean_inc(x_41);
  x_43 = lean_name_mk_string(x_41, x_42);
  x_44 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__14;
  lean_inc(x_41);
  x_45 = lean_name_mk_string(x_41, x_44);
  x_46 = lean_box(2);
  x_47 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__1;
  lean_inc(x_8);
  x_48 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_48, 0, x_46);
  lean_ctor_set(x_48, 1, x_8);
  lean_ctor_set(x_48, 2, x_47);
  x_49 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__16;
  lean_inc(x_41);
  x_50 = lean_name_mk_string(x_41, x_49);
  lean_inc(x_32);
  x_51 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_51, 0, x_32);
  lean_ctor_set(x_51, 1, x_49);
  lean_inc(x_4);
  x_52 = lean_array_push(x_4, x_51);
  x_53 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_53, 0, x_46);
  lean_ctor_set(x_53, 1, x_50);
  lean_ctor_set(x_53, 2, x_52);
  lean_inc(x_4);
  x_54 = lean_array_push(x_4, x_53);
  lean_inc(x_8);
  x_55 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_55, 0, x_46);
  lean_ctor_set(x_55, 1, x_8);
  lean_ctor_set(x_55, 2, x_54);
  x_56 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__30;
  lean_inc(x_41);
  x_57 = lean_name_mk_string(x_41, x_56);
  lean_inc(x_32);
  x_58 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_58, 0, x_32);
  lean_ctor_set(x_58, 1, x_56);
  lean_inc(x_4);
  x_59 = lean_array_push(x_4, x_58);
  x_60 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_60, 0, x_46);
  lean_ctor_set(x_60, 1, x_57);
  lean_ctor_set(x_60, 2, x_59);
  lean_inc(x_4);
  x_61 = lean_array_push(x_4, x_60);
  lean_inc(x_8);
  x_62 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_62, 0, x_46);
  lean_ctor_set(x_62, 1, x_8);
  lean_ctor_set(x_62, 2, x_61);
  x_63 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__9;
  lean_inc(x_48);
  x_64 = lean_array_push(x_63, x_48);
  lean_inc(x_48);
  x_65 = lean_array_push(x_64, x_48);
  x_66 = lean_array_push(x_65, x_55);
  lean_inc(x_48);
  x_67 = lean_array_push(x_66, x_48);
  lean_inc(x_48);
  x_68 = lean_array_push(x_67, x_48);
  x_69 = lean_array_push(x_68, x_62);
  x_70 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_70, 0, x_46);
  lean_ctor_set(x_70, 1, x_45);
  lean_ctor_set(x_70, 2, x_69);
  x_71 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__20;
  lean_inc(x_41);
  x_72 = lean_name_mk_string(x_41, x_71);
  lean_inc(x_32);
  x_73 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_73, 0, x_32);
  lean_ctor_set(x_73, 1, x_71);
  x_74 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__22;
  lean_inc(x_41);
  x_75 = lean_name_mk_string(x_41, x_74);
  lean_inc(x_9);
  x_76 = lean_array_push(x_9, x_10);
  lean_inc(x_48);
  x_77 = lean_array_push(x_76, x_48);
  x_78 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_78, 0, x_46);
  lean_ctor_set(x_78, 1, x_75);
  lean_ctor_set(x_78, 2, x_77);
  x_79 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__24;
  lean_inc(x_41);
  x_80 = lean_name_mk_string(x_41, x_79);
  x_81 = lean_ctor_get(x_5, 0);
  lean_inc(x_81);
  lean_dec(x_5);
  x_82 = l_Array_append___rarg(x_47, x_81);
  x_83 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__1;
  lean_inc(x_11);
  x_84 = lean_name_mk_string(x_11, x_83);
  x_85 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__2;
  lean_inc(x_32);
  x_86 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_86, 0, x_32);
  lean_ctor_set(x_86, 1, x_85);
  x_87 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__15;
  lean_inc(x_35);
  lean_inc(x_38);
  x_88 = l_Lean_addMacroScope(x_38, x_87, x_35);
  x_89 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__14;
  lean_inc(x_12);
  lean_inc(x_32);
  x_90 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_90, 0, x_32);
  lean_ctor_set(x_90, 1, x_89);
  lean_ctor_set(x_90, 2, x_88);
  lean_ctor_set(x_90, 3, x_12);
  lean_inc(x_4);
  x_91 = lean_array_push(x_4, x_90);
  lean_inc(x_8);
  x_92 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_92, 0, x_46);
  lean_ctor_set(x_92, 1, x_8);
  lean_ctor_set(x_92, 2, x_91);
  x_93 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__2;
  lean_inc(x_32);
  x_94 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_94, 0, x_32);
  lean_ctor_set(x_94, 1, x_93);
  x_95 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__8;
  lean_inc(x_35);
  lean_inc(x_38);
  x_96 = l_Lean_addMacroScope(x_38, x_95, x_35);
  x_97 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__9;
  x_98 = lean_name_mk_string(x_13, x_97);
  lean_inc(x_12);
  x_99 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_99, 0, x_98);
  lean_ctor_set(x_99, 1, x_12);
  lean_inc(x_12);
  x_100 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_100, 0, x_99);
  lean_ctor_set(x_100, 1, x_12);
  x_101 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__4;
  lean_inc(x_32);
  x_102 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_102, 0, x_32);
  lean_ctor_set(x_102, 1, x_101);
  lean_ctor_set(x_102, 2, x_96);
  lean_ctor_set(x_102, 3, x_100);
  lean_inc(x_9);
  x_103 = lean_array_push(x_9, x_94);
  lean_inc(x_103);
  x_104 = lean_array_push(x_103, x_102);
  lean_inc(x_8);
  x_105 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_105, 0, x_46);
  lean_ctor_set(x_105, 1, x_8);
  lean_ctor_set(x_105, 2, x_104);
  x_106 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__4;
  lean_inc(x_32);
  x_107 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_107, 0, x_32);
  lean_ctor_set(x_107, 1, x_106);
  x_108 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__5;
  x_109 = lean_array_push(x_108, x_86);
  x_110 = lean_array_push(x_109, x_92);
  x_111 = lean_array_push(x_110, x_105);
  lean_inc(x_48);
  x_112 = lean_array_push(x_111, x_48);
  x_113 = lean_array_push(x_112, x_107);
  x_114 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_114, 0, x_46);
  lean_ctor_set(x_114, 1, x_84);
  lean_ctor_set(x_114, 2, x_113);
  x_115 = lean_array_push(x_82, x_114);
  lean_inc(x_8);
  x_116 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_116, 0, x_46);
  lean_ctor_set(x_116, 1, x_8);
  lean_ctor_set(x_116, 2, x_115);
  x_117 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__6;
  x_118 = lean_name_mk_string(x_11, x_117);
  lean_inc(x_35);
  lean_inc(x_14);
  lean_inc(x_38);
  x_119 = l_Lean_addMacroScope(x_38, x_14, x_35);
  lean_inc(x_12);
  x_120 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_120, 0, x_14);
  lean_ctor_set(x_120, 1, x_12);
  lean_inc(x_12);
  x_121 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_121, 0, x_120);
  lean_ctor_set(x_121, 1, x_12);
  x_122 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__9;
  lean_inc(x_32);
  x_123 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_123, 0, x_32);
  lean_ctor_set(x_123, 1, x_122);
  lean_ctor_set(x_123, 2, x_119);
  lean_ctor_set(x_123, 3, x_121);
  x_124 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__13;
  x_125 = l_Lean_addMacroScope(x_38, x_124, x_35);
  lean_inc(x_12);
  x_126 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_126, 0, x_124);
  lean_ctor_set(x_126, 1, x_12);
  x_127 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_127, 0, x_126);
  lean_ctor_set(x_127, 1, x_12);
  x_128 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__12;
  lean_inc(x_32);
  x_129 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_129, 0, x_32);
  lean_ctor_set(x_129, 1, x_128);
  lean_ctor_set(x_129, 2, x_125);
  lean_ctor_set(x_129, 3, x_127);
  lean_inc(x_9);
  x_130 = lean_array_push(x_9, x_129);
  x_131 = lean_array_push(x_130, x_29);
  lean_inc(x_8);
  x_132 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_132, 0, x_46);
  lean_ctor_set(x_132, 1, x_8);
  lean_ctor_set(x_132, 2, x_131);
  lean_inc(x_9);
  x_133 = lean_array_push(x_9, x_123);
  x_134 = lean_array_push(x_133, x_132);
  x_135 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_135, 0, x_46);
  lean_ctor_set(x_135, 1, x_15);
  lean_ctor_set(x_135, 2, x_134);
  x_136 = lean_array_push(x_103, x_135);
  x_137 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_137, 0, x_46);
  lean_ctor_set(x_137, 1, x_118);
  lean_ctor_set(x_137, 2, x_136);
  lean_inc(x_4);
  x_138 = lean_array_push(x_4, x_137);
  x_139 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_139, 0, x_46);
  lean_ctor_set(x_139, 1, x_8);
  lean_ctor_set(x_139, 2, x_138);
  lean_inc(x_9);
  x_140 = lean_array_push(x_9, x_116);
  x_141 = lean_array_push(x_140, x_139);
  x_142 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_142, 0, x_46);
  lean_ctor_set(x_142, 1, x_80);
  lean_ctor_set(x_142, 2, x_141);
  x_143 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__26;
  x_144 = lean_name_mk_string(x_41, x_143);
  x_145 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__28;
  x_146 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_146, 0, x_32);
  lean_ctor_set(x_146, 1, x_145);
  x_147 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5;
  x_148 = lean_array_push(x_147, x_146);
  x_149 = lean_array_push(x_148, x_17);
  lean_inc(x_48);
  x_150 = lean_array_push(x_149, x_48);
  x_151 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_151, 0, x_46);
  lean_ctor_set(x_151, 1, x_144);
  lean_ctor_set(x_151, 2, x_150);
  x_152 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__29;
  x_153 = lean_array_push(x_152, x_73);
  x_154 = lean_array_push(x_153, x_78);
  x_155 = lean_array_push(x_154, x_142);
  x_156 = lean_array_push(x_155, x_151);
  lean_inc(x_48);
  x_157 = lean_array_push(x_156, x_48);
  lean_inc(x_48);
  x_158 = lean_array_push(x_157, x_48);
  x_159 = lean_array_push(x_158, x_48);
  x_160 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_160, 0, x_46);
  lean_ctor_set(x_160, 1, x_72);
  lean_ctor_set(x_160, 2, x_159);
  x_161 = lean_array_push(x_9, x_70);
  x_162 = lean_array_push(x_161, x_160);
  x_163 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_163, 0, x_46);
  lean_ctor_set(x_163, 1, x_43);
  lean_ctor_set(x_163, 2, x_162);
  x_164 = lean_box(0);
  x_165 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__2(x_1, x_2, x_3, x_4, x_163, x_164, x_19, x_20, x_21, x_22, x_23, x_24, x_39);
  return x_165;
  }
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__1() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("fromJson");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__2() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("Except.error");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__3() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__2;
  x_2 = lean_string_utf8_byte_size(x_1);
  return x_2;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__4() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; 
  x_1 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__2;
  x_2 = lean_unsigned_to_nat(0u);
  x_3 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__3;
  x_4 = lean_alloc_ctor(0, 3, 0);
  lean_ctor_set(x_4, 0, x_1);
  lean_ctor_set(x_4, 1, x_2);
  lean_ctor_set(x_4, 2, x_3);
  return x_4;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__5() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__7;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__6() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("error");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__7() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__5;
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__6;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__8() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__7;
  x_3 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_3, 0, x_2);
  lean_ctor_set(x_3, 1, x_1);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__9() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__8;
  x_3 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_3, 0, x_2);
  lean_ctor_set(x_3, 1, x_1);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__10() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("strLit");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__11() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__10;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__12() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("\"no inductive constructor matched\"");
  return x_1;
  }
  }
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10) {
  _start:
  {
  lean_object* x_11; lean_object* x_12; 
  x_11 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__1;
  lean_inc(x_9);
  lean_inc(x_8);
  lean_inc(x_7);
  lean_inc(x_6);
  lean_inc(x_5);
  lean_inc(x_4);
  x_12 = l_Lean_Elab_Deriving_mkContext(x_11, x_1, x_4, x_5, x_6, x_7, x_8, x_9, x_10);
  if (lean_obj_tag(x_12) == 0)
  {
  lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; 
  x_13 = lean_ctor_get(x_12, 0);
  lean_inc(x_13);
  x_14 = lean_ctor_get(x_12, 1);
  lean_inc(x_14);
  lean_dec(x_12);
  x_15 = lean_ctor_get(x_13, 0);
  lean_inc(x_15);
  x_16 = l_Lean_instInhabitedInductiveVal;
  x_17 = lean_unsigned_to_nat(0u);
  x_18 = lean_array_get(x_16, x_15, x_17);
  lean_dec(x_15);
  x_19 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__8;
  lean_inc(x_9);
  lean_inc(x_8);
  lean_inc(x_7);
  lean_inc(x_6);
  lean_inc(x_5);
  lean_inc(x_4);
  lean_inc(x_18);
  x_20 = l_Lean_Elab_Deriving_mkHeader___rarg(x_19, x_17, x_18, x_4, x_5, x_6, x_7, x_8, x_9, x_14);
  if (lean_obj_tag(x_20) == 0)
  {
  lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; 
  x_21 = lean_ctor_get(x_20, 0);
  lean_inc(x_21);
  x_22 = lean_ctor_get(x_20, 1);
  lean_inc(x_22);
  lean_dec(x_20);
  x_23 = lean_ctor_get(x_13, 1);
  lean_inc(x_23);
  x_24 = l_Lean_instInhabitedName;
  x_25 = lean_array_get(x_24, x_23, x_17);
  lean_dec(x_23);
  x_26 = lean_mk_syntax_ident(x_25);
  lean_inc(x_9);
  lean_inc(x_8);
  lean_inc(x_7);
  lean_inc(x_6);
  lean_inc(x_5);
  lean_inc(x_4);
  lean_inc(x_2);
  lean_inc(x_21);
  x_27 = l_Lean_Elab_Deriving_mkDiscrs(x_21, x_2, x_4, x_5, x_6, x_7, x_8, x_9, x_22);
  if (lean_obj_tag(x_27) == 0)
  {
  lean_object* x_28; lean_object* x_29; 
  x_28 = lean_ctor_get(x_27, 1);
  lean_inc(x_28);
  lean_dec(x_27);
  lean_inc(x_9);
  lean_inc(x_8);
  lean_inc(x_7);
  lean_inc(x_6);
  lean_inc(x_5);
  lean_inc(x_4);
  lean_inc(x_26);
  lean_inc(x_2);
  x_29 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts(x_2, x_26, x_4, x_5, x_6, x_7, x_8, x_9, x_28);
  if (lean_obj_tag(x_29) == 0)
  {
  lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; 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; lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; 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; uint8_t x_63; lean_object* x_64; lean_object* x_65; 
  x_30 = lean_ctor_get(x_29, 0);
  lean_inc(x_30);
  x_31 = lean_ctor_get(x_29, 1);
  lean_inc(x_31);
  lean_dec(x_29);
  lean_inc(x_8);
  x_32 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_8, x_9, x_31);
  x_33 = lean_ctor_get(x_32, 0);
  lean_inc(x_33);
  x_34 = lean_ctor_get(x_32, 1);
  lean_inc(x_34);
  lean_dec(x_32);
  x_35 = l_Lean_Elab_Term_getCurrMacroScope(x_4, x_5, x_6, x_7, x_8, x_9, x_34);
  x_36 = lean_ctor_get(x_35, 0);
  lean_inc(x_36);
  x_37 = lean_ctor_get(x_35, 1);
  lean_inc(x_37);
  lean_dec(x_35);
  x_38 = l_Lean_Elab_Term_getMainModule___rarg(x_9, x_37);
  x_39 = lean_ctor_get(x_38, 0);
  lean_inc(x_39);
  x_40 = lean_ctor_get(x_38, 1);
  lean_inc(x_40);
  lean_dec(x_38);
  x_41 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__7;
  x_42 = l_Lean_addMacroScope(x_39, x_41, x_36);
  x_43 = lean_box(0);
  x_44 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__4;
  x_45 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__9;
  lean_inc(x_33);
  x_46 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_46, 0, x_33);
  lean_ctor_set(x_46, 1, x_44);
  lean_ctor_set(x_46, 2, x_42);
  lean_ctor_set(x_46, 3, x_45);
  x_47 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__12;
  x_48 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_48, 0, x_33);
  lean_ctor_set(x_48, 1, x_47);
  x_49 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_50 = lean_array_push(x_49, x_48);
  x_51 = lean_box(2);
  x_52 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__11;
  x_53 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_53, 0, x_51);
  lean_ctor_set(x_53, 1, x_52);
  lean_ctor_set(x_53, 2, x_50);
  x_54 = lean_array_push(x_49, x_53);
  x_55 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_56 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_56, 0, x_51);
  lean_ctor_set(x_56, 1, x_55);
  lean_ctor_set(x_56, 2, x_54);
  x_57 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_58 = lean_array_push(x_57, x_46);
  x_59 = lean_array_push(x_58, x_56);
  x_60 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__4;
  x_61 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_61, 0, x_51);
  lean_ctor_set(x_61, 1, x_60);
  lean_ctor_set(x_61, 2, x_59);
  x_62 = lean_array_get_size(x_30);
  x_63 = lean_nat_dec_le(x_62, x_62);
  if (x_63 == 0)
  {
  uint8_t x_91; 
  x_91 = lean_nat_dec_lt(x_17, x_62);
  if (x_91 == 0)
  {
  lean_dec(x_62);
  lean_dec(x_30);
  x_64 = x_61;
  x_65 = x_40;
  goto block_90;
  }
  else
  {
  size_t x_92; size_t x_93; lean_object* x_94; lean_object* x_95; lean_object* x_96; lean_object* x_97; lean_object* x_98; 
  x_92 = lean_usize_of_nat(x_62);
  lean_dec(x_62);
  x_93 = 0;
  x_94 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6;
  x_95 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__5;
  lean_inc(x_8);
  x_96 = l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1(x_94, x_60, x_95, x_43, x_43, x_55, x_49, x_57, x_30, x_92, x_93, x_61, x_4, x_5, x_6, x_7, x_8, x_9, x_40);
  lean_dec(x_30);
  x_97 = lean_ctor_get(x_96, 0);
  lean_inc(x_97);
  x_98 = lean_ctor_get(x_96, 1);
  lean_inc(x_98);
  lean_dec(x_96);
  x_64 = x_97;
  x_65 = x_98;
  goto block_90;
  }
  }
  else
  {
  uint8_t x_99; 
  x_99 = lean_nat_dec_lt(x_17, x_62);
  if (x_99 == 0)
  {
  lean_dec(x_62);
  lean_dec(x_30);
  x_64 = x_61;
  x_65 = x_40;
  goto block_90;
  }
  else
  {
  size_t x_100; size_t x_101; lean_object* x_102; lean_object* x_103; lean_object* x_104; lean_object* x_105; lean_object* x_106; 
  x_100 = lean_usize_of_nat(x_62);
  lean_dec(x_62);
  x_101 = 0;
  x_102 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6;
  x_103 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__5;
  lean_inc(x_8);
  x_104 = l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__2(x_102, x_60, x_103, x_43, x_43, x_55, x_49, x_57, x_30, x_100, x_101, x_61, x_4, x_5, x_6, x_7, x_8, x_9, x_40);
  lean_dec(x_30);
  x_105 = lean_ctor_get(x_104, 0);
  lean_inc(x_105);
  x_106 = lean_ctor_get(x_104, 1);
  lean_inc(x_106);
  lean_dec(x_104);
  x_64 = x_105;
  x_65 = x_106;
  goto block_90;
  }
  }
  block_90:
  {
  uint8_t x_66; 
  x_66 = lean_ctor_get_uint8(x_13, sizeof(void*)*2);
  if (x_66 == 0)
  {
  lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72; 
  x_67 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__4;
  x_68 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6;
  x_69 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__2;
  x_70 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__5;
  x_71 = lean_box(0);
  x_72 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1(x_13, x_19, x_3, x_49, x_21, x_18, x_67, x_55, x_57, x_26, x_68, x_43, x_69, x_70, x_60, x_2, x_64, x_71, x_4, x_5, x_6, x_7, x_8, x_9, x_65);
  lean_dec(x_2);
  lean_dec(x_13);
  return x_72;
  }
  else
  {
  lean_object* x_73; lean_object* x_74; 
  x_73 = lean_ctor_get(x_21, 1);
  lean_inc(x_73);
  lean_inc(x_9);
  lean_inc(x_8);
  lean_inc(x_7);
  lean_inc(x_6);
  lean_inc(x_5);
  lean_inc(x_4);
  x_74 = l_Lean_Elab_Deriving_mkLocalInstanceLetDecls(x_13, x_19, x_73, x_4, x_5, x_6, x_7, x_8, x_9, x_65);
  if (lean_obj_tag(x_74) == 0)
  {
  lean_object* x_75; lean_object* x_76; lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; 
  x_75 = lean_ctor_get(x_74, 0);
  lean_inc(x_75);
  x_76 = lean_ctor_get(x_74, 1);
  lean_inc(x_76);
  lean_dec(x_74);
  lean_inc(x_9);
  lean_inc(x_8);
  lean_inc(x_7);
  lean_inc(x_6);
  lean_inc(x_5);
  lean_inc(x_4);
  x_77 = l_Lean_Elab_Deriving_mkLet(x_75, x_64, x_4, x_5, x_6, x_7, x_8, x_9, x_76);
  lean_dec(x_75);
  x_78 = lean_ctor_get(x_77, 0);
  lean_inc(x_78);
  x_79 = lean_ctor_get(x_77, 1);
  lean_inc(x_79);
  lean_dec(x_77);
  x_80 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__4;
  x_81 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6;
  x_82 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__2;
  x_83 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__5;
  x_84 = lean_box(0);
  x_85 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1(x_13, x_19, x_3, x_49, x_21, x_18, x_80, x_55, x_57, x_26, x_81, x_43, x_82, x_83, x_60, x_2, x_78, x_84, x_4, x_5, x_6, x_7, x_8, x_9, x_79);
  lean_dec(x_2);
  lean_dec(x_13);
  return x_85;
  }
  else
  {
  uint8_t x_86; 
  lean_dec(x_64);
  lean_dec(x_26);
  lean_dec(x_21);
  lean_dec(x_18);
  lean_dec(x_13);
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_5);
  lean_dec(x_4);
  lean_dec(x_2);
  x_86 = !lean_is_exclusive(x_74);
  if (x_86 == 0)
  {
  return x_74;
  }
  else
  {
  lean_object* x_87; lean_object* x_88; lean_object* x_89; 
  x_87 = lean_ctor_get(x_74, 0);
  x_88 = lean_ctor_get(x_74, 1);
  lean_inc(x_88);
  lean_inc(x_87);
  lean_dec(x_74);
  x_89 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_89, 0, x_87);
  lean_ctor_set(x_89, 1, x_88);
  return x_89;
  }
  }
  }
  }
  }
  else
  {
  uint8_t x_107; 
  lean_dec(x_26);
  lean_dec(x_21);
  lean_dec(x_18);
  lean_dec(x_13);
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_5);
  lean_dec(x_4);
  lean_dec(x_2);
  x_107 = !lean_is_exclusive(x_29);
  if (x_107 == 0)
  {
  return x_29;
  }
  else
  {
  lean_object* x_108; lean_object* x_109; lean_object* x_110; 
  x_108 = lean_ctor_get(x_29, 0);
  x_109 = lean_ctor_get(x_29, 1);
  lean_inc(x_109);
  lean_inc(x_108);
  lean_dec(x_29);
  x_110 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_110, 0, x_108);
  lean_ctor_set(x_110, 1, x_109);
  return x_110;
  }
  }
  }
  else
  {
  uint8_t x_111; 
  lean_dec(x_26);
  lean_dec(x_21);
  lean_dec(x_18);
  lean_dec(x_13);
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_5);
  lean_dec(x_4);
  lean_dec(x_2);
  x_111 = !lean_is_exclusive(x_27);
  if (x_111 == 0)
  {
  return x_27;
  }
  else
  {
  lean_object* x_112; lean_object* x_113; lean_object* x_114; 
  x_112 = lean_ctor_get(x_27, 0);
  x_113 = lean_ctor_get(x_27, 1);
  lean_inc(x_113);
  lean_inc(x_112);
  lean_dec(x_27);
  x_114 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_114, 0, x_112);
  lean_ctor_set(x_114, 1, x_113);
  return x_114;
  }
  }
  }
  else
  {
  uint8_t x_115; 
  lean_dec(x_18);
  lean_dec(x_13);
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_5);
  lean_dec(x_4);
  lean_dec(x_2);
  x_115 = !lean_is_exclusive(x_20);
  if (x_115 == 0)
  {
  return x_20;
  }
  else
  {
  lean_object* x_116; lean_object* x_117; lean_object* x_118; 
  x_116 = lean_ctor_get(x_20, 0);
  x_117 = lean_ctor_get(x_20, 1);
  lean_inc(x_117);
  lean_inc(x_116);
  lean_dec(x_20);
  x_118 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_118, 0, x_116);
  lean_ctor_set(x_118, 1, x_117);
  return x_118;
  }
  }
  }
  else
  {
  uint8_t x_119; 
  lean_dec(x_9);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_5);
  lean_dec(x_4);
  lean_dec(x_2);
  x_119 = !lean_is_exclusive(x_12);
  if (x_119 == 0)
  {
  return x_12;
  }
  else
  {
  lean_object* x_120; lean_object* x_121; lean_object* x_122; 
  x_120 = lean_ctor_get(x_12, 0);
  x_121 = lean_ctor_get(x_12, 1);
  lean_inc(x_121);
  lean_inc(x_120);
  lean_dec(x_12);
  x_122 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_122, 0, x_120);
  lean_ctor_set(x_122, 1, x_121);
  return x_122;
  }
  }
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__1() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6;
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__1;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__2() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("j");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__3() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; 
  x_1 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__2;
  x_2 = lean_string_utf8_byte_size(x_1);
  return x_2;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__4() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; 
  x_1 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__2;
  x_2 = lean_unsigned_to_nat(0u);
  x_3 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__3;
  x_4 = lean_alloc_ctor(0, 3, 0);
  lean_ctor_set(x_4, 0, x_1);
  lean_ctor_set(x_4, 1, x_2);
  lean_ctor_set(x_4, 2, x_3);
  return x_4;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__5() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__2;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__6() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__3;
  x_3 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_3, 0, x_2);
  lean_ctor_set(x_3, 1, x_1);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__7() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__6;
  x_3 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_3, 0, x_2);
  lean_ctor_set(x_3, 1, x_1);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__8() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6;
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__6;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__9() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__5;
  x_3 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_3, 0, x_2);
  lean_ctor_set(x_3, 1, x_1);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__10() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__9;
  x_3 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_3, 0, x_2);
  lean_ctor_set(x_3, 1, x_1);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__11() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__13;
  x_3 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_3, 0, x_2);
  lean_ctor_set(x_3, 1, x_1);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__12() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = lean_box(0);
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__11;
  x_3 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_3, 0, x_2);
  lean_ctor_set(x_3, 1, x_1);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__13() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("structInst");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__14() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6;
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__13;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__15() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("{");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__16() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("optEllipsis");
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__17() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6;
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__16;
  x_3 = lean_name_mk_string(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__18() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; 
  x_1 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__5;
  x_3 = lean_array_push(x_1, x_2);
  return x_3;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__19() {
  _start:
  {
  lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; 
  x_1 = lean_box(2);
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__17;
  x_3 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__18;
  x_4 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_4, 0, x_1);
  lean_ctor_set(x_4, 1, x_2);
  lean_ctor_set(x_4, 2, x_3);
  return x_4;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__20() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_mk_string("}");
  return x_1;
  }
  }
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9) {
  _start:
  {
  lean_object* x_10; lean_object* x_11; 
  x_10 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__1;
  lean_inc(x_8);
  lean_inc(x_7);
  lean_inc(x_6);
  lean_inc(x_5);
  lean_inc(x_4);
  lean_inc(x_3);
  lean_inc(x_1);
  x_11 = l_Lean_Elab_Deriving_mkContext(x_10, x_1, x_3, x_4, x_5, x_6, x_7, x_8, x_9);
  if (lean_obj_tag(x_11) == 0)
  {
  lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; 
  x_12 = lean_ctor_get(x_11, 0);
  lean_inc(x_12);
  x_13 = lean_ctor_get(x_11, 1);
  lean_inc(x_13);
  lean_dec(x_11);
  x_14 = lean_ctor_get(x_12, 0);
  lean_inc(x_14);
  x_15 = l_Lean_instInhabitedInductiveVal;
  x_16 = lean_unsigned_to_nat(0u);
  x_17 = lean_array_get(x_15, x_14, x_16);
  lean_dec(x_14);
  x_18 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__8;
  lean_inc(x_8);
  lean_inc(x_7);
  lean_inc(x_6);
  lean_inc(x_5);
  lean_inc(x_4);
  lean_inc(x_3);
  lean_inc(x_17);
  x_19 = l_Lean_Elab_Deriving_mkHeader___rarg(x_18, x_16, x_17, x_3, x_4, x_5, x_6, x_7, x_8, x_13);
  if (lean_obj_tag(x_19) == 0)
  {
  lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; uint8_t x_26; lean_object* x_27; lean_object* x_28; size_t x_29; size_t x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; 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; lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; 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; lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76; lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_object* x_94; lean_object* x_95; lean_object* x_96; lean_object* x_97; lean_object* x_98; lean_object* x_99; lean_object* x_100; lean_object* x_101; lean_object* x_102; lean_object* x_103; lean_object* x_104; lean_object* x_105; lean_object* x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; lean_object* x_110; lean_object* x_111; lean_object* x_112; lean_object* x_113; lean_object* x_114; lean_object* x_115; lean_object* x_116; lean_object* x_117; lean_object* x_118; lean_object* x_119; lean_object* x_120; lean_object* x_121; lean_object* x_122; lean_object* x_123; lean_object* x_124; lean_object* x_125; lean_object* x_126; lean_object* x_127; lean_object* x_128; lean_object* x_129; lean_object* x_130; lean_object* x_131; lean_object* x_132; lean_object* x_133; lean_object* x_134; lean_object* x_135; lean_object* x_136; lean_object* x_137; lean_object* x_138; lean_object* x_139; lean_object* x_140; lean_object* x_141; lean_object* x_142; lean_object* x_143; size_t x_144; lean_object* x_145; lean_object* x_146; lean_object* x_147; lean_object* x_148; lean_object* x_149; lean_object* x_150; lean_object* x_151; lean_object* x_152; lean_object* x_153; lean_object* x_154; lean_object* x_155; lean_object* x_156; size_t x_157; lean_object* x_158; lean_object* x_159; lean_object* x_160; lean_object* x_161; lean_object* x_162; lean_object* x_163; lean_object* x_164; lean_object* x_165; lean_object* x_166; lean_object* x_167; lean_object* x_168; lean_object* x_169; lean_object* x_170; lean_object* x_171; 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; lean_object* 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_190; lean_object* x_191; lean_object* x_192; lean_object* x_193; lean_object* x_194; lean_object* x_195; lean_object* x_196; 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; 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; lean_object* x_211; lean_object* x_212; lean_object* x_213; uint8_t x_214; lean_object* x_215; 
  x_20 = lean_ctor_get(x_19, 0);
  lean_inc(x_20);
  x_21 = lean_ctor_get(x_19, 1);
  lean_inc(x_21);
  lean_dec(x_19);
  x_22 = lean_st_ref_get(x_8, x_21);
  x_23 = lean_ctor_get(x_22, 0);
  lean_inc(x_23);
  x_24 = lean_ctor_get(x_22, 1);
  lean_inc(x_24);
  lean_dec(x_22);
  x_25 = lean_ctor_get(x_23, 0);
  lean_inc(x_25);
  lean_dec(x_23);
  x_26 = 0;
  x_27 = l_Lean_getStructureFieldsFlattened(x_25, x_1, x_26);
  x_28 = lean_array_get_size(x_27);
  x_29 = lean_usize_of_nat(x_28);
  lean_dec(x_28);
  x_30 = 0;
  x_31 = x_27;
  lean_inc(x_31);
  x_32 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__3___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__4(x_29, x_30, x_31);
  x_33 = x_32;
  x_34 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_mkInductiveApp___spec__1(x_29, x_30, x_31);
  x_35 = x_34;
  x_36 = lean_ctor_get(x_20, 1);
  lean_inc(x_36);
  lean_inc(x_7);
  x_37 = l_Lean_Elab_Deriving_mkInductiveApp(x_17, x_36, x_3, x_4, x_5, x_6, x_7, x_8, x_24);
  x_38 = lean_ctor_get(x_37, 0);
  lean_inc(x_38);
  x_39 = lean_ctor_get(x_37, 1);
  lean_inc(x_39);
  lean_dec(x_37);
  lean_inc(x_7);
  x_40 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(x_7, x_8, x_39);
  x_41 = lean_ctor_get(x_40, 0);
  lean_inc(x_41);
  x_42 = lean_ctor_get(x_40, 1);
  lean_inc(x_42);
  lean_dec(x_40);
  x_43 = l_Lean_Elab_Term_getCurrMacroScope(x_3, x_4, x_5, x_6, x_7, x_8, x_42);
  x_44 = lean_ctor_get(x_43, 0);
  lean_inc(x_44);
  x_45 = lean_ctor_get(x_43, 1);
  lean_inc(x_45);
  lean_dec(x_43);
  x_46 = l_Lean_Elab_Term_getMainModule___rarg(x_8, x_45);
  x_47 = lean_ctor_get(x_46, 0);
  lean_inc(x_47);
  x_48 = lean_ctor_get(x_46, 1);
  lean_inc(x_48);
  lean_dec(x_46);
  x_49 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__16;
  lean_inc(x_41);
  x_50 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_50, 0, x_41);
  lean_ctor_set(x_50, 1, x_49);
  x_51 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10;
  x_52 = lean_array_push(x_51, x_50);
  x_53 = lean_box(2);
  x_54 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__17;
  x_55 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_55, 0, x_53);
  lean_ctor_set(x_55, 1, x_54);
  lean_ctor_set(x_55, 2, x_52);
  x_56 = lean_array_push(x_51, x_55);
  x_57 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10;
  x_58 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_58, 0, x_53);
  lean_ctor_set(x_58, 1, x_57);
  lean_ctor_set(x_58, 2, x_56);
  x_59 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__19;
  x_60 = lean_array_push(x_59, x_58);
  x_61 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__5;
  x_62 = lean_array_push(x_60, x_61);
  x_63 = lean_array_push(x_62, x_61);
  x_64 = lean_array_push(x_63, x_61);
  x_65 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__15;
  x_66 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_66, 0, x_53);
  lean_ctor_set(x_66, 1, x_65);
  lean_ctor_set(x_66, 2, x_64);
  x_67 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__20;
  lean_inc(x_41);
  x_68 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_68, 0, x_41);
  lean_ctor_set(x_68, 1, x_67);
  x_69 = lean_ctor_get(x_12, 1);
  lean_inc(x_69);
  x_70 = l_Lean_instInhabitedName;
  x_71 = lean_array_get(x_70, x_69, x_16);
  lean_dec(x_69);
  x_72 = lean_mk_syntax_ident(x_71);
  x_73 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
  x_74 = lean_array_push(x_73, x_72);
  x_75 = lean_array_push(x_74, x_61);
  x_76 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__23;
  x_77 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_77, 0, x_53);
  lean_ctor_set(x_77, 1, x_76);
  lean_ctor_set(x_77, 2, x_75);
  x_78 = lean_ctor_get(x_20, 0);
  lean_inc(x_78);
  lean_dec(x_20);
  x_79 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__1;
  x_80 = l_Array_append___rarg(x_79, x_78);
  x_81 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__2;
  lean_inc(x_41);
  x_82 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_82, 0, x_41);
  lean_ctor_set(x_82, 1, x_81);
  x_83 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__5;
  lean_inc(x_44);
  lean_inc(x_47);
  x_84 = l_Lean_addMacroScope(x_47, x_83, x_44);
  x_85 = lean_box(0);
  x_86 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__4;
  lean_inc(x_41);
  x_87 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_87, 0, x_41);
  lean_ctor_set(x_87, 1, x_86);
  lean_ctor_set(x_87, 2, x_84);
  lean_ctor_set(x_87, 3, x_85);
  lean_inc(x_87);
  x_88 = lean_array_push(x_51, x_87);
  x_89 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_89, 0, x_53);
  lean_ctor_set(x_89, 1, x_57);
  lean_ctor_set(x_89, 2, x_88);
  x_90 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__2;
  lean_inc(x_41);
  x_91 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_91, 0, x_41);
  lean_ctor_set(x_91, 1, x_90);
  x_92 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__8;
  lean_inc(x_44);
  lean_inc(x_47);
  x_93 = l_Lean_addMacroScope(x_47, x_92, x_44);
  x_94 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__4;
  x_95 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__7;
  lean_inc(x_41);
  x_96 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_96, 0, x_41);
  lean_ctor_set(x_96, 1, x_94);
  lean_ctor_set(x_96, 2, x_93);
  lean_ctor_set(x_96, 3, x_95);
  x_97 = lean_array_push(x_73, x_91);
  lean_inc(x_97);
  x_98 = lean_array_push(x_97, x_96);
  x_99 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_99, 0, x_53);
  lean_ctor_set(x_99, 1, x_57);
  lean_ctor_set(x_99, 2, x_98);
  x_100 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__4;
  lean_inc(x_41);
  x_101 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_101, 0, x_41);
  lean_ctor_set(x_101, 1, x_100);
  x_102 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__5;
  x_103 = lean_array_push(x_102, x_82);
  x_104 = lean_array_push(x_103, x_89);
  x_105 = lean_array_push(x_104, x_99);
  x_106 = lean_array_push(x_105, x_61);
  x_107 = lean_array_push(x_106, x_101);
  x_108 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__1;
  x_109 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_109, 0, x_53);
  lean_ctor_set(x_109, 1, x_108);
  lean_ctor_set(x_109, 2, x_107);
  x_110 = lean_array_push(x_80, x_109);
  x_111 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_111, 0, x_53);
  lean_ctor_set(x_111, 1, x_57);
  lean_ctor_set(x_111, 2, x_110);
  x_112 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__5;
  lean_inc(x_44);
  lean_inc(x_47);
  x_113 = l_Lean_addMacroScope(x_47, x_112, x_44);
  x_114 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__9;
  x_115 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__10;
  lean_inc(x_41);
  x_116 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_116, 0, x_41);
  lean_ctor_set(x_116, 1, x_114);
  lean_ctor_set(x_116, 2, x_113);
  lean_ctor_set(x_116, 3, x_115);
  x_117 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__13;
  lean_inc(x_44);
  lean_inc(x_47);
  x_118 = l_Lean_addMacroScope(x_47, x_117, x_44);
  x_119 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__12;
  x_120 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__12;
  lean_inc(x_41);
  x_121 = lean_alloc_ctor(3, 4, 0);
  lean_ctor_set(x_121, 0, x_41);
  lean_ctor_set(x_121, 1, x_119);
  lean_ctor_set(x_121, 2, x_118);
  lean_ctor_set(x_121, 3, x_120);
  x_122 = lean_array_push(x_73, x_121);
  x_123 = lean_array_push(x_122, x_38);
  x_124 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_124, 0, x_53);
  lean_ctor_set(x_124, 1, x_57);
  lean_ctor_set(x_124, 2, x_123);
  x_125 = lean_array_push(x_73, x_116);
  x_126 = lean_array_push(x_125, x_124);
  x_127 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__4;
  x_128 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_128, 0, x_53);
  lean_ctor_set(x_128, 1, x_127);
  lean_ctor_set(x_128, 2, x_126);
  x_129 = lean_array_push(x_97, x_128);
  x_130 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__8;
  x_131 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_131, 0, x_53);
  lean_ctor_set(x_131, 1, x_130);
  lean_ctor_set(x_131, 2, x_129);
  x_132 = lean_array_push(x_51, x_131);
  x_133 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_133, 0, x_53);
  lean_ctor_set(x_133, 1, x_57);
  lean_ctor_set(x_133, 2, x_132);
  x_134 = lean_array_push(x_73, x_111);
  x_135 = lean_array_push(x_134, x_133);
  x_136 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__25;
  x_137 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_137, 0, x_53);
  lean_ctor_set(x_137, 1, x_136);
  lean_ctor_set(x_137, 2, x_135);
  x_138 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__28;
  lean_inc(x_41);
  x_139 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_139, 0, x_41);
  lean_ctor_set(x_139, 1, x_138);
  x_140 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__29;
  lean_inc(x_41);
  x_141 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_141, 0, x_41);
  lean_ctor_set(x_141, 1, x_140);
  x_142 = l_Array_zip___rarg(x_35, x_33);
  lean_dec(x_33);
  x_143 = lean_array_get_size(x_142);
  x_144 = lean_usize_of_nat(x_143);
  lean_dec(x_143);
  x_145 = x_142;
  x_146 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6;
  x_147 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__3;
  lean_inc(x_41);
  x_148 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5(x_41, x_44, x_47, x_57, x_61, x_51, x_73, x_146, x_85, x_87, x_147, x_85, x_127, x_144, x_30, x_145);
  x_149 = x_148;
  x_150 = l_Array_append___rarg(x_79, x_149);
  x_151 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__36;
  lean_inc(x_41);
  x_152 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_152, 0, x_41);
  lean_ctor_set(x_152, 1, x_151);
  x_153 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__15;
  lean_inc(x_41);
  x_154 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_154, 0, x_41);
  lean_ctor_set(x_154, 1, x_153);
  x_155 = l_Array_zip___rarg(x_35, x_35);
  lean_dec(x_35);
  x_156 = lean_array_get_size(x_155);
  x_157 = lean_usize_of_nat(x_156);
  lean_dec(x_156);
  x_158 = x_155;
  lean_inc(x_139);
  x_159 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__6(x_61, x_73, x_146, x_139, x_157, x_30, x_158);
  x_160 = x_159;
  x_161 = l_Array_append___rarg(x_79, x_160);
  x_162 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_162, 0, x_53);
  lean_ctor_set(x_162, 1, x_57);
  lean_ctor_set(x_162, 2, x_161);
  x_163 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__20;
  x_164 = lean_alloc_ctor(2, 2, 0);
  lean_ctor_set(x_164, 0, x_41);
  lean_ctor_set(x_164, 1, x_163);
  x_165 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__9;
  x_166 = lean_array_push(x_165, x_154);
  x_167 = lean_array_push(x_166, x_61);
  x_168 = lean_array_push(x_167, x_162);
  x_169 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__19;
  x_170 = lean_array_push(x_168, x_169);
  x_171 = lean_array_push(x_170, x_61);
  x_172 = lean_array_push(x_171, x_164);
  x_173 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__14;
  x_174 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_174, 0, x_53);
  lean_ctor_set(x_174, 1, x_173);
  lean_ctor_set(x_174, 2, x_172);
  x_175 = lean_array_push(x_51, x_174);
  x_176 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_176, 0, x_53);
  lean_ctor_set(x_176, 1, x_57);
  lean_ctor_set(x_176, 2, x_175);
  x_177 = lean_array_push(x_73, x_152);
  x_178 = lean_array_push(x_177, x_176);
  x_179 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__35;
  x_180 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_180, 0, x_53);
  lean_ctor_set(x_180, 1, x_179);
  lean_ctor_set(x_180, 2, x_178);
  x_181 = lean_array_push(x_73, x_180);
  x_182 = lean_array_push(x_181, x_61);
  x_183 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__33;
  x_184 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_184, 0, x_53);
  lean_ctor_set(x_184, 1, x_183);
  lean_ctor_set(x_184, 2, x_182);
  x_185 = lean_array_push(x_150, x_184);
  x_186 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_186, 0, x_53);
  lean_ctor_set(x_186, 1, x_57);
  lean_ctor_set(x_186, 2, x_185);
  x_187 = lean_array_push(x_51, x_186);
  x_188 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__32;
  x_189 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_189, 0, x_53);
  lean_ctor_set(x_189, 1, x_188);
  lean_ctor_set(x_189, 2, x_187);
  x_190 = lean_array_push(x_73, x_141);
  x_191 = lean_array_push(x_190, x_189);
  x_192 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__30;
  x_193 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_193, 0, x_53);
  lean_ctor_set(x_193, 1, x_192);
  lean_ctor_set(x_193, 2, x_191);
  x_194 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5;
  x_195 = lean_array_push(x_194, x_139);
  x_196 = lean_array_push(x_195, x_193);
  x_197 = lean_array_push(x_196, x_61);
  x_198 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__27;
  x_199 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_199, 0, x_53);
  lean_ctor_set(x_199, 1, x_198);
  lean_ctor_set(x_199, 2, x_197);
  x_200 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__29;
  x_201 = lean_array_push(x_200, x_68);
  x_202 = lean_array_push(x_201, x_77);
  x_203 = lean_array_push(x_202, x_137);
  x_204 = lean_array_push(x_203, x_199);
  x_205 = lean_array_push(x_204, x_61);
  x_206 = lean_array_push(x_205, x_61);
  x_207 = lean_array_push(x_206, x_61);
  x_208 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__21;
  x_209 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_209, 0, x_53);
  lean_ctor_set(x_209, 1, x_208);
  lean_ctor_set(x_209, 2, x_207);
  x_210 = lean_array_push(x_73, x_66);
  x_211 = lean_array_push(x_210, x_209);
  x_212 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__13;
  x_213 = lean_alloc_ctor(1, 3, 0);
  lean_ctor_set(x_213, 0, x_53);
  lean_ctor_set(x_213, 1, x_212);
  lean_ctor_set(x_213, 2, x_211);
  x_214 = 1;
  x_215 = l_Lean_Elab_Deriving_mkInstanceCmds(x_12, x_18, x_2, x_214, x_3, x_4, x_5, x_6, x_7, x_8, x_48);
  lean_dec(x_12);
  if (lean_obj_tag(x_215) == 0)
  {
  uint8_t x_216; 
  x_216 = !lean_is_exclusive(x_215);
  if (x_216 == 0)
  {
  lean_object* x_217; lean_object* x_218; lean_object* x_219; 
  x_217 = lean_ctor_get(x_215, 0);
  x_218 = lean_array_push(x_51, x_213);
  x_219 = l_Array_append___rarg(x_218, x_217);
  lean_ctor_set(x_215, 0, x_219);
  return x_215;
  }
  else
  {
  lean_object* x_220; lean_object* x_221; lean_object* x_222; lean_object* x_223; lean_object* x_224; 
  x_220 = lean_ctor_get(x_215, 0);
  x_221 = lean_ctor_get(x_215, 1);
  lean_inc(x_221);
  lean_inc(x_220);
  lean_dec(x_215);
  x_222 = lean_array_push(x_51, x_213);
  x_223 = l_Array_append___rarg(x_222, x_220);
  x_224 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_224, 0, x_223);
  lean_ctor_set(x_224, 1, x_221);
  return x_224;
  }
  }
  else
  {
  uint8_t x_225; 
  lean_dec(x_213);
  x_225 = !lean_is_exclusive(x_215);
  if (x_225 == 0)
  {
  return x_215;
  }
  else
  {
  lean_object* x_226; lean_object* x_227; lean_object* x_228; 
  x_226 = lean_ctor_get(x_215, 0);
  x_227 = lean_ctor_get(x_215, 1);
  lean_inc(x_227);
  lean_inc(x_226);
  lean_dec(x_215);
  x_228 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_228, 0, x_226);
  lean_ctor_set(x_228, 1, x_227);
  return x_228;
  }
  }
  }
  else
  {
  uint8_t x_229; 
  lean_dec(x_17);
  lean_dec(x_12);
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_5);
  lean_dec(x_4);
  lean_dec(x_3);
  lean_dec(x_1);
  x_229 = !lean_is_exclusive(x_19);
  if (x_229 == 0)
  {
  return x_19;
  }
  else
  {
  lean_object* x_230; lean_object* x_231; lean_object* x_232; 
  x_230 = lean_ctor_get(x_19, 0);
  x_231 = lean_ctor_get(x_19, 1);
  lean_inc(x_231);
  lean_inc(x_230);
  lean_dec(x_19);
  x_232 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_232, 0, x_230);
  lean_ctor_set(x_232, 1, x_231);
  return x_232;
  }
  }
  }
  else
  {
  uint8_t x_233; 
  lean_dec(x_8);
  lean_dec(x_7);
  lean_dec(x_6);
  lean_dec(x_5);
  lean_dec(x_4);
  lean_dec(x_3);
  lean_dec(x_1);
  x_233 = !lean_is_exclusive(x_11);
  if (x_233 == 0)
  {
  return x_11;
  }
  else
  {
  lean_object* x_234; lean_object* x_235; lean_object* x_236; 
  x_234 = lean_ctor_get(x_11, 0);
  x_235 = lean_ctor_get(x_11, 1);
  lean_inc(x_235);
  lean_inc(x_234);
  lean_dec(x_11);
  x_236 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_236, 0, x_234);
  lean_ctor_set(x_236, 1, x_235);
  return x_236;
  }
  }
  }
  }
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler(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; 
  x_5 = lean_array_get_size(x_1);
  x_6 = lean_unsigned_to_nat(1u);
  x_7 = lean_nat_dec_eq(x_5, x_6);
  lean_dec(x_5);
  if (x_7 == 0)
  {
  uint8_t x_8; lean_object* x_9; lean_object* x_10; 
  lean_dec(x_3);
  lean_dec(x_2);
  lean_dec(x_1);
  x_8 = 0;
  x_9 = lean_box(x_8);
  x_10 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_10, 0, x_9);
  lean_ctor_set(x_10, 1, x_4);
  return x_10;
  }
  else
  {
  lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; uint8_t x_18; 
  x_11 = lean_st_ref_get(x_3, x_4);
  x_12 = lean_ctor_get(x_11, 0);
  lean_inc(x_12);
  x_13 = lean_ctor_get(x_11, 1);
  lean_inc(x_13);
  lean_dec(x_11);
  x_14 = lean_ctor_get(x_12, 0);
  lean_inc(x_14);
  lean_dec(x_12);
  x_15 = l_Lean_instInhabitedName;
  x_16 = lean_unsigned_to_nat(0u);
  x_17 = lean_array_get(x_15, x_1, x_16);
  lean_inc(x_17);
  x_18 = l_Lean_isStructure(x_14, x_17);
  if (x_18 == 0)
  {
  lean_object* x_19; 
  lean_inc(x_2);
  lean_inc(x_17);
  x_19 = l_Lean_getConstInfoInduct___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__1(x_17, x_2, x_3, x_13);
  if (lean_obj_tag(x_19) == 0)
  {
  lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; 
  x_20 = lean_ctor_get(x_19, 0);
  lean_inc(x_20);
  x_21 = lean_ctor_get(x_19, 1);
  lean_inc(x_21);
  lean_dec(x_19);
  x_22 = lean_box(0);
  x_23 = lean_alloc_closure((void*)(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___boxed), 10, 3);
  lean_closure_set(x_23, 0, x_17);
  lean_closure_set(x_23, 1, x_20);
  lean_closure_set(x_23, 2, x_1);
  lean_inc(x_2);
  x_24 = l_Lean_Elab_Command_liftTermElabM___rarg(x_22, x_23, x_2, x_3, x_21);
  if (lean_obj_tag(x_24) == 0)
  {
  uint8_t x_25; 
  x_25 = !lean_is_exclusive(x_24);
  if (x_25 == 0)
  {
  lean_object* x_26; lean_object* x_27; lean_object* x_28; uint8_t x_29; 
  x_26 = lean_ctor_get(x_24, 0);
  x_27 = lean_ctor_get(x_24, 1);
  x_28 = lean_array_get_size(x_26);
  x_29 = lean_nat_dec_lt(x_16, x_28);
  if (x_29 == 0)
  {
  uint8_t x_30; lean_object* x_31; 
  lean_dec(x_28);
  lean_dec(x_26);
  lean_dec(x_3);
  lean_dec(x_2);
  x_30 = 1;
  x_31 = lean_box(x_30);
  lean_ctor_set(x_24, 0, x_31);
  return x_24;
  }
  else
  {
  uint8_t x_32; 
  x_32 = lean_nat_dec_le(x_28, x_28);
  if (x_32 == 0)
  {
  uint8_t x_33; lean_object* x_34; 
  lean_dec(x_28);
  lean_dec(x_26);
  lean_dec(x_3);
  lean_dec(x_2);
  x_33 = 1;
  x_34 = lean_box(x_33);
  lean_ctor_set(x_24, 0, x_34);
  return x_24;
  }
  else
  {
  size_t x_35; size_t x_36; lean_object* x_37; lean_object* x_38; 
  lean_free_object(x_24);
  x_35 = 0;
  x_36 = lean_usize_of_nat(x_28);
  lean_dec(x_28);
  x_37 = lean_box(0);
  x_38 = l_Array_foldlMUnsafe_fold___at_Lean_Elab_Command_elabCommand___spec__10(x_26, x_35, x_36, x_37, x_2, x_3, x_27);
  lean_dec(x_26);
  if (lean_obj_tag(x_38) == 0)
  {
  uint8_t x_39; 
  x_39 = !lean_is_exclusive(x_38);
  if (x_39 == 0)
  {
  lean_object* x_40; uint8_t x_41; lean_object* x_42; 
  x_40 = lean_ctor_get(x_38, 0);
  lean_dec(x_40);
  x_41 = 1;
  x_42 = lean_box(x_41);
  lean_ctor_set(x_38, 0, x_42);
  return x_38;
  }
  else
  {
  lean_object* x_43; uint8_t x_44; lean_object* x_45; lean_object* x_46; 
  x_43 = lean_ctor_get(x_38, 1);
  lean_inc(x_43);
  lean_dec(x_38);
  x_44 = 1;
  x_45 = lean_box(x_44);
  x_46 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_46, 0, x_45);
  lean_ctor_set(x_46, 1, x_43);
  return x_46;
  }
  }
  else
  {
  uint8_t x_47; 
  x_47 = !lean_is_exclusive(x_38);
  if (x_47 == 0)
  {
  return x_38;
  }
  else
  {
  lean_object* x_48; lean_object* x_49; lean_object* x_50; 
  x_48 = lean_ctor_get(x_38, 0);
  x_49 = lean_ctor_get(x_38, 1);
  lean_inc(x_49);
  lean_inc(x_48);
  lean_dec(x_38);
  x_50 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_50, 0, x_48);
  lean_ctor_set(x_50, 1, x_49);
  return x_50;
  }
  }
  }
  }
  }
  else
  {
  lean_object* x_51; lean_object* x_52; lean_object* x_53; uint8_t x_54; 
  x_51 = lean_ctor_get(x_24, 0);
  x_52 = lean_ctor_get(x_24, 1);
  lean_inc(x_52);
  lean_inc(x_51);
  lean_dec(x_24);
  x_53 = lean_array_get_size(x_51);
  x_54 = lean_nat_dec_lt(x_16, x_53);
  if (x_54 == 0)
  {
  uint8_t x_55; lean_object* x_56; lean_object* x_57; 
  lean_dec(x_53);
  lean_dec(x_51);
  lean_dec(x_3);
  lean_dec(x_2);
  x_55 = 1;
  x_56 = lean_box(x_55);
  x_57 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_57, 0, x_56);
  lean_ctor_set(x_57, 1, x_52);
  return x_57;
  }
  else
  {
  uint8_t x_58; 
  x_58 = lean_nat_dec_le(x_53, x_53);
  if (x_58 == 0)
  {
  uint8_t x_59; lean_object* x_60; lean_object* x_61; 
  lean_dec(x_53);
  lean_dec(x_51);
  lean_dec(x_3);
  lean_dec(x_2);
  x_59 = 1;
  x_60 = lean_box(x_59);
  x_61 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_61, 0, x_60);
  lean_ctor_set(x_61, 1, x_52);
  return x_61;
  }
  else
  {
  size_t x_62; size_t x_63; lean_object* x_64; lean_object* x_65; 
  x_62 = 0;
  x_63 = lean_usize_of_nat(x_53);
  lean_dec(x_53);
  x_64 = lean_box(0);
  x_65 = l_Array_foldlMUnsafe_fold___at_Lean_Elab_Command_elabCommand___spec__10(x_51, x_62, x_63, x_64, x_2, x_3, x_52);
  lean_dec(x_51);
  if (lean_obj_tag(x_65) == 0)
  {
  lean_object* x_66; lean_object* x_67; uint8_t x_68; lean_object* x_69; lean_object* x_70; 
  x_66 = lean_ctor_get(x_65, 1);
  lean_inc(x_66);
  if (lean_is_exclusive(x_65)) {
   lean_ctor_release(x_65, 0);
   lean_ctor_release(x_65, 1);
   x_67 = x_65;
  } else {
   lean_dec_ref(x_65);
   x_67 = lean_box(0);
  }
  x_68 = 1;
  x_69 = lean_box(x_68);
  if (lean_is_scalar(x_67)) {
   x_70 = lean_alloc_ctor(0, 2, 0);
  } else {
   x_70 = x_67;
  }
  lean_ctor_set(x_70, 0, x_69);
  lean_ctor_set(x_70, 1, x_66);
  return x_70;
  }
  else
  {
  lean_object* x_71; lean_object* x_72; lean_object* x_73; lean_object* x_74; 
  x_71 = lean_ctor_get(x_65, 0);
  lean_inc(x_71);
  x_72 = lean_ctor_get(x_65, 1);
  lean_inc(x_72);
  if (lean_is_exclusive(x_65)) {
   lean_ctor_release(x_65, 0);
   lean_ctor_release(x_65, 1);
   x_73 = x_65;
  } else {
   lean_dec_ref(x_65);
   x_73 = lean_box(0);
  }
  if (lean_is_scalar(x_73)) {
   x_74 = lean_alloc_ctor(1, 2, 0);
  } else {
   x_74 = x_73;
  }
  lean_ctor_set(x_74, 0, x_71);
  lean_ctor_set(x_74, 1, x_72);
  return x_74;
  }
  }
  }
  }
  }
  else
  {
  uint8_t x_75; 
  lean_dec(x_3);
  lean_dec(x_2);
  x_75 = !lean_is_exclusive(x_24);
  if (x_75 == 0)
  {
  return x_24;
  }
  else
  {
  lean_object* x_76; lean_object* x_77; lean_object* x_78; 
  x_76 = lean_ctor_get(x_24, 0);
  x_77 = lean_ctor_get(x_24, 1);
  lean_inc(x_77);
  lean_inc(x_76);
  lean_dec(x_24);
  x_78 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_78, 0, x_76);
  lean_ctor_set(x_78, 1, x_77);
  return x_78;
  }
  }
  }
  else
  {
  uint8_t x_79; 
  lean_dec(x_17);
  lean_dec(x_3);
  lean_dec(x_2);
  lean_dec(x_1);
  x_79 = !lean_is_exclusive(x_19);
  if (x_79 == 0)
  {
  return x_19;
  }
  else
  {
  lean_object* x_80; lean_object* x_81; lean_object* x_82; 
  x_80 = lean_ctor_get(x_19, 0);
  x_81 = lean_ctor_get(x_19, 1);
  lean_inc(x_81);
  lean_inc(x_80);
  lean_dec(x_19);
  x_82 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_82, 0, x_80);
  lean_ctor_set(x_82, 1, x_81);
  return x_82;
  }
  }
  }
  else
  {
  lean_object* x_83; lean_object* x_84; lean_object* x_85; 
  x_83 = lean_box(0);
  x_84 = lean_alloc_closure((void*)(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___boxed), 9, 2);
  lean_closure_set(x_84, 0, x_17);
  lean_closure_set(x_84, 1, x_1);
  lean_inc(x_2);
  x_85 = l_Lean_Elab_Command_liftTermElabM___rarg(x_83, x_84, x_2, x_3, x_13);
  if (lean_obj_tag(x_85) == 0)
  {
  uint8_t x_86; 
  x_86 = !lean_is_exclusive(x_85);
  if (x_86 == 0)
  {
  lean_object* x_87; lean_object* x_88; lean_object* x_89; uint8_t x_90; 
  x_87 = lean_ctor_get(x_85, 0);
  x_88 = lean_ctor_get(x_85, 1);
  x_89 = lean_array_get_size(x_87);
  x_90 = lean_nat_dec_lt(x_16, x_89);
  if (x_90 == 0)
  {
  uint8_t x_91; lean_object* x_92; 
  lean_dec(x_89);
  lean_dec(x_87);
  lean_dec(x_3);
  lean_dec(x_2);
  x_91 = 1;
  x_92 = lean_box(x_91);
  lean_ctor_set(x_85, 0, x_92);
  return x_85;
  }
  else
  {
  uint8_t x_93; 
  x_93 = lean_nat_dec_le(x_89, x_89);
  if (x_93 == 0)
  {
  uint8_t x_94; lean_object* x_95; 
  lean_dec(x_89);
  lean_dec(x_87);
  lean_dec(x_3);
  lean_dec(x_2);
  x_94 = 1;
  x_95 = lean_box(x_94);
  lean_ctor_set(x_85, 0, x_95);
  return x_85;
  }
  else
  {
  size_t x_96; size_t x_97; lean_object* x_98; lean_object* x_99; 
  lean_free_object(x_85);
  x_96 = 0;
  x_97 = lean_usize_of_nat(x_89);
  lean_dec(x_89);
  x_98 = lean_box(0);
  x_99 = l_Array_foldlMUnsafe_fold___at_Lean_Elab_Command_elabCommand___spec__10(x_87, x_96, x_97, x_98, x_2, x_3, x_88);
  lean_dec(x_87);
  if (lean_obj_tag(x_99) == 0)
  {
  uint8_t x_100; 
  x_100 = !lean_is_exclusive(x_99);
  if (x_100 == 0)
  {
  lean_object* x_101; uint8_t x_102; lean_object* x_103; 
  x_101 = lean_ctor_get(x_99, 0);
  lean_dec(x_101);
  x_102 = 1;
  x_103 = lean_box(x_102);
  lean_ctor_set(x_99, 0, x_103);
  return x_99;
  }
  else
  {
  lean_object* x_104; uint8_t x_105; lean_object* x_106; lean_object* x_107; 
  x_104 = lean_ctor_get(x_99, 1);
  lean_inc(x_104);
  lean_dec(x_99);
  x_105 = 1;
  x_106 = lean_box(x_105);
  x_107 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_107, 0, x_106);
  lean_ctor_set(x_107, 1, x_104);
  return x_107;
  }
  }
  else
  {
  uint8_t x_108; 
  x_108 = !lean_is_exclusive(x_99);
  if (x_108 == 0)
  {
  return x_99;
  }
  else
  {
  lean_object* x_109; lean_object* x_110; lean_object* x_111; 
  x_109 = lean_ctor_get(x_99, 0);
  x_110 = lean_ctor_get(x_99, 1);
  lean_inc(x_110);
  lean_inc(x_109);
  lean_dec(x_99);
  x_111 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_111, 0, x_109);
  lean_ctor_set(x_111, 1, x_110);
  return x_111;
  }
  }
  }
  }
  }
  else
  {
  lean_object* x_112; lean_object* x_113; lean_object* x_114; uint8_t x_115; 
  x_112 = lean_ctor_get(x_85, 0);
  x_113 = lean_ctor_get(x_85, 1);
  lean_inc(x_113);
  lean_inc(x_112);
  lean_dec(x_85);
  x_114 = lean_array_get_size(x_112);
  x_115 = lean_nat_dec_lt(x_16, x_114);
  if (x_115 == 0)
  {
  uint8_t x_116; lean_object* x_117; lean_object* x_118; 
  lean_dec(x_114);
  lean_dec(x_112);
  lean_dec(x_3);
  lean_dec(x_2);
  x_116 = 1;
  x_117 = lean_box(x_116);
  x_118 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_118, 0, x_117);
  lean_ctor_set(x_118, 1, x_113);
  return x_118;
  }
  else
  {
  uint8_t x_119; 
  x_119 = lean_nat_dec_le(x_114, x_114);
  if (x_119 == 0)
  {
  uint8_t x_120; lean_object* x_121; lean_object* x_122; 
  lean_dec(x_114);
  lean_dec(x_112);
  lean_dec(x_3);
  lean_dec(x_2);
  x_120 = 1;
  x_121 = lean_box(x_120);
  x_122 = lean_alloc_ctor(0, 2, 0);
  lean_ctor_set(x_122, 0, x_121);
  lean_ctor_set(x_122, 1, x_113);
  return x_122;
  }
  else
  {
  size_t x_123; size_t x_124; lean_object* x_125; lean_object* x_126; 
  x_123 = 0;
  x_124 = lean_usize_of_nat(x_114);
  lean_dec(x_114);
  x_125 = lean_box(0);
  x_126 = l_Array_foldlMUnsafe_fold___at_Lean_Elab_Command_elabCommand___spec__10(x_112, x_123, x_124, x_125, x_2, x_3, x_113);
  lean_dec(x_112);
  if (lean_obj_tag(x_126) == 0)
  {
  lean_object* x_127; lean_object* x_128; uint8_t x_129; lean_object* x_130; lean_object* x_131; 
  x_127 = lean_ctor_get(x_126, 1);
  lean_inc(x_127);
  if (lean_is_exclusive(x_126)) {
   lean_ctor_release(x_126, 0);
   lean_ctor_release(x_126, 1);
   x_128 = x_126;
  } else {
   lean_dec_ref(x_126);
   x_128 = lean_box(0);
  }
  x_129 = 1;
  x_130 = lean_box(x_129);
  if (lean_is_scalar(x_128)) {
   x_131 = lean_alloc_ctor(0, 2, 0);
  } else {
   x_131 = x_128;
  }
  lean_ctor_set(x_131, 0, x_130);
  lean_ctor_set(x_131, 1, x_127);
  return x_131;
  }
  else
  {
  lean_object* x_132; lean_object* x_133; lean_object* x_134; lean_object* x_135; 
  x_132 = lean_ctor_get(x_126, 0);
  lean_inc(x_132);
  x_133 = lean_ctor_get(x_126, 1);
  lean_inc(x_133);
  if (lean_is_exclusive(x_126)) {
   lean_ctor_release(x_126, 0);
   lean_ctor_release(x_126, 1);
   x_134 = x_126;
  } else {
   lean_dec_ref(x_126);
   x_134 = lean_box(0);
  }
  if (lean_is_scalar(x_134)) {
   x_135 = lean_alloc_ctor(1, 2, 0);
  } else {
   x_135 = x_134;
  }
  lean_ctor_set(x_135, 0, x_132);
  lean_ctor_set(x_135, 1, x_133);
  return x_135;
  }
  }
  }
  }
  }
  else
  {
  uint8_t x_136; 
  lean_dec(x_3);
  lean_dec(x_2);
  x_136 = !lean_is_exclusive(x_85);
  if (x_136 == 0)
  {
  return x_85;
  }
  else
  {
  lean_object* x_137; lean_object* x_138; lean_object* x_139; 
  x_137 = lean_ctor_get(x_85, 0);
  x_138 = lean_ctor_get(x_85, 1);
  lean_inc(x_138);
  lean_inc(x_137);
  lean_dec(x_85);
  x_139 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_139, 0, x_137);
  lean_ctor_set(x_139, 1, x_138);
  return x_139;
  }
  }
  }
  }
  }
  }
  LEAN_EXPORT lean_object* l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1___boxed(lean_object** _args) {
  lean_object* x_1 = _args[0];
  lean_object* x_2 = _args[1];
  lean_object* x_3 = _args[2];
  lean_object* x_4 = _args[3];
  lean_object* x_5 = _args[4];
  lean_object* x_6 = _args[5];
  lean_object* x_7 = _args[6];
  lean_object* x_8 = _args[7];
  lean_object* x_9 = _args[8];
  lean_object* x_10 = _args[9];
  lean_object* x_11 = _args[10];
  lean_object* x_12 = _args[11];
  lean_object* x_13 = _args[12];
  lean_object* x_14 = _args[13];
  lean_object* x_15 = _args[14];
  lean_object* x_16 = _args[15];
  lean_object* x_17 = _args[16];
  lean_object* x_18 = _args[17];
  lean_object* x_19 = _args[18];
  _start:
  {
  size_t x_20; size_t x_21; lean_object* x_22; 
  x_20 = lean_unbox_usize(x_10);
  lean_dec(x_10);
  x_21 = lean_unbox_usize(x_11);
  lean_dec(x_11);
  x_22 = l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_20, x_21, x_12, x_13, x_14, x_15, x_16, x_17, x_18, x_19);
  lean_dec(x_18);
  lean_dec(x_16);
  lean_dec(x_15);
  lean_dec(x_14);
  lean_dec(x_13);
  lean_dec(x_9);
  return x_22;
  }
  }
  LEAN_EXPORT lean_object* l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__2___boxed(lean_object** _args) {
  lean_object* x_1 = _args[0];
  lean_object* x_2 = _args[1];
  lean_object* x_3 = _args[2];
  lean_object* x_4 = _args[3];
  lean_object* x_5 = _args[4];
  lean_object* x_6 = _args[5];
  lean_object* x_7 = _args[6];
  lean_object* x_8 = _args[7];
  lean_object* x_9 = _args[8];
  lean_object* x_10 = _args[9];
  lean_object* x_11 = _args[10];
  lean_object* x_12 = _args[11];
  lean_object* x_13 = _args[12];
  lean_object* x_14 = _args[13];
  lean_object* x_15 = _args[14];
  lean_object* x_16 = _args[15];
  lean_object* x_17 = _args[16];
  lean_object* x_18 = _args[17];
  lean_object* x_19 = _args[18];
  _start:
  {
  size_t x_20; size_t x_21; lean_object* x_22; 
  x_20 = lean_unbox_usize(x_10);
  lean_dec(x_10);
  x_21 = lean_unbox_usize(x_11);
  lean_dec(x_11);
  x_22 = l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__2(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_20, x_21, x_12, x_13, x_14, x_15, x_16, x_17, x_18, x_19);
  lean_dec(x_18);
  lean_dec(x_16);
  lean_dec(x_15);
  lean_dec(x_14);
  lean_dec(x_13);
  lean_dec(x_9);
  return x_22;
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__3___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
  _start:
  {
  size_t x_5; size_t x_6; lean_object* x_7; 
  x_5 = lean_unbox_usize(x_2);
  lean_dec(x_2);
  x_6 = lean_unbox_usize(x_3);
  lean_dec(x_3);
  x_7 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__3(x_1, x_5, x_6, x_4);
  return x_7;
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__3___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__4___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
  _start:
  {
  size_t x_4; size_t x_5; lean_object* x_6; 
  x_4 = lean_unbox_usize(x_1);
  lean_dec(x_1);
  x_5 = lean_unbox_usize(x_2);
  lean_dec(x_2);
  x_6 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__3___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__4(x_4, x_5, x_3);
  return x_6;
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___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, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13, lean_object* x_14, lean_object* x_15, lean_object* x_16) {
  _start:
  {
  size_t x_17; size_t x_18; lean_object* x_19; 
  x_17 = lean_unbox_usize(x_14);
  lean_dec(x_14);
  x_18 = lean_unbox_usize(x_15);
  lean_dec(x_15);
  x_19 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12, x_13, x_17, x_18, x_16);
  return x_19;
  }
  }
  LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__6___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, lean_object* x_7) {
  _start:
  {
  size_t x_8; size_t x_9; lean_object* x_10; 
  x_8 = lean_unbox_usize(x_5);
  lean_dec(x_5);
  x_9 = lean_unbox_usize(x_6);
  lean_dec(x_6);
  x_10 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__6(x_1, x_2, x_3, x_4, x_8, x_9, x_7);
  return x_10;
  }
  }
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___boxed(lean_object** _args) {
  lean_object* x_1 = _args[0];
  lean_object* x_2 = _args[1];
  lean_object* x_3 = _args[2];
  lean_object* x_4 = _args[3];
  lean_object* x_5 = _args[4];
  lean_object* x_6 = _args[5];
  lean_object* x_7 = _args[6];
  lean_object* x_8 = _args[7];
  lean_object* x_9 = _args[8];
  lean_object* x_10 = _args[9];
  lean_object* x_11 = _args[10];
  lean_object* x_12 = _args[11];
  lean_object* x_13 = _args[12];
  lean_object* x_14 = _args[13];
  lean_object* x_15 = _args[14];
  lean_object* x_16 = _args[15];
  lean_object* x_17 = _args[16];
  lean_object* x_18 = _args[17];
  lean_object* x_19 = _args[18];
  lean_object* x_20 = _args[19];
  lean_object* x_21 = _args[20];
  lean_object* x_22 = _args[21];
  lean_object* x_23 = _args[22];
  lean_object* x_24 = _args[23];
  lean_object* x_25 = _args[24];
  _start:
  {
  lean_object* x_26; 
  x_26 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12, x_13, x_14, x_15, x_16, x_17, x_18, x_19, x_20, x_21, x_22, x_23, x_24, x_25);
  lean_dec(x_18);
  lean_dec(x_16);
  lean_dec(x_3);
  lean_dec(x_1);
  return x_26;
  }
  }
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___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, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10) {
  _start:
  {
  lean_object* x_11; 
  x_11 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10);
  lean_dec(x_3);
  return x_11;
  }
  }
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___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, lean_object* x_7, lean_object* x_8, lean_object* x_9) {
  _start:
  {
  lean_object* x_10; 
  x_10 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9);
  lean_dec(x_2);
  return x_10;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_6077____closed__1() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_alloc_closure((void*)(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler), 4, 0);
  return x_1;
  }
  }
  static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_6077____closed__2() {
  _start:
  {
  lean_object* x_1; 
  x_1 = lean_alloc_closure((void*)(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler), 4, 0);
  return x_1;
  }
  }
  LEAN_EXPORT lean_object* l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_6077_(lean_object* x_1) {
  _start:
  {
  lean_object* x_2; lean_object* x_3; lean_object* x_4; 
  x_2 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__2;
  x_3 = l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_6077____closed__1;
  x_4 = l_Lean_Elab_registerBuiltinDerivingHandler(x_2, x_3, x_1);
  if (lean_obj_tag(x_4) == 0)
  {
  lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; 
  x_5 = lean_ctor_get(x_4, 1);
  lean_inc(x_5);
  lean_dec(x_4);
  x_6 = l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__8;
  x_7 = l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_6077____closed__2;
  x_8 = l_Lean_Elab_registerBuiltinDerivingHandler(x_6, x_7, x_5);
  return x_8;
  }
  else
  {
  uint8_t x_9; 
  x_9 = !lean_is_exclusive(x_4);
  if (x_9 == 0)
  {
  return x_4;
  }
  else
  {
  lean_object* x_10; lean_object* x_11; lean_object* x_12; 
  x_10 = lean_ctor_get(x_4, 0);
  x_11 = lean_ctor_get(x_4, 1);
  lean_inc(x_11);
  lean_inc(x_10);
  lean_dec(x_4);
  x_12 = lean_alloc_ctor(1, 2, 0);
  lean_ctor_set(x_12, 0, x_10);
  lean_ctor_set(x_12, 1, x_11);
  return x_12;
  }
  }
  }
  }
  lean_object* initialize_Init(lean_object*);
  lean_object* initialize_Lean_Meta_Transform(lean_object*);
  lean_object* initialize_Lean_Elab_Deriving_Basic(lean_object*);
  lean_object* initialize_Lean_Elab_Deriving_Util(lean_object*);
  lean_object* initialize_Lean_Data_Json_FromToJson(lean_object*);
  static bool _G_initialized = false;
  LEAN_EXPORT lean_object* initialize_Lean_Elab_Deriving_FromToJson(lean_object* w) {
  lean_object * res;
  if (_G_initialized) return lean_io_result_mk_ok(lean_box(0));
  _G_initialized = true;
  res = initialize_Init(lean_io_mk_world());
  if (lean_io_result_is_error(res)) return res;
  lean_dec_ref(res);
  res = initialize_Lean_Meta_Transform(lean_io_mk_world());
  if (lean_io_result_is_error(res)) return res;
  lean_dec_ref(res);
  res = initialize_Lean_Elab_Deriving_Basic(lean_io_mk_world());
  if (lean_io_result_is_error(res)) return res;
  lean_dec_ref(res);
  res = initialize_Lean_Elab_Deriving_Util(lean_io_mk_world());
  if (lean_io_result_is_error(res)) return res;
  lean_dec_ref(res);
  res = initialize_Lean_Data_Json_FromToJson(lean_io_mk_world());
  if (lean_io_result_is_error(res)) return res;
  lean_dec_ref(res);
  l_Lean_Elab_Deriving_FromToJson_mkJsonField___closed__1 = _init_l_Lean_Elab_Deriving_FromToJson_mkJsonField___closed__1();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkJsonField___closed__1);
  l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1___closed__1 = _init_l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1___closed__1();
  lean_mark_persistent(l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1___closed__1);
  l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1___closed__2 = _init_l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1___closed__2();
  lean_mark_persistent(l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1___closed__2);
  l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1___closed__3 = _init_l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1___closed__3();
  lean_mark_persistent(l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1___closed__3);
  l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1___closed__4 = _init_l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1___closed__4();
  lean_mark_persistent(l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1___closed__4);
  l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__1 = _init_l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__1();
  lean_mark_persistent(l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__1);
  l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__2 = _init_l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__2();
  lean_mark_persistent(l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__2);
  l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3 = _init_l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3();
  lean_mark_persistent(l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__3);
  l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__4 = _init_l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__4();
  lean_mark_persistent(l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__4);
  l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5 = _init_l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5();
  lean_mark_persistent(l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__5);
  l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6 = _init_l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6();
  lean_mark_persistent(l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__6);
  l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__7 = _init_l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__7();
  lean_mark_persistent(l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__7);
  l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__8 = _init_l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__8();
  lean_mark_persistent(l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__8);
  l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__9 = _init_l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__9();
  lean_mark_persistent(l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__9);
  l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10 = _init_l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10();
  lean_mark_persistent(l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__3___closed__10);
  l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__4___lambda__1___closed__1 = _init_l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__4___lambda__1___closed__1();
  lean_mark_persistent(l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__4___lambda__1___closed__1);
  l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__4___lambda__1___closed__2 = _init_l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__4___lambda__1___closed__2();
  lean_mark_persistent(l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__4___lambda__1___closed__2);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__1 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__1();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__1);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__2 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__2();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__2);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__3);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__4 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__4();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__4);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__5 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__5();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__5);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__6 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__6();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__6);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__7 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__7();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__7);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__9 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__9();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__9);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__10);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__11 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__11();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__11);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__12 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__12();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__12);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__13 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__13();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__13);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__14 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__14();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__14);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__15 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__15();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__15);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__16 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__16();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__16);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__17 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__17();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__17);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___boxed__const__1 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___boxed__const__1();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___boxed__const__1);
  l_Lean_getConstInfoInduct___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__1___closed__1 = _init_l_Lean_getConstInfoInduct___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__1___closed__1();
  lean_mark_persistent(l_Lean_getConstInfoInduct___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__1___closed__1);
  l_Lean_getConstInfoInduct___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__1___closed__2 = _init_l_Lean_getConstInfoInduct___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__1___closed__2();
  lean_mark_persistent(l_Lean_getConstInfoInduct___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__1___closed__2);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__1 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__1();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__1);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__2 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__2();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__2);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__3 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__3();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__3);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__4 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__4();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__3___closed__4);
  l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__1 = _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__1();
  lean_mark_persistent(l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__1);
  l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__2 = _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__2();
  lean_mark_persistent(l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__2);
  l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__3 = _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__3();
  lean_mark_persistent(l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__3);
  l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__4 = _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__4();
  lean_mark_persistent(l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__4);
  l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5 = _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5();
  lean_mark_persistent(l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__4___closed__5);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__1 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__1();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__1);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__2 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__2();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__2);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__3 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__3();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__3);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__4 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__4();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__4);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__5 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__5();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__5);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__6 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__6();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__6);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__7 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__7();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__7);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__8 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__8();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__8);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__9 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__9();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__9);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__1 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__1();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__1);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__2 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__2();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__2);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__3 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__3();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__3);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__4 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__4();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__4);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__5 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__5();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__5);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__6 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__6();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__6);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__7 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__7();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__7);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__8 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__8();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__8);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__9 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__9();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__9);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__10 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__10();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__10);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__11 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__11();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__11);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__12 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__12();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__12);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__13 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__13();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___closed__13);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___boxed__const__1 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___boxed__const__1();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__1___boxed__const__1);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__1 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__1();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__1);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__2 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__2();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__2);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__3 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__3();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__3);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__4 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__4();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__4);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__5 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__5();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__5);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__6 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__6();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__6);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__7 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__7();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__7);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__8 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__8();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__8);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__9 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__9();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__9);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__10 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__10();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__10);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__11 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__11();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__11);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__12 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__12();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__12);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__13 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__13();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__13);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__14 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__14();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__14);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__15 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__15();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__15);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__16 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__16();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__16);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__17 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__17();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__17);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__18 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__18();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__18);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__19 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__19();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__19);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__20 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__20();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__20);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__21 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__21();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__21);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__22 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__22();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__22);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__23 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__23();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__23);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__24 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__24();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__24);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__25 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__25();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__25);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__26 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__26();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__26);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__27 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__27();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__27);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__28 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__28();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__28);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__29 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__29();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__29);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__30 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__30();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__30);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__31 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__31();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__31);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__1 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__1();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__1);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__2 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__2();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__2);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__3 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__3();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__3);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__4 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__4();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__4);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__5 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__5();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__5);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__6 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__6();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__6);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__7 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__7();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__7);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__8 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__8();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__8);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__9 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__9();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__9);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__10 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__10();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__10);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__11 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__11();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__11);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__12 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__12();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__12);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__13 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__13();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__13);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__14 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__14();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__14);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__15 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__15();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__15);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__16 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__16();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___closed__16);
  l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___boxed__const__1 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___boxed__const__1();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__4___boxed__const__1);
  l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__1 = _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__1();
  lean_mark_persistent(l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__1);
  l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__2 = _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__2();
  lean_mark_persistent(l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__2);
  l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__3 = _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__3();
  lean_mark_persistent(l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__3);
  l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__4 = _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__4();
  lean_mark_persistent(l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__4);
  l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__5 = _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__5();
  lean_mark_persistent(l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__5);
  l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__6 = _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__6();
  lean_mark_persistent(l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__6);
  l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__7 = _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__7();
  lean_mark_persistent(l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__7);
  l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__8 = _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__8();
  lean_mark_persistent(l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__8);
  l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__9 = _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__9();
  lean_mark_persistent(l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__9);
  l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__10 = _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__10();
  lean_mark_persistent(l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__10);
  l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__11 = _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__11();
  lean_mark_persistent(l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__11);
  l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__12 = _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__12();
  lean_mark_persistent(l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__12);
  l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__13 = _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__13();
  lean_mark_persistent(l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__13);
  l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__14 = _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__14();
  lean_mark_persistent(l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__14);
  l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__15 = _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__15();
  lean_mark_persistent(l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__15);
  l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__16 = _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__16();
  lean_mark_persistent(l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__16);
  l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__17 = _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__17();
  lean_mark_persistent(l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__17);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__1 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__1();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__1);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__2 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__2();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__2);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__3 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__3();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__3);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__4 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__4();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__4);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__5 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__5();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__4___closed__5);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___closed__1 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___closed__1();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___closed__1);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___closed__2 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___closed__2();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___closed__2);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___closed__3 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___closed__3();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___closed__3);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__1 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__1();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__1);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__2 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__2();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__2);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__3 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__3();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__3);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__4 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__4();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__4);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__5 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__5();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__5);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__6 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__6();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__6);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__7 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__7();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__7);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__8 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__8();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__8);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__9 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__9();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__9);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__10 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__10();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__10);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__11 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__11();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__11);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__12 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__12();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__12);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__13 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__13();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__13);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__14 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__14();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__14);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__15 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__15();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__15);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__16 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__16();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__16);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__17 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__17();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__17);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__18 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__18();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__18);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__19 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__19();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__19);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__20 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__20();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__20);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__21 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__21();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__21);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__22 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__22();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__22);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__23 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__23();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__23);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__24 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__24();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__24);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__25 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__25();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__25);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__26 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__26();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__26);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__27 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__27();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__27);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__28 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__28();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__28);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__29 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__29();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__29);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__30 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__30();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__30);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__31 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__31();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__31);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__32 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__32();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__32);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__33 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__33();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__33);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__34 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__34();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__34);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__35 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__35();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__35);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__36 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__36();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1___closed__36);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__1 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__1();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__1);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__2 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__2();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__2);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__3 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__3();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__3);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__4 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__4();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__4);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__5 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__5();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__5);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__6 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__6();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__6);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__7 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__7();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__7);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__8 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__8();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__8);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__9 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__9();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__9);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__10 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__10();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__10);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__11 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__11();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__11);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__12 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__12();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__12);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__13 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__13();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__13);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__14 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__14();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__14);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__15 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__15();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__15);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__16 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__16();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__2___closed__16);
  l_Array_qpartition_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__8___closed__1 = _init_l_Array_qpartition_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__8___closed__1();
  lean_mark_persistent(l_Array_qpartition_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__8___closed__1);
  l_Array_qsort_sort___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__7___closed__1 = _init_l_Array_qsort_sort___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__7___closed__1();
  lean_mark_persistent(l_Array_qsort_sort___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__7___closed__1);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___boxed__const__1 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___boxed__const__1();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___boxed__const__1);
  l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1___closed__1 = _init_l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1___closed__1();
  lean_mark_persistent(l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1___closed__1);
  l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1___closed__2 = _init_l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1___closed__2();
  lean_mark_persistent(l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1___closed__2);
  l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1___closed__3 = _init_l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1___closed__3();
  lean_mark_persistent(l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1___closed__3);
  l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1___closed__4 = _init_l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1___closed__4();
  lean_mark_persistent(l_Array_foldrMUnsafe_fold___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__1___closed__4);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___closed__1 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___closed__1();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___closed__1);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___closed__2 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___closed__2();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___closed__2);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___closed__3 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___closed__3();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___closed__3);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___closed__4 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___closed__4();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__5___closed__4);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__6___closed__1 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__6___closed__1();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__6___closed__1);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__6___closed__2 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__6___closed__2();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__6___closed__2);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__6___closed__3 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__6___closed__3();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__6___closed__3);
  l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__6___closed__4 = _init_l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__6___closed__4();
  lean_mark_persistent(l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__6___closed__4);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__1 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__1();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__1);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__2 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__2();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__2);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__3 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__3();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__3);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__4 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__4();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__4);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__5 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__5();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__5);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__6 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__6();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__6);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__7 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__7();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__7);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__8 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__8();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__8);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__9 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__9();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__9);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__10 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__10();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__10);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__11 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__11();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__11);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__12 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__12();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__12);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__13 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__13();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__13);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__1 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__1();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__1);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__2 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__2();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__2);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__3 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__3();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__3);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__4 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__4();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__4);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__5 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__5();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__5);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__6 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__6();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__6);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__7 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__7();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__7);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__8 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__8();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__8);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__9 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__9();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__9);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__10 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__10();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__10);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__11 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__11();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__11);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__12 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__12();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__12);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__1 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__1();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__1);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__2 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__2();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__2);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__3 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__3();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__3);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__4 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__4();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__4);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__5 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__5();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__5);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__6 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__6();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__6);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__7 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__7();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__7);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__8 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__8();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__8);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__9 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__9();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__9);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__10 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__10();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__10);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__11 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__11();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__11);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__12 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__12();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__12);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__13 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__13();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__13);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__14 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__14();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__14);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__15 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__15();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__15);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__16 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__16();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__16);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__17 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__17();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__17);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__18 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__18();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__18);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__19 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__19();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__19);
  l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__20 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__20();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__3___closed__20);
  l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_6077____closed__1 = _init_l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_6077____closed__1();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_6077____closed__1);
  l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_6077____closed__2 = _init_l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_6077____closed__2();
  lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_6077____closed__2);
  res = l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_6077_(lean_io_mk_world());
  if (lean_io_result_is_error(res)) return res;
  lean_dec_ref(res);
  return lean_io_result_mk_ok(lean_box(0));
  }
  #ifdef __cplusplus
  }
  #endif
  