	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function R_DlightSurface
LCPI0_0:
	.long	0x80000000                      ## float -0
	.long	0x80000000                      ## float -0
	.long	0x80000000                      ## float -0
	.long	0x80000000                      ## float -0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_R_DlightSurface:                       ## @R_DlightSurface
	.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, %r15d
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movl	8(%rdi), %r8d
	movq	_CULLINFO_PLANE@GOTPCREL(%rip), %rcx
	movq	_tr@GOTPCREL(%rip), %r14
	movl	8(%r14), %eax
	testl	%r8d, (%rcx)
	je	LBB0_10
## %bb.1:
	testl	%eax, %eax
	jle	LBB0_10
## %bb.2:
	movl	$8, %r13d
	xorl	%ebx, %ebx
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	notl	%r12d
	movl	-52(%rbp), %r15d                ## 4-byte Reload
	andl	%r12d, %r15d
	movq	_tr@GOTPCREL(%rip), %r14
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	movslq	8(%r14), %rax
	addq	$16, %r13
	cmpq	%rax, %rbx
	jge	LBB0_9
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	$1, %r12d
	movl	%ebx, %ecx
	shll	%cl, %r12d
	btl	%ebx, %r15d
	jae	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%r15d, -52(%rbp)                ## 4-byte Spill
	movq	16(%r14), %r15
	movq	-8(%r15,%r13), %rdi
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movl	36(%r14), %esi
	callq	_DotProduct
	subss	32(%r14), %xmm0
	movss	(%r15,%r13), %xmm1              ## xmm1 = mem[0],zero,zero,zero
	movaps	%xmm1, %xmm2
	xorps	LCPI0_0(%rip), %xmm2
	ucomiss	%xmm0, %xmm2
	ja	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	ucomiss	%xmm1, %xmm0
	ja	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_tr@GOTPCREL(%rip), %r14
	movl	-52(%rbp), %r15d                ## 4-byte Reload
	jmp	LBB0_8
LBB0_9:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	8(%rcx), %r8d
LBB0_10:
	movq	_CULLINFO_BOX@GOTPCREL(%rip), %rcx
	testl	%r8d, (%rcx)
	je	LBB0_22
## %bb.11:
	testl	%eax, %eax
	jle	LBB0_29
## %bb.12:
	movq	16(%r14), %rsi
	movl	%eax, %r9d
	addq	$8, %rsi
	xorl	%ecx, %ecx
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_13 Depth=1
	notl	%ebx
	andl	%ebx, %r15d
LBB0_21:                                ##   in Loop: Header=BB0_13 Depth=1
	incq	%rcx
	addq	$16, %rsi
	cmpq	%rcx, %r9
	je	LBB0_22
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movl	$1, %ebx
	shll	%cl, %ebx
	btl	%ecx, %r15d
	jae	LBB0_21
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	-8(%rsi), %r11
	movss	(%r11), %xmm1                   ## xmm1 = mem[0],zero,zero,zero
	movss	(%rsi), %xmm0                   ## xmm0 = mem[0],zero,zero,zero
	movaps	%xmm1, %xmm2
	subss	%xmm0, %xmm2
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	16(%rdx), %rdx
	movq	8(%rdx), %rdi
	ucomiss	(%rdi), %xmm2
	ja	LBB0_20
## %bb.15:                              ##   in Loop: Header=BB0_13 Depth=1
	addss	%xmm0, %xmm1
	movq	(%rdx), %r10
	movss	(%r10), %xmm2                   ## xmm2 = mem[0],zero,zero,zero
	ucomiss	%xmm1, %xmm2
	ja	LBB0_20
## %bb.16:                              ##   in Loop: Header=BB0_13 Depth=1
	movss	4(%r11), %xmm1                  ## xmm1 = mem[0],zero,zero,zero
	movaps	%xmm1, %xmm2
	subss	%xmm0, %xmm2
	ucomiss	4(%rdi), %xmm2
	ja	LBB0_20
## %bb.17:                              ##   in Loop: Header=BB0_13 Depth=1
	addss	%xmm0, %xmm1
	movss	4(%r10), %xmm2                  ## xmm2 = mem[0],zero,zero,zero
	ucomiss	%xmm1, %xmm2
	ja	LBB0_20
