// Lean compiler output
// Module: init.lean.modifiers
// Imports: init.lean.environment
#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_mkProtectedExtension___spec__2___boxed(obj*, obj*, obj*, obj*, obj*);
extern "C" uint8 lean_name_dec_eq(obj*, obj*);
namespace lean {
obj* environment_main_module_core(obj*);
}
extern obj* l_Array_empty___closed__1;
namespace lean {
obj* nat_sub(obj*, obj*);
}
namespace lean {
obj* private_prefix_core(obj*);
}
obj* l_Lean_protectedExt___elambda__1___boxed(obj*);
obj* l_Lean_mkProtectedExtension___lambda__2(obj*);
obj* l_Lean_EnvExtension_getStateUnsafe___rarg(obj*, obj*);
uint8 l_Lean_isPrivateName(obj*);
obj* l_Lean_protectedExt___elambda__3___boxed(obj*, obj*);
obj* l___private_init_lean_modifiers_2__privatePrefixAux___main___boxed(obj*);
namespace lean {
obj* add_protected_core(obj*, obj*);
}
obj* l_List_toArrayAux___main___rarg(obj*, obj*);
obj* l_Lean_mkProtectedExtension___lambda__1(obj*, obj*);
obj* l_Lean_SimplePersistentEnvExtension_getState___rarg(obj*, obj*);
extern obj* l_Lean_Inhabited;
obj* l_List_redLength___main___rarg(obj*);
obj* l_Lean_isPrivateNameExport___boxed(obj*);
obj* l_Lean_isProtected___boxed(obj*, obj*);
obj* l_Lean_isPrivateName___main___boxed(obj*);
obj* l___private_init_lean_modifiers_2__privatePrefixAux(obj*);
obj* l___private_init_lean_modifiers_2__privatePrefixAux___main(obj*);
obj* l_Array_mkEmpty(obj*, obj*);
obj* l___private_init_lean_modifiers_1__privateToUserNameAux(obj*);
obj* l_Lean_protectedExt___elambda__1(obj*);
obj* l_Array_swap(obj*, obj*, obj*, obj*);
uint8 l_Lean_NameSet_contains(obj*, obj*);
obj* l_RBNode_insert___at_Lean_NameSet_insert___spec__1(obj*, obj*, obj*);
obj* l_Lean_registerEnvExtensionUnsafe___rarg(obj*, obj*);
obj* l_Array_qsortAux___main___at_Lean_mkProtectedExtension___spec__1(obj*, obj*, obj*);
obj* l_Lean_Environment_getModuleIdxFor(obj*, obj*);
obj* l_Lean_mkProtectedExtension___closed__1;
namespace lean {
uint8 nat_dec_lt(obj*, obj*);
}
obj* l_Array_qsortAux___main___at_Lean_mkProtectedExtension___spec__1___boxed(obj*, obj*, obj*);
uint8 l_Lean_isPrivateName___main(obj*);
extern "C" obj* lean_name_mk_string(obj*, obj*);
obj* l_Lean_protectedExt;
obj* l_Lean_registerSimplePersistentEnvExtension___rarg(obj*, obj*);
obj* l_Lean_privateHeader;
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_Lean_EnvExtension_setStateUnsafe___rarg(obj*, obj*, obj*);
uint8 l_Array_binSearchAux___main___at_Lean_isProtected___spec__1(obj*, obj*, obj*, obj*);
obj* l___private_init_data_array_qsort_1__partitionAux___main___at_Lean_mkProtectedExtension___spec__2(obj*, obj*, obj*, obj*, obj*);
obj* l_Lean_protectedExt___elambda__2(obj*);
obj* l_Lean_mkProtectedExtension___lambda__2___boxed(obj*);
obj* l_Lean_protectedExt___elambda__3(obj*, obj*);
namespace lean {
obj* mk_private_name_core(obj*, obj*);
}
obj* l_Lean_PersistentEnvExtension_addEntry___rarg(obj*, obj*, obj*);
uint8 l_Lean_Name_quickLt(obj*, obj*);
extern "C" obj* lean_name_mk_numeral(obj*, obj*);
namespace lean {
uint8 is_protected_core(obj*, obj*);
}
obj* l_Array_size(obj*, obj*);
obj* l_Lean_isPrivateName___boxed(obj*);
namespace lean {
obj* mk_private_prefix_core(obj*);
}
obj* l_Array_get(obj*, obj*, obj*, obj*);
obj* l___private_init_lean_modifiers_1__privateToUserNameAux___main(obj*);
obj* l___private_init_lean_modifiers_2__privatePrefixAux___boxed(obj*);
namespace lean {
uint8 nat_dec_le(obj*, obj*);
}
obj* l_Lean_mkPrivateExtension(obj*);
namespace lean {
obj* nat_div(obj*, obj*);
}
obj* l_Lean_mkProtectedExtension(obj*);
obj* l_Array_binSearchAux___main___at_Lean_isProtected___spec__1___boxed(obj*, obj*, obj*, obj*);
obj* l_Lean_protectedExt___elambda__4(obj*, obj*, obj*);
namespace lean {
uint8 is_private_name_core(obj*);
}
obj* l_Lean_Name_append___main(obj*, obj*);
obj* l_Lean_privateExt;
obj* l_Lean_mkProtectedExtension___lambda__3(obj*);
obj* l_Lean_protectedExt___elambda__4___boxed(obj*, obj*, obj*);
obj* l_Lean_protectedExt___elambda__2___boxed(obj*);
namespace lean {
obj* private_to_user_name_core(obj*);
}
obj* l___private_init_data_array_qsort_1__partitionAux___main___at_Lean_mkProtectedExtension___spec__2(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; uint8 x_11; 
x_9 = l_Lean_Inhabited;
x_10 = lean::array_get(x_9, x_3, x_5);
x_11 = l_Lean_Name_quickLt(x_10, x_2);
lean::dec(x_10);
if (x_11 == 0)
{
obj* x_12; obj* x_13; 
x_12 = lean::mk_nat_obj(1u);
x_13 = lean::nat_add(x_5, x_12);
lean::dec(x_5);
x_5 = x_13;
goto _start;
}
else
{
obj* x_15; obj* x_16; obj* x_17; obj* x_18; 
x_15 = lean::array_swap(x_3, x_4, x_5);
x_16 = lean::mk_nat_obj(1u);
x_17 = lean::nat_add(x_4, x_16);
lean::dec(x_4);
x_18 = lean::nat_add(x_5, x_16);
lean::dec(x_5);
x_3 = x_15;
x_4 = x_17;
x_5 = x_18;
goto _start;
}
}
}
}
obj* l_Array_qsortAux___main___at_Lean_mkProtectedExtension___spec__1(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_52; obj* x_53; obj* x_54; uint8 x_55; 
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_52 = l_Lean_Inhabited;
x_53 = lean::array_get(x_52, x_1, x_7);
x_54 = lean::array_get(x_52, x_1, x_2);
x_55 = l_Lean_Name_quickLt(x_53, x_54);
lean::dec(x_54);
lean::dec(x_53);
if (x_55 == 0)
{
x_8 = x_1;
goto block_51;
}
else
{
obj* x_56; 
x_56 = lean::array_swap(x_1, x_2, x_7);
x_8 = x_56;
goto block_51;
}
block_51:
{
obj* x_9; obj* x_10; obj* x_11; uint8 x_12; 
x_9 = l_Lean_Inhabited;
x_10 = lean::array_get(x_9, x_8, x_3);
x_11 = lean::array_get(x_9, x_8, x_2);
x_12 = l_Lean_Name_quickLt(x_10, x_11);
lean::dec(x_11);
if (x_12 == 0)
{
obj* x_13; uint8 x_14; 
x_13 = lean::array_get(x_9, x_8, x_7);
x_14 = l_Lean_Name_quickLt(x_13, x_10);
lean::dec(x_13);
if (x_14 == 0)
{
obj* x_15; obj* x_16; obj* x_17; obj* x_18; obj* x_19; obj* x_20; 
lean::dec(x_7);
lean::inc(x_2, 2);
x_15 = l___private_init_data_array_qsort_1__partitionAux___main___at_Lean_mkProtectedExtension___spec__2(x_3, x_10, x_8, x_2, x_2);
lean::dec(x_10);
x_16 = lean::cnstr_get(x_15, 0);
lean::inc(x_16);
x_17 = lean::cnstr_get(x_15, 1);
lean::inc(x_17);
lean::dec(x_15);
x_18 = l_Array_qsortAux___main___at_Lean_mkProtectedExtension___spec__1(x_17, x_2, x_16);
x_19 = lean::mk_nat_obj(1u);
x_20 = lean::nat_add(x_16, x_19);
lean::dec(x_16);
x_1 = x_18;
x_2 = x_20;
goto _start;
}
else
{
obj* x_22; obj* x_23; obj* x_24; obj* x_25; obj* x_26; obj* x_27; obj* x_28; obj* x_29; 
lean::dec(x_10);
x_22 = lean::array_swap(x_8, x_7, x_3);
lean::dec(x_7);
x_23 = lean::array_get(x_9, x_22, x_3);
lean::inc(x_2, 2);
x_24 = l___private_init_data_array_qsort_1__partitionAux___main___at_Lean_mkProtectedExtension___spec__2(x_3, x_23, x_22, x_2, x_2);
lean::dec(x_23);
x_25 = lean::cnstr_get(x_24, 0);
lean::inc(x_25);
x_26 = lean::cnstr_get(x_24, 1);
lean::inc(x_26);
lean::dec(x_24);
x_27 = l_Array_qsortAux___main___at_Lean_mkProtectedExtension___spec__1(x_26, x_2, x_25);
x_28 = lean::mk_nat_obj(1u);
x_29 = lean::nat_add(x_25, x_28);
lean::dec(x_25);
x_1 = x_27;
x_2 = x_29;
goto _start;
}
}
else
{
obj* x_31; obj* x_32; obj* x_33; uint8 x_34; 
lean::dec(x_10);
x_31 = lean::array_swap(x_8, x_2, x_3);
x_32 = lean::array_get(x_9, x_31, x_7);
x_33 = lean::array_get(x_9, x_31, x_3);
x_34 = l_Lean_Name_quickLt(x_32, x_33);
lean::dec(x_32);
if (x_34 == 0)
{
obj* x_35; obj* x_36; obj* x_37; obj* x_38; obj* x_39; obj* x_40; 
lean::dec(x_7);
lean::inc(x_2, 2);
x_35 = l___private_init_data_array_qsort_1__partitionAux___main___at_Lean_mkProtectedExtension___spec__2(x_3, x_33, x_31, x_2, x_2);
lean::dec(x_33);
x_36 = lean::cnstr_get(x_35, 0);
lean::inc(x_36);
x_37 = lean::cnstr_get(x_35, 1);
lean::inc(x_37);
lean::dec(x_35);
x_38 = l_Array_qsortAux___main___at_Lean_mkProtectedExtension___spec__1(x_37, x_2, x_36);
x_39 = lean::mk_nat_obj(1u);
x_40 = lean::nat_add(x_36, x_39);
lean::dec(x_36);
x_1 = x_38;
x_2 = x_40;
goto _start;
}
else
{
obj* x_42; obj* x_43; obj* x_44; obj* x_45; obj* x_46; obj* x_47; obj* x_48; obj* x_49; 
lean::dec(x_33);
x_42 = lean::array_swap(x_31, x_7, x_3);
lean::dec(x_7);
x_43 = lean::array_get(x_9, x_42, x_3);
lean::inc(x_2, 2);
x_44 = l___private_init_data_array_qsort_1__partitionAux___main___at_Lean_mkProtectedExtension___spec__2(x_3, x_43, x_42, x_2, x_2);
lean::dec(x_43);
x_45 = lean::cnstr_get(x_44, 0);
lean::inc(x_45);
x_46 = lean::cnstr_get(x_44, 1);
lean::inc(x_46);
lean::dec(x_44);
x_47 = l_Array_qsortAux___main___at_Lean_mkProtectedExtension___spec__1(x_46, x_2, x_45);
x_48 = lean::mk_nat_obj(1u);
x_49 = lean::nat_add(x_45, x_48);
lean::dec(x_45);
x_1 = x_47;
x_2 = x_49;
goto _start;
}
}
}
}
}
}
obj* l_Lean_mkProtectedExtension___lambda__1(obj* x_1, obj* x_2) {
_start:
{
obj* x_3; obj* x_4; 
x_3 = lean::box(0);
x_4 = l_RBNode_insert___at_Lean_NameSet_insert___spec__1(x_1, x_2, x_3);
return x_4;
}
}
obj* l_Lean_mkProtectedExtension___lambda__2(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = lean::box(0);
return x_2;
}
}
obj* l_Lean_mkProtectedExtension___lambda__3(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; obj* x_9; 
x_2 = l_List_redLength___main___rarg(x_1);
x_3 = lean::mk_empty_array(x_2);
lean::dec(x_2);
x_4 = l_List_toArrayAux___main___rarg(x_1, x_3);
x_5 = lean::array_get_size(x_4);
x_6 = lean::mk_nat_obj(1u);
x_7 = lean::nat_sub(x_5, x_6);
lean::dec(x_5);
x_8 = lean::mk_nat_obj(0u);
x_9 = l_Array_qsortAux___main___at_Lean_mkProtectedExtension___spec__1(x_4, x_8, x_7);
lean::dec(x_7);
return x_9;
}
}
obj* _init_l_Lean_mkProtectedExtension___closed__1() {
_start:
{
obj* x_1; obj* x_2; obj* x_3; obj* x_4; obj* x_5; obj* x_6; obj* x_7; 
x_1 = lean::box(0);
x_2 = lean::mk_string("protected");
x_3 = lean_name_mk_string(x_1, x_2);
x_4 = lean::alloc_closure(reinterpret_cast<void*>(l_Lean_mkProtectedExtension___lambda__1), 2, 0);
x_5 = lean::alloc_closure(reinterpret_cast<void*>(l_Lean_mkProtectedExtension___lambda__2___boxed), 1, 0);
x_6 = lean::alloc_closure(reinterpret_cast<void*>(l_Lean_mkProtectedExtension___lambda__3), 1, 0);
x_7 = lean::alloc_cnstr(0, 4, 0);
lean::cnstr_set(x_7, 0, x_3);
lean::cnstr_set(x_7, 1, x_4);
lean::cnstr_set(x_7, 2, x_5);
lean::cnstr_set(x_7, 3, x_6);
return x_7;
}
}
obj* l_Lean_mkProtectedExtension(obj* x_1) {
_start:
{
obj* x_2; obj* x_3; 
x_2 = l_Lean_mkProtectedExtension___closed__1;
x_3 = l_Lean_registerSimplePersistentEnvExtension___rarg(x_2, x_1);
return x_3;
}
}
obj* l___private_init_data_array_qsort_1__partitionAux___main___at_Lean_mkProtectedExtension___spec__2___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_mkProtectedExtension___spec__2(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_mkProtectedExtension___spec__1___boxed(obj* x_1, obj* x_2, obj* x_3) {
_start:
{
obj* x_4; 
x_4 = l_Array_qsortAux___main___at_Lean_mkProtectedExtension___spec__1(x_1, x_2, x_3);
lean::dec(x_3);
return x_4;
}
}
obj* l_Lean_mkProtectedExtension___lambda__2___boxed(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = l_Lean_mkProtectedExtension___lambda__2(x_1);
lean::dec(x_1);
return x_2;
}
}
obj* l_Lean_protectedExt___elambda__1(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = lean::box(0);
return x_2;
}
}
obj* l_Lean_protectedExt___elambda__2(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = l_Array_empty___closed__1;
return x_2;
}
}
obj* l_Lean_protectedExt___elambda__3(obj* x_1, obj* x_2) {
_start:
{
lean::inc(x_1);
return x_1;
}
}
obj* l_Lean_protectedExt___elambda__4(obj* x_1, obj* x_2, obj* x_3) {
_start:
{
obj* x_4; 
x_4 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_4, 0, x_1);
lean::cnstr_set(x_4, 1, x_2);
return x_4;
}
}
obj* l_Lean_protectedExt___elambda__1___boxed(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = l_Lean_protectedExt___elambda__1(x_1);
lean::dec(x_1);
return x_2;
}
}
obj* l_Lean_protectedExt___elambda__2___boxed(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = l_Lean_protectedExt___elambda__2(x_1);
lean::dec(x_1);
return x_2;
}
}
obj* l_Lean_protectedExt___elambda__3___boxed(obj* x_1, obj* x_2) {
_start:
{
obj* x_3; 
x_3 = l_Lean_protectedExt___elambda__3(x_1, x_2);
lean::dec(x_2);
lean::dec(x_1);
return x_3;
}
}
obj* l_Lean_protectedExt___elambda__4___boxed(obj* x_1, obj* x_2, obj* x_3) {
_start:
{
obj* x_4; 
x_4 = l_Lean_protectedExt___elambda__4(x_1, x_2, x_3);
lean::dec(x_3);
return x_4;
}
}
namespace lean {
obj* add_protected_core(obj* x_1, obj* x_2) {
_start:
{
obj* x_3; obj* x_4; 
x_3 = l_Lean_protectedExt;
x_4 = l_Lean_PersistentEnvExtension_addEntry___rarg(x_3, x_1, x_2);
return x_4;
}
}
}
uint8 l_Array_binSearchAux___main___at_Lean_isProtected___spec__1(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)
{
uint8 x_6; 
lean::dec(x_4);
lean::dec(x_3);
x_6 = 0;
return x_6;
}
else
{
obj* x_7; obj* x_8; obj* x_9; obj* x_10; obj* x_11; uint8 x_12; 
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_Lean_Inhabited;
x_11 = lean::array_get(x_10, x_1, x_9);
x_12 = l_Lean_Name_quickLt(x_11, x_2);
if (x_12 == 0)
{
uint8 x_13; 
lean::dec(x_4);
x_13 = l_Lean_Name_quickLt(x_2, x_11);
lean::dec(x_11);
if (x_13 == 0)
{
uint8 x_14; 
lean::dec(x_9);
lean::dec(x_3);
x_14 = 1;
return x_14;
}
else
{
obj* x_15; uint8 x_16; 
x_15 = lean::mk_nat_obj(0u);
x_16 = lean::nat_dec_eq(x_9, x_15);
if (x_16 == 0)
{
obj* x_17; obj* x_18; 
x_17 = lean::mk_nat_obj(1u);
x_18 = lean::nat_sub(x_9, x_17);
lean::dec(x_9);
x_4 = x_18;
goto _start;
}
else
{
uint8 x_20; 
lean::dec(x_9);
lean::dec(x_3);
x_20 = 0;
return x_20;
}
}
}
else
{
obj* x_21; obj* x_22; 
lean::dec(x_11);
lean::dec(x_3);
x_21 = lean::mk_nat_obj(1u);
x_22 = lean::nat_add(x_9, x_21);
lean::dec(x_9);
x_3 = x_22;
goto _start;
}
}
}
}
namespace lean {
uint8 is_protected_core(obj* x_1, obj* x_2) {
_start:
{
obj* x_3; 
x_3 = l_Lean_Environment_getModuleIdxFor(x_1, x_2);
if (lean::obj_tag(x_3) == 0)
{
obj* x_4; obj* x_5; uint8 x_6; 
x_4 = l_Lean_protectedExt;
x_5 = l_Lean_SimplePersistentEnvExtension_getState___rarg(x_4, x_1);
lean::dec(x_1);
x_6 = l_Lean_NameSet_contains(x_5, x_2);
lean::dec(x_2);
lean::dec(x_5);
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::cnstr_get(x_3, 0);
lean::inc(x_7);
lean::dec(x_3);
x_8 = l_Lean_protectedExt;
x_9 = l_Lean_PersistentEnvExtension_getModuleEntries___rarg(x_8, x_1, x_7);
lean::dec(x_7);
lean::dec(x_1);
x_10 = lean::array_get_size(x_9);
x_11 = lean::mk_nat_obj(1u);
x_12 = lean::nat_sub(x_10, x_11);
lean::dec(x_10);
x_13 = lean::mk_nat_obj(0u);
x_14 = l_Array_binSearchAux___main___at_Lean_isProtected___spec__1(x_9, x_2, x_13, x_12);
lean::dec(x_2);
lean::dec(x_9);
return x_14;
}
}
}
}
obj* l_Array_binSearchAux___main___at_Lean_isProtected___spec__1___boxed(obj* x_1, obj* x_2, obj* x_3, obj* x_4) {
_start:
{
uint8 x_5; obj* x_6; 
x_5 = l_Array_binSearchAux___main___at_Lean_isProtected___spec__1(x_1, x_2, x_3, x_4);
lean::dec(x_2);
lean::dec(x_1);
x_6 = lean::box(x_5);
return x_6;
}
}
obj* l_Lean_isProtected___boxed(obj* x_1, obj* x_2) {
_start:
{
uint8 x_3; obj* x_4; 
x_3 = lean::is_protected_core(x_1, x_2);
x_4 = lean::box(x_3);
return x_4;
}
}
obj* l_Lean_mkPrivateExtension(obj* x_1) {
_start:
{
obj* x_2; obj* x_3; 
x_2 = lean::mk_nat_obj(1u);
x_3 = l_Lean_registerEnvExtensionUnsafe___rarg(x_2, x_1);
return x_3;
}
}
obj* _init_l_Lean_privateHeader() {
_start:
{
obj* x_1; obj* x_2; obj* x_3; 
x_1 = lean::box(0);
x_2 = lean::mk_string("_private");
x_3 = lean_name_mk_string(x_1, x_2);
return x_3;
}
}
namespace lean {
obj* mk_private_prefix_core(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; obj* x_9; obj* x_10; obj* x_11; 
x_2 = l_Lean_privateExt;
x_3 = l_Lean_EnvExtension_getStateUnsafe___rarg(x_2, x_1);
lean::inc(x_1);
x_4 = lean::environment_main_module_core(x_1);
x_5 = l_Lean_privateHeader;
x_6 = l_Lean_Name_append___main(x_5, x_4);
lean::inc(x_3);
x_7 = lean_name_mk_numeral(x_6, x_3);
x_8 = lean::mk_nat_obj(1u);
x_9 = lean::nat_add(x_3, x_8);
lean::dec(x_3);
x_10 = l_Lean_EnvExtension_setStateUnsafe___rarg(x_2, x_1, x_9);
x_11 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_11, 0, x_10);
lean::cnstr_set(x_11, 1, x_7);
return x_11;
}
}
}
namespace lean {
obj* mk_private_name_core(obj* x_1, obj* x_2) {
_start:
{
obj* x_3; uint8 x_4; 
x_3 = lean::mk_private_prefix_core(x_1);
x_4 = !lean::is_exclusive(x_3);
if (x_4 == 0)
{
obj* x_5; obj* x_6; 
x_5 = lean::cnstr_get(x_3, 1);
x_6 = l_Lean_Name_append___main(x_5, x_2);
lean::dec(x_5);
lean::cnstr_set(x_3, 1, x_6);
return x_3;
}
else
{
obj* x_7; obj* x_8; obj* x_9; obj* x_10; 
x_7 = lean::cnstr_get(x_3, 0);
x_8 = lean::cnstr_get(x_3, 1);
lean::inc(x_8);
lean::inc(x_7);
lean::dec(x_3);
x_9 = l_Lean_Name_append___main(x_8, x_2);
lean::dec(x_8);
x_10 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_10, 0, x_7);
lean::cnstr_set(x_10, 1, x_9);
return x_10;
}
}
}
}
uint8 l_Lean_isPrivateName___main(obj* x_1) {
_start:
{
switch (lean::obj_tag(x_1)) {
case 0:
{
uint8 x_2; 
x_2 = 0;
return x_2;
}
case 1:
{
obj* x_3; obj* x_4; uint8 x_5; 
x_3 = lean::cnstr_get(x_1, 0);
x_4 = l_Lean_privateHeader;
x_5 = lean_name_dec_eq(x_1, x_4);
if (x_5 == 0)
{
x_1 = x_3;
goto _start;
}
else
{
uint8 x_7; 
x_7 = 1;
return x_7;
}
}
default: 
{
obj* x_8; 
x_8 = lean::cnstr_get(x_1, 0);
x_1 = x_8;
goto _start;
}
}
}
}
obj* l_Lean_isPrivateName___main___boxed(obj* x_1) {
_start:
{
uint8 x_2; obj* x_3; 
x_2 = l_Lean_isPrivateName___main(x_1);
lean::dec(x_1);
x_3 = lean::box(x_2);
return x_3;
}
}
uint8 l_Lean_isPrivateName(obj* x_1) {
_start:
{
uint8 x_2; 
x_2 = l_Lean_isPrivateName___main(x_1);
return x_2;
}
}
obj* l_Lean_isPrivateName___boxed(obj* x_1) {
_start:
{
uint8 x_2; obj* x_3; 
x_2 = l_Lean_isPrivateName(x_1);
lean::dec(x_1);
x_3 = lean::box(x_2);
return x_3;
}
}
namespace lean {
uint8 is_private_name_core(obj* x_1) {
_start:
{
uint8 x_2; 
x_2 = l_Lean_isPrivateName___main(x_1);
lean::dec(x_1);
return x_2;
}
}
}
obj* l_Lean_isPrivateNameExport___boxed(obj* x_1) {
_start:
{
uint8 x_2; obj* x_3; 
x_2 = lean::is_private_name_core(x_1);
x_3 = lean::box(x_2);
return x_3;
}
}
obj* l___private_init_lean_modifiers_1__privateToUserNameAux___main(obj* x_1) {
_start:
{
switch (lean::obj_tag(x_1)) {
case 0:
{
return x_1;
}
case 1:
{
obj* x_2; obj* x_3; obj* x_4; obj* x_5; 
x_2 = lean::cnstr_get(x_1, 0);
lean::inc(x_2);
x_3 = lean::cnstr_get(x_1, 1);
lean::inc(x_3);
lean::dec(x_1);
x_4 = l___private_init_lean_modifiers_1__privateToUserNameAux___main(x_2);
x_5 = lean_name_mk_string(x_4, x_3);
return x_5;
}
default: 
{
obj* x_6; 
lean::dec(x_1);
x_6 = lean::box(0);
return x_6;
}
}
}
}
obj* l___private_init_lean_modifiers_1__privateToUserNameAux(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = l___private_init_lean_modifiers_1__privateToUserNameAux___main(x_1);
return x_2;
}
}
namespace lean {
obj* private_to_user_name_core(obj* x_1) {
_start:
{
uint8 x_2; 
x_2 = l_Lean_isPrivateName___main(x_1);
if (x_2 == 0)
{
obj* x_3; 
lean::dec(x_1);
x_3 = lean::box(0);
return x_3;
}
else
{
obj* x_4; obj* x_5; 
x_4 = l___private_init_lean_modifiers_1__privateToUserNameAux___main(x_1);
x_5 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_5, 0, x_4);
return x_5;
}
}
}
}
obj* l___private_init_lean_modifiers_2__privatePrefixAux___main(obj* x_1) {
_start:
{
switch (lean::obj_tag(x_1)) {
case 0:
{
return x_1;
}
case 1:
{
obj* x_2; 
x_2 = lean::cnstr_get(x_1, 0);
x_1 = x_2;
goto _start;
}
default: 
{
lean::inc(x_1);
return x_1;
}
}
}
}
obj* l___private_init_lean_modifiers_2__privatePrefixAux___main___boxed(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = l___private_init_lean_modifiers_2__privatePrefixAux___main(x_1);
lean::dec(x_1);
return x_2;
}
}
obj* l___private_init_lean_modifiers_2__privatePrefixAux(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = l___private_init_lean_modifiers_2__privatePrefixAux___main(x_1);
return x_2;
}
}
obj* l___private_init_lean_modifiers_2__privatePrefixAux___boxed(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = l___private_init_lean_modifiers_2__privatePrefixAux(x_1);
lean::dec(x_1);
return x_2;
}
}
namespace lean {
obj* private_prefix_core(obj* x_1) {
_start:
{
uint8 x_2; 
x_2 = l_Lean_isPrivateName___main(x_1);
if (x_2 == 0)
{
obj* x_3; 
lean::dec(x_1);
x_3 = lean::box(0);
return x_3;
}
else
{
obj* x_4; obj* x_5; 
x_4 = l___private_init_lean_modifiers_2__privatePrefixAux___main(x_1);
lean::dec(x_1);
x_5 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_5, 0, x_4);
return x_5;
}
}
}
}
obj* initialize_init_lean_environment(obj*);
static bool _G_initialized = false;
obj* initialize_init_lean_modifiers(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;
l_Lean_mkProtectedExtension___closed__1 = _init_l_Lean_mkProtectedExtension___closed__1();
lean::mark_persistent(l_Lean_mkProtectedExtension___closed__1);
REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name("Lean"), "mkProtectedExtension"), 1, l_Lean_mkProtectedExtension);
w = l_Lean_mkProtectedExtension(w);
if (io_result_is_error(w)) return w;
l_Lean_protectedExt = io_result_get_value(w);
lean::mark_persistent(l_Lean_protectedExt);
lean::register_constant(lean::mk_const_name(lean::mk_const_name("Lean"), "protectedExt"), l_Lean_protectedExt);
REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name("Lean"), "addProtected"), 2, lean::add_protected_core);
REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name("Lean"), "isProtected"), 2, l_Lean_isProtected___boxed);
REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name("Lean"), "mkPrivateExtension"), 1, l_Lean_mkPrivateExtension);
w = l_Lean_mkPrivateExtension(w);
if (io_result_is_error(w)) return w;
l_Lean_privateExt = io_result_get_value(w);
lean::mark_persistent(l_Lean_privateExt);
lean::register_constant(lean::mk_const_name(lean::mk_const_name("Lean"), "privateExt"), l_Lean_privateExt);
l_Lean_privateHeader = _init_l_Lean_privateHeader();
lean::mark_persistent(l_Lean_privateHeader);
lean::register_constant(lean::mk_const_name(lean::mk_const_name("Lean"), "privateHeader"), l_Lean_privateHeader);
REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name("Lean"), "mkPrivatePrefix"), 1, lean::mk_private_prefix_core);
REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name("Lean"), "mkPrivateName"), 2, lean::mk_private_name_core);
REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name("Lean"), "isPrivateName"), 1, l_Lean_isPrivateName___boxed);
REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name("Lean"), "isPrivateNameExport"), 1, l_Lean_isPrivateNameExport___boxed);
REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name("Lean"), "privateToUserName"), 1, lean::private_to_user_name_core);
REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name("Lean"), "privatePrefix"), 1, lean::private_prefix_core);
return w;
}
