// Lean compiler output
// Module: init.lean.compiler.initattr
// Imports: init.lean.environment init.lean.attributes
#include "runtime/object.h"
#include "runtime/apply.h"
typedef lean::object obj;    typedef lean::usize  usize;
typedef lean::uint8  uint8;  typedef lean::uint16 uint16;
typedef lean::uint32 uint32; typedef lean::uint64 uint64;
#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
obj* l___private_init_data_array_qsort_1__partitionAux___main___at_Lean_mkInitAttr___spec__4(obj*, obj*, obj*, obj*, obj*);
extern "C" uint8 lean_name_dec_eq(obj*, obj*);
obj* l___private_init_lean_compiler_initattr_1__getIOTypeArg___main___boxed(obj*);
obj* l_Array_binSearchAux___main___at_Lean_isIOUnitInitFn___spec__3___boxed(obj*, obj*, obj*, obj*);
obj* l_Lean_AttributeImpl_inhabited___lambda__4___boxed(obj*, obj*, obj*);
extern obj* l_Array_empty___closed__1;
namespace lean {
obj* nat_sub(obj*, obj*);
}
obj* l_Lean_mkInitAttr(obj*);
obj* l___private_init_data_array_qsort_1__partitionAux___main___at_Lean_mkInitAttr___spec__4___closed__1;
obj* l_Lean_mkInitAttr___lambda__1___closed__7;
obj* l_Lean_mkInitAttr___lambda__1___closed__2;
obj* l_Lean_registerParametricAttribute___at_Lean_mkInitAttr___spec__1___lambda__1(obj*);
obj* l_Lean_AttributeImpl_inhabited___lambda__3___boxed(obj*, obj*, obj*, obj*);
obj* l_Lean_PersistentEnvExtension_inhabited___rarg___lambda__1___boxed(obj*);
obj* l_Lean_registerParametricAttribute___at_Lean_mkInitAttr___spec__1___lambda__1___boxed(obj*);
obj* l___private_init_lean_compiler_initattr_3__isIOUnit___boxed(obj*);
obj* l_Array_qsortAux___main___at_Lean_mkInitAttr___spec__3___boxed(obj*, obj*, obj*);
namespace lean {
obj* get_init_fn_name_for_core(obj*, obj*);
}
obj* l_Lean_hasInitAttr___boxed(obj*, obj*);
obj* l_Lean_registerAttribute(obj*, obj*);
obj* l_RBNode_fold___main___at_Lean_mkInitAttr___spec__2___boxed(obj*, obj*);
uint8 l_Lean_isIOUnitInitFn(obj*, obj*);
uint8 l___private_init_lean_compiler_initattr_2__isUnitType___main(obj*);
obj* l_Lean_Name_toStringWithSep___main(obj*, obj*);
obj* l_Lean_mkInitAttr___lambda__1___closed__1;
extern obj* l_Lean_Inhabited;
obj* l_Array_qsortAux___main___at_Lean_mkInitAttr___spec__3(obj*, obj*, obj*);
obj* l_Lean_mkInitAttr___lambda__1___closed__8;
extern obj* l_Lean_registerParametricAttribute___rarg___closed__1;
obj* l___private_init_lean_compiler_initattr_1__getIOTypeArg___main___closed__1;
obj* l_Array_mkEmpty(obj*, obj*);
obj* l___private_init_lean_compiler_initattr_1__getIOTypeArg___main(obj*);
obj* l_Array_swap(obj*, obj*, obj*, obj*);
obj* l_Lean_ParametricAttribute_getParam___at_Lean_isIOUnitInitFn___spec__1___boxed(obj*, obj*, obj*);
obj* l_Lean_initAttr;
obj* l_RBNode_fold___main___at_Lean_mkInitAttr___spec__2(obj*, obj*);
uint8 l_Lean_hasInitAttr(obj*, obj*);
obj* l_Lean_AttributeImpl_inhabited___lambda__5(obj*, obj*);
extern "C" uint8 lean_expr_eqv(obj*, obj*);
obj* l_Lean_PersistentEnvExtension_getState___rarg(obj*, obj*);
obj* l_Lean_registerParametricAttribute___at_Lean_mkInitAttr___spec__1___closed__1;
obj* l___private_init_lean_compiler_initattr_1__getIOTypeArg(obj*);
obj* l___private_init_lean_compiler_initattr_2__isUnitType___boxed(obj*);
obj* l_Lean_Environment_getModuleIdxFor(obj*, obj*);
namespace lean {
obj* string_append(obj*, obj*);
}
extern obj* l_Lean_registerParametricAttribute___rarg___closed__2;
namespace lean {
uint8 nat_dec_lt(obj*, obj*);
}
extern obj* l_Lean_registerTagAttribute___closed__6;
extern obj* l_Char_HasRepr___closed__1;
obj* l_Lean_AttributeImpl_inhabited___lambda__1___boxed(obj*, obj*, obj*, obj*, obj*);
extern "C" obj* lean_name_mk_string(obj*, obj*);
obj* l_Lean_mkInitAttr___lambda__1(obj*, obj*, obj*);
namespace lean {
obj* nat_add(obj*, obj*);
}
obj* l_Lean_PersistentEnvExtension_getModuleEntries___rarg(obj*, obj*, obj*);
namespace lean {
uint8 nat_dec_eq(obj*, obj*);
}
obj* l_ExceptT_Monad___rarg___lambda__8___boxed(obj*, obj*);
obj* l_Lean_mkInitAttr___lambda__1___closed__5;
obj* l_Array_push(obj*, obj*, obj*);
uint8 l___private_init_lean_compiler_initattr_2__isUnitType(obj*);
obj* l_Lean_mkInitAttr___closed__3;
obj* l___private_init_data_array_qsort_1__partitionAux___main___at_Lean_mkInitAttr___spec__4___boxed(obj*, obj*, obj*, obj*, obj*);
obj* l_Lean_mkInitAttr___lambda__1___closed__3;
obj* l_Array_binSearchAux___main___at_Lean_isIOUnitInitFn___spec__3(obj*, obj*, obj*, obj*);
obj* l_Lean_ParametricAttribute_getParam___at_Lean_isIOUnitInitFn___spec__1(obj*, obj*, obj*);
obj* l_Lean_registerParametricAttribute___rarg___lambda__4___boxed(obj*, obj*, obj*, obj*, obj*, obj*, obj*, obj*);
obj* l_Lean_registerParametricAttribute___at_Lean_mkInitAttr___spec__1(obj*, obj*, obj*, obj*);
obj* l___private_init_lean_compiler_initattr_2__isUnitType___main___boxed(obj*);
obj* l_Lean_mkInitAttr___lambda__1___closed__6;
obj* l_Lean_registerTagAttribute___lambda__7___boxed(obj*, obj*, obj*, obj*, obj*);
obj* l___private_init_lean_compiler_initattr_2__isUnitType___main___closed__1;
obj* l___private_init_lean_compiler_initattr_1__getIOTypeArg___boxed(obj*);
uint8 l_Lean_Name_quickLt(obj*, obj*);
obj* l_Lean_isIOUnitInitFn___boxed(obj*, obj*);
obj* l_Lean_ParametricAttribute_setParam___rarg(obj*, obj*, obj*, obj*);
obj* l_Lean_ConstantInfo_type(obj*);
namespace lean {
obj* environment_find_core(obj*, obj*);
}
obj* l_RBNode_find___main___at_Lean_isIOUnitInitFn___spec__2___boxed(obj*, obj*);
obj* l_Lean_PersistentEnvExtension_inhabited___rarg___lambda__2___boxed(obj*);
obj* l_Array_size(obj*, obj*);
obj* l_Lean_setInitAttr(obj*, obj*, obj*);
obj* l_Array_get(obj*, obj*, obj*, obj*);
extern obj* l_Lean_registerTagAttribute___closed__5;
extern obj* l_Lean_Name_toString___closed__1;
namespace lean {
uint8 nat_dec_le(obj*, obj*);
}
obj* l_Lean_mkInitAttr___lambda__1___closed__4;
namespace lean {
obj* nat_div(obj*, obj*);
}
obj* l_Lean_AttributeImpl_inhabited___lambda__2___boxed(obj*, obj*, obj*, obj*);
obj* l_Lean_registerPersistentEnvExtensionUnsafe___rarg(obj*, obj*);
uint8 l___private_init_lean_compiler_initattr_3__isIOUnit(obj*);
obj* l_Lean_mkInitAttr___closed__2;
obj* l_Lean_mkInitAttr___closed__1;
extern obj* l_Lean_registerTagAttribute___closed__1;
obj* l_RBNode_find___main___at_Lean_isIOUnitInitFn___spec__2(obj*, obj*);
obj* l_Lean_registerTagAttribute___lambda__6___boxed(obj*, obj*, obj*, obj*, obj*);
obj* _init_l___private_init_lean_compiler_initattr_1__getIOTypeArg___main___closed__1() {
_start:
{
obj* x_1; obj* x_2; obj* x_3; 
x_1 = lean::box(0);
x_2 = lean::mk_string("IO");
x_3 = lean_name_mk_string(x_1, x_2);
return x_3;
}
}
obj* l___private_init_lean_compiler_initattr_1__getIOTypeArg___main(obj* x_1) {
_start:
{
if (lean::obj_tag(x_1) == 5)
{
obj* x_2; 
x_2 = lean::cnstr_get(x_1, 0);
if (lean::obj_tag(x_2) == 4)
{
obj* x_3; obj* x_4; obj* x_5; uint8 x_6; 
x_3 = lean::cnstr_get(x_1, 1);
x_4 = lean::cnstr_get(x_2, 0);
x_5 = l___private_init_lean_compiler_initattr_1__getIOTypeArg___main___closed__1;
x_6 = lean_name_dec_eq(x_4, x_5);
if (x_6 == 0)
{
obj* x_7; 
x_7 = lean::box(0);
return x_7;
}
else
{
obj* x_8; 
lean::inc(x_3);
x_8 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_8, 0, x_3);
return x_8;
}
}
else
{
obj* x_9; 
x_9 = lean::box(0);
return x_9;
}
}
else
{
obj* x_10; 
x_10 = lean::box(0);
return x_10;
}
}
}
obj* l___private_init_lean_compiler_initattr_1__getIOTypeArg___main___boxed(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = l___private_init_lean_compiler_initattr_1__getIOTypeArg___main(x_1);
lean::dec(x_1);
return x_2;
}
}
obj* l___private_init_lean_compiler_initattr_1__getIOTypeArg(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = l___private_init_lean_compiler_initattr_1__getIOTypeArg___main(x_1);
return x_2;
}
}
obj* l___private_init_lean_compiler_initattr_1__getIOTypeArg___boxed(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = l___private_init_lean_compiler_initattr_1__getIOTypeArg(x_1);
lean::dec(x_1);
return x_2;
}
}
obj* _init_l___private_init_lean_compiler_initattr_2__isUnitType___main___closed__1() {
_start:
{
obj* x_1; obj* x_2; obj* x_3; 
x_1 = lean::box(0);
x_2 = lean::mk_string("Unit");
x_3 = lean_name_mk_string(x_1, x_2);
return x_3;
}
}
uint8 l___private_init_lean_compiler_initattr_2__isUnitType___main(obj* x_1) {
_start:
{
if (lean::obj_tag(x_1) == 4)
{
obj* x_2; obj* x_3; uint8 x_4; 
x_2 = lean::cnstr_get(x_1, 0);
x_3 = l___private_init_lean_compiler_initattr_2__isUnitType___main___closed__1;
x_4 = lean_name_dec_eq(x_2, x_3);
if (x_4 == 0)
{
uint8 x_5; 
x_5 = 0;
return x_5;
}
else
{
uint8 x_6; 
x_6 = 1;
return x_6;
}
}
else
{
uint8 x_7; 
x_7 = 0;
return x_7;
}
}
}
obj* l___private_init_lean_compiler_initattr_2__isUnitType___main___boxed(obj* x_1) {
_start:
{
uint8 x_2; obj* x_3; 
x_2 = l___private_init_lean_compiler_initattr_2__isUnitType___main(x_1);
lean::dec(x_1);
x_3 = lean::box(x_2);
return x_3;
}
}
uint8 l___private_init_lean_compiler_initattr_2__isUnitType(obj* x_1) {
_start:
{
uint8 x_2; 
x_2 = l___private_init_lean_compiler_initattr_2__isUnitType___main(x_1);
return x_2;
}
}
obj* l___private_init_lean_compiler_initattr_2__isUnitType___boxed(obj* x_1) {
_start:
{
uint8 x_2; obj* x_3; 
x_2 = l___private_init_lean_compiler_initattr_2__isUnitType(x_1);
lean::dec(x_1);
x_3 = lean::box(x_2);
return x_3;
}
}
uint8 l___private_init_lean_compiler_initattr_3__isIOUnit(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = l___private_init_lean_compiler_initattr_1__getIOTypeArg___main(x_1);
if (lean::obj_tag(x_2) == 0)
{
uint8 x_3; 
x_3 = 0;
return x_3;
}
else
{
obj* x_4; uint8 x_5; 
x_4 = lean::cnstr_get(x_2, 0);
lean::inc(x_4);
lean::dec(x_2);
x_5 = l___private_init_lean_compiler_initattr_2__isUnitType___main(x_4);
lean::dec(x_4);
return x_5;
}
}
}
obj* l___private_init_lean_compiler_initattr_3__isIOUnit___boxed(obj* x_1) {
_start:
{
uint8 x_2; obj* x_3; 
x_2 = l___private_init_lean_compiler_initattr_3__isIOUnit(x_1);
lean::dec(x_1);
x_3 = lean::box(x_2);
return x_3;
}
}
obj* l_RBNode_fold___main___at_Lean_mkInitAttr___spec__2(obj* x_1, obj* x_2) {
_start:
{
if (lean::obj_tag(x_2) == 0)
{
return x_1;
}
else
{
obj* x_3; obj* x_4; obj* x_5; obj* x_6; obj* x_7; obj* x_8; obj* x_9; 
x_3 = lean::cnstr_get(x_2, 0);
x_4 = lean::cnstr_get(x_2, 1);
x_5 = lean::cnstr_get(x_2, 2);
x_6 = lean::cnstr_get(x_2, 3);
x_7 = l_RBNode_fold___main___at_Lean_mkInitAttr___spec__2(x_1, x_3);
lean::inc(x_5);
lean::inc(x_4);
x_8 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_8, 0, x_4);
lean::cnstr_set(x_8, 1, x_5);
x_9 = lean::array_push(x_7, x_8);
x_1 = x_9;
x_2 = x_6;
goto _start;
}
}
}
obj* _init_l___private_init_data_array_qsort_1__partitionAux___main___at_Lean_mkInitAttr___spec__4___closed__1() {
_start:
{
obj* x_1; obj* x_2; 
x_1 = l_Lean_Inhabited;
x_2 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_2, 0, x_1);
lean::cnstr_set(x_2, 1, x_1);
return x_2;
}
}
obj* l___private_init_data_array_qsort_1__partitionAux___main___at_Lean_mkInitAttr___spec__4(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5) {
_start:
{
uint8 x_6; 
x_6 = lean::nat_dec_lt(x_5, x_1);
if (x_6 == 0)
{
obj* x_7; obj* x_8; 
lean::dec(x_5);
x_7 = lean::array_swap(x_3, x_4, x_1);
x_8 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_8, 0, x_4);
lean::cnstr_set(x_8, 1, x_7);
return x_8;
}
else
{
obj* x_9; obj* x_10; obj* x_11; obj* x_12; uint8 x_13; 
x_9 = l___private_init_data_array_qsort_1__partitionAux___main___at_Lean_mkInitAttr___spec__4___closed__1;
x_10 = lean::array_get(x_9, x_3, x_5);
x_11 = lean::cnstr_get(x_10, 0);
lean::inc(x_11);
lean::dec(x_10);
x_12 = lean::cnstr_get(x_2, 0);
x_13 = l_Lean_Name_quickLt(x_11, x_12);
lean::dec(x_11);
if (x_13 == 0)
{
obj* x_14; obj* x_15; 
x_14 = lean::mk_nat_obj(1u);
x_15 = lean::nat_add(x_5, x_14);
lean::dec(x_5);
x_5 = x_15;
goto _start;
}
else
{
obj* x_17; obj* x_18; obj* x_19; obj* x_20; 
x_17 = lean::array_swap(x_3, x_4, x_5);
x_18 = lean::mk_nat_obj(1u);
x_19 = lean::nat_add(x_4, x_18);
lean::dec(x_4);
x_20 = lean::nat_add(x_5, x_18);
lean::dec(x_5);
x_3 = x_17;
x_4 = x_19;
x_5 = x_20;
goto _start;
}
}
}
}
obj* l_Array_qsortAux___main___at_Lean_mkInitAttr___spec__3(obj* x_1, obj* x_2, obj* x_3) {
_start:
{
uint8 x_4; 
x_4 = lean::nat_dec_lt(x_2, x_3);
if (x_4 == 0)
{
lean::dec(x_2);
return x_1;
}
else
{
obj* x_5; obj* x_6; obj* x_7; obj* x_8; obj* x_57; obj* x_58; obj* x_59; obj* x_60; obj* x_61; uint8 x_62; 
x_5 = lean::nat_add(x_2, x_3);
x_6 = lean::mk_nat_obj(2u);
x_7 = lean::nat_div(x_5, x_6);
lean::dec(x_5);
x_57 = l___private_init_data_array_qsort_1__partitionAux___main___at_Lean_mkInitAttr___spec__4___closed__1;
x_58 = lean::array_get(x_57, x_1, x_7);
x_59 = lean::array_get(x_57, x_1, x_2);
x_60 = lean::cnstr_get(x_58, 0);
lean::inc(x_60);
lean::dec(x_58);
x_61 = lean::cnstr_get(x_59, 0);
lean::inc(x_61);
lean::dec(x_59);
x_62 = l_Lean_Name_quickLt(x_60, x_61);
lean::dec(x_61);
lean::dec(x_60);
if (x_62 == 0)
{
x_8 = x_1;
goto block_56;
}
else
{
obj* x_63; 
x_63 = lean::array_swap(x_1, x_2, x_7);
x_8 = x_63;
goto block_56;
}
block_56:
{
obj* x_9; obj* x_10; obj* x_11; obj* x_12; obj* x_13; uint8 x_14; 
x_9 = l___private_init_data_array_qsort_1__partitionAux___main___at_Lean_mkInitAttr___spec__4___closed__1;
x_10 = lean::array_get(x_9, x_8, x_3);
x_11 = lean::array_get(x_9, x_8, x_2);
x_12 = lean::cnstr_get(x_10, 0);
lean::inc(x_12);
x_13 = lean::cnstr_get(x_11, 0);
lean::inc(x_13);
lean::dec(x_11);
x_14 = l_Lean_Name_quickLt(x_12, x_13);
lean::dec(x_13);
if (x_14 == 0)
{
obj* x_15; obj* x_16; uint8 x_17; 
x_15 = lean::array_get(x_9, x_8, x_7);
x_16 = lean::cnstr_get(x_15, 0);
lean::inc(x_16);
lean::dec(x_15);
x_17 = l_Lean_Name_quickLt(x_16, x_12);
lean::dec(x_12);
lean::dec(x_16);
if (x_17 == 0)
{
obj* x_18; obj* x_19; obj* x_20; obj* x_21; obj* x_22; obj* x_23; 
lean::dec(x_7);
lean::inc(x_2, 2);
x_18 = l___private_init_data_array_qsort_1__partitionAux___main___at_Lean_mkInitAttr___spec__4(x_3, x_10, x_8, x_2, x_2);
lean::dec(x_10);
x_19 = lean::cnstr_get(x_18, 0);
lean::inc(x_19);
x_20 = lean::cnstr_get(x_18, 1);
lean::inc(x_20);
lean::dec(x_18);
x_21 = l_Array_qsortAux___main___at_Lean_mkInitAttr___spec__3(x_20, x_2, x_19);
x_22 = lean::mk_nat_obj(1u);
x_23 = lean::nat_add(x_19, x_22);
lean::dec(x_19);
x_1 = x_21;
x_2 = x_23;
goto _start;
}
else
{
obj* x_25; obj* x_26; obj* x_27; obj* x_28; obj* x_29; obj* x_30; obj* x_31; obj* x_32; 
lean::dec(x_10);
x_25 = lean::array_swap(x_8, x_7, x_3);
lean::dec(x_7);
x_26 = lean::array_get(x_9, x_25, x_3);
lean::inc(x_2, 2);
x_27 = l___private_init_data_array_qsort_1__partitionAux___main___at_Lean_mkInitAttr___spec__4(x_3, x_26, x_25, x_2, x_2);
lean::dec(x_26);
x_28 = lean::cnstr_get(x_27, 0);
lean::inc(x_28);
x_29 = lean::cnstr_get(x_27, 1);
lean::inc(x_29);
lean::dec(x_27);
x_30 = l_Array_qsortAux___main___at_Lean_mkInitAttr___spec__3(x_29, x_2, x_28);
x_31 = lean::mk_nat_obj(1u);
x_32 = lean::nat_add(x_28, x_31);
lean::dec(x_28);
x_1 = x_30;
x_2 = x_32;
goto _start;
}
}
else
{
obj* x_34; obj* x_35; obj* x_36; obj* x_37; obj* x_38; uint8 x_39; 
lean::dec(x_12);
lean::dec(x_10);
x_34 = lean::array_swap(x_8, x_2, x_3);
x_35 = lean::array_get(x_9, x_34, x_7);
x_36 = lean::array_get(x_9, x_34, x_3);
x_37 = lean::cnstr_get(x_35, 0);
lean::inc(x_37);
lean::dec(x_35);
x_38 = lean::cnstr_get(x_36, 0);
lean::inc(x_38);
x_39 = l_Lean_Name_quickLt(x_37, x_38);
lean::dec(x_38);
lean::dec(x_37);
if (x_39 == 0)
{
obj* x_40; obj* x_41; obj* x_42; obj* x_43; obj* x_44; obj* x_45; 
lean::dec(x_7);
lean::inc(x_2, 2);
x_40 = l___private_init_data_array_qsort_1__partitionAux___main___at_Lean_mkInitAttr___spec__4(x_3, x_36, x_34, x_2, x_2);
lean::dec(x_36);
x_41 = lean::cnstr_get(x_40, 0);
lean::inc(x_41);
x_42 = lean::cnstr_get(x_40, 1);
lean::inc(x_42);
lean::dec(x_40);
x_43 = l_Array_qsortAux___main___at_Lean_mkInitAttr___spec__3(x_42, x_2, x_41);
x_44 = lean::mk_nat_obj(1u);
x_45 = lean::nat_add(x_41, x_44);
lean::dec(x_41);
x_1 = x_43;
x_2 = x_45;
goto _start;
}
else
{
obj* x_47; obj* x_48; obj* x_49; obj* x_50; obj* x_51; obj* x_52; obj* x_53; obj* x_54; 
lean::dec(x_36);
x_47 = lean::array_swap(x_34, x_7, x_3);
lean::dec(x_7);
x_48 = lean::array_get(x_9, x_47, x_3);
lean::inc(x_2, 2);
x_49 = l___private_init_data_array_qsort_1__partitionAux___main___at_Lean_mkInitAttr___spec__4(x_3, x_48, x_47, x_2, x_2);
lean::dec(x_48);
x_50 = lean::cnstr_get(x_49, 0);
lean::inc(x_50);
x_51 = lean::cnstr_get(x_49, 1);
lean::inc(x_51);
lean::dec(x_49);
x_52 = l_Array_qsortAux___main___at_Lean_mkInitAttr___spec__3(x_51, x_2, x_50);
x_53 = lean::mk_nat_obj(1u);
x_54 = lean::nat_add(x_50, x_53);
lean::dec(x_50);
x_1 = x_52;
x_2 = x_54;
goto _start;
}
}
}
}
}
}
obj* l_Lean_registerParametricAttribute___at_Lean_mkInitAttr___spec__1___lambda__1(obj* x_1) {
_start:
{
obj* x_2; obj* x_3; obj* x_4; obj* x_5; obj* x_6; obj* x_7; obj* x_8; 
x_2 = l_Array_empty___closed__1;
x_3 = l_RBNode_fold___main___at_Lean_mkInitAttr___spec__2(x_2, x_1);
x_4 = lean::array_get_size(x_3);
x_5 = lean::mk_nat_obj(1u);
x_6 = lean::nat_sub(x_4, x_5);
lean::dec(x_4);
x_7 = lean::mk_nat_obj(0u);
x_8 = l_Array_qsortAux___main___at_Lean_mkInitAttr___spec__3(x_3, x_7, x_6);
lean::dec(x_6);
return x_8;
}
}
obj* _init_l_Lean_registerParametricAttribute___at_Lean_mkInitAttr___spec__1___closed__1() {
_start:
{
obj* x_1; 
x_1 = lean::alloc_closure(reinterpret_cast<void*>(l_Lean_registerParametricAttribute___at_Lean_mkInitAttr___spec__1___lambda__1___boxed), 1, 0);
return x_1;
}
}
obj* l_Lean_registerParametricAttribute___at_Lean_mkInitAttr___spec__1(obj* x_1, obj* x_2, obj* x_3, obj* x_4) {
_start:
{
obj* x_5; obj* x_6; obj* x_7; obj* x_8; obj* x_9; obj* x_10; 
x_5 = l_Lean_registerTagAttribute___closed__1;
x_6 = l_Lean_registerParametricAttribute___rarg___closed__1;
x_7 = l_Lean_registerParametricAttribute___at_Lean_mkInitAttr___spec__1___closed__1;
x_8 = l_Lean_registerParametricAttribute___rarg___closed__2;
lean::inc(x_1);
x_9 = lean::alloc_cnstr(0, 5, 0);
lean::cnstr_set(x_9, 0, x_1);
lean::cnstr_set(x_9, 1, x_5);
lean::cnstr_set(x_9, 2, x_6);
lean::cnstr_set(x_9, 3, x_7);
lean::cnstr_set(x_9, 4, x_8);
x_10 = l_Lean_registerPersistentEnvExtensionUnsafe___rarg(x_9, x_4);
if (lean::obj_tag(x_10) == 0)
{
uint8 x_11; 
x_11 = !lean::is_exclusive(x_10);
if (x_11 == 0)
{
obj* x_12; obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17; obj* x_18; uint8 x_19; obj* x_20; obj* x_21; 
x_12 = lean::cnstr_get(x_10, 0);
x_13 = lean::box(0);
lean::cnstr_set(x_10, 0, x_13);
lean::inc(x_12);
lean::inc(x_1);
x_14 = lean::alloc_closure(reinterpret_cast<void*>(l_Lean_registerParametricAttribute___rarg___lambda__4___boxed), 8, 3);
lean::closure_set(x_14, 0, x_1);
lean::closure_set(x_14, 1, x_3);
lean::closure_set(x_14, 2, x_12);
lean::inc(x_1);
x_15 = lean::alloc_closure(reinterpret_cast<void*>(l_Lean_registerTagAttribute___lambda__6___boxed), 5, 1);
lean::closure_set(x_15, 0, x_1);
lean::inc(x_1);
x_16 = lean::alloc_closure(reinterpret_cast<void*>(l_Lean_registerTagAttribute___lambda__7___boxed), 5, 1);
lean::closure_set(x_16, 0, x_1);
x_17 = l_Lean_registerTagAttribute___closed__5;
x_18 = l_Lean_registerTagAttribute___closed__6;
x_19 = 0;
x_20 = lean::alloc_cnstr(0, 8, 1);
lean::cnstr_set(x_20, 0, x_1);
lean::cnstr_set(x_20, 1, x_2);
lean::cnstr_set(x_20, 2, x_14);
lean::cnstr_set(x_20, 3, x_15);
lean::cnstr_set(x_20, 4, x_16);
lean::cnstr_set(x_20, 5, x_17);
lean::cnstr_set(x_20, 6, x_18);
lean::cnstr_set(x_20, 7, x_18);
lean::cnstr_set_scalar(x_20, sizeof(void*)*8, x_19);
lean::inc(x_20);
x_21 = l_Lean_registerAttribute(x_20, x_10);
if (lean::obj_tag(x_21) == 0)
{
uint8 x_22; 
x_22 = !lean::is_exclusive(x_21);
if (x_22 == 0)
{
obj* x_23; obj* x_24; 
x_23 = lean::cnstr_get(x_21, 0);
lean::dec(x_23);
x_24 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_24, 0, x_20);
lean::cnstr_set(x_24, 1, x_12);
lean::cnstr_set(x_21, 0, x_24);
return x_21;
}
else
{
obj* x_25; obj* x_26; obj* x_27; 
x_25 = lean::cnstr_get(x_21, 1);
lean::inc(x_25);
lean::dec(x_21);
x_26 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_26, 0, x_20);
lean::cnstr_set(x_26, 1, x_12);
x_27 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_27, 0, x_26);
lean::cnstr_set(x_27, 1, x_25);
return x_27;
}
}
else
{
uint8 x_28; 
lean::dec(x_20);
lean::dec(x_12);
x_28 = !lean::is_exclusive(x_21);
if (x_28 == 0)
{
return x_21;
}
else
{
obj* x_29; obj* x_30; obj* x_31; 
x_29 = lean::cnstr_get(x_21, 0);
x_30 = lean::cnstr_get(x_21, 1);
lean::inc(x_30);
lean::inc(x_29);
lean::dec(x_21);
x_31 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_31, 0, x_29);
lean::cnstr_set(x_31, 1, x_30);
return x_31;
}
}
}
else
{
obj* x_32; obj* x_33; obj* x_34; obj* x_35; obj* x_36; obj* x_37; obj* x_38; obj* x_39; obj* x_40; uint8 x_41; obj* x_42; obj* x_43; 
x_32 = lean::cnstr_get(x_10, 0);
x_33 = lean::cnstr_get(x_10, 1);
lean::inc(x_33);
lean::inc(x_32);
lean::dec(x_10);
x_34 = lean::box(0);
x_35 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_35, 0, x_34);
lean::cnstr_set(x_35, 1, x_33);
lean::inc(x_32);
lean::inc(x_1);
x_36 = lean::alloc_closure(reinterpret_cast<void*>(l_Lean_registerParametricAttribute___rarg___lambda__4___boxed), 8, 3);
lean::closure_set(x_36, 0, x_1);
lean::closure_set(x_36, 1, x_3);
lean::closure_set(x_36, 2, x_32);
lean::inc(x_1);
x_37 = lean::alloc_closure(reinterpret_cast<void*>(l_Lean_registerTagAttribute___lambda__6___boxed), 5, 1);
lean::closure_set(x_37, 0, x_1);
lean::inc(x_1);
x_38 = lean::alloc_closure(reinterpret_cast<void*>(l_Lean_registerTagAttribute___lambda__7___boxed), 5, 1);
lean::closure_set(x_38, 0, x_1);
x_39 = l_Lean_registerTagAttribute___closed__5;
x_40 = l_Lean_registerTagAttribute___closed__6;
x_41 = 0;
x_42 = lean::alloc_cnstr(0, 8, 1);
lean::cnstr_set(x_42, 0, x_1);
lean::cnstr_set(x_42, 1, x_2);
lean::cnstr_set(x_42, 2, x_36);
lean::cnstr_set(x_42, 3, x_37);
lean::cnstr_set(x_42, 4, x_38);
lean::cnstr_set(x_42, 5, x_39);
lean::cnstr_set(x_42, 6, x_40);
lean::cnstr_set(x_42, 7, x_40);
lean::cnstr_set_scalar(x_42, sizeof(void*)*8, x_41);
lean::inc(x_42);
x_43 = l_Lean_registerAttribute(x_42, x_35);
if (lean::obj_tag(x_43) == 0)
{
obj* x_44; obj* x_45; obj* x_46; obj* x_47; 
x_44 = lean::cnstr_get(x_43, 1);
lean::inc(x_44);
if (lean::is_exclusive(x_43)) {
 lean::cnstr_release(x_43, 0);
 lean::cnstr_release(x_43, 1);
 x_45 = x_43;
} else {
 lean::dec_ref(x_43);
 x_45 = lean::box(0);
}
x_46 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_46, 0, x_42);
lean::cnstr_set(x_46, 1, x_32);
if (lean::is_scalar(x_45)) {
 x_47 = lean::alloc_cnstr(0, 2, 0);
} else {
 x_47 = x_45;
}
lean::cnstr_set(x_47, 0, x_46);
lean::cnstr_set(x_47, 1, x_44);
return x_47;
}
else
{
obj* x_48; obj* x_49; obj* x_50; obj* x_51; 
lean::dec(x_42);
lean::dec(x_32);
x_48 = lean::cnstr_get(x_43, 0);
lean::inc(x_48);
x_49 = lean::cnstr_get(x_43, 1);
lean::inc(x_49);
if (lean::is_exclusive(x_43)) {
 lean::cnstr_release(x_43, 0);
 lean::cnstr_release(x_43, 1);
 x_50 = x_43;
} else {
 lean::dec_ref(x_43);
 x_50 = lean::box(0);
}
if (lean::is_scalar(x_50)) {
 x_51 = lean::alloc_cnstr(1, 2, 0);
} else {
 x_51 = x_50;
}
lean::cnstr_set(x_51, 0, x_48);
lean::cnstr_set(x_51, 1, x_49);
return x_51;
}
}
}
else
{
uint8 x_52; 
lean::dec(x_3);
lean::dec(x_2);
lean::dec(x_1);
x_52 = !lean::is_exclusive(x_10);
if (x_52 == 0)
{
return x_10;
}
else
{
obj* x_53; obj* x_54; obj* x_55; 
x_53 = lean::cnstr_get(x_10, 0);
x_54 = lean::cnstr_get(x_10, 1);
lean::inc(x_54);
lean::inc(x_53);
lean::dec(x_10);
x_55 = lean::alloc_cnstr(1, 2, 0);
lean::cnstr_set(x_55, 0, x_53);
lean::cnstr_set(x_55, 1, x_54);
return x_55;
}
}
}
}
obj* _init_l_Lean_mkInitAttr___lambda__1___closed__1() {
_start:
{
obj* x_1; obj* x_2; 
x_1 = lean::mk_string("unknown declaration");
x_2 = lean::alloc_cnstr(0, 1, 0);
lean::cnstr_set(x_2, 0, x_1);
return x_2;
}
}
obj* _init_l_Lean_mkInitAttr___lambda__1___closed__2() {
_start:
{
obj* x_1; obj* x_2; 
x_1 = lean::mk_string("initialization function must have type `IO Unit`");
x_2 = lean::alloc_cnstr(0, 1, 0);
lean::cnstr_set(x_2, 0, x_1);
return x_2;
}
}
obj* _init_l_Lean_mkInitAttr___lambda__1___closed__3() {
_start:
{
obj* x_1; obj* x_2; 
x_1 = lean::box(0);
x_2 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_2, 0, x_1);
return x_2;
}
}
obj* _init_l_Lean_mkInitAttr___lambda__1___closed__4() {
_start:
{
obj* x_1; obj* x_2; 
x_1 = lean::mk_string("unexpected kind of argument");
x_2 = lean::alloc_cnstr(0, 1, 0);
lean::cnstr_set(x_2, 0, x_1);
return x_2;
}
}
obj* _init_l_Lean_mkInitAttr___lambda__1___closed__5() {
_start:
{
obj* x_1; 
x_1 = lean::mk_string("unknown initialization function '");
return x_1;
}
}
obj* _init_l_Lean_mkInitAttr___lambda__1___closed__6() {
_start:
{
obj* x_1; 
x_1 = lean::mk_string("initialization function '");
return x_1;
}
}
obj* _init_l_Lean_mkInitAttr___lambda__1___closed__7() {
_start:
{
obj* x_1; 
x_1 = lean::mk_string("' must have type of the form `IO <type>`");
return x_1;
}
}
obj* _init_l_Lean_mkInitAttr___lambda__1___closed__8() {
_start:
{
obj* x_1; 
x_1 = lean::mk_string("' type mismatch");
return x_1;
}
}
obj* l_Lean_mkInitAttr___lambda__1(obj* x_1, obj* x_2, obj* x_3) {
_start:
{
obj* x_4; 
lean::inc(x_1);
x_4 = lean::environment_find_core(x_1, x_2);
if (lean::obj_tag(x_4) == 0)
{
obj* x_5; 
lean::dec(x_3);
lean::dec(x_1);
x_5 = l_Lean_mkInitAttr___lambda__1___closed__1;
return x_5;
}
else
{
switch (lean::obj_tag(x_3)) {
case 0:
{
obj* x_6; obj* x_7; uint8 x_8; 
lean::dec(x_1);
x_6 = lean::cnstr_get(x_4, 0);
lean::inc(x_6);
lean::dec(x_4);
x_7 = l_Lean_ConstantInfo_type(x_6);
lean::dec(x_6);
x_8 = l___private_init_lean_compiler_initattr_3__isIOUnit(x_7);
lean::dec(x_7);
if (x_8 == 0)
{
obj* x_9; 
x_9 = l_Lean_mkInitAttr___lambda__1___closed__2;
return x_9;
}
else
{
obj* x_10; 
x_10 = l_Lean_mkInitAttr___lambda__1___closed__3;
return x_10;
}
}
case 3:
{
obj* x_11; obj* x_12; obj* x_13; 
x_11 = lean::cnstr_get(x_4, 0);
lean::inc(x_11);
lean::dec(x_4);
x_12 = lean::cnstr_get(x_3, 2);
lean::inc(x_12);
lean::dec(x_3);
lean::inc(x_12);
x_13 = lean::environment_find_core(x_1, x_12);
if (lean::obj_tag(x_13) == 0)
{
obj* x_14; obj* x_15; obj* x_16; obj* x_17; obj* x_18; obj* x_19; obj* x_20; 
lean::dec(x_11);
x_14 = l_Lean_Name_toString___closed__1;
x_15 = l_Lean_Name_toStringWithSep___main(x_14, x_12);
x_16 = l_Lean_mkInitAttr___lambda__1___closed__5;
x_17 = lean::string_append(x_16, x_15);
lean::dec(x_15);
x_18 = l_Char_HasRepr___closed__1;
x_19 = lean::string_append(x_17, x_18);
x_20 = lean::alloc_cnstr(0, 1, 0);
lean::cnstr_set(x_20, 0, x_19);
return x_20;
}
else
{
obj* x_21; obj* x_22; obj* x_23; 
x_21 = lean::cnstr_get(x_13, 0);
lean::inc(x_21);
lean::dec(x_13);
x_22 = l_Lean_ConstantInfo_type(x_21);
lean::dec(x_21);
x_23 = l___private_init_lean_compiler_initattr_1__getIOTypeArg___main(x_22);
lean::dec(x_22);
if (lean::obj_tag(x_23) == 0)
{
obj* x_24; obj* x_25; obj* x_26; obj* x_27; obj* x_28; obj* x_29; obj* x_30; 
lean::dec(x_11);
x_24 = l_Lean_Name_toString___closed__1;
x_25 = l_Lean_Name_toStringWithSep___main(x_24, x_12);
x_26 = l_Lean_mkInitAttr___lambda__1___closed__6;
x_27 = lean::string_append(x_26, x_25);
lean::dec(x_25);
x_28 = l_Lean_mkInitAttr___lambda__1___closed__7;
x_29 = lean::string_append(x_27, x_28);
x_30 = lean::alloc_cnstr(0, 1, 0);
lean::cnstr_set(x_30, 0, x_29);
return x_30;
}
else
{
obj* x_31; obj* x_32; uint8 x_33; 
x_31 = lean::cnstr_get(x_23, 0);
lean::inc(x_31);
lean::dec(x_23);
x_32 = l_Lean_ConstantInfo_type(x_11);
lean::dec(x_11);
x_33 = lean_expr_eqv(x_32, x_31);
lean::dec(x_31);
lean::dec(x_32);
if (x_33 == 0)
{
obj* x_34; obj* x_35; obj* x_36; obj* x_37; obj* x_38; obj* x_39; obj* x_40; 
x_34 = l_Lean_Name_toString___closed__1;
x_35 = l_Lean_Name_toStringWithSep___main(x_34, x_12);
x_36 = l_Lean_mkInitAttr___lambda__1___closed__6;
x_37 = lean::string_append(x_36, x_35);
lean::dec(x_35);
x_38 = l_Lean_mkInitAttr___lambda__1___closed__8;
x_39 = lean::string_append(x_37, x_38);
x_40 = lean::alloc_cnstr(0, 1, 0);
lean::cnstr_set(x_40, 0, x_39);
return x_40;
}
else
{
obj* x_41; 
x_41 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_41, 0, x_12);
return x_41;
}
}
}
}
default: 
{
obj* x_42; 
lean::dec(x_4);
lean::dec(x_3);
lean::dec(x_1);
x_42 = l_Lean_mkInitAttr___lambda__1___closed__4;
return x_42;
}
}
}
}
}
obj* _init_l_Lean_mkInitAttr___closed__1() {
_start:
{
obj* x_1; obj* x_2; obj* x_3; 
x_1 = lean::box(0);
x_2 = lean::mk_string("init");
x_3 = lean_name_mk_string(x_1, x_2);
return x_3;
}
}
obj* _init_l_Lean_mkInitAttr___closed__2() {
_start:
{
obj* x_1; 
x_1 = lean::mk_string("initialization procedure for global references");
return x_1;
}
}
obj* _init_l_Lean_mkInitAttr___closed__3() {
_start:
{
obj* x_1; 
x_1 = lean::alloc_closure(reinterpret_cast<void*>(l_Lean_mkInitAttr___lambda__1), 3, 0);
return x_1;
}
}
obj* l_Lean_mkInitAttr(obj* x_1) {
_start:
{
obj* x_2; obj* x_3; obj* x_4; obj* x_5; 
x_2 = l_Lean_mkInitAttr___closed__1;
x_3 = l_Lean_mkInitAttr___closed__2;
x_4 = l_Lean_mkInitAttr___closed__3;
x_5 = l_Lean_registerParametricAttribute___at_Lean_mkInitAttr___spec__1(x_2, x_3, x_4, x_1);
return x_5;
}
}
obj* l_RBNode_fold___main___at_Lean_mkInitAttr___spec__2___boxed(obj* x_1, obj* x_2) {
_start:
{
obj* x_3; 
x_3 = l_RBNode_fold___main___at_Lean_mkInitAttr___spec__2(x_1, x_2);
lean::dec(x_2);
return x_3;
}
}
obj* l___private_init_data_array_qsort_1__partitionAux___main___at_Lean_mkInitAttr___spec__4___boxed(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5) {
_start:
{
obj* x_6; 
x_6 = l___private_init_data_array_qsort_1__partitionAux___main___at_Lean_mkInitAttr___spec__4(x_1, x_2, x_3, x_4, x_5);
lean::dec(x_2);
lean::dec(x_1);
return x_6;
}
}
obj* l_Array_qsortAux___main___at_Lean_mkInitAttr___spec__3___boxed(obj* x_1, obj* x_2, obj* x_3) {
_start:
{
obj* x_4; 
x_4 = l_Array_qsortAux___main___at_Lean_mkInitAttr___spec__3(x_1, x_2, x_3);
lean::dec(x_3);
return x_4;
}
}
obj* l_Lean_registerParametricAttribute___at_Lean_mkInitAttr___spec__1___lambda__1___boxed(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = l_Lean_registerParametricAttribute___at_Lean_mkInitAttr___spec__1___lambda__1(x_1);
lean::dec(x_1);
return x_2;
}
}
obj* l_RBNode_find___main___at_Lean_isIOUnitInitFn___spec__2(obj* x_1, obj* x_2) {
_start:
{
if (lean::obj_tag(x_1) == 0)
{
obj* x_3; 
x_3 = lean::box(0);
return x_3;
}
else
{
obj* x_4; obj* x_5; obj* x_6; obj* x_7; uint8 x_8; 
x_4 = lean::cnstr_get(x_1, 0);
x_5 = lean::cnstr_get(x_1, 1);
x_6 = lean::cnstr_get(x_1, 2);
x_7 = lean::cnstr_get(x_1, 3);
x_8 = l_Lean_Name_quickLt(x_2, x_5);
if (x_8 == 0)
{
uint8 x_9; 
x_9 = l_Lean_Name_quickLt(x_5, x_2);
if (x_9 == 0)
{
obj* x_10; 
lean::inc(x_6);
x_10 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_10, 0, x_6);
return x_10;
}
else
{
x_1 = x_7;
goto _start;
}
}
else
{
x_1 = x_4;
goto _start;
}
}
}
}
obj* l_Array_binSearchAux___main___at_Lean_isIOUnitInitFn___spec__3(obj* x_1, obj* x_2, obj* x_3, obj* x_4) {
_start:
{
uint8 x_5; 
x_5 = lean::nat_dec_le(x_3, x_4);
if (x_5 == 0)
{
obj* x_6; 
lean::dec(x_4);
lean::dec(x_3);
x_6 = lean::box(0);
return x_6;
}
else
{
obj* x_7; obj* x_8; obj* x_9; obj* x_10; obj* x_11; obj* x_12; obj* x_13; uint8 x_14; 
x_7 = lean::nat_add(x_3, x_4);
x_8 = lean::mk_nat_obj(2u);
x_9 = lean::nat_div(x_7, x_8);
lean::dec(x_7);
x_10 = l___private_init_data_array_qsort_1__partitionAux___main___at_Lean_mkInitAttr___spec__4___closed__1;
x_11 = lean::array_get(x_10, x_1, x_9);
x_12 = lean::cnstr_get(x_11, 0);
lean::inc(x_12);
x_13 = lean::cnstr_get(x_2, 0);
x_14 = l_Lean_Name_quickLt(x_12, x_13);
if (x_14 == 0)
{
uint8 x_15; 
lean::dec(x_4);
x_15 = l_Lean_Name_quickLt(x_13, x_12);
lean::dec(x_12);
if (x_15 == 0)
{
obj* x_16; 
lean::dec(x_9);
lean::dec(x_3);
x_16 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_16, 0, x_11);
return x_16;
}
else
{
obj* x_17; uint8 x_18; 
lean::dec(x_11);
x_17 = lean::mk_nat_obj(0u);
x_18 = lean::nat_dec_eq(x_9, x_17);
if (x_18 == 0)
{
obj* x_19; obj* x_20; 
x_19 = lean::mk_nat_obj(1u);
x_20 = lean::nat_sub(x_9, x_19);
lean::dec(x_9);
x_4 = x_20;
goto _start;
}
else
{
obj* x_22; 
lean::dec(x_9);
lean::dec(x_3);
x_22 = lean::box(0);
return x_22;
}
}
}
else
{
obj* x_23; obj* x_24; 
lean::dec(x_12);
lean::dec(x_11);
lean::dec(x_3);
x_23 = lean::mk_nat_obj(1u);
x_24 = lean::nat_add(x_9, x_23);
lean::dec(x_9);
x_3 = x_24;
goto _start;
}
}
}
}
obj* l_Lean_ParametricAttribute_getParam___at_Lean_isIOUnitInitFn___spec__1(obj* x_1, obj* x_2, obj* x_3) {
_start:
{
obj* x_4; 
x_4 = l_Lean_Environment_getModuleIdxFor(x_2, x_3);
if (lean::obj_tag(x_4) == 0)
{
obj* x_5; obj* x_6; obj* x_7; 
x_5 = lean::cnstr_get(x_1, 1);
lean::inc(x_5);
lean::dec(x_1);
x_6 = l_Lean_PersistentEnvExtension_getState___rarg(x_5, x_2);
x_7 = l_RBNode_find___main___at_Lean_isIOUnitInitFn___spec__2(x_6, x_3);
lean::dec(x_3);
lean::dec(x_6);
return x_7;
}
else
{
obj* x_8; obj* x_9; obj* x_10; obj* x_11; obj* x_12; obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17; 
x_8 = lean::cnstr_get(x_4, 0);
lean::inc(x_8);
lean::dec(x_4);
x_9 = lean::cnstr_get(x_1, 1);
lean::inc(x_9);
lean::dec(x_1);
x_10 = l_Lean_PersistentEnvExtension_getModuleEntries___rarg(x_9, x_2, x_8);
lean::dec(x_8);
x_11 = lean::box(0);
x_12 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_12, 0, x_3);
lean::cnstr_set(x_12, 1, x_11);
x_13 = lean::array_get_size(x_10);
x_14 = lean::mk_nat_obj(1u);
x_15 = lean::nat_sub(x_13, x_14);
lean::dec(x_13);
x_16 = lean::mk_nat_obj(0u);
x_17 = l_Array_binSearchAux___main___at_Lean_isIOUnitInitFn___spec__3(x_10, x_12, x_16, x_15);
lean::dec(x_12);
lean::dec(x_10);
if (lean::obj_tag(x_17) == 0)
{
obj* x_18; 
x_18 = lean::box(0);
return x_18;
}
else
{
uint8 x_19; 
x_19 = !lean::is_exclusive(x_17);
if (x_19 == 0)
{
obj* x_20; obj* x_21; 
x_20 = lean::cnstr_get(x_17, 0);
x_21 = lean::cnstr_get(x_20, 1);
lean::inc(x_21);
lean::dec(x_20);
lean::cnstr_set(x_17, 0, x_21);
return x_17;
}
else
{
obj* x_22; obj* x_23; obj* x_24; 
x_22 = lean::cnstr_get(x_17, 0);
lean::inc(x_22);
lean::dec(x_17);
x_23 = lean::cnstr_get(x_22, 1);
lean::inc(x_23);
lean::dec(x_22);
x_24 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_24, 0, x_23);
return x_24;
}
}
}
}
}
uint8 l_Lean_isIOUnitInitFn(obj* x_1, obj* x_2) {
_start:
{
obj* x_3; obj* x_4; 
x_3 = l_Lean_initAttr;
x_4 = l_Lean_ParametricAttribute_getParam___at_Lean_isIOUnitInitFn___spec__1(x_3, x_1, x_2);
if (lean::obj_tag(x_4) == 0)
{
uint8 x_5; 
x_5 = 0;
return x_5;
}
else
{
obj* x_6; obj* x_7; uint8 x_8; 
x_6 = lean::cnstr_get(x_4, 0);
lean::inc(x_6);
lean::dec(x_4);
x_7 = lean::box(0);
x_8 = lean_name_dec_eq(x_6, x_7);
lean::dec(x_6);
if (x_8 == 0)
{
uint8 x_9; 
x_9 = 0;
return x_9;
}
else
{
uint8 x_10; 
x_10 = 1;
return x_10;
}
}
}
}
obj* l_RBNode_find___main___at_Lean_isIOUnitInitFn___spec__2___boxed(obj* x_1, obj* x_2) {
_start:
{
obj* x_3; 
x_3 = l_RBNode_find___main___at_Lean_isIOUnitInitFn___spec__2(x_1, x_2);
lean::dec(x_2);
lean::dec(x_1);
return x_3;
}
}
obj* l_Array_binSearchAux___main___at_Lean_isIOUnitInitFn___spec__3___boxed(obj* x_1, obj* x_2, obj* x_3, obj* x_4) {
_start:
{
obj* x_5; 
x_5 = l_Array_binSearchAux___main___at_Lean_isIOUnitInitFn___spec__3(x_1, x_2, x_3, x_4);
lean::dec(x_2);
lean::dec(x_1);
return x_5;
}
}
obj* l_Lean_ParametricAttribute_getParam___at_Lean_isIOUnitInitFn___spec__1___boxed(obj* x_1, obj* x_2, obj* x_3) {
_start:
{
obj* x_4; 
x_4 = l_Lean_ParametricAttribute_getParam___at_Lean_isIOUnitInitFn___spec__1(x_1, x_2, x_3);
lean::dec(x_2);
return x_4;
}
}
obj* l_Lean_isIOUnitInitFn___boxed(obj* x_1, obj* x_2) {
_start:
{
uint8 x_3; obj* x_4; 
x_3 = l_Lean_isIOUnitInitFn(x_1, x_2);
lean::dec(x_1);
x_4 = lean::box(x_3);
return x_4;
}
}
namespace lean {
obj* get_init_fn_name_for_core(obj* x_1, obj* x_2) {
_start:
{
obj* x_3; obj* x_4; 
x_3 = l_Lean_initAttr;
x_4 = l_Lean_ParametricAttribute_getParam___at_Lean_isIOUnitInitFn___spec__1(x_3, x_1, x_2);
lean::dec(x_1);
if (lean::obj_tag(x_4) == 0)
{
return x_4;
}
else
{
obj* x_5; obj* x_6; uint8 x_7; 
x_5 = lean::cnstr_get(x_4, 0);
lean::inc(x_5);
x_6 = lean::box(0);
x_7 = lean_name_dec_eq(x_5, x_6);
lean::dec(x_5);
if (x_7 == 0)
{
return x_4;
}
else
{
obj* x_8; 
lean::dec(x_4);
x_8 = lean::box(0);
return x_8;
}
}
}
}
}
uint8 l_Lean_hasInitAttr(obj* x_1, obj* x_2) {
_start:
{
obj* x_3; 
x_3 = lean::get_init_fn_name_for_core(x_1, x_2);
if (lean::obj_tag(x_3) == 0)
{
uint8 x_4; 
x_4 = 0;
return x_4;
}
else
{
uint8 x_5; 
lean::dec(x_3);
x_5 = 1;
return x_5;
}
}
}
obj* l_Lean_hasInitAttr___boxed(obj* x_1, obj* x_2) {
_start:
{
uint8 x_3; obj* x_4; 
x_3 = l_Lean_hasInitAttr(x_1, x_2);
x_4 = lean::box(x_3);
return x_4;
}
}
obj* l_Lean_setInitAttr(obj* x_1, obj* x_2, obj* x_3) {
_start:
{
obj* x_4; obj* x_5; 
x_4 = l_Lean_initAttr;
x_5 = l_Lean_ParametricAttribute_setParam___rarg(x_4, x_1, x_2, x_3);
return x_5;
}
}
obj* initialize_init_lean_environment(obj*);
obj* initialize_init_lean_attributes(obj*);
static bool _G_initialized = false;
obj* initialize_init_lean_compiler_initattr(obj* w) {
if (_G_initialized) return w;
_G_initialized = true;
if (io_result_is_error(w)) return w;
w = initialize_init_lean_environment(w);
if (io_result_is_error(w)) return w;
w = initialize_init_lean_attributes(w);
if (io_result_is_error(w)) return w;
l___private_init_lean_compiler_initattr_1__getIOTypeArg___main___closed__1 = _init_l___private_init_lean_compiler_initattr_1__getIOTypeArg___main___closed__1();
lean::mark_persistent(l___private_init_lean_compiler_initattr_1__getIOTypeArg___main___closed__1);
l___private_init_lean_compiler_initattr_2__isUnitType___main___closed__1 = _init_l___private_init_lean_compiler_initattr_2__isUnitType___main___closed__1();
lean::mark_persistent(l___private_init_lean_compiler_initattr_2__isUnitType___main___closed__1);
l___private_init_data_array_qsort_1__partitionAux___main___at_Lean_mkInitAttr___spec__4___closed__1 = _init_l___private_init_data_array_qsort_1__partitionAux___main___at_Lean_mkInitAttr___spec__4___closed__1();
lean::mark_persistent(l___private_init_data_array_qsort_1__partitionAux___main___at_Lean_mkInitAttr___spec__4___closed__1);
l_Lean_registerParametricAttribute___at_Lean_mkInitAttr___spec__1___closed__1 = _init_l_Lean_registerParametricAttribute___at_Lean_mkInitAttr___spec__1___closed__1();
lean::mark_persistent(l_Lean_registerParametricAttribute___at_Lean_mkInitAttr___spec__1___closed__1);
l_Lean_mkInitAttr___lambda__1___closed__1 = _init_l_Lean_mkInitAttr___lambda__1___closed__1();
lean::mark_persistent(l_Lean_mkInitAttr___lambda__1___closed__1);
l_Lean_mkInitAttr___lambda__1___closed__2 = _init_l_Lean_mkInitAttr___lambda__1___closed__2();
lean::mark_persistent(l_Lean_mkInitAttr___lambda__1___closed__2);
l_Lean_mkInitAttr___lambda__1___closed__3 = _init_l_Lean_mkInitAttr___lambda__1___closed__3();
lean::mark_persistent(l_Lean_mkInitAttr___lambda__1___closed__3);
l_Lean_mkInitAttr___lambda__1___closed__4 = _init_l_Lean_mkInitAttr___lambda__1___closed__4();
lean::mark_persistent(l_Lean_mkInitAttr___lambda__1___closed__4);
l_Lean_mkInitAttr___lambda__1___closed__5 = _init_l_Lean_mkInitAttr___lambda__1___closed__5();
lean::mark_persistent(l_Lean_mkInitAttr___lambda__1___closed__5);
l_Lean_mkInitAttr___lambda__1___closed__6 = _init_l_Lean_mkInitAttr___lambda__1___closed__6();
lean::mark_persistent(l_Lean_mkInitAttr___lambda__1___closed__6);
l_Lean_mkInitAttr___lambda__1___closed__7 = _init_l_Lean_mkInitAttr___lambda__1___closed__7();
lean::mark_persistent(l_Lean_mkInitAttr___lambda__1___closed__7);
l_Lean_mkInitAttr___lambda__1___closed__8 = _init_l_Lean_mkInitAttr___lambda__1___closed__8();
lean::mark_persistent(l_Lean_mkInitAttr___lambda__1___closed__8);
l_Lean_mkInitAttr___closed__1 = _init_l_Lean_mkInitAttr___closed__1();
lean::mark_persistent(l_Lean_mkInitAttr___closed__1);
l_Lean_mkInitAttr___closed__2 = _init_l_Lean_mkInitAttr___closed__2();
lean::mark_persistent(l_Lean_mkInitAttr___closed__2);
l_Lean_mkInitAttr___closed__3 = _init_l_Lean_mkInitAttr___closed__3();
lean::mark_persistent(l_Lean_mkInitAttr___closed__3);
REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name("Lean"), "mkInitAttr"), 1, l_Lean_mkInitAttr);
w = l_Lean_mkInitAttr(w);
if (io_result_is_error(w)) return w;
l_Lean_initAttr = io_result_get_value(w);
lean::mark_persistent(l_Lean_initAttr);
lean::register_constant(lean::mk_const_name(lean::mk_const_name("Lean"), "initAttr"), l_Lean_initAttr);
REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name("Lean"), "isIOUnitInitFn"), 2, l_Lean_isIOUnitInitFn___boxed);
REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name("Lean"), "getInitFnNameFor"), 2, lean::get_init_fn_name_for_core);
REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name("Lean"), "hasInitAttr"), 2, l_Lean_hasInitAttr___boxed);
REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name("Lean"), "setInitAttr"), 3, l_Lean_setInitAttr);
return w;
}
