1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
|
.file "test.cc"
.text
.p2align 4,,15
.globl __Z13sum_of_digitsi
.def __Z13sum_of_digitsi; .scl 2; .type 32; .endef
__Z13sum_of_digitsi:
pushl %esi
pushl %ebx
movl 12(%esp), %ecx
xorl %ebx, %ebx
cmpl $9, %ecx
jle L2
movl $1717986919, %esi
.p2align 4,,7
L3:
movl %ecx, %eax
imull %esi
movl %ecx, %eax
sarl $31, %eax
sarl $2, %edx
subl %eax, %edx
movl %edx, %eax
leal (%edx,%edx,4), %edx
addl %edx, %edx
subl %edx, %ecx
movl %ecx, %edx
movl %eax, %ecx
addl %edx, %ebx
cmpl $9, %eax
jg L3
L2:
leal (%ebx,%ecx), %eax
popl %ebx
popl %esi
ret
.p2align 4,,15
.globl __Z16is_perfect_primei
.def __Z16is_perfect_primei; .scl 2; .type 32; .endef
__Z16is_perfect_primei:
pushl %esi
movl $1717986919, %esi
pushl %ebx
movl 12(%esp), %ebx
cmpl $9, %ebx
jle L9
L11:
cmpl $4, %ebx
jle L13
testb $1, %bl
je L20
movl $2, %ecx
jmp L14
.p2align 4,,7
L15:is_perfect_prime
movl %ebx, %eax
cltd
idivl %ecx
testl %edx, %edx
je L20
L14:
addl $1, %ecx
movl %ecx, %eax
imull %ecx, %eax
cmpl %ebx, %eax
jl L15
L13:
xorl %ecx, %ecx
.p2align 4,,7
L18:
movl %ebx, %eax
imull %esi
movl %ebx, %eax
sarl $31, %eax
sarl $2, %edx
subl %eax, %edx
movl %edx, %eax
leal (%edx,%edx,4), %edx
addl %edx, %edx
subl %edx, %ebx
movl %ebx, %edx
movl %eax, %ebx
addl %edx, %ecx
cmpl $9, %eax
jg L18
addl %ecx, %ebx
cmpl $9, %ebx
jg L11
L9:
leal -2(%ebx), %eax
cmpl $1, %eax
setbe %dl
cmpl $5, %ebx
sete %al
orb %dl, %al
jne L21
cmpl $7, %ebx
sete %al
jmp L21
.p2align 4,,7
L20:
xorl %eax, %eax
L21:
popl %ebx
popl %esi
ret
.ident "GCC: (GNU) 4.9.0 20130901 (experimental)"
|