int cos_fixed(int deg) {
  int tmp = 1;
  const int cos_arr[501] = {
      1073741824, 1073736525, 1073720629, 1073694136, 1073657045, 1073609359,
      1073551075, 1073482197, 1073402723, 1073312656, 1073211995, 1073100742,
      1072978897, 1072846463, 1072703441, 1072549831, 1072385635, 1072210855,
      1072025493, 1071829551, 1071623030, 1071405932, 1071178260, 1070940016,
      1070691202, 1070431821, 1070161875, 1069881367, 1069590299, 1069288675,
      1068976498, 1068653770, 1068320494, 1067976675, 1067622316, 1067257419,
      1066881989, 1066496029, 1066099543, 1065692535, 1065275009, 1064846970,
      1064408420, 1063959366, 1063499810, 1063029758, 1062549214, 1062058184,
      1061556671, 1061044681, 1060522219, 1059989290, 1059445899, 1058892052,
      1058327753, 1057753010, 1057167827, 1056572210, 1055966165, 1055349698,
      1054722816, 1054085523, 1053437827, 1052779734, 1052111250, 1051432383,
      1050743138, 1050043523, 1049333544, 1048613208, 1047882524, 1047141497,
      1046390135, 1045628445, 1044856436, 1044074114, 1043281487, 1042478564,
      1041665352, 1040841859, 1040008093, 1039164063, 1038309776, 1037445242,
      1036570469, 1035685465, 1034790239, 1033884800, 1032969157, 1032043319,
      1031107296, 1030161095, 1029204727, 1028238202, 1027261527, 1026274715,
      1025277773, 1024270712, 1023253542, 1022226273, 1021188915, 1020141478,
      1019083972, 1018016409, 1016938798, 1015851151, 1014753477, 1013645788,
      1012528094, 1011400408, 1010262739, 1009115099, 1007957500, 1006789953,
      1005612468, 1004425059, 1003227737, 1002020513, 1000803399, 999576408,
      998339551,  997092842,  995836291,  994569911,  993293716,  992007717,
      990711927,  989406360,  988091027,  986765942,  985431119,  984086569,
      982732307,  981368345,  979994698,  978611378,  977218400,  975815778,
      974403524,  972981653,  971550180,  970109117,  968658480,  967198282,
      965728539,  964249264,  962760472,  961262179,  959754398,  958237144,
      956710433,  955174280,  953628699,  952073707,  950509318,  948935548,
      947352412,  945759926,  944158105,  942546966,  940926525,  939296797,
      937657798,  936009546,  934352055,  932685342,  931009424,  929324317,
      927630038,  925926604,  924214031,  922492337,  920761538,  919021651,
      917272694,  915514684,  913747638,  911971574,  910186508,  908392460,
      906589446,  904777484,  902956593,  901126789,  899288092,  897440520,
      895584089,  893718820,  891844730,  889961838,  888070162,  886169721,
      884260534,  882342620,  880415997,  878480685,  876536703,  874584070,
      872622804,  870652927,  868674456,  866687412,  864691813,  862687681,
      860675034,  858653893,  856624277,  854586206,  852539701,  850484782,
      848421469,  846349782,  844269742,  842181369,  840084685,  837979709,
      835866462,  833744966,  831615241,  829477308,  827331189,  825176904,
      823014475,  820843923,  818665269,  816478536,  814283744,  812080916,
      809870072,  807651236,  805424428,  803189671,  800946987,  798696398,
      796437926,  794171593,  791897423,  789615436,  787325656,  785028106,
      782722808,  780409784,  778089058,  775760653,  773424591,  771080896,
      768729590,  766370698,  764004241,  761630244,  759248731,  756859723,
      754463246,  752059322,  749647976,  747229231,  744803111,  742369640,
      739928843,  737480742,  735025363,  732562729,  730092866,  727615796,
      725131545,  722640138,  720141598,  717635951,  715123220,  712603432,
      710076611,  707542781,  705001969,  702454198,  699899494,  697337883,
      694769388,  692194037,  689611854,  687022865,  684427096,  681824571,
      679215317,  676599359,  673976723,  671347436,  668711522,  666069009,
      663419922,  660764287,  658102130,  655433478,  652758358,  650076795,
      647388816,  644694447,  641993716,  639286648,  636573270,  633853610,
      631127694,  628395549,  625657202,  622912680,  620162010,  617405220,
      614642335,  611873385,  609098395,  606317394,  603530409,  600737467,
      597938596,  595133824,  592323177,  589506685,  586684375,  583856274,
      581022411,  578182813,  575337509,  572486526,  569629894,  566767639,
      563899790,  561026376,  558147425,  555262965,  552373025,  549477633,
      546576818,  543670608,  540759033,  537842120,  534919899,  531992399,
      529059648,  526121676,  523178510,  520230182,  517276719,  514318150,
      511354505,  508385814,  505412105,  502433407,  499449751,  496461165,
      493467680,  490469324,  487466127,  484458120,  481445330,  478427790,
      475405527,  472378572,  469346955,  466310706,  463269854,  460224430,
      457174464,  454119985,  451061025,  447997613,  444929779,  441857554,
      438780968,  435700051,  432614834,  429525348,  426431622,  423333687,
      420231575,  417125314,  414014937,  410900474,  407781955,  404659412,
      401532874,  398402374,  395267942,  392129608,  388987404,  385841362,
      382691511,  379537883,  376380509,  373219420,  370054648,  366886223,
      363714178,  360538543,  357359349,  354176628,  350990412,  347800732,
      344607619,  341411104,  338211220,  335007999,  331801470,  328591667,
      325378621,  322162364,  318942927,  315720342,  312494641,  309265855,
      306034018,  302799160,  299561313,  296320510,  293076783,  289830162,
      286580682,  283328372,  280073267,  276815397,  273554795,  270291494,
      267025524,  263756919,  260485711,  257211932,  253935615,  250656791,
      247375493,  244091754,  240805606,  237517081,  234226212,  230933031,
      227637571,  224339864,  221039943,  217737840,  214433589,  211127221,
      207818769,  204508266,  201195745,  197881238,  194564778,  191246398,
      187926130,  184604008,  181280063,  177954330,  174626840,  171297626,
      167966722,  164634160,  161299973,  157964194,  154626856,  151287992,
      147947635,  144605818,  141262574,  137917935,  134571935,  131224607,
      127875984,  124526098,  121174984,  117822674,  114469200,  111114597,
      107758898,  104402135,  101044341,  97685550,   94325795,   90965109,
      87603526,   84241077,   80877797,   77513719,   74148876,   70783302,
      67417028,   64050089,   60682518,   57314348,   53945613,   50576345,
      47206578,   43836345,   40465679,   37094614,   33723182,   30351418,
      26979355,   23607025,   20234462,   16861699,   13488770,   10115708,
      6742546,    3369318,    0};
  deg = deg % 2000;
  if (deg > 1000)
    deg = 2000 - deg;
  if (deg > 500) {
    deg = 1000 - deg;
    tmp = -1;
  }
  return tmp * cos_arr[deg];
}


