llparse.opp.exp 68.8 KB
Newer Older
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
File "llparse.mly", line 74, characters 16-22:
Warning: the token APSint is unused.
File "llparse.mly", line 76, characters 7-16:
Warning: the token Backslash is unused.
File "llparse.mly", line 99, characters 7-12:
Warning: the token Error is unused.
%{

(* Parser for LLVM IR.  Needs to be kept up to date with the LLVM equivalent, see: *)
(*  https://github.com/llvm-mirror/llvm/commits/master/lib/AsmParser/LLParser.cpp  *)

type toplevel =
  | Fun of Llabs.finfo
  | Asm of string
  | Target of string
  | Datalayout of string
  | Deplibs of string list
  | Typ of Llabs.var * Llabs.typ option
  | Global of Llabs.ginfo
  | Alias of Llabs.ainfo
  | MDNodeDefn of Llabs.mdinfo
  | MDVarDefn of string * int list
  | ComdatVarDefn of string * Llabs.selectionkind
  | Attrgrp of int * Llabs.attribute list

let list_of_string s =
  if String.length s < 2 || String.get s 0 <> '"' || String.get s (String.length s - 1) <> '"' then
    failwith "list_of_string: expected quoted string constant";
  let l = ref [] in
  for i = (String.length s - 2) downto 1 do
    l := (String.get s i)::(!l)
  done;
  let is_hexdigit c =
    ('0' <= c && c <= '9') || ('A' <= c && c <= 'F') || ('A' <= c && c <= 'F') in
  let rec build = function
    | '\\'::x::y::tl when is_hexdigit x && is_hexdigit y ->
        (Scanf.sscanf (Printf.sprintf "%c%c" x y) "%x" (fun i -> i))::(build tl)
    | [] -> []
    | hd::tl -> (Char.code hd)::(build tl) in
  List.map
    (fun i -> (Llabs.Integer 8, Llabs.Int(Big_int.big_int_of_int i)))
    (build !l)

let process_toplevels t =
  let cu = {
    Llabs.ctarget=None;
    Llabs.cdatalayout=None;
    Llabs.casms=[];
    Llabs.cfuns=[];
    Llabs.ctyps=[];
    Llabs.cglobals=[];
    Llabs.caliases=[];
    Llabs.cmdnodes=[];
    Llabs.cmdvars=[];
    Llabs.cattrgrps=[];
  } in
  let proc = function
    | Fun fi -> cu.Llabs.cfuns <- fi::cu.Llabs.cfuns
    | Asm x -> cu.Llabs.casms <- x::cu.Llabs.casms
    | Target x ->
        if cu.Llabs.ctarget<>None then failwith "compilation unit with multiple targets"
        else cu.Llabs.ctarget <- Some x
    | Datalayout x ->
        if cu.Llabs.cdatalayout<>None then failwith "compilation unit with multiple datalayouts"
        else cu.Llabs.cdatalayout <- Some x
    | Deplibs _ -> () (* parses but ignored in LLVM 3.4, to be removed in 4.0 *)
    | Typ(x,y) -> cu.Llabs.ctyps <- (x,y)::cu.Llabs.ctyps
    | Global x -> cu.Llabs.cglobals <- x::cu.Llabs.cglobals
    | Alias x -> cu.Llabs.caliases <- x::cu.Llabs.caliases
    | MDNodeDefn x -> cu.Llabs.cmdnodes <- x::cu.Llabs.cmdnodes
    | MDVarDefn(x,y) -> cu.Llabs.cmdvars <- (x,y)::cu.Llabs.cmdvars
    | ComdatVarDefn(x,y) -> () (* ignored for now *)
    | Attrgrp(x,y) -> cu.Llabs.cattrgrps <- (x,y)::cu.Llabs.cattrgrps in
  List.iter proc (List.rev t);
  cu

%}
%start main
%token <string> StringConstant
%token Star
%token Rsquare
%token Rparen
%token Rbrace
%token <string> MetadataVar
%token Lsquare
%token Lparen
%token <Llabs.var> LocalVarID
%token <Llabs.var> LocalVar
%token Less
%token Lbrace
%token <string> LabelStr
%token Kw_zext
%token Kw_zeroinitializer
%token Kw_zeroext
%token Kw_xor
%token Kw_xchg
%token Kw_x86_thiscallcc
%token Kw_x86_stdcallcc
%token Kw_x86_mmx
%token Kw_x86_fp80
%token Kw_x86_fastcallcc
%token Kw_x86_cdeclmethodcc
%token Kw_x86_64_win64cc
%token Kw_x86_64_sysvcc
%token Kw_x
%token Kw_webkit_jscc
%token Kw_weak_odr
%token Kw_weak
%token Kw_volatile
%token Kw_void
%token Kw_va_arg
%token Kw_uwtable
%token Kw_urem
%token Kw_unwind
%token Kw_unreachable
%token Kw_unordered
%token Kw_uno
%token Kw_unnamed_addr
%token Kw_une
%token Kw_undef
%token Kw_umin
%token Kw_umax
%token Kw_ult
%token Kw_ule
%token Kw_uitofp
%token Kw_ugt
%token Kw_uge
%token Kw_ueq
%token Kw_udiv
%token Kw_type
%token Kw_trunc
%token Kw_true
%token Kw_triple
%token Kw_to
%token Kw_thread_local
%token Kw_target
%token Kw_tail
%token Kw_switch
%token Kw_sub
%token Kw_store
%token Kw_sspstrong
%token Kw_sspreq
%token Kw_ssp
%token Kw_sret
%token Kw_srem
%token Kw_spir_kernel
%token Kw_spir_func
%token Kw_slt
%token Kw_sle
%token Kw_sitofp
%token Kw_singlethread
%token Kw_signext
%token Kw_sideeffect
%token Kw_shufflevector
%token Kw_shl
%token Kw_sgt
%token Kw_sge
%token Kw_sext
%token Kw_seq_cst
%token Kw_select
%token Kw_section
%token Kw_sdiv
%token Kw_sanitize_thread
%token Kw_sanitize_memory
%token Kw_sanitize_address
%token Kw_samesize
%token Kw_returns_twice
%token Kw_returned
%token Kw_ret
%token Kw_resume
%token Kw_release
%token Kw_readonly
%token Kw_readnone
%token Kw_ptx_kernel
%token Kw_ptx_device
%token Kw_ptrtoint
%token Kw_protected
%token Kw_private
%token Kw_preserve_mostcc
%token Kw_preserve_allcc
%token Kw_prefix
%token Kw_ppc_fp128
%token Kw_phi
%token Kw_personality
%token Kw_ord
%token Kw_or
%token Kw_optsize
%token Kw_optnone
%token Kw_opaque
%token Kw_one
%token Kw_olt
%token Kw_ole
%token Kw_ogt
%token Kw_oge
%token Kw_oeq
%token Kw_nuw
%token Kw_null
%token Kw_nsz
%token Kw_nsw
%token Kw_nounwind
%token Kw_noreturn
%token Kw_noredzone
%token Kw_nonnull
%token Kw_nonlazybind
%token Kw_noinline
%token Kw_noimplicitfloat
%token Kw_noduplicates
%token Kw_noduplicate
%token Kw_nocapture
%token Kw_nobuiltin
%token Kw_noalias
%token Kw_nnan
%token Kw_ninf
%token Kw_nest
%token Kw_ne
%token Kw_nand
%token Kw_naked
%token Kw_musttail
%token Kw_mul
%token Kw_msp430_intrcc
%token Kw_monotonic
%token Kw_module
%token Kw_minsize
%token Kw_min
%token Kw_metadata
%token Kw_max
%token Kw_lshr
%token Kw_localexec
%token Kw_localdynamic
%token Kw_load
%token Kw_linkonce_odr
%token Kw_linkonce
%token Kw_linker_private_weak
%token Kw_linker_private
%token Kw_largest
%token Kw_landingpad
%token Kw_label
%token Kw_jumptable
%token Kw_invoke
%token Kw_inttoptr
%token Kw_internal
%token Kw_inteldialect
%token Kw_intel_ocl_bicc
%token Kw_insertvalue
%token Kw_insertelement
%token Kw_inreg
%token Kw_inlinehint
%token Kw_initialexec
%token Kw_indirectbr
%token Kw_inbounds
%token Kw_inalloca
%token Kw_icmp
%token Kw_hidden
%token Kw_half
%token Kw_global
%token Kw_getelementptr
%token Kw_gc
%token Kw_fsub
%token Kw_frem
%token Kw_fptrunc
%token Kw_fptoui
%token Kw_fptosi
%token Kw_fpext
%token Kw_fp128
%token Kw_fmul
%token Kw_float
%token Kw_filter
%token Kw_fence
%token Kw_fdiv
%token Kw_fcmp
%token Kw_fastcc
%token Kw_fast
%token Kw_false
%token Kw_fadd
%token Kw_extractvalue
%token Kw_extractelement
%token Kw_externally_initialized
%token Kw_external
%token Kw_extern_weak
%token Kw_exactmatch
%token Kw_exact
%token Kw_eq
%token Kw_double
%token Kw_dllimport
%token Kw_dllexport
%token Kw_dereferenceable
%token Kw_deplibs
%token Kw_define
%token Kw_default
%token Kw_declare
%token Kw_datalayout
%token Kw_constant
%token Kw_common
%token Kw_comdat
%token Kw_coldcc
%token Kw_cold
%token Kw_cmpxchg
%token Kw_cleanup
%token Kw_ccc
%token Kw_cc
%token Kw_catch
%token Kw_call
%token Kw_c
%token Kw_byval
%token Kw_builtin
%token Kw_br
%token Kw_blockaddress
%token Kw_bitcast
%token Kw_available_externally
%token Kw_attributes
%token Kw_atomicrmw
%token Kw_atomic
%token Kw_asm
%token Kw_ashr
%token Kw_arm_apcscc
%token Kw_arm_aapcscc
%token Kw_arm_aapcs_vfpcc
%token Kw_arcp
%token Kw_appending
%token Kw_anyregcc
%token Kw_any
%token Kw_and
%token Kw_alwaysinline
%token Kw_alloca
%token Kw_alignstack
%token Kw_align
%token Kw_alias
%token Kw_addrspacecast
%token Kw_addrspace
%token Kw_add
%token Kw_acquire
%token Kw_acq_rel
%token <int> I
%token Greater
%token <Llabs.var> GlobalVar
%token <Llabs.var> GlobalID
%token Exclaim
%token Error
%token Equal
%token Eof
%token DotDotDot
%token Comma
%token <string> ComdatVar
%token Backslash
%token <int> AttrGrpID
%token <string> APSint
%token <string> APInt
%token <string> APFloat

%type <Llabs.cunit> main
%%

main:
| _1 = toplevel_list
    {                ( process_toplevels _1 )}

toplevel_list:
| _1 = Eof
    {                ( [] )}
| _1 = toplevel _2 = toplevel_list
    {                         ( _1::_2 )}

toplevel:
| _1 = Kw_declare _2 = function_header
    {                                               ( Fun _2 )}
| _1 = Kw_define _2 = function_header _3 = function_body
    {                                               ( _2.Llabs.fblocks <- _3; Fun _2 )}
| _1 = Kw_module _2 = Kw_asm _3 = StringConstant
    {                                               ( Asm _3 )}
| _1 = Kw_target _2 = Kw_triple _3 = Equal _4 = StringConstant
    {                                               ( Target _4 )}
| _1 = Kw_target _2 = Kw_datalayout _3 = Equal _4 = StringConstant
    {                                               ( Datalayout _4)}
| _1 = Kw_deplibs _2 = Equal _3 = Lsquare _4 = string_list _5 = Rsquare
    {                                               ( Deplibs _4 )}
| _1 = LocalVarID _2 = Equal _3 = Kw_type _4 = Kw_opaque
    {                                               ( Typ(_1, None) )}
| _1 = LocalVarID _2 = Equal _3 = Kw_type _4 = typ
    {                                               ( Typ(_1, Some _4) )}
| _1 = LocalVar _2 = Equal _3 = Kw_type _4 = Kw_opaque
    {                                               ( Typ(_1, None) )}
| _1 = LocalVar _2 = Equal _3 = Kw_type _4 = typ
    {                                               ( Typ(_1, Some _4) )}
| _1 = global_eq _2 = external_linkage _3 = opt_visibility _4 = opt_dll_storageclass _5 = opt_thread_local _6 = opt_addrspace _7 = opt_unnamed_addr _8 = opt_externally_initialized _9 = constant_or_global _10 = typ _11 = opt_section_align_comdat
    {                                               ( Global {Llabs.gname = _1;
                                                         Llabs.glinkage = Some _2;
                                                         Llabs.gvisibility = _3;
                                                         Llabs.gstorageclass = _4;
                                                         Llabs.gthread_local = _5;
                                                         Llabs.gaddrspace = _6;
                                                         Llabs.gunnamed_addr = _7;
                                                         Llabs.gexternally_initialized = _8;
                                                         Llabs.gconstant = _9;
                                                         Llabs.gtyp = _10;
                                                         Llabs.gvalue = None;
                                                         Llabs.gsection = (match _11 with (x, _, _) -> x);
                                                         Llabs.galign = (match _11 with (_, x, _) -> x);
                                                         Llabs.gcomdat = (match _11 with (_, _, x) -> x);}
                                               )}
| _1 = global_eq _2 = non_external_linkage _3 = opt_visibility _4 = opt_dll_storageclass _5 = opt_thread_local _6 = opt_addrspace _7 = opt_unnamed_addr _8 = opt_externally_initialized _9 = constant_or_global _10 = typ _11 = value _12 = opt_section_align_comdat
    {                                               ( Global {Llabs.gname = _1;
                                                         Llabs.glinkage = _2;
                                                         Llabs.gvisibility = _3;
                                                         Llabs.gstorageclass = _4;
                                                         Llabs.gthread_local = _5;
                                                         Llabs.gaddrspace = _6;
                                                         Llabs.gunnamed_addr = _7;
                                                         Llabs.gexternally_initialized = _8;
                                                         Llabs.gconstant = _9;
                                                         Llabs.gtyp = _10;
                                                         Llabs.gvalue = Some _11;
                                                         Llabs.gsection = (match _12 with (x, _, _) -> x);
                                                         Llabs.galign = (match _12 with (_, x, _) -> x);
                                                         Llabs.gcomdat = (match _12 with (_, _, x) -> x);}
                                               )}
| _1 = global_eq _2 = external_linkage _3 = opt_visibility _4 = opt_thread_local _5 = Kw_alias _6 = opt_linkage _7 = aliasee
    {    ( Alias({Llabs.aname=_1; Llabs.avisibility=_3; Llabs.athread_local=_4; Llabs.alinkage=_6; Llabs.aaliasee=_7}) )}
| _1 = global_eq _2 = non_external_linkage _3 = opt_visibility _4 = opt_thread_local _5 = Kw_alias _6 = opt_linkage _7 = aliasee
    {    ( Alias({Llabs.aname=_1; Llabs.avisibility=_3; Llabs.athread_local=_4; Llabs.alinkage=_6; Llabs.aaliasee=_7}) )}
| _1 = ComdatVar _2 = Equal _3 = Kw_comdat _4 = selection_kind
    {    ( ComdatVarDefn(_1, _4) )}
| _1 = Exclaim _2 = APInt _3 = Equal _4 = Exclaim _5 = Lbrace _6 = mdnodevector _7 = Rbrace
    {    ( MDNodeDefn({Llabs.mdid=int_of_string _2; Llabs.mdcontents=_6}) )}
| _1 = MetadataVar _2 = Equal _3 = Exclaim _4 = Lbrace _5 = mdlist _6 = Rbrace
    {                                                                             ( MDVarDefn(_1, _5) )}
| _1 = Kw_attributes _2 = AttrGrpID _3 = Equal _4 = Lbrace _5 = group_attributes _6 = Rbrace
    {                                                                             ( Attrgrp(_2, _5) )}

aliasee:
| _1 = type_value
    {             ( (None, _1) )}
| _1 = Kw_addrspace _2 = Lparen _3 = APInt _4 = Rparen _5 = typ _6 = Comma _7 = type_value
    {                                                        ( (Some(int_of_string _3, _5) , _7) )}

selection_kind:
| _1 = Kw_any
    {                  ( Llabs.SK_any )}
| _1 = Kw_exactmatch
    {                  ( Llabs.SK_exactmatch )}
| _1 = Kw_largest
    {                  ( Llabs.SK_largest )}
| _1 = Kw_noduplicates
    {                  ( Llabs.SK_noduplicates )}
| _1 = Kw_samesize
    {                  ( Llabs.SK_samesize )}

global_eq:
| _1 = GlobalID _2 = Equal
    {                  ( _1 )}
| _1 = GlobalVar _2 = Equal
    {                  ( _1 )}

string_list:
| 
    {                             ( [] )}
| _1 = StringConstant _2 = string_list
    {                             ( _1::_2 )}

mdlist:
| 
    {                       ( [] )}
| _1 = Exclaim _2 = APInt _3 = mdlist
    {                       ( (int_of_string _2)::_3 )}

mdnodevector:
| _1 = value
    {                                ( [_1] )}
| _1 = typ _2 = value
    {                                ( [_2] )}
| _1 = value _2 = Comma _3 = mdnodevector
    {                                ( (_1)::_3 )}
| _1 = typ _2 = value _3 = Comma _4 = mdnodevector
    {                                ( (_2)::_4 )}

constant_or_global:
| _1 = Kw_constant
    {              ( true )}
| _1 = Kw_global
    {              ( false )}

function_header:
| _1 = opt_linkage _2 = opt_visibility _3 = opt_dll_storageclass _4 = opt_callingconv _5 = return_attributes _6 = typ _7 = global_name _8 = argument_list _9 = opt_unnamed_addr _10 = function_attributes _11 = opt_section _12 = opt_comdat _13 = opt_align _14 = opt_gc _15 = opt_prefix
    {                             (
                               {Llabs.flinkage = _1;
                                Llabs.fvisibility = _2;
                                Llabs.fstorageclass = _3;
                                Llabs.fcallingconv = _4;
                                Llabs.freturnattrs = _5;
                                Llabs.freturntyp = _6;
                                Llabs.fname = _7;
                                Llabs.fparams = _8;
                                Llabs.funnamed_addr = _9;
                                Llabs.fattrs = _10;
                                Llabs.fsection = _11;
                                Llabs.fcomdat = _12;
                                Llabs.falign = _13;
                                Llabs.fgc = _14;
                                Llabs.fprefix = _15;
                                Llabs.fblocks = [];}
                             )}

typ:
| _1 = Kw_void
    {                ( Llabs.Void )}
| _1 = non_void_type
    {                ( _1 )}

non_void_type:
| _1 = I
    {                                       ( Llabs.Integer _1 )}
| _1 = Kw_half
    {                                       ( Llabs.Half )}
| _1 = Kw_float
    {                                       ( Llabs.Float )}
| _1 = Kw_double
    {                                       ( Llabs.Double )}
| _1 = Kw_x86_fp80
    {                                       ( Llabs.X86_fp80 )}
| _1 = Kw_fp128
    {                                       ( Llabs.Fp128 )}
| _1 = Kw_ppc_fp128
    {                                       ( Llabs.Ppc_fp128 )}
| _1 = Kw_label
    {                                       ( Llabs.Label )}
| _1 = Kw_metadata
    {                                       ( Llabs.Metadata )}
| _1 = Kw_x86_mmx
    {                                       ( Llabs.X86_mmx )}
| _1 = LocalVar
    {                                       ( Llabs.Vartyp(_1) )}
| _1 = LocalVarID
    {                                       ( Llabs.Vartyp(_1) )}
| _1 = Lbrace _2 = Rbrace
    {                                       ( Llabs.Structtyp(false, []) )}
| _1 = Less _2 = Lbrace _3 = Rbrace _4 = Greater
    {                                       ( Llabs.Structtyp(true, []) )}
| _1 = Lbrace _2 = type_list _3 = Rbrace
    {                                       ( Llabs.Structtyp(false, _2) )}
| _1 = Less _2 = Lbrace _3 = type_list _4 = Rbrace _5 = Greater
    {                                       ( Llabs.Structtyp(true, _3) )}
| _1 = Lsquare _2 = APInt _3 = Kw_x _4 = typ _5 = Rsquare
    {                                       ( Llabs.Arraytyp(int_of_string _2, _4) )}
| _1 = Less _2 = APInt _3 = Kw_x _4 = typ _5 = Greater
    {                                       ( Llabs.Vector(int_of_string _2, _4) )}
| _1 = typ _2 = opt_addrspace _3 = Star
    {                                       ( Llabs.Pointer(_1, _2) )}
| _1 = typ _2 = argument_list
    {                                       ( Llabs.Funtyp(_1, fst _2, snd _2) )}

type_list:
| _1 = typ
    {                      ( [_1] )}
| _1 = typ _2 = Comma _3 = type_list
    {                      ( _1::_3 )}

global_name:
| _1 = GlobalID
    {            ( _1 )}
| _1 = GlobalVar
    {            ( _1 )}

argument_list:
| _1 = Lparen _2 = arg_type_list _3 = Rparen
    {                            ( _2 )}

arg_type_list:
| 
    {                               ( ([], false) )}
| _1 = DotDotDot
    {                               ( ([], true))}
| _1 = arg_type
    {                               ( ([_1], false) )}
| _1 = arg_type _2 = Comma _3 = arg_type_list
    {                               ( (_1::(fst _3), snd _3) )}

arg_type:
| _1 = typ _2 = param_attribute_list
    {                                    ( (_1, _2, None) )}
| _1 = typ _2 = param_attribute_list _3 = LocalVar
    {                                    ( (_1, _2, Some _3) )}

opt_section:
| 
    {                            ( None )}
| _1 = Kw_section _2 = StringConstant
    {                            ( Some _2 )}

opt_align:
| 
    {                 ( None )}
| _1 = Kw_align _2 = APInt
    {                 ( Some(int_of_string _2) )}

opt_inbounds:
| 
    {              ( false )}
| _1 = Kw_inbounds
    {              ( true )}

opt_tail:
| 
    {              ( Llabs.TCK_None )}
| _1 = Kw_tail
    {              ( Llabs.TCK_Tail )}
| _1 = Kw_musttail
    {              ( Llabs.TCK_MustTail )}

opt_cleanup:
| 
    {              ( false )}
| _1 = Kw_cleanup
    {              ( true )}

opt_comdat:
| 
    {                      ( None )}
| _1 = Kw_comdat _2 = ComdatVar
    {                      ( Some _2 )}

opt_section_align_comdat:
| 
    {                                                       ( (None    , None                  , None) )}
| _1 = Comma _2 = Kw_section _3 = StringConstant
    {                                                       ( (Some _3 , None                  , None) )}
| _1 = Comma _2 = Kw_align _3 = APInt
    {                                                       ( (None    , Some(int_of_string _3), None) )}
| _1 = Comma _2 = Kw_section _3 = StringConstant _4 = Comma _5 = Kw_align _6 = APInt
    {                                                       ( (Some _3 , Some(int_of_string _6), None) )}
| _1 = Comma _2 = Kw_comdat _3 = ComdatVar
    {                                                       ( (None    , None                  , Some _3) )}

align_metadata:
| _1 = instruction_metadata
    {                       ( (None, _1) )}
| _1 = Comma _2 = Kw_align _3 = APInt _4 = instruction_metadata
    {                                            ( (Some(int_of_string _3), _4) )}

opt_gc:
| 
    {                       ( None )}
| _1 = Kw_gc _2 = StringConstant
    {                       ( Some _2 )}

opt_prefix:
| 
    {                      ( None )}
| _1 = Kw_prefix _2 = typ _3 = value
    {                      ( Some(_2, _3) )}

opt_atomic:
| 
    {              ( false )}
| _1 = Kw_atomic
    {              ( true )}

opt_weak:
| 
    {              ( false )}
| _1 = Kw_weak
    {              ( true )}

opt_volatile:
| 
    {              ( false )}
| _1 = Kw_volatile
    {              ( true )}

value:
| _1 = GlobalID
    {                                                                                            ( Llabs.Var _1 )}
| _1 = GlobalVar
    {                                                                                            ( Llabs.Var _1 )}
| _1 = LocalVarID
    {                                                                                            ( Llabs.Var _1 )}
| _1 = LocalVar
    {                                                                                            ( Llabs.Var _1 )}
| _1 = Exclaim _2 = mdvalue
    {                                                                                            ( _2 )}
| _1 = APInt
    {                                                                                            ( Llabs.Int(Big_int.big_int_of_string _1) )}
| _1 = APFloat
    {                                                                                            ( Llabs.Float _1 )}
| _1 = Kw_true
    {                                                                                            ( Llabs.True )}
| _1 = Kw_false
    {                                                                                            ( Llabs.False )}
| _1 = Kw_null
    {                                                                                            ( Llabs.Null )}
| _1 = Kw_undef
    {                                                                                            ( Llabs.Undef )}
| _1 = Kw_zeroinitializer
    {                                                                                            ( Llabs.Zero )}
| _1 = Lbrace _2 = type_value_list _3 = Rbrace
    {                                                                                            ( Llabs.Struct(false, _2) )}
| _1 = Less _2 = Lbrace _3 = Rbrace _4 = Greater
    {                                                                                            ( Llabs.Struct(true, []) )}
| _1 = Less _2 = Lbrace _3 = type_value_LIST _4 = Rbrace _5 = Greater
    {                                                                                            ( Llabs.Struct(true, _3) )}
| _1 = Less _2 = type_value_list _3 = Greater
    {                                                                                            ( Llabs.Vector(_2) )}
| _1 = Lsquare _2 = type_value_list _3 = Rsquare
    {                                                                                            ( Llabs.Array(_2) )}
| _1 = Kw_c _2 = StringConstant
    {                                                                                            ( Llabs.Array(list_of_string _2) )}
| _1 = Kw_asm _2 = opt_sideeffect _3 = opt_alignstack _4 = opt_inteldialect _5 = StringConstant _6 = Comma _7 = StringConstant
    {                                                                                            ( Llabs.Asm(_2, _3, _4, _5, _7) )}
| _1 = Kw_blockaddress _2 = Lparen _3 = value _4 = Comma _5 = value _6 = Rparen
    {                                                                                            ( Llabs.Blockaddress(_3, _5) )}
| _1 = Kw_trunc _2 = Lparen _3 = type_value _4 = Kw_to _5 = typ _6 = Rparen
    {                                                                                            ( Llabs.Trunc         (_3, _5) )}
| _1 = Kw_zext _2 = Lparen _3 = type_value _4 = Kw_to _5 = typ _6 = Rparen
    {                                                                                            ( Llabs.Zext          (_3, _5) )}
| _1 = Kw_sext _2 = Lparen _3 = type_value _4 = Kw_to _5 = typ _6 = Rparen
    {                                                                                            ( Llabs.Sext          (_3, _5) )}
| _1 = Kw_fptrunc _2 = Lparen _3 = type_value _4 = Kw_to _5 = typ _6 = Rparen
    {                                                                                            ( Llabs.Fptrunc       (_3, _5) )}
| _1 = Kw_fpext _2 = Lparen _3 = type_value _4 = Kw_to _5 = typ _6 = Rparen
    {                                                                                            ( Llabs.Fpext         (_3, _5) )}
| _1 = Kw_bitcast _2 = Lparen _3 = type_value _4 = Kw_to _5 = typ _6 = Rparen
    {                                                                                            ( Llabs.Bitcast       (_3, _5) )}
| _1 = Kw_addrspacecast _2 = Lparen _3 = type_value _4 = Kw_to _5 = typ _6 = Rparen
    {                                                                                            ( Llabs.Addrspacecast (_3, _5) )}
| _1 = Kw_uitofp _2 = Lparen _3 = type_value _4 = Kw_to _5 = typ _6 = Rparen
    {                                                                                            ( Llabs.Uitofp        (_3, _5) )}
| _1 = Kw_sitofp _2 = Lparen _3 = type_value _4 = Kw_to _5 = typ _6 = Rparen
    {                                                                                            ( Llabs.Sitofp        (_3, _5) )}
| _1 = Kw_fptoui _2 = Lparen _3 = type_value _4 = Kw_to _5 = typ _6 = Rparen
    {                                                                                            ( Llabs.Fptoui        (_3, _5) )}
| _1 = Kw_fptosi _2 = Lparen _3 = type_value _4 = Kw_to _5 = typ _6 = Rparen
    {                                                                                            ( Llabs.Fptosi        (_3, _5) )}
| _1 = Kw_inttoptr _2 = Lparen _3 = type_value _4 = Kw_to _5 = typ _6 = Rparen
    {                                                                                            ( Llabs.Inttoptr      (_3, _5) )}
| _1 = Kw_ptrtoint _2 = Lparen _3 = type_value _4 = Kw_to _5 = typ _6 = Rparen
    {                                                                                            ( Llabs.Ptrtoint      (_3, _5) )}
| _1 = Kw_extractvalue _2 = Lparen _3 = type_value _4 = index_list _5 = Rparen
    {                                                                                            ( Llabs.Extractvalue(_3, _4) )}
| _1 = Kw_insertvalue _2 = Lparen _3 = type_value _4 = Comma _5 = type_value _6 = index_list _7 = Rparen
    {                                                                                            ( Llabs.Insertvalue(_3, _5, _6) )}
| _1 = Kw_icmp _2 = icmp_predicate _3 = Lparen _4 = type_value _5 = Comma _6 = type_value _7 = Rparen
    {                                                                                            ( Llabs.Icmp(_2, _4, _6) )}
| _1 = Kw_fcmp _2 = fcmp_predicate _3 = Lparen _4 = type_value _5 = Comma _6 = type_value _7 = Rparen
    {                                                                                            ( Llabs.Fcmp(_2, _4, _6) )}
| _1 = Kw_add _2 = opt_nuw_nsw _3 = Lparen _4 = type_value _5 = Comma _6 = type_value _7 = Rparen
    {                                                                                            ( Llabs.Add(fst _2, snd _2, _4, _6) )}
| _1 = Kw_sub _2 = opt_nuw_nsw _3 = Lparen _4 = type_value _5 = Comma _6 = type_value _7 = Rparen
    {                                                                                            ( Llabs.Sub(fst _2, snd _2, _4, _6) )}
| _1 = Kw_mul _2 = opt_nuw_nsw _3 = Lparen _4 = type_value _5 = Comma _6 = type_value _7 = Rparen
    {                                                                                            ( Llabs.Mul(fst _2, snd _2, _4, _6) )}
| _1 = Kw_shl _2 = opt_nuw_nsw _3 = Lparen _4 = type_value _5 = Comma _6 = type_value _7 = Rparen
    {                                                                                            ( Llabs.Shl(fst _2, snd _2, _4, _6) )}
| _1 = Kw_sdiv _2 = opt_exact _3 = Lparen _4 = type_value _5 = Comma _6 = type_value _7 = Rparen
    {                                                                                            ( Llabs.Sdiv(_2, _4, _6) )}
| _1 = Kw_udiv _2 = opt_exact _3 = Lparen _4 = type_value _5 = Comma _6 = type_value _7 = Rparen
    {                                                                                            ( Llabs.Udiv(_2, _4, _6) )}
| _1 = Kw_lshr _2 = opt_exact _3 = Lparen _4 = type_value _5 = Comma _6 = type_value _7 = Rparen
    {                                                                                            ( Llabs.Lshr(_2, _4, _6) )}
| _1 = Kw_ashr _2 = opt_exact _3 = Lparen _4 = type_value _5 = Comma _6 = type_value _7 = Rparen
    {                                                                                            ( Llabs.Ashr(_2, _4, _6) )}
| _1 = Kw_fadd _2 = Lparen _3 = type_value _4 = Comma _5 = type_value _6 = Rparen
    {                                                                                            ( Llabs.Fadd(_3, _5) )}
| _1 = Kw_fsub _2 = Lparen _3 = type_value _4 = Comma _5 = type_value _6 = Rparen
    {                                                                                            ( Llabs.Fsub(_3, _5) )}
| _1 = Kw_fmul _2 = Lparen _3 = type_value _4 = Comma _5 = type_value _6 = Rparen
    {                                                                                            ( Llabs.Fmul(_3, _5) )}
| _1 = Kw_fdiv _2 = Lparen _3 = type_value _4 = Comma _5 = type_value _6 = Rparen
    {                                                                                            ( Llabs.Fdiv(_3, _5) )}
| _1 = Kw_urem _2 = Lparen _3 = type_value _4 = Comma _5 = type_value _6 = Rparen
    {                                                                                            ( Llabs.Urem(_3, _5) )}
| _1 = Kw_srem _2 = Lparen _3 = type_value _4 = Comma _5 = type_value _6 = Rparen
    {                                                                                            ( Llabs.Srem(_3, _5) )}
| _1 = Kw_frem _2 = Lparen _3 = type_value _4 = Comma _5 = type_value _6 = Rparen
    {                                                                                            ( Llabs.Frem(_3, _5) )}
| _1 = Kw_and _2 = Lparen _3 = type_value _4 = Comma _5 = type_value _6 = Rparen
    {                                                                                            ( Llabs.And(_3, _5) )}
| _1 = Kw_or _2 = Lparen _3 = type_value _4 = Comma _5 = type_value _6 = Rparen
    {                                                                                            ( Llabs.Or(_3, _5) )}
| _1 = Kw_xor _2 = Lparen _3 = type_value _4 = Comma _5 = type_value _6 = Rparen
    {                                                                                            ( Llabs.Xor(_3, _5) )}
| _1 = Kw_getelementptr _2 = opt_inbounds _3 = Lparen _4 = type_value_list _5 = Rparen
    {                                                                                            ( Llabs.Getelementptr(_2, _4) )}
| _1 = Kw_shufflevector _2 = Lparen _3 = type_value_list _4 = Rparen
    {                                                                                            ( Llabs.Shufflevector  _3 )}
| _1 = Kw_insertelement _2 = Lparen _3 = type_value_list _4 = Rparen
    {                                                                                            ( Llabs.Insertelement  _3 )}
| _1 = Kw_extractelement _2 = Lparen _3 = type_value_list _4 = Rparen
    {                                                                                            ( Llabs.Extractelement _3 )}
| _1 = Kw_select _2 = Lparen _3 = type_value_list _4 = Rparen
    {                                                                                            ( Llabs.Select         _3 )}

mdvalue:
| _1 = APInt
    {                             ( Llabs.Mdnode(int_of_string _1) )}
| _1 = StringConstant
    {                             ( Llabs.Mdstring _1 )}
| _1 = Lbrace _2 = mdnodevector _3 = Rbrace
    {                             ( Llabs.Mdnodevector _2 )}

type_value_LIST_metadata:
| _1 = type_value _2 = instruction_metadata
    {                                            ( ([_1], _2) )}
| _1 = type_value _2 = Comma _3 = type_value_LIST_metadata
    {                                            ( (_1::(fst _3), snd _3) )}

type_value_LIST:
| _1 = type_value
    {                                   ( [_1] )}
| _1 = type_value _2 = Comma _3 = type_value_LIST
    {                                   ( _1::_3 )}

type_value_list:
| 
    {                                   ( [] )}
| _1 = type_value
    {                                   ( [_1] )}
| _1 = type_value _2 = Comma _3 = type_value_list
    {                                   ( _1::_3 )}

index_list:
| _1 = Comma _2 = APInt
    {                         ( [(int_of_string _2)] )}
| _1 = Comma _2 = APInt _3 = index_list
    {                         ( (int_of_string _2)::_3 )}

index_list_metadata:
| _1 = Comma _2 = APInt _3 = instruction_metadata
    {                                              ( [(int_of_string _2)], _3 )}
| _1 = Comma _2 = APInt _3 = index_list_metadata
    {                                              ( (int_of_string _2)::(fst _3), snd _3 )}

fcmp_predicate:
| _1 = Kw_oeq
    {           ( Llabs.F.Oeq   )}
| _1 = Kw_one
    {           ( Llabs.F.One   )}
| _1 = Kw_olt
    {           ( Llabs.F.Olt   )}
| _1 = Kw_ogt
    {           ( Llabs.F.Ogt   )}
| _1 = Kw_ole
    {           ( Llabs.F.Ole   )}
| _1 = Kw_oge
    {           ( Llabs.F.Oge   )}
| _1 = Kw_ord
    {           ( Llabs.F.Ord   )}
| _1 = Kw_uno
    {           ( Llabs.F.Uno   )}
| _1 = Kw_ueq
    {           ( Llabs.F.Ueq   )}
| _1 = Kw_une
    {           ( Llabs.F.Une   )}
| _1 = Kw_ult
    {           ( Llabs.F.Ult   )}
| _1 = Kw_ugt
    {           ( Llabs.F.Ugt   )}
| _1 = Kw_ule
    {           ( Llabs.F.Ule   )}
| _1 = Kw_uge
    {           ( Llabs.F.Uge   )}
| _1 = Kw_true
    {           ( Llabs.F.True  )}
| _1 = Kw_false
    {           ( Llabs.F.False )}

icmp_predicate:
| _1 = Kw_eq
    {         ( Llabs.I.Eq  )}
| _1 = Kw_ne
    {         ( Llabs.I.Ne  )}
| _1 = Kw_slt
    {         ( Llabs.I.Slt )}
| _1 = Kw_sgt
    {         ( Llabs.I.Sgt )}
| _1 = Kw_sle
    {         ( Llabs.I.Sle )}
| _1 = Kw_sge
    {         ( Llabs.I.Sge )}
| _1 = Kw_ult
    {         ( Llabs.I.Ult )}
| _1 = Kw_ugt
    {         ( Llabs.I.Ugt )}
| _1 = Kw_ule
    {         ( Llabs.I.Ule )}
| _1 = Kw_uge
    {         ( Llabs.I.Uge )}

function_body:
| _1 = Lbrace _2 = basicblock_list _3 = Rbrace
    {                                ( _2 )}

basicblock_list:
| _1 = basicblock
    {                             ( [_1] )}
| _1 = basicblock _2 = basicblock_list
    {                             ( _1::_2 )}

basicblock:
| _1 = LabelStr _2 = instruction_list
    {                            ( {Llabs.bname=Llabs.Name(false, _1); Llabs.binstrs=_2} )}
| _1 = instruction_list
    {                            ( {Llabs.bname=Llabs.Id(false, -1); Llabs.binstrs=_1} )}

instruction_list:
| _1 = terminator_instruction
    {                         ( [_1] )}
| _1 = instruction _2 = instruction_list
    {                               ( _1::_2 )}

instruction_metadata:
| 
    {              ( [] )}
| _1 = Comma _2 = MetadataVar _3 = Exclaim _4 = APInt _5 = instruction_metadata
    {                                                       ( (_2,Llabs.Mdnode(int_of_string _4))::_5 )}
| _1 = Comma _2 = MetadataVar _3 = Exclaim _4 = Lbrace _5 = mdnodevector _6 = Rbrace _7 = instruction_metadata
    {                                                                            ( (_2,Llabs.Mdnodevector _5)::_7 )}

local_eq:
| _1 = LocalVarID _2 = Equal
    {                   ( _1 )}
| _1 = LocalVar _2 = Equal
    {                   ( _1 )}

opt_local:
| 
    {              ( None )}
| _1 = local_eq
    {              ( Some _1 )}

instruction:
| _1 = local_eq _2 = Kw_add _3 = opt_nuw_nsw _4 = type_value _5 = Comma _6 = value _7 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Add(fst _3, snd _3, _4, _6, _7) )}
| _1 = local_eq _2 = Kw_sub _3 = opt_nuw_nsw _4 = type_value _5 = Comma _6 = value _7 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Sub(fst _3, snd _3, _4, _6, _7) )}
| _1 = local_eq _2 = Kw_mul _3 = opt_nuw_nsw _4 = type_value _5 = Comma _6 = value _7 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Mul(fst _3, snd _3, _4, _6, _7) )}
| _1 = local_eq _2 = Kw_shl _3 = opt_nuw_nsw _4 = type_value _5 = Comma _6 = value _7 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Shl(fst _3, snd _3, _4, _6, _7) )}
| _1 = local_eq _2 = Kw_fadd _3 = fast_math_flags _4 = type_value _5 = Comma _6 = value _7 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Fadd(_3, _4, _6, _7) )}
| _1 = local_eq _2 = Kw_fsub _3 = fast_math_flags _4 = type_value _5 = Comma _6 = value _7 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Fsub(_3, _4, _6, _7) )}
| _1 = local_eq _2 = Kw_fmul _3 = fast_math_flags _4 = type_value _5 = Comma _6 = value _7 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Fmul(_3, _4, _6, _7) )}
| _1 = local_eq _2 = Kw_fdiv _3 = fast_math_flags _4 = type_value _5 = Comma _6 = value _7 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Fdiv(_3, _4, _6, _7) )}
| _1 = local_eq _2 = Kw_frem _3 = fast_math_flags _4 = type_value _5 = Comma _6 = value _7 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Frem(_3, _4, _6, _7) )}
| _1 = local_eq _2 = Kw_sdiv _3 = opt_exact _4 = type_value _5 = Comma _6 = value _7 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Sdiv(_3, _4, _6, _7) )}
| _1 = local_eq _2 = Kw_udiv _3 = opt_exact _4 = type_value _5 = Comma _6 = value _7 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Udiv(_3, _4, _6, _7) )}
| _1 = local_eq _2 = Kw_lshr _3 = opt_exact _4 = type_value _5 = Comma _6 = value _7 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Lshr(_3, _4, _6, _7) )}
| _1 = local_eq _2 = Kw_ashr _3 = opt_exact _4 = type_value _5 = Comma _6 = value _7 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Ashr(_3, _4, _6, _7) )}
| _1 = local_eq _2 = Kw_urem _3 = type_value _4 = Comma _5 = value _6 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Urem(_3, _5, _6) )}
| _1 = local_eq _2 = Kw_srem _3 = type_value _4 = Comma _5 = value _6 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Srem(_3, _5, _6) )}
| _1 = local_eq _2 = Kw_and _3 = type_value _4 = Comma _5 = value _6 = instruction_metadata
    {                                                                               ( Some _1, Llabs.And(_3, _5, _6) )}
