summaryrefslogtreecommitdiff
path: root/src/csview.c
blob: 1937f4d925a717407433a4ce4564683ad36debd6 (plain)
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
/* csview.c generated by valac, the Vala compiler
 * generated from csview.vala, do not modify */

/*
 * Copyright 2010 Joakim Sindholt <opensource@zhasha.com>
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * on the rights to use, copy, modify, merge, publish, distribute, sub
 * license, and/or sell copies of the Software, and to permit persons to whom
 * the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the next
 * paragraph) shall be included in all copies or substantial portions of the
 * Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
 * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
 * USE OR OTHER DEALINGS IN THE SOFTWARE. */

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <gobject/gvaluecollector.h>


#define GUI_TYPE_CS_LIST_MODEL (gui_cs_list_model_get_type ())
#define GUI_CS_LIST_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GUI_TYPE_CS_LIST_MODEL, GUICSListModel))
#define GUI_CS_LIST_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GUI_TYPE_CS_LIST_MODEL, GUICSListModelClass))
#define GUI_IS_CS_LIST_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GUI_TYPE_CS_LIST_MODEL))
#define GUI_IS_CS_LIST_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GUI_TYPE_CS_LIST_MODEL))
#define GUI_CS_LIST_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GUI_TYPE_CS_LIST_MODEL, GUICSListModelClass))

typedef struct _GUICSListModel GUICSListModel;
typedef struct _GUICSListModelClass GUICSListModelClass;
typedef struct _GUICSListModelPrivate GUICSListModelPrivate;

#define EMULATION_TYPE_CS (emulation_cs_get_type ())
#define EMULATION_CS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_CS, EmulationCS))
#define EMULATION_CS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_CS, EmulationCSClass))
#define EMULATION_IS_CS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_CS))
#define EMULATION_IS_CS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_CS))
#define EMULATION_CS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_CS, EmulationCSClass))

typedef struct _EmulationCS EmulationCS;
typedef struct _EmulationCSClass EmulationCSClass;

#define EMULATION_TYPE_SPEC (emulation_spec_get_type ())
#define EMULATION_SPEC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_SPEC, EmulationSpec))
#define EMULATION_SPEC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_SPEC, EmulationSpecClass))
#define EMULATION_IS_SPEC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_SPEC))
#define EMULATION_IS_SPEC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_SPEC))
#define EMULATION_SPEC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_SPEC, EmulationSpecClass))

typedef struct _EmulationSpec EmulationSpec;
typedef struct _EmulationSpecClass EmulationSpecClass;

#define GUI_CS_LIST_MODEL_TYPE_COLUMNS (gui_cs_list_model_columns_get_type ())

#define GUI_CS_LIST_MODEL_TYPE_ROW_TYPE (gui_cs_list_model_row_type_get_type ())
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define EMULATION_TYPE_REGISTER_LIST (emulation_register_list_get_type ())
#define EMULATION_REGISTER_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_REGISTER_LIST, EmulationRegisterList))
#define EMULATION_REGISTER_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_REGISTER_LIST, EmulationRegisterListClass))
#define EMULATION_IS_REGISTER_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_REGISTER_LIST))
#define EMULATION_IS_REGISTER_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_REGISTER_LIST))
#define EMULATION_REGISTER_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_REGISTER_LIST, EmulationRegisterListClass))

typedef struct _EmulationRegisterList EmulationRegisterList;
typedef struct _EmulationRegisterListClass EmulationRegisterListClass;

#define EMULATION_TYPE_REGISTER (emulation_register_get_type ())
#define EMULATION_REGISTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_REGISTER, EmulationRegister))
#define EMULATION_REGISTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_REGISTER, EmulationRegisterClass))
#define EMULATION_IS_REGISTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_REGISTER))
#define EMULATION_IS_REGISTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_REGISTER))
#define EMULATION_REGISTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_REGISTER, EmulationRegisterClass))

typedef struct _EmulationRegister EmulationRegister;
typedef struct _EmulationRegisterClass EmulationRegisterClass;

#define EMULATION_TYPE_REGISTER_INFO (emulation_register_info_get_type ())
#define EMULATION_REGISTER_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_REGISTER_INFO, EmulationRegisterInfo))
#define EMULATION_REGISTER_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_REGISTER_INFO, EmulationRegisterInfoClass))
#define EMULATION_IS_REGISTER_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_REGISTER_INFO))
#define EMULATION_IS_REGISTER_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_REGISTER_INFO))
#define EMULATION_REGISTER_INFO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_REGISTER_INFO, EmulationRegisterInfoClass))

typedef struct _EmulationRegisterInfo EmulationRegisterInfo;
typedef struct _EmulationRegisterInfoClass EmulationRegisterInfoClass;

#define GUI_CS_LIST_MODEL_TYPE_CS_ITER (gui_cs_list_model_cs_iter_get_type ())
#define GUI_CS_LIST_MODEL_CS_ITER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GUI_CS_LIST_MODEL_TYPE_CS_ITER, GUICSListModelCSIter))
#define GUI_CS_LIST_MODEL_CS_ITER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GUI_CS_LIST_MODEL_TYPE_CS_ITER, GUICSListModelCSIterClass))
#define GUI_CS_LIST_MODEL_IS_CS_ITER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GUI_CS_LIST_MODEL_TYPE_CS_ITER))
#define GUI_CS_LIST_MODEL_IS_CS_ITER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GUI_CS_LIST_MODEL_TYPE_CS_ITER))
#define GUI_CS_LIST_MODEL_CS_ITER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GUI_CS_LIST_MODEL_TYPE_CS_ITER, GUICSListModelCSIterClass))

typedef struct _GUICSListModelCSIter GUICSListModelCSIter;
typedef struct _GUICSListModelCSIterClass GUICSListModelCSIterClass;
typedef struct _EmulationCSPrivate EmulationCSPrivate;

#define EMULATION_TYPE_PACKET_BASE (emulation_packet_base_get_type ())
#define EMULATION_PACKET_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_PACKET_BASE, EmulationPacketBase))
#define EMULATION_PACKET_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_PACKET_BASE, EmulationPacketBaseClass))
#define EMULATION_IS_PACKET_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_PACKET_BASE))
#define EMULATION_IS_PACKET_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_PACKET_BASE))
#define EMULATION_PACKET_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_PACKET_BASE, EmulationPacketBaseClass))

typedef struct _EmulationPacketBase EmulationPacketBase;
typedef struct _EmulationPacketBaseClass EmulationPacketBaseClass;
#define _gui_cs_list_model_cs_iter_unref0(var) ((var == NULL) ? NULL : (var = (gui_cs_list_model_cs_iter_unref (var), NULL)))

#define EMULATION_TYPE_PACKET0 (emulation_packet0_get_type ())
#define EMULATION_PACKET0(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_PACKET0, EmulationPacket0))
#define EMULATION_PACKET0_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_PACKET0, EmulationPacket0Class))
#define EMULATION_IS_PACKET0(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_PACKET0))
#define EMULATION_IS_PACKET0_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_PACKET0))
#define EMULATION_PACKET0_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_PACKET0, EmulationPacket0Class))

typedef struct _EmulationPacket0 EmulationPacket0;
typedef struct _EmulationPacket0Class EmulationPacket0Class;

#define EMULATION_TYPE_PACKET1 (emulation_packet1_get_type ())
#define EMULATION_PACKET1(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_PACKET1, EmulationPacket1))
#define EMULATION_PACKET1_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_PACKET1, EmulationPacket1Class))
#define EMULATION_IS_PACKET1(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_PACKET1))
#define EMULATION_IS_PACKET1_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_PACKET1))
#define EMULATION_PACKET1_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_PACKET1, EmulationPacket1Class))

typedef struct _EmulationPacket1 EmulationPacket1;
typedef struct _EmulationPacket1Class EmulationPacket1Class;
#define _gtk_tree_path_free0(var) ((var == NULL) ? NULL : (var = (gtk_tree_path_free (var), NULL)))

#define EMULATION_TYPE_BITFIELD (emulation_bitfield_get_type ())
#define EMULATION_BITFIELD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_BITFIELD, EmulationBitfield))
#define EMULATION_BITFIELD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_BITFIELD, EmulationBitfieldClass))
#define EMULATION_IS_BITFIELD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_BITFIELD))
#define EMULATION_IS_BITFIELD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_BITFIELD))
#define EMULATION_BITFIELD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_BITFIELD, EmulationBitfieldClass))

typedef struct _EmulationBitfield EmulationBitfield;
typedef struct _EmulationBitfieldClass EmulationBitfieldClass;
typedef struct _EmulationPacketBasePrivate EmulationPacketBasePrivate;
#define _g_free0(var) (var = (g_free (var), NULL))

#define EMULATION_TYPE_PACKET3 (emulation_packet3_get_type ())
#define EMULATION_PACKET3(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_PACKET3, EmulationPacket3))
#define EMULATION_PACKET3_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_PACKET3, EmulationPacket3Class))
#define EMULATION_IS_PACKET3(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_PACKET3))
#define EMULATION_IS_PACKET3_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_PACKET3))
#define EMULATION_PACKET3_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_PACKET3, EmulationPacket3Class))

typedef struct _EmulationPacket3 EmulationPacket3;
typedef struct _EmulationPacket3Class EmulationPacket3Class;
typedef struct _GUICSListModelCSIterPrivate GUICSListModelCSIterPrivate;
typedef struct _GUICSListModelParamSpecCSIter GUICSListModelParamSpecCSIter;

#define GUI_TYPE_CS_VIEW (gui_cs_view_get_type ())
#define GUI_CS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GUI_TYPE_CS_VIEW, GUICSView))
#define GUI_CS_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GUI_TYPE_CS_VIEW, GUICSViewClass))
#define GUI_IS_CS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GUI_TYPE_CS_VIEW))
#define GUI_IS_CS_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GUI_TYPE_CS_VIEW))
#define GUI_CS_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GUI_TYPE_CS_VIEW, GUICSViewClass))

typedef struct _GUICSView GUICSView;
typedef struct _GUICSViewClass GUICSViewClass;
typedef struct _GUICSViewPrivate GUICSViewPrivate;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define EMULATION_TYPE_SPEC_ENTRY (emulation_spec_entry_get_type ())
typedef struct _EmulationSpecEntry EmulationSpecEntry;

struct _GUICSListModel {
	GObject parent_instance;
	GUICSListModelPrivate * priv;
};

struct _GUICSListModelClass {
	GObjectClass parent_class;
};

struct _GUICSListModelPrivate {
	EmulationCS* m_cs;
	EmulationSpec* m_spec;
	gint m_stamp;
};

typedef enum  {
	GUI_CS_LIST_MODEL_COLUMNS_NAME = 0,
	GUI_CS_LIST_MODEL_COLUMNS_VALUE,
	GUI_CS_LIST_MODEL_COLUMNS_TARGET,
	GUI_CS_LIST_MODEL_COLUMNS_COUNT
} GUICSListModelColumns;

typedef enum  {
	GUI_CS_LIST_MODEL_ROW_TYPE_PACKET = 0,
	GUI_CS_LIST_MODEL_ROW_TYPE_HEADER,
	GUI_CS_LIST_MODEL_ROW_TYPE_DWORD,
	GUI_CS_LIST_MODEL_ROW_TYPE_VARIANT,
	GUI_CS_LIST_MODEL_ROW_TYPE_BITFIELD,
	GUI_CS_LIST_MODEL_ROW_TYPE_HEADER_BITFIELD
} GUICSListModelRowType;

struct _EmulationCS {
	GObject parent_instance;
	EmulationCSPrivate * priv;
	EmulationPacketBase** packets;
	gint packets_length1;
	guint32* dwords;
	gint dwords_length1;
};

struct _EmulationCSClass {
	GObjectClass parent_class;
};

struct _EmulationPacketBase {
	GObject parent_instance;
	EmulationPacketBasePrivate * priv;
	guint32* dwords;
	guint32 header;
};

struct _EmulationPacketBaseClass {
	GObjectClass parent_class;
	guint (*get_length) (EmulationPacketBase* self);
};

struct _GUICSListModelCSIter {
	GTypeInstance parent_instance;
	volatile int ref_count;
	GUICSListModelCSIterPrivate * priv;
};

struct _GUICSListModelCSIterClass {
	GTypeClass parent_class;
	void (*finalize) (GUICSListModelCSIter *self);
};

struct _GUICSListModelCSIterPrivate {
	GtkTreeIter* m_iter;
};

struct _GUICSListModelParamSpecCSIter {
	GParamSpec parent_instance;
};

struct _GUICSView {
	GtkWindow parent_instance;
	GUICSViewPrivate * priv;
};

struct _GUICSViewClass {
	GtkWindowClass parent_class;
};

struct _GUICSViewPrivate {
	GtkButton* up_btn;
	GtkButton* down_btn;
	GUICSListModel** models;
	gint models_length1;
	gint models_size;
	GtkTreeView* cs_view;
};

struct _EmulationSpecEntry {
	EmulationSpec* spec;
	char* name;
};


