	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_HL_SplitBrushWithFace          ## -- Begin function HL_SplitBrushWithFace
	.p2align	4, 0x90
_HL_SplitBrushWithFace:                 ## @HL_SplitBrushWithFace
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	_hl_dplanes@GOTPCREL(%rip), %rax
	movq	(%rsi), %rsi
	shlq	$2, %rsi
	addq	(%rax), %rsi
	leaq	-72(%rbp), %rdi
	movl	$8, %edx
	callq	_memcpy
	cmpq	$0, 16(%rbx)
	je	LBB0_2
## %bb.1:
	movl	-72(%rbp), %edi
	movl	%edi, %esi
	callq	_VectorNegate
	negl	-68(%rbp)
LBB0_2:
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movq	%rbx, -96(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, -104(%rbp)                ## 8-byte Spill
	movq	_hl_dsurfedges@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	12(%rbx), %rcx
	addq	%r15, %rcx
	movl	(%rax,%rcx,4), %r12d
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	testl	%r12d, %r12d
	setle	%r14b
	setg	%bl
	movq	_hl_dvertexes@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_hl_dedges@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movl	%r12d, %edi
	callq	_abs
	movq	(%r13,%rax,8), %rax
	movq	(%rax,%rbx,8), %rax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx,%rax,8), %r13
	movq	_hl_dvertexes@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_hl_dedges@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movl	%r12d, %edi
	callq	_abs
	movq	(%rbx,%rax,8), %rax
	movq	(%rax,%r14,8), %rax
	movq	-104(%rbp), %r14                ## 8-byte Reload
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx,%rax,8), %rsi
	movq	%r13, %rdi
	callq	_VectorSubtract
	movl	-72(%rbp), %esi
	callq	_CrossProduct
	callq	_VectorNormalize
	movq	%r13, %rsi
	callq	_DotProduct
	callq	_FindFloatPlane
	movq	%r14, %rdi
	movl	%eax, %esi
	leaq	-88(%rbp), %rdx
	leaq	-80(%rbp), %rcx
	callq	_SplitBrush
	movq	-80(%rbp), %rax
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	8(%r14), %ecx
	movl	%ecx, 8(%rax)
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, (%rax)
	movq	-80(%rbp), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	incl	-44(%rbp)                       ## 4-byte Folded Spill
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	-88(%rbp), %rdi
	testq	%rdi, %rdi
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	8(%r14), %eax
	movl	%eax, 8(%rdi)
	incq	%r15
	movq	%rdi, %r14
	cmpl	8(%rbx), %r15d
	jl	LBB0_3
## %bb.7:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_10
## %bb.8:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, (%rdi)
	movq	-88(%rbp), %rax
	jmp	LBB0_12
LBB0_9:
	leaq	L_.str(%rip), %rdi
	callq	_Log_Print
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_FreeBrushList
	jmp	LBB0_11
LBB0_10:
	callq	_FreeBrush
LBB0_11:
	xorl	%eax, %eax
LBB0_12:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_hl_dplanes,8,3                 ## @hl_dplanes
	.comm	_hl_dsurfedges,8,3              ## @hl_dsurfedges
	.comm	_hl_dvertexes,8,3               ## @hl_dvertexes
	.comm	_hl_dedges,8,3                  ## @hl_dedges
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"HL_SplitBrushWithFace: no new brush\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_HL_SplitBrushWithFace          ; -- Begin function HL_SplitBrushWithFace
	.p2align	2
_HL_SplitBrushWithFace:                 ; @HL_SplitBrushWithFace
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _hl_dplanes@GOTPAGE
Lloh1:
	ldr	x8, [x8, _hl_dplanes@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x9, [x1]
	add	x1, x8, x9, lsl #2
	add	x0, sp, #40
	mov	w2, #8
	bl	_memcpy
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	w0, [sp, #40]
	mov	x1, x0
	bl	_VectorNegate
	ldr	w8, [sp, #44]
	neg	w8, w8
	str	w8, [sp, #44]
LBB0_2:
	mov	x25, #0
	str	xzr, [sp, #16]                  ; 8-byte Folded Spill
	str	wzr, [sp, #12]                  ; 4-byte Folded Spill
Lloh3:
	adrp	x21, _hl_dvertexes@GOTPAGE
Lloh4:
	ldr	x21, [x21, _hl_dvertexes@GOTPAGEOFF]
Lloh5:
	adrp	x24, _hl_dedges@GOTPAGE
Lloh6:
	ldr	x24, [x24, _hl_dedges@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
Lloh7:
	adrp	x8, _hl_dsurfedges@GOTPAGE
Lloh8:
	ldr	x8, [x8, _hl_dsurfedges@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	ldrsw	x9, [x19, #12]
	add	x9, x25, x9
	ldr	w22, [x8, x9, lsl #2]
	cmp	w22, #1
	cset	w26, lt
	cmp	w22, #0
	cset	w23, gt
	ldr	x27, [x21]
	ldr	x28, [x24]
	mov	x0, x22
	bl	_abs
	ldr	x8, [x28, x0, lsl #3]
	ldr	x8, [x8, w23, uxtw #3]
	ldr	x23, [x27, x8, lsl #3]
	ldr	x27, [x21]
	ldr	x28, [x24]
	mov	x0, x22
	bl	_abs
	ldr	x8, [x28, x0, lsl #3]
	ldr	x8, [x8, w26, uxtw #3]
	ldr	x1, [x27, x8, lsl #3]
	mov	x0, x23
	bl	_VectorSubtract
	ldr	w1, [sp, #40]
	bl	_CrossProduct
	bl	_VectorNormalize
	mov	x1, x23
	bl	_DotProduct
	bl	_FindFloatPlane
	mov	x1, x0
	add	x2, sp, #32
	add	x3, sp, #24
	mov	x0, x20
	bl	_SplitBrush
	ldr	x8, [sp, #24]
	cbz	x8, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w9, [x20, #8]
	str	w9, [x8, #8]
	ldr	x9, [sp, #16]                   ; 8-byte Folded Reload
	str	x9, [x8]
	ldr	x8, [sp, #24]
	str	x8, [sp, #16]                   ; 8-byte Folded Spill
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	add	w8, w8, #1
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x0, [sp, #32]
	cbz	x0, LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x20, #8]
	str	w8, [x0, #8]
	ldr	w8, [x19, #8]
	add	x25, x25, #1
	mov	x20, x0
	cmp	w25, w8
	b.lt	LBB0_3
; %bb.7:
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	cbz	w8, LBB0_10
; %bb.8:
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	str	x8, [x0]
	ldr	x0, [sp, #32]
	b	LBB0_12
LBB0_9:
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Log_Print
	ldr	x0, [sp, #16]                   ; 8-byte Folded Reload
	bl	_FreeBrushList
	b	LBB0_11
LBB0_10:
	bl	_FreeBrush
LBB0_11:
	mov	x0, #0
LBB0_12:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_hl_dplanes,8,3                 ; @hl_dplanes
	.comm	_hl_dsurfedges,8,3              ; @hl_dsurfedges
	.comm	_hl_dvertexes,8,3               ; @hl_dvertexes
	.comm	_hl_dedges,8,3                  ; @hl_dedges
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"HL_SplitBrushWithFace: no new brush\n"

.subsections_via_symbols