## %bb.18:                              ##   in Loop: Header=BB0_13 Depth=1
	movss	8(%r11), %xmm1                  ## xmm1 = mem[0],zero,zero,zero
	movaps	%xmm1, %xmm2
	subss	%xmm0, %xmm2
	ucomiss	8(%rdi), %xmm2
	ja	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_13 Depth=1
	addss	%xmm1, %xmm0
	movss	8(%r10), %xmm1                  ## xmm1 = mem[0],zero,zero,zero
	ucomiss	%xmm0, %xmm1
	ja	LBB0_20
	jmp	LBB0_21
LBB0_22:
	movq	_CULLINFO_SPHERE@GOTPCREL(%rip), %rcx
	testl	%r8d, (%rcx)
	je	LBB0_29
## %bb.23:
	testl	%eax, %eax
	jle	LBB0_29
## %bb.24:
	movl	$8, %r13d
	xorl	%ebx, %ebx
	jmp	LBB0_25
	.p2align	4, 0x90
LBB0_28:                                ##   in Loop: Header=BB0_25 Depth=1
	incq	%rbx
	movslq	8(%r14), %rax
	addq	$16, %r13
	cmpq	%rax, %rbx
	jge	LBB0_29
LBB0_25:                                ## =>This Inner Loop Header: Depth=1
	movl	$1, %r12d
	movl	%ebx, %ecx
	shll	%cl, %r12d
	btl	%ebx, %r15d
	jae	LBB0_28
## %bb.26:                              ##   in Loop: Header=BB0_25 Depth=1
	movq	16(%r14), %rax
	movq	-8(%rax,%r13), %rdi
	movss	(%rax,%r13), %xmm0              ## xmm0 = mem[0],zero,zero,zero
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	24(%rax), %edx
	movl	28(%rax), %esi
	callq	_SpheresIntersect
	testl	%eax, %eax
	jne	LBB0_28
## %bb.27:                              ##   in Loop: Header=BB0_25 Depth=1
	notl	%r12d
	andl	%r12d, %r15d
	jmp	LBB0_28
LBB0_29:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movl	(%rax), %ecx
	addl	$-128, %ecx
	cmpl	$2, %ecx
	ja	LBB0_32
## %bb.30:
	movl	%r15d, (%rax)
	testl	%r15d, %r15d
	je	LBB0_32
## %bb.31:
	incl	4(%r14)
	jmp	LBB0_33
LBB0_32:
	incl	(%r14)
	xorl	%r15d, %r15d