| _1 = local_eq _2 = Kw_or _3 = type_value _4 = Comma _5 = value _6 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Or(_3, _5, _6) )}
| _1 = local_eq _2 = Kw_xor _3 = type_value _4 = Comma _5 = value _6 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Xor(_3, _5, _6) )}
| _1 = local_eq _2 = Kw_icmp _3 = icmp_predicate _4 = type_value _5 = Comma _6 = value _7 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Icmp(_3, _4, _6, _7) )}
| _1 = local_eq _2 = Kw_fcmp _3 = fcmp_predicate _4 = type_value _5 = Comma _6 = value _7 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Fcmp(_3, _4, _6, _7) )}
| _1 = local_eq _2 = Kw_trunc _3 = type_value _4 = Kw_to _5 = typ _6 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Trunc(_3, _5, _6) )}
| _1 = local_eq _2 = Kw_zext _3 = type_value _4 = Kw_to _5 = typ _6 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Zext(_3, _5, _6) )}
| _1 = local_eq _2 = Kw_sext _3 = type_value _4 = Kw_to _5 = typ _6 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Sext(_3, _5, _6) )}
| _1 = local_eq _2 = Kw_fptrunc _3 = type_value _4 = Kw_to _5 = typ _6 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Fptrunc(_3, _5, _6) )}
| _1 = local_eq _2 = Kw_fpext _3 = type_value _4 = Kw_to _5 = typ _6 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Fpext(_3, _5, _6) )}
| _1 = local_eq _2 = Kw_bitcast _3 = type_value _4 = Kw_to _5 = typ _6 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Bitcast(_3, _5, _6) )}
| _1 = local_eq _2 = Kw_addrspacecast _3 = type_value _4 = Kw_to _5 = typ _6 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Addrspacecast(_3, _5, _6) )}
| _1 = local_eq _2 = Kw_uitofp _3 = type_value _4 = Kw_to _5 = typ _6 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Uitofp(_3, _5, _6) )}
| _1 = local_eq _2 = Kw_sitofp _3 = type_value _4 = Kw_to _5 = typ _6 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Sitofp(_3, _5, _6) )}
| _1 = local_eq _2 = Kw_fptoui _3 = type_value _4 = Kw_to _5 = typ _6 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Fptoui(_3, _5, _6) )}
| _1 = local_eq _2 = Kw_fptosi _3 = type_value _4 = Kw_to _5 = typ _6 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Fptosi(_3, _5, _6) )}
| _1 = local_eq _2 = Kw_inttoptr _3 = type_value _4 = Kw_to _5 = typ _6 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Inttoptr(_3, _5, _6) )}
| _1 = local_eq _2 = Kw_ptrtoint _3 = type_value _4 = Kw_to _5 = typ _6 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Ptrtoint(_3, _5, _6) )}
| _1 = local_eq _2 = Kw_va_arg _3 = type_value _4 = Comma _5 = typ _6 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Va_arg(_3, _5, _6) )}
| _1 = local_eq _2 = Kw_getelementptr _3 = opt_inbounds _4 = type_value_LIST_metadata
    {                                                                               ( Some _1, Llabs.Getelementptr(_3, fst _4, snd _4) )}
