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
|
/* Generated by Nim Compiler v0.16.0 */
/* (c) 2017 Andreas Rumpf */
/* The generated code is subject to the original license. */
#define NIM_INTBITS 32
#include "nimbase.h"
#undef linux
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
struct TGenericSeq {
NI len;
NI reserved;
};
struct NimStringDesc {
TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
static N_INLINE(NI, HEX21HEX26_6dtCP6C39bxOkT4wrIPJwKghashes)(NI h0, NI val0);
static N_INLINE(NI, HEX21HEX24_zs9byUtT9cNi2e9clB27b2cUAhashes)(NI h0);
static N_INLINE(NIM_BOOL, ismagicidentseparatorrune_jEsY0iAEfTnaxdnZAwGvIwidents)(NCSTRING cs0, NI i0);
static N_INLINE(NI, HEX21HEX26_6dtCP6C39bxOkT4wrIPJwKghashes)(NI h0, NI val0) {
NI result0;
result0 = (NI)0;
result0 = (NI)((NU32)(h0) + (NU32)(val0));
result0 = (NI)((NU32)(result0) + (NU32)((NI)((NU32)(result0) << (NU32)(((NI) 10)))));
result0 = (NI)(result0 ^ (NI)((NU32)(result0) >> (NU32)(((NI) 6))));
return result0;
}
static N_INLINE(NI, HEX21HEX24_zs9byUtT9cNi2e9clB27b2cUAhashes)(NI h0) {
NI result0;
result0 = (NI)0;
result0 = (NI)((NU32)(h0) + (NU32)((NI)((NU32)(h0) << (NU32)(((NI) 3)))));
result0 = (NI)(result0 ^ (NI)((NU32)(result0) >> (NU32)(((NI) 11))));
result0 = (NI)((NU32)(result0) + (NU32)((NI)((NU32)(result0) << (NU32)(((NI) 15)))));
return result0;
}
N_NIMCALL(NI, hash_uBstFm5SYVQeOL3j9c9bc58A)(NimStringDesc* x0) {
NI result0;
NI h0;
result0 = (NI)0;
h0 = ((NI) 0);
{
NI i_8yjSY27k9auQ29baB1P8NefQ;
NI HEX3Atmp_9a6O0SjfH9acKqHTCOs2pISw;
NI res_w69czt14PqjVC9c2DXgkaLqw;
i_8yjSY27k9auQ29baB1P8NefQ = (NI)0;
HEX3Atmp_9a6O0SjfH9acKqHTCOs2pISw = (NI)0;
HEX3Atmp_9a6O0SjfH9acKqHTCOs2pISw = (NI)((x0 ? x0->Sup.len : 0) - ((NI) 1));
res_w69czt14PqjVC9c2DXgkaLqw = ((NI) 0);
{
while (1) {
if (!(res_w69czt14PqjVC9c2DXgkaLqw <= HEX3Atmp_9a6O0SjfH9acKqHTCOs2pISw)) goto LA3;
i_8yjSY27k9auQ29baB1P8NefQ = res_w69czt14PqjVC9c2DXgkaLqw;
h0 = HEX21HEX26_6dtCP6C39bxOkT4wrIPJwKghashes(h0, ((NI) (((NU8)(x0->data[i_8yjSY27k9auQ29baB1P8NefQ])))));
res_w69czt14PqjVC9c2DXgkaLqw += ((NI) 1);
} LA3: ;
}
}
result0 = HEX21HEX24_zs9byUtT9cNi2e9clB27b2cUAhashes(h0);
return result0;
}
static N_INLINE(NIM_BOOL, ismagicidentseparatorrune_jEsY0iAEfTnaxdnZAwGvIwidents)(NCSTRING cs0, NI i0) {
NIM_BOOL result0;
NIM_BOOL LOC1;
NIM_BOOL LOC2;
result0 = (NIM_BOOL)0;
LOC1 = (NIM_BOOL)0;
LOC2 = (NIM_BOOL)0;
LOC2 = ((NU8)(cs0[i0]) == (NU8)(226));
if (!(LOC2)) goto LA3;
LOC2 = ((NU8)(cs0[(NI)(i0 + ((NI) 1))]) == (NU8)(128));
LA3: ;
LOC1 = LOC2;
if (!(LOC1)) goto LA4;
LOC1 = ((NU8)(cs0[(NI)(i0 + ((NI) 2))]) == (NU8)(147));
LA4: ;
result0 = LOC1;
return result0;
}
N_NIMCALL(NI, hashignorestyle_uBstFm5SYVQeOL3j9c9bc58A_2)(NimStringDesc* x0) {
NI result0;
NI h0;
NI i0;
NI xlen0;
result0 = (NI)0;
h0 = ((NI) 0);
i0 = ((NI) 0);
xlen0 = (x0 ? x0->Sup.len : 0);
{
while (1) {
NIM_CHAR c0;
if (!(i0 < xlen0)) goto LA2;
c0 = x0->data[i0];
{
if (!((NU8)(c0) == (NU8)(95))) goto LA5;
i0 += ((NI) 1);
}
goto LA3;
LA5: ;
{
NIM_BOOL LOC8;
LOC8 = (NIM_BOOL)0;
LOC8 = ismagicidentseparatorrune_jEsY0iAEfTnaxdnZAwGvIwidents(x0->data, i0);
if (!LOC8) goto LA9;
i0 += ((NI) 3);
}
goto LA3;
LA9: ;
{
{
if (!(((NU8)(c0)) >= ((NU8)(65)) && ((NU8)(c0)) <= ((NU8)(90)))) goto LA14;
c0 = ((NIM_CHAR) (((NI) ((NI)(((NI) (((NU8)(c0)))) + ((NI) 32))))));
}
LA14: ;
h0 = HEX21HEX26_6dtCP6C39bxOkT4wrIPJwKghashes(h0, ((NI) (((NU8)(c0)))));
i0 += ((NI) 1);
}
LA3: ;
} LA2: ;
}
result0 = HEX21HEX24_zs9byUtT9cNi2e9clB27b2cUAhashes(h0);
return result0;
}
N_NIMCALL(NI, hashignorecase_uBstFm5SYVQeOL3j9c9bc58A_3)(NimStringDesc* x0) {
NI result0;
NI h0;
result0 = (NI)0;
h0 = ((NI) 0);
{
NI i_geCfISAXY7wFUcQDgQbZ9cw;
NI HEX3Atmp_9cPLbhLYuyM42xBxz2jFY8A;
NI res_6i1CeXQb9a5YXrgtqL55qvg;
i_geCfISAXY7wFUcQDgQbZ9cw = (NI)0;
HEX3Atmp_9cPLbhLYuyM42xBxz2jFY8A = (NI)0;
HEX3Atmp_9cPLbhLYuyM42xBxz2jFY8A = (NI)((x0 ? x0->Sup.len : 0) - ((NI) 1));
res_6i1CeXQb9a5YXrgtqL55qvg = ((NI) 0);
{
while (1) {
NIM_CHAR c0;
if (!(res_6i1CeXQb9a5YXrgtqL55qvg <= HEX3Atmp_9cPLbhLYuyM42xBxz2jFY8A)) goto LA3;
i_geCfISAXY7wFUcQDgQbZ9cw = res_6i1CeXQb9a5YXrgtqL55qvg;
c0 = x0->data[i_geCfISAXY7wFUcQDgQbZ9cw];
{
if (!(((NU8)(c0)) >= ((NU8)(65)) && ((NU8)(c0)) <= ((NU8)(90)))) goto LA6;
c0 = ((NIM_CHAR) (((NI) ((NI)(((NI) (((NU8)(c0)))) + ((NI) 32))))));
}
LA6: ;
h0 = HEX21HEX26_6dtCP6C39bxOkT4wrIPJwKghashes(h0, ((NI) (((NU8)(c0)))));
res_6i1CeXQb9a5YXrgtqL55qvg += ((NI) 1);
} LA3: ;
}
}
result0 = HEX21HEX24_zs9byUtT9cNi2e9clB27b2cUAhashes(h0);
return result0;
}
NIM_EXTERNC N_NOINLINE(void, stdlib_hashesInit000)(void) {
}
NIM_EXTERNC N_NOINLINE(void, stdlib_hashesDatInit000)(void) {
}
|