LBB0_33:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CULLINFO_PLANE,4,2             ## @CULLINFO_PLANE
	.comm	_tr,24,3                        ## @tr
	.comm	_CULLINFO_BOX,4,2               ## @CULLINFO_BOX
	.comm	_CULLINFO_SPHERE,4,2            ## @CULLINFO_SPHERE
	.no_dead_strip	_R_DlightSurface
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function R_DlightSurface
_R_DlightSurface:                       ; @R_DlightSurface
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x1
	mov	x20, x0
	ldr	w9, [x0, #8]
Lloh0:
	adrp	x8, _CULLINFO_PLANE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CULLINFO_PLANE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	and	w10, w8, w9
Lloh3:
	adrp	x21, _tr@GOTPAGE
Lloh4:
	ldr	x21, [x21, _tr@GOTPAGEOFF]
	ldr	w8, [x21, #8]
	cmp	w10, #0
	ccmp	w8, #1, #8, ne
	b.lt	LBB0_7
; %bb.1:
	mov	x22, #0
	mov	x23, #0
	mov	w24, #1
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x21, #8]
	add	x22, x22, #16
	cmp	x23, x8
	b.ge	LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	lsl	w25, w24, w23
	tst	w25, w19
	b.eq	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x21, #16]
	add	x26, x8, x22
	ldr	x0, [x26]
	ldr	w1, [x20, #36]
	bl	_DotProduct
	ldr	s1, [x20, #32]
	fsub	s0, s0, s1
	ldr	s1, [x26, #8]
	fneg	s2, s1
	fcmp	s0, s2
	fccmp	s0, s1, #0, pl
	b.le	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	bic	w19, w19, w25
	b	LBB0_2
LBB0_6:
	ldr	w9, [x20, #8]
LBB0_7:
Lloh5:
	adrp	x10, _CULLINFO_BOX@GOTPAGE
Lloh6:
	ldr	x10, [x10, _CULLINFO_BOX@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_19
; %bb.8:
	cmp	w8, #1
	b.lt	LBB0_20
; %bb.9:
	mov	x10, #0
	ldr	x12, [x21, #16]
	mov	w11, w8
	add	x12, x12, #8
	mov	w13, #1
	b	LBB0_12
LBB0_10:                                ;   in Loop: Header=BB0_12 Depth=1
	bic	w19, w19, w14
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	add	x10, x10, #1
	add	x12, x12, #16
	cmp	x11, x10
	b.eq	LBB0_19
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	lsl	w14, w13, w10
	tst	w14, w19
	b.eq	LBB0_11
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	ldur	x15, [x12, #-8]
	ldr	s1, [x15]
	ldr	s0, [x12]
	fsub	s2, s1, s0
	ldr	x17, [x20, #16]
	ldr	x16, [x17, #8]
	ldr	s3, [x16]
	fcmp	s2, s3
	b.gt	LBB0_10
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=1
	fadd	s1, s1, s0
	ldr	x17, [x17]
	ldr	s2, [x17]
	fcmp	s1, s2
	b.mi	LBB0_10
; %bb.15:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	s1, [x15, #4]
	fsub	s2, s1, s0
	ldr	s3, [x16, #4]
	fcmp	s2, s3
	b.gt	LBB0_10
; %bb.16:                               ;   in Loop: Header=BB0_12 Depth=1
	fadd	s1, s0, s1
	ldr	s2, [x17, #4]
	fcmp	s1, s2
	b.mi	LBB0_10
; %bb.17:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	s1, [x15, #8]
	fsub	s2, s1, s0
	ldr	s3, [x16, #8]
	fcmp	s2, s3
	b.gt	LBB0_10
; %bb.18:                               ;   in Loop: Header=BB0_12 Depth=1
	fadd	s0, s0, s1
	ldr	s1, [x17, #8]
	fcmp	s0, s1
	b.mi	LBB0_10
	b	LBB0_11
LBB0_19:
Lloh8:
	adrp	x10, _CULLINFO_SPHERE@GOTPAGE
Lloh9:
	ldr	x10, [x10, _CULLINFO_SPHERE@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	and	w9, w10, w9
	cmp	w9, #0
	ccmp	w8, #1, #8, ne
	b.ge	LBB0_25
LBB0_20:
	ldr	x8, [x20]
	ldr	w9, [x8]
	sub	w9, w9, #128
	cmp	w9, #2
	b.hi	LBB0_23
; %bb.21:
	str	w19, [x8]
	cbz	w19, LBB0_23
; %bb.22:
	ldr	w8, [x21, #4]
	add	w8, w8, #1
	str	w8, [x21, #4]
	b	LBB0_24
LBB0_23:
	mov	w19, #0
	ldr	w8, [x21]
	add	w8, w8, #1
	str	w8, [x21]
LBB0_24:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_25:
	mov	x22, #0
	mov	x23, #0
	mov	w24, #1
	b	LBB0_27
LBB0_26:                                ;   in Loop: Header=BB0_27 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x21, #8]
	add	x22, x22, #16
	cmp	x23, x8
	b.ge	LBB0_20
LBB0_27:                                ; =>This Inner Loop Header: Depth=1
	lsl	w25, w24, w23
	tst	w25, w19
	b.eq	LBB0_26
; %bb.28:                               ;   in Loop: Header=BB0_27 Depth=1
	ldr	x8, [x21, #16]
	add	x8, x8, x22
	ldr	x0, [x8]
	ldr	s0, [x8, #8]
	ldp	w2, w1, [x20, #24]
	bl	_SpheresIntersect
	bic	w8, w19, w25
	cmp	w0, #0
	csel	w19, w19, w8, ne
	b	LBB0_26
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_CULLINFO_PLANE,4,2             ; @CULLINFO_PLANE
	.comm	_tr,24,3                        ; @tr
	.comm	_CULLINFO_BOX,4,2               ; @CULLINFO_BOX
	.comm	_CULLINFO_SPHERE,4,2            ; @CULLINFO_SPHERE
	.no_dead_strip	_R_DlightSurface
.subsections_via_symbols
