.file "storage.cpp" .local _ZStL8__ioinit .comm _ZStL8__ioinit,1,1 .globl global_var .data .align 4 .type global_var, @object .size global_var, 4 global_var: .long 7 .section .rodata .align 4 .type _ZL12global_const, @object .size _ZL12global_const, 4 _ZL12global_const: .long 9 .local _ZL13global_const2 .comm _ZL13global_const2,4,4 .local _ZGVZ3foovE13static_const2 .comm _ZGVZ3foovE13static_const2,8,8 .LC0: .string "Auto var = %d\n" .LC1: .string "Auto const = %d\n" .LC2: .string "Auto const 2 = %d\n" .LC3: .string "Static var = %d\n" .LC4: .string "Static const = %d\n" .LC5: .string "Static const 2 = %d\n" .LC6: .string "Dynamic var = %d\n" .text .globl _Z3foov .type _Z3foov, @function _Z3foov: .LFB1021: .cfi_startproc pushq %rbp .cfi_def_cfa_offset 16 .cfi_offset 6, -16 movq %rsp, %rbp .cfi_def_cfa_register 6 subq $32, %rsp movl $9, -20(%rbp) movl $9, -16(%rbp) call rand movl %eax, -12(%rbp) movl $_ZGVZ3foovE13static_const2, %eax movzbl (%rax), %eax testb %al, %al jne .L2 movl $_ZGVZ3foovE13static_const2, %edi call __cxa_guard_acquire testl %eax, %eax setne %al testb %al, %al je .L2 call rand movl %eax, _ZZ3foovE13static_const2(%rip) movl $_ZGVZ3foovE13static_const2, %edi call __cxa_guard_release .L2: movl $4, %edi call _Znwm movl $100, (%rax) movq %rax, -8(%rbp) movl -20(%rbp), %eax movl %eax, %esi movl $.LC0, %edi movl $0, %eax call printf movl $9, %esi movl $.LC1, %edi movl $0, %eax call printf movl -12(%rbp), %eax movl %eax, %esi movl $.LC2, %edi movl $0, %eax call printf movl _ZZ3foovE10static_var(%rip), %eax movl %eax, %esi movl $.LC3, %edi movl $0, %eax call printf movl $9, %esi movl $.LC4, %edi movl $0, %eax call printf movl _ZZ3foovE13static_const2(%rip), %eax movl %eax, %esi movl $.LC5, %edi movl $0, %eax call printf movq -8(%rbp), %rax movl (%rax), %eax movl %eax, %esi movl $.LC6, %edi movl $0, %eax call printf nop leave .cfi_def_cfa 7, 8 ret .cfi_endproc .LFE1021: .size _Z3foov, .-_Z3foov .section .rodata .LC7: .string "Global var = %d\n" .LC8: .string "Global const = %d\n" .LC9: .string "Global const 2 = %d\n" .text .globl main .type main, @function main: .LFB1022: .cfi_startproc pushq %rbp .cfi_def_cfa_offset 16 .cfi_offset 6, -16 movq %rsp, %rbp .cfi_def_cfa_register 6 call _Z3foov movl global_var(%rip), %eax movl %eax, %esi movl $.LC7, %edi movl $0, %eax call printf movl $9, %esi movl $.LC8, %edi movl $0, %eax call printf movl _ZL13global_const2(%rip), %eax movl %eax, %esi movl $.LC9, %edi movl $0, %eax call printf movl $0, %eax popq %rbp .cfi_def_cfa 7, 8 ret .cfi_endproc .LFE1022: .size main, .-main .type _Z41__static_initialization_and_destruction_0ii, @function _Z41__static_initialization_and_destruction_0ii: .LFB1023: .cfi_startproc pushq %rbp .cfi_def_cfa_offset 16 .cfi_offset 6, -16 movq %rsp, %rbp .cfi_def_cfa_register 6 subq $16, %rsp movl %edi, -4(%rbp) movl %esi, -8(%rbp) cmpl $1, -4(%rbp) jne .L7 cmpl $65535, -8(%rbp) jne .L7 movl $_ZStL8__ioinit, %edi call _ZNSt8ios_base4InitC1Ev movl $__dso_handle, %edx movl $_ZStL8__ioinit, %esi movl $_ZNSt8ios_base4InitD1Ev, %edi call __cxa_atexit call rand movl %eax, _ZL13global_const2(%rip) .L7: nop leave .cfi_def_cfa 7, 8 ret .cfi_endproc .LFE1023: .size _Z41__static_initialization_and_destruction_0ii, .-_Z41__static_initialization_and_destruction_0ii .type _GLOBAL__sub_I_global_var, @function _GLOBAL__sub_I_global_var: .LFB1024: .cfi_startproc pushq %rbp .cfi_def_cfa_offset 16 .cfi_offset 6, -16 movq %rsp, %rbp .cfi_def_cfa_register 6 movl $65535, %esi movl $1, %edi call _Z41__static_initialization_and_destruction_0ii popq %rbp .cfi_def_cfa 7, 8 ret .cfi_endproc .LFE1024: .size _GLOBAL__sub_I_global_var, .-_GLOBAL__sub_I_global_var .section .init_array,"aw" .align 8 .quad _GLOBAL__sub_I_global_var .local _ZZ3foovE13static_const2 .comm _ZZ3foovE13static_const2,4,4 .data .align 4 .type _ZZ3foovE10static_var, @object .size _ZZ3foovE10static_var, 4 _ZZ3foovE10static_var: .long 7 .section .rodata .align 4 .type _ZZ3foovE12static_const, @object .size _ZZ3foovE12static_const, 4 _ZZ3foovE12static_const: .long 9 .hidden __dso_handle .ident "GCC: (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609" .section .note.GNU-stack,"",@progbits