#include int main() { int score = 70; int attendance = 1; int pass_the_course = 0; if (attendance if(score_ _){ if(. score score if(score }else{ return 0;

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Consider the following assembly code:
<+0>:
push %rbp
<+1>:
mov
%rsp,%rbp
movl $0x46,-0x4(%rbp)
movl $0x1,-0x8(%rbp)
movl $0x0,-0xc(%rbp)
<+4>:
<+11>:
<+18>:
<+25>:
cmpl $0x1,-0x8(%rbp)
<+29>:
jle
Øx4004f8 <main+66>
<+31>:
cmpl $0x4f,-0x4(%rbp)
<+35>:
jle
Øx4004e2 <main+44>
movl $0x4,-0xc(%rbp)
movl $0x3,-0xc(%rbp)
cmpl $0x3b, -Øx4(%rbp)
<+37>:
<+44>:
<+51>:
<+55>:
jg
movl $0x2,-0xc(%rbp)
Øx400506 <main+80>
<+57>:
<+64>:
jmp
Øx400506 <main+80>
<+66>:
movl $ex0,-0xc(%rbp)
<+73>:
mov
$0x0,%eax
<+78>:
jmp
Ox400506 <main+80>
<+80>:
pop
%rbp
<+81>:
retq
This code came from skeleton C file below after optimizing with 00. This means gcc -00 -S
command was used to convert C File into assembly file. Complete the C code given below
using the provided assembly code.
#include <stdio.h>
int main() {
int score = 70;
int attendance = 1;
int pass_the_course = 0;
if (attendance_
_){
if(score
if(
score
if(score_
}else{
return 0;
}
Transcribed Image Text:Consider the following assembly code: <+0>: push %rbp <+1>: mov %rsp,%rbp movl $0x46,-0x4(%rbp) movl $0x1,-0x8(%rbp) movl $0x0,-0xc(%rbp) <+4>: <+11>: <+18>: <+25>: cmpl $0x1,-0x8(%rbp) <+29>: jle Øx4004f8 <main+66> <+31>: cmpl $0x4f,-0x4(%rbp) <+35>: jle Øx4004e2 <main+44> movl $0x4,-0xc(%rbp) movl $0x3,-0xc(%rbp) cmpl $0x3b, -Øx4(%rbp) <+37>: <+44>: <+51>: <+55>: jg movl $0x2,-0xc(%rbp) Øx400506 <main+80> <+57>: <+64>: jmp Øx400506 <main+80> <+66>: movl $ex0,-0xc(%rbp) <+73>: mov $0x0,%eax <+78>: jmp Ox400506 <main+80> <+80>: pop %rbp <+81>: retq This code came from skeleton C file below after optimizing with 00. This means gcc -00 -S command was used to convert C File into assembly file. Complete the C code given below using the provided assembly code. #include <stdio.h> int main() { int score = 70; int attendance = 1; int pass_the_course = 0; if (attendance_ _){ if(score if( score if(score_ }else{ return 0; }
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY