Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/CUDApp/blob/main/src/cudapp_om_cg_pack_h.c # CUDApp CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `CUDApp / src / cudapp_om_cg_pack_h.c` 374 lines · 25136 bytes Raw Blame History 1 #if defined(__GNUC__) 2 #pragma GCC diagnostic push 3 #pragma GCC diagnostic ignored "-Wunused-function" 4 #pragma GCC diagnostic ignored "-Wunused-parameter" 5 #pragma GCC diagnostic ignored "-Wmisleading-indentation" 6 #endif 7 /* Emitted by Omega Bridge. GNU C11, POSIX. Scalars use canonical 64-bit bits. */ 8 #include 9 #include 10 #include 11 #include 12 #include 13 static _Thread_local jmp_buf o_jmp; 14 static _Thread_local int o_busy; 15 static __attribute__((noreturn)) void o_trap(int c){if(o_busy)longjmp(o_jmp,c);_exit(100+c);} 16 static _Thread_local unsigned o_depth; 17 static void o_enter(void){if(++o_depth>128)o_trap(6);} 18 static uint64_t o_leave(uint64_t v){--o_depth;return v;} 19 static unsigned o_width(unsigned t){static const unsigned w[]={0,1,8,16,32,64,8,16,32,64};return w[t];} 20 static __int128 o_value(unsigned t,uint64_t v){return t>=6 && v>>63 ? (__int128)v-(((__int128)1)<<64):(__int128)v;} 21 static uint64_t o_norm(unsigned t,__int128 v,int code){unsigned w=o_width(t);if(t>=6){__int128 m=((__int128)1)<<(w-1);if(v< -m||v>=m)o_trap(code);}else {if(v<0||(__uint128_t)v>=(((__uint128_t)1)<=6&&op<=11){switch(op){case 6:return x==y;case 7:return x!=y;case 8:return xy;default:return x>=y;}} 26 if(op==12)return a&b;if(op==13)return a|b;if(op==14)return a^b; 27 if(op==15||op==16){if(b>=w)o_trap(7);if(op==15)return t>=6?o_norm(t,x*(((__int128)1)<>b;if(!b)return a;return (a>>b)|((a>>63)?(UINT64_MAX<<(64-b)):0);} 28 if(op==17){if(t<6)return (0-a)&mask;return o_norm(t,-x,1);}if(op==18)return t==1?!a:(t>=6?~a:(~a)&mask); 29 if(op==4||op==5){if(!b)o_trap(2);z=op==4?x/y:x%y;return t>=6?o_norm(t,z,1):(uint64_t)z;} 30 if(t<6){if(op==1)return (a+b)&mask;if(op==2)return (a-b)&mask;return (a*b)&mask;} 31 if(op==1)z=x+y;if(op==2)z=x-y;if(op==3)z=x*y;return o_norm(t,z,1); 32 } 33 static uint64_t o_get(const void *p,uint64_t n,uint64_t i,unsigned t){if(i>=n)o_trap(3);unsigned w=t==11?32:t==12?64:o_width(t);const uint8_t *b=(const uint8_t*)p+i*(w/8);uint64_t v=0;if(w==8)v=b[0];else if(w==16){uint16_t x;__builtin_memcpy(&x,b,2);v=x;}else if(w==32){uint32_t x;__builtin_memcpy(&x,b,4);v=x;}else if(w==64)__builtin_memcpy(&v,b,8);if(t>=6&&t<=9&&w<64&&(v>> (w-1)))v|=UINT64_MAX<=n)o_trap(3);unsigned w=t==11?32:t==12?64:o_width(t);if(t<11)o_norm(t,o_value(t,v),5);uint8_t *b=(uint8_t*)p+i*(w/8);if(w==8)b[0]=(uint8_t)v;else if(w==16){uint16_t x=(uint16_t)v;__builtin_memcpy(b,&x,2);}else if(w==32){uint32_t x=(uint32_t)v;__builtin_memcpy(b,&x,4);}else if(w==64)__builtin_memcpy(b,&v,8);} 35 static void o_fill(void *p,uint64_t n,uint64_t v,unsigned t){for(uint64_t i=0;in||len>n-off)o_trap(3);int f=(int)o_value(8,fd);ssize_t r=op==1?read(f,(uint8_t*)p+off,(size_t)len):write(f,(const uint8_t*)p+off,(size_t)len);return r<0?(uint64_t)(-(int64_t)errno):(uint64_t)r;} 37 static int o_valid(unsigned t,uint64_t v){unsigned w=o_width(t);__int128 x=o_value(t,v);__int128 m=((__int128)1)<<(t>=6?w-1:w);return t>=6?x>=-m&&x=0&&xUINTPTR_MAX/z)return 0;if(want&&n>want)return 0;if(!n)return 1;if(!p)return 0;return a%z==0&&a<=UINTPTR_MAX-n*z;} 42 static int o_rover(const void *a,uint64_t an,const void *b,uint64_t bn){return an&&bn&&o_overlap(a,an,b,bn);} 43 #if !defined(__BYTE_ORDER__) || __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ 44 #error seeded C profile requires little-endian storage 45 #endif 46 #include 47 #include 48 #if FLT_RADIX != 2 || FLT_MANT_DIG != 24 || FLT_MAX_EXP != 128 || DBL_MANT_DIG != 53 || DBL_MAX_EXP != 1024 || FLT_EVAL_METHOD != 0 49 #error unsupported binary32 or binary64 environment 50 #endif 51 #if defined(__FAST_MATH__) 52 #error fast math is not a supported Omega environment 53 #endif 54 static int o_fnan(unsigned t,uint64_t a){return t==11?((a>>23&255)==255&&(a&UINT64_C(0x7fffff))!=0):((a>>52&2047)==2047&&(a&UINT64_C(0xfffffffffffff))!=0);} 55 static uint64_t o_fpn(unsigned t,uint64_t a,uint64_t b,uint64_t r){uint64_t q=t==11?UINT64_C(0x400000):UINT64_C(0x8000000000000);if(!o_fnan(t,r))return r;if(o_fnan(t,a)&&!(a&q))return a|q;if(o_fnan(t,b)&&!(b&q))return b|q;if(o_fnan(t,a))return a;if(o_fnan(t,b))return b;return t==11?UINT64_C(0x7fc00000):UINT64_C(0x7ff8000000000000);} 56 static float o_sqrt32(float a){float r; 57 #if defined(__aarch64__) 58 __asm__("fsqrt %s0, %s1":"=w"(r):"w"(a)); 59 #elif defined(__x86_64__) 60 __asm__("sqrtss %1, %0":"=x"(r):"x"(a)); 61 #else 62 #error unsupported seeded float sqrt target 63 #endif 64 return r;} 65 static double o_sqrt64(double a){double r; 66 #if defined(__aarch64__) 67 __asm__("fsqrt %d0, %d1":"=w"(r):"w"(a)); 68 #elif defined(__x86_64__) 69 __asm__("sqrtsd %1, %0":"=x"(r):"x"(a)); 70 #else 71 #error unsupported seeded float sqrt target 72 #endif 73 return r;} 74 static uint64_t o_fp(unsigned op,unsigned t,uint64_t a,uint64_t b){if(t==11){uint32_t ua=(uint32_t)a,ub=(uint32_t)b,ur;float x,y;volatile float z;__builtin_memcpy(&x,&ua,4);__builtin_memcpy(&y,&ub,4);switch(op){case 1:z=x+y;break;case 2:z=x-y;break;case 3:z=x*y;break;case 4:z=x/y;break;case 6:return x==y;case 7:return x!=y;case 8:return xy;case 11:return x>=y;case 17:return ua^UINT32_C(0x80000000);case 19:return ua&UINT32_C(0x7fffffff);case 20:z=o_sqrt32(x);break;default:__builtin_trap();}__builtin_memcpy(&ur,(const void*)&z,4);return o_fpn(11,ua,ub,ur);}uint64_t ur;double x,y;volatile double z;__builtin_memcpy(&x,&a,8);__builtin_memcpy(&y,&b,8);switch(op){case 1:z=x+y;break;case 2:z=x-y;break;case 3:z=x*y;break;case 4:z=x/y;break;case 6:return x==y;case 7:return x!=y;case 8:return xy;case 11:return x>=y;case 17:return a^UINT64_C(0x8000000000000000);case 19:return a&UINT64_C(0x7fffffffffffffff);case 20:z=o_sqrt64(x);break;default:__builtin_trap();}__builtin_memcpy(&ur,(const void*)&z,8);return o_fpn(12,a,b,ur);} 75 static uint64_t o_fcv(unsigned t,unsigned s,uint64_t a){uint32_t u=(uint32_t)a;float f;double x;if(s==t)return a;if(s<11){if(t==11){volatile float z=s>=6?(float)(int64_t)a:(float)a;__builtin_memcpy(&u,(const void*)&z,4);return u;}volatile double z=s>=6?(double)(int64_t)a:(double)a;__builtin_memcpy(&a,(const void*)&z,8);return a;}if(t==12){if(o_fnan(11,a))return (uint64_t)(u>>31)<<63|UINT64_C(0x7ff8000000000000)|(uint64_t)(u&UINT32_C(0x7fffff))<<29;__builtin_memcpy(&f,&u,4);volatile double z=f;__builtin_memcpy(&a,(const void*)&z,8);return a;}if(t==11){if(o_fnan(12,a))return (a>>63)<<31|UINT64_C(0x7fc00000)|(a>>29&UINT64_C(0x3fffff));__builtin_memcpy(&x,&a,8);volatile float z=(float)x;__builtin_memcpy(&u,(const void*)&z,4);return u;}if(s==11){__builtin_memcpy(&f,&u,4);x=f;}else __builtin_memcpy(&x,&a,8);if(x!=x)return 0;unsigned w=o_width(t);if(t>=6){double m=(double)((uint64_t)1<<(w-1));if(x>=m)return ((uint64_t)1<<(w-1))-1;if(x<-m)return (uint64_t)0-((uint64_t)1<<(w-1));return (uint64_t)(int64_t)x;}if(x<1.0)return 0;if(x>=(w==64?`18446744073709551616`.0:(double)((uint64_t)1< 77 static uint64_t o_arg32(float v){uint32_t b;memcpy(&b,&v,4);return b;} 78 static uint64_t o_arg64(double v){uint64_t b;memcpy(&b,&v,8);return b;} 79 static uint64_t f0(const void *v0, uint64_t v0_n, uint64_t v1, uint64_t v2); 80 static uint64_t f1(uint64_t v0); 81 static uint64_t f2(uint64_t v0); 82 static uint64_t f3(void *v0, uint64_t v0_n, uint64_t v1); 83 static uint64_t f4(uint64_t v0, uint64_t v1); 84 static uint64_t f5(const void *v0, uint64_t v0_n, const void *v1, uint64_t v1_n, void *v2, uint64_t v2_n); 85 static uint64_t f6(const void *v0, uint64_t v0_n, uint64_t v1, uint64_t v2, uint64_t v3); 86 static uint64_t f7(const void *v0, uint64_t v0_n, uint64_t v1, uint64_t v2); 87 static uint64_t f8(const void *v0, uint64_t v0_n, const void *v1, uint64_t v1_n, void *v2, uint64_t v2_n, uint64_t v3); 88 static uint64_t f9(const void *v0, uint64_t v0_n, const void *v1, uint64_t v1_n, void *v2, uint64_t v2_n, uint64_t v3); 89 static uint64_t f10(const void *v0, uint64_t v0_n, const void *v1, uint64_t v1_n, void *v2, uint64_t v2_n); 90 static uint64_t f11(void *v0, uint64_t v0_n, uint64_t v1, uint64_t v2); 91 static uint64_t f12(const void *v0, uint64_t v0_n, const void *v1, uint64_t v1_n, void *v2, uint64_t v2_n); 92 static uint64_t f13(uint64_t v0, uint64_t v1); 93 static uint64_t f14(const void *v0, uint64_t v0_n, uint64_t v1, uint64_t v2); 94 static uint64_t f15(const void *v0, uint64_t v0_n, const void *v1, uint64_t v1_n, void *v2, uint64_t v2_n); 95 static uint64_t f16(const void *v0, uint64_t v0_n, const void *v1, uint64_t v1_n, void *v2, uint64_t v2_n, uint64_t v3); 96 static uint64_t f17(const void *v0, uint64_t v0_n, const void *v1, uint64_t v1_n, void *v2, uint64_t v2_n); 97 static uint64_t f18(const void *v0, uint64_t v0_n, const void *v1, uint64_t v1_n, void *v2, uint64_t v2_n); 98 static uint64_t f0(const void *v0, uint64_t v0_n, uint64_t v1, uint64_t v2){ 99 o_enter(); 100 uint64_t __attribute__((unused)) v3=({uint64_t _a=o_cast(5, 2, o_get(v0, v0_n, v1, 2));uint64_t _b=({uint64_t _a=o_cast(5, 2, o_get(v0, v0_n, ({uint64_t _a=v1;uint64_t _b=1ULL;o_op(1, 5, _a,_b);}), 2));uint64_t _b=8ULL;o_op(15, 5, _a,_b);});o_op(13, 5, _a,_b);}); 101 if(({uint64_t _a=v2;uint64_t _b=2ULL;o_op(6, 5, _a,_b);})){ 102 return o_leave(v3); 103 } 104 v3=({uint64_t _a=v3;uint64_t _b=({uint64_t _a=o_cast(5, 2, o_get(v0, v0_n, ({uint64_t _a=v1;uint64_t _b=2ULL;o_op(1, 5, _a,_b);}), 2));uint64_t _b=16ULL;o_op(15, 5, _a,_b);});o_op(13, 5, _a,_b);}); 105 v3=({uint64_t _a=v3;uint64_t _b=({uint64_t _a=o_cast(5, 2, o_get(v0, v0_n, ({uint64_t _a=v1;uint64_t _b=3ULL;o_op(1, 5, _a,_b);}), 2));uint64_t _b=24ULL;o_op(15, 5, _a,_b);});o_op(13, 5, _a,_b);}); 106 if(({uint64_t _a=({uint64_t _a=({uint64_t _a=v3;uint64_t _b=2139095040ULL;o_op(12, 5, _a,_b);});uint64_t _b=2139095040ULL;o_op(6, 5, _a,_b);});uint64_t _b=({uint64_t _a=({uint64_t _a=v3;uint64_t _b=8388607ULL;o_op(12, 5, _a,_b);});uint64_t _b=0ULL;o_op(7, 5, _a,_b);});o_op(12, 1, _a,_b);})){ 107 return o_leave(({uint64_t _a=({uint64_t _a=v3;uint64_t _b=16ULL;o_op(16, 5, _a,_b);});uint64_t _b=64ULL;o_op(13, 5, _a,_b);})); 108 } 109 return o_leave(({uint64_t _a=({uint64_t _a=({uint64_t _a=({uint64_t _a=({uint64_t _a=v3;uint64_t _b=32767ULL;o_op(1, 5, _a,_b);});uint64_t _b=({uint64_t _a=({uint64_t _a=v3;uint64_t _b=16ULL;o_op(16, 5, _a,_b);});uint64_t _b=1ULL;o_op(12, 5, _a,_b);});o_op(1, 5, _a,_b);});uint64_t _b=4294967295ULL;o_op(12, 5, _a,_b);});uint64_t _b=16ULL;o_op(16, 5, _a,_b);});uint64_t _b=65535ULL;o_op(12, 5, _a,_b);})); 110 } 111 static uint64_t f1(uint64_t v0){ 112 o_enter(); 113 return o_leave(({uint64_t _a=({uint64_t _a=({uint64_t _a=({uint64_t _a=({uint64_t _a=v0;uint64_t _b=7ULL;o_op(12, 5, _a,_b);});uint64_t _b=1ULL;o_op(16, 5, _a,_b);});uint64_t _b=8ULL;o_op(3, 5, _a,_b);});uint64_t _b=({uint64_t _a=({uint64_t _a=v0;uint64_t _b=3ULL;o_op(16, 5, _a,_b);});uint64_t _b=4ULL;o_op(3, 5, _a,_b);});o_op(1, 5, _a,_b);});uint64_t _b=({uint64_t _a=v0;uint64_t _b=1ULL;o_op(12, 5, _a,_b);});o_op(1, 5, _a,_b);})); 114 } 115 static uint64_t f2(uint64_t v0){ 116 o_enter(); 117 return o_leave(({uint64_t _a=({uint64_t _a=({uint64_t _a=v0;uint64_t _b=7ULL;o_op(12, 5, _a,_b);});uint64_t _b=32ULL;o_op(3, 5, _a,_b);});uint64_t _b=({uint64_t _a=({uint64_t _a=v0;uint64_t _b=3ULL;o_op(16, 5, _a,_b);});uint64_t _b=2ULL;o_op(3, 5, _a,_b);});o_op(1, 5, _a,_b);})); 118 } 119 static uint64_t f3(void *v0, uint64_t v0_n, uint64_t v1){ 120 o_enter(); 121 { 122 uint64_t v2=0; 123 uint64_t k1=({uint64_t _a=({uint64_t _a=v1;uint64_t _b=65536ULL;o_op(4, 5, _a,_b);});uint64_t _b=1ULL;o_op(1, 5, _a,_b);}); 124 uint64_t c1=0; 125 for(;o_op(8,5, v2, k1);v2=o_op(1,5, v2,1)){ 126 if(c1++>=`1000000`)o_trap(4); 127 { 128 uint64_t v3=0; 129 uint64_t k2=65536ULL; 130 for(;o_op(8,5, v3, k2);v3=o_op(1,5, v3,1)){ 131 uint64_t __attribute__((unused)) v4=({uint64_t _a=({uint64_t _a=v2;uint64_t _b=65536ULL;o_op(3, 5, _a,_b);});uint64_t _b=v3;o_op(1, 5, _a,_b);}); 132 if(({uint64_t _a=v4;uint64_t _b=v1;o_op(11, 5, _a,_b);})){ 133 return o_leave(0); 134 } 135 {uint64_t _i=v4;uint64_t _v=0ULL;o_put(v0, v0_n, _i,_v,3);} 136 } 137 } 138 } 139 } 140 return o_leave(0); 141 } 142 static uint64_t f4(uint64_t v0, uint64_t v1){ 143 o_enter(); 144 uint64_t __attribute__((unused)) v2=({uint64_t _a=v0;uint64_t _b=v1;o_op(2, 5, _a,_b);}); 145 if(({uint64_t _a=v2;uint64_t _b=16ULL;o_op(8, 5, _a,_b);})){ 146 return o_leave(v2); 147 } 148 return o_leave(16ULL); 149 } 150 static uint64_t f5(const void *v0, uint64_t v0_n, const void *v1, uint64_t v1_n, void *v2, uint64_t v2_n){ 151 o_enter(); 152 uint64_t __attribute__((unused)) v3=2ULL; 153 if(({uint64_t _a=o_get(v0, v0_n, 3ULL, 5);uint64_t _b=3ULL;o_op(11, 5, _a,_b);})){ 154 v3=4ULL; 155 } 156 { 157 uint64_t v4=0; 158 uint64_t k1=o_get(v0, v0_n, 2ULL, 5); 159 uint64_t c1=0; 160 for(;o_op(8,5, v4, k1);v4=o_op(1,5, v4,1)){ 161 if(c1++>=`1000000`)o_trap(4); 162 uint64_t __attribute__((unused)) v5=({uint64_t p1=({uint64_t _a=({uint64_t _a=o_get(v0, v0_n, 1ULL, 5);uint64_t _b=v4;o_op(1, 5, _a,_b);});uint64_t _b=v3;o_op(3, 5, _a,_b);});uint64_t p2=v3;f0(v1, v1_n, p1, p2);}); 163 {uint64_t _i=({uint64_t _a=o_get(v0, v0_n, 0ULL, 5);uint64_t _b=({uint64_t p0=v4;f1(p0);});o_op(1, 5, _a,_b);});uint64_t _v=o_cast(3, 5, v5);o_put(v2, v2_n, _i,_v,3);} 164 } 165 } 166 return o_leave(0); 167 } 168 static uint64_t f6(const void *v0, uint64_t v0_n, uint64_t v1, uint64_t v2, uint64_t v3){ 169 o_enter(); 170 uint64_t __attribute__((unused)) v4=({uint64_t _a=({uint64_t _a=v1;uint64_t _b=16ULL;o_op(3, 5, _a,_b);});uint64_t _b=v2;o_op(1, 5, _a,_b);}); 171 return o_leave(({uint64_t _a=({uint64_t _a=v4;uint64_t _b=o_get(v0, v0_n, 2ULL, 5);o_op(3, 5, _a,_b);});uint64_t _b=({uint64_t _a=v3;uint64_t _b=16ULL;o_op(3, 5, _a,_b);});o_op(1, 5, _a,_b);})); 172 } 173 static uint64_t f7(const void *v0, uint64_t v0_n, uint64_t v1, uint64_t v2){ 174 o_enter(); 175 return o_leave(({uint64_t _a=({uint64_t _a=({uint64_t _a=v1;uint64_t _b=({uint64_t _a=o_get(v0, v0_n, 4ULL, 5);uint64_t _b=16ULL;o_op(4, 5, _a,_b);});o_op(3, 5, _a,_b);});uint64_t _b=v2;o_op(1, 5, _a,_b);});uint64_t _b=256ULL;o_op(3, 5, _a,_b);})); 176 } 177 static uint64_t f8(const void *v0, uint64_t v0_n, const void *v1, uint64_t v1_n, void *v2, uint64_t v2_n, uint64_t v3){ 178 o_enter(); 179 uint64_t v4[4]={0}; 180 uint64_t v4_n=4; 181 o_fill(v4, v4_n, 0ULL, 5); 182 uint64_t __attribute__((unused)) v5=({uint64_t _a=v3;uint64_t _b=268435455ULL;o_op(12, 5, _a,_b);}); 183 uint64_t __attribute__((unused)) v6=({uint64_t _a=({uint64_t _a=v3;uint64_t _b=28ULL;o_op(16, 5, _a,_b);});uint64_t _b=268435455ULL;o_op(12, 5, _a,_b);}); 184 uint64_t __attribute__((unused)) v7=({uint64_t _a=v3;uint64_t _b=56ULL;o_op(16, 5, _a,_b);}); 185 uint64_t __attribute__((unused)) v8=({uint64_t p1=v5;uint64_t p2=v6;f7(v0, v0_n, p1, p2);}); 186 v8=({uint64_t _a=v8;uint64_t _b=({uint64_t p0=v7;f2(p0);});o_op(1, 5, _a,_b);}); 187 uint64_t __attribute__((unused)) v9=({uint64_t p0=o_get(v0, v0_n, 2ULL, 5);uint64_t p1=({uint64_t _a=v6;uint64_t _b=16ULL;o_op(3, 5, _a,_b);});f4(p0, p1);}); 188 {uint64_t _i=0ULL;uint64_t _v=v8;o_put(v4, v4_n, _i,_v,5);} 189 {uint64_t _i=1ULL;uint64_t _v=({uint64_t p1=v5;uint64_t p2=v7;uint64_t p3=v6;f6(v0, v0_n, p1, p2, p3);});o_put(v4, v4_n, _i,_v,5);} 190 {uint64_t _i=2ULL;uint64_t _v=v9;o_put(v4, v4_n, _i,_v,5);} 191 {uint64_t _i=3ULL;uint64_t _v=o_get(v0, v0_n, 0ULL, 5);o_put(v4, v4_n, _i,_v,5);} 192 ({f5(v4, v4_n, v1, v1_n, v2, v2_n);}); 193 return o_leave(0); 194 } 195 static uint64_t f9(const void *v0, uint64_t v0_n, const void *v1, uint64_t v1_n, void *v2, uint64_t v2_n, uint64_t v3){ 196 o_enter(); 197 { 198 uint64_t v4=0; 199 uint64_t k1=({uint64_t p0=o_get(v0, v0_n, 1ULL, 5);uint64_t p1=({uint64_t _a=({uint64_t _a=v3;uint64_t _b=268435455ULL;o_op(12, 5, _a,_b);});uint64_t _b=16ULL;o_op(3, 5, _a,_b);});f4(p0, p1);}); 200 uint64_t c1=0; 201 for(;o_op(8,5, v4, k1);v4=o_op(1,5, v4,1)){ 202 if(c1++>=`1000000`)o_trap(4); 203 ({uint64_t p3=({uint64_t _a=v3;uint64_t _b=({uint64_t _a=v4;uint64_t _b=56ULL;o_op(15, 5, _a,_b);});o_op(13, 5, _a,_b);});f8(v0, v0_n, v1, v1_n, v2, v2_n, p3);}); 204 } 205 } 206 return o_leave(0); 207 } 208 static uint64_t f10(const void *v0, uint64_t v0_n, const void *v1, uint64_t v1_n, void *v2, uint64_t v2_n){ 209 o_enter(); 210 ({uint64_t p1=o_get(v0, v0_n, 9ULL, 5);f3(v2, v2_n, p1);}); 211 uint64_t __attribute__((unused)) v3=({uint64_t _a=({uint64_t _a=o_get(v0, v0_n, 1ULL, 5);uint64_t _b=15ULL;o_op(1, 5, _a,_b);});uint64_t _b=16ULL;o_op(4, 5, _a,_b);}); 212 uint64_t __attribute__((unused)) v4=({uint64_t _a=({uint64_t _a=o_get(v0, v0_n, 2ULL, 5);uint64_t _b=15ULL;o_op(1, 5, _a,_b);});uint64_t _b=16ULL;o_op(4, 5, _a,_b);}); 213 { 214 uint64_t v5=0; 215 uint64_t c1=0; 216 for(;o_op(8,5, v5, v3);v5=o_op(1,5, v5,1)){ 217 if(c1++>=`1000000`)o_trap(4); 218 { 219 uint64_t v6=0; 220 uint64_t c2=0; 221 for(;o_op(8,5, v6, v4);v6=o_op(1,5, v6,1)){ 222 if(c2++>=`1000000`)o_trap(4); 223 ({uint64_t p3=({uint64_t _a=v5;uint64_t _b=({uint64_t _a=v6;uint64_t _b=28ULL;o_op(15, 5, _a,_b);});o_op(13, 5, _a,_b);});f9(v0, v0_n, v1, v1_n, v2, v2_n, p3);}); 224 } 225 } 226 } 227 } 228 return o_leave(0ULL); 229 } 230 static uint64_t f11(void *v0, uint64_t v0_n, uint64_t v1, uint64_t v2){ 231 o_enter(); 232 { 233 uint64_t v3=0; 234 uint64_t k1=16ULL; 235 for(;o_op(8,5, v3, k1);v3=o_op(1,5, v3,1)){ 236 if(({uint64_t _a=v3;uint64_t _b=v2;o_op(11, 5, _a,_b);})){ 237 {uint64_t _i=({uint64_t _a=v1;uint64_t _b=({uint64_t p0=v3;f1(p0);});o_op(1, 5, _a,_b);});uint64_t _v=0ULL;o_put(v0, v0_n, _i,_v,3);} 238 } 239 } 240 } 241 return o_leave(0); 242 } 243 static uint64_t f12(const void *v0, uint64_t v0_n, const void *v1, uint64_t v1_n, void *v2, uint64_t v2_n){ 244 o_enter(); 245 uint64_t v3[4]={0}; 246 uint64_t v3_n=4; 247 o_fill(v3, v3_n, 0ULL, 5); 248 { 249 uint64_t v4=0; 250 uint64_t k1=({uint64_t _a=o_get(v0, v0_n, 4ULL, 5);uint64_t _b=16ULL;o_op(4, 5, _a,_b);}); 251 uint64_t c1=0; 252 for(;o_op(8,5, v4, k1);v4=o_op(1,5, v4,1)){ 253 if(c1++>=`1000000`)o_trap(4); 254 uint64_t __attribute__((unused)) v5=({uint64_t _a=v4;uint64_t _b=16ULL;o_op(3, 5, _a,_b);}); 255 uint64_t __attribute__((unused)) v6=0ULL; 256 if(({uint64_t _a=v5;uint64_t _b=o_get(v0, v0_n, 2ULL, 5);o_op(8, 5, _a,_b);})){ 257 v6=({uint64_t p0=o_get(v0, v0_n, 2ULL, 5);uint64_t p1=v5;f4(p0, p1);}); 258 } 259 uint64_t __attribute__((unused)) v7=({uint64_t _a=v4;uint64_t _b=256ULL;o_op(3, 5, _a,_b);}); 260 {uint64_t _i=0ULL;uint64_t _v=v7;o_put(v3, v3_n, _i,_v,5);} 261 {uint64_t _i=1ULL;uint64_t _v=v5;o_put(v3, v3_n, _i,_v,5);} 262 {uint64_t _i=2ULL;uint64_t _v=v6;o_put(v3, v3_n, _i,_v,5);} 263 {uint64_t _i=3ULL;uint64_t _v=o_get(v0, v0_n, 0ULL, 5);o_put(v3, v3_n, _i,_v,5);} 264 ({f5(v3, v3_n, v1, v1_n, v2, v2_n);}); 265 ({uint64_t p1=v7;uint64_t p2=v6;f11(v2, v2_n, p1, p2);}); 266 } 267 } 268 return o_leave(0ULL); 269 } 270 static uint64_t f13(uint64_t v0, uint64_t v1){ 271 o_enter(); 272 uint64_t __attribute__((unused)) v2=0ULL; 273 { 274 uint64_t v3=0; 275 uint64_t k1=8ULL; 276 for(;o_op(8,5, v3, k1);v3=o_op(1,5, v3,1)){ 277 if(({uint64_t _a=({uint64_t _a=({uint64_t _a=v0;uint64_t _b=v3;o_op(1, 5, _a,_b);});uint64_t _b=4294967295ULL;o_op(12, 5, _a,_b);});uint64_t _b=v1;o_op(8, 5, _a,_b);})){ 278 v2=({uint64_t _a=v2;uint64_t _b=({uint64_t _a=1ULL;uint64_t _b=v3;o_op(15, 5, _a,_b);});o_op(13, 5, _a,_b);}); 279 } 280 } 281 } 282 return o_leave(v2); 283 } 284 static uint64_t f14(const void *v0, uint64_t v0_n, uint64_t v1, uint64_t v2){ 285 o_enter(); 286 uint64_t __attribute__((unused)) v3=({uint64_t _a=v1;uint64_t _b=15ULL;o_op(12, 5, _a,_b);}); 287 uint64_t __attribute__((unused)) v4=({uint64_t _a=({uint64_t _a=({uint64_t _a=v2;uint64_t _b=({uint64_t _a=o_get(v0, v0_n, 4ULL, 5);uint64_t _b=16ULL;o_op(4, 5, _a,_b);});o_op(3, 5, _a,_b);});uint64_t _b=({uint64_t _a=v1;uint64_t _b=4ULL;o_op(16, 5, _a,_b);});o_op(1, 5, _a,_b);});uint64_t _b=128ULL;o_op(3, 5, _a,_b);}); 288 v4=({uint64_t _a=v4;uint64_t _b=({uint64_t _a=({uint64_t _a=({uint64_t _a=v3;uint64_t _b=3ULL;o_op(16, 5, _a,_b);});uint64_t _b=2ULL;o_op(3, 5, _a,_b);});uint64_t _b=({uint64_t _a=v3;uint64_t _b=1ULL;o_op(12, 5, _a,_b);});o_op(1, 5, _a,_b);});o_op(1, 5, _a,_b);}); 289 return o_leave(({uint64_t _a=v4;uint64_t _b=({uint64_t _a=({uint64_t _a=({uint64_t _a=v3;uint64_t _b=7ULL;o_op(12, 5, _a,_b);});uint64_t _b=1ULL;o_op(16, 5, _a,_b);});uint64_t _b=4ULL;o_op(3, 5, _a,_b);});o_op(1, 5, _a,_b);})); 290 } 291 static uint64_t f15(const void *v0, uint64_t v0_n, const void *v1, uint64_t v1_n, void *v2, uint64_t v2_n){ 292 o_enter(); 293 { 294 uint64_t v3=0; 295 uint64_t k1=8ULL; 296 for(;o_op(8,5, v3, k1);v3=o_op(1,5, v3,1)){ 297 if(({uint64_t _a=({uint64_t _a=({uint64_t _a=o_get(v0, v0_n, 1ULL, 5);uint64_t _b=v3;o_op(16, 5, _a,_b);});uint64_t _b=1ULL;o_op(12, 5, _a,_b);});uint64_t _b=0ULL;o_op(7, 5, _a,_b);})){ 298 uint64_t __attribute__((unused)) v4=({uint64_t p1=({uint64_t _a=({uint64_t _a=o_get(v0, v0_n, 2ULL, 5);uint64_t _b=v3;o_op(1, 5, _a,_b);});uint64_t _b=2ULL;o_op(3, 5, _a,_b);});uint64_t p2=2ULL;f0(v1, v1_n, p1, p2);}); 299 {uint64_t _i=({uint64_t _a=o_get(v0, v0_n, 0ULL, 5);uint64_t _b=({uint64_t _a=v3;uint64_t _b=16ULL;o_op(3, 5, _a,_b);});o_op(1, 5, _a,_b);});uint64_t _v=o_cast(3, 5, v4);o_put(v2, v2_n, _i,_v,3);} 300 } 301 } 302 } 303 return o_leave(0); 304 } 305 static uint64_t f16(const void *v0, uint64_t v0_n, const void *v1, uint64_t v1_n, void *v2, uint64_t v2_n, uint64_t v3){ 306 o_enter(); 307 uint64_t v4[3]={0}; 308 uint64_t v4_n=3; 309 o_fill(v4, v4_n, 0ULL, 5); 310 uint64_t __attribute__((unused)) v5=({uint64_t _a=v3;uint64_t _b=4294967295ULL;o_op(12, 5, _a,_b);}); 311 uint64_t __attribute__((unused)) v6=({uint64_t _a=v3;uint64_t _b=32ULL;o_op(16, 5, _a,_b);}); 312 uint64_t __attribute__((unused)) v7=({uint64_t _a=({uint64_t _a=({uint64_t _a=o_get(v0, v0_n, 6ULL, 5);uint64_t _b=v6;o_op(1, 5, _a,_b);});uint64_t _b=8ULL;o_op(3, 5, _a,_b);});uint64_t _b=4294967295ULL;o_op(12, 5, _a,_b);}); 313 {uint64_t _i=0ULL;uint64_t _v=({uint64_t p1=v5;uint64_t p2=v6;f14(v0, v0_n, p1, p2);});o_put(v4, v4_n, _i,_v,5);} 314 {uint64_t _i=1ULL;uint64_t _v=({uint64_t p0=v7;uint64_t p1=o_get(v0, v0_n, 5ULL, 5);f13(p0, p1);});o_put(v4, v4_n, _i,_v,5);} 315 {uint64_t _i=2ULL;uint64_t _v=({uint64_t _a=({uint64_t _a=v5;uint64_t _b=o_get(v0, v0_n, 5ULL, 5);o_op(3, 5, _a,_b);});uint64_t _b=v7;o_op(1, 5, _a,_b);});o_put(v4, v4_n, _i,_v,5);} 316 ({f15(v4, v4_n, v1, v1_n, v2, v2_n);}); 317 return o_leave(0); 318 } 319 static uint64_t f17(const void *v0, uint64_t v0_n, const void *v1, uint64_t v1_n, void *v2, uint64_t v2_n){ 320 o_enter(); 321 uint64_t __attribute__((unused)) v3=({uint64_t _a=o_get(v0, v0_n, 7ULL, 5);uint64_t _b=o_get(v0, v0_n, 6ULL, 5);o_op(2, 5, _a,_b);}); 322 ({uint64_t p1=o_get(v0, v0_n, 9ULL, 5);f3(v2, v2_n, p1);}); 323 { 324 uint64_t v4=0; 325 uint64_t k1=o_get(v0, v0_n, 2ULL, 5); 326 uint64_t c1=0; 327 for(;o_op(8,5, v4, k1);v4=o_op(1,5, v4,1)){ 328 if(c1++>=`1000000`)o_trap(4); 329 { 330 uint64_t v5=0; 331 uint64_t c2=0; 332 for(;o_op(8,5, v5, v3);v5=o_op(1,5, v5,1)){ 333 if(c2++>=`1000000`)o_trap(4); 334 ({uint64_t p3=({uint64_t _a=v4;uint64_t _b=({uint64_t _a=v5;uint64_t _b=32ULL;o_op(15, 5, _a,_b);});o_op(13, 5, _a,_b);});f16(v0, v0_n, v1, v1_n, v2, v2_n, p3);}); 335 } 336 } 337 } 338 } 339 return o_leave(0ULL); 340 } 341 static uint64_t f18(const void *v0, uint64_t v0_n, const void *v1, uint64_t v1_n, void *v2, uint64_t v2_n){ 342 o_enter(); 343 if(({uint64_t _a=({uint64_t _a=v1_n;uint64_t _b=o_get(v0, v0_n, 8ULL, 5);o_op(8, 5, _a,_b);});uint64_t _b=({uint64_t _a=v2_n;uint64_t _b=o_get(v0, v0_n, 9ULL, 5);o_op(8, 5, _a,_b);});o_op(13, 1, _a,_b);})){ 344 return o_leave(18446744073709551615ULL); 345 } 346 uint64_t __attribute__((unused)) v3=o_get(v0, v0_n, 0ULL, 5); 347 if(({uint64_t _a=({uint64_t _a=v3;uint64_t _b=0ULL;o_op(6, 5, _a,_b);});uint64_t _b=({uint64_t _a=v3;uint64_t _b=3ULL;o_op(6, 5, _a,_b);});o_op(13, 1, _a,_b);})){ 348 return o_leave(({f10(v0, v0_n, v1, v1_n, v2, v2_n);})); 349 } 350 if(({uint64_t _a=({uint64_t _a=v3;uint64_t _b=1ULL;o_op(6, 5, _a,_b);});uint64_t _b=({uint64_t _a=v3;uint64_t _b=4ULL;o_op(6, 5, _a,_b);});o_op(13, 1, _a,_b);})){ 351 return o_leave(({f12(v0, v0_n, v1, v1_n, v2, v2_n);})); 352 } 353 if(({uint64_t _a=v3;uint64_t _b=2ULL;o_op(6, 5, _a,_b);})){ 354 return o_leave(({f17(v0, v0_n, v1, v1_n, v2, v2_n);})); 355 } 356 return o_leave(18446744073709551615ULL); 357 } 358 uint32_t omega_cg_pkh(uint64_t *result, const void *p0, volatile uint64_t p0_n, const void *p1, volatile uint64_t p1_n, void *p2, volatile uint64_t p2_n){ 359 if(!o_buf(result,1,1,5))return 32; 360 if(!o_rbuf(p0, p0_n,12, 5))return 32; 361 if(o_rover(result,8,p0, p0_n*8))return 32; 362 if(!o_rbuf(p1, p1_n,0, 2))return 32; 363 if(o_rover(result,8,p1, p1_n*1))return 32; 364 if(!o_rbuf(p2, p2_n,0, 3))return 32; 365 if(o_rover(result,8,p2, p2_n*2))return 32; 366 if(o_rover(p2, p2_n*2, p0, p0_n*8))return 32; 367 if(o_rover(p2, p2_n*2, p1, p1_n*1))return 32; 368 if(o_busy)return 33; 369 o_busy=1;o_depth=0;int code=setjmp(o_jmp);if(!code){uint64_t _result=f18(p0, p0_n, p1, p1_n, p2, p2_n);o_put(result,1,0,_result,5);} 370 o_busy=0;return (uint32_t)code; 371 } 372 #if defined(__GNUC__) 373 #pragma GCC diagnostic pop 374 #endif