Skip to content

Instantly share code, notes, and snippets.

@d1m0
Created January 30, 2019 22:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save d1m0/3f137f1adc29c62ea6a8e21ee066819f to your computer and use it in GitHub Desktop.
Save d1m0/3f137f1adc29c62ea6a8e21ee066819f to your computer and use it in GitHub Desktop.
/* "sdiv.sol":61:164 contract sdiv {... */
mstore(0x40, 0x80)
callvalue
/* "--CODEGEN--":8:17 */
dup1
/* "--CODEGEN--":5:7 */
iszero
tag_1
jumpi
/* "--CODEGEN--":30:31 */
0x0
/* "--CODEGEN--":27:28 */
dup1
/* "--CODEGEN--":20:32 */
revert
/* "--CODEGEN--":5:7 */
tag_1:
/* "sdiv.sol":61:164 contract sdiv {... */
pop
dataSize(sub_0)
dup1
dataOffset(sub_0)
0x0
codecopy
0x0
return
stop
sub_0: assembly {
/* "sdiv.sol":61:164 contract sdiv {... */
mstore(0x40, 0x80)
jumpi(tag_1, lt(calldatasize, 0x4))
calldataload(0x0)
0x100000000000000000000000000000000000000000000000000000000
swap1
div
0xffffffff
and
dup1
0x168382b8
eq
tag_2
jumpi
tag_1:
0x0
dup1
revert
/* "sdiv.sol":80:162 function f(int32 a, int32 b) public pure returns (int32 ret) {... */
tag_2:
callvalue
/* "--CODEGEN--":8:17 */
dup1
/* "--CODEGEN--":5:7 */
iszero
tag_3
jumpi
/* "--CODEGEN--":30:31 */
0x0
/* "--CODEGEN--":27:28 */
dup1
/* "--CODEGEN--":20:32 */
revert
/* "--CODEGEN--":5:7 */
tag_3:
/* "sdiv.sol":80:162 function f(int32 a, int32 b) public pure returns (int32 ret) {... */
pop
tag_4
0x4
dup1
calldatasize
sub
dup2
add
swap1
dup1
dup1
calldataload
0x3
signextend
swap1
0x20
add
swap1
swap3
swap2
swap1
dup1
calldataload
0x3
signextend
swap1
0x20
add
swap1
swap3
swap2
swap1
pop
pop
pop
jump(tag_5)
tag_4:
mload(0x40)
dup1
dup3
0x3
signextend
0x3
signextend
dup2
mstore
0x20
add
swap2
pop
pop
mload(0x40)
dup1
swap2
sub
swap1
return
tag_5:
/* "sdiv.sol":130:139 int32 ret */
0x0
/* "sdiv.sol":156:157 b */
dup2
/* "sdiv.sol":154:157 a/b */
0x3
signextend
/* "sdiv.sol":154:155 a */
dup4
/* "sdiv.sol":154:157 a/b */
0x3
signextend
dup2
iszero
iszero
tag_7
jumpi
invalid
tag_7:
sdiv
/* "sdiv.sol":147:157 return a/b */
swap1
pop
/* "sdiv.sol":80:162 function f(int32 a, int32 b) public pure returns (int32 ret) {... */
swap3
swap2
pop
pop
jump // out
auxdata: 0xa165627a7a7230582071652927ab00ddcf93a616f3df22f0903557ced1d0242e13dafc16f5e3a2e4620029
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment