Question
Hello, can anyone solve this assembly code. I need to find the correct inputs Breakpoint 1, 0x0000000000400f94 in phase_4 () (gdb) disas Dump of assembler
Hello, can anyone solve this assembly code. I need to find the correct inputs
Breakpoint 1, 0x0000000000400f94 in phase_4 () (gdb) disas Dump of assembler code for function phase_4: => 0x0000000000400f94 <+0>: sub $0x18,%rsp 0x0000000000400f98 <+4>: lea 0x8(%rsp),%rcx 0x0000000000400f9d <+9>: lea 0xc(%rsp),%rdx 0x0000000000400fa2 <+14>: mov $0x40272d,%esi 0x0000000000400fa7 <+19>: mov $0x0,%eax 0x0000000000400fac <+24>: callq 0x400b90 <__isoc99_sscanf@plt> 0x0000000000400fb1 <+29>: cmp $0x2,%eax 0x0000000000400fb4 <+32>: jne 0x400fbd 0x0000000000400fb6 <+34>: cmpl $0xe,0xc(%rsp) 0x0000000000400fbb <+39>: jbe 0x400fc2 0x0000000000400fbd <+41>: callq 0x4014b2 0x0000000000400fc2 <+46>: mov $0xe,%edx 0x0000000000400fc7 <+51>: mov $0x0,%esi 0x0000000000400fcc <+56>: mov 0xc(%rsp),%edi 0x0000000000400fd0 <+60>: callq 0x400f60 0x0000000000400fd5 <+65>: cmp $0x1f,%eax 0x0000000000400fd8 <+68>: jne 0x400fe1 0x0000000000400fda <+70>: cmpl $0x1f,0x8(%rsp) 0x0000000000400fdf <+75>: je 0x400fe6 0x0000000000400fe1 <+77>: callq 0x4014b2 0x0000000000400fe6 <+82>: add $0x18,%rsp 0x0000000000400fea <+86>: retq
Dump of assembler code for function func4: => 0x0000000000400f60 <+0>: push %rbx 0x0000000000400f61 <+1>: mov %edx,%eax 0x0000000000400f63 <+3>: sub %esi,%eax 0x0000000000400f65 <+5>: mov %eax,%ebx 0x0000000000400f67 <+7>: shr $0x1f,%ebx 0x0000000000400f6a <+10>: add %eax,%ebx 0x0000000000400f6c <+12>: sar %ebx 0x0000000000400f6e <+14>: add %esi,%ebx 0x0000000000400f70 <+16>: cmp %edi,%ebx 0x0000000000400f72 <+18>: jg 0x400f7c0x0000000000400f74 <+20>: cmp %edi,%ebx 0x0000000000400f76 <+22>: jl 0x400f88 0x0000000000400f78 <+24>: mov %ebx,%eax 0x0000000000400f7a <+26>: pop %rbx 0x0000000000400f7b <+27>: retq 0x0000000000400f7c <+28>: lea -0x1(%rbx),%edx 0x0000000000400f7f <+31>: callq 0x400f60 0x0000000000400f84 <+36>: add %eax,%ebx 0x0000000000400f86 <+38>: jmp 0x400f78 0x0000000000400f88 <+40>: lea 0x1(%rbx),%esi 0x0000000000400f8b <+43>: callq 0x400f60 0x0000000000400f90 <+48>: add %eax,%ebx 0x0000000000400f92 <+50>: jmp 0x400f78
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started