Command for the test (source code):
./chef.py test backend -bw doc/p_57.c
cat build/cpp-bin/assembly.s
Result:
.file "p_59.c"
.text
.Ltext0:
.globl main
.type main, @function
main:
pushq %rbp
movq %rsp, %rbp
subq $88, %rsp
jmp .L1_innerbeginof_main
.L1_innerbeginof_main:
movl $0, -8(%rbp)
movl -8(%rbp), %r10d
movl %r10d, -12(%rbp) # copyInstr
movl $0, -24(%rbp)
movl -24(%rbp), %r10d
movl %r10d, -16(%rbp) # copyInstr
nop
# empty with returnName=a
movl $79, -32(%rbp)
movl -32(%rbp), %r10d
movl %r10d, -12(%rbp) # copyInstr
movl $75, -40(%rbp)
movl $0, -48(%rbp)
# common begin of arrayAccess of b
pushq %rdx
movl -48(%rbp), %eax
cltq
# begin of local arrayAccess of b
movl -40(%rbp), %r10d
movl %r10d, -16(%rbp,%rax,4)
movl -40(%rbp), %r10d
movl %r10d, -52(%rbp)
# end of local arrayAccess of b
# empty with returnName=a
pushq %rdi
movl -12(%rbp), %edi # call Param
call putchar
popq %rdi
movl $0, -60(%rbp)
# common begin of arrayAccess of b
pushq %rdx
movl -60(%rbp), %eax
cltq
# begin of local arrayAccess of b
movl -16(%rbp,%rax,4), %r10d
movl %r10d, -64(%rbp)
# end of local arrayAccess of b
pushq %rdi
movl -64(%rbp), %edi # call Param
call putchar
popq %rdi
movl $10, -72(%rbp)
pushq %rdi
movl -72(%rbp), %edi # call Param
call putchar
popq %rdi
movl $0, -80(%rbp)
movl -80(%rbp), %eax
jmp .L0_endof_main
jmp .L0_endof_main
.L0_endof_main:
leave
ret