Guest User

Untitled

a guest
Feb 18th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. float sum=0;
  7. for(int i = 0; i < 10; i++)
  8. sum += 1.0f/float(i+1);
  9. cout<<sum<<endl;
  10. return 0;
  11. }
  12.  
  13. g++ -O3 main.cpp && ./a.out
  14.  
  15. .file "main.cpp"
  16. .section .text.startup,"ax",@progbits
  17. .p2align 4,,15
  18. .globl main
  19. .type main, @function
  20. main:
  21. .LFB1561:
  22. .cfi_startproc
  23. subq $8, %rsp
  24. .cfi_def_cfa_offset 16
  25. movl $_ZSt4cout, %edi
  26. movsd .LC0(%rip), %xmm0
  27. call _ZNSo9_M_insertIdEERSoT_
  28. movq %rax, %rdi
  29. call _ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
  30. xorl %eax, %eax
  31. addq $8, %rsp
  32. .cfi_def_cfa_offset 8
  33. ret
  34. .cfi_endproc
  35. .LFE1561:
  36. .size main, .-main
  37. .p2align 4,,15
  38. .type _GLOBAL__sub_I_main, @function
  39. _GLOBAL__sub_I_main:
  40. .LFB2048:
  41. .cfi_startproc
  42. subq $8, %rsp
  43. .cfi_def_cfa_offset 16
  44. movl $_ZStL8__ioinit, %edi
  45. call _ZNSt8ios_base4InitC1Ev
  46. movl $__dso_handle, %edx
  47. movl $_ZStL8__ioinit, %esi
  48. movl $_ZNSt8ios_base4InitD1Ev, %edi
  49. addq $8, %rsp
  50. .cfi_def_cfa_offset 8
  51. jmp __cxa_atexit
  52. .cfi_endproc
  53. .LFE2048:
  54. .size _GLOBAL__sub_I_main, .-_GLOBAL__sub_I_main
  55. .section .init_array,"aw"
  56. .align 8
  57. .quad _GLOBAL__sub_I_main
  58. .local _ZStL8__ioinit
  59. .comm _ZStL8__ioinit,1,1
  60. .section .rodata.cst8,"aM",@progbits,8
  61. .align 8
  62. .LC0:
  63. .long 0
  64. .long 1074228871
  65. .hidden __dso_handle
  66. .ident "GCC: (Ubuntu 7.2.0-1ubuntu1~16.04) 7.2.0"
  67. .section .note.GNU-stack,"",@progbits
Add Comment
Please, Sign In to add comment