.file "duff-2.c" .section ".text" .align 4 .global cksum .type cksum, #function .proc 04 cksum: !#PROLOGUE# 0 !#PROLOGUE# 1 and %o1, 3, %g1 cmp %g1, 1 be .LL9 mov 0, %g2 cmp %g1, 1 blu,a .LL13 ldub [%o0], %g1 cmp %g1, 2 be .LL8 cmp %g1, 3 bne .LL2 nop .LL7: ldub [%o0], %g1 add %o1, -1, %o1 sll %g1, 16, %g1 add %o0, 1, %o0 xor %g2, %g1, %g2 .LL8: ldub [%o0], %g1 add %o1, -1, %o1 sll %g1, 8, %g1 add %o0, 1, %o0 xor %g2, %g1, %g2 .LL9: ldub [%o0], %g1 addcc %o1, -1, %o1 xor %g2, %g1, %g2 be .LL2 add %o0, 1, %o0 ldub [%o0], %g1 .LL13: add %o1, -1, %o1 sll %g1, 24, %g1 add %o0, 1, %o0 b .LL7 xor %g2, %g1, %g2 .LL2: retl mov %g2, %o0 .size cksum, .-cksum .global testpat .section ".rodata" .align 8 .type testpat, #object .size testpat, 46 testpat: .asciz "The quick brown fox jumped over the lazy dog." .section ".text" .align 4 .global main .type main, #function .proc 04 main: !#PROLOGUE# 0 save %sp, -104, %sp !#PROLOGUE# 1 sethi %hi(testpat), %o0 mov 46, %o1 call cksum, 0 or %o0, %lo(testpat), %o0 sethi %hi(925902848), %g1 or %g1, 60, %g1 cmp %o0, %g1 be .LL15 nop call abort, 0 nop .LL15: call exit, 0 mov 0, %o0 nop .size main, .-main .ident "GCC: (GNU) 3.3.2"