Advertisement
_takumi

skfuncs

Nov 27th, 2022 (edited)
1,460
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     .intel_syntax noprefix
  2.     .section    .rodata
  3. .LC4:
  4.     .string "-c"
  5. .LC5:
  6.     .string "%lf %lf"
  7. .LC6:
  8.     .string "%lf\n"
  9. .LC8:
  10.     .string "Program execution time: %lf\n"
  11. .LC9:
  12.     .string "-f"
  13. .LC10:
  14.     .string "r"
  15. .LC11:
  16.     .string "w"
  17.     .align 8
  18. .LC12:
  19.     .string "Please enter one of the following keys: -f, -c"
  20. .LC13:
  21.     .string "Incorrect input\n"
  22.     .text
  23.     .globl  f
  24.     .type   f, @function
  25. f:
  26.     push    rbp
  27.     mov rbp, rsp
  28.     movsd   xmm2, xmm0 # xmm0 - double x
  29.     movsd   xmm0, xmm2
  30.     mulsd   xmm0, xmm0
  31.     mulsd   xmm0, xmm2
  32.     movapd  xmm1, xmm0
  33.     mulsd   xmm1, xmm2
  34.     movsd   xmm0, xmm2
  35.     addsd   xmm0, xmm0
  36.     mulsd   xmm0, xmm2
  37.     mulsd   xmm0, xmm2
  38.     addsd   xmm0, xmm1
  39.     subsd   xmm0, xmm2
  40.     movsd   xmm1, QWORD PTR .LC0[rip]
  41.     subsd   xmm0, xmm1
  42.     pop rbp
  43.     ret
  44.     .size   f, .-f
  45.     .globl  solve
  46.     .type   solve, @function
  47. solve:
  48.     push    rbp
  49.     mov rbp, rsp
  50.     sub rsp, 48
  51.     movsd   QWORD PTR -24[rbp], xmm0 # xmm0 - double a
  52.     movsd   QWORD PTR -32[rbp], xmm1 # xmm1 - double b
  53.     movsd   QWORD PTR -40[rbp], xmm2 # xmm2 - double e
  54.     jmp .L4
  55. .L7:
  56.     movsd   xmm0, QWORD PTR -24[rbp]
  57.     addsd   xmm0, QWORD PTR -32[rbp]
  58.     movsd   xmm1, QWORD PTR .LC1[rip]
  59.     divsd   xmm0, xmm1
  60.     movsd   QWORD PTR -8[rbp], xmm0
  61.     mov rax, QWORD PTR -32[rbp]
  62.     movq    xmm0, rax                # xmm0 - arg1 - double x
  63.     call    f
  64.     movsd   QWORD PTR -48[rbp], xmm0
  65.     mov rax, QWORD PTR -8[rbp]
  66.     movq    xmm0, rax                # xmm0 - arg1 - double x
  67.     call    f
  68.     movsd   xmm1, QWORD PTR -48[rbp]
  69.     mulsd   xmm1, xmm0
  70.     pxor    xmm0, xmm0
  71.     comisd  xmm0, xmm1
  72.     jbe .L10
  73.     movsd   xmm0, QWORD PTR -8[rbp]
  74.     movsd   QWORD PTR -24[rbp], xmm0
  75.     jmp .L4
  76. .L10:
  77.     movsd   xmm0, QWORD PTR -8[rbp]
  78.     movsd   QWORD PTR -32[rbp], xmm0
  79. .L4:
  80.     movsd   xmm0, QWORD PTR -32[rbp]
  81.     subsd   xmm0, QWORD PTR -24[rbp]
  82.     comisd  xmm0, QWORD PTR -40[rbp]
  83.     ja  .L7
  84.     movsd   xmm0, QWORD PTR -24[rbp]
  85.     addsd   xmm0, QWORD PTR -32[rbp]
  86.     movsd   xmm1, QWORD PTR .LC1[rip]
  87.     divsd   xmm0, xmm1
  88.     leave
  89.     ret
  90.     .size   solve, .-solve
  91.     .section    .rodata
  92.     .align 8
  93. .LC0:
  94.     .long   0
  95.     .long   1072693248
  96.     .align 8
  97. .LC1:
  98.     .long   0
  99.     .long   1073741824
  100.     .align 8
  101. .LC3:
  102.     .long   2696277389
  103.     .long   1051772663
  104.     .align 8
  105. .LC7:
  106.     .long   0
  107.     .long   1093567616
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement