interplane.Get Omega
Read in your language

omega-bridge

Omega-first language interoperability: checked conversion backends and native language bindings

Brought by drakestapleton

branch main Branches Tags History

omega-bridge / tests / cabi / golden / libombrfx.c

677 lines · 37929 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 <stdint.h>
9#include <stddef.h>
10#include <unistd.h>
11#include <errno.h>
12#include <setjmp.h>
13static _Thread_local jmp_buf o_jmp;
14static _Thread_local int o_busy;
15static __attribute__((noreturn)) void o_trap(int c){if(o_busy)longjmp(o_jmp,c);_exit(100+c);}
16static _Thread_local unsigned o_depth;
17static void o_enter(void){if(++o_depth>128)o_trap(6);}
18static uint64_t o_leave(uint64_t v){--o_depth;return v;}
19static unsigned o_width(unsigned t){static const unsigned w[]={0,1,8,16,32,64,8,16,32,64};return w[t];}
20static __int128 o_value(unsigned t,uint64_t v){return t>=6 && v>>63 ? (__int128)v-(((__int128)1)<<64):(__int128)v;}
21static 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)<<w))o_trap(code);}return (uint64_t)v;}
22static uint64_t o_cast(unsigned t,unsigned s,uint64_t a){return o_norm(t,o_value(s,a),5);}
23static uint64_t o_op(unsigned op,unsigned t,uint64_t a,uint64_t b){
24 __int128 x=o_value(t,a),y=o_value(t,b),z=0;unsigned w=o_width(t);uint64_t mask=w==64?UINT64_MAX:(((uint64_t)1<<w)-1);
25 if(op>=6&&op<=11){switch(op){case 6:return x==y;case 7:return x!=y;case 8:return x<y;case 9:return x<=y;case 10:return x>y;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),1):(a<<b)&mask;if(t<6)return a>>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}
33static 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<<w;return v;}
34static void o_put(void *p,uint64_t n,uint64_t i,uint64_t v,unsigned t){if(i>=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);}
35static void o_fill(void *p,uint64_t n,uint64_t v,unsigned t){for(uint64_t i=0;i<n;i++)o_put(p,n,i,v,t);}
36static uint64_t o_io(unsigned op,uint64_t fd,const void *p,uint64_t n,uint64_t off,uint64_t len){if(off>n||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;}
37static 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<m:x>=0&&x<m;}
38static int o_buf(const void *p,uint64_t n,uint64_t want,unsigned t){uintptr_t a=(uintptr_t)p;uint64_t z=t==11?4:t==12?8:o_width(t)/8;return p&&n==want&&a%z==0&&n<=UINTPTR_MAX/z&&a<=UINTPTR_MAX-n*z;}
39static int o_overlap(const void *a,uint64_t an,const void *b,uint64_t bn){uintptr_t x=(uintptr_t)a,y=(uintptr_t)b;return x<y+bn&&y<x+an;}
40#if !defined(__BYTE_ORDER__) || __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
41#error seeded C profile requires little-endian storage
42#endif
43#include <float.h>
44#include <fenv.h>
45#if FLT_RADIX != 2 || FLT_MANT_DIG != 24 || FLT_MAX_EXP != 128 || DBL_MANT_DIG != 53 || DBL_MAX_EXP != 1024 || FLT_EVAL_METHOD != 0
46#error unsupported binary32 or binary64 environment
47#endif
48#if defined(__FAST_MATH__)
49#error fast math is not a supported Omega environment
50#endif
51static 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);}
52static 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);}
53static float o_sqrt32(float a){float r;
54#if defined(__aarch64__)
55__asm__("fsqrt %s0, %s1":"=w"(r):"w"(a));
56#elif defined(__x86_64__)
57__asm__("sqrtss %1, %0":"=x"(r):"x"(a));
58#else
59#error unsupported seeded float sqrt target
60#endif
61return r;}
62static double o_sqrt64(double a){double r;
63#if defined(__aarch64__)
64__asm__("fsqrt %d0, %d1":"=w"(r):"w"(a));
65#elif defined(__x86_64__)
66__asm__("sqrtsd %1, %0":"=x"(r):"x"(a));
67#else
68#error unsupported seeded float sqrt target
69#endif
70return r;}
71static 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 x<y;case 9:return x<=y;case 10:return x>y;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 x<y;case 9:return x<=y;case 10:return x>y;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);}
72static 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<<w)))return w==64?UINT64_MAX:((uint64_t)1<<w)-1;return (uint64_t)x;}
73#include <string.h>
74static uint64_t o_arg32(float v){uint32_t b;memcpy(&b,&v,4);return b;}
75static uint64_t o_arg64(double v){uint64_t b;memcpy(&b,&v,8);return b;}
76#include <pthread.h>
77static int o_span(uint64_t n,uint64_t o,uint64_t l){return o>n||l>n-o;}
78typedef enum nvmlReturn_enum {
79 NVML_SUCCESS = 0,
80 NVML_ERROR_INVALID_ARGUMENT = 2,
81 NVML_ERROR_INSUFFICIENT_SIZE = 7,
82 NVML_ERROR_UNKNOWN = 999
83} nvmlReturn_t;
84typedef struct nvmlDevice_st *nvmlDevice_t;
85typedef struct nvmlMemory_st {
86 unsigned long long total;
87 unsigned long long free;
88 unsigned long long used;
89} nvmlMemory_t;
90typedef struct nvmlProcessInfo_v2_st {
91 unsigned int pid;
92 unsigned long long usedGpuMemory;
93 unsigned int gpuInstanceId;
94 unsigned int computeInstanceId;
95} nvmlProcessInfo_v2_t, nvmlProcessInfo_t;
96static pthread_mutex_t FxLock=PTHREAD_MUTEX_INITIALIZER;
97static int o_in2(uint64_t v){switch(v){case 0:case 2:case 7:case 999:return 1;default:return 0;}}
98struct nvmlDevice_st{uint64_t o_magic,o_index;};
99static struct nvmlDevice_st FxDevs[4];
100static uint64_t o_hi11(nvmlDevice_t o_d){uintptr_t a=(uintptr_t)o_d,b=(uintptr_t)FxDevs;if(a<b||a-b>=sizeof FxDevs||(a-b)%sizeof FxDevs[0])return UINT64_MAX;uint64_t i=(a-b)/sizeof FxDevs[0];return FxDevs[i].o_magic==UINT64_C(0x4f6d656761484e44)&&FxDevs[i].o_index==i?i:UINT64_MAX;}
101static nvmlDevice_t o_ho11(uint64_t i){FxDevs[i].o_magic=UINT64_C(0x4f6d656761484e44);FxDevs[i].o_index=i;return &FxDevs[i];}
102_Static_assert(sizeof(nvmlMemory_t)==24&&_Alignof(nvmlMemory_t)==8,"record layout");
103_Static_assert(offsetof(nvmlMemory_t,total)==0,"record layout");
104_Static_assert(offsetof(nvmlMemory_t,free)==8,"record layout");
105_Static_assert(offsetof(nvmlMemory_t,used)==16,"record layout");
106_Static_assert(sizeof(nvmlProcessInfo_v2_t)==24&&_Alignof(nvmlProcessInfo_v2_t)==8,"record layout");
107_Static_assert(offsetof(nvmlProcessInfo_v2_t,pid)==0,"record layout");
108_Static_assert(offsetof(nvmlProcessInfo_v2_t,usedGpuMemory)==8,"record layout");
109_Static_assert(offsetof(nvmlProcessInfo_v2_t,gpuInstanceId)==16,"record layout");
110_Static_assert(offsetof(nvmlProcessInfo_v2_t,computeInstanceId)==20,"record layout");
111static uint64_t FxState[8];
112static uint8_t FxBytes[512] __attribute__((aligned(8)));
113static uint8_t FxTexts[128] __attribute__((aligned(8)));
114static uint64_t FxSum[1];
115static uint64_t FxW[3];
116static uint64_t FxV[6];
117static const char o_fb27[]="Unknown Error";
118uint32_t omega_fx_sum(uint64_t*,const void*,uint64_t,uint64_t,void*,uint64_t,const void*,uint64_t,uint64_t);
119static uint64_t f0(void *v0, uint64_t v0_n, const void *v1, uint64_t v1_n, uint64_t v2, void *v3, uint64_t v3_n, const void *v4, uint64_t v4_n, uint64_t v5);
120static uint64_t f1(void *v0, uint64_t v0_n);
121static uint64_t f2(void *v0, uint64_t v0_n, void *v1, uint64_t v1_n);
122static uint64_t f3(void *v0, uint64_t v0_n, void *v1, uint64_t v1_n);
123static uint64_t f4(void *v0, uint64_t v0_n, uint64_t v1);
124static uint64_t f5(void *v0, uint64_t v0_n, void *v1, uint64_t v1_n, void *v2, uint64_t v2_n);
125static uint64_t f6(void *v0, uint64_t v0_n, uint64_t v1, uint64_t v2);
126static uint64_t f7(void *v0, uint64_t v0_n, uint64_t v1, uint64_t v2);
127static uint64_t f8(void *v0, uint64_t v0_n, void *v1, uint64_t v1_n, void *v2, uint64_t v2_n);
128static uint64_t f9(void *v0, uint64_t v0_n, uint64_t v1, uint64_t v2);
129static uint64_t f10(void *v0, uint64_t v0_n, void *v1, uint64_t v1_n, void *v2, uint64_t v2_n);
130static uint64_t f11(void *v0, uint64_t v0_n);
131static uint64_t f12(void *v0, uint64_t v0_n, void *v1, uint64_t v1_n, void *v2, uint64_t v2_n);
132static uint64_t f13(void *v0, uint64_t v0_n, void *v1, uint64_t v1_n);
133static uint64_t f14(void *v0, uint64_t v0_n, void *v1, uint64_t v1_n, void *v2, uint64_t v2_n, void *v3, uint64_t v3_n, void *v4, uint64_t v4_n);
134static uint64_t f0(void *v0, uint64_t v0_n, const void *v1, uint64_t v1_n, uint64_t v2, void *v3, uint64_t v3_n, const void *v4, uint64_t v4_n, uint64_t v5){
135o_enter();
136if(o_span(v1_n,0,v2))o_trap(3);
137if(o_span(v3_n,0,v5))o_trap(3);
138if(o_span(v4_n,3,v5))o_trap(3);
139return o_leave((uint64_t)omega_fx_sum((uint64_t*)v0,(const uint8_t*)v1+0,v2,v2,(uint64_t*)v3+0,v5,(const uint64_t*)v4+3,v5,v5));
140}
141static uint64_t f1(void *v0, uint64_t v0_n){
142o_enter();
143if(({uint64_t _a=o_get(v0, v0_n, 7ULL, 5);uint64_t _b=0ULL;o_op(6, 5, _a,_b);})){
144{uint64_t _i=0ULL;uint64_t _v=2ULL;o_put(v0, v0_n, _i,_v,5);}
145{uint64_t _i=7ULL;uint64_t _v=1ULL;o_put(v0, v0_n, _i,_v,5);}
146}
147return o_leave(0);
148}
149static uint64_t f2(void *v0, uint64_t v0_n, void *v1, uint64_t v1_n){
150o_enter();
151({f1(v1, v1_n);});
152{uint64_t _i=1ULL;uint64_t _v=({uint64_t _a=o_get(v1, v1_n, 1ULL, 5);uint64_t _b=1ULL;o_op(1, 5, _a,_b);});o_put(v1, v1_n, _i,_v,5);}
153if(({uint64_t _a=o_get(v0, v0_n, 2ULL, 5);uint64_t _b=0ULL;o_op(6, 5, _a,_b);})){
154{uint64_t _i=0ULL;uint64_t _v=2ULL;o_put(v0, v0_n, _i,_v,5);}
155return o_leave(0ULL);
156}
157{uint64_t _i=3ULL;uint64_t _v=o_get(v1, v1_n, 0ULL, 5);o_put(v0, v0_n, _i,_v,5);}
158{uint64_t _i=1ULL;uint64_t _v=1ULL;o_put(v0, v0_n, _i,_v,5);}
159{uint64_t _i=0ULL;uint64_t _v=0ULL;o_put(v0, v0_n, _i,_v,5);}
160return o_leave(0ULL);
161}
162static uint64_t f3(void *v0, uint64_t v0_n, void *v1, uint64_t v1_n){
163o_enter();
164({f1(v1, v1_n);});
165if(({uint64_t _a=o_get(v0, v0_n, 3ULL, 5);uint64_t _b=0ULL;o_op(6, 5, _a,_b);})){
166{uint64_t _i=0ULL;uint64_t _v=2ULL;o_put(v0, v0_n, _i,_v,5);}
167return o_leave(0ULL);
168}
169if(({uint64_t _a=o_get(v0, v0_n, 2ULL, 5);uint64_t _b=o_get(v1, v1_n, 0ULL, 5);o_op(11, 5, _a,_b);})){
170{uint64_t _i=0ULL;uint64_t _v=2ULL;o_put(v0, v0_n, _i,_v,5);}
171return o_leave(0ULL);
172}
173{uint64_t _i=4ULL;uint64_t _v=o_get(v0, v0_n, 2ULL, 5);o_put(v0, v0_n, _i,_v,5);}
174{uint64_t _i=1ULL;uint64_t _v=1ULL;o_put(v0, v0_n, _i,_v,5);}
175{uint64_t _i=0ULL;uint64_t _v=0ULL;o_put(v0, v0_n, _i,_v,5);}
176return o_leave(0ULL);
177}
178static uint64_t f4(void *v0, uint64_t v0_n, uint64_t v1){
179o_enter();
180{uint64_t _i=0ULL;uint64_t _v=79ULL;o_put(v0, v0_n, _i,_v,2);}
181{uint64_t _i=1ULL;uint64_t _v=109ULL;o_put(v0, v0_n, _i,_v,2);}
182{uint64_t _i=2ULL;uint64_t _v=101ULL;o_put(v0, v0_n, _i,_v,2);}
183{uint64_t _i=3ULL;uint64_t _v=103ULL;o_put(v0, v0_n, _i,_v,2);}
184{uint64_t _i=4ULL;uint64_t _v=97ULL;o_put(v0, v0_n, _i,_v,2);}
185{uint64_t _i=5ULL;uint64_t _v=32ULL;o_put(v0, v0_n, _i,_v,2);}
186{uint64_t _i=6ULL;uint64_t _v=70ULL;o_put(v0, v0_n, _i,_v,2);}
187{uint64_t _i=7ULL;uint64_t _v=105ULL;o_put(v0, v0_n, _i,_v,2);}
188{uint64_t _i=8ULL;uint64_t _v=120ULL;o_put(v0, v0_n, _i,_v,2);}
189{uint64_t _i=9ULL;uint64_t _v=116ULL;o_put(v0, v0_n, _i,_v,2);}
190{uint64_t _i=10ULL;uint64_t _v=117ULL;o_put(v0, v0_n, _i,_v,2);}
191{uint64_t _i=11ULL;uint64_t _v=114ULL;o_put(v0, v0_n, _i,_v,2);}
192{uint64_t _i=12ULL;uint64_t _v=101ULL;o_put(v0, v0_n, _i,_v,2);}
193{uint64_t _i=13ULL;uint64_t _v=32ULL;o_put(v0, v0_n, _i,_v,2);}
194{uint64_t _i=14ULL;uint64_t _v=71ULL;o_put(v0, v0_n, _i,_v,2);}
195{uint64_t _i=15ULL;uint64_t _v=80ULL;o_put(v0, v0_n, _i,_v,2);}
196{uint64_t _i=16ULL;uint64_t _v=85ULL;o_put(v0, v0_n, _i,_v,2);}
197{uint64_t _i=17ULL;uint64_t _v=32ULL;o_put(v0, v0_n, _i,_v,2);}
198{uint64_t _i=18ULL;uint64_t _v=o_cast(2, 5, ({uint64_t _a=48ULL;uint64_t _b=v1;o_op(1, 5, _a,_b);}));o_put(v0, v0_n, _i,_v,2);}
199{uint64_t _i=19ULL;uint64_t _v=0ULL;o_put(v0, v0_n, _i,_v,2);}
200return o_leave(20ULL);
201}
202static uint64_t f5(void *v0, uint64_t v0_n, void *v1, uint64_t v1_n, void *v2, uint64_t v2_n){
203o_enter();
204({f1(v1, v1_n);});
205if(({uint64_t _a=o_get(v0, v0_n, 2ULL, 5);uint64_t _b=o_get(v1, v1_n, 0ULL, 5);o_op(11, 5, _a,_b);})){
206{uint64_t _i=0ULL;uint64_t _v=2ULL;o_put(v0, v0_n, _i,_v,5);}
207return o_leave(0ULL);
208}
209if(({uint64_t _a=o_get(v0, v0_n, 3ULL, 5);uint64_t _b=0ULL;o_op(6, 5, _a,_b);})){
210{uint64_t _i=0ULL;uint64_t _v=2ULL;o_put(v0, v0_n, _i,_v,5);}
211return o_leave(0ULL);
212}
213uint64_t __attribute__((unused)) v3=({uint64_t p1=o_get(v0, v0_n, 2ULL, 5);f4(v2, v2_n, p1);});
214if(({uint64_t _a=v3;uint64_t _b=o_get(v0, v0_n, 5ULL, 5);o_op(10, 5, _a,_b);})){
215{uint64_t _i=0ULL;uint64_t _v=7ULL;o_put(v0, v0_n, _i,_v,5);}
216return o_leave(0ULL);
217}
218{uint64_t _i=4ULL;uint64_t _v=v3;o_put(v0, v0_n, _i,_v,5);}
219{uint64_t _i=1ULL;uint64_t _v=1ULL;o_put(v0, v0_n, _i,_v,5);}
220{uint64_t _i=0ULL;uint64_t _v=0ULL;o_put(v0, v0_n, _i,_v,5);}
221return o_leave(0ULL);
222}
223static uint64_t f6(void *v0, uint64_t v0_n, uint64_t v1, uint64_t v2){
224o_enter();
225uint64_t __attribute__((unused)) v3=v2;
226{
227uint64_t v4=0;
228uint64_t k1=8ULL;
229for(;o_op(8,5, v4, k1);v4=o_op(1,5, v4,1)){
230{uint64_t _i=({uint64_t _a=v1;uint64_t _b=v4;o_op(1, 5, _a,_b);});uint64_t _v=o_cast(2, 5, ({uint64_t _a=v3;uint64_t _b=255ULL;o_op(12, 5, _a,_b);}));o_put(v0, v0_n, _i,_v,2);}
231v3=({uint64_t _a=v3;uint64_t _b=8ULL;o_op(16, 5, _a,_b);});
232}
233}
234return o_leave(0);
235}
236static uint64_t f7(void *v0, uint64_t v0_n, uint64_t v1, uint64_t v2){
237o_enter();
238uint64_t __attribute__((unused)) v3=v2;
239{
240uint64_t v4=0;
241uint64_t k1=4ULL;
242for(;o_op(8,5, v4, k1);v4=o_op(1,5, v4,1)){
243{uint64_t _i=({uint64_t _a=v1;uint64_t _b=v4;o_op(1, 5, _a,_b);});uint64_t _v=o_cast(2, 5, ({uint64_t _a=v3;uint64_t _b=255ULL;o_op(12, 5, _a,_b);}));o_put(v0, v0_n, _i,_v,2);}
244v3=({uint64_t _a=v3;uint64_t _b=8ULL;o_op(16, 5, _a,_b);});
245}
246}
247return o_leave(0);
248}
249static uint64_t f8(void *v0, uint64_t v0_n, void *v1, uint64_t v1_n, void *v2, uint64_t v2_n){
250o_enter();
251({f1(v1, v1_n);});
252if(({uint64_t _a=o_get(v0, v0_n, 2ULL, 5);uint64_t _b=o_get(v1, v1_n, 0ULL, 5);o_op(11, 5, _a,_b);})){
253{uint64_t _i=0ULL;uint64_t _v=2ULL;o_put(v0, v0_n, _i,_v,5);}
254return o_leave(0ULL);
255}
256if(({uint64_t _a=o_get(v0, v0_n, 3ULL, 5);uint64_t _b=0ULL;o_op(6, 5, _a,_b);})){
257{uint64_t _i=0ULL;uint64_t _v=2ULL;o_put(v0, v0_n, _i,_v,5);}
258return o_leave(0ULL);
259}
260uint64_t __attribute__((unused)) v3=({uint64_t _a=({uint64_t _a=o_get(v0, v0_n, 2ULL, 5);uint64_t _b=1ULL;o_op(1, 5, _a,_b);});uint64_t _b=1073741824ULL;o_op(3, 5, _a,_b);});
261uint64_t __attribute__((unused)) v4=({uint64_t _a=({uint64_t _a=o_get(v0, v0_n, 2ULL, 5);uint64_t _b=1ULL;o_op(1, 5, _a,_b);});uint64_t _b=4096ULL;o_op(3, 5, _a,_b);});
262({uint64_t p1=64ULL;uint64_t p2=v3;f6(v2, v2_n, p1, p2);});
263({uint64_t p1=72ULL;uint64_t p2=({uint64_t _a=v3;uint64_t _b=v4;o_op(2, 5, _a,_b);});f6(v2, v2_n, p1, p2);});
264({uint64_t p1=80ULL;uint64_t p2=v4;f6(v2, v2_n, p1, p2);});
265{uint64_t _i=1ULL;uint64_t _v=1ULL;o_put(v0, v0_n, _i,_v,5);}
266{uint64_t _i=0ULL;uint64_t _v=0ULL;o_put(v0, v0_n, _i,_v,5);}
267return o_leave(0ULL);
268}
269static uint64_t f9(void *v0, uint64_t v0_n, uint64_t v1, uint64_t v2){
270o_enter();
271uint64_t __attribute__((unused)) v3=({uint64_t _a=128ULL;uint64_t _b=({uint64_t _a=v1;uint64_t _b=24ULL;o_op(3, 5, _a,_b);});o_op(1, 5, _a,_b);});
272{
273uint64_t v4=0;
274uint64_t k1=24ULL;
275for(;o_op(8,5, v4, k1);v4=o_op(1,5, v4,1)){
276{uint64_t _i=({uint64_t _a=v3;uint64_t _b=v4;o_op(1, 5, _a,_b);});uint64_t _v=0ULL;o_put(v0, v0_n, _i,_v,2);}
277}
278}
279({uint64_t p1=v3;uint64_t p2=({uint64_t _a=1000ULL;uint64_t _b=({uint64_t _a=({uint64_t _a=v2;uint64_t _b=10ULL;o_op(3, 5, _a,_b);});uint64_t _b=v1;o_op(1, 5, _a,_b);});o_op(1, 5, _a,_b);});f6(v0, v0_n, p1, p2);});
280({uint64_t p1=({uint64_t _a=v3;uint64_t _b=8ULL;o_op(1, 5, _a,_b);});uint64_t p2=({uint64_t _a=({uint64_t _a=v1;uint64_t _b=1ULL;o_op(1, 5, _a,_b);});uint64_t _b=1048576ULL;o_op(3, 5, _a,_b);});f6(v0, v0_n, p1, p2);});
281({uint64_t p1=({uint64_t _a=v3;uint64_t _b=16ULL;o_op(1, 5, _a,_b);});uint64_t p2=7ULL;f7(v0, v0_n, p1, p2);});
282({uint64_t p1=({uint64_t _a=v3;uint64_t _b=20ULL;o_op(1, 5, _a,_b);});uint64_t p2=9ULL;f7(v0, v0_n, p1, p2);});
283return o_leave(0);
284}
285static uint64_t f10(void *v0, uint64_t v0_n, void *v1, uint64_t v1_n, void *v2, uint64_t v2_n){
286o_enter();
287({f1(v1, v1_n);});
288if(({uint64_t _a=o_get(v0, v0_n, 2ULL, 5);uint64_t _b=o_get(v1, v1_n, 0ULL, 5);o_op(11, 5, _a,_b);})){
289{uint64_t _i=0ULL;uint64_t _v=2ULL;o_put(v0, v0_n, _i,_v,5);}
290return o_leave(0ULL);
291}
292if(({uint64_t _a=o_get(v0, v0_n, 3ULL, 5);uint64_t _b=0ULL;o_op(6, 5, _a,_b);})){
293{uint64_t _i=0ULL;uint64_t _v=2ULL;o_put(v0, v0_n, _i,_v,5);}
294return o_leave(0ULL);
295}
296if(({uint64_t _a=o_get(v0, v0_n, 4ULL, 5);uint64_t _b=2ULL;o_op(8, 5, _a,_b);})){
297{uint64_t _i=4ULL;uint64_t _v=2ULL;o_put(v0, v0_n, _i,_v,5);}
298{uint64_t _i=1ULL;uint64_t _v=2ULL;o_put(v0, v0_n, _i,_v,5);}
299{uint64_t _i=0ULL;uint64_t _v=7ULL;o_put(v0, v0_n, _i,_v,5);}
300return o_leave(0ULL);
301}
302if(({uint64_t _a=o_get(v0, v0_n, 5ULL, 5);uint64_t _b=0ULL;o_op(6, 5, _a,_b);})){
303{uint64_t _i=0ULL;uint64_t _v=2ULL;o_put(v0, v0_n, _i,_v,5);}
304return o_leave(0ULL);
305}
306({uint64_t p1=0ULL;uint64_t p2=o_get(v0, v0_n, 2ULL, 5);f9(v2, v2_n, p1, p2);});
307({uint64_t p1=1ULL;uint64_t p2=o_get(v0, v0_n, 2ULL, 5);f9(v2, v2_n, p1, p2);});
308{uint64_t _i=4ULL;uint64_t _v=2ULL;o_put(v0, v0_n, _i,_v,5);}
309{uint64_t _i=6ULL;uint64_t _v=2ULL;o_put(v0, v0_n, _i,_v,5);}
310{uint64_t _i=1ULL;uint64_t _v=6ULL;o_put(v0, v0_n, _i,_v,5);}
311{uint64_t _i=0ULL;uint64_t _v=0ULL;o_put(v0, v0_n, _i,_v,5);}
312return o_leave(0ULL);
313}
314static uint64_t f11(void *v0, uint64_t v0_n){
315o_enter();
316{uint64_t _i=0ULL;uint64_t _v=83ULL;o_put(v0, v0_n, _i,_v,2);}
317{uint64_t _i=1ULL;uint64_t _v=117ULL;o_put(v0, v0_n, _i,_v,2);}
318{uint64_t _i=2ULL;uint64_t _v=99ULL;o_put(v0, v0_n, _i,_v,2);}
319{uint64_t _i=3ULL;uint64_t _v=99ULL;o_put(v0, v0_n, _i,_v,2);}
320{uint64_t _i=4ULL;uint64_t _v=101ULL;o_put(v0, v0_n, _i,_v,2);}
321{uint64_t _i=5ULL;uint64_t _v=115ULL;o_put(v0, v0_n, _i,_v,2);}
322{uint64_t _i=6ULL;uint64_t _v=115ULL;o_put(v0, v0_n, _i,_v,2);}
323{uint64_t _i=7ULL;uint64_t _v=0ULL;o_put(v0, v0_n, _i,_v,2);}
324{uint64_t _i=32ULL;uint64_t _v=73ULL;o_put(v0, v0_n, _i,_v,2);}
325{uint64_t _i=33ULL;uint64_t _v=110ULL;o_put(v0, v0_n, _i,_v,2);}
326{uint64_t _i=34ULL;uint64_t _v=118ULL;o_put(v0, v0_n, _i,_v,2);}
327{uint64_t _i=35ULL;uint64_t _v=97ULL;o_put(v0, v0_n, _i,_v,2);}
328{uint64_t _i=36ULL;uint64_t _v=108ULL;o_put(v0, v0_n, _i,_v,2);}
329{uint64_t _i=37ULL;uint64_t _v=105ULL;o_put(v0, v0_n, _i,_v,2);}
330{uint64_t _i=38ULL;uint64_t _v=100ULL;o_put(v0, v0_n, _i,_v,2);}
331{uint64_t _i=39ULL;uint64_t _v=32ULL;o_put(v0, v0_n, _i,_v,2);}
332{uint64_t _i=40ULL;uint64_t _v=65ULL;o_put(v0, v0_n, _i,_v,2);}
333{uint64_t _i=41ULL;uint64_t _v=114ULL;o_put(v0, v0_n, _i,_v,2);}
334{uint64_t _i=42ULL;uint64_t _v=103ULL;o_put(v0, v0_n, _i,_v,2);}
335{uint64_t _i=43ULL;uint64_t _v=117ULL;o_put(v0, v0_n, _i,_v,2);}
336{uint64_t _i=44ULL;uint64_t _v=109ULL;o_put(v0, v0_n, _i,_v,2);}
337{uint64_t _i=45ULL;uint64_t _v=101ULL;o_put(v0, v0_n, _i,_v,2);}
338{uint64_t _i=46ULL;uint64_t _v=110ULL;o_put(v0, v0_n, _i,_v,2);}
339{uint64_t _i=47ULL;uint64_t _v=116ULL;o_put(v0, v0_n, _i,_v,2);}
340{uint64_t _i=48ULL;uint64_t _v=0ULL;o_put(v0, v0_n, _i,_v,2);}
341{uint64_t _i=64ULL;uint64_t _v=73ULL;o_put(v0, v0_n, _i,_v,2);}
342{uint64_t _i=65ULL;uint64_t _v=110ULL;o_put(v0, v0_n, _i,_v,2);}
343{uint64_t _i=66ULL;uint64_t _v=115ULL;o_put(v0, v0_n, _i,_v,2);}
344{uint64_t _i=67ULL;uint64_t _v=117ULL;o_put(v0, v0_n, _i,_v,2);}
345{uint64_t _i=68ULL;uint64_t _v=102ULL;o_put(v0, v0_n, _i,_v,2);}
346{uint64_t _i=69ULL;uint64_t _v=102ULL;o_put(v0, v0_n, _i,_v,2);}
347{uint64_t _i=70ULL;uint64_t _v=105ULL;o_put(v0, v0_n, _i,_v,2);}
348{uint64_t _i=71ULL;uint64_t _v=99ULL;o_put(v0, v0_n, _i,_v,2);}
349{uint64_t _i=72ULL;uint64_t _v=105ULL;o_put(v0, v0_n, _i,_v,2);}
350{uint64_t _i=73ULL;uint64_t _v=101ULL;o_put(v0, v0_n, _i,_v,2);}
351{uint64_t _i=74ULL;uint64_t _v=110ULL;o_put(v0, v0_n, _i,_v,2);}
352{uint64_t _i=75ULL;uint64_t _v=116ULL;o_put(v0, v0_n, _i,_v,2);}
353{uint64_t _i=76ULL;uint64_t _v=32ULL;o_put(v0, v0_n, _i,_v,2);}
354{uint64_t _i=77ULL;uint64_t _v=83ULL;o_put(v0, v0_n, _i,_v,2);}
355{uint64_t _i=78ULL;uint64_t _v=105ULL;o_put(v0, v0_n, _i,_v,2);}
356{uint64_t _i=79ULL;uint64_t _v=122ULL;o_put(v0, v0_n, _i,_v,2);}
357{uint64_t _i=80ULL;uint64_t _v=101ULL;o_put(v0, v0_n, _i,_v,2);}
358{uint64_t _i=81ULL;uint64_t _v=0ULL;o_put(v0, v0_n, _i,_v,2);}
359return o_leave(0);
360}
361static uint64_t f12(void *v0, uint64_t v0_n, void *v1, uint64_t v1_n, void *v2, uint64_t v2_n){
362o_enter();
363if(({uint64_t _a=o_get(v2, v2_n, 6ULL, 5);uint64_t _b=0ULL;o_op(6, 5, _a,_b);})){
364({f11(v1, v1_n);});
365{uint64_t _i=6ULL;uint64_t _v=1ULL;o_put(v2, v2_n, _i,_v,5);}
366}
367uint64_t __attribute__((unused)) v3=o_get(v0, v0_n, 2ULL, 5);
368{uint64_t _i=0ULL;uint64_t _v=4ULL;o_put(v0, v0_n, _i,_v,5);}
369{uint64_t _i=1ULL;uint64_t _v=0ULL;o_put(v0, v0_n, _i,_v,5);}
370if(({uint64_t _a=v3;uint64_t _b=0ULL;o_op(6, 5, _a,_b);})){
371{uint64_t _i=0ULL;uint64_t _v=0ULL;o_put(v0, v0_n, _i,_v,5);}
372{uint64_t _i=1ULL;uint64_t _v=7ULL;o_put(v0, v0_n, _i,_v,5);}
373}
374if(({uint64_t _a=v3;uint64_t _b=2ULL;o_op(6, 5, _a,_b);})){
375{uint64_t _i=0ULL;uint64_t _v=1ULL;o_put(v0, v0_n, _i,_v,5);}
376{uint64_t _i=1ULL;uint64_t _v=16ULL;o_put(v0, v0_n, _i,_v,5);}
377}
378if(({uint64_t _a=v3;uint64_t _b=7ULL;o_op(6, 5, _a,_b);})){
379{uint64_t _i=0ULL;uint64_t _v=2ULL;o_put(v0, v0_n, _i,_v,5);}
380{uint64_t _i=1ULL;uint64_t _v=17ULL;o_put(v0, v0_n, _i,_v,5);}
381}
382return o_leave(0ULL);
383}
384static uint64_t f13(void *v0, uint64_t v0_n, void *v1, uint64_t v1_n){
385o_enter();
386if(({uint64_t _a=o_get(v0, v0_n, 2ULL, 5);uint64_t _b=0ULL;o_op(6, 5, _a,_b);})){
387{uint64_t _i=0ULL;uint64_t _v=2ULL;o_put(v0, v0_n, _i,_v,5);}
388return o_leave(0ULL);
389}
390uint64_t __attribute__((unused)) v2=o_get(v1, v1_n, 3ULL, 5);
391uint64_t __attribute__((unused)) v3=0ULL;
392{
393uint64_t v4=0;
394uint64_t k1=4096ULL;
395for(;o_op(8,5, v4, k1);v4=o_op(1,5, v4,1)){
396v3=({uint64_t _a=v3;uint64_t _b=v4;o_op(1, 5, _a,_b);});
397}
398}
399{uint64_t _i=3ULL;uint64_t _v=({uint64_t _a=v2;uint64_t _b=1ULL;o_op(1, 5, _a,_b);});o_put(v1, v1_n, _i,_v,5);}
400{uint64_t _i=3ULL;uint64_t _v=({uint64_t _a=v2;uint64_t _b=1ULL;o_op(1, 5, _a,_b);});o_put(v0, v0_n, _i,_v,5);}
401{uint64_t _i=1ULL;uint64_t _v=1ULL;o_put(v0, v0_n, _i,_v,5);}
402{uint64_t _i=0ULL;uint64_t _v=0ULL;o_put(v0, v0_n, _i,_v,5);}
403return o_leave(0ULL);
404}
405static uint64_t f14(void *v0, uint64_t v0_n, void *v1, uint64_t v1_n, void *v2, uint64_t v2_n, void *v3, uint64_t v3_n, void *v4, uint64_t v4_n){
406o_enter();
407if(({uint64_t _a=o_get(v0, v0_n, 3ULL, 5);uint64_t _b=0ULL;o_op(6, 5, _a,_b);})){
408{uint64_t _i=0ULL;uint64_t _v=2ULL;o_put(v0, v0_n, _i,_v,5);}
409return o_leave(0ULL);
410}
411{
412uint64_t v5=0;
413uint64_t k1=512ULL;
414for(;o_op(8,5, v5, k1);v5=o_op(1,5, v5,1)){
415{uint64_t _i=v5;uint64_t _v=o_cast(2, 5, ({uint64_t _a=v5;uint64_t _b=255ULL;o_op(12, 5, _a,_b);}));o_put(v1, v1_n, _i,_v,2);}
416}
417}
418{
419uint64_t v5=0;
420uint64_t k1=6ULL;
421for(;o_op(8,5, v5, k1);v5=o_op(1,5, v5,1)){
422{uint64_t _i=v5;uint64_t _v=({uint64_t _a=v5;uint64_t _b=1ULL;o_op(1, 5, _a,_b);});o_put(v4, v4_n, _i,_v,5);}
423}
424}
425{uint64_t _i=0ULL;uint64_t _v=0ULL;o_put(v2, v2_n, _i,_v,5);}
426uint64_t __attribute__((unused)) v5=({uint64_t p2=512ULL;uint64_t p5=3ULL;f0(v2, v2_n, v1, v1_n, p2, v3, v3_n, v4, v4_n, p5);});
427if(({uint64_t _a=v5;uint64_t _b=0ULL;o_op(7, 5, _a,_b);})){
428return o_leave(1ULL);
429}
430uint64_t __attribute__((unused)) v6=({uint64_t _a=o_get(v0, v0_n, 2ULL, 5);uint64_t _b=o_get(v2, v2_n, 0ULL, 5);o_op(1, 5, _a,_b);});
431v6=({uint64_t _a=v6;uint64_t _b=o_get(v3, v3_n, 0ULL, 5);o_op(1, 5, _a,_b);});
432v6=({uint64_t _a=v6;uint64_t _b=o_get(v3, v3_n, 1ULL, 5);o_op(1, 5, _a,_b);});
433v6=({uint64_t _a=v6;uint64_t _b=o_get(v3, v3_n, 2ULL, 5);o_op(1, 5, _a,_b);});
434{uint64_t _i=4ULL;uint64_t _v=v6;o_put(v0, v0_n, _i,_v,5);}
435{uint64_t _i=1ULL;uint64_t _v=1ULL;o_put(v0, v0_n, _i,_v,5);}
436{uint64_t _i=0ULL;uint64_t _v=0ULL;o_put(v0, v0_n, _i,_v,5);}
437return o_leave(0ULL);
438}
439static uint32_t omega_fx_count(uint64_t *result, void *p0, uint64_t p0_n, void *p1, uint64_t p1_n){
440 if(!o_buf(result,1,1,5))return 32;
441if(!o_buf(p0, p0_n,4, 5))return 32;
442 if(o_overlap(result,8,p0, p0_n*8))return 32;
443if(!o_buf(p1, p1_n,8, 5))return 32;
444 if(o_overlap(result,8,p1, p1_n*8))return 32;
445if(o_overlap(p1, p1_n*8, p0, p0_n*8))return 32;
446 if(o_busy)return 33;
447 o_busy=1;o_depth=0;int code=setjmp(o_jmp);if(!code){uint64_t _result=f2(p0, p0_n, p1, p1_n);o_put(result,1,0,_result,5);}
448 o_busy=0;return (uint32_t)code;
449}
450__attribute__((visibility("default"))) nvmlReturn_t nvmlDeviceGetCount_v2(unsigned int *deviceCount){
451 uint64_t o_f[4]={999},o_d=1;int o_ok=0;
452 if(pthread_mutex_lock(&FxLock))return (nvmlReturn_t)999;
453 o_f[2]=deviceCount!=NULL;
454 if(!omega_fx_count(&o_d,o_f,4,FxState,8)&&!o_d&&o_in2(o_f[0])&&!(o_f[1]&~UINT64_C(1))){
455 o_ok=1;
456 if(o_f[1]&UINT64_C(1)&&(!deviceCount||o_f[3]>UINT32_MAX))o_ok=0;
457 }
458 if(o_ok){
459 if(o_f[1]&UINT64_C(1))*deviceCount=(unsigned int)o_f[3];
460 }
461 pthread_mutex_unlock(&FxLock);
462 return o_ok?(nvmlReturn_t)o_f[0]:(nvmlReturn_t)999;
463}
464static uint32_t omega_fx_handle(uint64_t *result, void *p0, uint64_t p0_n, void *p1, uint64_t p1_n){
465 if(!o_buf(result,1,1,5))return 32;
466if(!o_buf(p0, p0_n,5, 5))return 32;
467 if(o_overlap(result,8,p0, p0_n*8))return 32;
468if(!o_buf(p1, p1_n,8, 5))return 32;
469 if(o_overlap(result,8,p1, p1_n*8))return 32;
470if(o_overlap(p1, p1_n*8, p0, p0_n*8))return 32;
471 if(o_busy)return 33;
472 o_busy=1;o_depth=0;int code=setjmp(o_jmp);if(!code){uint64_t _result=f3(p0, p0_n, p1, p1_n);o_put(result,1,0,_result,5);}
473 o_busy=0;return (uint32_t)code;
474}
475__attribute__((visibility("default"))) nvmlReturn_t nvmlDeviceGetHandleByIndex_v2(unsigned int index, nvmlDevice_t *device){
476 uint64_t o_f[5]={999},o_d=1;int o_ok=0;
477 if(pthread_mutex_lock(&FxLock))return (nvmlReturn_t)999;
478 o_f[2]=(uint64_t)(uint32_t)index;
479 o_f[3]=device!=NULL;
480 if(!omega_fx_handle(&o_d,o_f,5,FxState,8)&&!o_d&&o_in2(o_f[0])&&!(o_f[1]&~UINT64_C(1))){
481 o_ok=1;
482 if(o_f[1]&UINT64_C(1)&&(!device||o_f[4]>=4))o_ok=0;
483 }
484 if(o_ok){
485 if(o_f[1]&UINT64_C(1))*device=o_ho11(o_f[4]);
486 }
487 pthread_mutex_unlock(&FxLock);
488 return o_ok?(nvmlReturn_t)o_f[0]:(nvmlReturn_t)999;
489}
490static uint32_t omega_fx_name(uint64_t *result, void *p0, uint64_t p0_n, void *p1, uint64_t p1_n, void *p2, uint64_t p2_n){
491 if(!o_buf(result,1,1,5))return 32;
492if(!o_buf(p0, p0_n,6, 5))return 32;
493 if(o_overlap(result,8,p0, p0_n*8))return 32;
494if(!o_buf(p1, p1_n,8, 5))return 32;
495 if(o_overlap(result,8,p1, p1_n*8))return 32;
496if(o_overlap(p1, p1_n*8, p0, p0_n*8))return 32;
497if(!o_buf(p2, p2_n,512, 2))return 32;
498 if(o_overlap(result,8,p2, p2_n*1))return 32;
499if(o_overlap(p2, p2_n*1, p0, p0_n*8))return 32;
500if(o_overlap(p2, p2_n*1, p1, p1_n*8))return 32;
501 if(o_busy)return 33;
502 o_busy=1;o_depth=0;int code=setjmp(o_jmp);if(!code){uint64_t _result=f5(p0, p0_n, p1, p1_n, p2, p2_n);o_put(result,1,0,_result,5);}
503 o_busy=0;return (uint32_t)code;
504}
505__attribute__((visibility("default"))) nvmlReturn_t nvmlDeviceGetName(nvmlDevice_t device, char *name, unsigned int length){
506 uint64_t o_f[6]={999},o_d=1;int o_ok=0;
507 if(pthread_mutex_lock(&FxLock))return (nvmlReturn_t)999;
508 o_f[2]=o_hi11(device);
509 o_f[3]=name!=NULL;
510 o_f[5]=(uint64_t)(uint32_t)length;
511 if(!omega_fx_name(&o_d,o_f,6,FxState,8,FxBytes,512)&&!o_d&&o_in2(o_f[0])&&!(o_f[1]&~UINT64_C(1))){
512 o_ok=1;
513 if(o_f[1]&UINT64_C(1)&&(!name||o_f[4]>(uint64_t)length||o_f[4]>512||!o_f[4]||FxBytes[0+o_f[4]-1]))o_ok=0;
514 }
515 if(o_ok){
516 if(o_f[1]&UINT64_C(1))memcpy(name,FxBytes+0,o_f[4]);
517 }
518 pthread_mutex_unlock(&FxLock);
519 return o_ok?(nvmlReturn_t)o_f[0]:(nvmlReturn_t)999;
520}
521static uint32_t omega_fx_mem(uint64_t *result, void *p0, uint64_t p0_n, void *p1, uint64_t p1_n, void *p2, uint64_t p2_n){
522 if(!o_buf(result,1,1,5))return 32;
523if(!o_buf(p0, p0_n,4, 5))return 32;
524 if(o_overlap(result,8,p0, p0_n*8))return 32;
525if(!o_buf(p1, p1_n,8, 5))return 32;
526 if(o_overlap(result,8,p1, p1_n*8))return 32;
527if(o_overlap(p1, p1_n*8, p0, p0_n*8))return 32;
528if(!o_buf(p2, p2_n,512, 2))return 32;
529 if(o_overlap(result,8,p2, p2_n*1))return 32;
530if(o_overlap(p2, p2_n*1, p0, p0_n*8))return 32;
531if(o_overlap(p2, p2_n*1, p1, p1_n*8))return 32;
532 if(o_busy)return 33;
533 o_busy=1;o_depth=0;int code=setjmp(o_jmp);if(!code){uint64_t _result=f8(p0, p0_n, p1, p1_n, p2, p2_n);o_put(result,1,0,_result,5);}
534 o_busy=0;return (uint32_t)code;
535}
536__attribute__((visibility("default"))) nvmlReturn_t nvmlDeviceGetMemoryInfo(nvmlDevice_t device, nvmlMemory_t *memory){
537 uint64_t o_f[4]={999},o_d=1;int o_ok=0;
538 if(pthread_mutex_lock(&FxLock))return (nvmlReturn_t)999;
539 o_f[2]=o_hi11(device);
540 o_f[3]=memory!=NULL;
541 if(!omega_fx_mem(&o_d,o_f,4,FxState,8,FxBytes,512)&&!o_d&&o_in2(o_f[0])&&!(o_f[1]&~UINT64_C(1))){
542 o_ok=1;
543 if(o_f[1]&UINT64_C(1)&&(!memory))o_ok=0;
544 }
545 if(o_ok){
546 if(o_f[1]&UINT64_C(1)){memcpy(&memory->total,FxBytes+64,8);memcpy(&memory->free,FxBytes+72,8);memcpy(&memory->used,FxBytes+80,8);}
547 }
548 pthread_mutex_unlock(&FxLock);
549 return o_ok?(nvmlReturn_t)o_f[0]:(nvmlReturn_t)999;
550}
551static uint32_t omega_fx_procs(uint64_t *result, void *p0, uint64_t p0_n, void *p1, uint64_t p1_n, void *p2, uint64_t p2_n){
552 if(!o_buf(result,1,1,5))return 32;
553if(!o_buf(p0, p0_n,7, 5))return 32;
554 if(o_overlap(result,8,p0, p0_n*8))return 32;
555if(!o_buf(p1, p1_n,8, 5))return 32;
556 if(o_overlap(result,8,p1, p1_n*8))return 32;
557if(o_overlap(p1, p1_n*8, p0, p0_n*8))return 32;
558if(!o_buf(p2, p2_n,512, 2))return 32;
559 if(o_overlap(result,8,p2, p2_n*1))return 32;
560if(o_overlap(p2, p2_n*1, p0, p0_n*8))return 32;
561if(o_overlap(p2, p2_n*1, p1, p1_n*8))return 32;
562 if(o_busy)return 33;
563 o_busy=1;o_depth=0;int code=setjmp(o_jmp);if(!code){uint64_t _result=f10(p0, p0_n, p1, p1_n, p2, p2_n);o_put(result,1,0,_result,5);}
564 o_busy=0;return (uint32_t)code;
565}
566__attribute__((visibility("default"))) nvmlReturn_t nvmlDeviceGetComputeRunningProcesses_v2(nvmlDevice_t device, unsigned int *infoCount, nvmlProcessInfo_v2_t *infos){
567 uint64_t o_f[7]={999},o_d=1;int o_ok=0;
568 if(pthread_mutex_lock(&FxLock))return (nvmlReturn_t)999;
569 o_f[2]=o_hi11(device);
570 o_f[3]=infoCount!=NULL;
571 if(infoCount)o_f[4]=(uint64_t)(uint32_t)*infoCount;
572 const uint64_t o_i3=o_f[4];
573 o_f[5]=infos!=NULL;
574 if(!omega_fx_procs(&o_d,o_f,7,FxState,8,FxBytes,512)&&!o_d&&o_in2(o_f[0])&&!(o_f[1]&~UINT64_C(6))){
575 o_ok=1;
576 if(o_f[1]&UINT64_C(2)&&(!infoCount||o_f[4]>UINT32_MAX))o_ok=0;
577 if(o_f[1]&UINT64_C(4)&&(!infos||o_f[6]>o_i3||o_f[6]>16))o_ok=0;
578 }
579 if(o_ok){
580 if(o_f[1]&UINT64_C(2))*infoCount=(unsigned int)o_f[4];
581 if(o_f[1]&UINT64_C(4))for(uint64_t o_j=0;o_j<o_f[6];o_j++){memcpy(&infos[o_j].pid,FxBytes+128+o_j*24,4);memcpy(&infos[o_j].usedGpuMemory,FxBytes+136+o_j*24,8);memcpy(&infos[o_j].gpuInstanceId,FxBytes+144+o_j*24,4);memcpy(&infos[o_j].computeInstanceId,FxBytes+148+o_j*24,4);}
582 }
583 pthread_mutex_unlock(&FxLock);
584 return o_ok?(nvmlReturn_t)o_f[0]:(nvmlReturn_t)999;
585}
586static uint32_t omega_fx_err(uint64_t *result, void *p0, uint64_t p0_n, void *p1, uint64_t p1_n, void *p2, uint64_t p2_n){
587 if(!o_buf(result,1,1,5))return 32;
588if(!o_buf(p0, p0_n,3, 5))return 32;
589 if(o_overlap(result,8,p0, p0_n*8))return 32;
590if(!o_buf(p1, p1_n,128, 2))return 32;
591 if(o_overlap(result,8,p1, p1_n*1))return 32;
592if(o_overlap(p1, p1_n*1, p0, p0_n*8))return 32;
593if(!o_buf(p2, p2_n,8, 5))return 32;
594 if(o_overlap(result,8,p2, p2_n*8))return 32;
595if(o_overlap(p2, p2_n*8, p0, p0_n*8))return 32;
596if(o_overlap(p2, p2_n*8, p1, p1_n*1))return 32;
597 if(o_busy)return 33;
598 o_busy=1;o_depth=0;int code=setjmp(o_jmp);if(!code){uint64_t _result=f12(p0, p0_n, p1, p1_n, p2, p2_n);o_put(result,1,0,_result,5);}
599 o_busy=0;return (uint32_t)code;
600}
601__attribute__((visibility("default"))) const char *nvmlErrorString(nvmlReturn_t result){
602 uint64_t o_f[3]={4},o_d=1;const char *o_r=o_fb27;
603 if(pthread_mutex_lock(&FxLock))return o_fb27;
604 o_f[2]=(uint64_t)(int64_t)(int32_t)result;
605 if(!omega_fx_err(&o_d,o_f,3,FxTexts,128,FxState,8)&&!o_d&&o_f[0]<4&&o_f[1]<32&&!FxTexts[o_f[0]*32+o_f[1]])o_r=(const char*)FxTexts+o_f[0]*32;
606 pthread_mutex_unlock(&FxLock);
607 return o_r;
608}
609static uint32_t omega_fx_bump(uint64_t *result, void *p0, uint64_t p0_n, void *p1, uint64_t p1_n){
610 if(!o_buf(result,1,1,5))return 32;
611if(!o_buf(p0, p0_n,4, 5))return 32;
612 if(o_overlap(result,8,p0, p0_n*8))return 32;
613if(!o_buf(p1, p1_n,8, 5))return 32;
614 if(o_overlap(result,8,p1, p1_n*8))return 32;
615if(o_overlap(p1, p1_n*8, p0, p0_n*8))return 32;
616 if(o_busy)return 33;
617 o_busy=1;o_depth=0;int code=setjmp(o_jmp);if(!code){uint64_t _result=f13(p0, p0_n, p1, p1_n);o_put(result,1,0,_result,5);}
618 o_busy=0;return (uint32_t)code;
619}
620__attribute__((visibility("default"))) nvmlReturn_t ombrFxBump(unsigned long long *value){
621 uint64_t o_f[4]={999},o_d=1;int o_ok=0;
622 if(pthread_mutex_lock(&FxLock))return (nvmlReturn_t)999;
623 o_f[2]=value!=NULL;
624 if(!omega_fx_bump(&o_d,o_f,4,FxState,8)&&!o_d&&o_in2(o_f[0])&&!(o_f[1]&~UINT64_C(1))){
625 o_ok=1;
626 if(o_f[1]&UINT64_C(1)&&(!value))o_ok=0;
627 }
628 if(o_ok){
629 if(o_f[1]&UINT64_C(1))*value=(unsigned long long)o_f[3];
630 }
631 pthread_mutex_unlock(&FxLock);
632 return o_ok?(nvmlReturn_t)o_f[0]:(nvmlReturn_t)999;
633}
634static uint32_t omega_fx_sumx(uint64_t *result, void *p0, uint64_t p0_n, void *p1, uint64_t p1_n, void *p2, uint64_t p2_n, void *p3, uint64_t p3_n, void *p4, uint64_t p4_n){
635 if(!o_buf(result,1,1,5))return 32;
636if(!o_buf(p0, p0_n,5, 5))return 32;
637 if(o_overlap(result,8,p0, p0_n*8))return 32;
638if(!o_buf(p1, p1_n,512, 2))return 32;
639 if(o_overlap(result,8,p1, p1_n*1))return 32;
640if(o_overlap(p1, p1_n*1, p0, p0_n*8))return 32;
641if(!o_buf(p2, p2_n,1, 5))return 32;
642 if(o_overlap(result,8,p2, p2_n*8))return 32;
643if(o_overlap(p2, p2_n*8, p0, p0_n*8))return 32;
644if(o_overlap(p2, p2_n*8, p1, p1_n*1))return 32;
645if(!o_buf(p3, p3_n,3, 5))return 32;
646 if(o_overlap(result,8,p3, p3_n*8))return 32;
647if(o_overlap(p3, p3_n*8, p0, p0_n*8))return 32;
648if(o_overlap(p3, p3_n*8, p1, p1_n*1))return 32;
649if(o_overlap(p3, p3_n*8, p2, p2_n*8))return 32;
650if(!o_buf(p4, p4_n,6, 5))return 32;
651 if(o_overlap(result,8,p4, p4_n*8))return 32;
652if(o_overlap(p4, p4_n*8, p0, p0_n*8))return 32;
653if(o_overlap(p4, p4_n*8, p1, p1_n*1))return 32;
654if(o_overlap(p4, p4_n*8, p2, p2_n*8))return 32;
655if(o_overlap(p4, p4_n*8, p3, p3_n*8))return 32;
656 if(o_busy)return 33;
657 o_busy=1;o_depth=0;int code=setjmp(o_jmp);if(!code){uint64_t _result=f14(p0, p0_n, p1, p1_n, p2, p2_n, p3, p3_n, p4, p4_n);o_put(result,1,0,_result,5);}
658 o_busy=0;return (uint32_t)code;
659}
660__attribute__((visibility("default"))) nvmlReturn_t ombrFxSum(unsigned long long seed, unsigned long long *sum){
661 uint64_t o_f[5]={999},o_d=1;int o_ok=0;
662 if(pthread_mutex_lock(&FxLock))return (nvmlReturn_t)999;
663 o_f[2]=(uint64_t)seed;
664 o_f[3]=sum!=NULL;
665 if(!omega_fx_sumx(&o_d,o_f,5,FxBytes,512,FxSum,1,FxW,3,FxV,6)&&!o_d&&o_in2(o_f[0])&&!(o_f[1]&~UINT64_C(1))){
666 o_ok=1;
667 if(o_f[1]&UINT64_C(1)&&(!sum))o_ok=0;
668 }
669 if(o_ok){
670 if(o_f[1]&UINT64_C(1))*sum=(unsigned long long)o_f[4];
671 }
672 pthread_mutex_unlock(&FxLock);
673 return o_ok?(nvmlReturn_t)o_f[0]:(nvmlReturn_t)999;
674}
675#if defined(__GNUC__)
676#pragma GCC diagnostic pop
677#endif