Skip to content

Instantly share code, notes, and snippets.

@dolpheen
Created July 27, 2020 06:20
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 dolpheen/caaa706e92a42419565aa395ae06605e to your computer and use it in GitHub Desktop.
Save dolpheen/caaa706e92a42419565aa395ae06605e to your computer and use it in GitHub Desktop.
test_int ASM source
;; B0
;; B1
;; Invocation Count Check
0x11272abf0 498b7c2437 movq rdi,[r12+0x37]
0x11272abf5 ff8783000000 incl [rdi+0x83]
0x11272abfb 81bf8300000028230000 cmpl [rdi+0x83],0x2328
0x11272ac05 7c07 jl 0x000000011272ac0e
0x11272ac07 41ffa618020000 jmp [thr+0x218]
;; Enter frame
;; PrologueOffset = 30
0x11272ac0e 55 push rbp
0x11272ac0f 4889e5 movq rbp,rsp
0x11272ac12 4154 push r12
0x11272ac14 4157 push pp
0x11272ac16 4d8b7c2427 movq pp,[r12+0x27]
0x11272ac1b 4883ec20 subq rsp,0x20
;; Initialize spill slots
0x11272ac1f 498b86d0000000 movq rax,[thr+0xd0] null
0x11272ac26 488945e8 movq [rbp-0x18],rax
0x11272ac2a 488945e0 movq [rbp-0x20],rax
0x11272ac2e 488945d8 movq [rbp-0x28],rax
0x11272ac32 488945d0 movq [rbp-0x30],rax
;; Edge counter
0x11272ac36 498b470f movq rax,[pp+0xf]
0x11272ac3a 4883401f02 addq [rax+0x1f],2
;; CheckStackOverflow:8(stack=0, loop=0)
0x11272ac3f 493b6648 cmpq rsp,[thr+0x48]
0x11272ac43 0f86ac000000 jna 0x000000011272acf5
;; DebugStepCheck:10()
0x11272ac49 4d8b6717 movq r12,[pp+0x17]
0x11272ac4d 41ff542407 call [r12+0x7]
;; DebugStepCheck:12()
0x11272ac52 4d8b671f movq r12,[pp+0x1f]
0x11272ac56 41ff542407 call [r12+0x7]
;; t0 <- Constant(#null)
;; StoreLocal(k @-1, t0)
0x11272ac5b 498b86d0000000 movq rax,[thr+0xd0] null
0x11272ac62 488945e0 movq [rbp-0x20],rax
;; DebugStepCheck:14()
0x11272ac66 4d8b6727 movq r12,[pp+0x27]
0x11272ac6a 41ff542407 call [r12+0x7]
;; t0 <- Constant(#4)
;; StoreLocal(i @-2, t0)
0x11272ac6f b808000000 movl rax,8
0x11272ac74 488945d8 movq [rbp-0x28],rax
;; DebugStepCheck:16()
0x11272ac78 4d8b672f movq r12,[pp+0x2f]
0x11272ac7c 41ff542407 call [r12+0x7]
;; t0 <- Constant(#6)
;; StoreLocal(j @-3, t0)
0x11272ac81 b80c000000 movl rax,0xc
0x11272ac86 488945d0 movq [rbp-0x30],rax
;; t0 <- LoadLocal(i @-2)
0x11272ac8a ff75d8 push [rbp-0x28]
;; t1 <- LoadLocal(j @-3)
0x11272ac8d ff75d0 push [rbp-0x30]
;; t0 <- InstanceCall:18( +<0>, t0, t1)
0x11272ac90 488b542408 movq rdx,[rsp+0x8]
0x11272ac95 498b5f37 movq rbx,[pp+0x37]
0x11272ac99 4d8b673f movq r12,[pp+0x3f]
0x11272ac9d 41ff54240f call [r12+0xf]
0x11272aca2 59 pop rcx
0x11272aca3 59 pop rcx
;; StoreLocal(k @-1, t0)
0x11272aca4 488945e0 movq [rbp-0x20],rax
;; t0 <- LoadLocal(i @-2)
0x11272aca8 ff75d8 push [rbp-0x28]
;; StaticCall:20( print<0> t0)
0x11272acab 498b5f47 movq rbx,[pp+0x47]
0x11272acaf 4d8b674f movq r12,[pp+0x4f]
0x11272acb3 41ff542407 call [r12+0x7]
0x11272acb8 59 pop rcx
;; t0 <- LoadLocal(j @-3)
0x11272acb9 ff75d0 push [rbp-0x30]
;; StaticCall:22( print<0> t0)
0x11272acbc 498b5f57 movq rbx,[pp+0x57]
0x11272acc0 4d8b675f movq r12,[pp+0x5f]
0x11272acc4 41ff542407 call [r12+0x7]
0x11272acc9 59 pop rcx
;; t0 <- LoadLocal(k @-1)
0x11272acca ff75e0 push [rbp-0x20]
;; StaticCall:24( print<0> t0)
0x11272accd 498b5f67 movq rbx,[pp+0x67]
0x11272acd1 4d8b676f movq r12,[pp+0x6f]
0x11272acd5 41ff542407 call [r12+0x7]
0x11272acda 59 pop rcx
;; t0 <- Constant(#null)
0x11272acdb 41ffb6d0000000 push [thr+0xd0]
;; DebugStepCheck:26()
0x11272ace2 4d8b6777 movq r12,[pp+0x77]
0x11272ace6 41ff542407 call [r12+0x7]
;; Return:28(t0)
0x11272aceb 58 pop rax
0x11272acec 4c8b7df0 movq pp,[rbp-0x10]
0x11272acf0 4889ec movq rsp,rbp
0x11272acf3 5d pop rbp
0x11272acf4 c3 ret
;; CheckStackOverflowSlowPath
0x11272acf5 498b9ec0030000 movq rbx,[thr+0x3c0]
0x11272acfc 4533d2 xorl r10,r10
0x11272acff 41ff96c0010000 call [thr+0x1c0]
0x11272ad06 e93effffff jmp 0x000000011272ac49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment