65816-llvm-mos/compare/sumSquares.ours.s
Scott Duensing 42f0d16d07 Checkpoint
2026-05-13 20:54:28 -05:00

76 lines
1.5 KiB
ArmAsm

.file "sumSquares.c"
.text
.globl sumSquares ; -- Begin function sumSquares
.type sumSquares,@function
sumSquares: ; @sumSquares
; %bb.0: ; %entry
rep #0x30
tay
tsc
sec
sbc #0xc
tcs
tya
sta 0x5, s
lda #0x0
sta 0x3, s
sta 0x1, s
lda 0x5, s
bne .LBB0_1
; %bb.6: ; %entry
brl .LBB0_5
.LBB0_1: ; %for.body.preheader
lda 0x5, s
inc a
sta 0x5, s
cmp #0x3
bcs .LBB0_3
; %bb.2: ; %for.body.preheader
lda #0x2
sta 0x5, s
.LBB0_3: ; %for.body.preheader
lda #0x1
sta 0x7, s
lda 0x5, s
dec a
sta 0x5, s
lda #0x0
sta 0x1, s
.LBB0_4: ; %for.body
; =>This Inner Loop Header: Depth=1
lda 0x7, s
pha
jsl __umulhisi3
ply
clc
adc 0x3, s
sta 0x3, s
txa
adc 0x1, s
sta 0x1, s
lda 0x7, s
inc a
sta 0x7, s
lda 0x5, s
dec a
sta 0x5, s
beq .LBB0_5
bra .LBB0_4
.LBB0_5: ; %for.cond.cleanup
lda 0x1, s
tax
lda 0x3, s
tay
tsc
clc
adc #0xc
tcs
tya
rtl
.Lfunc_end0:
.size sumSquares, .Lfunc_end0-sumSquares
; -- End function
.ident "clang version 23.0.0git (https://github.com/llvm-mos/llvm-mos.git c798c31416f72b395c658b5502d281a162387ab1)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym __umulhisi3