Following is the C code that was recovered for funcl: int funcl( int x, int y) { int t1 = func3( &x ); printf("t1 is: %d \n", t1); int t2 = func3( &y ); printf("t2 is: %d \n", t2); if ( t1 > t2 ) { return tl; } return t2; } And here is the assembly code for func3 Dump of assembler code for function func3: Ox0000000000400666 <+0>: Ox0000000000400667 <+1>: => 0x000000000040066a <+4>: Ox000000000040066e <+8>: Ox0000000000400672 <+12>: Ox0000000000400679 <+19>: θx000000000040067d <423> : Ox000000000040067f <+25>: push %rbp (%rsp),%rbp $0x20, %rsp %rdi,-0x18(%rbp) $0x1,-0x4(%rbp) -0x18, (%rbp),%rax (%rax),%eax $0x4, %eax Ox4006a7 # SETUP mov %23 sub %#3 mov %23 movl %23 mov mov %23 cmp jle Ox0000000000400682 <+28>: #3 Ox0000000000400684 <+30>: -0x18, (%rbp),%rax (%rax),%eax $0x2,%eax %eax,%edx -0x18(%rbp),%rax %edx,(%rax) -0x18(%rbp),%rax %rax, %rdi callq Ox400666 $0x1,%eax %eax,-0x4(%rbp) -0x4(%rbp),%eax mov #3 Ox0000000000400688 <+34>: Ox000000000040068a <+36>: Ox000000000040068d <+39>: Ox000000000040068f <+41>: Ox0000000000400693 <+45>: Ox0000000000400695 <+47>: mov #3 sar # mov mov %23 mov 23 mov #3 Ox0000000000400699 <+51>: mov #3 Ox000000000040069c <+54>: %23 Ox00000000004006a1 <+59>: add #3 Ox00000000004006a4 <+62>: Ox00000000004006a7 <+65>: Ox00000000004006aa <+68>: mov %23 mov %23 leaveq retq # CLEAN-Up Ox00000000004006ab <+69>: %#3 End of assembler dump. Q2) What is the halting condition for the recursive function func3? Assuming the fist parameter is called x.
Following is the C code that was recovered for funcl: int funcl( int x, int y) { int t1 = func3( &x ); printf("t1 is: %d \n", t1); int t2 = func3( &y ); printf("t2 is: %d \n", t2); if ( t1 > t2 ) { return tl; } return t2; } And here is the assembly code for func3 Dump of assembler code for function func3: Ox0000000000400666 <+0>: Ox0000000000400667 <+1>: => 0x000000000040066a <+4>: Ox000000000040066e <+8>: Ox0000000000400672 <+12>: Ox0000000000400679 <+19>: θx000000000040067d <423> : Ox000000000040067f <+25>: push %rbp (%rsp),%rbp $0x20, %rsp %rdi,-0x18(%rbp) $0x1,-0x4(%rbp) -0x18, (%rbp),%rax (%rax),%eax $0x4, %eax Ox4006a7 # SETUP mov %23 sub %#3 mov %23 movl %23 mov mov %23 cmp jle Ox0000000000400682 <+28>: #3 Ox0000000000400684 <+30>: -0x18, (%rbp),%rax (%rax),%eax $0x2,%eax %eax,%edx -0x18(%rbp),%rax %edx,(%rax) -0x18(%rbp),%rax %rax, %rdi callq Ox400666 $0x1,%eax %eax,-0x4(%rbp) -0x4(%rbp),%eax mov #3 Ox0000000000400688 <+34>: Ox000000000040068a <+36>: Ox000000000040068d <+39>: Ox000000000040068f <+41>: Ox0000000000400693 <+45>: Ox0000000000400695 <+47>: mov #3 sar # mov mov %23 mov 23 mov #3 Ox0000000000400699 <+51>: mov #3 Ox000000000040069c <+54>: %23 Ox00000000004006a1 <+59>: add #3 Ox00000000004006a4 <+62>: Ox00000000004006a7 <+65>: Ox00000000004006aa <+68>: mov %23 mov %23 leaveq retq # CLEAN-Up Ox00000000004006ab <+69>: %#3 End of assembler dump. Q2) What is the halting condition for the recursive function func3? Assuming the fist parameter is called x.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Expert Solution
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
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education