	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_R_SortVisSprites               ## -- Begin function R_SortVisSprites
	.p2align	4, 0x90
_R_SortVisSprites:                      ## @R_SortVisSprites
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	.cfi_offset %rbx, -24
	movq	_vissprite_p@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rsi
	movq	_vissprites@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	%rsi, %rax
	subq	%rdi, %rax
	shrq	$3, %rax
	imull	$-1431655765, %eax, %r9d        ## imm = 0xAAAAAAAB
	testl	%r9d, %r9d
	je	LBB0_10
## %bb.1:
	cmpq	%rsi, %rdi
	jae	LBB0_4
## %bb.2:
	leaq	24(%rdi), %rax
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rax, -8(%rax)
	leaq	-48(%rax), %rcx
	movq	%rcx, -16(%rax)
	leaq	24(%rax), %rcx
	cmpq	%rsi, %rax
	movq	%rcx, %rax
	jb	LBB0_3
LBB0_4:
	leaq	-32(%rbp), %rcx
	movq	%rcx, 8(%rdi)
	movq	%rdi, -16(%rbp)
	movq	%rcx, -8(%rsi)
	movq	(%rdx), %rax
	addq	$-24, %rax
	movq	%rax, -24(%rbp)
	movq	_vsprsortedhead@GOTPCREL(%rip), %r10
	movq	%r10, 8(%r10)
	movq	%r10, 16(%r10)
	testl	%r9d, %r9d
	jle	LBB0_10
## %bb.5:
	movq	_MAXINT@GOTPCREL(%rip), %rax
	movq	(%rax), %r8
	xorl	%r11d, %r11d
                                        ## implicit-def: $rsi
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	8(%rsi), %rax
	movq	16(%rsi), %rdx
	movq	%rax, 8(%rdx)
	movq	8(%rsi), %rax
	movq	%rdx, 16(%rax)
	movq	%r10, 16(%rsi)
	movq	8(%r10), %rax
	movq	%rax, 8(%rsi)
	movq	8(%r10), %rax
	movq	%rsi, 16(%rax)
	movq	%rsi, 8(%r10)
	incl	%r11d
	cmpl	%r9d, %r11d
	je	LBB0_10
LBB0_6:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
	movq	-16(%rbp), %rdx
	cmpq	%rcx, %rdx
	je	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%r8, %rax
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_6 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%rdx), %rdi
	cmpq	%rax, %rdi
	cmovlq	%rdx, %rsi
	movq	16(%rdx), %rbx
	cmovlq	%rdi, %rax
	movq	%rbx, %rdx
	cmpq	%rcx, %rbx
	jne	LBB0_8
	jmp	LBB0_9
LBB0_10:
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_vissprite_p,8,3                ## @vissprite_p
	.comm	_vissprites,8,3                 ## @vissprites
	.comm	_vsprsortedhead,24,3            ## @vsprsortedhead
	.comm	_MAXINT,8,3                     ## @MAXINT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_R_SortVisSprites               ; -- Begin function R_SortVisSprites
	.p2align	2
_R_SortVisSprites:                      ; @R_SortVisSprites
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #32
	.cfi_def_cfa_offset 32
Lloh0:
	adrp	x9, _vissprite_p@GOTPAGE
Lloh1:
	ldr	x9, [x9, _vissprite_p@GOTPAGEOFF]
Lloh2:
	adrp	x8, _vissprites@GOTPAGE
Lloh3:
	ldr	x8, [x8, _vissprites@GOTPAGEOFF]
	ldr	x10, [x9]
Lloh4:
	ldr	x11, [x8]
	sub	x8, x10, x11
	lsr	x8, x8, #3
	mov	w12, #43691
	movk	w12, #43690, lsl #16
	mul	w8, w8, w12
	cbz	w8, LBB0_14
; %bb.1:
	cmp	x11, x10
	b.hs	LBB0_8
; %bb.2:
	add	x12, x11, #24
	cmp	x10, x12
	csel	x12, x10, x12, hi
	sub	x12, x12, #24
	cmp	x12, x11
	cinc	x13, x11, ne
	sub	x13, x12, x13
	cmp	x12, x11
	mov	x12, #-6148914691236517206
	movk	x12, #43691
	umulh	x12, x13, x12
	lsr	x12, x12, #4
	cinc	x13, x12, ne
	mov	x12, x11
	cmp	x13, #3
	b.lo	LBB0_6
; %bb.3:
	add	x13, x13, #1
	and	x14, x13, #0x3ffffffffffffffc
	mov	w12, #24
	madd	x12, x14, x12, x11
	add	x15, x11, #96
	mov	x16, x14
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	sub	x17, x15, #72
	sub	x0, x15, #48
	sub	x1, x15, #120
	stp	x1, x17, [x15, #-88]
	sub	x1, x15, #24
	sub	x2, x15, #96
	stp	x2, x0, [x15, #-64]
	stp	x17, x1, [x15, #-40]
	stp	x0, x15, [x15, #-16]
	add	x15, x15, #96
	subs	x16, x16, #4
	b.ne	LBB0_4
; %bb.5:
	cmp	x13, x14
	b.eq	LBB0_8
LBB0_6:
	add	x12, x12, #24
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	sub	x13, x12, #48
	stp	x13, x12, [x12, #-16]
	add	x13, x12, #24
	cmp	x12, x10
	mov	x12, x13
	b.lo	LBB0_7
LBB0_8:
	add	x12, sp, #8
	str	x12, [x11, #8]
	str	x11, [sp, #24]
	stur	x12, [x10, #-8]
	ldr	x9, [x9]
	sub	x9, x9, #24
	str	x9, [sp, #16]
Lloh5:
	adrp	x9, _vsprsortedhead@GOTPAGE
Lloh6:
	ldr	x9, [x9, _vsprsortedhead@GOTPAGEOFF]
	stp	x9, x9, [x9, #8]
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.9:
	mov	w10, #0
Lloh7:
	adrp	x11, _MAXINT@GOTPAGE
Lloh8:
	ldr	x11, [x11, _MAXINT@GOTPAGEOFF]
Lloh9:
	ldr	x11, [x11]
                                        ; implicit-def: $x13
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	ldp	x14, x15, [x13, #8]
	str	x14, [x15, #8]
	ldr	x14, [x13, #8]
	str	x15, [x14, #16]
	ldr	x14, [x9, #8]
	stp	x14, x9, [x13, #8]
	ldr	x14, [x9, #8]
	str	x13, [x14, #16]
	str	x13, [x9, #8]
	add	w10, w10, #1
	cmp	w10, w8
	b.eq	LBB0_14
LBB0_11:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_13 Depth 2
	ldr	x14, [sp, #24]
	cmp	x14, x12
	b.eq	LBB0_10
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x15, x11
LBB0_13:                                ;   Parent Loop BB0_11 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x16, [x14]
	cmp	x16, x15
	csel	x13, x14, x13, lt
	csel	x15, x16, x15, lt
	ldr	x14, [x14, #16]
	cmp	x14, x12
	b.ne	LBB0_13
	b	LBB0_10
LBB0_14:
	add	sp, sp, #32
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_vissprite_p,8,3                ; @vissprite_p
	.comm	_vissprites,8,3                 ; @vissprites
	.comm	_vsprsortedhead,24,3            ; @vsprsortedhead
	.comm	_MAXINT,8,3                     ; @MAXINT
.subsections_via_symbols
