1// Lean compiler output
2// Module: Leanc
3// Imports: Init Lean.Compiler.FFI
4#include <lean/lean.h>
5#if defined(__clang__)
6#pragma clang diagnostic ignored "-Wunused-parameter"
7#pragma clang diagnostic ignored "-Wunused-label"
8#elif defined(__GNUC__) && !defined(__CLANG__)
9#pragma GCC diagnostic ignored "-Wunused-parameter"
10#pragma GCC diagnostic ignored "-Wunused-label"
11#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
12#endif
13#ifdef __cplusplus
14extern "C" {
15#endif
16LEAN_EXPORT lean_object* l_main___lambda__4(lean_object*, lean_object*, lean_object*);
17lean_object* lean_mk_empty_array_with_capacity(lean_object*);
18LEAN_EXPORT lean_object* _lean_main(lean_object*, lean_object*);
19lean_object* l_Lean_Compiler_FFI_getLinkerFlags(lean_object*, uint8_t);
20LEAN_EXPORT lean_object* l_Array_anyMUnsafe_any___at_main___spec__7___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
21LEAN_EXPORT lean_object* l_panic___at_main___spec__9(lean_object*);
22static lean_object* l_main___lambda__4___closed__3;
23LEAN_EXPORT lean_object* l_main___boxed__const__1;
24lean_object* lean_array_push(lean_object*, lean_object*);
25static lean_object* l_main___lambda__1___closed__1;
26uint8_t lean_usize_dec_eq(size_t, size_t);
27LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_main___spec__5___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
28LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_main___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
29lean_object* l_String_trim(lean_object*);
30static lean_object* l_main___lambda__5___closed__2;
31LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_main___spec__5(lean_object*, size_t, size_t, lean_object*);
32static lean_object* l_Array_mapMUnsafe_map___at_main___spec__2___closed__1;
33static lean_object* l_main___lambda__5___closed__4;
34lean_object* lean_io_getenv(lean_object*, lean_object*);
35LEAN_EXPORT uint8_t l_Array_contains___at_main___spec__6(lean_object*, lean_object*);
36uint8_t lean_string_dec_eq(lean_object*, lean_object*);
37static lean_object* l_main___lambda__2___closed__4;
38static lean_object* l_main___lambda__5___closed__1;
39LEAN_EXPORT lean_object* l_Array_foldlMUnsafe_fold___at_main___spec__8(lean_object*, size_t, size_t, lean_object*);
40lean_object* lean_io_process_child_wait(lean_object*, lean_object*, lean_object*);
41LEAN_EXPORT lean_object* l_Array_contains___at_main___spec__6___boxed(lean_object*, lean_object*);
42lean_object* l_IO_println___at_Lean_instEval___spec__1(lean_object*, lean_object*);
43size_t lean_usize_of_nat(lean_object*);
44uint8_t l_String_isEmpty(lean_object*);
45LEAN_EXPORT lean_object* l_List_forIn_loop___at_main___spec__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
46LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_main___spec__3(lean_object*, size_t, size_t, lean_object*);
47LEAN_EXPORT lean_object* l_main___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
48lean_object* l_IO_eprintln___at___private_Init_System_IO_0__IO_eprintlnAux___spec__1(lean_object*, lean_object*);
49static lean_object* l_main___lambda__4___closed__2;
50static lean_object* l_List_forIn_loop___at_main___spec__4___closed__3;
51LEAN_EXPORT lean_object* l_main___lambda__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
52static lean_object* l_main___closed__1;
53static lean_object* l_main___lambda__2___closed__1;
54uint8_t l_List_isEmpty___rarg(lean_object*);
55lean_object* lean_array_to_list(lean_object*, lean_object*);
56LEAN_EXPORT lean_object* l_main___lambda__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
57lean_object* l_IO_appDir(lean_object*);
58lean_object* lean_io_process_spawn(lean_object*, lean_object*);
59static lean_object* l_main___lambda__3___closed__2;
60static lean_object* l_main___lambda__3___closed__1;
61lean_object* l_System_FilePath_parent(lean_object*);
62LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_main___spec__2(lean_object*, size_t, size_t, lean_object*);
63LEAN_EXPORT lean_object* l_main___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
64LEAN_EXPORT lean_object* l_List_forIn_loop___at_main___spec__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
65lean_object* l___private_Init_Util_0__mkPanicMessageWithDecl(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
66LEAN_EXPORT uint8_t l_Array_anyMUnsafe_any___at_main___spec__7(lean_object*, lean_object*, size_t, size_t);
67LEAN_EXPORT lean_object* l_List_forIn_loop___at_main___spec__4___closed__4___boxed__const__1;
68static lean_object* l_main___lambda__4___closed__4;
69lean_object* l_String_replace_loop(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
70LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_main___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
71lean_object* l_Array_append___rarg(lean_object*, lean_object*);
72LEAN_EXPORT lean_object* l_Array_foldlMUnsafe_fold___at_main___spec__8___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
73LEAN_EXPORT lean_object* l_List_elem___at_main___spec__1___boxed(lean_object*, lean_object*);
74static lean_object* l_Array_mapMUnsafe_map___at_main___spec__2___closed__2;
75static lean_object* l_main___lambda__5___closed__5;
76static lean_object* l_main___lambda__2___closed__2;
77static lean_object* l_List_forIn_loop___at_main___spec__4___closed__4;
78static lean_object* l_List_forIn_loop___at_main___spec__4___closed__1;
79uint8_t lean_nat_dec_lt(lean_object*, lean_object*);
80static lean_object* l_main___lambda__4___closed__1;
81LEAN_EXPORT uint8_t l_List_elem___at_main___spec__1(lean_object*, lean_object*);
82extern lean_object* l_System_instInhabitedFilePath;
83lean_object* lean_panic_fn(lean_object*, lean_object*);
84LEAN_EXPORT lean_object* l_main___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
85static lean_object* l_main___lambda__2___closed__3;
86LEAN_EXPORT lean_object* l_main___lambda__5(lean_object*, lean_object*, lean_object*);
87lean_object* l_List_foldl___at_Array_appendList___spec__1___rarg(lean_object*, lean_object*);
88lean_object* l_Lean_Compiler_FFI_getCFlags(lean_object*);
89lean_object* l_String_intercalate(lean_object*, lean_object*);
90size_t lean_usize_add(size_t, size_t);
91lean_object* lean_array_uget(lean_object*, size_t);
92static lean_object* l_List_forIn_loop___at_main___spec__4___closed__2;
93lean_object* lean_string_append(lean_object*, lean_object*);
94lean_object* lean_array_get_size(lean_object*);
95static lean_object* l_List_forIn_loop___at_main___spec__4___closed__5;
96uint8_t lean_nat_dec_le(lean_object*, lean_object*);
97static lean_object* l_main___lambda__5___closed__3;
98uint8_t lean_usize_dec_lt(size_t, size_t);
99lean_object* lean_array_uset(lean_object*, size_t, lean_object*);
100lean_object* l_String_splitOn(lean_object*, lean_object*);
101LEAN_EXPORT uint8_t l_List_elem___at_main___spec__1(lean_object* x_1, lean_object* x_2) {
102_start:
103{
104if (lean_obj_tag(x_2) == 0)
105{
106uint8_t x_3;
107x_3 = 0;
108return x_3;
109}
110else
111{
112lean_object* x_4; lean_object* x_5; uint8_t x_6;
113x_4 = lean_ctor_get(x_2, 0);
114x_5 = lean_ctor_get(x_2, 1);
115x_6 = lean_string_dec_eq(x_1, x_4);
116if (x_6 == 0)
117{
118x_2 = x_5;
119goto _start;
120}
121else
122{
123uint8_t x_8;
124x_8 = 1;
125return x_8;
126}
127}
128}
129}
130static lean_object* _init_l_Array_mapMUnsafe_map___at_main___spec__2___closed__1() {
131_start:
132{
133lean_object* x_1;
134x_1 = lean_mk_string_from_bytes("ROOT", 4);
135return x_1;
136}
137}
138static lean_object* _init_l_Array_mapMUnsafe_map___at_main___spec__2___closed__2() {
139_start:
140{
141lean_object* x_1;
142x_1 = lean_mk_string_from_bytes("", 0);
143return x_1;
144}
145}
146LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_main___spec__2(lean_object* x_1, size_t x_2, size_t x_3, lean_object* x_4) {
147_start:
148{
149uint8_t x_5;
150x_5 = lean_usize_dec_lt(x_3, x_2);
151if (x_5 == 0)
152{
153return x_4;
154}
155else
156{
157lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; size_t x_12; size_t x_13; lean_object* x_14;
158x_6 = lean_array_uget(x_4, x_3);
159x_7 = lean_unsigned_to_nat(0u);
160x_8 = lean_array_uset(x_4, x_3, x_7);
161x_9 = l_Array_mapMUnsafe_map___at_main___spec__2___closed__1;
162x_10 = l_Array_mapMUnsafe_map___at_main___spec__2___closed__2;
163x_11 = l_String_replace_loop(x_6, x_9, x_1, x_10, x_7, x_7);
164lean_dec(x_6);
165x_12 = 1;
166x_13 = lean_usize_add(x_3, x_12);
167x_14 = lean_array_uset(x_8, x_3, x_11);
168x_3 = x_13;
169x_4 = x_14;
170goto _start;
171}
172}
173}
174LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_main___spec__3(lean_object* x_1, size_t x_2, size_t x_3, lean_object* x_4) {
175_start:
176{
177uint8_t x_5;
178x_5 = lean_usize_dec_lt(x_3, x_2);
179if (x_5 == 0)
180{
181return x_4;
182}
183else
184{
185lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; size_t x_12; size_t x_13; lean_object* x_14;
186x_6 = lean_array_uget(x_4, x_3);
187x_7 = lean_unsigned_to_nat(0u);
188x_8 = lean_array_uset(x_4, x_3, x_7);
189x_9 = l_Array_mapMUnsafe_map___at_main___spec__2___closed__1;
190x_10 = l_Array_mapMUnsafe_map___at_main___spec__2___closed__2;
191x_11 = l_String_replace_loop(x_6, x_9, x_1, x_10, x_7, x_7);
192lean_dec(x_6);
193x_12 = 1;
194x_13 = lean_usize_add(x_3, x_12);
195x_14 = lean_array_uset(x_8, x_3, x_11);
196x_3 = x_13;
197x_4 = x_14;
198goto _start;
199}
200}
201}
202static lean_object* _init_l_List_forIn_loop___at_main___spec__4___closed__1() {
203_start:
204{
205lean_object* x_1;
206x_1 = lean_mk_string_from_bytes("--print-cflags", 14);
207return x_1;
208}
209}
210static lean_object* _init_l_List_forIn_loop___at_main___spec__4___closed__2() {
211_start:
212{
213lean_object* x_1;
214x_1 = lean_mk_string_from_bytes("--print-ldflags", 15);
215return x_1;
216}
217}
218static lean_object* _init_l_List_forIn_loop___at_main___spec__4___closed__3() {
219_start:
220{
221lean_object* x_1;
222x_1 = lean_mk_string_from_bytes(" ", 1);
223return x_1;
224}
225}
226static lean_object* _init_l_List_forIn_loop___at_main___spec__4___closed__4___boxed__const__1() {
227_start:
228{
229uint32_t x_1; lean_object* x_2;
230x_1 = 0;
231x_2 = lean_box_uint32(x_1);
232return x_2;
233}
234}
235static lean_object* _init_l_List_forIn_loop___at_main___spec__4___closed__4() {
236_start:
237{
238lean_object* x_1; lean_object* x_2;
239x_1 = l_List_forIn_loop___at_main___spec__4___closed__4___boxed__const__1;
240x_2 = lean_alloc_ctor(1, 1, 0);
241lean_ctor_set(x_2, 0, x_1);
242return x_2;
243}
244}
245static lean_object* _init_l_List_forIn_loop___at_main___spec__4___closed__5() {
246_start:
247{
248lean_object* x_1; lean_object* x_2; lean_object* x_3;
249x_1 = l_List_forIn_loop___at_main___spec__4___closed__4;
250x_2 = lean_box(0);
251x_3 = lean_alloc_ctor(0, 2, 0);
252lean_ctor_set(x_3, 0, x_1);
253lean_ctor_set(x_3, 1, x_2);
254return x_3;
255}
256}
257LEAN_EXPORT lean_object* l_List_forIn_loop___at_main___spec__4(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) {
258_start:
259{
260if (lean_obj_tag(x_5) == 0)
261{
262lean_object* x_8;
263lean_dec(x_4);
264lean_dec(x_3);
265lean_dec(x_2);
266x_8 = lean_alloc_ctor(0, 2, 0);
267lean_ctor_set(x_8, 0, x_6);
268lean_ctor_set(x_8, 1, x_7);
269return x_8;
270}
271else
272{
273lean_object* x_9; lean_object* x_10; lean_object* x_11; uint8_t x_12;
274lean_dec(x_6);
275x_9 = lean_ctor_get(x_5, 0);
276x_10 = lean_ctor_get(x_5, 1);
277x_11 = l_List_forIn_loop___at_main___spec__4___closed__1;
278x_12 = lean_string_dec_eq(x_9, x_11);
279if (x_12 == 0)
280{
281lean_object* x_13; uint8_t x_14;
282x_13 = l_List_forIn_loop___at_main___spec__4___closed__2;
283x_14 = lean_string_dec_eq(x_9, x_13);
284if (x_14 == 0)
285{
286lean_inc(x_3);
287{
288lean_object* _tmp_4 = x_10;
289lean_object* _tmp_5 = x_3;
290x_5 = _tmp_4;
291x_6 = _tmp_5;
292}
293goto _start;
294}
295else
296{
297lean_object* x_16; lean_object* x_17; size_t x_18; size_t x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24;
298lean_dec(x_3);
299x_16 = l_Array_append___rarg(x_2, x_4);
300x_17 = lean_array_get_size(x_16);
301x_18 = lean_usize_of_nat(x_17);
302lean_dec(x_17);
303x_19 = 0;
304x_20 = l_Array_mapMUnsafe_map___at_main___spec__2(x_1, x_18, x_19, x_16);
305x_21 = lean_array_to_list(lean_box(0), x_20);
306x_22 = l_List_forIn_loop___at_main___spec__4___closed__3;
307x_23 = l_String_intercalate(x_22, x_21);
308x_24 = l_IO_println___at_Lean_instEval___spec__1(x_23, x_7);
309if (lean_obj_tag(x_24) == 0)
310{
311uint8_t x_25;
312x_25 = !lean_is_exclusive(x_24);
313if (x_25 == 0)
314{
315lean_object* x_26; lean_object* x_27;
316x_26 = lean_ctor_get(x_24, 0);
317lean_dec(x_26);
318x_27 = l_List_forIn_loop___at_main___spec__4___closed__5;
319lean_ctor_set(x_24, 0, x_27);
320return x_24;
321}
322else
323{
324lean_object* x_28; lean_object* x_29; lean_object* x_30;
325x_28 = lean_ctor_get(x_24, 1);
326lean_inc(x_28);
327lean_dec(x_24);
328x_29 = l_List_forIn_loop___at_main___spec__4___closed__5;
329x_30 = lean_alloc_ctor(0, 2, 0);
330lean_ctor_set(x_30, 0, x_29);
331lean_ctor_set(x_30, 1, x_28);
332return x_30;
333}
334}
335else
336{
337uint8_t x_31;
338x_31 = !lean_is_exclusive(x_24);
339if (x_31 == 0)
340{
341return x_24;
342}
343else
344{
345lean_object* x_32; lean_object* x_33; lean_object* x_34;
346x_32 = lean_ctor_get(x_24, 0);
347x_33 = lean_ctor_get(x_24, 1);
348lean_inc(x_33);
349lean_inc(x_32);
350lean_dec(x_24);
351x_34 = lean_alloc_ctor(1, 2, 0);
352lean_ctor_set(x_34, 0, x_32);
353lean_ctor_set(x_34, 1, x_33);
354return x_34;
355}
356}
357}
358}
359else
360{
361lean_object* x_35; size_t x_36; size_t x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42;
362lean_dec(x_4);
363lean_dec(x_3);
364x_35 = lean_array_get_size(x_2);
365x_36 = lean_usize_of_nat(x_35);
366lean_dec(x_35);
367x_37 = 0;
368x_38 = l_Array_mapMUnsafe_map___at_main___spec__3(x_1, x_36, x_37, x_2);
369x_39 = lean_array_to_list(lean_box(0), x_38);
370x_40 = l_List_forIn_loop___at_main___spec__4___closed__3;
371x_41 = l_String_intercalate(x_40, x_39);
372x_42 = l_IO_println___at_Lean_instEval___spec__1(x_41, x_7);
373if (lean_obj_tag(x_42) == 0)
374{
375uint8_t x_43;
376x_43 = !lean_is_exclusive(x_42);
377if (x_43 == 0)
378{
379lean_object* x_44; lean_object* x_45;
380x_44 = lean_ctor_get(x_42, 0);
381lean_dec(x_44);
382x_45 = l_List_forIn_loop___at_main___spec__4___closed__5;
383lean_ctor_set(x_42, 0, x_45);
384return x_42;
385}
386else
387{
388lean_object* x_46; lean_object* x_47; lean_object* x_48;
389x_46 = lean_ctor_get(x_42, 1);
390lean_inc(x_46);
391lean_dec(x_42);
392x_47 = l_List_forIn_loop___at_main___spec__4___closed__5;
393x_48 = lean_alloc_ctor(0, 2, 0);
394lean_ctor_set(x_48, 0, x_47);
395lean_ctor_set(x_48, 1, x_46);
396return x_48;
397}
398}
399else
400{
401uint8_t x_49;
402x_49 = !lean_is_exclusive(x_42);
403if (x_49 == 0)
404{
405return x_42;
406}
407else
408{
409lean_object* x_50; lean_object* x_51; lean_object* x_52;
410x_50 = lean_ctor_get(x_42, 0);
411x_51 = lean_ctor_get(x_42, 1);
412lean_inc(x_51);
413lean_inc(x_50);
414lean_dec(x_42);
415x_52 = lean_alloc_ctor(1, 2, 0);
416lean_ctor_set(x_52, 0, x_50);
417lean_ctor_set(x_52, 1, x_51);
418return x_52;
419}
420}
421}
422}
423}
424}
425LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_main___spec__5(lean_object* x_1, size_t x_2, size_t x_3, lean_object* x_4) {
426_start:
427{
428uint8_t x_5;
429x_5 = lean_usize_dec_lt(x_3, x_2);
430if (x_5 == 0)
431{
432return x_4;
433}
434else
435{
436lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; size_t x_12; size_t x_13; lean_object* x_14;
437x_6 = lean_array_uget(x_4, x_3);
438x_7 = lean_unsigned_to_nat(0u);
439x_8 = lean_array_uset(x_4, x_3, x_7);
440x_9 = l_Array_mapMUnsafe_map___at_main___spec__2___closed__1;
441x_10 = l_Array_mapMUnsafe_map___at_main___spec__2___closed__2;
442x_11 = l_String_replace_loop(x_6, x_9, x_1, x_10, x_7, x_7);
443lean_dec(x_6);
444x_12 = 1;
445x_13 = lean_usize_add(x_3, x_12);
446x_14 = lean_array_uset(x_8, x_3, x_11);
447x_3 = x_13;
448x_4 = x_14;
449goto _start;
450}
451}
452}
453LEAN_EXPORT uint8_t l_Array_anyMUnsafe_any___at_main___spec__7(lean_object* x_1, lean_object* x_2, size_t x_3, size_t x_4) {
454_start:
455{
456uint8_t x_5;
457x_5 = lean_usize_dec_eq(x_3, x_4);
458if (x_5 == 0)
459{
460lean_object* x_6; uint8_t x_7;
461x_6 = lean_array_uget(x_2, x_3);
462x_7 = lean_string_dec_eq(x_1, x_6);
463lean_dec(x_6);
464if (x_7 == 0)
465{
466size_t x_8; size_t x_9;
467x_8 = 1;
468x_9 = lean_usize_add(x_3, x_8);
469x_3 = x_9;
470goto _start;
471}
472else
473{
474uint8_t x_11;
475x_11 = 1;
476return x_11;
477}
478}
479else
480{
481uint8_t x_12;
482x_12 = 0;
483return x_12;
484}
485}
486}
487LEAN_EXPORT uint8_t l_Array_contains___at_main___spec__6(lean_object* x_1, lean_object* x_2) {
488_start:
489{
490lean_object* x_3; lean_object* x_4; uint8_t x_5;
491x_3 = lean_array_get_size(x_1);
492x_4 = lean_unsigned_to_nat(0u);
493x_5 = lean_nat_dec_lt(x_4, x_3);
494if (x_5 == 0)
495{
496uint8_t x_6;
497lean_dec(x_3);
498x_6 = 0;
499return x_6;
500}
501else
502{
503uint8_t x_7;
504x_7 = lean_nat_dec_le(x_3, x_3);
505if (x_7 == 0)
506{
507uint8_t x_8;
508lean_dec(x_3);
509x_8 = 0;
510return x_8;
511}
512else
513{
514size_t x_9; size_t x_10; uint8_t x_11;
515x_9 = 0;
516x_10 = lean_usize_of_nat(x_3);
517lean_dec(x_3);
518x_11 = l_Array_anyMUnsafe_any___at_main___spec__7(x_2, x_1, x_9, x_10);
519return x_11;
520}
521}
522}
523}
524LEAN_EXPORT lean_object* l_Array_foldlMUnsafe_fold___at_main___spec__8(lean_object* x_1, size_t x_2, size_t x_3, lean_object* x_4) {
525_start:
526{
527uint8_t x_5;
528x_5 = lean_usize_dec_eq(x_2, x_3);
529if (x_5 == 0)
530{
531lean_object* x_6; uint8_t x_7; size_t x_8; size_t x_9;
532x_6 = lean_array_uget(x_1, x_2);
533x_7 = l_String_isEmpty(x_6);
534x_8 = 1;
535x_9 = lean_usize_add(x_2, x_8);
536if (x_7 == 0)
537{
538lean_object* x_10;
539x_10 = lean_array_push(x_4, x_6);
540x_2 = x_9;
541x_4 = x_10;
542goto _start;
543}
544else
545{
546lean_dec(x_6);
547x_2 = x_9;
548goto _start;
549}
550}
551else
552{
553return x_4;
554}
555}
556}
557LEAN_EXPORT lean_object* l_panic___at_main___spec__9(lean_object* x_1) {
558_start:
559{
560lean_object* x_2; lean_object* x_3;
561x_2 = l_System_instInhabitedFilePath;
562x_3 = lean_panic_fn(x_2, x_1);
563return x_3;
564}
565}
566static lean_object* _init_l_main___lambda__1___closed__1() {
567_start:
568{
569uint8_t x_1; lean_object* x_2;
570x_1 = 1;
571x_2 = lean_alloc_ctor(0, 0, 3);
572lean_ctor_set_uint8(x_2, 0, x_1);
573lean_ctor_set_uint8(x_2, 1, x_1);
574lean_ctor_set_uint8(x_2, 2, x_1);
575return x_2;
576}
577}
578LEAN_EXPORT lean_object* l_main___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) {
579_start:
580{
581lean_object* x_7; lean_object* x_8; lean_object* x_9;
582x_7 = l_main___lambda__1___closed__1;
583x_8 = lean_alloc_ctor(0, 5, 0);
584lean_ctor_set(x_8, 0, x_7);
585lean_ctor_set(x_8, 1, x_1);
586lean_ctor_set(x_8, 2, x_2);
587lean_ctor_set(x_8, 3, x_3);
588lean_ctor_set(x_8, 4, x_4);
589x_9 = lean_io_process_spawn(x_8, x_6);
590if (lean_obj_tag(x_9) == 0)
591{
592lean_object* x_10; lean_object* x_11; lean_object* x_12;
593x_10 = lean_ctor_get(x_9, 0);
594lean_inc(x_10);
595x_11 = lean_ctor_get(x_9, 1);
596lean_inc(x_11);
597lean_dec(x_9);
598x_12 = lean_io_process_child_wait(x_7, x_10, x_11);
599lean_dec(x_10);
600return x_12;
601}
602else
603{
604uint8_t x_13;
605x_13 = !lean_is_exclusive(x_9);
606if (x_13 == 0)
607{
608return x_9;
609}
610else
611{
612lean_object* x_14; lean_object* x_15; lean_object* x_16;
613x_14 = lean_ctor_get(x_9, 0);
614x_15 = lean_ctor_get(x_9, 1);
615lean_inc(x_15);
616lean_inc(x_14);
617lean_dec(x_9);
618x_16 = lean_alloc_ctor(1, 2, 0);
619lean_ctor_set(x_16, 0, x_14);
620lean_ctor_set(x_16, 1, x_15);
621return x_16;
622}
623}
624}
625}
626static lean_object* _init_l_main___lambda__2___closed__1() {
627_start:
628{
629lean_object* x_1;
630x_1 = lean_mk_string_from_bytes("-Wno-unused-command-line-argument", 33);
631return x_1;
632}
633}
634static lean_object* _init_l_main___lambda__2___closed__2() {
635_start:
636{
637lean_object* x_1; lean_object* x_2; lean_object* x_3;
638x_1 = lean_box(0);
639x_2 = l_main___lambda__2___closed__1;
640x_3 = lean_alloc_ctor(1, 2, 0);
641lean_ctor_set(x_3, 0, x_2);
642lean_ctor_set(x_3, 1, x_1);
643return x_3;
644}
645}
646static lean_object* _init_l_main___lambda__2___closed__3() {
647_start:
648{
649lean_object* x_1; lean_object* x_2;
650x_1 = lean_unsigned_to_nat(0u);
651x_2 = lean_mk_empty_array_with_capacity(x_1);
652return x_2;
653}
654}
655static lean_object* _init_l_main___lambda__2___closed__4() {
656_start:
657{
658lean_object* x_1;
659x_1 = lean_mk_string_from_bytes("-v", 2);
660return x_1;
661}
662}
663LEAN_EXPORT lean_object* l_main___lambda__2(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) {
664_start:
665{
666lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; uint8_t x_22; size_t x_23; lean_object* x_24;
667x_11 = l_Array_mapMUnsafe_map___at_main___spec__2___closed__1;
668x_12 = l_Array_mapMUnsafe_map___at_main___spec__2___closed__2;
669x_13 = lean_unsigned_to_nat(0u);
670x_14 = l_String_replace_loop(x_6, x_11, x_1, x_12, x_13, x_13);
671lean_dec(x_6);
672x_15 = l_List_foldl___at_Array_appendList___spec__1___rarg(x_2, x_7);
673x_16 = l_List_foldl___at_Array_appendList___spec__1___rarg(x_15, x_3);
674x_17 = l_List_foldl___at_Array_appendList___spec__1___rarg(x_16, x_8);
675x_18 = l_Array_append___rarg(x_17, x_4);
676x_19 = l_main___lambda__2___closed__2;
677x_20 = l_List_foldl___at_Array_appendList___spec__1___rarg(x_18, x_19);
678x_21 = lean_array_get_size(x_20);
679x_22 = lean_nat_dec_lt(x_13, x_21);
680x_23 = 0;
681if (x_22 == 0)
682{
683lean_object* x_50;
684lean_dec(x_21);
685lean_dec(x_20);
686x_50 = l_main___lambda__2___closed__3;
687x_24 = x_50;
688goto block_49;
689}
690else
691{
692uint8_t x_51;
693x_51 = lean_nat_dec_le(x_21, x_21);
694if (x_51 == 0)
695{
696lean_object* x_52;
697lean_dec(x_21);
698lean_dec(x_20);
699x_52 = l_main___lambda__2___closed__3;
700x_24 = x_52;
701goto block_49;
702}
703else
704{
705size_t x_53; lean_object* x_54; lean_object* x_55;
706x_53 = lean_usize_of_nat(x_21);
707lean_dec(x_21);
708x_54 = l_main___lambda__2___closed__3;
709x_55 = l_Array_foldlMUnsafe_fold___at_main___spec__8(x_20, x_23, x_53, x_54);
710lean_dec(x_20);
711x_24 = x_55;
712goto block_49;
713}
714}
715block_49:
716{
717lean_object* x_25; size_t x_26; lean_object* x_27; lean_object* x_28; uint8_t x_29;
718x_25 = lean_array_get_size(x_24);
719x_26 = lean_usize_of_nat(x_25);
720lean_dec(x_25);
721x_27 = l_Array_mapMUnsafe_map___at_main___spec__5(x_1, x_26, x_23, x_24);
722lean_dec(x_1);
723x_28 = l_main___lambda__2___closed__4;
724x_29 = l_Array_contains___at_main___spec__6(x_27, x_28);
725if (x_29 == 0)
726{
727lean_object* x_30; lean_object* x_31; lean_object* x_32;
728x_30 = l_main___lambda__2___closed__3;
729x_31 = lean_box(0);
730x_32 = l_main___lambda__1(x_14, x_27, x_5, x_30, x_31, x_10);
731return x_32;
732}
733else
734{
735lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40;
736x_33 = lean_string_append(x_12, x_14);
737x_34 = l_List_forIn_loop___at_main___spec__4___closed__3;
738x_35 = lean_string_append(x_33, x_34);
739lean_inc(x_27);
740x_36 = lean_array_to_list(lean_box(0), x_27);
741x_37 = l_String_intercalate(x_34, x_36);
742x_38 = lean_string_append(x_35, x_37);
743lean_dec(x_37);
744x_39 = lean_string_append(x_38, x_12);
745x_40 = l_IO_eprintln___at___private_Init_System_IO_0__IO_eprintlnAux___spec__1(x_39, x_10);
746if (lean_obj_tag(x_40) == 0)
747{
748lean_object* x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44;
749x_41 = lean_ctor_get(x_40, 0);
750lean_inc(x_41);
751x_42 = lean_ctor_get(x_40, 1);
752lean_inc(x_42);
753lean_dec(x_40);
754x_43 = l_main___lambda__2___closed__3;
755x_44 = l_main___lambda__1(x_14, x_27, x_5, x_43, x_41, x_42);
756lean_dec(x_41);
757return x_44;
758}
759else
760{
761uint8_t x_45;
762lean_dec(x_27);
763lean_dec(x_14);
764lean_dec(x_5);
765x_45 = !lean_is_exclusive(x_40);
766if (x_45 == 0)
767{
768return x_40;
769}
770else
771{
772lean_object* x_46; lean_object* x_47; lean_object* x_48;
773x_46 = lean_ctor_get(x_40, 0);
774x_47 = lean_ctor_get(x_40, 1);
775lean_inc(x_47);
776lean_inc(x_46);
777lean_dec(x_40);
778x_48 = lean_alloc_ctor(1, 2, 0);
779lean_ctor_set(x_48, 0, x_46);
780lean_ctor_set(x_48, 1, x_47);
781return x_48;
782}
783}
784}
785}
786}
787}
788static lean_object* _init_l_main___lambda__3___closed__1() {
789_start:
790{
791lean_object* x_1;
792x_1 = lean_mk_string_from_bytes("LEAN_CC", 7);
793return x_1;
794}
795}
796static lean_object* _init_l_main___lambda__3___closed__2() {
797_start:
798{
799lean_object* x_1;
800x_1 = lean_mk_string_from_bytes("cc", 2);
801return x_1;
802}
803}
804LEAN_EXPORT lean_object* l_main___lambda__3(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) {
805_start:
806{
807lean_object* x_10; lean_object* x_11; lean_object* x_12;
808lean_dec(x_8);
809x_10 = l_main___lambda__3___closed__1;
810x_11 = lean_io_getenv(x_10, x_9);
811x_12 = lean_ctor_get(x_11, 0);
812lean_inc(x_12);
813if (lean_obj_tag(x_12) == 0)
814{
815lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16;
816x_13 = lean_ctor_get(x_11, 1);
817lean_inc(x_13);
818lean_dec(x_11);
819x_14 = l_main___lambda__3___closed__2;
820x_15 = lean_box(0);
821x_16 = l_main___lambda__2(x_1, x_2, x_3, x_4, x_5, x_14, x_6, x_7, x_15, x_13);
822return x_16;
823}
824else
825{
826lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21;
827lean_dec(x_7);
828lean_dec(x_6);
829x_17 = lean_ctor_get(x_11, 1);
830lean_inc(x_17);
831lean_dec(x_11);
832x_18 = lean_ctor_get(x_12, 0);
833lean_inc(x_18);
834lean_dec(x_12);
835x_19 = lean_box(0);
836x_20 = lean_box(0);
837x_21 = l_main___lambda__2(x_1, x_2, x_3, x_4, x_5, x_18, x_19, x_19, x_20, x_17);
838return x_21;
839}
840}
841}
842static lean_object* _init_l_main___lambda__4___closed__1() {
843_start:
844{
845lean_object* x_1;
846x_1 = lean_mk_string_from_bytes("-shared", 7);
847return x_1;
848}
849}
850static lean_object* _init_l_main___lambda__4___closed__2() {
851_start:
852{
853lean_object* x_1; lean_object* x_2;
854x_1 = l_Array_mapMUnsafe_map___at_main___spec__2___closed__2;
855x_2 = l_String_trim(x_1);
856return x_2;
857}
858}
859static lean_object* _init_l_main___lambda__4___closed__3() {
860_start:
861{
862lean_object* x_1; lean_object* x_2; lean_object* x_3;
863x_1 = l_main___lambda__4___closed__2;
864x_2 = l_List_forIn_loop___at_main___spec__4___closed__3;
865x_3 = l_String_splitOn(x_1, x_2);
866return x_3;
867}
868}
869static lean_object* _init_l_main___lambda__4___closed__4() {
870_start:
871{
872lean_object* x_1; lean_object* x_2; lean_object* x_3;
873x_1 = lean_box(0);
874x_2 = lean_box(0);
875x_3 = lean_alloc_ctor(0, 2, 0);
876lean_ctor_set(x_3, 0, x_1);
877lean_ctor_set(x_3, 1, x_2);
878return x_3;
879}
880}
881LEAN_EXPORT lean_object* l_main___lambda__4(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
882_start:
883{
884lean_object* x_4; uint8_t x_5; lean_object* x_6; lean_object* x_7; uint8_t x_8;
885x_4 = l_main___lambda__4___closed__1;
886x_5 = l_List_elem___at_main___spec__1(x_4, x_1);
887lean_inc(x_2);
888x_6 = l_Lean_Compiler_FFI_getCFlags(x_2);
889x_7 = lean_box(0);
890if (x_5 == 0)
891{
892uint8_t x_29;
893x_29 = 1;
894x_8 = x_29;
895goto block_28;
896}
897else
898{
899uint8_t x_30;
900x_30 = 0;
901x_8 = x_30;
902goto block_28;
903}
904block_28:
905{
906lean_object* x_9; lean_object* x_10; lean_object* x_11;
907lean_inc(x_2);
908x_9 = l_Lean_Compiler_FFI_getLinkerFlags(x_2, x_8);
909x_10 = l_main___lambda__4___closed__4;
910lean_inc(x_9);
911lean_inc(x_6);
912x_11 = l_List_forIn_loop___at_main___spec__4(x_2, x_6, x_10, x_9, x_1, x_10, x_3);
913if (lean_obj_tag(x_11) == 0)
914{
915lean_object* x_12; lean_object* x_13;
916x_12 = lean_ctor_get(x_11, 0);
917lean_inc(x_12);
918x_13 = lean_ctor_get(x_12, 0);
919lean_inc(x_13);
920lean_dec(x_12);
921if (lean_obj_tag(x_13) == 0)
922{
923lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17;
924x_14 = lean_ctor_get(x_11, 1);
925lean_inc(x_14);
926lean_dec(x_11);
927x_15 = l_main___lambda__4___closed__3;
928x_16 = lean_box(0);
929x_17 = l_main___lambda__3(x_2, x_6, x_1, x_9, x_7, x_15, x_15, x_16, x_14);
930return x_17;
931}
932else
933{
934uint8_t x_18;
935lean_dec(x_9);
936lean_dec(x_6);
937lean_dec(x_2);
938lean_dec(x_1);
939x_18 = !lean_is_exclusive(x_11);
940if (x_18 == 0)
941{
942lean_object* x_19; lean_object* x_20;
943x_19 = lean_ctor_get(x_11, 0);
944lean_dec(x_19);
945x_20 = lean_ctor_get(x_13, 0);
946lean_inc(x_20);
947lean_dec(x_13);
948lean_ctor_set(x_11, 0, x_20);
949return x_11;
950}
951else
952{
953lean_object* x_21; lean_object* x_22; lean_object* x_23;
954x_21 = lean_ctor_get(x_11, 1);
955lean_inc(x_21);
956lean_dec(x_11);
957x_22 = lean_ctor_get(x_13, 0);
958lean_inc(x_22);
959lean_dec(x_13);
960x_23 = lean_alloc_ctor(0, 2, 0);
961lean_ctor_set(x_23, 0, x_22);
962lean_ctor_set(x_23, 1, x_21);
963return x_23;
964}
965}
966}
967else
968{
969uint8_t x_24;
970lean_dec(x_9);
971lean_dec(x_6);
972lean_dec(x_2);
973lean_dec(x_1);
974x_24 = !lean_is_exclusive(x_11);
975if (x_24 == 0)
976{
977return x_11;
978}
979else
980{
981lean_object* x_25; lean_object* x_26; lean_object* x_27;
982x_25 = lean_ctor_get(x_11, 0);
983x_26 = lean_ctor_get(x_11, 1);
984lean_inc(x_26);
985lean_inc(x_25);
986lean_dec(x_11);
987x_27 = lean_alloc_ctor(1, 2, 0);
988lean_ctor_set(x_27, 0, x_25);
989lean_ctor_set(x_27, 1, x_26);
990return x_27;
991}
992}
993}
994}
995}
996static lean_object* _init_l_main___lambda__5___closed__1() {
997_start:
998{
999lean_object* x_1;
1000x_1 = lean_mk_string_from_bytes("LEAN_SYSROOT", 12);
1001return x_1;
1002}
1003}
1004static lean_object* _init_l_main___lambda__5___closed__2() {
1005_start:
1006{
1007lean_object* x_1;
1008x_1 = lean_mk_string_from_bytes("Init.Data.Option.BasicAux", 25);
1009return x_1;
1010}
1011}
1012static lean_object* _init_l_main___lambda__5___closed__3() {
1013_start:
1014{
1015lean_object* x_1;
1016x_1 = lean_mk_string_from_bytes("Option.get!", 11);
1017return x_1;
1018}
1019}
1020static lean_object* _init_l_main___lambda__5___closed__4() {
1021_start:
1022{
1023lean_object* x_1;
1024x_1 = lean_mk_string_from_bytes("value is none", 13);
1025return x_1;
1026}
1027}
1028static lean_object* _init_l_main___lambda__5___closed__5() {
1029_start:
1030{
1031lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
1032x_1 = l_main___lambda__5___closed__2;
1033x_2 = l_main___lambda__5___closed__3;
1034x_3 = lean_unsigned_to_nat(16u);
1035x_4 = lean_unsigned_to_nat(14u);
1036x_5 = l_main___lambda__5___closed__4;
1037x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
1038return x_6;
1039}
1040}
1041LEAN_EXPORT lean_object* l_main___lambda__5(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
1042_start:
1043{
1044lean_object* x_4; lean_object* x_5; lean_object* x_6;
1045lean_dec(x_2);
1046x_4 = l_main___lambda__5___closed__1;
1047x_5 = lean_io_getenv(x_4, x_3);
1048x_6 = lean_ctor_get(x_5, 0);
1049lean_inc(x_6);
1050if (lean_obj_tag(x_6) == 0)
1051{
1052lean_object* x_7; lean_object* x_8;
1053x_7 = lean_ctor_get(x_5, 1);
1054lean_inc(x_7);
1055lean_dec(x_5);
1056x_8 = l_IO_appDir(x_7);
1057if (lean_obj_tag(x_8) == 0)
1058{
1059lean_object* x_9; lean_object* x_10; lean_object* x_11;
1060x_9 = lean_ctor_get(x_8, 0);
1061lean_inc(x_9);
1062x_10 = lean_ctor_get(x_8, 1);
1063lean_inc(x_10);
1064lean_dec(x_8);
1065x_11 = l_System_FilePath_parent(x_9);
1066lean_dec(x_9);
1067if (lean_obj_tag(x_11) == 0)
1068{
1069lean_object* x_12; lean_object* x_13; lean_object* x_14;
1070x_12 = l_main___lambda__5___closed__5;
1071x_13 = l_panic___at_main___spec__9(x_12);
1072x_14 = l_main___lambda__4(x_1, x_13, x_10);
1073return x_14;
1074}
1075else
1076{
1077lean_object* x_15; lean_object* x_16;
1078x_15 = lean_ctor_get(x_11, 0);
1079lean_inc(x_15);
1080lean_dec(x_11);
1081x_16 = l_main___lambda__4(x_1, x_15, x_10);
1082return x_16;
1083}
1084}
1085else
1086{
1087uint8_t x_17;
1088lean_dec(x_1);
1089x_17 = !lean_is_exclusive(x_8);
1090if (x_17 == 0)
1091{
1092return x_8;
1093}
1094else
1095{
1096lean_object* x_18; lean_object* x_19; lean_object* x_20;
1097x_18 = lean_ctor_get(x_8, 0);
1098x_19 = lean_ctor_get(x_8, 1);
1099lean_inc(x_19);
1100lean_inc(x_18);
1101lean_dec(x_8);
1102x_20 = lean_alloc_ctor(1, 2, 0);
1103lean_ctor_set(x_20, 0, x_18);
1104lean_ctor_set(x_20, 1, x_19);
1105return x_20;
1106}
1107}
1108}
1109else
1110{
1111lean_object* x_21; lean_object* x_22; lean_object* x_23;
1112x_21 = lean_ctor_get(x_5, 1);
1113lean_inc(x_21);
1114lean_dec(x_5);
1115x_22 = lean_ctor_get(x_6, 0);
1116lean_inc(x_22);
1117lean_dec(x_6);
1118x_23 = l_main___lambda__4(x_1, x_22, x_21);
1119return x_23;
1120}
1121}
1122}
1123static lean_object* _init_l_main___closed__1() {
1124_start:
1125{
1126lean_object* x_1;
1127x_1 = lean_mk_string_from_bytes("Lean C compiler\n\nA simple wrapper around a C compiler. Defaults to `cc`,\nwhich can be overridden with the environment variable `LEAN_CC`. All parameters are passed\nas-is to the wrapped compiler.\n\nInteresting options:\n* `--print-cflags`: print C compiler flags necessary for building against the Lean runtime and exit\n* `--print-ldflags`: print C compiler flags necessary for statically linking against the Lean library and exit", 427);
1128return x_1;
1129}
1130}
1131static lean_object* _init_l_main___boxed__const__1() {
1132_start:
1133{
1134uint32_t x_1; lean_object* x_2;
1135x_1 = 1;
1136x_2 = lean_box_uint32(x_1);
1137return x_2;
1138}
1139}
1140LEAN_EXPORT lean_object* _lean_main(lean_object* x_1, lean_object* x_2) {
1141_start:
1142{
1143uint8_t x_3;
1144x_3 = l_List_isEmpty___rarg(x_1);
1145if (x_3 == 0)
1146{
1147lean_object* x_4; lean_object* x_5;
1148x_4 = lean_box(0);
1149x_5 = l_main___lambda__5(x_1, x_4, x_2);
1150return x_5;
1151}
1152else
1153{
1154lean_object* x_6; lean_object* x_7;
1155lean_dec(x_1);
1156x_6 = l_main___closed__1;
1157x_7 = l_IO_println___at_Lean_instEval___spec__1(x_6, x_2);
1158if (lean_obj_tag(x_7) == 0)
1159{
1160uint8_t x_8;
1161x_8 = !lean_is_exclusive(x_7);
1162if (x_8 == 0)
1163{
1164lean_object* x_9; lean_object* x_10;
1165x_9 = lean_ctor_get(x_7, 0);
1166lean_dec(x_9);
1167x_10 = l_main___boxed__const__1;
1168lean_ctor_set(x_7, 0, x_10);
1169return x_7;
1170}
1171else
1172{
1173lean_object* x_11; lean_object* x_12; lean_object* x_13;
1174x_11 = lean_ctor_get(x_7, 1);
1175lean_inc(x_11);
1176lean_dec(x_7);
1177x_12 = l_main___boxed__const__1;
1178x_13 = lean_alloc_ctor(0, 2, 0);
1179lean_ctor_set(x_13, 0, x_12);
1180lean_ctor_set(x_13, 1, x_11);
1181return x_13;
1182}
1183}
1184else
1185{
1186uint8_t x_14;
1187x_14 = !lean_is_exclusive(x_7);
1188if (x_14 == 0)
1189{
1190return x_7;
1191}
1192else
1193{
1194lean_object* x_15; lean_object* x_16; lean_object* x_17;
1195x_15 = lean_ctor_get(x_7, 0);
1196x_16 = lean_ctor_get(x_7, 1);
1197lean_inc(x_16);
1198lean_inc(x_15);
1199lean_dec(x_7);
1200x_17 = lean_alloc_ctor(1, 2, 0);
1201lean_ctor_set(x_17, 0, x_15);
1202lean_ctor_set(x_17, 1, x_16);
1203return x_17;
1204}
1205}
1206}
1207}
1208}
1209LEAN_EXPORT lean_object* l_List_elem___at_main___spec__1___boxed(lean_object* x_1, lean_object* x_2) {
1210_start:
1211{
1212uint8_t x_3; lean_object* x_4;
1213x_3 = l_List_elem___at_main___spec__1(x_1, x_2);
1214lean_dec(x_2);
1215lean_dec(x_1);
1216x_4 = lean_box(x_3);
1217return x_4;
1218}
1219}
1220LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_main___spec__2___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
1221_start:
1222{
1223size_t x_5; size_t x_6; lean_object* x_7;
1224x_5 = lean_unbox_usize(x_2);
1225lean_dec(x_2);
1226x_6 = lean_unbox_usize(x_3);
1227lean_dec(x_3);
1228x_7 = l_Array_mapMUnsafe_map___at_main___spec__2(x_1, x_5, x_6, x_4);
1229lean_dec(x_1);
1230return x_7;
1231}
1232}
1233LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_main___spec__3___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
1234_start:
1235{
1236size_t x_5; size_t x_6; lean_object* x_7;
1237x_5 = lean_unbox_usize(x_2);
1238lean_dec(x_2);
1239x_6 = lean_unbox_usize(x_3);
1240lean_dec(x_3);
1241x_7 = l_Array_mapMUnsafe_map___at_main___spec__3(x_1, x_5, x_6, x_4);
1242lean_dec(x_1);
1243return x_7;
1244}
1245}
1246LEAN_EXPORT lean_object* l_List_forIn_loop___at_main___spec__4___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) {
1247_start:
1248{
1249lean_object* x_8;
1250x_8 = l_List_forIn_loop___at_main___spec__4(x_1, x_2, x_3, x_4, x_5, x_6, x_7);
1251lean_dec(x_5);
1252lean_dec(x_1);
1253return x_8;
1254}
1255}
1256LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_main___spec__5___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
1257_start:
1258{
1259size_t x_5; size_t x_6; lean_object* x_7;
1260x_5 = lean_unbox_usize(x_2);
1261lean_dec(x_2);
1262x_6 = lean_unbox_usize(x_3);
1263lean_dec(x_3);
1264x_7 = l_Array_mapMUnsafe_map___at_main___spec__5(x_1, x_5, x_6, x_4);
1265lean_dec(x_1);
1266return x_7;
1267}
1268}
1269LEAN_EXPORT lean_object* l_Array_anyMUnsafe_any___at_main___spec__7___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
1270_start:
1271{
1272size_t x_5; size_t x_6; uint8_t x_7; lean_object* x_8;
1273x_5 = lean_unbox_usize(x_3);
1274lean_dec(x_3);
1275x_6 = lean_unbox_usize(x_4);
1276lean_dec(x_4);
1277x_7 = l_Array_anyMUnsafe_any___at_main___spec__7(x_1, x_2, x_5, x_6);
1278lean_dec(x_2);
1279lean_dec(x_1);
1280x_8 = lean_box(x_7);
1281return x_8;
1282}
1283}
1284LEAN_EXPORT lean_object* l_Array_contains___at_main___spec__6___boxed(lean_object* x_1, lean_object* x_2) {
1285_start:
1286{
1287uint8_t x_3; lean_object* x_4;
1288x_3 = l_Array_contains___at_main___spec__6(x_1, x_2);
1289lean_dec(x_2);
1290lean_dec(x_1);
1291x_4 = lean_box(x_3);
1292return x_4;
1293}
1294}
1295LEAN_EXPORT lean_object* l_Array_foldlMUnsafe_fold___at_main___spec__8___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
1296_start:
1297{
1298size_t x_5; size_t x_6; lean_object* x_7;
1299x_5 = lean_unbox_usize(x_2);
1300lean_dec(x_2);
1301x_6 = lean_unbox_usize(x_3);
1302lean_dec(x_3);
1303x_7 = l_Array_foldlMUnsafe_fold___at_main___spec__8(x_1, x_5, x_6, x_4);
1304lean_dec(x_1);
1305return x_7;
1306}
1307}
1308LEAN_EXPORT lean_object* l_main___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) {
1309_start:
1310{
1311lean_object* x_7;
1312x_7 = l_main___lambda__1(x_1, x_2, x_3, x_4, x_5, x_6);
1313lean_dec(x_5);
1314return x_7;
1315}
1316}
1317LEAN_EXPORT lean_object* l_main___lambda__2___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) {
1318_start:
1319{
1320lean_object* x_11;
1321x_11 = l_main___lambda__2(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10);
1322lean_dec(x_9);
1323return x_11;
1324}
1325}
1326lean_object* initialize_Init(uint8_t builtin, lean_object*);
1327lean_object* initialize_Lean_Compiler_FFI(uint8_t builtin, lean_object*);
1328static bool _G_initialized = false;
1329LEAN_EXPORT lean_object* initialize_Leanc(uint8_t builtin, lean_object* w) {
1330lean_object * res;
1331if (_G_initialized) return lean_io_result_mk_ok(lean_box(0));
1332_G_initialized = true;
1333res = initialize_Init(builtin, lean_io_mk_world());
1334if (lean_io_result_is_error(res)) return res;
1335lean_dec_ref(res);
1336res = initialize_Lean_Compiler_FFI(builtin, lean_io_mk_world());
1337if (lean_io_result_is_error(res)) return res;
1338lean_dec_ref(res);
1339l_Array_mapMUnsafe_map___at_main___spec__2___closed__1 = _init_l_Array_mapMUnsafe_map___at_main___spec__2___closed__1();
1340lean_mark_persistent(l_Array_mapMUnsafe_map___at_main___spec__2___closed__1);
1341l_Array_mapMUnsafe_map___at_main___spec__2___closed__2 = _init_l_Array_mapMUnsafe_map___at_main___spec__2___closed__2();
1342lean_mark_persistent(l_Array_mapMUnsafe_map___at_main___spec__2___closed__2);
1343l_List_forIn_loop___at_main___spec__4___closed__1 = _init_l_List_forIn_loop___at_main___spec__4___closed__1();
1344lean_mark_persistent(l_List_forIn_loop___at_main___spec__4___closed__1);
1345l_List_forIn_loop___at_main___spec__4___closed__2 = _init_l_List_forIn_loop___at_main___spec__4___closed__2();
1346lean_mark_persistent(l_List_forIn_loop___at_main___spec__4___closed__2);
1347l_List_forIn_loop___at_main___spec__4___closed__3 = _init_l_List_forIn_loop___at_main___spec__4___closed__3();
1348lean_mark_persistent(l_List_forIn_loop___at_main___spec__4___closed__3);
1349l_List_forIn_loop___at_main___spec__4___closed__4___boxed__const__1 = _init_l_List_forIn_loop___at_main___spec__4___closed__4___boxed__const__1();
1350lean_mark_persistent(l_List_forIn_loop___at_main___spec__4___closed__4___boxed__const__1);
1351l_List_forIn_loop___at_main___spec__4___closed__4 = _init_l_List_forIn_loop___at_main___spec__4___closed__4();
1352lean_mark_persistent(l_List_forIn_loop___at_main___spec__4___closed__4);
1353l_List_forIn_loop___at_main___spec__4___closed__5 = _init_l_List_forIn_loop___at_main___spec__4___closed__5();
1354lean_mark_persistent(l_List_forIn_loop___at_main___spec__4___closed__5);
1355l_main___lambda__1___closed__1 = _init_l_main___lambda__1___closed__1();
1356lean_mark_persistent(l_main___lambda__1___closed__1);
1357l_main___lambda__2___closed__1 = _init_l_main___lambda__2___closed__1();
1358lean_mark_persistent(l_main___lambda__2___closed__1);
1359l_main___lambda__2___closed__2 = _init_l_main___lambda__2___closed__2();
1360lean_mark_persistent(l_main___lambda__2___closed__2);
1361l_main___lambda__2___closed__3 = _init_l_main___lambda__2___closed__3();
1362lean_mark_persistent(l_main___lambda__2___closed__3);
1363l_main___lambda__2___closed__4 = _init_l_main___lambda__2___closed__4();
1364lean_mark_persistent(l_main___lambda__2___closed__4);
1365l_main___lambda__3___closed__1 = _init_l_main___lambda__3___closed__1();
1366lean_mark_persistent(l_main___lambda__3___closed__1);
1367l_main___lambda__3___closed__2 = _init_l_main___lambda__3___closed__2();
1368lean_mark_persistent(l_main___lambda__3___closed__2);
1369l_main___lambda__4___closed__1 = _init_l_main___lambda__4___closed__1();
1370lean_mark_persistent(l_main___lambda__4___closed__1);
1371l_main___lambda__4___closed__2 = _init_l_main___lambda__4___closed__2();
1372lean_mark_persistent(l_main___lambda__4___closed__2);
1373l_main___lambda__4___closed__3 = _init_l_main___lambda__4___closed__3();
1374lean_mark_persistent(l_main___lambda__4___closed__3);
1375l_main___lambda__4___closed__4 = _init_l_main___lambda__4___closed__4();
1376lean_mark_persistent(l_main___lambda__4___closed__4);
1377l_main___lambda__5___closed__1 = _init_l_main___lambda__5___closed__1();
1378lean_mark_persistent(l_main___lambda__5___closed__1);
1379l_main___lambda__5___closed__2 = _init_l_main___lambda__5___closed__2();
1380lean_mark_persistent(l_main___lambda__5___closed__2);
1381l_main___lambda__5___closed__3 = _init_l_main___lambda__5___closed__3();
1382lean_mark_persistent(l_main___lambda__5___closed__3);
1383l_main___lambda__5___closed__4 = _init_l_main___lambda__5___closed__4();
1384lean_mark_persistent(l_main___lambda__5___closed__4);
1385l_main___lambda__5___closed__5 = _init_l_main___lambda__5___closed__5();
1386lean_mark_persistent(l_main___lambda__5___closed__5);
1387l_main___closed__1 = _init_l_main___closed__1();
1388lean_mark_persistent(l_main___closed__1);
1389l_main___boxed__const__1 = _init_l_main___boxed__const__1();
1390lean_mark_persistent(l_main___boxed__const__1);
1391return lean_io_result_mk_ok(lean_box(0));
1392}
1393void lean_initialize();
1394
1395 #if defined(WIN32) || defined(_WIN32)
1396 #include <windows.h>
1397 #endif
1398
1399 int main(int argc, char ** argv) {
1400 #if defined(WIN32) || defined(_WIN32)
1401 SetErrorMode(SEM_FAILCRITICALERRORS);
1402 #endif
1403 lean_object* in; lean_object* res;
1404lean_initialize();
1405lean_set_panic_messages(false);
1406res = initialize_Leanc(1 /* builtin */, lean_io_mk_world());
1407lean_set_panic_messages(true);
1408lean_io_mark_end_initialization();
1409if (lean_io_result_is_ok(res)) {
1410lean_dec_ref(res);
1411lean_init_task_manager();
1412in = lean_box(0);
1413int i = argc;
1414while (i > 1) {
1415 lean_object* n;
1416 i--;
1417 n = lean_alloc_ctor(1,2,0); lean_ctor_set(n, 0, lean_mk_string(argv[i])); lean_ctor_set(n, 1, in);
1418 in = n;
1419}
1420res = _lean_main(in, lean_io_mk_world());
1421}
1422lean_finalize_task_manager();
1423if (lean_io_result_is_ok(res)) {
1424 int ret = lean_unbox_uint32(lean_io_result_get_value(res));
1425 lean_dec_ref(res);
1426 return ret;
1427} else {
1428 lean_io_result_show_error(res);
1429 lean_dec_ref(res);
1430 return 1;
1431}
1432}
1433#ifdef __cplusplus
1434}
1435#endif
1436