Advertisement
shssoichiro

Untitled

Jan 22nd, 2023
1,465
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. example::divu_gen:
  2.         push    rax
  3.         lzcnt   ecx, esi
  4.         mov     eax, 32
  5.         mov     r9d, -1
  6.         sub     eax, ecx
  7.         blsr    ecx, esi
  8.         mov     ecx, -1
  9.         lea     r8, [rax - 1]
  10.         je      .LBB0_3
  11.         jb      .LBB0_4
  12.         mov     edx, 2147483648
  13.         mov     ecx, esi
  14.         xor     r9d, r9d
  15.         shlx    rax, rdx, rax
  16.         xor     edx, edx
  17.         div     rcx
  18.         mov     ecx, 1
  19.         shlx    r10, rcx, r8
  20.         xor     ecx, ecx
  21.         mov     edx, eax
  22.         imul    edx, esi
  23.         add     edx, esi
  24.         cmp     rdx, r10
  25.         setbe   cl
  26.         cmova   r9d, eax
  27.         add     ecx, eax
  28. .LBB0_3:
  29.         mov     dword ptr [rdi], ecx
  30.         mov     dword ptr [rdi + 4], r9d
  31.         mov     dword ptr [rdi + 8], r8d
  32.         mov     rax, rdi
  33.         pop     rcx
  34.         ret
  35. .LBB0_4:
  36.         lea     rdi, [rip + str.0]
  37.         lea     rdx, [rip + .L__unnamed_1]
  38.         mov     esi, 25
  39.         call    qword ptr [rip + core::panicking::panic@GOTPCREL]
  40.         ud2
  41.  
  42. .L__unnamed_2:
  43.         .ascii  "/app/example.rs"
  44.  
  45. .L__unnamed_1:
  46.         .quad   .L__unnamed_2
  47.         .asciz  "\017\000\000\000\000\000\000\000\n\000\000\000\r\000\000"
  48.  
  49. str.0:
  50.         .ascii  "attempt to divide by zero"
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement