	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_HL_CreateBrushes_r             ## -- Begin function HL_CreateBrushes_r
	.p2align	4, 0x90
_HL_CreateBrushes_r:                    ## @HL_CreateBrushes_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	testl	%esi, %esi
	js	LBB0_1
## %bb.10:
	movq	_hl_dnodes@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movl	%ebx, %r12d
	shlq	$4, %r12
	movslq	(%rax,%r12), %rax
	movq	_hl_dplanes@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rcx,%rax,8), %esi
	movl	4(%rcx,%rax,8), %edi
	callq	_FindFloatPlane
	leaq	-40(%rbp), %rcx
	leaq	-48(%rbp), %r8
	movq	%r14, %rdi
	movl	%eax, %esi
	movl	%ebx, %edx
	callq	_HL_SplitBrush
	movq	%r14, %rdi
	callq	_FreeBrush
	movq	-40(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_12
## %bb.11:
	cmpq	$0, -48(%rbp)
	jne	LBB0_14
LBB0_12:
	leaq	L_.str.1(%rip), %rdi
	callq	_Log_Print
	movq	-40(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_13
LBB0_14:
	movq	(%r15), %rax
	movq	8(%rax,%r12), %rax
	movl	(%rax), %esi
	callq	_HL_CreateBrushes_r
	movq	%rax, -40(%rbp)
LBB0_15:
	movq	-48(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_16
## %bb.17:
	movq	(%r15), %rax
	movq	8(%rax,%r12), %rax
	movl	4(%rax), %esi
	callq	_HL_CreateBrushes_r
	movq	%rax, %r14
	movq	%rax, -48(%rbp)
	movq	-40(%rbp), %rax
	testq	%rax, %rax
	jne	LBB0_19
	jmp	LBB0_21
LBB0_1:
	movq	_hl_dleafs@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	notl	%ebx
	movl	(%rax,%rbx,4), %esi
	leal	-128(%rsi), %eax
	cmpl	$7, %eax
	ja	LBB0_9
## %bb.2:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_4:
	movq	_CONTENTS_SOLID@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_16:
	xorl	%r14d, %r14d
	testq	%rax, %rax
	je	LBB0_21
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movq	%rax, %rcx
	movq	(%rax), %rax
	testq	%rax, %rax
	jne	LBB0_19
## %bb.20:
	movq	%r14, (%rcx)
	movq	-40(%rbp), %r14
	jmp	LBB0_21
LBB0_13:
	xorl	%eax, %eax
	jmp	LBB0_15
LBB0_6:
	movq	_CONTENTS_WATER@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_9:
	leaq	L_.str(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_Error
	xorl	%r14d, %r14d
	jmp	LBB0_21
LBB0_7:
	movq	_CONTENTS_SLIME@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_8:
	movq	_CONTENTS_LAVA@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %eax
	movl	%eax, 8(%r14)
LBB0_21:
	movq	%r14, %rax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%r14, %rdi
	callq	_FreeBrush
	xorl	%r14d, %r14d
	jmp	LBB0_21
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_4, LBB0_4-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_3, LBB0_3-LJTI0_0
LJTI0_0:
	.long	L0_0_set_6
	.long	L0_0_set_9
	.long	L0_0_set_4
	.long	L0_0_set_7
	.long	L0_0_set_4
	.long	L0_0_set_9
	.long	L0_0_set_8
	.long	L0_0_set_3
	.end_data_region
                                        ## -- End function
	.comm	_hl_dleafs,8,3                  ## @hl_dleafs
	.comm	_CONTENTS_SOLID,4,2             ## @CONTENTS_SOLID
	.comm	_CONTENTS_WATER,4,2             ## @CONTENTS_WATER
	.comm	_CONTENTS_SLIME,4,2             ## @CONTENTS_SLIME
	.comm	_CONTENTS_LAVA,4,2              ## @CONTENTS_LAVA
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"HL_CreateBrushes_r: unknown contents %d in Half-Life BSP"

	.comm	_hl_dnodes,8,3                  ## @hl_dnodes
	.comm	_hl_dplanes,8,3                 ## @hl_dplanes
L_.str.1:                               ## @.str.1
	.asciz	"HL_CreateBrushes_r: WARNING node not splitting brush\n"

	.comm	_hl_numbrushes,4,2              ## @hl_numbrushes
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_HL_CreateBrushes_r             ; -- Begin function HL_CreateBrushes_r
	.p2align	2
_HL_CreateBrushes_r:                    ; @HL_CreateBrushes_r
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x1
	mov	x19, x0
	tbnz	w1, #31, LBB0_7
; %bb.1:
Lloh0:
	adrp	x21, _hl_dnodes@GOTPAGE
Lloh1:
	ldr	x21, [x21, _hl_dnodes@GOTPAGEOFF]
	ldr	x8, [x21]
	mov	w22, w20
	lsl	x9, x22, #4
	ldrsw	x8, [x8, x9]
Lloh2:
	adrp	x9, _hl_dplanes@GOTPAGE
Lloh3:
	ldr	x9, [x9, _hl_dplanes@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	add	x8, x9, x8, lsl #3
	ldp	w1, w0, [x8]
	bl	_FindFloatPlane
	mov	x1, x0
	add	x3, sp, #8
	mov	x4, sp
	mov	x0, x19
	mov	x2, x20
	bl	_HL_SplitBrush
	mov	x0, x19
	bl	_FreeBrush
	ldr	x0, [sp, #8]
	cbz	x0, LBB0_3
; %bb.2:
	ldr	x8, [sp]
	cbnz	x8, LBB0_4
LBB0_3:
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_Log_Print
	ldr	x0, [sp, #8]
	cbz	x0, LBB0_5
LBB0_4:
	ldr	x8, [x21]
	add	x8, x8, x22, lsl #4
	ldr	x8, [x8, #8]
	ldr	w1, [x8]
	bl	_HL_CreateBrushes_r
	str	x0, [sp, #8]
LBB0_5:
	ldr	x8, [sp]
	cbz	x8, LBB0_10
; %bb.6:
	ldr	x9, [x21]
	add	x9, x9, x22, lsl #4
	ldr	x9, [x9, #8]
	ldr	w1, [x9, #4]
	mov	x0, x8
	bl	_HL_CreateBrushes_r
	mov	x19, x0
	str	x0, [sp]
	ldr	x0, [sp, #8]
	cbnz	x0, LBB0_11
	b	LBB0_18
LBB0_7:
Lloh7:
	adrp	x8, _hl_dleafs@GOTPAGE
Lloh8:
	ldr	x8, [x8, _hl_dleafs@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	mvn	w9, w20
	ldr	w1, [x8, w9, uxtw #2]
	sub	w8, w1, #128
	cmp	w8, #7
	b.hi	LBB0_14
; %bb.8:
Lloh10:
	adrp	x9, lJTI0_0@PAGE
Lloh11:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_9
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_9:
Lloh12:
	adrp	x8, _CONTENTS_SOLID@GOTPAGE
Lloh13:
	ldr	x8, [x8, _CONTENTS_SOLID@GOTPAGEOFF]
	b	LBB0_17
LBB0_10:
	mov	x19, #0
	cbz	x0, LBB0_18
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	mov	x8, x0
	ldr	x0, [x0]
	cbnz	x0, LBB0_11
; %bb.12:
	str	x19, [x8]
	ldr	x19, [sp, #8]
	b	LBB0_18
LBB0_13:
Lloh14:
	adrp	x8, _CONTENTS_WATER@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CONTENTS_WATER@GOTPAGEOFF]
	b	LBB0_17
LBB0_14:
Lloh16:
	adrp	x0, l_.str@PAGE
Lloh17:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Error
	mov	x19, #0
	b	LBB0_18
LBB0_15:
Lloh18:
	adrp	x8, _CONTENTS_SLIME@GOTPAGE
Lloh19:
	ldr	x8, [x8, _CONTENTS_SLIME@GOTPAGEOFF]
	b	LBB0_17
LBB0_16:
Lloh20:
	adrp	x8, _CONTENTS_LAVA@GOTPAGE
Lloh21:
	ldr	x8, [x8, _CONTENTS_LAVA@GOTPAGEOFF]
LBB0_17:
	ldr	w8, [x8]
	str	w8, [x19, #8]
LBB0_18:
	mov	x0, x19
	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
	add	sp, sp, #64
	ret
LBB0_19:
	mov	x0, x19
	bl	_FreeBrush
	mov	x19, #0
	b	LBB0_18
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_13-LBB0_9)>>2
	.byte	(LBB0_14-LBB0_9)>>2
	.byte	(LBB0_9-LBB0_9)>>2
	.byte	(LBB0_15-LBB0_9)>>2
	.byte	(LBB0_9-LBB0_9)>>2
	.byte	(LBB0_14-LBB0_9)>>2
	.byte	(LBB0_16-LBB0_9)>>2
	.byte	(LBB0_19-LBB0_9)>>2
                                        ; -- End function
	.comm	_hl_dleafs,8,3                  ; @hl_dleafs
	.comm	_CONTENTS_SOLID,4,2             ; @CONTENTS_SOLID
	.comm	_CONTENTS_WATER,4,2             ; @CONTENTS_WATER
	.comm	_CONTENTS_SLIME,4,2             ; @CONTENTS_SLIME
	.comm	_CONTENTS_LAVA,4,2              ; @CONTENTS_LAVA
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"HL_CreateBrushes_r: unknown contents %d in Half-Life BSP"

	.comm	_hl_dnodes,8,3                  ; @hl_dnodes
	.comm	_hl_dplanes,8,3                 ; @hl_dplanes
l_.str.1:                               ; @.str.1
	.asciz	"HL_CreateBrushes_r: WARNING node not splitting brush\n"

	.comm	_hl_numbrushes,4,2              ; @hl_numbrushes
.subsections_via_symbols
