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

below C code blue color by the assembly 5. (Page 213) Fill in the missing expres

ID: 3705980 • Letter: B

Question

below C code blue color by the assembly 5. (Page 213) Fill in the missing expression in the (right column)-(16 points) 2 points for each blank with using code long condi (long x, long y, long z) { | # The assembly code is displayed below: xin%rdi, yin%rsi, z in %rdx # long val if ; )t cond1 leaq (%rdi, %rsi), %rax addq 90rds, %rax cmpq $6, %rdi jle L2 cmpq %rdx, %rsi jle L3 movq %rdi, %rax xorq %rsi, %rax ret if( (val- else (val. :3 ??????; else if (val- ????; } else val- L3 return val; close con1 function movq andq %rdi, %rax 90rst %rax ret L2: $-5, %rdi crnpq Jge movq orq ret LS %rsi, %rax %rds, %rax L5 movq %rsi, %rax ret

Explanation / Answer

General Instruction:
addq- adding the two numbers
jle-jump less than or equal instruction
compq-compares the two values
andq-AND operator(&)
orq-OR operator(|)
movq src dest-moves the source value to the destination

coding:
long val=x+y;
val=val+z;
if(x<=6)
{
if(x>=-5)
{
val=y;
val=val*z;
return;
}
else
{
val=y;
val=val|z;
return;
}}
else if(y<=z)
{
val=x;
val=val&y;
return;
}
else{
val=x;
val=val^y;
return;
}
return val;