**factorial exercise** ~~~~~~~~~~~~~~~~~~~~~~~~~ int fact(int n) { int r = 1; while(n > 1) r *= n; n--; } return r; } ~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~ <fact>: 0x400616: mov $0x1,%eax 0x40061b: jmp 0x400623 <fact+0xd> 0x40061d: imul %edi,%eax 0x400620: sub $0x1,%edi 0x400623: cmp $0x1,%edi 0x400626: jg 0x40061d <fact+0x7> 0x400628: retq ~~~~~~~~~~~~~~~~~~~~~~~~~ Trace the series of instructions that result from the call `fact(3)`. Give the register values and condition codes that exist at each `jg` instruction. __Answer__: ````````````````````````````````````x86asm 01: mov $0x1,%eax 02: jmp 0x400623 <fact+0xd> 03: cmp $0x1,%edi 04: jg 0x40061d <fact+0x7> 05: imul %edi,%eax 06: sub $0x1,%edi 07: cmp $0x1,%edi 08: jg 0x40061d <fact+0x7> 09: imul %edi,%eax 10: sub $0x1,%edi 11: cmp $0x1,%edi 12: jg 0x40061d <fact+0x7> 13: retq ```````````````````````````````````` _registers and condition codes at instruction `04`:_ * `%eax` <== 1 * `%edi` <== 3 * ZF <== 0 * SF <== 0 * OF <== 0 _registers and condition codes at instruction `08`:_ * `%eax` <== 3 * `%edi` <== 2 * ZF <== 0 * SF <== 0 * OF <== 0 _registers and condition codes at instruction `12`:_ * `%eax` <== 6 * `%edi` <== 1 * ZF <== 1 * SF <== 0 * OF <== 0