mirror of
https://github.com/danog/toncontest.git
synced 2024-12-04 10:28:24 +01:00
372 lines
5.4 KiB
Plaintext
372 lines
5.4 KiB
Plaintext
|
"Asm.fif" include
|
||
|
// automatically generated from `/home/daniil/repos/contest/lib/crypto/smartcont/stdlib.fc` `wallet-code.fc`
|
||
|
PROGRAM{
|
||
|
DECLPROC ~collect_garbage
|
||
|
DECLPROC store_db
|
||
|
DECLPROC recv_internal
|
||
|
DECLPROC recv_external
|
||
|
85143 DECLMETHOD seqno
|
||
|
119659 DECLMETHOD getKey
|
||
|
66593 DECLMETHOD getId
|
||
|
124239 DECLMETHOD getPartials
|
||
|
113609 DECLMETHOD getPartialsByKeyId
|
||
|
125107 DECLMETHOD getPartialByKey
|
||
|
100959 DECLMETHOD getPartialByHash
|
||
|
~collect_garbage PROC:<{
|
||
|
-1 PUSHINT
|
||
|
UNTIL:<{
|
||
|
OVER
|
||
|
8 PUSHPOW2
|
||
|
DICTUGETNEXT
|
||
|
NULLSWAPIFNOT
|
||
|
NULLSWAPIFNOT
|
||
|
DUP
|
||
|
IF:<{
|
||
|
s0 s2 XCHG
|
||
|
4 PUSHINT
|
||
|
SDSKIPFIRST
|
||
|
SKIPDICT
|
||
|
32 PLDU
|
||
|
NOW
|
||
|
LEQ
|
||
|
IF:<{
|
||
|
8 PUSHPOW2
|
||
|
s1 s3 s3 PUXC2
|
||
|
DICTUDEL
|
||
|
DROP
|
||
|
}>ELSE<{
|
||
|
s0 s2 XCHG
|
||
|
}>
|
||
|
}>ELSE<{
|
||
|
2SWAP
|
||
|
DROP
|
||
|
}>
|
||
|
SWAP
|
||
|
NOT
|
||
|
s1 s2 XCHG
|
||
|
}>
|
||
|
DROP
|
||
|
}>
|
||
|
store_db PROC:<{
|
||
|
NEWC
|
||
|
s1 s3 XCHG
|
||
|
32 STU
|
||
|
STDICT
|
||
|
STDICT
|
||
|
ENDC
|
||
|
c4 POP
|
||
|
}>
|
||
|
recv_internal PROC:<{
|
||
|
DROP
|
||
|
}>
|
||
|
recv_external PROC:<{
|
||
|
1 LDU
|
||
|
SWAP
|
||
|
32 THROWIF
|
||
|
DUP
|
||
|
1 PLDU
|
||
|
33 THROWIFNOT
|
||
|
LDDICT
|
||
|
DUP
|
||
|
32 LDU
|
||
|
32 LDU
|
||
|
s2 PUSH
|
||
|
NOW
|
||
|
LEQ
|
||
|
34 THROWIF
|
||
|
s0 s3 XCHG
|
||
|
HASHSU
|
||
|
c4 PUSH
|
||
|
CTOS
|
||
|
32 LDU
|
||
|
4 LDU
|
||
|
LDDICT
|
||
|
LDDICT
|
||
|
ENDS
|
||
|
0 PUSHINT
|
||
|
NEWDICT
|
||
|
s5 s7 PUSH2
|
||
|
EQUAL
|
||
|
IF:<{
|
||
|
s0 s5 XCHG
|
||
|
INC
|
||
|
}>ELSE<{
|
||
|
2DROP
|
||
|
s4 s0 PUSH2
|
||
|
8 PUSHPOW2
|
||
|
DICTUGET
|
||
|
NULLSWAPIFNOT
|
||
|
35 THROWIFNOT
|
||
|
4 LDU
|
||
|
PLDDICT
|
||
|
s0 s5 XCHG
|
||
|
}>
|
||
|
ACCEPT
|
||
|
-1 PUSHINT
|
||
|
UNTIL:<{
|
||
|
s11 PUSH
|
||
|
4 PUSHINT
|
||
|
DICTUGETNEXT
|
||
|
NULLSWAPIFNOT
|
||
|
NULLSWAPIFNOT
|
||
|
DUP
|
||
|
IF:<{
|
||
|
DROP
|
||
|
s0 s5 PUSH2
|
||
|
4 PUSHINT
|
||
|
DICTUGET
|
||
|
NULLSWAPIFNOT
|
||
|
DUP
|
||
|
36 THROWIFNOT
|
||
|
s3 s(-1) s0 PUXC2
|
||
|
256 PLDU
|
||
|
s11 s2 s2 PUXC2
|
||
|
CHKSIGNU
|
||
|
37 THROWIFNOT
|
||
|
s1 s8 PUSH2
|
||
|
4 PUSHINT
|
||
|
DICTUGET
|
||
|
NULLSWAPIFNOT
|
||
|
NIP
|
||
|
NOT
|
||
|
IF:<{
|
||
|
s1 s2 XCHG
|
||
|
4 PUSHINT
|
||
|
s3 s9 s9 PUXC2
|
||
|
DICTUSET
|
||
|
s0 s3 XCHG
|
||
|
INC
|
||
|
}>ELSE<{
|
||
|
s0 s8 XCHG
|
||
|
s1 s4 s4 XCHG3
|
||
|
DROP
|
||
|
}>
|
||
|
}>ELSE<{
|
||
|
s0 s8 XCHG
|
||
|
s1 s4 s4 XCHG3
|
||
|
DROP
|
||
|
}>
|
||
|
s0 s7 XCHG
|
||
|
NOT
|
||
|
s3 s7 XCHG
|
||
|
}>
|
||
|
DROP
|
||
|
s10 POP
|
||
|
s0 s3 PUSH2
|
||
|
GEQ
|
||
|
IF:<{
|
||
|
DROP
|
||
|
s3 POP
|
||
|
s4 POP
|
||
|
s4 POP
|
||
|
s0 s4 XCHG
|
||
|
1 LDU
|
||
|
SWAP
|
||
|
IF:<{
|
||
|
s2 POP
|
||
|
s2 POP
|
||
|
4 LDU
|
||
|
LDDICT
|
||
|
LDREF
|
||
|
SWAP
|
||
|
SETCODE
|
||
|
}>ELSE<{
|
||
|
8 LDU
|
||
|
LDREF
|
||
|
s0 s2 XCHG
|
||
|
SENDRAWMSG
|
||
|
s3 s3 s0 XCHG3
|
||
|
}>
|
||
|
ENDS
|
||
|
s2 s3 XCHG2
|
||
|
8 PUSHPOW2
|
||
|
DICTUDEL
|
||
|
DROP
|
||
|
}>ELSE<{
|
||
|
NEWC
|
||
|
4 STU
|
||
|
s1 s4 XCHG
|
||
|
STDICT
|
||
|
s1 s6 XCHG
|
||
|
32 STU
|
||
|
s1 s4 XCHG
|
||
|
32 STU
|
||
|
s0 s5 XCHG2
|
||
|
STSLICER
|
||
|
s0 s1 s4 XCHG3
|
||
|
8 PUSHPOW2
|
||
|
DICTUSETB
|
||
|
s1 s2 XCHG
|
||
|
}>
|
||
|
~collect_garbage CALLDICT
|
||
|
NEWC
|
||
|
s1 s4 XCHG
|
||
|
32 STU
|
||
|
4 STU
|
||
|
STDICT
|
||
|
STDICT
|
||
|
ENDC
|
||
|
c4 POP
|
||
|
}>
|
||
|
seqno PROC:<{
|
||
|
c4 PUSH
|
||
|
CTOS
|
||
|
32 PLDU
|
||
|
}>
|
||
|
getKey PROC:<{
|
||
|
c4 PUSH
|
||
|
CTOS
|
||
|
36 PUSHINT
|
||
|
SDSKIPFIRST
|
||
|
PLDDICT
|
||
|
4 PUSHINT
|
||
|
DICTUGET
|
||
|
NULLSWAPIFNOT
|
||
|
DUP
|
||
|
NOT
|
||
|
IFJMP:<{
|
||
|
NIP
|
||
|
0 PUSHINT
|
||
|
}>
|
||
|
DROP
|
||
|
-1 PUSHINT
|
||
|
SWAP
|
||
|
256 PLDU
|
||
|
}>
|
||
|
getId PROC:<{
|
||
|
c4 PUSH
|
||
|
CTOS
|
||
|
36 PUSHINT
|
||
|
SDSKIPFIRST
|
||
|
PLDDICT
|
||
|
-1 PUSHINT
|
||
|
0 PUSHINT
|
||
|
UNTIL:<{
|
||
|
s1 s2 XCPU
|
||
|
4 PUSHINT
|
||
|
DICTUGETNEXT
|
||
|
NULLSWAPIFNOT
|
||
|
NULLSWAPIFNOT
|
||
|
DUP
|
||
|
IF:<{
|
||
|
s3 POP
|
||
|
SWAP
|
||
|
256 PLDU
|
||
|
s4 PUSH
|
||
|
EQUAL
|
||
|
}>ELSE<{
|
||
|
s1 s3 s3 XCHG3
|
||
|
DROP
|
||
|
}>
|
||
|
s0 s2 XCHG
|
||
|
NOT
|
||
|
s2 PUSH
|
||
|
OR
|
||
|
s1 s2 XCHG
|
||
|
}>
|
||
|
s2 POP
|
||
|
s2 POP
|
||
|
IFJMP:<{
|
||
|
-1 PUSHINT
|
||
|
SWAP
|
||
|
}>
|
||
|
DROP
|
||
|
0 PUSHINT
|
||
|
DUP
|
||
|
}>
|
||
|
getPartials PROC:<{
|
||
|
c4 PUSH
|
||
|
CTOS
|
||
|
36 PUSHINT
|
||
|
SDSKIPFIRST
|
||
|
SKIPDICT
|
||
|
PLDDICT
|
||
|
}>
|
||
|
getPartialsByKeyId PROC:<{
|
||
|
c4 PUSH
|
||
|
CTOS
|
||
|
36 PUSHINT
|
||
|
SDSKIPFIRST
|
||
|
SKIPDICT
|
||
|
PLDDICT
|
||
|
NEWDICT
|
||
|
-1 PUSHINT
|
||
|
0 PUSHINT
|
||
|
UNTIL:<{
|
||
|
s1 s3 XCPU
|
||
|
8 PUSHPOW2
|
||
|
DICTUGETNEXT
|
||
|
NULLSWAPIFNOT
|
||
|
NULLSWAPIFNOT
|
||
|
DUP
|
||
|
IF:<{
|
||
|
s2 PUSH
|
||
|
4 PUSHINT
|
||
|
SDSKIPFIRST
|
||
|
PLDDICT
|
||
|
s7 s(-1) PUXC
|
||
|
4 PUSHINT
|
||
|
DICTUGET
|
||
|
NULLSWAPIFNOT
|
||
|
NIP
|
||
|
IF:<{
|
||
|
s0 s3 XCHG
|
||
|
INC
|
||
|
NEWC
|
||
|
s0 s3 XCHG2
|
||
|
STSLICER
|
||
|
SWAP
|
||
|
8 PUSHPOW2
|
||
|
s1 s5 s5 PUXC2
|
||
|
DICTUSETB
|
||
|
}>ELSE<{
|
||
|
s3 s4 s3 XCHG3
|
||
|
DROP
|
||
|
}>
|
||
|
}>ELSE<{
|
||
|
s3 s4 s3 XCHG3
|
||
|
DROP
|
||
|
}>
|
||
|
s0 s2 XCHG
|
||
|
NOT
|
||
|
s2 s3 XCHG
|
||
|
}>
|
||
|
NIP
|
||
|
s2 POP
|
||
|
s2 POP
|
||
|
SWAP
|
||
|
}>
|
||
|
getPartialByKey PROC:<{
|
||
|
getId CALLDICT
|
||
|
SWAP
|
||
|
IFNOTJMP:<{
|
||
|
DROP
|
||
|
0 PUSHINT
|
||
|
NEWDICT
|
||
|
}>
|
||
|
getPartialsByKeyId CALLDICT
|
||
|
}>
|
||
|
getPartialByHash PROC:<{
|
||
|
c4 PUSH
|
||
|
CTOS
|
||
|
36 PUSHINT
|
||
|
SDSKIPFIRST
|
||
|
SKIPDICT
|
||
|
PLDDICT
|
||
|
8 PUSHPOW2
|
||
|
DICTUGET
|
||
|
NULLSWAPIFNOT
|
||
|
DUP
|
||
|
IFNOTJMP:<{
|
||
|
2DROP
|
||
|
0 PUSHINT
|
||
|
NEWC
|
||
|
ENDC
|
||
|
}>
|
||
|
NEWC
|
||
|
ROT
|
||
|
STSLICER
|
||
|
ENDC
|
||
|
}>
|
||
|
}END>c
|