| _1 = local_eq _2 = Kw_extractelement _3 = type_value_LIST_metadata
    {                                                                               ( Some _1, Llabs.Extractelement(fst _3, snd _3) )}
| _1 = local_eq _2 = Kw_insertelement _3 = type_value_LIST_metadata
    {                                                                               ( Some _1, Llabs.Insertelement(fst _3, snd _3) )}
| _1 = local_eq _2 = Kw_shufflevector _3 = type_value_LIST_metadata
    {                                                                               ( Some _1, Llabs.Shufflevector(fst _3, snd _3) )}
| _1 = local_eq _2 = Kw_select _3 = type_value_LIST_metadata
    {                                                                               ( Some _1, Llabs.Select(fst _3, snd _3) )}
| _1 = local_eq _2 = Kw_phi _3 = typ _4 = phi_list_metadata
    {                                                                               ( Some _1, Llabs.Phi(_3, fst _4, snd _4) )}
| _1 = local_eq _2 = Kw_landingpad _3 = typ _4 = Kw_personality _5 = type_value _6 = opt_cleanup _7 = landingpad_list _8 = instruction_metadata
    {                                                                               ( Some _1, Llabs.Landingpad(_3, _5, _6, _7, _8) )}
| _1 = opt_local _2 = opt_tail _3 = Kw_call _4 = opt_callingconv _5 = return_attributes _6 = typ _7 = value _8 = Lparen _9 = param_list _10 = Rparen _11 = call_attributes _12 = instruction_metadata
    {                                                                               ( _1, Llabs.Call(_2, _4, _5, _6, _7, _9, _11, _12) )}
