struct bird
{
int x,y,z;
float flying;
char *p;
};
bird bir,b1;
bird test(bird a,bird b)
{
a.x=b.x;
a.y=b.y;
a.z=b.z;
a.flying=b.flying;
a.p=b.p;
b.x=100;
b.y=200;
}
int main()
{
b1.x=999;
b1.y=888;
b1.z=777;
b1.flying=9.0;
bird d=test(bir,b1);
}
//********************
.file "b04.cpp"
.globl bir
.bss
.align 16
.type bir, @object
.size bir, 24
bir:
.zero 24
.globl b1
.align 16
.type b1, @object
.size b1, 24
b1:
.zero 24
.text
.globl _Z4test4birdS_
.type _Z4test4birdS_, @function
_Z4test4birdS_:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movq %rdi, -8(%rbp)
movl 40(%rbp), %eax
movl %eax, 16(%rbp)
movl 44(%rbp), %eax
movl %eax, 20(%rbp)
movl 48(%rbp), %eax
movl %eax, 24(%rbp)
movl 52(%rbp), %eax
movl %eax, 28(%rbp)
movq 56(%rbp), %rax
movq %rax, 32(%rbp)
movl $100, 40(%rbp)
movl $200, 44(%rbp)
movq -8(%rbp), %rax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size _Z4test4birdS_, .-_Z4test4birdS_
.globl main
.type main, @function
main:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $80, %rsp
movl $999, b1(%rip)
movl $888, b1+4(%rip)
movl $777, b1+8(%rip)
movl .LC0(%rip), %eax
movl %eax, b1+12(%rip)
leaq -32(%rbp), %rax
movq b1(%rip), %rdx
movq %rdx, 24(%rsp)
movq b1+8(%rip), %rdx
movq %rdx, 32(%rsp)
movq b1+16(%rip), %rdx
movq %rdx, 40(%rsp)
movq bir(%rip), %rdx
movq %rdx, (%rsp)
movq bir+8(%rip), %rdx
movq %rdx, 8(%rsp)
movq bir+16(%rip), %rdx
movq %rdx, 16(%rsp)
movq %rax, %rdi
call _Z4test4birdS_
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size main, .-main
.section .rodata
.align 4
.LC0:
.long 1091567616
.ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-11)"
.section .note.GNU-stack,"",@progbits