lean4-htt/stage0/stdlib/LeanChecker.c
2026-02-05 13:41:34 +11:00

3080 lines
83 KiB
C
Generated

// Lean compiler output
// Module: LeanChecker
// Imports: public import Init public import Lean.CoreM public import Lean.Replay public import LeanChecker.Replay public import Lake.Load.Manifest
#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
uint8_t lean_usize_dec_lt(size_t, size_t);
uint8_t lean_nat_dec_lt(lean_object*, lean_object*);
lean_object* lean_array_uget(lean_object*, size_t);
lean_object* lean_array_fget(lean_object*, lean_object*);
lean_object* lean_nat_add(lean_object*, lean_object*);
lean_object* l_Std_DHashMap_Internal_Raw_u2080_insert___at___00Lean_SMap_insert___at___00Lean_initFn_00___x40_Lean_ReducibilityAttrs_3557922905____hygCtx___hyg_2__spec__1_spec__2___redArg(lean_object*, lean_object*, lean_object*);
size_t lean_usize_add(size_t, size_t);
LEAN_EXPORT lean_object* l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00replayFromImports_spec__0(lean_object*, size_t, size_t, lean_object*);
LEAN_EXPORT lean_object* l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00replayFromImports_spec__0___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_mk_array(lean_object*, lean_object*);
static lean_object* l_replayFromImports___closed__0;
uint8_t l_Lean_instOrdOLeanLevel_ord(uint8_t, uint8_t);
static uint8_t l_replayFromImports___closed__1;
static const lean_string_object l_replayFromImports___closed__2_value = {.m_header = {.m_rc = 0, .m_cs_sz = 0, .m_other = 0, .m_tag = 249}, .m_size = 27, .m_capacity = 27, .m_length = 26, .m_data = "failed to read module data"};
static const lean_object* l_replayFromImports___closed__2 = (const lean_object*)&l_replayFromImports___closed__2_value;
static const lean_ctor_object l_replayFromImports___closed__3_value = {.m_header = {.m_rc = 0, .m_cs_sz = sizeof(lean_ctor_object) + sizeof(void*)*1 + 0, .m_other = 1, .m_tag = 18}, .m_objs = {((lean_object*)&l_replayFromImports___closed__2_value)}};
static const lean_object* l_replayFromImports___closed__3 = (const lean_object*)&l_replayFromImports___closed__3_value;
static const lean_string_object l_replayFromImports___closed__4_value = {.m_header = {.m_rc = 0, .m_cs_sz = 0, .m_other = 0, .m_tag = 249}, .m_size = 14, .m_capacity = 14, .m_length = 13, .m_data = "object file '"};
static const lean_object* l_replayFromImports___closed__4 = (const lean_object*)&l_replayFromImports___closed__4_value;
static const lean_string_object l_replayFromImports___closed__5_value = {.m_header = {.m_rc = 0, .m_cs_sz = 0, .m_other = 0, .m_tag = 249}, .m_size = 13, .m_capacity = 13, .m_length = 12, .m_data = "' of module "};
static const lean_object* l_replayFromImports___closed__5 = (const lean_object*)&l_replayFromImports___closed__5_value;
static const lean_string_object l_replayFromImports___closed__6_value = {.m_header = {.m_rc = 0, .m_cs_sz = 0, .m_other = 0, .m_tag = 249}, .m_size = 16, .m_capacity = 16, .m_length = 15, .m_data = " does not exist"};
static const lean_object* l_replayFromImports___closed__6 = (const lean_object*)&l_replayFromImports___closed__6_value;
lean_object* lean_mk_empty_array_with_capacity(lean_object*);
static lean_object* l_replayFromImports___closed__7;
lean_object* l_Lean_findOLean(lean_object*);
uint8_t l_System_FilePath_pathExists(lean_object*);
extern lean_object* l_Lean_instInhabitedImportState_default;
lean_object* lean_st_mk_ref(lean_object*);
lean_object* l_Lean_importModulesCore(lean_object*, uint8_t, lean_object*, uint8_t, lean_object*);
lean_object* lean_st_ref_get(lean_object*);
extern lean_object* l_Lean_Options_empty;
lean_object* l_Lean_finalizeImport(lean_object*, lean_object*, lean_object*, uint32_t, uint8_t, uint8_t, uint8_t, uint8_t);
lean_object* lean_nat_sub(lean_object*, lean_object*);
lean_object* lean_array_get_size(lean_object*);
lean_object* l_Array_toSubarray___redArg(lean_object*, lean_object*, lean_object*);
size_t lean_array_size(lean_object*);
lean_object* l_Lean_Environment_replay_x27(lean_object*, lean_object*);
lean_object* lean_environment_free_regions(lean_object*);
lean_object* lean_read_module_data_parts(lean_object*);
uint8_t lean_nat_dec_eq(lean_object*, lean_object*);
lean_object* lean_array_fget_borrowed(lean_object*, lean_object*);
lean_object* lean_string_append(lean_object*, lean_object*);
lean_object* l_Lean_Name_toStringWithToken___at___00Lean_Name_toString_spec__0(lean_object*, uint8_t);
lean_object* lean_array_push(lean_object*, lean_object*);
lean_object* l_Lean_OLeanLevel_adjustFileName(lean_object*, uint8_t);
LEAN_EXPORT lean_object* l_replayFromImports(lean_object*);
LEAN_EXPORT lean_object* l_replayFromImports___boxed(lean_object*, lean_object*);
lean_object* lean_mk_empty_environment(uint32_t);
lean_object* l_Lean_Environment_constants(lean_object*);
LEAN_EXPORT lean_object* l_replayFromFresh___lam__0(lean_object*);
LEAN_EXPORT lean_object* l_replayFromFresh___lam__0___boxed(lean_object*, lean_object*);
static const lean_closure_object l_replayFromFresh___closed__0_value = {.m_header = {.m_rc = 0, .m_cs_sz = sizeof(lean_closure_object) + sizeof(void*)*0, .m_other = 0, .m_tag = 245}, .m_fun = (void*)l_replayFromFresh___lam__0___boxed, .m_arity = 2, .m_num_fixed = 0, .m_objs = {} };
static const lean_object* l_replayFromFresh___closed__0 = (const lean_object*)&l_replayFromFresh___closed__0_value;
static lean_object* l_replayFromFresh___closed__1;
lean_object* l_Lean_withImportModules___redArg(lean_object*, lean_object*, lean_object*, uint32_t);
LEAN_EXPORT lean_object* l_replayFromFresh(lean_object*);
LEAN_EXPORT lean_object* l_replayFromFresh___boxed(lean_object*, lean_object*);
static const lean_string_object l_getCurrentModule___closed__0_value = {.m_header = {.m_rc = 0, .m_cs_sz = 0, .m_other = 0, .m_tag = 249}, .m_size = 19, .m_capacity = 19, .m_length = 18, .m_data = "lake-manifest.json"};
static const lean_object* l_getCurrentModule___closed__0 = (const lean_object*)&l_getCurrentModule___closed__0_value;
lean_object* l_Lake_Manifest_load_x3f(lean_object*);
lean_object* l_Lean_Name_capitalize(lean_object*);
LEAN_EXPORT lean_object* l_getCurrentModule();
LEAN_EXPORT lean_object* l_getCurrentModule___boxed(lean_object*);
static const lean_string_object l_List_partition_loop___at___00main_spec__0___closed__0_value = {.m_header = {.m_rc = 0, .m_cs_sz = 0, .m_other = 0, .m_tag = 249}, .m_size = 2, .m_capacity = 2, .m_length = 1, .m_data = "-"};
static const lean_object* l_List_partition_loop___at___00main_spec__0___closed__0 = (const lean_object*)&l_List_partition_loop___at___00main_spec__0___closed__0_value;
lean_object* lean_string_utf8_byte_size(lean_object*);
static lean_object* l_List_partition_loop___at___00main_spec__0___closed__1;
lean_object* l_List_reverse___redArg(lean_object*);
LEAN_EXPORT lean_object* l_List_partition_loop___at___00main_spec__0(lean_object*, lean_object*);
uint8_t lean_nat_dec_le(lean_object*, lean_object*);
uint8_t lean_string_memcmp(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_forIn_x27_loop___at___00main_spec__3___redArg___lam__0(lean_object*);
LEAN_EXPORT lean_object* l_List_forIn_x27_loop___at___00main_spec__3___redArg___lam__0___boxed(lean_object*, lean_object*);
lean_object* lean_io_as_task(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_forIn_x27_loop___at___00main_spec__3___redArg(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_forIn_x27_loop___at___00main_spec__3___redArg___boxed(lean_object*, lean_object*, lean_object*);
static const lean_string_object l_List_mapM_loop___at___00main_spec__6___closed__0_value = {.m_header = {.m_rc = 0, .m_cs_sz = 0, .m_other = 0, .m_tag = 249}, .m_size = 27, .m_capacity = 27, .m_length = 26, .m_data = "Could not resolve module: "};
static const lean_object* l_List_mapM_loop___at___00main_spec__6___closed__0 = (const lean_object*)&l_List_mapM_loop___at___00main_spec__6___closed__0_value;
lean_object* l_String_toName(lean_object*);
uint8_t l_Lean_Name_isAnonymous(lean_object*);
LEAN_EXPORT lean_object* l_List_mapM_loop___at___00main_spec__6(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_mapM_loop___at___00main_spec__6___boxed(lean_object*, lean_object*, lean_object*);
static const lean_string_object l_List_forIn_x27_loop___at___00main_spec__5___redArg___closed__0_value = {.m_header = {.m_rc = 0, .m_cs_sz = 0, .m_other = 0, .m_tag = 249}, .m_size = 11, .m_capacity = 11, .m_length = 10, .m_data = "replaying "};
static const lean_object* l_List_forIn_x27_loop___at___00main_spec__5___redArg___closed__0 = (const lean_object*)&l_List_forIn_x27_loop___at___00main_spec__5___redArg___closed__0_value;
static const lean_string_object l_List_forIn_x27_loop___at___00main_spec__5___redArg___closed__1_value = {.m_header = {.m_rc = 0, .m_cs_sz = 0, .m_other = 0, .m_tag = 249}, .m_size = 14, .m_capacity = 14, .m_length = 13, .m_data = " with --fresh"};
static const lean_object* l_List_forIn_x27_loop___at___00main_spec__5___redArg___closed__1 = (const lean_object*)&l_List_forIn_x27_loop___at___00main_spec__5___redArg___closed__1_value;
LEAN_EXPORT lean_object* l_List_forIn_x27_loop___at___00main_spec__5___redArg(uint8_t, lean_object*, lean_object*);
lean_object* l_IO_println___at___00__private_Lean_Language_Basic_0__Lean_Language_reportMessages_spec__3(lean_object*);
LEAN_EXPORT lean_object* l_List_forIn_x27_loop___at___00main_spec__5___redArg___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_instDecidableEqString___boxed(lean_object*, lean_object*);
lean_object* l_instBEqOfDecidableEq___redArg___lam__0___boxed(lean_object*, lean_object*, lean_object*);
static lean_object* l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_spec__1___closed__0;
static const lean_string_object l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_spec__1___closed__1_value = {.m_header = {.m_rc = 0, .m_cs_sz = 0, .m_other = 0, .m_tag = 249}, .m_size = 8, .m_capacity = 8, .m_length = 7, .m_data = "--fresh"};
static const lean_object* l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_spec__1___closed__1 = (const lean_object*)&l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_spec__1___closed__1_value;
LEAN_EXPORT lean_object* l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_spec__1(lean_object*, lean_object*, lean_object*, lean_object*, size_t, size_t, lean_object*);
lean_object* l_Lean_searchModuleNameOfFileName(lean_object*, lean_object*);
uint8_t l_List_elem___at___00Lean_addAliasEntry_spec__2(lean_object*, lean_object*);
uint8_t lean_name_eq(lean_object*, lean_object*);
uint8_t l_List_elem___redArg(lean_object*, lean_object*, lean_object*);
uint8_t l_Lean_Name_isPrefixOf(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static const lean_string_object l_List_forIn_x27_loop___at___00main_spec__2___redArg___closed__0_value = {.m_header = {.m_rc = 0, .m_cs_sz = 0, .m_other = 0, .m_tag = 249}, .m_size = 6, .m_capacity = 6, .m_length = 5, .m_data = "olean"};
static const lean_object* l_List_forIn_x27_loop___at___00main_spec__2___redArg___closed__0 = (const lean_object*)&l_List_forIn_x27_loop___at___00main_spec__2___redArg___closed__0_value;
static const lean_string_object l_List_forIn_x27_loop___at___00main_spec__2___redArg___closed__1_value = {.m_header = {.m_rc = 0, .m_cs_sz = 0, .m_other = 0, .m_tag = 249}, .m_size = 32, .m_capacity = 32, .m_length = 31, .m_data = "Could not find any oleans for: "};
static const lean_object* l_List_forIn_x27_loop___at___00main_spec__2___redArg___closed__1 = (const lean_object*)&l_List_forIn_x27_loop___at___00main_spec__2___redArg___closed__1_value;
lean_object* l_Lean_SearchPath_findAllWithExt(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_forIn_x27_loop___at___00main_spec__2___redArg(lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_forIn_x27_loop___at___00main_spec__2___redArg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static const lean_string_object l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_spec__4___closed__0_value = {.m_header = {.m_rc = 0, .m_cs_sz = 0, .m_other = 0, .m_tag = 249}, .m_size = 32, .m_capacity = 32, .m_length = 31, .m_data = "leanchecker found a problem in "};
static const lean_object* l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_spec__4___closed__0 = (const lean_object*)&l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_spec__4___closed__0_value;
lean_object* lean_task_get_own(lean_object*);
lean_object* l_IO_eprintln___at___00__private_Init_System_IO_0__IO_eprintlnAux_spec__0(lean_object*);
LEAN_EXPORT lean_object* l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_spec__4(uint8_t, lean_object*, size_t, size_t, lean_object*);
LEAN_EXPORT lean_object* l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_spec__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static const lean_string_object l_main___closed__0_value = {.m_header = {.m_rc = 0, .m_cs_sz = 0, .m_other = 0, .m_tag = 249}, .m_size = 5, .m_capacity = 5, .m_length = 4, .m_data = "lean"};
static const lean_object* l_main___closed__0 = (const lean_object*)&l_main___closed__0_value;
static const lean_ctor_object l_main___closed__1_value = {.m_header = {.m_rc = 0, .m_cs_sz = sizeof(lean_ctor_object) + sizeof(void*)*2 + 0, .m_other = 2, .m_tag = 0}, .m_objs = {((lean_object*)(((size_t)(0) << 1) | 1)),((lean_object*)(((size_t)(0) << 1) | 1))}};
static const lean_object* l_main___closed__1 = (const lean_object*)&l_main___closed__1_value;
static lean_object* l_main___closed__2;
static const lean_string_object l_main___closed__3_value = {.m_header = {.m_rc = 0, .m_cs_sz = 0, .m_other = 0, .m_tag = 249}, .m_size = 61, .m_capacity = 61, .m_length = 60, .m_data = "--fresh flag is only valid when specifying a single module:\n"};
static const lean_object* l_main___closed__3 = (const lean_object*)&l_main___closed__3_value;
static const lean_string_object l_main___closed__4_value = {.m_header = {.m_rc = 0, .m_cs_sz = 0, .m_other = 0, .m_tag = 249}, .m_size = 3, .m_capacity = 3, .m_length = 2, .m_data = "-v"};
static const lean_object* l_main___closed__4 = (const lean_object*)&l_main___closed__4_value;
static const lean_string_object l_main___closed__5_value = {.m_header = {.m_rc = 0, .m_cs_sz = 0, .m_other = 0, .m_tag = 249}, .m_size = 10, .m_capacity = 10, .m_length = 9, .m_data = "--verbose"};
static const lean_object* l_main___closed__5 = (const lean_object*)&l_main___closed__5_value;
LEAN_EXPORT lean_object* l_main___boxed__const__1;
lean_object* l_Lean_findSysroot(lean_object*);
lean_object* l_Lean_initSearchPath(lean_object*, lean_object*);
extern lean_object* l_Lean_searchPathRef;
lean_object* l_List_lengthTR___redArg(lean_object*);
lean_object* l_List_toString___at___00Lean_Environment_AddConstAsyncResult_commitConst_spec__1(lean_object*);
LEAN_EXPORT lean_object* _lean_main(lean_object*);
LEAN_EXPORT lean_object* l_main___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_forIn_x27_loop___at___00main_spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_forIn_x27_loop___at___00main_spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_forIn_x27_loop___at___00main_spec__3(lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_forIn_x27_loop___at___00main_spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_forIn_x27_loop___at___00main_spec__5(uint8_t, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_forIn_x27_loop___at___00main_spec__5___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00replayFromImports_spec__0(lean_object* x_1, size_t x_2, size_t x_3, lean_object* x_4) {
_start:
{
uint8_t x_6;
x_6 = lean_usize_dec_lt(x_3, x_2);
if (x_6 == 0)
{
lean_object* x_7;
x_7 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_7, 0, x_4);
return x_7;
}
else
{
uint8_t x_8;
x_8 = !lean_is_exclusive(x_4);
if (x_8 == 0)
{
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_9 = lean_ctor_get(x_4, 0);
x_10 = lean_ctor_get(x_4, 1);
x_11 = lean_ctor_get(x_9, 0);
x_12 = lean_ctor_get(x_9, 1);
x_13 = lean_ctor_get(x_9, 2);
x_14 = lean_nat_dec_lt(x_12, x_13);
if (x_14 == 0)
{
lean_object* x_15;
x_15 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_15, 0, x_4);
return x_15;
}
else
{
uint8_t x_16;
lean_inc(x_13);
lean_inc(x_12);
lean_inc_ref(x_11);
x_16 = !lean_is_exclusive(x_9);
if (x_16 == 0)
{
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; size_t x_25; size_t x_26;
x_17 = lean_ctor_get(x_9, 2);
lean_dec(x_17);
x_18 = lean_ctor_get(x_9, 1);
lean_dec(x_18);
x_19 = lean_ctor_get(x_9, 0);
lean_dec(x_19);
x_20 = lean_array_uget(x_1, x_3);
x_21 = lean_array_fget(x_11, x_12);
x_22 = lean_unsigned_to_nat(1u);
x_23 = lean_nat_add(x_12, x_22);
lean_dec(x_12);
lean_ctor_set(x_9, 1, x_23);
x_24 = l_Std_DHashMap_Internal_Raw_u2080_insert___at___00Lean_SMap_insert___at___00Lean_initFn_00___x40_Lean_ReducibilityAttrs_3557922905____hygCtx___hyg_2__spec__1_spec__2___redArg(x_10, x_20, x_21);
lean_ctor_set(x_4, 1, x_24);
x_25 = 1;
x_26 = lean_usize_add(x_3, x_25);
x_3 = x_26;
goto _start;
}
else
{
lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; size_t x_34; size_t x_35;
lean_dec(x_9);
x_28 = lean_array_uget(x_1, x_3);
x_29 = lean_array_fget(x_11, x_12);
x_30 = lean_unsigned_to_nat(1u);
x_31 = lean_nat_add(x_12, x_30);
lean_dec(x_12);
x_32 = lean_alloc_ctor(0, 3, 0);
lean_ctor_set(x_32, 0, x_11);
lean_ctor_set(x_32, 1, x_31);
lean_ctor_set(x_32, 2, x_13);
x_33 = l_Std_DHashMap_Internal_Raw_u2080_insert___at___00Lean_SMap_insert___at___00Lean_initFn_00___x40_Lean_ReducibilityAttrs_3557922905____hygCtx___hyg_2__spec__1_spec__2___redArg(x_10, x_28, x_29);
lean_ctor_set(x_4, 1, x_33);
lean_ctor_set(x_4, 0, x_32);
x_34 = 1;
x_35 = lean_usize_add(x_3, x_34);
x_3 = x_35;
goto _start;
}
}
}
else
{
lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41; uint8_t x_42;
x_37 = lean_ctor_get(x_4, 0);
x_38 = lean_ctor_get(x_4, 1);
lean_inc(x_38);
lean_inc(x_37);
lean_dec(x_4);
x_39 = lean_ctor_get(x_37, 0);
x_40 = lean_ctor_get(x_37, 1);
x_41 = lean_ctor_get(x_37, 2);
x_42 = lean_nat_dec_lt(x_40, x_41);
if (x_42 == 0)
{
lean_object* x_43; lean_object* x_44;
x_43 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_43, 0, x_37);
lean_ctor_set(x_43, 1, x_38);
x_44 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_44, 0, x_43);
return x_44;
}
else
{
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; size_t x_53; size_t x_54;
lean_inc(x_41);
lean_inc(x_40);
lean_inc_ref(x_39);
if (lean_is_exclusive(x_37)) {
lean_ctor_release(x_37, 0);
lean_ctor_release(x_37, 1);
lean_ctor_release(x_37, 2);
x_45 = x_37;
} else {
lean_dec_ref(x_37);
x_45 = lean_box(0);
}
x_46 = lean_array_uget(x_1, x_3);
x_47 = lean_array_fget(x_39, x_40);
x_48 = lean_unsigned_to_nat(1u);
x_49 = lean_nat_add(x_40, x_48);
lean_dec(x_40);
if (lean_is_scalar(x_45)) {
x_50 = lean_alloc_ctor(0, 3, 0);
} else {
x_50 = x_45;
}
lean_ctor_set(x_50, 0, x_39);
lean_ctor_set(x_50, 1, x_49);
lean_ctor_set(x_50, 2, x_41);
x_51 = l_Std_DHashMap_Internal_Raw_u2080_insert___at___00Lean_SMap_insert___at___00Lean_initFn_00___x40_Lean_ReducibilityAttrs_3557922905____hygCtx___hyg_2__spec__1_spec__2___redArg(x_38, x_46, x_47);
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 = 1;
x_54 = lean_usize_add(x_3, x_53);
x_3 = x_54;
x_4 = x_52;
goto _start;
}
}
}
}
}
LEAN_EXPORT lean_object* l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00replayFromImports_spec__0___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_2);
lean_dec(x_2);
x_7 = lean_unbox_usize(x_3);
lean_dec(x_3);
x_8 = l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00replayFromImports_spec__0(x_1, x_6, x_7, x_4);
lean_dec_ref(x_1);
return x_8;
}
}
static lean_object* _init_l_replayFromImports___closed__0() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_box(0);
x_2 = lean_unsigned_to_nat(16u);
x_3 = lean_mk_array(x_2, x_1);
return x_3;
}
}
static uint8_t _init_l_replayFromImports___closed__1() {
_start:
{
uint8_t x_1; uint8_t x_2;
x_1 = 2;
x_2 = l_Lean_instOrdOLeanLevel_ord(x_1, x_1);
return x_2;
}
}
static lean_object* _init_l_replayFromImports___closed__7() {
_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_replayFromImports(lean_object* x_1) {
_start:
{
lean_object* x_3;
lean_inc(x_1);
x_3 = l_Lean_findOLean(x_1);
if (lean_obj_tag(x_3) == 0)
{
uint8_t x_4;
x_4 = !lean_is_exclusive(x_3);
if (x_4 == 0)
{
lean_object* x_5; uint8_t x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; uint8_t x_11; uint8_t x_12; lean_object* x_13; lean_object* x_14; uint8_t x_15; lean_object* x_77; lean_object* x_78;
x_5 = lean_ctor_get(x_3, 0);
x_6 = l_System_FilePath_pathExists(x_5);
if (x_6 == 0)
{
lean_object* x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; uint8_t x_110; lean_object* x_111; lean_object* x_112; lean_object* x_113; lean_object* x_114; lean_object* x_115;
x_106 = ((lean_object*)(l_replayFromImports___closed__4));
x_107 = lean_string_append(x_106, x_5);
lean_dec(x_5);
x_108 = ((lean_object*)(l_replayFromImports___closed__5));
x_109 = lean_string_append(x_107, x_108);
x_110 = 1;
x_111 = l_Lean_Name_toStringWithToken___at___00Lean_Name_toString_spec__0(x_1, x_110);
x_112 = lean_string_append(x_109, x_111);
lean_dec_ref(x_111);
x_113 = ((lean_object*)(l_replayFromImports___closed__6));
x_114 = lean_string_append(x_112, x_113);
x_115 = lean_alloc_ctor(18, 1, 0);
lean_ctor_set(x_115, 0, x_114);
lean_ctor_set_tag(x_3, 1);
lean_ctor_set(x_3, 0, x_115);
return x_3;
}
else
{
lean_object* x_116; lean_object* x_117; uint8_t x_118; lean_object* x_119; uint8_t x_120;
lean_free_object(x_3);
lean_dec(x_1);
x_116 = l_replayFromImports___closed__7;
lean_inc(x_5);
x_117 = lean_array_push(x_116, x_5);
x_118 = 1;
lean_inc(x_5);
x_119 = l_Lean_OLeanLevel_adjustFileName(x_5, x_118);
x_120 = l_System_FilePath_pathExists(x_119);
if (x_120 == 0)
{
lean_dec_ref(x_119);
lean_dec(x_5);
x_77 = x_117;
x_78 = lean_box(0);
goto block_105;
}
else
{
uint8_t x_121; lean_object* x_122; uint8_t x_123; lean_object* x_124;
x_121 = 2;
x_122 = l_Lean_OLeanLevel_adjustFileName(x_5, x_121);
x_123 = l_System_FilePath_pathExists(x_122);
x_124 = lean_array_push(x_117, x_119);
if (x_123 == 0)
{
lean_dec_ref(x_122);
x_77 = x_124;
x_78 = lean_box(0);
goto block_105;
}
else
{
lean_object* x_125;
x_125 = lean_array_push(x_124, x_122);
x_77 = x_125;
x_78 = lean_box(0);
goto block_105;
}
}
}
block_76:
{
lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19;
x_16 = l_Lean_instInhabitedImportState_default;
x_17 = lean_st_mk_ref(x_16);
x_18 = lean_ctor_get(x_13, 0);
lean_inc_ref(x_18);
lean_dec_ref(x_13);
lean_inc(x_17);
x_19 = l_Lean_importModulesCore(x_18, x_12, x_7, x_15, x_17);
if (lean_obj_tag(x_19) == 0)
{
lean_object* x_20; lean_object* x_21; uint32_t x_22; lean_object* x_23;
lean_dec_ref(x_19);
x_20 = lean_st_ref_get(x_17);
lean_dec(x_17);
x_21 = l_Lean_Options_empty;
x_22 = 0;
x_23 = l_Lean_finalizeImport(x_20, x_18, x_21, x_22, x_11, x_11, x_12, x_6);
lean_dec(x_20);
if (lean_obj_tag(x_23) == 0)
{
lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; uint8_t x_28;
x_24 = lean_ctor_get(x_23, 0);
lean_inc(x_24);
lean_dec_ref(x_23);
x_25 = lean_unsigned_to_nat(1u);
x_26 = lean_nat_sub(x_9, x_25);
lean_dec(x_9);
x_27 = lean_array_fget(x_8, x_26);
lean_dec(x_26);
lean_dec_ref(x_8);
x_28 = !lean_is_exclusive(x_27);
if (x_28 == 0)
{
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; size_t x_37; size_t x_38; lean_object* x_39;
x_29 = lean_ctor_get(x_27, 0);
x_30 = lean_ctor_get(x_27, 1);
lean_dec(x_30);
x_31 = lean_ctor_get(x_29, 1);
lean_inc_ref(x_31);
x_32 = lean_ctor_get(x_29, 2);
lean_inc_ref(x_32);
lean_dec(x_29);
x_33 = l_replayFromImports___closed__0;
lean_inc(x_14);
lean_ctor_set(x_27, 1, x_33);
lean_ctor_set(x_27, 0, x_14);
x_34 = lean_array_get_size(x_32);
x_35 = l_Array_toSubarray___redArg(x_32, x_14, x_34);
x_36 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_36, 0, x_35);
lean_ctor_set(x_36, 1, x_27);
x_37 = lean_array_size(x_31);
x_38 = 0;
x_39 = l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00replayFromImports_spec__0(x_31, x_37, x_38, x_36);
lean_dec_ref(x_31);
if (lean_obj_tag(x_39) == 0)
{
lean_object* x_40; lean_object* x_41; lean_object* x_42;
x_40 = lean_ctor_get(x_39, 0);
lean_inc(x_40);
lean_dec_ref(x_39);
x_41 = lean_ctor_get(x_40, 1);
lean_inc(x_41);
lean_dec(x_40);
x_42 = l_Lean_Environment_replay_x27(x_41, x_24);
if (lean_obj_tag(x_42) == 0)
{
lean_object* x_43; lean_object* x_44;
x_43 = lean_ctor_get(x_42, 0);
lean_inc(x_43);
lean_dec_ref(x_42);
x_44 = lean_environment_free_regions(x_43);
return x_44;
}
else
{
uint8_t x_45;
x_45 = !lean_is_exclusive(x_42);
if (x_45 == 0)
{
return x_42;
}
else
{
lean_object* x_46; lean_object* x_47;
x_46 = lean_ctor_get(x_42, 0);
lean_inc(x_46);
lean_dec(x_42);
x_47 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_47, 0, x_46);
return x_47;
}
}
}
else
{
uint8_t x_48;
lean_dec(x_24);
x_48 = !lean_is_exclusive(x_39);
if (x_48 == 0)
{
return x_39;
}
else
{
lean_object* x_49; lean_object* x_50;
x_49 = lean_ctor_get(x_39, 0);
lean_inc(x_49);
lean_dec(x_39);
x_50 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_50, 0, x_49);
return x_50;
}
}
}
else
{
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; size_t x_59; size_t x_60; lean_object* x_61;
x_51 = lean_ctor_get(x_27, 0);
lean_inc(x_51);
lean_dec(x_27);
x_52 = lean_ctor_get(x_51, 1);
lean_inc_ref(x_52);
x_53 = lean_ctor_get(x_51, 2);
lean_inc_ref(x_53);
lean_dec(x_51);
x_54 = l_replayFromImports___closed__0;
lean_inc(x_14);
x_55 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_55, 0, x_14);
lean_ctor_set(x_55, 1, x_54);
x_56 = lean_array_get_size(x_53);
x_57 = l_Array_toSubarray___redArg(x_53, x_14, x_56);
x_58 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_58, 0, x_57);
lean_ctor_set(x_58, 1, x_55);
x_59 = lean_array_size(x_52);
x_60 = 0;
x_61 = l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00replayFromImports_spec__0(x_52, x_59, x_60, x_58);
lean_dec_ref(x_52);
if (lean_obj_tag(x_61) == 0)
{
lean_object* x_62; lean_object* x_63; lean_object* x_64;
x_62 = lean_ctor_get(x_61, 0);
lean_inc(x_62);
lean_dec_ref(x_61);
x_63 = lean_ctor_get(x_62, 1);
lean_inc(x_63);
lean_dec(x_62);
x_64 = l_Lean_Environment_replay_x27(x_63, x_24);
if (lean_obj_tag(x_64) == 0)
{
lean_object* x_65; lean_object* x_66;
x_65 = lean_ctor_get(x_64, 0);
lean_inc(x_65);
lean_dec_ref(x_64);
x_66 = lean_environment_free_regions(x_65);
return x_66;
}
else
{
lean_object* x_67; lean_object* x_68; lean_object* x_69;
x_67 = lean_ctor_get(x_64, 0);
lean_inc(x_67);
if (lean_is_exclusive(x_64)) {
lean_ctor_release(x_64, 0);
x_68 = x_64;
} else {
lean_dec_ref(x_64);
x_68 = lean_box(0);
}
if (lean_is_scalar(x_68)) {
x_69 = lean_alloc_ctor(1, 1, 0);
} else {
x_69 = x_68;
}
lean_ctor_set(x_69, 0, x_67);
return x_69;
}
}
else
{
lean_object* x_70; lean_object* x_71; lean_object* x_72;
lean_dec(x_24);
x_70 = lean_ctor_get(x_61, 0);
lean_inc(x_70);
if (lean_is_exclusive(x_61)) {
lean_ctor_release(x_61, 0);
x_71 = x_61;
} else {
lean_dec_ref(x_61);
x_71 = lean_box(0);
}
if (lean_is_scalar(x_71)) {
x_72 = lean_alloc_ctor(1, 1, 0);
} else {
x_72 = x_71;
}
lean_ctor_set(x_72, 0, x_70);
return x_72;
}
}
}
else
{
uint8_t x_73;
lean_dec(x_14);
lean_dec(x_9);
lean_dec_ref(x_8);
x_73 = !lean_is_exclusive(x_23);
if (x_73 == 0)
{
return x_23;
}
else
{
lean_object* x_74; lean_object* x_75;
x_74 = lean_ctor_get(x_23, 0);
lean_inc(x_74);
lean_dec(x_23);
x_75 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_75, 0, x_74);
return x_75;
}
}
}
else
{
lean_dec_ref(x_18);
lean_dec(x_17);
lean_dec(x_14);
lean_dec(x_9);
lean_dec_ref(x_8);
return x_19;
}
}
block_105:
{
lean_object* x_79;
x_79 = lean_read_module_data_parts(x_77);
lean_dec_ref(x_77);
if (lean_obj_tag(x_79) == 0)
{
uint8_t x_80;
x_80 = !lean_is_exclusive(x_79);
if (x_80 == 0)
{
lean_object* x_81; lean_object* x_82; lean_object* x_83; uint8_t x_84;
x_81 = lean_ctor_get(x_79, 0);
x_82 = lean_array_get_size(x_81);
x_83 = lean_unsigned_to_nat(0u);
x_84 = lean_nat_dec_eq(x_82, x_83);
if (x_84 == 0)
{
lean_object* x_85; lean_object* x_86; uint8_t x_87; lean_object* x_88; uint8_t x_89;
lean_free_object(x_79);
x_85 = lean_array_fget_borrowed(x_81, x_83);
x_86 = lean_ctor_get(x_85, 0);
lean_inc(x_86);
x_87 = 2;
x_88 = lean_box(1);
x_89 = l_replayFromImports___closed__1;
if (x_89 == 0)
{
x_7 = x_88;
x_8 = x_81;
x_9 = x_82;
x_10 = lean_box(0);
x_11 = x_84;
x_12 = x_87;
x_13 = x_86;
x_14 = x_83;
x_15 = x_6;
goto block_76;
}
else
{
x_7 = x_88;
x_8 = x_81;
x_9 = x_82;
x_10 = lean_box(0);
x_11 = x_84;
x_12 = x_87;
x_13 = x_86;
x_14 = x_83;
x_15 = x_84;
goto block_76;
}
}
else
{
lean_object* x_90;
lean_dec(x_81);
x_90 = ((lean_object*)(l_replayFromImports___closed__3));
lean_ctor_set_tag(x_79, 1);
lean_ctor_set(x_79, 0, x_90);
return x_79;
}
}
else
{
lean_object* x_91; lean_object* x_92; lean_object* x_93; uint8_t x_94;
x_91 = lean_ctor_get(x_79, 0);
lean_inc(x_91);
lean_dec(x_79);
x_92 = lean_array_get_size(x_91);
x_93 = lean_unsigned_to_nat(0u);
x_94 = lean_nat_dec_eq(x_92, x_93);
if (x_94 == 0)
{
lean_object* x_95; lean_object* x_96; uint8_t x_97; lean_object* x_98; uint8_t x_99;
x_95 = lean_array_fget_borrowed(x_91, x_93);
x_96 = lean_ctor_get(x_95, 0);
lean_inc(x_96);
x_97 = 2;
x_98 = lean_box(1);
x_99 = l_replayFromImports___closed__1;
if (x_99 == 0)
{
x_7 = x_98;
x_8 = x_91;
x_9 = x_92;
x_10 = lean_box(0);
x_11 = x_94;
x_12 = x_97;
x_13 = x_96;
x_14 = x_93;
x_15 = x_6;
goto block_76;
}
else
{
x_7 = x_98;
x_8 = x_91;
x_9 = x_92;
x_10 = lean_box(0);
x_11 = x_94;
x_12 = x_97;
x_13 = x_96;
x_14 = x_93;
x_15 = x_94;
goto block_76;
}
}
else
{
lean_object* x_100; lean_object* x_101;
lean_dec(x_91);
x_100 = ((lean_object*)(l_replayFromImports___closed__3));
x_101 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_101, 0, x_100);
return x_101;
}
}
}
else
{
uint8_t x_102;
x_102 = !lean_is_exclusive(x_79);
if (x_102 == 0)
{
return x_79;
}
else
{
lean_object* x_103; lean_object* x_104;
x_103 = lean_ctor_get(x_79, 0);
lean_inc(x_103);
lean_dec(x_79);
x_104 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_104, 0, x_103);
return x_104;
}
}
}
}
else
{
lean_object* x_126; uint8_t x_127; lean_object* x_128; lean_object* x_129; lean_object* x_130; lean_object* x_131; uint8_t x_132; uint8_t x_133; lean_object* x_134; lean_object* x_135; uint8_t x_136; lean_object* x_176; lean_object* x_177;
x_126 = lean_ctor_get(x_3, 0);
lean_inc(x_126);
lean_dec(x_3);
x_127 = l_System_FilePath_pathExists(x_126);
if (x_127 == 0)
{
lean_object* x_195; lean_object* x_196; lean_object* x_197; lean_object* x_198; uint8_t 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;
x_195 = ((lean_object*)(l_replayFromImports___closed__4));
x_196 = lean_string_append(x_195, x_126);
lean_dec(x_126);
x_197 = ((lean_object*)(l_replayFromImports___closed__5));
x_198 = lean_string_append(x_196, x_197);
x_199 = 1;
x_200 = l_Lean_Name_toStringWithToken___at___00Lean_Name_toString_spec__0(x_1, x_199);
x_201 = lean_string_append(x_198, x_200);
lean_dec_ref(x_200);
x_202 = ((lean_object*)(l_replayFromImports___closed__6));
x_203 = lean_string_append(x_201, x_202);
x_204 = lean_alloc_ctor(18, 1, 0);
lean_ctor_set(x_204, 0, x_203);
x_205 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_205, 0, x_204);
return x_205;
}
else
{
lean_object* x_206; lean_object* x_207; uint8_t x_208; lean_object* x_209; uint8_t x_210;
lean_dec(x_1);
x_206 = l_replayFromImports___closed__7;
lean_inc(x_126);
x_207 = lean_array_push(x_206, x_126);
x_208 = 1;
lean_inc(x_126);
x_209 = l_Lean_OLeanLevel_adjustFileName(x_126, x_208);
x_210 = l_System_FilePath_pathExists(x_209);
if (x_210 == 0)
{
lean_dec_ref(x_209);
lean_dec(x_126);
x_176 = x_207;
x_177 = lean_box(0);
goto block_194;
}
else
{
uint8_t x_211; lean_object* x_212; uint8_t x_213; lean_object* x_214;
x_211 = 2;
x_212 = l_Lean_OLeanLevel_adjustFileName(x_126, x_211);
x_213 = l_System_FilePath_pathExists(x_212);
x_214 = lean_array_push(x_207, x_209);
if (x_213 == 0)
{
lean_dec_ref(x_212);
x_176 = x_214;
x_177 = lean_box(0);
goto block_194;
}
else
{
lean_object* x_215;
x_215 = lean_array_push(x_214, x_212);
x_176 = x_215;
x_177 = lean_box(0);
goto block_194;
}
}
}
block_175:
{
lean_object* x_137; lean_object* x_138; lean_object* x_139; lean_object* x_140;
x_137 = l_Lean_instInhabitedImportState_default;
x_138 = lean_st_mk_ref(x_137);
x_139 = lean_ctor_get(x_134, 0);
lean_inc_ref(x_139);
lean_dec_ref(x_134);
lean_inc(x_138);
x_140 = l_Lean_importModulesCore(x_139, x_133, x_128, x_136, x_138);
if (lean_obj_tag(x_140) == 0)
{
lean_object* x_141; lean_object* x_142; uint32_t x_143; lean_object* x_144;
lean_dec_ref(x_140);
x_141 = lean_st_ref_get(x_138);
lean_dec(x_138);
x_142 = l_Lean_Options_empty;
x_143 = 0;
x_144 = l_Lean_finalizeImport(x_141, x_139, x_142, x_143, x_132, x_132, x_133, x_127);
lean_dec(x_141);
if (lean_obj_tag(x_144) == 0)
{
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; size_t x_158; size_t x_159; lean_object* x_160;
x_145 = lean_ctor_get(x_144, 0);
lean_inc(x_145);
lean_dec_ref(x_144);
x_146 = lean_unsigned_to_nat(1u);
x_147 = lean_nat_sub(x_130, x_146);
lean_dec(x_130);
x_148 = lean_array_fget(x_129, x_147);
lean_dec(x_147);
lean_dec_ref(x_129);
x_149 = lean_ctor_get(x_148, 0);
lean_inc(x_149);
if (lean_is_exclusive(x_148)) {
lean_ctor_release(x_148, 0);
lean_ctor_release(x_148, 1);
x_150 = x_148;
} else {
lean_dec_ref(x_148);
x_150 = lean_box(0);
}
x_151 = lean_ctor_get(x_149, 1);
lean_inc_ref(x_151);
x_152 = lean_ctor_get(x_149, 2);
lean_inc_ref(x_152);
lean_dec(x_149);
x_153 = l_replayFromImports___closed__0;
lean_inc(x_135);
if (lean_is_scalar(x_150)) {
x_154 = lean_alloc_ctor(0, 2, 0);
} else {
x_154 = x_150;
}
lean_ctor_set(x_154, 0, x_135);
lean_ctor_set(x_154, 1, x_153);
x_155 = lean_array_get_size(x_152);
x_156 = l_Array_toSubarray___redArg(x_152, x_135, x_155);
x_157 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_157, 0, x_156);
lean_ctor_set(x_157, 1, x_154);
x_158 = lean_array_size(x_151);
x_159 = 0;
x_160 = l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00replayFromImports_spec__0(x_151, x_158, x_159, x_157);
lean_dec_ref(x_151);
if (lean_obj_tag(x_160) == 0)
{
lean_object* x_161; lean_object* x_162; lean_object* x_163;
x_161 = lean_ctor_get(x_160, 0);
lean_inc(x_161);
lean_dec_ref(x_160);
x_162 = lean_ctor_get(x_161, 1);
lean_inc(x_162);
lean_dec(x_161);
x_163 = l_Lean_Environment_replay_x27(x_162, x_145);
if (lean_obj_tag(x_163) == 0)
{
lean_object* x_164; lean_object* x_165;
x_164 = lean_ctor_get(x_163, 0);
lean_inc(x_164);
lean_dec_ref(x_163);
x_165 = lean_environment_free_regions(x_164);
return x_165;
}
else
{
lean_object* x_166; lean_object* x_167; lean_object* x_168;
x_166 = lean_ctor_get(x_163, 0);
lean_inc(x_166);
if (lean_is_exclusive(x_163)) {
lean_ctor_release(x_163, 0);
x_167 = x_163;
} else {
lean_dec_ref(x_163);
x_167 = lean_box(0);
}
if (lean_is_scalar(x_167)) {
x_168 = lean_alloc_ctor(1, 1, 0);
} else {
x_168 = x_167;
}
lean_ctor_set(x_168, 0, x_166);
return x_168;
}
}
else
{
lean_object* x_169; lean_object* x_170; lean_object* x_171;
lean_dec(x_145);
x_169 = lean_ctor_get(x_160, 0);
lean_inc(x_169);
if (lean_is_exclusive(x_160)) {
lean_ctor_release(x_160, 0);
x_170 = x_160;
} else {
lean_dec_ref(x_160);
x_170 = lean_box(0);
}
if (lean_is_scalar(x_170)) {
x_171 = lean_alloc_ctor(1, 1, 0);
} else {
x_171 = x_170;
}
lean_ctor_set(x_171, 0, x_169);
return x_171;
}
}
else
{
lean_object* x_172; lean_object* x_173; lean_object* x_174;
lean_dec(x_135);
lean_dec(x_130);
lean_dec_ref(x_129);
x_172 = lean_ctor_get(x_144, 0);
lean_inc(x_172);
if (lean_is_exclusive(x_144)) {
lean_ctor_release(x_144, 0);
x_173 = x_144;
} else {
lean_dec_ref(x_144);
x_173 = lean_box(0);
}
if (lean_is_scalar(x_173)) {
x_174 = lean_alloc_ctor(1, 1, 0);
} else {
x_174 = x_173;
}
lean_ctor_set(x_174, 0, x_172);
return x_174;
}
}
else
{
lean_dec_ref(x_139);
lean_dec(x_138);
lean_dec(x_135);
lean_dec(x_130);
lean_dec_ref(x_129);
return x_140;
}
}
block_194:
{
lean_object* x_178;
x_178 = lean_read_module_data_parts(x_176);
lean_dec_ref(x_176);
if (lean_obj_tag(x_178) == 0)
{
lean_object* x_179; lean_object* x_180; lean_object* x_181; lean_object* x_182; uint8_t x_183;
x_179 = lean_ctor_get(x_178, 0);
lean_inc(x_179);
if (lean_is_exclusive(x_178)) {
lean_ctor_release(x_178, 0);
x_180 = x_178;
} else {
lean_dec_ref(x_178);
x_180 = lean_box(0);
}
x_181 = lean_array_get_size(x_179);
x_182 = lean_unsigned_to_nat(0u);
x_183 = lean_nat_dec_eq(x_181, x_182);
if (x_183 == 0)
{
lean_object* x_184; lean_object* x_185; uint8_t x_186; lean_object* x_187; uint8_t x_188;
lean_dec(x_180);
x_184 = lean_array_fget_borrowed(x_179, x_182);
x_185 = lean_ctor_get(x_184, 0);
lean_inc(x_185);
x_186 = 2;
x_187 = lean_box(1);
x_188 = l_replayFromImports___closed__1;
if (x_188 == 0)
{
x_128 = x_187;
x_129 = x_179;
x_130 = x_181;
x_131 = lean_box(0);
x_132 = x_183;
x_133 = x_186;
x_134 = x_185;
x_135 = x_182;
x_136 = x_127;
goto block_175;
}
else
{
x_128 = x_187;
x_129 = x_179;
x_130 = x_181;
x_131 = lean_box(0);
x_132 = x_183;
x_133 = x_186;
x_134 = x_185;
x_135 = x_182;
x_136 = x_183;
goto block_175;
}
}
else
{
lean_object* x_189; lean_object* x_190;
lean_dec(x_179);
x_189 = ((lean_object*)(l_replayFromImports___closed__3));
if (lean_is_scalar(x_180)) {
x_190 = lean_alloc_ctor(1, 1, 0);
} else {
x_190 = x_180;
lean_ctor_set_tag(x_190, 1);
}
lean_ctor_set(x_190, 0, x_189);
return x_190;
}
}
else
{
lean_object* x_191; lean_object* x_192; lean_object* x_193;
x_191 = lean_ctor_get(x_178, 0);
lean_inc(x_191);
if (lean_is_exclusive(x_178)) {
lean_ctor_release(x_178, 0);
x_192 = x_178;
} else {
lean_dec_ref(x_178);
x_192 = lean_box(0);
}
if (lean_is_scalar(x_192)) {
x_193 = lean_alloc_ctor(1, 1, 0);
} else {
x_193 = x_192;
}
lean_ctor_set(x_193, 0, x_191);
return x_193;
}
}
}
}
else
{
uint8_t x_216;
lean_dec(x_1);
x_216 = !lean_is_exclusive(x_3);
if (x_216 == 0)
{
return x_3;
}
else
{
lean_object* x_217; lean_object* x_218;
x_217 = lean_ctor_get(x_3, 0);
lean_inc(x_217);
lean_dec(x_3);
x_218 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_218, 0, x_217);
return x_218;
}
}
}
}
LEAN_EXPORT lean_object* l_replayFromImports___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3;
x_3 = l_replayFromImports(x_1);
return x_3;
}
}
LEAN_EXPORT lean_object* l_replayFromFresh___lam__0(lean_object* x_1) {
_start:
{
uint32_t x_3; lean_object* x_4;
x_3 = 0;
x_4 = lean_mk_empty_environment(x_3);
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, 0);
lean_inc(x_5);
lean_dec_ref(x_4);
x_6 = l_Lean_Environment_constants(x_1);
x_7 = lean_ctor_get(x_6, 0);
lean_inc_ref(x_7);
lean_dec_ref(x_6);
x_8 = l_Lean_Environment_replay_x27(x_7, x_5);
if (lean_obj_tag(x_8) == 0)
{
uint8_t x_9;
x_9 = !lean_is_exclusive(x_8);
if (x_9 == 0)
{
lean_object* x_10; lean_object* x_11;
x_10 = lean_ctor_get(x_8, 0);
lean_dec(x_10);
x_11 = lean_box(0);
lean_ctor_set(x_8, 0, x_11);
return x_8;
}
else
{
lean_object* x_12; lean_object* x_13;
lean_dec(x_8);
x_12 = lean_box(0);
x_13 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_13, 0, x_12);
return x_13;
}
}
else
{
uint8_t x_14;
x_14 = !lean_is_exclusive(x_8);
if (x_14 == 0)
{
return x_8;
}
else
{
lean_object* x_15; lean_object* x_16;
x_15 = lean_ctor_get(x_8, 0);
lean_inc(x_15);
lean_dec(x_8);
x_16 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_16, 0, x_15);
return x_16;
}
}
}
else
{
uint8_t x_17;
lean_dec_ref(x_1);
x_17 = !lean_is_exclusive(x_4);
if (x_17 == 0)
{
return x_4;
}
else
{
lean_object* x_18; lean_object* x_19;
x_18 = lean_ctor_get(x_4, 0);
lean_inc(x_18);
lean_dec(x_4);
x_19 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_19, 0, x_18);
return x_19;
}
}
}
}
LEAN_EXPORT lean_object* l_replayFromFresh___lam__0___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3;
x_3 = l_replayFromFresh___lam__0(x_1);
return x_3;
}
}
static lean_object* _init_l_replayFromFresh___closed__1() {
_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_replayFromFresh(lean_object* x_1) {
_start:
{
lean_object* x_3; uint8_t x_4; uint8_t x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; uint32_t x_10; lean_object* x_11;
x_3 = ((lean_object*)(l_replayFromFresh___closed__0));
x_4 = 0;
x_5 = 1;
x_6 = lean_alloc_ctor(0, 1, 3);
lean_ctor_set(x_6, 0, x_1);
lean_ctor_set_uint8(x_6, sizeof(void*)*1, x_4);
lean_ctor_set_uint8(x_6, sizeof(void*)*1 + 1, x_5);
lean_ctor_set_uint8(x_6, sizeof(void*)*1 + 2, x_4);
x_7 = l_replayFromFresh___closed__1;
x_8 = lean_array_push(x_7, x_6);
x_9 = l_Lean_Options_empty;
x_10 = 0;
x_11 = l_Lean_withImportModules___redArg(x_8, x_9, x_3, x_10);
return x_11;
}
}
LEAN_EXPORT lean_object* l_replayFromFresh___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3;
x_3 = l_replayFromFresh(x_1);
return x_3;
}
}
LEAN_EXPORT lean_object* l_getCurrentModule() {
_start:
{
lean_object* x_2; lean_object* x_3;
x_2 = ((lean_object*)(l_getCurrentModule___closed__0));
x_3 = l_Lake_Manifest_load_x3f(x_2);
if (lean_obj_tag(x_3) == 0)
{
uint8_t x_4;
x_4 = !lean_is_exclusive(x_3);
if (x_4 == 0)
{
lean_object* x_5;
x_5 = lean_ctor_get(x_3, 0);
if (lean_obj_tag(x_5) == 0)
{
lean_object* x_6;
x_6 = lean_box(0);
lean_ctor_set(x_3, 0, x_6);
return x_3;
}
else
{
lean_object* x_7; lean_object* x_8; lean_object* x_9;
x_7 = lean_ctor_get(x_5, 0);
lean_inc(x_7);
lean_dec_ref(x_5);
x_8 = lean_ctor_get(x_7, 0);
lean_inc(x_8);
lean_dec(x_7);
x_9 = l_Lean_Name_capitalize(x_8);
lean_ctor_set(x_3, 0, x_9);
return x_3;
}
}
else
{
lean_object* x_10;
x_10 = lean_ctor_get(x_3, 0);
lean_inc(x_10);
lean_dec(x_3);
if (lean_obj_tag(x_10) == 0)
{
lean_object* x_11; lean_object* x_12;
x_11 = lean_box(0);
x_12 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_12, 0, x_11);
return x_12;
}
else
{
lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16;
x_13 = lean_ctor_get(x_10, 0);
lean_inc(x_13);
lean_dec_ref(x_10);
x_14 = lean_ctor_get(x_13, 0);
lean_inc(x_14);
lean_dec(x_13);
x_15 = l_Lean_Name_capitalize(x_14);
x_16 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_16, 0, x_15);
return x_16;
}
}
}
else
{
uint8_t x_17;
x_17 = !lean_is_exclusive(x_3);
if (x_17 == 0)
{
return x_3;
}
else
{
lean_object* x_18; lean_object* x_19;
x_18 = lean_ctor_get(x_3, 0);
lean_inc(x_18);
lean_dec(x_3);
x_19 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_19, 0, x_18);
return x_19;
}
}
}
}
LEAN_EXPORT lean_object* l_getCurrentModule___boxed(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = l_getCurrentModule();
return x_2;
}
}
static lean_object* _init_l_List_partition_loop___at___00main_spec__0___closed__1() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = ((lean_object*)(l_List_partition_loop___at___00main_spec__0___closed__0));
x_2 = lean_string_utf8_byte_size(x_1);
return x_2;
}
}
LEAN_EXPORT lean_object* l_List_partition_loop___at___00main_spec__0(lean_object* x_1, lean_object* x_2) {
_start:
{
if (lean_obj_tag(x_1) == 0)
{
uint8_t x_3;
x_3 = !lean_is_exclusive(x_2);
if (x_3 == 0)
{
lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7;
x_4 = lean_ctor_get(x_2, 0);
x_5 = lean_ctor_get(x_2, 1);
x_6 = l_List_reverse___redArg(x_4);
x_7 = l_List_reverse___redArg(x_5);
lean_ctor_set(x_2, 1, x_7);
lean_ctor_set(x_2, 0, x_6);
return x_2;
}
else
{
lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12;
x_8 = lean_ctor_get(x_2, 0);
x_9 = lean_ctor_get(x_2, 1);
lean_inc(x_9);
lean_inc(x_8);
lean_dec(x_2);
x_10 = l_List_reverse___redArg(x_8);
x_11 = l_List_reverse___redArg(x_9);
x_12 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_12, 0, x_10);
lean_ctor_set(x_12, 1, x_11);
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_23; lean_object* x_24; lean_object* x_25; uint8_t x_26;
x_13 = lean_ctor_get(x_1, 0);
lean_inc(x_13);
x_14 = lean_ctor_get(x_1, 1);
lean_inc(x_14);
if (lean_is_exclusive(x_1)) {
lean_ctor_release(x_1, 0);
lean_ctor_release(x_1, 1);
x_15 = x_1;
} else {
lean_dec_ref(x_1);
x_15 = lean_box(0);
}
x_16 = lean_ctor_get(x_2, 0);
lean_inc(x_16);
x_17 = lean_ctor_get(x_2, 1);
lean_inc(x_17);
if (lean_is_exclusive(x_2)) {
lean_ctor_release(x_2, 0);
lean_ctor_release(x_2, 1);
x_18 = x_2;
} else {
lean_dec_ref(x_2);
x_18 = lean_box(0);
}
x_23 = ((lean_object*)(l_List_partition_loop___at___00main_spec__0___closed__0));
x_24 = lean_string_utf8_byte_size(x_13);
x_25 = l_List_partition_loop___at___00main_spec__0___closed__1;
x_26 = lean_nat_dec_le(x_25, x_24);
if (x_26 == 0)
{
goto block_22;
}
else
{
lean_object* x_27; uint8_t x_28;
x_27 = lean_unsigned_to_nat(0u);
x_28 = lean_string_memcmp(x_13, x_23, x_27, x_27, x_25);
if (x_28 == 0)
{
goto block_22;
}
else
{
lean_object* x_29; lean_object* x_30;
lean_dec(x_18);
lean_dec(x_15);
x_29 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_29, 0, x_13);
lean_ctor_set(x_29, 1, x_16);
x_30 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_30, 0, x_29);
lean_ctor_set(x_30, 1, x_17);
x_1 = x_14;
x_2 = x_30;
goto _start;
}
}
block_22:
{
lean_object* x_19; lean_object* x_20;
if (lean_is_scalar(x_15)) {
x_19 = lean_alloc_ctor(1, 2, 0);
} else {
x_19 = x_15;
}
lean_ctor_set(x_19, 0, x_13);
lean_ctor_set(x_19, 1, x_17);
if (lean_is_scalar(x_18)) {
x_20 = lean_alloc_ctor(0, 2, 0);
} else {
x_20 = x_18;
}
lean_ctor_set(x_20, 0, x_16);
lean_ctor_set(x_20, 1, x_19);
x_1 = x_14;
x_2 = x_20;
goto _start;
}
}
}
}
LEAN_EXPORT lean_object* l_List_forIn_x27_loop___at___00main_spec__3___redArg___lam__0(lean_object* x_1) {
_start:
{
lean_object* x_3;
x_3 = l_replayFromImports(x_1);
if (lean_obj_tag(x_3) == 0)
{
uint8_t x_4;
x_4 = !lean_is_exclusive(x_3);
if (x_4 == 0)
{
lean_ctor_set_tag(x_3, 1);
return x_3;
}
else
{
lean_object* x_5; lean_object* x_6;
x_5 = lean_ctor_get(x_3, 0);
lean_inc(x_5);
lean_dec(x_3);
x_6 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_6, 0, x_5);
return x_6;
}
}
else
{
uint8_t x_7;
x_7 = !lean_is_exclusive(x_3);
if (x_7 == 0)
{
lean_ctor_set_tag(x_3, 0);
return x_3;
}
else
{
lean_object* x_8; lean_object* x_9;
x_8 = lean_ctor_get(x_3, 0);
lean_inc(x_8);
lean_dec(x_3);
x_9 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_9, 0, x_8);
return x_9;
}
}
}
}
LEAN_EXPORT lean_object* l_List_forIn_x27_loop___at___00main_spec__3___redArg___lam__0___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3;
x_3 = l_List_forIn_x27_loop___at___00main_spec__3___redArg___lam__0(x_1);
return x_3;
}
}
LEAN_EXPORT lean_object* l_List_forIn_x27_loop___at___00main_spec__3___redArg(lean_object* x_1, lean_object* x_2) {
_start:
{
if (lean_obj_tag(x_1) == 0)
{
lean_object* x_4;
x_4 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_4, 0, x_2);
return x_4;
}
else
{
uint8_t x_5;
x_5 = !lean_is_exclusive(x_1);
if (x_5 == 0)
{
lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11;
x_6 = lean_ctor_get(x_1, 0);
x_7 = lean_ctor_get(x_1, 1);
lean_inc(x_6);
x_8 = lean_alloc_closure((void*)(l_List_forIn_x27_loop___at___00main_spec__3___redArg___lam__0___boxed), 2, 1);
lean_closure_set(x_8, 0, x_6);
x_9 = lean_unsigned_to_nat(0u);
x_10 = lean_io_as_task(x_8, x_9);
lean_ctor_set_tag(x_1, 0);
lean_ctor_set(x_1, 1, x_10);
x_11 = lean_array_push(x_2, x_1);
x_1 = x_7;
x_2 = x_11;
goto _start;
}
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;
x_13 = lean_ctor_get(x_1, 0);
x_14 = lean_ctor_get(x_1, 1);
lean_inc(x_14);
lean_inc(x_13);
lean_dec(x_1);
lean_inc(x_13);
x_15 = lean_alloc_closure((void*)(l_List_forIn_x27_loop___at___00main_spec__3___redArg___lam__0___boxed), 2, 1);
lean_closure_set(x_15, 0, x_13);
x_16 = lean_unsigned_to_nat(0u);
x_17 = lean_io_as_task(x_15, x_16);
x_18 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_18, 0, x_13);
lean_ctor_set(x_18, 1, x_17);
x_19 = lean_array_push(x_2, x_18);
x_1 = x_14;
x_2 = x_19;
goto _start;
}
}
}
}
LEAN_EXPORT lean_object* l_List_forIn_x27_loop___at___00main_spec__3___redArg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
lean_object* x_4;
x_4 = l_List_forIn_x27_loop___at___00main_spec__3___redArg(x_1, x_2);
return x_4;
}
}
LEAN_EXPORT lean_object* l_List_mapM_loop___at___00main_spec__6(lean_object* x_1, lean_object* x_2) {
_start:
{
if (lean_obj_tag(x_1) == 0)
{
lean_object* x_4; lean_object* x_5;
x_4 = l_List_reverse___redArg(x_2);
x_5 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_5, 0, x_4);
return x_5;
}
else
{
uint8_t x_6;
x_6 = !lean_is_exclusive(x_1);
if (x_6 == 0)
{
lean_object* x_7; lean_object* x_8; lean_object* x_9; uint8_t x_10;
x_7 = lean_ctor_get(x_1, 0);
x_8 = lean_ctor_get(x_1, 1);
lean_inc(x_7);
x_9 = l_String_toName(x_7);
x_10 = l_Lean_Name_isAnonymous(x_9);
if (x_10 == 0)
{
lean_dec(x_7);
lean_ctor_set(x_1, 1, x_2);
lean_ctor_set(x_1, 0, x_9);
{
lean_object* _tmp_0 = x_8;
lean_object* _tmp_1 = x_1;
x_1 = _tmp_0;
x_2 = _tmp_1;
}
goto _start;
}
else
{
lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15;
lean_dec(x_9);
lean_free_object(x_1);
lean_dec(x_8);
lean_dec(x_2);
x_12 = ((lean_object*)(l_List_mapM_loop___at___00main_spec__6___closed__0));
x_13 = lean_string_append(x_12, x_7);
lean_dec(x_7);
x_14 = lean_alloc_ctor(18, 1, 0);
lean_ctor_set(x_14, 0, x_13);
x_15 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_15, 0, x_14);
return x_15;
}
}
else
{
lean_object* x_16; lean_object* x_17; lean_object* x_18; uint8_t x_19;
x_16 = lean_ctor_get(x_1, 0);
x_17 = lean_ctor_get(x_1, 1);
lean_inc(x_17);
lean_inc(x_16);
lean_dec(x_1);
lean_inc(x_16);
x_18 = l_String_toName(x_16);
x_19 = l_Lean_Name_isAnonymous(x_18);
if (x_19 == 0)
{
lean_object* x_20;
lean_dec(x_16);
x_20 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_20, 0, x_18);
lean_ctor_set(x_20, 1, x_2);
x_1 = x_17;
x_2 = x_20;
goto _start;
}
else
{
lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25;
lean_dec(x_18);
lean_dec(x_17);
lean_dec(x_2);
x_22 = ((lean_object*)(l_List_mapM_loop___at___00main_spec__6___closed__0));
x_23 = lean_string_append(x_22, x_16);
lean_dec(x_16);
x_24 = lean_alloc_ctor(18, 1, 0);
lean_ctor_set(x_24, 0, x_23);
x_25 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_25, 0, x_24);
return x_25;
}
}
}
}
}
LEAN_EXPORT lean_object* l_List_mapM_loop___at___00main_spec__6___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
lean_object* x_4;
x_4 = l_List_mapM_loop___at___00main_spec__6(x_1, x_2);
return x_4;
}
}
LEAN_EXPORT lean_object* l_List_forIn_x27_loop___at___00main_spec__5___redArg(uint8_t x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
if (lean_obj_tag(x_2) == 0)
{
lean_object* x_5;
x_5 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_5, 0, x_3);
return x_5;
}
else
{
lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9;
x_6 = lean_ctor_get(x_2, 0);
lean_inc(x_6);
x_7 = lean_ctor_get(x_2, 1);
lean_inc(x_7);
lean_dec_ref(x_2);
x_8 = lean_box(0);
if (x_1 == 0)
{
x_9 = lean_box(0);
goto block_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;
x_13 = ((lean_object*)(l_List_forIn_x27_loop___at___00main_spec__5___redArg___closed__0));
lean_inc(x_6);
x_14 = l_Lean_Name_toStringWithToken___at___00Lean_Name_toString_spec__0(x_6, x_1);
x_15 = lean_string_append(x_13, x_14);
lean_dec_ref(x_14);
x_16 = ((lean_object*)(l_List_forIn_x27_loop___at___00main_spec__5___redArg___closed__1));
x_17 = lean_string_append(x_15, x_16);
x_18 = l_IO_println___at___00__private_Lean_Language_Basic_0__Lean_Language_reportMessages_spec__3(x_17);
if (lean_obj_tag(x_18) == 0)
{
lean_dec_ref(x_18);
x_9 = lean_box(0);
goto block_12;
}
else
{
lean_dec(x_7);
lean_dec(x_6);
return x_18;
}
}
block_12:
{
lean_object* x_10;
x_10 = l_replayFromFresh(x_6);
if (lean_obj_tag(x_10) == 0)
{
lean_dec_ref(x_10);
x_2 = x_7;
x_3 = x_8;
goto _start;
}
else
{
lean_dec(x_7);
return x_10;
}
}
}
}
}
LEAN_EXPORT lean_object* l_List_forIn_x27_loop___at___00main_spec__5___redArg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
uint8_t x_5; lean_object* x_6;
x_5 = lean_unbox(x_1);
x_6 = l_List_forIn_x27_loop___at___00main_spec__5___redArg(x_5, x_2, x_3);
return x_6;
}
}
static lean_object* _init_l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_spec__1___closed__0() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = lean_alloc_closure((void*)(l_instDecidableEqString___boxed), 2, 0);
x_2 = lean_alloc_closure((void*)(l_instBEqOfDecidableEq___redArg___lam__0___boxed), 3, 1);
lean_closure_set(x_2, 0, x_1);
return x_2;
}
}
LEAN_EXPORT lean_object* l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_spec__1(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:
{
lean_object* x_9; lean_object* x_10; uint8_t x_15;
x_15 = lean_usize_dec_lt(x_6, x_5);
if (x_15 == 0)
{
lean_object* x_16;
lean_dec(x_3);
lean_dec(x_1);
x_16 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_16, 0, x_7);
return x_16;
}
else
{
lean_object* x_17; lean_object* x_18;
x_17 = lean_array_uget(x_4, x_6);
lean_inc(x_1);
x_18 = l_Lean_searchModuleNameOfFileName(x_17, x_1);
if (lean_obj_tag(x_18) == 0)
{
lean_object* x_19; lean_object* x_20;
x_19 = lean_ctor_get(x_18, 0);
lean_inc(x_19);
lean_dec_ref(x_18);
if (lean_obj_tag(x_19) == 1)
{
lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_34; lean_object* x_35; uint8_t x_36;
x_24 = lean_ctor_get(x_7, 0);
lean_inc(x_24);
x_25 = lean_ctor_get(x_7, 1);
lean_inc(x_25);
if (lean_is_exclusive(x_7)) {
lean_ctor_release(x_7, 0);
lean_ctor_release(x_7, 1);
x_26 = x_7;
} else {
lean_dec_ref(x_7);
x_26 = lean_box(0);
}
x_27 = lean_ctor_get(x_19, 0);
lean_inc(x_27);
lean_dec_ref(x_19);
x_34 = l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_spec__1___closed__0;
x_35 = ((lean_object*)(l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_spec__1___closed__1));
lean_inc(x_3);
x_36 = l_List_elem___redArg(x_34, x_35, x_3);
if (x_36 == 0)
{
uint8_t x_37;
x_37 = l_Lean_Name_isPrefixOf(x_2, x_27);
if (x_37 == 0)
{
goto block_33;
}
else
{
lean_dec(x_26);
lean_dec(x_24);
goto block_30;
}
}
else
{
goto block_33;
}
block_30:
{
uint8_t x_28;
x_28 = l_List_elem___at___00Lean_addAliasEntry_spec__2(x_27, x_25);
if (x_28 == 0)
{
lean_object* x_29;
x_29 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_29, 0, x_27);
lean_ctor_set(x_29, 1, x_25);
x_20 = x_29;
goto block_23;
}
else
{
lean_dec(x_27);
x_20 = x_25;
goto block_23;
}
}
block_33:
{
uint8_t x_31;
x_31 = lean_name_eq(x_2, x_27);
if (x_31 == 0)
{
lean_object* x_32;
lean_dec(x_27);
if (lean_is_scalar(x_26)) {
x_32 = lean_alloc_ctor(0, 2, 0);
} else {
x_32 = x_26;
}
lean_ctor_set(x_32, 0, x_24);
lean_ctor_set(x_32, 1, x_25);
x_9 = x_32;
x_10 = lean_box(0);
goto block_14;
}
else
{
lean_dec(x_26);
lean_dec(x_24);
goto block_30;
}
}
}
else
{
uint8_t x_38;
lean_dec(x_19);
x_38 = !lean_is_exclusive(x_7);
if (x_38 == 0)
{
x_9 = x_7;
x_10 = lean_box(0);
goto block_14;
}
else
{
lean_object* x_39; lean_object* x_40; lean_object* x_41;
x_39 = lean_ctor_get(x_7, 0);
x_40 = lean_ctor_get(x_7, 1);
lean_inc(x_40);
lean_inc(x_39);
lean_dec(x_7);
x_41 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_41, 0, x_39);
lean_ctor_set(x_41, 1, x_40);
x_9 = x_41;
x_10 = lean_box(0);
goto block_14;
}
}
block_23:
{
lean_object* x_21; lean_object* x_22;
x_21 = lean_box(x_15);
x_22 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_22, 0, x_21);
lean_ctor_set(x_22, 1, x_20);
x_9 = x_22;
x_10 = lean_box(0);
goto block_14;
}
}
else
{
uint8_t x_42;
lean_dec_ref(x_7);
lean_dec(x_3);
lean_dec(x_1);
x_42 = !lean_is_exclusive(x_18);
if (x_42 == 0)
{
return x_18;
}
else
{
lean_object* x_43; lean_object* x_44;
x_43 = lean_ctor_get(x_18, 0);
lean_inc(x_43);
lean_dec(x_18);
x_44 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_44, 0, x_43);
return x_44;
}
}
}
block_14:
{
size_t x_11; size_t x_12;
x_11 = 1;
x_12 = lean_usize_add(x_6, x_11);
x_6 = x_12;
x_7 = x_9;
goto _start;
}
}
}
LEAN_EXPORT lean_object* l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_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:
{
size_t x_9; size_t x_10; lean_object* x_11;
x_9 = lean_unbox_usize(x_5);
lean_dec(x_5);
x_10 = lean_unbox_usize(x_6);
lean_dec(x_6);
x_11 = l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_spec__1(x_1, x_2, x_3, x_4, x_9, x_10, x_7);
lean_dec_ref(x_4);
lean_dec(x_2);
return x_11;
}
}
LEAN_EXPORT lean_object* l_List_forIn_x27_loop___at___00main_spec__2___redArg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
if (lean_obj_tag(x_3) == 0)
{
lean_object* x_6;
lean_dec(x_2);
lean_dec(x_1);
x_6 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_6, 0, x_4);
return x_6;
}
else
{
uint8_t x_7;
x_7 = !lean_is_exclusive(x_3);
if (x_7 == 0)
{
lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11;
x_8 = lean_ctor_get(x_3, 0);
x_9 = lean_ctor_get(x_3, 1);
x_10 = ((lean_object*)(l_List_forIn_x27_loop___at___00main_spec__2___redArg___closed__0));
lean_inc(x_1);
x_11 = l_Lean_SearchPath_findAllWithExt(x_1, x_10);
if (lean_obj_tag(x_11) == 0)
{
lean_object* x_12; uint8_t x_13; lean_object* x_14; size_t x_15; size_t x_16; lean_object* x_17;
x_12 = lean_ctor_get(x_11, 0);
lean_inc(x_12);
lean_dec_ref(x_11);
x_13 = 0;
x_14 = lean_box(x_13);
lean_ctor_set_tag(x_3, 0);
lean_ctor_set(x_3, 1, x_4);
lean_ctor_set(x_3, 0, x_14);
x_15 = lean_array_size(x_12);
x_16 = 0;
lean_inc(x_2);
lean_inc(x_1);
x_17 = l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_spec__1(x_1, x_8, x_2, x_12, x_15, x_16, x_3);
lean_dec(x_12);
if (lean_obj_tag(x_17) == 0)
{
uint8_t x_18;
x_18 = !lean_is_exclusive(x_17);
if (x_18 == 0)
{
lean_object* x_19; lean_object* x_20; uint8_t x_21;
x_19 = lean_ctor_get(x_17, 0);
x_20 = lean_ctor_get(x_19, 0);
x_21 = lean_unbox(x_20);
if (x_21 == 0)
{
uint8_t x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26;
lean_dec(x_19);
lean_dec(x_9);
lean_dec(x_2);
lean_dec(x_1);
x_22 = 1;
x_23 = ((lean_object*)(l_List_forIn_x27_loop___at___00main_spec__2___redArg___closed__1));
x_24 = l_Lean_Name_toStringWithToken___at___00Lean_Name_toString_spec__0(x_8, x_22);
x_25 = lean_string_append(x_23, x_24);
lean_dec_ref(x_24);
x_26 = lean_alloc_ctor(18, 1, 0);
lean_ctor_set(x_26, 0, x_25);
lean_ctor_set_tag(x_17, 1);
lean_ctor_set(x_17, 0, x_26);
return x_17;
}
else
{
lean_object* x_27;
lean_free_object(x_17);
lean_dec(x_8);
x_27 = lean_ctor_get(x_19, 1);
lean_inc(x_27);
lean_dec(x_19);
x_3 = x_9;
x_4 = x_27;
goto _start;
}
}
else
{
lean_object* x_29; lean_object* x_30; uint8_t x_31;
x_29 = lean_ctor_get(x_17, 0);
lean_inc(x_29);
lean_dec(x_17);
x_30 = lean_ctor_get(x_29, 0);
x_31 = lean_unbox(x_30);
if (x_31 == 0)
{
uint8_t x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37;
lean_dec(x_29);
lean_dec(x_9);
lean_dec(x_2);
lean_dec(x_1);
x_32 = 1;
x_33 = ((lean_object*)(l_List_forIn_x27_loop___at___00main_spec__2___redArg___closed__1));
x_34 = l_Lean_Name_toStringWithToken___at___00Lean_Name_toString_spec__0(x_8, x_32);
x_35 = lean_string_append(x_33, x_34);
lean_dec_ref(x_34);
x_36 = lean_alloc_ctor(18, 1, 0);
lean_ctor_set(x_36, 0, x_35);
x_37 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_37, 0, x_36);
return x_37;
}
else
{
lean_object* x_38;
lean_dec(x_8);
x_38 = lean_ctor_get(x_29, 1);
lean_inc(x_38);
lean_dec(x_29);
x_3 = x_9;
x_4 = x_38;
goto _start;
}
}
}
else
{
uint8_t x_40;
lean_dec(x_9);
lean_dec(x_8);
lean_dec(x_2);
lean_dec(x_1);
x_40 = !lean_is_exclusive(x_17);
if (x_40 == 0)
{
return x_17;
}
else
{
lean_object* x_41; lean_object* x_42;
x_41 = lean_ctor_get(x_17, 0);
lean_inc(x_41);
lean_dec(x_17);
x_42 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_42, 0, x_41);
return x_42;
}
}
}
else
{
uint8_t x_43;
lean_free_object(x_3);
lean_dec(x_9);
lean_dec(x_8);
lean_dec(x_4);
lean_dec(x_2);
lean_dec(x_1);
x_43 = !lean_is_exclusive(x_11);
if (x_43 == 0)
{
return x_11;
}
else
{
lean_object* x_44; lean_object* x_45;
x_44 = lean_ctor_get(x_11, 0);
lean_inc(x_44);
lean_dec(x_11);
x_45 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_45, 0, x_44);
return x_45;
}
}
}
else
{
lean_object* x_46; lean_object* x_47; lean_object* x_48; lean_object* x_49;
x_46 = lean_ctor_get(x_3, 0);
x_47 = lean_ctor_get(x_3, 1);
lean_inc(x_47);
lean_inc(x_46);
lean_dec(x_3);
x_48 = ((lean_object*)(l_List_forIn_x27_loop___at___00main_spec__2___redArg___closed__0));
lean_inc(x_1);
x_49 = l_Lean_SearchPath_findAllWithExt(x_1, x_48);
if (lean_obj_tag(x_49) == 0)
{
lean_object* x_50; uint8_t x_51; lean_object* x_52; lean_object* x_53; size_t x_54; size_t x_55; lean_object* x_56;
x_50 = lean_ctor_get(x_49, 0);
lean_inc(x_50);
lean_dec_ref(x_49);
x_51 = 0;
x_52 = lean_box(x_51);
x_53 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_53, 0, x_52);
lean_ctor_set(x_53, 1, x_4);
x_54 = lean_array_size(x_50);
x_55 = 0;
lean_inc(x_2);
lean_inc(x_1);
x_56 = l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_spec__1(x_1, x_46, x_2, x_50, x_54, x_55, x_53);
lean_dec(x_50);
if (lean_obj_tag(x_56) == 0)
{
lean_object* x_57; lean_object* x_58; lean_object* x_59; uint8_t x_60;
x_57 = lean_ctor_get(x_56, 0);
lean_inc(x_57);
if (lean_is_exclusive(x_56)) {
lean_ctor_release(x_56, 0);
x_58 = x_56;
} else {
lean_dec_ref(x_56);
x_58 = lean_box(0);
}
x_59 = lean_ctor_get(x_57, 0);
x_60 = lean_unbox(x_59);
if (x_60 == 0)
{
uint8_t x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66;
lean_dec(x_57);
lean_dec(x_47);
lean_dec(x_2);
lean_dec(x_1);
x_61 = 1;
x_62 = ((lean_object*)(l_List_forIn_x27_loop___at___00main_spec__2___redArg___closed__1));
x_63 = l_Lean_Name_toStringWithToken___at___00Lean_Name_toString_spec__0(x_46, x_61);
x_64 = lean_string_append(x_62, x_63);
lean_dec_ref(x_63);
x_65 = lean_alloc_ctor(18, 1, 0);
lean_ctor_set(x_65, 0, x_64);
if (lean_is_scalar(x_58)) {
x_66 = lean_alloc_ctor(1, 1, 0);
} else {
x_66 = x_58;
lean_ctor_set_tag(x_66, 1);
}
lean_ctor_set(x_66, 0, x_65);
return x_66;
}
else
{
lean_object* x_67;
lean_dec(x_58);
lean_dec(x_46);
x_67 = lean_ctor_get(x_57, 1);
lean_inc(x_67);
lean_dec(x_57);
x_3 = x_47;
x_4 = x_67;
goto _start;
}
}
else
{
lean_object* x_69; lean_object* x_70; lean_object* x_71;
lean_dec(x_47);
lean_dec(x_46);
lean_dec(x_2);
lean_dec(x_1);
x_69 = lean_ctor_get(x_56, 0);
lean_inc(x_69);
if (lean_is_exclusive(x_56)) {
lean_ctor_release(x_56, 0);
x_70 = x_56;
} else {
lean_dec_ref(x_56);
x_70 = lean_box(0);
}
if (lean_is_scalar(x_70)) {
x_71 = lean_alloc_ctor(1, 1, 0);
} else {
x_71 = x_70;
}
lean_ctor_set(x_71, 0, x_69);
return x_71;
}
}
else
{
lean_object* x_72; lean_object* x_73; lean_object* x_74;
lean_dec(x_47);
lean_dec(x_46);
lean_dec(x_4);
lean_dec(x_2);
lean_dec(x_1);
x_72 = lean_ctor_get(x_49, 0);
lean_inc(x_72);
if (lean_is_exclusive(x_49)) {
lean_ctor_release(x_49, 0);
x_73 = x_49;
} else {
lean_dec_ref(x_49);
x_73 = lean_box(0);
}
if (lean_is_scalar(x_73)) {
x_74 = lean_alloc_ctor(1, 1, 0);
} else {
x_74 = x_73;
}
lean_ctor_set(x_74, 0, x_72);
return x_74;
}
}
}
}
}
LEAN_EXPORT lean_object* l_List_forIn_x27_loop___at___00main_spec__2___redArg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
_start:
{
lean_object* x_6;
x_6 = l_List_forIn_x27_loop___at___00main_spec__2___redArg(x_1, x_2, x_3, x_4);
return x_6;
}
}
LEAN_EXPORT lean_object* l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_spec__4(uint8_t x_1, lean_object* x_2, size_t x_3, size_t x_4, lean_object* x_5) {
_start:
{
uint8_t x_7;
x_7 = lean_usize_dec_lt(x_4, x_3);
if (x_7 == 0)
{
lean_object* x_8;
x_8 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_8, 0, x_5);
return x_8;
}
else
{
lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13;
x_9 = lean_array_uget(x_2, x_4);
x_10 = lean_ctor_get(x_9, 0);
lean_inc(x_10);
x_11 = lean_ctor_get(x_9, 1);
lean_inc(x_11);
lean_dec(x_9);
x_12 = lean_box(0);
if (x_1 == 0)
{
x_13 = lean_box(0);
goto block_26;
}
else
{
lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30;
x_27 = ((lean_object*)(l_List_forIn_x27_loop___at___00main_spec__5___redArg___closed__0));
lean_inc(x_10);
x_28 = l_Lean_Name_toStringWithToken___at___00Lean_Name_toString_spec__0(x_10, x_1);
x_29 = lean_string_append(x_27, x_28);
lean_dec_ref(x_28);
x_30 = l_IO_println___at___00__private_Lean_Language_Basic_0__Lean_Language_reportMessages_spec__3(x_29);
if (lean_obj_tag(x_30) == 0)
{
lean_dec_ref(x_30);
x_13 = lean_box(0);
goto block_26;
}
else
{
lean_dec(x_11);
lean_dec(x_10);
return x_30;
}
}
block_26:
{
lean_object* x_14;
x_14 = lean_task_get_own(x_11);
if (lean_obj_tag(x_14) == 0)
{
lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19;
x_15 = lean_ctor_get(x_14, 0);
lean_inc(x_15);
lean_dec_ref(x_14);
x_16 = ((lean_object*)(l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_spec__4___closed__0));
x_17 = l_Lean_Name_toStringWithToken___at___00Lean_Name_toString_spec__0(x_10, x_7);
x_18 = lean_string_append(x_16, x_17);
lean_dec_ref(x_17);
x_19 = l_IO_eprintln___at___00__private_Init_System_IO_0__IO_eprintlnAux_spec__0(x_18);
if (lean_obj_tag(x_19) == 0)
{
uint8_t x_20;
x_20 = !lean_is_exclusive(x_19);
if (x_20 == 0)
{
lean_object* x_21;
x_21 = lean_ctor_get(x_19, 0);
lean_dec(x_21);
lean_ctor_set_tag(x_19, 1);
lean_ctor_set(x_19, 0, x_15);
return x_19;
}
else
{
lean_object* x_22;
lean_dec(x_19);
x_22 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_22, 0, x_15);
return x_22;
}
}
else
{
lean_dec(x_15);
return x_19;
}
}
else
{
size_t x_23; size_t x_24;
lean_dec(x_14);
lean_dec(x_10);
x_23 = 1;
x_24 = lean_usize_add(x_4, x_23);
x_4 = x_24;
x_5 = x_12;
goto _start;
}
}
}
}
}
LEAN_EXPORT lean_object* l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_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) {
_start:
{
uint8_t x_7; size_t x_8; size_t x_9; lean_object* x_10;
x_7 = lean_unbox(x_1);
x_8 = lean_unbox_usize(x_3);
lean_dec(x_3);
x_9 = lean_unbox_usize(x_4);
lean_dec(x_4);
x_10 = l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_spec__4(x_7, x_2, x_8, x_9, x_5);
lean_dec_ref(x_2);
return x_10;
}
}
static lean_object* _init_l_main___closed__2() {
_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_main___boxed__const__1() {
_start:
{
uint32_t x_1; lean_object* x_2;
x_1 = 0;
x_2 = lean_box_uint32(x_1);
return x_2;
}
}
LEAN_EXPORT lean_object* _lean_main(lean_object* x_1) {
_start:
{
lean_object* x_3; lean_object* x_7; lean_object* x_8;
x_7 = ((lean_object*)(l_main___closed__0));
x_8 = l_Lean_findSysroot(x_7);
if (lean_obj_tag(x_8) == 0)
{
lean_object* x_9; lean_object* x_10; lean_object* x_11;
x_9 = lean_ctor_get(x_8, 0);
lean_inc(x_9);
lean_dec_ref(x_8);
x_10 = lean_box(0);
x_11 = l_Lean_initSearchPath(x_9, x_10);
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; uint8_t x_18; lean_object* x_19; lean_object* x_20; uint8_t x_86; lean_object* x_99; uint8_t x_100;
lean_dec_ref(x_11);
x_12 = ((lean_object*)(l_main___closed__1));
x_13 = l_List_partition_loop___at___00main_spec__0(x_1, x_12);
x_14 = lean_ctor_get(x_13, 0);
lean_inc(x_14);
x_15 = lean_ctor_get(x_13, 1);
lean_inc(x_15);
if (lean_is_exclusive(x_13)) {
lean_ctor_release(x_13, 0);
lean_ctor_release(x_13, 1);
x_16 = x_13;
} else {
lean_dec_ref(x_13);
x_16 = lean_box(0);
}
x_17 = l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_spec__1___closed__0;
x_99 = ((lean_object*)(l_main___closed__4));
lean_inc(x_14);
x_100 = l_List_elem___redArg(x_17, x_99, x_14);
if (x_100 == 0)
{
lean_object* x_101; uint8_t x_102;
x_101 = ((lean_object*)(l_main___closed__5));
lean_inc(x_14);
x_102 = l_List_elem___redArg(x_17, x_101, x_14);
x_86 = x_102;
goto block_98;
}
else
{
x_86 = x_100;
goto block_98;
}
block_85:
{
lean_object* x_21; lean_object* x_22; lean_object* x_23;
x_21 = l_Lean_searchPathRef;
x_22 = lean_st_ref_get(x_21);
lean_inc(x_14);
x_23 = l_List_forIn_x27_loop___at___00main_spec__2___redArg(x_22, x_14, x_19, x_10);
if (lean_obj_tag(x_23) == 0)
{
uint8_t x_24;
x_24 = !lean_is_exclusive(x_23);
if (x_24 == 0)
{
lean_object* x_25; lean_object* x_26; uint8_t x_27;
x_25 = lean_ctor_get(x_23, 0);
x_26 = ((lean_object*)(l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_spec__1___closed__1));
x_27 = l_List_elem___redArg(x_17, x_26, x_14);
if (x_27 == 0)
{
lean_object* x_28; lean_object* x_29;
lean_free_object(x_23);
x_28 = l_main___closed__2;
x_29 = l_List_forIn_x27_loop___at___00main_spec__3___redArg(x_25, x_28);
if (lean_obj_tag(x_29) == 0)
{
lean_object* x_30; lean_object* x_31; size_t x_32; size_t x_33; lean_object* x_34;
x_30 = lean_ctor_get(x_29, 0);
lean_inc(x_30);
lean_dec_ref(x_29);
x_31 = lean_box(0);
x_32 = lean_array_size(x_30);
x_33 = 0;
x_34 = l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_spec__4(x_18, x_30, x_32, x_33, x_31);
lean_dec(x_30);
if (lean_obj_tag(x_34) == 0)
{
lean_dec_ref(x_34);
x_3 = lean_box(0);
goto block_6;
}
else
{
uint8_t x_35;
x_35 = !lean_is_exclusive(x_34);
if (x_35 == 0)
{
return x_34;
}
else
{
lean_object* x_36; lean_object* x_37;
x_36 = lean_ctor_get(x_34, 0);
lean_inc(x_36);
lean_dec(x_34);
x_37 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_37, 0, x_36);
return x_37;
}
}
}
else
{
uint8_t x_38;
x_38 = !lean_is_exclusive(x_29);
if (x_38 == 0)
{
return x_29;
}
else
{
lean_object* x_39; lean_object* x_40;
x_39 = lean_ctor_get(x_29, 0);
lean_inc(x_39);
lean_dec(x_29);
x_40 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_40, 0, x_39);
return x_40;
}
}
}
else
{
lean_object* x_41; lean_object* x_42; uint8_t x_43;
x_41 = l_List_lengthTR___redArg(x_25);
x_42 = lean_unsigned_to_nat(1u);
x_43 = lean_nat_dec_eq(x_41, x_42);
lean_dec(x_41);
if (x_43 == 0)
{
lean_object* x_44; lean_object* x_45; lean_object* x_46; lean_object* x_47;
x_44 = ((lean_object*)(l_main___closed__3));
x_45 = l_List_toString___at___00Lean_Environment_AddConstAsyncResult_commitConst_spec__1(x_25);
x_46 = lean_string_append(x_44, x_45);
lean_dec_ref(x_45);
x_47 = lean_alloc_ctor(18, 1, 0);
lean_ctor_set(x_47, 0, x_46);
lean_ctor_set_tag(x_23, 1);
lean_ctor_set(x_23, 0, x_47);
return x_23;
}
else
{
lean_object* x_48; lean_object* x_49;
lean_free_object(x_23);
x_48 = lean_box(0);
x_49 = l_List_forIn_x27_loop___at___00main_spec__5___redArg(x_18, x_25, x_48);
if (lean_obj_tag(x_49) == 0)
{
lean_dec_ref(x_49);
x_3 = lean_box(0);
goto block_6;
}
else
{
uint8_t x_50;
x_50 = !lean_is_exclusive(x_49);
if (x_50 == 0)
{
return x_49;
}
else
{
lean_object* x_51; lean_object* x_52;
x_51 = lean_ctor_get(x_49, 0);
lean_inc(x_51);
lean_dec(x_49);
x_52 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_52, 0, x_51);
return x_52;
}
}
}
}
}
else
{
lean_object* x_53; lean_object* x_54; uint8_t x_55;
x_53 = lean_ctor_get(x_23, 0);
lean_inc(x_53);
lean_dec(x_23);
x_54 = ((lean_object*)(l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_spec__1___closed__1));
x_55 = l_List_elem___redArg(x_17, x_54, x_14);
if (x_55 == 0)
{
lean_object* x_56; lean_object* x_57;
x_56 = l_main___closed__2;
x_57 = l_List_forIn_x27_loop___at___00main_spec__3___redArg(x_53, x_56);
if (lean_obj_tag(x_57) == 0)
{
lean_object* x_58; lean_object* x_59; size_t x_60; size_t x_61; lean_object* x_62;
x_58 = lean_ctor_get(x_57, 0);
lean_inc(x_58);
lean_dec_ref(x_57);
x_59 = lean_box(0);
x_60 = lean_array_size(x_58);
x_61 = 0;
x_62 = l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_spec__4(x_18, x_58, x_60, x_61, x_59);
lean_dec(x_58);
if (lean_obj_tag(x_62) == 0)
{
lean_dec_ref(x_62);
x_3 = lean_box(0);
goto block_6;
}
else
{
lean_object* x_63; lean_object* x_64; lean_object* x_65;
x_63 = lean_ctor_get(x_62, 0);
lean_inc(x_63);
if (lean_is_exclusive(x_62)) {
lean_ctor_release(x_62, 0);
x_64 = x_62;
} else {
lean_dec_ref(x_62);
x_64 = lean_box(0);
}
if (lean_is_scalar(x_64)) {
x_65 = lean_alloc_ctor(1, 1, 0);
} else {
x_65 = x_64;
}
lean_ctor_set(x_65, 0, x_63);
return x_65;
}
}
else
{
lean_object* x_66; lean_object* x_67; lean_object* x_68;
x_66 = lean_ctor_get(x_57, 0);
lean_inc(x_66);
if (lean_is_exclusive(x_57)) {
lean_ctor_release(x_57, 0);
x_67 = x_57;
} else {
lean_dec_ref(x_57);
x_67 = lean_box(0);
}
if (lean_is_scalar(x_67)) {
x_68 = lean_alloc_ctor(1, 1, 0);
} else {
x_68 = x_67;
}
lean_ctor_set(x_68, 0, x_66);
return x_68;
}
}
else
{
lean_object* x_69; lean_object* x_70; uint8_t x_71;
x_69 = l_List_lengthTR___redArg(x_53);
x_70 = lean_unsigned_to_nat(1u);
x_71 = lean_nat_dec_eq(x_69, x_70);
lean_dec(x_69);
if (x_71 == 0)
{
lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76;
x_72 = ((lean_object*)(l_main___closed__3));
x_73 = l_List_toString___at___00Lean_Environment_AddConstAsyncResult_commitConst_spec__1(x_53);
x_74 = lean_string_append(x_72, x_73);
lean_dec_ref(x_73);
x_75 = lean_alloc_ctor(18, 1, 0);
lean_ctor_set(x_75, 0, x_74);
x_76 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_76, 0, x_75);
return x_76;
}
else
{
lean_object* x_77; lean_object* x_78;
x_77 = lean_box(0);
x_78 = l_List_forIn_x27_loop___at___00main_spec__5___redArg(x_18, x_53, x_77);
if (lean_obj_tag(x_78) == 0)
{
lean_dec_ref(x_78);
x_3 = lean_box(0);
goto block_6;
}
else
{
lean_object* x_79; lean_object* x_80; lean_object* x_81;
x_79 = lean_ctor_get(x_78, 0);
lean_inc(x_79);
if (lean_is_exclusive(x_78)) {
lean_ctor_release(x_78, 0);
x_80 = x_78;
} else {
lean_dec_ref(x_78);
x_80 = lean_box(0);
}
if (lean_is_scalar(x_80)) {
x_81 = lean_alloc_ctor(1, 1, 0);
} else {
x_81 = x_80;
}
lean_ctor_set(x_81, 0, x_79);
return x_81;
}
}
}
}
}
else
{
uint8_t x_82;
lean_dec(x_14);
x_82 = !lean_is_exclusive(x_23);
if (x_82 == 0)
{
return x_23;
}
else
{
lean_object* x_83; lean_object* x_84;
x_83 = lean_ctor_get(x_23, 0);
lean_inc(x_83);
lean_dec(x_23);
x_84 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_84, 0, x_83);
return x_84;
}
}
}
block_98:
{
if (lean_obj_tag(x_15) == 0)
{
lean_object* x_87;
x_87 = l_getCurrentModule();
if (lean_obj_tag(x_87) == 0)
{
lean_object* x_88; lean_object* x_89;
x_88 = lean_ctor_get(x_87, 0);
lean_inc(x_88);
lean_dec_ref(x_87);
if (lean_is_scalar(x_16)) {
x_89 = lean_alloc_ctor(1, 2, 0);
} else {
x_89 = x_16;
lean_ctor_set_tag(x_89, 1);
}
lean_ctor_set(x_89, 0, x_88);
lean_ctor_set(x_89, 1, x_10);
x_18 = x_86;
x_19 = x_89;
x_20 = lean_box(0);
goto block_85;
}
else
{
uint8_t x_90;
lean_dec(x_16);
lean_dec(x_14);
x_90 = !lean_is_exclusive(x_87);
if (x_90 == 0)
{
return x_87;
}
else
{
lean_object* x_91; lean_object* x_92;
x_91 = lean_ctor_get(x_87, 0);
lean_inc(x_91);
lean_dec(x_87);
x_92 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_92, 0, x_91);
return x_92;
}
}
}
else
{
lean_object* x_93;
lean_dec(x_16);
x_93 = l_List_mapM_loop___at___00main_spec__6(x_15, x_10);
if (lean_obj_tag(x_93) == 0)
{
lean_object* x_94;
x_94 = lean_ctor_get(x_93, 0);
lean_inc(x_94);
lean_dec_ref(x_93);
x_18 = x_86;
x_19 = x_94;
x_20 = lean_box(0);
goto block_85;
}
else
{
uint8_t x_95;
lean_dec(x_14);
x_95 = !lean_is_exclusive(x_93);
if (x_95 == 0)
{
return x_93;
}
else
{
lean_object* x_96; lean_object* x_97;
x_96 = lean_ctor_get(x_93, 0);
lean_inc(x_96);
lean_dec(x_93);
x_97 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_97, 0, x_96);
return x_97;
}
}
}
}
}
else
{
uint8_t x_103;
lean_dec(x_1);
x_103 = !lean_is_exclusive(x_11);
if (x_103 == 0)
{
return x_11;
}
else
{
lean_object* x_104; lean_object* x_105;
x_104 = lean_ctor_get(x_11, 0);
lean_inc(x_104);
lean_dec(x_11);
x_105 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_105, 0, x_104);
return x_105;
}
}
}
else
{
uint8_t x_106;
lean_dec(x_1);
x_106 = !lean_is_exclusive(x_8);
if (x_106 == 0)
{
return x_8;
}
else
{
lean_object* x_107; lean_object* x_108;
x_107 = lean_ctor_get(x_8, 0);
lean_inc(x_107);
lean_dec(x_8);
x_108 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_108, 0, x_107);
return x_108;
}
}
block_6:
{
lean_object* x_4; lean_object* x_5;
x_4 = l_main___boxed__const__1;
x_5 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_5, 0, x_4);
return x_5;
}
}
}
LEAN_EXPORT lean_object* l_main___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3;
x_3 = _lean_main(x_1);
return x_3;
}
}
LEAN_EXPORT lean_object* l_List_forIn_x27_loop___at___00main_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) {
_start:
{
lean_object* x_8;
x_8 = l_List_forIn_x27_loop___at___00main_spec__2___redArg(x_1, x_2, x_4, x_5);
return x_8;
}
}
LEAN_EXPORT lean_object* l_List_forIn_x27_loop___at___00main_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) {
_start:
{
lean_object* x_8;
x_8 = l_List_forIn_x27_loop___at___00main_spec__2(x_1, x_2, x_3, x_4, x_5, x_6);
lean_dec(x_3);
return x_8;
}
}
LEAN_EXPORT lean_object* l_List_forIn_x27_loop___at___00main_spec__3(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
lean_object* x_6;
x_6 = l_List_forIn_x27_loop___at___00main_spec__3___redArg(x_2, x_3);
return x_6;
}
}
LEAN_EXPORT lean_object* l_List_forIn_x27_loop___at___00main_spec__3___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
_start:
{
lean_object* x_6;
x_6 = l_List_forIn_x27_loop___at___00main_spec__3(x_1, x_2, x_3, x_4);
lean_dec(x_1);
return x_6;
}
}
LEAN_EXPORT lean_object* l_List_forIn_x27_loop___at___00main_spec__5(uint8_t x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
_start:
{
lean_object* x_7;
x_7 = l_List_forIn_x27_loop___at___00main_spec__5___redArg(x_1, x_3, x_4);
return x_7;
}
}
LEAN_EXPORT lean_object* l_List_forIn_x27_loop___at___00main_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) {
_start:
{
uint8_t x_7; lean_object* x_8;
x_7 = lean_unbox(x_1);
x_8 = l_List_forIn_x27_loop___at___00main_spec__5(x_7, x_2, x_3, x_4, x_5);
lean_dec(x_2);
return x_8;
}
}
lean_object* initialize_Init(uint8_t builtin);
lean_object* initialize_Lean_CoreM(uint8_t builtin);
lean_object* initialize_Lean_Replay(uint8_t builtin);
lean_object* initialize_LeanChecker_Replay(uint8_t builtin);
lean_object* initialize_Lake_Load_Manifest(uint8_t builtin);
static bool _G_initialized = false;
LEAN_EXPORT lean_object* initialize_LeanChecker(uint8_t builtin) {
lean_object * res;
if (_G_initialized) return lean_io_result_mk_ok(lean_box(0));
_G_initialized = true;
res = initialize_Init(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lean_CoreM(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lean_Replay(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_LeanChecker_Replay(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lake_Load_Manifest(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
l_replayFromImports___closed__0 = _init_l_replayFromImports___closed__0();
lean_mark_persistent(l_replayFromImports___closed__0);
l_replayFromImports___closed__1 = _init_l_replayFromImports___closed__1();
l_replayFromImports___closed__7 = _init_l_replayFromImports___closed__7();
lean_mark_persistent(l_replayFromImports___closed__7);
l_replayFromFresh___closed__1 = _init_l_replayFromFresh___closed__1();
lean_mark_persistent(l_replayFromFresh___closed__1);
l_List_partition_loop___at___00main_spec__0___closed__1 = _init_l_List_partition_loop___at___00main_spec__0___closed__1();
lean_mark_persistent(l_List_partition_loop___at___00main_spec__0___closed__1);
l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_spec__1___closed__0 = _init_l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_spec__1___closed__0();
lean_mark_persistent(l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00main_spec__1___closed__0);
l_main___closed__2 = _init_l_main___closed__2();
lean_mark_persistent(l_main___closed__2);
l_main___boxed__const__1 = _init_l_main___boxed__const__1();
lean_mark_persistent(l_main___boxed__const__1);
return lean_io_result_mk_ok(lean_box(0));
}
char ** lean_setup_args(int argc, char ** argv);
void lean_initialize();
#if defined(WIN32) || defined(_WIN32)
#include <windows.h>
#endif
int main(int argc, char ** argv) {
#if defined(WIN32) || defined(_WIN32)
SetErrorMode(SEM_FAILCRITICALERRORS);
SetConsoleOutputCP(CP_UTF8);
#endif
lean_object* in; lean_object* res;
argv = lean_setup_args(argc, argv);
lean_initialize();
lean_set_panic_messages(false);
res = initialize_LeanChecker(1 /* builtin */);
lean_set_panic_messages(true);
lean_io_mark_end_initialization();
if (lean_io_result_is_ok(res)) {
lean_dec_ref(res);
lean_init_task_manager();
in = lean_box(0);
int i = argc;
while (i > 1) {
lean_object* n;
i--;
n = lean_alloc_ctor(1,2,0); lean_ctor_set(n, 0, lean_mk_string(argv[i])); lean_ctor_set(n, 1, in);
in = n;
}
res = _lean_main(in);
}
lean_finalize_task_manager();
if (lean_io_result_is_ok(res)) {
int ret = lean_unbox_uint32(lean_io_result_get_value(res));
lean_dec_ref(res);
return ret;
} else {
lean_io_result_show_error(res);
lean_dec_ref(res);
return 1;
}
}
#ifdef __cplusplus
}
#endif