Question: Consider the following assembly code for a function with a while loop: Based on the assembly code above, fill in the blanks below in its
Consider the following assembly code for a function with a while loop:

Based on the assembly code above, fill in the blanks below in its corresponding C source code. You may only use the source-level C variable names such as n, m and result. Dont use register names!

Prob1: L5: #%d! is the lower 8 bits of %rdi testb $1, %dil je .L3 leal 7 (%rdi, %rdi, 8) , addl $6, %esi %eax jmp .L2 .L3: 1(, %rsi, $3, %esi $2, %edi 2), %eax leal addl sh11 L2: cmp1 %edi, %esi jb .L5 ret Prob1: L5: #%d! is the lower 8 bits of %rdi testb $1, %dil je .L3 leal 7 (%rdi, %rdi, 8) , addl $6, %esi %eax jmp .L2 .L3: 1(, %rsi, $3, %esi $2, %edi 2), %eax leal addl sh11 L2: cmp1 %edi, %esi jb .L5 ret
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