x86 assembly (clang, -O0):
<cos_fixed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7e0,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
lea    -0x7e0(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x7d4,%edx
call   1030 <memcpy@plt>
mov    -0x4(%rbp),%eax
mov    $0x7d0,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
cmpl   $0x3e8,-0x4(%rbp)
jle    1163 <cos_fixed+0x53>
mov    $0x7d0,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x1f4,-0x4(%rbp)
jle    1182 <cos_fixed+0x72>
mov    $0x3e8,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movslq -0x4(%rbp),%rcx
imul   -0x7e0(%rbp,%rcx,4),%eax
ff
add    $0x7e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cos_fixed>:
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x27,%rcx
add    %edx,%ecx
imul   $0x7d0,%ecx,%ecx
sub    %ecx,%eax
mov    $0x7d0,%ecx
sub    %eax,%ecx
cmp    $0x3e9,%eax
cmovl  %eax,%ecx
mov    $0x3e8,%eax
sub    %ecx,%eax
cmp    $0x1f5,%ecx
cmovl  %ecx,%eax
cltq
lea    0xeb9(%rip),%rdx
mov    (%rdx,%rax,4),%edx
mov    %edx,%eax
neg    %eax
cmp    $0x1f5,%ecx
cmovl  %edx,%eax
ret

LLVM IR (-O0):
@__const.cos_fixed.cos_arr = [501 x i32] [i32 1073741824, i32 1073736525, i32 1073720629, i32 1073694136, i32 1073657045, i32 1073609359, i32 1073551075, i32 1073482197, i32 1073402723, i32 1073312656, i32 1073211995, i32 1073100742, i32 1072978897, i32 1072846463, i32 1072703441, i32 1072549831, i32 1072385635, i32 1072210855, i32 1072025493, i32 1071829551, i32 1071623030, i32 1071405932, i32 1071178260, i32 1070940016, i32 1070691202, i32 1070431821, i32 1070161875, i32 1069881367, i32 1069590299, i32 1069288675, i32 1068976498, i32 1068653770, i32 1068320494, i32 1067976675, i32 1067622316, i32 1067257419, i32 1066881989, i32 1066496029, i32 1066099543, i32 1065692535, i32 1065275009, i32 1064846970, i32 1064408420, i32 1063959366, i32 1063499810, i32 1063029758, i32 1062549214, i32 1062058184, i32 1061556671, i32 1061044681, i32 1060522219, i32 1059989290, i32 1059445899, i32 1058892052, i32 1058327753, i32 1057753010, i32 1057167827, i32 1056572210, i32 1055966165, i32 1055349698, i32 1054722816, i32 1054085523, i32 1053437827, i32 1052779734, i32 1052111250, i32 1051432383, i32 1050743138, i32 1050043523, i32 1049333544, i32 1048613208, i32 1047882524, i32 1047141497, i32 1046390135, i32 1045628445, i32 1044856436, i32 1044074114, i32 1043281487, i32 1042478564, i32 1041665352, i32 1040841859, i32 1040008093, i32 1039164063, i32 1038309776, i32 1037445242, i32 1036570469, i32 1035685465, i32 1034790239, i32 1033884800, i32 1032969157, i32 1032043319, i32 1031107296, i32 1030161095, i32 1029204727, i32 1028238202, i32 1027261527, i32 1026274715, i32 1025277773, i32 1024270712, i32 1023253542, i32 1022226273, i32 1021188915, i32 1020141478, i32 1019083972, i32 1018016409, i32 1016938798, i32 1015851151, i32 1014753477, i32 1013645788, i32 1012528094, i32 1011400408, i32 1010262739, i32 1009115099, i32 1007957500, i32 1006789953, i32 1005612468, i32 1004425059, i32 1003227737, i32 1002020513, i32 1000803399, i32 999576408, i32 998339551, i32 997092842, i32 995836291, i32 994569911, i32 993293716, i32 992007717, i32 990711927, i32 989406360, i32 988091027, i32 986765942, i32 985431119, i32 984086569, i32 982732307, i32 981368345, i32 979994698, i32 978611378, i32 977218400, i32 975815778, i32 974403524, i32 972981653, i32 971550180, i32 970109117, i32 968658480, i32 967198282, i32 965728539, i32 964249264, i32 962760472, i32 961262179, i32 959754398, i32 958237144, i32 956710433, i32 955174280, i32 953628699, i32 952073707, i32 950509318, i32 948935548, i32 947352412, i32 945759926, i32 944158105, i32 942546966, i32 940926525, i32 939296797, i32 937657798, i32 936009546, i32 934352055, i32 932685342, i32 931009424, i32 929324317, i32 927630038, i32 925926604, i32 924214031, i32 922492337, i32 920761538, i32 919021651, i32 917272694, i32 915514684, i32 913747638, i32 911971574, i32 910186508, i32 908392460, i32 906589446, i32 904777484, i32 902956593, i32 901126789, i32 899288092, i32 897440520, i32 895584089, i32 893718820, i32 891844730, i32 889961838, i32 888070162, i32 886169721, i32 884260534, i32 882342620, i32 880415997, i32 878480685, i32 876536703, i32 874584070, i32 872622804, i32 870652927, i32 868674456, i32 866687412, i32 864691813, i32 862687681, i32 860675034, i32 858653893, i32 856624277, i32 854586206, i32 852539701, i32 850484782, i32 848421469, i32 846349782, i32 844269742, i32 842181369, i32 840084685, i32 837979709, i32 835866462, i32 833744966, i32 831615241, i32 829477308, i32 827331189, i32 825176904, i32 823014475, i32 820843923, i32 818665269, i32 816478536, i32 814283744, i32 812080916, i32 809870072, i32 807651236, i32 805424428, i32 803189671, i32 800946987, i32 798696398, i32 796437926, i32 794171593, i32 791897423, i32 789615436, i32 787325656, i32 785028106, i32 782722808, i32 780409784, i32 778089058, i32 775760653, i32 773424591, i32 771080896, i32 768729590, i32 766370698, i32 764004241, i32 761630244, i32 759248731, i32 756859723, i32 754463246, i32 752059322, i32 749647976, i32 747229231, i32 744803111, i32 742369640, i32 739928843, i32 737480742, i32 735025363, i32 732562729, i32 730092866, i32 727615796, i32 725131545, i32 722640138, i32 720141598, i32 717635951, i32 715123220, i32 712603432, i32 710076611, i32 707542781, i32 705001969, i32 702454198, i32 699899494, i32 697337883, i32 694769388, i32 692194037, i32 689611854, i32 687022865, i32 684427096, i32 681824571, i32 679215317, i32 676599359, i32 673976723, i32 671347436, i32 668711522, i32 666069009, i32 663419922, i32 660764287, i32 658102130, i32 655433478, i32 652758358, i32 650076795, i32 647388816, i32 644694447, i32 641993716, i32 639286648, i32 636573270, i32 633853610, i32 631127694, i32 628395549, i32 625657202, i32 622912680, i32 620162010, i32 617405220, i32 614642335, i32 611873385, i32 609098395, i32 606317394, i32 603530409, i32 600737467, i32 597938596, i32 595133824, i32 592323177, i32 589506685, i32 586684375, i32 583856274, i32 581022411, i32 578182813, i32 575337509, i32 572486526, i32 569629894, i32 566767639, i32 563899790, i32 561026376, i32 558147425, i32 555262965, i32 552373025, i32 549477633, i32 546576818, i32 543670608, i32 540759033, i32 537842120, i32 534919899, i32 531992399, i32 529059648, i32 526121676, i32 523178510, i32 520230182, i32 517276719, i32 514318150, i32 511354505, i32 508385814, i32 505412105, i32 502433407, i32 499449751, i32 496461165, i32 493467680, i32 490469324, i32 487466127, i32 484458120, i32 481445330, i32 478427790, i32 475405527, i32 472378572, i32 469346955, i32 466310706, i32 463269854, i32 460224430, i32 457174464, i32 454119985, i32 451061025, i32 447997613, i32 444929779, i32 441857554, i32 438780968, i32 435700051, i32 432614834, i32 429525348, i32 426431622, i32 423333687, i32 420231575, i32 417125314, i32 414014937, i32 410900474, i32 407781955, i32 404659412, i32 401532874, i32 398402374, i32 395267942, i32 392129608, i32 388987404, i32 385841362, i32 382691511, i32 379537883, i32 376380509, i32 373219420, i32 370054648, i32 366886223, i32 363714178, i32 360538543, i32 357359349, i32 354176628, i32 350990412, i32 347800732, i32 344607619, i32 341411104, i32 338211220, i32 335007999, i32 331801470, i32 328591667, i32 325378621, i32 322162364, i32 318942927, i32 315720342, i32 312494641, i32 309265855, i32 306034018, i32 302799160, i32 299561313, i32 296320510, i32 293076783, i32 289830162, i32 286580682, i32 283328372, i32 280073267, i32 276815397, i32 273554795, i32 270291494, i32 267025524, i32 263756919, i32 260485711, i32 257211932, i32 253935615, i32 250656791, i32 247375493, i32 244091754, i32 240805606, i32 237517081, i32 234226212, i32 230933031, i32 227637571, i32 224339864, i32 221039943, i32 217737840, i32 214433589, i32 211127221, i32 207818769, i32 204508266, i32 201195745, i32 197881238, i32 194564778, i32 191246398, i32 187926130, i32 184604008, i32 181280063, i32 177954330, i32 174626840, i32 171297626, i32 167966722, i32 164634160, i32 161299973, i32 157964194, i32 154626856, i32 151287992, i32 147947635, i32 144605818, i32 141262574, i32 137917935, i32 134571935, i32 131224607, i32 127875984, i32 124526098, i32 121174984, i32 117822674, i32 114469200, i32 111114597, i32 107758898, i32 104402135, i32 101044341, i32 97685550, i32 94325795, i32 90965109, i32 87603526, i32 84241077, i32 80877797, i32 77513719, i32 74148876, i32 70783302, i32 67417028, i32 64050089, i32 60682518, i32 57314348, i32 53945613, i32 50576345, i32 47206578, i32 43836345, i32 40465679, i32 37094614, i32 33723182, i32 30351418, i32 26979355, i32 23607025, i32 20234462, i32 16861699, i32 13488770, i32 10115708, i32 6742546, i32 3369318, i32 0]
define i32 @cos_fixed(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [501 x i32]
store i32 %0, i32* %2
store i32 1, i32* %3
%5 = bitcast [501 x i32]* %4 to i8*
%6 = load i32, i32* %2
%7 = srem i32 %6, 2000
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 1000
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i32, i32* %2
%12 = sub nsw i32 2000, %11
store i32 %12, i32* %2
br label %13
13: ; preds = %10, %1
%14 = load i32, i32* %2
%15 = icmp sgt i32 %14, 500
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load i32, i32* %2
%18 = sub nsw i32 1000, %17
store i32 %18, i32* %2
store i32 -1, i32* %3
br label %19
19: ; preds = %16, %13
%20 = load i32, i32* %3
%21 = load i32, i32* %2
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [501 x i32], [501 x i32]* %4, i64 0, i64 %22
%24 = load i32, i32* %23
%25 = mul nsw i32 %20, %24
ret i32 %25
}

LLVM IR (-O2):
@__const.cos_fixed.cos_arr = [501 x i32] [i32 1073741824, i32 1073736525, i32 1073720629, i32 1073694136, i32 1073657045, i32 1073609359, i32 1073551075, i32 1073482197, i32 1073402723, i32 1073312656, i32 1073211995, i32 1073100742, i32 1072978897, i32 1072846463, i32 1072703441, i32 1072549831, i32 1072385635, i32 1072210855, i32 1072025493, i32 1071829551, i32 1071623030, i32 1071405932, i32 1071178260, i32 1070940016, i32 1070691202, i32 1070431821, i32 1070161875, i32 1069881367, i32 1069590299, i32 1069288675, i32 1068976498, i32 1068653770, i32 1068320494, i32 1067976675, i32 1067622316, i32 1067257419, i32 1066881989, i32 1066496029, i32 1066099543, i32 1065692535, i32 1065275009, i32 1064846970, i32 1064408420, i32 1063959366, i32 1063499810, i32 1063029758, i32 1062549214, i32 1062058184, i32 1061556671, i32 1061044681, i32 1060522219, i32 1059989290, i32 1059445899, i32 1058892052, i32 1058327753, i32 1057753010, i32 1057167827, i32 1056572210, i32 1055966165, i32 1055349698, i32 1054722816, i32 1054085523, i32 1053437827, i32 1052779734, i32 1052111250, i32 1051432383, i32 1050743138, i32 1050043523, i32 1049333544, i32 1048613208, i32 1047882524, i32 1047141497, i32 1046390135, i32 1045628445, i32 1044856436, i32 1044074114, i32 1043281487, i32 1042478564, i32 1041665352, i32 1040841859, i32 1040008093, i32 1039164063, i32 1038309776, i32 1037445242, i32 1036570469, i32 1035685465, i32 1034790239, i32 1033884800, i32 1032969157, i32 1032043319, i32 1031107296, i32 1030161095, i32 1029204727, i32 1028238202, i32 1027261527, i32 1026274715, i32 1025277773, i32 1024270712, i32 1023253542, i32 1022226273, i32 1021188915, i32 1020141478, i32 1019083972, i32 1018016409, i32 1016938798, i32 1015851151, i32 1014753477, i32 1013645788, i32 1012528094, i32 1011400408, i32 1010262739, i32 1009115099, i32 1007957500, i32 1006789953, i32 1005612468, i32 1004425059, i32 1003227737, i32 1002020513, i32 1000803399, i32 999576408, i32 998339551, i32 997092842, i32 995836291, i32 994569911, i32 993293716, i32 992007717, i32 990711927, i32 989406360, i32 988091027, i32 986765942, i32 985431119, i32 984086569, i32 982732307, i32 981368345, i32 979994698, i32 978611378, i32 977218400, i32 975815778, i32 974403524, i32 972981653, i32 971550180, i32 970109117, i32 968658480, i32 967198282, i32 965728539, i32 964249264, i32 962760472, i32 961262179, i32 959754398, i32 958237144, i32 956710433, i32 955174280, i32 953628699, i32 952073707, i32 950509318, i32 948935548, i32 947352412, i32 945759926, i32 944158105, i32 942546966, i32 940926525, i32 939296797, i32 937657798, i32 936009546, i32 934352055, i32 932685342, i32 931009424, i32 929324317, i32 927630038, i32 925926604, i32 924214031, i32 922492337, i32 920761538, i32 919021651, i32 917272694, i32 915514684, i32 913747638, i32 911971574, i32 910186508, i32 908392460, i32 906589446, i32 904777484, i32 902956593, i32 901126789, i32 899288092, i32 897440520, i32 895584089, i32 893718820, i32 891844730, i32 889961838, i32 888070162, i32 886169721, i32 884260534, i32 882342620, i32 880415997, i32 878480685, i32 876536703, i32 874584070, i32 872622804, i32 870652927, i32 868674456, i32 866687412, i32 864691813, i32 862687681, i32 860675034, i32 858653893, i32 856624277, i32 854586206, i32 852539701, i32 850484782, i32 848421469, i32 846349782, i32 844269742, i32 842181369, i32 840084685, i32 837979709, i32 835866462, i32 833744966, i32 831615241, i32 829477308, i32 827331189, i32 825176904, i32 823014475, i32 820843923, i32 818665269, i32 816478536, i32 814283744, i32 812080916, i32 809870072, i32 807651236, i32 805424428, i32 803189671, i32 800946987, i32 798696398, i32 796437926, i32 794171593, i32 791897423, i32 789615436, i32 787325656, i32 785028106, i32 782722808, i32 780409784, i32 778089058, i32 775760653, i32 773424591, i32 771080896, i32 768729590, i32 766370698, i32 764004241, i32 761630244, i32 759248731, i32 756859723, i32 754463246, i32 752059322, i32 749647976, i32 747229231, i32 744803111, i32 742369640, i32 739928843, i32 737480742, i32 735025363, i32 732562729, i32 730092866, i32 727615796, i32 725131545, i32 722640138, i32 720141598, i32 717635951, i32 715123220, i32 712603432, i32 710076611, i32 707542781, i32 705001969, i32 702454198, i32 699899494, i32 697337883, i32 694769388, i32 692194037, i32 689611854, i32 687022865, i32 684427096, i32 681824571, i32 679215317, i32 676599359, i32 673976723, i32 671347436, i32 668711522, i32 666069009, i32 663419922, i32 660764287, i32 658102130, i32 655433478, i32 652758358, i32 650076795, i32 647388816, i32 644694447, i32 641993716, i32 639286648, i32 636573270, i32 633853610, i32 631127694, i32 628395549, i32 625657202, i32 622912680, i32 620162010, i32 617405220, i32 614642335, i32 611873385, i32 609098395, i32 606317394, i32 603530409, i32 600737467, i32 597938596, i32 595133824, i32 592323177, i32 589506685, i32 586684375, i32 583856274, i32 581022411, i32 578182813, i32 575337509, i32 572486526, i32 569629894, i32 566767639, i32 563899790, i32 561026376, i32 558147425, i32 555262965, i32 552373025, i32 549477633, i32 546576818, i32 543670608, i32 540759033, i32 537842120, i32 534919899, i32 531992399, i32 529059648, i32 526121676, i32 523178510, i32 520230182, i32 517276719, i32 514318150, i32 511354505, i32 508385814, i32 505412105, i32 502433407, i32 499449751, i32 496461165, i32 493467680, i32 490469324, i32 487466127, i32 484458120, i32 481445330, i32 478427790, i32 475405527, i32 472378572, i32 469346955, i32 466310706, i32 463269854, i32 460224430, i32 457174464, i32 454119985, i32 451061025, i32 447997613, i32 444929779, i32 441857554, i32 438780968, i32 435700051, i32 432614834, i32 429525348, i32 426431622, i32 423333687, i32 420231575, i32 417125314, i32 414014937, i32 410900474, i32 407781955, i32 404659412, i32 401532874, i32 398402374, i32 395267942, i32 392129608, i32 388987404, i32 385841362, i32 382691511, i32 379537883, i32 376380509, i32 373219420, i32 370054648, i32 366886223, i32 363714178, i32 360538543, i32 357359349, i32 354176628, i32 350990412, i32 347800732, i32 344607619, i32 341411104, i32 338211220, i32 335007999, i32 331801470, i32 328591667, i32 325378621, i32 322162364, i32 318942927, i32 315720342, i32 312494641, i32 309265855, i32 306034018, i32 302799160, i32 299561313, i32 296320510, i32 293076783, i32 289830162, i32 286580682, i32 283328372, i32 280073267, i32 276815397, i32 273554795, i32 270291494, i32 267025524, i32 263756919, i32 260485711, i32 257211932, i32 253935615, i32 250656791, i32 247375493, i32 244091754, i32 240805606, i32 237517081, i32 234226212, i32 230933031, i32 227637571, i32 224339864, i32 221039943, i32 217737840, i32 214433589, i32 211127221, i32 207818769, i32 204508266, i32 201195745, i32 197881238, i32 194564778, i32 191246398, i32 187926130, i32 184604008, i32 181280063, i32 177954330, i32 174626840, i32 171297626, i32 167966722, i32 164634160, i32 161299973, i32 157964194, i32 154626856, i32 151287992, i32 147947635, i32 144605818, i32 141262574, i32 137917935, i32 134571935, i32 131224607, i32 127875984, i32 124526098, i32 121174984, i32 117822674, i32 114469200, i32 111114597, i32 107758898, i32 104402135, i32 101044341, i32 97685550, i32 94325795, i32 90965109, i32 87603526, i32 84241077, i32 80877797, i32 77513719, i32 74148876, i32 70783302, i32 67417028, i32 64050089, i32 60682518, i32 57314348, i32 53945613, i32 50576345, i32 47206578, i32 43836345, i32 40465679, i32 37094614, i32 33723182, i32 30351418, i32 26979355, i32 23607025, i32 20234462, i32 16861699, i32 13488770, i32 10115708, i32 6742546, i32 3369318, i32 0]
define i32 @cos_fixed(i32 %0) {
%2 = srem i32 %0, 2000
%3 = icmp sgt i32 %2, 1000
%4 = sub nsw i32 2000, %2
%5 = select i1 %3, i32 %4, i32 %2
%6 = icmp sgt i32 %5, 500
%7 = sub nsw i32 1000, %5
%8 = select i1 %6, i32 %7, i32 %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [501 x i32], [501 x i32]* @__const.cos_fixed.cos_arr, i64 0, i64 %9
%11 = load i32, i32* %10
%12 = sub nsw i32 0, %11
%13 = select i1 %6, i32 %12, i32 %11
ret i32 %13
}