Question: Dump of assembler code for function phase_4: => 0x0000000000400f75 : sub $0x18,%rsp 0x0000000000400f79 : lea 0x8(%rsp),%rcx 0x0000000000400f7e : lea 0xc(%rsp),%rdx 0x0000000000400f83 : mov $0x40244f,%esi 0x0000000000400f88

Dump of assembler code for function phase_4: => 0x0000000000400f75 <+0>: sub $0x18,%rsp 0x0000000000400f79 <+4>: lea 0x8(%rsp),%rcx 0x0000000000400f7e <+9>: lea 0xc(%rsp),%rdx 0x0000000000400f83 <+14>: mov $0x40244f,%esi 0x0000000000400f88 <+19>: mov $0x0,%eax 0x0000000000400f8d <+24>: callq 0x400ba0 <__isoc99_sscanf@plt> 0x0000000000400f92 <+29>: cmp $0x2,%eax 0x0000000000400f95 <+32>: jne 0x400f9e 0x0000000000400f97 <+34>: cmpl $0xe,0xc(%rsp) 0x0000000000400f9c <+39>: jbe 0x400fa3 0x0000000000400f9e <+41>: callq 0x40134f 0x0000000000400fa3 <+46>: mov $0xe,%edx 0x0000000000400fa8 <+51>: mov $0x0,%esi 0x0000000000400fad <+56>: mov 0xc(%rsp),%edi 0x0000000000400fb1 <+60>: callq 0x400f42 0x0000000000400fb6 <+65>: cmp $0xa,%eax 0x0000000000400fb9 <+68>: jne 0x400fc2 0x0000000000400fbb <+70>: cmpl $0xa,0x8(%rsp) 0x0000000000400fc0 <+75>: je 0x400fc7 0x0000000000400fc2 <+77>: callq 0x40134f 0x0000000000400fc7 <+82>: add $0x18,%rsp 0x0000000000400fcb <+86>: retq

Dump of assembler code for function func4: 0x0000000000400f42 <+0>: push %rbx 0x0000000000400f43 <+1>: mov %edx,%eax 0x0000000000400f45 <+3>: sub %esi,%eax 0x0000000000400f47 <+5>: mov %eax,%ebx 0x0000000000400f49 <+7>: shr $0x1f,%ebx 0x0000000000400f4c <+10>: add %ebx,%eax 0x0000000000400f4e <+12>: sar %eax 0x0000000000400f50 <+14>: lea (%rax,%rsi,1),%ebx 0x0000000000400f53 <+17>: cmp %edi,%ebx 0x0000000000400f55 <+19>: jle 0x400f63 0x0000000000400f57 <+21>: lea -0x1(%rbx),%edx 0x0000000000400f5a <+24>: callq 0x400f42 0x0000000000400f5f <+29>: add %ebx,%eax 0x0000000000400f61 <+31>: jmp 0x400f73 0x0000000000400f63 <+33>: mov %ebx,%eax 0x0000000000400f65 <+35>: cmp %edi,%ebx 0x0000000000400f67 <+37>: jge 0x400f73 0x0000000000400f69 <+39>: lea 0x1(%rbx),%esi 0x0000000000400f6c <+42>: callq 0x400f42 0x0000000000400f71 <+47>: add %ebx,%eax 0x0000000000400f73 <+49>: pop %rbx 0x0000000000400f74 <+50>: retq

This is what I know. The input is suppose to be "%d %d". The first value has to be less then 14, and that func4 is recursive. I am having trouble understanding exactly what func4 is doing though.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!