static char** gui_cs_list_model_packet_strings;
static gint gui_cs_list_model_packet_strings_length1;
static char** gui_cs_list_model_packet_strings = NULL;
static gint gui_cs_list_model_packet_strings_length1 = 0;
static gint gui_cs_list_model_packet_strings_size = 0;
static char** gui_cs_list_model_packet0_headers;
static gint gui_cs_list_model_packet0_headers_length1;
static char** gui_cs_list_model_packet0_headers = NULL;
static gint gui_cs_list_model_packet0_headers_length1 = 0;
static gint gui_cs_list_model_packet0_headers_size = 0;
static char** gui_cs_list_model_packet1_headers;
static gint gui_cs_list_model_packet1_headers_length1;
static char** gui_cs_list_model_packet1_headers = NULL;
static gint gui_cs_list_model_packet1_headers_length1 = 0;
static gint gui_cs_list_model_packet1_headers_size = 0;
static char** gui_cs_list_model_packet2_headers;
static gint gui_cs_list_model_packet2_headers_length1;
static char** gui_cs_list_model_packet2_headers = NULL;
static gint gui_cs_list_model_packet2_headers_length1 = 0;
static gint gui_cs_list_model_packet2_headers_size = 0;
static char** gui_cs_list_model_packet3_headers;
static gint gui_cs_list_model_packet3_headers_length1;
static char** gui_cs_list_model_packet3_headers = NULL;
static gint gui_cs_list_model_packet3_headers_length1 = 0;
static gint gui_cs_list_model_packet3_headers_size = 0;
static char*** gui_cs_list_model_packet_headers;
static gint gui_cs_list_model_packet_headers_length1;
static char*** gui_cs_list_model_packet_headers = NULL;
static gint gui_cs_list_model_packet_headers_length1 = 0;
static gint gui_cs_list_model_packet_headers_size = 0;
static guint* gui_cs_list_model_packet_headers_length;
static gint gui_cs_list_model_packet_headers_length_length1;
static guint* gui_cs_list_model_packet_headers_length = NULL;
static gint gui_cs_list_model_packet_headers_length_length1 = 0;
static gint gui_cs_list_model_packet_headers_length_size = 0;
static gpointer gui_cs_list_model_cs_iter_parent_class = NULL;
static gpointer gui_cs_list_model_parent_class = NULL;
static GtkTreeModelIface* gui_cs_list_model_gtk_tree_model_parent_iface = NULL;
static char* gui_cs_view_xml_ui;
static char* gui_cs_view_xml_ui = NULL;
extern EmulationSpecEntry* emulation_specs;
extern gint emulation_specs_length1;
extern guint emulation_spec_default;
static gpointer gui_cs_view_parent_class = NULL;

GType gui_cs_list_model_get_type (void);
GType emulation_cs_get_type (void);
GType emulation_spec_get_type (void);
#define GUI_CS_LIST_MODEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GUI_TYPE_CS_LIST_MODEL, GUICSListModelPrivate))
enum  {
	GUI_CS_LIST_MODEL_DUMMY_PROPERTY
};
GType gui_cs_list_model_columns_get_type (void);
GType gui_cs_list_model_row_type_get_type (void);
static char** _vala_array_dup3 (char** self, int length);
static char** _vala_array_dup4 (char** self, int length);
static char** _vala_array_dup5 (char** self, int length);
static char** _vala_array_dup6 (char** self, int length);
GUICSListModel* gui_cs_list_model_new (EmulationCS* cs, EmulationSpec* spec);
GUICSListModel* gui_cs_list_model_construct (GType object_type, EmulationCS* cs, EmulationSpec* spec);
static GtkTreeModelFlags gui_cs_list_model_real_get_flags (GtkTreeModel* base);
static gint gui_cs_list_model_real_get_n_columns (GtkTreeModel* base);
static GType gui_cs_list_model_real_get_column_type (GtkTreeModel* base, gint i);
GType emulation_register_list_get_type (void);
EmulationRegisterList* emulation_spec_translate_addr (EmulationSpec* self, guint addr);
guint emulation_register_list_get_length (EmulationRegisterList* self);
static guint gui_cs_list_model_get_variant_count (GUICSListModel* self, guint32 addr);
GType emulation_register_get_type (void);
EmulationRegister* emulation_register_list_get (EmulationRegisterList* self, guint index);
GType emulation_register_info_get_type (void);
EmulationRegisterInfo* emulation_register_get_info (EmulationRegister* self);
guint emulation_register_info_get_length (EmulationRegisterInfo* self);
static guint gui_cs_list_model_get_bitfield_count (GUICSListModel* self, guint32 addr, guint variant);
GUICSListModelCSIter* gui_cs_list_model_cs_iter_new (GtkTreeIter* iter);
GUICSListModelCSIter* gui_cs_list_model_cs_iter_construct (GType object_type, GtkTreeIter* iter);
gpointer gui_cs_list_model_cs_iter_ref (gpointer instance);
void gui_cs_list_model_cs_iter_unref (gpointer instance);
GParamSpec* gui_cs_list_model_param_spec_cs_iter (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void gui_cs_list_model_value_set_cs_iter (GValue* value, gpointer v_object);
gpointer gui_cs_list_model_value_get_cs_iter (const GValue* value);
GType gui_cs_list_model_cs_iter_get_type (void);
void gui_cs_list_model_cs_iter_reset (GUICSListModelCSIter* self);
GType emulation_packet_base_get_type (void);
void gui_cs_list_model_cs_iter_set_packet (GUICSListModelCSIter* self, guint32 value);
guint32 gui_cs_list_model_cs_iter_get_packet (GUICSListModelCSIter* self);
guint emulation_packet_base_get_length (EmulationPacketBase* self);
void gui_cs_list_model_cs_iter_set_dword (GUICSListModelCSIter* self, guint32 value);
void gui_cs_list_model_cs_iter_set_in_dwords (GUICSListModelCSIter* self, gboolean value);
guint32 gui_cs_list_model_cs_iter_get_dword (GUICSListModelCSIter* self);
guint emulation_packet_base_get_type_id (EmulationPacketBase* self);
void gui_cs_list_model_cs_iter_set_bitfield (GUICSListModelCSIter* self, guint32 value);
void gui_cs_list_model_cs_iter_set_in_bitfields (GUICSListModelCSIter* self, gboolean value);
GType emulation_packet0_get_type (void);
guint32 emulation_packet0_get_addr (EmulationPacket0* self);
GType emulation_packet1_get_type (void);
guint32 emulation_packet1_get_addr1 (EmulationPacket1* self);
guint32 emulation_packet1_get_addr2 (EmulationPacket1* self);
void gui_cs_list_model_cs_iter_set_variant (GUICSListModelCSIter* self, guint32 value);
void gui_cs_list_model_cs_iter_set_in_variants (GUICSListModelCSIter* self, gboolean value);
guint32 gui_cs_list_model_cs_iter_get_variant (GUICSListModelCSIter* self);
static gboolean gui_cs_list_model_real_get_iter (GtkTreeModel* base, GtkTreeIter* iter, GtkTreePath* path);
gboolean gui_cs_list_model_cs_iter_get_in_dwords (GUICSListModelCSIter* self);
gboolean gui_cs_list_model_cs_iter_get_in_bitfields (GUICSListModelCSIter* self);
gboolean gui_cs_list_model_cs_iter_get_in_variants (GUICSListModelCSIter* self);
guint32 gui_cs_list_model_cs_iter_get_bitfield (GUICSListModelCSIter* self);
static GtkTreePath* gui_cs_list_model_real_get_path (GtkTreeModel* base, GtkTreeIter* iter);
const char* emulation_register_info_get_name (EmulationRegisterInfo* self);
static char* gui_cs_list_model_translate_addr (GUICSListModel* self, guint32 addr);
static const char* gui_cs_list_model_variant_name (GUICSListModel* self, guint32 addr, guint variant);
GType emulation_bitfield_get_type (void);
EmulationBitfield* emulation_register_info_get (EmulationRegisterInfo* self, guint index);
const char* emulation_bitfield_get_name (EmulationBitfield* self);
static const char* gui_cs_list_model_bitfield_name (GUICSListModel* self, guint32 addr, guint variant, guint bitfield);
guint8 emulation_bitfield_get_high (EmulationBitfield* self);
guint8 emulation_bitfield_get_low (EmulationBitfield* self);
static guint32 gui_cs_list_model_bitfield_value (GUICSListModel* self, guint32 addr, guint variant, guint bitfield, guint32 dword);
GUICSListModelRowType gui_cs_list_model_cs_iter_get_row_type (GUICSListModelCSIter* self);
static guint32 gui_cs_list_model_dword_addr (GUICSListModel* self, guint p, guint d);
guint32 emulation_packet_base_get (EmulationPacketBase* self, guint index);
guint32 emulation_packet0_get__ADDR (EmulationPacket0* self);
guint32 emulation_packet0_get__ONE_REG_WR (EmulationPacket0* self);
guint32 emulation_packet0_get__COUNT (EmulationPacket0* self);
guint32 emulation_packet1_get__ADDR1 (EmulationPacket1* self);
guint32 emulation_packet1_get__ADDR2 (EmulationPacket1* self);
GType emulation_packet3_get_type (void);
guint32 emulation_packet3_get__IT_OPCODE (EmulationPacket3* self);
guint32 emulation_packet3_get__COUNT (EmulationPacket3* self);
static void gui_cs_list_model_real_get_value (GtkTreeModel* base, GtkTreeIter* iter, gint column, GValue* val);
gboolean emulation_packet0_get_one_reg_wr (EmulationPacket0* self);
static gboolean gui_cs_list_model_real_iter_next (GtkTreeModel* base, GtkTreeIter* iter);
void gui_cs_list_model_cs_iter_copy (GUICSListModelCSIter* self, GUICSListModelCSIter* it);
static gboolean gui_cs_list_model_real_iter_children (GtkTreeModel* base, GtkTreeIter* iter, GtkTreeIter* parent);
static gboolean gui_cs_list_model_real_iter_has_child (GtkTreeModel* base, GtkTreeIter* iter);
static gint gui_cs_list_model_real_iter_n_children (GtkTreeModel* base, GtkTreeIter* iter);
static gboolean gui_cs_list_model_real_iter_nth_child (GtkTreeModel* base, GtkTreeIter* iter, GtkTreeIter* parent, gint n);
static gboolean gui_cs_list_model_real_iter_parent (GtkTreeModel* base, GtkTreeIter* iter, GtkTreeIter* child);
static void gui_cs_list_model_real_ref_node (GtkTreeModel* base, GtkTreeIter* iter);
static void gui_cs_list_model_real_unref_node (GtkTreeModel* base, GtkTreeIter* iter);
#define GUI_CS_LIST_MODEL_CS_ITER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GUI_CS_LIST_MODEL_TYPE_CS_ITER, GUICSListModelCSIterPrivate))
enum  {
	GUI_CS_LIST_MODEL_CS_ITER_DUMMY_PROPERTY
};
static inline guint32 gui_cs_list_model_cs_iter_get_iter_bits (GUICSListModelCSIter* self, guint low, guint high);
static inline void gui_cs_list_model_cs_iter_set_iter_bits (GUICSListModelCSIter* self, guint low, guint high, guint32 val);
gboolean gui_cs_list_model_cs_iter_get_is_header (GUICSListModelCSIter* self);
static void gui_cs_list_model_cs_iter_finalize (GUICSListModelCSIter* obj);
static void gui_cs_list_model_finalize (GObject* obj);
GType gui_cs_view_get_type (void);
#define GUI_CS_VIEW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GUI_TYPE_CS_VIEW, GUICSViewPrivate))
enum  {
	GUI_CS_VIEW_DUMMY_PROPERTY
};
GType emulation_spec_entry_get_type (void);
EmulationSpecEntry* emulation_spec_entry_dup (const EmulationSpecEntry* self);
void emulation_spec_entry_free (EmulationSpecEntry* self);
void emulation_spec_entry_copy (const EmulationSpecEntry* self, EmulationSpecEntry* dest);
void emulation_spec_entry_destroy (EmulationSpecEntry* self);
static void _lambda8_ (GtkComboBox* combo, GUICSView* self);
static void __lambda8__gtk_combo_box_changed (GtkComboBox* _sender, gpointer self);
GUICSView* gui_cs_view_new (EmulationCS* cs);
GUICSView* gui_cs_view_construct (GType object_type, EmulationCS* cs);
static void gui_cs_view_finalize (GObject* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);




GType gui_cs_list_model_columns_get_type (void) {
	static GType gui_cs_list_model_columns_type_id = 0;
	if (G_UNLIKELY (gui_cs_list_model_columns_type_id == 0)) {
		static const GEnumValue values[] = {{GUI_CS_LIST_MODEL_COLUMNS_NAME, "GUI_CS_LIST_MODEL_COLUMNS_NAME", "name"}, {GUI_CS_LIST_MODEL_COLUMNS_VALUE, "GUI_CS_LIST_MODEL_COLUMNS_VALUE", "value"}, {GUI_CS_LIST_MODEL_COLUMNS_TARGET, "GUI_CS_LIST_MODEL_COLUMNS_TARGET", "target"}, {GUI_CS_LIST_MODEL_COLUMNS_COUNT, "GUI_CS_LIST_MODEL_COLUMNS_COUNT", "count"}, {0, NULL, NULL}};
		gui_cs_list_model_columns_type_id = g_enum_register_static ("GUICSListModelColumns", values);
	}
	return gui_cs_list_model_columns_type_id;
}



GType gui_cs_list_model_row_type_get_type (void) {
	static GType gui_cs_list_model_row_type_type_id = 0;
	if (G_UNLIKELY (gui_cs_list_model_row_type_type_id == 0)) {
		static const GEnumValue values[] = {{GUI_CS_LIST_MODEL_ROW_TYPE_PACKET, "GUI_CS_LIST_MODEL_ROW_TYPE_PACKET", "packet"}, {GUI_CS_LIST_MODEL_ROW_TYPE_HEADER, "GUI_CS_LIST_MODEL_ROW_TYPE_HEADER", "header"}, {GUI_CS_LIST_MODEL_ROW_TYPE_DWORD, "GUI_CS_LIST_MODEL_ROW_TYPE_DWORD", "dword"}, {GUI_CS_LIST_MODEL_ROW_TYPE_VARIANT, "GUI_CS_LIST_MODEL_ROW_TYPE_VARIANT", "variant"}, {GUI_CS_LIST_MODEL_ROW_TYPE_BITFIELD, "GUI_CS_LIST_MODEL_ROW_TYPE_BITFIELD", "bitfield"}, {GUI_CS_LIST_MODEL_ROW_TYPE_HEADER_BITFIELD, "GUI_CS_LIST_MODEL_ROW_TYPE_HEADER_BITFIELD", "header-bitfield"}, {0, NULL, NULL}};
		gui_cs_list_model_row_type_type_id = g_enum_register_static ("GUICSListModelRowType", values);
	}
	return gui_cs_list_model_row_type_type_id;
}


static char** _vala_array_dup3 (char** self, int length) {
	char** result;
	int i;
	result = g_new0 (char*, length + 1);
	for (i = 0; i < length; i++) {
		result[i] = g_strdup (self[i]);
	}
	return result;
}


static char** _vala_array_dup4 (char** self, int length) {
	char** result;
	int i;
	char** _tmp5_;
	result = g_new0 (char*, length + 1);
	for (i = 0; i < length; i++) {
		result[i] = g_strdup (self[i]);
	}
	return result;
}


static char** _vala_array_dup5 (char** self, int length) {
	char** result;
	int i;
	char** _tmp6_;
	char** _tmp5_;
	result = g_new0 (char*, length + 1);
	for (i = 0; i < length; i++) {
		result[i] = g_strdup (self[i]);
	}
	return result;
}


static char** _vala_array_dup6 (char** self, int length) {
	char** result;
	int i;
	char** _tmp7_;
	char** _tmp6_;
	char** _tmp5_;
	result = g_new0 (char*, length + 1);
	for (i = 0; i < length; i++) {
		result[i] = g_strdup (self[i]);
	}
	return result;
}


static gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


GUICSListModel* gui_cs_list_model_construct (GType object_type, EmulationCS* cs, EmulationSpec* spec) {
	GUICSListModel * self;
	EmulationCS* _tmp0_;
	EmulationSpec* _tmp1_;
	g_return_val_if_fail (cs != NULL, NULL);
	g_return_val_if_fail (spec != NULL, NULL);
	self = (GUICSListModel*) g_object_new (object_type, NULL);
	self->priv->m_cs = (_tmp0_ = _g_object_ref0 (cs), _g_object_unref0 (self->priv->m_cs), _tmp0_);
	self->priv->m_spec = (_tmp1_ = _g_object_ref0 (spec), _g_object_unref0 (self->priv->m_spec), _tmp1_);
	self->priv->m_stamp = 19449216;
	return self;
}


GUICSListModel* gui_cs_list_model_new (EmulationCS* cs, EmulationSpec* spec) {
	return gui_cs_list_model_construct (GUI_TYPE_CS_LIST_MODEL, cs, spec);
}


static GtkTreeModelFlags gui_cs_list_model_real_get_flags (GtkTreeModel* base) {
	GUICSListModel * self;
	GtkTreeModelFlags result;
	self = (GUICSListModel*) base;
	result = GTK_TREE_MODEL_ITERS_PERSIST;
	return result;
}


static gint gui_cs_list_model_real_get_n_columns (GtkTreeModel* base) {
	GUICSListModel * self;
	gint result;
	self = (GUICSListModel*) base;
	result = (gint) GUI_CS_LIST_MODEL_COLUMNS_COUNT;
	return result;
}


static GType gui_cs_list_model_real_get_column_type (GtkTreeModel* base, gint i) {
	GUICSListModel * self;
	GType result;
	self = (GUICSListModel*) base;
	result = G_TYPE_STRING;
	return result;
}


static guint gui_cs_list_model_get_variant_count (GUICSListModel* self, guint32 addr) {
	guint result;
	EmulationRegisterList* regs;
	guint _tmp0_ = 0U;
	g_return_val_if_fail (self != NULL, 0U);
	regs = emulation_spec_translate_addr (self->priv->m_spec, (guint) addr);
	if (regs == NULL) {
		_tmp0_ = (guint) 0;
	} else {
		_tmp0_ = emulation_register_list_get_length (regs);
	}
	result = _tmp0_;
	_g_object_unref0 (regs);
	return result;
}


static guint gui_cs_list_model_get_bitfield_count (GUICSListModel* self, guint32 addr, guint variant) {
	guint result;
	EmulationRegisterList* regs;
	guint _tmp0_ = 0U;
	g_return_val_if_fail (self != NULL, 0U);
	regs = emulation_spec_translate_addr (self->priv->m_spec, (guint) addr);
	g_assert (regs != NULL);
	g_assert (variant < emulation_register_list_get_length (regs));
	if (emulation_register_info_get_length (emulation_register_get_info (emulation_register_list_get (regs, variant))) == 0) {
		_tmp0_ = (guint) 1;
	} else {
		_tmp0_ = emulation_register_info_get_length (emulation_register_get_info (emulation_register_list_get (regs, variant)));
	}
	result = _tmp0_;
	_g_object_unref0 (regs);
	return result;
}


static gboolean gui_cs_list_model_real_get_iter (GtkTreeModel* base, GtkTreeIter* iter, GtkTreePath* path) {
	GUICSListModel * self;
	gboolean result;
	gint depth;
	GUICSListModelCSIter* it;
	gint* indices;
	gboolean _tmp0_ = FALSE;
	self = (GUICSListModel*) base;
	g_return_val_if_fail (path != NULL, FALSE);
	depth = gtk_tree_path_get_depth (path);
	g_assert ((depth <= 4) && (depth >= 1));
	it = gui_cs_list_model_cs_iter_new (iter);
	gui_cs_list_model_cs_iter_reset (it);
	indices = gtk_tree_path_get_indices (path);
	if (indices[0] >= self->priv->m_cs->packets_length1) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = indices[0] < 0;
	}
	if (_tmp0_) {
		result = FALSE;
		_gui_cs_list_model_cs_iter_unref0 (it);
		return result;
	}
	gui_cs_list_model_cs_iter_set_packet (it, (guint32) indices[0]);
	if (depth >= 2) {
		gboolean _tmp1_ = FALSE;
		if (indices[1] > emulation_packet_base_get_length (self->priv->m_cs->packets[gui_cs_list_model_cs_iter_get_packet (it)])) {
			_tmp1_ = TRUE;
		} else {
			_tmp1_ = indices[1] < 0;
		}
		if (_tmp1_) {
			result = FALSE;
			_gui_cs_list_model_cs_iter_unref0 (it);
			return result;
		}
		gui_cs_list_model_cs_iter_set_dword (it, (guint32) indices[1]);
		gui_cs_list_model_cs_iter_set_in_dwords (it, TRUE);
	}
	if (depth >= 3) {
		if (indices[2] < 0) {
			result = FALSE;
			_gui_cs_list_model_cs_iter_unref0 (it);
			return result;
		}
		if (gui_cs_list_model_cs_iter_get_dword (it) == 0) {
			if (indices[2] >= gui_cs_list_model_packet_headers_length[emulation_packet_base_get_type_id (self->priv->m_cs->packets[gui_cs_list_model_cs_iter_get_packet (it)])]) {
				result = FALSE;
				_gui_cs_list_model_cs_iter_unref0 (it);
				return result;
			}
			if (depth > 3) {
				result = FALSE;
				_gui_cs_list_model_cs_iter_unref0 (it);
				return result;
			}
			gui_cs_list_model_cs_iter_set_bitfield (it, (guint32) indices[2]);
			gui_cs_list_model_cs_iter_set_in_bitfields (it, TRUE);
		} else {
			guint32 addr;
			addr = (guint32) 0;
			switch (emulation_packet_base_get_type_id (self->priv->m_cs->packets[gui_cs_list_model_cs_iter_get_packet (it)])) {
				case 0:
				{
					EmulationPacketBase* _tmp2_;
					EmulationPacket0* p0;
					p0 = _g_object_ref0 ((_tmp2_ = self->priv->m_cs->packets[gui_cs_list_model_cs_iter_get_packet (it)], EMULATION_IS_PACKET0 (_tmp2_) ? ((EmulationPacket0*) _tmp2_) : NULL));
					addr = emulation_packet0_get_addr (p0);
					_g_object_unref0 (p0);
					break;
				}
				case 1:
				{
					EmulationPacketBase* _tmp3_;
					EmulationPacket1* p1;
					guint32 _tmp4_ = 0U;
					p1 = _g_object_ref0 ((_tmp3_ = self->priv->m_cs->packets[gui_cs_list_model_cs_iter_get_packet (it)], EMULATION_IS_PACKET1 (_tmp3_) ? ((EmulationPacket1*) _tmp3_) : NULL));
					if (gui_cs_list_model_cs_iter_get_dword (it) == 1) {
						_tmp4_ = emulation_packet1_get_addr1 (p1);
					} else {
						_tmp4_ = emulation_packet1_get_addr2 (p1);
					}
					addr = _tmp4_;
					_g_object_unref0 (p1);
					break;
				}
				case 2:
				{
					result = FALSE;
					_gui_cs_list_model_cs_iter_unref0 (it);
					return result;
				}
				case 3:
				{
					result = FALSE;
					_gui_cs_list_model_cs_iter_unref0 (it);
					return result;
				}
			}
			if (indices[2] < 0) {
				result = FALSE;
				_gui_cs_list_model_cs_iter_unref0 (it);
				return result;
			}
			if (indices[2] >= gui_cs_list_model_get_variant_count (self, addr)) {
				result = FALSE;
				_gui_cs_list_model_cs_iter_unref0 (it);
				return result;
			}
			gui_cs_list_model_cs_iter_set_variant (it, (guint32) indices[2]);
			gui_cs_list_model_cs_iter_set_in_variants (it, TRUE);
			if (depth == 4) {
				if (indices[3] < 0) {
					result = FALSE;
					_gui_cs_list_model_cs_iter_unref0 (it);
					return result;
				}
				if (indices[3] >= gui_cs_list_model_get_bitfield_count (self, addr, (guint) gui_cs_list_model_cs_iter_get_variant (it))) {
					result = FALSE;
					_gui_cs_list_model_cs_iter_unref0 (it);
					return result;
				}
				gui_cs_list_model_cs_iter_set_bitfield (it, (guint32) indices[3]);
				gui_cs_list_model_cs_iter_set_in_bitfields (it, TRUE);
			}
		}
	}
	(*iter).stamp = self->priv->m_stamp;
	result = TRUE;
	_gui_cs_list_model_cs_iter_unref0 (it);
	return result;
}


