// Lean compiler output
// Module: init.lean.disjoint_set
// Imports: init.data.hashmap.basic
#include "runtime/object.h"
#include "runtime/apply.h"
typedef lean::object obj;    typedef lean::usize  usize;
typedef lean::uint8  uint8;  typedef lean::uint16 uint16;
typedef lean::uint32 uint32; typedef lean::uint64 uint64;
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunused-parameter"
#pragma clang diagnostic ignored "-Wunused-label"
#elif defined(__GNUC__) && !defined(__CLANG__)
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wunused-label"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif
obj* l___private_init_lean_disjoint__set_1__findAux(obj*);
obj* l_HashMapImp_insert___at_Lean_DisjointSet_merge___main___spec__7___rarg(obj*, obj*, obj*, obj*, obj*);
obj* l_Lean_DisjointSet_merge___main(obj*);
namespace lean {
obj* nat_sub(obj*, obj*);
}
uint8 l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__2___rarg(obj*, obj*, obj*);
obj* l___private_init_lean_disjoint__set_1__findAux___main___rarg(obj*, obj*, obj*, obj*, obj*);
obj* l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__6___rarg(obj*, obj*, obj*, obj*);
obj* l_AssocList_find___main___at___private_init_lean_disjoint__set_1__findAux___main___spec__2(obj*);
obj* l_HashMapImp_insert___at_Lean_DisjointSet_merge___main___spec__10(obj*);
obj* l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__9(obj*);
obj* l_AssocList_find___main___at___private_init_lean_disjoint__set_1__findAux___main___spec__2___rarg(obj*, obj*, obj*);
obj* l_Lean_mkDisjointSet(obj*, obj*, obj*);
obj* l_Array_uget(obj*, obj*, usize, obj*);
obj* l_Array_uset(obj*, obj*, usize, obj*, obj*);
obj* l_Lean_DisjointSet_merge___main___rarg(obj*, obj*, obj*, obj*, obj*);
obj* l_Lean_DisjointSet_find___main(obj*);
obj* l_Lean_DisjointSet_find(obj*);
uint8 l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__11___rarg(obj*, obj*, obj*);
obj* l___private_init_lean_disjoint__set_1__findAux___main___rarg___boxed(obj*, obj*, obj*, obj*, obj*);
obj* l_Lean_DisjointSet_find___main___rarg(obj*, obj*, obj*, obj*);
obj* l_Lean_DisjointSet_merge___rarg(obj*, obj*, obj*, obj*, obj*);
obj* l_Lean_DisjointSet_rank(obj*);
obj* l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__12(obj*);
obj* l_Lean_DisjointSet_rank___main___rarg(obj*, obj*, obj*, obj*);
namespace lean {
uint8 nat_dec_lt(obj*, obj*);
}
obj* l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__6(obj*);
obj* l_HashMapImp_insert___at_Lean_DisjointSet_merge___main___spec__4(obj*);
obj* l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__8(obj*);
namespace lean {
obj* nat_add(obj*, obj*);
}
obj* l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__9___rarg(obj*, obj*, obj*, obj*);
obj* l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__11___rarg___boxed(obj*, obj*, obj*);
namespace lean {
uint8 nat_dec_eq(obj*, obj*);
}
obj* l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__2(obj*);
obj* l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__12___rarg(obj*, obj*, obj*, obj*);
obj* l_Lean_DisjointSet_find___rarg(obj*, obj*, obj*, obj*);
obj* l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__2___rarg___boxed(obj*, obj*, obj*);
obj* l_HashMapImp_insert___at_Lean_DisjointSet_merge___main___spec__1(obj*);
obj* l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__11(obj*);
obj* l_HashMapImp_insert___at_Lean_DisjointSet_merge___main___spec__1___rarg(obj*, obj*, obj*, obj*, obj*);
obj* l_HashMapImp_find___at___private_init_lean_disjoint__set_1__findAux___main___spec__1(obj*);
obj* l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__8___rarg___boxed(obj*, obj*, obj*);
obj* l_Lean_DisjointSet_rank___main(obj*);
namespace lean {
usize usize_modn(usize, obj*);
}
obj* l_HashMapImp_insert___at_Lean_DisjointSet_merge___main___spec__4___rarg(obj*, obj*, obj*, obj*, obj*);
obj* l_Lean_DisjointSet_rank___rarg(obj*, obj*, obj*, obj*);
extern obj* l_HashMap_Inhabited___closed__1;
uint8 l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__5___rarg(obj*, obj*, obj*);
obj* l_Array_size(obj*, obj*);
obj* l_HashMapImp_insert___at_Lean_DisjointSet_merge___main___spec__7(obj*);
obj* l_Lean_mkDisjointSet___boxed(obj*, obj*, obj*);
obj* l___private_init_lean_disjoint__set_1__findAux___main(obj*);
obj* l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__5___rarg___boxed(obj*, obj*, obj*);
namespace lean {
uint8 nat_dec_le(obj*, obj*);
}
obj* l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__3(obj*);
obj* l_Lean_DisjointSet_merge(obj*);
obj* l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__5(obj*);
obj* l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__3___rarg(obj*, obj*, obj*, obj*);
obj* l___private_init_lean_disjoint__set_1__findAux___rarg(obj*, obj*, obj*, obj*, obj*);
uint8 l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__8___rarg(obj*, obj*, obj*);
obj* l_HashMapImp_insert___at_Lean_DisjointSet_merge___main___spec__10___rarg(obj*, obj*, obj*, obj*, obj*);
obj* l_HashMapImp_find___at___private_init_lean_disjoint__set_1__findAux___main___spec__1___rarg(obj*, obj*, obj*, obj*);
obj* l___private_init_lean_disjoint__set_1__findAux___rarg___boxed(obj*, obj*, obj*, obj*, obj*);
obj* l_HashMapImp_find___at___private_init_lean_disjoint__set_1__findAux___main___spec__1___rarg___boxed(obj*, obj*, obj*, obj*);
obj* l_HashMapImp_expand___rarg(obj*, obj*, obj*);
obj* l_Lean_mkDisjointSet(obj* x_1, obj* x_2, obj* x_3) {
_start:
{
obj* x_4; 
x_4 = l_HashMap_Inhabited___closed__1;
return x_4;
}
}
obj* l_Lean_mkDisjointSet___boxed(obj* x_1, obj* x_2, obj* x_3) {
_start:
{
obj* x_4; 
x_4 = l_Lean_mkDisjointSet(x_1, x_2, x_3);
lean::dec(x_3);
lean::dec(x_2);
return x_4;
}
}
obj* l_AssocList_find___main___at___private_init_lean_disjoint__set_1__findAux___main___spec__2___rarg(obj* x_1, obj* x_2, obj* x_3) {
_start:
{
if (lean::obj_tag(x_3) == 0)
{
obj* x_4; 
lean::dec(x_2);
lean::dec(x_1);
x_4 = lean::box(0);
return x_4;
}
else
{
obj* x_5; obj* x_6; obj* x_7; obj* x_8; uint8 x_9; 
x_5 = lean::cnstr_get(x_3, 0);
lean::inc(x_5);
x_6 = lean::cnstr_get(x_3, 1);
lean::inc(x_6);
x_7 = lean::cnstr_get(x_3, 2);
lean::inc(x_7);
lean::dec(x_3);
lean::inc(x_1);
lean::inc(x_2);
x_8 = lean::apply_2(x_1, x_5, x_2);
x_9 = lean::unbox(x_8);
lean::dec(x_8);
if (x_9 == 0)
{
lean::dec(x_6);
x_3 = x_7;
goto _start;
}
else
{
obj* x_11; 
lean::dec(x_7);
lean::dec(x_2);
lean::dec(x_1);
x_11 = lean::alloc_cnstr(1, 1, 0);
lean::cnstr_set(x_11, 0, x_6);
return x_11;
}
}
}
}
obj* l_AssocList_find___main___at___private_init_lean_disjoint__set_1__findAux___main___spec__2(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = lean::alloc_closure(reinterpret_cast<void*>(l_AssocList_find___main___at___private_init_lean_disjoint__set_1__findAux___main___spec__2___rarg), 3, 0);
return x_2;
}
}
obj* l_HashMapImp_find___at___private_init_lean_disjoint__set_1__findAux___main___spec__1___rarg(obj* x_1, obj* x_2, obj* x_3, obj* x_4) {
_start:
{
obj* x_5; obj* x_6; obj* x_7; usize x_8; usize x_9; obj* x_10; usize x_11; obj* x_12; obj* x_13; 
x_5 = lean::cnstr_get(x_3, 1);
x_6 = lean::array_get_size(x_5);
lean::inc(x_4);
x_7 = lean::apply_1(x_2, x_4);
x_8 = lean::unbox_size_t(x_7);
lean::dec(x_7);
x_9 = lean::usize_modn(x_8, x_6);
lean::dec(x_6);
x_10 = lean::box_size_t(x_9);
x_11 = lean::unbox_size_t(x_10);
lean::dec(x_10);
x_12 = lean::array_uget(x_5, x_11);
x_13 = l_AssocList_find___main___at___private_init_lean_disjoint__set_1__findAux___main___spec__2___rarg(x_1, x_4, x_12);
return x_13;
}
}
obj* l_HashMapImp_find___at___private_init_lean_disjoint__set_1__findAux___main___spec__1(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = lean::alloc_closure(reinterpret_cast<void*>(l_HashMapImp_find___at___private_init_lean_disjoint__set_1__findAux___main___spec__1___rarg___boxed), 4, 0);
return x_2;
}
}
obj* l___private_init_lean_disjoint__set_1__findAux___main___rarg(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5) {
_start:
{
obj* x_6; uint8 x_7; 
x_6 = lean::mk_nat_obj(0u);
x_7 = lean::nat_dec_eq(x_3, x_6);
if (x_7 == 0)
{
obj* x_8; obj* x_9; obj* x_10; 
x_8 = lean::mk_nat_obj(1u);
x_9 = lean::nat_sub(x_3, x_8);
lean::dec(x_3);
lean::inc(x_4);
lean::inc(x_2);
lean::inc(x_1);
x_10 = l_HashMapImp_find___at___private_init_lean_disjoint__set_1__findAux___main___spec__1___rarg(x_1, x_2, x_5, x_4);
if (lean::obj_tag(x_10) == 0)
{
obj* x_11; 
lean::dec(x_9);
lean::dec(x_2);
lean::dec(x_1);
x_11 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_11, 0, x_4);
lean::cnstr_set(x_11, 1, x_6);
return x_11;
}
else
{
obj* x_12; obj* x_13; obj* x_14; uint8 x_15; 
x_12 = lean::cnstr_get(x_10, 0);
lean::inc(x_12);
lean::dec(x_10);
x_13 = lean::cnstr_get(x_12, 0);
lean::inc(x_13);
lean::inc(x_1);
lean::inc(x_13);
x_14 = lean::apply_2(x_1, x_13, x_4);
x_15 = lean::unbox(x_14);
lean::dec(x_14);
if (x_15 == 0)
{
lean::dec(x_12);
x_3 = x_9;
x_4 = x_13;
goto _start;
}
else
{
lean::dec(x_13);
lean::dec(x_9);
lean::dec(x_2);
lean::dec(x_1);
return x_12;
}
}
}
else
{
obj* x_17; 
lean::dec(x_3);
lean::dec(x_2);
lean::dec(x_1);
x_17 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_17, 0, x_4);
lean::cnstr_set(x_17, 1, x_6);
return x_17;
}
}
}
obj* l___private_init_lean_disjoint__set_1__findAux___main(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = lean::alloc_closure(reinterpret_cast<void*>(l___private_init_lean_disjoint__set_1__findAux___main___rarg___boxed), 5, 0);
return x_2;
}
}
obj* l_HashMapImp_find___at___private_init_lean_disjoint__set_1__findAux___main___spec__1___rarg___boxed(obj* x_1, obj* x_2, obj* x_3, obj* x_4) {
_start:
{
obj* x_5; 
x_5 = l_HashMapImp_find___at___private_init_lean_disjoint__set_1__findAux___main___spec__1___rarg(x_1, x_2, x_3, x_4);
lean::dec(x_3);
return x_5;
}
}
obj* l___private_init_lean_disjoint__set_1__findAux___main___rarg___boxed(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5) {
_start:
{
obj* x_6; 
x_6 = l___private_init_lean_disjoint__set_1__findAux___main___rarg(x_1, x_2, x_3, x_4, x_5);
lean::dec(x_5);
return x_6;
}
}
obj* l___private_init_lean_disjoint__set_1__findAux___rarg(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5) {
_start:
{
obj* x_6; 
x_6 = l___private_init_lean_disjoint__set_1__findAux___main___rarg(x_1, x_2, x_3, x_4, x_5);
return x_6;
}
}
obj* l___private_init_lean_disjoint__set_1__findAux(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = lean::alloc_closure(reinterpret_cast<void*>(l___private_init_lean_disjoint__set_1__findAux___rarg___boxed), 5, 0);
return x_2;
}
}
obj* l___private_init_lean_disjoint__set_1__findAux___rarg___boxed(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5) {
_start:
{
obj* x_6; 
x_6 = l___private_init_lean_disjoint__set_1__findAux___rarg(x_1, x_2, x_3, x_4, x_5);
lean::dec(x_5);
return x_6;
}
}
obj* l_Lean_DisjointSet_find___main___rarg(obj* x_1, obj* x_2, obj* x_3, obj* x_4) {
_start:
{
obj* x_5; obj* x_6; obj* x_7; 
x_5 = lean::cnstr_get(x_3, 0);
lean::inc(x_5);
x_6 = l___private_init_lean_disjoint__set_1__findAux___main___rarg(x_1, x_2, x_5, x_4, x_3);
lean::dec(x_3);
x_7 = lean::cnstr_get(x_6, 0);
lean::inc(x_7);
lean::dec(x_6);
return x_7;
}
}
obj* l_Lean_DisjointSet_find___main(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = lean::alloc_closure(reinterpret_cast<void*>(l_Lean_DisjointSet_find___main___rarg), 4, 0);
return x_2;
}
}
obj* l_Lean_DisjointSet_find___rarg(obj* x_1, obj* x_2, obj* x_3, obj* x_4) {
_start:
{
obj* x_5; 
x_5 = l_Lean_DisjointSet_find___main___rarg(x_1, x_2, x_3, x_4);
return x_5;
}
}
obj* l_Lean_DisjointSet_find(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = lean::alloc_closure(reinterpret_cast<void*>(l_Lean_DisjointSet_find___rarg), 4, 0);
return x_2;
}
}
obj* l_Lean_DisjointSet_rank___main___rarg(obj* x_1, obj* x_2, obj* x_3, obj* x_4) {
_start:
{
obj* x_5; obj* x_6; obj* x_7; 
x_5 = lean::cnstr_get(x_3, 0);
lean::inc(x_5);
x_6 = l___private_init_lean_disjoint__set_1__findAux___main___rarg(x_1, x_2, x_5, x_4, x_3);
lean::dec(x_3);
x_7 = lean::cnstr_get(x_6, 1);
lean::inc(x_7);
lean::dec(x_6);
return x_7;
}
}
obj* l_Lean_DisjointSet_rank___main(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = lean::alloc_closure(reinterpret_cast<void*>(l_Lean_DisjointSet_rank___main___rarg), 4, 0);
return x_2;
}
}
obj* l_Lean_DisjointSet_rank___rarg(obj* x_1, obj* x_2, obj* x_3, obj* x_4) {
_start:
{
obj* x_5; 
x_5 = l_Lean_DisjointSet_rank___main___rarg(x_1, x_2, x_3, x_4);
return x_5;
}
}
obj* l_Lean_DisjointSet_rank(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = lean::alloc_closure(reinterpret_cast<void*>(l_Lean_DisjointSet_rank___rarg), 4, 0);
return x_2;
}
}
uint8 l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__2___rarg(obj* x_1, obj* x_2, obj* x_3) {
_start:
{
if (lean::obj_tag(x_3) == 0)
{
uint8 x_4; 
lean::dec(x_2);
lean::dec(x_1);
x_4 = 0;
return x_4;
}
else
{
obj* x_5; obj* x_6; obj* x_7; uint8 x_8; 
x_5 = lean::cnstr_get(x_3, 0);
lean::inc(x_5);
x_6 = lean::cnstr_get(x_3, 2);
lean::inc(x_6);
lean::dec(x_3);
lean::inc(x_1);
lean::inc(x_2);
x_7 = lean::apply_2(x_1, x_5, x_2);
x_8 = lean::unbox(x_7);
lean::dec(x_7);
if (x_8 == 0)
{
x_3 = x_6;
goto _start;
}
else
{
uint8 x_10; 
lean::dec(x_6);
lean::dec(x_2);
lean::dec(x_1);
x_10 = 1;
return x_10;
}
}
}
}
obj* l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__2(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = lean::alloc_closure(reinterpret_cast<void*>(l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__2___rarg___boxed), 3, 0);
return x_2;
}
}
obj* l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__3___rarg(obj* x_1, obj* x_2, obj* x_3, obj* x_4) {
_start:
{
if (lean::obj_tag(x_4) == 0)
{
lean::dec(x_3);
lean::dec(x_2);
lean::dec(x_1);
return x_4;
}
else
{
uint8 x_5; 
x_5 = !lean::is_exclusive(x_4);
if (x_5 == 0)
{
obj* x_6; obj* x_7; obj* x_8; obj* x_9; uint8 x_10; 
x_6 = lean::cnstr_get(x_4, 0);
x_7 = lean::cnstr_get(x_4, 1);
x_8 = lean::cnstr_get(x_4, 2);
lean::inc(x_1);
lean::inc(x_2);
lean::inc(x_6);
x_9 = lean::apply_2(x_1, x_6, x_2);
x_10 = lean::unbox(x_9);
lean::dec(x_9);
if (x_10 == 0)
{
obj* x_11; 
x_11 = l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__3___rarg(x_1, x_2, x_3, x_8);
lean::cnstr_set(x_4, 2, x_11);
return x_4;
}
else
{
lean::dec(x_7);
lean::dec(x_6);
lean::dec(x_1);
lean::cnstr_set(x_4, 1, x_3);
lean::cnstr_set(x_4, 0, x_2);
return x_4;
}
}
else
{
obj* x_12; obj* x_13; obj* x_14; obj* x_15; uint8 x_16; 
x_12 = lean::cnstr_get(x_4, 0);
x_13 = lean::cnstr_get(x_4, 1);
x_14 = lean::cnstr_get(x_4, 2);
lean::inc(x_14);
lean::inc(x_13);
lean::inc(x_12);
lean::dec(x_4);
lean::inc(x_1);
lean::inc(x_2);
lean::inc(x_12);
x_15 = lean::apply_2(x_1, x_12, x_2);
x_16 = lean::unbox(x_15);
lean::dec(x_15);
if (x_16 == 0)
{
obj* x_17; obj* x_18; 
x_17 = l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__3___rarg(x_1, x_2, x_3, x_14);
x_18 = lean::alloc_cnstr(1, 3, 0);
lean::cnstr_set(x_18, 0, x_12);
lean::cnstr_set(x_18, 1, x_13);
lean::cnstr_set(x_18, 2, x_17);
return x_18;
}
else
{
obj* x_19; 
lean::dec(x_13);
lean::dec(x_12);
lean::dec(x_1);
x_19 = lean::alloc_cnstr(1, 3, 0);
lean::cnstr_set(x_19, 0, x_2);
lean::cnstr_set(x_19, 1, x_3);
lean::cnstr_set(x_19, 2, x_14);
return x_19;
}
}
}
}
}
obj* l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__3(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = lean::alloc_closure(reinterpret_cast<void*>(l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__3___rarg), 4, 0);
return x_2;
}
}
obj* l_HashMapImp_insert___at_Lean_DisjointSet_merge___main___spec__1___rarg(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5) {
_start:
{
uint8 x_6; 
x_6 = !lean::is_exclusive(x_3);
if (x_6 == 0)
{
obj* x_7; obj* x_8; obj* x_9; obj* x_10; usize x_11; usize x_12; obj* x_13; usize x_14; obj* x_15; uint8 x_16; 
x_7 = lean::cnstr_get(x_3, 0);
x_8 = lean::cnstr_get(x_3, 1);
x_9 = lean::array_get_size(x_8);
lean::inc(x_2);
lean::inc(x_4);
x_10 = lean::apply_1(x_2, x_4);
x_11 = lean::unbox_size_t(x_10);
lean::dec(x_10);
x_12 = lean::usize_modn(x_11, x_9);
x_13 = lean::box_size_t(x_12);
x_14 = lean::unbox_size_t(x_13);
x_15 = lean::array_uget(x_8, x_14);
lean::inc(x_15);
lean::inc(x_4);
lean::inc(x_1);
x_16 = l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__2___rarg(x_1, x_4, x_15);
if (x_16 == 0)
{
obj* x_17; obj* x_18; obj* x_19; usize x_20; obj* x_21; uint8 x_22; 
lean::dec(x_1);
x_17 = lean::mk_nat_obj(1u);
x_18 = lean::nat_add(x_7, x_17);
lean::dec(x_7);
x_19 = lean::alloc_cnstr(1, 3, 0);
lean::cnstr_set(x_19, 0, x_4);
lean::cnstr_set(x_19, 1, x_5);
lean::cnstr_set(x_19, 2, x_15);
x_20 = lean::unbox_size_t(x_13);
lean::dec(x_13);
x_21 = lean::array_uset(x_8, x_20, x_19);
x_22 = lean::nat_dec_le(x_18, x_9);
lean::dec(x_9);
if (x_22 == 0)
{
obj* x_23; 
lean::free_heap_obj(x_3);
x_23 = l_HashMapImp_expand___rarg(x_2, x_18, x_21);
return x_23;
}
else
{
lean::dec(x_2);
lean::cnstr_set(x_3, 1, x_21);
lean::cnstr_set(x_3, 0, x_18);
return x_3;
}
}
else
{
obj* x_24; usize x_25; obj* x_26; 
lean::dec(x_9);
lean::dec(x_2);
x_24 = l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__3___rarg(x_1, x_4, x_5, x_15);
x_25 = lean::unbox_size_t(x_13);
lean::dec(x_13);
x_26 = lean::array_uset(x_8, x_25, x_24);
lean::cnstr_set(x_3, 1, x_26);
return x_3;
}
}
else
{
obj* x_27; obj* x_28; obj* x_29; obj* x_30; usize x_31; usize x_32; obj* x_33; usize x_34; obj* x_35; uint8 x_36; 
x_27 = lean::cnstr_get(x_3, 0);
x_28 = lean::cnstr_get(x_3, 1);
lean::inc(x_28);
lean::inc(x_27);
lean::dec(x_3);
x_29 = lean::array_get_size(x_28);
lean::inc(x_2);
lean::inc(x_4);
x_30 = lean::apply_1(x_2, x_4);
x_31 = lean::unbox_size_t(x_30);
lean::dec(x_30);
x_32 = lean::usize_modn(x_31, x_29);
x_33 = lean::box_size_t(x_32);
x_34 = lean::unbox_size_t(x_33);
x_35 = lean::array_uget(x_28, x_34);
lean::inc(x_35);
lean::inc(x_4);
lean::inc(x_1);
x_36 = l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__2___rarg(x_1, x_4, x_35);
if (x_36 == 0)
{
obj* x_37; obj* x_38; obj* x_39; usize x_40; obj* x_41; uint8 x_42; 
lean::dec(x_1);
x_37 = lean::mk_nat_obj(1u);
x_38 = lean::nat_add(x_27, x_37);
lean::dec(x_27);
x_39 = lean::alloc_cnstr(1, 3, 0);
lean::cnstr_set(x_39, 0, x_4);
lean::cnstr_set(x_39, 1, x_5);
lean::cnstr_set(x_39, 2, x_35);
x_40 = lean::unbox_size_t(x_33);
lean::dec(x_33);
x_41 = lean::array_uset(x_28, x_40, x_39);
x_42 = lean::nat_dec_le(x_38, x_29);
lean::dec(x_29);
if (x_42 == 0)
{
obj* x_43; 
x_43 = l_HashMapImp_expand___rarg(x_2, x_38, x_41);
return x_43;
}
else
{
obj* x_44; 
lean::dec(x_2);
x_44 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_44, 0, x_38);
lean::cnstr_set(x_44, 1, x_41);
return x_44;
}
}
else
{
obj* x_45; usize x_46; obj* x_47; obj* x_48; 
lean::dec(x_29);
lean::dec(x_2);
x_45 = l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__3___rarg(x_1, x_4, x_5, x_35);
x_46 = lean::unbox_size_t(x_33);
lean::dec(x_33);
x_47 = lean::array_uset(x_28, x_46, x_45);
x_48 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_48, 0, x_27);
lean::cnstr_set(x_48, 1, x_47);
return x_48;
}
}
}
}
obj* l_HashMapImp_insert___at_Lean_DisjointSet_merge___main___spec__1(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = lean::alloc_closure(reinterpret_cast<void*>(l_HashMapImp_insert___at_Lean_DisjointSet_merge___main___spec__1___rarg), 5, 0);
return x_2;
}
}
uint8 l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__5___rarg(obj* x_1, obj* x_2, obj* x_3) {
_start:
{
if (lean::obj_tag(x_3) == 0)
{
uint8 x_4; 
lean::dec(x_2);
lean::dec(x_1);
x_4 = 0;
return x_4;
}
else
{
obj* x_5; obj* x_6; obj* x_7; uint8 x_8; 
x_5 = lean::cnstr_get(x_3, 0);
lean::inc(x_5);
x_6 = lean::cnstr_get(x_3, 2);
lean::inc(x_6);
lean::dec(x_3);
lean::inc(x_1);
lean::inc(x_2);
x_7 = lean::apply_2(x_1, x_5, x_2);
x_8 = lean::unbox(x_7);
lean::dec(x_7);
if (x_8 == 0)
{
x_3 = x_6;
goto _start;
}
else
{
uint8 x_10; 
lean::dec(x_6);
lean::dec(x_2);
lean::dec(x_1);
x_10 = 1;
return x_10;
}
}
}
}
obj* l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__5(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = lean::alloc_closure(reinterpret_cast<void*>(l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__5___rarg___boxed), 3, 0);
return x_2;
}
}
obj* l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__6___rarg(obj* x_1, obj* x_2, obj* x_3, obj* x_4) {
_start:
{
if (lean::obj_tag(x_4) == 0)
{
lean::dec(x_3);
lean::dec(x_2);
lean::dec(x_1);
return x_4;
}
else
{
uint8 x_5; 
x_5 = !lean::is_exclusive(x_4);
if (x_5 == 0)
{
obj* x_6; obj* x_7; obj* x_8; obj* x_9; uint8 x_10; 
x_6 = lean::cnstr_get(x_4, 0);
x_7 = lean::cnstr_get(x_4, 1);
x_8 = lean::cnstr_get(x_4, 2);
lean::inc(x_1);
lean::inc(x_2);
lean::inc(x_6);
x_9 = lean::apply_2(x_1, x_6, x_2);
x_10 = lean::unbox(x_9);
lean::dec(x_9);
if (x_10 == 0)
{
obj* x_11; 
x_11 = l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__6___rarg(x_1, x_2, x_3, x_8);
lean::cnstr_set(x_4, 2, x_11);
return x_4;
}
else
{
lean::dec(x_7);
lean::dec(x_6);
lean::dec(x_1);
lean::cnstr_set(x_4, 1, x_3);
lean::cnstr_set(x_4, 0, x_2);
return x_4;
}
}
else
{
obj* x_12; obj* x_13; obj* x_14; obj* x_15; uint8 x_16; 
x_12 = lean::cnstr_get(x_4, 0);
x_13 = lean::cnstr_get(x_4, 1);
x_14 = lean::cnstr_get(x_4, 2);
lean::inc(x_14);
lean::inc(x_13);
lean::inc(x_12);
lean::dec(x_4);
lean::inc(x_1);
lean::inc(x_2);
lean::inc(x_12);
x_15 = lean::apply_2(x_1, x_12, x_2);
x_16 = lean::unbox(x_15);
lean::dec(x_15);
if (x_16 == 0)
{
obj* x_17; obj* x_18; 
x_17 = l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__6___rarg(x_1, x_2, x_3, x_14);
x_18 = lean::alloc_cnstr(1, 3, 0);
lean::cnstr_set(x_18, 0, x_12);
lean::cnstr_set(x_18, 1, x_13);
lean::cnstr_set(x_18, 2, x_17);
return x_18;
}
else
{
obj* x_19; 
lean::dec(x_13);
lean::dec(x_12);
lean::dec(x_1);
x_19 = lean::alloc_cnstr(1, 3, 0);
lean::cnstr_set(x_19, 0, x_2);
lean::cnstr_set(x_19, 1, x_3);
lean::cnstr_set(x_19, 2, x_14);
return x_19;
}
}
}
}
}
obj* l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__6(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = lean::alloc_closure(reinterpret_cast<void*>(l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__6___rarg), 4, 0);
return x_2;
}
}
obj* l_HashMapImp_insert___at_Lean_DisjointSet_merge___main___spec__4___rarg(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5) {
_start:
{
uint8 x_6; 
x_6 = !lean::is_exclusive(x_3);
if (x_6 == 0)
{
obj* x_7; obj* x_8; obj* x_9; obj* x_10; usize x_11; usize x_12; obj* x_13; usize x_14; obj* x_15; uint8 x_16; 
x_7 = lean::cnstr_get(x_3, 0);
x_8 = lean::cnstr_get(x_3, 1);
x_9 = lean::array_get_size(x_8);
lean::inc(x_2);
lean::inc(x_4);
x_10 = lean::apply_1(x_2, x_4);
x_11 = lean::unbox_size_t(x_10);
lean::dec(x_10);
x_12 = lean::usize_modn(x_11, x_9);
x_13 = lean::box_size_t(x_12);
x_14 = lean::unbox_size_t(x_13);
x_15 = lean::array_uget(x_8, x_14);
lean::inc(x_15);
lean::inc(x_4);
lean::inc(x_1);
x_16 = l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__5___rarg(x_1, x_4, x_15);
if (x_16 == 0)
{
obj* x_17; obj* x_18; obj* x_19; usize x_20; obj* x_21; uint8 x_22; 
lean::dec(x_1);
x_17 = lean::mk_nat_obj(1u);
x_18 = lean::nat_add(x_7, x_17);
lean::dec(x_7);
x_19 = lean::alloc_cnstr(1, 3, 0);
lean::cnstr_set(x_19, 0, x_4);
lean::cnstr_set(x_19, 1, x_5);
lean::cnstr_set(x_19, 2, x_15);
x_20 = lean::unbox_size_t(x_13);
lean::dec(x_13);
x_21 = lean::array_uset(x_8, x_20, x_19);
x_22 = lean::nat_dec_le(x_18, x_9);
lean::dec(x_9);
if (x_22 == 0)
{
obj* x_23; 
lean::free_heap_obj(x_3);
x_23 = l_HashMapImp_expand___rarg(x_2, x_18, x_21);
return x_23;
}
else
{
lean::dec(x_2);
lean::cnstr_set(x_3, 1, x_21);
lean::cnstr_set(x_3, 0, x_18);
return x_3;
}
}
else
{
obj* x_24; usize x_25; obj* x_26; 
lean::dec(x_9);
lean::dec(x_2);
x_24 = l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__6___rarg(x_1, x_4, x_5, x_15);
x_25 = lean::unbox_size_t(x_13);
lean::dec(x_13);
x_26 = lean::array_uset(x_8, x_25, x_24);
lean::cnstr_set(x_3, 1, x_26);
return x_3;
}
}
else
{
obj* x_27; obj* x_28; obj* x_29; obj* x_30; usize x_31; usize x_32; obj* x_33; usize x_34; obj* x_35; uint8 x_36; 
x_27 = lean::cnstr_get(x_3, 0);
x_28 = lean::cnstr_get(x_3, 1);
lean::inc(x_28);
lean::inc(x_27);
lean::dec(x_3);
x_29 = lean::array_get_size(x_28);
lean::inc(x_2);
lean::inc(x_4);
x_30 = lean::apply_1(x_2, x_4);
x_31 = lean::unbox_size_t(x_30);
lean::dec(x_30);
x_32 = lean::usize_modn(x_31, x_29);
x_33 = lean::box_size_t(x_32);
x_34 = lean::unbox_size_t(x_33);
x_35 = lean::array_uget(x_28, x_34);
lean::inc(x_35);
lean::inc(x_4);
lean::inc(x_1);
x_36 = l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__5___rarg(x_1, x_4, x_35);
if (x_36 == 0)
{
obj* x_37; obj* x_38; obj* x_39; usize x_40; obj* x_41; uint8 x_42; 
lean::dec(x_1);
x_37 = lean::mk_nat_obj(1u);
x_38 = lean::nat_add(x_27, x_37);
lean::dec(x_27);
x_39 = lean::alloc_cnstr(1, 3, 0);
lean::cnstr_set(x_39, 0, x_4);
lean::cnstr_set(x_39, 1, x_5);
lean::cnstr_set(x_39, 2, x_35);
x_40 = lean::unbox_size_t(x_33);
lean::dec(x_33);
x_41 = lean::array_uset(x_28, x_40, x_39);
x_42 = lean::nat_dec_le(x_38, x_29);
lean::dec(x_29);
if (x_42 == 0)
{
obj* x_43; 
x_43 = l_HashMapImp_expand___rarg(x_2, x_38, x_41);
return x_43;
}
else
{
obj* x_44; 
lean::dec(x_2);
x_44 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_44, 0, x_38);
lean::cnstr_set(x_44, 1, x_41);
return x_44;
}
}
else
{
obj* x_45; usize x_46; obj* x_47; obj* x_48; 
lean::dec(x_29);
lean::dec(x_2);
x_45 = l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__6___rarg(x_1, x_4, x_5, x_35);
x_46 = lean::unbox_size_t(x_33);
lean::dec(x_33);
x_47 = lean::array_uset(x_28, x_46, x_45);
x_48 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_48, 0, x_27);
lean::cnstr_set(x_48, 1, x_47);
return x_48;
}
}
}
}
obj* l_HashMapImp_insert___at_Lean_DisjointSet_merge___main___spec__4(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = lean::alloc_closure(reinterpret_cast<void*>(l_HashMapImp_insert___at_Lean_DisjointSet_merge___main___spec__4___rarg), 5, 0);
return x_2;
}
}
uint8 l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__8___rarg(obj* x_1, obj* x_2, obj* x_3) {
_start:
{
if (lean::obj_tag(x_3) == 0)
{
uint8 x_4; 
lean::dec(x_2);
lean::dec(x_1);
x_4 = 0;
return x_4;
}
else
{
obj* x_5; obj* x_6; obj* x_7; uint8 x_8; 
x_5 = lean::cnstr_get(x_3, 0);
lean::inc(x_5);
x_6 = lean::cnstr_get(x_3, 2);
lean::inc(x_6);
lean::dec(x_3);
lean::inc(x_1);
lean::inc(x_2);
x_7 = lean::apply_2(x_1, x_5, x_2);
x_8 = lean::unbox(x_7);
lean::dec(x_7);
if (x_8 == 0)
{
x_3 = x_6;
goto _start;
}
else
{
uint8 x_10; 
lean::dec(x_6);
lean::dec(x_2);
lean::dec(x_1);
x_10 = 1;
return x_10;
}
}
}
}
obj* l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__8(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = lean::alloc_closure(reinterpret_cast<void*>(l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__8___rarg___boxed), 3, 0);
return x_2;
}
}
obj* l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__9___rarg(obj* x_1, obj* x_2, obj* x_3, obj* x_4) {
_start:
{
if (lean::obj_tag(x_4) == 0)
{
lean::dec(x_3);
lean::dec(x_2);
lean::dec(x_1);
return x_4;
}
else
{
uint8 x_5; 
x_5 = !lean::is_exclusive(x_4);
if (x_5 == 0)
{
obj* x_6; obj* x_7; obj* x_8; obj* x_9; uint8 x_10; 
x_6 = lean::cnstr_get(x_4, 0);
x_7 = lean::cnstr_get(x_4, 1);
x_8 = lean::cnstr_get(x_4, 2);
lean::inc(x_1);
lean::inc(x_2);
lean::inc(x_6);
x_9 = lean::apply_2(x_1, x_6, x_2);
x_10 = lean::unbox(x_9);
lean::dec(x_9);
if (x_10 == 0)
{
obj* x_11; 
x_11 = l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__9___rarg(x_1, x_2, x_3, x_8);
lean::cnstr_set(x_4, 2, x_11);
return x_4;
}
else
{
lean::dec(x_7);
lean::dec(x_6);
lean::dec(x_1);
lean::cnstr_set(x_4, 1, x_3);
lean::cnstr_set(x_4, 0, x_2);
return x_4;
}
}
else
{
obj* x_12; obj* x_13; obj* x_14; obj* x_15; uint8 x_16; 
x_12 = lean::cnstr_get(x_4, 0);
x_13 = lean::cnstr_get(x_4, 1);
x_14 = lean::cnstr_get(x_4, 2);
lean::inc(x_14);
lean::inc(x_13);
lean::inc(x_12);
lean::dec(x_4);
lean::inc(x_1);
lean::inc(x_2);
lean::inc(x_12);
x_15 = lean::apply_2(x_1, x_12, x_2);
x_16 = lean::unbox(x_15);
lean::dec(x_15);
if (x_16 == 0)
{
obj* x_17; obj* x_18; 
x_17 = l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__9___rarg(x_1, x_2, x_3, x_14);
x_18 = lean::alloc_cnstr(1, 3, 0);
lean::cnstr_set(x_18, 0, x_12);
lean::cnstr_set(x_18, 1, x_13);
lean::cnstr_set(x_18, 2, x_17);
return x_18;
}
else
{
obj* x_19; 
lean::dec(x_13);
lean::dec(x_12);
lean::dec(x_1);
x_19 = lean::alloc_cnstr(1, 3, 0);
lean::cnstr_set(x_19, 0, x_2);
lean::cnstr_set(x_19, 1, x_3);
lean::cnstr_set(x_19, 2, x_14);
return x_19;
}
}
}
}
}
obj* l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__9(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = lean::alloc_closure(reinterpret_cast<void*>(l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__9___rarg), 4, 0);
return x_2;
}
}
obj* l_HashMapImp_insert___at_Lean_DisjointSet_merge___main___spec__7___rarg(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5) {
_start:
{
uint8 x_6; 
x_6 = !lean::is_exclusive(x_3);
if (x_6 == 0)
{
obj* x_7; obj* x_8; obj* x_9; obj* x_10; usize x_11; usize x_12; obj* x_13; usize x_14; obj* x_15; uint8 x_16; 
x_7 = lean::cnstr_get(x_3, 0);
x_8 = lean::cnstr_get(x_3, 1);
x_9 = lean::array_get_size(x_8);
lean::inc(x_2);
lean::inc(x_4);
x_10 = lean::apply_1(x_2, x_4);
x_11 = lean::unbox_size_t(x_10);
lean::dec(x_10);
x_12 = lean::usize_modn(x_11, x_9);
x_13 = lean::box_size_t(x_12);
x_14 = lean::unbox_size_t(x_13);
x_15 = lean::array_uget(x_8, x_14);
lean::inc(x_15);
lean::inc(x_4);
lean::inc(x_1);
x_16 = l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__8___rarg(x_1, x_4, x_15);
if (x_16 == 0)
{
obj* x_17; obj* x_18; obj* x_19; usize x_20; obj* x_21; uint8 x_22; 
lean::dec(x_1);
x_17 = lean::mk_nat_obj(1u);
x_18 = lean::nat_add(x_7, x_17);
lean::dec(x_7);
x_19 = lean::alloc_cnstr(1, 3, 0);
lean::cnstr_set(x_19, 0, x_4);
lean::cnstr_set(x_19, 1, x_5);
lean::cnstr_set(x_19, 2, x_15);
x_20 = lean::unbox_size_t(x_13);
lean::dec(x_13);
x_21 = lean::array_uset(x_8, x_20, x_19);
x_22 = lean::nat_dec_le(x_18, x_9);
lean::dec(x_9);
if (x_22 == 0)
{
obj* x_23; 
lean::free_heap_obj(x_3);
x_23 = l_HashMapImp_expand___rarg(x_2, x_18, x_21);
return x_23;
}
else
{
lean::dec(x_2);
lean::cnstr_set(x_3, 1, x_21);
lean::cnstr_set(x_3, 0, x_18);
return x_3;
}
}
else
{
obj* x_24; usize x_25; obj* x_26; 
lean::dec(x_9);
lean::dec(x_2);
x_24 = l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__9___rarg(x_1, x_4, x_5, x_15);
x_25 = lean::unbox_size_t(x_13);
lean::dec(x_13);
x_26 = lean::array_uset(x_8, x_25, x_24);
lean::cnstr_set(x_3, 1, x_26);
return x_3;
}
}
else
{
obj* x_27; obj* x_28; obj* x_29; obj* x_30; usize x_31; usize x_32; obj* x_33; usize x_34; obj* x_35; uint8 x_36; 
x_27 = lean::cnstr_get(x_3, 0);
x_28 = lean::cnstr_get(x_3, 1);
lean::inc(x_28);
lean::inc(x_27);
lean::dec(x_3);
x_29 = lean::array_get_size(x_28);
lean::inc(x_2);
lean::inc(x_4);
x_30 = lean::apply_1(x_2, x_4);
x_31 = lean::unbox_size_t(x_30);
lean::dec(x_30);
x_32 = lean::usize_modn(x_31, x_29);
x_33 = lean::box_size_t(x_32);
x_34 = lean::unbox_size_t(x_33);
x_35 = lean::array_uget(x_28, x_34);
lean::inc(x_35);
lean::inc(x_4);
lean::inc(x_1);
x_36 = l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__8___rarg(x_1, x_4, x_35);
if (x_36 == 0)
{
obj* x_37; obj* x_38; obj* x_39; usize x_40; obj* x_41; uint8 x_42; 
lean::dec(x_1);
x_37 = lean::mk_nat_obj(1u);
x_38 = lean::nat_add(x_27, x_37);
lean::dec(x_27);
x_39 = lean::alloc_cnstr(1, 3, 0);
lean::cnstr_set(x_39, 0, x_4);
lean::cnstr_set(x_39, 1, x_5);
lean::cnstr_set(x_39, 2, x_35);
x_40 = lean::unbox_size_t(x_33);
lean::dec(x_33);
x_41 = lean::array_uset(x_28, x_40, x_39);
x_42 = lean::nat_dec_le(x_38, x_29);
lean::dec(x_29);
if (x_42 == 0)
{
obj* x_43; 
x_43 = l_HashMapImp_expand___rarg(x_2, x_38, x_41);
return x_43;
}
else
{
obj* x_44; 
lean::dec(x_2);
x_44 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_44, 0, x_38);
lean::cnstr_set(x_44, 1, x_41);
return x_44;
}
}
else
{
obj* x_45; usize x_46; obj* x_47; obj* x_48; 
lean::dec(x_29);
lean::dec(x_2);
x_45 = l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__9___rarg(x_1, x_4, x_5, x_35);
x_46 = lean::unbox_size_t(x_33);
lean::dec(x_33);
x_47 = lean::array_uset(x_28, x_46, x_45);
x_48 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_48, 0, x_27);
lean::cnstr_set(x_48, 1, x_47);
return x_48;
}
}
}
}
obj* l_HashMapImp_insert___at_Lean_DisjointSet_merge___main___spec__7(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = lean::alloc_closure(reinterpret_cast<void*>(l_HashMapImp_insert___at_Lean_DisjointSet_merge___main___spec__7___rarg), 5, 0);
return x_2;
}
}
uint8 l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__11___rarg(obj* x_1, obj* x_2, obj* x_3) {
_start:
{
if (lean::obj_tag(x_3) == 0)
{
uint8 x_4; 
lean::dec(x_2);
lean::dec(x_1);
x_4 = 0;
return x_4;
}
else
{
obj* x_5; obj* x_6; obj* x_7; uint8 x_8; 
x_5 = lean::cnstr_get(x_3, 0);
lean::inc(x_5);
x_6 = lean::cnstr_get(x_3, 2);
lean::inc(x_6);
lean::dec(x_3);
lean::inc(x_1);
lean::inc(x_2);
x_7 = lean::apply_2(x_1, x_5, x_2);
x_8 = lean::unbox(x_7);
lean::dec(x_7);
if (x_8 == 0)
{
x_3 = x_6;
goto _start;
}
else
{
uint8 x_10; 
lean::dec(x_6);
lean::dec(x_2);
lean::dec(x_1);
x_10 = 1;
return x_10;
}
}
}
}
obj* l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__11(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = lean::alloc_closure(reinterpret_cast<void*>(l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__11___rarg___boxed), 3, 0);
return x_2;
}
}
obj* l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__12___rarg(obj* x_1, obj* x_2, obj* x_3, obj* x_4) {
_start:
{
if (lean::obj_tag(x_4) == 0)
{
lean::dec(x_3);
lean::dec(x_2);
lean::dec(x_1);
return x_4;
}
else
{
uint8 x_5; 
x_5 = !lean::is_exclusive(x_4);
if (x_5 == 0)
{
obj* x_6; obj* x_7; obj* x_8; obj* x_9; uint8 x_10; 
x_6 = lean::cnstr_get(x_4, 0);
x_7 = lean::cnstr_get(x_4, 1);
x_8 = lean::cnstr_get(x_4, 2);
lean::inc(x_1);
lean::inc(x_2);
lean::inc(x_6);
x_9 = lean::apply_2(x_1, x_6, x_2);
x_10 = lean::unbox(x_9);
lean::dec(x_9);
if (x_10 == 0)
{
obj* x_11; 
x_11 = l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__12___rarg(x_1, x_2, x_3, x_8);
lean::cnstr_set(x_4, 2, x_11);
return x_4;
}
else
{
lean::dec(x_7);
lean::dec(x_6);
lean::dec(x_1);
lean::cnstr_set(x_4, 1, x_3);
lean::cnstr_set(x_4, 0, x_2);
return x_4;
}
}
else
{
obj* x_12; obj* x_13; obj* x_14; obj* x_15; uint8 x_16; 
x_12 = lean::cnstr_get(x_4, 0);
x_13 = lean::cnstr_get(x_4, 1);
x_14 = lean::cnstr_get(x_4, 2);
lean::inc(x_14);
lean::inc(x_13);
lean::inc(x_12);
lean::dec(x_4);
lean::inc(x_1);
lean::inc(x_2);
lean::inc(x_12);
x_15 = lean::apply_2(x_1, x_12, x_2);
x_16 = lean::unbox(x_15);
lean::dec(x_15);
if (x_16 == 0)
{
obj* x_17; obj* x_18; 
x_17 = l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__12___rarg(x_1, x_2, x_3, x_14);
x_18 = lean::alloc_cnstr(1, 3, 0);
lean::cnstr_set(x_18, 0, x_12);
lean::cnstr_set(x_18, 1, x_13);
lean::cnstr_set(x_18, 2, x_17);
return x_18;
}
else
{
obj* x_19; 
lean::dec(x_13);
lean::dec(x_12);
lean::dec(x_1);
x_19 = lean::alloc_cnstr(1, 3, 0);
lean::cnstr_set(x_19, 0, x_2);
lean::cnstr_set(x_19, 1, x_3);
lean::cnstr_set(x_19, 2, x_14);
return x_19;
}
}
}
}
}
obj* l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__12(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = lean::alloc_closure(reinterpret_cast<void*>(l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__12___rarg), 4, 0);
return x_2;
}
}
obj* l_HashMapImp_insert___at_Lean_DisjointSet_merge___main___spec__10___rarg(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5) {
_start:
{
uint8 x_6; 
x_6 = !lean::is_exclusive(x_3);
if (x_6 == 0)
{
obj* x_7; obj* x_8; obj* x_9; obj* x_10; usize x_11; usize x_12; obj* x_13; usize x_14; obj* x_15; uint8 x_16; 
x_7 = lean::cnstr_get(x_3, 0);
x_8 = lean::cnstr_get(x_3, 1);
x_9 = lean::array_get_size(x_8);
lean::inc(x_2);
lean::inc(x_4);
x_10 = lean::apply_1(x_2, x_4);
x_11 = lean::unbox_size_t(x_10);
lean::dec(x_10);
x_12 = lean::usize_modn(x_11, x_9);
x_13 = lean::box_size_t(x_12);
x_14 = lean::unbox_size_t(x_13);
x_15 = lean::array_uget(x_8, x_14);
lean::inc(x_15);
lean::inc(x_4);
lean::inc(x_1);
x_16 = l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__11___rarg(x_1, x_4, x_15);
if (x_16 == 0)
{
obj* x_17; obj* x_18; obj* x_19; usize x_20; obj* x_21; uint8 x_22; 
lean::dec(x_1);
x_17 = lean::mk_nat_obj(1u);
x_18 = lean::nat_add(x_7, x_17);
lean::dec(x_7);
x_19 = lean::alloc_cnstr(1, 3, 0);
lean::cnstr_set(x_19, 0, x_4);
lean::cnstr_set(x_19, 1, x_5);
lean::cnstr_set(x_19, 2, x_15);
x_20 = lean::unbox_size_t(x_13);
lean::dec(x_13);
x_21 = lean::array_uset(x_8, x_20, x_19);
x_22 = lean::nat_dec_le(x_18, x_9);
lean::dec(x_9);
if (x_22 == 0)
{
obj* x_23; 
lean::free_heap_obj(x_3);
x_23 = l_HashMapImp_expand___rarg(x_2, x_18, x_21);
return x_23;
}
else
{
lean::dec(x_2);
lean::cnstr_set(x_3, 1, x_21);
lean::cnstr_set(x_3, 0, x_18);
return x_3;
}
}
else
{
obj* x_24; usize x_25; obj* x_26; 
lean::dec(x_9);
lean::dec(x_2);
x_24 = l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__12___rarg(x_1, x_4, x_5, x_15);
x_25 = lean::unbox_size_t(x_13);
lean::dec(x_13);
x_26 = lean::array_uset(x_8, x_25, x_24);
lean::cnstr_set(x_3, 1, x_26);
return x_3;
}
}
else
{
obj* x_27; obj* x_28; obj* x_29; obj* x_30; usize x_31; usize x_32; obj* x_33; usize x_34; obj* x_35; uint8 x_36; 
x_27 = lean::cnstr_get(x_3, 0);
x_28 = lean::cnstr_get(x_3, 1);
lean::inc(x_28);
lean::inc(x_27);
lean::dec(x_3);
x_29 = lean::array_get_size(x_28);
lean::inc(x_2);
lean::inc(x_4);
x_30 = lean::apply_1(x_2, x_4);
x_31 = lean::unbox_size_t(x_30);
lean::dec(x_30);
x_32 = lean::usize_modn(x_31, x_29);
x_33 = lean::box_size_t(x_32);
x_34 = lean::unbox_size_t(x_33);
x_35 = lean::array_uget(x_28, x_34);
lean::inc(x_35);
lean::inc(x_4);
lean::inc(x_1);
x_36 = l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__11___rarg(x_1, x_4, x_35);
if (x_36 == 0)
{
obj* x_37; obj* x_38; obj* x_39; usize x_40; obj* x_41; uint8 x_42; 
lean::dec(x_1);
x_37 = lean::mk_nat_obj(1u);
x_38 = lean::nat_add(x_27, x_37);
lean::dec(x_27);
x_39 = lean::alloc_cnstr(1, 3, 0);
lean::cnstr_set(x_39, 0, x_4);
lean::cnstr_set(x_39, 1, x_5);
lean::cnstr_set(x_39, 2, x_35);
x_40 = lean::unbox_size_t(x_33);
lean::dec(x_33);
x_41 = lean::array_uset(x_28, x_40, x_39);
x_42 = lean::nat_dec_le(x_38, x_29);
lean::dec(x_29);
if (x_42 == 0)
{
obj* x_43; 
x_43 = l_HashMapImp_expand___rarg(x_2, x_38, x_41);
return x_43;
}
else
{
obj* x_44; 
lean::dec(x_2);
x_44 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_44, 0, x_38);
lean::cnstr_set(x_44, 1, x_41);
return x_44;
}
}
else
{
obj* x_45; usize x_46; obj* x_47; obj* x_48; 
lean::dec(x_29);
lean::dec(x_2);
x_45 = l_AssocList_replace___main___at_Lean_DisjointSet_merge___main___spec__12___rarg(x_1, x_4, x_5, x_35);
x_46 = lean::unbox_size_t(x_33);
lean::dec(x_33);
x_47 = lean::array_uset(x_28, x_46, x_45);
x_48 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_48, 0, x_27);
lean::cnstr_set(x_48, 1, x_47);
return x_48;
}
}
}
}
obj* l_HashMapImp_insert___at_Lean_DisjointSet_merge___main___spec__10(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = lean::alloc_closure(reinterpret_cast<void*>(l_HashMapImp_insert___at_Lean_DisjointSet_merge___main___spec__10___rarg), 5, 0);
return x_2;
}
}
obj* l_Lean_DisjointSet_merge___main___rarg(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5) {
_start:
{
obj* x_6; obj* x_7; obj* x_8; obj* x_9; obj* x_10; obj* x_11; uint8 x_12; 
x_6 = lean::cnstr_get(x_3, 0);
lean::inc(x_6);
lean::inc(x_4);
lean::inc(x_6);
lean::inc(x_2);
lean::inc(x_1);
x_7 = l___private_init_lean_disjoint__set_1__findAux___main___rarg(x_1, x_2, x_6, x_4, x_3);
lean::inc(x_5);
lean::inc(x_2);
lean::inc(x_1);
x_8 = l___private_init_lean_disjoint__set_1__findAux___main___rarg(x_1, x_2, x_6, x_5, x_3);
x_9 = lean::cnstr_get(x_7, 0);
lean::inc(x_9);
x_10 = lean::cnstr_get(x_8, 0);
lean::inc(x_10);
lean::inc(x_1);
x_11 = lean::apply_2(x_1, x_9, x_10);
x_12 = lean::unbox(x_11);
lean::dec(x_11);
if (x_12 == 0)
{
obj* x_13; obj* x_14; uint8 x_15; 
x_13 = lean::cnstr_get(x_7, 1);
lean::inc(x_13);
lean::dec(x_7);
x_14 = lean::cnstr_get(x_8, 1);
lean::inc(x_14);
lean::dec(x_8);
x_15 = lean::nat_dec_lt(x_13, x_14);
if (x_15 == 0)
{
uint8 x_16; 
x_16 = lean::nat_dec_eq(x_13, x_14);
lean::dec(x_13);
if (x_16 == 0)
{
obj* x_17; obj* x_18; obj* x_19; 
lean::dec(x_14);
x_17 = lean::mk_nat_obj(0u);
x_18 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_18, 0, x_4);
lean::cnstr_set(x_18, 1, x_17);
x_19 = l_HashMapImp_insert___at_Lean_DisjointSet_merge___main___spec__1___rarg(x_1, x_2, x_3, x_5, x_18);
return x_19;
}
else
{
obj* x_20; obj* x_21; obj* x_22; obj* x_23; obj* x_24; obj* x_25; obj* x_26; 
x_20 = lean::mk_nat_obj(0u);
lean::inc(x_5);
x_21 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_21, 0, x_5);
lean::cnstr_set(x_21, 1, x_20);
x_22 = lean::mk_nat_obj(1u);
x_23 = lean::nat_add(x_14, x_22);
lean::dec(x_14);
lean::inc(x_5);
x_24 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_24, 0, x_5);
lean::cnstr_set(x_24, 1, x_23);
lean::inc(x_2);
lean::inc(x_1);
x_25 = l_HashMapImp_insert___at_Lean_DisjointSet_merge___main___spec__4___rarg(x_1, x_2, x_3, x_4, x_21);
x_26 = l_HashMapImp_insert___at_Lean_DisjointSet_merge___main___spec__7___rarg(x_1, x_2, x_25, x_5, x_24);
return x_26;
}
}
else
{
obj* x_27; obj* x_28; obj* x_29; 
lean::dec(x_14);
lean::dec(x_13);
x_27 = lean::mk_nat_obj(0u);
x_28 = lean::alloc_cnstr(0, 2, 0);
lean::cnstr_set(x_28, 0, x_5);
lean::cnstr_set(x_28, 1, x_27);
x_29 = l_HashMapImp_insert___at_Lean_DisjointSet_merge___main___spec__10___rarg(x_1, x_2, x_3, x_4, x_28);
return x_29;
}
}
else
{
lean::dec(x_8);
lean::dec(x_7);
lean::dec(x_5);
lean::dec(x_4);
lean::dec(x_2);
lean::dec(x_1);
return x_3;
}
}
}
obj* l_Lean_DisjointSet_merge___main(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = lean::alloc_closure(reinterpret_cast<void*>(l_Lean_DisjointSet_merge___main___rarg), 5, 0);
return x_2;
}
}
obj* l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__2___rarg___boxed(obj* x_1, obj* x_2, obj* x_3) {
_start:
{
uint8 x_4; obj* x_5; 
x_4 = l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__2___rarg(x_1, x_2, x_3);
x_5 = lean::box(x_4);
return x_5;
}
}
obj* l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__5___rarg___boxed(obj* x_1, obj* x_2, obj* x_3) {
_start:
{
uint8 x_4; obj* x_5; 
x_4 = l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__5___rarg(x_1, x_2, x_3);
x_5 = lean::box(x_4);
return x_5;
}
}
obj* l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__8___rarg___boxed(obj* x_1, obj* x_2, obj* x_3) {
_start:
{
uint8 x_4; obj* x_5; 
x_4 = l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__8___rarg(x_1, x_2, x_3);
x_5 = lean::box(x_4);
return x_5;
}
}
obj* l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__11___rarg___boxed(obj* x_1, obj* x_2, obj* x_3) {
_start:
{
uint8 x_4; obj* x_5; 
x_4 = l_AssocList_contains___main___at_Lean_DisjointSet_merge___main___spec__11___rarg(x_1, x_2, x_3);
x_5 = lean::box(x_4);
return x_5;
}
}
obj* l_Lean_DisjointSet_merge___rarg(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5) {
_start:
{
obj* x_6; 
x_6 = l_Lean_DisjointSet_merge___main___rarg(x_1, x_2, x_3, x_4, x_5);
return x_6;
}
}
obj* l_Lean_DisjointSet_merge(obj* x_1) {
_start:
{
obj* x_2; 
x_2 = lean::alloc_closure(reinterpret_cast<void*>(l_Lean_DisjointSet_merge___rarg), 5, 0);
return x_2;
}
}
obj* initialize_init_data_hashmap_basic(obj*);
static bool _G_initialized = false;
obj* initialize_init_lean_disjoint__set(obj* w) {
if (_G_initialized) return w;
_G_initialized = true;
if (io_result_is_error(w)) return w;
w = initialize_init_data_hashmap_basic(w);
if (io_result_is_error(w)) return w;
REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name("Lean"), "mkDisjointSet"), 3, l_Lean_mkDisjointSet___boxed);
REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name(lean::mk_const_name("Lean"), "DisjointSet"), "find"), 1, l_Lean_DisjointSet_find);
REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name(lean::mk_const_name("Lean"), "DisjointSet"), "rank"), 1, l_Lean_DisjointSet_rank);
REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name(lean::mk_const_name("Lean"), "DisjointSet"), "merge"), 1, l_Lean_DisjointSet_merge);
return w;
}
