	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function R_BoxSurfaces_r
LCPI0_0:
	.quad	0xbfe0000000000000              ## double -0.5
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_R_BoxSurfaces_r
	.p2align	4, 0x90
_R_BoxSurfaces_r:                       ## @R_BoxSurfaces_r
	.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	%r9, %r13
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movl	%edx, %r14d
	movl	%esi, %ebx
	movq	%rdi, %r15
	movl	16(%rbp), %r12d
	cmpl	$-1, (%rdi)
	je	LBB0_1
LBB0_7:
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	movl	%r14d, -52(%rbp)                ## 4-byte Spill
	movl	4(%r15), %r14d
	testq	%r14, %r14
	movl	-44(%rbp), %r10d                ## 4-byte Reload
	je	LBB0_21
## %bb.8:
	movq	8(%r15), %r8
	xorl	%r15d, %r15d
	movq	_SURF_NOIMPACT@GOTPCREL(%rip), %rdi
	movq	_SURF_NOMARKS@GOTPCREL(%rip), %rbx
	movq	_CONTENTS_FOG@GOTPCREL(%rip), %r9
	movq	_tr@GOTPCREL(%rip), %rsi
	movq	%r8, -64(%rbp)                  ## 8-byte Spill
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_9 Depth=1
	incq	%r15
	cmpl	%r15d, %r14d
	je	LBB0_21
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%r10d, (%r13)
	jge	LBB0_21
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	(%r8,%r15,8), %r12
	movq	16(%r12), %rax
	movl	(%rbx), %ecx
	orl	(%rdi), %ecx
	testl	%ecx, (%rax)
	jne	LBB0_17
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	(%r9), %ecx
	testl	%ecx, 4(%rax)
	je	LBB0_12
LBB0_17:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	(%rsi), %rax
	movq	%rax, (%r12)
LBB0_18:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	(%rsi), %rax
	cmpq	%rax, (%r12)
	je	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%rax, (%r12)
	movq	8(%r12), %rax
	movslq	(%r13), %rcx
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movq	%rax, (%rdx,%rcx,8)
	leal	1(%rcx), %eax
	movl	%eax, (%r13)
	jmp	LBB0_20
LBB0_12:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	8(%r12), %rdx
	movq	(%rdx), %rax
	movq	_SF_FACE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	callq	_BoxOnPlaneSide
	movq	_tr@GOTPCREL(%rip), %rsi
	movq	_CONTENTS_FOG@GOTPCREL(%rip), %r9
	movq	-64(%rbp), %r8                  ## 8-byte Reload
	movq	_SURF_NOMARKS@GOTPCREL(%rip), %rbx
	movq	_SURF_NOIMPACT@GOTPCREL(%rip), %rdi
	movl	-44(%rbp), %r10d                ## 4-byte Reload
	decl	%eax
	cmpl	$2, %eax
	jb	LBB0_17
## %bb.14:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	8(%r12), %rax
	movl	(%rax), %edi
	movl	16(%rbp), %esi
	callq	_DotProduct
	movq	_tr@GOTPCREL(%rip), %rsi
	movq	_CONTENTS_FOG@GOTPCREL(%rip), %r9
	movq	-64(%rbp), %r8                  ## 8-byte Reload
	movq	_SURF_NOMARKS@GOTPCREL(%rip), %rbx
	movq	_SURF_NOIMPACT@GOTPCREL(%rip), %rdi
	movl	-44(%rbp), %r10d                ## 4-byte Reload
	ucomisd	LCPI0_0(%rip), %xmm0
	ja	LBB0_17
	jmp	LBB0_18
LBB0_15:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	_SF_GRID@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_18
## %bb.16:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_SF_TRIANGLES@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_17
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	16(%r15), %rax
	movq	(%rax), %rdi
	movl	%r12d, (%rsp)
	movl	%ebx, %esi
	movl	%r14d, %edx
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	movq	%r13, %r9
	callq	_R_BoxSurfaces_r
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	16(%r15), %rax
	addq	$8, %rax
LBB0_6:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	(%rax), %r15
	cmpl	$-1, (%r15)
	jne	LBB0_7
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%r15), %rdx
	movl	%ebx, %edi
	movl	%r14d, %esi
	callq	_BoxOnPlaneSide
	cmpl	$2, %eax
	je	LBB0_5
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$1, %eax
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	16(%r15), %rax
	jmp	LBB0_6
LBB0_21:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SURF_NOIMPACT,4,2              ## @SURF_NOIMPACT
	.comm	_SURF_NOMARKS,4,2               ## @SURF_NOMARKS
	.comm	_CONTENTS_FOG,4,2               ## @CONTENTS_FOG
	.comm	_tr,8,3                         ## @tr
	.comm	_SF_FACE,8,3                    ## @SF_FACE
	.comm	_SF_GRID,8,3                    ## @SF_GRID
	.comm	_SF_TRIANGLES,8,3               ## @SF_TRIANGLES
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_R_BoxSurfaces_r                ; -- Begin function R_BoxSurfaces_r
	.p2align	2