static GtkTreePath* gui_cs_list_model_real_get_path (GtkTreeModel* base, GtkTreeIter* iter) {
	GUICSListModel * self;
	GtkTreePath* result;
	GtkTreePath* path;
	GUICSListModelCSIter* it;
	self = (GUICSListModel*) base;
	path = gtk_tree_path_new ();
	it = gui_cs_list_model_cs_iter_new (iter);
	gtk_tree_path_append_index (path, (gint) gui_cs_list_model_cs_iter_get_packet (it));
	if (gui_cs_list_model_cs_iter_get_in_dwords (it)) {
		gtk_tree_path_append_index (path, (gint) gui_cs_list_model_cs_iter_get_dword (it));
	}
	if (gui_cs_list_model_cs_iter_get_in_bitfields (it)) {
		if (gui_cs_list_model_cs_iter_get_in_variants (it)) {
			gtk_tree_path_append_index (path, (gint) gui_cs_list_model_cs_iter_get_variant (it));
		}
		gtk_tree_path_append_index (path, (gint) gui_cs_list_model_cs_iter_get_bitfield (it));
	}
	result = path;
	_gui_cs_list_model_cs_iter_unref0 (it);
	return result;
}


static char* gui_cs_list_model_translate_addr (GUICSListModel* self, guint32 addr) {
	char* result;
	EmulationRegisterList* regs;
	const char* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	regs = emulation_spec_translate_addr (self->priv->m_spec, (guint) addr);
	if (regs == NULL) {
		result = g_strdup_printf ("0x%04X", addr);
		_g_object_unref0 (regs);
		return result;
	}
	_tmp0_ = NULL;
	if (emulation_register_list_get_length (regs) > 1) {
		_tmp0_ = "Multiple";
	} else {
		_tmp0_ = emulation_register_info_get_name (emulation_register_get_info (emulation_register_list_get (regs, (guint) 0)));
	}
	result = g_strdup (_tmp0_);
	_g_object_unref0 (regs);
	return result;
}


static const char* gui_cs_list_model_variant_name (GUICSListModel* self, guint32 addr, guint variant) {
	const char* result;
	EmulationRegisterList* regs;
	g_return_val_if_fail (self != NULL, NULL);
	regs = emulation_spec_translate_addr (self->priv->m_spec, (guint) addr);
	g_assert (regs != NULL);
	g_assert (variant < emulation_register_list_get_length (regs));
	result = emulation_register_info_get_name (emulation_register_get_info (emulation_register_list_get (regs, variant)));
	_g_object_unref0 (regs);
	return result;
}


