chore: update stage0

This commit is contained in:
Lean stage0 autoupdater 2026-04-20 22:03:37 +00:00
parent a3cb98bb27
commit e2f9df6578
22 changed files with 112926 additions and 65289 deletions

View file

@ -22,7 +22,6 @@ options get_default_options() {
opts = opts.update({"quotPrecheck"}, true);
opts = opts.update({"pp", "rawOnError"}, true);
// bump stage0 to pick up `ControlInfo.sequence` aggregating past `numRegularExits == 0`
// Temporary, core-only flags for editing (i.e. must be part of stage0/bin/lean). Must be synced
// with `LEAN_EXTRA_MAKE_OPTS` build flags in src/CMakeLists.txt.

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
// Lean compiler output
// Module: Std.Internal.Http
// Imports: public import Std.Internal.Http.Data public import Std.Internal.Http.Protocol.H1
// Imports: public import Std.Internal.Http.Server public import Std.Internal.Http.Test.Helpers
#include <lean/lean.h>
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunused-parameter"
@ -13,17 +13,17 @@
#ifdef __cplusplus
extern "C" {
#endif
lean_object* runtime_initialize_Std_Internal_Http_Data(uint8_t builtin);
lean_object* runtime_initialize_Std_Internal_Http_Protocol_H1(uint8_t builtin);
lean_object* runtime_initialize_Std_Internal_Http_Server(uint8_t builtin);
lean_object* runtime_initialize_Std_Internal_Http_Test_Helpers(uint8_t builtin);
static bool _G_runtime_initialized = false;
LEAN_EXPORT lean_object* runtime_initialize_Std_Internal_Http(uint8_t builtin) {
lean_object * res;
if (_G_runtime_initialized) return lean_io_result_mk_ok(lean_box(0));
_G_runtime_initialized = true;
res = runtime_initialize_Std_Internal_Http_Data(builtin);
res = runtime_initialize_Std_Internal_Http_Server(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = runtime_initialize_Std_Internal_Http_Protocol_H1(builtin);
res = runtime_initialize_Std_Internal_Http_Test_Helpers(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
return lean_io_result_mk_ok(lean_box(0));
@ -35,17 +35,17 @@ if (_G_meta_initialized) return lean_io_result_mk_ok(lean_box(0));
_G_meta_initialized = true;
return lean_io_result_mk_ok(lean_box(0));
}
lean_object* initialize_Std_Internal_Http_Data(uint8_t builtin);
lean_object* initialize_Std_Internal_Http_Protocol_H1(uint8_t builtin);
lean_object* initialize_Std_Internal_Http_Server(uint8_t builtin);
lean_object* initialize_Std_Internal_Http_Test_Helpers(uint8_t builtin);
static bool _G_initialized = false;
LEAN_EXPORT lean_object* initialize_Std_Internal_Http(uint8_t builtin) {
lean_object * res;
if (_G_initialized) return lean_io_result_mk_ok(lean_box(0));
_G_initialized = true;
res = initialize_Std_Internal_Http_Data(builtin);
res = initialize_Std_Internal_Http_Server(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Std_Internal_Http_Protocol_H1(builtin);
res = initialize_Std_Internal_Http_Test_Helpers(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = runtime_initialize_Std_Internal_Http(builtin);

View file

@ -25,8 +25,10 @@ LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__3(lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__3___boxed(lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__4(lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__4___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__5(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__5___boxed(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__5(lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__5___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__6(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__6___boxed(lean_object*, lean_object*, lean_object*);
static const lean_closure_object l_Std_Http_Body_instAny___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_Std_Http_Body_instAny___lam__0___boxed, .m_arity = 2, .m_num_fixed = 0, .m_objs = {} };
static const lean_object* l_Std_Http_Body_instAny___closed__0 = (const lean_object*)&l_Std_Http_Body_instAny___closed__0_value;
static const lean_closure_object l_Std_Http_Body_instAny___closed__1_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_Std_Http_Body_instAny___lam__1___boxed, .m_arity = 2, .m_num_fixed = 0, .m_objs = {} };
@ -37,203 +39,229 @@ static const lean_closure_object l_Std_Http_Body_instAny___closed__3_value = {.m
static const lean_object* l_Std_Http_Body_instAny___closed__3 = (const lean_object*)&l_Std_Http_Body_instAny___closed__3_value;
static const lean_closure_object l_Std_Http_Body_instAny___closed__4_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_Std_Http_Body_instAny___lam__4___boxed, .m_arity = 2, .m_num_fixed = 0, .m_objs = {} };
static const lean_object* l_Std_Http_Body_instAny___closed__4 = (const lean_object*)&l_Std_Http_Body_instAny___closed__4_value;
static const lean_closure_object l_Std_Http_Body_instAny___closed__5_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_Std_Http_Body_instAny___lam__5___boxed, .m_arity = 3, .m_num_fixed = 0, .m_objs = {} };
static const lean_closure_object l_Std_Http_Body_instAny___closed__5_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_Std_Http_Body_instAny___lam__5___boxed, .m_arity = 2, .m_num_fixed = 0, .m_objs = {} };
static const lean_object* l_Std_Http_Body_instAny___closed__5 = (const lean_object*)&l_Std_Http_Body_instAny___closed__5_value;
static const lean_ctor_object l_Std_Http_Body_instAny___closed__6_value = {.m_header = {.m_rc = 0, .m_cs_sz = sizeof(lean_ctor_object) + sizeof(void*)*6 + 0, .m_other = 6, .m_tag = 0}, .m_objs = {((lean_object*)&l_Std_Http_Body_instAny___closed__0_value),((lean_object*)&l_Std_Http_Body_instAny___closed__1_value),((lean_object*)&l_Std_Http_Body_instAny___closed__2_value),((lean_object*)&l_Std_Http_Body_instAny___closed__3_value),((lean_object*)&l_Std_Http_Body_instAny___closed__4_value),((lean_object*)&l_Std_Http_Body_instAny___closed__5_value)}};
static const lean_closure_object l_Std_Http_Body_instAny___closed__6_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_Std_Http_Body_instAny___lam__6___boxed, .m_arity = 3, .m_num_fixed = 0, .m_objs = {} };
static const lean_object* l_Std_Http_Body_instAny___closed__6 = (const lean_object*)&l_Std_Http_Body_instAny___closed__6_value;
LEAN_EXPORT const lean_object* l_Std_Http_Body_instAny = (const lean_object*)&l_Std_Http_Body_instAny___closed__6_value;
static const lean_ctor_object l_Std_Http_Body_instAny___closed__7_value = {.m_header = {.m_rc = 0, .m_cs_sz = sizeof(lean_ctor_object) + sizeof(void*)*7 + 0, .m_other = 7, .m_tag = 0}, .m_objs = {((lean_object*)&l_Std_Http_Body_instAny___closed__0_value),((lean_object*)&l_Std_Http_Body_instAny___closed__1_value),((lean_object*)&l_Std_Http_Body_instAny___closed__2_value),((lean_object*)&l_Std_Http_Body_instAny___closed__3_value),((lean_object*)&l_Std_Http_Body_instAny___closed__4_value),((lean_object*)&l_Std_Http_Body_instAny___closed__5_value),((lean_object*)&l_Std_Http_Body_instAny___closed__6_value)}};
static const lean_object* l_Std_Http_Body_instAny___closed__7 = (const lean_object*)&l_Std_Http_Body_instAny___closed__7_value;
LEAN_EXPORT const lean_object* l_Std_Http_Body_instAny = (const lean_object*)&l_Std_Http_Body_instAny___closed__7_value;
LEAN_EXPORT lean_object* l_Std_Http_Body_Any_ofBody___redArg(lean_object* v_inst_1_, lean_object* v_body_2_){
_start:
{
lean_object* v_recv_3_; lean_object* v_close_4_; lean_object* v_isClosed_5_; lean_object* v_recvSelector_6_; lean_object* v_getKnownSize_7_; lean_object* v_setKnownSize_8_; lean_object* v___x_10_; uint8_t v_isShared_11_; uint8_t v_isSharedCheck_21_;
lean_object* v_recv_3_; lean_object* v_close_4_; lean_object* v_isClosed_5_; lean_object* v_recvSelector_6_; lean_object* v_tryRecv_7_; lean_object* v_getKnownSize_8_; lean_object* v_setKnownSize_9_; lean_object* v___x_11_; uint8_t v_isShared_12_; uint8_t v_isSharedCheck_23_;
v_recv_3_ = lean_ctor_get(v_inst_1_, 0);
v_close_4_ = lean_ctor_get(v_inst_1_, 1);
v_isClosed_5_ = lean_ctor_get(v_inst_1_, 2);
v_recvSelector_6_ = lean_ctor_get(v_inst_1_, 3);
v_getKnownSize_7_ = lean_ctor_get(v_inst_1_, 4);
v_setKnownSize_8_ = lean_ctor_get(v_inst_1_, 5);
v_isSharedCheck_21_ = !lean_is_exclusive(v_inst_1_);
if (v_isSharedCheck_21_ == 0)
v_tryRecv_7_ = lean_ctor_get(v_inst_1_, 4);
v_getKnownSize_8_ = lean_ctor_get(v_inst_1_, 5);
v_setKnownSize_9_ = lean_ctor_get(v_inst_1_, 6);
v_isSharedCheck_23_ = !lean_is_exclusive(v_inst_1_);
if (v_isSharedCheck_23_ == 0)
{
v___x_10_ = v_inst_1_;
v_isShared_11_ = v_isSharedCheck_21_;
goto v_resetjp_9_;
v___x_11_ = v_inst_1_;
v_isShared_12_ = v_isSharedCheck_23_;
goto v_resetjp_10_;
}
else
{
lean_inc(v_setKnownSize_8_);
lean_inc(v_getKnownSize_7_);
lean_inc(v_setKnownSize_9_);
lean_inc(v_getKnownSize_8_);
lean_inc(v_tryRecv_7_);
lean_inc(v_recvSelector_6_);
lean_inc(v_isClosed_5_);
lean_inc(v_close_4_);
lean_inc(v_recv_3_);
lean_dec(v_inst_1_);
v___x_10_ = lean_box(0);
v_isShared_11_ = v_isSharedCheck_21_;
goto v_resetjp_9_;
v___x_11_ = lean_box(0);
v_isShared_12_ = v_isSharedCheck_23_;
goto v_resetjp_10_;
}
v_resetjp_9_:
v_resetjp_10_:
{
lean_object* v___x_12_; lean_object* v___x_13_; lean_object* v___x_14_; lean_object* v___x_15_; lean_object* v___x_16_; lean_object* v___x_17_; lean_object* v___x_19_;
lean_inc_n(v_body_2_, 5);
v___x_12_ = lean_apply_1(v_recv_3_, v_body_2_);
v___x_13_ = lean_apply_1(v_close_4_, v_body_2_);
v___x_14_ = lean_apply_1(v_isClosed_5_, v_body_2_);
v___x_15_ = lean_apply_1(v_recvSelector_6_, v_body_2_);
v___x_16_ = lean_apply_1(v_getKnownSize_7_, v_body_2_);
v___x_17_ = lean_apply_1(v_setKnownSize_8_, v_body_2_);
if (v_isShared_11_ == 0)
lean_object* v___x_13_; lean_object* v___x_14_; lean_object* v___x_15_; lean_object* v___x_16_; lean_object* v___x_17_; lean_object* v___x_18_; lean_object* v___x_19_; lean_object* v___x_21_;
lean_inc_n(v_body_2_, 6);
v___x_13_ = lean_apply_1(v_recv_3_, v_body_2_);
v___x_14_ = lean_apply_1(v_close_4_, v_body_2_);
v___x_15_ = lean_apply_1(v_isClosed_5_, v_body_2_);
v___x_16_ = lean_apply_1(v_recvSelector_6_, v_body_2_);
v___x_17_ = lean_apply_1(v_tryRecv_7_, v_body_2_);
v___x_18_ = lean_apply_1(v_getKnownSize_8_, v_body_2_);
v___x_19_ = lean_apply_1(v_setKnownSize_9_, v_body_2_);
if (v_isShared_12_ == 0)
{
lean_ctor_set(v___x_10_, 5, v___x_17_);
lean_ctor_set(v___x_10_, 4, v___x_16_);
lean_ctor_set(v___x_10_, 3, v___x_15_);
lean_ctor_set(v___x_10_, 2, v___x_14_);
lean_ctor_set(v___x_10_, 1, v___x_13_);
lean_ctor_set(v___x_10_, 0, v___x_12_);
v___x_19_ = v___x_10_;
goto v_reusejp_18_;
lean_ctor_set(v___x_11_, 6, v___x_19_);
lean_ctor_set(v___x_11_, 5, v___x_18_);
lean_ctor_set(v___x_11_, 4, v___x_17_);
lean_ctor_set(v___x_11_, 3, v___x_16_);
lean_ctor_set(v___x_11_, 2, v___x_15_);
lean_ctor_set(v___x_11_, 1, v___x_14_);
lean_ctor_set(v___x_11_, 0, v___x_13_);
v___x_21_ = v___x_11_;
goto v_reusejp_20_;
}
else
{
lean_object* v_reuseFailAlloc_20_;
v_reuseFailAlloc_20_ = lean_alloc_ctor(0, 6, 0);
lean_ctor_set(v_reuseFailAlloc_20_, 0, v___x_12_);
lean_ctor_set(v_reuseFailAlloc_20_, 1, v___x_13_);
lean_ctor_set(v_reuseFailAlloc_20_, 2, v___x_14_);
lean_ctor_set(v_reuseFailAlloc_20_, 3, v___x_15_);
lean_ctor_set(v_reuseFailAlloc_20_, 4, v___x_16_);
lean_ctor_set(v_reuseFailAlloc_20_, 5, v___x_17_);
v___x_19_ = v_reuseFailAlloc_20_;
goto v_reusejp_18_;
lean_object* v_reuseFailAlloc_22_;
v_reuseFailAlloc_22_ = lean_alloc_ctor(0, 7, 0);
lean_ctor_set(v_reuseFailAlloc_22_, 0, v___x_13_);
lean_ctor_set(v_reuseFailAlloc_22_, 1, v___x_14_);
lean_ctor_set(v_reuseFailAlloc_22_, 2, v___x_15_);
lean_ctor_set(v_reuseFailAlloc_22_, 3, v___x_16_);
lean_ctor_set(v_reuseFailAlloc_22_, 4, v___x_17_);
lean_ctor_set(v_reuseFailAlloc_22_, 5, v___x_18_);
lean_ctor_set(v_reuseFailAlloc_22_, 6, v___x_19_);
v___x_21_ = v_reuseFailAlloc_22_;
goto v_reusejp_20_;
}
v_reusejp_18_:
v_reusejp_20_:
{
return v___x_19_;
return v___x_21_;
}
}
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_Any_ofBody(lean_object* v_00_u03b1_22_, lean_object* v_inst_23_, lean_object* v_body_24_){
LEAN_EXPORT lean_object* l_Std_Http_Body_Any_ofBody(lean_object* v_00_u03b1_24_, lean_object* v_inst_25_, lean_object* v_body_26_){
_start:
{
lean_object* v___x_25_;
v___x_25_ = l_Std_Http_Body_Any_ofBody___redArg(v_inst_23_, v_body_24_);
return v___x_25_;
lean_object* v___x_27_;
v___x_27_ = l_Std_Http_Body_Any_ofBody___redArg(v_inst_25_, v_body_26_);
return v___x_27_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__0(lean_object* v_self_26_){
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__0(lean_object* v_self_28_){
_start:
{
lean_object* v_recv_28_; lean_object* v___x_29_;
v_recv_28_ = lean_ctor_get(v_self_26_, 0);
lean_inc_ref(v_recv_28_);
lean_dec_ref(v_self_26_);
v___x_29_ = lean_apply_1(v_recv_28_, lean_box(0));
return v___x_29_;
lean_object* v_recv_30_; lean_object* v___x_31_;
v_recv_30_ = lean_ctor_get(v_self_28_, 0);
lean_inc_ref(v_recv_30_);
lean_dec_ref(v_self_28_);
v___x_31_ = lean_apply_1(v_recv_30_, lean_box(0));
return v___x_31_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__0___boxed(lean_object* v_self_30_, lean_object* v___y_31_){
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__0___boxed(lean_object* v_self_32_, lean_object* v___y_33_){
_start:
{
lean_object* v_res_32_;
v_res_32_ = l_Std_Http_Body_instAny___lam__0(v_self_30_);
return v_res_32_;
lean_object* v_res_34_;
v_res_34_ = l_Std_Http_Body_instAny___lam__0(v_self_32_);
return v_res_34_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__1(lean_object* v_self_33_){
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__1(lean_object* v_self_35_){
_start:
{
lean_object* v_close_35_; lean_object* v___x_36_;
v_close_35_ = lean_ctor_get(v_self_33_, 1);
lean_inc_ref(v_close_35_);
lean_dec_ref(v_self_33_);
v___x_36_ = lean_apply_1(v_close_35_, lean_box(0));
return v___x_36_;
lean_object* v_close_37_; lean_object* v___x_38_;
v_close_37_ = lean_ctor_get(v_self_35_, 1);
lean_inc_ref(v_close_37_);
lean_dec_ref(v_self_35_);
v___x_38_ = lean_apply_1(v_close_37_, lean_box(0));
return v___x_38_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__1___boxed(lean_object* v_self_37_, lean_object* v___y_38_){
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__1___boxed(lean_object* v_self_39_, lean_object* v___y_40_){
_start:
{
lean_object* v_res_39_;
v_res_39_ = l_Std_Http_Body_instAny___lam__1(v_self_37_);
return v_res_39_;
lean_object* v_res_41_;
v_res_41_ = l_Std_Http_Body_instAny___lam__1(v_self_39_);
return v_res_41_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__2(lean_object* v_self_40_){
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__2(lean_object* v_self_42_){
_start:
{
lean_object* v_isClosed_42_; lean_object* v___x_43_;
v_isClosed_42_ = lean_ctor_get(v_self_40_, 2);
lean_inc_ref(v_isClosed_42_);
lean_dec_ref(v_self_40_);
v___x_43_ = lean_apply_1(v_isClosed_42_, lean_box(0));
return v___x_43_;
lean_object* v_isClosed_44_; lean_object* v___x_45_;
v_isClosed_44_ = lean_ctor_get(v_self_42_, 2);
lean_inc_ref(v_isClosed_44_);
lean_dec_ref(v_self_42_);
v___x_45_ = lean_apply_1(v_isClosed_44_, lean_box(0));
return v___x_45_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__2___boxed(lean_object* v_self_44_, lean_object* v___y_45_){
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__2___boxed(lean_object* v_self_46_, lean_object* v___y_47_){
_start:
{
lean_object* v_res_46_;
v_res_46_ = l_Std_Http_Body_instAny___lam__2(v_self_44_);
return v_res_46_;
lean_object* v_res_48_;
v_res_48_ = l_Std_Http_Body_instAny___lam__2(v_self_46_);
return v_res_48_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__3(lean_object* v_self_47_){
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__3(lean_object* v_self_49_){
_start:
{
lean_object* v_recvSelector_48_;
v_recvSelector_48_ = lean_ctor_get(v_self_47_, 3);
lean_inc_ref(v_recvSelector_48_);
return v_recvSelector_48_;
lean_object* v_recvSelector_50_;
v_recvSelector_50_ = lean_ctor_get(v_self_49_, 3);
lean_inc_ref(v_recvSelector_50_);
return v_recvSelector_50_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__3___boxed(lean_object* v_self_49_){
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__3___boxed(lean_object* v_self_51_){
_start:
{
lean_object* v_res_50_;
v_res_50_ = l_Std_Http_Body_instAny___lam__3(v_self_49_);
lean_dec_ref(v_self_49_);
return v_res_50_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__4(lean_object* v_self_51_){
_start:
{
lean_object* v_getKnownSize_53_; lean_object* v___x_54_;
v_getKnownSize_53_ = lean_ctor_get(v_self_51_, 4);
lean_inc_ref(v_getKnownSize_53_);
lean_object* v_res_52_;
v_res_52_ = l_Std_Http_Body_instAny___lam__3(v_self_51_);
lean_dec_ref(v_self_51_);
v___x_54_ = lean_apply_1(v_getKnownSize_53_, lean_box(0));
return v___x_54_;
return v_res_52_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__4___boxed(lean_object* v_self_55_, lean_object* v___y_56_){
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__4(lean_object* v_self_53_){
_start:
{
lean_object* v_res_57_;
v_res_57_ = l_Std_Http_Body_instAny___lam__4(v_self_55_);
return v_res_57_;
lean_object* v_tryRecv_55_; lean_object* v___x_56_;
v_tryRecv_55_ = lean_ctor_get(v_self_53_, 4);
lean_inc_ref(v_tryRecv_55_);
lean_dec_ref(v_self_53_);
v___x_56_ = lean_apply_1(v_tryRecv_55_, lean_box(0));
return v___x_56_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__5(lean_object* v_self_58_, lean_object* v___y_59_){
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__4___boxed(lean_object* v_self_57_, lean_object* v___y_58_){
_start:
{
lean_object* v_setKnownSize_61_; lean_object* v___x_62_;
v_setKnownSize_61_ = lean_ctor_get(v_self_58_, 5);
lean_inc_ref(v_setKnownSize_61_);
lean_dec_ref(v_self_58_);
v___x_62_ = lean_apply_2(v_setKnownSize_61_, v___y_59_, lean_box(0));
return v___x_62_;
lean_object* v_res_59_;
v_res_59_ = l_Std_Http_Body_instAny___lam__4(v_self_57_);
return v_res_59_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__5___boxed(lean_object* v_self_63_, lean_object* v___y_64_, lean_object* v___y_65_){
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__5(lean_object* v_self_60_){
_start:
{
lean_object* v_getKnownSize_62_; lean_object* v___x_63_;
v_getKnownSize_62_ = lean_ctor_get(v_self_60_, 5);
lean_inc_ref(v_getKnownSize_62_);
lean_dec_ref(v_self_60_);
v___x_63_ = lean_apply_1(v_getKnownSize_62_, lean_box(0));
return v___x_63_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__5___boxed(lean_object* v_self_64_, lean_object* v___y_65_){
_start:
{
lean_object* v_res_66_;
v_res_66_ = l_Std_Http_Body_instAny___lam__5(v_self_63_, v___y_64_);
v_res_66_ = l_Std_Http_Body_instAny___lam__5(v_self_64_);
return v_res_66_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__6(lean_object* v_self_67_, lean_object* v___y_68_){
_start:
{
lean_object* v_setKnownSize_70_; lean_object* v___x_71_;
v_setKnownSize_70_ = lean_ctor_get(v_self_67_, 6);
lean_inc_ref(v_setKnownSize_70_);
lean_dec_ref(v_self_67_);
v___x_71_ = lean_apply_2(v_setKnownSize_70_, v___y_68_, lean_box(0));
return v___x_71_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_instAny___lam__6___boxed(lean_object* v_self_72_, lean_object* v___y_73_, lean_object* v___y_74_){
_start:
{
lean_object* v_res_75_;
v_res_75_ = l_Std_Http_Body_instAny___lam__6(v_self_72_, v___y_73_);
return v_res_75_;
}
}
lean_object* runtime_initialize_Std_Internal_Http_Data_Body_Basic(uint8_t builtin);
static bool _G_runtime_initialized = false;
LEAN_EXPORT lean_object* runtime_initialize_Std_Internal_Http_Data_Body_Any(uint8_t builtin) {

View file

@ -57,6 +57,16 @@ LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_isClosed___redArg();
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_isClosed___redArg___boxed(lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_isClosed(lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_isClosed___boxed(lean_object*, lean_object*);
static const lean_ctor_object l_Std_Http_Body_Empty_tryRecv___redArg___closed__0_value = {.m_header = {.m_rc = 0, .m_cs_sz = sizeof(lean_ctor_object) + sizeof(void*)*1 + 0, .m_other = 1, .m_tag = 1}, .m_objs = {((lean_object*)(((size_t)(0) << 1) | 1))}};
static const lean_object* l_Std_Http_Body_Empty_tryRecv___redArg___closed__0 = (const lean_object*)&l_Std_Http_Body_Empty_tryRecv___redArg___closed__0_value;
static const lean_ctor_object l_Std_Http_Body_Empty_tryRecv___redArg___closed__1_value = {.m_header = {.m_rc = 0, .m_cs_sz = sizeof(lean_ctor_object) + sizeof(void*)*1 + 0, .m_other = 1, .m_tag = 1}, .m_objs = {((lean_object*)&l_Std_Http_Body_Empty_tryRecv___redArg___closed__0_value)}};
static const lean_object* l_Std_Http_Body_Empty_tryRecv___redArg___closed__1 = (const lean_object*)&l_Std_Http_Body_Empty_tryRecv___redArg___closed__1_value;
static const lean_ctor_object l_Std_Http_Body_Empty_tryRecv___redArg___closed__2_value = {.m_header = {.m_rc = 0, .m_cs_sz = sizeof(lean_ctor_object) + sizeof(void*)*1 + 0, .m_other = 1, .m_tag = 0}, .m_objs = {((lean_object*)&l_Std_Http_Body_Empty_tryRecv___redArg___closed__1_value)}};
static const lean_object* l_Std_Http_Body_Empty_tryRecv___redArg___closed__2 = (const lean_object*)&l_Std_Http_Body_Empty_tryRecv___redArg___closed__2_value;
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_tryRecv___redArg();
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_tryRecv___redArg___boxed(lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_tryRecv(lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_tryRecv___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_recvSelector___lam__0(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_recvSelector___lam__0___boxed(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_recvSelector___lam__1(lean_object*);
@ -83,12 +93,10 @@ static const lean_closure_object l_Std_Http_Body_Empty_recvSelector___closed__6_
static const lean_object* l_Std_Http_Body_Empty_recvSelector___closed__6 = (const lean_object*)&l_Std_Http_Body_Empty_recvSelector___closed__6_value;
static lean_once_cell_t l_Std_Http_Body_Empty_recvSelector___closed__7_once = LEAN_ONCE_CELL_INITIALIZER;
static lean_object* l_Std_Http_Body_Empty_recvSelector___closed__7;
static const lean_ctor_object l_Std_Http_Body_Empty_recvSelector___closed__8_value = {.m_header = {.m_rc = 0, .m_cs_sz = sizeof(lean_ctor_object) + sizeof(void*)*1 + 0, .m_other = 1, .m_tag = 1}, .m_objs = {((lean_object*)(((size_t)(0) << 1) | 1))}};
static const lean_closure_object l_Std_Http_Body_Empty_recvSelector___closed__8_value = {.m_header = {.m_rc = 0, .m_cs_sz = sizeof(lean_closure_object) + sizeof(void*)*1, .m_other = 0, .m_tag = 245}, .m_fun = (void*)l_Std_Http_Body_Empty_recvSelector___lam__3___boxed, .m_arity = 2, .m_num_fixed = 1, .m_objs = {((lean_object*)&l_Std_Http_Body_Empty_tryRecv___redArg___closed__0_value)} };
static const lean_object* l_Std_Http_Body_Empty_recvSelector___closed__8 = (const lean_object*)&l_Std_Http_Body_Empty_recvSelector___closed__8_value;
static const lean_closure_object l_Std_Http_Body_Empty_recvSelector___closed__9_value = {.m_header = {.m_rc = 0, .m_cs_sz = sizeof(lean_closure_object) + sizeof(void*)*1, .m_other = 0, .m_tag = 245}, .m_fun = (void*)l_Std_Http_Body_Empty_recvSelector___lam__3___boxed, .m_arity = 2, .m_num_fixed = 1, .m_objs = {((lean_object*)&l_Std_Http_Body_Empty_recvSelector___closed__8_value)} };
static const lean_object* l_Std_Http_Body_Empty_recvSelector___closed__9 = (const lean_object*)&l_Std_Http_Body_Empty_recvSelector___closed__9_value;
static lean_once_cell_t l_Std_Http_Body_Empty_recvSelector___closed__10_once = LEAN_ONCE_CELL_INITIALIZER;
static lean_object* l_Std_Http_Body_Empty_recvSelector___closed__10;
static lean_once_cell_t l_Std_Http_Body_Empty_recvSelector___closed__9_once = LEAN_ONCE_CELL_INITIALIZER;
static lean_object* l_Std_Http_Body_Empty_recvSelector___closed__9;
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_recvSelector(lean_object*);
static const lean_ctor_object l_Std_Http_Body_instEmpty___lam__0___closed__0_value = {.m_header = {.m_rc = 0, .m_cs_sz = sizeof(lean_ctor_object) + sizeof(void*)*1 + 0, .m_other = 1, .m_tag = 1}, .m_objs = {((lean_object*)(((size_t)(0) << 1) | 1))}};
static const lean_object* l_Std_Http_Body_instEmpty___lam__0___closed__0 = (const lean_object*)&l_Std_Http_Body_instEmpty___lam__0___closed__0_value;
@ -114,21 +122,23 @@ static const lean_closure_object l_Std_Http_Body_instEmpty___closed__4_value = {
static const lean_object* l_Std_Http_Body_instEmpty___closed__4 = (const lean_object*)&l_Std_Http_Body_instEmpty___closed__4_value;
static const lean_closure_object l_Std_Http_Body_instEmpty___closed__5_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_Std_Http_Body_Empty_recvSelector, .m_arity = 1, .m_num_fixed = 0, .m_objs = {} };
static const lean_object* l_Std_Http_Body_instEmpty___closed__5 = (const lean_object*)&l_Std_Http_Body_instEmpty___closed__5_value;
static const lean_ctor_object l_Std_Http_Body_instEmpty___closed__6_value = {.m_header = {.m_rc = 0, .m_cs_sz = sizeof(lean_ctor_object) + sizeof(void*)*6 + 0, .m_other = 6, .m_tag = 0}, .m_objs = {((lean_object*)&l_Std_Http_Body_instEmpty___closed__2_value),((lean_object*)&l_Std_Http_Body_instEmpty___closed__3_value),((lean_object*)&l_Std_Http_Body_instEmpty___closed__4_value),((lean_object*)&l_Std_Http_Body_instEmpty___closed__5_value),((lean_object*)&l_Std_Http_Body_instEmpty___closed__0_value),((lean_object*)&l_Std_Http_Body_instEmpty___closed__1_value)}};
static const lean_closure_object l_Std_Http_Body_instEmpty___closed__6_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_Std_Http_Body_Empty_tryRecv___boxed, .m_arity = 2, .m_num_fixed = 0, .m_objs = {} };
static const lean_object* l_Std_Http_Body_instEmpty___closed__6 = (const lean_object*)&l_Std_Http_Body_instEmpty___closed__6_value;
LEAN_EXPORT const lean_object* l_Std_Http_Body_instEmpty = (const lean_object*)&l_Std_Http_Body_instEmpty___closed__6_value;
static const lean_closure_object l_Std_Http_Body_instCoeEmptyAny___closed__0_value = {.m_header = {.m_rc = 0, .m_cs_sz = sizeof(lean_closure_object) + sizeof(void*)*2, .m_other = 0, .m_tag = 245}, .m_fun = (void*)l_Std_Http_Body_Any_ofBody, .m_arity = 3, .m_num_fixed = 2, .m_objs = {((lean_object*)(((size_t)(0) << 1) | 1)),((lean_object*)&l_Std_Http_Body_instEmpty___closed__6_value)} };
static const lean_ctor_object l_Std_Http_Body_instEmpty___closed__7_value = {.m_header = {.m_rc = 0, .m_cs_sz = sizeof(lean_ctor_object) + sizeof(void*)*7 + 0, .m_other = 7, .m_tag = 0}, .m_objs = {((lean_object*)&l_Std_Http_Body_instEmpty___closed__2_value),((lean_object*)&l_Std_Http_Body_instEmpty___closed__3_value),((lean_object*)&l_Std_Http_Body_instEmpty___closed__4_value),((lean_object*)&l_Std_Http_Body_instEmpty___closed__5_value),((lean_object*)&l_Std_Http_Body_instEmpty___closed__6_value),((lean_object*)&l_Std_Http_Body_instEmpty___closed__0_value),((lean_object*)&l_Std_Http_Body_instEmpty___closed__1_value)}};
static const lean_object* l_Std_Http_Body_instEmpty___closed__7 = (const lean_object*)&l_Std_Http_Body_instEmpty___closed__7_value;
LEAN_EXPORT const lean_object* l_Std_Http_Body_instEmpty = (const lean_object*)&l_Std_Http_Body_instEmpty___closed__7_value;
static const lean_closure_object l_Std_Http_Body_instCoeEmptyAny___closed__0_value = {.m_header = {.m_rc = 0, .m_cs_sz = sizeof(lean_closure_object) + sizeof(void*)*2, .m_other = 0, .m_tag = 245}, .m_fun = (void*)l_Std_Http_Body_Any_ofBody, .m_arity = 3, .m_num_fixed = 2, .m_objs = {((lean_object*)(((size_t)(0) << 1) | 1)),((lean_object*)&l_Std_Http_Body_instEmpty___closed__7_value)} };
static const lean_object* l_Std_Http_Body_instCoeEmptyAny___closed__0 = (const lean_object*)&l_Std_Http_Body_instCoeEmptyAny___closed__0_value;
LEAN_EXPORT const lean_object* l_Std_Http_Body_instCoeEmptyAny = (const lean_object*)&l_Std_Http_Body_instCoeEmptyAny___closed__0_value;
LEAN_EXPORT lean_object* l_Std_Http_Body_instCoeResponseEmptyAny___lam__0(lean_object*, lean_object*);
static const lean_closure_object l_Std_Http_Body_instCoeResponseEmptyAny___closed__0_value = {.m_header = {.m_rc = 0, .m_cs_sz = sizeof(lean_closure_object) + sizeof(void*)*1, .m_other = 0, .m_tag = 245}, .m_fun = (void*)l_Std_Http_Body_instCoeResponseEmptyAny___lam__0, .m_arity = 2, .m_num_fixed = 1, .m_objs = {((lean_object*)&l_Std_Http_Body_instEmpty___closed__6_value)} };
static const lean_closure_object l_Std_Http_Body_instCoeResponseEmptyAny___closed__0_value = {.m_header = {.m_rc = 0, .m_cs_sz = sizeof(lean_closure_object) + sizeof(void*)*1, .m_other = 0, .m_tag = 245}, .m_fun = (void*)l_Std_Http_Body_instCoeResponseEmptyAny___lam__0, .m_arity = 2, .m_num_fixed = 1, .m_objs = {((lean_object*)&l_Std_Http_Body_instEmpty___closed__7_value)} };
static const lean_object* l_Std_Http_Body_instCoeResponseEmptyAny___closed__0 = (const lean_object*)&l_Std_Http_Body_instCoeResponseEmptyAny___closed__0_value;
LEAN_EXPORT const lean_object* l_Std_Http_Body_instCoeResponseEmptyAny = (const lean_object*)&l_Std_Http_Body_instCoeResponseEmptyAny___closed__0_value;
LEAN_EXPORT lean_object* l_Std_Http_Body_instCoeContextAsyncResponseEmptyAny___lam__0(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Body_instCoeContextAsyncResponseEmptyAny___lam__0___boxed(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Body_instCoeContextAsyncResponseEmptyAny___lam__1(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Body_instCoeContextAsyncResponseEmptyAny___lam__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
static const lean_closure_object l_Std_Http_Body_instCoeContextAsyncResponseEmptyAny___closed__0_value = {.m_header = {.m_rc = 0, .m_cs_sz = sizeof(lean_closure_object) + sizeof(void*)*1, .m_other = 0, .m_tag = 245}, .m_fun = (void*)l_Std_Http_Body_instCoeContextAsyncResponseEmptyAny___lam__0___boxed, .m_arity = 3, .m_num_fixed = 1, .m_objs = {((lean_object*)&l_Std_Http_Body_instEmpty___closed__6_value)} };
static const lean_closure_object l_Std_Http_Body_instCoeContextAsyncResponseEmptyAny___closed__0_value = {.m_header = {.m_rc = 0, .m_cs_sz = sizeof(lean_closure_object) + sizeof(void*)*1, .m_other = 0, .m_tag = 245}, .m_fun = (void*)l_Std_Http_Body_instCoeContextAsyncResponseEmptyAny___lam__0___boxed, .m_arity = 3, .m_num_fixed = 1, .m_objs = {((lean_object*)&l_Std_Http_Body_instEmpty___closed__7_value)} };
static const lean_object* l_Std_Http_Body_instCoeContextAsyncResponseEmptyAny___closed__0 = (const lean_object*)&l_Std_Http_Body_instCoeContextAsyncResponseEmptyAny___closed__0_value;
static const lean_closure_object l_Std_Http_Body_instCoeContextAsyncResponseEmptyAny___closed__1_value = {.m_header = {.m_rc = 0, .m_cs_sz = sizeof(lean_closure_object) + sizeof(void*)*1, .m_other = 0, .m_tag = 245}, .m_fun = (void*)l_Std_Http_Body_instCoeContextAsyncResponseEmptyAny___lam__1___boxed, .m_arity = 4, .m_num_fixed = 1, .m_objs = {((lean_object*)&l_Std_Http_Body_instCoeContextAsyncResponseEmptyAny___closed__0_value)} };
static const lean_object* l_Std_Http_Body_instCoeContextAsyncResponseEmptyAny___closed__1 = (const lean_object*)&l_Std_Http_Body_instCoeContextAsyncResponseEmptyAny___closed__1_value;
@ -279,444 +289,476 @@ v_res_56_ = l_Std_Http_Body_Empty_isClosed(v_x_54_);
return v_res_56_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_recvSelector___lam__0(lean_object* v___x_57_, lean_object* v_promise_58_){
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_tryRecv___redArg(){
_start:
{
lean_object* v___x_60_; lean_object* v___x_61_; lean_object* v___x_62_; lean_object* v___x_63_;
v___x_60_ = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(v___x_60_, 0, v___x_57_);
v___x_61_ = lean_io_promise_resolve(v___x_60_, v_promise_58_);
v___x_62_ = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(v___x_62_, 0, v___x_61_);
v___x_63_ = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(v___x_63_, 0, v___x_62_);
return v___x_63_;
lean_object* v___x_64_;
v___x_64_ = ((lean_object*)(l_Std_Http_Body_Empty_tryRecv___redArg___closed__2));
return v___x_64_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_recvSelector___lam__0___boxed(lean_object* v___x_64_, lean_object* v_promise_65_, lean_object* v___y_66_){
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_tryRecv___redArg___boxed(lean_object* v_a_65_){
_start:
{
lean_object* v_res_67_;
v_res_67_ = l_Std_Http_Body_Empty_recvSelector___lam__0(v___x_64_, v_promise_65_);
lean_dec(v_promise_65_);
return v_res_67_;
lean_object* v_res_66_;
v_res_66_ = l_Std_Http_Body_Empty_tryRecv___redArg();
return v_res_66_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_recvSelector___lam__1(lean_object* v___x_68_){
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_tryRecv(lean_object* v_x_67_){
_start:
{
lean_object* v___x_70_; lean_object* v___x_71_;
v___x_70_ = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(v___x_70_, 0, v___x_68_);
v___x_71_ = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(v___x_71_, 0, v___x_70_);
return v___x_71_;
lean_object* v___x_69_;
v___x_69_ = ((lean_object*)(l_Std_Http_Body_Empty_tryRecv___redArg___closed__2));
return v___x_69_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_recvSelector___lam__1___boxed(lean_object* v___x_72_, lean_object* v___y_73_){
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_tryRecv___boxed(lean_object* v_x_70_, lean_object* v_a_71_){
_start:
{
lean_object* v_res_74_;
v_res_74_ = l_Std_Http_Body_Empty_recvSelector___lam__1(v___x_72_);
return v_res_74_;
lean_object* v_res_72_;
v_res_72_ = l_Std_Http_Body_Empty_tryRecv(v_x_70_);
return v_res_72_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_recvSelector___lam__2(lean_object* v___x_77_, lean_object* v___f_78_, lean_object* v_win_79_, lean_object* v_waiter_80_){
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_recvSelector___lam__0(lean_object* v___x_73_, lean_object* v_promise_74_){
_start:
{
lean_object* v_lose_82_; lean_object* v___x_221__overap_83_; lean_object* v___x_84_;
v_lose_82_ = ((lean_object*)(l_Std_Http_Body_Empty_recvSelector___lam__2___closed__0));
v___x_221__overap_83_ = l_Std_Internal_IO_Async_Waiter_race___redArg(v___x_77_, v___f_78_, v_waiter_80_, v_lose_82_, v_win_79_);
v___x_84_ = lean_apply_1(v___x_221__overap_83_, lean_box(0));
return v___x_84_;
lean_object* v___x_76_; lean_object* v___x_77_; lean_object* v___x_78_; lean_object* v___x_79_;
v___x_76_ = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(v___x_76_, 0, v___x_73_);
v___x_77_ = lean_io_promise_resolve(v___x_76_, v_promise_74_);
v___x_78_ = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(v___x_78_, 0, v___x_77_);
v___x_79_ = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(v___x_79_, 0, v___x_78_);
return v___x_79_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_recvSelector___lam__2___boxed(lean_object* v___x_85_, lean_object* v___f_86_, lean_object* v_win_87_, lean_object* v_waiter_88_, lean_object* v___y_89_){
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_recvSelector___lam__0___boxed(lean_object* v___x_80_, lean_object* v_promise_81_, lean_object* v___y_82_){
_start:
{
lean_object* v_res_83_;
v_res_83_ = l_Std_Http_Body_Empty_recvSelector___lam__0(v___x_80_, v_promise_81_);
lean_dec(v_promise_81_);
return v_res_83_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_recvSelector___lam__1(lean_object* v___x_84_){
_start:
{
lean_object* v___x_86_; lean_object* v___x_87_;
v___x_86_ = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(v___x_86_, 0, v___x_84_);
v___x_87_ = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(v___x_87_, 0, v___x_86_);
return v___x_87_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_recvSelector___lam__1___boxed(lean_object* v___x_88_, lean_object* v___y_89_){
_start:
{
lean_object* v_res_90_;
v_res_90_ = l_Std_Http_Body_Empty_recvSelector___lam__2(v___x_85_, v___f_86_, v_win_87_, v_waiter_88_);
v_res_90_ = l_Std_Http_Body_Empty_recvSelector___lam__1(v___x_88_);
return v_res_90_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_recvSelector___lam__3(lean_object* v___x_91_){
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_recvSelector___lam__2(lean_object* v___x_93_, lean_object* v___f_94_, lean_object* v_win_95_, lean_object* v_waiter_96_){
_start:
{
lean_object* v___x_93_; lean_object* v___x_94_;
v___x_93_ = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(v___x_93_, 0, v___x_91_);
v___x_94_ = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(v___x_94_, 0, v___x_93_);
return v___x_94_;
lean_object* v_lose_98_; lean_object* v___x_221__overap_99_; lean_object* v___x_100_;
v_lose_98_ = ((lean_object*)(l_Std_Http_Body_Empty_recvSelector___lam__2___closed__0));
v___x_221__overap_99_ = l_Std_Internal_IO_Async_Waiter_race___redArg(v___x_93_, v___f_94_, v_waiter_96_, v_lose_98_, v_win_95_);
v___x_100_ = lean_apply_1(v___x_221__overap_99_, lean_box(0));
return v___x_100_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_recvSelector___lam__3___boxed(lean_object* v___x_95_, lean_object* v___y_96_){
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_recvSelector___lam__2___boxed(lean_object* v___x_101_, lean_object* v___f_102_, lean_object* v_win_103_, lean_object* v_waiter_104_, lean_object* v___y_105_){
_start:
{
lean_object* v_res_97_;
v_res_97_ = l_Std_Http_Body_Empty_recvSelector___lam__3(v___x_95_);
return v_res_97_;
lean_object* v_res_106_;
v_res_106_ = l_Std_Http_Body_Empty_recvSelector___lam__2(v___x_101_, v___f_102_, v_win_103_, v_waiter_104_);
return v_res_106_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_recvSelector___lam__3(lean_object* v___x_107_){
_start:
{
lean_object* v___x_109_; lean_object* v___x_110_;
v___x_109_ = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(v___x_109_, 0, v___x_107_);
v___x_110_ = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(v___x_110_, 0, v___x_109_);
return v___x_110_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_recvSelector___lam__3___boxed(lean_object* v___x_111_, lean_object* v___y_112_){
_start:
{
lean_object* v_res_113_;
v_res_113_ = l_Std_Http_Body_Empty_recvSelector___lam__3(v___x_111_);
return v_res_113_;
}
}
static lean_object* _init_l_Std_Http_Body_Empty_recvSelector___closed__0(void){
_start:
{
lean_object* v___x_98_;
v___x_98_ = l_Std_Internal_IO_Async_EAsync_instMonad(lean_box(0));
return v___x_98_;
lean_object* v___x_114_;
v___x_114_ = l_Std_Internal_IO_Async_EAsync_instMonad(lean_box(0));
return v___x_114_;
}
}
static lean_object* _init_l_Std_Http_Body_Empty_recvSelector___closed__7(void){
_start:
{
lean_object* v_win_110_; lean_object* v___f_111_; lean_object* v___x_112_; lean_object* v___f_113_;
v_win_110_ = ((lean_object*)(l_Std_Http_Body_Empty_recvSelector___closed__6));
v___f_111_ = ((lean_object*)(l_Std_Http_Body_Empty_recvSelector___closed__5));
v___x_112_ = lean_obj_once(&l_Std_Http_Body_Empty_recvSelector___closed__0, &l_Std_Http_Body_Empty_recvSelector___closed__0_once, _init_l_Std_Http_Body_Empty_recvSelector___closed__0);
v___f_113_ = lean_alloc_closure((void*)(l_Std_Http_Body_Empty_recvSelector___lam__2___boxed), 5, 3);
lean_closure_set(v___f_113_, 0, v___x_112_);
lean_closure_set(v___f_113_, 1, v___f_111_);
lean_closure_set(v___f_113_, 2, v_win_110_);
return v___f_113_;
lean_object* v_win_126_; lean_object* v___f_127_; lean_object* v___x_128_; lean_object* v___f_129_;
v_win_126_ = ((lean_object*)(l_Std_Http_Body_Empty_recvSelector___closed__6));
v___f_127_ = ((lean_object*)(l_Std_Http_Body_Empty_recvSelector___closed__5));
v___x_128_ = lean_obj_once(&l_Std_Http_Body_Empty_recvSelector___closed__0, &l_Std_Http_Body_Empty_recvSelector___closed__0_once, _init_l_Std_Http_Body_Empty_recvSelector___closed__0);
v___f_129_ = lean_alloc_closure((void*)(l_Std_Http_Body_Empty_recvSelector___lam__2___boxed), 5, 3);
lean_closure_set(v___f_129_, 0, v___x_128_);
lean_closure_set(v___f_129_, 1, v___f_127_);
lean_closure_set(v___f_129_, 2, v_win_126_);
return v___f_129_;
}
}
static lean_object* _init_l_Std_Http_Body_Empty_recvSelector___closed__10(void){
static lean_object* _init_l_Std_Http_Body_Empty_recvSelector___closed__9(void){
_start:
{
lean_object* v___f_118_; lean_object* v___f_119_; lean_object* v___f_120_; lean_object* v___x_121_;
v___f_118_ = ((lean_object*)(l_Std_Http_Body_Empty_recvSelector___lam__2___closed__0));
v___f_119_ = lean_obj_once(&l_Std_Http_Body_Empty_recvSelector___closed__7, &l_Std_Http_Body_Empty_recvSelector___closed__7_once, _init_l_Std_Http_Body_Empty_recvSelector___closed__7);
v___f_120_ = ((lean_object*)(l_Std_Http_Body_Empty_recvSelector___closed__9));
v___x_121_ = lean_alloc_ctor(0, 3, 0);
lean_ctor_set(v___x_121_, 0, v___f_120_);
lean_ctor_set(v___x_121_, 1, v___f_119_);
lean_ctor_set(v___x_121_, 2, v___f_118_);
return v___x_121_;
lean_object* v___f_132_; lean_object* v___f_133_; lean_object* v___f_134_; lean_object* v___x_135_;
v___f_132_ = ((lean_object*)(l_Std_Http_Body_Empty_recvSelector___lam__2___closed__0));
v___f_133_ = lean_obj_once(&l_Std_Http_Body_Empty_recvSelector___closed__7, &l_Std_Http_Body_Empty_recvSelector___closed__7_once, _init_l_Std_Http_Body_Empty_recvSelector___closed__7);
v___f_134_ = ((lean_object*)(l_Std_Http_Body_Empty_recvSelector___closed__8));
v___x_135_ = lean_alloc_ctor(0, 3, 0);
lean_ctor_set(v___x_135_, 0, v___f_134_);
lean_ctor_set(v___x_135_, 1, v___f_133_);
lean_ctor_set(v___x_135_, 2, v___f_132_);
return v___x_135_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_recvSelector(lean_object* v_x_122_){
LEAN_EXPORT lean_object* l_Std_Http_Body_Empty_recvSelector(lean_object* v_x_136_){
_start:
{
lean_object* v___x_123_;
v___x_123_ = lean_obj_once(&l_Std_Http_Body_Empty_recvSelector___closed__10, &l_Std_Http_Body_Empty_recvSelector___closed__10_once, _init_l_Std_Http_Body_Empty_recvSelector___closed__10);
return v___x_123_;
lean_object* v___x_137_;
v___x_137_ = lean_obj_once(&l_Std_Http_Body_Empty_recvSelector___closed__9, &l_Std_Http_Body_Empty_recvSelector___closed__9_once, _init_l_Std_Http_Body_Empty_recvSelector___closed__9);
return v___x_137_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_instEmpty___lam__0(lean_object* v_x_132_){
LEAN_EXPORT lean_object* l_Std_Http_Body_instEmpty___lam__0(lean_object* v_x_146_){
_start:
{
lean_object* v___x_134_;
v___x_134_ = ((lean_object*)(l_Std_Http_Body_instEmpty___lam__0___closed__3));
return v___x_134_;
lean_object* v___x_148_;
v___x_148_ = ((lean_object*)(l_Std_Http_Body_instEmpty___lam__0___closed__3));
return v___x_148_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_instEmpty___lam__0___boxed(lean_object* v_x_135_, lean_object* v___y_136_){
LEAN_EXPORT lean_object* l_Std_Http_Body_instEmpty___lam__0___boxed(lean_object* v_x_149_, lean_object* v___y_150_){
_start:
{
lean_object* v_res_137_;
v_res_137_ = l_Std_Http_Body_instEmpty___lam__0(v_x_135_);
return v_res_137_;
lean_object* v_res_151_;
v_res_151_ = l_Std_Http_Body_instEmpty___lam__0(v_x_149_);
return v_res_151_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_instEmpty___lam__1(lean_object* v_x_138_, lean_object* v_x_139_){
LEAN_EXPORT lean_object* l_Std_Http_Body_instEmpty___lam__1(lean_object* v_x_152_, lean_object* v_x_153_){
_start:
{
lean_object* v___x_141_;
v___x_141_ = ((lean_object*)(l_Std_Http_Body_Empty_close___redArg___closed__1));
return v___x_141_;
lean_object* v___x_155_;
v___x_155_ = ((lean_object*)(l_Std_Http_Body_Empty_close___redArg___closed__1));
return v___x_155_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_instEmpty___lam__1___boxed(lean_object* v_x_142_, lean_object* v_x_143_, lean_object* v___y_144_){
LEAN_EXPORT lean_object* l_Std_Http_Body_instEmpty___lam__1___boxed(lean_object* v_x_156_, lean_object* v_x_157_, lean_object* v___y_158_){
_start:
{
lean_object* v_res_145_;
v_res_145_ = l_Std_Http_Body_instEmpty___lam__1(v_x_142_, v_x_143_);
lean_dec(v_x_143_);
return v_res_145_;
lean_object* v_res_159_;
v_res_159_ = l_Std_Http_Body_instEmpty___lam__1(v_x_156_, v_x_157_);
lean_dec(v_x_157_);
return v_res_159_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_instCoeResponseEmptyAny___lam__0(lean_object* v___x_163_, lean_object* v_f_164_){
LEAN_EXPORT lean_object* l_Std_Http_Body_instCoeResponseEmptyAny___lam__0(lean_object* v___x_179_, lean_object* v_f_180_){
_start:
{
lean_object* v_line_165_; lean_object* v_body_166_; lean_object* v_extensions_167_; lean_object* v___x_169_; uint8_t v_isShared_170_; uint8_t v_isSharedCheck_175_;
v_line_165_ = lean_ctor_get(v_f_164_, 0);
v_body_166_ = lean_ctor_get(v_f_164_, 1);
v_extensions_167_ = lean_ctor_get(v_f_164_, 2);
v_isSharedCheck_175_ = !lean_is_exclusive(v_f_164_);
if (v_isSharedCheck_175_ == 0)
lean_object* v_line_181_; lean_object* v_body_182_; lean_object* v_extensions_183_; lean_object* v___x_185_; uint8_t v_isShared_186_; uint8_t v_isSharedCheck_191_;
v_line_181_ = lean_ctor_get(v_f_180_, 0);
v_body_182_ = lean_ctor_get(v_f_180_, 1);
v_extensions_183_ = lean_ctor_get(v_f_180_, 2);
v_isSharedCheck_191_ = !lean_is_exclusive(v_f_180_);
if (v_isSharedCheck_191_ == 0)
{
v___x_169_ = v_f_164_;
v_isShared_170_ = v_isSharedCheck_175_;
goto v_resetjp_168_;
v___x_185_ = v_f_180_;
v_isShared_186_ = v_isSharedCheck_191_;
goto v_resetjp_184_;
}
else
{
lean_inc(v_extensions_167_);
lean_inc(v_body_166_);
lean_inc(v_line_165_);
lean_dec(v_f_164_);
v___x_169_ = lean_box(0);
v_isShared_170_ = v_isSharedCheck_175_;
goto v_resetjp_168_;
lean_inc(v_extensions_183_);
lean_inc(v_body_182_);
lean_inc(v_line_181_);
lean_dec(v_f_180_);
v___x_185_ = lean_box(0);
v_isShared_186_ = v_isSharedCheck_191_;
goto v_resetjp_184_;
}
v_resetjp_168_:
v_resetjp_184_:
{
lean_object* v___x_171_; lean_object* v___x_173_;
v___x_171_ = l_Std_Http_Body_Any_ofBody___redArg(v___x_163_, v_body_166_);
if (v_isShared_170_ == 0)
lean_object* v___x_187_; lean_object* v___x_189_;
v___x_187_ = l_Std_Http_Body_Any_ofBody___redArg(v___x_179_, v_body_182_);
if (v_isShared_186_ == 0)
{
lean_ctor_set(v___x_169_, 1, v___x_171_);
v___x_173_ = v___x_169_;
goto v_reusejp_172_;
lean_ctor_set(v___x_185_, 1, v___x_187_);
v___x_189_ = v___x_185_;
goto v_reusejp_188_;
}
else
{
lean_object* v_reuseFailAlloc_174_;
v_reuseFailAlloc_174_ = lean_alloc_ctor(0, 3, 0);
lean_ctor_set(v_reuseFailAlloc_174_, 0, v_line_165_);
lean_ctor_set(v_reuseFailAlloc_174_, 1, v___x_171_);
lean_ctor_set(v_reuseFailAlloc_174_, 2, v_extensions_167_);
v___x_173_ = v_reuseFailAlloc_174_;
goto v_reusejp_172_;
lean_object* v_reuseFailAlloc_190_;
v_reuseFailAlloc_190_ = lean_alloc_ctor(0, 3, 0);
lean_ctor_set(v_reuseFailAlloc_190_, 0, v_line_181_);
lean_ctor_set(v_reuseFailAlloc_190_, 1, v___x_187_);
lean_ctor_set(v_reuseFailAlloc_190_, 2, v_extensions_183_);
v___x_189_ = v_reuseFailAlloc_190_;
goto v_reusejp_188_;
}
v_reusejp_172_:
v_reusejp_188_:
{
return v___x_173_;
return v___x_189_;
}
}
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_instCoeContextAsyncResponseEmptyAny___lam__0(lean_object* v___x_179_, lean_object* v_x_180_){
LEAN_EXPORT lean_object* l_Std_Http_Body_instCoeContextAsyncResponseEmptyAny___lam__0(lean_object* v___x_195_, lean_object* v_x_196_){
_start:
{
if (lean_obj_tag(v_x_180_) == 0)
if (lean_obj_tag(v_x_196_) == 0)
{
lean_object* v_a_182_; lean_object* v___x_184_; uint8_t v_isShared_185_; uint8_t v_isSharedCheck_190_;
lean_dec_ref(v___x_179_);
v_a_182_ = lean_ctor_get(v_x_180_, 0);
v_isSharedCheck_190_ = !lean_is_exclusive(v_x_180_);
if (v_isSharedCheck_190_ == 0)
lean_object* v_a_198_; lean_object* v___x_200_; uint8_t v_isShared_201_; uint8_t v_isSharedCheck_206_;
lean_dec_ref(v___x_195_);
v_a_198_ = lean_ctor_get(v_x_196_, 0);
v_isSharedCheck_206_ = !lean_is_exclusive(v_x_196_);
if (v_isSharedCheck_206_ == 0)
{
v___x_184_ = v_x_180_;
v_isShared_185_ = v_isSharedCheck_190_;
goto v_resetjp_183_;
v___x_200_ = v_x_196_;
v_isShared_201_ = v_isSharedCheck_206_;
goto v_resetjp_199_;
}
else
{
lean_inc(v_a_182_);
lean_dec(v_x_180_);
v___x_184_ = lean_box(0);
v_isShared_185_ = v_isSharedCheck_190_;
goto v_resetjp_183_;
lean_inc(v_a_198_);
lean_dec(v_x_196_);
v___x_200_ = lean_box(0);
v_isShared_201_ = v_isSharedCheck_206_;
goto v_resetjp_199_;
}
v_resetjp_183_:
v_resetjp_199_:
{
lean_object* v___x_187_;
if (v_isShared_185_ == 0)
lean_object* v___x_203_;
if (v_isShared_201_ == 0)
{
v___x_187_ = v___x_184_;
goto v_reusejp_186_;
}
else
{
lean_object* v_reuseFailAlloc_189_;
v_reuseFailAlloc_189_ = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(v_reuseFailAlloc_189_, 0, v_a_182_);
v___x_187_ = v_reuseFailAlloc_189_;
goto v_reusejp_186_;
}
v_reusejp_186_:
{
lean_object* v___x_188_;
v___x_188_ = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(v___x_188_, 0, v___x_187_);
return v___x_188_;
}
}
}
else
{
lean_object* v_a_191_; lean_object* v___x_193_; uint8_t v_isShared_194_; uint8_t v_isSharedCheck_210_;
v_a_191_ = lean_ctor_get(v_x_180_, 0);
v_isSharedCheck_210_ = !lean_is_exclusive(v_x_180_);
if (v_isSharedCheck_210_ == 0)
{
v___x_193_ = v_x_180_;
v_isShared_194_ = v_isSharedCheck_210_;
goto v_resetjp_192_;
}
else
{
lean_inc(v_a_191_);
lean_dec(v_x_180_);
v___x_193_ = lean_box(0);
v_isShared_194_ = v_isSharedCheck_210_;
goto v_resetjp_192_;
}
v_resetjp_192_:
{
lean_object* v_line_195_; lean_object* v_body_196_; lean_object* v_extensions_197_; lean_object* v___x_199_; uint8_t v_isShared_200_; uint8_t v_isSharedCheck_209_;
v_line_195_ = lean_ctor_get(v_a_191_, 0);
v_body_196_ = lean_ctor_get(v_a_191_, 1);
v_extensions_197_ = lean_ctor_get(v_a_191_, 2);
v_isSharedCheck_209_ = !lean_is_exclusive(v_a_191_);
if (v_isSharedCheck_209_ == 0)
{
v___x_199_ = v_a_191_;
v_isShared_200_ = v_isSharedCheck_209_;
goto v_resetjp_198_;
}
else
{
lean_inc(v_extensions_197_);
lean_inc(v_body_196_);
lean_inc(v_line_195_);
lean_dec(v_a_191_);
v___x_199_ = lean_box(0);
v_isShared_200_ = v_isSharedCheck_209_;
goto v_resetjp_198_;
}
v_resetjp_198_:
{
lean_object* v___x_201_; lean_object* v___x_203_;
v___x_201_ = l_Std_Http_Body_Any_ofBody___redArg(v___x_179_, v_body_196_);
if (v_isShared_200_ == 0)
{
lean_ctor_set(v___x_199_, 1, v___x_201_);
v___x_203_ = v___x_199_;
v___x_203_ = v___x_200_;
goto v_reusejp_202_;
}
else
{
lean_object* v_reuseFailAlloc_208_;
v_reuseFailAlloc_208_ = lean_alloc_ctor(0, 3, 0);
lean_ctor_set(v_reuseFailAlloc_208_, 0, v_line_195_);
lean_ctor_set(v_reuseFailAlloc_208_, 1, v___x_201_);
lean_ctor_set(v_reuseFailAlloc_208_, 2, v_extensions_197_);
v___x_203_ = v_reuseFailAlloc_208_;
lean_object* v_reuseFailAlloc_205_;
v_reuseFailAlloc_205_ = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(v_reuseFailAlloc_205_, 0, v_a_198_);
v___x_203_ = v_reuseFailAlloc_205_;
goto v_reusejp_202_;
}
v_reusejp_202_:
{
lean_object* v___x_205_;
if (v_isShared_194_ == 0)
{
lean_ctor_set(v___x_193_, 0, v___x_203_);
v___x_205_ = v___x_193_;
goto v_reusejp_204_;
lean_object* v___x_204_;
v___x_204_ = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(v___x_204_, 0, v___x_203_);
return v___x_204_;
}
}
}
else
{
lean_object* v_reuseFailAlloc_207_;
v_reuseFailAlloc_207_ = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(v_reuseFailAlloc_207_, 0, v___x_203_);
v___x_205_ = v_reuseFailAlloc_207_;
goto v_reusejp_204_;
}
v_reusejp_204_:
lean_object* v_a_207_; lean_object* v___x_209_; uint8_t v_isShared_210_; uint8_t v_isSharedCheck_226_;
v_a_207_ = lean_ctor_get(v_x_196_, 0);
v_isSharedCheck_226_ = !lean_is_exclusive(v_x_196_);
if (v_isSharedCheck_226_ == 0)
{
lean_object* v___x_206_;
v___x_206_ = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(v___x_206_, 0, v___x_205_);
return v___x_206_;
v___x_209_ = v_x_196_;
v_isShared_210_ = v_isSharedCheck_226_;
goto v_resetjp_208_;
}
}
}
}
}
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_instCoeContextAsyncResponseEmptyAny___lam__0___boxed(lean_object* v___x_211_, lean_object* v_x_212_, lean_object* v___y_213_){
_start:
else
{
lean_object* v_res_214_;
v_res_214_ = l_Std_Http_Body_instCoeContextAsyncResponseEmptyAny___lam__0(v___x_211_, v_x_212_);
return v_res_214_;
lean_inc(v_a_207_);
lean_dec(v_x_196_);
v___x_209_ = lean_box(0);
v_isShared_210_ = v_isSharedCheck_226_;
goto v_resetjp_208_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_instCoeContextAsyncResponseEmptyAny___lam__1(lean_object* v___f_215_, lean_object* v_action_216_, lean_object* v___y_217_){
_start:
v_resetjp_208_:
{
lean_object* v___x_219_; lean_object* v___x_220_; uint8_t v___x_221_; lean_object* v___x_222_;
lean_inc_ref(v___y_217_);
v___x_219_ = lean_apply_2(v_action_216_, v___y_217_, lean_box(0));
v___x_220_ = lean_unsigned_to_nat(0u);
v___x_221_ = 0;
v___x_222_ = l___private_Std_Internal_Async_Basic_0__Std_Internal_IO_Async_BaseAsync_bind_bindAsyncTask(lean_box(0), lean_box(0), v___x_220_, v___x_221_, v___x_219_, v___f_215_);
lean_object* v_line_211_; lean_object* v_body_212_; lean_object* v_extensions_213_; lean_object* v___x_215_; uint8_t v_isShared_216_; uint8_t v_isSharedCheck_225_;
v_line_211_ = lean_ctor_get(v_a_207_, 0);
v_body_212_ = lean_ctor_get(v_a_207_, 1);
v_extensions_213_ = lean_ctor_get(v_a_207_, 2);
v_isSharedCheck_225_ = !lean_is_exclusive(v_a_207_);
if (v_isSharedCheck_225_ == 0)
{
v___x_215_ = v_a_207_;
v_isShared_216_ = v_isSharedCheck_225_;
goto v_resetjp_214_;
}
else
{
lean_inc(v_extensions_213_);
lean_inc(v_body_212_);
lean_inc(v_line_211_);
lean_dec(v_a_207_);
v___x_215_ = lean_box(0);
v_isShared_216_ = v_isSharedCheck_225_;
goto v_resetjp_214_;
}
v_resetjp_214_:
{
lean_object* v___x_217_; lean_object* v___x_219_;
v___x_217_ = l_Std_Http_Body_Any_ofBody___redArg(v___x_195_, v_body_212_);
if (v_isShared_216_ == 0)
{
lean_ctor_set(v___x_215_, 1, v___x_217_);
v___x_219_ = v___x_215_;
goto v_reusejp_218_;
}
else
{
lean_object* v_reuseFailAlloc_224_;
v_reuseFailAlloc_224_ = lean_alloc_ctor(0, 3, 0);
lean_ctor_set(v_reuseFailAlloc_224_, 0, v_line_211_);
lean_ctor_set(v_reuseFailAlloc_224_, 1, v___x_217_);
lean_ctor_set(v_reuseFailAlloc_224_, 2, v_extensions_213_);
v___x_219_ = v_reuseFailAlloc_224_;
goto v_reusejp_218_;
}
v_reusejp_218_:
{
lean_object* v___x_221_;
if (v_isShared_210_ == 0)
{
lean_ctor_set(v___x_209_, 0, v___x_219_);
v___x_221_ = v___x_209_;
goto v_reusejp_220_;
}
else
{
lean_object* v_reuseFailAlloc_223_;
v_reuseFailAlloc_223_ = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(v_reuseFailAlloc_223_, 0, v___x_219_);
v___x_221_ = v_reuseFailAlloc_223_;
goto v_reusejp_220_;
}
v_reusejp_220_:
{
lean_object* v___x_222_;
v___x_222_ = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(v___x_222_, 0, v___x_221_);
return v___x_222_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_instCoeContextAsyncResponseEmptyAny___lam__1___boxed(lean_object* v___f_223_, lean_object* v_action_224_, lean_object* v___y_225_, lean_object* v___y_226_){
}
}
}
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_instCoeContextAsyncResponseEmptyAny___lam__0___boxed(lean_object* v___x_227_, lean_object* v_x_228_, lean_object* v___y_229_){
_start:
{
lean_object* v_res_227_;
v_res_227_ = l_Std_Http_Body_instCoeContextAsyncResponseEmptyAny___lam__1(v___f_223_, v_action_224_, v___y_225_);
lean_dec_ref(v___y_225_);
return v_res_227_;
lean_object* v_res_230_;
v_res_230_ = l_Std_Http_Body_instCoeContextAsyncResponseEmptyAny___lam__0(v___x_227_, v_x_228_);
return v_res_230_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_instCoeAsyncResponseEmptyContextAsyncAny___lam__1(lean_object* v___f_233_, lean_object* v_action_234_, lean_object* v___y_235_){
LEAN_EXPORT lean_object* l_Std_Http_Body_instCoeContextAsyncResponseEmptyAny___lam__1(lean_object* v___f_231_, lean_object* v_action_232_, lean_object* v___y_233_){
_start:
{
lean_object* v___x_237_; lean_object* v___x_238_; uint8_t v___x_239_; lean_object* v___x_240_;
v___x_237_ = lean_apply_1(v_action_234_, lean_box(0));
v___x_238_ = lean_unsigned_to_nat(0u);
v___x_239_ = 0;
v___x_240_ = l___private_Std_Internal_Async_Basic_0__Std_Internal_IO_Async_BaseAsync_bind_bindAsyncTask(lean_box(0), lean_box(0), v___x_238_, v___x_239_, v___x_237_, v___f_233_);
return v___x_240_;
lean_object* v___x_235_; lean_object* v___x_236_; uint8_t v___x_237_; lean_object* v___x_238_;
lean_inc_ref(v___y_233_);
v___x_235_ = lean_apply_2(v_action_232_, v___y_233_, lean_box(0));
v___x_236_ = lean_unsigned_to_nat(0u);
v___x_237_ = 0;
v___x_238_ = l___private_Std_Internal_Async_Basic_0__Std_Internal_IO_Async_BaseAsync_bind_bindAsyncTask(lean_box(0), lean_box(0), v___x_236_, v___x_237_, v___x_235_, v___f_231_);
return v___x_238_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Body_instCoeAsyncResponseEmptyContextAsyncAny___lam__1___boxed(lean_object* v___f_241_, lean_object* v_action_242_, lean_object* v___y_243_, lean_object* v___y_244_){
LEAN_EXPORT lean_object* l_Std_Http_Body_instCoeContextAsyncResponseEmptyAny___lam__1___boxed(lean_object* v___f_239_, lean_object* v_action_240_, lean_object* v___y_241_, lean_object* v___y_242_){
_start:
{
lean_object* v_res_245_;
v_res_245_ = l_Std_Http_Body_instCoeAsyncResponseEmptyContextAsyncAny___lam__1(v___f_241_, v_action_242_, v___y_243_);
lean_dec_ref(v___y_243_);
return v_res_245_;
lean_object* v_res_243_;
v_res_243_ = l_Std_Http_Body_instCoeContextAsyncResponseEmptyAny___lam__1(v___f_239_, v_action_240_, v___y_241_);
lean_dec_ref(v___y_241_);
return v_res_243_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Request_Builder_empty(lean_object* v_builder_249_){
LEAN_EXPORT lean_object* l_Std_Http_Body_instCoeAsyncResponseEmptyContextAsyncAny___lam__1(lean_object* v___f_249_, lean_object* v_action_250_, lean_object* v___y_251_){
_start:
{
lean_object* v___x_251_; lean_object* v___x_252_; lean_object* v___x_253_; lean_object* v___x_254_;
v___x_251_ = lean_box(0);
v___x_252_ = l_Std_Http_Request_Builder_body___redArg(v_builder_249_, v___x_251_);
v___x_253_ = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(v___x_253_, 0, v___x_252_);
v___x_254_ = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(v___x_254_, 0, v___x_253_);
return v___x_254_;
lean_object* v___x_253_; lean_object* v___x_254_; uint8_t v___x_255_; lean_object* v___x_256_;
v___x_253_ = lean_apply_1(v_action_250_, lean_box(0));
v___x_254_ = lean_unsigned_to_nat(0u);
v___x_255_ = 0;
v___x_256_ = l___private_Std_Internal_Async_Basic_0__Std_Internal_IO_Async_BaseAsync_bind_bindAsyncTask(lean_box(0), lean_box(0), v___x_254_, v___x_255_, v___x_253_, v___f_249_);
return v___x_256_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Request_Builder_empty___boxed(lean_object* v_builder_255_, lean_object* v_a_256_){
LEAN_EXPORT lean_object* l_Std_Http_Body_instCoeAsyncResponseEmptyContextAsyncAny___lam__1___boxed(lean_object* v___f_257_, lean_object* v_action_258_, lean_object* v___y_259_, lean_object* v___y_260_){
_start:
{
lean_object* v_res_257_;
v_res_257_ = l_Std_Http_Request_Builder_empty(v_builder_255_);
lean_dec_ref(v_builder_255_);
return v_res_257_;
lean_object* v_res_261_;
v_res_261_ = l_Std_Http_Body_instCoeAsyncResponseEmptyContextAsyncAny___lam__1(v___f_257_, v_action_258_, v___y_259_);
lean_dec_ref(v___y_259_);
return v_res_261_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Response_Builder_empty(lean_object* v_builder_258_){
LEAN_EXPORT lean_object* l_Std_Http_Request_Builder_empty(lean_object* v_builder_265_){
_start:
{
lean_object* v___x_260_; lean_object* v___x_261_; lean_object* v___x_262_; lean_object* v___x_263_;
v___x_260_ = lean_box(0);
v___x_261_ = l_Std_Http_Response_Builder_body___redArg(v_builder_258_, v___x_260_);
v___x_262_ = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(v___x_262_, 0, v___x_261_);
v___x_263_ = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(v___x_263_, 0, v___x_262_);
return v___x_263_;
lean_object* v___x_267_; lean_object* v___x_268_; lean_object* v___x_269_; lean_object* v___x_270_;
v___x_267_ = lean_box(0);
v___x_268_ = l_Std_Http_Request_Builder_body___redArg(v_builder_265_, v___x_267_);
v___x_269_ = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(v___x_269_, 0, v___x_268_);
v___x_270_ = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(v___x_270_, 0, v___x_269_);
return v___x_270_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Response_Builder_empty___boxed(lean_object* v_builder_264_, lean_object* v_a_265_){
LEAN_EXPORT lean_object* l_Std_Http_Request_Builder_empty___boxed(lean_object* v_builder_271_, lean_object* v_a_272_){
_start:
{
lean_object* v_res_266_;
v_res_266_ = l_Std_Http_Response_Builder_empty(v_builder_264_);
lean_dec_ref(v_builder_264_);
return v_res_266_;
lean_object* v_res_273_;
v_res_273_ = l_Std_Http_Request_Builder_empty(v_builder_271_);
lean_dec_ref(v_builder_271_);
return v_res_273_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Response_Builder_empty(lean_object* v_builder_274_){
_start:
{
lean_object* v___x_276_; lean_object* v___x_277_; lean_object* v___x_278_; lean_object* v___x_279_;
v___x_276_ = lean_box(0);
v___x_277_ = l_Std_Http_Response_Builder_body___redArg(v_builder_274_, v___x_276_);
v___x_278_ = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(v___x_278_, 0, v___x_277_);
v___x_279_ = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(v___x_279_, 0, v___x_278_);
return v___x_279_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Response_Builder_empty___boxed(lean_object* v_builder_280_, lean_object* v_a_281_){
_start:
{
lean_object* v_res_282_;
v_res_282_ = l_Std_Http_Response_Builder_empty(v_builder_280_);
lean_dec_ref(v_builder_280_);
return v_res_282_;
}
}
lean_object* runtime_initialize_Std_Internal_Http_Data_Request(uint8_t builtin);

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

4929
stage0/stdlib/Std/Internal/Http/Server.c generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,136 @@
// Lean compiler output
// Module: Std.Internal.Http.Server.Config
// Imports: public import Std.Time public import Std.Internal.Http.Protocol.H1
#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
LEAN_EXPORT lean_object* l_Std_Http_Config_toH1Config(lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Config_toH1Config___boxed(lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Config_toH1Config(lean_object* v_config_1_){
_start:
{
lean_object* v_maxRequests_2_; lean_object* v_maxHeaders_3_; lean_object* v_maxHeaderBytes_4_; uint8_t v_enableKeepAlive_5_; lean_object* v_serverName_6_; lean_object* v_maxUriLength_7_; lean_object* v_maxStartLineLength_8_; lean_object* v_maxHeaderNameLength_9_; lean_object* v_maxHeaderValueLength_10_; lean_object* v_maxSpaceSequence_11_; lean_object* v_maxLeadingEmptyLines_12_; lean_object* v_maxChunkExtNameLength_13_; lean_object* v_maxChunkExtValueLength_14_; lean_object* v_maxChunkLineLength_15_; lean_object* v_maxChunkSize_16_; lean_object* v_maxBodySize_17_; lean_object* v_maxReasonPhraseLength_18_; lean_object* v_maxTrailerHeaders_19_; lean_object* v_maxChunkExtensions_20_; lean_object* v___x_21_;
v_maxRequests_2_ = lean_ctor_get(v_config_1_, 1);
v_maxHeaders_3_ = lean_ctor_get(v_config_1_, 2);
v_maxHeaderBytes_4_ = lean_ctor_get(v_config_1_, 3);
v_enableKeepAlive_5_ = lean_ctor_get_uint8(v_config_1_, sizeof(void*)*24);
v_serverName_6_ = lean_ctor_get(v_config_1_, 9);
v_maxUriLength_7_ = lean_ctor_get(v_config_1_, 10);
v_maxStartLineLength_8_ = lean_ctor_get(v_config_1_, 11);
v_maxHeaderNameLength_9_ = lean_ctor_get(v_config_1_, 12);
v_maxHeaderValueLength_10_ = lean_ctor_get(v_config_1_, 13);
v_maxSpaceSequence_11_ = lean_ctor_get(v_config_1_, 14);
v_maxLeadingEmptyLines_12_ = lean_ctor_get(v_config_1_, 15);
v_maxChunkExtNameLength_13_ = lean_ctor_get(v_config_1_, 16);
v_maxChunkExtValueLength_14_ = lean_ctor_get(v_config_1_, 17);
v_maxChunkLineLength_15_ = lean_ctor_get(v_config_1_, 18);
v_maxChunkSize_16_ = lean_ctor_get(v_config_1_, 19);
v_maxBodySize_17_ = lean_ctor_get(v_config_1_, 20);
v_maxReasonPhraseLength_18_ = lean_ctor_get(v_config_1_, 21);
v_maxTrailerHeaders_19_ = lean_ctor_get(v_config_1_, 22);
v_maxChunkExtensions_20_ = lean_ctor_get(v_config_1_, 23);
lean_inc(v_maxTrailerHeaders_19_);
lean_inc(v_maxReasonPhraseLength_18_);
lean_inc(v_maxBodySize_17_);
lean_inc(v_maxChunkSize_16_);
lean_inc(v_maxChunkLineLength_15_);
lean_inc(v_maxChunkExtValueLength_14_);
lean_inc(v_maxChunkExtNameLength_13_);
lean_inc(v_maxChunkExtensions_20_);
lean_inc(v_maxLeadingEmptyLines_12_);
lean_inc(v_maxSpaceSequence_11_);
lean_inc(v_maxHeaderValueLength_10_);
lean_inc(v_maxHeaderNameLength_9_);
lean_inc(v_maxStartLineLength_8_);
lean_inc(v_maxUriLength_7_);
lean_inc(v_serverName_6_);
lean_inc(v_maxHeaderBytes_4_);
lean_inc(v_maxHeaders_3_);
lean_inc(v_maxRequests_2_);
v___x_21_ = lean_alloc_ctor(0, 18, 1);
lean_ctor_set(v___x_21_, 0, v_maxRequests_2_);
lean_ctor_set(v___x_21_, 1, v_maxHeaders_3_);
lean_ctor_set(v___x_21_, 2, v_maxHeaderBytes_4_);
lean_ctor_set(v___x_21_, 3, v_serverName_6_);
lean_ctor_set(v___x_21_, 4, v_maxUriLength_7_);
lean_ctor_set(v___x_21_, 5, v_maxStartLineLength_8_);
lean_ctor_set(v___x_21_, 6, v_maxHeaderNameLength_9_);
lean_ctor_set(v___x_21_, 7, v_maxHeaderValueLength_10_);
lean_ctor_set(v___x_21_, 8, v_maxSpaceSequence_11_);
lean_ctor_set(v___x_21_, 9, v_maxLeadingEmptyLines_12_);
lean_ctor_set(v___x_21_, 10, v_maxChunkExtensions_20_);
lean_ctor_set(v___x_21_, 11, v_maxChunkExtNameLength_13_);
lean_ctor_set(v___x_21_, 12, v_maxChunkExtValueLength_14_);
lean_ctor_set(v___x_21_, 13, v_maxChunkLineLength_15_);
lean_ctor_set(v___x_21_, 14, v_maxChunkSize_16_);
lean_ctor_set(v___x_21_, 15, v_maxBodySize_17_);
lean_ctor_set(v___x_21_, 16, v_maxReasonPhraseLength_18_);
lean_ctor_set(v___x_21_, 17, v_maxTrailerHeaders_19_);
lean_ctor_set_uint8(v___x_21_, sizeof(void*)*18, v_enableKeepAlive_5_);
return v___x_21_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Config_toH1Config___boxed(lean_object* v_config_22_){
_start:
{
lean_object* v_res_23_;
v_res_23_ = l_Std_Http_Config_toH1Config(v_config_22_);
lean_dec_ref(v_config_22_);
return v_res_23_;
}
}
lean_object* runtime_initialize_Std_Time(uint8_t builtin);
lean_object* runtime_initialize_Std_Internal_Http_Protocol_H1(uint8_t builtin);
static bool _G_runtime_initialized = false;
LEAN_EXPORT lean_object* runtime_initialize_Std_Internal_Http_Server_Config(uint8_t builtin) {
lean_object * res;
if (_G_runtime_initialized) return lean_io_result_mk_ok(lean_box(0));
_G_runtime_initialized = true;
res = runtime_initialize_Std_Time(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = runtime_initialize_Std_Internal_Http_Protocol_H1(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
return lean_io_result_mk_ok(lean_box(0));
}
static bool _G_meta_initialized = false;
LEAN_EXPORT lean_object* meta_initialize_Std_Internal_Http_Server_Config(uint8_t builtin) {
lean_object * res;
if (_G_meta_initialized) return lean_io_result_mk_ok(lean_box(0));
_G_meta_initialized = true;
return lean_io_result_mk_ok(lean_box(0));
}
lean_object* initialize_Std_Time(uint8_t builtin);
lean_object* initialize_Std_Internal_Http_Protocol_H1(uint8_t builtin);
static bool _G_initialized = false;
LEAN_EXPORT lean_object* initialize_Std_Internal_Http_Server_Config(uint8_t builtin) {
lean_object * res;
if (_G_initialized) return lean_io_result_mk_ok(lean_box(0));
_G_initialized = true;
res = initialize_Std_Time(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Std_Internal_Http_Protocol_H1(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = runtime_initialize_Std_Internal_Http_Server_Config(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = meta_initialize_Std_Internal_Http_Server_Config(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
return initialize_Std_Internal_Http_Server_Config(builtin);
}
#ifdef __cplusplus
}
#endif

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,350 @@
// Lean compiler output
// Module: Std.Internal.Http.Server.Handler
// Imports: public import Std.Internal.Async public import Std.Internal.Http.Data public import Std.Internal.Async.ContextAsync
#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
extern lean_object* l_Std_Http_Body_instAny;
LEAN_EXPORT lean_object* l_Std_Http_Server_instHandlerStatelessHandler___lam__0(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Server_instHandlerStatelessHandler___lam__0___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Server_instHandlerStatelessHandler___lam__1(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Server_instHandlerStatelessHandler___lam__1___boxed(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Server_instHandlerStatelessHandler___lam__2(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Server_instHandlerStatelessHandler___lam__2___boxed(lean_object*, lean_object*, lean_object*);
static const lean_closure_object l_Std_Http_Server_instHandlerStatelessHandler___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_Std_Http_Server_instHandlerStatelessHandler___lam__0___boxed, .m_arity = 4, .m_num_fixed = 0, .m_objs = {} };
static const lean_object* l_Std_Http_Server_instHandlerStatelessHandler___closed__0 = (const lean_object*)&l_Std_Http_Server_instHandlerStatelessHandler___closed__0_value;
static const lean_closure_object l_Std_Http_Server_instHandlerStatelessHandler___closed__1_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_Std_Http_Server_instHandlerStatelessHandler___lam__1___boxed, .m_arity = 3, .m_num_fixed = 0, .m_objs = {} };
static const lean_object* l_Std_Http_Server_instHandlerStatelessHandler___closed__1 = (const lean_object*)&l_Std_Http_Server_instHandlerStatelessHandler___closed__1_value;
static const lean_closure_object l_Std_Http_Server_instHandlerStatelessHandler___closed__2_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_Std_Http_Server_instHandlerStatelessHandler___lam__2___boxed, .m_arity = 3, .m_num_fixed = 0, .m_objs = {} };
static const lean_object* l_Std_Http_Server_instHandlerStatelessHandler___closed__2 = (const lean_object*)&l_Std_Http_Server_instHandlerStatelessHandler___closed__2_value;
static lean_once_cell_t l_Std_Http_Server_instHandlerStatelessHandler___closed__3_once = LEAN_ONCE_CELL_INITIALIZER;
static lean_object* l_Std_Http_Server_instHandlerStatelessHandler___closed__3;
LEAN_EXPORT lean_object* l_Std_Http_Server_instHandlerStatelessHandler;
static const lean_ctor_object l_Std_Http_Server_Handler_ofFn___lam__0___closed__0_value = {.m_header = {.m_rc = 0, .m_cs_sz = sizeof(lean_ctor_object) + sizeof(void*)*1 + 0, .m_other = 1, .m_tag = 1}, .m_objs = {((lean_object*)(((size_t)(0) << 1) | 1))}};
static const lean_object* l_Std_Http_Server_Handler_ofFn___lam__0___closed__0 = (const lean_object*)&l_Std_Http_Server_Handler_ofFn___lam__0___closed__0_value;
static const lean_ctor_object l_Std_Http_Server_Handler_ofFn___lam__0___closed__1_value = {.m_header = {.m_rc = 0, .m_cs_sz = sizeof(lean_ctor_object) + sizeof(void*)*1 + 0, .m_other = 1, .m_tag = 0}, .m_objs = {((lean_object*)&l_Std_Http_Server_Handler_ofFn___lam__0___closed__0_value)}};
static const lean_object* l_Std_Http_Server_Handler_ofFn___lam__0___closed__1 = (const lean_object*)&l_Std_Http_Server_Handler_ofFn___lam__0___closed__1_value;
LEAN_EXPORT lean_object* l_Std_Http_Server_Handler_ofFn___lam__0(lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Server_Handler_ofFn___lam__0___boxed(lean_object*, lean_object*);
static const lean_ctor_object l_Std_Http_Server_Handler_ofFn___lam__1___closed__0_value = {.m_header = {.m_rc = 0, .m_cs_sz = sizeof(lean_ctor_object) + sizeof(void*)*1 + 0, .m_other = 1, .m_tag = 1}, .m_objs = {((lean_object*)(((size_t)(1) << 1) | 1))}};
static const lean_object* l_Std_Http_Server_Handler_ofFn___lam__1___closed__0 = (const lean_object*)&l_Std_Http_Server_Handler_ofFn___lam__1___closed__0_value;
static const lean_ctor_object l_Std_Http_Server_Handler_ofFn___lam__1___closed__1_value = {.m_header = {.m_rc = 0, .m_cs_sz = sizeof(lean_ctor_object) + sizeof(void*)*1 + 0, .m_other = 1, .m_tag = 0}, .m_objs = {((lean_object*)&l_Std_Http_Server_Handler_ofFn___lam__1___closed__0_value)}};
static const lean_object* l_Std_Http_Server_Handler_ofFn___lam__1___closed__1 = (const lean_object*)&l_Std_Http_Server_Handler_ofFn___lam__1___closed__1_value;
LEAN_EXPORT lean_object* l_Std_Http_Server_Handler_ofFn___lam__1(lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Server_Handler_ofFn___lam__1___boxed(lean_object*, lean_object*);
static const lean_closure_object l_Std_Http_Server_Handler_ofFn___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_Std_Http_Server_Handler_ofFn___lam__0___boxed, .m_arity = 2, .m_num_fixed = 0, .m_objs = {} };
static const lean_object* l_Std_Http_Server_Handler_ofFn___closed__0 = (const lean_object*)&l_Std_Http_Server_Handler_ofFn___closed__0_value;
static const lean_closure_object l_Std_Http_Server_Handler_ofFn___closed__1_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_Std_Http_Server_Handler_ofFn___lam__1___boxed, .m_arity = 2, .m_num_fixed = 0, .m_objs = {} };
static const lean_object* l_Std_Http_Server_Handler_ofFn___closed__1 = (const lean_object*)&l_Std_Http_Server_Handler_ofFn___closed__1_value;
LEAN_EXPORT lean_object* l_Std_Http_Server_Handler_ofFn(lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Server_Handler_ofFns(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Server_Handler_withFailure(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Server_Handler_withContinue(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Http_Server_instHandlerStatelessHandler___lam__0(lean_object* v_self_1_, lean_object* v_request_2_, lean_object* v___y_3_){
_start:
{
lean_object* v_onRequest_5_; lean_object* v___x_6_;
v_onRequest_5_ = lean_ctor_get(v_self_1_, 0);
lean_inc_ref(v_onRequest_5_);
lean_dec_ref(v_self_1_);
lean_inc_ref(v___y_3_);
v___x_6_ = lean_apply_3(v_onRequest_5_, v_request_2_, v___y_3_, lean_box(0));
return v___x_6_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Server_instHandlerStatelessHandler___lam__0___boxed(lean_object* v_self_7_, lean_object* v_request_8_, lean_object* v___y_9_, lean_object* v___y_10_){
_start:
{
lean_object* v_res_11_;
v_res_11_ = l_Std_Http_Server_instHandlerStatelessHandler___lam__0(v_self_7_, v_request_8_, v___y_9_);
lean_dec_ref(v___y_9_);
return v_res_11_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Server_instHandlerStatelessHandler___lam__1(lean_object* v_self_12_, lean_object* v_error_13_){
_start:
{
lean_object* v_onFailure_15_; lean_object* v___x_16_;
v_onFailure_15_ = lean_ctor_get(v_self_12_, 1);
lean_inc_ref(v_onFailure_15_);
lean_dec_ref(v_self_12_);
v___x_16_ = lean_apply_2(v_onFailure_15_, v_error_13_, lean_box(0));
return v___x_16_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Server_instHandlerStatelessHandler___lam__1___boxed(lean_object* v_self_17_, lean_object* v_error_18_, lean_object* v___y_19_){
_start:
{
lean_object* v_res_20_;
v_res_20_ = l_Std_Http_Server_instHandlerStatelessHandler___lam__1(v_self_17_, v_error_18_);
return v_res_20_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Server_instHandlerStatelessHandler___lam__2(lean_object* v_self_21_, lean_object* v_request_22_){
_start:
{
lean_object* v_onContinue_24_; lean_object* v___x_25_;
v_onContinue_24_ = lean_ctor_get(v_self_21_, 2);
lean_inc_ref(v_onContinue_24_);
lean_dec_ref(v_self_21_);
v___x_25_ = lean_apply_2(v_onContinue_24_, v_request_22_, lean_box(0));
return v___x_25_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Server_instHandlerStatelessHandler___lam__2___boxed(lean_object* v_self_26_, lean_object* v_request_27_, lean_object* v___y_28_){
_start:
{
lean_object* v_res_29_;
v_res_29_ = l_Std_Http_Server_instHandlerStatelessHandler___lam__2(v_self_26_, v_request_27_);
return v_res_29_;
}
}
static lean_object* _init_l_Std_Http_Server_instHandlerStatelessHandler___closed__3(void){
_start:
{
lean_object* v___f_33_; lean_object* v___f_34_; lean_object* v___f_35_; lean_object* v___x_36_; lean_object* v___x_37_;
v___f_33_ = ((lean_object*)(l_Std_Http_Server_instHandlerStatelessHandler___closed__2));
v___f_34_ = ((lean_object*)(l_Std_Http_Server_instHandlerStatelessHandler___closed__1));
v___f_35_ = ((lean_object*)(l_Std_Http_Server_instHandlerStatelessHandler___closed__0));
v___x_36_ = l_Std_Http_Body_instAny;
v___x_37_ = lean_alloc_ctor(0, 4, 0);
lean_ctor_set(v___x_37_, 0, v___x_36_);
lean_ctor_set(v___x_37_, 1, v___f_35_);
lean_ctor_set(v___x_37_, 2, v___f_34_);
lean_ctor_set(v___x_37_, 3, v___f_33_);
return v___x_37_;
}
}
static lean_object* _init_l_Std_Http_Server_instHandlerStatelessHandler(void){
_start:
{
lean_object* v___x_38_;
v___x_38_ = lean_obj_once(&l_Std_Http_Server_instHandlerStatelessHandler___closed__3, &l_Std_Http_Server_instHandlerStatelessHandler___closed__3_once, _init_l_Std_Http_Server_instHandlerStatelessHandler___closed__3);
return v___x_38_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Server_Handler_ofFn___lam__0(lean_object* v_x_43_){
_start:
{
lean_object* v___x_45_;
v___x_45_ = ((lean_object*)(l_Std_Http_Server_Handler_ofFn___lam__0___closed__1));
return v___x_45_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Server_Handler_ofFn___lam__0___boxed(lean_object* v_x_46_, lean_object* v___y_47_){
_start:
{
lean_object* v_res_48_;
v_res_48_ = l_Std_Http_Server_Handler_ofFn___lam__0(v_x_46_);
lean_dec(v_x_46_);
return v_res_48_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Server_Handler_ofFn___lam__1(lean_object* v_x_54_){
_start:
{
lean_object* v___x_56_;
v___x_56_ = ((lean_object*)(l_Std_Http_Server_Handler_ofFn___lam__1___closed__1));
return v___x_56_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Server_Handler_ofFn___lam__1___boxed(lean_object* v_x_57_, lean_object* v___y_58_){
_start:
{
lean_object* v_res_59_;
v_res_59_ = l_Std_Http_Server_Handler_ofFn___lam__1(v_x_57_);
lean_dec_ref(v_x_57_);
return v_res_59_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Server_Handler_ofFn(lean_object* v_f_62_){
_start:
{
lean_object* v___f_63_; lean_object* v___f_64_; lean_object* v___x_65_;
v___f_63_ = ((lean_object*)(l_Std_Http_Server_Handler_ofFn___closed__0));
v___f_64_ = ((lean_object*)(l_Std_Http_Server_Handler_ofFn___closed__1));
v___x_65_ = lean_alloc_ctor(0, 3, 0);
lean_ctor_set(v___x_65_, 0, v_f_62_);
lean_ctor_set(v___x_65_, 1, v___f_63_);
lean_ctor_set(v___x_65_, 2, v___f_64_);
return v___x_65_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Server_Handler_ofFns(lean_object* v_onRequest_66_, lean_object* v_onFailure_67_, lean_object* v_onContinue_68_){
_start:
{
lean_object* v___x_69_;
v___x_69_ = lean_alloc_ctor(0, 3, 0);
lean_ctor_set(v___x_69_, 0, v_onRequest_66_);
lean_ctor_set(v___x_69_, 1, v_onFailure_67_);
lean_ctor_set(v___x_69_, 2, v_onContinue_68_);
return v___x_69_;
}
}
LEAN_EXPORT lean_object* l_Std_Http_Server_Handler_withFailure(lean_object* v_handler_70_, lean_object* v_onFailure_71_){
_start:
{
lean_object* v_onRequest_72_; lean_object* v_onContinue_73_; lean_object* v___x_75_; uint8_t v_isShared_76_; uint8_t v_isSharedCheck_80_;
v_onRequest_72_ = lean_ctor_get(v_handler_70_, 0);
v_onContinue_73_ = lean_ctor_get(v_handler_70_, 2);
v_isSharedCheck_80_ = !lean_is_exclusive(v_handler_70_);
if (v_isSharedCheck_80_ == 0)
{
lean_object* v_unused_81_;
v_unused_81_ = lean_ctor_get(v_handler_70_, 1);
lean_dec(v_unused_81_);
v___x_75_ = v_handler_70_;
v_isShared_76_ = v_isSharedCheck_80_;
goto v_resetjp_74_;
}
else
{
lean_inc(v_onContinue_73_);
lean_inc(v_onRequest_72_);
lean_dec(v_handler_70_);
v___x_75_ = lean_box(0);
v_isShared_76_ = v_isSharedCheck_80_;
goto v_resetjp_74_;
}
v_resetjp_74_:
{
lean_object* v___x_78_;
if (v_isShared_76_ == 0)
{
lean_ctor_set(v___x_75_, 1, v_onFailure_71_);
v___x_78_ = v___x_75_;
goto v_reusejp_77_;
}
else
{
lean_object* v_reuseFailAlloc_79_;
v_reuseFailAlloc_79_ = lean_alloc_ctor(0, 3, 0);
lean_ctor_set(v_reuseFailAlloc_79_, 0, v_onRequest_72_);
lean_ctor_set(v_reuseFailAlloc_79_, 1, v_onFailure_71_);
lean_ctor_set(v_reuseFailAlloc_79_, 2, v_onContinue_73_);
v___x_78_ = v_reuseFailAlloc_79_;
goto v_reusejp_77_;
}
v_reusejp_77_:
{
return v___x_78_;
}
}
}
}
LEAN_EXPORT lean_object* l_Std_Http_Server_Handler_withContinue(lean_object* v_handler_82_, lean_object* v_onContinue_83_){
_start:
{
lean_object* v_onRequest_84_; lean_object* v_onFailure_85_; lean_object* v___x_87_; uint8_t v_isShared_88_; uint8_t v_isSharedCheck_92_;
v_onRequest_84_ = lean_ctor_get(v_handler_82_, 0);
v_onFailure_85_ = lean_ctor_get(v_handler_82_, 1);
v_isSharedCheck_92_ = !lean_is_exclusive(v_handler_82_);
if (v_isSharedCheck_92_ == 0)
{
lean_object* v_unused_93_;
v_unused_93_ = lean_ctor_get(v_handler_82_, 2);
lean_dec(v_unused_93_);
v___x_87_ = v_handler_82_;
v_isShared_88_ = v_isSharedCheck_92_;
goto v_resetjp_86_;
}
else
{
lean_inc(v_onFailure_85_);
lean_inc(v_onRequest_84_);
lean_dec(v_handler_82_);
v___x_87_ = lean_box(0);
v_isShared_88_ = v_isSharedCheck_92_;
goto v_resetjp_86_;
}
v_resetjp_86_:
{
lean_object* v___x_90_;
if (v_isShared_88_ == 0)
{
lean_ctor_set(v___x_87_, 2, v_onContinue_83_);
v___x_90_ = v___x_87_;
goto v_reusejp_89_;
}
else
{
lean_object* v_reuseFailAlloc_91_;
v_reuseFailAlloc_91_ = lean_alloc_ctor(0, 3, 0);
lean_ctor_set(v_reuseFailAlloc_91_, 0, v_onRequest_84_);
lean_ctor_set(v_reuseFailAlloc_91_, 1, v_onFailure_85_);
lean_ctor_set(v_reuseFailAlloc_91_, 2, v_onContinue_83_);
v___x_90_ = v_reuseFailAlloc_91_;
goto v_reusejp_89_;
}
v_reusejp_89_:
{
return v___x_90_;
}
}
}
}
lean_object* runtime_initialize_Std_Internal_Async(uint8_t builtin);
lean_object* runtime_initialize_Std_Internal_Http_Data(uint8_t builtin);
lean_object* runtime_initialize_Std_Internal_Async_ContextAsync(uint8_t builtin);
static bool _G_runtime_initialized = false;
LEAN_EXPORT lean_object* runtime_initialize_Std_Internal_Http_Server_Handler(uint8_t builtin) {
lean_object * res;
if (_G_runtime_initialized) return lean_io_result_mk_ok(lean_box(0));
_G_runtime_initialized = true;
res = runtime_initialize_Std_Internal_Async(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = runtime_initialize_Std_Internal_Http_Data(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = runtime_initialize_Std_Internal_Async_ContextAsync(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
l_Std_Http_Server_instHandlerStatelessHandler = _init_l_Std_Http_Server_instHandlerStatelessHandler();
lean_mark_persistent(l_Std_Http_Server_instHandlerStatelessHandler);
return lean_io_result_mk_ok(lean_box(0));
}
static bool _G_meta_initialized = false;
LEAN_EXPORT lean_object* meta_initialize_Std_Internal_Http_Server_Handler(uint8_t builtin) {
lean_object * res;
if (_G_meta_initialized) return lean_io_result_mk_ok(lean_box(0));
_G_meta_initialized = true;
return lean_io_result_mk_ok(lean_box(0));
}
lean_object* initialize_Std_Internal_Async(uint8_t builtin);
lean_object* initialize_Std_Internal_Http_Data(uint8_t builtin);
lean_object* initialize_Std_Internal_Async_ContextAsync(uint8_t builtin);
static bool _G_initialized = false;
LEAN_EXPORT lean_object* initialize_Std_Internal_Http_Server_Handler(uint8_t builtin) {
lean_object * res;
if (_G_initialized) return lean_io_result_mk_ok(lean_box(0));
_G_initialized = true;
res = initialize_Std_Internal_Async(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Std_Internal_Http_Data(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Std_Internal_Async_ContextAsync(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = runtime_initialize_Std_Internal_Http_Server_Handler(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = meta_initialize_Std_Internal_Http_Server_Handler(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
return initialize_Std_Internal_Http_Server_Handler(builtin);
}
#ifdef __cplusplus
}
#endif

File diff suppressed because it is too large Load diff

3339
stage0/stdlib/Std/Internal/Http/Transport.c generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -23,6 +23,9 @@ uint8_t l_Array_instDecidableEqImpl___redArg(lean_object*, lean_object*, lean_ob
lean_object* l_instDecidableEqUInt16___boxed(lean_object*, lean_object*);
uint8_t lean_uint16_dec_eq(uint16_t, uint16_t);
uint8_t lean_nat_dec_le(lean_object*, lean_object*);
lean_object* lean_string_append(lean_object*, lean_object*);
lean_object* lean_uint16_to_nat(uint16_t);
lean_object* l_Nat_reprFast(lean_object*);
uint8_t lean_string_dec_eq(lean_object*, lean_object*);
uint8_t lean_nat_dec_eq(lean_object*, lean_object*);
static lean_once_cell_t l_Std_Net_instInhabitedMACAddr_default___closed__0_once = LEAN_ONCE_CELL_INITIALIZER;
@ -138,6 +141,13 @@ LEAN_EXPORT lean_object* l_Std_Net_IPv4Addr_instCoeIPAddr___lam__0(lean_object*)
static const lean_closure_object l_Std_Net_IPv4Addr_instCoeIPAddr___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_Std_Net_IPv4Addr_instCoeIPAddr___lam__0, .m_arity = 1, .m_num_fixed = 0, .m_objs = {} };
static const lean_object* l_Std_Net_IPv4Addr_instCoeIPAddr___closed__0 = (const lean_object*)&l_Std_Net_IPv4Addr_instCoeIPAddr___closed__0_value;
LEAN_EXPORT const lean_object* l_Std_Net_IPv4Addr_instCoeIPAddr = (const lean_object*)&l_Std_Net_IPv4Addr_instCoeIPAddr___closed__0_value;
static const lean_string_object l_Std_Net_SocketAddressV4_instToString___lam__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_Std_Net_SocketAddressV4_instToString___lam__0___closed__0 = (const lean_object*)&l_Std_Net_SocketAddressV4_instToString___lam__0___closed__0_value;
LEAN_EXPORT lean_object* l_Std_Net_SocketAddressV4_instToString___lam__0(lean_object*);
LEAN_EXPORT lean_object* l_Std_Net_SocketAddressV4_instToString___lam__0___boxed(lean_object*);
static const lean_closure_object l_Std_Net_SocketAddressV4_instToString___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_Std_Net_SocketAddressV4_instToString___lam__0___boxed, .m_arity = 1, .m_num_fixed = 0, .m_objs = {} };
static const lean_object* l_Std_Net_SocketAddressV4_instToString___closed__0 = (const lean_object*)&l_Std_Net_SocketAddressV4_instToString___closed__0_value;
LEAN_EXPORT const lean_object* l_Std_Net_SocketAddressV4_instToString = (const lean_object*)&l_Std_Net_SocketAddressV4_instToString___closed__0_value;
LEAN_EXPORT lean_object* l_Std_Net_SocketAddressV4_instCoeSocketAddress___lam__0(lean_object*);
static const lean_closure_object l_Std_Net_SocketAddressV4_instCoeSocketAddress___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_Std_Net_SocketAddressV4_instCoeSocketAddress___lam__0, .m_arity = 1, .m_num_fixed = 0, .m_objs = {} };
static const lean_object* l_Std_Net_SocketAddressV4_instCoeSocketAddress___closed__0 = (const lean_object*)&l_Std_Net_SocketAddressV4_instCoeSocketAddress___closed__0_value;
@ -155,6 +165,15 @@ LEAN_EXPORT lean_object* l_Std_Net_IPv6Addr_instCoeIPAddr___lam__0(lean_object*)
static const lean_closure_object l_Std_Net_IPv6Addr_instCoeIPAddr___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_Std_Net_IPv6Addr_instCoeIPAddr___lam__0, .m_arity = 1, .m_num_fixed = 0, .m_objs = {} };
static const lean_object* l_Std_Net_IPv6Addr_instCoeIPAddr___closed__0 = (const lean_object*)&l_Std_Net_IPv6Addr_instCoeIPAddr___closed__0_value;
LEAN_EXPORT const lean_object* l_Std_Net_IPv6Addr_instCoeIPAddr = (const lean_object*)&l_Std_Net_IPv6Addr_instCoeIPAddr___closed__0_value;
static const lean_string_object l_Std_Net_SocketAddressV6_instToString___lam__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_Std_Net_SocketAddressV6_instToString___lam__0___closed__0 = (const lean_object*)&l_Std_Net_SocketAddressV6_instToString___lam__0___closed__0_value;
static const lean_string_object l_Std_Net_SocketAddressV6_instToString___lam__0___closed__1_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 = "]:"};
static const lean_object* l_Std_Net_SocketAddressV6_instToString___lam__0___closed__1 = (const lean_object*)&l_Std_Net_SocketAddressV6_instToString___lam__0___closed__1_value;
LEAN_EXPORT lean_object* l_Std_Net_SocketAddressV6_instToString___lam__0(lean_object*);
LEAN_EXPORT lean_object* l_Std_Net_SocketAddressV6_instToString___lam__0___boxed(lean_object*);
static const lean_closure_object l_Std_Net_SocketAddressV6_instToString___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_Std_Net_SocketAddressV6_instToString___lam__0___boxed, .m_arity = 1, .m_num_fixed = 0, .m_objs = {} };
static const lean_object* l_Std_Net_SocketAddressV6_instToString___closed__0 = (const lean_object*)&l_Std_Net_SocketAddressV6_instToString___closed__0_value;
LEAN_EXPORT const lean_object* l_Std_Net_SocketAddressV6_instToString = (const lean_object*)&l_Std_Net_SocketAddressV6_instToString___closed__0_value;
LEAN_EXPORT lean_object* l_Std_Net_SocketAddressV6_instCoeSocketAddress___lam__0(lean_object*);
static const lean_closure_object l_Std_Net_SocketAddressV6_instCoeSocketAddress___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_Std_Net_SocketAddressV6_instCoeSocketAddress___lam__0, .m_arity = 1, .m_num_fixed = 0, .m_objs = {} };
static const lean_object* l_Std_Net_SocketAddressV6_instCoeSocketAddress___closed__0 = (const lean_object*)&l_Std_Net_SocketAddressV6_instCoeSocketAddress___closed__0_value;
@ -166,6 +185,11 @@ LEAN_EXPORT lean_object* l_Std_Net_IPAddr_toString___boxed(lean_object*);
static const lean_closure_object l_Std_Net_IPAddr_instToString___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_Std_Net_IPAddr_toString___boxed, .m_arity = 1, .m_num_fixed = 0, .m_objs = {} };
static const lean_object* l_Std_Net_IPAddr_instToString___closed__0 = (const lean_object*)&l_Std_Net_IPAddr_instToString___closed__0_value;
LEAN_EXPORT const lean_object* l_Std_Net_IPAddr_instToString = (const lean_object*)&l_Std_Net_IPAddr_instToString___closed__0_value;
LEAN_EXPORT lean_object* l_Std_Net_SocketAddress_instToString___lam__0(lean_object*);
LEAN_EXPORT lean_object* l_Std_Net_SocketAddress_instToString___lam__0___boxed(lean_object*);
static const lean_closure_object l_Std_Net_SocketAddress_instToString___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_Std_Net_SocketAddress_instToString___lam__0___boxed, .m_arity = 1, .m_num_fixed = 0, .m_objs = {} };
static const lean_object* l_Std_Net_SocketAddress_instToString___closed__0 = (const lean_object*)&l_Std_Net_SocketAddress_instToString___closed__0_value;
LEAN_EXPORT const lean_object* l_Std_Net_SocketAddress_instToString = (const lean_object*)&l_Std_Net_SocketAddress_instToString___closed__0_value;
LEAN_EXPORT uint8_t l_Std_Net_SocketAddress_family(lean_object*);
LEAN_EXPORT lean_object* l_Std_Net_SocketAddress_family___boxed(lean_object*);
LEAN_EXPORT lean_object* l_Std_Net_SocketAddress_ipAddr(lean_object*);
@ -1187,427 +1211,527 @@ lean_ctor_set(v___x_345_, 0, v_addr_344_);
return v___x_345_;
}
}
LEAN_EXPORT lean_object* l_Std_Net_SocketAddressV4_instCoeSocketAddress___lam__0(lean_object* v_addr_348_){
LEAN_EXPORT lean_object* l_Std_Net_SocketAddressV4_instToString___lam__0(lean_object* v_sa_349_){
_start:
{
lean_object* v___x_349_;
v___x_349_ = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(v___x_349_, 0, v_addr_348_);
return v___x_349_;
lean_object* v_addr_350_; uint16_t v_port_351_; lean_object* v___x_352_; lean_object* v___x_353_; lean_object* v___x_354_; lean_object* v___x_355_; lean_object* v___x_356_; lean_object* v___x_357_;
v_addr_350_ = lean_ctor_get(v_sa_349_, 0);
v_port_351_ = lean_ctor_get_uint16(v_sa_349_, sizeof(void*)*1);
v___x_352_ = lean_uv_ntop_v4(v_addr_350_);
v___x_353_ = ((lean_object*)(l_Std_Net_SocketAddressV4_instToString___lam__0___closed__0));
v___x_354_ = lean_string_append(v___x_352_, v___x_353_);
v___x_355_ = lean_uint16_to_nat(v_port_351_);
v___x_356_ = l_Nat_reprFast(v___x_355_);
v___x_357_ = lean_string_append(v___x_354_, v___x_356_);
lean_dec_ref(v___x_356_);
return v___x_357_;
}
}
LEAN_EXPORT lean_object* l_Std_Net_IPv6Addr_ofParts(uint16_t v_a_352_, uint16_t v_b_353_, uint16_t v_c_354_, uint16_t v_d_355_, uint16_t v_e_356_, uint16_t v_f_357_, uint16_t v_g_358_, uint16_t v_h_359_){
LEAN_EXPORT lean_object* l_Std_Net_SocketAddressV4_instToString___lam__0___boxed(lean_object* v_sa_358_){
_start:
{
lean_object* v___x_360_; lean_object* v___x_361_; lean_object* v___x_362_; lean_object* v___x_363_; lean_object* v___x_364_; lean_object* v___x_365_; lean_object* v___x_366_; lean_object* v___x_367_; lean_object* v___x_368_; lean_object* v___x_369_; lean_object* v___x_370_; lean_object* v___x_371_; lean_object* v___x_372_; lean_object* v___x_373_; lean_object* v___x_374_; lean_object* v___x_375_; lean_object* v___x_376_; lean_object* v___x_377_;
v___x_360_ = lean_unsigned_to_nat(8u);
v___x_361_ = lean_mk_empty_array_with_capacity(v___x_360_);
v___x_362_ = lean_box(v_a_352_);
v___x_363_ = lean_array_push(v___x_361_, v___x_362_);
v___x_364_ = lean_box(v_b_353_);
v___x_365_ = lean_array_push(v___x_363_, v___x_364_);
v___x_366_ = lean_box(v_c_354_);
v___x_367_ = lean_array_push(v___x_365_, v___x_366_);
v___x_368_ = lean_box(v_d_355_);
v___x_369_ = lean_array_push(v___x_367_, v___x_368_);
v___x_370_ = lean_box(v_e_356_);
v___x_371_ = lean_array_push(v___x_369_, v___x_370_);
v___x_372_ = lean_box(v_f_357_);
v___x_373_ = lean_array_push(v___x_371_, v___x_372_);
v___x_374_ = lean_box(v_g_358_);
v___x_375_ = lean_array_push(v___x_373_, v___x_374_);
v___x_376_ = lean_box(v_h_359_);
lean_object* v_res_359_;
v_res_359_ = l_Std_Net_SocketAddressV4_instToString___lam__0(v_sa_358_);
lean_dec_ref(v_sa_358_);
return v_res_359_;
}
}
LEAN_EXPORT lean_object* l_Std_Net_SocketAddressV4_instCoeSocketAddress___lam__0(lean_object* v_addr_362_){
_start:
{
lean_object* v___x_363_;
v___x_363_ = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(v___x_363_, 0, v_addr_362_);
return v___x_363_;
}
}
LEAN_EXPORT lean_object* l_Std_Net_IPv6Addr_ofParts(uint16_t v_a_366_, uint16_t v_b_367_, uint16_t v_c_368_, uint16_t v_d_369_, uint16_t v_e_370_, uint16_t v_f_371_, uint16_t v_g_372_, uint16_t v_h_373_){
_start:
{
lean_object* v___x_374_; lean_object* v___x_375_; lean_object* v___x_376_; lean_object* v___x_377_; lean_object* v___x_378_; lean_object* v___x_379_; lean_object* v___x_380_; lean_object* v___x_381_; lean_object* v___x_382_; lean_object* v___x_383_; lean_object* v___x_384_; lean_object* v___x_385_; lean_object* v___x_386_; lean_object* v___x_387_; lean_object* v___x_388_; lean_object* v___x_389_; lean_object* v___x_390_; lean_object* v___x_391_;
v___x_374_ = lean_unsigned_to_nat(8u);
v___x_375_ = lean_mk_empty_array_with_capacity(v___x_374_);
v___x_376_ = lean_box(v_a_366_);
v___x_377_ = lean_array_push(v___x_375_, v___x_376_);
return v___x_377_;
v___x_378_ = lean_box(v_b_367_);
v___x_379_ = lean_array_push(v___x_377_, v___x_378_);
v___x_380_ = lean_box(v_c_368_);
v___x_381_ = lean_array_push(v___x_379_, v___x_380_);
v___x_382_ = lean_box(v_d_369_);
v___x_383_ = lean_array_push(v___x_381_, v___x_382_);
v___x_384_ = lean_box(v_e_370_);
v___x_385_ = lean_array_push(v___x_383_, v___x_384_);
v___x_386_ = lean_box(v_f_371_);
v___x_387_ = lean_array_push(v___x_385_, v___x_386_);
v___x_388_ = lean_box(v_g_372_);
v___x_389_ = lean_array_push(v___x_387_, v___x_388_);
v___x_390_ = lean_box(v_h_373_);
v___x_391_ = lean_array_push(v___x_389_, v___x_390_);
return v___x_391_;
}
}
LEAN_EXPORT lean_object* l_Std_Net_IPv6Addr_ofParts___boxed(lean_object* v_a_378_, lean_object* v_b_379_, lean_object* v_c_380_, lean_object* v_d_381_, lean_object* v_e_382_, lean_object* v_f_383_, lean_object* v_g_384_, lean_object* v_h_385_){
LEAN_EXPORT lean_object* l_Std_Net_IPv6Addr_ofParts___boxed(lean_object* v_a_392_, lean_object* v_b_393_, lean_object* v_c_394_, lean_object* v_d_395_, lean_object* v_e_396_, lean_object* v_f_397_, lean_object* v_g_398_, lean_object* v_h_399_){
_start:
{
uint16_t v_a_boxed_386_; uint16_t v_b_boxed_387_; uint16_t v_c_boxed_388_; uint16_t v_d_boxed_389_; uint16_t v_e_boxed_390_; uint16_t v_f_boxed_391_; uint16_t v_g_boxed_392_; uint16_t v_h_boxed_393_; lean_object* v_res_394_;
v_a_boxed_386_ = lean_unbox(v_a_378_);
v_b_boxed_387_ = lean_unbox(v_b_379_);
v_c_boxed_388_ = lean_unbox(v_c_380_);
v_d_boxed_389_ = lean_unbox(v_d_381_);
v_e_boxed_390_ = lean_unbox(v_e_382_);
v_f_boxed_391_ = lean_unbox(v_f_383_);
v_g_boxed_392_ = lean_unbox(v_g_384_);
v_h_boxed_393_ = lean_unbox(v_h_385_);
v_res_394_ = l_Std_Net_IPv6Addr_ofParts(v_a_boxed_386_, v_b_boxed_387_, v_c_boxed_388_, v_d_boxed_389_, v_e_boxed_390_, v_f_boxed_391_, v_g_boxed_392_, v_h_boxed_393_);
return v_res_394_;
uint16_t v_a_boxed_400_; uint16_t v_b_boxed_401_; uint16_t v_c_boxed_402_; uint16_t v_d_boxed_403_; uint16_t v_e_boxed_404_; uint16_t v_f_boxed_405_; uint16_t v_g_boxed_406_; uint16_t v_h_boxed_407_; lean_object* v_res_408_;
v_a_boxed_400_ = lean_unbox(v_a_392_);
v_b_boxed_401_ = lean_unbox(v_b_393_);
v_c_boxed_402_ = lean_unbox(v_c_394_);
v_d_boxed_403_ = lean_unbox(v_d_395_);
v_e_boxed_404_ = lean_unbox(v_e_396_);
v_f_boxed_405_ = lean_unbox(v_f_397_);
v_g_boxed_406_ = lean_unbox(v_g_398_);
v_h_boxed_407_ = lean_unbox(v_h_399_);
v_res_408_ = l_Std_Net_IPv6Addr_ofParts(v_a_boxed_400_, v_b_boxed_401_, v_c_boxed_402_, v_d_boxed_403_, v_e_boxed_404_, v_f_boxed_405_, v_g_boxed_406_, v_h_boxed_407_);
return v_res_408_;
}
}
LEAN_EXPORT lean_object* l_Std_Net_IPv6Addr_ofString___boxed(lean_object* v_s_396_){
LEAN_EXPORT lean_object* l_Std_Net_IPv6Addr_ofString___boxed(lean_object* v_s_410_){
_start:
{
lean_object* v_res_397_;
v_res_397_ = lean_uv_pton_v6(v_s_396_);
lean_dec_ref(v_s_396_);
return v_res_397_;
lean_object* v_res_411_;
v_res_411_ = lean_uv_pton_v6(v_s_410_);
lean_dec_ref(v_s_410_);
return v_res_411_;
}
}
LEAN_EXPORT lean_object* l_Std_Net_IPv6Addr_toString___boxed(lean_object* v_addr_399_){
LEAN_EXPORT lean_object* l_Std_Net_IPv6Addr_toString___boxed(lean_object* v_addr_413_){
_start:
{
lean_object* v_res_400_;
v_res_400_ = lean_uv_ntop_v6(v_addr_399_);
lean_dec_ref(v_addr_399_);
return v_res_400_;
lean_object* v_res_414_;
v_res_414_ = lean_uv_ntop_v6(v_addr_413_);
lean_dec_ref(v_addr_413_);
return v_res_414_;
}
}
LEAN_EXPORT lean_object* l_Std_Net_IPv6Addr_instCoeIPAddr___lam__0(lean_object* v_addr_403_){
LEAN_EXPORT lean_object* l_Std_Net_IPv6Addr_instCoeIPAddr___lam__0(lean_object* v_addr_417_){
_start:
{
lean_object* v___x_404_;
v___x_404_ = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(v___x_404_, 0, v_addr_403_);
return v___x_404_;
lean_object* v___x_418_;
v___x_418_ = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(v___x_418_, 0, v_addr_417_);
return v___x_418_;
}
}
LEAN_EXPORT lean_object* l_Std_Net_SocketAddressV6_instCoeSocketAddress___lam__0(lean_object* v_addr_407_){
LEAN_EXPORT lean_object* l_Std_Net_SocketAddressV6_instToString___lam__0(lean_object* v_sa_423_){
_start:
{
lean_object* v___x_408_;
v___x_408_ = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(v___x_408_, 0, v_addr_407_);
return v___x_408_;
lean_object* v_addr_424_; uint16_t v_port_425_; lean_object* v___x_426_; lean_object* v___x_427_; lean_object* v___x_428_; lean_object* v___x_429_; lean_object* v___x_430_; lean_object* v___x_431_; lean_object* v___x_432_; lean_object* v___x_433_;
v_addr_424_ = lean_ctor_get(v_sa_423_, 0);
v_port_425_ = lean_ctor_get_uint16(v_sa_423_, sizeof(void*)*1);
v___x_426_ = ((lean_object*)(l_Std_Net_SocketAddressV6_instToString___lam__0___closed__0));
v___x_427_ = lean_uv_ntop_v6(v_addr_424_);
v___x_428_ = lean_string_append(v___x_426_, v___x_427_);
lean_dec_ref(v___x_427_);
v___x_429_ = ((lean_object*)(l_Std_Net_SocketAddressV6_instToString___lam__0___closed__1));
v___x_430_ = lean_string_append(v___x_428_, v___x_429_);
v___x_431_ = lean_uint16_to_nat(v_port_425_);
v___x_432_ = l_Nat_reprFast(v___x_431_);
v___x_433_ = lean_string_append(v___x_430_, v___x_432_);
lean_dec_ref(v___x_432_);
return v___x_433_;
}
}
LEAN_EXPORT uint8_t l_Std_Net_IPAddr_family(lean_object* v_x_411_){
LEAN_EXPORT lean_object* l_Std_Net_SocketAddressV6_instToString___lam__0___boxed(lean_object* v_sa_434_){
_start:
{
if (lean_obj_tag(v_x_411_) == 0)
{
uint8_t v___x_412_;
v___x_412_ = 0;
return v___x_412_;
}
else
{
uint8_t v___x_413_;
v___x_413_ = 1;
return v___x_413_;
lean_object* v_res_435_;
v_res_435_ = l_Std_Net_SocketAddressV6_instToString___lam__0(v_sa_434_);
lean_dec_ref(v_sa_434_);
return v_res_435_;
}
}
}
LEAN_EXPORT lean_object* l_Std_Net_IPAddr_family___boxed(lean_object* v_x_414_){
LEAN_EXPORT lean_object* l_Std_Net_SocketAddressV6_instCoeSocketAddress___lam__0(lean_object* v_addr_438_){
_start:
{
uint8_t v_res_415_; lean_object* v_r_416_;
v_res_415_ = l_Std_Net_IPAddr_family(v_x_414_);
lean_dec_ref(v_x_414_);
v_r_416_ = lean_box(v_res_415_);
return v_r_416_;
}
}
LEAN_EXPORT lean_object* l_Std_Net_IPAddr_toString(lean_object* v_x_417_){
_start:
{
if (lean_obj_tag(v_x_417_) == 0)
{
lean_object* v_addr_418_; lean_object* v___x_419_;
v_addr_418_ = lean_ctor_get(v_x_417_, 0);
v___x_419_ = lean_uv_ntop_v4(v_addr_418_);
return v___x_419_;
}
else
{
lean_object* v_addr_420_; lean_object* v___x_421_;
v_addr_420_ = lean_ctor_get(v_x_417_, 0);
v___x_421_ = lean_uv_ntop_v6(v_addr_420_);
return v___x_421_;
}
}
}
LEAN_EXPORT lean_object* l_Std_Net_IPAddr_toString___boxed(lean_object* v_x_422_){
_start:
{
lean_object* v_res_423_;
v_res_423_ = l_Std_Net_IPAddr_toString(v_x_422_);
lean_dec_ref(v_x_422_);
return v_res_423_;
}
}
LEAN_EXPORT uint8_t l_Std_Net_SocketAddress_family(lean_object* v_x_426_){
_start:
{
if (lean_obj_tag(v_x_426_) == 0)
{
uint8_t v___x_427_;
v___x_427_ = 0;
return v___x_427_;
}
else
{
uint8_t v___x_428_;
v___x_428_ = 1;
return v___x_428_;
}
}
}
LEAN_EXPORT lean_object* l_Std_Net_SocketAddress_family___boxed(lean_object* v_x_429_){
_start:
{
uint8_t v_res_430_; lean_object* v_r_431_;
v_res_430_ = l_Std_Net_SocketAddress_family(v_x_429_);
lean_dec_ref(v_x_429_);
v_r_431_ = lean_box(v_res_430_);
return v_r_431_;
}
}
LEAN_EXPORT lean_object* l_Std_Net_SocketAddress_ipAddr(lean_object* v_x_432_){
_start:
{
if (lean_obj_tag(v_x_432_) == 0)
{
lean_object* v_addr_433_; lean_object* v___x_435_; uint8_t v_isShared_436_; uint8_t v_isSharedCheck_441_;
v_addr_433_ = lean_ctor_get(v_x_432_, 0);
v_isSharedCheck_441_ = !lean_is_exclusive(v_x_432_);
if (v_isSharedCheck_441_ == 0)
{
v___x_435_ = v_x_432_;
v_isShared_436_ = v_isSharedCheck_441_;
goto v_resetjp_434_;
}
else
{
lean_inc(v_addr_433_);
lean_dec(v_x_432_);
v___x_435_ = lean_box(0);
v_isShared_436_ = v_isSharedCheck_441_;
goto v_resetjp_434_;
}
v_resetjp_434_:
{
lean_object* v_addr_437_; lean_object* v___x_439_;
v_addr_437_ = lean_ctor_get(v_addr_433_, 0);
lean_inc_ref(v_addr_437_);
lean_dec_ref(v_addr_433_);
if (v_isShared_436_ == 0)
{
lean_ctor_set(v___x_435_, 0, v_addr_437_);
v___x_439_ = v___x_435_;
goto v_reusejp_438_;
}
else
{
lean_object* v_reuseFailAlloc_440_;
v_reuseFailAlloc_440_ = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(v_reuseFailAlloc_440_, 0, v_addr_437_);
v___x_439_ = v_reuseFailAlloc_440_;
goto v_reusejp_438_;
}
v_reusejp_438_:
{
lean_object* v___x_439_;
v___x_439_ = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(v___x_439_, 0, v_addr_438_);
return v___x_439_;
}
}
}
else
{
lean_object* v_addr_442_; lean_object* v___x_444_; uint8_t v_isShared_445_; uint8_t v_isSharedCheck_450_;
v_addr_442_ = lean_ctor_get(v_x_432_, 0);
v_isSharedCheck_450_ = !lean_is_exclusive(v_x_432_);
if (v_isSharedCheck_450_ == 0)
{
v___x_444_ = v_x_432_;
v_isShared_445_ = v_isSharedCheck_450_;
goto v_resetjp_443_;
}
else
{
lean_inc(v_addr_442_);
lean_dec(v_x_432_);
v___x_444_ = lean_box(0);
v_isShared_445_ = v_isSharedCheck_450_;
goto v_resetjp_443_;
}
v_resetjp_443_:
{
lean_object* v_addr_446_; lean_object* v___x_448_;
v_addr_446_ = lean_ctor_get(v_addr_442_, 0);
lean_inc_ref(v_addr_446_);
lean_dec_ref(v_addr_442_);
if (v_isShared_445_ == 0)
{
lean_ctor_set(v___x_444_, 0, v_addr_446_);
v___x_448_ = v___x_444_;
goto v_reusejp_447_;
}
else
{
lean_object* v_reuseFailAlloc_449_;
v_reuseFailAlloc_449_ = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(v_reuseFailAlloc_449_, 0, v_addr_446_);
v___x_448_ = v_reuseFailAlloc_449_;
goto v_reusejp_447_;
}
v_reusejp_447_:
{
return v___x_448_;
}
}
}
}
}
LEAN_EXPORT uint16_t l_Std_Net_SocketAddress_port(lean_object* v_x_451_){
LEAN_EXPORT uint8_t l_Std_Net_IPAddr_family(lean_object* v_x_442_){
_start:
{
lean_object* v_addr_452_; uint16_t v_port_453_;
v_addr_452_ = lean_ctor_get(v_x_451_, 0);
v_port_453_ = lean_ctor_get_uint16(v_addr_452_, sizeof(void*)*1);
return v_port_453_;
if (lean_obj_tag(v_x_442_) == 0)
{
uint8_t v___x_443_;
v___x_443_ = 0;
return v___x_443_;
}
else
{
uint8_t v___x_444_;
v___x_444_ = 1;
return v___x_444_;
}
}
LEAN_EXPORT lean_object* l_Std_Net_SocketAddress_port___boxed(lean_object* v_x_454_){
}
LEAN_EXPORT lean_object* l_Std_Net_IPAddr_family___boxed(lean_object* v_x_445_){
_start:
{
uint16_t v_res_455_; lean_object* v_r_456_;
v_res_455_ = l_Std_Net_SocketAddress_port(v_x_454_);
lean_dec_ref(v_x_454_);
v_r_456_ = lean_box(v_res_455_);
return v_r_456_;
uint8_t v_res_446_; lean_object* v_r_447_;
v_res_446_ = l_Std_Net_IPAddr_family(v_x_445_);
lean_dec_ref(v_x_445_);
v_r_447_ = lean_box(v_res_446_);
return v_r_447_;
}
}
LEAN_EXPORT lean_object* l_Std_Net_IPAddr_toString(lean_object* v_x_448_){
_start:
{
if (lean_obj_tag(v_x_448_) == 0)
{
lean_object* v_addr_449_; lean_object* v___x_450_;
v_addr_449_ = lean_ctor_get(v_x_448_, 0);
v___x_450_ = lean_uv_ntop_v4(v_addr_449_);
return v___x_450_;
}
else
{
lean_object* v_addr_451_; lean_object* v___x_452_;
v_addr_451_ = lean_ctor_get(v_x_448_, 0);
v___x_452_ = lean_uv_ntop_v6(v_addr_451_);
return v___x_452_;
}
}
}
LEAN_EXPORT lean_object* l_Std_Net_IPAddr_toString___boxed(lean_object* v_x_453_){
_start:
{
lean_object* v_res_454_;
v_res_454_ = l_Std_Net_IPAddr_toString(v_x_453_);
lean_dec_ref(v_x_453_);
return v_res_454_;
}
}
LEAN_EXPORT lean_object* l_Std_Net_SocketAddress_instToString___lam__0(lean_object* v_x_457_){
_start:
{
if (lean_obj_tag(v_x_457_) == 0)
{
lean_object* v_addr_458_; lean_object* v_addr_459_; uint16_t v_port_460_; lean_object* v___x_461_; lean_object* v___x_462_; lean_object* v___x_463_; lean_object* v___x_464_; lean_object* v___x_465_; lean_object* v___x_466_;
v_addr_458_ = lean_ctor_get(v_x_457_, 0);
v_addr_459_ = lean_ctor_get(v_addr_458_, 0);
v_port_460_ = lean_ctor_get_uint16(v_addr_458_, sizeof(void*)*1);
v___x_461_ = lean_uv_ntop_v4(v_addr_459_);
v___x_462_ = ((lean_object*)(l_Std_Net_SocketAddressV4_instToString___lam__0___closed__0));
v___x_463_ = lean_string_append(v___x_461_, v___x_462_);
v___x_464_ = lean_uint16_to_nat(v_port_460_);
v___x_465_ = l_Nat_reprFast(v___x_464_);
v___x_466_ = lean_string_append(v___x_463_, v___x_465_);
lean_dec_ref(v___x_465_);
return v___x_466_;
}
else
{
lean_object* v_addr_467_; lean_object* v_addr_468_; uint16_t v_port_469_; lean_object* v___x_470_; lean_object* v___x_471_; lean_object* v___x_472_; lean_object* v___x_473_; lean_object* v___x_474_; lean_object* v___x_475_; lean_object* v___x_476_; lean_object* v___x_477_;
v_addr_467_ = lean_ctor_get(v_x_457_, 0);
v_addr_468_ = lean_ctor_get(v_addr_467_, 0);
v_port_469_ = lean_ctor_get_uint16(v_addr_467_, sizeof(void*)*1);
v___x_470_ = ((lean_object*)(l_Std_Net_SocketAddressV6_instToString___lam__0___closed__0));
v___x_471_ = lean_uv_ntop_v6(v_addr_468_);
v___x_472_ = lean_string_append(v___x_470_, v___x_471_);
lean_dec_ref(v___x_471_);
v___x_473_ = ((lean_object*)(l_Std_Net_SocketAddressV6_instToString___lam__0___closed__1));
v___x_474_ = lean_string_append(v___x_472_, v___x_473_);
v___x_475_ = lean_uint16_to_nat(v_port_469_);
v___x_476_ = l_Nat_reprFast(v___x_475_);
v___x_477_ = lean_string_append(v___x_474_, v___x_476_);
lean_dec_ref(v___x_476_);
return v___x_477_;
}
}
}
LEAN_EXPORT lean_object* l_Std_Net_SocketAddress_instToString___lam__0___boxed(lean_object* v_x_478_){
_start:
{
lean_object* v_res_479_;
v_res_479_ = l_Std_Net_SocketAddress_instToString___lam__0(v_x_478_);
lean_dec_ref(v_x_478_);
return v_res_479_;
}
}
LEAN_EXPORT uint8_t l_Std_Net_SocketAddress_family(lean_object* v_x_482_){
_start:
{
if (lean_obj_tag(v_x_482_) == 0)
{
uint8_t v___x_483_;
v___x_483_ = 0;
return v___x_483_;
}
else
{
uint8_t v___x_484_;
v___x_484_ = 1;
return v___x_484_;
}
}
}
LEAN_EXPORT lean_object* l_Std_Net_SocketAddress_family___boxed(lean_object* v_x_485_){
_start:
{
uint8_t v_res_486_; lean_object* v_r_487_;
v_res_486_ = l_Std_Net_SocketAddress_family(v_x_485_);
lean_dec_ref(v_x_485_);
v_r_487_ = lean_box(v_res_486_);
return v_r_487_;
}
}
LEAN_EXPORT lean_object* l_Std_Net_SocketAddress_ipAddr(lean_object* v_x_488_){
_start:
{
if (lean_obj_tag(v_x_488_) == 0)
{
lean_object* v_addr_489_; lean_object* v___x_491_; uint8_t v_isShared_492_; uint8_t v_isSharedCheck_497_;
v_addr_489_ = lean_ctor_get(v_x_488_, 0);
v_isSharedCheck_497_ = !lean_is_exclusive(v_x_488_);
if (v_isSharedCheck_497_ == 0)
{
v___x_491_ = v_x_488_;
v_isShared_492_ = v_isSharedCheck_497_;
goto v_resetjp_490_;
}
else
{
lean_inc(v_addr_489_);
lean_dec(v_x_488_);
v___x_491_ = lean_box(0);
v_isShared_492_ = v_isSharedCheck_497_;
goto v_resetjp_490_;
}
v_resetjp_490_:
{
lean_object* v_addr_493_; lean_object* v___x_495_;
v_addr_493_ = lean_ctor_get(v_addr_489_, 0);
lean_inc_ref(v_addr_493_);
lean_dec_ref(v_addr_489_);
if (v_isShared_492_ == 0)
{
lean_ctor_set(v___x_491_, 0, v_addr_493_);
v___x_495_ = v___x_491_;
goto v_reusejp_494_;
}
else
{
lean_object* v_reuseFailAlloc_496_;
v_reuseFailAlloc_496_ = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(v_reuseFailAlloc_496_, 0, v_addr_493_);
v___x_495_ = v_reuseFailAlloc_496_;
goto v_reusejp_494_;
}
v_reusejp_494_:
{
return v___x_495_;
}
}
}
else
{
lean_object* v_addr_498_; lean_object* v___x_500_; uint8_t v_isShared_501_; uint8_t v_isSharedCheck_506_;
v_addr_498_ = lean_ctor_get(v_x_488_, 0);
v_isSharedCheck_506_ = !lean_is_exclusive(v_x_488_);
if (v_isSharedCheck_506_ == 0)
{
v___x_500_ = v_x_488_;
v_isShared_501_ = v_isSharedCheck_506_;
goto v_resetjp_499_;
}
else
{
lean_inc(v_addr_498_);
lean_dec(v_x_488_);
v___x_500_ = lean_box(0);
v_isShared_501_ = v_isSharedCheck_506_;
goto v_resetjp_499_;
}
v_resetjp_499_:
{
lean_object* v_addr_502_; lean_object* v___x_504_;
v_addr_502_ = lean_ctor_get(v_addr_498_, 0);
lean_inc_ref(v_addr_502_);
lean_dec_ref(v_addr_498_);
if (v_isShared_501_ == 0)
{
lean_ctor_set(v___x_500_, 0, v_addr_502_);
v___x_504_ = v___x_500_;
goto v_reusejp_503_;
}
else
{
lean_object* v_reuseFailAlloc_505_;
v_reuseFailAlloc_505_ = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(v_reuseFailAlloc_505_, 0, v_addr_502_);
v___x_504_ = v_reuseFailAlloc_505_;
goto v_reusejp_503_;
}
v_reusejp_503_:
{
return v___x_504_;
}
}
}
}
}
LEAN_EXPORT uint16_t l_Std_Net_SocketAddress_port(lean_object* v_x_507_){
_start:
{
lean_object* v_addr_508_; uint16_t v_port_509_;
v_addr_508_ = lean_ctor_get(v_x_507_, 0);
v_port_509_ = lean_ctor_get_uint16(v_addr_508_, sizeof(void*)*1);
return v_port_509_;
}
}
LEAN_EXPORT lean_object* l_Std_Net_SocketAddress_port___boxed(lean_object* v_x_510_){
_start:
{
uint16_t v_res_511_; lean_object* v_r_512_;
v_res_511_ = l_Std_Net_SocketAddress_port(v_x_510_);
lean_dec_ref(v_x_510_);
v_r_512_ = lean_box(v_res_511_);
return v_r_512_;
}
}
static lean_object* _init_l_Std_Net_instInhabitedInterfaceAddress_default___closed__1(void){
_start:
{
lean_object* v___x_458_; uint8_t v___x_459_; lean_object* v___x_460_; lean_object* v___x_461_; lean_object* v___x_462_;
v___x_458_ = l_Std_Net_instInhabitedIPAddr_default;
v___x_459_ = 0;
v___x_460_ = l_Std_Net_instInhabitedMACAddr_default;
v___x_461_ = ((lean_object*)(l_Std_Net_instInhabitedInterfaceAddress_default___closed__0));
v___x_462_ = lean_alloc_ctor(0, 4, 1);
lean_ctor_set(v___x_462_, 0, v___x_461_);
lean_ctor_set(v___x_462_, 1, v___x_460_);
lean_ctor_set(v___x_462_, 2, v___x_458_);
lean_ctor_set(v___x_462_, 3, v___x_458_);
lean_ctor_set_uint8(v___x_462_, sizeof(void*)*4, v___x_459_);
return v___x_462_;
lean_object* v___x_514_; uint8_t v___x_515_; lean_object* v___x_516_; lean_object* v___x_517_; lean_object* v___x_518_;
v___x_514_ = l_Std_Net_instInhabitedIPAddr_default;
v___x_515_ = 0;
v___x_516_ = l_Std_Net_instInhabitedMACAddr_default;
v___x_517_ = ((lean_object*)(l_Std_Net_instInhabitedInterfaceAddress_default___closed__0));
v___x_518_ = lean_alloc_ctor(0, 4, 1);
lean_ctor_set(v___x_518_, 0, v___x_517_);
lean_ctor_set(v___x_518_, 1, v___x_516_);
lean_ctor_set(v___x_518_, 2, v___x_514_);
lean_ctor_set(v___x_518_, 3, v___x_514_);
lean_ctor_set_uint8(v___x_518_, sizeof(void*)*4, v___x_515_);
return v___x_518_;
}
}
static lean_object* _init_l_Std_Net_instInhabitedInterfaceAddress_default(void){
_start:
{
lean_object* v___x_463_;
v___x_463_ = lean_obj_once(&l_Std_Net_instInhabitedInterfaceAddress_default___closed__1, &l_Std_Net_instInhabitedInterfaceAddress_default___closed__1_once, _init_l_Std_Net_instInhabitedInterfaceAddress_default___closed__1);
return v___x_463_;
lean_object* v___x_519_;
v___x_519_ = lean_obj_once(&l_Std_Net_instInhabitedInterfaceAddress_default___closed__1, &l_Std_Net_instInhabitedInterfaceAddress_default___closed__1_once, _init_l_Std_Net_instInhabitedInterfaceAddress_default___closed__1);
return v___x_519_;
}
}
static lean_object* _init_l_Std_Net_instInhabitedInterfaceAddress(void){
_start:
{
lean_object* v___x_464_;
v___x_464_ = l_Std_Net_instInhabitedInterfaceAddress_default;
return v___x_464_;
lean_object* v___x_520_;
v___x_520_ = l_Std_Net_instInhabitedInterfaceAddress_default;
return v___x_520_;
}
}
LEAN_EXPORT uint8_t l_Std_Net_instDecidableEqInterfaceAddress_decEq(lean_object* v_x_465_, lean_object* v_x_466_){
LEAN_EXPORT uint8_t l_Std_Net_instDecidableEqInterfaceAddress_decEq(lean_object* v_x_521_, lean_object* v_x_522_){
_start:
{
lean_object* v_name_467_; lean_object* v_physicalAddress_468_; uint8_t v_isLoopback_469_; lean_object* v_address_470_; lean_object* v_netMask_471_; lean_object* v_name_472_; lean_object* v_physicalAddress_473_; uint8_t v_isLoopback_474_; lean_object* v_address_475_; lean_object* v_netMask_476_; uint8_t v___x_480_;
v_name_467_ = lean_ctor_get(v_x_465_, 0);
v_physicalAddress_468_ = lean_ctor_get(v_x_465_, 1);
v_isLoopback_469_ = lean_ctor_get_uint8(v_x_465_, sizeof(void*)*4);
v_address_470_ = lean_ctor_get(v_x_465_, 2);
v_netMask_471_ = lean_ctor_get(v_x_465_, 3);
v_name_472_ = lean_ctor_get(v_x_466_, 0);
v_physicalAddress_473_ = lean_ctor_get(v_x_466_, 1);
v_isLoopback_474_ = lean_ctor_get_uint8(v_x_466_, sizeof(void*)*4);
v_address_475_ = lean_ctor_get(v_x_466_, 2);
v_netMask_476_ = lean_ctor_get(v_x_466_, 3);
v___x_480_ = lean_string_dec_eq(v_name_467_, v_name_472_);
if (v___x_480_ == 0)
lean_object* v_name_523_; lean_object* v_physicalAddress_524_; uint8_t v_isLoopback_525_; lean_object* v_address_526_; lean_object* v_netMask_527_; lean_object* v_name_528_; lean_object* v_physicalAddress_529_; uint8_t v_isLoopback_530_; lean_object* v_address_531_; lean_object* v_netMask_532_; uint8_t v___x_536_;
v_name_523_ = lean_ctor_get(v_x_521_, 0);
v_physicalAddress_524_ = lean_ctor_get(v_x_521_, 1);
v_isLoopback_525_ = lean_ctor_get_uint8(v_x_521_, sizeof(void*)*4);
v_address_526_ = lean_ctor_get(v_x_521_, 2);
v_netMask_527_ = lean_ctor_get(v_x_521_, 3);
v_name_528_ = lean_ctor_get(v_x_522_, 0);
v_physicalAddress_529_ = lean_ctor_get(v_x_522_, 1);
v_isLoopback_530_ = lean_ctor_get_uint8(v_x_522_, sizeof(void*)*4);
v_address_531_ = lean_ctor_get(v_x_522_, 2);
v_netMask_532_ = lean_ctor_get(v_x_522_, 3);
v___x_536_ = lean_string_dec_eq(v_name_523_, v_name_528_);
if (v___x_536_ == 0)
{
return v___x_480_;
return v___x_536_;
}
else
{
uint8_t v___x_481_;
v___x_481_ = l_Std_Net_instDecidableEqMACAddr_decEq(v_physicalAddress_468_, v_physicalAddress_473_);
if (v___x_481_ == 0)
uint8_t v___x_537_;
v___x_537_ = l_Std_Net_instDecidableEqMACAddr_decEq(v_physicalAddress_524_, v_physicalAddress_529_);
if (v___x_537_ == 0)
{
return v___x_481_;
return v___x_537_;
}
else
{
if (v_isLoopback_469_ == 0)
if (v_isLoopback_525_ == 0)
{
if (v_isLoopback_474_ == 0)
if (v_isLoopback_530_ == 0)
{
goto v___jp_477_;
goto v___jp_533_;
}
else
{
return v_isLoopback_469_;
return v_isLoopback_525_;
}
}
else
{
if (v_isLoopback_474_ == 0)
if (v_isLoopback_530_ == 0)
{
return v_isLoopback_474_;
return v_isLoopback_530_;
}
else
{
goto v___jp_477_;
goto v___jp_533_;
}
}
}
}
v___jp_477_:
v___jp_533_:
{
uint8_t v___x_478_;
v___x_478_ = l_Std_Net_instDecidableEqIPAddr_decEq(v_address_470_, v_address_475_);
if (v___x_478_ == 0)
uint8_t v___x_534_;
v___x_534_ = l_Std_Net_instDecidableEqIPAddr_decEq(v_address_526_, v_address_531_);
if (v___x_534_ == 0)
{
return v___x_478_;
return v___x_534_;
}
else
{
uint8_t v___x_479_;
v___x_479_ = l_Std_Net_instDecidableEqIPAddr_decEq(v_netMask_471_, v_netMask_476_);
return v___x_479_;
uint8_t v___x_535_;
v___x_535_ = l_Std_Net_instDecidableEqIPAddr_decEq(v_netMask_527_, v_netMask_532_);
return v___x_535_;
}
}
}
}
LEAN_EXPORT lean_object* l_Std_Net_instDecidableEqInterfaceAddress_decEq___boxed(lean_object* v_x_482_, lean_object* v_x_483_){
LEAN_EXPORT lean_object* l_Std_Net_instDecidableEqInterfaceAddress_decEq___boxed(lean_object* v_x_538_, lean_object* v_x_539_){
_start:
{
uint8_t v_res_484_; lean_object* v_r_485_;
v_res_484_ = l_Std_Net_instDecidableEqInterfaceAddress_decEq(v_x_482_, v_x_483_);
lean_dec_ref(v_x_483_);
lean_dec_ref(v_x_482_);
v_r_485_ = lean_box(v_res_484_);
return v_r_485_;
uint8_t v_res_540_; lean_object* v_r_541_;
v_res_540_ = l_Std_Net_instDecidableEqInterfaceAddress_decEq(v_x_538_, v_x_539_);
lean_dec_ref(v_x_539_);
lean_dec_ref(v_x_538_);
v_r_541_ = lean_box(v_res_540_);
return v_r_541_;
}
}
LEAN_EXPORT uint8_t l_Std_Net_instDecidableEqInterfaceAddress(lean_object* v_x_486_, lean_object* v_x_487_){
LEAN_EXPORT uint8_t l_Std_Net_instDecidableEqInterfaceAddress(lean_object* v_x_542_, lean_object* v_x_543_){
_start:
{
uint8_t v___x_488_;
v___x_488_ = l_Std_Net_instDecidableEqInterfaceAddress_decEq(v_x_486_, v_x_487_);
return v___x_488_;
uint8_t v___x_544_;
v___x_544_ = l_Std_Net_instDecidableEqInterfaceAddress_decEq(v_x_542_, v_x_543_);
return v___x_544_;
}
}
LEAN_EXPORT lean_object* l_Std_Net_instDecidableEqInterfaceAddress___boxed(lean_object* v_x_489_, lean_object* v_x_490_){
LEAN_EXPORT lean_object* l_Std_Net_instDecidableEqInterfaceAddress___boxed(lean_object* v_x_545_, lean_object* v_x_546_){
_start:
{
uint8_t v_res_491_; lean_object* v_r_492_;
v_res_491_ = l_Std_Net_instDecidableEqInterfaceAddress(v_x_489_, v_x_490_);
lean_dec_ref(v_x_490_);
lean_dec_ref(v_x_489_);
v_r_492_ = lean_box(v_res_491_);
return v_r_492_;
uint8_t v_res_547_; lean_object* v_r_548_;
v_res_547_ = l_Std_Net_instDecidableEqInterfaceAddress(v_x_545_, v_x_546_);
lean_dec_ref(v_x_546_);
lean_dec_ref(v_x_545_);
v_r_548_ = lean_box(v_res_547_);
return v_r_548_;
}
}
LEAN_EXPORT lean_object* l_Std_Net_interfaceAddresses___boxed(lean_object* v_a_00___x40___internal___hyg_494_){
LEAN_EXPORT lean_object* l_Std_Net_interfaceAddresses___boxed(lean_object* v_a_00___x40___internal___hyg_550_){
_start:
{
lean_object* v_res_495_;
v_res_495_ = lean_uv_interface_addresses();
return v_res_495_;
lean_object* v_res_551_;
v_res_551_ = lean_uv_interface_addresses();
return v_res_551_;
}
}
lean_object* runtime_initialize_Init_System_IO(uint8_t builtin);

View file

@ -1,6 +1,6 @@
// Lean compiler output
// Module: Std.Sync
// Imports: public import Std.Sync.Basic public import Std.Sync.Channel public import Std.Sync.Mutex public import Std.Sync.RecursiveMutex public import Std.Sync.Barrier public import Std.Sync.SharedMutex public import Std.Sync.Notify public import Std.Sync.Broadcast public import Std.Sync.StreamMap public import Std.Sync.CancellationToken public import Std.Sync.CancellationContext
// Imports: public import Std.Sync.Basic public import Std.Sync.Channel public import Std.Sync.Mutex public import Std.Sync.RecursiveMutex public import Std.Sync.Barrier public import Std.Sync.Semaphore public import Std.Sync.SharedMutex public import Std.Sync.Notify public import Std.Sync.Broadcast public import Std.Sync.StreamMap public import Std.Sync.CancellationToken public import Std.Sync.CancellationContext
#include <lean/lean.h>
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunused-parameter"
@ -18,6 +18,7 @@ lean_object* runtime_initialize_Std_Sync_Channel(uint8_t builtin);
lean_object* runtime_initialize_Std_Sync_Mutex(uint8_t builtin);
lean_object* runtime_initialize_Std_Sync_RecursiveMutex(uint8_t builtin);
lean_object* runtime_initialize_Std_Sync_Barrier(uint8_t builtin);
lean_object* runtime_initialize_Std_Sync_Semaphore(uint8_t builtin);
lean_object* runtime_initialize_Std_Sync_SharedMutex(uint8_t builtin);
lean_object* runtime_initialize_Std_Sync_Notify(uint8_t builtin);
lean_object* runtime_initialize_Std_Sync_Broadcast(uint8_t builtin);
@ -44,6 +45,9 @@ lean_dec_ref(res);
res = runtime_initialize_Std_Sync_Barrier(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = runtime_initialize_Std_Sync_Semaphore(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = runtime_initialize_Std_Sync_SharedMutex(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
@ -76,6 +80,7 @@ lean_object* initialize_Std_Sync_Channel(uint8_t builtin);
lean_object* initialize_Std_Sync_Mutex(uint8_t builtin);
lean_object* initialize_Std_Sync_RecursiveMutex(uint8_t builtin);
lean_object* initialize_Std_Sync_Barrier(uint8_t builtin);
lean_object* initialize_Std_Sync_Semaphore(uint8_t builtin);
lean_object* initialize_Std_Sync_SharedMutex(uint8_t builtin);
lean_object* initialize_Std_Sync_Notify(uint8_t builtin);
lean_object* initialize_Std_Sync_Broadcast(uint8_t builtin);
@ -102,6 +107,9 @@ lean_dec_ref(res);
res = initialize_Std_Sync_Barrier(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Std_Sync_Semaphore(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Std_Sync_SharedMutex(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);

638
stage0/stdlib/Std/Sync/Semaphore.c generated Normal file
View file

@ -0,0 +1,638 @@
// Lean compiler output
// Module: Std.Sync.Semaphore
// Imports: public import Init.Data.Queue public import Init.System.Promise public import Std.Sync.Mutex
#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
lean_object* lean_st_ref_get(lean_object*);
uint8_t lean_nat_dec_lt(lean_object*, lean_object*);
lean_object* lean_io_promise_new();
lean_object* l_Std_Queue_enqueue___redArg(lean_object*, lean_object*);
lean_object* lean_st_ref_set(lean_object*, lean_object*);
lean_object* lean_nat_sub(lean_object*, lean_object*);
lean_object* lean_io_promise_resolve(lean_object*, lean_object*);
lean_object* lean_io_basemutex_lock(lean_object*);
lean_object* lean_io_basemutex_unlock(lean_object*);
lean_object* l_Std_Queue_dequeue_x3f___redArg(lean_object*);
lean_object* lean_nat_add(lean_object*, lean_object*);
lean_object* l_Std_Queue_empty(lean_object*);
lean_object* l_Std_Mutex_new___redArg(lean_object*);
LEAN_EXPORT lean_object* l___private_Std_Sync_Semaphore_0__Std_mkResolvedPromise___redArg(lean_object*);
LEAN_EXPORT lean_object* l___private_Std_Sync_Semaphore_0__Std_mkResolvedPromise___redArg___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Std_Sync_Semaphore_0__Std_mkResolvedPromise(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Std_Sync_Semaphore_0__Std_mkResolvedPromise___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
static lean_once_cell_t l_Std_Semaphore_new___closed__0_once = LEAN_ONCE_CELL_INITIALIZER;
static lean_object* l_Std_Semaphore_new___closed__0;
LEAN_EXPORT lean_object* l_Std_Semaphore_new(lean_object*);
LEAN_EXPORT lean_object* l_Std_Semaphore_new___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Mutex_atomically___at___00Std_Semaphore_acquire_spec__0___redArg(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Mutex_atomically___at___00Std_Semaphore_acquire_spec__0___redArg___boxed(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Mutex_atomically___at___00Std_Semaphore_acquire_spec__0(lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Mutex_atomically___at___00Std_Semaphore_acquire_spec__0___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Semaphore_acquire___lam__0(lean_object*);
LEAN_EXPORT lean_object* l_Std_Semaphore_acquire___lam__0___boxed(lean_object*, lean_object*);
static const lean_closure_object l_Std_Semaphore_acquire___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_Std_Semaphore_acquire___lam__0___boxed, .m_arity = 2, .m_num_fixed = 0, .m_objs = {} };
static const lean_object* l_Std_Semaphore_acquire___closed__0 = (const lean_object*)&l_Std_Semaphore_acquire___closed__0_value;
LEAN_EXPORT lean_object* l_Std_Semaphore_acquire(lean_object*);
LEAN_EXPORT lean_object* l_Std_Semaphore_acquire___boxed(lean_object*, lean_object*);
LEAN_EXPORT uint8_t l_Std_Semaphore_tryAcquire___lam__0(lean_object*);
LEAN_EXPORT lean_object* l_Std_Semaphore_tryAcquire___lam__0___boxed(lean_object*, lean_object*);
static const lean_closure_object l_Std_Semaphore_tryAcquire___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_Std_Semaphore_tryAcquire___lam__0___boxed, .m_arity = 2, .m_num_fixed = 0, .m_objs = {} };
static const lean_object* l_Std_Semaphore_tryAcquire___closed__0 = (const lean_object*)&l_Std_Semaphore_tryAcquire___closed__0_value;
LEAN_EXPORT uint8_t l_Std_Semaphore_tryAcquire(lean_object*);
LEAN_EXPORT lean_object* l_Std_Semaphore_tryAcquire___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Semaphore_release___lam__0(lean_object*);
LEAN_EXPORT lean_object* l_Std_Semaphore_release___lam__0___boxed(lean_object*, lean_object*);
static const lean_closure_object l_Std_Semaphore_release___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_Std_Semaphore_release___lam__0___boxed, .m_arity = 2, .m_num_fixed = 0, .m_objs = {} };
static const lean_object* l_Std_Semaphore_release___closed__0 = (const lean_object*)&l_Std_Semaphore_release___closed__0_value;
LEAN_EXPORT lean_object* l_Std_Semaphore_release(lean_object*);
LEAN_EXPORT lean_object* l_Std_Semaphore_release___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Semaphore_availablePermits___lam__0(lean_object*);
LEAN_EXPORT lean_object* l_Std_Semaphore_availablePermits___lam__0___boxed(lean_object*, lean_object*);
static const lean_closure_object l_Std_Semaphore_availablePermits___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_Std_Semaphore_availablePermits___lam__0___boxed, .m_arity = 2, .m_num_fixed = 0, .m_objs = {} };
static const lean_object* l_Std_Semaphore_availablePermits___closed__0 = (const lean_object*)&l_Std_Semaphore_availablePermits___closed__0_value;
LEAN_EXPORT lean_object* l_Std_Semaphore_availablePermits(lean_object*);
LEAN_EXPORT lean_object* l_Std_Semaphore_availablePermits___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Std_Sync_Semaphore_0__Std_mkResolvedPromise___redArg(lean_object* v_a_1_){
_start:
{
lean_object* v___x_3_; lean_object* v___x_4_;
v___x_3_ = lean_io_promise_new();
v___x_4_ = lean_io_promise_resolve(v_a_1_, v___x_3_);
return v___x_3_;
}
}
LEAN_EXPORT lean_object* l___private_Std_Sync_Semaphore_0__Std_mkResolvedPromise___redArg___boxed(lean_object* v_a_5_, lean_object* v_a_6_){
_start:
{
lean_object* v_res_7_;
v_res_7_ = l___private_Std_Sync_Semaphore_0__Std_mkResolvedPromise___redArg(v_a_5_);
return v_res_7_;
}
}
LEAN_EXPORT lean_object* l___private_Std_Sync_Semaphore_0__Std_mkResolvedPromise(lean_object* v_00_u03b1_8_, lean_object* v_inst_9_, lean_object* v_a_10_){
_start:
{
lean_object* v___x_12_;
v___x_12_ = l___private_Std_Sync_Semaphore_0__Std_mkResolvedPromise___redArg(v_a_10_);
return v___x_12_;
}
}
LEAN_EXPORT lean_object* l___private_Std_Sync_Semaphore_0__Std_mkResolvedPromise___boxed(lean_object* v_00_u03b1_13_, lean_object* v_inst_14_, lean_object* v_a_15_, lean_object* v_a_16_){
_start:
{
lean_object* v_res_17_;
v_res_17_ = l___private_Std_Sync_Semaphore_0__Std_mkResolvedPromise(v_00_u03b1_13_, v_inst_14_, v_a_15_);
return v_res_17_;
}
}
static lean_object* _init_l_Std_Semaphore_new___closed__0(void){
_start:
{
lean_object* v___x_18_;
v___x_18_ = l_Std_Queue_empty(lean_box(0));
return v___x_18_;
}
}
LEAN_EXPORT lean_object* l_Std_Semaphore_new(lean_object* v_permits_19_){
_start:
{
lean_object* v___x_21_; lean_object* v___x_22_; lean_object* v___x_23_;
v___x_21_ = lean_obj_once(&l_Std_Semaphore_new___closed__0, &l_Std_Semaphore_new___closed__0_once, _init_l_Std_Semaphore_new___closed__0);
v___x_22_ = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(v___x_22_, 0, v_permits_19_);
lean_ctor_set(v___x_22_, 1, v___x_21_);
v___x_23_ = l_Std_Mutex_new___redArg(v___x_22_);
return v___x_23_;
}
}
LEAN_EXPORT lean_object* l_Std_Semaphore_new___boxed(lean_object* v_permits_24_, lean_object* v_a_25_){
_start:
{
lean_object* v_res_26_;
v_res_26_ = l_Std_Semaphore_new(v_permits_24_);
return v_res_26_;
}
}
LEAN_EXPORT lean_object* l_Std_Mutex_atomically___at___00Std_Semaphore_acquire_spec__0___redArg(lean_object* v_mutex_27_, lean_object* v_k_28_){
_start:
{
lean_object* v_ref_30_; lean_object* v_mutex_31_; lean_object* v___x_32_; lean_object* v___x_33_; lean_object* v___x_34_;
v_ref_30_ = lean_ctor_get(v_mutex_27_, 0);
lean_inc(v_ref_30_);
v_mutex_31_ = lean_ctor_get(v_mutex_27_, 1);
lean_inc(v_mutex_31_);
lean_dec_ref(v_mutex_27_);
v___x_32_ = lean_io_basemutex_lock(v_mutex_31_);
v___x_33_ = lean_apply_2(v_k_28_, v_ref_30_, lean_box(0));
v___x_34_ = lean_io_basemutex_unlock(v_mutex_31_);
lean_dec(v_mutex_31_);
return v___x_33_;
}
}
LEAN_EXPORT lean_object* l_Std_Mutex_atomically___at___00Std_Semaphore_acquire_spec__0___redArg___boxed(lean_object* v_mutex_35_, lean_object* v_k_36_, lean_object* v___y_37_){
_start:
{
lean_object* v_res_38_;
v_res_38_ = l_Std_Mutex_atomically___at___00Std_Semaphore_acquire_spec__0___redArg(v_mutex_35_, v_k_36_);
return v_res_38_;
}
}
LEAN_EXPORT lean_object* l_Std_Mutex_atomically___at___00Std_Semaphore_acquire_spec__0(lean_object* v_00_u03b1_39_, lean_object* v_00_u03b2_40_, lean_object* v_mutex_41_, lean_object* v_k_42_){
_start:
{
lean_object* v___x_44_;
v___x_44_ = l_Std_Mutex_atomically___at___00Std_Semaphore_acquire_spec__0___redArg(v_mutex_41_, v_k_42_);
return v___x_44_;
}
}
LEAN_EXPORT lean_object* l_Std_Mutex_atomically___at___00Std_Semaphore_acquire_spec__0___boxed(lean_object* v_00_u03b1_45_, lean_object* v_00_u03b2_46_, lean_object* v_mutex_47_, lean_object* v_k_48_, lean_object* v___y_49_){
_start:
{
lean_object* v_res_50_;
v_res_50_ = l_Std_Mutex_atomically___at___00Std_Semaphore_acquire_spec__0(v_00_u03b1_45_, v_00_u03b2_46_, v_mutex_47_, v_k_48_);
return v_res_50_;
}
}
LEAN_EXPORT lean_object* l_Std_Semaphore_acquire___lam__0(lean_object* v___y_51_){
_start:
{
lean_object* v___x_53_; lean_object* v_permits_54_; lean_object* v_waiters_55_; lean_object* v___x_57_; uint8_t v_isShared_58_; uint8_t v_isSharedCheck_75_;
v___x_53_ = lean_st_ref_get(v___y_51_);
v_permits_54_ = lean_ctor_get(v___x_53_, 0);
v_waiters_55_ = lean_ctor_get(v___x_53_, 1);
v_isSharedCheck_75_ = !lean_is_exclusive(v___x_53_);
if (v_isSharedCheck_75_ == 0)
{
v___x_57_ = v___x_53_;
v_isShared_58_ = v_isSharedCheck_75_;
goto v_resetjp_56_;
}
else
{
lean_inc(v_waiters_55_);
lean_inc(v_permits_54_);
lean_dec(v___x_53_);
v___x_57_ = lean_box(0);
v_isShared_58_ = v_isSharedCheck_75_;
goto v_resetjp_56_;
}
v_resetjp_56_:
{
lean_object* v___x_59_; uint8_t v___x_60_;
v___x_59_ = lean_unsigned_to_nat(0u);
v___x_60_ = lean_nat_dec_lt(v___x_59_, v_permits_54_);
if (v___x_60_ == 0)
{
lean_object* v___x_61_; lean_object* v___x_62_; lean_object* v___x_64_;
v___x_61_ = lean_io_promise_new();
lean_inc(v___x_61_);
v___x_62_ = l_Std_Queue_enqueue___redArg(v___x_61_, v_waiters_55_);
if (v_isShared_58_ == 0)
{
lean_ctor_set(v___x_57_, 1, v___x_62_);
v___x_64_ = v___x_57_;
goto v_reusejp_63_;
}
else
{
lean_object* v_reuseFailAlloc_66_;
v_reuseFailAlloc_66_ = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(v_reuseFailAlloc_66_, 0, v_permits_54_);
lean_ctor_set(v_reuseFailAlloc_66_, 1, v___x_62_);
v___x_64_ = v_reuseFailAlloc_66_;
goto v_reusejp_63_;
}
v_reusejp_63_:
{
lean_object* v___x_65_;
v___x_65_ = lean_st_ref_set(v___y_51_, v___x_64_);
return v___x_61_;
}
}
else
{
lean_object* v___x_67_; lean_object* v___x_68_; lean_object* v___x_70_;
v___x_67_ = lean_unsigned_to_nat(1u);
v___x_68_ = lean_nat_sub(v_permits_54_, v___x_67_);
lean_dec(v_permits_54_);
if (v_isShared_58_ == 0)
{
lean_ctor_set(v___x_57_, 0, v___x_68_);
v___x_70_ = v___x_57_;
goto v_reusejp_69_;
}
else
{
lean_object* v_reuseFailAlloc_74_;
v_reuseFailAlloc_74_ = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(v_reuseFailAlloc_74_, 0, v___x_68_);
lean_ctor_set(v_reuseFailAlloc_74_, 1, v_waiters_55_);
v___x_70_ = v_reuseFailAlloc_74_;
goto v_reusejp_69_;
}
v_reusejp_69_:
{
lean_object* v___x_71_; lean_object* v___x_72_; lean_object* v___x_73_;
v___x_71_ = lean_st_ref_set(v___y_51_, v___x_70_);
v___x_72_ = lean_box(0);
v___x_73_ = l___private_Std_Sync_Semaphore_0__Std_mkResolvedPromise___redArg(v___x_72_);
return v___x_73_;
}
}
}
}
}
LEAN_EXPORT lean_object* l_Std_Semaphore_acquire___lam__0___boxed(lean_object* v___y_76_, lean_object* v___y_77_){
_start:
{
lean_object* v_res_78_;
v_res_78_ = l_Std_Semaphore_acquire___lam__0(v___y_76_);
lean_dec(v___y_76_);
return v_res_78_;
}
}
LEAN_EXPORT lean_object* l_Std_Semaphore_acquire(lean_object* v_sem_80_){
_start:
{
lean_object* v___f_82_; lean_object* v___x_83_;
v___f_82_ = ((lean_object*)(l_Std_Semaphore_acquire___closed__0));
v___x_83_ = l_Std_Mutex_atomically___at___00Std_Semaphore_acquire_spec__0___redArg(v_sem_80_, v___f_82_);
return v___x_83_;
}
}
LEAN_EXPORT lean_object* l_Std_Semaphore_acquire___boxed(lean_object* v_sem_84_, lean_object* v_a_85_){
_start:
{
lean_object* v_res_86_;
v_res_86_ = l_Std_Semaphore_acquire(v_sem_84_);
return v_res_86_;
}
}
LEAN_EXPORT uint8_t l_Std_Semaphore_tryAcquire___lam__0(lean_object* v___y_87_){
_start:
{
lean_object* v___x_89_; lean_object* v_permits_90_; lean_object* v_waiters_91_; lean_object* v___x_93_; uint8_t v_isShared_94_; uint8_t v_isSharedCheck_103_;
v___x_89_ = lean_st_ref_get(v___y_87_);
v_permits_90_ = lean_ctor_get(v___x_89_, 0);
v_waiters_91_ = lean_ctor_get(v___x_89_, 1);
v_isSharedCheck_103_ = !lean_is_exclusive(v___x_89_);
if (v_isSharedCheck_103_ == 0)
{
v___x_93_ = v___x_89_;
v_isShared_94_ = v_isSharedCheck_103_;
goto v_resetjp_92_;
}
else
{
lean_inc(v_waiters_91_);
lean_inc(v_permits_90_);
lean_dec(v___x_89_);
v___x_93_ = lean_box(0);
v_isShared_94_ = v_isSharedCheck_103_;
goto v_resetjp_92_;
}
v_resetjp_92_:
{
lean_object* v___x_95_; uint8_t v___x_96_;
v___x_95_ = lean_unsigned_to_nat(0u);
v___x_96_ = lean_nat_dec_lt(v___x_95_, v_permits_90_);
if (v___x_96_ == 0)
{
lean_del_object(v___x_93_);
lean_dec_ref(v_waiters_91_);
lean_dec(v_permits_90_);
return v___x_96_;
}
else
{
lean_object* v___x_97_; lean_object* v___x_98_; lean_object* v___x_100_;
v___x_97_ = lean_unsigned_to_nat(1u);
v___x_98_ = lean_nat_sub(v_permits_90_, v___x_97_);
lean_dec(v_permits_90_);
if (v_isShared_94_ == 0)
{
lean_ctor_set(v___x_93_, 0, v___x_98_);
v___x_100_ = v___x_93_;
goto v_reusejp_99_;
}
else
{
lean_object* v_reuseFailAlloc_102_;
v_reuseFailAlloc_102_ = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(v_reuseFailAlloc_102_, 0, v___x_98_);
lean_ctor_set(v_reuseFailAlloc_102_, 1, v_waiters_91_);
v___x_100_ = v_reuseFailAlloc_102_;
goto v_reusejp_99_;
}
v_reusejp_99_:
{
lean_object* v___x_101_;
v___x_101_ = lean_st_ref_set(v___y_87_, v___x_100_);
return v___x_96_;
}
}
}
}
}
LEAN_EXPORT lean_object* l_Std_Semaphore_tryAcquire___lam__0___boxed(lean_object* v___y_104_, lean_object* v___y_105_){
_start:
{
uint8_t v_res_106_; lean_object* v_r_107_;
v_res_106_ = l_Std_Semaphore_tryAcquire___lam__0(v___y_104_);
lean_dec(v___y_104_);
v_r_107_ = lean_box(v_res_106_);
return v_r_107_;
}
}
LEAN_EXPORT uint8_t l_Std_Semaphore_tryAcquire(lean_object* v_sem_109_){
_start:
{
lean_object* v___f_111_; lean_object* v___x_112_; uint8_t v___x_113_;
v___f_111_ = ((lean_object*)(l_Std_Semaphore_tryAcquire___closed__0));
v___x_112_ = l_Std_Mutex_atomically___at___00Std_Semaphore_acquire_spec__0___redArg(v_sem_109_, v___f_111_);
v___x_113_ = lean_unbox(v___x_112_);
lean_dec(v___x_112_);
return v___x_113_;
}
}
LEAN_EXPORT lean_object* l_Std_Semaphore_tryAcquire___boxed(lean_object* v_sem_114_, lean_object* v_a_115_){
_start:
{
uint8_t v_res_116_; lean_object* v_r_117_;
v_res_116_ = l_Std_Semaphore_tryAcquire(v_sem_114_);
v_r_117_ = lean_box(v_res_116_);
return v_r_117_;
}
}
LEAN_EXPORT lean_object* l_Std_Semaphore_release___lam__0(lean_object* v___y_118_){
_start:
{
lean_object* v___x_120_; lean_object* v_permits_121_; lean_object* v_waiters_122_; lean_object* v___x_124_; uint8_t v_isShared_125_; uint8_t v_isSharedCheck_148_;
v___x_120_ = lean_st_ref_get(v___y_118_);
v_permits_121_ = lean_ctor_get(v___x_120_, 0);
v_waiters_122_ = lean_ctor_get(v___x_120_, 1);
v_isSharedCheck_148_ = !lean_is_exclusive(v___x_120_);
if (v_isSharedCheck_148_ == 0)
{
v___x_124_ = v___x_120_;
v_isShared_125_ = v_isSharedCheck_148_;
goto v_resetjp_123_;
}
else
{
lean_inc(v_waiters_122_);
lean_inc(v_permits_121_);
lean_dec(v___x_120_);
v___x_124_ = lean_box(0);
v_isShared_125_ = v_isSharedCheck_148_;
goto v_resetjp_123_;
}
v_resetjp_123_:
{
lean_object* v___x_126_;
lean_inc_ref(v_waiters_122_);
v___x_126_ = l_Std_Queue_dequeue_x3f___redArg(v_waiters_122_);
if (lean_obj_tag(v___x_126_) == 0)
{
lean_object* v___x_127_; lean_object* v___x_128_; lean_object* v___x_130_;
v___x_127_ = lean_unsigned_to_nat(1u);
v___x_128_ = lean_nat_add(v_permits_121_, v___x_127_);
lean_dec(v_permits_121_);
if (v_isShared_125_ == 0)
{
lean_ctor_set(v___x_124_, 0, v___x_128_);
v___x_130_ = v___x_124_;
goto v_reusejp_129_;
}
else
{
lean_object* v_reuseFailAlloc_133_;
v_reuseFailAlloc_133_ = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(v_reuseFailAlloc_133_, 0, v___x_128_);
lean_ctor_set(v_reuseFailAlloc_133_, 1, v_waiters_122_);
v___x_130_ = v_reuseFailAlloc_133_;
goto v_reusejp_129_;
}
v_reusejp_129_:
{
lean_object* v___x_131_; lean_object* v___x_132_;
v___x_131_ = lean_st_ref_set(v___y_118_, v___x_130_);
v___x_132_ = lean_box(0);
return v___x_132_;
}
}
else
{
lean_object* v_val_134_; lean_object* v___x_136_; uint8_t v_isShared_137_; uint8_t v_isSharedCheck_147_;
lean_dec_ref(v_waiters_122_);
v_val_134_ = lean_ctor_get(v___x_126_, 0);
v_isSharedCheck_147_ = !lean_is_exclusive(v___x_126_);
if (v_isSharedCheck_147_ == 0)
{
v___x_136_ = v___x_126_;
v_isShared_137_ = v_isSharedCheck_147_;
goto v_resetjp_135_;
}
else
{
lean_inc(v_val_134_);
lean_dec(v___x_126_);
v___x_136_ = lean_box(0);
v_isShared_137_ = v_isSharedCheck_147_;
goto v_resetjp_135_;
}
v_resetjp_135_:
{
lean_object* v_fst_138_; lean_object* v_snd_139_; lean_object* v___x_141_;
v_fst_138_ = lean_ctor_get(v_val_134_, 0);
lean_inc(v_fst_138_);
v_snd_139_ = lean_ctor_get(v_val_134_, 1);
lean_inc(v_snd_139_);
lean_dec(v_val_134_);
if (v_isShared_125_ == 0)
{
lean_ctor_set(v___x_124_, 1, v_snd_139_);
v___x_141_ = v___x_124_;
goto v_reusejp_140_;
}
else
{
lean_object* v_reuseFailAlloc_146_;
v_reuseFailAlloc_146_ = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(v_reuseFailAlloc_146_, 0, v_permits_121_);
lean_ctor_set(v_reuseFailAlloc_146_, 1, v_snd_139_);
v___x_141_ = v_reuseFailAlloc_146_;
goto v_reusejp_140_;
}
v_reusejp_140_:
{
lean_object* v___x_142_; lean_object* v___x_144_;
v___x_142_ = lean_st_ref_set(v___y_118_, v___x_141_);
if (v_isShared_137_ == 0)
{
lean_ctor_set(v___x_136_, 0, v_fst_138_);
v___x_144_ = v___x_136_;
goto v_reusejp_143_;
}
else
{
lean_object* v_reuseFailAlloc_145_;
v_reuseFailAlloc_145_ = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(v_reuseFailAlloc_145_, 0, v_fst_138_);
v___x_144_ = v_reuseFailAlloc_145_;
goto v_reusejp_143_;
}
v_reusejp_143_:
{
return v___x_144_;
}
}
}
}
}
}
}
LEAN_EXPORT lean_object* l_Std_Semaphore_release___lam__0___boxed(lean_object* v___y_149_, lean_object* v___y_150_){
_start:
{
lean_object* v_res_151_;
v_res_151_ = l_Std_Semaphore_release___lam__0(v___y_149_);
lean_dec(v___y_149_);
return v_res_151_;
}
}
LEAN_EXPORT lean_object* l_Std_Semaphore_release(lean_object* v_sem_153_){
_start:
{
lean_object* v___f_155_; lean_object* v___x_156_;
v___f_155_ = ((lean_object*)(l_Std_Semaphore_release___closed__0));
v___x_156_ = l_Std_Mutex_atomically___at___00Std_Semaphore_acquire_spec__0___redArg(v_sem_153_, v___f_155_);
if (lean_obj_tag(v___x_156_) == 1)
{
lean_object* v_val_157_; lean_object* v___x_158_; lean_object* v___x_159_;
v_val_157_ = lean_ctor_get(v___x_156_, 0);
lean_inc(v_val_157_);
lean_dec_ref(v___x_156_);
v___x_158_ = lean_box(0);
v___x_159_ = lean_io_promise_resolve(v___x_158_, v_val_157_);
lean_dec(v_val_157_);
return v___x_159_;
}
else
{
lean_object* v___x_160_;
lean_dec(v___x_156_);
v___x_160_ = lean_box(0);
return v___x_160_;
}
}
}
LEAN_EXPORT lean_object* l_Std_Semaphore_release___boxed(lean_object* v_sem_161_, lean_object* v_a_162_){
_start:
{
lean_object* v_res_163_;
v_res_163_ = l_Std_Semaphore_release(v_sem_161_);
return v_res_163_;
}
}
LEAN_EXPORT lean_object* l_Std_Semaphore_availablePermits___lam__0(lean_object* v___y_164_){
_start:
{
lean_object* v___x_166_; lean_object* v_permits_167_;
v___x_166_ = lean_st_ref_get(v___y_164_);
v_permits_167_ = lean_ctor_get(v___x_166_, 0);
lean_inc(v_permits_167_);
lean_dec(v___x_166_);
return v_permits_167_;
}
}
LEAN_EXPORT lean_object* l_Std_Semaphore_availablePermits___lam__0___boxed(lean_object* v___y_168_, lean_object* v___y_169_){
_start:
{
lean_object* v_res_170_;
v_res_170_ = l_Std_Semaphore_availablePermits___lam__0(v___y_168_);
lean_dec(v___y_168_);
return v_res_170_;
}
}
LEAN_EXPORT lean_object* l_Std_Semaphore_availablePermits(lean_object* v_sem_172_){
_start:
{
lean_object* v___f_174_; lean_object* v___x_175_;
v___f_174_ = ((lean_object*)(l_Std_Semaphore_availablePermits___closed__0));
v___x_175_ = l_Std_Mutex_atomically___at___00Std_Semaphore_acquire_spec__0___redArg(v_sem_172_, v___f_174_);
return v___x_175_;
}
}
LEAN_EXPORT lean_object* l_Std_Semaphore_availablePermits___boxed(lean_object* v_sem_176_, lean_object* v_a_177_){
_start:
{
lean_object* v_res_178_;
v_res_178_ = l_Std_Semaphore_availablePermits(v_sem_176_);
return v_res_178_;
}
}
lean_object* runtime_initialize_Init_Data_Queue(uint8_t builtin);
lean_object* runtime_initialize_Init_System_Promise(uint8_t builtin);
lean_object* runtime_initialize_Std_Sync_Mutex(uint8_t builtin);
static bool _G_runtime_initialized = false;
LEAN_EXPORT lean_object* runtime_initialize_Std_Sync_Semaphore(uint8_t builtin) {
lean_object * res;
if (_G_runtime_initialized) return lean_io_result_mk_ok(lean_box(0));
_G_runtime_initialized = true;
res = runtime_initialize_Init_Data_Queue(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = runtime_initialize_Init_System_Promise(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = runtime_initialize_Std_Sync_Mutex(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
return lean_io_result_mk_ok(lean_box(0));
}
static bool _G_meta_initialized = false;
LEAN_EXPORT lean_object* meta_initialize_Std_Sync_Semaphore(uint8_t builtin) {
lean_object * res;
if (_G_meta_initialized) return lean_io_result_mk_ok(lean_box(0));
_G_meta_initialized = true;
return lean_io_result_mk_ok(lean_box(0));
}
lean_object* initialize_Init_Data_Queue(uint8_t builtin);
lean_object* initialize_Init_System_Promise(uint8_t builtin);
lean_object* initialize_Std_Sync_Mutex(uint8_t builtin);
static bool _G_initialized = false;
LEAN_EXPORT lean_object* initialize_Std_Sync_Semaphore(uint8_t builtin) {
lean_object * res;
if (_G_initialized) return lean_io_result_mk_ok(lean_box(0));
_G_initialized = true;
res = initialize_Init_Data_Queue(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Init_System_Promise(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Std_Sync_Mutex(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = runtime_initialize_Std_Sync_Semaphore(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = meta_initialize_Std_Sync_Semaphore(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
return initialize_Std_Sync_Semaphore(builtin);
}
#ifdef __cplusplus
}
#endif