_R_BoxSurfaces_r:                       ; @R_BoxSurfaces_r
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	d9, d8, [sp, #16]               ; 16-byte Folded Spill
	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
	.cfi_offset b8, -104
	.cfi_offset b9, -112
	mov	x19, x6
	mov	x20, x5
	mov	x21, x4
	mov	x22, x3
	mov	x23, x2
	mov	x24, x1
	mov	x25, x0
	ldr	w8, [x0]
	b	LBB0_4
LBB0_1:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x25, #16]
	ldr	x0, [x8]
	mov	x1, x24
	mov	x2, x23
	mov	x3, x22
	mov	x4, x21
	mov	x5, x20
	mov	x6, x19
	bl	_R_BoxSurfaces_r
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x25, #16]
	add	x8, x8, #8
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x25, [x8]
	ldr	w8, [x25]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	cmn	w8, #1
	b.ne	LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x2, [x25, #24]
	mov	x0, x24
	mov	x1, x23
	bl	_BoxOnPlaneSide
	cmp	w0, #2
	b.eq	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w0, #1
	b.ne	LBB0_1
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x25, #16]
	b	LBB0_3
LBB0_8:
	str	w19, [sp, #12]                  ; 4-byte Folded Spill
	ldr	w26, [x25, #4]
	cbz	w26, LBB0_21
; %bb.9:
Lloh0:
	adrp	x12, _SURF_NOIMPACT@GOTPAGE
Lloh1:
	ldr	x12, [x12, _SURF_NOIMPACT@GOTPAGEOFF]
Lloh2:
	adrp	x13, _SURF_NOMARKS@GOTPAGE
Lloh3:
	ldr	x13, [x13, _SURF_NOMARKS@GOTPAGEOFF]
	ldr	x25, [x25, #8]
Lloh4:
	adrp	x14, _CONTENTS_FOG@GOTPAGE
Lloh5:
	ldr	x14, [x14, _CONTENTS_FOG@GOTPAGEOFF]
	fmov	d8, #-0.50000000
Lloh6:
	adrp	x19, _tr@GOTPAGE
Lloh7:
	ldr	x19, [x19, _tr@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	add	x25, x25, #8
	cbz	w26, LBB0_21
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x20]
	cmp	w8, w21
	b.ge	LBB0_21
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	x27, [x25]
	ldr	x8, [x27, #16]
	ldr	w9, [x8]
	ldr	w10, [x12]
	ldr	w11, [x13]
	orr	w10, w11, w10
	tst	w10, w9
	b.ne	LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	w8, [x8, #4]
	ldr	w9, [x14]
	tst	w9, w8
	b.eq	LBB0_17
LBB0_14:                                ;   in Loop: Header=BB0_11 Depth=1
	ldr	x8, [x19]
	str	x8, [x27]
LBB0_15:                                ;   in Loop: Header=BB0_11 Depth=1
	sub	w26, w26, #1
	ldr	x9, [x27]
	ldr	x8, [x19]
	cmp	x9, x8
	b.eq	LBB0_10
; %bb.16:                               ;   in Loop: Header=BB0_11 Depth=1
	str	x8, [x27]
	ldr	x8, [x27, #8]
	ldrsw	x9, [x20]
	str	x8, [x22, x9, lsl #3]
	add	w8, w9, #1
	str	w8, [x20]
	b	LBB0_10
LBB0_17:                                ;   in Loop: Header=BB0_11 Depth=1
	ldr	x2, [x27, #8]
	ldr	x8, [x2]
Lloh8:
	adrp	x9, _SF_FACE@GOTPAGE
Lloh9:
	ldr	x9, [x9, _SF_FACE@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_20
; %bb.18:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x24
	mov	x1, x23
	mov	x28, x13
	bl	_BoxOnPlaneSide
Lloh11:
	adrp	x14, _CONTENTS_FOG@GOTPAGE
Lloh12:
	ldr	x14, [x14, _CONTENTS_FOG@GOTPAGEOFF]
	mov	x13, x28
Lloh13:
	adrp	x12, _SURF_NOIMPACT@GOTPAGE
Lloh14:
	ldr	x12, [x12, _SURF_NOIMPACT@GOTPAGEOFF]
	sub	w8, w0, #1
	cmp	w8, #2
	b.lo	LBB0_14
; %bb.19:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	x8, [x27, #8]
	ldr	w0, [x8]
	ldr	w1, [sp, #12]                   ; 4-byte Folded Reload
	bl	_DotProduct
Lloh15:
	adrp	x14, _CONTENTS_FOG@GOTPAGE
Lloh16:
	ldr	x14, [x14, _CONTENTS_FOG@GOTPAGEOFF]
	mov	x13, x28
Lloh17:
	adrp	x12, _SURF_NOIMPACT@GOTPAGE
Lloh18:
	ldr	x12, [x12, _SURF_NOIMPACT@GOTPAGEOFF]
	fcmp	d0, d8
	b.gt	LBB0_14
	b	LBB0_15
LBB0_20:                                ;   in Loop: Header=BB0_11 Depth=1
Lloh19:
	adrp	x9, _SF_GRID@GOTPAGE
Lloh20:
	ldr	x9, [x9, _SF_GRID@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
Lloh22:
	adrp	x10, _SF_TRIANGLES@GOTPAGE
Lloh23:
	ldr	x10, [x10, _SF_TRIANGLES@GOTPAGEOFF]
Lloh24:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_14
	b	LBB0_15
LBB0_21:
	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
	ldp	d9, d8, [sp, #16]               ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_SURF_NOIMPACT,4,2              ; @SURF_NOIMPACT
	.comm	_SURF_NOMARKS,4,2               ; @SURF_NOMARKS
	.comm	_CONTENTS_FOG,4,2               ; @CONTENTS_FOG
	.comm	_tr,8,3                         ; @tr
	.comm	_SF_FACE,8,3                    ; @SF_FACE
	.comm	_SF_GRID,8,3                    ; @SF_GRID
	.comm	_SF_TRIANGLES,8,3               ; @SF_TRIANGLES
.subsections_via_symbols
