	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SelectSplitPlaneNum            ## -- Begin function SelectSplitPlaneNum
	.p2align	4, 0x90
_SelectSplitPlaneNum:                   ## @SelectSplitPlaneNum
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r13
	movq	%rdi, %r12
	movq	_qfalse@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movq	_hintsplit@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movq	_BLOCK_SIZE@GOTPCREL(%rip), %r15
	movl	(%r15), %ebx
	movq	(%rdi), %rax
	movl	(%rax), %eax
	cltd
	idivl	%ebx
	movl	%eax, %edi
	callq	_floor
	incl	%eax
	imull	%ebx, %eax
	cvtsi2ss	%eax, %xmm0
	movq	8(%r12), %rax
	movss	(%rax), %xmm1                   ## xmm1 = mem[0],zero,zero,zero
	ucomiss	%xmm0, %xmm1
	ja	LBB0_20
## %bb.1:
	movl	(%r15), %ebx
	movq	(%r12), %rax
	movl	4(%rax), %eax
	cltd
	idivl	%ebx
	movl	%eax, %edi
	callq	_floor
	incl	%eax
	imull	%ebx, %eax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	movq	8(%r12), %rax
	movss	4(%rax), %xmm1                  ## xmm1 = mem[0],zero,zero,zero
	ucomiss	%xmm0, %xmm1
	ja	LBB0_20
## %bb.2:
	movl	$-1, %eax
	testq	%r13, %r13
	je	LBB0_19
## %bb.3:
	movq	(%r14), %rax
	movq	%r13, %rcx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rax, 32(%rcx)
	movq	40(%rcx), %rcx
	testq	%rcx, %rcx
	jne	LBB0_4
## %bb.5:
	movl	$-99999, %eax                   ## imm = 0xFFFE7961
	movq	%r13, %r15
	movq	%r13, %rdx
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_6 Depth=1
	subl	%r12d, %r13d
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	cmpl	$3, (%rax,%rcx,4)
	leal	(%r13,%r13,4), %eax
	leal	5(%r13,%r13,4), %ecx
	cmovgel	%eax, %ecx
	addl	16(%r15), %ecx
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	cmpl	%eax, %ecx
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	cmovgq	%r15, %rdx
	cmovgl	%ecx, %eax
	movq	-56(%rbp), %r13                 ## 8-byte Reload
LBB0_14:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	40(%r15), %r15
	testq	%r15, %r15
	je	LBB0_15
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, 32(%r15)
	jne	LBB0_14
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movq	_mapplanes@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	(%r15), %rax
	leaq	(%rax,%rax,2), %rdx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	leaq	(%rcx,%rdx,4), %rbx
	addq	$8, %rbx
	xorl	%r12d, %r12d
	movq	%r13, %r14
	xorl	%r13d, %r13d
	cmpq	%rax, (%r14)
	jne	LBB0_10
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	incl	%r13d
	movq	_qtrue@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 32(%r14)
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_6 Depth=1
	movl	24(%r14), %edi
	movl	(%rbx), %esi
	movl	-4(%rbx), %edx
	callq	_WindingOnPlaneSide
	xorl	%ecx, %ecx
	movq	_SIDE_CROSS@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %eax
	sete	%cl
	addl	%ecx, %r12d
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	40(%r14), %r14
	testq	%r14, %r14
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	(%r15), %rax
	cmpq	%rax, (%r14)
	jne	LBB0_10
	jmp	LBB0_9
LBB0_15:
	cmpl	$-99999, %eax                   ## imm = 0xFFFE7961
	movl	$-1, %eax
	je	LBB0_19
## %bb.16:
	cmpq	$0, 8(%rdx)
	je	LBB0_18
## %bb.17:
	movq	_qtrue@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_hintsplit@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
LBB0_18:
	movl	(%rdx), %eax
	jmp	LBB0_19
LBB0_20:
	callq	_SelectSplitPlaneNum.cold.1
	xorl	%eax, %eax
LBB0_19:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.p2align	4, 0x90                         ## -- Begin function SelectSplitPlaneNum.cold.1
_SelectSplitPlaneNum.cold.1:            ## @SelectSplitPlaneNum.cold.1
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	callq	_VectorClear
	ud2
	.cfi_endproc
                                        ## -- End function
	.comm	_qfalse,8,3                     ## @qfalse
	.comm	_hintsplit,8,3                  ## @hintsplit
	.comm	_BLOCK_SIZE,4,2                 ## @BLOCK_SIZE
	.comm	_mapplanes,8,3                  ## @mapplanes
	.comm	_qtrue,8,3                      ## @qtrue
	.comm	_SIDE_CROSS,4,2                 ## @SIDE_CROSS
	.comm	_SIDE_FRONT,4,2                 ## @SIDE_FRONT
	.comm	_SIDE_BACK,4,2                  ## @SIDE_BACK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SelectSplitPlaneNum            ; -- Begin function SelectSplitPlaneNum
	.p2align	2
_SelectSplitPlaneNum:                   ; @SelectSplitPlaneNum
	.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	x27, x1
	mov	x20, x0
Lloh0:
	adrp	x19, _qfalse@GOTPAGE
Lloh1:
	ldr	x19, [x19, _qfalse@GOTPAGEOFF]
	ldr	x8, [x19]
Lloh2:
	adrp	x9, _hintsplit@GOTPAGE
Lloh3:
	ldr	x9, [x9, _hintsplit@GOTPAGEOFF]
Lloh4:
	str	x8, [x9]
Lloh5:
	adrp	x21, _BLOCK_SIZE@GOTPAGE
