Ilya_konstantinov

Untitled

Feb 27th, 2026
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. =================================== solution.S
  2. .intel_syntax noprefix
  3. .section .note.GNU-stack
  4.  
  5. .text
  6. .global Solve
  7. Solve:
  8. // TODO: your code here.
  9. =================================== wrong-function-1.S
  10. .intel_syntax noprefix
  11. .section .note.GNU-stack
  12.  
  13. .section .text
  14.  
  15. .global Process
  16. Process:
  17. lea rdi, [rip + scans]
  18. lea rsi, [rip + tmp_arg]
  19. call scanf
  20. mov rax, [rip + tmp_arg]
  21. test rax, rax
  22. jz null
  23. jl negative
  24. shl rax, 1
  25. jmp done
  26.  
  27. negative:
  28. add rax, 7
  29. jmp done
  30.  
  31. null:
  32. mov rax, 42
  33.  
  34. done:
  35. mov rdx, 2
  36. mov rcx, 3
  37. leave
  38. ret
  39.  
  40. scans:
  41. .asciz "%ld"
  42.  
  43. .section .data
  44. .global process_arg
  45. process_arg:
  46. .int 0
  47. tmp_arg:
  48. .int 0
  49. =================================== test.cpp
  50. #include <cstdint>
  51. #include <iostream>
  52.  
  53. extern "C" void Solve();
  54.  
  55. int main() {
  56. Solve();
  57. }
Advertisement
Add Comment
Please, Sign In to add comment