1
0
mirror of https://github.com/danog/toncontest.git synced 2024-11-30 04:29:14 +01:00
toncontest/lightning/wallet-code.fif
2019-10-15 17:57:37 +02:00

446 lines
6.1 KiB
Plaintext

"Asm.fif" include
// automatically generated from `/home/daniil/repos/contest/lib/crypto/smartcont/stdlib.fc` `wallet-code.fc`
PROGRAM{
DECLPROC ~load_simple_addr_pair
DECLPROC preload_simple_addr_pair
DECLPROC skip_sigs
DECLPROC ~load_sigs
DECLPROC preload_sigs
DECLPROC store_sigs
DECLPROC load_storage
DECLPROC store_storage
DECLPROC recv_internal
DECLPROC recv_external
84593 DECLMETHOD seqNo
125129 DECLMETHOD getDelta
112390 DECLMETHOD isTurnA
100197 DECLMETHOD isTurnB
101812 DECLMETHOD getAmountA
114135 DECLMETHOD getAmountB
105039 DECLMETHOD getAddrA
109100 DECLMETHOD getAddrB
78055 DECLMETHOD getSignatures
115661 DECLMETHOD hasSignatureA
127918 DECLMETHOD hasSignatureB
120167 DECLMETHOD getHash
~load_simple_addr_pair PROC:<{
8 LDI
256 LDU
8 LDI
256 LDU
4 -ROLL
}>
preload_simple_addr_pair PROC:<{
8 LDI
DUP
256 PLDU
SWAP
8 LDI
256 PLDU
}>
skip_sigs PROC:<{
DUP
SREFS
2 EQINT
IFJMP:<{
}>
1 PUSHINT
SDSKIPFIRST
}>
~load_sigs PROC:<{
DUP
SREFS
2 EQINT
IFJMP:<{
3 PUSHINT
SWAP
LDREF
LDREF
3 -ROLL
}>
1 LDU
SWAP
IFJMP:<{
2 PUSHINT
NEWDICT
s0 s2 XCHG
LDREF
s3 s3 XCHG2
}>
1 PUSHINT
SWAP
LDREF
NEWDICT
s3 s3 s0 XCHG3
}>
preload_sigs PROC:<{
~load_sigs CALLDICT
s3 POP
ROT
}>
store_sigs PROC:<{
s2 PUSH
3 EQINT
IFJMP:<{
s2 POP
ROT
STREF
STREF
}>
s0 s2 XCHG
2 EQINT
IFJMP:<{
DROP
1 PUSHINT
ROT
1 STU
STREF
}>
NIP
0 PUSHINT
ROT
1 STU
STREF
}>
load_storage PROC:<{
c4 PUSH
CTOS
256 LDU
256 LDU
LDGRAMS
LDGRAMS
LDREF
~load_sigs CALLDICT
s0 s3 XCHG
32 LDU
LDGRAMS
1 LDU
ENDS
s4 s5 XCHG
s3 s4 XCHG
}>
store_storage PROC:<{
NEWC
s1 s11 XCHG
256 STU
s1 s9 XCHG
256 STU
s0 s7 XCHG2
STGRAMS
s0 s5 XCHG2
STGRAMS
s1 s3 XCHG
STREF
s2 s3 XCHG2
store_sigs CALLDICT
32 STU
SWAP
STGRAMS
1 STU
ENDC
c4 POP
}>
recv_internal PROC:<{
NIP
CTOS
4 LDU
LDMSGADDR
DROP
REWRITESTDADDR
s0 s2 XCHG
1 PUSHINT
AND
IFJMP:<{
2DROP
}>
load_storage CALLDICT
s6 s10 XCHG
10 BLKDROP
DUP
CTOS
NIP
preload_simple_addr_pair CALLDICT
s3 s4 XCPU
EQUAL
s2 s5 XCPU
EQUAL
s1 s2 XCHG
AND
IF:<{
4 BLKDROP
}>ELSE<{
ROT
EQUAL
s0 s2 XCHG
EQUAL
AND
IF:<{
}>ELSE<{
33 THROW
}>
}>
}>
recv_external PROC:<{
~load_sigs CALLDICT
s3 PUSH
32 LDU
DROP
s0 s4 XCHG
LDGRAMS
1 LDU
load_storage CALLDICT
s3 POP
s3 POP
s4 POP
s14 s3 PUSH2
SUB
s4 POP
s3 PUSH
1 GTINT
33 THROWIF
s3 PUSH
0 LESSINT
34 THROWIF
s0 s3 XCHG
IF:<{
s2 POP
3 EQINT
35 THROWIFNOT
s7 PUSH
0 PUSHINT
s0 s2 XCHG
SUB
s12 PUSH
1 MODPOW2#
s13 POP
s0 s12 XCHG
IF:<{
s2 POP
s0 s10 XCHG
0 LESSINT
36 THROWIF
s9 s5 PUSH2
SUB
s6 POP
s9 POP
s0 s4 XCHG
0 LESSINT
37 THROWIF
}>ELSE<{
NIP
s0 s10 XCHG
0 GTINT
36 THROWIF
s0 s5 PUSH2
ADD
NIP
s5 POP
s0 s4 XCHG
0 LESSINT
37 THROWIF
}>
}>ELSE<{
s3 POP
s3 POP
s11 POP
OVER
3 EQINT
35 THROWIF
s6 s6 XCPU
EQUAL
s6 POP
s0 s5 XCHG
38 THROWIFNOT
s3 s8 XCPU
EQUAL
39 THROWIFNOT
s3 s7 XCHG
s2 s3 XCHG
}>
ACCEPT
SWAP
HASHSU
s7 PUSH
NOT
s1 s7 XCHG
AND
DUP
1 PUSHINT
AND
IF:<{
s5 PUSH
CTOS
s6 POP
s0 s5 XCHG
9 PUSHPOW2
PLDSLICEX
s6 s1 s(-1) PU2XC
CHKSIGNU
NIP
39 THROWIFNOT
s0 s5 XCHG
1 PUSHINT
OR
}>ELSE<{
s7 s1 s5 XCHG3
2DROP
}>
s0 s3 XCHG
2 PUSHINT
AND
IF:<{
OVER
CTOS
s2 POP
SWAP
9 PUSHPOW2
PLDSLICEX
s3 s0 s3 XC2PU
CHKSIGNU
s2 POP
SWAP
40 THROWIFNOT
2 PUSHINT
OR
}>ELSE<{
s2 s3 XCHG
3 BLKDROP
}>
DUP
3 EQINT
NIP
OVER
AND
NIP
IF:<{
}>
}>
seqNo PROC:<{
c4 PUSH
CTOS
9 PUSHPOW2
SDSKIPFIRST
LDGRAMS
NIP
LDGRAMS
NIP
LDREF
NIP
skip_sigs CALLDICT
32 PLDU
}>
getDelta PROC:<{
c4 PUSH
CTOS
9 PUSHPOW2
SDSKIPFIRST
LDGRAMS
NIP
LDGRAMS
NIP
LDREF
NIP
skip_sigs CALLDICT
32 PUSHINT
SDSKIPFIRST
LDGRAMS
DROP
}>
isTurnA PROC:<{
seqNo CALLDICT
1 MODPOW2#
NOT
}>
isTurnB PROC:<{
seqNo CALLDICT
1 MODPOW2#
}>
getAmountA PROC:<{
c4 PUSH
CTOS
9 PUSHPOW2
SDSKIPFIRST
LDGRAMS
DROP
}>
getAmountB PROC:<{
c4 PUSH
CTOS
9 PUSHPOW2
SDSKIPFIRST
LDGRAMS
NIP
LDGRAMS
DROP
}>
getAddrA PROC:<{
c4 PUSH
CTOS
9 PUSHPOW2
SDSKIPFIRST
LDGRAMS
NIP
LDGRAMS
NIP
PLDREF
CTOS
8 LDI
256 PLDU
}>
getAddrB PROC:<{
c4 PUSH
CTOS
9 PUSHPOW2
SDSKIPFIRST
LDGRAMS
NIP
LDGRAMS
NIP
PLDREF
CTOS
264 PUSHINT
SDSKIPFIRST
8 LDI
256 PLDU
}>
getSignatures PROC:<{
c4 PUSH
CTOS
9 PUSHPOW2
SDSKIPFIRST
LDGRAMS
NIP
LDGRAMS
NIP
LDREF
NIP
preload_sigs CALLDICT
}>
hasSignatureA PROC:<{
getSignatures CALLDICT
2DROP
1 PUSHINT
AND
}>
hasSignatureB PROC:<{
getSignatures CALLDICT
2DROP
2 PUSHINT
AND
}>
getHash PROC:<{
c4 PUSH
CTOS
9 PUSHPOW2
SDSKIPFIRST
LDGRAMS
NIP
LDGRAMS
NIP
LDREF
NIP
skip_sigs CALLDICT
HASHSU
}>
}END>c