| _1 = local_eq _2 = Kw_alloca _3 = alloc_metadata
    {                                                                               ( Some _1, _3 )}
| _1 = local_eq _2 = Kw_load _3 = opt_atomic _4 = opt_volatile _5 = type_value _6 = scopeandordering _7 = align_metadata
    {                                                                               ( Some _1, Llabs.Load(_3, _4, _5, _6, fst _7, snd _7) )}
| _1 = Kw_store _2 = opt_atomic _3 = opt_volatile _4 = type_value _5 = Comma _6 = type_value _7 = scopeandordering _8 = align_metadata
    {                                                                               ( None, Llabs.Store(_2, _3, _4, _6, _7, fst _8, snd _8) )}
| _1 = Kw_cmpxchg _2 = opt_weak _3 = opt_volatile _4 = type_value _5 = Comma _6 = type_value _7 = Comma _8 = type_value _9 = opt_singlethread _10 = ordering _11 = ordering _12 = instruction_metadata
    {                                                                               ( None, Llabs.Cmpxchg(_2, _3, _4, _6, _8, _9, _10, _11, _12) )}
| _1 = Kw_atomicrmw _2 = opt_volatile _3 = binop _4 = type_value _5 = Comma _6 = type_value _7 = opt_singlethread _8 = ordering _9 = instruction_metadata
    {                                                                               ( None, Llabs.Atomicrmw(_2, _3, _4, _6, _7, _8, _9) )}
