	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_R_CubemapForPoint              ## -- Begin function R_CubemapForPoint
	.p2align	4, 0x90
_R_CubemapForPoint:                     ## @R_CubemapForPoint
	.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
	movq	_r_cubeMapping@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	xorl	%r12d, %r12d
	cmpq	$0, (%rax)
	je	LBB0_6
## %bb.1:
	movq	_tr@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	je	LBB0_6
## %bb.2:
	jle	LBB0_6
## %bb.3:
	movl	%edi, %r14d
	movq	_WORLD_SIZE@GOTPCREL(%rip), %rax
	cvtsi2ssq	(%rax), %xmm0
	mulss	%xmm0, %xmm0
	cvttss2si	%xmm0, %r13
	movl	$-1, %r12d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rax
	movl	(%rax,%rbx,4), %esi
	movl	%r14d, %edi
	callq	_VectorSubtract
	callq	_DotProduct
	cmpq	%rax, %r13
	cmovgeq	%rax, %r13
	cmovgl	%ebx, %r12d
	incq	%rbx
	movslq	(%r15), %rax
	cmpq	%rax, %rbx
	jl	LBB0_4
## %bb.5:
	incl	%r12d
LBB0_6:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_r_cubeMapping,8,3              ## @r_cubeMapping
	.comm	_tr,16,3                        ## @tr
	.comm	_WORLD_SIZE,8,3                 ## @WORLD_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_R_CubemapForPoint              ; -- Begin function R_CubemapForPoint
	.p2align	2
_R_CubemapForPoint:                     ; @R_CubemapForPoint
	.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
Lloh0:
	adrp	x8, _r_cubeMapping@GOTPAGE
Lloh1:
	ldr	x8, [x8, _r_cubeMapping@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x8, [x8]
Lloh3:
	adrp	x20, _tr@GOTPAGE
Lloh4:
	ldr	x20, [x20, _tr@GOTPAGEOFF]
	ldr	w9, [x20]
	cmp	x8, #0
	ccmp	w9, #0, #4, ne
	ccmp	w9, #1, #8, ne
	b.ge	LBB0_2
; %bb.1:
	mov	w0, #0
	b	LBB0_5
LBB0_2:
	mov	x19, x0
	mov	x21, #0
Lloh5:
	adrp	x8, _WORLD_SIZE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _WORLD_SIZE@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	scvtf	s0, x8
	fmul	s0, s0, s0
	fcvtzs	x23, s0
	mov	w22, #-1
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #8]
	ldr	w1, [x8, x21, lsl #2]
	mov	x0, x19
	bl	_VectorSubtract
	bl	_DotProduct
	cmp	x23, x0
	csel	x23, x23, x0, lt
	csel	w22, w21, w22, gt
	add	x21, x21, #1
	ldrsw	x8, [x20]
	cmp	x21, x8
	b.lt	LBB0_3
; %bb.4:
	add	w0, w22, #1
LBB0_5:
	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
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_r_cubeMapping,8,3              ; @r_cubeMapping
	.comm	_tr,16,3                        ; @tr
	.comm	_WORLD_SIZE,8,3                 ; @WORLD_SIZE
.subsections_via_symbols
