#include <stdio.h>
#include <stdint.h>
int64_t testregs(int a, int b, int c, int d, int e, int f, int g, int h);
int64_t testregs(int a, int b, int c, int d, int e, int f, int g, int h)
{
int64_t result;
result = a + b;
result -= c;
result *= e;
result /= f;
result += g;
result -= h;
return result;
}
int main(int argc, char **argv)
{
int64_t rr;
rr = testregs(3, 4, 5, 6, 2, 8, 9, 7);
printf("rr = %ld\n", rr);
return 0;
}
000000000040059a <main>:
40059a: 55 push %rbp
40059b: 48 89 e5 mov %rsp,%rbp
40059e: 48 83 ec 30 sub $0x30,%rsp
4005a2: 89 7d ec mov %edi,-0x14(%rbp)
4005a5: 48 89 75 e0 mov %rsi,-0x20(%rbp)
4005a9: c7 44 24 08 07 00 00 movl $0x7,0x8(%rsp)
4005b0: 00
4005b1: c7 04 24 09 00 00 00 movl $0x9,(%rsp)
4005b8: 41 b9 08 00 00 00 mov $0x8,%r9d
4005be: 41 b8 02 00 00 00 mov $0x2,%r8d
4005c4: b9 06 00 00 00 mov $0x6,%ecx
4005c9: ba 05 00 00 00 mov $0x5,%edx
4005ce: be 04 00 00 00 mov $0x4,%esi
4005d3: bf 03 00 00 00 mov $0x3,%edi
4005d8: e8 50 ff ff ff callq 40052d <testregs>
4005dd: 48 89 45 f8 mov %rax,-0x8(%rbp)
4005e1: 48 8b 45 f8 mov -0x8(%rbp),%rax
4005e5: 48 89 c6 mov %rax,%rsi
4005e8: bf 84 06 40 00 mov $0x400684,%edi
4005ed: b8 00 00 00 00 mov $0x0,%eax
4005f2: e8 19 fe ff ff callq 400410 <printf@plt>
4005f7: b8 00 00 00 00 mov $0x0,%eax
4005fc: c9 leaveq
4005fd: c3 retq
4005fe: 66 90 xchg %ax,%ax
000000000040052d <testregs>:
40052d: 55 push %rbp
40052e: 48 89 e5 mov %rsp,%rbp
400531: 53 push %rbx
400532: 89 7d e4 mov %edi,-0x1c(%rbp)
400535: 89 75 e0 mov %esi,-0x20(%rbp)
400538: 89 55 dc mov %edx,-0x24(%rbp)
40053b: 89 4d d8 mov %ecx,-0x28(%rbp)
40053e: 44 89 45 d4 mov %r8d,-0x2c(%rbp)
400542: 44 89 4d d0 mov %r9d,-0x30(%rbp)
400546: 8b 45 e0 mov -0x20(%rbp),%eax
400549: 8b 55 e4 mov -0x1c(%rbp),%edx
40054c: 01 d0 add %edx,%eax
40054e: 48 98 cltq
400550: 48 89 45 f0 mov %rax,-0x10(%rbp)
400554: 8b 45 dc mov -0x24(%rbp),%eax
400557: 48 98 cltq
400559: 48 29 45 f0 sub %rax,-0x10(%rbp)
40055d: 8b 45 d4 mov -0x2c(%rbp),%eax
400560: 48 98 cltq
400562: 48 8b 55 f0 mov -0x10(%rbp),%rdx
400566: 48 0f af c2 imul %rdx,%rax
40056a: 48 89 45 f0 mov %rax,-0x10(%rbp)
40056e: 8b 45 d0 mov -0x30(%rbp),%eax
400571: 48 63 d8 movslq %eax,%rbx
400574: 48 8b 45 f0 mov -0x10(%rbp),%rax
400578: 48 99 cqto
40057a: 48 f7 fb idiv %rbx
40057d: 48 89 45 f0 mov %rax,-0x10(%rbp)
400581: 8b 45 10 mov 0x10(%rbp),%eax
400584: 48 98 cltq
400586: 48 01 45 f0 add %rax,-0x10(%rbp)
40058a: 8b 45 18 mov 0x18(%rbp),%eax
40058d: 48 98 cltq
40058f: 48 29 45 f0 sub %rax,-0x10(%rbp)
400593: 48 8b 45 f0 mov -0x10(%rbp),%rax
400597: 5b pop %rbx
400598: 5d pop %rbp
400599: c3 retq