2024-02-12 09:43:17 +03:00
|
|
|
2
|
|
|
|
3
|
|
|
|
4
|
|
|
|
5
|
|
|
|
2
|
|
|
|
4
|
|
|
|
Value *Main_insert
|
|
|
|
(
|
|
|
|
Value * var_0
|
|
|
|
, Value * var_1
|
|
|
|
, Value * var_2
|
|
|
|
);
|
|
|
|
Value *Main_insert
|
|
|
|
(
|
|
|
|
Value * var_0
|
|
|
|
, Value * var_1
|
|
|
|
, Value * var_2
|
|
|
|
)
|
|
|
|
{
|
2024-04-17 17:48:43 +03:00
|
|
|
Value * tmp_34 = NULL; // Main:6:24--6:31
|
2024-02-20 17:01:06 +03:00
|
|
|
if (((Value_Constructor *)var_2)->tag == 0 /* Main.Leaf */) {
|
2024-04-17 17:48:43 +03:00
|
|
|
Value_Constructor* constructor_35 = NULL;
|
2024-04-03 19:22:19 +03:00
|
|
|
if (idris2_isUnique(var_2)) {
|
2024-04-17 17:48:43 +03:00
|
|
|
constructor_35 = (Value_Constructor*)var_2;
|
2024-02-12 09:43:17 +03:00
|
|
|
}
|
|
|
|
else {
|
2024-04-03 19:22:19 +03:00
|
|
|
idris2_removeReference(var_2);
|
2024-02-12 09:43:17 +03:00
|
|
|
}
|
2024-04-03 19:22:19 +03:00
|
|
|
idris2_removeReference(var_0);
|
2024-02-20 17:01:06 +03:00
|
|
|
// constructor Main.Leaf // Main:7:22--7:26
|
2024-04-17 17:48:43 +03:00
|
|
|
if (! constructor_35) { // Main:7:22--7:26
|
|
|
|
constructor_35 = idris2_newConstructor(0, 0); // Main:7:22--7:26
|
2024-02-12 09:43:17 +03:00
|
|
|
} // Main:7:22--7:26
|
2024-04-17 17:48:43 +03:00
|
|
|
Value * var_3 = (Value*)constructor_35; // Main:7:17--7:21
|
2024-02-20 17:01:06 +03:00
|
|
|
// constructor Main.Leaf // Main:7:29--7:33
|
2024-04-17 17:48:43 +03:00
|
|
|
Value_Constructor* constructor_36 = idris2_newConstructor(0, 0);
|
2024-02-12 09:43:17 +03:00
|
|
|
// Main:7:29--7:33
|
2024-04-17 17:48:43 +03:00
|
|
|
Value * var_4 = (Value*)constructor_36; // Main:7:17--7:21
|
2024-02-20 17:01:06 +03:00
|
|
|
// constructor Main.Node // Main:7:17--7:21
|
2024-04-17 17:48:43 +03:00
|
|
|
Value_Constructor* constructor_37 = idris2_newConstructor(3, 1);
|
2024-02-12 09:43:17 +03:00
|
|
|
// Main:7:17--7:21
|
2024-04-17 17:48:43 +03:00
|
|
|
constructor_37->args[0] = var_3;
|
|
|
|
constructor_37->args[1] = var_1;
|
|
|
|
constructor_37->args[2] = var_4;
|
|
|
|
tmp_34 = (Value*)constructor_37;
|
2024-02-20 17:01:06 +03:00
|
|
|
} else if (((Value_Constructor *)var_2)->tag == 1 /* Main.Node */) {
|
2024-02-12 09:43:17 +03:00
|
|
|
Value *var_5 = ((Value_Constructor*)var_2)->args[0];
|
|
|
|
Value *var_6 = ((Value_Constructor*)var_2)->args[1];
|
|
|
|
Value *var_7 = ((Value_Constructor*)var_2)->args[2];
|
2024-04-17 17:48:43 +03:00
|
|
|
Value_Constructor* constructor_38 = NULL;
|
2024-04-03 19:22:19 +03:00
|
|
|
if (idris2_isUnique(var_2)) {
|
2024-04-17 17:48:43 +03:00
|
|
|
constructor_38 = (Value_Constructor*)var_2;
|
2024-02-12 09:43:17 +03:00
|
|
|
}
|
|
|
|
else {
|
2024-04-03 19:22:19 +03:00
|
|
|
idris2_newReference(var_5);
|
|
|
|
idris2_newReference(var_6);
|
|
|
|
idris2_newReference(var_7);
|
|
|
|
idris2_removeReference(var_2);
|
2024-02-12 09:43:17 +03:00
|
|
|
}
|
2024-04-17 17:48:43 +03:00
|
|
|
Value * tmp_39 = NULL; // Prelude.EqOrd:121:3--121:6
|
2024-02-20 17:01:06 +03:00
|
|
|
if (((Value_Constructor *)var_0)->tag == 0 /* Prelude.EqOrd.MkOrd */) {
|
2024-02-12 09:43:17 +03:00
|
|
|
Value *var_8 = ((Value_Constructor*)var_0)->args[0];
|
|
|
|
Value *var_9 = ((Value_Constructor*)var_0)->args[1];
|
|
|
|
Value *var_10 = ((Value_Constructor*)var_0)->args[2];
|
|
|
|
Value *var_11 = ((Value_Constructor*)var_0)->args[3];
|
|
|
|
Value *var_12 = ((Value_Constructor*)var_0)->args[4];
|
|
|
|
Value *var_13 = ((Value_Constructor*)var_0)->args[5];
|
|
|
|
Value *var_14 = ((Value_Constructor*)var_0)->args[6];
|
|
|
|
Value *var_15 = ((Value_Constructor*)var_0)->args[7];
|
2024-04-03 19:22:19 +03:00
|
|
|
idris2_newReference(var_10);
|
|
|
|
Value * var_16 = idris2_apply_closure(var_10, idris2_newReference(var_1));
|
2024-02-12 09:43:17 +03:00
|
|
|
// Prelude.EqOrd:121:3--121:6
|
2024-04-17 17:48:43 +03:00
|
|
|
tmp_39 = idris2_apply_closure(var_16, idris2_newReference(var_6));
|
2024-02-12 09:43:17 +03:00
|
|
|
}
|
2024-04-17 17:48:43 +03:00
|
|
|
Value * var_19 = tmp_39;
|
|
|
|
Value *tmp_40 = NULL;
|
|
|
|
int64_t tmp_41 = idris2_extractInt(var_19);
|
|
|
|
if (tmp_41 == UINT8_C(1)) {
|
2024-04-03 19:22:19 +03:00
|
|
|
idris2_removeReference(var_19);
|
2024-04-17 17:48:43 +03:00
|
|
|
Value * var_17 = idris2_trampoline(Main_insert(var_0, var_1, var_5));
|
|
|
|
// Main:8:42--8:46
|
2024-02-20 17:01:06 +03:00
|
|
|
// constructor Main.Node // Main:8:42--8:46
|
2024-04-17 17:48:43 +03:00
|
|
|
if (! constructor_38) { // Main:8:42--8:46
|
|
|
|
constructor_38 = idris2_newConstructor(3, 1);
|
2024-04-03 19:22:19 +03:00
|
|
|
// Main:8:42--8:46
|
2024-02-12 09:43:17 +03:00
|
|
|
} // Main:8:42--8:46
|
2024-04-17 17:48:43 +03:00
|
|
|
constructor_38->args[0] = var_17;
|
|
|
|
constructor_38->args[1] = var_6;
|
|
|
|
constructor_38->args[2] = var_7;
|
|
|
|
tmp_40 = (Value*)constructor_38;
|
|
|
|
} else if (tmp_41 == UINT8_C(0)) {
|
2024-04-03 19:22:19 +03:00
|
|
|
idris2_removeReference(var_19);
|
2024-04-17 17:48:43 +03:00
|
|
|
Value * var_18 = idris2_trampoline(Main_insert(var_0, var_1, var_7));
|
|
|
|
// Main:9:42--9:46
|
2024-02-20 17:01:06 +03:00
|
|
|
// constructor Main.Node // Main:9:42--9:46
|
2024-04-17 17:48:43 +03:00
|
|
|
if (! constructor_38) { // Main:9:42--9:46
|
|
|
|
constructor_38 = idris2_newConstructor(3, 1);
|
2024-04-03 19:22:19 +03:00
|
|
|
// Main:9:42--9:46
|
2024-02-12 09:43:17 +03:00
|
|
|
} // Main:9:42--9:46
|
2024-04-17 17:48:43 +03:00
|
|
|
constructor_38->args[0] = var_5;
|
|
|
|
constructor_38->args[1] = var_6;
|
|
|
|
constructor_38->args[2] = var_18;
|
|
|
|
tmp_40 = (Value*)constructor_38;
|
2024-02-12 09:43:17 +03:00
|
|
|
}
|
2024-04-17 17:48:43 +03:00
|
|
|
tmp_34 = tmp_40;
|
2024-02-12 09:43:17 +03:00
|
|
|
}
|
2024-04-17 17:48:43 +03:00
|
|
|
return tmp_34;
|
2024-02-12 09:43:17 +03:00
|
|
|
}
|