| _1 = Kw_fence _2 = opt_singlethread _3 = ordering _4 = instruction_metadata
    {                                                                               ( None, Llabs.Fence(_2, _3, _4) )}
| _1 = local_eq _2 = Kw_extractvalue _3 = type_value _4 = index_list_metadata
    {                                                                               ( Some _1, Llabs.Extractvalue(_3, fst _4, snd _4) )}
| _1 = local_eq _2 = Kw_insertvalue _3 = type_value _4 = Comma _5 = type_value _6 = index_list_metadata
    {                                                                               ( Some _1, Llabs.Insertvalue(_3, _5, fst _6, snd _6) )}

binop:
| _1 = Kw_xchg
    {          ( Llabs.Xchg )}
| _1 = Kw_add
    {          ( Llabs.Add  )}
| _1 = Kw_sub
    {          ( Llabs.Sub  )}
| _1 = Kw_and
    {          ( Llabs.And  )}
| _1 = Kw_nand
    {          ( Llabs.Nand )}
| _1 = Kw_or
    {          ( Llabs.Or   )}
| _1 = Kw_xor
    {          ( Llabs.Xor  )}
| _1 = Kw_max
    {          ( Llabs.Max  )}
| _1 = Kw_min
    {          ( Llabs.Min  )}
| _1 = Kw_umax
    {          ( Llabs.Umax )}
