	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_R_FindPlane                    ## -- Begin function R_FindPlane
	.p2align	4, 0x90
_R_FindPlane:                           ## @R_FindPlane
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	_skyflatnum@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	cmpl	%esi, (%rax)
	movl	$0, %r12d
	cmovneq	%rdi, %r12
	movl	%edx, %r15d
	cmovel	%ecx, %r15d
	movq	_visplanes@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	_lastvisplane@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	movq	%rcx, %rbx
	cmpq	%rax, %rcx
	jae	LBB0_6
## %bb.1:
	movq	%rcx, %rbx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	addq	$32, %rbx
	cmpq	%rax, %rbx
	jae	LBB0_6
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	(%rbx), %r12
	jne	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	%r14d, 8(%rbx)
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	12(%rbx), %r15d
	jne	LBB0_5
	jmp	LBB0_9
LBB0_6:
	movq	%rax, %rdx
	subq	%rcx, %rdx
	sarq	$5, %rdx
	movq	_MAXVISPLANES@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	cmpq	%rcx, %rdx
	jne	LBB0_8
## %bb.7:
	leaq	L_.str(%rip), %rdi
	callq	_I_Error
	movq	(%r13), %rax
LBB0_8:
	addq	$32, %rax
	movq	%rax, (%r13)
	movq	%r12, (%rbx)
	movl	%r14d, 8(%rbx)
	movl	%r15d, 12(%rbx)
	movq	_SCREENWIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movl	$-1, 16(%rbx)
	movl	20(%rbx), %edi
	movl	$255, %esi
	movl	$4, %edx
	callq	_memset
LBB0_9:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_skyflatnum,4,2                 ## @skyflatnum
	.comm	_visplanes,8,3                  ## @visplanes
	.comm	_lastvisplane,8,3               ## @lastvisplane
	.comm	_MAXVISPLANES,4,2               ## @MAXVISPLANES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"R_FindPlane: no more visplanes"

	.comm	_SCREENWIDTH,4,2                ## @SCREENWIDTH
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_R_FindPlane                    ; -- Begin function R_FindPlane
	.p2align	2
_R_FindPlane:                           ; @R_FindPlane
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x1
Lloh0:
	adrp	x8, _skyflatnum@GOTPAGE
Lloh1:
	ldr	x8, [x8, _skyflatnum@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	csel	w21, wzr, w2, eq
Lloh3:
	adrp	x8, _visplanes@GOTPAGE
Lloh4:
	ldr	x8, [x8, _visplanes@GOTPAGEOFF]
	csel	x22, xzr, x0, eq
Lloh5:
	ldr	x9, [x8]
Lloh6:
	adrp	x23, _lastvisplane@GOTPAGE
Lloh7:
	ldr	x23, [x23, _lastvisplane@GOTPAGEOFF]
	ldr	x8, [x23]
	mov	x19, x9
	cmp	x9, x8
	b.lo	LBB0_6
LBB0_1:
	sub	x9, x8, x9
Lloh8:
	adrp	x10, _MAXVISPLANES@GOTPAGE
Lloh9:
	ldr	x10, [x10, _MAXVISPLANES@GOTPAGEOFF]
Lloh10:
	ldrsw	x10, [x10]
	cmp	x10, x9, asr #5
	b.ne	LBB0_3
; %bb.2:
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	bl	_I_Error
	ldr	x8, [x23]
LBB0_3:
	add	x8, x8, #32
	str	x8, [x23]
	str	x22, [x19]
Lloh13:
	adrp	x8, _SCREENWIDTH@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SCREENWIDTH@GOTPAGEOFF]
	stp	w20, w21, [x19, #8]
Lloh15:
	ldr	w8, [x8]
	str	w8, [x19, #24]
	mov	w8, #-1
	str	w8, [x19, #16]
	ldr	w0, [x19, #20]
	mov	w1, #255
	mov	w2, #4
	bl	_memset
LBB0_4:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x19, x19, #32
	cmp	x19, x8
	b.hs	LBB0_1
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x19]
	cmp	x22, x10
	b.ne	LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w10, [x19, #8]
	cmp	w10, w20
	b.ne	LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w10, [x19, #12]
	cmp	w21, w10
	b.ne	LBB0_5
	b	LBB0_4
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_skyflatnum,4,2                 ; @skyflatnum
	.comm	_visplanes,8,3                  ; @visplanes
	.comm	_lastvisplane,8,3               ; @lastvisplane
	.comm	_MAXVISPLANES,4,2               ; @MAXVISPLANES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"R_FindPlane: no more visplanes"

	.comm	_SCREENWIDTH,4,2                ; @SCREENWIDTH
.subsections_via_symbols
