File: %40m..%40slib%40spure%40sdynlib.nim.c

package info (click to toggle)
nim 2.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,911,644 kB
  • sloc: sh: 24,603; ansic: 1,761; python: 1,492; makefile: 1,013; sql: 298; asm: 141; xml: 13
file content (186 lines) | stat: -rw-r--r-- 6,100 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
/* Generated by Nim Compiler v2.2.0 */
#define NIM_INTBITS 64
#define NIM_EmulateOverflowChecks

#include "nimbase.h"
#include <string.h>
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC
#undef R3000
#undef R4000
#undef i386
#undef linux
#undef mips
#undef near
#undef far
#undef powerpc
#undef unix
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ tySequence__sM4lkSb7zS6F7OVMvW9cffQ;
typedef struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content;
struct NimStrPayload {
	NI cap;
	NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
	NI len;
	NimStrPayload* p;
};
struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ {
  NI len; tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content* p;
};
struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content { NI cap; NimStringV2 data[SEQ_DECL_SIZE]; };
N_LIB_PRIVATE N_NIMCALL(NI, nsuFindChar)(NimStringV2 s_p0, NIM_CHAR sub_p1, NI start_p2, NI last_p3);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, substr__system_u8389)(NimStringV2 s_p0, NI first_p1, NI last_p2);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, substr__system_u8401)(NimStringV2 s_p0, NI first_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___system_u2606)(NimStringV2* dest_p0, NimStringV2 src_p1);
N_LIB_PRIVATE N_NIMCALL(void, libCandidates__pureZdynlib_u81)(NimStringV2 s_p0, tySequence__sM4lkSb7zS6F7OVMvW9cffQ* dest_p1);
static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1);
static N_INLINE(void, copyMem__system_u1713)(void* dest_p0, void* source_p1, NI size_p2);
static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, rawNewString)(NI space_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___system_u2597)(NimStringV2 dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, add__stdZenumutils_u71)(tySequence__sM4lkSb7zS6F7OVMvW9cffQ* x_p0, NimStringV2 y_p1);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, eqdup___system_u2603)(NimStringV2 src_p0);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
extern NIM_BOOL nimInErrorMode__system_u4276;
static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2) {
	void* T1_;
	T1_ = (void*)0;
	T1_ = memcpy(dest_p0, source_p1, ((size_t) (size_p2)));
}
static N_INLINE(void, copyMem__system_u1713)(void* dest_p0, void* source_p1, NI size_p2) {
	nimCopyMem(dest_p0, source_p1, size_p2);
}
static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1) {
	{
		if (!(((NI)0) < src_p1.len)) goto LA3_;
		copyMem__system_u1713(((void*) ((&(*(*dest_p0).p).data[(*dest_p0).len]))), ((void*) ((&(*src_p1.p).data[((NI)0)]))), ((NI)(src_p1.len + ((NI)1))));
		(*dest_p0).len += src_p1.len;
	}
LA3_: ;
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
	NIM_BOOL* result;
	result = (&nimInErrorMode__system_u4276);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, libCandidates__pureZdynlib_u81)(NimStringV2 s_p0, tySequence__sM4lkSb7zS6F7OVMvW9cffQ* dest_p1) {
	NI le;
	NI ri;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	le = nsuFindChar(s_p0, 40, ((NI)0), ((NI)-1));
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	ri = nsuFindChar(s_p0, 41, ((NI)(le + ((NI)1))), ((NI)-1));
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	{
		NIM_BOOL T3_;
		NimStringV2 prefix;
		NimStringV2 suffix;
		T3_ = (NIM_BOOL)0;
		T3_ = (((NI)0) <= le);
		if (!(T3_)) goto LA4_;
		T3_ = (le < ri);
LA4_: ;
		if (!T3_) goto LA5_;
		prefix.len = 0; prefix.p = NIM_NIL;
		suffix.len = 0; suffix.p = NIM_NIL;
		prefix = substr__system_u8389(s_p0, ((NI)0), (NI)(le - ((NI)1)));
		suffix = substr__system_u8401(s_p0, (NI)(ri + ((NI)1)));
		{
			NimStringV2 middle;
			NimStringV2 colontmp_;
			NI lastX60gensym34_;
			NI splitsX60gensym34_;
			middle.len = 0; middle.p = NIM_NIL;
			colontmp_.len = 0; colontmp_.p = NIM_NIL;
			colontmp_ = substr__system_u8389(s_p0, (NI)(le + ((NI)1)), (NI)(ri - ((NI)1)));
			lastX60gensym34_ = ((NI)0);
			splitsX60gensym34_ = ((NI)-1);
			{
				while (1) {
					NimStringV2 colontmpD_;
					NI firstX60gensym34_;
					NimStringV2 T21_;
					NimStringV2 T22_;
					if (!(lastX60gensym34_ <= colontmp_.len)) goto LA11;
					colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
					firstX60gensym34_ = lastX60gensym34_;
					{
						while (1) {
							NIM_BOOL T15_;
							T15_ = (NIM_BOOL)0;
							T15_ = (lastX60gensym34_ < colontmp_.len);
							if (!(T15_)) goto LA16_;
							T15_ = !(((NU8)(colontmp_.p->data[lastX60gensym34_]) == (NU8)(124)));
LA16_: ;
							if (!T15_) goto LA14;
							lastX60gensym34_ += ((NI)1);
						} LA14: ;
					}
					{
						if (!(splitsX60gensym34_ == ((NI)0))) goto LA19_;
						lastX60gensym34_ = colontmp_.len;
					}
LA19_: ;
					T21_.len = 0; T21_.p = NIM_NIL;
					T21_ = substr__system_u8389(colontmp_, firstX60gensym34_, (NI)(lastX60gensym34_ - ((NI)1)));
					eqsink___system_u2606((&middle), T21_);
					T22_.len = 0; T22_.p = NIM_NIL;
					T22_ = rawNewString(prefix.len + middle.len + suffix.len + 0);
appendString((&T22_), prefix);
appendString((&T22_), middle);
appendString((&T22_), suffix);
					colontmpD_ = T22_;
					libCandidates__pureZdynlib_u81(colontmpD_, dest_p1);
					if (NIM_UNLIKELY(*nimErr_)) goto LA12_;
					{
						if (!(splitsX60gensym34_ == ((NI)0))) goto LA25_;
						eqdestroy___system_u2597(colontmpD_);
						goto LA10;
					}
LA25_: ;
					splitsX60gensym34_ -= ((NI)1);
					lastX60gensym34_ += ((NI)1);
					{
						LA12_:;
					}
					{
						eqdestroy___system_u2597(colontmpD_);
					}
					if (NIM_UNLIKELY(*nimErr_)) goto LA9_;
				} LA11: ;
			} LA10: ;
			{
				LA9_:;
			}
			{
				eqdestroy___system_u2597(colontmp_);
				eqdestroy___system_u2597(middle);
			}
			if (NIM_UNLIKELY(*nimErr_)) goto LA7_;
		}
		{
			LA7_:;
		}
		{
			eqdestroy___system_u2597(suffix);
			eqdestroy___system_u2597(prefix);
		}
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
	goto LA1_;
LA5_: ;
	{
		NimStringV2 colontmpD__2;
		colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
		colontmpD__2 = eqdup___system_u2603(s_p0);
		add__stdZenumutils_u71((&(*dest_p1)), colontmpD__2);
	}
LA1_: ;
	}BeforeRet_: ;
}