static const char* gui_cs_list_model_bitfield_name (GUICSListModel* self, guint32 addr, guint variant, guint bitfield) {
	const char* result;
	EmulationRegisterList* regs;
	g_return_val_if_fail (self != NULL, NULL);
	regs = emulation_spec_translate_addr (self->priv->m_spec, (guint) addr);
	g_assert (regs != NULL);
	g_assert (variant < emulation_register_list_get_length (regs));
	if (emulation_register_info_get_length (emulation_register_get_info (emulation_register_list_get (regs, variant))) > 0) {
		g_assert (bitfield < emulation_register_info_get_length (emulation_register_get_info (emulation_register_list_get (regs, variant))));
		result = emulation_bitfield_get_name (emulation_register_info_get (emulation_register_get_info (emulation_register_list_get (regs, variant)), bitfield));
		_g_object_unref0 (regs);
		return result;
	}
	result = "DATA_REGISTER";
	_g_object_unref0 (regs);
	return result;
}


static guint32 gui_cs_list_model_bitfield_value (GUICSListModel* self, guint32 addr, guint variant, guint bitfield, guint32 dword) {
	guint32 result;
	EmulationRegisterList* regs;
	guint high;
	guint low;
	g_return_val_if_fail (self != NULL, 0U);
	regs = emulation_spec_translate_addr (self->priv->m_spec, (guint) addr);
	g_assert (regs != NULL);
	g_assert (variant < emulation_register_list_get_length (regs));
	high = (guint) 31;
	low = (guint) 0;
	if (emulation_register_info_get_length (emulation_register_get_info (emulation_register_list_get (regs, variant))) > 0) {
		g_assert (bitfield < emulation_register_info_get_length (emulation_register_get_info (emulation_register_list_get (regs, variant))));
		high = (guint) emulation_bitfield_get_high (emulation_register_info_get (emulation_register_get_info (emulation_register_list_get (regs, variant)), bitfield));
		low = (guint) emulation_bitfield_get_low (emulation_register_info_get (emulation_register_get_info (emulation_register_list_get (regs, variant)), bitfield));
	}
	result = (dword >> low) & ((1 << ((high - low) + 1)) - 1);
	_g_object_unref0 (regs);
	return result;
}


static void gui_cs_list_model_real_get_value (GtkTreeModel* base, GtkTreeIter* iter, gint column, GValue* val) {
	GUICSListModel * self;
	GUICSListModelCSIter* it;
	EmulationPacketBase* p;
	self = (GUICSListModel*) base;
	if ((*iter).stamp != self->priv->m_stamp) {
		return;
	}
	it = gui_cs_list_model_cs_iter_new (iter);
	p = _g_object_ref0 (self->priv->m_cs->packets[gui_cs_list_model_cs_iter_get_packet (it)]);
	g_value_init (val, G_TYPE_STRING);
	switch (gui_cs_list_model_cs_iter_get_row_type (it)) {
		case GUI_CS_LIST_MODEL_ROW_TYPE_PACKET:
		{
			switch (column) {
				case GUI_CS_LIST_MODEL_COLUMNS_NAME:
				{
					g_value_set_static_string (val, gui_cs_list_model_packet_strings[emulation_packet_base_get_type_id (p)]);
					break;
				}
				case GUI_CS_LIST_MODEL_COLUMNS_VALUE:
				{
					char* _tmp0_;
					g_value_set_string (val, _tmp0_ = g_strdup_printf ("0x%08X", p->header));
					_g_free0 (_tmp0_);
					break;
				}
				case GUI_CS_LIST_MODEL_COLUMNS_TARGET:
				{
					switch (emulation_packet_base_get_type_id (p)) {
						case 0:
						{
							char* _tmp1_;
							g_value_set_string (val, _tmp1_ = gui_cs_list_model_translate_addr (self, gui_cs_list_model_dword_addr (self, (guint) gui_cs_list_model_cs_iter_get_packet (it), (guint) 1)));
							_g_free0 (_tmp1_);
							break;
						}
						case 1:
						{
							char* _tmp5_;
							char* _tmp4_;
							char* _tmp3_;
							char* _tmp2_;
							g_value_set_string (val, _tmp5_ = g_strconcat (_tmp3_ = g_strconcat (_tmp2_ = gui_cs_list_model_translate_addr (self, gui_cs_list_model_dword_addr (self, (guint) gui_cs_list_model_cs_iter_get_packet (it), (guint) 1)), " | ", NULL), _tmp4_ = gui_cs_list_model_translate_addr (self, gui_cs_list_model_dword_addr (self, (guint) gui_cs_list_model_cs_iter_get_packet (it), (guint) 2)), NULL));
							_g_free0 (_tmp5_);
							_g_free0 (_tmp4_);
							_g_free0 (_tmp3_);
							_g_free0 (_tmp2_);
							break;
						}
						case 2:
						{
							g_value_set_static_string (val, "");
							break;
						}
						case 3:
						{
							g_value_set_static_string (val, "TODO");
							break;
						}
					}
					break;
				}
			}
			break;
		}
		case GUI_CS_LIST_MODEL_ROW_TYPE_DWORD:
		{
			switch (column) {
				case GUI_CS_LIST_MODEL_COLUMNS_NAME:
				{
					char* _tmp6_;
					g_value_set_string (val, _tmp6_ = g_strdup_printf ("DWORD%u", gui_cs_list_model_cs_iter_get_dword (it) - 1));
					_g_free0 (_tmp6_);
					break;
				}
				case GUI_CS_LIST_MODEL_COLUMNS_VALUE:
				{
					char* _tmp7_;
					g_value_set_string (val, _tmp7_ = g_strdup_printf ("0x%08X", emulation_packet_base_get (p, (guint) (gui_cs_list_model_cs_iter_get_dword (it) - 1))));
					_g_free0 (_tmp7_);
					break;
				}
				case GUI_CS_LIST_MODEL_COLUMNS_TARGET:
				{
					switch (emulation_packet_base_get_type_id (p)) {
						case 0:
						{
							char* _tmp8_;
							g_value_set_string (val, _tmp8_ = gui_cs_list_model_translate_addr (self, gui_cs_list_model_dword_addr (self, (guint) gui_cs_list_model_cs_iter_get_packet (it), (guint) gui_cs_list_model_cs_iter_get_dword (it))));
							_g_free0 (_tmp8_);
							break;
						}
						case 1:
						{
							char* _tmp9_;
							g_value_set_string (val, _tmp9_ = gui_cs_list_model_translate_addr (self, gui_cs_list_model_dword_addr (self, (guint) gui_cs_list_model_cs_iter_get_packet (it), (guint) gui_cs_list_model_cs_iter_get_dword (it))));
							_g_free0 (_tmp9_);
							break;
						}
						case 2:
						{
							g_value_set_static_string (val, "");
							break;
						}
						case 3:
						{
							g_value_set_static_string (val, "TODO");
							break;
						}
					}
					break;
				}
			}
			break;
		}
		case GUI_CS_LIST_MODEL_ROW_TYPE_HEADER:
		{
			switch (column) {
				case GUI_CS_LIST_MODEL_COLUMNS_NAME:
				{
					g_value_set_static_string (val, "HEADER");
					break;
				}
				case GUI_CS_LIST_MODEL_COLUMNS_VALUE:
				{
					char* _tmp10_;
					g_value_set_string (val, _tmp10_ = g_strdup_printf ("0x%08X", p->header));
					_g_free0 (_tmp10_);
					break;
				}
				case GUI_CS_LIST_MODEL_COLUMNS_TARGET:
				{
					g_value_set_static_string (val, "");
					break;
				}
			}
			break;
		}
		case GUI_CS_LIST_MODEL_ROW_TYPE_VARIANT:
		{
			switch (column) {
				case GUI_CS_LIST_MODEL_COLUMNS_NAME:
				{
					g_value_set_static_string (val, gui_cs_list_model_variant_name (self, gui_cs_list_model_dword_addr (self, (guint) gui_cs_list_model_cs_iter_get_packet (it), (guint) gui_cs_list_model_cs_iter_get_dword (it)), (guint) gui_cs_list_model_cs_iter_get_variant (it)));
					break;
				}
				case GUI_CS_LIST_MODEL_COLUMNS_VALUE:
				{
					g_value_set_static_string (val, "");
					break;
				}
				case GUI_CS_LIST_MODEL_COLUMNS_TARGET:
				{
					g_value_set_static_string (val, "");
					break;
				}
			}
			break;
		}
		case GUI_CS_LIST_MODEL_ROW_TYPE_BITFIELD:
		{
			switch (column) {
				case GUI_CS_LIST_MODEL_COLUMNS_NAME:
				{
					g_value_set_static_string (val, gui_cs_list_model_bitfield_name (self, gui_cs_list_model_dword_addr (self, (guint) gui_cs_list_model_cs_iter_get_packet (it), (guint) gui_cs_list_model_cs_iter_get_dword (it)), (guint) gui_cs_list_model_cs_iter_get_variant (it), (guint) gui_cs_list_model_cs_iter_get_bitfield (it)));
					break;
				}
				case GUI_CS_LIST_MODEL_COLUMNS_VALUE:
				{
					char* _tmp11_;
					g_value_set_string (val, _tmp11_ = g_strdup_printf ("%u", gui_cs_list_model_bitfield_value (self, gui_cs_list_model_dword_addr (self, (guint) gui_cs_list_model_cs_iter_get_packet (it), (guint) gui_cs_list_model_cs_iter_get_dword (it)), (guint) gui_cs_list_model_cs_iter_get_variant (it), (guint) gui_cs_list_model_cs_iter_get_bitfield (it), emulation_packet_base_get (p, (guint) (gui_cs_list_model_cs_iter_get_dword (it) - 1)))));
					_g_free0 (_tmp11_);
					break;
				}
				case GUI_CS_LIST_MODEL_COLUMNS_TARGET:
				{
					g_value_set_static_string (val, "");
					break;
				}
			}
			break;
		}
		case GUI_CS_LIST_MODEL_ROW_TYPE_HEADER_BITFIELD:
		{
			switch (column) {
				case GUI_CS_LIST_MODEL_COLUMNS_NAME:
				{
					g_value_set_static_string (val, gui_cs_list_model_packet_headers[emulation_packet_base_get_type_id (p)][gui_cs_list_model_cs_iter_get_bitfield (it)]);
					break;
				}
				case GUI_CS_LIST_MODEL_COLUMNS_TARGET:
				{
					g_value_set_static_string (val, "");
					break;
				}
				case GUI_CS_LIST_MODEL_COLUMNS_VALUE:
				{
					switch (emulation_packet_base_get_type_id (p)) {
						case 0:
						{
							EmulationPacketBase* _tmp12_;
							EmulationPacket0* p0;
							p0 = _g_object_ref0 ((_tmp12_ = p, EMULATION_IS_PACKET0 (_tmp12_) ? ((EmulationPacket0*) _tmp12_) : NULL));
							switch (gui_cs_list_model_cs_iter_get_bitfield (it)) {
								case 0:
								{
									char* _tmp13_;
									g_value_set_string (val, _tmp13_ = gui_cs_list_model_translate_addr (self, emulation_packet0_get__ADDR (p0)));
									_g_free0 (_tmp13_);
									break;
								}
								case 1:
								{
									char* _tmp14_;
									g_value_set_string (val, _tmp14_ = g_strdup_printf ("%u", emulation_packet0_get__ONE_REG_WR (p0)));
									_g_free0 (_tmp14_);
									break;
								}
								case 2:
								{
									char* _tmp15_;
									g_value_set_string (val, _tmp15_ = g_strdup_printf ("%u", emulation_packet0_get__COUNT (p0)));
									_g_free0 (_tmp15_);
									break;
								}
								case 3:
								{
									char* _tmp16_;
									g_value_set_string (val, _tmp16_ = g_strdup_printf ("%u", emulation_packet_base_get_type_id (p)));
									_g_free0 (_tmp16_);
									break;
								}
							}
							_g_object_unref0 (p0);
							break;
						}
						case 1:
						{
							EmulationPacketBase* _tmp17_;
							EmulationPacket1* p1;
							p1 = _g_object_ref0 ((_tmp17_ = p, EMULATION_IS_PACKET1 (_tmp17_) ? ((EmulationPacket1*) _tmp17_) : NULL));
							switch (gui_cs_list_model_cs_iter_get_bitfield (it)) {
								case 0:
								{
									char* _tmp18_;
									g_value_set_string (val, _tmp18_ = gui_cs_list_model_translate_addr (self, emulation_packet1_get__ADDR1 (p1)));
									_g_free0 (_tmp18_);
									break;
								}
								case 1:
								{
									char* _tmp19_;
									g_value_set_string (val, _tmp19_ = gui_cs_list_model_translate_addr (self, emulation_packet1_get__ADDR2 (p1)));
									_g_free0 (_tmp19_);
									break;
								}
								case 2:
								{
									char* _tmp20_;
									g_value_set_string (val, _tmp20_ = g_strdup_printf ("%u", emulation_packet_base_get_type_id (p)));
									_g_free0 (_tmp20_);
									break;
								}
							}
							_g_object_unref0 (p1);
							break;
						}
						case 2:
						{
							switch (gui_cs_list_model_cs_iter_get_bitfield (it)) {
								case 0:
								{
									char* _tmp21_;
									g_value_set_string (val, _tmp21_ = g_strdup_printf ("%u", emulation_packet_base_get_type_id (p)));
									_g_free0 (_tmp21_);
									break;
								}
							}
							break;
						}
						case 3:
						{
							EmulationPacketBase* _tmp22_;
							EmulationPacket3* p3;
							p3 = _g_object_ref0 ((_tmp22_ = p, EMULATION_IS_PACKET3 (_tmp22_) ? ((EmulationPacket3*) _tmp22_) : NULL));
							switch (gui_cs_list_model_cs_iter_get_bitfield (it)) {
								case 0:
								{
									char* _tmp23_;
									g_value_set_string (val, _tmp23_ = g_strdup_printf ("0x%02X", emulation_packet3_get__IT_OPCODE (p3)));
									_g_free0 (_tmp23_);
									break;
								}
								case 1:
								{
									char* _tmp24_;
									g_value_set_string (val, _tmp24_ = g_strdup_printf ("%u", emulation_packet3_get__COUNT (p3)));
									_g_free0 (_tmp24_);
									break;
								}
								case 2:
								{
									char* _tmp25_;
									g_value_set_string (val, _tmp25_ = g_strdup_printf ("%u", emulation_packet_base_get_type_id (p)));
									_g_free0 (_tmp25_);
									break;
								}
							}
							_g_object_unref0 (p3);
							break;
						}
					}
					break;
				}
			}
			break;
		}
	}
	_gui_cs_list_model_cs_iter_unref0 (it);
	_g_object_unref0 (p);
}


