Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- float sum=0;
- for(int i = 0; i < 10; i++)
- sum += 1.0f/float(i+1);
- cout<<sum<<endl;
- return 0;
- }
- g++ -O3 main.cpp && ./a.out
- .file "main.cpp"
- .section .text.startup,"ax",@progbits
- .p2align 4,,15
- .globl main
- .type main, @function
- main:
- .LFB1561:
- .cfi_startproc
- subq $8, %rsp
- .cfi_def_cfa_offset 16
- movl $_ZSt4cout, %edi
- movsd .LC0(%rip), %xmm0
- call _ZNSo9_M_insertIdEERSoT_
- movq %rax, %rdi
- call _ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
- xorl %eax, %eax
- addq $8, %rsp
- .cfi_def_cfa_offset 8
- ret
- .cfi_endproc
- .LFE1561:
- .size main, .-main
- .p2align 4,,15
- .type _GLOBAL__sub_I_main, @function
- _GLOBAL__sub_I_main:
- .LFB2048:
- .cfi_startproc
- subq $8, %rsp
- .cfi_def_cfa_offset 16
- movl $_ZStL8__ioinit, %edi
- call _ZNSt8ios_base4InitC1Ev
- movl $__dso_handle, %edx
- movl $_ZStL8__ioinit, %esi
- movl $_ZNSt8ios_base4InitD1Ev, %edi
- addq $8, %rsp
- .cfi_def_cfa_offset 8
- jmp __cxa_atexit
- .cfi_endproc
- .LFE2048:
- .size _GLOBAL__sub_I_main, .-_GLOBAL__sub_I_main
- .section .init_array,"aw"
- .align 8
- .quad _GLOBAL__sub_I_main
- .local _ZStL8__ioinit
- .comm _ZStL8__ioinit,1,1
- .section .rodata.cst8,"aM",@progbits,8
- .align 8
- .LC0:
- .long 0
- .long 1074228871
- .hidden __dso_handle
- .ident "GCC: (Ubuntu 7.2.0-1ubuntu1~16.04) 7.2.0"
- .section .note.GNU-stack,"",@progbits
Add Comment
Please, Sign In to add comment