Compilation case with clang compiler. ----- main() { int i; for(i=1;i<=2;i++){printf("test out\n"); } printf("end\n"); } ----- .text .file "test-opt.c" .globl main # -- Begin function main .p2align 4, 0x90 .type main,@function main: # @main .cfi_startproc # %bb.0: pushq %rbp .cfi_def_cfa_offset 16 .cfi_offset %rbp, -16 movq %rsp, %rbp .cfi_def_cfa_register %rbp subq $16, %rsp movl $0, -4(%rbp) movl $1, -8(%rbp) .LBB0_1: # =>This Inner Loop Header: Depth=1 cmpl $2, -8(%rbp) jg .LBB0_4 # %bb.2: # in Loop: Header=BB0_1 Depth=1 movabsq $.L.str, %rdi movb $0, %al callq printf movl %eax, -12(%rbp) # 4-byte Spill # %bb.3: # in Loop: Header=BB0_1 Depth=1 movl -8(%rbp), %eax addl $1, %eax movl %eax, -8(%rbp) jmp .LBB0_1 .LBB0_4: movabsq $.L.str.1, %rdi movb $0, %al callq printf movl -4(%rbp), %ecx movl %eax, -16(%rbp) # 4-byte Spill movl %ecx, %eax addq $16, %rsp popq %rbp retq .Lfunc_end0: .size main, .Lfunc_end0-main .cfi_endproc # -- End function .type .L.str,@object # @.str .section .rodata.str1.1,"aMS",@progbits,1 .L.str: .asciz "test out\n" .size .L.str, 10 .type .L.str.1,@object # @.str.1 .L.str.1: .asciz "end\n" .size .L.str.1, 5 .ident "FreeBSD clang version 6.0.0 (tags/RELEASE_600/final 326565) (based on LLVM 6.0.0)" .section ".note.GNU-stack","",@progbits