static guint32 gui_cs_list_model_dword_addr (GUICSListModel* self, guint p, guint d) {
	guint32 result;
	g_return_val_if_fail (self != NULL, 0U);
	g_assert (p < self->priv->m_cs->packets_length1);
	switch (emulation_packet_base_get_type_id (self->priv->m_cs->packets[p])) {
		case 0:
		{
			EmulationPacketBase* _tmp0_;
			EmulationPacket0* p0;
			guint _tmp1_ = 0U;
			p0 = _g_object_ref0 ((_tmp0_ = self->priv->m_cs->packets[p], EMULATION_IS_PACKET0 (_tmp0_) ? ((EmulationPacket0*) _tmp0_) : NULL));
			if (emulation_packet0_get_one_reg_wr (p0)) {
				_tmp1_ = (guint) 0;
			} else {
				_tmp1_ = 4 * (d - 1);
			}
			result = emulation_packet0_get_addr (p0) + _tmp1_;
			_g_object_unref0 (p0);
			return result;
		}
		case 1:
		{
			EmulationPacketBase* _tmp2_;
			EmulationPacket1* p1;
			guint32 _tmp3_ = 0U;
			p1 = _g_object_ref0 ((_tmp2_ = self->priv->m_cs->packets[p], EMULATION_IS_PACKET1 (_tmp2_) ? ((EmulationPacket1*) _tmp2_) : NULL));
			if (d == 1) {
				_tmp3_ = emulation_packet1_get_addr1 (p1);
			} else {
				_tmp3_ = emulation_packet1_get_addr2 (p1);
			}
			result = _tmp3_;
			_g_object_unref0 (p1);
			return result;
		}
	}
	result = (guint32) 0;
	return result;
}


static gboolean gui_cs_list_model_real_iter_next (GtkTreeModel* base, GtkTreeIter* iter) {
	GUICSListModel * self;
	gboolean result;
	GUICSListModelCSIter* it;
	guint32 p;
	self = (GUICSListModel*) base;
	if ((*iter).stamp != self->priv->m_stamp) {
		result = FALSE;
		return result;
	}
	(*iter).stamp = 0;
	it = gui_cs_list_model_cs_iter_new (iter);
	p = gui_cs_list_model_cs_iter_get_packet (it);
	switch (gui_cs_list_model_cs_iter_get_row_type (it)) {
		case GUI_CS_LIST_MODEL_ROW_TYPE_PACKET:
		{
			p++;
			if (p >= self->priv->m_cs->packets_length1) {
				result = FALSE;
				_gui_cs_list_model_cs_iter_unref0 (it);
				return result;
			}
			gui_cs_list_model_cs_iter_set_packet (it, p);
			break;
		}
		case GUI_CS_LIST_MODEL_ROW_TYPE_HEADER:
		case GUI_CS_LIST_MODEL_ROW_TYPE_DWORD:
		{
			guint32 d;
			d = gui_cs_list_model_cs_iter_get_dword (it) + 1;
			if (d >= (emulation_packet_base_get_length (self->priv->m_cs->packets[p]) + 1)) {
				result = FALSE;
				_gui_cs_list_model_cs_iter_unref0 (it);
				return result;
			}
			gui_cs_list_model_cs_iter_set_dword (it, d);
			break;
		}
		case GUI_CS_LIST_MODEL_ROW_TYPE_VARIANT:
		{
			guint32 v;
			v = gui_cs_list_model_cs_iter_get_variant (it) + 1;
			if (v >= gui_cs_list_model_get_variant_count (self, gui_cs_list_model_dword_addr (self, (guint) p, (guint) gui_cs_list_model_cs_iter_get_dword (it)))) {
				result = FALSE;
				_gui_cs_list_model_cs_iter_unref0 (it);
				return result;
			}
			gui_cs_list_model_cs_iter_set_variant (it, v);
			break;
		}
		case GUI_CS_LIST_MODEL_ROW_TYPE_BITFIELD:
		{
			guint32 b;
			b = gui_cs_list_model_cs_iter_get_bitfield (it) + 1;
			if (b >= gui_cs_list_model_get_bitfield_count (self, gui_cs_list_model_dword_addr (self, (guint) p, (guint) gui_cs_list_model_cs_iter_get_dword (it)), (guint) gui_cs_list_model_cs_iter_get_variant (it))) {
				result = FALSE;
				_gui_cs_list_model_cs_iter_unref0 (it);
				return result;
			}
			gui_cs_list_model_cs_iter_set_bitfield (it, b);
			break;
		}
		case GUI_CS_LIST_MODEL_ROW_TYPE_HEADER_BITFIELD:
		{
			guint32 b;
			b = gui_cs_list_model_cs_iter_get_bitfield (it) + 1;
			if (b >= gui_cs_list_model_packet_headers_length[emulation_packet_base_get_type_id (self->priv->m_cs->packets[p])]) {
				result = FALSE;
				_gui_cs_list_model_cs_iter_unref0 (it);
				return result;
			}
			gui_cs_list_model_cs_iter_set_bitfield (it, b);
			break;
		}
	}
	(*iter).stamp = self->priv->m_stamp;
	result = TRUE;
	_gui_cs_list_model_cs_iter_unref0 (it);
	return result;
}


static gboolean gui_cs_list_model_real_iter_children (GtkTreeModel* base, GtkTreeIter* iter, GtkTreeIter* parent) {
	GUICSListModel * self;
	gboolean result;
	GUICSListModelCSIter* it;
	GUICSListModelCSIter* pa;
	self = (GUICSListModel*) base;
	it = gui_cs_list_model_cs_iter_new (iter);
	(*iter).stamp = 0;
	if (parent == NULL) {
		if (self->priv->m_cs->packets_length1 == 0) {
			result = FALSE;
			_gui_cs_list_model_cs_iter_unref0 (it);
			return result;
		}
		gui_cs_list_model_cs_iter_reset (it);
		(*iter).stamp = self->priv->m_stamp;
		result = TRUE;
		_gui_cs_list_model_cs_iter_unref0 (it);
		return result;
	}
	if ((*parent).stamp != self->priv->m_stamp) {
		result = FALSE;
		_gui_cs_list_model_cs_iter_unref0 (it);
		return result;
	}
	pa = gui_cs_list_model_cs_iter_new (parent);
	gui_cs_list_model_cs_iter_copy (it, pa);
	switch (gui_cs_list_model_cs_iter_get_row_type (pa)) {
		case GUI_CS_LIST_MODEL_ROW_TYPE_PACKET:
		{
			gui_cs_list_model_cs_iter_set_dword (it, (guint32) 0);
			gui_cs_list_model_cs_iter_set_in_dwords (it, TRUE);
			break;
		}
		case GUI_CS_LIST_MODEL_ROW_TYPE_VARIANT:
		case GUI_CS_LIST_MODEL_ROW_TYPE_HEADER:
		{
			gui_cs_list_model_cs_iter_set_bitfield (it, (guint32) 0);
			gui_cs_list_model_cs_iter_set_in_bitfields (it, TRUE);
			break;
		}
		case GUI_CS_LIST_MODEL_ROW_TYPE_DWORD:
		{
			if (gui_cs_list_model_get_variant_count (self, gui_cs_list_model_dword_addr (self, (guint) gui_cs_list_model_cs_iter_get_packet (pa), (guint) gui_cs_list_model_cs_iter_get_dword (pa))) == 0) {
				result = FALSE;
				_gui_cs_list_model_cs_iter_unref0 (it);
				_gui_cs_list_model_cs_iter_unref0 (pa);
				return result;
			}
			gui_cs_list_model_cs_iter_set_variant (it, (guint32) 0);
			gui_cs_list_model_cs_iter_set_in_variants (it, TRUE);
			break;
		}
		default:
		{
			result = FALSE;
			_gui_cs_list_model_cs_iter_unref0 (it);
			_gui_cs_list_model_cs_iter_unref0 (pa);
			return result;
		}
	}
	(*iter).stamp = self->priv->m_stamp;
	result = TRUE;
	_gui_cs_list_model_cs_iter_unref0 (it);
	_gui_cs_list_model_cs_iter_unref0 (pa);
	return result;
}


static gboolean gui_cs_list_model_real_iter_has_child (GtkTreeModel* base, GtkTreeIter* iter) {
	GUICSListModel * self;
	gboolean result;
	GUICSListModelCSIter* it;
	self = (GUICSListModel*) base;
	if ((*iter).stamp != self->priv->m_stamp) {
		result = FALSE;
		return result;
	}
	it = gui_cs_list_model_cs_iter_new (iter);
	switch (gui_cs_list_model_cs_iter_get_row_type (it)) {
		case GUI_CS_LIST_MODEL_ROW_TYPE_PACKET:
		{
			result = TRUE;
			_gui_cs_list_model_cs_iter_unref0 (it);
			return result;
		}
		case GUI_CS_LIST_MODEL_ROW_TYPE_HEADER:
		{
			result = TRUE;
			_gui_cs_list_model_cs_iter_unref0 (it);
			return result;
		}
		case GUI_CS_LIST_MODEL_ROW_TYPE_DWORD:
		{
			gboolean _tmp0_ = FALSE;
			if (gui_cs_list_model_get_variant_count (self, gui_cs_list_model_dword_addr (self, (guint) gui_cs_list_model_cs_iter_get_packet (it), (guint) gui_cs_list_model_cs_iter_get_dword (it))) == 0) {
				_tmp0_ = FALSE;
			} else {
				_tmp0_ = TRUE;
			}
			result = _tmp0_;
			_gui_cs_list_model_cs_iter_unref0 (it);
			return result;
		}
		case GUI_CS_LIST_MODEL_ROW_TYPE_VARIANT:
		{
			result = TRUE;
			_gui_cs_list_model_cs_iter_unref0 (it);
			return result;
		}
		case GUI_CS_LIST_MODEL_ROW_TYPE_BITFIELD:
		{
			result = FALSE;
			_gui_cs_list_model_cs_iter_unref0 (it);
			return result;
		}
		case GUI_CS_LIST_MODEL_ROW_TYPE_HEADER_BITFIELD:
		{
			result = FALSE;
			_gui_cs_list_model_cs_iter_unref0 (it);
			return result;
		}
	}
	result = FALSE;
	_gui_cs_list_model_cs_iter_unref0 (it);
	return result;
}


static gint gui_cs_list_model_real_iter_n_children (GtkTreeModel* base, GtkTreeIter* iter) {
	GUICSListModel * self;
	gint result;
	GUICSListModelCSIter* it;
	self = (GUICSListModel*) base;
	if (iter == NULL) {
		result = self->priv->m_cs->packets_length1;
		return result;
	}
	if ((*iter).stamp != self->priv->m_stamp) {
		result = 0;
		return result;
	}
	it = gui_cs_list_model_cs_iter_new (iter);
	switch (gui_cs_list_model_cs_iter_get_row_type (it)) {
		case GUI_CS_LIST_MODEL_ROW_TYPE_PACKET:
		{
			result = ((gint) emulation_packet_base_get_length (self->priv->m_cs->packets[gui_cs_list_model_cs_iter_get_packet (it)])) + 1;
			_gui_cs_list_model_cs_iter_unref0 (it);
			return result;
		}
		case GUI_CS_LIST_MODEL_ROW_TYPE_HEADER:
		{
			result = (gint) gui_cs_list_model_packet_headers_length[emulation_packet_base_get_type_id (self->priv->m_cs->packets[gui_cs_list_model_cs_iter_get_packet (it)])];
			_gui_cs_list_model_cs_iter_unref0 (it);
			return result;
		}
		case GUI_CS_LIST_MODEL_ROW_TYPE_DWORD:
		{
			result = (gint) gui_cs_list_model_get_variant_count (self, gui_cs_list_model_dword_addr (self, (guint) gui_cs_list_model_cs_iter_get_packet (it), (guint) gui_cs_list_model_cs_iter_get_dword (it)));
			_gui_cs_list_model_cs_iter_unref0 (it);
			return result;
		}
		case GUI_CS_LIST_MODEL_ROW_TYPE_VARIANT:
		{
			result = (gint) gui_cs_list_model_get_bitfield_count (self, gui_cs_list_model_dword_addr (self, (guint) gui_cs_list_model_cs_iter_get_packet (it), (guint) gui_cs_list_model_cs_iter_get_dword (it)), (guint) gui_cs_list_model_cs_iter_get_variant (it));
			_gui_cs_list_model_cs_iter_unref0 (it);
			return result;
		}
		case GUI_CS_LIST_MODEL_ROW_TYPE_BITFIELD:
		{
			result = 0;
			_gui_cs_list_model_cs_iter_unref0 (it);
			return result;
		}
		case GUI_CS_LIST_MODEL_ROW_TYPE_HEADER_BITFIELD:
		{
			result = 0;
			_gui_cs_list_model_cs_iter_unref0 (it);
			return result;
		}
	}
	result = 0;
	_gui_cs_list_model_cs_iter_unref0 (it);
	return result;
}


