what is this assembly code of C is doing, can anyone explain?   0x00000000004014dc <+0>:     sub    $0x8,%rsp     0x00000000004014e0 <+4>:     cmpb   $0x41,(%rdi)    0x00000000004014e3 <+7>:     jne    0x40151c   0x00000000004014e5 <+9>:     cmpb   $0x2e,0x1(%rdi)             0x00000000004014e9 <+13>:    jne    0x40151c   0x00000000004014eb <+15>:    cmpb   $0x71,0x3(%rdi)             0x00000000004014ef <+19>:    jne    0x40151c    0x00000000004014f1 <+21>:    cmpb   $0x4b,0x4(%rdi)             0x00000000004014f5 <+25>:    jne    0x40151c   0x00000000004014f7 <+27>:    cmpb   $0x63,0x2(%rdi)            0x00000000004014fb <+31>:    je     0x40152a   0x00000000004014fd <+33>:    cmp    %cl,0x1f(%rdi)             0x0000000000401500 <+36>:    jne    0x40151c   0x0000000000401502 <+38>:    movzbl 0x28(%rdi),%ecx             0x0000000000401506 <+42>:    movzbl 0x16(%rdi),%eax            0x000000000040150a <+46>:    cmp    %al,%cl                   0x000000000040150c <+48>:    je     0x40151c 0x000000000040150e <+50>:    or     $0xe,%eax                 0x0000000000401511 <+53>:    mov    %eax,%edx                  0x0000000000401513 <+55>:    mov    $0x1,%eax                 0x0000000000401518 <+60>:    cmp    %dl,%cl                   0x000000000040151a <+62>:    je     0x40152f 0x000000000040151c <+64>:    callq  0x401e54 0x0000000000401521 <+69>:    mov    $0xfffffffffe7ed1e5,%rax     0x0000000000401528 <+76>:    jmp    0x40152f   0x000000000040152a <+78>:    mov    $0x0,%eax    0x000000000040152f <+83>:    add    $0x8,%rsp     0x0000000000401533 <+87>:    retq

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
icon
Related questions
Question

what is this assembly code of C is doing, can anyone explain?

 

0x00000000004014dc <+0>:     sub    $0x8,%rsp    
0x00000000004014e0 <+4>:     cmpb   $0x41,(%rdi)   
0x00000000004014e3 <+7>:     jne    0x40151c <bombphase_1+64> 
0x00000000004014e5 <+9>:     cmpb   $0x2e,0x1(%rdi)            
0x00000000004014e9 <+13>:    jne    0x40151c <bombphase_1+64>  
0x00000000004014eb <+15>:    cmpb   $0x71,0x3(%rdi)            
0x00000000004014ef <+19>:    jne    0x40151c <bombphase_1+64>   
0x00000000004014f1 <+21>:    cmpb   $0x4b,0x4(%rdi)            
0x00000000004014f5 <+25>:    jne    0x40151c <bombphase_1+64> 
0x00000000004014f7 <+27>:    cmpb   $0x63,0x2(%rdi)           
0x00000000004014fb <+31>:    je     0x40152a <bombphase_1+78> 
0x00000000004014fd <+33>:    cmp    %cl,0x1f(%rdi)            
0x0000000000401500 <+36>:    jne    0x40151c <bombphase_1+64>  
0x0000000000401502 <+38>:    movzbl 0x28(%rdi),%ecx            
0x0000000000401506 <+42>:    movzbl 0x16(%rdi),%eax           
0x000000000040150a <+46>:    cmp    %al,%cl                  
0x000000000040150c <+48>:    je     0x40151c <bombphase_1+64>
0x000000000040150e <+50>:    or     $0xe,%eax                
0x0000000000401511 <+53>:    mov    %eax,%edx                 
0x0000000000401513 <+55>:    mov    $0x1,%eax                
0x0000000000401518 <+60>:    cmp    %dl,%cl                  
0x000000000040151a <+62>:    je     0x40152f <bombphase_1+83>
0x000000000040151c <+64>:    callq  0x401e54 <explosion_begins>
0x0000000000401521 <+69>:    mov    $0xfffffffffe7ed1e5,%rax    
0x0000000000401528 <+76>:    jmp    0x40152f <bombphase_1+83>  
0x000000000040152a <+78>:    mov    $0x0,%eax   
0x000000000040152f <+83>:    add    $0x8,%rsp    

0x0000000000401533 <+87>:    retq 

Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Fundamentals of Computer System
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
Recommended textbooks for you
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education