
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question

Transcribed Image Text:Following is the C code that was recovered for func1:
int funcl( int x, int y) {
int t1 = func3( &x );
printf("t1 is: %d \n", tl);
int t2 = func3( &y );
printf("t2 is: %d \n", t2);
if ( t1 > t2 ) {
return t1;
return t2;
And here is the assembly code for func3
Dump of assembler code for function func3:
Ox0000000000400666 <+0>: push
Ox0000000000400667 <+1>:
=> 0x000000000040066a <+4>;
%rbp
(%rsp),%rbp
$0x20,%rsp
%rdi,-0x18(%rbp)
$0x1,-0x4(%rbp)
-0x18, (%rbp), %rax
(%rax),%eax
$0x4,%eax
Ox4006a7 <func3+65>
# SETUP
mov
sub
Ox000000000040066e <+8>:
mov
23
Ox0000000000400672 <+12>:
movl
Ox0000000000400679 <+19>:
mov
Ox000000000040067d <+23>:
Ox000000000040067f <+25>:
θx0000000000400682 <+28>:
Ox0000000000400684 <+30>:
mov
23
cmp
jle
%23
%23
-0x18, (%rbp), %rax
(%rax),%eax
$0x2,%eax
%eax,%edx
-0x18(%rbp),%rax
%edx,(%rax)
-0x18(%rbp),%rax
%rax,%rdi
callq Ox400666 <func3>
$0x1,%eax
%eax,-0x4(%rbp)
-0x4(%rbp),%eax
mov
%23
Ox0000000000400688 <+34>:
Ox000000000040068a <+36>:
Ox000000000040068d <+39>:
Ox000000000040068f <+41>:
mov
%23
sar
%23
mov
%23
mov
%23
Ox0000000000400693 <+45>:
mov
%23
θx0000000000400695<+47>:
mov
#:
Ox0000000000400699 <+51>:
mov
#3
Ox000000000040069c <+54>:
%23
Ox00000000004006al <+59>:
add
Ox00000000004006a4 <+62>:
mov
%23
Ox00000000004006a7 <+65>:
mov
#3
Ox00000000004006aa <+68>:
leaveq
retq
# CLEAN-UP
Ox00000000004006ab <+69>:
End of assembler dump.
%23
Q2)
Assuming the fist parameter is called x.
What is the halting condition for the recursive function func3?
betta er allt dæmið i þessari spurningu
Open original
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 nowThis is a popular solution!
Step by stepSolved 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.Similar questions
- In the C programming language, if all function prototypes are listed at the top of your code, outside and above all functions, you do not need to worry about the order of the function definitions within the code. True Falsearrow_forwardIn C programming, if the return type of a function is Void how can you implement assert statements? For example, Void ceasar(int n, char*x); //if char = c and n = 3 output == f how do i use assert statements as this does not work assert (caesar(3,c)==f);arrow_forwardIn C++ fill in the blanksarrow_forward
- In Haskell: Code a function "rangeProduct" that takes two arguments. The function should return 0 if the second argument is smaller than the first, otherwise it should return the product of the range between two numbers, ex: rangeProduct 3 5 --> 60 (because 3*4*5 = 60) What to do for negative numbers to do (if anything) is up to you. Write the program without recursion first and then write it with recursion.arrow_forwardIn C++arrow_forwardStudent survey data: Hours studied Last exam grade 3 60 4 62 7 89 65 Last exam passed with 65. Which of these describes a valid data analysis process and the information it can reveal? Classification analysis can determine how many students passed the exam after studying less than 3 hours. Cluster analysis could identify students who failed the exam after studying for more than five hours. Association rule mining can identify groups of students with similar exam scores and study hours. Anomaly detection could tell how many hours a student who passed the exam studied.arrow_forward
- C programmingarrow_forwardI'm trying to create a c program that will take in a ten-digit ISBN number and then check to see if the number is valid by calculating its weighted sum. This is the code that I have up to know, but I'm not sure what to do next. Can you give me some pointers? DOCUMENTATION-------------This program will determine if an ISBN number is valid by calculating its weighted sum.********************************************************************/#include <stdio.h>#include <stdbool.h> #define ISBN_SIZE 10#define MOD_NUM 11 void printInstructions(void);void getIsbn(int isbnArray[]);void printIsbn(int isbnArray[]);int calculateWeightedSum(int isbnArray[]);bool isIsbnValid(weightedSum);void printGoodbye(void); int main(){int isbnArray[ISBN_SIZE] = {0}; printInstructions();getIsbn(isbnArray); printf("\n\nThe ISBN ");printIsbn(isbnArray); if(isIsbnValid(calculateWeightedSum(isbnArray))){printf(" is valid.");}else{printf(" is not valid.");} printGoodbye(); return 0;}…arrow_forwardThis assignment will give you practice on basic C programming. You will implement a few Cprogramsarrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

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