x86_64-mont.masm 26 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477
  1. OPTION DOTNAME
  2. .text$ SEGMENT ALIGN(256) 'CODE'
  3. EXTERN OPENSSL_ia32cap_P:NEAR
  4. PUBLIC bn_mul_mont
  5. ALIGN 16
  6. bn_mul_mont PROC PUBLIC
  7. mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
  8. mov QWORD PTR[16+rsp],rsi
  9. mov rax,rsp
  10. $L$SEH_begin_bn_mul_mont::
  11. mov rdi,rcx
  12. mov rsi,rdx
  13. mov rdx,r8
  14. mov rcx,r9
  15. mov r8,QWORD PTR[40+rsp]
  16. mov r9,QWORD PTR[48+rsp]
  17. mov r9d,r9d
  18. mov rax,rsp
  19. test r9d,3
  20. jnz $L$mul_enter
  21. cmp r9d,8
  22. jb $L$mul_enter
  23. mov r11d,DWORD PTR[((OPENSSL_ia32cap_P+8))]
  24. cmp rdx,rsi
  25. jne $L$mul4x_enter
  26. test r9d,7
  27. jz $L$sqr8x_enter
  28. jmp $L$mul4x_enter
  29. ALIGN 16
  30. $L$mul_enter::
  31. push rbx
  32. push rbp
  33. push r12
  34. push r13
  35. push r14
  36. push r15
  37. neg r9
  38. mov r11,rsp
  39. lea r10,QWORD PTR[((-16))+r9*8+rsp]
  40. neg r9
  41. and r10,-1024
  42. sub r11,r10
  43. and r11,-4096
  44. lea rsp,QWORD PTR[r11*1+r10]
  45. mov r11,QWORD PTR[rsp]
  46. cmp rsp,r10
  47. ja $L$mul_page_walk
  48. jmp $L$mul_page_walk_done
  49. ALIGN 16
  50. $L$mul_page_walk::
  51. lea rsp,QWORD PTR[((-4096))+rsp]
  52. mov r11,QWORD PTR[rsp]
  53. cmp rsp,r10
  54. ja $L$mul_page_walk
  55. $L$mul_page_walk_done::
  56. mov QWORD PTR[8+r9*8+rsp],rax
  57. $L$mul_body::
  58. mov r12,rdx
  59. mov r8,QWORD PTR[r8]
  60. mov rbx,QWORD PTR[r12]
  61. mov rax,QWORD PTR[rsi]
  62. xor r14,r14
  63. xor r15,r15
  64. mov rbp,r8
  65. mul rbx
  66. mov r10,rax
  67. mov rax,QWORD PTR[rcx]
  68. imul rbp,r10
  69. mov r11,rdx
  70. mul rbp
  71. add r10,rax
  72. mov rax,QWORD PTR[8+rsi]
  73. adc rdx,0
  74. mov r13,rdx
  75. lea r15,QWORD PTR[1+r15]
  76. jmp $L$1st_enter
  77. ALIGN 16
  78. $L$1st::
  79. add r13,rax
  80. mov rax,QWORD PTR[r15*8+rsi]
  81. adc rdx,0
  82. add r13,r11
  83. mov r11,r10
  84. adc rdx,0
  85. mov QWORD PTR[((-16))+r15*8+rsp],r13
  86. mov r13,rdx
  87. $L$1st_enter::
  88. mul rbx
  89. add r11,rax
  90. mov rax,QWORD PTR[r15*8+rcx]
  91. adc rdx,0
  92. lea r15,QWORD PTR[1+r15]
  93. mov r10,rdx
  94. mul rbp
  95. cmp r15,r9
  96. jne $L$1st
  97. add r13,rax
  98. mov rax,QWORD PTR[rsi]
  99. adc rdx,0
  100. add r13,r11
  101. adc rdx,0
  102. mov QWORD PTR[((-16))+r15*8+rsp],r13
  103. mov r13,rdx
  104. mov r11,r10
  105. xor rdx,rdx
  106. add r13,r11
  107. adc rdx,0
  108. mov QWORD PTR[((-8))+r9*8+rsp],r13
  109. mov QWORD PTR[r9*8+rsp],rdx
  110. lea r14,QWORD PTR[1+r14]
  111. jmp $L$outer
  112. ALIGN 16
  113. $L$outer::
  114. mov rbx,QWORD PTR[r14*8+r12]
  115. xor r15,r15
  116. mov rbp,r8
  117. mov r10,QWORD PTR[rsp]
  118. mul rbx
  119. add r10,rax
  120. mov rax,QWORD PTR[rcx]
  121. adc rdx,0
  122. imul rbp,r10
  123. mov r11,rdx
  124. mul rbp
  125. add r10,rax
  126. mov rax,QWORD PTR[8+rsi]
  127. adc rdx,0
  128. mov r10,QWORD PTR[8+rsp]
  129. mov r13,rdx
  130. lea r15,QWORD PTR[1+r15]
  131. jmp $L$inner_enter
  132. ALIGN 16
  133. $L$inner::
  134. add r13,rax
  135. mov rax,QWORD PTR[r15*8+rsi]
  136. adc rdx,0
  137. add r13,r10
  138. mov r10,QWORD PTR[r15*8+rsp]
  139. adc rdx,0
  140. mov QWORD PTR[((-16))+r15*8+rsp],r13
  141. mov r13,rdx
  142. $L$inner_enter::
  143. mul rbx
  144. add r11,rax
  145. mov rax,QWORD PTR[r15*8+rcx]
  146. adc rdx,0
  147. add r10,r11
  148. mov r11,rdx
  149. adc r11,0
  150. lea r15,QWORD PTR[1+r15]
  151. mul rbp
  152. cmp r15,r9
  153. jne $L$inner
  154. add r13,rax
  155. mov rax,QWORD PTR[rsi]
  156. adc rdx,0
  157. add r13,r10
  158. mov r10,QWORD PTR[r15*8+rsp]
  159. adc rdx,0
  160. mov QWORD PTR[((-16))+r15*8+rsp],r13
  161. mov r13,rdx
  162. xor rdx,rdx
  163. add r13,r11
  164. adc rdx,0
  165. add r13,r10
  166. adc rdx,0
  167. mov QWORD PTR[((-8))+r9*8+rsp],r13
  168. mov QWORD PTR[r9*8+rsp],rdx
  169. lea r14,QWORD PTR[1+r14]
  170. cmp r14,r9
  171. jb $L$outer
  172. xor r14,r14
  173. mov rax,QWORD PTR[rsp]
  174. mov r15,r9
  175. ALIGN 16
  176. $L$sub:: sbb rax,QWORD PTR[r14*8+rcx]
  177. mov QWORD PTR[r14*8+rdi],rax
  178. mov rax,QWORD PTR[8+r14*8+rsp]
  179. lea r14,QWORD PTR[1+r14]
  180. dec r15
  181. jnz $L$sub
  182. sbb rax,0
  183. mov rbx,-1
  184. xor rbx,rax
  185. xor r14,r14
  186. mov r15,r9
  187. $L$copy::
  188. mov rcx,QWORD PTR[r14*8+rdi]
  189. mov rdx,QWORD PTR[r14*8+rsp]
  190. and rcx,rbx
  191. and rdx,rax
  192. mov QWORD PTR[r14*8+rsp],r9
  193. or rdx,rcx
  194. mov QWORD PTR[r14*8+rdi],rdx
  195. lea r14,QWORD PTR[1+r14]
  196. sub r15,1
  197. jnz $L$copy
  198. mov rsi,QWORD PTR[8+r9*8+rsp]
  199. mov rax,1
  200. mov r15,QWORD PTR[((-48))+rsi]
  201. mov r14,QWORD PTR[((-40))+rsi]
  202. mov r13,QWORD PTR[((-32))+rsi]
  203. mov r12,QWORD PTR[((-24))+rsi]
  204. mov rbp,QWORD PTR[((-16))+rsi]
  205. mov rbx,QWORD PTR[((-8))+rsi]
  206. lea rsp,QWORD PTR[rsi]
  207. $L$mul_epilogue::
  208. mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue
  209. mov rsi,QWORD PTR[16+rsp]
  210. DB 0F3h,0C3h ;repret
  211. $L$SEH_end_bn_mul_mont::
  212. bn_mul_mont ENDP
  213. ALIGN 16
  214. bn_mul4x_mont PROC PRIVATE
  215. mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
  216. mov QWORD PTR[16+rsp],rsi
  217. mov rax,rsp
  218. $L$SEH_begin_bn_mul4x_mont::
  219. mov rdi,rcx
  220. mov rsi,rdx
  221. mov rdx,r8
  222. mov rcx,r9
  223. mov r8,QWORD PTR[40+rsp]
  224. mov r9,QWORD PTR[48+rsp]
  225. mov r9d,r9d
  226. mov rax,rsp
  227. $L$mul4x_enter::
  228. and r11d,080100h
  229. cmp r11d,080100h
  230. je $L$mulx4x_enter
  231. push rbx
  232. push rbp
  233. push r12
  234. push r13
  235. push r14
  236. push r15
  237. neg r9
  238. mov r11,rsp
  239. lea r10,QWORD PTR[((-32))+r9*8+rsp]
  240. neg r9
  241. and r10,-1024
  242. sub r11,r10
  243. and r11,-4096
  244. lea rsp,QWORD PTR[r11*1+r10]
  245. mov r11,QWORD PTR[rsp]
  246. cmp rsp,r10
  247. ja $L$mul4x_page_walk
  248. jmp $L$mul4x_page_walk_done
  249. $L$mul4x_page_walk::
  250. lea rsp,QWORD PTR[((-4096))+rsp]
  251. mov r11,QWORD PTR[rsp]
  252. cmp rsp,r10
  253. ja $L$mul4x_page_walk
  254. $L$mul4x_page_walk_done::
  255. mov QWORD PTR[8+r9*8+rsp],rax
  256. $L$mul4x_body::
  257. mov QWORD PTR[16+r9*8+rsp],rdi
  258. mov r12,rdx
  259. mov r8,QWORD PTR[r8]
  260. mov rbx,QWORD PTR[r12]
  261. mov rax,QWORD PTR[rsi]
  262. xor r14,r14
  263. xor r15,r15
  264. mov rbp,r8
  265. mul rbx
  266. mov r10,rax
  267. mov rax,QWORD PTR[rcx]
  268. imul rbp,r10
  269. mov r11,rdx
  270. mul rbp
  271. add r10,rax
  272. mov rax,QWORD PTR[8+rsi]
  273. adc rdx,0
  274. mov rdi,rdx
  275. mul rbx
  276. add r11,rax
  277. mov rax,QWORD PTR[8+rcx]
  278. adc rdx,0
  279. mov r10,rdx
  280. mul rbp
  281. add rdi,rax
  282. mov rax,QWORD PTR[16+rsi]
  283. adc rdx,0
  284. add rdi,r11
  285. lea r15,QWORD PTR[4+r15]
  286. adc rdx,0
  287. mov QWORD PTR[rsp],rdi
  288. mov r13,rdx
  289. jmp $L$1st4x
  290. ALIGN 16
  291. $L$1st4x::
  292. mul rbx
  293. add r10,rax
  294. mov rax,QWORD PTR[((-16))+r15*8+rcx]
  295. adc rdx,0
  296. mov r11,rdx
  297. mul rbp
  298. add r13,rax
  299. mov rax,QWORD PTR[((-8))+r15*8+rsi]
  300. adc rdx,0
  301. add r13,r10
  302. adc rdx,0
  303. mov QWORD PTR[((-24))+r15*8+rsp],r13
  304. mov rdi,rdx
  305. mul rbx
  306. add r11,rax
  307. mov rax,QWORD PTR[((-8))+r15*8+rcx]
  308. adc rdx,0
  309. mov r10,rdx
  310. mul rbp
  311. add rdi,rax
  312. mov rax,QWORD PTR[r15*8+rsi]
  313. adc rdx,0
  314. add rdi,r11
  315. adc rdx,0
  316. mov QWORD PTR[((-16))+r15*8+rsp],rdi
  317. mov r13,rdx
  318. mul rbx
  319. add r10,rax
  320. mov rax,QWORD PTR[r15*8+rcx]
  321. adc rdx,0
  322. mov r11,rdx
  323. mul rbp
  324. add r13,rax
  325. mov rax,QWORD PTR[8+r15*8+rsi]
  326. adc rdx,0
  327. add r13,r10
  328. adc rdx,0
  329. mov QWORD PTR[((-8))+r15*8+rsp],r13
  330. mov rdi,rdx
  331. mul rbx
  332. add r11,rax
  333. mov rax,QWORD PTR[8+r15*8+rcx]
  334. adc rdx,0
  335. lea r15,QWORD PTR[4+r15]
  336. mov r10,rdx
  337. mul rbp
  338. add rdi,rax
  339. mov rax,QWORD PTR[((-16))+r15*8+rsi]
  340. adc rdx,0
  341. add rdi,r11
  342. adc rdx,0
  343. mov QWORD PTR[((-32))+r15*8+rsp],rdi
  344. mov r13,rdx
  345. cmp r15,r9
  346. jb $L$1st4x
  347. mul rbx
  348. add r10,rax
  349. mov rax,QWORD PTR[((-16))+r15*8+rcx]
  350. adc rdx,0
  351. mov r11,rdx
  352. mul rbp
  353. add r13,rax
  354. mov rax,QWORD PTR[((-8))+r15*8+rsi]
  355. adc rdx,0
  356. add r13,r10
  357. adc rdx,0
  358. mov QWORD PTR[((-24))+r15*8+rsp],r13
  359. mov rdi,rdx
  360. mul rbx
  361. add r11,rax
  362. mov rax,QWORD PTR[((-8))+r15*8+rcx]
  363. adc rdx,0
  364. mov r10,rdx
  365. mul rbp
  366. add rdi,rax
  367. mov rax,QWORD PTR[rsi]
  368. adc rdx,0
  369. add rdi,r11
  370. adc rdx,0
  371. mov QWORD PTR[((-16))+r15*8+rsp],rdi
  372. mov r13,rdx
  373. xor rdi,rdi
  374. add r13,r10
  375. adc rdi,0
  376. mov QWORD PTR[((-8))+r15*8+rsp],r13
  377. mov QWORD PTR[r15*8+rsp],rdi
  378. lea r14,QWORD PTR[1+r14]
  379. ALIGN 4
  380. $L$outer4x::
  381. mov rbx,QWORD PTR[r14*8+r12]
  382. xor r15,r15
  383. mov r10,QWORD PTR[rsp]
  384. mov rbp,r8
  385. mul rbx
  386. add r10,rax
  387. mov rax,QWORD PTR[rcx]
  388. adc rdx,0
  389. imul rbp,r10
  390. mov r11,rdx
  391. mul rbp
  392. add r10,rax
  393. mov rax,QWORD PTR[8+rsi]
  394. adc rdx,0
  395. mov rdi,rdx
  396. mul rbx
  397. add r11,rax
  398. mov rax,QWORD PTR[8+rcx]
  399. adc rdx,0
  400. add r11,QWORD PTR[8+rsp]
  401. adc rdx,0
  402. mov r10,rdx
  403. mul rbp
  404. add rdi,rax
  405. mov rax,QWORD PTR[16+rsi]
  406. adc rdx,0
  407. add rdi,r11
  408. lea r15,QWORD PTR[4+r15]
  409. adc rdx,0
  410. mov QWORD PTR[rsp],rdi
  411. mov r13,rdx
  412. jmp $L$inner4x
  413. ALIGN 16
  414. $L$inner4x::
  415. mul rbx
  416. add r10,rax
  417. mov rax,QWORD PTR[((-16))+r15*8+rcx]
  418. adc rdx,0
  419. add r10,QWORD PTR[((-16))+r15*8+rsp]
  420. adc rdx,0
  421. mov r11,rdx
  422. mul rbp
  423. add r13,rax
  424. mov rax,QWORD PTR[((-8))+r15*8+rsi]
  425. adc rdx,0
  426. add r13,r10
  427. adc rdx,0
  428. mov QWORD PTR[((-24))+r15*8+rsp],r13
  429. mov rdi,rdx
  430. mul rbx
  431. add r11,rax
  432. mov rax,QWORD PTR[((-8))+r15*8+rcx]
  433. adc rdx,0
  434. add r11,QWORD PTR[((-8))+r15*8+rsp]
  435. adc rdx,0
  436. mov r10,rdx
  437. mul rbp
  438. add rdi,rax
  439. mov rax,QWORD PTR[r15*8+rsi]
  440. adc rdx,0
  441. add rdi,r11
  442. adc rdx,0
  443. mov QWORD PTR[((-16))+r15*8+rsp],rdi
  444. mov r13,rdx
  445. mul rbx
  446. add r10,rax
  447. mov rax,QWORD PTR[r15*8+rcx]
  448. adc rdx,0
  449. add r10,QWORD PTR[r15*8+rsp]
  450. adc rdx,0
  451. mov r11,rdx
  452. mul rbp
  453. add r13,rax
  454. mov rax,QWORD PTR[8+r15*8+rsi]
  455. adc rdx,0
  456. add r13,r10
  457. adc rdx,0
  458. mov QWORD PTR[((-8))+r15*8+rsp],r13
  459. mov rdi,rdx
  460. mul rbx
  461. add r11,rax
  462. mov rax,QWORD PTR[8+r15*8+rcx]
  463. adc rdx,0
  464. add r11,QWORD PTR[8+r15*8+rsp]
  465. adc rdx,0
  466. lea r15,QWORD PTR[4+r15]
  467. mov r10,rdx
  468. mul rbp
  469. add rdi,rax
  470. mov rax,QWORD PTR[((-16))+r15*8+rsi]
  471. adc rdx,0
  472. add rdi,r11
  473. adc rdx,0
  474. mov QWORD PTR[((-32))+r15*8+rsp],rdi
  475. mov r13,rdx
  476. cmp r15,r9
  477. jb $L$inner4x
  478. mul rbx
  479. add r10,rax
  480. mov rax,QWORD PTR[((-16))+r15*8+rcx]
  481. adc rdx,0
  482. add r10,QWORD PTR[((-16))+r15*8+rsp]
  483. adc rdx,0
  484. mov r11,rdx
  485. mul rbp
  486. add r13,rax
  487. mov rax,QWORD PTR[((-8))+r15*8+rsi]
  488. adc rdx,0
  489. add r13,r10
  490. adc rdx,0
  491. mov QWORD PTR[((-24))+r15*8+rsp],r13
  492. mov rdi,rdx
  493. mul rbx
  494. add r11,rax
  495. mov rax,QWORD PTR[((-8))+r15*8+rcx]
  496. adc rdx,0
  497. add r11,QWORD PTR[((-8))+r15*8+rsp]
  498. adc rdx,0
  499. lea r14,QWORD PTR[1+r14]
  500. mov r10,rdx
  501. mul rbp
  502. add rdi,rax
  503. mov rax,QWORD PTR[rsi]
  504. adc rdx,0
  505. add rdi,r11
  506. adc rdx,0
  507. mov QWORD PTR[((-16))+r15*8+rsp],rdi
  508. mov r13,rdx
  509. xor rdi,rdi
  510. add r13,r10
  511. adc rdi,0
  512. add r13,QWORD PTR[r9*8+rsp]
  513. adc rdi,0
  514. mov QWORD PTR[((-8))+r15*8+rsp],r13
  515. mov QWORD PTR[r15*8+rsp],rdi
  516. cmp r14,r9
  517. jb $L$outer4x
  518. mov rdi,QWORD PTR[16+r9*8+rsp]
  519. lea r15,QWORD PTR[((-4))+r9]
  520. mov rax,QWORD PTR[rsp]
  521. mov rdx,QWORD PTR[8+rsp]
  522. shr r15,2
  523. lea rsi,QWORD PTR[rsp]
  524. xor r14,r14
  525. sub rax,QWORD PTR[rcx]
  526. mov rbx,QWORD PTR[16+rsi]
  527. mov rbp,QWORD PTR[24+rsi]
  528. sbb rdx,QWORD PTR[8+rcx]
  529. $L$sub4x::
  530. mov QWORD PTR[r14*8+rdi],rax
  531. mov QWORD PTR[8+r14*8+rdi],rdx
  532. sbb rbx,QWORD PTR[16+r14*8+rcx]
  533. mov rax,QWORD PTR[32+r14*8+rsi]
  534. mov rdx,QWORD PTR[40+r14*8+rsi]
  535. sbb rbp,QWORD PTR[24+r14*8+rcx]
  536. mov QWORD PTR[16+r14*8+rdi],rbx
  537. mov QWORD PTR[24+r14*8+rdi],rbp
  538. sbb rax,QWORD PTR[32+r14*8+rcx]
  539. mov rbx,QWORD PTR[48+r14*8+rsi]
  540. mov rbp,QWORD PTR[56+r14*8+rsi]
  541. sbb rdx,QWORD PTR[40+r14*8+rcx]
  542. lea r14,QWORD PTR[4+r14]
  543. dec r15
  544. jnz $L$sub4x
  545. mov QWORD PTR[r14*8+rdi],rax
  546. mov rax,QWORD PTR[32+r14*8+rsi]
  547. sbb rbx,QWORD PTR[16+r14*8+rcx]
  548. mov QWORD PTR[8+r14*8+rdi],rdx
  549. sbb rbp,QWORD PTR[24+r14*8+rcx]
  550. mov QWORD PTR[16+r14*8+rdi],rbx
  551. sbb rax,0
  552. mov QWORD PTR[24+r14*8+rdi],rbp
  553. pxor xmm0,xmm0
  554. DB 102,72,15,110,224
  555. pcmpeqd xmm5,xmm5
  556. pshufd xmm4,xmm4,0
  557. mov r15,r9
  558. pxor xmm5,xmm4
  559. shr r15,2
  560. xor eax,eax
  561. jmp $L$copy4x
  562. ALIGN 16
  563. $L$copy4x::
  564. movdqa xmm1,XMMWORD PTR[rax*1+rsp]
  565. movdqu xmm2,XMMWORD PTR[rax*1+rdi]
  566. pand xmm1,xmm4
  567. pand xmm2,xmm5
  568. movdqa xmm3,XMMWORD PTR[16+rax*1+rsp]
  569. movdqa XMMWORD PTR[rax*1+rsp],xmm0
  570. por xmm1,xmm2
  571. movdqu xmm2,XMMWORD PTR[16+rax*1+rdi]
  572. movdqu XMMWORD PTR[rax*1+rdi],xmm1
  573. pand xmm3,xmm4
  574. pand xmm2,xmm5
  575. movdqa XMMWORD PTR[16+rax*1+rsp],xmm0
  576. por xmm3,xmm2
  577. movdqu XMMWORD PTR[16+rax*1+rdi],xmm3
  578. lea rax,QWORD PTR[32+rax]
  579. dec r15
  580. jnz $L$copy4x
  581. mov rsi,QWORD PTR[8+r9*8+rsp]
  582. mov rax,1
  583. mov r15,QWORD PTR[((-48))+rsi]
  584. mov r14,QWORD PTR[((-40))+rsi]
  585. mov r13,QWORD PTR[((-32))+rsi]
  586. mov r12,QWORD PTR[((-24))+rsi]
  587. mov rbp,QWORD PTR[((-16))+rsi]
  588. mov rbx,QWORD PTR[((-8))+rsi]
  589. lea rsp,QWORD PTR[rsi]
  590. $L$mul4x_epilogue::
  591. mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue
  592. mov rsi,QWORD PTR[16+rsp]
  593. DB 0F3h,0C3h ;repret
  594. $L$SEH_end_bn_mul4x_mont::
  595. bn_mul4x_mont ENDP
  596. EXTERN bn_sqrx8x_internal:NEAR
  597. EXTERN bn_sqr8x_internal:NEAR
  598. ALIGN 32
  599. bn_sqr8x_mont PROC PRIVATE
  600. mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
  601. mov QWORD PTR[16+rsp],rsi
  602. mov rax,rsp
  603. $L$SEH_begin_bn_sqr8x_mont::
  604. mov rdi,rcx
  605. mov rsi,rdx
  606. mov rdx,r8
  607. mov rcx,r9
  608. mov r8,QWORD PTR[40+rsp]
  609. mov r9,QWORD PTR[48+rsp]
  610. mov rax,rsp
  611. $L$sqr8x_enter::
  612. push rbx
  613. push rbp
  614. push r12
  615. push r13
  616. push r14
  617. push r15
  618. $L$sqr8x_prologue::
  619. mov r10d,r9d
  620. shl r9d,3
  621. shl r10,3+2
  622. neg r9
  623. lea r11,QWORD PTR[((-64))+r9*2+rsp]
  624. mov rbp,rsp
  625. mov r8,QWORD PTR[r8]
  626. sub r11,rsi
  627. and r11,4095
  628. cmp r10,r11
  629. jb $L$sqr8x_sp_alt
  630. sub rbp,r11
  631. lea rbp,QWORD PTR[((-64))+r9*2+rbp]
  632. jmp $L$sqr8x_sp_done
  633. ALIGN 32
  634. $L$sqr8x_sp_alt::
  635. lea r10,QWORD PTR[((4096-64))+r9*2]
  636. lea rbp,QWORD PTR[((-64))+r9*2+rbp]
  637. sub r11,r10
  638. mov r10,0
  639. cmovc r11,r10
  640. sub rbp,r11
  641. $L$sqr8x_sp_done::
  642. and rbp,-64
  643. mov r11,rsp
  644. sub r11,rbp
  645. and r11,-4096
  646. lea rsp,QWORD PTR[rbp*1+r11]
  647. mov r10,QWORD PTR[rsp]
  648. cmp rsp,rbp
  649. ja $L$sqr8x_page_walk
  650. jmp $L$sqr8x_page_walk_done
  651. ALIGN 16
  652. $L$sqr8x_page_walk::
  653. lea rsp,QWORD PTR[((-4096))+rsp]
  654. mov r10,QWORD PTR[rsp]
  655. cmp rsp,rbp
  656. ja $L$sqr8x_page_walk
  657. $L$sqr8x_page_walk_done::
  658. mov r10,r9
  659. neg r9
  660. mov QWORD PTR[32+rsp],r8
  661. mov QWORD PTR[40+rsp],rax
  662. $L$sqr8x_body::
  663. DB 102,72,15,110,209
  664. pxor xmm0,xmm0
  665. DB 102,72,15,110,207
  666. DB 102,73,15,110,218
  667. mov eax,DWORD PTR[((OPENSSL_ia32cap_P+8))]
  668. and eax,080100h
  669. cmp eax,080100h
  670. jne $L$sqr8x_nox
  671. call bn_sqrx8x_internal
  672. lea rbx,QWORD PTR[rcx*1+r8]
  673. mov r9,rcx
  674. mov rdx,rcx
  675. DB 102,72,15,126,207
  676. sar rcx,3+2
  677. jmp $L$sqr8x_sub
  678. ALIGN 32
  679. $L$sqr8x_nox::
  680. call bn_sqr8x_internal
  681. lea rbx,QWORD PTR[r9*1+rdi]
  682. mov rcx,r9
  683. mov rdx,r9
  684. DB 102,72,15,126,207
  685. sar rcx,3+2
  686. jmp $L$sqr8x_sub
  687. ALIGN 32
  688. $L$sqr8x_sub::
  689. mov r12,QWORD PTR[rbx]
  690. mov r13,QWORD PTR[8+rbx]
  691. mov r14,QWORD PTR[16+rbx]
  692. mov r15,QWORD PTR[24+rbx]
  693. lea rbx,QWORD PTR[32+rbx]
  694. sbb r12,QWORD PTR[rbp]
  695. sbb r13,QWORD PTR[8+rbp]
  696. sbb r14,QWORD PTR[16+rbp]
  697. sbb r15,QWORD PTR[24+rbp]
  698. lea rbp,QWORD PTR[32+rbp]
  699. mov QWORD PTR[rdi],r12
  700. mov QWORD PTR[8+rdi],r13
  701. mov QWORD PTR[16+rdi],r14
  702. mov QWORD PTR[24+rdi],r15
  703. lea rdi,QWORD PTR[32+rdi]
  704. inc rcx
  705. jnz $L$sqr8x_sub
  706. sbb rax,0
  707. lea rbx,QWORD PTR[r9*1+rbx]
  708. lea rdi,QWORD PTR[r9*1+rdi]
  709. DB 102,72,15,110,200
  710. pxor xmm0,xmm0
  711. pshufd xmm1,xmm1,0
  712. mov rsi,QWORD PTR[40+rsp]
  713. jmp $L$sqr8x_cond_copy
  714. ALIGN 32
  715. $L$sqr8x_cond_copy::
  716. movdqa xmm2,XMMWORD PTR[rbx]
  717. movdqa xmm3,XMMWORD PTR[16+rbx]
  718. lea rbx,QWORD PTR[32+rbx]
  719. movdqu xmm4,XMMWORD PTR[rdi]
  720. movdqu xmm5,XMMWORD PTR[16+rdi]
  721. lea rdi,QWORD PTR[32+rdi]
  722. movdqa XMMWORD PTR[(-32)+rbx],xmm0
  723. movdqa XMMWORD PTR[(-16)+rbx],xmm0
  724. movdqa XMMWORD PTR[(-32)+rdx*1+rbx],xmm0
  725. movdqa XMMWORD PTR[(-16)+rdx*1+rbx],xmm0
  726. pcmpeqd xmm0,xmm1
  727. pand xmm2,xmm1
  728. pand xmm3,xmm1
  729. pand xmm4,xmm0
  730. pand xmm5,xmm0
  731. pxor xmm0,xmm0
  732. por xmm4,xmm2
  733. por xmm5,xmm3
  734. movdqu XMMWORD PTR[(-32)+rdi],xmm4
  735. movdqu XMMWORD PTR[(-16)+rdi],xmm5
  736. add r9,32
  737. jnz $L$sqr8x_cond_copy
  738. mov rax,1
  739. mov r15,QWORD PTR[((-48))+rsi]
  740. mov r14,QWORD PTR[((-40))+rsi]
  741. mov r13,QWORD PTR[((-32))+rsi]
  742. mov r12,QWORD PTR[((-24))+rsi]
  743. mov rbp,QWORD PTR[((-16))+rsi]
  744. mov rbx,QWORD PTR[((-8))+rsi]
  745. lea rsp,QWORD PTR[rsi]
  746. $L$sqr8x_epilogue::
  747. mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue
  748. mov rsi,QWORD PTR[16+rsp]
  749. DB 0F3h,0C3h ;repret
  750. $L$SEH_end_bn_sqr8x_mont::
  751. bn_sqr8x_mont ENDP
  752. ALIGN 32
  753. bn_mulx4x_mont PROC PRIVATE
  754. mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
  755. mov QWORD PTR[16+rsp],rsi
  756. mov rax,rsp
  757. $L$SEH_begin_bn_mulx4x_mont::
  758. mov rdi,rcx
  759. mov rsi,rdx
  760. mov rdx,r8
  761. mov rcx,r9
  762. mov r8,QWORD PTR[40+rsp]
  763. mov r9,QWORD PTR[48+rsp]
  764. mov rax,rsp
  765. $L$mulx4x_enter::
  766. push rbx
  767. push rbp
  768. push r12
  769. push r13
  770. push r14
  771. push r15
  772. $L$mulx4x_prologue::
  773. shl r9d,3
  774. xor r10,r10
  775. sub r10,r9
  776. mov r8,QWORD PTR[r8]
  777. lea rbp,QWORD PTR[((-72))+r10*1+rsp]
  778. and rbp,-128
  779. mov r11,rsp
  780. sub r11,rbp
  781. and r11,-4096
  782. lea rsp,QWORD PTR[rbp*1+r11]
  783. mov r10,QWORD PTR[rsp]
  784. cmp rsp,rbp
  785. ja $L$mulx4x_page_walk
  786. jmp $L$mulx4x_page_walk_done
  787. ALIGN 16
  788. $L$mulx4x_page_walk::
  789. lea rsp,QWORD PTR[((-4096))+rsp]
  790. mov r10,QWORD PTR[rsp]
  791. cmp rsp,rbp
  792. ja $L$mulx4x_page_walk
  793. $L$mulx4x_page_walk_done::
  794. lea r10,QWORD PTR[r9*1+rdx]
  795. mov QWORD PTR[rsp],r9
  796. shr r9,5
  797. mov QWORD PTR[16+rsp],r10
  798. sub r9,1
  799. mov QWORD PTR[24+rsp],r8
  800. mov QWORD PTR[32+rsp],rdi
  801. mov QWORD PTR[40+rsp],rax
  802. mov QWORD PTR[48+rsp],r9
  803. jmp $L$mulx4x_body
  804. ALIGN 32
  805. $L$mulx4x_body::
  806. lea rdi,QWORD PTR[8+rdx]
  807. mov rdx,QWORD PTR[rdx]
  808. lea rbx,QWORD PTR[((64+32))+rsp]
  809. mov r9,rdx
  810. mulx rax,r8,QWORD PTR[rsi]
  811. mulx r14,r11,QWORD PTR[8+rsi]
  812. add r11,rax
  813. mov QWORD PTR[8+rsp],rdi
  814. mulx r13,r12,QWORD PTR[16+rsi]
  815. adc r12,r14
  816. adc r13,0
  817. mov rdi,r8
  818. imul r8,QWORD PTR[24+rsp]
  819. xor rbp,rbp
  820. mulx r14,rax,QWORD PTR[24+rsi]
  821. mov rdx,r8
  822. lea rsi,QWORD PTR[32+rsi]
  823. adcx r13,rax
  824. adcx r14,rbp
  825. mulx r10,rax,QWORD PTR[rcx]
  826. adcx rdi,rax
  827. adox r10,r11
  828. mulx r11,rax,QWORD PTR[8+rcx]
  829. adcx r10,rax
  830. adox r11,r12
  831. DB 0c4h,062h,0fbh,0f6h,0a1h,010h,000h,000h,000h
  832. mov rdi,QWORD PTR[48+rsp]
  833. mov QWORD PTR[((-32))+rbx],r10
  834. adcx r11,rax
  835. adox r12,r13
  836. mulx r15,rax,QWORD PTR[24+rcx]
  837. mov rdx,r9
  838. mov QWORD PTR[((-24))+rbx],r11
  839. adcx r12,rax
  840. adox r15,rbp
  841. lea rcx,QWORD PTR[32+rcx]
  842. mov QWORD PTR[((-16))+rbx],r12
  843. jmp $L$mulx4x_1st
  844. ALIGN 32
  845. $L$mulx4x_1st::
  846. adcx r15,rbp
  847. mulx rax,r10,QWORD PTR[rsi]
  848. adcx r10,r14
  849. mulx r14,r11,QWORD PTR[8+rsi]
  850. adcx r11,rax
  851. mulx rax,r12,QWORD PTR[16+rsi]
  852. adcx r12,r14
  853. mulx r14,r13,QWORD PTR[24+rsi]
  854. DB 067h,067h
  855. mov rdx,r8
  856. adcx r13,rax
  857. adcx r14,rbp
  858. lea rsi,QWORD PTR[32+rsi]
  859. lea rbx,QWORD PTR[32+rbx]
  860. adox r10,r15
  861. mulx r15,rax,QWORD PTR[rcx]
  862. adcx r10,rax
  863. adox r11,r15
  864. mulx r15,rax,QWORD PTR[8+rcx]
  865. adcx r11,rax
  866. adox r12,r15
  867. mulx r15,rax,QWORD PTR[16+rcx]
  868. mov QWORD PTR[((-40))+rbx],r10
  869. adcx r12,rax
  870. mov QWORD PTR[((-32))+rbx],r11
  871. adox r13,r15
  872. mulx r15,rax,QWORD PTR[24+rcx]
  873. mov rdx,r9
  874. mov QWORD PTR[((-24))+rbx],r12
  875. adcx r13,rax
  876. adox r15,rbp
  877. lea rcx,QWORD PTR[32+rcx]
  878. mov QWORD PTR[((-16))+rbx],r13
  879. dec rdi
  880. jnz $L$mulx4x_1st
  881. mov rax,QWORD PTR[rsp]
  882. mov rdi,QWORD PTR[8+rsp]
  883. adc r15,rbp
  884. add r14,r15
  885. sbb r15,r15
  886. mov QWORD PTR[((-8))+rbx],r14
  887. jmp $L$mulx4x_outer
  888. ALIGN 32
  889. $L$mulx4x_outer::
  890. mov rdx,QWORD PTR[rdi]
  891. lea rdi,QWORD PTR[8+rdi]
  892. sub rsi,rax
  893. mov QWORD PTR[rbx],r15
  894. lea rbx,QWORD PTR[((64+32))+rsp]
  895. sub rcx,rax
  896. mulx r11,r8,QWORD PTR[rsi]
  897. xor ebp,ebp
  898. mov r9,rdx
  899. mulx r12,r14,QWORD PTR[8+rsi]
  900. adox r8,QWORD PTR[((-32))+rbx]
  901. adcx r11,r14
  902. mulx r13,r15,QWORD PTR[16+rsi]
  903. adox r11,QWORD PTR[((-24))+rbx]
  904. adcx r12,r15
  905. adox r12,QWORD PTR[((-16))+rbx]
  906. adcx r13,rbp
  907. adox r13,rbp
  908. mov QWORD PTR[8+rsp],rdi
  909. mov r15,r8
  910. imul r8,QWORD PTR[24+rsp]
  911. xor ebp,ebp
  912. mulx r14,rax,QWORD PTR[24+rsi]
  913. mov rdx,r8
  914. adcx r13,rax
  915. adox r13,QWORD PTR[((-8))+rbx]
  916. adcx r14,rbp
  917. lea rsi,QWORD PTR[32+rsi]
  918. adox r14,rbp
  919. mulx r10,rax,QWORD PTR[rcx]
  920. adcx r15,rax
  921. adox r10,r11
  922. mulx r11,rax,QWORD PTR[8+rcx]
  923. adcx r10,rax
  924. adox r11,r12
  925. mulx r12,rax,QWORD PTR[16+rcx]
  926. mov QWORD PTR[((-32))+rbx],r10
  927. adcx r11,rax
  928. adox r12,r13
  929. mulx r15,rax,QWORD PTR[24+rcx]
  930. mov rdx,r9
  931. mov QWORD PTR[((-24))+rbx],r11
  932. lea rcx,QWORD PTR[32+rcx]
  933. adcx r12,rax
  934. adox r15,rbp
  935. mov rdi,QWORD PTR[48+rsp]
  936. mov QWORD PTR[((-16))+rbx],r12
  937. jmp $L$mulx4x_inner
  938. ALIGN 32
  939. $L$mulx4x_inner::
  940. mulx rax,r10,QWORD PTR[rsi]
  941. adcx r15,rbp
  942. adox r10,r14
  943. mulx r14,r11,QWORD PTR[8+rsi]
  944. adcx r10,QWORD PTR[rbx]
  945. adox r11,rax
  946. mulx rax,r12,QWORD PTR[16+rsi]
  947. adcx r11,QWORD PTR[8+rbx]
  948. adox r12,r14
  949. mulx r14,r13,QWORD PTR[24+rsi]
  950. mov rdx,r8
  951. adcx r12,QWORD PTR[16+rbx]
  952. adox r13,rax
  953. adcx r13,QWORD PTR[24+rbx]
  954. adox r14,rbp
  955. lea rsi,QWORD PTR[32+rsi]
  956. lea rbx,QWORD PTR[32+rbx]
  957. adcx r14,rbp
  958. adox r10,r15
  959. mulx r15,rax,QWORD PTR[rcx]
  960. adcx r10,rax
  961. adox r11,r15
  962. mulx r15,rax,QWORD PTR[8+rcx]
  963. adcx r11,rax
  964. adox r12,r15
  965. mulx r15,rax,QWORD PTR[16+rcx]
  966. mov QWORD PTR[((-40))+rbx],r10
  967. adcx r12,rax
  968. adox r13,r15
  969. mulx r15,rax,QWORD PTR[24+rcx]
  970. mov rdx,r9
  971. mov QWORD PTR[((-32))+rbx],r11
  972. mov QWORD PTR[((-24))+rbx],r12
  973. adcx r13,rax
  974. adox r15,rbp
  975. lea rcx,QWORD PTR[32+rcx]
  976. mov QWORD PTR[((-16))+rbx],r13
  977. dec rdi
  978. jnz $L$mulx4x_inner
  979. mov rax,QWORD PTR[rsp]
  980. mov rdi,QWORD PTR[8+rsp]
  981. adc r15,rbp
  982. sub rbp,QWORD PTR[rbx]
  983. adc r14,r15
  984. sbb r15,r15
  985. mov QWORD PTR[((-8))+rbx],r14
  986. cmp rdi,QWORD PTR[16+rsp]
  987. jne $L$mulx4x_outer
  988. lea rbx,QWORD PTR[64+rsp]
  989. sub rcx,rax
  990. neg r15
  991. mov rdx,rax
  992. shr rax,3+2
  993. mov rdi,QWORD PTR[32+rsp]
  994. jmp $L$mulx4x_sub
  995. ALIGN 32
  996. $L$mulx4x_sub::
  997. mov r11,QWORD PTR[rbx]
  998. mov r12,QWORD PTR[8+rbx]
  999. mov r13,QWORD PTR[16+rbx]
  1000. mov r14,QWORD PTR[24+rbx]
  1001. lea rbx,QWORD PTR[32+rbx]
  1002. sbb r11,QWORD PTR[rcx]
  1003. sbb r12,QWORD PTR[8+rcx]
  1004. sbb r13,QWORD PTR[16+rcx]
  1005. sbb r14,QWORD PTR[24+rcx]
  1006. lea rcx,QWORD PTR[32+rcx]
  1007. mov QWORD PTR[rdi],r11
  1008. mov QWORD PTR[8+rdi],r12
  1009. mov QWORD PTR[16+rdi],r13
  1010. mov QWORD PTR[24+rdi],r14
  1011. lea rdi,QWORD PTR[32+rdi]
  1012. dec rax
  1013. jnz $L$mulx4x_sub
  1014. sbb r15,0
  1015. lea rbx,QWORD PTR[64+rsp]
  1016. sub rdi,rdx
  1017. DB 102,73,15,110,207
  1018. pxor xmm0,xmm0
  1019. pshufd xmm1,xmm1,0
  1020. mov rsi,QWORD PTR[40+rsp]
  1021. jmp $L$mulx4x_cond_copy
  1022. ALIGN 32
  1023. $L$mulx4x_cond_copy::
  1024. movdqa xmm2,XMMWORD PTR[rbx]
  1025. movdqa xmm3,XMMWORD PTR[16+rbx]
  1026. lea rbx,QWORD PTR[32+rbx]
  1027. movdqu xmm4,XMMWORD PTR[rdi]
  1028. movdqu xmm5,XMMWORD PTR[16+rdi]
  1029. lea rdi,QWORD PTR[32+rdi]
  1030. movdqa XMMWORD PTR[(-32)+rbx],xmm0
  1031. movdqa XMMWORD PTR[(-16)+rbx],xmm0
  1032. pcmpeqd xmm0,xmm1
  1033. pand xmm2,xmm1
  1034. pand xmm3,xmm1
  1035. pand xmm4,xmm0
  1036. pand xmm5,xmm0
  1037. pxor xmm0,xmm0
  1038. por xmm4,xmm2
  1039. por xmm5,xmm3
  1040. movdqu XMMWORD PTR[(-32)+rdi],xmm4
  1041. movdqu XMMWORD PTR[(-16)+rdi],xmm5
  1042. sub rdx,32
  1043. jnz $L$mulx4x_cond_copy
  1044. mov QWORD PTR[rbx],rdx
  1045. mov rax,1
  1046. mov r15,QWORD PTR[((-48))+rsi]
  1047. mov r14,QWORD PTR[((-40))+rsi]
  1048. mov r13,QWORD PTR[((-32))+rsi]
  1049. mov r12,QWORD PTR[((-24))+rsi]
  1050. mov rbp,QWORD PTR[((-16))+rsi]
  1051. mov rbx,QWORD PTR[((-8))+rsi]
  1052. lea rsp,QWORD PTR[rsi]
  1053. $L$mulx4x_epilogue::
  1054. mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue
  1055. mov rsi,QWORD PTR[16+rsp]
  1056. DB 0F3h,0C3h ;repret
  1057. $L$SEH_end_bn_mulx4x_mont::
  1058. bn_mulx4x_mont ENDP
  1059. DB 77,111,110,116,103,111,109,101,114,121,32,77,117,108,116,105
  1060. DB 112,108,105,99,97,116,105,111,110,32,102,111,114,32,120,56
  1061. DB 54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83
  1062. DB 32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115
  1063. DB 115,108,46,111,114,103,62,0
  1064. ALIGN 16
  1065. EXTERN __imp_RtlVirtualUnwind:NEAR
  1066. ALIGN 16
  1067. mul_handler PROC PRIVATE
  1068. push rsi
  1069. push rdi
  1070. push rbx
  1071. push rbp
  1072. push r12
  1073. push r13
  1074. push r14
  1075. push r15
  1076. pushfq
  1077. sub rsp,64
  1078. mov rax,QWORD PTR[120+r8]
  1079. mov rbx,QWORD PTR[248+r8]
  1080. mov rsi,QWORD PTR[8+r9]
  1081. mov r11,QWORD PTR[56+r9]
  1082. mov r10d,DWORD PTR[r11]
  1083. lea r10,QWORD PTR[r10*1+rsi]
  1084. cmp rbx,r10
  1085. jb $L$common_seh_tail
  1086. mov rax,QWORD PTR[152+r8]
  1087. mov r10d,DWORD PTR[4+r11]
  1088. lea r10,QWORD PTR[r10*1+rsi]
  1089. cmp rbx,r10
  1090. jae $L$common_seh_tail
  1091. mov r10,QWORD PTR[192+r8]
  1092. mov rax,QWORD PTR[8+r10*8+rax]
  1093. jmp $L$common_pop_regs
  1094. mul_handler ENDP
  1095. ALIGN 16
  1096. sqr_handler PROC PRIVATE
  1097. push rsi
  1098. push rdi
  1099. push rbx
  1100. push rbp
  1101. push r12
  1102. push r13
  1103. push r14
  1104. push r15
  1105. pushfq
  1106. sub rsp,64
  1107. mov rax,QWORD PTR[120+r8]
  1108. mov rbx,QWORD PTR[248+r8]
  1109. mov rsi,QWORD PTR[8+r9]
  1110. mov r11,QWORD PTR[56+r9]
  1111. mov r10d,DWORD PTR[r11]
  1112. lea r10,QWORD PTR[r10*1+rsi]
  1113. cmp rbx,r10
  1114. jb $L$common_seh_tail
  1115. mov r10d,DWORD PTR[4+r11]
  1116. lea r10,QWORD PTR[r10*1+rsi]
  1117. cmp rbx,r10
  1118. jb $L$common_pop_regs
  1119. mov rax,QWORD PTR[152+r8]
  1120. mov r10d,DWORD PTR[8+r11]
  1121. lea r10,QWORD PTR[r10*1+rsi]
  1122. cmp rbx,r10
  1123. jae $L$common_seh_tail
  1124. mov rax,QWORD PTR[40+rax]
  1125. $L$common_pop_regs::
  1126. mov rbx,QWORD PTR[((-8))+rax]
  1127. mov rbp,QWORD PTR[((-16))+rax]
  1128. mov r12,QWORD PTR[((-24))+rax]
  1129. mov r13,QWORD PTR[((-32))+rax]
  1130. mov r14,QWORD PTR[((-40))+rax]
  1131. mov r15,QWORD PTR[((-48))+rax]
  1132. mov QWORD PTR[144+r8],rbx
  1133. mov QWORD PTR[160+r8],rbp
  1134. mov QWORD PTR[216+r8],r12
  1135. mov QWORD PTR[224+r8],r13
  1136. mov QWORD PTR[232+r8],r14
  1137. mov QWORD PTR[240+r8],r15
  1138. $L$common_seh_tail::
  1139. mov rdi,QWORD PTR[8+rax]
  1140. mov rsi,QWORD PTR[16+rax]
  1141. mov QWORD PTR[152+r8],rax
  1142. mov QWORD PTR[168+r8],rsi
  1143. mov QWORD PTR[176+r8],rdi
  1144. mov rdi,QWORD PTR[40+r9]
  1145. mov rsi,r8
  1146. mov ecx,154
  1147. DD 0a548f3fch
  1148. mov rsi,r9
  1149. xor rcx,rcx
  1150. mov rdx,QWORD PTR[8+rsi]
  1151. mov r8,QWORD PTR[rsi]
  1152. mov r9,QWORD PTR[16+rsi]
  1153. mov r10,QWORD PTR[40+rsi]
  1154. lea r11,QWORD PTR[56+rsi]
  1155. lea r12,QWORD PTR[24+rsi]
  1156. mov QWORD PTR[32+rsp],r10
  1157. mov QWORD PTR[40+rsp],r11
  1158. mov QWORD PTR[48+rsp],r12
  1159. mov QWORD PTR[56+rsp],rcx
  1160. call QWORD PTR[__imp_RtlVirtualUnwind]
  1161. mov eax,1
  1162. add rsp,64
  1163. popfq
  1164. pop r15
  1165. pop r14
  1166. pop r13
  1167. pop r12
  1168. pop rbp
  1169. pop rbx
  1170. pop rdi
  1171. pop rsi
  1172. DB 0F3h,0C3h ;repret
  1173. sqr_handler ENDP
  1174. .text$ ENDS
  1175. .pdata SEGMENT READONLY ALIGN(4)
  1176. ALIGN 4
  1177. DD imagerel $L$SEH_begin_bn_mul_mont
  1178. DD imagerel $L$SEH_end_bn_mul_mont
  1179. DD imagerel $L$SEH_info_bn_mul_mont
  1180. DD imagerel $L$SEH_begin_bn_mul4x_mont
  1181. DD imagerel $L$SEH_end_bn_mul4x_mont
  1182. DD imagerel $L$SEH_info_bn_mul4x_mont
  1183. DD imagerel $L$SEH_begin_bn_sqr8x_mont
  1184. DD imagerel $L$SEH_end_bn_sqr8x_mont
  1185. DD imagerel $L$SEH_info_bn_sqr8x_mont
  1186. DD imagerel $L$SEH_begin_bn_mulx4x_mont
  1187. DD imagerel $L$SEH_end_bn_mulx4x_mont
  1188. DD imagerel $L$SEH_info_bn_mulx4x_mont
  1189. .pdata ENDS
  1190. .xdata SEGMENT READONLY ALIGN(8)
  1191. ALIGN 8
  1192. $L$SEH_info_bn_mul_mont::
  1193. DB 9,0,0,0
  1194. DD imagerel mul_handler
  1195. DD imagerel $L$mul_body,imagerel $L$mul_epilogue
  1196. $L$SEH_info_bn_mul4x_mont::
  1197. DB 9,0,0,0
  1198. DD imagerel mul_handler
  1199. DD imagerel $L$mul4x_body,imagerel $L$mul4x_epilogue
  1200. $L$SEH_info_bn_sqr8x_mont::
  1201. DB 9,0,0,0
  1202. DD imagerel sqr_handler
  1203. DD imagerel $L$sqr8x_prologue,imagerel $L$sqr8x_body,imagerel $L$sqr8x_epilogue
  1204. ALIGN 8
  1205. $L$SEH_info_bn_mulx4x_mont::
  1206. DB 9,0,0,0
  1207. DD imagerel sqr_handler
  1208. DD imagerel $L$mulx4x_prologue,imagerel $L$mulx4x_body,imagerel $L$mulx4x_epilogue
  1209. ALIGN 8
  1210. .xdata ENDS
  1211. END