;;; Produced with gcc -O1 -S hello-loop.c

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 11, 0	sdk_version 12, 1
	.globl	_main                           ; -- Begin function main
	.p2align	2
_main:                                  ; @main
	.cfi_startproc
											       ; %bb.0:
;;; SB: Note the saving of callee-saved registers x19 and x20:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16                    ; =16
;;; SB: These .cfi lines will be compiled into DWARF exception-handling information and packaged with the executable
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
;;; x20 will be used as the sole location for the loop counter "i" without any stack allocation.
	mov	w20, #-11		        ; SB: the loop counts up from -11 to 0 
Lloh0:
	adrp	x19, l_.str@PAGE
Lloh1:
	add	x19, x19, l_.str@PAGEOFF
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_puts
	adds	w20, w20, #1                    ; =1
	b.lo	LBB0_1				; SB: "LO" means that the carry flag is 0.
	;; SB: When adding 1 to negative numbers, the carry flag will first become
	;;     non-zero when adding 1 to 0xFF..FF (-1) produces 0. Tricky, but efficient.  

; %bb.2:
	mov	w0, #42	  			; SB: our return value from main
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
;;; SB: Callee saved registers now restored:
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Hello"

.subsections_via_symbols