| _1 = Kw_umin
    {          ( Llabs.Umin )}

phi_list_metadata:
| _1 = Lsquare _2 = value _3 = Comma _4 = value _5 = Rsquare _6 = instruction_metadata
    {                                                            ( [(_2, _4)], _6 )}
| _1 = Lsquare _2 = value _3 = Comma _4 = value _5 = Rsquare _6 = Comma _7 = phi_list_metadata
    {                                                            ( (_2, _4)::(fst _7), snd _7 )}

landingpad_list:
| _1 = Kw_catch _2 = typ _3 = value
    {                                      ( [Llabs.Catch(_2, _3)] )}
| _1 = Kw_filter _2 = typ _3 = value
    {                                      ( [Llabs.Filter(_2, _3)] )}
| _1 = Kw_catch _2 = typ _3 = value _4 = landingpad_list
    {                                      ( (Llabs.Catch(_2, _3))::_4 )}
| _1 = Kw_filter _2 = typ _3 = value _4 = landingpad_list
    {                                      ( (Llabs.Filter(_2, _3))::_4 )}

ordering:
| _1 = Kw_unordered
    {               ( Llabs.Unordered )}
| _1 = Kw_monotonic
    {               ( Llabs.Monotonic )}
| _1 = Kw_acquire
    {               ( Llabs.Acquire   )}
| _1 = Kw_release
    {               ( Llabs.Release   )}
| _1 = Kw_acq_rel
    {               ( Llabs.Acq_rel   )}
| _1 = Kw_seq_cst
    {               ( Llabs.Seq_cst   )}

opt_singlethread:
| 
    {                            ( false )}
| _1 = Kw_singlethread
    {                            ( true )}

scopeandordering:
| 
    {                            ( None )}
| _1 = opt_singlethread _2 = ordering
    {                            ( Some(_1, _2) )}

alloc_metadata:
| _1 = Kw_inalloca _2 = typ _3 = Comma _4 = type_value _5 = Comma _6 = Kw_align _7 = APInt _8 = instruction_metadata
    {                                                                             ( Llabs.Alloca(true,  _2, Some _4, Some(int_of_string _7), _8) )}
| _1 = Kw_inalloca _2 = typ _3 = Comma _4 = type_value _5 = instruction_metadata
    {                                                                             ( Llabs.Alloca(true,  _2, Some _4, None, _5) )}
| _1 = Kw_inalloca _2 = typ _3 = Comma _4 = Kw_align _5 = APInt _6 = instruction_metadata
    {                                                                             ( Llabs.Alloca(true,  _2, None, Some(int_of_string _5), _6) )}
| _1 = Kw_inalloca _2 = typ _3 = instruction_metadata
    {                                                                             ( Llabs.Alloca(true,  _2, None, None, _3) )}
| _1 = typ _2 = Comma _3 = type_value _4 = Comma _5 = Kw_align _6 = APInt _7 = instruction_metadata
    {                                                                             ( Llabs.Alloca(false, _1, Some _3, Some(int_of_string _6), _7) )}
| _1 = typ _2 = Comma _3 = type_value _4 = instruction_metadata
    {                                                                             ( Llabs.Alloca(false, _1, Some _3, None, _4) )}
| _1 = typ _2 = Comma _3 = Kw_align _4 = APInt _5 = instruction_metadata
    {                                                                             ( Llabs.Alloca(false, _1, None, Some(int_of_string _4), _5) )}
| _1 = typ _2 = instruction_metadata
    {                                                                             ( Llabs.Alloca(false, _1, None, None, _2) )}

fast_math_flags:
| 
    {                                 ( [] )}
| _1 = fast_math_flag _2 = fast_math_flags
    {                                 ( _1::_2 )}