static gboolean gui_cs_list_model_real_iter_nth_child (GtkTreeModel* base, GtkTreeIter* iter, GtkTreeIter* parent, gint n) {
	GUICSListModel * self;
	gboolean result;
	GUICSListModelCSIter* it;
	GUICSListModelCSIter* pa;
	self = (GUICSListModel*) base;
	it = gui_cs_list_model_cs_iter_new (iter);
	(*iter).stamp = 0;
	if (parent == NULL) {
		gboolean _tmp0_ = FALSE;
		if (n >= self->priv->m_cs->packets_length1) {
			_tmp0_ = TRUE;
		} else {
			_tmp0_ = n < 0;
		}
		if (_tmp0_) {
			result = FALSE;
			_gui_cs_list_model_cs_iter_unref0 (it);
			return result;
		}
		(*iter).stamp = self->priv->m_stamp;
		gui_cs_list_model_cs_iter_reset (it);
		gui_cs_list_model_cs_iter_set_packet (it, (guint32) n);
		result = TRUE;
		_gui_cs_list_model_cs_iter_unref0 (it);
		return result;
	}
	if ((*parent).stamp != self->priv->m_stamp) {
		result = FALSE;
		_gui_cs_list_model_cs_iter_unref0 (it);
		return result;
	}
	if (n < 0) {
		result = FALSE;
		_gui_cs_list_model_cs_iter_unref0 (it);
		return result;
	}
	pa = gui_cs_list_model_cs_iter_new (parent);
	gui_cs_list_model_cs_iter_copy (it, pa);
	switch (gui_cs_list_model_cs_iter_get_row_type (pa)) {
		case GUI_CS_LIST_MODEL_ROW_TYPE_PACKET:
		{
			if (n > emulation_packet_base_get_length (self->priv->m_cs->packets[gui_cs_list_model_cs_iter_get_packet (pa)])) {
				result = FALSE;
				_gui_cs_list_model_cs_iter_unref0 (it);
				_gui_cs_list_model_cs_iter_unref0 (pa);
				return result;
			}
			gui_cs_list_model_cs_iter_set_in_dwords (it, TRUE);
			gui_cs_list_model_cs_iter_set_dword (it, (guint32) n);
			break;
		}
		case GUI_CS_LIST_MODEL_ROW_TYPE_HEADER:
		{
			if (n >= gui_cs_list_model_packet_headers_length[emulation_packet_base_get_type_id (self->priv->m_cs->packets[gui_cs_list_model_cs_iter_get_packet (pa)])]) {
				result = FALSE;
				_gui_cs_list_model_cs_iter_unref0 (it);
				_gui_cs_list_model_cs_iter_unref0 (pa);
				return result;
			}
			gui_cs_list_model_cs_iter_set_in_bitfields (it, TRUE);
			gui_cs_list_model_cs_iter_set_bitfield (it, (guint32) n);
			break;
		}
		case GUI_CS_LIST_MODEL_ROW_TYPE_DWORD:
		{
			if (n >= gui_cs_list_model_get_variant_count (self, gui_cs_list_model_dword_addr (self, (guint) gui_cs_list_model_cs_iter_get_packet (pa), (guint) gui_cs_list_model_cs_iter_get_dword (pa)))) {
				result = FALSE;
				_gui_cs_list_model_cs_iter_unref0 (it);
				_gui_cs_list_model_cs_iter_unref0 (pa);
				return result;
			}
			gui_cs_list_model_cs_iter_set_in_variants (it, TRUE);
			gui_cs_list_model_cs_iter_set_variant (it, (guint32) n);
			break;
		}
		case GUI_CS_LIST_MODEL_ROW_TYPE_VARIANT:
		{
			if (n >= gui_cs_list_model_get_bitfield_count (self, gui_cs_list_model_dword_addr (self, (guint) gui_cs_list_model_cs_iter_get_packet (pa), (guint) gui_cs_list_model_cs_iter_get_dword (pa)), (guint) gui_cs_list_model_cs_iter_get_variant (pa))) {
				result = FALSE;
				_gui_cs_list_model_cs_iter_unref0 (it);
				_gui_cs_list_model_cs_iter_unref0 (pa);
				return result;
			}
			gui_cs_list_model_cs_iter_set_in_bitfields (it, TRUE);
			gui_cs_list_model_cs_iter_set_bitfield (it, (guint32) n);
			break;
		}
		default:
		{
			result = FALSE;
			_gui_cs_list_model_cs_iter_unref0 (it);
			_gui_cs_list_model_cs_iter_unref0 (pa);
			return result;
		}
	}
	(*iter).stamp = self->priv->m_stamp;
	result = TRUE;
	_gui_cs_list_model_cs_iter_unref0 (it);
	_gui_cs_list_model_cs_iter_unref0 (pa);
	return result;
}


static gboolean gui_cs_list_model_real_iter_parent (GtkTreeModel* base, GtkTreeIter* iter, GtkTreeIter* child) {
	GUICSListModel * self;
	gboolean result;
	GUICSListModelCSIter* it;
	GUICSListModelCSIter* ch;
	self = (GUICSListModel*) base;
	(*iter).stamp = 0;
	if ((*child).stamp != self->priv->m_stamp) {
		result = FALSE;
		return result;
	}
	it = gui_cs_list_model_cs_iter_new (iter);
	ch = gui_cs_list_model_cs_iter_new (child);
	gui_cs_list_model_cs_iter_copy (it, ch);
	if (gui_cs_list_model_cs_iter_get_in_bitfields (ch)) {
		gui_cs_list_model_cs_iter_set_in_bitfields (it, FALSE);
	} else {
		if (gui_cs_list_model_cs_iter_get_in_variants (ch)) {
			gui_cs_list_model_cs_iter_set_in_variants (it, FALSE);
		} else {
			if (gui_cs_list_model_cs_iter_get_in_dwords (ch)) {
				gui_cs_list_model_cs_iter_set_in_dwords (it, FALSE);
			} else {
				result = FALSE;
				_gui_cs_list_model_cs_iter_unref0 (it);
				_gui_cs_list_model_cs_iter_unref0 (ch);
				return result;
			}
		}
	}
	(*iter).stamp = self->priv->m_stamp;
	result = TRUE;
	_gui_cs_list_model_cs_iter_unref0 (it);
	_gui_cs_list_model_cs_iter_unref0 (ch);
	return result;
}


static void gui_cs_list_model_real_ref_node (GtkTreeModel* base, GtkTreeIter* iter) {
	GUICSListModel * self;
	self = (GUICSListModel*) base;
	return;
}


static void gui_cs_list_model_real_unref_node (GtkTreeModel* base, GtkTreeIter* iter) {
	GUICSListModel * self;
	self = (GUICSListModel*) base;
	return;
}


GUICSListModelCSIter* gui_cs_list_model_cs_iter_construct (GType object_type, GtkTreeIter* iter) {
	GUICSListModelCSIter* self;
	self = (GUICSListModelCSIter*) g_type_create_instance (object_type);
	g_assert (iter != NULL);
	self->priv->m_iter = (GtkTreeIter*) iter;
	return self;
}


GUICSListModelCSIter* gui_cs_list_model_cs_iter_new (GtkTreeIter* iter) {
	return gui_cs_list_model_cs_iter_construct (GUI_CS_LIST_MODEL_TYPE_CS_ITER, iter);
}


static inline guint32 gui_cs_list_model_cs_iter_get_iter_bits (GUICSListModelCSIter* self, guint low, guint high) {
	guint32 result;
	guint64 num;
	g_return_val_if_fail (self != NULL, 0U);
	num = ((guint64) (*((guint32*) (&(*self->priv->m_iter).user_data)))) | (((guint64) (*((guint32*) (&(*self->priv->m_iter).user_data2)))) << 32);
	result = (guint32) ((num >> low) & ((((guint64) 1) << ((high - low) + 1)) - 1));
	return result;
}


static inline void gui_cs_list_model_cs_iter_set_iter_bits (GUICSListModelCSIter* self, guint low, guint high, guint32 val) {
	guint64 num;
	guint64 mask;
	guint32 num32[2] = {0};
	g_return_if_fail (self != NULL);
	num = ((guint64) (*((guint32*) (&(*self->priv->m_iter).user_data)))) | (((guint64) (*((guint32*) (&(*self->priv->m_iter).user_data2)))) << 32);
	mask = ((((guint64) 1) << ((high - low) + 1)) - 1) << low;
	num = num & (~mask);
	num = num | ((((guint64) val) << low) & mask);
	num32[0] = (guint32) num;
	num32[1] = (guint32) (num >> 32);
	(*self->priv->m_iter).user_data = *((void**) (&num32[0]));
	(*self->priv->m_iter).user_data2 = *((void**) (&num32[1]));
}


void gui_cs_list_model_cs_iter_reset (GUICSListModelCSIter* self) {
	g_return_if_fail (self != NULL);
	gui_cs_list_model_cs_iter_set_iter_bits (self, (guint) 0, (guint) 31, (guint32) 0);
	gui_cs_list_model_cs_iter_set_iter_bits (self, (guint) 32, (guint) 51, (guint32) 0);
}


void gui_cs_list_model_cs_iter_copy (GUICSListModelCSIter* self, GUICSListModelCSIter* it) {
	g_return_if_fail (self != NULL);
	g_return_if_fail (it != NULL);
	gui_cs_list_model_cs_iter_set_iter_bits (self, (guint) 0, (guint) 31, gui_cs_list_model_cs_iter_get_iter_bits (it, (guint) 0, (guint) 31));
	gui_cs_list_model_cs_iter_set_iter_bits (self, (guint) 32, (guint) 51, gui_cs_list_model_cs_iter_get_iter_bits (it, (guint) 32, (guint) 51));
}


guint32 gui_cs_list_model_cs_iter_get_packet (GUICSListModelCSIter* self) {
	guint32 result;
	g_return_val_if_fail (self != NULL, 0U);
	result = gui_cs_list_model_cs_iter_get_iter_bits (self, (guint) 0, (guint) 13);
	return result;
}


void gui_cs_list_model_cs_iter_set_packet (GUICSListModelCSIter* self, guint32 value) {
	g_return_if_fail (self != NULL);
	gui_cs_list_model_cs_iter_set_iter_bits (self, (guint) 0, (guint) 13, value);
}


guint32 gui_cs_list_model_cs_iter_get_dword (GUICSListModelCSIter* self) {
	guint32 result;
	g_return_val_if_fail (self != NULL, 0U);
	result = gui_cs_list_model_cs_iter_get_iter_bits (self, (guint) 15, (guint) 29);
	return result;
}


void gui_cs_list_model_cs_iter_set_dword (GUICSListModelCSIter* self, guint32 value) {
	g_return_if_fail (self != NULL);
	gui_cs_list_model_cs_iter_set_iter_bits (self, (guint) 15, (guint) 29, value);
}


guint32 gui_cs_list_model_cs_iter_get_variant (GUICSListModelCSIter* self) {
	guint32 result;
	g_return_val_if_fail (self != NULL, 0U);
	result = gui_cs_list_model_cs_iter_get_iter_bits (self, (guint) 31, (guint) 45);
	return result;
}


void gui_cs_list_model_cs_iter_set_variant (GUICSListModelCSIter* self, guint32 value) {
	g_return_if_fail (self != NULL);
	gui_cs_list_model_cs_iter_set_iter_bits (self, (guint) 31, (guint) 45, value);
}


guint32 gui_cs_list_model_cs_iter_get_bitfield (GUICSListModelCSIter* self) {
	guint32 result;
	g_return_val_if_fail (self != NULL, 0U);
	result = gui_cs_list_model_cs_iter_get_iter_bits (self, (guint) 47, (guint) 51);
	return result;
}


void gui_cs_list_model_cs_iter_set_bitfield (GUICSListModelCSIter* self, guint32 value) {
	g_return_if_fail (self != NULL);
	gui_cs_list_model_cs_iter_set_iter_bits (self, (guint) 47, (guint) 51, value);
}


gboolean gui_cs_list_model_cs_iter_get_in_dwords (GUICSListModelCSIter* self) {
	gboolean result;
	gboolean _tmp0_ = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	if (gui_cs_list_model_cs_iter_get_iter_bits (self, (guint) 14, (guint) 14) == 1) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}


