// Lean compiler output
// Module: Lean.Meta.Tactic.Simp.Arith.Util
// Imports: Lean.Meta.Basic Lean.Expr
#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
static lean_object* l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__2;
lean_object* l_Lean_Expr_const___override(lean_object*, lean_object*);
static lean_object* l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__12;
lean_object* l_Lean_mkAppN(lean_object*, lean_object*);
static lean_object* l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__17;
lean_object* l___private_Lean_Expr_0__Lean_Expr_getAppNumArgsAux(lean_object*, lean_object*);
LEAN_EXPORT uint8_t l_Lean_Meta_Simp_Arith_isDvdCnstr(lean_object*);
static lean_object* l_Lean_Meta_Simp_Arith_isLinearTerm___closed__1;
uint8_t l_Lean_Expr_isAppOfArity(lean_object*, lean_object*, lean_object*);
lean_object* lean_array_push(lean_object*, lean_object*);
static lean_object* l_Lean_Meta_Simp_Arith_isLinearTerm___closed__13;
LEAN_EXPORT lean_object* l_Lean_Meta_withLocalDecl___at_Lean_Meta_Simp_Arith_withAbstractAtoms_go___spec__1___rarg(lean_object*, uint8_t, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Meta_Simp_Arith_isLinearTerm___closed__17;
static lean_object* l_Lean_Meta_Simp_Arith_isLinearTerm___closed__15;
static lean_object* l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__10;
static lean_object* l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__15;
lean_object* l_Lean_Expr_appArg_x21(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Meta_Simp_Arith_isDvdCnstr___boxed(lean_object*);
static lean_object* l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__5;
static lean_object* l_Lean_Meta_Simp_Arith_isLinearTerm___closed__6;
static lean_object* l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__7;
static lean_object* l_Lean_Meta_Simp_Arith_isDvdCnstr___closed__2;
lean_object* l___private_Lean_Meta_Basic_0__Lean_Meta_withLocalDeclImp___rarg(lean_object*, uint8_t, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___private_Lean_CoreM_0__Lean_Core_mkFreshNameImp(lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Meta_Simp_Arith_isLinearCnstr___boxed(lean_object*);
static lean_object* l_Lean_Meta_Simp_Arith_isLinearTerm___closed__21;
static lean_object* l_Lean_Meta_Simp_Arith_isLinearTerm___closed__16;
static lean_object* l_Lean_Meta_Simp_Arith_isLinearTerm___closed__11;
static lean_object* l_Lean_Meta_Simp_Arith_isLinearTerm___closed__20;
lean_object* l_Lean_Expr_constName_x21(lean_object*);
static lean_object* l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__1;
static lean_object* l_Lean_Meta_Simp_Arith_isLinearTerm___closed__3;
uint8_t lean_name_eq(lean_object*, lean_object*);
lean_object* l_Lean_Name_str___override(lean_object*, lean_object*);
static lean_object* l_Lean_Meta_Simp_Arith_withAbstractAtoms___closed__1;
static lean_object* l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__11;
static lean_object* l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__8;
static lean_object* l_Lean_Meta_Simp_Arith_isLinearTerm___closed__24;
static lean_object* l_Lean_Meta_Simp_Arith_isLinearTerm___closed__22;
static lean_object* l_Lean_Meta_Simp_Arith_isLinearTerm___closed__9;
static lean_object* l_Lean_Meta_Simp_Arith_isLinearTerm___closed__10;
static lean_object* l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__18;
LEAN_EXPORT lean_object* l_Lean_Meta_Simp_Arith_withAbstractAtoms_go(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__6;
static lean_object* l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__14;
lean_object* lean_array_fget(lean_object*, lean_object*);
static lean_object* l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__9;
static lean_object* l_Lean_Meta_Simp_Arith_isDvdCnstr___closed__3;
uint8_t lean_nat_dec_eq(lean_object*, lean_object*);
uint8_t lean_nat_dec_lt(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Meta_Simp_Arith_withAbstractAtoms_go___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Name_mkStr2(lean_object*, lean_object*);
static lean_object* l_Lean_Meta_Simp_Arith_isLinearTerm___closed__14;
LEAN_EXPORT lean_object* l_Lean_Meta_withLocalDecl___at_Lean_Meta_Simp_Arith_withAbstractAtoms_go___spec__1(lean_object*);
LEAN_EXPORT uint8_t l_Lean_Meta_Simp_Arith_isLinearCnstr(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Meta_Simp_Arith_withAbstractAtoms(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Expr_getAppFn(lean_object*);
static lean_object* l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__13;
static lean_object* l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__3;
static lean_object* l_Lean_Meta_Simp_Arith_isLinearTerm___closed__23;
LEAN_EXPORT lean_object* l_Lean_Meta_Simp_Arith_withAbstractAtoms_go___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Meta_Simp_Arith_isLinearTerm___closed__2;
static lean_object* l_Lean_Meta_Simp_Arith_isLinearTerm___closed__7;
lean_object* lean_array_mk(lean_object*);
static lean_object* l_Lean_Meta_Simp_Arith_isLinearTerm___closed__19;
static lean_object* l_Lean_Meta_Simp_Arith_isLinearTerm___closed__8;
LEAN_EXPORT lean_object* l_Lean_Meta_Simp_Arith_isLinearTerm___boxed(lean_object*, lean_object*);
static lean_object* l_Lean_Meta_Simp_Arith_isDvdCnstr___closed__1;
LEAN_EXPORT lean_object* l_Lean_Meta_withLocalDecl___at_Lean_Meta_Simp_Arith_withAbstractAtoms_go___spec__1___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_array_get_size(lean_object*);
static lean_object* l_Lean_Meta_Simp_Arith_withAbstractAtoms_go___closed__2;
lean_object* l_Lean_Meta_mkLambdaFVars(lean_object*, lean_object*, uint8_t, uint8_t, uint8_t, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__16;
lean_object* lean_nat_add(lean_object*, lean_object*);
static lean_object* l_Lean_Meta_Simp_Arith_isLinearTerm___closed__18;
uint8_t l_Lean_Expr_isConst(lean_object*);
lean_object* l_Lean_Expr_beta(lean_object*, lean_object*);
static lean_object* l_Lean_Meta_Simp_Arith_withAbstractAtoms_go___closed__1;
uint8_t l_Lean_Expr_isFVar(lean_object*);
static lean_object* l_Lean_Meta_Simp_Arith_isLinearTerm___closed__5;
LEAN_EXPORT uint8_t l_Lean_Meta_Simp_Arith_isLinearTerm(lean_object*, uint8_t);
static lean_object* l_Lean_Meta_Simp_Arith_isLinearTerm___closed__12;
static lean_object* l_Lean_Meta_Simp_Arith_isLinearTerm___closed__4;
static lean_object* l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__4;
uint8_t l_Array_isEmpty___rarg(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Meta_withLocalDecl___at_Lean_Meta_Simp_Arith_withAbstractAtoms_go___spec__1___rarg(lean_object* x_1, uint8_t x_2, lean_object* x_3, lean_object* x_4, uint8_t x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10) {
_start:
{
lean_object* x_11; 
x_11 = l___private_Lean_Meta_Basic_0__Lean_Meta_withLocalDeclImp___rarg(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10);
if (lean_obj_tag(x_11) == 0)
{
uint8_t x_12; 
x_12 = !lean_is_exclusive(x_11);
if (x_12 == 0)
{
return x_11;
}
else
{
lean_object* x_13; lean_object* x_14; lean_object* x_15; 
x_13 = lean_ctor_get(x_11, 0);
x_14 = lean_ctor_get(x_11, 1);
lean_inc(x_14);
lean_inc(x_13);
lean_dec(x_11);
x_15 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_15, 0, x_13);
lean_ctor_set(x_15, 1, x_14);
return x_15;
}
}
else
{
uint8_t x_16; 
x_16 = !lean_is_exclusive(x_11);
if (x_16 == 0)
{
return x_11;
}
else
{
lean_object* x_17; lean_object* x_18; lean_object* x_19; 
x_17 = lean_ctor_get(x_11, 0);
x_18 = lean_ctor_get(x_11, 1);
lean_inc(x_18);
lean_inc(x_17);
lean_dec(x_11);
x_19 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_19, 0, x_17);
lean_ctor_set(x_19, 1, x_18);
return x_19;
}
}
}
}
LEAN_EXPORT lean_object* l_Lean_Meta_withLocalDecl___at_Lean_Meta_Simp_Arith_withAbstractAtoms_go___spec__1(lean_object* x_1) {
_start:
{
lean_object* x_2; 
x_2 = lean_alloc_closure((void*)(l_Lean_Meta_withLocalDecl___at_Lean_Meta_Simp_Arith_withAbstractAtoms_go___spec__1___rarg___boxed), 10, 0);
return x_2;
}
}
LEAN_EXPORT lean_object* l_Lean_Meta_Simp_Arith_withAbstractAtoms_go___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13, lean_object* x_14) {
_start:
{
lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; 
x_15 = lean_unsigned_to_nat(1u);
x_16 = lean_nat_add(x_1, x_15);
lean_inc(x_9);
x_17 = lean_array_push(x_2, x_9);
x_18 = lean_array_push(x_3, x_9);
x_19 = lean_array_push(x_4, x_5);
x_20 = l_Lean_Meta_Simp_Arith_withAbstractAtoms_go(x_6, x_7, x_8, x_16, x_17, x_18, x_19, x_10, x_11, x_12, x_13, x_14);
return x_20;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_withAbstractAtoms_go___closed__1() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("x", 1, 1);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_withAbstractAtoms_go___closed__2() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3; 
x_1 = lean_box(0);
x_2 = l_Lean_Meta_Simp_Arith_withAbstractAtoms_go___closed__1;
x_3 = l_Lean_Name_str___override(x_1, x_2);
return x_3;
}
}
LEAN_EXPORT lean_object* l_Lean_Meta_Simp_Arith_withAbstractAtoms_go(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12) {
_start:
{
lean_object* x_13; uint8_t x_14; 
x_13 = lean_array_get_size(x_1);
x_14 = lean_nat_dec_lt(x_4, x_13);
lean_dec(x_13);
if (x_14 == 0)
{
uint8_t x_15; 
lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_1);
x_15 = l_Array_isEmpty___rarg(x_6);
if (x_15 == 0)
{
lean_object* x_16; 
lean_inc(x_11);
lean_inc(x_10);
lean_inc(x_9);
lean_inc(x_8);
x_16 = lean_apply_6(x_2, x_5, x_8, x_9, x_10, x_11, x_12);
if (lean_obj_tag(x_16) == 0)
{
lean_object* x_17; 
x_17 = lean_ctor_get(x_16, 0);
lean_inc(x_17);
if (lean_obj_tag(x_17) == 0)
{
uint8_t x_18; 
lean_dec(x_11);
lean_dec(x_10);
lean_dec(x_9);
lean_dec(x_8);
lean_dec(x_7);
lean_dec(x_6);
x_18 = !lean_is_exclusive(x_16);
if (x_18 == 0)
{
lean_object* x_19; lean_object* x_20; 
x_19 = lean_ctor_get(x_16, 0);
lean_dec(x_19);
x_20 = lean_box(0);
lean_ctor_set(x_16, 0, x_20);
return x_16;
}
else
{
lean_object* x_21; lean_object* x_22; lean_object* x_23; 
x_21 = lean_ctor_get(x_16, 1);
lean_inc(x_21);
lean_dec(x_16);
x_22 = lean_box(0);
x_23 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_23, 0, x_22);
lean_ctor_set(x_23, 1, x_21);
return x_23;
}
}
else
{
uint8_t x_24; 
x_24 = !lean_is_exclusive(x_17);
if (x_24 == 0)
{
lean_object* x_25; lean_object* x_26; uint8_t x_27; 
x_25 = lean_ctor_get(x_17, 0);
x_26 = lean_ctor_get(x_16, 1);
lean_inc(x_26);
lean_dec(x_16);
x_27 = !lean_is_exclusive(x_25);
if (x_27 == 0)
{
lean_object* x_28; lean_object* x_29; uint8_t x_30; uint8_t x_31; uint8_t x_32; lean_object* x_33; 
x_28 = lean_ctor_get(x_25, 0);
x_29 = lean_ctor_get(x_25, 1);
x_30 = 0;
x_31 = 1;
x_32 = 1;
x_33 = l_Lean_Meta_mkLambdaFVars(x_6, x_28, x_30, x_31, x_30, x_32, x_8, x_9, x_10, x_11, x_26);
if (lean_obj_tag(x_33) == 0)
{
lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; 
x_34 = lean_ctor_get(x_33, 0);
lean_inc(x_34);
x_35 = lean_ctor_get(x_33, 1);
lean_inc(x_35);
lean_dec(x_33);
lean_inc(x_7);
x_36 = l_Lean_Expr_beta(x_34, x_7);
x_37 = l_Lean_Meta_mkLambdaFVars(x_6, x_29, x_30, x_31, x_30, x_32, x_8, x_9, x_10, x_11, x_35);
lean_dec(x_11);
lean_dec(x_10);
lean_dec(x_9);
lean_dec(x_8);
lean_dec(x_6);
if (lean_obj_tag(x_37) == 0)
{
uint8_t x_38; 
x_38 = !lean_is_exclusive(x_37);
if (x_38 == 0)
{
lean_object* x_39; lean_object* x_40; 
x_39 = lean_ctor_get(x_37, 0);
x_40 = l_Lean_mkAppN(x_39, x_7);
lean_dec(x_7);
lean_ctor_set(x_25, 1, x_40);
lean_ctor_set(x_25, 0, x_36);
lean_ctor_set(x_37, 0, x_17);
return x_37;
}
else
{
lean_object* x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44; 
x_41 = lean_ctor_get(x_37, 0);
x_42 = lean_ctor_get(x_37, 1);
lean_inc(x_42);
lean_inc(x_41);
lean_dec(x_37);
x_43 = l_Lean_mkAppN(x_41, x_7);
lean_dec(x_7);
lean_ctor_set(x_25, 1, x_43);
lean_ctor_set(x_25, 0, x_36);
x_44 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_44, 0, x_17);
lean_ctor_set(x_44, 1, x_42);
return x_44;
}
}
else
{
uint8_t x_45; 
lean_dec(x_36);
lean_free_object(x_25);
lean_free_object(x_17);
lean_dec(x_7);
x_45 = !lean_is_exclusive(x_37);
if (x_45 == 0)
{
return x_37;
}
else
{
lean_object* x_46; lean_object* x_47; lean_object* x_48; 
x_46 = lean_ctor_get(x_37, 0);
x_47 = lean_ctor_get(x_37, 1);
lean_inc(x_47);
lean_inc(x_46);
lean_dec(x_37);
x_48 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_48, 0, x_46);
lean_ctor_set(x_48, 1, x_47);
return x_48;
}
}
}
else
{
uint8_t x_49; 
lean_free_object(x_25);
lean_dec(x_29);
lean_free_object(x_17);
lean_dec(x_11);
lean_dec(x_10);
lean_dec(x_9);
lean_dec(x_8);
lean_dec(x_7);
lean_dec(x_6);
x_49 = !lean_is_exclusive(x_33);
if (x_49 == 0)
{
return x_33;
}
else
{
lean_object* x_50; lean_object* x_51; lean_object* x_52; 
x_50 = lean_ctor_get(x_33, 0);
x_51 = lean_ctor_get(x_33, 1);
lean_inc(x_51);
lean_inc(x_50);
lean_dec(x_33);
x_52 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_52, 0, x_50);
lean_ctor_set(x_52, 1, x_51);
return x_52;
}
}
}
else
{
lean_object* x_53; lean_object* x_54; uint8_t x_55; uint8_t x_56; uint8_t x_57; lean_object* x_58; 
x_53 = lean_ctor_get(x_25, 0);
x_54 = lean_ctor_get(x_25, 1);
lean_inc(x_54);
lean_inc(x_53);
lean_dec(x_25);
x_55 = 0;
x_56 = 1;
x_57 = 1;
x_58 = l_Lean_Meta_mkLambdaFVars(x_6, x_53, x_55, x_56, x_55, x_57, x_8, x_9, x_10, x_11, x_26);
if (lean_obj_tag(x_58) == 0)
{
lean_object* x_59; lean_object* x_60; lean_object* x_61; lean_object* x_62; 
x_59 = lean_ctor_get(x_58, 0);
lean_inc(x_59);
x_60 = lean_ctor_get(x_58, 1);
lean_inc(x_60);
lean_dec(x_58);
lean_inc(x_7);
x_61 = l_Lean_Expr_beta(x_59, x_7);
x_62 = l_Lean_Meta_mkLambdaFVars(x_6, x_54, x_55, x_56, x_55, x_57, x_8, x_9, x_10, x_11, x_60);
lean_dec(x_11);
lean_dec(x_10);
lean_dec(x_9);
lean_dec(x_8);
lean_dec(x_6);
if (lean_obj_tag(x_62) == 0)
{
lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; 
x_63 = lean_ctor_get(x_62, 0);
lean_inc(x_63);
x_64 = lean_ctor_get(x_62, 1);
lean_inc(x_64);
if (lean_is_exclusive(x_62)) {
 lean_ctor_release(x_62, 0);
 lean_ctor_release(x_62, 1);
 x_65 = x_62;
} else {
 lean_dec_ref(x_62);
 x_65 = lean_box(0);
}
x_66 = l_Lean_mkAppN(x_63, x_7);
lean_dec(x_7);
x_67 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_67, 0, x_61);
lean_ctor_set(x_67, 1, x_66);
lean_ctor_set(x_17, 0, x_67);
if (lean_is_scalar(x_65)) {
 x_68 = lean_alloc_ctor(0, 2, 0);
} else {
 x_68 = x_65;
}
lean_ctor_set(x_68, 0, x_17);
lean_ctor_set(x_68, 1, x_64);
return x_68;
}
else
{
lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72; 
lean_dec(x_61);
lean_free_object(x_17);
lean_dec(x_7);
x_69 = lean_ctor_get(x_62, 0);
lean_inc(x_69);
x_70 = lean_ctor_get(x_62, 1);
lean_inc(x_70);
if (lean_is_exclusive(x_62)) {
 lean_ctor_release(x_62, 0);
 lean_ctor_release(x_62, 1);
 x_71 = x_62;
} else {
 lean_dec_ref(x_62);
 x_71 = lean_box(0);
}
if (lean_is_scalar(x_71)) {
 x_72 = lean_alloc_ctor(1, 2, 0);
} else {
 x_72 = x_71;
}
lean_ctor_set(x_72, 0, x_69);
lean_ctor_set(x_72, 1, x_70);
return x_72;
}
}
else
{
lean_object* x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76; 
lean_dec(x_54);
lean_free_object(x_17);
lean_dec(x_11);
lean_dec(x_10);
lean_dec(x_9);
lean_dec(x_8);
lean_dec(x_7);
lean_dec(x_6);
x_73 = lean_ctor_get(x_58, 0);
lean_inc(x_73);
x_74 = lean_ctor_get(x_58, 1);
lean_inc(x_74);
if (lean_is_exclusive(x_58)) {
 lean_ctor_release(x_58, 0);
 lean_ctor_release(x_58, 1);
 x_75 = x_58;
} else {
 lean_dec_ref(x_58);
 x_75 = lean_box(0);
}
if (lean_is_scalar(x_75)) {
 x_76 = lean_alloc_ctor(1, 2, 0);
} else {
 x_76 = x_75;
}
lean_ctor_set(x_76, 0, x_73);
lean_ctor_set(x_76, 1, x_74);
return x_76;
}
}
}
else
{
lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81; uint8_t x_82; uint8_t x_83; uint8_t x_84; lean_object* x_85; 
x_77 = lean_ctor_get(x_17, 0);
lean_inc(x_77);
lean_dec(x_17);
x_78 = lean_ctor_get(x_16, 1);
lean_inc(x_78);
lean_dec(x_16);
x_79 = lean_ctor_get(x_77, 0);
lean_inc(x_79);
x_80 = lean_ctor_get(x_77, 1);
lean_inc(x_80);
if (lean_is_exclusive(x_77)) {
 lean_ctor_release(x_77, 0);
 lean_ctor_release(x_77, 1);
 x_81 = x_77;
} else {
 lean_dec_ref(x_77);
 x_81 = lean_box(0);
}
x_82 = 0;
x_83 = 1;
x_84 = 1;
x_85 = l_Lean_Meta_mkLambdaFVars(x_6, x_79, x_82, x_83, x_82, x_84, x_8, x_9, x_10, x_11, x_78);
if (lean_obj_tag(x_85) == 0)
{
lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; 
x_86 = lean_ctor_get(x_85, 0);
lean_inc(x_86);
x_87 = lean_ctor_get(x_85, 1);
lean_inc(x_87);
lean_dec(x_85);
lean_inc(x_7);
x_88 = l_Lean_Expr_beta(x_86, x_7);
x_89 = l_Lean_Meta_mkLambdaFVars(x_6, x_80, x_82, x_83, x_82, x_84, x_8, x_9, x_10, x_11, x_87);
lean_dec(x_11);
lean_dec(x_10);
lean_dec(x_9);
lean_dec(x_8);
lean_dec(x_6);
if (lean_obj_tag(x_89) == 0)
{
lean_object* x_90; lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_object* x_94; lean_object* x_95; lean_object* x_96; 
x_90 = lean_ctor_get(x_89, 0);
lean_inc(x_90);
x_91 = lean_ctor_get(x_89, 1);
lean_inc(x_91);
if (lean_is_exclusive(x_89)) {
 lean_ctor_release(x_89, 0);
 lean_ctor_release(x_89, 1);
 x_92 = x_89;
} else {
 lean_dec_ref(x_89);
 x_92 = lean_box(0);
}
x_93 = l_Lean_mkAppN(x_90, x_7);
lean_dec(x_7);
if (lean_is_scalar(x_81)) {
 x_94 = lean_alloc_ctor(0, 2, 0);
} else {
 x_94 = x_81;
}
lean_ctor_set(x_94, 0, x_88);
lean_ctor_set(x_94, 1, x_93);
x_95 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_95, 0, x_94);
if (lean_is_scalar(x_92)) {
 x_96 = lean_alloc_ctor(0, 2, 0);
} else {
 x_96 = x_92;
}
lean_ctor_set(x_96, 0, x_95);
lean_ctor_set(x_96, 1, x_91);
return x_96;
}
else
{
lean_object* x_97; lean_object* x_98; lean_object* x_99; lean_object* x_100; 
lean_dec(x_88);
lean_dec(x_81);
lean_dec(x_7);
x_97 = lean_ctor_get(x_89, 0);
lean_inc(x_97);
x_98 = lean_ctor_get(x_89, 1);
lean_inc(x_98);
if (lean_is_exclusive(x_89)) {
 lean_ctor_release(x_89, 0);
 lean_ctor_release(x_89, 1);
 x_99 = x_89;
} else {
 lean_dec_ref(x_89);
 x_99 = lean_box(0);
}
if (lean_is_scalar(x_99)) {
 x_100 = lean_alloc_ctor(1, 2, 0);
} else {
 x_100 = x_99;
}
lean_ctor_set(x_100, 0, x_97);
lean_ctor_set(x_100, 1, x_98);
return x_100;
}
}
else
{
lean_object* x_101; lean_object* x_102; lean_object* x_103; lean_object* x_104; 
lean_dec(x_81);
lean_dec(x_80);
lean_dec(x_11);
lean_dec(x_10);
lean_dec(x_9);
lean_dec(x_8);
lean_dec(x_7);
lean_dec(x_6);
x_101 = lean_ctor_get(x_85, 0);
lean_inc(x_101);
x_102 = lean_ctor_get(x_85, 1);
lean_inc(x_102);
if (lean_is_exclusive(x_85)) {
 lean_ctor_release(x_85, 0);
 lean_ctor_release(x_85, 1);
 x_103 = x_85;
} else {
 lean_dec_ref(x_85);
 x_103 = lean_box(0);
}
if (lean_is_scalar(x_103)) {
 x_104 = lean_alloc_ctor(1, 2, 0);
} else {
 x_104 = x_103;
}
lean_ctor_set(x_104, 0, x_101);
lean_ctor_set(x_104, 1, x_102);
return x_104;
}
}
}
}
else
{
uint8_t x_105; 
lean_dec(x_11);
lean_dec(x_10);
lean_dec(x_9);
lean_dec(x_8);
lean_dec(x_7);
lean_dec(x_6);
x_105 = !lean_is_exclusive(x_16);
if (x_105 == 0)
{
return x_16;
}
else
{
lean_object* x_106; lean_object* x_107; lean_object* x_108; 
x_106 = lean_ctor_get(x_16, 0);
x_107 = lean_ctor_get(x_16, 1);
lean_inc(x_107);
lean_inc(x_106);
lean_dec(x_16);
x_108 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_108, 0, x_106);
lean_ctor_set(x_108, 1, x_107);
return x_108;
}
}
}
else
{
lean_object* x_109; 
lean_dec(x_7);
lean_dec(x_6);
x_109 = lean_apply_6(x_2, x_5, x_8, x_9, x_10, x_11, x_12);
return x_109;
}
}
else
{
lean_object* x_110; uint8_t x_111; 
x_110 = lean_array_fget(x_1, x_4);
x_111 = l_Lean_Expr_isFVar(x_110);
if (x_111 == 0)
{
lean_object* x_112; lean_object* x_113; lean_object* x_114; lean_object* x_115; lean_object* x_116; uint8_t x_117; uint8_t x_118; lean_object* x_119; 
x_112 = l_Lean_Meta_Simp_Arith_withAbstractAtoms_go___closed__2;
x_113 = l___private_Lean_CoreM_0__Lean_Core_mkFreshNameImp(x_112, x_10, x_11, x_12);
x_114 = lean_ctor_get(x_113, 0);
lean_inc(x_114);
x_115 = lean_ctor_get(x_113, 1);
lean_inc(x_115);
lean_dec(x_113);
lean_inc(x_3);
x_116 = lean_alloc_closure((void*)(l_Lean_Meta_Simp_Arith_withAbstractAtoms_go___lambda__1___boxed), 14, 8);
lean_closure_set(x_116, 0, x_4);
lean_closure_set(x_116, 1, x_5);
lean_closure_set(x_116, 2, x_6);
lean_closure_set(x_116, 3, x_7);
lean_closure_set(x_116, 4, x_110);
lean_closure_set(x_116, 5, x_1);
lean_closure_set(x_116, 6, x_2);
lean_closure_set(x_116, 7, x_3);
x_117 = 0;
x_118 = 0;
x_119 = l_Lean_Meta_withLocalDecl___at_Lean_Meta_Simp_Arith_withAbstractAtoms_go___spec__1___rarg(x_114, x_117, x_3, x_116, x_118, x_8, x_9, x_10, x_11, x_115);
return x_119;
}
else
{
lean_object* x_120; lean_object* x_121; lean_object* x_122; 
x_120 = lean_unsigned_to_nat(1u);
x_121 = lean_nat_add(x_4, x_120);
lean_dec(x_4);
x_122 = lean_array_push(x_5, x_110);
x_4 = x_121;
x_5 = x_122;
goto _start;
}
}
}
}
LEAN_EXPORT lean_object* l_Lean_Meta_withLocalDecl___at_Lean_Meta_Simp_Arith_withAbstractAtoms_go___spec__1___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10) {
_start:
{
uint8_t x_11; uint8_t x_12; lean_object* x_13; 
x_11 = lean_unbox(x_2);
lean_dec(x_2);
x_12 = lean_unbox(x_5);
lean_dec(x_5);
x_13 = l_Lean_Meta_withLocalDecl___at_Lean_Meta_Simp_Arith_withAbstractAtoms_go___spec__1___rarg(x_1, x_11, x_3, x_4, x_12, x_6, x_7, x_8, x_9, x_10);
return x_13;
}
}
LEAN_EXPORT lean_object* l_Lean_Meta_Simp_Arith_withAbstractAtoms_go___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13, lean_object* x_14) {
_start:
{
lean_object* x_15; 
x_15 = l_Lean_Meta_Simp_Arith_withAbstractAtoms_go___lambda__1(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12, x_13, x_14);
lean_dec(x_1);
return x_15;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_withAbstractAtoms___closed__1() {
_start:
{
lean_object* x_1; lean_object* x_2; 
x_1 = lean_box(0);
x_2 = lean_array_mk(x_1);
return x_2;
}
}
LEAN_EXPORT lean_object* l_Lean_Meta_Simp_Arith_withAbstractAtoms(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8) {
_start:
{
lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; 
x_9 = lean_box(0);
x_10 = l_Lean_Expr_const___override(x_2, x_9);
x_11 = lean_unsigned_to_nat(0u);
x_12 = l_Lean_Meta_Simp_Arith_withAbstractAtoms___closed__1;
x_13 = l_Lean_Meta_Simp_Arith_withAbstractAtoms_go(x_1, x_3, x_10, x_11, x_12, x_12, x_12, x_4, x_5, x_6, x_7, x_8);
return x_13;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__1() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("HAdd", 4, 4);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__2() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("hAdd", 4, 4);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__3() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3; 
x_1 = l_Lean_Meta_Simp_Arith_isLinearTerm___closed__1;
x_2 = l_Lean_Meta_Simp_Arith_isLinearTerm___closed__2;
x_3 = l_Lean_Name_mkStr2(x_1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__4() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("HMul", 4, 4);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__5() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("hMul", 4, 4);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__6() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3; 
x_1 = l_Lean_Meta_Simp_Arith_isLinearTerm___closed__4;
x_2 = l_Lean_Meta_Simp_Arith_isLinearTerm___closed__5;
x_3 = l_Lean_Name_mkStr2(x_1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__7() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("Neg", 3, 3);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__8() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("neg", 3, 3);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__9() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3; 
x_1 = l_Lean_Meta_Simp_Arith_isLinearTerm___closed__7;
x_2 = l_Lean_Meta_Simp_Arith_isLinearTerm___closed__8;
x_3 = l_Lean_Name_mkStr2(x_1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__10() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("Nat", 3, 3);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__11() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("succ", 4, 4);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__12() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3; 
x_1 = l_Lean_Meta_Simp_Arith_isLinearTerm___closed__10;
x_2 = l_Lean_Meta_Simp_Arith_isLinearTerm___closed__11;
x_3 = l_Lean_Name_mkStr2(x_1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__13() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("Add", 3, 3);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__14() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("add", 3, 3);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__15() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3; 
x_1 = l_Lean_Meta_Simp_Arith_isLinearTerm___closed__13;
x_2 = l_Lean_Meta_Simp_Arith_isLinearTerm___closed__14;
x_3 = l_Lean_Name_mkStr2(x_1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__16() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("Mul", 3, 3);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__17() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("mul", 3, 3);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__18() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3; 
x_1 = l_Lean_Meta_Simp_Arith_isLinearTerm___closed__16;
x_2 = l_Lean_Meta_Simp_Arith_isLinearTerm___closed__17;
x_3 = l_Lean_Name_mkStr2(x_1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__19() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("HSub", 4, 4);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__20() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("hSub", 4, 4);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__21() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3; 
x_1 = l_Lean_Meta_Simp_Arith_isLinearTerm___closed__19;
x_2 = l_Lean_Meta_Simp_Arith_isLinearTerm___closed__20;
x_3 = l_Lean_Name_mkStr2(x_1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__22() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("Sub", 3, 3);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__23() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("sub", 3, 3);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__24() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3; 
x_1 = l_Lean_Meta_Simp_Arith_isLinearTerm___closed__22;
x_2 = l_Lean_Meta_Simp_Arith_isLinearTerm___closed__23;
x_3 = l_Lean_Name_mkStr2(x_1, x_2);
return x_3;
}
}
LEAN_EXPORT uint8_t l_Lean_Meta_Simp_Arith_isLinearTerm(lean_object* x_1, uint8_t x_2) {
_start:
{
lean_object* x_3; uint8_t x_4; 
x_3 = l_Lean_Expr_getAppFn(x_1);
x_4 = l_Lean_Expr_isConst(x_3);
if (x_4 == 0)
{
uint8_t x_5; 
lean_dec(x_3);
x_5 = 0;
return x_5;
}
else
{
lean_object* x_6; lean_object* x_7; uint8_t x_8; 
x_6 = l_Lean_Expr_constName_x21(x_3);
lean_dec(x_3);
x_7 = l_Lean_Meta_Simp_Arith_isLinearTerm___closed__3;
x_8 = lean_name_eq(x_6, x_7);
if (x_8 == 0)
{
lean_object* x_9; uint8_t x_10; 
x_9 = l_Lean_Meta_Simp_Arith_isLinearTerm___closed__6;
x_10 = lean_name_eq(x_6, x_9);
if (x_10 == 0)
{
lean_object* x_11; uint8_t x_12; 
x_11 = l_Lean_Meta_Simp_Arith_isLinearTerm___closed__9;
x_12 = lean_name_eq(x_6, x_11);
if (x_12 == 0)
{
lean_object* x_13; uint8_t x_14; 
x_13 = l_Lean_Meta_Simp_Arith_isLinearTerm___closed__12;
x_14 = lean_name_eq(x_6, x_13);
if (x_14 == 0)
{
lean_object* x_15; uint8_t x_16; 
x_15 = l_Lean_Meta_Simp_Arith_isLinearTerm___closed__15;
x_16 = lean_name_eq(x_6, x_15);
if (x_16 == 0)
{
lean_object* x_17; uint8_t x_18; 
x_17 = l_Lean_Meta_Simp_Arith_isLinearTerm___closed__18;
x_18 = lean_name_eq(x_6, x_17);
if (x_18 == 0)
{
if (x_2 == 0)
{
lean_object* x_19; uint8_t x_20; 
x_19 = l_Lean_Meta_Simp_Arith_isLinearTerm___closed__21;
x_20 = lean_name_eq(x_6, x_19);
if (x_20 == 0)
{
lean_object* x_21; uint8_t x_22; 
x_21 = l_Lean_Meta_Simp_Arith_isLinearTerm___closed__24;
x_22 = lean_name_eq(x_6, x_21);
lean_dec(x_6);
return x_22;
}
else
{
uint8_t x_23; 
lean_dec(x_6);
x_23 = 1;
return x_23;
}
}
else
{
uint8_t x_24; 
lean_dec(x_6);
x_24 = 0;
return x_24;
}
}
else
{
uint8_t x_25; 
lean_dec(x_6);
x_25 = 1;
return x_25;
}
}
else
{
uint8_t x_26; 
lean_dec(x_6);
x_26 = 1;
return x_26;
}
}
else
{
uint8_t x_27; 
lean_dec(x_6);
x_27 = 1;
return x_27;
}
}
else
{
uint8_t x_28; 
lean_dec(x_6);
x_28 = 1;
return x_28;
}
}
else
{
uint8_t x_29; 
lean_dec(x_6);
x_29 = 1;
return x_29;
}
}
else
{
uint8_t x_30; 
lean_dec(x_6);
x_30 = 1;
return x_30;
}
}
}
}
LEAN_EXPORT lean_object* l_Lean_Meta_Simp_Arith_isLinearTerm___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
uint8_t x_3; uint8_t x_4; lean_object* x_5; 
x_3 = lean_unbox(x_2);
lean_dec(x_2);
x_4 = l_Lean_Meta_Simp_Arith_isLinearTerm(x_1, x_3);
lean_dec(x_1);
x_5 = lean_box(x_4);
return x_5;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__1() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("Eq", 2, 2);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__2() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3; 
x_1 = lean_box(0);
x_2 = l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__1;
x_3 = l_Lean_Name_str___override(x_1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__3() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("LT", 2, 2);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__4() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("lt", 2, 2);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__5() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3; 
x_1 = l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__3;
x_2 = l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__4;
x_3 = l_Lean_Name_mkStr2(x_1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__6() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("LE", 2, 2);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__7() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("le", 2, 2);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__8() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3; 
x_1 = l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__6;
x_2 = l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__7;
x_3 = l_Lean_Name_mkStr2(x_1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__9() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("GT", 2, 2);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__10() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("gt", 2, 2);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__11() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3; 
x_1 = l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__9;
x_2 = l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__10;
x_3 = l_Lean_Name_mkStr2(x_1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__12() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("GE", 2, 2);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__13() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("ge", 2, 2);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__14() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3; 
x_1 = l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__12;
x_2 = l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__13;
x_3 = l_Lean_Name_mkStr2(x_1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__15() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("Ne", 2, 2);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__16() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3; 
x_1 = lean_box(0);
x_2 = l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__15;
x_3 = l_Lean_Name_str___override(x_1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__17() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("Not", 3, 3);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__18() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3; 
x_1 = lean_box(0);
x_2 = l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__17;
x_3 = l_Lean_Name_str___override(x_1, x_2);
return x_3;
}
}
LEAN_EXPORT uint8_t l_Lean_Meta_Simp_Arith_isLinearCnstr(lean_object* x_1) {
_start:
{
lean_object* x_2; uint8_t x_3; 
x_2 = l_Lean_Expr_getAppFn(x_1);
x_3 = l_Lean_Expr_isConst(x_2);
if (x_3 == 0)
{
uint8_t x_4; 
lean_dec(x_2);
lean_dec(x_1);
x_4 = 0;
return x_4;
}
else
{
lean_object* x_5; lean_object* x_6; uint8_t x_7; 
x_5 = l_Lean_Expr_constName_x21(x_2);
lean_dec(x_2);
x_6 = l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__2;
x_7 = lean_name_eq(x_5, x_6);
if (x_7 == 0)
{
lean_object* x_8; uint8_t x_9; 
x_8 = l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__5;
x_9 = lean_name_eq(x_5, x_8);
if (x_9 == 0)
{
lean_object* x_10; uint8_t x_11; 
x_10 = l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__8;
x_11 = lean_name_eq(x_5, x_10);
if (x_11 == 0)
{
lean_object* x_12; uint8_t x_13; 
x_12 = l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__11;
x_13 = lean_name_eq(x_5, x_12);
if (x_13 == 0)
{
lean_object* x_14; uint8_t x_15; 
x_14 = l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__14;
x_15 = lean_name_eq(x_5, x_14);
if (x_15 == 0)
{
lean_object* x_16; uint8_t x_17; 
x_16 = l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__16;
x_17 = lean_name_eq(x_5, x_16);
if (x_17 == 0)
{
lean_object* x_18; uint8_t x_19; 
x_18 = l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__18;
x_19 = lean_name_eq(x_5, x_18);
lean_dec(x_5);
if (x_19 == 0)
{
uint8_t x_20; 
lean_dec(x_1);
x_20 = 0;
return x_20;
}
else
{
lean_object* x_21; lean_object* x_22; lean_object* x_23; uint8_t x_24; 
x_21 = lean_unsigned_to_nat(0u);
x_22 = l___private_Lean_Expr_0__Lean_Expr_getAppNumArgsAux(x_1, x_21);
x_23 = lean_unsigned_to_nat(1u);
x_24 = lean_nat_dec_eq(x_22, x_23);
lean_dec(x_22);
if (x_24 == 0)
{
uint8_t x_25; 
lean_dec(x_1);
x_25 = 0;
return x_25;
}
else
{
lean_object* x_26; 
x_26 = l_Lean_Expr_appArg_x21(x_1);
lean_dec(x_1);
x_1 = x_26;
goto _start;
}
}
}
else
{
uint8_t x_28; 
lean_dec(x_5);
lean_dec(x_1);
x_28 = 1;
return x_28;
}
}
else
{
uint8_t x_29; 
lean_dec(x_5);
lean_dec(x_1);
x_29 = 1;
return x_29;
}
}
else
{
uint8_t x_30; 
lean_dec(x_5);
lean_dec(x_1);
x_30 = 1;
return x_30;
}
}
else
{
uint8_t x_31; 
lean_dec(x_5);
lean_dec(x_1);
x_31 = 1;
return x_31;
}
}
else
{
uint8_t x_32; 
lean_dec(x_5);
lean_dec(x_1);
x_32 = 1;
return x_32;
}
}
else
{
uint8_t x_33; 
lean_dec(x_5);
lean_dec(x_1);
x_33 = 1;
return x_33;
}
}
}
}
LEAN_EXPORT lean_object* l_Lean_Meta_Simp_Arith_isLinearCnstr___boxed(lean_object* x_1) {
_start:
{
uint8_t x_2; lean_object* x_3; 
x_2 = l_Lean_Meta_Simp_Arith_isLinearCnstr(x_1);
x_3 = lean_box(x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isDvdCnstr___closed__1() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("Dvd", 3, 3);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isDvdCnstr___closed__2() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("dvd", 3, 3);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_Simp_Arith_isDvdCnstr___closed__3() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3; 
x_1 = l_Lean_Meta_Simp_Arith_isDvdCnstr___closed__1;
x_2 = l_Lean_Meta_Simp_Arith_isDvdCnstr___closed__2;
x_3 = l_Lean_Name_mkStr2(x_1, x_2);
return x_3;
}
}
LEAN_EXPORT uint8_t l_Lean_Meta_Simp_Arith_isDvdCnstr(lean_object* x_1) {
_start:
{
lean_object* x_2; lean_object* x_3; uint8_t x_4; 
x_2 = l_Lean_Meta_Simp_Arith_isDvdCnstr___closed__3;
x_3 = lean_unsigned_to_nat(4u);
x_4 = l_Lean_Expr_isAppOfArity(x_1, x_2, x_3);
return x_4;
}
}
LEAN_EXPORT lean_object* l_Lean_Meta_Simp_Arith_isDvdCnstr___boxed(lean_object* x_1) {
_start:
{
uint8_t x_2; lean_object* x_3; 
x_2 = l_Lean_Meta_Simp_Arith_isDvdCnstr(x_1);
lean_dec(x_1);
x_3 = lean_box(x_2);
return x_3;
}
}
lean_object* initialize_Lean_Meta_Basic(uint8_t builtin, lean_object*);
lean_object* initialize_Lean_Expr(uint8_t builtin, lean_object*);
static bool _G_initialized = false;
LEAN_EXPORT lean_object* initialize_Lean_Meta_Tactic_Simp_Arith_Util(uint8_t builtin, lean_object* w) {
lean_object * res;
if (_G_initialized) return lean_io_result_mk_ok(lean_box(0));
_G_initialized = true;
res = initialize_Lean_Meta_Basic(builtin, lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lean_Expr(builtin, lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
l_Lean_Meta_Simp_Arith_withAbstractAtoms_go___closed__1 = _init_l_Lean_Meta_Simp_Arith_withAbstractAtoms_go___closed__1();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_withAbstractAtoms_go___closed__1);
l_Lean_Meta_Simp_Arith_withAbstractAtoms_go___closed__2 = _init_l_Lean_Meta_Simp_Arith_withAbstractAtoms_go___closed__2();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_withAbstractAtoms_go___closed__2);
l_Lean_Meta_Simp_Arith_withAbstractAtoms___closed__1 = _init_l_Lean_Meta_Simp_Arith_withAbstractAtoms___closed__1();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_withAbstractAtoms___closed__1);
l_Lean_Meta_Simp_Arith_isLinearTerm___closed__1 = _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__1();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearTerm___closed__1);
l_Lean_Meta_Simp_Arith_isLinearTerm___closed__2 = _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__2();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearTerm___closed__2);
l_Lean_Meta_Simp_Arith_isLinearTerm___closed__3 = _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__3();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearTerm___closed__3);
l_Lean_Meta_Simp_Arith_isLinearTerm___closed__4 = _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__4();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearTerm___closed__4);
l_Lean_Meta_Simp_Arith_isLinearTerm___closed__5 = _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__5();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearTerm___closed__5);
l_Lean_Meta_Simp_Arith_isLinearTerm___closed__6 = _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__6();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearTerm___closed__6);
l_Lean_Meta_Simp_Arith_isLinearTerm___closed__7 = _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__7();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearTerm___closed__7);
l_Lean_Meta_Simp_Arith_isLinearTerm___closed__8 = _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__8();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearTerm___closed__8);
l_Lean_Meta_Simp_Arith_isLinearTerm___closed__9 = _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__9();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearTerm___closed__9);
l_Lean_Meta_Simp_Arith_isLinearTerm___closed__10 = _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__10();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearTerm___closed__10);
l_Lean_Meta_Simp_Arith_isLinearTerm___closed__11 = _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__11();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearTerm___closed__11);
l_Lean_Meta_Simp_Arith_isLinearTerm___closed__12 = _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__12();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearTerm___closed__12);
l_Lean_Meta_Simp_Arith_isLinearTerm___closed__13 = _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__13();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearTerm___closed__13);
l_Lean_Meta_Simp_Arith_isLinearTerm___closed__14 = _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__14();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearTerm___closed__14);
l_Lean_Meta_Simp_Arith_isLinearTerm___closed__15 = _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__15();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearTerm___closed__15);
l_Lean_Meta_Simp_Arith_isLinearTerm___closed__16 = _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__16();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearTerm___closed__16);
l_Lean_Meta_Simp_Arith_isLinearTerm___closed__17 = _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__17();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearTerm___closed__17);
l_Lean_Meta_Simp_Arith_isLinearTerm___closed__18 = _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__18();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearTerm___closed__18);
l_Lean_Meta_Simp_Arith_isLinearTerm___closed__19 = _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__19();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearTerm___closed__19);
l_Lean_Meta_Simp_Arith_isLinearTerm___closed__20 = _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__20();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearTerm___closed__20);
l_Lean_Meta_Simp_Arith_isLinearTerm___closed__21 = _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__21();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearTerm___closed__21);
l_Lean_Meta_Simp_Arith_isLinearTerm___closed__22 = _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__22();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearTerm___closed__22);
l_Lean_Meta_Simp_Arith_isLinearTerm___closed__23 = _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__23();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearTerm___closed__23);
l_Lean_Meta_Simp_Arith_isLinearTerm___closed__24 = _init_l_Lean_Meta_Simp_Arith_isLinearTerm___closed__24();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearTerm___closed__24);
l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__1 = _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__1();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__1);
l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__2 = _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__2();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__2);
l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__3 = _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__3();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__3);
l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__4 = _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__4();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__4);
l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__5 = _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__5();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__5);
l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__6 = _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__6();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__6);
l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__7 = _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__7();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__7);
l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__8 = _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__8();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__8);
l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__9 = _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__9();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__9);
l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__10 = _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__10();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__10);
l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__11 = _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__11();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__11);
l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__12 = _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__12();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__12);
l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__13 = _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__13();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__13);
l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__14 = _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__14();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__14);
l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__15 = _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__15();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__15);
l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__16 = _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__16();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__16);
l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__17 = _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__17();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__17);
l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__18 = _init_l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__18();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isLinearCnstr___closed__18);
l_Lean_Meta_Simp_Arith_isDvdCnstr___closed__1 = _init_l_Lean_Meta_Simp_Arith_isDvdCnstr___closed__1();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isDvdCnstr___closed__1);
l_Lean_Meta_Simp_Arith_isDvdCnstr___closed__2 = _init_l_Lean_Meta_Simp_Arith_isDvdCnstr___closed__2();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isDvdCnstr___closed__2);
l_Lean_Meta_Simp_Arith_isDvdCnstr___closed__3 = _init_l_Lean_Meta_Simp_Arith_isDvdCnstr___closed__3();
lean_mark_persistent(l_Lean_Meta_Simp_Arith_isDvdCnstr___closed__3);
return lean_io_result_mk_ok(lean_box(0));
}
#ifdef __cplusplus
}
#endif
