lucasribeiroc

Speedr 0.9.0beta-rc19.4 commented disassembly (Lusca code)

May 24th, 2012
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.93 KB | None | 0 0
  1. # Called by:
  2. # commConnectHandle
  3. # commClose
  4. # commUpdateEvents
  5.  
  6. 00000000004a7070 <commSetEvents>:
  7.  
  8. 4a7070: mov %rbx,-0x28(%rsp)
  9. 4a7075: mov %rbp,-0x20(%rsp)
  10. 4a707a: mov %edi,%ebp # ebp: fd
  11. 4a707c: mov %r12,-0x18(%rsp)
  12. 4a7081: mov %r13,-0x10(%rsp)
  13. 4a7086: mov %esi,%r12d # r12d: need_read
  14. 4a7089: mov %r14,-0x8(%rsp)
  15. 4a708e: sub $0x28,%rsp
  16. #
  17. # int st_new = (need_read ? STATE_READ : 0) |
  18. # (need_write ? STATE_WRITE : 0);
  19. #
  20. 4a7092: cmp $0x1,%edx # edx: need_write
  21. 4a7095: sbb %ebx,%ebx
  22. 4a7097: xor %eax,%eax
  23. 4a7099: mov %edx,%r13d
  24. 4a709c: not %ebx
  25. 4a709e: and $0x2,%ebx
  26. 4a70a1: test %esi,%esi
  27. 4a70a3: setne %al
  28. 4a70a6: or %eax,%ebx # ebx: st_new
  29. #
  30. # assert(fd >= 0);
  31. #
  32. 4a70a8: test %edi,%edi
  33. 4a70aa: js 4a7221 <commSetEvents+0x1b1>
  34. #
  35. #Jump from 4a7235:
  36. #
  37. # debug(5, 8) ("commSetEvents(fd=%d, read=%d, write=%d)\n",
  38. # fd, need_read, need_write);
  39. #
  40. 4a70b0: cmpl $0x7,0x267c3d(%rip) # 70ecf4 <debugLevels+0x14>
  41. 4a70b7: movl $0x8,0x267daf(%rip) # 70ee70 <_db_level>
  42. 4a70c1: jg 4a7208 <commSetEvents+0x198>
  43. #
  44. #Jump from 4a721c:
  45. #
  46. # st_change = kqueue_state[fd] ^ st_new;
  47. #
  48. 4a70c7: mov 0x22e12a(%rip),%rcx # 6d51f8 <kqueue_state.33801>
  49. 4a70ce: movslq %ebp,%rbp # rbp: fd
  50. 4a70d1: mov %ebx,%r14d # r14d: st_new
  51. 4a70d4: movzbl 0x0(%rbp,%rcx,1),%eax # eax: kqueue_state[fd]
  52. 4a70d9: xor %eax,%r14d # r14d: st_change
  53. #
  54. # if (!st_change)
  55. # return;
  56. #
  57. 4a70dc: je 4a71b0 <commSetEvents+0x140>
  58. #
  59. # if (kqoff >= kqmax - 2) {
  60. #
  61. 4a70e2: mov 0x22e108(%rip),%edx # 6d51f0 <kqmax.33799>
  62. 4a70e8: lea -0x2(%rdx),%eax
  63. 4a70eb: cmp 0x22e103(%rip),%eax # 6d51f4 <kqoff.33800>
  64. 4a70f1: jg 4a7150 <commSetEvents+0xe0>
  65. 4a70f3: mov 0x1583ef(%rip),%eax # 5ff4e8 <Squid_MaxFD>
  66. #
  67. # kqmax = kqmax + KE_QUEUE_STEP;
  68. #
  69. 4a70f9: sub $0xffffff80,%edx # edx: kqmax + KE_QUEUE_STEP
  70. 4a70fc: mov %edx,0x22e0ee(%rip) # 6d51f0 <kqmax.33799>
  71. #
  72. # assert(kqmax < Squid_MaxFD * 4);
  73. #
  74. 4a7102: shl $0x2,%eax # eax: Squid_MaxFD * 4
  75. 4a7105: cmp %eax,%edx
  76. 4a7107: jge 4a7240 <commSetEvents+0x1d0>
  77. #
  78. # kqlst = xrealloc(kqlst, sizeof(*kqlst) * kqmax);
  79. #
  80. 4a710d: movslq 0x22e0dc(%rip),%rsi # 6d51f0 <kqmax.33799>
  81. 4a7114: mov 0x22e0c5(%rip),%rdi # 6d51e0 <kqlst.33797>
  82. 4a711b: shl $0x5,%rsi
  83. 4a711f: callq 4b9440 <xrealloc>
  84. #
  85. # ke = xrealloc(ke, sizeof(*ke) * kqmax);
  86. #
  87. 4a7124: movslq 0x22e0c5(%rip),%rsi # 6d51f0 <kqmax.33799>
  88. 4a712b: mov 0x22e0b6(%rip),%rdi # 6d51e8 <ke.33798>
  89. 4a7132: mov %rax,0x22e0a7(%rip) # 6d51e0 <kqlst.33797>
  90. 4a7139: shl $0x5,%rsi
  91. 4a713d: callq 4b9440 <xrealloc>
  92. 4a7142: mov 0x22e0af(%rip),%rcx # 6d51f8 <kqueue_state.33801>
  93. 4a7149: mov %rax,0x22e098(%rip) # 6d51e8 <ke.33798>
  94. #
  95. #Conditional Jump from 4a71b0
  96. #
  97. # }
  98. #
  99. # kep = kqlst + kqof;
  100. #
  101. 4a7150: mov 0x22e09e(%rip),%esi # 6d51f4 <kqoff.33800>
  102. 4a7156: movslq %esi,%rdx
  103. 4a7159: shl $0x5,%rdx
  104. 4a715d: add 0x22e07c(%rip),%rdx # 6d51e0 <kqlst.33797>
  105. # rdx: kep
  106. #
  107. # if (st_change & STATE_READ) {
  108. #
  109. 4a7164: test $0x1,%r14b
  110. 4a7168: je 4a71a6 <commSetEvents+0x136>
  111. #
  112. # EV_SET(kep, (uintptr_t) fd, EVFILT_READ,
  113. # need_read ? EV_ADD : EV_DELETE, 0, 0, 0);
  114. #
  115. 4a716a: cmp $0x1,%r12d # r12d: need_read
  116. 4a716e: movl $0x0,0xc(%rdx)
  117. 4a7175: mov %rbp,(%rdx)
  118. 4a7178: sbb %eax,%eax
  119. 4a717a: movw $0xffff,0x8(%rdx)
  120. 4a7180: movq $0x0,0x10(%rdx)
  121. 4a7188: not %eax
  122. 4a718a: movq $0x0,0x18(%rdx)
  123. 4a7192: add $0x2,%eax
  124. 4a7195: mov %ax,0xa(%rdx)
  125. 4a7199: lea 0x1(%rsi),%eax
  126. 4a719c: add $0x20,%rdx # kep++;
  127. 4a71a0: mov %eax,0x22e04e(%rip) # 6d51f4 <kqoff.33800>
  128. #
  129. #Conditional Jump from 4a7168
  130. #
  131. # }
  132. #
  133. # if ( ! (st_change & STATE_WRITE) ) {
  134. #
  135. 4a71a6: and $0x2,%r14d
  136. 4a71aa: jne 4a71d0 <commSetEvents+0x160>
  137. #
  138. #Jump from 4a7206
  139. #
  140. #save_state_return:;
  141. #
  142. # kqueue_state[fd] = st_new;
  143. #
  144. 4a71ac: mov %bl,0x0(%rbp,%rcx,1)
  145. #
  146. #Restore registers and return
  147. #
  148. 4a71b0: mov (%rsp),%rbx
  149. 4a71b4: mov 0x8(%rsp),%rbp
  150. 4a71b9: mov 0x10(%rsp),%r12
  151. 4a71be: mov 0x18(%rsp),%r13
  152. 4a71c3: mov 0x20(%rsp),%r14
  153. 4a71c8: add $0x28,%rsp
  154. 4a71cc: retq
  155. #
  156. #Conditional Jump from 4a71aa
  157. #
  158. # }
  159. #
  160. # EV_SET(kep, (uintptr_t) fd, EVFILT_WRITE,
  161. # need_write ? EV_ADD : EV_DELETE, 0, 0, 0);
  162. #
  163. 4a71d0: cmp $0x1,%r13d # r13d: need_write
  164. 4a71d4: movl $0x0,0xc(%rdx)
  165. 4a71db: mov %rbp,(%rdx)
  166. 4a71de: sbb %eax,%eax
  167. 4a71e0: addl $0x1,0x22e00d(%rip) # 6d51f4 <kqoff.33800>
  168. 4a71e7: movw $0xfffe,0x8(%rdx)
  169. 4a71ed: not %eax
  170. 4a71ef: movq $0x0,0x10(%rdx)
  171. 4a71f7: movq $0x0,0x18(%rdx)
  172. 4a71ff: add $0x2,%eax
  173. 4a7202: mov %ax,0xa(%rdx)
  174. #
  175. # goto save_state_return;
  176. #
  177. 4a7206: jmp 4a71ac <commSetEvents+0x13c>
  178. ##
  179. #
  180. #Conditional Jump from 4a70c1
  181. #
  182. 4a7208: mov %r13d,%ecx
  183. 4a720b: mov %r12d,%edx
  184. 4a720e: mov %ebp,%esi
  185. 4a7210: mov $0x4f1760,%edi
  186. 4a7215: xor %eax,%eax
  187. 4a7217: callq 49b720 <_db_print>
  188. 4a721c: jmpq 4a70c7 <commSetEvents+0x57>
  189. ##
  190. #
  191. #Conditional Jump from 4a70aa
  192. #
  193. 4a7221: mov $0x77,%edx
  194. 4a7226: mov $0x4f2b1d,%esi
  195. 4a722b: mov $0x4e701d,%edi
  196. 4a7230: callq 49b8b0 <xassert>
  197. 4a7235: jmpq 4a70b0 <commSetEvents+0x40>
  198. ##
  199. #
  200. #Conditional Jump from 4a7107
  201. #
  202. 4a7240: mov $0x81,%edx
  203. 4a7245: mov $0x4f2b1d,%esi
  204. 4a724a: mov $0x4f2b2b,%edi
  205. 4a724f: callq 49b8b0 <xassert>
Advertisement
Add Comment
Please, Sign In to add comment