fast_math_flag:
| _1 = Kw_fast
    {          ( Llabs.Fast )}
| _1 = Kw_nnan
    {          ( Llabs.Nnan )}
| _1 = Kw_ninf
    {          ( Llabs.Ninf )}
| _1 = Kw_nsz
    {          ( Llabs.Nsz  )}
| _1 = Kw_arcp
    {          ( Llabs.Arcp )}

terminator_instruction:
| _1 = Kw_unreachable _2 = instruction_metadata
    {                                                                                        ( None, Llabs.Unreachable _2 )}
| _1 = Kw_ret _2 = Kw_void _3 = instruction_metadata
    {                                                                                        ( None, Llabs.Return(None,_3) )}
| _1 = Kw_ret _2 = non_void_type _3 = value _4 = instruction_metadata
    {                                                                                        ( None, Llabs.Return(Some(_2, _3),_4) )}
| _1 = Kw_br _2 = type_value _3 = instruction_metadata
    {                                                                                        ( None, Llabs.Br(_2, None, _3) )}
| _1 = Kw_br _2 = type_value _3 = Comma _4 = type_value _5 = Comma _6 = type_value _7 = instruction_metadata
    {                                                                                        ( None, Llabs.Br(_2, Some(_4, _6), _7) )}
| _1 = Kw_indirectbr _2 = type_value _3 = Comma _4 = Lsquare _5 = type_value_LIST _6 = Rsquare _7 = instruction_metadata
    {                                                                                        ( None, Llabs.Indirectbr(_2, _5, _7) )}
| _1 = Kw_resume _2 = type_value _3 = instruction_metadata
    {                                                                                        ( None, Llabs.Resume(_2, _3) )}
| _1 = Kw_switch _2 = type_value _3 = Comma _4 = type_value _5 = Lsquare _6 = jump_table _7 = Rsquare _8 = instruction_metadata
    {                                                                                        ( None, Llabs.Switch(_2, _4, _6, _8) )}
| _1 = local_eq _2 = Kw_invoke _3 = opt_callingconv _4 = return_attributes _5 = typ _6 = value _7 = Lparen _8 = param_list _9 = Rparen _10 = function_attributes _11 = Kw_to _12 = type_value _13 = Kw_unwind _14 = type_value _15 = instruction_metadata
    {                                                                                                                                                                         ( Some _1, Llabs.Invoke(_3, _4, _5, _6, _8, _10, _12, _14, _15) )}

call_attributes:
| 
    {                                 ( [] )}
| _1 = call_attribute _2 = call_attributes
    {                                 ( _1::_2 )}

call_attribute:
| _1 = AttrGrpID
    {              ( Llabs.Attrgrp(_1) )}
| _1 = Kw_noreturn
    {              ( Llabs.Noreturn )}
| _1 = Kw_nounwind
    {              ( Llabs.Nounwind )}
| _1 = Kw_readnone
    {              ( Llabs.Readnone )}
| _1 = Kw_readonly
    {              ( Llabs.Readonly )}

function_attributes:
| 
    {                                         ( [] )}
| _1 = function_attribute _2 = function_attributes
    {                                         ( _1::_2 )}

function_attribute:
| _1 = AttrGrpID
    {                                           ( Llabs.Attrgrp(_1) )}
| _1 = StringConstant _2 = Equal _3 = StringConstant
    {                                           ( Llabs.Attr(_1, Some _3) )}
| _1 = Kw_alignstack _2 = Equal _3 = Lparen _4 = APInt _5 = Rparen
    {                                           ( Llabs.Alignstack(int_of_string _4) )}
| _1 = Kw_alwaysinline
    {                                           ( Llabs.Alwaysinline     )}
| _1 = Kw_builtin
    {                                           ( Llabs.Builtin          )}
| _1 = Kw_cold
    {                                           ( Llabs.Cold             )}
| _1 = Kw_inlinehint
    {                                           ( Llabs.Inlinehint       )}
| _1 = Kw_jumptable
    {                                           ( Llabs.Jumptable        )}
| _1 = Kw_minsize
    {                                           ( Llabs.Minsize          )}
| _1 = Kw_naked
    {                                           ( Llabs.Naked            )}
| _1 = Kw_nobuiltin
    {                                           ( Llabs.Nobuiltin        )}
| _1 = Kw_noduplicate
    {                                           ( Llabs.Noduplicate      )}
| _1 = Kw_noimplicitfloat
    {                                           ( Llabs.Noimplicitfloat  )}
| _1 = Kw_noinline
    {                                           ( Llabs.Noinline         )}
| _1 = Kw_nonlazybind
    {                                           ( Llabs.Nonlazybind      )}
| _1 = Kw_noredzone
    {                                           ( Llabs.Noredzone        )}
| _1 = Kw_noreturn
    {                                           ( Llabs.Noreturn         )}
| _1 = Kw_nounwind
    {                                           ( Llabs.Nounwind         )}
| _1 = Kw_optnone
    {                                           ( Llabs.Optnone          )}
| _1 = Kw_optsize
    {                                           ( Llabs.Optsize          )}
| _1 = Kw_readnone
    {                                           ( Llabs.Readnone         )}
| _1 = Kw_readonly
    {                                           ( Llabs.Readonly         )}
| _1 = Kw_returns_twice
    {                                           ( Llabs.Returns_twice    )}
| _1 = Kw_ssp
    {                                           ( Llabs.Ssp              )}
| _1 = Kw_sspreq
    {                                           ( Llabs.Sspreq           )}
| _1 = Kw_sspstrong
    {                                           ( Llabs.Sspstrong        )}
| _1 = Kw_sanitize_address
    {                                           ( Llabs.Sanitize_address )}
| _1 = Kw_sanitize_thread
    {                                           ( Llabs.Sanitize_thread  )}
| _1 = Kw_sanitize_memory
    {                                           ( Llabs.Sanitize_memory  )}
| _1 = Kw_uwtable
    {                                           ( Llabs.Uwtable          )}

group_attributes:
| 
    {                                   ( [] )}
| _1 = group_attribute _2 = group_attributes
    {                                   ( _1::_2 )}

group_attribute:
| _1 = StringConstant
    {                                      ( Llabs.Attr(_1, None) )}
| _1 = StringConstant _2 = Equal _3 = StringConstant
    {                                      ( Llabs.Attr(_1, Some _3) )}
| _1 = Kw_align _2 = Equal _3 = APInt
    {                                      ( Llabs.Align(int_of_string _3) )}
| _1 = Kw_alignstack _2 = Equal _3 = APInt
    {                                      ( Llabs.Alignstack(int_of_string _3) )}
| _1 = Kw_alwaysinline
    {                                      ( Llabs.Alwaysinline    )}
| _1 = Kw_builtin
    {                                      ( Llabs.Builtin         )}
| _1 = Kw_cold
    {                                      ( Llabs.Cold            )}
| _1 = Kw_inlinehint
    {                                      ( Llabs.Inlinehint      )}
| _1 = Kw_jumptable
    {                                      ( Llabs.Jumptable        )}
| _1 = Kw_minsize
    {                                      ( Llabs.Minsize         )}
| _1 = Kw_naked
    {                                      ( Llabs.Naked           )}
| _1 = Kw_nobuiltin
    {                                      ( Llabs.Nobuiltin       )}
| _1 = Kw_noduplicate
    {                                      ( Llabs.Noduplicate     )}
| _1 = Kw_noimplicitfloat
    {                                      ( Llabs.Noimplicitfloat )}
| _1 = Kw_noinline
    {                                      ( Llabs.Noinline        )}
| _1 = Kw_nonlazybind
    {                                      ( Llabs.Nonlazybind     )}
| _1 = Kw_noredzone
    {                                      ( Llabs.Noredzone       )}
| _1 = Kw_noreturn
    {                                      ( Llabs.Noreturn        )}
| _1 = Kw_nounwind
    {                                      ( Llabs.Nounwind        )}
| _1 = Kw_optnone
    {                                      ( Llabs.Optnone         )}
| _1 = Kw_optsize
    {                                      ( Llabs.Optsize         )}
| _1 = Kw_readnone
    {                                      ( Llabs.Readnone        )}
| _1 = Kw_readonly
    {                                      ( Llabs.Readonly        )}
| _1 = Kw_returns_twice
    {                                      ( Llabs.Returns_twice   )}
| _1 = Kw_ssp
    {                                      ( Llabs.Ssp             )}
| _1 = Kw_sspreq
    {                                      ( Llabs.Sspreq          )}
| _1 = Kw_sspstrong
    {                                      ( Llabs.Sspstrong       )}
| _1 = Kw_sanitize_address
    {                                      ( Llabs.Sanitize_address)}
| _1 = Kw_sanitize_thread
    {                                      ( Llabs.Sanitize_thread )}
| _1 = Kw_sanitize_memory
    {                                      ( Llabs.Sanitize_memory )}
| _1 = Kw_uwtable
    {                                      ( Llabs.Uwtable         )}

param_list:
| 
    {                         ( [] )}
