100000f70: 100000f71: pushq %rbp 55 48 89 e5 89 7d fc c7 45 18 02 ee ee ee 8b 7d f8 movq movl Krsp, Krbp Kedi, -4(%rbp) int foolint num) { int val = 2; int result = val - num; 10000er81: 100000f74: 100000177: $2, -8(%rbp movl -8(%rbp), %edi -4 (Krbp), Nedi %edi, -12(Nrbp) -12 (%rbp), %eax 10000017e: movl Of af 7d fc imull movl 100000f85: 89 7d 14 return result; 100000f88: 8b 45 f4 movl 100000f8b: 5d %rbp popq retq 100000f8c: c3 int foo(int num) : pushg &rbp movg trap, rbp movl tedi, -4 (%rbp)e
100000f70: 100000f71: pushq %rbp 55 48 89 e5 89 7d fc c7 45 18 02 ee ee ee 8b 7d f8 movq movl Krsp, Krbp Kedi, -4(%rbp) int foolint num) { int val = 2; int result = val - num; 10000er81: 100000f74: 100000177: $2, -8(%rbp movl -8(%rbp), %edi -4 (Krbp), Nedi %edi, -12(Nrbp) -12 (%rbp), %eax 10000017e: movl Of af 7d fc imull movl 100000f85: 89 7d 14 return result; 100000f88: 8b 45 f4 movl 100000f8b: 5d %rbp popq retq 100000f8c: c3 int foo(int num) : pushg &rbp movg trap, rbp movl tedi, -4 (%rbp)e
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...
Related questions
Question
![2. Given the following code snippet and assembly instructions, align the code with the
corresponding assembly. The first line has already been done for you
23fooii:
10000er68:
55
pusha
Krbp
10000ef61:
48 89 e5
Krsp, Krbp
89 7d fc
mova
movl
10000ef64:
%edi, -4(%rbp)
%esi, -8(%rbp)
movl
$3, -4(%rbp), %esi
%esi, -16(%rbp)
-8(Krbp), %esi
-12(Xrbp), Nesi
Kesi, -20(%rbp)
-12(Xrbp), Xesi
-16(Nrbp), %esi
%esi, -24 (%rbp)
-24 (%rbp), %eax
10000ef67:
movl
c7 45 14 02 ee ee ee
imull
movl
movl
89 75 18
int foo(int num1, int num2){
int val1 = 2;
int val2 = 3 * num1;
int val3 = num2 + val1;
int result = val1 - val2; 1e000e17e:
10000ef6a:
$2, -12(Nrbp)
100000f71:
6b 75 fc 03
10000ef75:
18000ef78:
89 75 fe
8b 75 f8
03 75 14
addl
movl
movl
10000ef7b:
89 75 ec
8b 75 f4
2b 75 fe
10000er81:
10000ef84:
subl
return result;
89 75 e8
8b 45 e8
5d
movl
movl
10000er87:
10000ef8a:
10000ef8d:
}
Krbp
popa
1000eef8e:
c3
reta
int foo (int numl, int num2) :
pushg &rbp
movg trsp, rbp
movl tedi,
movl sesi, -8 (8rbp) e
-4 (rbp)e
www w](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Ff677ad4c-42c4-4cbd-b8e5-1674403e60c7%2F00634f5a-9f11-418c-967d-e089bde14105%2Fxx2jgli_processed.jpeg&w=3840&q=75)
Transcribed Image Text:2. Given the following code snippet and assembly instructions, align the code with the
corresponding assembly. The first line has already been done for you
23fooii:
10000er68:
55
pusha
Krbp
10000ef61:
48 89 e5
Krsp, Krbp
89 7d fc
mova
movl
10000ef64:
%edi, -4(%rbp)
%esi, -8(%rbp)
movl
$3, -4(%rbp), %esi
%esi, -16(%rbp)
-8(Krbp), %esi
-12(Xrbp), Nesi
Kesi, -20(%rbp)
-12(Xrbp), Xesi
-16(Nrbp), %esi
%esi, -24 (%rbp)
-24 (%rbp), %eax
10000ef67:
movl
c7 45 14 02 ee ee ee
imull
movl
movl
89 75 18
int foo(int num1, int num2){
int val1 = 2;
int val2 = 3 * num1;
int val3 = num2 + val1;
int result = val1 - val2; 1e000e17e:
10000ef6a:
$2, -12(Nrbp)
100000f71:
6b 75 fc 03
10000ef75:
18000ef78:
89 75 fe
8b 75 f8
03 75 14
addl
movl
movl
10000ef7b:
89 75 ec
8b 75 f4
2b 75 fe
10000er81:
10000ef84:
subl
return result;
89 75 e8
8b 45 e8
5d
movl
movl
10000er87:
10000ef8a:
10000ef8d:
}
Krbp
popa
1000eef8e:
c3
reta
int foo (int numl, int num2) :
pushg &rbp
movg trsp, rbp
movl tedi,
movl sesi, -8 (8rbp) e
-4 (rbp)e
www w
![1. Given the following code snippet and assembly instructions, align the code with the
corresponding assembly. The first line has already been done for you.
-_23fooi:
100000f70:
55
pushq
%rbp
%rsp, %rbp
%edi, -4(%rbp)
movl
100000f71:
48 89 e5
movq
int foolint num){
int val = 2;
89 7d fc
100000f74:
100000f77:
100000f7e:
int result = val num; 10000e181:
movl
c7 45 f8 02 ee ee 00
movl
imull
movl
movl
$2, -8(%rbp)
-8(%rbp), %edi
-4(%rbp), %edi
%edi, -12(%rbp)
-12 (%rbp), %eax
8b 7d f8
ef af 7d fc
100000f85:
100000f88:
89 7d f4
return result;
8b 45 f4
100000f8b:
5d
%rbp
popa
retq
100000f8c:
c3
int foo (int num) :
Rushg &rbp
movg rsp, trbp
movl šedi, -4 (8rbp)e](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Ff677ad4c-42c4-4cbd-b8e5-1674403e60c7%2F00634f5a-9f11-418c-967d-e089bde14105%2Ftm2rnbc_processed.jpeg&w=3840&q=75)
Transcribed Image Text:1. Given the following code snippet and assembly instructions, align the code with the
corresponding assembly. The first line has already been done for you.
-_23fooi:
100000f70:
55
pushq
%rbp
%rsp, %rbp
%edi, -4(%rbp)
movl
100000f71:
48 89 e5
movq
int foolint num){
int val = 2;
89 7d fc
100000f74:
100000f77:
100000f7e:
int result = val num; 10000e181:
movl
c7 45 f8 02 ee ee 00
movl
imull
movl
movl
$2, -8(%rbp)
-8(%rbp), %edi
-4(%rbp), %edi
%edi, -12(%rbp)
-12 (%rbp), %eax
8b 7d f8
ef af 7d fc
100000f85:
100000f88:
89 7d f4
return result;
8b 45 f4
100000f8b:
5d
%rbp
popa
retq
100000f8c:
c3
int foo (int num) :
Rushg &rbp
movg rsp, trbp
movl šedi, -4 (8rbp)e
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
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…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
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)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
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…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
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)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
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](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY