Question: (Translate from Assembly to C) Rewrite the print_mat function in C. Write the function's prototype and all code contained within. Don't forget about arguments and

(Translate from Assembly to C) Rewrite the print_mat function in C. Write the function's prototype and all code contained within. Don't forget about arguments and local variable definitions:

push rbp mov rbp,rsp sub rsp,0x30 mov QWORD PTR [rbp-0x18],rdi mov QWORD PTR [rbp-0x20],rsi mov QWORD PTR [rbp-0x28],rdx mov QWORD PTR [rbp-0x8],0x0 mov QWORD PTR [rbp-0x10],0x0 jmp 4008f6 <+0x94> mov edi,0x4009cd ; "[ " mov eax,0x0 call 4004f0 mov QWORD PTR [rbp-0x8],0x0 jmp 4008dd mov rax,QWORD PTR [rbp-0x10] imul rax,QWORD PTR [rbp-0x20] mov rdx,rax mov rax,QWORD PTR [rbp-0x8] add rax,rdx lea rdx,[rax*8+0x0] mov rax,QWORD PTR [rbp-0x18] add rax,rdx mov rax,QWORD PTR [rax] mov rsi,rax mov edi,0x4009d0 ; "%#10lx " mov eax,0x0 call 4004f0 add QWORD PTR [rbp-0x8],0x1 mov rax,QWORD PTR [rbp-0x8] cmp rax,QWORD PTR [rbp-0x28] jb 4008a1 mov edi,0x4009d8 ; "] " call 4004d0 add QWORD PTR [rbp-0x10],0x1 mov rax,QWORD PTR [rbp-0x10] cmp rax,QWORD PTR [rbp-0x20] jb 400888 nop leave ret nop WORD PTR cs:[rax+rax*1+0x0] nop DWORD PTR [rax]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!