Advertisement
Guest User

Untitled

a guest
Feb 1st, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .data
  2. .text
  3. .global tree_find
  4. tree_find:
  5.     pushl       %ebp
  6.     movl        %esp, %ebp
  7.     pushl       %edi
  8.     pushl       %ebx
  9.     pushl       %esi
  10.  
  11.     movl        8(%ebp), %eax
  12.     cmpl        $0, %eax
  13.     jz          l5
  14.     movsd       12(%ebp), %xmm0
  15.     movl        20(%ebp), %ebx
  16.  
  17.     movsd       (%eax), %xmm1
  18.     movl        8(%eax), %ecx
  19.     movl        12(%eax), %edx
  20.     movl        16(%eax), %edi
  21.  
  22.     subsd       %xmm0, %xmm1
  23.     movl        $0, %esi
  24.     cvtsi2sd    %esi, %xmm7
  25.     comisd      %xmm7, %xmm1
  26.     jae         l1
  27.     movl        $-1, %esi
  28.     cvtsi2sd    %esi, %xmm2
  29.     mulpd       %xmm2, %xmm1
  30. l1:
  31.     movl        $1, %esi
  32.     cvtsi2sd    %esi, %xmm3
  33.     movl        $100000000, %esi
  34.     cvtsi2sd    %esi, %xmm2
  35.     divpd       %xmm2, %xmm3
  36.     comisd      %xmm3, %xmm1
  37.  
  38.     jbe         l2
  39.    
  40.     pushl       %ebx
  41.     subl        $8, %esp
  42.     movsd       %xmm0, (%esp)
  43.  
  44.     movsd       (%eax), %xmm1
  45.     comisd      %xmm1, %xmm0
  46.     ja          l3
  47.     pushl       %ecx
  48.     jmp         l4
  49. l3:
  50.     pushl       %edx
  51. l4:
  52.     call        tree_find
  53.     addl        $16, %esp
  54.     jmp         l5
  55. l2:
  56.     cmpl        $0, %ebx
  57.     jz          l6
  58.     movl        %edi, (%ebx)
  59. l6:
  60.     movl        $1, %eax
  61. l5:
  62.     popl        %esi
  63.     popl        %ebx
  64.     popl        %edi
  65.     popl        %ebp
  66.     ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement