	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Q3_LoadMapFromBSP              ## -- Begin function Q3_LoadMapFromBSP
	.p2align	4, 0x90
_Q3_LoadMapFromBSP:                     ## @Q3_LoadMapFromBSP
	.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	%rdi, %rbx
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_Log_Print
	movq	_MAPTYPE_QUAKE3@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_loadedmaptype@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	(%rbx), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_Log_Print
	movq	%rbx, %rdi
	callq	_Q3_LoadBSPFile
	movq	_MAX_MAPFILE_BRUSHES@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_3
## %bb.1:
	movq	_brushmodelnumbers@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	$-1, (%rcx,%rdx,4)
	incq	%rdx
	movslq	(%rax), %rsi
	cmpq	%rsi, %rdx
	jl	LBB0_2
LBB0_3:
	movq	_nummapbrushsides@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_num_entities@GOTPCREL(%rip), %r14
	movl	$0, (%r14)
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_Q3_ParseEntities
	cmpl	$0, (%r14)
	jle	LBB0_5
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_Q3_ParseBSPEntity
	incl	%ebx
	cmpl	(%r14), %ebx
	jl	LBB0_4
LBB0_5:
	xorl	%eax, %eax
	callq	_AAS_CreateCurveBrushes
	movq	_map_mins@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	movq	_map_maxs@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	callq	_ClearBounds
	movq	_entities@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpl	$0, (%rax)
	jle	LBB0_10
## %bb.6:
	xorl	%ebx, %ebx
	movq	_mapbrushes@GOTPCREL(%rip), %r13
	xorl	%r15d, %r15d
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	incq	%r15
	movslq	(%rax), %rcx
	addq	$16, %rbx
	cmpq	%rcx, %r15
	jge	LBB0_10
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rcx
	cmpq	$0, (%rcx,%rbx)
	jle	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	12(%rcx,%rbx), %edi
	movl	(%r14), %esi
	movl	(%r12), %edx
	callq	_AddPointToBounds
	movq	(%r13), %rax
	movl	8(%rax,%rbx), %edi
	movl	(%r14), %esi
	movl	(%r12), %edx
	callq	_AddPointToBounds
	movq	_entities@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	jmp	LBB0_9
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"-- Q3_LoadMapFromBSP --\n"

	.comm	_MAPTYPE_QUAKE3,4,2             ## @MAPTYPE_QUAKE3
	.comm	_loadedmaptype,4,2              ## @loadedmaptype
L_.str.1:                               ## @.str.1
	.asciz	"Loading map from %s...\n"

	.comm	_MAX_MAPFILE_BRUSHES,4,2        ## @MAX_MAPFILE_BRUSHES
	.comm	_brushmodelnumbers,8,3          ## @brushmodelnumbers
	.comm	_nummapbrushsides,8,3           ## @nummapbrushsides
	.comm	_num_entities,4,2               ## @num_entities
	.comm	_map_mins,4,2                   ## @map_mins
	.comm	_map_maxs,4,2                   ## @map_maxs
	.comm	_entities,8,3                   ## @entities
	.comm	_mapbrushes,8,3                 ## @mapbrushes
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Q3_LoadMapFromBSP              ; -- Begin function Q3_LoadMapFromBSP
	.p2align	2
_Q3_LoadMapFromBSP:                     ; @Q3_LoadMapFromBSP
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Log_Print
Lloh2:
	adrp	x8, _MAPTYPE_QUAKE3@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MAPTYPE_QUAKE3@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _loadedmaptype@GOTPAGE
Lloh6:
	ldr	x9, [x9, _loadedmaptype@GOTPAGEOFF]
Lloh7:
	str	w8, [x9]
	ldr	w8, [x19]
	str	x8, [sp]
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_Log_Print
	mov	x0, x19
	bl	_Q3_LoadBSPFile
Lloh10:
	adrp	x8, _MAX_MAPFILE_BRUSHES@GOTPAGE