void gui_cs_list_model_cs_iter_set_in_dwords (GUICSListModelCSIter* self, gboolean value) {
	gint _tmp1_ = 0;
	g_return_if_fail (self != NULL);
	if (value) {
		_tmp1_ = 1;
	} else {
		_tmp1_ = 0;
	}
	gui_cs_list_model_cs_iter_set_iter_bits (self, (guint) 14, (guint) 14, (guint32) _tmp1_);
}


gboolean gui_cs_list_model_cs_iter_get_in_variants (GUICSListModelCSIter* self) {
	gboolean result;
	gboolean _tmp0_ = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	if (gui_cs_list_model_cs_iter_get_iter_bits (self, (guint) 30, (guint) 30) == 1) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}


void gui_cs_list_model_cs_iter_set_in_variants (GUICSListModelCSIter* self, gboolean value) {
	gint _tmp1_ = 0;
	g_return_if_fail (self != NULL);
	if (value) {
		_tmp1_ = 1;
	} else {
		_tmp1_ = 0;
	}
	gui_cs_list_model_cs_iter_set_iter_bits (self, (guint) 30, (guint) 30, (guint32) _tmp1_);
}


gboolean gui_cs_list_model_cs_iter_get_in_bitfields (GUICSListModelCSIter* self) {
	gboolean result;
	gboolean _tmp0_ = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	if (gui_cs_list_model_cs_iter_get_iter_bits (self, (guint) 46, (guint) 46) == 1) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}


void gui_cs_list_model_cs_iter_set_in_bitfields (GUICSListModelCSIter* self, gboolean value) {
	gint _tmp1_ = 0;
	g_return_if_fail (self != NULL);
	if (value) {
		_tmp1_ = 1;
	} else {
		_tmp1_ = 0;
	}
	gui_cs_list_model_cs_iter_set_iter_bits (self, (guint) 46, (guint) 46, (guint32) _tmp1_);
}


gboolean gui_cs_list_model_cs_iter_get_is_header (GUICSListModelCSIter* self) {
	gboolean result;
	gboolean _tmp0_ = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	if (gui_cs_list_model_cs_iter_get_dword (self) == 0) {
		_tmp0_ = gui_cs_list_model_cs_iter_get_in_dwords (self);
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}


GUICSListModelRowType gui_cs_list_model_cs_iter_get_row_type (GUICSListModelCSIter* self) {
	GUICSListModelRowType result;
	g_return_val_if_fail (self != NULL, 0);
	if (gui_cs_list_model_cs_iter_get_in_bitfields (self)) {
		GUICSListModelRowType _tmp0_ = 0;
		if (gui_cs_list_model_cs_iter_get_is_header (self)) {
			_tmp0_ = GUI_CS_LIST_MODEL_ROW_TYPE_HEADER_BITFIELD;
		} else {
			_tmp0_ = GUI_CS_LIST_MODEL_ROW_TYPE_BITFIELD;
		}
		result = _tmp0_;
		return result;
	} else {
		if (gui_cs_list_model_cs_iter_get_in_variants (self)) {
			result = GUI_CS_LIST_MODEL_ROW_TYPE_VARIANT;
			return result;
		} else {
			if (gui_cs_list_model_cs_iter_get_in_dwords (self)) {
				GUICSListModelRowType _tmp1_ = 0;
				if (gui_cs_list_model_cs_iter_get_is_header (self)) {
					_tmp1_ = GUI_CS_LIST_MODEL_ROW_TYPE_HEADER;
				} else {
					_tmp1_ = GUI_CS_LIST_MODEL_ROW_TYPE_DWORD;
				}
				result = _tmp1_;
				return result;
			}
		}
	}
	result = GUI_CS_LIST_MODEL_ROW_TYPE_PACKET;
	return result;
}


static void gui_cs_list_model_value_cs_iter_init (GValue* value) {
	value->data[0].v_pointer = NULL;
}


static void gui_cs_list_model_value_cs_iter_free_value (GValue* value) {
	if (value->data[0].v_pointer) {
		gui_cs_list_model_cs_iter_unref (value->data[0].v_pointer);
	}
}


static void gui_cs_list_model_value_cs_iter_copy_value (const GValue* src_value, GValue* dest_value) {
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = gui_cs_list_model_cs_iter_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}


static gpointer gui_cs_list_model_value_cs_iter_peek_pointer (const GValue* value) {
	return value->data[0].v_pointer;
}


static gchar* gui_cs_list_model_value_cs_iter_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		GUICSListModelCSIter* object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = gui_cs_list_model_cs_iter_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* gui_cs_list_model_value_cs_iter_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	GUICSListModelCSIter** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags && G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = gui_cs_list_model_cs_iter_ref (value->data[0].v_pointer);
	}
	return NULL;
}


GParamSpec* gui_cs_list_model_param_spec_cs_iter (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	GUICSListModelParamSpecCSIter* spec;
	g_return_val_if_fail (g_type_is_a (object_type, GUI_CS_LIST_MODEL_TYPE_CS_ITER), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}


gpointer gui_cs_list_model_value_get_cs_iter (const GValue* value) {
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GUI_CS_LIST_MODEL_TYPE_CS_ITER), NULL);
	return value->data[0].v_pointer;
}


void gui_cs_list_model_value_set_cs_iter (GValue* value, gpointer v_object) {
	GUICSListModelCSIter* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GUI_CS_LIST_MODEL_TYPE_CS_ITER));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GUI_CS_LIST_MODEL_TYPE_CS_ITER));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		gui_cs_list_model_cs_iter_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		gui_cs_list_model_cs_iter_unref (old);
	}
}


static void gui_cs_list_model_cs_iter_class_init (GUICSListModelCSIterClass * klass) {
	gui_cs_list_model_cs_iter_parent_class = g_type_class_peek_parent (klass);
	GUI_CS_LIST_MODEL_CS_ITER_CLASS (klass)->finalize = gui_cs_list_model_cs_iter_finalize;
	g_type_class_add_private (klass, sizeof (GUICSListModelCSIterPrivate));
}


static void gui_cs_list_model_cs_iter_instance_init (GUICSListModelCSIter * self) {
	self->priv = GUI_CS_LIST_MODEL_CS_ITER_GET_PRIVATE (self);
	self->ref_count = 1;
}


static void gui_cs_list_model_cs_iter_finalize (GUICSListModelCSIter* obj) {
	GUICSListModelCSIter * self;
	self = GUI_CS_LIST_MODEL_CS_ITER (obj);
}


GType gui_cs_list_model_cs_iter_get_type (void) {
	static GType gui_cs_list_model_cs_iter_type_id = 0;
	if (gui_cs_list_model_cs_iter_type_id == 0) {
		static const GTypeValueTable g_define_type_value_table = { gui_cs_list_model_value_cs_iter_init, gui_cs_list_model_value_cs_iter_free_value, gui_cs_list_model_value_cs_iter_copy_value, gui_cs_list_model_value_cs_iter_peek_pointer, "p", gui_cs_list_model_value_cs_iter_collect_value, "p", gui_cs_list_model_value_cs_iter_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (GUICSListModelCSIterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gui_cs_list_model_cs_iter_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GUICSListModelCSIter), 0, (GInstanceInitFunc) gui_cs_list_model_cs_iter_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		gui_cs_list_model_cs_iter_type_id = g_type_register_fundamental (g_type_fundamental_next (), "GUICSListModelCSIter", &g_define_type_info, &g_define_type_fundamental_info, 0);
	}
	return gui_cs_list_model_cs_iter_type_id;
}


gpointer gui_cs_list_model_cs_iter_ref (gpointer instance) {
	GUICSListModelCSIter* self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}


void gui_cs_list_model_cs_iter_unref (gpointer instance) {
	GUICSListModelCSIter* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		GUI_CS_LIST_MODEL_CS_ITER_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}


static void gui_cs_list_model_class_init (GUICSListModelClass * klass) {
	char** _tmp0_ = NULL;
	char** _tmp1_ = NULL;
	char** _tmp2_ = NULL;
	char** _tmp3_ = NULL;
	char** _tmp4_ = NULL;
	char*** _tmp9_ = NULL;
	char** _tmp8_;
	char** _tmp7_;
	char** _tmp6_;
	char** _tmp5_;
	guint* _tmp10_ = NULL;
	gui_cs_list_model_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GUICSListModelPrivate));
	G_OBJECT_CLASS (klass)->finalize = gui_cs_list_model_finalize;
	gui_cs_list_model_packet_strings = (_tmp0_ = g_new0 (char*, 4 + 1), _tmp0_[0] = g_strdup ("packet0"), _tmp0_[1] = g_strdup ("packet1"), _tmp0_[2] = g_strdup ("packet2"), _tmp0_[3] = g_strdup ("packet3"), _tmp0_);
	gui_cs_list_model_packet_strings_length1 = 4;
	gui_cs_list_model_packet0_headers = (_tmp1_ = g_new0 (char*, 4 + 1), _tmp1_[0] = g_strdup ("BASE_INDEX"), _tmp1_[1] = g_strdup ("ONE_REG_WR"), _tmp1_[2] = g_strdup ("COUNT"), _tmp1_[3] = g_strdup ("TYPE"), _tmp1_);
	gui_cs_list_model_packet0_headers_length1 = 4;
	gui_cs_list_model_packet1_headers = (_tmp2_ = g_new0 (char*, 3 + 1), _tmp2_[0] = g_strdup ("REG_INDEX1"), _tmp2_[1] = g_strdup ("REG_INDEX2"), _tmp2_[2] = g_strdup ("TYPE"), _tmp2_);
	gui_cs_list_model_packet1_headers_length1 = 3;
	gui_cs_list_model_packet2_headers = (_tmp3_ = g_new0 (char*, 1 + 1), _tmp3_[0] = g_strdup ("TYPE"), _tmp3_);
	gui_cs_list_model_packet2_headers_length1 = 1;
	gui_cs_list_model_packet3_headers = (_tmp4_ = g_new0 (char*, 3 + 1), _tmp4_[0] = g_strdup ("IT_OPCODE"), _tmp4_[1] = g_strdup ("COUNT"), _tmp4_[2] = g_strdup ("TYPE"), _tmp4_);
	gui_cs_list_model_packet3_headers_length1 = 3;
	gui_cs_list_model_packet_headers = (_tmp9_ = g_new0 (char**, 4), _tmp9_[0] = (_tmp5_ = gui_cs_list_model_packet0_headers, (_tmp5_ == NULL) ? ((gpointer) _tmp5_) : _vala_array_dup3 (_tmp5_, gui_cs_list_model_packet0_headers_length1)), _tmp9_[1] = (_tmp6_ = gui_cs_list_model_packet1_headers, (_tmp6_ == NULL) ? ((gpointer) _tmp6_) : _vala_array_dup4 (_tmp6_, gui_cs_list_model_packet1_headers_length1)), _tmp9_[2] = (_tmp7_ = gui_cs_list_model_packet2_headers, (_tmp7_ == NULL) ? ((gpointer) _tmp7_) : _vala_array_dup5 (_tmp7_, gui_cs_list_model_packet2_headers_length1)), _tmp9_[3] = (_tmp8_ = gui_cs_list_model_packet3_headers, (_tmp8_ == NULL) ? ((gpointer) _tmp8_) : _vala_array_dup6 (_tmp8_, gui_cs_list_model_packet3_headers_length1)), _tmp9_);
	gui_cs_list_model_packet_headers_length1 = 4;
	gui_cs_list_model_packet_headers_length = (_tmp10_ = g_new0 (guint, 4), _tmp10_[0] = (guint) 4, _tmp10_[1] = (guint) 3, _tmp10_[2] = (guint) 1, _tmp10_[3] = (guint) 3, _tmp10_);
	gui_cs_list_model_packet_headers_length_length1 = 4;
}


static void gui_cs_list_model_gtk_tree_model_interface_init (GtkTreeModelIface * iface) {
	gui_cs_list_model_gtk_tree_model_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_flags = gui_cs_list_model_real_get_flags;
	iface->get_n_columns = gui_cs_list_model_real_get_n_columns;
	iface->get_column_type = gui_cs_list_model_real_get_column_type;
	iface->get_iter = gui_cs_list_model_real_get_iter;
	iface->get_path = gui_cs_list_model_real_get_path;
	iface->get_value = gui_cs_list_model_real_get_value;
	iface->iter_next = gui_cs_list_model_real_iter_next;
	iface->iter_children = gui_cs_list_model_real_iter_children;
	iface->iter_has_child = gui_cs_list_model_real_iter_has_child;
	iface->iter_n_children = gui_cs_list_model_real_iter_n_children;
	iface->iter_nth_child = gui_cs_list_model_real_iter_nth_child;
	iface->iter_parent = gui_cs_list_model_real_iter_parent;
	iface->ref_node = gui_cs_list_model_real_ref_node;
	iface->unref_node = gui_cs_list_model_real_unref_node;
}


static void gui_cs_list_model_instance_init (GUICSListModel * self) {
	self->priv = GUI_CS_LIST_MODEL_GET_PRIVATE (self);
}


static void gui_cs_list_model_finalize (GObject* obj) {
	GUICSListModel * self;
	self = GUI_CS_LIST_MODEL (obj);
	_g_object_unref0 (self->priv->m_cs);
	_g_object_unref0 (self->priv->m_spec);
	G_OBJECT_CLASS (gui_cs_list_model_parent_class)->finalize (obj);
}