| _1 = param
    {                         ( [_1] )}
| _1 = param _2 = Comma _3 = param_list
    {                         ( _1::_3 )}

param:
| _1 = typ _2 = param_attribute_list _3 = value
    {                                 ( (_1, _2, _3) )}

param_attribute_list:
| 
    {                                       ( [] )}
| _1 = param_attribute _2 = param_attribute_list
    {                                       ( _1::_2 )}

param_attribute:
| _1 = Kw_align _2 = APInt
    {                                         ( Llabs.Align(int_of_string _2)           )}
| _1 = Kw_byval
    {                                         ( Llabs.Byval                             )}
| _1 = Kw_dereferenceable _2 = Lparen _3 = APInt _4 = Rparen
    {                                         ( Llabs.Dereferenceable(int_of_string _3) )}
| _1 = Kw_inalloca
    {                                         ( Llabs.Inalloca                          )}
| _1 = Kw_inreg
    {                                         ( Llabs.Inreg                             )}
| _1 = Kw_nest
    {                                         ( Llabs.Nest                              )}
| _1 = Kw_noalias
    {                                         ( Llabs.Noalias                           )}
| _1 = Kw_nocapture
    {                                         ( Llabs.Nocapture                         )}
| _1 = Kw_nonnull
    {                                         ( Llabs.Nonnull                           )}
| _1 = Kw_readnone
    {                                         ( Llabs.Readnone                          )}
| _1 = Kw_readonly
    {                                         ( Llabs.Readonly                          )}
| _1 = Kw_returned
    {                                         ( Llabs.Returned                          )}
| _1 = Kw_signext
    {                                         ( Llabs.Signext                           )}
| _1 = Kw_sret
    {                                         ( Llabs.Sret                              )}
| _1 = Kw_zeroext
    {                                         ( Llabs.Zeroext                           )}

jump_table:
| 
    {                                         ( [] )}
| _1 = type_value _2 = Comma _3 = type_value _4 = jump_table
    {                                         ( (_1,_3)::_4 )}

type_value:
| _1 = typ _2 = value
    {            ( (_1, _2) )}

opt_sideeffect:
| 
    {                ( false )}
| _1 = Kw_sideeffect
    {                ( true )}

opt_alignstack:
| 
    {                ( false )}
| _1 = Kw_alignstack
    {                ( true )}

opt_inteldialect:
| 
    {                  ( false )}
| _1 = Kw_inteldialect
    {                  ( true )}

opt_exact:
| 
    {              ( false )}
| _1 = Kw_exact
    {              ( true )}

opt_nuw_nsw:
| 
    {                ( (false, false) )}
| _1 = Kw_nuw _2 = Kw_nsw
    {                ( (true, true)   )}
| _1 = Kw_nsw _2 = Kw_nuw
    {                ( (true, true)   )}
| _1 = Kw_nuw
    {                ( (true, false)  )}
| _1 = Kw_nsw
    {                ( (false, true)  )}

opt_thread_local:
| 
    {                                                ( None )}
| _1 = Kw_thread_local
    {                                                ( Some None )}
| _1 = Kw_thread_local _2 = Lparen _3 = Kw_localdynamic _4 = Rparen
    {                                                ( Some (Some Llabs.Localdynamic) )}
| _1 = Kw_thread_local _2 = Lparen _3 = Kw_initialexec _4 = Rparen
    {                                                ( Some (Some Llabs.Initialexec) )}
| _1 = Kw_thread_local _2 = Lparen _3 = Kw_localexec _4 = Rparen
    {                                                ( Some (Some Llabs.Localexec) )}

opt_addrspace:
| 
    {                                   ( None )}
| _1 = Kw_addrspace _2 = Lparen _3 = APInt _4 = Rparen
    {                                   ( Some (int_of_string _3) )}

opt_unnamed_addr:
| 
    {                  ( false )}
| _1 = Kw_unnamed_addr
    {                  ( true )}

opt_externally_initialized:
| 
    {                            ( false )}
| _1 = Kw_externally_initialized
    {                            ( true )}

opt_dll_storageclass:
| 
    {               ( None )}
| _1 = Kw_dllimport
    {               ( Some Llabs.Dllimport )}
| _1 = Kw_dllexport
    {               ( Some Llabs.Dllexport )}

opt_linkage:
| _1 = external_linkage
    {                       ( Some _1 )}
| _1 = non_external_linkage
    {                       ( _1 )}

external_linkage:
| _1 = Kw_extern_weak
    {                 ( Llabs.Extern_weak )}
| _1 = Kw_external
    {                 ( Llabs.External )}

non_external_linkage:
| 
    {                          ( None )}
| _1 = Kw_private
    {                          ( Some Llabs.Private )}
| _1 = Kw_internal
    {                          ( Some Llabs.Internal )}
| _1 = Kw_linker_private
    {                          ( Some Llabs.Linker_private )}
| _1 = Kw_linker_private_weak
    {                          ( Some Llabs.Linker_private_weak )}
| _1 = Kw_weak
    {                          ( Some Llabs.Weak )}
| _1 = Kw_weak_odr
    {                          ( Some Llabs.Weak_odr )}
| _1 = Kw_linkonce
    {                          ( Some Llabs.Linkonce )}
| _1 = Kw_linkonce_odr
    {                          ( Some Llabs.Linkonce_odr )}
| _1 = Kw_available_externally
    {                          ( Some Llabs.Available_externally )}
| _1 = Kw_appending
    {                          ( Some Llabs.Appending )}
| _1 = Kw_common
    {                          ( Some Llabs.Common )}

opt_visibility:
| 
    {               ( None )}
| _1 = Kw_default
    {               ( Some Llabs.Default )}
| _1 = Kw_hidden
    {               ( Some Llabs.Hidden )}
| _1 = Kw_protected
    {               ( Some Llabs.Protected )}

opt_callingconv:
| 
    {                       ( None )}
| _1 = Kw_ccc
    {                       ( Some Llabs.Ccc               )}
| _1 = Kw_fastcc
    {                       ( Some Llabs.Fastcc            )}
| _1 = Kw_intel_ocl_bicc
    {                       ( Some Llabs.Intel_ocl_bicc    )}
| _1 = Kw_coldcc
    {                       ( Some Llabs.Coldcc            )}
| _1 = Kw_x86_stdcallcc
    {                       ( Some Llabs.X86_stdcallcc     )}
| _1 = Kw_x86_fastcallcc
    {                       ( Some Llabs.X86_fastcallcc    )}
| _1 = Kw_x86_thiscallcc
    {                       ( Some Llabs.X86_thiscallcc    )}
| _1 = Kw_x86_cdeclmethodcc
    {                       ( Some Llabs.X86_cdeclmethodcc )}
| _1 = Kw_arm_apcscc
    {                       ( Some Llabs.Arm_apcscc        )}
| _1 = Kw_arm_aapcscc
    {                       ( Some Llabs.Arm_aapcscc       )}
| _1 = Kw_arm_aapcs_vfpcc
    {                       ( Some Llabs.Arm_aapcs_vfpcc   )}
| _1 = Kw_msp430_intrcc
    {                       ( Some Llabs.Msp430_intrcc     )}
| _1 = Kw_ptx_kernel
    {                       ( Some Llabs.Ptx_kernel        )}
| _1 = Kw_ptx_device
    {                       ( Some Llabs.Ptx_device        )}
| _1 = Kw_spir_func
    {                       ( Some Llabs.Spir_func         )}
| _1 = Kw_spir_kernel
    {                       ( Some Llabs.Spir_kernel       )}
| _1 = Kw_x86_64_sysvcc
    {                       ( Some Llabs.X86_64_sysvcc     )}
| _1 = Kw_x86_64_win64cc
    {                       ( Some Llabs.X86_64_win64cc    )}
| _1 = Kw_webkit_jscc
    {                       ( Some Llabs.Webkit_jscc       )}
| _1 = Kw_anyregcc
    {                       ( Some Llabs.Anyregcc          )}
| _1 = Kw_preserve_mostcc
    {                       ( Some Llabs.Preserve_mostcc   )}
| _1 = Kw_preserve_allcc
    {                       ( Some Llabs.Preserve_allcc    )}
| _1 = Kw_cc
    {                       ( Some Llabs.Cc                )}

return_attributes:
| 
    {                                     ( [] )}
| _1 = return_attribute _2 = return_attributes
    {                                     ( _1::_2 )}

return_attribute:
| _1 = Kw_dereferenceable _2 = Lparen _3 = APInt _4 = Rparen
    {                                         ( Llabs.Dereferenceable(int_of_string _3) )}
| _1 = Kw_inreg
    {                                         ( Llabs.Inreg                             )}
| _1 = Kw_noalias
    {                                         ( Llabs.Noalias                           )}
| _1 = Kw_nonnull
    {                                         ( Llabs.Nonnull                           )}
| _1 = Kw_signext
    {                                         ( Llabs.Signext                           )}
| _1 = Kw_zeroext
    {                                         ( Llabs.Zeroext                           )}

%%