	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_R_SortDrawSurfs                ## -- Begin function R_SortDrawSurfs
	.p2align	4, 0x90
_R_SortDrawSurfs:                       ## @R_SortDrawSurfs
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	testl	%esi, %esi
	jle	LBB0_10
## %bb.1:
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_R_RadixSort
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movl	%r14d, %r12d
	shlq	$2, %r12
	xorl	%r13d, %r13d
	movq	_SS_PORTAL@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx,%r13), %edi
	leaq	-48(%rbp), %rsi
	leaq	-56(%rbp), %rdx
	leaq	-64(%rbp), %rcx
	leaq	-60(%rbp), %r8
	callq	_R_DecomposeSort
	movq	-56(%rbp), %rax
	movq	(%rax), %rcx
	cmpq	(%r14), %rcx
	jg	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	leaq	(%rbx,%r13), %r15
	movq	_SS_BAD@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_ERR_DROP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	8(%rax), %edx
	leaq	L_.str(%rip), %rsi
	movq	_ri@GOTPCREL(%rip), %rax
	callq	*(%rax)
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	-48(%rbp), %esi
	movq	%r15, %rdi
	callq	_R_MirrorViewBySurface
	testq	%rax, %rax
	jne	LBB0_7
## %bb.2:                               ##   in Loop: Header=BB0_3 Depth=1
	addq	$4, %r13
	cmpq	%r13, %r12
	jne	LBB0_3
	jmp	LBB0_8
LBB0_10:
	movq	%rbx, %rdi
	movl	%r14d, %esi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_R_AddDrawSurfCmd               ## TAILCALL
LBB0_7:
	movq	_r_portalOnly@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	$0, (%rax)
	jne	LBB0_9
LBB0_8:
	movq	%rbx, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_R_AddDrawSurfCmd
LBB0_9:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SS_PORTAL,8,3                  ## @SS_PORTAL
	.comm	_SS_BAD,8,3                     ## @SS_BAD
	.comm	_ri,8,3                         ## @ri
	.comm	_ERR_DROP,4,2                   ## @ERR_DROP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Shader '%s'with sort == SS_BAD"

	.comm	_r_portalOnly,8,3               ## @r_portalOnly
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_R_SortDrawSurfs                ; -- Begin function R_SortDrawSurfs
	.p2align	2
_R_SortDrawSurfs:                       ; @R_SortDrawSurfs
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x1
	mov	x20, x0
	cmp	w1, #0
	b.le	LBB0_7
; %bb.1:
	mov	x0, x20
	mov	x1, x19
	bl	_R_RadixSort
	mov	x23, #0
	mov	w8, w19
	lsl	x24, x8, #2
Lloh0:
	adrp	x25, _SS_PORTAL@GOTPAGE
Lloh1:
	ldr	x25, [x25, _SS_PORTAL@GOTPAGEOFF]
Lloh2:
	adrp	x26, _SS_BAD@GOTPAGE
Lloh3:
	ldr	x26, [x26, _SS_BAD@GOTPAGEOFF]
Lloh4:
	adrp	x27, _ri@GOTPAGE
Lloh5:
	ldr	x27, [x27, _ri@GOTPAGEOFF]
Lloh6:
	adrp	x28, _ERR_DROP@GOTPAGE
Lloh7:
	ldr	x28, [x28, _ERR_DROP@GOTPAGEOFF]
Lloh8:
	adrp	x21, l_.str@PAGE
Lloh9:
	add	x21, x21, l_.str@PAGEOFF
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	add	x22, x20, x23
	ldr	w0, [x22]
	add	x1, sp, #16
	add	x2, sp, #24
	add	x3, sp, #20
	add	x4, sp, #12
	bl	_R_DecomposeSort
	ldr	x8, [sp, #24]
	ldr	x9, [x8]
	ldr	x10, [x25]
	cmp	x9, x10
	b.gt	LBB0_9
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x10, [x26]
	cmp	x9, x10
	b.ne	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x9, [x27]
	ldr	w0, [x28]
	ldr	w2, [x8, #8]
	mov	x1, x21
	blr	x9
LBB0_5:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	w1, [sp, #16]
	mov	x0, x22
	bl	_R_MirrorViewBySurface
	cbnz	x0, LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x23, x23, #4
	cmp	x24, x23
	b.ne	LBB0_2
	b	LBB0_9
LBB0_7:
	mov	x0, x20
	mov	x1, x19
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_R_AddDrawSurfCmd
LBB0_8:
Lloh10:
	adrp	x8, _r_portalOnly@GOTPAGE
Lloh11:
	ldr	x8, [x8, _r_portalOnly@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	ldr	x8, [x8]
	cbnz	x8, LBB0_10
LBB0_9:
	mov	x0, x20
	mov	x1, x19
	bl	_R_AddDrawSurfCmd
LBB0_10:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_SS_PORTAL,8,3                  ; @SS_PORTAL
	.comm	_SS_BAD,8,3                     ; @SS_BAD
	.comm	_ri,8,3                         ; @ri
	.comm	_ERR_DROP,4,2                   ; @ERR_DROP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Shader '%s'with sort == SS_BAD"

	.comm	_r_portalOnly,8,3               ; @r_portalOnly
.subsections_via_symbols
