Command to run the test (source code):
./chef.py test backend -bw doc/p_57.c
cat build/cpp-bin/assembly.s
Result:
.file "p_57.c"
.text
.Ltext0:
.globl main
.type main, @function
main:
pushq %rbp
movq %rsp, %rbp
subq $52, %rsp
jmp .L1_innerbeginof_main
.L1_innerbeginof_main:
movl $79, -8(%rbp)
movl -8(%rbp), %r10d
movl %r10d, -12(%rbp) # copyInstr
jmp .L2_Wcond
.L2_Wcond:
# empty with returnName=i
movl $75, -20(%rbp)
movl -20(%rbp), %r10d
cmp %r10d, -12(%rbp)
setge %cl
movzbl %cl, %r10d
movl %r10d, -24(%rbp)
cmpl $0, -24(%rbp)
je .L4_Wend
jmp .L3_Wthen
.L3_Wthen:
# empty with returnName=i
pushq %rdi
movl -12(%rbp), %edi # call Param
call putchar
popq %rdi
movl $4, -32(%rbp)
# empty with returnName=i
movl -12(%rbp), %eax
subl -32(%rbp), %eax
movl %eax, -36(%rbp)
movl -36(%rbp), %r10d
movl %r10d, -12(%rbp) # copyInstr
jmp .L2_Wcond
.L4_Wend:
jmp .L5_funcinnerafter
.L5_funcinnerafter:
movl $10, -44(%rbp)
pushq %rdi
movl -44(%rbp), %edi # call Param
call putchar
popq %rdi
jmp .L0_endof_main
.L0_endof_main:
leave
ret