-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.i
1036 lines (626 loc) · 23.4 KB
/
main.i
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
# 1 "main.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "main.c"
# 1 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/stdlib.h" 1 3
# 10 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/stdlib.h" 3
# 1 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/machine/ieeefp.h" 1 3
# 11 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/stdlib.h" 2 3
# 1 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/_ansi.h" 1 3
# 15 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/_ansi.h" 3
# 1 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/newlib.h" 1 3
# 14 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/newlib.h" 3
# 1 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/_newlib_version.h" 1 3
# 15 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/newlib.h" 2 3
# 16 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/_ansi.h" 2 3
# 1 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/config.h" 1 3
# 1 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/machine/ieeefp.h" 1 3
# 5 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/config.h" 2 3
# 1 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/features.h" 1 3
# 6 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/config.h" 2 3
# 17 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/_ansi.h" 2 3
# 12 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/stdlib.h" 2 3
# 1 "/Users/nishatfiroj/CS2261/devkitARM/lib/gcc/arm-none-eabi/7.1.0/include/stddef.h" 1 3 4
# 216 "/Users/nishatfiroj/CS2261/devkitARM/lib/gcc/arm-none-eabi/7.1.0/include/stddef.h" 3 4
# 216 "/Users/nishatfiroj/CS2261/devkitARM/lib/gcc/arm-none-eabi/7.1.0/include/stddef.h" 3 4
typedef unsigned int size_t;
# 328 "/Users/nishatfiroj/CS2261/devkitARM/lib/gcc/arm-none-eabi/7.1.0/include/stddef.h" 3 4
typedef unsigned int wchar_t;
# 17 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/stdlib.h" 2 3
# 1 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/reent.h" 1 3
# 13 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/reent.h" 3
# 1 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/_ansi.h" 1 3
# 14 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/reent.h" 2 3
# 1 "/Users/nishatfiroj/CS2261/devkitARM/lib/gcc/arm-none-eabi/7.1.0/include/stddef.h" 1 3 4
# 149 "/Users/nishatfiroj/CS2261/devkitARM/lib/gcc/arm-none-eabi/7.1.0/include/stddef.h" 3 4
typedef int ptrdiff_t;
# 15 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/reent.h" 2 3
# 1 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/_types.h" 1 3
# 24 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/_types.h" 3
# 1 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/machine/_types.h" 1 3
# 1 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/machine/_default_types.h" 1 3
# 41 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/machine/_default_types.h" 3
typedef signed char __int8_t;
typedef unsigned char __uint8_t;
# 55 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/machine/_default_types.h" 3
typedef short int __int16_t;
typedef short unsigned int __uint16_t;
# 77 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/machine/_default_types.h" 3
typedef long int __int32_t;
typedef long unsigned int __uint32_t;
# 103 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/machine/_default_types.h" 3
typedef long long int __int64_t;
typedef long long unsigned int __uint64_t;
# 134 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/machine/_default_types.h" 3
typedef signed char __int_least8_t;
typedef unsigned char __uint_least8_t;
# 160 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/machine/_default_types.h" 3
typedef short int __int_least16_t;
typedef short unsigned int __uint_least16_t;
# 182 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/machine/_default_types.h" 3
typedef long int __int_least32_t;
typedef long unsigned int __uint_least32_t;
# 200 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/machine/_default_types.h" 3
typedef long long int __int_least64_t;
typedef long long unsigned int __uint_least64_t;
# 214 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/machine/_default_types.h" 3
typedef long long int __intmax_t;
typedef long long unsigned int __uintmax_t;
typedef int __intptr_t;
typedef unsigned int __uintptr_t;
# 5 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/machine/_types.h" 2 3
typedef __int64_t _off_t;
typedef __int64_t _fpos_t;
typedef __uint32_t __ino_t;
typedef __uint32_t __dev_t;
# 25 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/_types.h" 2 3
# 1 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/lock.h" 1 3
# 1 "/Users/nishatfiroj/CS2261/devkitARM/lib/gcc/arm-none-eabi/7.1.0/include/stdint.h" 1 3 4
# 9 "/Users/nishatfiroj/CS2261/devkitARM/lib/gcc/arm-none-eabi/7.1.0/include/stdint.h" 3 4
# 1 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/stdint.h" 1 3 4
# 13 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/stdint.h" 3 4
# 1 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/_intsup.h" 1 3 4
# 35 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/_intsup.h" 3 4
# 187 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/_intsup.h" 3 4
# 14 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/stdint.h" 2 3 4
# 1 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/_stdint.h" 1 3 4
# 20 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/_stdint.h" 3 4
typedef __int8_t int8_t ;
typedef __uint8_t uint8_t ;
typedef __int16_t int16_t ;
typedef __uint16_t uint16_t ;
typedef __int32_t int32_t ;
typedef __uint32_t uint32_t ;
typedef __int64_t int64_t ;
typedef __uint64_t uint64_t ;
typedef __intmax_t intmax_t;
typedef __uintmax_t uintmax_t;
typedef __intptr_t intptr_t;
typedef __uintptr_t uintptr_t;
# 15 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/stdint.h" 2 3 4
typedef __int_least8_t int_least8_t;
typedef __uint_least8_t uint_least8_t;
typedef __int_least16_t int_least16_t;
typedef __uint_least16_t uint_least16_t;
typedef __int_least32_t int_least32_t;
typedef __uint_least32_t uint_least32_t;
typedef __int_least64_t int_least64_t;
typedef __uint_least64_t uint_least64_t;
# 51 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/stdint.h" 3 4
typedef int int_fast8_t;
typedef unsigned int uint_fast8_t;
# 61 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/stdint.h" 3 4
typedef int int_fast16_t;
typedef unsigned int uint_fast16_t;
# 71 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/stdint.h" 3 4
typedef int int_fast32_t;
typedef unsigned int uint_fast32_t;
# 81 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/stdint.h" 3 4
typedef long long int int_fast64_t;
typedef long long unsigned int uint_fast64_t;
# 10 "/Users/nishatfiroj/CS2261/devkitARM/lib/gcc/arm-none-eabi/7.1.0/include/stdint.h" 2 3 4
# 6 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/lock.h" 2 3
typedef int32_t _LOCK_T;
struct __lock_t {
_LOCK_T lock;
uint32_t thread_tag;
uint32_t counter;
};
typedef struct __lock_t _LOCK_RECURSIVE_T;
extern void __libc_lock_init(_LOCK_T *lock);
extern void __libc_lock_init_recursive(_LOCK_RECURSIVE_T *lock);
extern void __libc_lock_close(_LOCK_T *lock);
extern void __libc_lock_close_recursive(_LOCK_RECURSIVE_T *lock);
extern void __libc_lock_acquire(_LOCK_T *lock);
extern void __libc_lock_acquire_recursive(_LOCK_RECURSIVE_T *lock);
extern void __libc_lock_release(_LOCK_T *lock);
extern void __libc_lock_release_recursive(_LOCK_RECURSIVE_T *lock);
extern int __libc_lock_try_acquire(_LOCK_T *lock);
extern int __libc_lock_try_acquire_recursive(_LOCK_RECURSIVE_T *lock);
# 26 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/_types.h" 2 3
typedef long __blkcnt_t;
typedef long __blksize_t;
typedef __uint64_t __fsblkcnt_t;
typedef __uint32_t __fsfilcnt_t;
# 50 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/_types.h" 3
typedef int __pid_t;
typedef unsigned short __uid_t;
typedef unsigned short __gid_t;
typedef __uint32_t __id_t;
# 88 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/_types.h" 3
typedef __uint32_t __mode_t;
__extension__ typedef long long _off64_t;
typedef _off_t __off_t;
typedef _off64_t __loff_t;
typedef long __key_t;
# 129 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/_types.h" 3
typedef unsigned int __size_t;
# 145 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/_types.h" 3
typedef signed int _ssize_t;
# 156 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/_types.h" 3
typedef _ssize_t __ssize_t;
# 1 "/Users/nishatfiroj/CS2261/devkitARM/lib/gcc/arm-none-eabi/7.1.0/include/stddef.h" 1 3 4
# 357 "/Users/nishatfiroj/CS2261/devkitARM/lib/gcc/arm-none-eabi/7.1.0/include/stddef.h" 3 4
typedef unsigned int wint_t;
# 160 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/_types.h" 2 3
typedef struct
{
int __count;
union
{
wint_t __wch;
unsigned char __wchb[4];
} __value;
} _mbstate_t;
typedef _LOCK_RECURSIVE_T _flock_t;
typedef void *_iconv_t;
typedef unsigned long __clock_t;
typedef long __time_t;
typedef unsigned long __clockid_t;
typedef unsigned long __timer_t;
typedef __uint8_t __sa_family_t;
typedef __uint32_t __socklen_t;
typedef unsigned short __nlink_t;
typedef long __suseconds_t;
typedef unsigned long __useconds_t;
typedef char * __va_list;
# 16 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/reent.h" 2 3
typedef unsigned long __ULong;
# 38 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/reent.h" 3
struct _reent;
struct __locale_t;
struct _Bigint
{
struct _Bigint *_next;
int _k, _maxwds, _sign, _wds;
__ULong _x[1];
};
struct __tm
{
int __tm_sec;
int __tm_min;
int __tm_hour;
int __tm_mday;
int __tm_mon;
int __tm_year;
int __tm_wday;
int __tm_yday;
int __tm_isdst;
};
struct _on_exit_args {
void * _fnargs[32];
void * _dso_handle[32];
__ULong _fntypes;
__ULong _is_cxa;
};
# 93 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/reent.h" 3
struct _atexit {
struct _atexit *_next;
int _ind;
void (*_fns[32])(void);
struct _on_exit_args _on_exit_args;
};
# 117 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/reent.h" 3
struct __sbuf {
unsigned char *_base;
int _size;
};
# 181 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/reent.h" 3
struct __sFILE {
unsigned char *_p;
int _r;
int _w;
short _flags;
short _file;
struct __sbuf _bf;
int _lbfsize;
void * _cookie;
int (* _read) (struct _reent *, void *, char *, int)
;
int (* _write) (struct _reent *, void *, const char *, int)
;
_fpos_t (* _seek) (struct _reent *, void *, _fpos_t, int);
int (* _close) (struct _reent *, void *);
struct __sbuf _ub;
unsigned char *_up;
int _ur;
unsigned char _ubuf[3];
unsigned char _nbuf[1];
struct __sbuf _lb;
int _blksize;
_off_t _offset;
struct _reent *_data;
_flock_t _lock;
_mbstate_t _mbstate;
int _flags2;
};
# 287 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/reent.h" 3
typedef struct __sFILE __FILE;
struct _glue
{
struct _glue *_next;
int _niobs;
__FILE *_iobs;
};
# 319 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/reent.h" 3
struct _rand48 {
unsigned short _seed[3];
unsigned short _mult[3];
unsigned short _add;
};
# 571 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/reent.h" 3
struct _reent
{
int _errno;
__FILE *_stdin, *_stdout, *_stderr;
int _inc;
char _emergency[25];
int _unspecified_locale_info;
struct __locale_t *_locale;
int __sdidinit;
void (* __cleanup) (struct _reent *);
struct _Bigint *_result;
int _result_k;
struct _Bigint *_p5s;
struct _Bigint **_freelist;
int _cvtlen;
char *_cvtbuf;
union
{
struct
{
unsigned int _unused_rand;
char * _strtok_last;
char _asctime_buf[26];
struct __tm _localtime_buf;
int _gamma_signgam;
__extension__ unsigned long long _rand_next;
struct _rand48 _r48;
_mbstate_t _mblen_state;
_mbstate_t _mbtowc_state;
_mbstate_t _wctomb_state;
char _l64a_buf[8];
char _signal_buf[24];
int _getdate_err;
_mbstate_t _mbrlen_state;
_mbstate_t _mbrtowc_state;
_mbstate_t _mbsrtowcs_state;
_mbstate_t _wcrtomb_state;
_mbstate_t _wcsrtombs_state;
int _h_errno;
} _reent;
struct
{
unsigned char * _nextf[30];
unsigned int _nmalloc[30];
} _unused;
} _new;
struct _atexit *_atexit;
struct _atexit _atexit0;
void (**(_sig_func))(int);
struct _glue __sglue;
__FILE __sf[3];
void *deviceData;
};
# 769 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/reent.h" 3
extern struct _reent *_impure_ptr ;
extern struct _reent *const _global_impure_ptr ;
void _reclaim_reent (struct _reent *);
struct _reent * __getreent (void);
# 19 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/stdlib.h" 2 3
# 1 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/cdefs.h" 1 3
# 45 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/cdefs.h" 3
# 1 "/Users/nishatfiroj/CS2261/devkitARM/lib/gcc/arm-none-eabi/7.1.0/include/stddef.h" 1 3 4
# 46 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/sys/cdefs.h" 2 3
# 20 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/stdlib.h" 2 3
# 1 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/machine/stdlib.h" 1 3
# 21 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/stdlib.h" 2 3
# 33 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/stdlib.h" 3
typedef struct
{
int quot;
int rem;
} div_t;
typedef struct
{
long quot;
long rem;
} ldiv_t;
typedef struct
{
long long int quot;
long long int rem;
} lldiv_t;
typedef int (*__compar_fn_t) (const void *, const void *);
int __locale_mb_cur_max (void);
void abort (void) __attribute__ ((__noreturn__));
int abs (int);
int atexit (void (*__func)(void));
double atof (const char *__nptr);
int atoi (const char *__nptr);
int _atoi_r (struct _reent *, const char *__nptr);
long atol (const char *__nptr);
long _atol_r (struct _reent *, const char *__nptr);
void * bsearch (const void * __key, const void * __base, size_t __nmemb, size_t __size, __compar_fn_t _compar)
;
void * calloc (size_t __nmemb, size_t __size) ;
div_t div (int __numer, int __denom);
void exit (int __status) __attribute__ ((__noreturn__));
void free (void *) ;
char * getenv (const char *__string);
char * _getenv_r (struct _reent *, const char *__string);
char * _findenv (const char *, int *);
char * _findenv_r (struct _reent *, const char *, int *);
long labs (long);
ldiv_t ldiv (long __numer, long __denom);
void * malloc (size_t __size) ;
int mblen (const char *, size_t);
int _mblen_r (struct _reent *, const char *, size_t, _mbstate_t *);
int mbtowc (wchar_t *restrict, const char *restrict, size_t);
int _mbtowc_r (struct _reent *, wchar_t *restrict, const char *restrict, size_t, _mbstate_t *);
int wctomb (char *, wchar_t);
int _wctomb_r (struct _reent *, char *, wchar_t, _mbstate_t *);
size_t mbstowcs (wchar_t *restrict, const char *restrict, size_t);
size_t _mbstowcs_r (struct _reent *, wchar_t *restrict, const char *restrict, size_t, _mbstate_t *);
size_t wcstombs (char *restrict, const wchar_t *restrict, size_t);
size_t _wcstombs_r (struct _reent *, char *restrict, const wchar_t *restrict, size_t, _mbstate_t *);
# 133 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/stdlib.h" 3
char * _mkdtemp_r (struct _reent *, char *);
int _mkostemp_r (struct _reent *, char *, int);
int _mkostemps_r (struct _reent *, char *, int, int);
int _mkstemp_r (struct _reent *, char *);
int _mkstemps_r (struct _reent *, char *, int);
char * _mktemp_r (struct _reent *, char *) __attribute__ ((__deprecated__("the use of `mktemp' is dangerous; use `mkstemp' instead")));
void qsort (void * __base, size_t __nmemb, size_t __size, __compar_fn_t _compar);
int rand (void);
void * realloc (void * __r, size_t __size) ;
# 154 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/stdlib.h" 3
void srand (unsigned __seed);
double strtod (const char *restrict __n, char **restrict __end_PTR);
double _strtod_r (struct _reent *,const char *restrict __n, char **restrict __end_PTR);
float strtof (const char *restrict __n, char **restrict __end_PTR);
long strtol (const char *restrict __n, char **restrict __end_PTR, int __base);
long _strtol_r (struct _reent *,const char *restrict __n, char **restrict __end_PTR, int __base);
unsigned long strtoul (const char *restrict __n, char **restrict __end_PTR, int __base);
unsigned long _strtoul_r (struct _reent *,const char *restrict __n, char **restrict __end_PTR, int __base);
# 186 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/stdlib.h" 3
int system (const char *__string);
# 197 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/stdlib.h" 3
void _Exit (int __status) __attribute__ ((__noreturn__));
int _putenv_r (struct _reent *, char *__string);
void * _reallocf_r (struct _reent *, void *, size_t);
int _setenv_r (struct _reent *, const char *__string, const char *__value, int __overwrite);
# 219 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/stdlib.h" 3
char * __itoa (int, char *, int);
char * __utoa (unsigned, char *, int);
# 258 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/stdlib.h" 3
long long atoll (const char *__nptr);
long long _atoll_r (struct _reent *, const char *__nptr);
long long llabs (long long);
lldiv_t lldiv (long long __numer, long long __denom);
long long strtoll (const char *restrict __n, char **restrict __end_PTR, int __base);
long long _strtoll_r (struct _reent *, const char *restrict __n, char **restrict __end_PTR, int __base);
unsigned long long strtoull (const char *restrict __n, char **restrict __end_PTR, int __base);
unsigned long long _strtoull_r (struct _reent *, const char *restrict __n, char **restrict __end_PTR, int __base);
# 279 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/stdlib.h" 3
int _unsetenv_r (struct _reent *, const char *__string);
char * _dtoa_r (struct _reent *, double, int, int, int *, int*, char**);
void * _malloc_r (struct _reent *, size_t) ;
void * _calloc_r (struct _reent *, size_t, size_t) ;
void _free_r (struct _reent *, void *) ;
void * _realloc_r (struct _reent *, void *, size_t) ;
void _mstats_r (struct _reent *, char *);
int _system_r (struct _reent *, const char *);
void __eprintf (const char *, const char *, unsigned int, const char *);
# 316 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/stdlib.h" 3
extern long double _strtold_r (struct _reent *, const char *restrict, char **restrict);
extern long double strtold (const char *restrict, char **restrict);
# 333 "/Users/nishatfiroj/CS2261/devkitARM/arm-none-eabi/include/stdlib.h" 3
# 2 "main.c" 2
# 1 "myLib.h" 1
# 5 "myLib.h"
typedef unsigned short u16;
# 25 "myLib.h"
extern unsigned short *videoBuffer;
# 44 "myLib.h"
void setPixel(int row, int col, unsigned short color);
void drawRect(int row, int col, int height, int width, unsigned short color);
void fillScreen(unsigned short color);
void waitForVBlank();
# 69 "myLib.h"
extern unsigned short oldButtons;
extern unsigned short buttons;
# 80 "myLib.h"
int collision(int rowA, int colA, int heightA, int widthA, int rowB, int colB, int heightB, int widthB);
# 3 "main.c" 2
# 1 "game.h" 1
typedef struct {
int row;
int col;
int oldRow;
int oldCol;
int cdel;
int height;
int width;
unsigned short color;
} PLAYER;
typedef struct {
int row;
int col;
int oldRow;
int oldCol;
int rdel;
int cdel;
int height;
int width;
unsigned short color;
int active;
int erased;
} BALL;
typedef struct {
int row;
int col;
int oldRow;
int oldCol;
int rdel;
int cdel;
int height;
int width;
unsigned short color;
int active;
int erased;
} GOAL;
extern PLAYER player;
extern BALL balls[5];
extern GOAL goals[5];
extern int goalsRemaining;
void initGame();
void updateGame();
void drawGame();
void initPlayer();
void updatePlayer();
void drawPlayer();
void initBalls();
void updateBall(BALL *);
void drawBall(BALL *);
void initGoals();
void updateGoal(GOAL *);
void drawGoal(GOAL *);
void drawString(int row, int col, char *str, unsigned short color);
void goToLose();
void goToWin();
void deactivateAllMovingObjects();
# 4 "main.c" 2
void initialize();
void startState();
void winState();
void pauseState();
void loseState();
void gameState();
void startState();
void goToStart();
void gameState();
void goToGame();
void pauseState();
void goToPause();
void winState();
void goToWin();
void loseState();
void goToLose();
enum {START, GAME, PAUSE, WIN, LOSE};
int state;
unsigned short buttons;
unsigned short oldButtons;
int seed;
int main() {
initialize();
while(1) {
oldButtons = buttons;
buttons = (*(volatile unsigned short *)0x04000130);
switch(state) {
case START:
startState();
break;
case GAME:
gameState();
break;
case PAUSE:
pauseState();
break;
case WIN:
winState();
break;
case LOSE:
loseState();
break;
}
}
}
void initialize() {
(*(unsigned short *)0x4000000) = 3 | (1<<10);
goToStart();
}
void startState(){
seed++;
if ((!(~(oldButtons)&((1<<0))) && (~buttons & ((1<<0))))) {
goToGame();
srand(seed);
initGame();
}
}
void goToStart() {
fillScreen(((31) | (31)<<5 | (31)<<10));
drawString(80, 100, "START", 0);
state = START;
}
void gameState() {
updateGame();
waitForVBlank();
drawGame();
if ((!(~(oldButtons)&((1<<0))) && (~buttons & ((1<<0))))) {
goToPause();
}
if ((!(~(oldButtons)&((1<<1))) && (~buttons & ((1<<1))))) {
goToLose();
}
if (goalsRemaining == 0) {
goToWin();
}
}
void goToGame() {
fillScreen(((3) | (7)<<5 | (10)<<10));
state = GAME;
}
void pauseState() {
if ((!(~(oldButtons)&((1<<0))) && (~buttons & ((1<<0))))) {