Lloh11:
	ldr	x8, [x8, _MAX_MAPFILE_BRUSHES@GOTPAGEOFF]
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x9, #0
Lloh12:
	adrp	x10, _brushmodelnumbers@GOTPAGE
Lloh13:
	ldr	x10, [x10, _brushmodelnumbers@GOTPAGEOFF]
Lloh14:
	ldr	x10, [x10]
	mov	w11, #-1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	str	w11, [x10, x9, lsl #2]
	add	x9, x9, #1
	ldrsw	x12, [x8]
	cmp	x9, x12
	b.lt	LBB0_2
LBB0_3:
Lloh15:
	adrp	x8, _nummapbrushsides@GOTPAGE
Lloh16:
	ldr	x8, [x8, _nummapbrushsides@GOTPAGEOFF]
Lloh17:
	str	xzr, [x8]
Lloh18:
	adrp	x20, _num_entities@GOTPAGE
Lloh19:
	ldr	x20, [x20, _num_entities@GOTPAGEOFF]
	str	wzr, [x20]
	bl	_Q3_ParseEntities
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.4:
	mov	w19, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_Q3_ParseBSPEntity
	add	w19, w19, #1
	ldr	w8, [x20]
	cmp	w19, w8
	b.lt	LBB0_5
LBB0_6:
	bl	_AAS_CreateCurveBrushes
Lloh20:
	adrp	x19, _map_mins@GOTPAGE
Lloh21:
	ldr	x19, [x19, _map_mins@GOTPAGEOFF]
	ldr	w0, [x19]
Lloh22:
	adrp	x20, _map_maxs@GOTPAGE
Lloh23:
	ldr	x20, [x20, _map_maxs@GOTPAGEOFF]
	ldr	w1, [x20]
	bl	_ClearBounds
Lloh24:
	adrp	x21, _entities@GOTPAGE
Lloh25:
	ldr	x21, [x21, _entities@GOTPAGEOFF]
	ldr	x8, [x21]
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_11
; %bb.7:
	mov	x22, #0
	mov	x23, #0
Lloh26:
	adrp	x24, _mapbrushes@GOTPAGE
Lloh27:
	ldr	x24, [x24, _mapbrushes@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	x23, x23, #1
	ldrsw	x9, [x8]
	add	x22, x22, #16
	cmp	x23, x9
	b.ge	LBB0_11
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x24]
	ldr	x10, [x9, x22]
	cmp	x10, #1
	b.lt	LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	add	x8, x9, x22
	ldr	w0, [x8, #12]
	ldr	w1, [x19]
	ldr	w2, [x20]
	bl	_AddPointToBounds
	ldr	x8, [x24]
	add	x8, x8, x22
	ldr	w0, [x8, #8]
	ldr	w1, [x19]
	ldr	w2, [x20]
	bl	_AddPointToBounds
	ldr	x8, [x21]
	b	LBB0_8
LBB0_11:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotStr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotStr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"-- Q3_LoadMapFromBSP --\n"

	.comm	_MAPTYPE_QUAKE3,4,2             ; @MAPTYPE_QUAKE3
	.comm	_loadedmaptype,4,2              ; @loadedmaptype
l_.str.1:                               ; @.str.1
	.asciz	"Loading map from %s...\n"

	.comm	_MAX_MAPFILE_BRUSHES,4,2        ; @MAX_MAPFILE_BRUSHES
	.comm	_brushmodelnumbers,8,3          ; @brushmodelnumbers
	.comm	_nummapbrushsides,8,3           ; @nummapbrushsides
	.comm	_num_entities,4,2               ; @num_entities
	.comm	_map_mins,4,2                   ; @map_mins
	.comm	_map_maxs,4,2                   ; @map_maxs
	.comm	_entities,8,3                   ; @entities
	.comm	_mapbrushes,8,3                 ; @mapbrushes
.subsections_via_symbols
