Skip to content

Instantly share code, notes, and snippets.

@jimblandy
Created July 27, 2016 05:29
Show Gist options
  • Save jimblandy/7028a3acce8453944ec285f667293b4f to your computer and use it in GitHub Desktop.
Save jimblandy/7028a3acce8453944ec285f667293b4f to your computer and use it in GitHub Desktop.
fn t(n: usize) -> usize { (0..n+1).fold(0, |s, i| s+i*i*i) }
5828: 49 83 fa ff cmp $0xffffffffffffffff,%r10
582c: 74 5d je 588b <_ZN8triangle4main17h1e5682daf508becbE+0x11b>
582e: 49 8d 42 ff lea -0x1(%r10),%rax
5832: 49 f7 e2 mul %r10
5835: 49 89 c0 mov %rax,%r8
5838: 49 89 d1 mov %rdx,%r9
583b: 49 8d 72 fe lea -0x2(%r10),%rsi
583f: 48 f7 e6 mul %rsi
5842: 48 89 c7 mov %rax,%rdi
5845: 48 89 d3 mov %rdx,%rbx
5848: 89 f0 mov %esi,%eax
584a: 41 0f af c1 imul %r9d,%eax
584e: 4d 0f a4 c1 3f shld $0x3f,%r8,%r9
5853: 4a 8d 34 cd 00 00 00 lea 0x0(,%r9,8),%rsi
585a: 00
585b: 4c 29 ce sub %r9,%rsi
585e: 01 c3 add %eax,%ebx
5860: 4d 8d 42 fd lea -0x3(%r10),%r8
5864: 48 89 f8 mov %rdi,%rax
5867: 49 f7 e0 mul %r8
586a: 44 89 c1 mov %r8d,%ecx
586d: 0f af cb imul %ebx,%ecx
5870: 01 ca add %ecx,%edx
5872: 48 0f a4 c2 3e shld $0x3e,%rax,%rdx
5877: 48 83 e2 fe and $0xfffffffffffffffe,%rdx
587b: 48 01 ff add %rdi,%rdi
587e: 48 83 e7 fc and $0xfffffffffffffffc,%rdi
5882: 4c 01 d6 add %r10,%rsi
5885: 48 01 fe add %rdi,%rsi
5888: 48 01 d6 add %rdx,%rsi
588b: ... and use %rsi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment