Advertisement
Guest User

Powers of two, Clang Output

a guest
Jul 27th, 2011
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 89.33 KB | None | 0 0
  1. ==> powersoftwo-1-c2.s <===================================================
  2. .section __TEXT,__text,regular,pure_instructions
  3. .globl _isPowerOfTwo
  4. _isPowerOfTwo: ## @isPowerOfTwo
  5. Ltmp2:
  6. .cfi_startproc
  7. ## BB#0: ## %entry
  8. pushq %rbp
  9. Ltmp3:
  10. .cfi_def_cfa_offset 16
  11. Ltmp4:
  12. .cfi_offset %rbp, -16
  13. movq %rsp, %rbp
  14. Ltmp5:
  15. .cfi_def_cfa_register %rbp
  16. testb $1, %dil
  17. je LBB0_2
  18. LBB0_1:
  19. movl %edi, %eax
  20. jmp LBB0_5
  21. LBB0_2: ## %entry
  22. cmpl $2, %edi
  23. jb LBB0_1
  24. LBB0_3: ## %while.body
  25. ## =>This Inner Loop Header: Depth=1
  26. movl %edi, %eax
  27. shrl %eax
  28. btl $1, %edi
  29. jb LBB0_5
  30. ## BB#4: ## %while.body
  31. ## in Loop: Header=BB0_3 Depth=1
  32. cmpl $3, %edi
  33. movl %eax, %edi
  34. ja LBB0_3
  35. LBB0_5: ## %while.end
  36. cmpl $1, %eax
  37. sete %al
  38. movzbl %al, %eax
  39. popq %rbp
  40. ret
  41. Ltmp6:
  42. .cfi_endproc
  43. Leh_func_end0:
  44.  
  45. .globl _main
  46. _main: ## @main
  47. Ltmp10:
  48. .cfi_startproc
  49. ## BB#0: ## %entry
  50. pushq %rbp
  51. Ltmp11:
  52. .cfi_def_cfa_offset 16
  53. Ltmp12:
  54. .cfi_offset %rbp, -16
  55. movq %rsp, %rbp
  56. Ltmp13:
  57. .cfi_def_cfa_register %rbp
  58. pushq %r14
  59. pushq %rbx
  60. Ltmp14:
  61. .cfi_offset %rbx, -32
  62. Ltmp15:
  63. .cfi_offset %r14, -24
  64. callq _mach_absolute_time
  65. movq %rax, %r14
  66. xorl %eax, %eax
  67. movl %eax, %ebx
  68. LBB1_1: ## %for.body
  69. ## =>This Loop Header: Depth=1
  70. ## Child Loop BB1_3 Depth 2
  71. movl %ebx, %ecx
  72. testb $1, %al
  73. movl %eax, %edx
  74. jne LBB1_5
  75. ## BB#2: ## %for.body
  76. ## in Loop: Header=BB1_1 Depth=1
  77. cmpl $2, %eax
  78. movl %eax, %esi
  79. movl %eax, %edx
  80. jb LBB1_5
  81. LBB1_3: ## %while.body.i
  82. ## Parent Loop BB1_1 Depth=1
  83. ## => This Inner Loop Header: Depth=2
  84. movl %esi, %edx
  85. shrl %edx
  86. btl $1, %esi
  87. jb LBB1_5
  88. ## BB#4: ## %while.body.i
  89. ## in Loop: Header=BB1_3 Depth=2
  90. cmpl $3, %esi
  91. movl %edx, %esi
  92. ja LBB1_3
  93. LBB1_5: ## %isPowerOfTwo.exit
  94. ## in Loop: Header=BB1_1 Depth=1
  95. cmpl $1, %edx
  96. sete %dl
  97. movzbl %dl, %ebx
  98. addl %ecx, %ebx
  99. incl %eax
  100. cmpl $-1, %eax
  101. jne LBB1_1
  102. ## BB#6: ## %for.end
  103. callq _mach_absolute_time
  104. subq %r14, %rax
  105. leaq L_.str(%rip), %rdi
  106. movl %ebx, %esi
  107. movq %rax, %rdx
  108. xorb %al, %al
  109. callq _printf
  110. xorl %eax, %eax
  111. popq %rbx
  112. popq %r14
  113. popq %rbp
  114. ret
  115. Ltmp16:
  116. .cfi_endproc
  117. Leh_func_end1:
  118.  
  119. .section __TEXT,__cstring,cstring_literals
  120. L_.str: ## @.str
  121. .asciz "%d powers of two found in %lu ns\n"
  122.  
  123.  
  124. .subsections_via_symbols
  125.  
  126.  
  127.  
  128. ==> powersoftwo-1-i7.s <===================================================
  129. .section __TEXT,__text,regular,pure_instructions
  130. .globl _isPowerOfTwo
  131. _isPowerOfTwo: ## @isPowerOfTwo
  132. Ltmp2:
  133. .cfi_startproc
  134. ## BB#0: ## %entry
  135. pushq %rbp
  136. Ltmp3:
  137. .cfi_def_cfa_offset 16
  138. Ltmp4:
  139. .cfi_offset %rbp, -16
  140. movq %rsp, %rbp
  141. Ltmp5:
  142. .cfi_def_cfa_register %rbp
  143. testb $1, %dil
  144. je LBB0_2
  145. LBB0_1:
  146. movl %edi, %eax
  147. jmp LBB0_5
  148. LBB0_2: ## %entry
  149. cmpl $2, %edi
  150. jb LBB0_1
  151. LBB0_3: ## %while.body
  152. ## =>This Inner Loop Header: Depth=1
  153. movl %edi, %eax
  154. shrl %eax
  155. btl $1, %edi
  156. jb LBB0_5
  157. ## BB#4: ## %while.body
  158. ## in Loop: Header=BB0_3 Depth=1
  159. cmpl $3, %edi
  160. movl %eax, %edi
  161. ja LBB0_3
  162. LBB0_5: ## %while.end
  163. cmpl $1, %eax
  164. sete %al
  165. movzbl %al, %eax
  166. popq %rbp
  167. ret
  168. Ltmp6:
  169. .cfi_endproc
  170. Leh_func_end0:
  171.  
  172. .globl _main
  173. _main: ## @main
  174. Ltmp10:
  175. .cfi_startproc
  176. ## BB#0: ## %entry
  177. pushq %rbp
  178. Ltmp11:
  179. .cfi_def_cfa_offset 16
  180. Ltmp12:
  181. .cfi_offset %rbp, -16
  182. movq %rsp, %rbp
  183. Ltmp13:
  184. .cfi_def_cfa_register %rbp
  185. pushq %r14
  186. pushq %rbx
  187. Ltmp14:
  188. .cfi_offset %rbx, -32
  189. Ltmp15:
  190. .cfi_offset %r14, -24
  191. callq _mach_absolute_time
  192. movq %rax, %r14
  193. xorl %eax, %eax
  194. movl %eax, %ebx
  195. LBB1_1: ## %for.body
  196. ## =>This Loop Header: Depth=1
  197. ## Child Loop BB1_3 Depth 2
  198. movl %ebx, %ecx
  199. testb $1, %al
  200. movl %eax, %edx
  201. jne LBB1_5
  202. ## BB#2: ## %for.body
  203. ## in Loop: Header=BB1_1 Depth=1
  204. cmpl $2, %eax
  205. movl %eax, %esi
  206. movl %eax, %edx
  207. jb LBB1_5
  208. LBB1_3: ## %while.body.i
  209. ## Parent Loop BB1_1 Depth=1
  210. ## => This Inner Loop Header: Depth=2
  211. movl %esi, %edx
  212. shrl %edx
  213. btl $1, %esi
  214. jb LBB1_5
  215. ## BB#4: ## %while.body.i
  216. ## in Loop: Header=BB1_3 Depth=2
  217. cmpl $3, %esi
  218. movl %edx, %esi
  219. ja LBB1_3
  220. LBB1_5: ## %isPowerOfTwo.exit
  221. ## in Loop: Header=BB1_1 Depth=1
  222. cmpl $1, %edx
  223. sete %dl
  224. movzbl %dl, %ebx
  225. addl %ecx, %ebx
  226. incl %eax
  227. cmpl $-1, %eax
  228. jne LBB1_1
  229. ## BB#6: ## %for.end
  230. callq _mach_absolute_time
  231. subq %r14, %rax
  232. leaq L_.str(%rip), %rdi
  233. movl %ebx, %esi
  234. movq %rax, %rdx
  235. xorb %al, %al
  236. callq _printf
  237. xorl %eax, %eax
  238. popq %rbx
  239. popq %r14
  240. popq %rbp
  241. ret
  242. Ltmp16:
  243. .cfi_endproc
  244. Leh_func_end1:
  245.  
  246. .section __TEXT,__cstring,cstring_literals
  247. L_.str: ## @.str
  248. .asciz "%d powers of two found in %lu ns\n"
  249.  
  250.  
  251. .subsections_via_symbols
  252.  
  253.  
  254.  
  255. ==> powersoftwo-2-c2.s <===================================================
  256. .section __TEXT,__text,regular,pure_instructions
  257. .globl _isPowerOfTwo
  258. _isPowerOfTwo: ## @isPowerOfTwo
  259. Ltmp2:
  260. .cfi_startproc
  261. ## BB#0: ## %entry
  262. pushq %rbp
  263. Ltmp3:
  264. .cfi_def_cfa_offset 16
  265. Ltmp4:
  266. .cfi_offset %rbp, -16
  267. movq %rsp, %rbp
  268. Ltmp5:
  269. .cfi_def_cfa_register %rbp
  270. leal -1(%rdi), %ecx
  271. movb $1, %al
  272. cmpl $2, %ecx
  273. jb LBB0_31
  274. ## BB#1: ## %entry
  275. cmpl $4, %edi
  276. je LBB0_31
  277. ## BB#2: ## %entry
  278. cmpl $8, %edi
  279. je LBB0_31
  280. ## BB#3: ## %entry
  281. cmpl $16, %edi
  282. je LBB0_31
  283. ## BB#4: ## %entry
  284. cmpl $32, %edi
  285. je LBB0_31
  286. ## BB#5: ## %entry
  287. cmpl $64, %edi
  288. je LBB0_31
  289. ## BB#6: ## %entry
  290. cmpl $128, %edi
  291. je LBB0_31
  292. ## BB#7: ## %entry
  293. cmpl $256, %edi ## imm = 0x100
  294. je LBB0_31
  295. ## BB#8: ## %entry
  296. cmpl $512, %edi ## imm = 0x200
  297. je LBB0_31
  298. ## BB#9: ## %entry
  299. cmpl $1024, %edi ## imm = 0x400
  300. je LBB0_31
  301. ## BB#10: ## %entry
  302. cmpl $2048, %edi ## imm = 0x800
  303. je LBB0_31
  304. ## BB#11: ## %entry
  305. cmpl $4096, %edi ## imm = 0x1000
  306. je LBB0_31
  307. ## BB#12: ## %entry
  308. cmpl $8192, %edi ## imm = 0x2000
  309. je LBB0_31
  310. ## BB#13: ## %entry
  311. cmpl $16384, %edi ## imm = 0x4000
  312. je LBB0_31
  313. ## BB#14: ## %entry
  314. cmpl $32768, %edi ## imm = 0x8000
  315. je LBB0_31
  316. ## BB#15: ## %entry
  317. cmpl $65536, %edi ## imm = 0x10000
  318. je LBB0_31
  319. ## BB#16: ## %entry
  320. cmpl $131072, %edi ## imm = 0x20000
  321. je LBB0_31
  322. ## BB#17: ## %entry
  323. cmpl $262144, %edi ## imm = 0x40000
  324. je LBB0_31
  325. ## BB#18: ## %entry
  326. cmpl $524288, %edi ## imm = 0x80000
  327. je LBB0_31
  328. ## BB#19: ## %entry
  329. cmpl $1048576, %edi ## imm = 0x100000
  330. je LBB0_31
  331. ## BB#20: ## %entry
  332. cmpl $2097152, %edi ## imm = 0x200000
  333. je LBB0_31
  334. ## BB#21: ## %entry
  335. cmpl $4194304, %edi ## imm = 0x400000
  336. je LBB0_31
  337. ## BB#22: ## %entry
  338. cmpl $8388608, %edi ## imm = 0x800000
  339. je LBB0_31
  340. ## BB#23: ## %entry
  341. cmpl $16777216, %edi ## imm = 0x1000000
  342. je LBB0_31
  343. ## BB#24: ## %entry
  344. cmpl $33554432, %edi ## imm = 0x2000000
  345. je LBB0_31
  346. ## BB#25: ## %entry
  347. cmpl $67108864, %edi ## imm = 0x4000000
  348. je LBB0_31
  349. ## BB#26: ## %entry
  350. cmpl $134217728, %edi ## imm = 0x8000000
  351. je LBB0_31
  352. ## BB#27: ## %entry
  353. cmpl $268435456, %edi ## imm = 0x10000000
  354. je LBB0_31
  355. ## BB#28: ## %entry
  356. cmpl $536870912, %edi ## imm = 0x20000000
  357. je LBB0_31
  358. ## BB#29: ## %entry
  359. cmpl $1073741824, %edi ## imm = 0x40000000
  360. je LBB0_31
  361. ## BB#30: ## %lor.rhs
  362. cmpl $-2147483648, %edi ## imm = 0xFFFFFFFF80000000
  363. sete %al
  364. LBB0_31: ## %lor.end
  365. movzbl %al, %eax
  366. popq %rbp
  367. ret
  368. Ltmp6:
  369. .cfi_endproc
  370. Leh_func_end0:
  371.  
  372. .globl _main
  373. _main: ## @main
  374. Ltmp10:
  375. .cfi_startproc
  376. ## BB#0: ## %entry
  377. pushq %rbp
  378. Ltmp11:
  379. .cfi_def_cfa_offset 16
  380. Ltmp12:
  381. .cfi_offset %rbp, -16
  382. movq %rsp, %rbp
  383. Ltmp13:
  384. .cfi_def_cfa_register %rbp
  385. pushq %r15
  386. pushq %r14
  387. pushq %rbx
  388. pushq %rax
  389. Ltmp14:
  390. .cfi_offset %rbx, -40
  391. Ltmp15:
  392. .cfi_offset %r14, -32
  393. Ltmp16:
  394. .cfi_offset %r15, -24
  395. callq _mach_absolute_time
  396. movq %rax, %r14
  397. xorl %r15d, %r15d
  398. movl %r15d, %ebx
  399. LBB1_1: ## %for.body
  400. ## =>This Inner Loop Header: Depth=1
  401. movl %r15d, %edi
  402. callq _isPowerOfTwo
  403. cmpl $1, %eax
  404. sbbl $-1, %ebx
  405. incl %r15d
  406. cmpl $-1, %r15d
  407. jne LBB1_1
  408. ## BB#2: ## %for.end
  409. callq _mach_absolute_time
  410. subq %r14, %rax
  411. leaq L_.str(%rip), %rdi
  412. movl %ebx, %esi
  413. movq %rax, %rdx
  414. xorb %al, %al
  415. callq _printf
  416. xorl %eax, %eax
  417. addq $8, %rsp
  418. popq %rbx
  419. popq %r14
  420. popq %r15
  421. popq %rbp
  422. ret
  423. Ltmp17:
  424. .cfi_endproc
  425. Leh_func_end1:
  426.  
  427. .section __TEXT,__cstring,cstring_literals
  428. L_.str: ## @.str
  429. .asciz "%d powers of two found in %lu ns\n"
  430.  
  431.  
  432. .subsections_via_symbols
  433.  
  434.  
  435.  
  436. ==> powersoftwo-2-i7.s <===================================================
  437. .section __TEXT,__text,regular,pure_instructions
  438. .globl _isPowerOfTwo
  439. _isPowerOfTwo: ## @isPowerOfTwo
  440. Ltmp2:
  441. .cfi_startproc
  442. ## BB#0: ## %entry
  443. pushq %rbp
  444. Ltmp3:
  445. .cfi_def_cfa_offset 16
  446. Ltmp4:
  447. .cfi_offset %rbp, -16
  448. movq %rsp, %rbp
  449. Ltmp5:
  450. .cfi_def_cfa_register %rbp
  451. leal -1(%rdi), %ecx
  452. movb $1, %al
  453. cmpl $2, %ecx
  454. jb LBB0_31
  455. ## BB#1: ## %entry
  456. cmpl $4, %edi
  457. je LBB0_31
  458. ## BB#2: ## %entry
  459. cmpl $8, %edi
  460. je LBB0_31
  461. ## BB#3: ## %entry
  462. cmpl $16, %edi
  463. je LBB0_31
  464. ## BB#4: ## %entry
  465. cmpl $32, %edi
  466. je LBB0_31
  467. ## BB#5: ## %entry
  468. cmpl $64, %edi
  469. je LBB0_31
  470. ## BB#6: ## %entry
  471. cmpl $128, %edi
  472. je LBB0_31
  473. ## BB#7: ## %entry
  474. cmpl $256, %edi ## imm = 0x100
  475. je LBB0_31
  476. ## BB#8: ## %entry
  477. cmpl $512, %edi ## imm = 0x200
  478. je LBB0_31
  479. ## BB#9: ## %entry
  480. cmpl $1024, %edi ## imm = 0x400
  481. je LBB0_31
  482. ## BB#10: ## %entry
  483. cmpl $2048, %edi ## imm = 0x800
  484. je LBB0_31
  485. ## BB#11: ## %entry
  486. cmpl $4096, %edi ## imm = 0x1000
  487. je LBB0_31
  488. ## BB#12: ## %entry
  489. cmpl $8192, %edi ## imm = 0x2000
  490. je LBB0_31
  491. ## BB#13: ## %entry
  492. cmpl $16384, %edi ## imm = 0x4000
  493. je LBB0_31
  494. ## BB#14: ## %entry
  495. cmpl $32768, %edi ## imm = 0x8000
  496. je LBB0_31
  497. ## BB#15: ## %entry
  498. cmpl $65536, %edi ## imm = 0x10000
  499. je LBB0_31
  500. ## BB#16: ## %entry
  501. cmpl $131072, %edi ## imm = 0x20000
  502. je LBB0_31
  503. ## BB#17: ## %entry
  504. cmpl $262144, %edi ## imm = 0x40000
  505. je LBB0_31
  506. ## BB#18: ## %entry
  507. cmpl $524288, %edi ## imm = 0x80000
  508. je LBB0_31
  509. ## BB#19: ## %entry
  510. cmpl $1048576, %edi ## imm = 0x100000
  511. je LBB0_31
  512. ## BB#20: ## %entry
  513. cmpl $2097152, %edi ## imm = 0x200000
  514. je LBB0_31
  515. ## BB#21: ## %entry
  516. cmpl $4194304, %edi ## imm = 0x400000
  517. je LBB0_31
  518. ## BB#22: ## %entry
  519. cmpl $8388608, %edi ## imm = 0x800000
  520. je LBB0_31
  521. ## BB#23: ## %entry
  522. cmpl $16777216, %edi ## imm = 0x1000000
  523. je LBB0_31
  524. ## BB#24: ## %entry
  525. cmpl $33554432, %edi ## imm = 0x2000000
  526. je LBB0_31
  527. ## BB#25: ## %entry
  528. cmpl $67108864, %edi ## imm = 0x4000000
  529. je LBB0_31
  530. ## BB#26: ## %entry
  531. cmpl $134217728, %edi ## imm = 0x8000000
  532. je LBB0_31
  533. ## BB#27: ## %entry
  534. cmpl $268435456, %edi ## imm = 0x10000000
  535. je LBB0_31
  536. ## BB#28: ## %entry
  537. cmpl $536870912, %edi ## imm = 0x20000000
  538. je LBB0_31
  539. ## BB#29: ## %entry
  540. cmpl $1073741824, %edi ## imm = 0x40000000
  541. je LBB0_31
  542. ## BB#30: ## %lor.rhs
  543. cmpl $-2147483648, %edi ## imm = 0xFFFFFFFF80000000
  544. sete %al
  545. LBB0_31: ## %lor.end
  546. movzbl %al, %eax
  547. popq %rbp
  548. ret
  549. Ltmp6:
  550. .cfi_endproc
  551. Leh_func_end0:
  552.  
  553. .globl _main
  554. _main: ## @main
  555. Ltmp10:
  556. .cfi_startproc
  557. ## BB#0: ## %entry
  558. pushq %rbp
  559. Ltmp11:
  560. .cfi_def_cfa_offset 16
  561. Ltmp12:
  562. .cfi_offset %rbp, -16
  563. movq %rsp, %rbp
  564. Ltmp13:
  565. .cfi_def_cfa_register %rbp
  566. pushq %r15
  567. pushq %r14
  568. pushq %rbx
  569. pushq %rax
  570. Ltmp14:
  571. .cfi_offset %rbx, -40
  572. Ltmp15:
  573. .cfi_offset %r14, -32
  574. Ltmp16:
  575. .cfi_offset %r15, -24
  576. callq _mach_absolute_time
  577. movq %rax, %r14
  578. xorl %r15d, %r15d
  579. movl %r15d, %ebx
  580. LBB1_1: ## %for.body
  581. ## =>This Inner Loop Header: Depth=1
  582. movl %r15d, %edi
  583. callq _isPowerOfTwo
  584. cmpl $1, %eax
  585. sbbl $-1, %ebx
  586. incl %r15d
  587. cmpl $-1, %r15d
  588. jne LBB1_1
  589. ## BB#2: ## %for.end
  590. callq _mach_absolute_time
  591. subq %r14, %rax
  592. leaq L_.str(%rip), %rdi
  593. movl %ebx, %esi
  594. movq %rax, %rdx
  595. xorb %al, %al
  596. callq _printf
  597. xorl %eax, %eax
  598. addq $8, %rsp
  599. popq %rbx
  600. popq %r14
  601. popq %r15
  602. popq %rbp
  603. ret
  604. Ltmp17:
  605. .cfi_endproc
  606. Leh_func_end1:
  607.  
  608. .section __TEXT,__cstring,cstring_literals
  609. L_.str: ## @.str
  610. .asciz "%d powers of two found in %lu ns\n"
  611.  
  612.  
  613. .subsections_via_symbols
  614.  
  615.  
  616.  
  617. ==> powersoftwo-3-c2.s <===================================================
  618. .section __TEXT,__text,regular,pure_instructions
  619. .globl _isPowerOfTwo
  620. _isPowerOfTwo: ## @isPowerOfTwo
  621. Ltmp2:
  622. .cfi_startproc
  623. ## BB#0: ## %entry
  624. pushq %rbp
  625. Ltmp3:
  626. .cfi_def_cfa_offset 16
  627. Ltmp4:
  628. .cfi_offset %rbp, -16
  629. movq %rsp, %rbp
  630. Ltmp5:
  631. .cfi_def_cfa_register %rbp
  632. movl $1, %eax
  633. cmpl $2, %edi
  634. jb LBB0_3
  635. LBB0_1: ## %while.body
  636. ## =>This Inner Loop Header: Depth=1
  637. addl %eax, %eax
  638. cmpl %edi, %eax
  639. jae LBB0_3
  640. ## BB#2: ## %while.body
  641. ## in Loop: Header=BB0_1 Depth=1
  642. testl %eax, %eax
  643. jns LBB0_1
  644. LBB0_3: ## %while.end
  645. cmpl %edi, %eax
  646. sete %al
  647. movzbl %al, %eax
  648. popq %rbp
  649. ret
  650. Ltmp6:
  651. .cfi_endproc
  652. Leh_func_end0:
  653.  
  654. .globl _main
  655. _main: ## @main
  656. Ltmp10:
  657. .cfi_startproc
  658. ## BB#0: ## %entry
  659. pushq %rbp
  660. Ltmp11:
  661. .cfi_def_cfa_offset 16
  662. Ltmp12:
  663. .cfi_offset %rbp, -16
  664. movq %rsp, %rbp
  665. Ltmp13:
  666. .cfi_def_cfa_register %rbp
  667. pushq %r14
  668. pushq %rbx
  669. Ltmp14:
  670. .cfi_offset %rbx, -32
  671. Ltmp15:
  672. .cfi_offset %r14, -24
  673. callq _mach_absolute_time
  674. movq %rax, %r14
  675. xorl %eax, %eax
  676. movl %eax, %ebx
  677. LBB1_1: ## %for.body
  678. ## =>This Loop Header: Depth=1
  679. ## Child Loop BB1_2 Depth 2
  680. movl %ebx, %ecx
  681. movl $1, %edx
  682. cmpl $2, %eax
  683. jb LBB1_4
  684. LBB1_2: ## %while.body.i
  685. ## Parent Loop BB1_1 Depth=1
  686. ## => This Inner Loop Header: Depth=2
  687. addl %edx, %edx
  688. cmpl %eax, %edx
  689. jae LBB1_4
  690. ## BB#3: ## %while.body.i
  691. ## in Loop: Header=BB1_2 Depth=2
  692. testl %edx, %edx
  693. jns LBB1_2
  694. LBB1_4: ## %isPowerOfTwo.exit
  695. ## in Loop: Header=BB1_1 Depth=1
  696. cmpl %edx, %eax
  697. sete %dl
  698. movzbl %dl, %ebx
  699. addl %ecx, %ebx
  700. incl %eax
  701. cmpl $-1, %eax
  702. jne LBB1_1
  703. ## BB#5: ## %for.end
  704. callq _mach_absolute_time
  705. subq %r14, %rax
  706. leaq L_.str(%rip), %rdi
  707. movl %ebx, %esi
  708. movq %rax, %rdx
  709. xorb %al, %al
  710. callq _printf
  711. xorl %eax, %eax
  712. popq %rbx
  713. popq %r14
  714. popq %rbp
  715. ret
  716. Ltmp16:
  717. .cfi_endproc
  718. Leh_func_end1:
  719.  
  720. .section __TEXT,__cstring,cstring_literals
  721. L_.str: ## @.str
  722. .asciz "%d powers of two found in %lu ns\n"
  723.  
  724.  
  725. .subsections_via_symbols
  726.  
  727.  
  728.  
  729. ==> powersoftwo-3-i7.s <===================================================
  730. .section __TEXT,__text,regular,pure_instructions
  731. .globl _isPowerOfTwo
  732. _isPowerOfTwo: ## @isPowerOfTwo
  733. Ltmp2:
  734. .cfi_startproc
  735. ## BB#0: ## %entry
  736. pushq %rbp
  737. Ltmp3:
  738. .cfi_def_cfa_offset 16
  739. Ltmp4:
  740. .cfi_offset %rbp, -16
  741. movq %rsp, %rbp
  742. Ltmp5:
  743. .cfi_def_cfa_register %rbp
  744. movl $1, %eax
  745. cmpl $2, %edi
  746. jb LBB0_3
  747. LBB0_1: ## %while.body
  748. ## =>This Inner Loop Header: Depth=1
  749. addl %eax, %eax
  750. cmpl %edi, %eax
  751. jae LBB0_3
  752. ## BB#2: ## %while.body
  753. ## in Loop: Header=BB0_1 Depth=1
  754. testl %eax, %eax
  755. jns LBB0_1
  756. LBB0_3: ## %while.end
  757. cmpl %edi, %eax
  758. sete %al
  759. movzbl %al, %eax
  760. popq %rbp
  761. ret
  762. Ltmp6:
  763. .cfi_endproc
  764. Leh_func_end0:
  765.  
  766. .globl _main
  767. _main: ## @main
  768. Ltmp10:
  769. .cfi_startproc
  770. ## BB#0: ## %entry
  771. pushq %rbp
  772. Ltmp11:
  773. .cfi_def_cfa_offset 16
  774. Ltmp12:
  775. .cfi_offset %rbp, -16
  776. movq %rsp, %rbp
  777. Ltmp13:
  778. .cfi_def_cfa_register %rbp
  779. pushq %r14
  780. pushq %rbx
  781. Ltmp14:
  782. .cfi_offset %rbx, -32
  783. Ltmp15:
  784. .cfi_offset %r14, -24
  785. callq _mach_absolute_time
  786. movq %rax, %r14
  787. xorl %eax, %eax
  788. movl %eax, %ebx
  789. LBB1_1: ## %for.body
  790. ## =>This Loop Header: Depth=1
  791. ## Child Loop BB1_2 Depth 2
  792. movl %ebx, %ecx
  793. movl $1, %edx
  794. cmpl $2, %eax
  795. jb LBB1_4
  796. LBB1_2: ## %while.body.i
  797. ## Parent Loop BB1_1 Depth=1
  798. ## => This Inner Loop Header: Depth=2
  799. addl %edx, %edx
  800. cmpl %eax, %edx
  801. jae LBB1_4
  802. ## BB#3: ## %while.body.i
  803. ## in Loop: Header=BB1_2 Depth=2
  804. testl %edx, %edx
  805. jns LBB1_2
  806. LBB1_4: ## %isPowerOfTwo.exit
  807. ## in Loop: Header=BB1_1 Depth=1
  808. cmpl %edx, %eax
  809. sete %dl
  810. movzbl %dl, %ebx
  811. addl %ecx, %ebx
  812. incl %eax
  813. cmpl $-1, %eax
  814. jne LBB1_1
  815. ## BB#5: ## %for.end
  816. callq _mach_absolute_time
  817. subq %r14, %rax
  818. leaq L_.str(%rip), %rdi
  819. movl %ebx, %esi
  820. movq %rax, %rdx
  821. xorb %al, %al
  822. callq _printf
  823. xorl %eax, %eax
  824. popq %rbx
  825. popq %r14
  826. popq %rbp
  827. ret
  828. Ltmp16:
  829. .cfi_endproc
  830. Leh_func_end1:
  831.  
  832. .section __TEXT,__cstring,cstring_literals
  833. L_.str: ## @.str
  834. .asciz "%d powers of two found in %lu ns\n"
  835.  
  836.  
  837. .subsections_via_symbols
  838.  
  839.  
  840.  
  841. ==> powersoftwo-4-c2.s <===================================================
  842. .section __TEXT,__text,regular,pure_instructions
  843. .globl _isPowerOfTwo
  844. _isPowerOfTwo: ## @isPowerOfTwo
  845. Ltmp2:
  846. .cfi_startproc
  847. ## BB#0: ## %entry
  848. pushq %rbp
  849. Ltmp3:
  850. .cfi_def_cfa_offset 16
  851. Ltmp4:
  852. .cfi_offset %rbp, -16
  853. movq %rsp, %rbp
  854. Ltmp5:
  855. .cfi_def_cfa_register %rbp
  856. movl $1, %eax
  857. cmpl $2, %edi
  858. jb LBB0_4
  859. ## BB#1:
  860. movl $1, %ecx
  861. leaq _isPowerOfTwo.powersOfTwo(%rip), %rdx
  862. LBB0_2: ## %while.body
  863. ## =>This Inner Loop Header: Depth=1
  864. movl (%rdx,%rcx,4), %eax
  865. cmpl %edi, %eax
  866. jae LBB0_4
  867. ## BB#3: ## %while.body
  868. ## in Loop: Header=BB0_2 Depth=1
  869. movq %rcx, %rsi
  870. incq %rsi
  871. cmpl $31, %ecx
  872. movq %rsi, %rcx
  873. jl LBB0_2
  874. LBB0_4: ## %while.end
  875. cmpl %edi, %eax
  876. sete %al
  877. movzbl %al, %eax
  878. popq %rbp
  879. ret
  880. Ltmp6:
  881. .cfi_endproc
  882. Leh_func_end0:
  883.  
  884. .globl _main
  885. _main: ## @main
  886. Ltmp10:
  887. .cfi_startproc
  888. ## BB#0: ## %entry
  889. pushq %rbp
  890. Ltmp11:
  891. .cfi_def_cfa_offset 16
  892. Ltmp12:
  893. .cfi_offset %rbp, -16
  894. movq %rsp, %rbp
  895. Ltmp13:
  896. .cfi_def_cfa_register %rbp
  897. pushq %r14
  898. pushq %rbx
  899. Ltmp14:
  900. .cfi_offset %rbx, -32
  901. Ltmp15:
  902. .cfi_offset %r14, -24
  903. callq _mach_absolute_time
  904. movq %rax, %r14
  905. xorl %eax, %eax
  906. leaq _isPowerOfTwo.powersOfTwo(%rip), %rcx
  907. movl %eax, %ebx
  908. LBB1_1: ## %for.body
  909. ## =>This Loop Header: Depth=1
  910. ## Child Loop BB1_2 Depth 2
  911. movl %ebx, %edx
  912. movl $1, %esi
  913. movl $1, %ebx
  914. cmpl $2, %eax
  915. jb LBB1_4
  916. LBB1_2: ## %while.body.i
  917. ## Parent Loop BB1_1 Depth=1
  918. ## => This Inner Loop Header: Depth=2
  919. movl (%rcx,%rbx,4), %esi
  920. cmpl %eax, %esi
  921. jae LBB1_4
  922. ## BB#3: ## %while.body.i
  923. ## in Loop: Header=BB1_2 Depth=2
  924. movq %rbx, %rdi
  925. incq %rdi
  926. cmpl $31, %ebx
  927. movq %rdi, %rbx
  928. jl LBB1_2
  929. LBB1_4: ## %isPowerOfTwo.exit
  930. ## in Loop: Header=BB1_1 Depth=1
  931. cmpl %esi, %eax
  932. sete %bl
  933. movzbl %bl, %ebx
  934. addl %edx, %ebx
  935. incl %eax
  936. cmpl $-1, %eax
  937. jne LBB1_1
  938. ## BB#5: ## %for.end
  939. callq _mach_absolute_time
  940. subq %r14, %rax
  941. leaq L_.str(%rip), %rdi
  942. movl %ebx, %esi
  943. movq %rax, %rdx
  944. xorb %al, %al
  945. callq _printf
  946. xorl %eax, %eax
  947. popq %rbx
  948. popq %r14
  949. popq %rbp
  950. ret
  951. Ltmp16:
  952. .cfi_endproc
  953. Leh_func_end1:
  954.  
  955. .section __TEXT,__const
  956. .align 4 ## @isPowerOfTwo.powersOfTwo
  957. _isPowerOfTwo.powersOfTwo:
  958. .long 1 ## 0x1
  959. .long 2 ## 0x2
  960. .long 4 ## 0x4
  961. .long 8 ## 0x8
  962. .long 16 ## 0x10
  963. .long 32 ## 0x20
  964. .long 64 ## 0x40
  965. .long 128 ## 0x80
  966. .long 256 ## 0x100
  967. .long 512 ## 0x200
  968. .long 1024 ## 0x400
  969. .long 2048 ## 0x800
  970. .long 4096 ## 0x1000
  971. .long 8192 ## 0x2000
  972. .long 16384 ## 0x4000
  973. .long 32768 ## 0x8000
  974. .long 65536 ## 0x10000
  975. .long 131072 ## 0x20000
  976. .long 262144 ## 0x40000
  977. .long 524288 ## 0x80000
  978. .long 1048576 ## 0x100000
  979. .long 2097152 ## 0x200000
  980. .long 4194304 ## 0x400000
  981. .long 8388608 ## 0x800000
  982. .long 16777216 ## 0x1000000
  983. .long 33554432 ## 0x2000000
  984. .long 67108864 ## 0x4000000
  985. .long 134217728 ## 0x8000000
  986. .long 268435456 ## 0x10000000
  987. .long 536870912 ## 0x20000000
  988. .long 1073741824 ## 0x40000000
  989. .long 2147483648 ## 0x80000000
  990.  
  991. .section __TEXT,__cstring,cstring_literals
  992. L_.str: ## @.str
  993. .asciz "%d powers of two found in %lu ns\n"
  994.  
  995.  
  996. .subsections_via_symbols
  997.  
  998.  
  999.  
  1000. ==> powersoftwo-4-i7.s <===================================================
  1001. .section __TEXT,__text,regular,pure_instructions
  1002. .globl _isPowerOfTwo
  1003. _isPowerOfTwo: ## @isPowerOfTwo
  1004. Ltmp2:
  1005. .cfi_startproc
  1006. ## BB#0: ## %entry
  1007. pushq %rbp
  1008. Ltmp3:
  1009. .cfi_def_cfa_offset 16
  1010. Ltmp4:
  1011. .cfi_offset %rbp, -16
  1012. movq %rsp, %rbp
  1013. Ltmp5:
  1014. .cfi_def_cfa_register %rbp
  1015. movl $1, %eax
  1016. cmpl $2, %edi
  1017. jb LBB0_4
  1018. ## BB#1:
  1019. movl $1, %ecx
  1020. leaq _isPowerOfTwo.powersOfTwo(%rip), %rdx
  1021. LBB0_2: ## %while.body
  1022. ## =>This Inner Loop Header: Depth=1
  1023. movl (%rdx,%rcx,4), %eax
  1024. cmpl %edi, %eax
  1025. jae LBB0_4
  1026. ## BB#3: ## %while.body
  1027. ## in Loop: Header=BB0_2 Depth=1
  1028. movq %rcx, %rsi
  1029. incq %rsi
  1030. cmpl $31, %ecx
  1031. movq %rsi, %rcx
  1032. jl LBB0_2
  1033. LBB0_4: ## %while.end
  1034. cmpl %edi, %eax
  1035. sete %al
  1036. movzbl %al, %eax
  1037. popq %rbp
  1038. ret
  1039. Ltmp6:
  1040. .cfi_endproc
  1041. Leh_func_end0:
  1042.  
  1043. .globl _main
  1044. _main: ## @main
  1045. Ltmp10:
  1046. .cfi_startproc
  1047. ## BB#0: ## %entry
  1048. pushq %rbp
  1049. Ltmp11:
  1050. .cfi_def_cfa_offset 16
  1051. Ltmp12:
  1052. .cfi_offset %rbp, -16
  1053. movq %rsp, %rbp
  1054. Ltmp13:
  1055. .cfi_def_cfa_register %rbp
  1056. pushq %r14
  1057. pushq %rbx
  1058. Ltmp14:
  1059. .cfi_offset %rbx, -32
  1060. Ltmp15:
  1061. .cfi_offset %r14, -24
  1062. callq _mach_absolute_time
  1063. movq %rax, %r14
  1064. xorl %eax, %eax
  1065. leaq _isPowerOfTwo.powersOfTwo(%rip), %rcx
  1066. movl %eax, %ebx
  1067. LBB1_1: ## %for.body
  1068. ## =>This Loop Header: Depth=1
  1069. ## Child Loop BB1_2 Depth 2
  1070. movl %ebx, %edx
  1071. movl $1, %esi
  1072. movl $1, %ebx
  1073. cmpl $2, %eax
  1074. jb LBB1_4
  1075. LBB1_2: ## %while.body.i
  1076. ## Parent Loop BB1_1 Depth=1
  1077. ## => This Inner Loop Header: Depth=2
  1078. movl (%rcx,%rbx,4), %esi
  1079. cmpl %eax, %esi
  1080. jae LBB1_4
  1081. ## BB#3: ## %while.body.i
  1082. ## in Loop: Header=BB1_2 Depth=2
  1083. movq %rbx, %rdi
  1084. incq %rdi
  1085. cmpl $31, %ebx
  1086. movq %rdi, %rbx
  1087. jl LBB1_2
  1088. LBB1_4: ## %isPowerOfTwo.exit
  1089. ## in Loop: Header=BB1_1 Depth=1
  1090. cmpl %esi, %eax
  1091. sete %bl
  1092. movzbl %bl, %ebx
  1093. addl %edx, %ebx
  1094. incl %eax
  1095. cmpl $-1, %eax
  1096. jne LBB1_1
  1097. ## BB#5: ## %for.end
  1098. callq _mach_absolute_time
  1099. subq %r14, %rax
  1100. leaq L_.str(%rip), %rdi
  1101. movl %ebx, %esi
  1102. movq %rax, %rdx
  1103. xorb %al, %al
  1104. callq _printf
  1105. xorl %eax, %eax
  1106. popq %rbx
  1107. popq %r14
  1108. popq %rbp
  1109. ret
  1110. Ltmp16:
  1111. .cfi_endproc
  1112. Leh_func_end1:
  1113.  
  1114. .section __TEXT,__const
  1115. .align 4 ## @isPowerOfTwo.powersOfTwo
  1116. _isPowerOfTwo.powersOfTwo:
  1117. .long 1 ## 0x1
  1118. .long 2 ## 0x2
  1119. .long 4 ## 0x4
  1120. .long 8 ## 0x8
  1121. .long 16 ## 0x10
  1122. .long 32 ## 0x20
  1123. .long 64 ## 0x40
  1124. .long 128 ## 0x80
  1125. .long 256 ## 0x100
  1126. .long 512 ## 0x200
  1127. .long 1024 ## 0x400
  1128. .long 2048 ## 0x800
  1129. .long 4096 ## 0x1000
  1130. .long 8192 ## 0x2000
  1131. .long 16384 ## 0x4000
  1132. .long 32768 ## 0x8000
  1133. .long 65536 ## 0x10000
  1134. .long 131072 ## 0x20000
  1135. .long 262144 ## 0x40000
  1136. .long 524288 ## 0x80000
  1137. .long 1048576 ## 0x100000
  1138. .long 2097152 ## 0x200000
  1139. .long 4194304 ## 0x400000
  1140. .long 8388608 ## 0x800000
  1141. .long 16777216 ## 0x1000000
  1142. .long 33554432 ## 0x2000000
  1143. .long 67108864 ## 0x4000000
  1144. .long 134217728 ## 0x8000000
  1145. .long 268435456 ## 0x10000000
  1146. .long 536870912 ## 0x20000000
  1147. .long 1073741824 ## 0x40000000
  1148. .long 2147483648 ## 0x80000000
  1149.  
  1150. .section __TEXT,__cstring,cstring_literals
  1151. L_.str: ## @.str
  1152. .asciz "%d powers of two found in %lu ns\n"
  1153.  
  1154.  
  1155. .subsections_via_symbols
  1156.  
  1157.  
  1158.  
  1159. ==> powersoftwo-5-c2.s <===================================================
  1160. .section __TEXT,__text,regular,pure_instructions
  1161. .globl _isPowerOfTwo
  1162. _isPowerOfTwo: ## @isPowerOfTwo
  1163. Ltmp2:
  1164. .cfi_startproc
  1165. ## BB#0: ## %entry
  1166. pushq %rbp
  1167. Ltmp3:
  1168. .cfi_def_cfa_offset 16
  1169. Ltmp4:
  1170. .cfi_offset %rbp, -16
  1171. movq %rsp, %rbp
  1172. Ltmp5:
  1173. .cfi_def_cfa_register %rbp
  1174. cmpl $2, %edi
  1175. jb LBB0_6
  1176. ## BB#1: ## %while.cond.preheader
  1177. movb $1, %r9b
  1178. cmpl $65536, %edi ## imm = 0x10000
  1179. je LBB0_5
  1180. ## BB#2:
  1181. movl $16, %eax
  1182. movl $65536, %r10d ## imm = 0x10000
  1183. leaq _isPowerOfTwo.powersOfTwo(%rip), %r8
  1184. movl %eax, %ecx
  1185. LBB0_3: ## %while.body
  1186. ## =>This Inner Loop Header: Depth=1
  1187. movl %ecx, %esi
  1188. shrl $31, %esi
  1189. addl %ecx, %esi
  1190. sarl %esi
  1191. movl %esi, %edx
  1192. negl %edx
  1193. cmpl %edi, %r10d
  1194. cmovbel %esi, %edx
  1195. addl %edx, %eax
  1196. movslq %eax, %rdx
  1197. movl (%r8,%rdx,4), %r10d
  1198. cmpl %edi, %r10d
  1199. setne %dl
  1200. sete %r9b
  1201. cmpl $4, %ecx
  1202. jl LBB0_5
  1203. ## BB#4: ## %while.body
  1204. ## in Loop: Header=BB0_3 Depth=1
  1205. testb %dl, %dl
  1206. movl %esi, %ecx
  1207. jne LBB0_3
  1208. LBB0_5: ## %while.end
  1209. movzbl %r9b, %edi
  1210. LBB0_6: ## %sw.epilog
  1211. movl %edi, %eax
  1212. popq %rbp
  1213. ret
  1214. Ltmp6:
  1215. .cfi_endproc
  1216. Leh_func_end0:
  1217.  
  1218. .globl _main
  1219. _main: ## @main
  1220. Ltmp10:
  1221. .cfi_startproc
  1222. ## BB#0: ## %entry
  1223. pushq %rbp
  1224. Ltmp11:
  1225. .cfi_def_cfa_offset 16
  1226. Ltmp12:
  1227. .cfi_offset %rbp, -16
  1228. movq %rsp, %rbp
  1229. Ltmp13:
  1230. .cfi_def_cfa_register %rbp
  1231. pushq %r15
  1232. pushq %r14
  1233. pushq %rbx
  1234. pushq %rax
  1235. Ltmp14:
  1236. .cfi_offset %rbx, -40
  1237. Ltmp15:
  1238. .cfi_offset %r14, -32
  1239. Ltmp16:
  1240. .cfi_offset %r15, -24
  1241. callq _mach_absolute_time
  1242. movq %rax, %r14
  1243. xorl %r15d, %r15d
  1244. movl %r15d, %ebx
  1245. LBB1_1: ## %for.body
  1246. ## =>This Inner Loop Header: Depth=1
  1247. movl %r15d, %edi
  1248. callq _isPowerOfTwo
  1249. cmpl $1, %eax
  1250. sbbl $-1, %ebx
  1251. incl %r15d
  1252. cmpl $-1, %r15d
  1253. jne LBB1_1
  1254. ## BB#2: ## %for.end
  1255. callq _mach_absolute_time
  1256. subq %r14, %rax
  1257. leaq L_.str(%rip), %rdi
  1258. movl %ebx, %esi
  1259. movq %rax, %rdx
  1260. xorb %al, %al
  1261. callq _printf
  1262. xorl %eax, %eax
  1263. addq $8, %rsp
  1264. popq %rbx
  1265. popq %r14
  1266. popq %r15
  1267. popq %rbp
  1268. ret
  1269. Ltmp17:
  1270. .cfi_endproc
  1271. Leh_func_end1:
  1272.  
  1273. .section __TEXT,__const
  1274. .align 4 ## @isPowerOfTwo.powersOfTwo
  1275. _isPowerOfTwo.powersOfTwo:
  1276. .long 1 ## 0x1
  1277. .long 2 ## 0x2
  1278. .long 4 ## 0x4
  1279. .long 8 ## 0x8
  1280. .long 16 ## 0x10
  1281. .long 32 ## 0x20
  1282. .long 64 ## 0x40
  1283. .long 128 ## 0x80
  1284. .long 256 ## 0x100
  1285. .long 512 ## 0x200
  1286. .long 1024 ## 0x400
  1287. .long 2048 ## 0x800
  1288. .long 4096 ## 0x1000
  1289. .long 8192 ## 0x2000
  1290. .long 16384 ## 0x4000
  1291. .long 32768 ## 0x8000
  1292. .long 65536 ## 0x10000
  1293. .long 131072 ## 0x20000
  1294. .long 262144 ## 0x40000
  1295. .long 524288 ## 0x80000
  1296. .long 1048576 ## 0x100000
  1297. .long 2097152 ## 0x200000
  1298. .long 4194304 ## 0x400000
  1299. .long 8388608 ## 0x800000
  1300. .long 16777216 ## 0x1000000
  1301. .long 33554432 ## 0x2000000
  1302. .long 67108864 ## 0x4000000
  1303. .long 134217728 ## 0x8000000
  1304. .long 268435456 ## 0x10000000
  1305. .long 536870912 ## 0x20000000
  1306. .long 1073741824 ## 0x40000000
  1307. .long 2147483648 ## 0x80000000
  1308.  
  1309. .section __TEXT,__cstring,cstring_literals
  1310. L_.str: ## @.str
  1311. .asciz "%d powers of two found in %lu ns\n"
  1312.  
  1313.  
  1314. .subsections_via_symbols
  1315.  
  1316.  
  1317.  
  1318. ==> powersoftwo-5-i7.s <===================================================
  1319. .section __TEXT,__text,regular,pure_instructions
  1320. .globl _isPowerOfTwo
  1321. _isPowerOfTwo: ## @isPowerOfTwo
  1322. Ltmp2:
  1323. .cfi_startproc
  1324. ## BB#0: ## %entry
  1325. pushq %rbp
  1326. Ltmp3:
  1327. .cfi_def_cfa_offset 16
  1328. Ltmp4:
  1329. .cfi_offset %rbp, -16
  1330. movq %rsp, %rbp
  1331. Ltmp5:
  1332. .cfi_def_cfa_register %rbp
  1333. cmpl $2, %edi
  1334. jb LBB0_6
  1335. ## BB#1: ## %while.cond.preheader
  1336. movb $1, %r9b
  1337. cmpl $65536, %edi ## imm = 0x10000
  1338. je LBB0_5
  1339. ## BB#2:
  1340. movl $16, %eax
  1341. movl $65536, %r10d ## imm = 0x10000
  1342. leaq _isPowerOfTwo.powersOfTwo(%rip), %r8
  1343. movl %eax, %ecx
  1344. LBB0_3: ## %while.body
  1345. ## =>This Inner Loop Header: Depth=1
  1346. movl %ecx, %esi
  1347. shrl $31, %esi
  1348. addl %ecx, %esi
  1349. sarl %esi
  1350. movl %esi, %edx
  1351. negl %edx
  1352. cmpl %edi, %r10d
  1353. cmovbel %esi, %edx
  1354. addl %edx, %eax
  1355. movslq %eax, %rdx
  1356. movl (%r8,%rdx,4), %r10d
  1357. cmpl %edi, %r10d
  1358. setne %dl
  1359. sete %r9b
  1360. cmpl $4, %ecx
  1361. jl LBB0_5
  1362. ## BB#4: ## %while.body
  1363. ## in Loop: Header=BB0_3 Depth=1
  1364. testb %dl, %dl
  1365. movl %esi, %ecx
  1366. jne LBB0_3
  1367. LBB0_5: ## %while.end
  1368. movzbl %r9b, %edi
  1369. LBB0_6: ## %sw.epilog
  1370. movl %edi, %eax
  1371. popq %rbp
  1372. ret
  1373. Ltmp6:
  1374. .cfi_endproc
  1375. Leh_func_end0:
  1376.  
  1377. .globl _main
  1378. _main: ## @main
  1379. Ltmp10:
  1380. .cfi_startproc
  1381. ## BB#0: ## %entry
  1382. pushq %rbp
  1383. Ltmp11:
  1384. .cfi_def_cfa_offset 16
  1385. Ltmp12:
  1386. .cfi_offset %rbp, -16
  1387. movq %rsp, %rbp
  1388. Ltmp13:
  1389. .cfi_def_cfa_register %rbp
  1390. pushq %r15
  1391. pushq %r14
  1392. pushq %rbx
  1393. pushq %rax
  1394. Ltmp14:
  1395. .cfi_offset %rbx, -40
  1396. Ltmp15:
  1397. .cfi_offset %r14, -32
  1398. Ltmp16:
  1399. .cfi_offset %r15, -24
  1400. callq _mach_absolute_time
  1401. movq %rax, %r14
  1402. xorl %r15d, %r15d
  1403. movl %r15d, %ebx
  1404. LBB1_1: ## %for.body
  1405. ## =>This Inner Loop Header: Depth=1
  1406. movl %r15d, %edi
  1407. callq _isPowerOfTwo
  1408. cmpl $1, %eax
  1409. sbbl $-1, %ebx
  1410. incl %r15d
  1411. cmpl $-1, %r15d
  1412. jne LBB1_1
  1413. ## BB#2: ## %for.end
  1414. callq _mach_absolute_time
  1415. subq %r14, %rax
  1416. leaq L_.str(%rip), %rdi
  1417. movl %ebx, %esi
  1418. movq %rax, %rdx
  1419. xorb %al, %al
  1420. callq _printf
  1421. xorl %eax, %eax
  1422. addq $8, %rsp
  1423. popq %rbx
  1424. popq %r14
  1425. popq %r15
  1426. popq %rbp
  1427. ret
  1428. Ltmp17:
  1429. .cfi_endproc
  1430. Leh_func_end1:
  1431.  
  1432. .section __TEXT,__const
  1433. .align 4 ## @isPowerOfTwo.powersOfTwo
  1434. _isPowerOfTwo.powersOfTwo:
  1435. .long 1 ## 0x1
  1436. .long 2 ## 0x2
  1437. .long 4 ## 0x4
  1438. .long 8 ## 0x8
  1439. .long 16 ## 0x10
  1440. .long 32 ## 0x20
  1441. .long 64 ## 0x40
  1442. .long 128 ## 0x80
  1443. .long 256 ## 0x100
  1444. .long 512 ## 0x200
  1445. .long 1024 ## 0x400
  1446. .long 2048 ## 0x800
  1447. .long 4096 ## 0x1000
  1448. .long 8192 ## 0x2000
  1449. .long 16384 ## 0x4000
  1450. .long 32768 ## 0x8000
  1451. .long 65536 ## 0x10000
  1452. .long 131072 ## 0x20000
  1453. .long 262144 ## 0x40000
  1454. .long 524288 ## 0x80000
  1455. .long 1048576 ## 0x100000
  1456. .long 2097152 ## 0x200000
  1457. .long 4194304 ## 0x400000
  1458. .long 8388608 ## 0x800000
  1459. .long 16777216 ## 0x1000000
  1460. .long 33554432 ## 0x2000000
  1461. .long 67108864 ## 0x4000000
  1462. .long 134217728 ## 0x8000000
  1463. .long 268435456 ## 0x10000000
  1464. .long 536870912 ## 0x20000000
  1465. .long 1073741824 ## 0x40000000
  1466. .long 2147483648 ## 0x80000000
  1467.  
  1468. .section __TEXT,__cstring,cstring_literals
  1469. L_.str: ## @.str
  1470. .asciz "%d powers of two found in %lu ns\n"
  1471.  
  1472.  
  1473. .subsections_via_symbols
  1474.  
  1475.  
  1476.  
  1477. ==> powersoftwo-6-c2.s <===================================================
  1478. .section __TEXT,__text,regular,pure_instructions
  1479. .section __TEXT,__literal8,8byte_literals
  1480. .align 3
  1481. LCPI0_0:
  1482. .quad 4604418534313441775 ## double 6.931472e-01
  1483. .section __TEXT,__text,regular,pure_instructions
  1484. .globl _isPowerOfTwo
  1485. _isPowerOfTwo: ## @isPowerOfTwo
  1486. Ltmp3:
  1487. .cfi_startproc
  1488. ## BB#0: ## %entry
  1489. pushq %rbp
  1490. Ltmp4:
  1491. .cfi_def_cfa_offset 16
  1492. Ltmp5:
  1493. .cfi_offset %rbp, -16
  1494. movq %rsp, %rbp
  1495. Ltmp6:
  1496. .cfi_def_cfa_register %rbp
  1497. pushq %rbx
  1498. pushq %rax
  1499. Ltmp7:
  1500. .cfi_offset %rbx, -24
  1501. movl %edi, %ebx
  1502. xorl %eax, %eax
  1503. testl %ebx, %ebx
  1504. je LBB0_5
  1505. ## BB#1: ## %entry
  1506. cmpl $-2147483648, %ebx ## imm = 0xFFFFFFFF80000000
  1507. ja LBB0_5
  1508. ## BB#2: ## %if.else
  1509. movl %ebx, %eax
  1510. cvtsi2sdq %rax, %xmm0
  1511. callq _log
  1512. divsd LCPI0_0(%rip), %xmm0
  1513. movb $1, %al
  1514. leaq _isPowerOfTwo.powersOfTwo(%rip), %rdx
  1515. cvttsd2si %xmm0, %ecx
  1516. movslq %ecx, %rsi
  1517. cmpl %ebx, (%rdx,%rsi,4)
  1518. je LBB0_4
  1519. ## BB#3: ## %lor.rhs
  1520. incl %ecx
  1521. movslq %ecx, %rax
  1522. leaq _isPowerOfTwo.powersOfTwo(%rip), %rcx
  1523. cmpl %ebx, (%rcx,%rax,4)
  1524. sete %al
  1525. LBB0_4: ## %lor.end
  1526. movzbl %al, %eax
  1527. LBB0_5: ## %if.end
  1528. addq $8, %rsp
  1529. popq %rbx
  1530. popq %rbp
  1531. ret
  1532. Ltmp8:
  1533. .cfi_endproc
  1534. Leh_func_end0:
  1535.  
  1536. .globl _main
  1537. _main: ## @main
  1538. Ltmp12:
  1539. .cfi_startproc
  1540. ## BB#0: ## %entry
  1541. pushq %rbp
  1542. Ltmp13:
  1543. .cfi_def_cfa_offset 16
  1544. Ltmp14:
  1545. .cfi_offset %rbp, -16
  1546. movq %rsp, %rbp
  1547. Ltmp15:
  1548. .cfi_def_cfa_register %rbp
  1549. pushq %r15
  1550. pushq %r14
  1551. pushq %rbx
  1552. pushq %rax
  1553. Ltmp16:
  1554. .cfi_offset %rbx, -40
  1555. Ltmp17:
  1556. .cfi_offset %r14, -32
  1557. Ltmp18:
  1558. .cfi_offset %r15, -24
  1559. callq _mach_absolute_time
  1560. movq %rax, %r14
  1561. xorl %r15d, %r15d
  1562. movl %r15d, %ebx
  1563. LBB1_1: ## %for.body
  1564. ## =>This Inner Loop Header: Depth=1
  1565. movl %r15d, %edi
  1566. callq _isPowerOfTwo
  1567. cmpl $1, %eax
  1568. sbbl $-1, %ebx
  1569. incl %r15d
  1570. cmpl $-1, %r15d
  1571. jne LBB1_1
  1572. ## BB#2: ## %for.end
  1573. callq _mach_absolute_time
  1574. subq %r14, %rax
  1575. leaq L_.str(%rip), %rdi
  1576. movl %ebx, %esi
  1577. movq %rax, %rdx
  1578. xorb %al, %al
  1579. callq _printf
  1580. xorl %eax, %eax
  1581. addq $8, %rsp
  1582. popq %rbx
  1583. popq %r14
  1584. popq %r15
  1585. popq %rbp
  1586. ret
  1587. Ltmp19:
  1588. .cfi_endproc
  1589. Leh_func_end1:
  1590.  
  1591. .section __TEXT,__const
  1592. .align 4 ## @isPowerOfTwo.powersOfTwo
  1593. _isPowerOfTwo.powersOfTwo:
  1594. .long 1 ## 0x1
  1595. .long 2 ## 0x2
  1596. .long 4 ## 0x4
  1597. .long 8 ## 0x8
  1598. .long 16 ## 0x10
  1599. .long 32 ## 0x20
  1600. .long 64 ## 0x40
  1601. .long 128 ## 0x80
  1602. .long 256 ## 0x100
  1603. .long 512 ## 0x200
  1604. .long 1024 ## 0x400
  1605. .long 2048 ## 0x800
  1606. .long 4096 ## 0x1000
  1607. .long 8192 ## 0x2000
  1608. .long 16384 ## 0x4000
  1609. .long 32768 ## 0x8000
  1610. .long 65536 ## 0x10000
  1611. .long 131072 ## 0x20000
  1612. .long 262144 ## 0x40000
  1613. .long 524288 ## 0x80000
  1614. .long 1048576 ## 0x100000
  1615. .long 2097152 ## 0x200000
  1616. .long 4194304 ## 0x400000
  1617. .long 8388608 ## 0x800000
  1618. .long 16777216 ## 0x1000000
  1619. .long 33554432 ## 0x2000000
  1620. .long 67108864 ## 0x4000000
  1621. .long 134217728 ## 0x8000000
  1622. .long 268435456 ## 0x10000000
  1623. .long 536870912 ## 0x20000000
  1624. .long 1073741824 ## 0x40000000
  1625. .long 2147483648 ## 0x80000000
  1626.  
  1627. .section __TEXT,__cstring,cstring_literals
  1628. L_.str: ## @.str
  1629. .asciz "%d powers of two found in %lu ns\n"
  1630.  
  1631.  
  1632. .subsections_via_symbols
  1633.  
  1634.  
  1635.  
  1636. ==> powersoftwo-6-i7.s <===================================================
  1637. .section __TEXT,__text,regular,pure_instructions
  1638. .section __TEXT,__literal8,8byte_literals
  1639. .align 3
  1640. LCPI0_0:
  1641. .quad 4604418534313441775 ## double 6.931472e-01
  1642. .section __TEXT,__text,regular,pure_instructions
  1643. .globl _isPowerOfTwo
  1644. _isPowerOfTwo: ## @isPowerOfTwo
  1645. Ltmp3:
  1646. .cfi_startproc
  1647. ## BB#0: ## %entry
  1648. pushq %rbp
  1649. Ltmp4:
  1650. .cfi_def_cfa_offset 16
  1651. Ltmp5:
  1652. .cfi_offset %rbp, -16
  1653. movq %rsp, %rbp
  1654. Ltmp6:
  1655. .cfi_def_cfa_register %rbp
  1656. pushq %rbx
  1657. pushq %rax
  1658. Ltmp7:
  1659. .cfi_offset %rbx, -24
  1660. movl %edi, %ebx
  1661. xorl %eax, %eax
  1662. testl %ebx, %ebx
  1663. je LBB0_5
  1664. ## BB#1: ## %entry
  1665. cmpl $-2147483648, %ebx ## imm = 0xFFFFFFFF80000000
  1666. ja LBB0_5
  1667. ## BB#2: ## %if.else
  1668. movl %ebx, %eax
  1669. cvtsi2sdq %rax, %xmm0
  1670. callq _log
  1671. divsd LCPI0_0(%rip), %xmm0
  1672. movb $1, %al
  1673. leaq _isPowerOfTwo.powersOfTwo(%rip), %rdx
  1674. cvttsd2si %xmm0, %ecx
  1675. movslq %ecx, %rsi
  1676. cmpl %ebx, (%rdx,%rsi,4)
  1677. je LBB0_4
  1678. ## BB#3: ## %lor.rhs
  1679. incl %ecx
  1680. movslq %ecx, %rax
  1681. leaq _isPowerOfTwo.powersOfTwo(%rip), %rcx
  1682. cmpl %ebx, (%rcx,%rax,4)
  1683. sete %al
  1684. LBB0_4: ## %lor.end
  1685. movzbl %al, %eax
  1686. LBB0_5: ## %if.end
  1687. addq $8, %rsp
  1688. popq %rbx
  1689. popq %rbp
  1690. ret
  1691. Ltmp8:
  1692. .cfi_endproc
  1693. Leh_func_end0:
  1694.  
  1695. .globl _main
  1696. _main: ## @main
  1697. Ltmp12:
  1698. .cfi_startproc
  1699. ## BB#0: ## %entry
  1700. pushq %rbp
  1701. Ltmp13:
  1702. .cfi_def_cfa_offset 16
  1703. Ltmp14:
  1704. .cfi_offset %rbp, -16
  1705. movq %rsp, %rbp
  1706. Ltmp15:
  1707. .cfi_def_cfa_register %rbp
  1708. pushq %r15
  1709. pushq %r14
  1710. pushq %rbx
  1711. pushq %rax
  1712. Ltmp16:
  1713. .cfi_offset %rbx, -40
  1714. Ltmp17:
  1715. .cfi_offset %r14, -32
  1716. Ltmp18:
  1717. .cfi_offset %r15, -24
  1718. callq _mach_absolute_time
  1719. movq %rax, %r14
  1720. xorl %r15d, %r15d
  1721. movl %r15d, %ebx
  1722. LBB1_1: ## %for.body
  1723. ## =>This Inner Loop Header: Depth=1
  1724. movl %r15d, %edi
  1725. callq _isPowerOfTwo
  1726. cmpl $1, %eax
  1727. sbbl $-1, %ebx
  1728. incl %r15d
  1729. cmpl $-1, %r15d
  1730. jne LBB1_1
  1731. ## BB#2: ## %for.end
  1732. callq _mach_absolute_time
  1733. subq %r14, %rax
  1734. leaq L_.str(%rip), %rdi
  1735. movl %ebx, %esi
  1736. movq %rax, %rdx
  1737. xorb %al, %al
  1738. callq _printf
  1739. xorl %eax, %eax
  1740. addq $8, %rsp
  1741. popq %rbx
  1742. popq %r14
  1743. popq %r15
  1744. popq %rbp
  1745. ret
  1746. Ltmp19:
  1747. .cfi_endproc
  1748. Leh_func_end1:
  1749.  
  1750. .section __TEXT,__const
  1751. .align 4 ## @isPowerOfTwo.powersOfTwo
  1752. _isPowerOfTwo.powersOfTwo:
  1753. .long 1 ## 0x1
  1754. .long 2 ## 0x2
  1755. .long 4 ## 0x4
  1756. .long 8 ## 0x8
  1757. .long 16 ## 0x10
  1758. .long 32 ## 0x20
  1759. .long 64 ## 0x40
  1760. .long 128 ## 0x80
  1761. .long 256 ## 0x100
  1762. .long 512 ## 0x200
  1763. .long 1024 ## 0x400
  1764. .long 2048 ## 0x800
  1765. .long 4096 ## 0x1000
  1766. .long 8192 ## 0x2000
  1767. .long 16384 ## 0x4000
  1768. .long 32768 ## 0x8000
  1769. .long 65536 ## 0x10000
  1770. .long 131072 ## 0x20000
  1771. .long 262144 ## 0x40000
  1772. .long 524288 ## 0x80000
  1773. .long 1048576 ## 0x100000
  1774. .long 2097152 ## 0x200000
  1775. .long 4194304 ## 0x400000
  1776. .long 8388608 ## 0x800000
  1777. .long 16777216 ## 0x1000000
  1778. .long 33554432 ## 0x2000000
  1779. .long 67108864 ## 0x4000000
  1780. .long 134217728 ## 0x8000000
  1781. .long 268435456 ## 0x10000000
  1782. .long 536870912 ## 0x20000000
  1783. .long 1073741824 ## 0x40000000
  1784. .long 2147483648 ## 0x80000000
  1785.  
  1786. .section __TEXT,__cstring,cstring_literals
  1787. L_.str: ## @.str
  1788. .asciz "%d powers of two found in %lu ns\n"
  1789.  
  1790.  
  1791. .subsections_via_symbols
  1792.  
  1793.  
  1794.  
  1795. ==> powersoftwo-7-c2.s <===================================================
  1796. .section __TEXT,__text,regular,pure_instructions
  1797. .globl _isPowerOfTwo
  1798. _isPowerOfTwo: ## @isPowerOfTwo
  1799. Ltmp2:
  1800. .cfi_startproc
  1801. ## BB#0: ## %entry
  1802. pushq %rbp
  1803. Ltmp3:
  1804. .cfi_def_cfa_offset 16
  1805. Ltmp4:
  1806. .cfi_offset %rbp, -16
  1807. movq %rsp, %rbp
  1808. Ltmp5:
  1809. .cfi_def_cfa_register %rbp
  1810. xorb %al, %al
  1811. testl %edi, %edi
  1812. je LBB0_5
  1813. ## BB#1:
  1814. xorl %eax, %eax
  1815. LBB0_2: ## %while.body
  1816. ## =>This Inner Loop Header: Depth=1
  1817. movl %edi, %ecx
  1818. andl $1, %ecx
  1819. addl %ecx, %eax
  1820. shrl %edi
  1821. testl %edi, %edi
  1822. je LBB0_4
  1823. ## BB#3: ## %while.body
  1824. ## in Loop: Header=BB0_2 Depth=1
  1825. cmpl $2, %eax
  1826. jb LBB0_2
  1827. LBB0_4: ## %while.cond.while.end_crit_edge
  1828. cmpl $1, %eax
  1829. sete %al
  1830. LBB0_5: ## %while.end
  1831. movzbl %al, %eax
  1832. popq %rbp
  1833. ret
  1834. Ltmp6:
  1835. .cfi_endproc
  1836. Leh_func_end0:
  1837.  
  1838. .globl _main
  1839. _main: ## @main
  1840. Ltmp10:
  1841. .cfi_startproc
  1842. ## BB#0: ## %entry
  1843. pushq %rbp
  1844. Ltmp11:
  1845. .cfi_def_cfa_offset 16
  1846. Ltmp12:
  1847. .cfi_offset %rbp, -16
  1848. movq %rsp, %rbp
  1849. Ltmp13:
  1850. .cfi_def_cfa_register %rbp
  1851. pushq %r14
  1852. pushq %rbx
  1853. Ltmp14:
  1854. .cfi_offset %rbx, -32
  1855. Ltmp15:
  1856. .cfi_offset %r14, -24
  1857. callq _mach_absolute_time
  1858. movq %rax, %r14
  1859. xorl %ebx, %ebx
  1860. movl %ebx, %esi
  1861. jmp LBB1_1
  1862. LBB1_2: ## %for.cond
  1863. ## in Loop: Header=BB1_1 Depth=1
  1864. xorb %al, %al
  1865. testl %esi, %esi
  1866. movl %esi, %edx
  1867. movl $0, %ecx
  1868. je LBB1_6
  1869. LBB1_3: ## %while.body.i
  1870. ## Parent Loop BB1_1 Depth=1
  1871. ## => This Inner Loop Header: Depth=2
  1872. movl %edx, %eax
  1873. andl $1, %eax
  1874. addl %eax, %ecx
  1875. shrl %edx
  1876. testl %edx, %edx
  1877. je LBB1_5
  1878. ## BB#4: ## %while.body.i
  1879. ## in Loop: Header=BB1_3 Depth=2
  1880. cmpl $2, %ecx
  1881. jb LBB1_3
  1882. LBB1_5: ## %while.cond.while.end_crit_edge.i
  1883. ## in Loop: Header=BB1_1 Depth=1
  1884. cmpl $1, %ecx
  1885. sete %al
  1886. LBB1_6: ## %isPowerOfTwo.exit
  1887. ## in Loop: Header=BB1_1 Depth=1
  1888. movzbl %al, %eax
  1889. addl %eax, %ebx
  1890. incl %esi
  1891. LBB1_1: ## %for.cond
  1892. ## =>This Loop Header: Depth=1
  1893. ## Child Loop BB1_3 Depth 2
  1894. cmpl $-1, %esi
  1895. jne LBB1_2
  1896. ## BB#7: ## %for.end
  1897. callq _mach_absolute_time
  1898. subq %r14, %rax
  1899. leaq L_.str(%rip), %rdi
  1900. movl %ebx, %esi
  1901. movq %rax, %rdx
  1902. xorb %al, %al
  1903. callq _printf
  1904. xorl %eax, %eax
  1905. popq %rbx
  1906. popq %r14
  1907. popq %rbp
  1908. ret
  1909. Ltmp16:
  1910. .cfi_endproc
  1911. Leh_func_end1:
  1912.  
  1913. .section __TEXT,__cstring,cstring_literals
  1914. L_.str: ## @.str
  1915. .asciz "%d powers of two found in %lu ns\n"
  1916.  
  1917.  
  1918. .subsections_via_symbols
  1919.  
  1920.  
  1921.  
  1922. ==> powersoftwo-7-i7.s <===================================================
  1923. .section __TEXT,__text,regular,pure_instructions
  1924. .globl _isPowerOfTwo
  1925. _isPowerOfTwo: ## @isPowerOfTwo
  1926. Ltmp2:
  1927. .cfi_startproc
  1928. ## BB#0: ## %entry
  1929. pushq %rbp
  1930. Ltmp3:
  1931. .cfi_def_cfa_offset 16
  1932. Ltmp4:
  1933. .cfi_offset %rbp, -16
  1934. movq %rsp, %rbp
  1935. Ltmp5:
  1936. .cfi_def_cfa_register %rbp
  1937. xorb %al, %al
  1938. testl %edi, %edi
  1939. je LBB0_5
  1940. ## BB#1:
  1941. xorl %eax, %eax
  1942. LBB0_2: ## %while.body
  1943. ## =>This Inner Loop Header: Depth=1
  1944. movl %edi, %ecx
  1945. andl $1, %ecx
  1946. addl %ecx, %eax
  1947. shrl %edi
  1948. testl %edi, %edi
  1949. je LBB0_4
  1950. ## BB#3: ## %while.body
  1951. ## in Loop: Header=BB0_2 Depth=1
  1952. cmpl $2, %eax
  1953. jb LBB0_2
  1954. LBB0_4: ## %while.cond.while.end_crit_edge
  1955. cmpl $1, %eax
  1956. sete %al
  1957. LBB0_5: ## %while.end
  1958. movzbl %al, %eax
  1959. popq %rbp
  1960. ret
  1961. Ltmp6:
  1962. .cfi_endproc
  1963. Leh_func_end0:
  1964.  
  1965. .globl _main
  1966. _main: ## @main
  1967. Ltmp10:
  1968. .cfi_startproc
  1969. ## BB#0: ## %entry
  1970. pushq %rbp
  1971. Ltmp11:
  1972. .cfi_def_cfa_offset 16
  1973. Ltmp12:
  1974. .cfi_offset %rbp, -16
  1975. movq %rsp, %rbp
  1976. Ltmp13:
  1977. .cfi_def_cfa_register %rbp
  1978. pushq %r14
  1979. pushq %rbx
  1980. Ltmp14:
  1981. .cfi_offset %rbx, -32
  1982. Ltmp15:
  1983. .cfi_offset %r14, -24
  1984. callq _mach_absolute_time
  1985. movq %rax, %r14
  1986. xorl %ebx, %ebx
  1987. movl %ebx, %esi
  1988. jmp LBB1_1
  1989. LBB1_2: ## %for.cond
  1990. ## in Loop: Header=BB1_1 Depth=1
  1991. xorb %al, %al
  1992. testl %esi, %esi
  1993. movl %esi, %edx
  1994. movl $0, %ecx
  1995. je LBB1_6
  1996. LBB1_3: ## %while.body.i
  1997. ## Parent Loop BB1_1 Depth=1
  1998. ## => This Inner Loop Header: Depth=2
  1999. movl %edx, %eax
  2000. andl $1, %eax
  2001. addl %eax, %ecx
  2002. shrl %edx
  2003. testl %edx, %edx
  2004. je LBB1_5
  2005. ## BB#4: ## %while.body.i
  2006. ## in Loop: Header=BB1_3 Depth=2
  2007. cmpl $2, %ecx
  2008. jb LBB1_3
  2009. LBB1_5: ## %while.cond.while.end_crit_edge.i
  2010. ## in Loop: Header=BB1_1 Depth=1
  2011. cmpl $1, %ecx
  2012. sete %al
  2013. LBB1_6: ## %isPowerOfTwo.exit
  2014. ## in Loop: Header=BB1_1 Depth=1
  2015. movzbl %al, %eax
  2016. addl %eax, %ebx
  2017. incl %esi
  2018. LBB1_1: ## %for.cond
  2019. ## =>This Loop Header: Depth=1
  2020. ## Child Loop BB1_3 Depth 2
  2021. cmpl $-1, %esi
  2022. jne LBB1_2
  2023. ## BB#7: ## %for.end
  2024. callq _mach_absolute_time
  2025. subq %r14, %rax
  2026. leaq L_.str(%rip), %rdi
  2027. movl %ebx, %esi
  2028. movq %rax, %rdx
  2029. xorb %al, %al
  2030. callq _printf
  2031. xorl %eax, %eax
  2032. popq %rbx
  2033. popq %r14
  2034. popq %rbp
  2035. ret
  2036. Ltmp16:
  2037. .cfi_endproc
  2038. Leh_func_end1:
  2039.  
  2040. .section __TEXT,__cstring,cstring_literals
  2041. L_.str: ## @.str
  2042. .asciz "%d powers of two found in %lu ns\n"
  2043.  
  2044.  
  2045. .subsections_via_symbols
  2046.  
  2047.  
  2048.  
  2049. ==> powersoftwo-8-c2.s <===================================================
  2050. .section __TEXT,__text,regular,pure_instructions
  2051. .globl _isPowerOfTwo
  2052. _isPowerOfTwo: ## @isPowerOfTwo
  2053. Ltmp2:
  2054. .cfi_startproc
  2055. ## BB#0: ## %entry
  2056. pushq %rbp
  2057. Ltmp3:
  2058. .cfi_def_cfa_offset 16
  2059. Ltmp4:
  2060. .cfi_offset %rbp, -16
  2061. movq %rsp, %rbp
  2062. Ltmp5:
  2063. .cfi_def_cfa_register %rbp
  2064. testb $1, %dil
  2065. je LBB0_2
  2066. LBB0_1:
  2067. movl %edi, %eax
  2068. jmp LBB0_5
  2069. LBB0_2: ## %entry
  2070. cmpl $2, %edi
  2071. jb LBB0_1
  2072. LBB0_3: ## %while.body
  2073. ## =>This Inner Loop Header: Depth=1
  2074. movl %edi, %eax
  2075. shrl %eax
  2076. btl $1, %edi
  2077. jb LBB0_5
  2078. ## BB#4: ## %while.body
  2079. ## in Loop: Header=BB0_3 Depth=1
  2080. cmpl $3, %edi
  2081. movl %eax, %edi
  2082. ja LBB0_3
  2083. LBB0_5: ## %while.end
  2084. cmpl $1, %eax
  2085. sete %al
  2086. movzbl %al, %eax
  2087. popq %rbp
  2088. ret
  2089. Ltmp6:
  2090. .cfi_endproc
  2091. Leh_func_end0:
  2092.  
  2093. .globl _main
  2094. _main: ## @main
  2095. Ltmp10:
  2096. .cfi_startproc
  2097. ## BB#0: ## %entry
  2098. pushq %rbp
  2099. Ltmp11:
  2100. .cfi_def_cfa_offset 16
  2101. Ltmp12:
  2102. .cfi_offset %rbp, -16
  2103. movq %rsp, %rbp
  2104. Ltmp13:
  2105. .cfi_def_cfa_register %rbp
  2106. pushq %r14
  2107. pushq %rbx
  2108. Ltmp14:
  2109. .cfi_offset %rbx, -32
  2110. Ltmp15:
  2111. .cfi_offset %r14, -24
  2112. callq _mach_absolute_time
  2113. movq %rax, %r14
  2114. xorl %eax, %eax
  2115. movl %eax, %ebx
  2116. LBB1_1: ## %for.body
  2117. ## =>This Loop Header: Depth=1
  2118. ## Child Loop BB1_3 Depth 2
  2119. movl %ebx, %ecx
  2120. testb $1, %al
  2121. movl %eax, %edx
  2122. jne LBB1_5
  2123. ## BB#2: ## %for.body
  2124. ## in Loop: Header=BB1_1 Depth=1
  2125. cmpl $2, %eax
  2126. movl %eax, %esi
  2127. movl %eax, %edx
  2128. jb LBB1_5
  2129. LBB1_3: ## %while.body.i
  2130. ## Parent Loop BB1_1 Depth=1
  2131. ## => This Inner Loop Header: Depth=2
  2132. movl %esi, %edx
  2133. shrl %edx
  2134. btl $1, %esi
  2135. jb LBB1_5
  2136. ## BB#4: ## %while.body.i
  2137. ## in Loop: Header=BB1_3 Depth=2
  2138. cmpl $3, %esi
  2139. movl %edx, %esi
  2140. ja LBB1_3
  2141. LBB1_5: ## %isPowerOfTwo.exit
  2142. ## in Loop: Header=BB1_1 Depth=1
  2143. cmpl $1, %edx
  2144. sete %dl
  2145. movzbl %dl, %ebx
  2146. addl %ecx, %ebx
  2147. incl %eax
  2148. cmpl $-1, %eax
  2149. jne LBB1_1
  2150. ## BB#6: ## %for.end
  2151. callq _mach_absolute_time
  2152. subq %r14, %rax
  2153. leaq L_.str(%rip), %rdi
  2154. movl %ebx, %esi
  2155. movq %rax, %rdx
  2156. xorb %al, %al
  2157. callq _printf
  2158. xorl %eax, %eax
  2159. popq %rbx
  2160. popq %r14
  2161. popq %rbp
  2162. ret
  2163. Ltmp16:
  2164. .cfi_endproc
  2165. Leh_func_end1:
  2166.  
  2167. .section __TEXT,__cstring,cstring_literals
  2168. L_.str: ## @.str
  2169. .asciz "%d powers of two found in %lu ns\n"
  2170.  
  2171.  
  2172. .subsections_via_symbols
  2173.  
  2174.  
  2175.  
  2176. ==> powersoftwo-8-i7.s <===================================================
  2177. .section __TEXT,__text,regular,pure_instructions
  2178. .globl _isPowerOfTwo
  2179. _isPowerOfTwo: ## @isPowerOfTwo
  2180. Ltmp2:
  2181. .cfi_startproc
  2182. ## BB#0: ## %entry
  2183. pushq %rbp
  2184. Ltmp3:
  2185. .cfi_def_cfa_offset 16
  2186. Ltmp4:
  2187. .cfi_offset %rbp, -16
  2188. movq %rsp, %rbp
  2189. Ltmp5:
  2190. .cfi_def_cfa_register %rbp
  2191. testb $1, %dil
  2192. je LBB0_2
  2193. LBB0_1:
  2194. movl %edi, %eax
  2195. jmp LBB0_5
  2196. LBB0_2: ## %entry
  2197. cmpl $2, %edi
  2198. jb LBB0_1
  2199. LBB0_3: ## %while.body
  2200. ## =>This Inner Loop Header: Depth=1
  2201. movl %edi, %eax
  2202. shrl %eax
  2203. btl $1, %edi
  2204. jb LBB0_5
  2205. ## BB#4: ## %while.body
  2206. ## in Loop: Header=BB0_3 Depth=1
  2207. cmpl $3, %edi
  2208. movl %eax, %edi
  2209. ja LBB0_3
  2210. LBB0_5: ## %while.end
  2211. cmpl $1, %eax
  2212. sete %al
  2213. movzbl %al, %eax
  2214. popq %rbp
  2215. ret
  2216. Ltmp6:
  2217. .cfi_endproc
  2218. Leh_func_end0:
  2219.  
  2220. .globl _main
  2221. _main: ## @main
  2222. Ltmp10:
  2223. .cfi_startproc
  2224. ## BB#0: ## %entry
  2225. pushq %rbp
  2226. Ltmp11:
  2227. .cfi_def_cfa_offset 16
  2228. Ltmp12:
  2229. .cfi_offset %rbp, -16
  2230. movq %rsp, %rbp
  2231. Ltmp13:
  2232. .cfi_def_cfa_register %rbp
  2233. pushq %r14
  2234. pushq %rbx
  2235. Ltmp14:
  2236. .cfi_offset %rbx, -32
  2237. Ltmp15:
  2238. .cfi_offset %r14, -24
  2239. callq _mach_absolute_time
  2240. movq %rax, %r14
  2241. xorl %eax, %eax
  2242. movl %eax, %ebx
  2243. LBB1_1: ## %for.body
  2244. ## =>This Loop Header: Depth=1
  2245. ## Child Loop BB1_3 Depth 2
  2246. movl %ebx, %ecx
  2247. testb $1, %al
  2248. movl %eax, %edx
  2249. jne LBB1_5
  2250. ## BB#2: ## %for.body
  2251. ## in Loop: Header=BB1_1 Depth=1
  2252. cmpl $2, %eax
  2253. movl %eax, %esi
  2254. movl %eax, %edx
  2255. jb LBB1_5
  2256. LBB1_3: ## %while.body.i
  2257. ## Parent Loop BB1_1 Depth=1
  2258. ## => This Inner Loop Header: Depth=2
  2259. movl %esi, %edx
  2260. shrl %edx
  2261. btl $1, %esi
  2262. jb LBB1_5
  2263. ## BB#4: ## %while.body.i
  2264. ## in Loop: Header=BB1_3 Depth=2
  2265. cmpl $3, %esi
  2266. movl %edx, %esi
  2267. ja LBB1_3
  2268. LBB1_5: ## %isPowerOfTwo.exit
  2269. ## in Loop: Header=BB1_1 Depth=1
  2270. cmpl $1, %edx
  2271. sete %dl
  2272. movzbl %dl, %ebx
  2273. addl %ecx, %ebx
  2274. incl %eax
  2275. cmpl $-1, %eax
  2276. jne LBB1_1
  2277. ## BB#6: ## %for.end
  2278. callq _mach_absolute_time
  2279. subq %r14, %rax
  2280. leaq L_.str(%rip), %rdi
  2281. movl %ebx, %esi
  2282. movq %rax, %rdx
  2283. xorb %al, %al
  2284. callq _printf
  2285. xorl %eax, %eax
  2286. popq %rbx
  2287. popq %r14
  2288. popq %rbp
  2289. ret
  2290. Ltmp16:
  2291. .cfi_endproc
  2292. Leh_func_end1:
  2293.  
  2294. .section __TEXT,__cstring,cstring_literals
  2295. L_.str: ## @.str
  2296. .asciz "%d powers of two found in %lu ns\n"
  2297.  
  2298.  
  2299. .subsections_via_symbols
  2300.  
  2301.  
  2302.  
  2303. ==> powersoftwo-9a-c2.s <===================================================
  2304. .section __TEXT,__text,regular,pure_instructions
  2305. .globl _isPowerOfTwo
  2306. _isPowerOfTwo: ## @isPowerOfTwo
  2307. Ltmp2:
  2308. .cfi_startproc
  2309. ## BB#0: ## %entry
  2310. pushq %rbp
  2311. Ltmp3:
  2312. .cfi_def_cfa_offset 16
  2313. Ltmp4:
  2314. .cfi_offset %rbp, -16
  2315. movq %rsp, %rbp
  2316. Ltmp5:
  2317. .cfi_def_cfa_register %rbp
  2318. xorb %al, %al
  2319. testl %edi, %edi
  2320. je LBB0_2
  2321. ## BB#1: ## %land.rhs
  2322. leal -1(%rdi), %eax
  2323. testl %edi, %eax
  2324. sete %al
  2325. LBB0_2: ## %land.end
  2326. movzbl %al, %eax
  2327. popq %rbp
  2328. ret
  2329. Ltmp6:
  2330. .cfi_endproc
  2331. Leh_func_end0:
  2332.  
  2333. .globl _main
  2334. _main: ## @main
  2335. Ltmp10:
  2336. .cfi_startproc
  2337. ## BB#0: ## %entry
  2338. pushq %rbp
  2339. Ltmp11:
  2340. .cfi_def_cfa_offset 16
  2341. Ltmp12:
  2342. .cfi_offset %rbp, -16
  2343. movq %rsp, %rbp
  2344. Ltmp13:
  2345. .cfi_def_cfa_register %rbp
  2346. pushq %r14
  2347. pushq %rbx
  2348. Ltmp14:
  2349. .cfi_offset %rbx, -32
  2350. Ltmp15:
  2351. .cfi_offset %r14, -24
  2352. callq _mach_absolute_time
  2353. movq %rax, %r14
  2354. xorl %ebx, %ebx
  2355. movl $-1, %eax
  2356. jmp LBB1_1
  2357. LBB1_2: ## %for.cond
  2358. ## in Loop: Header=BB1_1 Depth=1
  2359. xorb %dl, %dl
  2360. testl %ecx, %ecx
  2361. je LBB1_4
  2362. ## BB#3: ## %land.rhs.i
  2363. ## in Loop: Header=BB1_1 Depth=1
  2364. testl %ecx, %eax
  2365. sete %dl
  2366. LBB1_4: ## %isPowerOfTwo.exit
  2367. ## in Loop: Header=BB1_1 Depth=1
  2368. movzbl %dl, %eax
  2369. addl %eax, %ebx
  2370. movl %ecx, %eax
  2371. LBB1_1: ## %for.cond
  2372. ## =>This Inner Loop Header: Depth=1
  2373. leal 1(%rax), %ecx
  2374. cmpl $-1, %ecx
  2375. jne LBB1_2
  2376. ## BB#5: ## %for.end
  2377. callq _mach_absolute_time
  2378. subq %r14, %rax
  2379. leaq L_.str(%rip), %rdi
  2380. movl %ebx, %esi
  2381. movq %rax, %rdx
  2382. xorb %al, %al
  2383. callq _printf
  2384. xorl %eax, %eax
  2385. popq %rbx
  2386. popq %r14
  2387. popq %rbp
  2388. ret
  2389. Ltmp16:
  2390. .cfi_endproc
  2391. Leh_func_end1:
  2392.  
  2393. .section __TEXT,__cstring,cstring_literals
  2394. L_.str: ## @.str
  2395. .asciz "%d powers of two found in %lu ns\n"
  2396.  
  2397.  
  2398. .subsections_via_symbols
  2399.  
  2400.  
  2401.  
  2402. ==> powersoftwo-9a-i7.s <===================================================
  2403. .section __TEXT,__text,regular,pure_instructions
  2404. .globl _isPowerOfTwo
  2405. _isPowerOfTwo: ## @isPowerOfTwo
  2406. Ltmp2:
  2407. .cfi_startproc
  2408. ## BB#0: ## %entry
  2409. pushq %rbp
  2410. Ltmp3:
  2411. .cfi_def_cfa_offset 16
  2412. Ltmp4:
  2413. .cfi_offset %rbp, -16
  2414. movq %rsp, %rbp
  2415. Ltmp5:
  2416. .cfi_def_cfa_register %rbp
  2417. xorb %al, %al
  2418. testl %edi, %edi
  2419. je LBB0_2
  2420. ## BB#1: ## %land.rhs
  2421. leal -1(%rdi), %eax
  2422. testl %edi, %eax
  2423. sete %al
  2424. LBB0_2: ## %land.end
  2425. movzbl %al, %eax
  2426. popq %rbp
  2427. ret
  2428. Ltmp6:
  2429. .cfi_endproc
  2430. Leh_func_end0:
  2431.  
  2432. .globl _main
  2433. _main: ## @main
  2434. Ltmp10:
  2435. .cfi_startproc
  2436. ## BB#0: ## %entry
  2437. pushq %rbp
  2438. Ltmp11:
  2439. .cfi_def_cfa_offset 16
  2440. Ltmp12:
  2441. .cfi_offset %rbp, -16
  2442. movq %rsp, %rbp
  2443. Ltmp13:
  2444. .cfi_def_cfa_register %rbp
  2445. pushq %r14
  2446. pushq %rbx
  2447. Ltmp14:
  2448. .cfi_offset %rbx, -32
  2449. Ltmp15:
  2450. .cfi_offset %r14, -24
  2451. callq _mach_absolute_time
  2452. movq %rax, %r14
  2453. xorl %ebx, %ebx
  2454. movl $-1, %eax
  2455. jmp LBB1_1
  2456. LBB1_2: ## %for.cond
  2457. ## in Loop: Header=BB1_1 Depth=1
  2458. xorb %dl, %dl
  2459. testl %ecx, %ecx
  2460. je LBB1_4
  2461. ## BB#3: ## %land.rhs.i
  2462. ## in Loop: Header=BB1_1 Depth=1
  2463. testl %ecx, %eax
  2464. sete %dl
  2465. LBB1_4: ## %isPowerOfTwo.exit
  2466. ## in Loop: Header=BB1_1 Depth=1
  2467. movzbl %dl, %eax
  2468. addl %eax, %ebx
  2469. movl %ecx, %eax
  2470. LBB1_1: ## %for.cond
  2471. ## =>This Inner Loop Header: Depth=1
  2472. leal 1(%rax), %ecx
  2473. cmpl $-1, %ecx
  2474. jne LBB1_2
  2475. ## BB#5: ## %for.end
  2476. callq _mach_absolute_time
  2477. subq %r14, %rax
  2478. leaq L_.str(%rip), %rdi
  2479. movl %ebx, %esi
  2480. movq %rax, %rdx
  2481. xorb %al, %al
  2482. callq _printf
  2483. xorl %eax, %eax
  2484. popq %rbx
  2485. popq %r14
  2486. popq %rbp
  2487. ret
  2488. Ltmp16:
  2489. .cfi_endproc
  2490. Leh_func_end1:
  2491.  
  2492. .section __TEXT,__cstring,cstring_literals
  2493. L_.str: ## @.str
  2494. .asciz "%d powers of two found in %lu ns\n"
  2495.  
  2496.  
  2497. .subsections_via_symbols
  2498.  
  2499.  
  2500.  
  2501. ==> powersoftwo-9b-c2.s <===================================================
  2502. .section __TEXT,__text,regular,pure_instructions
  2503. .globl _isPowerOfTwo
  2504. _isPowerOfTwo: ## @isPowerOfTwo
  2505. Ltmp2:
  2506. .cfi_startproc
  2507. ## BB#0: ## %entry
  2508. pushq %rbp
  2509. Ltmp3:
  2510. .cfi_def_cfa_offset 16
  2511. Ltmp4:
  2512. .cfi_offset %rbp, -16
  2513. movq %rsp, %rbp
  2514. Ltmp5:
  2515. .cfi_def_cfa_register %rbp
  2516. xorb %al, %al
  2517. testl %edi, %edi
  2518. je LBB0_2
  2519. ## BB#1: ## %land.rhs
  2520. movl %edi, %eax
  2521. negl %eax
  2522. andl %edi, %eax
  2523. cmpl %edi, %eax
  2524. sete %al
  2525. LBB0_2: ## %land.end
  2526. movzbl %al, %eax
  2527. popq %rbp
  2528. ret
  2529. Ltmp6:
  2530. .cfi_endproc
  2531. Leh_func_end0:
  2532.  
  2533. .globl _main
  2534. _main: ## @main
  2535. Ltmp10:
  2536. .cfi_startproc
  2537. ## BB#0: ## %entry
  2538. pushq %rbp
  2539. Ltmp11:
  2540. .cfi_def_cfa_offset 16
  2541. Ltmp12:
  2542. .cfi_offset %rbp, -16
  2543. movq %rsp, %rbp
  2544. Ltmp13:
  2545. .cfi_def_cfa_register %rbp
  2546. pushq %r14
  2547. pushq %rbx
  2548. Ltmp14:
  2549. .cfi_offset %rbx, -32
  2550. Ltmp15:
  2551. .cfi_offset %r14, -24
  2552. callq _mach_absolute_time
  2553. movq %rax, %r14
  2554. xorl %eax, %eax
  2555. movl %eax, %ebx
  2556. movl %eax, %ecx
  2557. jmp LBB1_1
  2558. LBB1_2: ## %for.cond
  2559. ## in Loop: Header=BB1_1 Depth=1
  2560. xorb %dl, %dl
  2561. testl %ecx, %ecx
  2562. je LBB1_4
  2563. ## BB#3: ## %land.rhs.i
  2564. ## in Loop: Header=BB1_1 Depth=1
  2565. movl %ecx, %edx
  2566. andl %eax, %edx
  2567. cmpl %edx, %ecx
  2568. sete %dl
  2569. LBB1_4: ## %isPowerOfTwo.exit
  2570. ## in Loop: Header=BB1_1 Depth=1
  2571. movzbl %dl, %edx
  2572. addl %edx, %ebx
  2573. decl %eax
  2574. incl %ecx
  2575. LBB1_1: ## %for.cond
  2576. ## =>This Inner Loop Header: Depth=1
  2577. cmpl $-1, %ecx
  2578. jne LBB1_2
  2579. ## BB#5: ## %for.end
  2580. callq _mach_absolute_time
  2581. subq %r14, %rax
  2582. leaq L_.str(%rip), %rdi
  2583. movl %ebx, %esi
  2584. movq %rax, %rdx
  2585. xorb %al, %al
  2586. callq _printf
  2587. xorl %eax, %eax
  2588. popq %rbx
  2589. popq %r14
  2590. popq %rbp
  2591. ret
  2592. Ltmp16:
  2593. .cfi_endproc
  2594. Leh_func_end1:
  2595.  
  2596. .section __TEXT,__cstring,cstring_literals
  2597. L_.str: ## @.str
  2598. .asciz "%d powers of two found in %lu ns\n"
  2599.  
  2600.  
  2601. .subsections_via_symbols
  2602.  
  2603.  
  2604.  
  2605. ==> powersoftwo-9b-i7.s <===================================================
  2606. .section __TEXT,__text,regular,pure_instructions
  2607. .globl _isPowerOfTwo
  2608. _isPowerOfTwo: ## @isPowerOfTwo
  2609. Ltmp2:
  2610. .cfi_startproc
  2611. ## BB#0: ## %entry
  2612. pushq %rbp
  2613. Ltmp3:
  2614. .cfi_def_cfa_offset 16
  2615. Ltmp4:
  2616. .cfi_offset %rbp, -16
  2617. movq %rsp, %rbp
  2618. Ltmp5:
  2619. .cfi_def_cfa_register %rbp
  2620. xorb %al, %al
  2621. testl %edi, %edi
  2622. je LBB0_2
  2623. ## BB#1: ## %land.rhs
  2624. movl %edi, %eax
  2625. negl %eax
  2626. andl %edi, %eax
  2627. cmpl %edi, %eax
  2628. sete %al
  2629. LBB0_2: ## %land.end
  2630. movzbl %al, %eax
  2631. popq %rbp
  2632. ret
  2633. Ltmp6:
  2634. .cfi_endproc
  2635. Leh_func_end0:
  2636.  
  2637. .globl _main
  2638. _main: ## @main
  2639. Ltmp10:
  2640. .cfi_startproc
  2641. ## BB#0: ## %entry
  2642. pushq %rbp
  2643. Ltmp11:
  2644. .cfi_def_cfa_offset 16
  2645. Ltmp12:
  2646. .cfi_offset %rbp, -16
  2647. movq %rsp, %rbp
  2648. Ltmp13:
  2649. .cfi_def_cfa_register %rbp
  2650. pushq %r14
  2651. pushq %rbx
  2652. Ltmp14:
  2653. .cfi_offset %rbx, -32
  2654. Ltmp15:
  2655. .cfi_offset %r14, -24
  2656. callq _mach_absolute_time
  2657. movq %rax, %r14
  2658. xorl %eax, %eax
  2659. movl %eax, %ebx
  2660. movl %eax, %ecx
  2661. jmp LBB1_1
  2662. LBB1_2: ## %for.cond
  2663. ## in Loop: Header=BB1_1 Depth=1
  2664. xorb %dl, %dl
  2665. testl %ecx, %ecx
  2666. je LBB1_4
  2667. ## BB#3: ## %land.rhs.i
  2668. ## in Loop: Header=BB1_1 Depth=1
  2669. movl %ecx, %edx
  2670. andl %eax, %edx
  2671. cmpl %edx, %ecx
  2672. sete %dl
  2673. LBB1_4: ## %isPowerOfTwo.exit
  2674. ## in Loop: Header=BB1_1 Depth=1
  2675. movzbl %dl, %edx
  2676. addl %edx, %ebx
  2677. decl %eax
  2678. incl %ecx
  2679. LBB1_1: ## %for.cond
  2680. ## =>This Inner Loop Header: Depth=1
  2681. cmpl $-1, %ecx
  2682. jne LBB1_2
  2683. ## BB#5: ## %for.end
  2684. callq _mach_absolute_time
  2685. subq %r14, %rax
  2686. leaq L_.str(%rip), %rdi
  2687. movl %ebx, %esi
  2688. movq %rax, %rdx
  2689. xorb %al, %al
  2690. callq _printf
  2691. xorl %eax, %eax
  2692. popq %rbx
  2693. popq %r14
  2694. popq %rbp
  2695. ret
  2696. Ltmp16:
  2697. .cfi_endproc
  2698. Leh_func_end1:
  2699.  
  2700. .section __TEXT,__cstring,cstring_literals
  2701. L_.str: ## @.str
  2702. .asciz "%d powers of two found in %lu ns\n"
  2703.  
  2704.  
  2705. .subsections_via_symbols
  2706.  
  2707.  
  2708.  
  2709. ==> powersoftwo-R1-c2.s <===================================================
  2710. .section __TEXT,__text,regular,pure_instructions
  2711. .globl _is_pot_recur
  2712. _is_pot_recur: ## @is_pot_recur
  2713. Ltmp2:
  2714. .cfi_startproc
  2715. ## BB#0: ## %entry
  2716. pushq %rbp
  2717. Ltmp3:
  2718. .cfi_def_cfa_offset 16
  2719. Ltmp4:
  2720. .cfi_offset %rbp, -16
  2721. movq %rsp, %rbp
  2722. Ltmp5:
  2723. .cfi_def_cfa_register %rbp
  2724. movl %esi, %edx
  2725. jmp LBB0_1
  2726. LBB0_3: ## %if.end
  2727. ## in Loop: Header=BB0_1 Depth=1
  2728. xorl %eax, %eax
  2729. cmpl $1, %ecx
  2730. jne LBB0_6
  2731. LBB0_4: ## %sw.bb
  2732. ## in Loop: Header=BB0_1 Depth=1
  2733. shrl %edx
  2734. LBB0_1: ## %tailrecurse
  2735. ## =>This Inner Loop Header: Depth=1
  2736. movl $1, %eax
  2737. movb %dl, %cl
  2738. movl $1, %esi
  2739. shll %cl, %esi
  2740. testl %edx, %edx
  2741. je LBB0_6
  2742. ## BB#2: ## %if.end
  2743. ## in Loop: Header=BB0_1 Depth=1
  2744. decl %esi
  2745. testl %edi, %esi
  2746. setne %al
  2747. movzbl %al, %eax
  2748. movb %dl, %cl
  2749. shll %cl, %esi
  2750. testl %edi, %esi
  2751. setne %cl
  2752. movzbl %cl, %ecx
  2753. addl %ecx, %ecx
  2754. orl %eax, %ecx
  2755. cmpl $2, %ecx
  2756. jne LBB0_3
  2757. ## BB#5: ## %sw.bb19
  2758. ## in Loop: Header=BB0_1 Depth=1
  2759. movb %dl, %cl
  2760. shrl %cl, %edi
  2761. jmp LBB0_4
  2762. LBB0_6: ## %return
  2763. popq %rbp
  2764. ret
  2765. Ltmp6:
  2766. .cfi_endproc
  2767. Leh_func_end0:
  2768.  
  2769. .globl _is_pot
  2770. _is_pot: ## @is_pot
  2771. Ltmp9:
  2772. .cfi_startproc
  2773. ## BB#0: ## %entry
  2774. pushq %rbp
  2775. Ltmp10:
  2776. .cfi_def_cfa_offset 16
  2777. Ltmp11:
  2778. .cfi_offset %rbp, -16
  2779. movq %rsp, %rbp
  2780. Ltmp12:
  2781. .cfi_def_cfa_register %rbp
  2782. movl $16, %esi
  2783. popq %rbp
  2784. jmp _is_pot_recur ## TAILCALL
  2785. Ltmp13:
  2786. .cfi_endproc
  2787. Leh_func_end1:
  2788.  
  2789. .globl _main
  2790. _main: ## @main
  2791. Ltmp17:
  2792. .cfi_startproc
  2793. ## BB#0: ## %entry
  2794. pushq %rbp
  2795. Ltmp18:
  2796. .cfi_def_cfa_offset 16
  2797. Ltmp19:
  2798. .cfi_offset %rbp, -16
  2799. movq %rsp, %rbp
  2800. Ltmp20:
  2801. .cfi_def_cfa_register %rbp
  2802. pushq %r15
  2803. pushq %r14
  2804. pushq %rbx
  2805. pushq %rax
  2806. Ltmp21:
  2807. .cfi_offset %rbx, -40
  2808. Ltmp22:
  2809. .cfi_offset %r14, -32
  2810. Ltmp23:
  2811. .cfi_offset %r15, -24
  2812. callq _mach_absolute_time
  2813. movq %rax, %r14
  2814. xorl %r15d, %r15d
  2815. movl %r15d, %ebx
  2816. LBB2_1: ## %for.body
  2817. ## =>This Inner Loop Header: Depth=1
  2818. movl %r15d, %edi
  2819. movl $16, %esi
  2820. callq _is_pot_recur
  2821. cmpl $1, %eax
  2822. sbbl $-1, %ebx
  2823. incl %r15d
  2824. cmpl $-1, %r15d
  2825. jne LBB2_1
  2826. ## BB#2: ## %for.end
  2827. callq _mach_absolute_time
  2828. subq %r14, %rax
  2829. leaq L_.str(%rip), %rdi
  2830. movl %ebx, %esi
  2831. movq %rax, %rdx
  2832. xorb %al, %al
  2833. callq _printf
  2834. xorl %eax, %eax
  2835. addq $8, %rsp
  2836. popq %rbx
  2837. popq %r14
  2838. popq %r15
  2839. popq %rbp
  2840. ret
  2841. Ltmp24:
  2842. .cfi_endproc
  2843. Leh_func_end2:
  2844.  
  2845. .section __TEXT,__cstring,cstring_literals
  2846. L_.str: ## @.str
  2847. .asciz "%d powers of two found in %lu ns\n"
  2848.  
  2849.  
  2850. .subsections_via_symbols
  2851.  
  2852.  
  2853.  
  2854. ==> powersoftwo-R1-i7.s <===================================================
  2855. .section __TEXT,__text,regular,pure_instructions
  2856. .globl _is_pot_recur
  2857. _is_pot_recur: ## @is_pot_recur
  2858. Ltmp2:
  2859. .cfi_startproc
  2860. ## BB#0: ## %entry
  2861. pushq %rbp
  2862. Ltmp3:
  2863. .cfi_def_cfa_offset 16
  2864. Ltmp4:
  2865. .cfi_offset %rbp, -16
  2866. movq %rsp, %rbp
  2867. Ltmp5:
  2868. .cfi_def_cfa_register %rbp
  2869. movl %esi, %edx
  2870. jmp LBB0_1
  2871. LBB0_3: ## %if.end
  2872. ## in Loop: Header=BB0_1 Depth=1
  2873. xorl %eax, %eax
  2874. cmpl $1, %ecx
  2875. jne LBB0_6
  2876. LBB0_4: ## %sw.bb
  2877. ## in Loop: Header=BB0_1 Depth=1
  2878. shrl %edx
  2879. LBB0_1: ## %tailrecurse
  2880. ## =>This Inner Loop Header: Depth=1
  2881. movl $1, %eax
  2882. movb %dl, %cl
  2883. movl $1, %esi
  2884. shll %cl, %esi
  2885. testl %edx, %edx
  2886. je LBB0_6
  2887. ## BB#2: ## %if.end
  2888. ## in Loop: Header=BB0_1 Depth=1
  2889. decl %esi
  2890. testl %edi, %esi
  2891. setne %al
  2892. movzbl %al, %eax
  2893. movb %dl, %cl
  2894. shll %cl, %esi
  2895. testl %edi, %esi
  2896. setne %cl
  2897. movzbl %cl, %ecx
  2898. addl %ecx, %ecx
  2899. orl %eax, %ecx
  2900. cmpl $2, %ecx
  2901. jne LBB0_3
  2902. ## BB#5: ## %sw.bb19
  2903. ## in Loop: Header=BB0_1 Depth=1
  2904. movb %dl, %cl
  2905. shrl %cl, %edi
  2906. jmp LBB0_4
  2907. LBB0_6: ## %return
  2908. popq %rbp
  2909. ret
  2910. Ltmp6:
  2911. .cfi_endproc
  2912. Leh_func_end0:
  2913.  
  2914. .globl _is_pot
  2915. _is_pot: ## @is_pot
  2916. Ltmp9:
  2917. .cfi_startproc
  2918. ## BB#0: ## %entry
  2919. pushq %rbp
  2920. Ltmp10:
  2921. .cfi_def_cfa_offset 16
  2922. Ltmp11:
  2923. .cfi_offset %rbp, -16
  2924. movq %rsp, %rbp
  2925. Ltmp12:
  2926. .cfi_def_cfa_register %rbp
  2927. movl $16, %esi
  2928. popq %rbp
  2929. jmp _is_pot_recur ## TAILCALL
  2930. Ltmp13:
  2931. .cfi_endproc
  2932. Leh_func_end1:
  2933.  
  2934. .globl _main
  2935. _main: ## @main
  2936. Ltmp17:
  2937. .cfi_startproc
  2938. ## BB#0: ## %entry
  2939. pushq %rbp
  2940. Ltmp18:
  2941. .cfi_def_cfa_offset 16
  2942. Ltmp19:
  2943. .cfi_offset %rbp, -16
  2944. movq %rsp, %rbp
  2945. Ltmp20:
  2946. .cfi_def_cfa_register %rbp
  2947. pushq %r15
  2948. pushq %r14
  2949. pushq %rbx
  2950. pushq %rax
  2951. Ltmp21:
  2952. .cfi_offset %rbx, -40
  2953. Ltmp22:
  2954. .cfi_offset %r14, -32
  2955. Ltmp23:
  2956. .cfi_offset %r15, -24
  2957. callq _mach_absolute_time
  2958. movq %rax, %r14
  2959. xorl %r15d, %r15d
  2960. movl %r15d, %ebx
  2961. LBB2_1: ## %for.body
  2962. ## =>This Inner Loop Header: Depth=1
  2963. movl %r15d, %edi
  2964. movl $16, %esi
  2965. callq _is_pot_recur
  2966. cmpl $1, %eax
  2967. sbbl $-1, %ebx
  2968. incl %r15d
  2969. cmpl $-1, %r15d
  2970. jne LBB2_1
  2971. ## BB#2: ## %for.end
  2972. callq _mach_absolute_time
  2973. subq %r14, %rax
  2974. leaq L_.str(%rip), %rdi
  2975. movl %ebx, %esi
  2976. movq %rax, %rdx
  2977. xorb %al, %al
  2978. callq _printf
  2979. xorl %eax, %eax
  2980. addq $8, %rsp
  2981. popq %rbx
  2982. popq %r14
  2983. popq %r15
  2984. popq %rbp
  2985. ret
  2986. Ltmp24:
  2987. .cfi_endproc
  2988. Leh_func_end2:
  2989.  
  2990. .section __TEXT,__cstring,cstring_literals
  2991. L_.str: ## @.str
  2992. .asciz "%d powers of two found in %lu ns\n"
  2993.  
  2994.  
  2995. .subsections_via_symbols
  2996.  
  2997.  
  2998.  
  2999. ==> powersoftwo-R2-c2.s <===================================================
  3000. .section __TEXT,__text,regular,pure_instructions
  3001. .globl _isPowerOfTwo
  3002. _isPowerOfTwo: ## @isPowerOfTwo
  3003. Ltmp2:
  3004. .cfi_startproc
  3005. ## BB#0: ## %entry
  3006. pushq %rbp
  3007. Ltmp3:
  3008. .cfi_def_cfa_offset 16
  3009. Ltmp4:
  3010. .cfi_offset %rbp, -16
  3011. movq %rsp, %rbp
  3012. Ltmp5:
  3013. .cfi_def_cfa_register %rbp
  3014. testl $1431655765, %edi ## imm = 0x55555555
  3015. je LBB0_2
  3016. ## BB#1: ## %entry
  3017. movl %edi, %ecx
  3018. andl $-1431655766, %ecx ## imm = 0xFFFFFFFFAAAAAAAA
  3019. xorb %al, %al
  3020. testl %ecx, %ecx
  3021. jne LBB0_9
  3022. LBB0_2: ## %land.lhs.true4
  3023. testl $858993459, %edi ## imm = 0x33333333
  3024. je LBB0_4
  3025. ## BB#3: ## %land.lhs.true4
  3026. movl %edi, %ecx
  3027. andl $-858993460, %ecx ## imm = 0xFFFFFFFFCCCCCCCC
  3028. xorb %al, %al
  3029. testl %ecx, %ecx
  3030. jne LBB0_9
  3031. LBB0_4: ## %land.lhs.true12
  3032. testl $252645135, %edi ## imm = 0xF0F0F0F
  3033. je LBB0_6
  3034. ## BB#5: ## %land.lhs.true12
  3035. movl %edi, %ecx
  3036. andl $-252645136, %ecx ## imm = 0xFFFFFFFFF0F0F0F0
  3037. xorb %al, %al
  3038. testl %ecx, %ecx
  3039. jne LBB0_9
  3040. LBB0_6: ## %land.lhs.true20
  3041. testl $16711935, %edi ## imm = 0xFF00FF
  3042. je LBB0_8
  3043. ## BB#7: ## %land.lhs.true20
  3044. movl %edi, %ecx
  3045. andl $-16711936, %ecx ## imm = 0xFFFFFFFFFF00FF00
  3046. xorb %al, %al
  3047. testl %ecx, %ecx
  3048. jne LBB0_9
  3049. LBB0_8: ## %land.rhs
  3050. cmpl $65536, %edi ## imm = 0x10000
  3051. setb %cl
  3052. testw %di, %di
  3053. sete %al
  3054. orb %cl, %al
  3055. LBB0_9: ## %land.end35
  3056. movzbl %al, %eax
  3057. popq %rbp
  3058. ret
  3059. Ltmp6:
  3060. .cfi_endproc
  3061. Leh_func_end0:
  3062.  
  3063. .globl _main
  3064. _main: ## @main
  3065. Ltmp10:
  3066. .cfi_startproc
  3067. ## BB#0: ## %entry
  3068. pushq %rbp
  3069. Ltmp11:
  3070. .cfi_def_cfa_offset 16
  3071. Ltmp12:
  3072. .cfi_offset %rbp, -16
  3073. movq %rsp, %rbp
  3074. Ltmp13:
  3075. .cfi_def_cfa_register %rbp
  3076. pushq %r15
  3077. pushq %r14
  3078. pushq %rbx
  3079. pushq %rax
  3080. Ltmp14:
  3081. .cfi_offset %rbx, -40
  3082. Ltmp15:
  3083. .cfi_offset %r14, -32
  3084. Ltmp16:
  3085. .cfi_offset %r15, -24
  3086. callq _mach_absolute_time
  3087. movq %rax, %r14
  3088. xorl %r15d, %r15d
  3089. movl %r15d, %ebx
  3090. LBB1_1: ## %for.body
  3091. ## =>This Inner Loop Header: Depth=1
  3092. movl %r15d, %edi
  3093. callq _isPowerOfTwo
  3094. cmpl $1, %eax
  3095. sbbl $-1, %ebx
  3096. incl %r15d
  3097. cmpl $-1, %r15d
  3098. jne LBB1_1
  3099. ## BB#2: ## %for.end
  3100. callq _mach_absolute_time
  3101. subq %r14, %rax
  3102. leaq L_.str(%rip), %rdi
  3103. movl %ebx, %esi
  3104. movq %rax, %rdx
  3105. xorb %al, %al
  3106. callq _printf
  3107. xorl %eax, %eax
  3108. addq $8, %rsp
  3109. popq %rbx
  3110. popq %r14
  3111. popq %r15
  3112. popq %rbp
  3113. ret
  3114. Ltmp17:
  3115. .cfi_endproc
  3116. Leh_func_end1:
  3117.  
  3118. .section __TEXT,__cstring,cstring_literals
  3119. L_.str: ## @.str
  3120. .asciz "%d powers of two found in %lu ns\n"
  3121.  
  3122.  
  3123. .subsections_via_symbols
  3124.  
  3125.  
  3126.  
  3127. ==> powersoftwo-R2-i7.s <===================================================
  3128. .section __TEXT,__text,regular,pure_instructions
  3129. .globl _isPowerOfTwo
  3130. _isPowerOfTwo: ## @isPowerOfTwo
  3131. Ltmp2:
  3132. .cfi_startproc
  3133. ## BB#0: ## %entry
  3134. pushq %rbp
  3135. Ltmp3:
  3136. .cfi_def_cfa_offset 16
  3137. Ltmp4:
  3138. .cfi_offset %rbp, -16
  3139. movq %rsp, %rbp
  3140. Ltmp5:
  3141. .cfi_def_cfa_register %rbp
  3142. testl $1431655765, %edi ## imm = 0x55555555
  3143. je LBB0_2
  3144. ## BB#1: ## %entry
  3145. movl %edi, %ecx
  3146. andl $-1431655766, %ecx ## imm = 0xFFFFFFFFAAAAAAAA
  3147. xorb %al, %al
  3148. testl %ecx, %ecx
  3149. jne LBB0_9
  3150. LBB0_2: ## %land.lhs.true4
  3151. testl $858993459, %edi ## imm = 0x33333333
  3152. je LBB0_4
  3153. ## BB#3: ## %land.lhs.true4
  3154. movl %edi, %ecx
  3155. andl $-858993460, %ecx ## imm = 0xFFFFFFFFCCCCCCCC
  3156. xorb %al, %al
  3157. testl %ecx, %ecx
  3158. jne LBB0_9
  3159. LBB0_4: ## %land.lhs.true12
  3160. testl $252645135, %edi ## imm = 0xF0F0F0F
  3161. je LBB0_6
  3162. ## BB#5: ## %land.lhs.true12
  3163. movl %edi, %ecx
  3164. andl $-252645136, %ecx ## imm = 0xFFFFFFFFF0F0F0F0
  3165. xorb %al, %al
  3166. testl %ecx, %ecx
  3167. jne LBB0_9
  3168. LBB0_6: ## %land.lhs.true20
  3169. testl $16711935, %edi ## imm = 0xFF00FF
  3170. je LBB0_8
  3171. ## BB#7: ## %land.lhs.true20
  3172. movl %edi, %ecx
  3173. andl $-16711936, %ecx ## imm = 0xFFFFFFFFFF00FF00
  3174. xorb %al, %al
  3175. testl %ecx, %ecx
  3176. jne LBB0_9
  3177. LBB0_8: ## %land.rhs
  3178. cmpl $65536, %edi ## imm = 0x10000
  3179. setb %cl
  3180. testw %di, %di
  3181. sete %al
  3182. orb %cl, %al
  3183. LBB0_9: ## %land.end35
  3184. movzbl %al, %eax
  3185. popq %rbp
  3186. ret
  3187. Ltmp6:
  3188. .cfi_endproc
  3189. Leh_func_end0:
  3190.  
  3191. .globl _main
  3192. _main: ## @main
  3193. Ltmp10:
  3194. .cfi_startproc
  3195. ## BB#0: ## %entry
  3196. pushq %rbp
  3197. Ltmp11:
  3198. .cfi_def_cfa_offset 16
  3199. Ltmp12:
  3200. .cfi_offset %rbp, -16
  3201. movq %rsp, %rbp
  3202. Ltmp13:
  3203. .cfi_def_cfa_register %rbp
  3204. pushq %r15
  3205. pushq %r14
  3206. pushq %rbx
  3207. pushq %rax
  3208. Ltmp14:
  3209. .cfi_offset %rbx, -40
  3210. Ltmp15:
  3211. .cfi_offset %r14, -32
  3212. Ltmp16:
  3213. .cfi_offset %r15, -24
  3214. callq _mach_absolute_time
  3215. movq %rax, %r14
  3216. xorl %r15d, %r15d
  3217. movl %r15d, %ebx
  3218. LBB1_1: ## %for.body
  3219. ## =>This Inner Loop Header: Depth=1
  3220. movl %r15d, %edi
  3221. callq _isPowerOfTwo
  3222. cmpl $1, %eax
  3223. sbbl $-1, %ebx
  3224. incl %r15d
  3225. cmpl $-1, %r15d
  3226. jne LBB1_1
  3227. ## BB#2: ## %for.end
  3228. callq _mach_absolute_time
  3229. subq %r14, %rax
  3230. leaq L_.str(%rip), %rdi
  3231. movl %ebx, %esi
  3232. movq %rax, %rdx
  3233. xorb %al, %al
  3234. callq _printf
  3235. xorl %eax, %eax
  3236. addq $8, %rsp
  3237. popq %rbx
  3238. popq %r14
  3239. popq %r15
  3240. popq %rbp
  3241. ret
  3242. Ltmp17:
  3243. .cfi_endproc
  3244. Leh_func_end1:
  3245.  
  3246. .section __TEXT,__cstring,cstring_literals
  3247. L_.str: ## @.str
  3248. .asciz "%d powers of two found in %lu ns\n"
  3249.  
  3250.  
  3251. .subsections_via_symbols
  3252.  
  3253.  
  3254.  
  3255. ==> powersoftwo-R3-c2.s <===================================================
  3256. .section __TEXT,__text,regular,pure_instructions
  3257. .globl _isPowerOf2
  3258. _isPowerOf2: ## @isPowerOf2
  3259. Ltmp2:
  3260. .cfi_startproc
  3261. ## BB#0: ## %entry
  3262. pushq %rbp
  3263. Ltmp3:
  3264. .cfi_def_cfa_offset 16
  3265. Ltmp4:
  3266. .cfi_offset %rbp, -16
  3267. movq %rsp, %rbp
  3268. Ltmp5:
  3269. .cfi_def_cfa_register %rbp
  3270. movl %edi, %eax
  3271. shrl %eax
  3272. andl $1431655765, %eax ## imm = 0x55555555
  3273. subl %eax, %edi
  3274. movl %edi, %eax
  3275. andl $858993459, %eax ## imm = 0x33333333
  3276. shrl $2, %edi
  3277. andl $858993459, %edi ## imm = 0x33333333
  3278. addl %eax, %edi
  3279. movl %edi, %eax
  3280. shrl $4, %eax
  3281. addl %edi, %eax
  3282. andl $252645135, %eax ## imm = 0xF0F0F0F
  3283. imull $16843009, %eax, %eax ## imm = 0x1010101
  3284. shrl $24, %eax
  3285. cmpl $1, %eax
  3286. sete %al
  3287. movzbl %al, %eax
  3288. popq %rbp
  3289. ret
  3290. Ltmp6:
  3291. .cfi_endproc
  3292. Leh_func_end0:
  3293.  
  3294. .globl _main
  3295. _main: ## @main
  3296. Ltmp10:
  3297. .cfi_startproc
  3298. ## BB#0: ## %entry
  3299. pushq %rbp
  3300. Ltmp11:
  3301. .cfi_def_cfa_offset 16
  3302. Ltmp12:
  3303. .cfi_offset %rbp, -16
  3304. movq %rsp, %rbp
  3305. Ltmp13:
  3306. .cfi_def_cfa_register %rbp
  3307. pushq %r14
  3308. pushq %rbx
  3309. Ltmp14:
  3310. .cfi_offset %rbx, -32
  3311. Ltmp15:
  3312. .cfi_offset %r14, -24
  3313. callq _mach_absolute_time
  3314. movq %rax, %r14
  3315. xorl %eax, %eax
  3316. movl %eax, %ebx
  3317. LBB1_1: ## %for.body
  3318. ## =>This Inner Loop Header: Depth=1
  3319. movl %eax, %edx
  3320. shrl %edx
  3321. andl $1431655765, %edx ## imm = 0x55555555
  3322. movl %eax, %ecx
  3323. subl %edx, %ecx
  3324. movl %ecx, %edx
  3325. andl $858993459, %edx ## imm = 0x33333333
  3326. shrl $2, %ecx
  3327. andl $858993459, %ecx ## imm = 0x33333333
  3328. addl %edx, %ecx
  3329. incl %eax
  3330. movl %ecx, %edx
  3331. shrl $4, %edx
  3332. addl %ecx, %edx
  3333. andl $252645135, %edx ## imm = 0xF0F0F0F
  3334. imull $16843009, %edx, %ecx ## imm = 0x1010101
  3335. shrl $24, %ecx
  3336. cmpl $1, %ecx
  3337. sete %cl
  3338. movzbl %cl, %ecx
  3339. addl %ecx, %ebx
  3340. cmpl $-1, %eax
  3341. jne LBB1_1
  3342. ## BB#2: ## %for.end
  3343. callq _mach_absolute_time
  3344. subq %r14, %rax
  3345. leaq L_.str(%rip), %rdi
  3346. movl %ebx, %esi
  3347. movq %rax, %rdx
  3348. xorb %al, %al
  3349. callq _printf
  3350. xorl %eax, %eax
  3351. popq %rbx
  3352. popq %r14
  3353. popq %rbp
  3354. ret
  3355. Ltmp16:
  3356. .cfi_endproc
  3357. Leh_func_end1:
  3358.  
  3359. .section __TEXT,__cstring,cstring_literals
  3360. L_.str: ## @.str
  3361. .asciz "%d powers of two found in %lu ns\n"
  3362.  
  3363.  
  3364. .subsections_via_symbols
  3365.  
  3366.  
  3367.  
  3368. ==> powersoftwo-R4-c2.s <===================================================
  3369. .section __TEXT,__text,regular,pure_instructions
  3370. .globl _isPowerOf2
  3371. _isPowerOf2: ## @isPowerOf2
  3372. Ltmp2:
  3373. .cfi_startproc
  3374. ## BB#0: ## %entry
  3375. pushq %rbp
  3376. Ltmp3:
  3377. .cfi_def_cfa_offset 16
  3378. Ltmp4:
  3379. .cfi_offset %rbp, -16
  3380. movq %rsp, %rbp
  3381. Ltmp5:
  3382. .cfi_def_cfa_register %rbp
  3383. xorb %al, %al
  3384. testl %edi, %edi
  3385. je LBB0_2
  3386. ## BB#1: ## %land.rhs
  3387. movl $32, %eax
  3388. bsfl %edi, %ecx
  3389. cmovel %eax, %ecx
  3390. ## kill: CL<def> CL<kill> ECX<kill>
  3391. movl $1, %eax
  3392. shll %cl, %eax
  3393. cmpl %edi, %eax
  3394. sete %al
  3395. LBB0_2: ## %land.end
  3396. movzbl %al, %eax
  3397. popq %rbp
  3398. ret
  3399. Ltmp6:
  3400. .cfi_endproc
  3401. Leh_func_end0:
  3402.  
  3403. .globl _main
  3404. _main: ## @main
  3405. Ltmp10:
  3406. .cfi_startproc
  3407. ## BB#0: ## %entry
  3408. pushq %rbp
  3409. Ltmp11:
  3410. .cfi_def_cfa_offset 16
  3411. Ltmp12:
  3412. .cfi_offset %rbp, -16
  3413. movq %rsp, %rbp
  3414. Ltmp13:
  3415. .cfi_def_cfa_register %rbp
  3416. pushq %r14
  3417. pushq %rbx
  3418. Ltmp14:
  3419. .cfi_offset %rbx, -32
  3420. Ltmp15:
  3421. .cfi_offset %r14, -24
  3422. callq _mach_absolute_time
  3423. movq %rax, %r14
  3424. xorl %ebx, %ebx
  3425. movl $32, %eax
  3426. movl %ebx, %edx
  3427. jmp LBB1_1
  3428. LBB1_2: ## %for.cond
  3429. ## in Loop: Header=BB1_1 Depth=1
  3430. xorb %cl, %cl
  3431. testl %edx, %edx
  3432. je LBB1_4
  3433. ## BB#3: ## %land.rhs.i
  3434. ## in Loop: Header=BB1_1 Depth=1
  3435. bsfl %edx, %ecx
  3436. cmovel %eax, %ecx
  3437. ## kill: CL<def> CL<kill> ECX<kill>
  3438. movl $1, %esi
  3439. shll %cl, %esi
  3440. cmpl %esi, %edx
  3441. sete %cl
  3442. LBB1_4: ## %isPowerOf2.exit
  3443. ## in Loop: Header=BB1_1 Depth=1
  3444. movzbl %cl, %ecx
  3445. addl %ecx, %ebx
  3446. incl %edx
  3447. LBB1_1: ## %for.cond
  3448. ## =>This Inner Loop Header: Depth=1
  3449. cmpl $-1, %edx
  3450. jne LBB1_2
  3451. ## BB#5: ## %for.end
  3452. callq _mach_absolute_time
  3453. subq %r14, %rax
  3454. leaq L_.str(%rip), %rdi
  3455. movl %ebx, %esi
  3456. movq %rax, %rdx
  3457. xorb %al, %al
  3458. callq _printf
  3459. xorl %eax, %eax
  3460. popq %rbx
  3461. popq %r14
  3462. popq %rbp
  3463. ret
  3464. Ltmp16:
  3465. .cfi_endproc
  3466. Leh_func_end1:
  3467.  
  3468. .section __TEXT,__cstring,cstring_literals
  3469. L_.str: ## @.str
  3470. .asciz "%d powers of two found in %lu ns\n"
  3471.  
  3472.  
  3473. .subsections_via_symbols
  3474.  
  3475.  
  3476.  
  3477. ==> powersoftwo-R4-i7.s <===================================================
  3478. .section __TEXT,__text,regular,pure_instructions
  3479. .globl _isPowerOf2
  3480. _isPowerOf2: ## @isPowerOf2
  3481. Ltmp2:
  3482. .cfi_startproc
  3483. ## BB#0: ## %entry
  3484. pushq %rbp
  3485. Ltmp3:
  3486. .cfi_def_cfa_offset 16
  3487. Ltmp4:
  3488. .cfi_offset %rbp, -16
  3489. movq %rsp, %rbp
  3490. Ltmp5:
  3491. .cfi_def_cfa_register %rbp
  3492. xorb %al, %al
  3493. testl %edi, %edi
  3494. je LBB0_2
  3495. ## BB#1: ## %land.rhs
  3496. movl $32, %eax
  3497. bsfl %edi, %ecx
  3498. cmovel %eax, %ecx
  3499. ## kill: CL<def> CL<kill> ECX<kill>
  3500. movl $1, %eax
  3501. shll %cl, %eax
  3502. cmpl %edi, %eax
  3503. sete %al
  3504. LBB0_2: ## %land.end
  3505. movzbl %al, %eax
  3506. popq %rbp
  3507. ret
  3508. Ltmp6:
  3509. .cfi_endproc
  3510. Leh_func_end0:
  3511.  
  3512. .globl _main
  3513. _main: ## @main
  3514. Ltmp10:
  3515. .cfi_startproc
  3516. ## BB#0: ## %entry
  3517. pushq %rbp
  3518. Ltmp11:
  3519. .cfi_def_cfa_offset 16
  3520. Ltmp12:
  3521. .cfi_offset %rbp, -16
  3522. movq %rsp, %rbp
  3523. Ltmp13:
  3524. .cfi_def_cfa_register %rbp
  3525. pushq %r14
  3526. pushq %rbx
  3527. Ltmp14:
  3528. .cfi_offset %rbx, -32
  3529. Ltmp15:
  3530. .cfi_offset %r14, -24
  3531. callq _mach_absolute_time
  3532. movq %rax, %r14
  3533. xorl %ebx, %ebx
  3534. movl $32, %eax
  3535. movl %ebx, %edx
  3536. jmp LBB1_1
  3537. LBB1_2: ## %for.cond
  3538. ## in Loop: Header=BB1_1 Depth=1
  3539. xorb %cl, %cl
  3540. testl %edx, %edx
  3541. je LBB1_4
  3542. ## BB#3: ## %land.rhs.i
  3543. ## in Loop: Header=BB1_1 Depth=1
  3544. bsfl %edx, %ecx
  3545. cmovel %eax, %ecx
  3546. ## kill: CL<def> CL<kill> ECX<kill>
  3547. movl $1, %esi
  3548. shll %cl, %esi
  3549. cmpl %esi, %edx
  3550. sete %cl
  3551. LBB1_4: ## %isPowerOf2.exit
  3552. ## in Loop: Header=BB1_1 Depth=1
  3553. movzbl %cl, %ecx
  3554. addl %ecx, %ebx
  3555. incl %edx
  3556. LBB1_1: ## %for.cond
  3557. ## =>This Inner Loop Header: Depth=1
  3558. cmpl $-1, %edx
  3559. jne LBB1_2
  3560. ## BB#5: ## %for.end
  3561. callq _mach_absolute_time
  3562. subq %r14, %rax
  3563. leaq L_.str(%rip), %rdi
  3564. movl %ebx, %esi
  3565. movq %rax, %rdx
  3566. xorb %al, %al
  3567. callq _printf
  3568. xorl %eax, %eax
  3569. popq %rbx
  3570. popq %r14
  3571. popq %rbp
  3572. ret
  3573. Ltmp16:
  3574. .cfi_endproc
  3575. Leh_func_end1:
  3576.  
  3577. .section __TEXT,__cstring,cstring_literals
  3578. L_.str: ## @.str
  3579. .asciz "%d powers of two found in %lu ns\n"
  3580.  
  3581.  
  3582. .subsections_via_symbols
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement