Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Given the following C code: Fill in the blanks by dragging the appropriate entri

ID: 3752822 • Letter: G

Question

Given the following C code: Fill in the blanks by dragging the appropriate entries below:

Given the following C code: Long rfun(int x) if ( x 0 ) return 0; long rv = rfun(nx); return x-rvi Fill in the blanks by dragging the appropriate entries below rfun: movl $0, eax testq %rdi, %rdi je .L6 pushq movl %rbs %edi, %ebx shrq $2,%rdi call rfun popq rbx .L6: rep ret cmP4 $100, %r testq %rdi, %rd sarq $3, %rdi unsigned int | addq %rbx, %r nulq %rdi, %ra stl %edi, %eulq %rbx, %rax bq %rax, %rbx sarl S2, %edi je .L6 js.L6 sarq $2, %rdi ja .L6 Shri $2, %edi leaq (%rdi,%rdi), %rdi shrq $2,%rdi

Explanation / Answer

Answer to 1st wrong answer

It should be
testl %edi, %edi


Then Comes the right shift part, It should be

shrl $2 , %edi

Then The last Instruction should be Substract

subq %rax , %rbx


Thanks, PLEASE UPVOTE if helpful



Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote