#include <stdio.h>
int func0(int &i)
{
i++;
return 100;
}
int func1(int *ip)
{
(*ip) ++;
return 101;
}
int& func2(int i)
{
static int ii = 123;
return ii;
}
main()
{
int i, j;
i = 4;
j = 104;
j = func0(i);
//printf("i = %d j = %d\n", i, j);
j = func1(&i);
//printf("i = %d j = %d\n", i, j);
j = func2(9);
//printf("i = %d j = %d\n", i, j);
}
.file "t2.c"
.text
.align 2
.globl _Z5func0Ri
.type _Z5func0Ri,@function
_Z5func0Ri:
.LFB2:
pushl %ebp
.LCFI0:
movl %esp, %ebp
.LCFI1:
movl 8(%ebp), %eax
incl (%eax)
movl $100, %eax
leave
ret
.LFE2:
.Lfe1:
.size _Z5func0Ri,.Lfe1-_Z5func0Ri
.align 2
.globl _Z5func1Pi
.type _Z5func1Pi,@function
_Z5func1Pi:
.LFB4:
pushl %ebp
.LCFI2:
movl %esp, %ebp
.LCFI3:
movl 8(%ebp), %eax
incl (%eax)
movl $101, %eax
leave
ret
.LFE4:
.Lfe2:
.size _Z5func1Pi,.Lfe2-_Z5func1Pi
.align 2
.globl _Z5func2i
.type _Z5func2i,@function
_Z5func2i:
.LFB6:
pushl %ebp
.LCFI4:
movl %esp, %ebp
.LCFI5:
subl $4, %esp
.LCFI6:
movl $123, -4(%ebp)
leal -4(%ebp), %eax
leave
ret
.LFE6:
.Lfe3:
.size _Z5func2i,.Lfe3-_Z5func2i
.align 2
.globl main
.type main,@function
main:
.LFB8:
pushl %ebp
.LCFI7:
movl %esp, %ebp
.LCFI8:
subl $8, %esp
.LCFI9:
andl $-16, %esp
movl $0, %eax
subl %eax, %esp
movl $4, -4(%ebp)
movl $104, -8(%ebp)
subl $12, %esp
leal -4(%ebp), %eax
pushl %eax
.LCFI10:
call _Z5func0Ri
addl $16, %esp
movl %eax, -8(%ebp)
subl $12, %esp
leal -4(%ebp), %eax
pushl %eax
call _Z5func1Pi
addl $16, %esp
movl %eax, -8(%ebp)
subl $12, %esp
pushl $9
call _Z5func2i
addl $16, %esp
movl (%eax), %eax
movl %eax, -8(%ebp)
movl $0, %eax
leave
ret
.LFE8:
.Lfe4:
.size main,.Lfe4-main
.ident "GCC: (GNU) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)"