1.global memset 2.type memset,@function 3memset: 4 movzbq %sil,%rax 5 mov $0x101010101010101,%r8 6 imul %r8,%rax 7 8 cmp $126,%rdx 9 ja 2f 10 11 test %edx,%edx 12 jz 1f 13 14 mov %sil,(%rdi) 15 mov %sil,-1(%rdi,%rdx) 16 cmp $2,%edx 17 jbe 1f 18 19 mov %ax,1(%rdi) 20 mov %ax,(-1-2)(%rdi,%rdx) 21 cmp $6,%edx 22 jbe 1f 23 24 mov %eax,(1+2)(%rdi) 25 mov %eax,(-1-2-4)(%rdi,%rdx) 26 cmp $14,%edx 27 jbe 1f 28 29 mov %rax,(1+2+4)(%rdi) 30 mov %rax,(-1-2-4-8)(%rdi,%rdx) 31 cmp $30,%edx 32 jbe 1f 33 34 mov %rax,(1+2+4+8)(%rdi) 35 mov %rax,(1+2+4+8+8)(%rdi) 36 mov %rax,(-1-2-4-8-16)(%rdi,%rdx) 37 mov %rax,(-1-2-4-8-8)(%rdi,%rdx) 38 cmp $62,%edx 39 jbe 1f 40 41 mov %rax,(1+2+4+8+16)(%rdi) 42 mov %rax,(1+2+4+8+16+8)(%rdi) 43 mov %rax,(1+2+4+8+16+16)(%rdi) 44 mov %rax,(1+2+4+8+16+24)(%rdi) 45 mov %rax,(-1-2-4-8-16-32)(%rdi,%rdx) 46 mov %rax,(-1-2-4-8-16-24)(%rdi,%rdx) 47 mov %rax,(-1-2-4-8-16-16)(%rdi,%rdx) 48 mov %rax,(-1-2-4-8-16-8)(%rdi,%rdx) 49 501: mov %rdi,%rax 51 ret 52 532: test $15,%edi 54 mov %rdi,%r8 55 mov %rax,-8(%rdi,%rdx) 56 mov %rdx,%rcx 57 jnz 2f 58 591: shr $3,%rcx 60 rep 61 stosq 62 mov %r8,%rax 63 ret 64 652: xor %edx,%edx 66 sub %edi,%edx 67 and $15,%edx 68 mov %rax,(%rdi) 69 mov %rax,8(%rdi) 70 sub %rdx,%rcx 71 add %rdx,%rdi 72 jmp 1b 73