Lloh6:
	ldr	x21, [x21, _BLOCK_SIZE@GOTPAGEOFF]
	ldr	w22, [x21]
	ldr	x8, [x0]
	ldr	w8, [x8]
	sdiv	w0, w8, w22
	bl	_floor
	madd	w8, w22, w0, w22
	scvtf	s0, w8
	ldr	x8, [x20, #8]
	ldr	s1, [x8]
	fcmp	s1, s0
	b.gt	LBB0_20
; %bb.1:
	ldr	w21, [x21]
	ldr	x8, [x20]
	ldr	w8, [x8, #4]
	sdiv	w0, w8, w21
	bl	_floor
	madd	w8, w21, w0, w21
	scvtf	s0, w8
	ldr	x8, [x20, #8]
	ldr	s1, [x8, #4]
	fcmp	s1, s0
	b.gt	LBB0_20
; %bb.2:
	cbz	x27, LBB0_15
; %bb.3:
	ldr	x8, [x19]
	mov	x9, x27
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	str	x8, [x9, #32]
	ldr	x9, [x9, #40]
	cbnz	x9, LBB0_4
; %bb.5:
Lloh7:
	adrp	x20, _qtrue@GOTPAGE
Lloh8:
	ldr	x20, [x20, _qtrue@GOTPAGEOFF]
	mov	w11, #12
Lloh9:
	adrp	x26, _SIDE_CROSS@GOTPAGE
Lloh10:
	ldr	x26, [x26, _SIDE_CROSS@GOTPAGEOFF]
	mov	x28, x27
	mov	w9, #31073
	movk	w9, #65534, lsl #16
	mov	x10, x27
	str	x27, [sp, #8]                   ; 8-byte Folded Spill
	b	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=1
	sub	w8, w25, w24
	add	w8, w8, w8, lsl #2
	mov	w11, #12
	mul	x9, x21, x11
	ldr	w9, [x23, x9]
	add	w10, w8, #5
	cmp	w9, #3
	csel	w8, w10, w8, lt
	ldr	w9, [x28, #16]
	add	w8, w8, w9
	ldr	w9, [sp, #20]                   ; 4-byte Folded Reload
	cmp	w8, w9
	ldr	x10, [sp, #24]                  ; 8-byte Folded Reload
	csel	x10, x28, x10, gt
	csel	w9, w8, w9, gt
	ldr	x27, [sp, #8]                   ; 8-byte Folded Reload
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	ldr	x28, [x28, #40]
	cbz	x28, LBB0_14
LBB0_8:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_12 Depth 2
	ldr	x8, [x28, #32]
	cbnz	x8, LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	str	w9, [sp, #20]                   ; 4-byte Folded Spill
	str	x10, [sp, #24]                  ; 8-byte Folded Spill
	mov	w24, #0
	mov	w25, #0
Lloh11:
	adrp	x8, _mapplanes@GOTPAGE
Lloh12:
	ldr	x8, [x8, _mapplanes@GOTPAGEOFF]
Lloh13:
	ldr	x23, [x8]
	ldr	x21, [x28]
	madd	x8, x21, x11, x23
	add	x19, x8, #8
	add	x22, x8, #4
	mov	x8, x21
	b	LBB0_12
LBB0_10:                                ;   in Loop: Header=BB0_12 Depth=2
	ldr	w0, [x27, #24]
	ldr	w1, [x19]
	ldr	w2, [x22]
	bl	_WindingOnPlaneSide
	ldr	w8, [x26]
	cmp	w0, w8
	cinc	w24, w24, eq
	ldr	x27, [x27, #40]
	cbz	x27, LBB0_6
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=2
	ldr	x8, [x28]
LBB0_12:                                ;   Parent Loop BB0_8 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x9, [x27]
	cmp	x9, x8
	b.ne	LBB0_10
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=2
	add	w25, w25, #1
	ldr	x8, [x20]
	str	x8, [x27, #32]
	ldr	x27, [x27, #40]
	cbnz	x27, LBB0_11
	b	LBB0_6
LBB0_14:
	mov	w8, #31073
	movk	w8, #65534, lsl #16
	cmp	w9, w8
	b.ne	LBB0_16
LBB0_15:
	mov	w0, #-1
	b	LBB0_19
LBB0_16:
	ldr	x8, [x10, #8]
	cbz	x8, LBB0_18
; %bb.17:
	ldr	x8, [x20]
Lloh14:
	adrp	x9, _hintsplit@GOTPAGE
Lloh15:
	ldr	x9, [x9, _hintsplit@GOTPAGEOFF]
Lloh16:
	str	x8, [x9]
LBB0_18:
	ldr	w0, [x10]
LBB0_19:
	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
LBB0_20:
	bl	_SelectSplitPlaneNum.cold.1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotStr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotStr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.p2align	2                               ; -- Begin function SelectSplitPlaneNum.cold.1
_SelectSplitPlaneNum.cold.1:            ; @SelectSplitPlaneNum.cold.1
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	bl	_VectorClear
	brk	#0x1
	.cfi_endproc
                                        ; -- End function
	.comm	_qfalse,8,3                     ; @qfalse
	.comm	_hintsplit,8,3                  ; @hintsplit
	.comm	_BLOCK_SIZE,4,2                 ; @BLOCK_SIZE
	.comm	_mapplanes,8,3                  ; @mapplanes
	.comm	_qtrue,8,3                      ; @qtrue
	.comm	_SIDE_CROSS,4,2                 ; @SIDE_CROSS
	.comm	_SIDE_FRONT,4,2                 ; @SIDE_FRONT
	.comm	_SIDE_BACK,4,2                  ; @SIDE_BACK
.subsections_via_symbols