GType gui_cs_list_model_get_type (void) {
	static GType gui_cs_list_model_type_id = 0;
	if (gui_cs_list_model_type_id == 0) {
		static const GTypeInfo g_define_type_info = { sizeof (GUICSListModelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gui_cs_list_model_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GUICSListModel), 0, (GInstanceInitFunc) gui_cs_list_model_instance_init, NULL };
		static const GInterfaceInfo gtk_tree_model_info = { (GInterfaceInitFunc) gui_cs_list_model_gtk_tree_model_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		gui_cs_list_model_type_id = g_type_register_static (G_TYPE_OBJECT, "GUICSListModel", &g_define_type_info, 0);
		g_type_add_interface_static (gui_cs_list_model_type_id, GTK_TYPE_TREE_MODEL, &gtk_tree_model_info);
	}
	return gui_cs_list_model_type_id;
}


static glong string_get_length (const char* self) {
	glong result;
	g_return_val_if_fail (self != NULL, 0L);
	result = g_utf8_strlen (self, -1);
	return result;
}


static void _lambda8_ (GtkComboBox* combo, GUICSView* self) {
	g_return_if_fail (combo != NULL);
	gtk_tree_view_set_model (self->priv->cs_view, (GtkTreeModel*) self->priv->models[gtk_combo_box_get_active (combo)]);
}


static void __lambda8__gtk_combo_box_changed (GtkComboBox* _sender, gpointer self) {
	_lambda8_ (_sender, self);
}


GUICSView* gui_cs_view_construct (GType object_type, EmulationCS* cs) {
	GError * _inner_error_;
	GUICSView * self;
	GtkBuilder* builder;
	GUICSListModel** _tmp0_;
	GtkComboBox* chips;
	GObject* _tmp3_;
	GtkHBox* chips_box;
	GtkTreeView* _tmp5_;
	GObject* _tmp4_;
	GtkTreeViewColumn* _tmp7_;
	GtkCellRendererText* _tmp6_;
	GtkTreeViewColumn* _tmp9_;
	GtkCellRendererText* _tmp8_;
	GtkTreeViewColumn* _tmp11_;
	GtkCellRendererText* _tmp10_;
	GtkButton* _tmp13_;
	GObject* _tmp12_;
	GtkButton* _tmp15_;
	GObject* _tmp14_;
	GObject* _tmp16_;
	g_return_val_if_fail (cs != NULL, NULL);
	_inner_error_ = NULL;
	self = g_object_newv (object_type, 0, NULL);
	builder = gtk_builder_new ();
	{
		gtk_builder_add_from_string (builder, gui_cs_view_xml_ui, (gsize) string_get_length (gui_cs_view_xml_ui), &_inner_error_);
		if (_inner_error_ != NULL) {
			goto __catch2_g_error;
		}
	}
	goto __finally2;
	__catch2_g_error:
	{
		GError * e;
		e = _inner_error_;
		_inner_error_ = NULL;
		{
			fprintf (stderr, "Unable to construct cs viewer: %s\n", e->message);
			_g_error_free0 (e);
			_g_object_unref0 (builder);
			return self;
		}
	}
	__finally2:
	if (_inner_error_ != NULL) {
		_g_object_unref0 (builder);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return NULL;
	}
	gtk_window_set_title ((GtkWindow*) self, "Viewing CS");
	gtk_container_set_border_width ((GtkContainer*) self, (guint) 10);
	gtk_window_set_default_size ((GtkWindow*) self, 640, 480);
	self->priv->models = (_tmp0_ = g_new0 (GUICSListModel*, emulation_specs_length1 + 1), self->priv->models = (_vala_array_free (self->priv->models, self->priv->models_length1, (GDestroyNotify) g_object_unref), NULL), self->priv->models_length1 = emulation_specs_length1, self->priv->models_size = self->priv->models_length1, _tmp0_);
	chips = g_object_ref_sink ((GtkComboBox*) gtk_combo_box_new_text ());
	{
		guint i;
		i = (guint) 0;
		{
			gboolean _tmp1_;
			_tmp1_ = TRUE;
			while (TRUE) {
				GUICSListModel* _tmp2_;
				if (!_tmp1_) {
					i++;
				}
				_tmp1_ = FALSE;
				if (!(i < emulation_specs_length1)) {
					break;
				}
				gtk_combo_box_append_text (chips, emulation_specs[i].name);
				self->priv->models[i] = (_tmp2_ = gui_cs_list_model_new (cs, emulation_specs[i].spec), _g_object_unref0 (self->priv->models[i]), _tmp2_);
			}
		}
	}
	gtk_combo_box_set_active (chips, (gint) emulation_spec_default);
	g_signal_connect_object (chips, "changed", (GCallback) __lambda8__gtk_combo_box_changed, self, 0);
	chips_box = _g_object_ref0 ((_tmp3_ = gtk_builder_get_object (builder, "chips_box"), GTK_IS_HBOX (_tmp3_) ? ((GtkHBox*) _tmp3_) : NULL));
	gtk_box_pack_start ((GtkBox*) chips_box, (GtkWidget*) chips, FALSE, FALSE, (guint) 0);
	self->priv->cs_view = (_tmp5_ = _g_object_ref0 ((_tmp4_ = gtk_builder_get_object (builder, "packet_tree"), GTK_IS_TREE_VIEW (_tmp4_) ? ((GtkTreeView*) _tmp4_) : NULL)), _g_object_unref0 (self->priv->cs_view), _tmp5_);
	gtk_tree_view_set_model (self->priv->cs_view, (GtkTreeModel*) self->priv->models[emulation_spec_default]);
	gtk_tree_view_insert_column (self->priv->cs_view, _tmp7_ = g_object_ref_sink (gtk_tree_view_column_new_with_attributes ("Name", (GtkCellRenderer*) (_tmp6_ = g_object_ref_sink ((GtkCellRendererText*) gtk_cell_renderer_text_new ())), "text", GUI_CS_LIST_MODEL_COLUMNS_NAME, NULL, NULL)), -1);
	_g_object_unref0 (_tmp7_);
	_g_object_unref0 (_tmp6_);
	gtk_tree_view_insert_column (self->priv->cs_view, _tmp9_ = g_object_ref_sink (gtk_tree_view_column_new_with_attributes ("Value", (GtkCellRenderer*) (_tmp8_ = g_object_ref_sink ((GtkCellRendererText*) gtk_cell_renderer_text_new ())), "text", GUI_CS_LIST_MODEL_COLUMNS_VALUE, NULL, NULL)), -1);
	_g_object_unref0 (_tmp9_);
	_g_object_unref0 (_tmp8_);
	gtk_tree_view_insert_column (self->priv->cs_view, _tmp11_ = g_object_ref_sink (gtk_tree_view_column_new_with_attributes ("Target", (GtkCellRenderer*) (_tmp10_ = g_object_ref_sink ((GtkCellRendererText*) gtk_cell_renderer_text_new ())), "text", GUI_CS_LIST_MODEL_COLUMNS_TARGET, NULL, NULL)), -1);
	_g_object_unref0 (_tmp11_);
	_g_object_unref0 (_tmp10_);
	self->priv->up_btn = (_tmp13_ = _g_object_ref0 ((_tmp12_ = gtk_builder_get_object (builder, "up_button"), GTK_IS_BUTTON (_tmp12_) ? ((GtkButton*) _tmp12_) : NULL)), _g_object_unref0 (self->priv->up_btn), _tmp13_);
	self->priv->down_btn = (_tmp15_ = _g_object_ref0 ((_tmp14_ = gtk_builder_get_object (builder, "down_button"), GTK_IS_BUTTON (_tmp14_) ? ((GtkButton*) _tmp14_) : NULL)), _g_object_unref0 (self->priv->down_btn), _tmp15_);
	gtk_container_add ((GtkContainer*) self, (_tmp16_ = gtk_builder_get_object (builder, "mainbox"), GTK_IS_WIDGET (_tmp16_) ? ((GtkWidget*) _tmp16_) : NULL));
	_g_object_unref0 (builder);
	_g_object_unref0 (chips);
	_g_object_unref0 (chips_box);
	return self;
}


GUICSView* gui_cs_view_new (EmulationCS* cs) {
	return gui_cs_view_construct (GUI_TYPE_CS_VIEW, cs);
}


static void gui_cs_view_class_init (GUICSViewClass * klass) {
	gui_cs_view_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GUICSViewPrivate));
	G_OBJECT_CLASS (klass)->finalize = gui_cs_view_finalize;
	gui_cs_view_xml_ui = g_strdup ("\n        <?xml version=\"1.0\"?>\n        <interface>\n          <requires lib=\"gtk+\" version=\"2.16\"/>\n          <!-- interface-naming-policy project-wide -->\n          <object class=\"GtkVBox\" id=\"mainbox\">\n            <property name=\"visible\">True</property>\n            <property name=\"orientation\">vertical</property>\n            <property name=\"spacing\">4</property>\n            <child>\n              <object class=\"GtkHBox\" id=\"chips_box\">\n                <property name=\"visible\">True</property>\n                <property name=\"spacing\">4</property>\n                <child>\n                  <object class=\"GtkLabel\" id=\"label1\">\n                    <property name=\"visible\">True</property>\n                    <property name=\"label\" translatable=\"yes\">&lt;b&gt;Chip&lt;/b&gt;</property>\n                    <property name=\"use_markup\">True</property>\n                  </object>\n                  <packing>\n                    <property name=\"expand\">False</property>\n                    <property name=\"position\">0</property>\n                  </packing>\n                </child>\n              </object>\n              <packing>\n                <property name=\"expand\">False</property>\n                <property name=\"position\">0</property>\n              </packing>\n            </child>\n            <child>\n              <object class=\"GtkHBox\" id=\"hbox2\">\n                <property name=\"visible\">True</property>\n                <property name=\"spacing\">4</property>\n                <child>\n                  <object class=\"GtkScrolledWindow\" id=\"scrolledwindow1\">\n                    <property name=\"visible\">True</property>\n                    <property name=\"can_focus\">True</property>\n                    <property name=\"hscrollbar_policy\">automatic</property>\n                    <property name=\"vscrollbar_policy\">automatic</property>\n                    <property name=\"shadow_type\">etched-in</property>\n                    <child>\n                      <object class=\"GtkTreeView\" id=\"packet_tree\">\n                        <property name=\"visible\">True</property>\n                        <property name=\"can_focus\">True</property>\n                      </object>\n                    </child>\n                  </object>\n                  <packing>\n                    <property name=\"position\">0</property>\n                  </packing>\n                </child>\n                <child>\n                  <object class=\"GtkVBox\" id=\"vbox2\">\n                    <property name=\"visible\">True</property>\n                    <property name=\"orientation\">vertical</property>\n                    <child>\n                      <object class=\"GtkButton\" id=\"up_button\">\n                        <property name=\"visible\">True</property>\n                        <property name=\"can_focus\">True</property>\n                        <property name=\"receives_default\">True</property>\n                        <child>\n                          <object class=\"GtkImage\" id=\"image2\">\n                            <property name=\"visible\">True</property>\n                            <property name=\"stock\">gtk-go-up</property>\n                          </object>\n                        </child>\n                      </object>\n                      <packing>\n                        <property name=\"expand\">False</property>\n                        <property name=\"position\">0</property>\n                      </packing>\n                    </child>\n                    <child>\n                      <object class=\"GtkButton\" id=\"down_button\">\n                        <property name=\"visible\">True</property>\n                        <property name=\"can_focus\">True</property>\n                        <property name=\"receives_default\">True</property>\n                        <child>\n                          <object class=\"GtkImage\" id=\"image1\">\n                            <property name=\"visible\">True</property>\n                            <property name=\"stock\">gtk-go-down</property>\n                          </object>\n                        </child>\n                      </object>\n                      <packing>\n                        <property name=\"expand\">False</property>\n                        <property name=\"pack_type\">end</property>\n                        <property name=\"position\">1</property>\n                      </packing>\n                    </child>\n                  </object>\n                  <packing>\n                    <property name=\"expand\">False</property>\n                    <property name=\"position\">1</property>\n                  </packing>\n                </child>\n              </object>\n              <packing>\n                <property name=\"position\">1</property>\n              </packing>\n            </child>\n          </object>\n        </interface>\n        ");
}


static void gui_cs_view_instance_init (GUICSView * self) {
	self->priv = GUI_CS_VIEW_GET_PRIVATE (self);
}


static void gui_cs_view_finalize (GObject* obj) {
	GUICSView * self;
	self = GUI_CS_VIEW (obj);
	_g_object_unref0 (self->priv->up_btn);
	_g_object_unref0 (self->priv->down_btn);
	self->priv->models = (_vala_array_free (self->priv->models, self->priv->models_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (self->priv->cs_view);
	G_OBJECT_CLASS (gui_cs_view_parent_class)->finalize (obj);
}


GType gui_cs_view_get_type (void) {
	static GType gui_cs_view_type_id = 0;
	if (gui_cs_view_type_id == 0) {
		static const GTypeInfo g_define_type_info = { sizeof (GUICSViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gui_cs_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GUICSView), 0, (GInstanceInitFunc) gui_cs_view_instance_init, NULL };
		gui_cs_view_type_id = g_type_register_static (GTK_TYPE_WINDOW, "GUICSView", &g_define_type_info, 0);
	}
	return gui_cs_view_type_id;
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}