-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcem.S
2113 lines (2014 loc) · 52.4 KB
/
cem.S
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
.text
.file "cem.a.bc"
.globl TimerB1_ISR
.align 2
.type TimerB1_ISR,@function
TimerB1_ISR: ; @TimerB1_ISR
; BB#0: ; %entry
push.w r4
mov.w r1, r4
push.w r12
mov.w &0x03C0, r12
and.w #-3, r12
mov.w r12, &0x03C0
mov.w &0x03C0, r12
cmp.w #0, r12
jeq .LBB0_2
jmp .LBB0_1
.LBB0_1: ; %if.then
mov.w &overflow, r12
add.w #1, r12
mov.w r12, &overflow
mov.w &0x03C0, r12
bis.w #4, r12
mov.w r12, &0x03C0
mov.w &0x03C0, r12
bis.w #2, r12
mov.w r12, &0x03C0
mov.w &0x03C0, r12
and.w #-2, r12
mov.w r12, &0x03C0
jmp .LBB0_2
.LBB0_2: ; %if.end
pop.w r12
pop.w r4
reti
.Lfunc_end0:
.size TimerB1_ISR, .Lfunc_end0-TimerB1_ISR
.globl init
.align 2
.type init,@function
init: ; @init
; BB#0: ; %entry
push.w r4
mov.w r1, r4
sub.w #6, r1
mov.w &timer, r12
mov.w 0(r12), r13
and.w #-6401, r13
mov.w r13, 0(r12)
mov.w &timer, r12
mov.w 0(r12), r13
bis.w #512, r13
mov.w r13, 0(r12)
mov.w &timer, r12
mov.w 0(r12), r13
bis.w #192, r13
mov.w r13, 0(r12)
mov.w &timer, r12
mov.w 0(r12), r13
and.w #-17, r13
mov.w r13, 0(r12)
mov.w &timer, r12
mov.w 0(r12), r13
bis.w #32, r13
mov.w r13, 0(r12)
mov.w &timer, r12
mov.w 0(r12), r13
bis.w #2, r13
mov.w r13, 0(r12)
call #init_hw
call #mspconsole_init
;APP
eint { nop
;NO_APP
mov.w &curctx, r12
mov.w 0(r12), r12
mov.w 2(r12), r12
mov.w r1, r13
mov.w r12, 2(r13)
mov.w #.L.str, 0(r13)
call #printf
mov.w r15, -2(r4) ; 2-byte Folded Spill
add.w #6, r1
pop.w r4
ret
.Lfunc_end1:
.size init, .Lfunc_end1-init
.globl task_init
.align 2
.type task_init,@function
task_init: ; @task_init
; BB#0: ; %entry
push.w r4
mov.w r1, r4
sub.w #8, r1
mov.w &overflow, r12
mov.w &0x03D0, r13
mov.w r1, r14
mov.w r13, 4(r14)
mov.w r12, 2(r14)
mov.w #.L.str.1, 0(r14)
call #printf
mov.w #0, &_global_parent_next
mov.w #0, &_global_out_len
mov.w #0, &_global_letter
mov.w #0, &_global_prev_sample
mov.w #0, &_global_letter_idx
mov.w #1, &_global_sample_count
mov.w #_task_task_init_dict, r12
mov.w r15, -2(r4) ; 2-byte Folded Spill
mov.w r12, r15
call #transition_to
add.w #8, r1
pop.w r4
ret
.Lfunc_end2:
.size task_init, .Lfunc_end2-task_init
.globl task_init_dict
.align 2
.type task_init_dict,@function
task_init_dict: ; @task_init_dict
; BB#0: ; %entry
push.w r4
mov.w r1, r4
sub.w #8, r1
mov.w &_global_letter, r12
mov.w r12, &_global_letter_bak
mov.w r12, -6(r4)
mov.w #0, -4(r4)
mov.w #0, -2(r4)
mov.w &_global_letter_bak, r12
mov.w r12, -8(r4)
mov.w #6, r14
mov.w r12, r15
call #__mulhi3hw_noint
mov.w -2(r4), r12
mov.w r12, _global_dict+4(r15)
mov.w -4(r4), r12
mov.w r12, _global_dict+2(r15)
mov.w -6(r4), r12
mov.w r12, _global_dict(r15)
mov.w &_global_letter_bak, r12
add.w #1, r12
mov.w r12, &_global_letter_bak
cmp.w #256, r12
jhs .LBB3_2
jmp .LBB3_1
.LBB3_1: ; %if.then
mov.w #_global_letter, r14
mov.w #_global_letter_bak, r15
mov.w #2, r13
call #write_to_gbuf
mov.w #_task_task_init_dict, r15
call #transition_to
jmp .LBB3_3
.LBB3_2: ; %if.else
mov.w #256, &_global_node_count
mov.w #_global_letter, r14
mov.w #_global_letter_bak, r15
mov.w #2, r13
call #write_to_gbuf
mov.w #_task_task_sample, r15
call #transition_to
jmp .LBB3_3
.LBB3_3: ; %if.end
add.w #8, r1
pop.w r4
ret
.Lfunc_end3:
.size task_init_dict, .Lfunc_end3-task_init_dict
.globl task_sample
.align 2
.type task_sample,@function
task_sample: ; @task_sample
; BB#0: ; %entry
push.w r4
mov.w r1, r4
sub.w #2, r1
mov.w &_global_letter_idx, r12
mov.w r12, &_global_letter_idx_bak
add.w #1, r12
mov.w r12, -2(r4)
cmp.w #2, r12
jne .LBB4_2
jmp .LBB4_1
.LBB4_1: ; %if.then
mov.w #0, -2(r4)
jmp .LBB4_2
.LBB4_2: ; %if.end
mov.w &_global_letter_idx_bak, r12
cmp.w #0, r12
jne .LBB4_4
jmp .LBB4_3
.LBB4_3: ; %if.then.2
mov.w -2(r4), r12
mov.w r12, &_global_letter_idx_bak
mov.w #_global_letter_idx_bak, r15
mov.w #_global_letter_idx, r14
mov.w #2, r13
call #write_to_gbuf
mov.w #_task_task_measure_temp, r15
call #transition_to
jmp .LBB4_5
.LBB4_4: ; %if.else
mov.w -2(r4), r12
mov.w r12, &_global_letter_idx_bak
mov.w #_global_letter_idx_bak, r15
mov.w #_global_letter_idx, r14
mov.w #2, r13
call #write_to_gbuf
mov.w #_task_task_letterize, r15
call #transition_to
jmp .LBB4_5
.LBB4_5: ; %if.end.3
add.w #2, r1
pop.w r4
ret
.Lfunc_end4:
.size task_sample, .Lfunc_end4-task_sample
.globl task_measure_temp
.align 2
.type task_measure_temp,@function
task_measure_temp: ; @task_measure_temp
; BB#0: ; %entry
push.w r4
mov.w r1, r4
sub.w #8, r1
mov.w #_global_prev_sample, r14
mov.w &_global_prev_sample, r12
mov.w r12, &_global_prev_sample_bak
mov.w #_global_prev_sample_bak, r15
mov.w r12, -2(r4)
mov.w r15, -6(r4) ; 2-byte Folded Spill
mov.w r12, r15
mov.w r14, -8(r4) ; 2-byte Folded Spill
call #acquire_sample
mov.w r15, -4(r4)
mov.w r15, -2(r4)
mov.w r15, &_global_prev_sample_bak
mov.w -4(r4), r12
mov.w r12, &_global_sample
mov.w #2, r13
mov.w -6(r4), r15 ; 2-byte Folded Reload
mov.w -8(r4), r14 ; 2-byte Folded Reload
call #write_to_gbuf
mov.w #_task_task_letterize, r15
call #transition_to
add.w #8, r1
pop.w r4
ret
.Lfunc_end5:
.size task_measure_temp, .Lfunc_end5-task_measure_temp
.globl task_letterize
.align 2
.type task_letterize,@function
task_letterize: ; @task_letterize
; BB#0: ; %entry
push.w r4
mov.w r1, r4
sub.w #16, r1
mov.w &_global_letter_idx, r12
mov.w r12, -2(r4)
cmp.w #0, r12
jne .LBB6_2
jmp .LBB6_1
.LBB6_1: ; %if.then
mov.w #2, -2(r4)
jmp .LBB6_3
.LBB6_2: ; %if.else
mov.w -2(r4), r12
add.w #-1, r12
mov.w r12, -2(r4)
jmp .LBB6_3
.LBB6_3: ; %if.end
;DEBUG_VALUE: task_letterize:letter_shift <- [FP+-4]
mov.w -2(r4), r12
rla.w r12
rla.w r12
rla.w r12
mov.w r12, -4(r4)
;DEBUG_VALUE: task_letterize:letter <- [FP+-6]
mov.w &_global_sample, r12
mov.b -4(r4), r13
mov.w #255, r14
cmp.b #0, r13
mov.b r13, r15
mov.w r12, -8(r4) ; 2-byte Folded Spill
mov.b r13, -9(r4) ; 1-byte Folded Spill
mov.w r14, -12(r4) ; 2-byte Folded Spill
mov.b r15, -13(r4) ; 1-byte Folded Spill
jeq .LBB6_5
.LBB6_4: ; %if.end
; =>This Inner Loop Header: Depth=1
mov.b -13(r4), r12 ; 1-byte Folded Reload
mov.w -12(r4), r13 ; 2-byte Folded Reload
rla.w r13
sub.b #1, r12
mov.w r13, -12(r4) ; 2-byte Folded Spill
mov.b r12, -13(r4) ; 1-byte Folded Spill
jne .LBB6_4
.LBB6_5: ; %if.end
mov.w -12(r4), r12 ; 2-byte Folded Reload
mov.w -8(r4), r13 ; 2-byte Folded Reload
and.w r12, r13
mov.b -9(r4), r14 ; 1-byte Folded Reload
cmp.b #0, r14
mov.b r14, -14(r4) ; 1-byte Folded Spill
mov.w r13, -16(r4) ; 2-byte Folded Spill
jeq .LBB6_7
.LBB6_6: ; %if.end
; =>This Inner Loop Header: Depth=1
mov.b -14(r4), r12 ; 1-byte Folded Reload
mov.w -16(r4), r13 ; 2-byte Folded Reload
clrc
rrc.w r13
sub.b #1, r12
mov.w r13, -16(r4) ; 2-byte Folded Spill
mov.b r12, -14(r4) ; 1-byte Folded Spill
jne .LBB6_6
.LBB6_7: ; %if.end
mov.w -16(r4), r12 ; 2-byte Folded Reload
mov.w r12, -6(r4)
mov.w r12, &_global_letter
mov.w #_task_task_compress, r15
call #transition_to
add.w #16, r1
pop.w r4
ret
.Lfunc_end6:
.size task_letterize, .Lfunc_end6-task_letterize
.globl task_compress
.align 2
.type task_compress,@function
task_compress: ; @task_compress
; BB#0: ; %entry
push.w r4
mov.w r1, r4
sub.w #12, r1
mov.w #_global_sample_count, r14
mov.w &_global_sample_count, r12
mov.w r12, &_global_sample_count_bak
mov.w #_global_sample_count_bak, r15
mov.w &_global_parent_next, r12
mov.w r12, -8(r4)
mov.w #6, r13
mov.w r15, -10(r4) ; 2-byte Folded Spill
mov.w r12, r15
mov.w r14, -12(r4) ; 2-byte Folded Spill
mov.w r13, r14
call #__mulhi3hw_noint
mov.w _global_dict+4(r15), r12
mov.w r12, -2(r4)
mov.w _global_dict+2(r15), r12
mov.w r12, -4(r4)
mov.w _global_dict(r15), r12
mov.w r12, -6(r4)
mov.w -2(r4), r12
mov.w r12, &_global_sibling
mov.w -2(r4), r12
mov.w r12, &_global_parent_node+4
mov.w -4(r4), r12
mov.w r12, &_global_parent_node+2
mov.w -6(r4), r12
mov.w r12, &_global_parent_node
mov.w -8(r4), r12
mov.w r12, &_global_parent
mov.w -2(r4), r12
mov.w r12, &_global_child
mov.w &_global_sample_count_bak, r12
add.w #1, r12
mov.w r12, &_global_sample_count_bak
mov.w #2, r13
mov.w -10(r4), r15 ; 2-byte Folded Reload
mov.w -12(r4), r14 ; 2-byte Folded Reload
call #write_to_gbuf
mov.w #_task_task_find_sibling, r15
call #transition_to
add.w #12, r1
pop.w r4
ret
.Lfunc_end7:
.size task_compress, .Lfunc_end7-task_compress
.globl task_find_sibling
.align 2
.type task_find_sibling,@function
task_find_sibling: ; @task_find_sibling
; BB#0: ; %entry
push.w r4
mov.w r1, r4
sub.w #6, r1
mov.w &_global_sibling, r12
mov.w r12, &_global_sibling_bak
cmp.w #0, r12
jeq .LBB8_7
jmp .LBB8_1
.LBB8_1: ; %if.then
;DEBUG_VALUE: i <- [FP+-4]
mov.w &_global_sibling_bak, r12
mov.w r12, -4(r4)
mov.w #6, r14
mov.w r12, r15
call #__mulhi3hw_noint
mov.w r15, r12
add.w #_global_dict, r12
mov.w r12, -2(r4)
mov.w _global_dict(r15), r12
mov.w &_global_letter, r14
cmp.w r14, r12
jne .LBB8_3
jmp .LBB8_2
.LBB8_2: ; %if.then.2
mov.w #_global_sibling_bak, r15
mov.w &_global_sibling_bak, r12
mov.w r12, &_global_parent_next
mov.w #_global_sibling, r14
mov.w #2, r13
call #write_to_gbuf
mov.w #_task_task_letterize, r15
call #transition_to
jmp .LBB8_6
.LBB8_3: ; %if.else
mov.w -2(r4), r12
mov.w 2(r12), r12
cmp.w #0, r12
jeq .LBB8_5
jmp .LBB8_4
.LBB8_4: ; %if.then.4
mov.w -2(r4), r12
mov.w 2(r12), r12
mov.w r12, &_global_sibling_bak
mov.w #_global_sibling_bak, r15
mov.w #_global_sibling, r14
mov.w #2, r13
call #write_to_gbuf
mov.w #_task_task_find_sibling, r15
call #transition_to
jmp .LBB8_5
.LBB8_5: ; %if.end
jmp .LBB8_6
.LBB8_6: ; %if.end.6
jmp .LBB8_7
.LBB8_7: ; %if.end.7
;DEBUG_VALUE: task_find_sibling:starting_node_idx <- [FP+-6]
mov.w &_global_letter, r12
mov.w r12, -6(r4)
mov.w r12, &_global_parent_next
mov.w &_global_child, r12
cmp.w #0, r12
jne .LBB8_9
jmp .LBB8_8
.LBB8_8: ; %if.then.9
mov.w #_global_sibling, r14
mov.w #_global_sibling_bak, r15
mov.w #2, r13
call #write_to_gbuf
mov.w #_task_task_add_insert, r15
call #transition_to
jmp .LBB8_10
.LBB8_9: ; %if.else.10
mov.w #_global_sibling, r14
mov.w #_global_sibling_bak, r15
mov.w #2, r13
call #write_to_gbuf
mov.w #_task_task_add_node, r15
call #transition_to
jmp .LBB8_10
.LBB8_10: ; %if.end.11
add.w #6, r1
pop.w r4
ret
.Lfunc_end8:
.size task_find_sibling, .Lfunc_end8-task_find_sibling
.globl task_add_node
.align 2
.type task_add_node,@function
task_add_node: ; @task_add_node
; BB#0: ; %entry
push.w r4
mov.w r1, r4
sub.w #12, r1
mov.w &_global_sibling, r12
mov.w r12, &_global_sibling_bak
mov.w r12, -4(r4)
mov.w #6, r14
mov.w r12, r15
call #__mulhi3hw_noint
mov.w r15, r12
add.w #_global_dict, r12
mov.w r12, -2(r4)
mov.w _global_dict+2(r15), r12
cmp.w #0, r12
jeq .LBB9_2
jmp .LBB9_1
.LBB9_1: ; %if.then
;DEBUG_VALUE: next_sibling <- [FP+-6]
mov.w -2(r4), r12
mov.w 2(r12), r12
mov.w r12, -6(r4)
mov.w r12, &_global_sibling_bak
mov.w #_global_sibling_bak, r15
mov.w #_global_sibling, r14
mov.w #2, r13
call #write_to_gbuf
mov.w #_task_task_add_node, r15
call #transition_to
jmp .LBB9_3
.LBB9_2: ; %if.else
;DEBUG_VALUE: sibling_node_obj <- [FP+-12]
mov.w -2(r4), r12
mov.w 4(r12), r13
mov.w r13, -8(r4)
mov.w 2(r12), r13
mov.w r13, -10(r4)
mov.w 0(r12), r12
mov.w r12, -12(r4)
mov.w -8(r4), r12
mov.w r12, &_global_sibling_node+4
mov.w -10(r4), r12
mov.w r12, &_global_sibling_node+2
mov.w -12(r4), r12
mov.w r12, &_global_sibling_node
mov.w #_global_sibling, r14
mov.w #_global_sibling_bak, r15
mov.w #2, r13
call #write_to_gbuf
mov.w #_task_task_add_insert, r15
call #transition_to
jmp .LBB9_3
.LBB9_3: ; %if.end
add.w #12, r1
pop.w r4
ret
.Lfunc_end9:
.size task_add_node, .Lfunc_end9-task_add_node
.globl task_add_insert
.align 2
.type task_add_insert,@function
task_add_insert: ; @task_add_insert
; BB#0: ; %entry
push.w r4
mov.w r1, r4
sub.w #24, r1
mov.w &_global_node_count, r12
mov.w r12, &_global_node_count_bak
cmp.w #512, r12
jne .LBB10_3
jmp .LBB10_1
.LBB10_1: ; %if.then
jmp .LBB10_2
.LBB10_2: ; %while.body
; =>This Inner Loop Header: Depth=1
jmp .LBB10_2
.LBB10_3: ; %if.end
;DEBUG_VALUE: task_add_insert:child <- [FP+-2]
mov.w &_global_node_count_bak, r12
mov.w r12, -2(r4)
;DEBUG_VALUE: task_add_insert:child_node <- [FP+-8]
mov.w &_global_letter, r12
mov.w r12, -8(r4)
mov.w #0, -6(r4)
mov.w #0, -4(r4)
mov.w &_global_parent_node+4, r12
cmp.w #0, r12
jne .LBB10_5
jmp .LBB10_4
.LBB10_4: ; %if.then.3
;DEBUG_VALUE: parent_node_obj <- [FP+-14]
mov.w &_global_parent_node+4, r12
mov.w r12, -10(r4)
mov.w &_global_parent_node+2, r12
mov.w r12, -12(r4)
mov.w &_global_parent_node, r12
mov.w r12, -14(r4)
mov.w -2(r4), r12
mov.w r12, -10(r4)
;DEBUG_VALUE: i <- [FP+-16]
mov.w &_global_parent, r12
mov.w r12, -16(r4)
mov.w #6, r14
mov.w r12, r15
call #__mulhi3hw_noint
mov.w -10(r4), r12
mov.w r12, _global_dict+4(r15)
mov.w -12(r4), r12
mov.w r12, _global_dict+2(r15)
mov.w -14(r4), r12
mov.w r12, _global_dict(r15)
jmp .LBB10_6
.LBB10_5: ; %if.else
;DEBUG_VALUE: last_sibling <- [FP+-18]
mov.w &_global_sibling, r12
mov.w r12, -18(r4)
;DEBUG_VALUE: last_sibling_node <- [FP+-24]
mov.w &_global_sibling_node+4, r12
mov.w r12, -20(r4)
mov.w &_global_sibling_node+2, r12
mov.w r12, -22(r4)
mov.w &_global_sibling_node, r12
mov.w r12, -24(r4)
mov.w -2(r4), r12
mov.w r12, -22(r4)
mov.w -18(r4), r15
mov.w #6, r14
call #__mulhi3hw_noint
mov.w -20(r4), r12
mov.w r12, _global_dict+4(r15)
mov.w -22(r4), r12
mov.w r12, _global_dict+2(r15)
mov.w -24(r4), r12
mov.w r12, _global_dict(r15)
jmp .LBB10_6
.LBB10_6: ; %if.end.7
mov.w -2(r4), r15
mov.w #6, r14
call #__mulhi3hw_noint
mov.w -4(r4), r14
mov.w r14, _global_dict+4(r15)
mov.w -6(r4), r14
mov.w r14, _global_dict+2(r15)
mov.w -8(r4), r14
mov.w r14, _global_dict(r15)
mov.w &_global_parent, r14
mov.w r14, &_global_symbol
mov.w #_global_node_count_bak, r15
mov.w &_global_node_count_bak, r14
add.w #1, r14
mov.w r14, &_global_node_count_bak
mov.w #_global_node_count, r14
mov.w #2, r13
call #write_to_gbuf
mov.w #_task_task_append_compressed, r15
call #transition_to
add.w #24, r1
pop.w r4
ret
.Lfunc_end10:
.size task_add_insert, .Lfunc_end10-task_add_insert
.globl task_append_compressed
.align 2
.type task_append_compressed,@function
task_append_compressed: ; @task_append_compressed
; BB#0: ; %entry
push.w r4
mov.w r1, r4
sub.w #4, r1
mov.w &_global_out_len, r12
mov.w r12, &_global_out_len_bak
mov.w r12, -2(r4)
mov.w &_global_symbol, r13
mov.w #6, r14
mov.w r12, r15
mov.w r13, -4(r4) ; 2-byte Folded Spill
call #__mulhi3hw_noint
mov.w -4(r4), r12 ; 2-byte Folded Reload
mov.w r12, _global_compressed_data(r15)
mov.w &_global_out_len_bak, r12
add.w #1, r12
mov.w r12, &_global_out_len_bak
cmp.w #64, r12
jne .LBB11_2
jmp .LBB11_1
.LBB11_1: ; %if.then
mov.w #_global_out_len, r14
mov.w #_global_out_len_bak, r15
mov.w #2, r13
call #write_to_gbuf
mov.w #_task_task_print, r15
call #transition_to
jmp .LBB11_3
.LBB11_2: ; %if.else
mov.w #_global_out_len, r14
mov.w #_global_out_len_bak, r15
mov.w #2, r13
call #write_to_gbuf
mov.w #_task_task_sample, r15
call #transition_to
jmp .LBB11_3
.LBB11_3: ; %if.end
add.w #4, r1
pop.w r4
ret
.Lfunc_end11:
.size task_append_compressed, .Lfunc_end11-task_append_compressed
.globl task_print
.align 2
.type task_print,@function
task_print: ; @task_print
; BB#0: ; %entry
push.w r4
mov.w r1, r4
sub.w #22, r1
mov.w &overflow, r12
mov.w &0x03D0, r13
mov.w r1, r14
mov.w r13, 4(r14)
mov.w r12, 2(r14)
mov.w #.L.str.2, 0(r14)
call #printf
mov.w r1, r12
mov.w #.L.str.3, 0(r12)
mov.w r15, -6(r4) ; 2-byte Folded Spill
call #printf
mov.w #0, -2(r4)
mov.w r15, -8(r4) ; 2-byte Folded Spill
jmp .LBB12_1
.LBB12_1: ; %for.cond
; =>This Inner Loop Header: Depth=1
mov.w -2(r4), r12
cmp.w #64, r12
jhs .LBB12_7
jmp .LBB12_2
.LBB12_2: ; %for.body
; in Loop: Header=BB12_1 Depth=1
;DEBUG_VALUE: index <- [FP+-4]
mov.w -2(r4), r15
mov.w #6, r14
call #__mulhi3hw_noint
mov.w _global_compressed_data(r15), r14
mov.w r14, -4(r4)
mov.w r1, r15
mov.w r14, 2(r15)
mov.w #.L.str.4, 0(r15)
call #printf
mov.w -2(r4), r14
cmp.w #0, r14
mov.w r15, -10(r4) ; 2-byte Folded Spill
jeq .LBB12_5
jmp .LBB12_3
.LBB12_3: ; %land.lhs.true
; in Loop: Header=BB12_1 Depth=1
mov.w -2(r4), r12
add.w #1, r12
bit.w #7, r12
jne .LBB12_5
jmp .LBB12_4
.LBB12_4: ; %if.then
; in Loop: Header=BB12_1 Depth=1
mov.w r1, r12
mov.w #.L.str.5, 0(r12)
call #printf
mov.w r15, -12(r4) ; 2-byte Folded Spill
jmp .LBB12_5
.LBB12_5: ; %if.end
; in Loop: Header=BB12_1 Depth=1
jmp .LBB12_6
.LBB12_6: ; %for.inc
; in Loop: Header=BB12_1 Depth=1
mov.w -2(r4), r12
add.w #1, r12
mov.w r12, -2(r4)
jmp .LBB12_1
.LBB12_7: ; %for.end
mov.w r1, r12
mov.w #.L.str.5, 0(r12)
call #printf
mov.w &_global_sample_count, r12
mov.w r1, r13
mov.w r12, 2(r13)
mov.w #64, 4(r13)
mov.w #.L.str.6, 0(r13)
mov.w r15, -14(r4) ; 2-byte Folded Spill
call #printf
mov.w #_task_task_done, r12
mov.w r15, -16(r4) ; 2-byte Folded Spill
mov.w r12, r15
call #transition_to
add.w #22, r1
pop.w r4
ret
.Lfunc_end12:
.size task_print, .Lfunc_end12-task_print
.globl task_done
.align 2
.type task_done,@function
task_done: ; @task_done
; BB#0: ; %entry
push.w r4
mov.w r1, r4
pop.w r4
ret
.Lfunc_end13:
.size task_done, .Lfunc_end13-task_done
.globl _entry_task
.align 2
.type _entry_task,@function
_entry_task: ; @_entry_task
; BB#0: ; %entry
push.w r4
mov.w r1, r4
mov.w #_task_task_init, r15
call #transition_to
pop.w r4
ret
.Lfunc_end14:
.size _entry_task, .Lfunc_end14-_entry_task
.globl _init
.align 2
.type _init,@function
_init: ; @_init
; BB#0: ; %entry
push.w r4
mov.w r1, r4
call #init
pop.w r4
ret
.Lfunc_end15:
.size _init, .Lfunc_end15-_init
.globl clear_isDirty
.align 2
.type clear_isDirty,@function
clear_isDirty: ; @clear_isDirty
; BB#0: ; %entry
ret
.Lfunc_end16:
.size clear_isDirty, .Lfunc_end16-clear_isDirty
.align 2
.type init_hw,@function
init_hw: ; @init_hw
; BB#0: ; %entry
push.w r4
mov.w r1, r4
call #msp_watchdog_disable
mov.w &0x0130, r12
and.w #-2, r12
mov.w r12, &0x0130
call #msp_clock_setup
pop.w r4
ret
.Lfunc_end17:
.size init_hw, .Lfunc_end17-init_hw
.align 2
.type acquire_sample,@function
acquire_sample: ; @acquire_sample
; BB#0: ; %entry
push.w r4
mov.w r1, r4
sub.w #6, r1
;DEBUG_VALUE: acquire_sample:prev_sample <- undef
mov.w r15, r12
mov.w r15, -2(r4)
add.w #1, r15
and.w #3, r15
mov.w r15, -4(r4)
mov.w r12, -6(r4) ; 2-byte Folded Spill
add.w #6, r1
pop.w r4
ret
.Lfunc_end18:
.size acquire_sample, .Lfunc_end18-acquire_sample
.globl msp_watchdog_enable
.align 2
.type msp_watchdog_enable,@function
msp_watchdog_enable: ; @msp_watchdog_enable
; BB#0: ; %entry
push.w r4
mov.w r1, r4
;DEBUG_VALUE: msp_watchdog_enable:bits <- R15
;DEBUG_VALUE: msp_watchdog_enable:bits <- R15
mov.b r15, r12
bis.w #23048, r15
mov.w r15, &0x015C
mov.b r12, &watchdog_bits
pop.w r4
ret
.Lfunc_end19:
.size msp_watchdog_enable, .Lfunc_end19-msp_watchdog_enable
.globl msp_watchdog_disable
.align 2
.type msp_watchdog_disable,@function
msp_watchdog_disable: ; @msp_watchdog_disable
; BB#0: ; %entry
push.w r4
mov.w r1, r4
mov.w #23168, &0x015C
pop.w r4
ret
.Lfunc_end20:
.size msp_watchdog_disable, .Lfunc_end20-msp_watchdog_disable
.globl msp_watchdog_kick
.align 2
.type msp_watchdog_kick,@function
msp_watchdog_kick: ; @msp_watchdog_kick
; BB#0: ; %entry
push.w r4
mov.w r1, r4
mov.b &watchdog_bits, r12
bis.w #23048, r12
mov.w r12, &0x015C
pop.w r4
ret
.Lfunc_end21:
.size msp_watchdog_kick, .Lfunc_end21-msp_watchdog_kick
.globl memcpy
.align 2
.type memcpy,@function
memcpy: ; @memcpy
; BB#0: ; %entry
push.w r4
mov.w r1, r4
sub.w #8, r1
;DEBUG_VALUE: memcpy:dest <- R15
;DEBUG_VALUE: memcpy:src <- R14
;DEBUG_VALUE: memcpy:n <- R13
;DEBUG_VALUE: memcpy:n <- R13
;DEBUG_VALUE: memcpy:src <- R14
;DEBUG_VALUE: memcpy:dest <- R15
;DEBUG_VALUE: memcpy:i <- 0
mov.w r13, r12
;DEBUG_VALUE: memcpy:src <- R14
;DEBUG_VALUE: memcpy:dest <- R15
cmp.w #0, r13
mov.w r15, -2(r4) ; 2-byte Folded Spill
;DEBUG_VALUE: memcpy:dest <- [FP+-2]
mov.w r12, -4(r4) ; 2-byte Folded Spill
mov.w r14, -6(r4) ; 2-byte Folded Spill
;DEBUG_VALUE: memcpy:src <- [FP+-6]
jeq .LBB22_4
jmp .LBB22_1
.LBB22_1: ; %while.body.preheader
mov.w #0, r12
mov.w r12, -8(r4) ; 2-byte Folded Spill
jmp .LBB22_2
.LBB22_2: ; %while.body
; =>This Inner Loop Header: Depth=1
mov.w -8(r4), r12 ; 2-byte Folded Reload
mov.w -6(r4), r13 ; 2-byte Folded Reload
add.w r12, r13
mov.b 0(r13), r14
mov.w -2(r4), r13 ; 2-byte Folded Reload
add.w r12, r13
mov.b r14, 0(r13)
add.w #1, r12
;DEBUG_VALUE: memcpy:i <- R12
mov.w -4(r4), r13 ; 2-byte Folded Reload
cmp.w r13, r12
mov.w r12, -8(r4) ; 2-byte Folded Spill
jne .LBB22_2
jmp .LBB22_3
.LBB22_3: ; %while.end.loopexit
jmp .LBB22_4
.LBB22_4: ; %while.end
mov.w -2(r4), r15 ; 2-byte Folded Reload
add.w #8, r1
pop.w r4
ret
.Lfunc_end22:
.size memcpy, .Lfunc_end22-memcpy
.globl my_memset
.align 2
.type my_memset,@function
my_memset: ; @my_memset
; BB#0: ; %entry
push.w r4
mov.w r1, r4
;DEBUG_VALUE: my_memset:s <- R15
;DEBUG_VALUE: my_memset:c <- R14
;DEBUG_VALUE: my_memset:n <- R13
;APP
mov r15, r12
add r15, r13
cmp r13, r12
jz $+10
mov.b r14, 0(r12)
inc r12
jmp $-10
;NO_APP
pop.w r4
ret
.Lfunc_end23:
.size my_memset, .Lfunc_end23-my_memset
.globl msp_clock_setup
.align 2
.type msp_clock_setup,@function
msp_clock_setup: ; @msp_clock_setup
; BB#0: ; %entry