	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Q2_LoadMapFile                 ## -- Begin function Q2_LoadMapFile
	.p2align	4, 0x90
_Q2_LoadMapFile:                        ## @Q2_LoadMapFile
	.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, %r14
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_Log_Print
	movq	%r14, %rdi
	callq	_LoadScriptFile
	testq	%rax, %rax
	je	LBB0_9
## %bb.1:
	movq	%rax, %r13
	movq	_SCFL_NOSTRINGWHITESPACES@GOTPCREL(%rip), %rax
	movq	_SCFL_NOSTRINGESCAPECHARS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	_SCFL_PRIMITIVE@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	%r13, %rdi
	callq	_SetScriptFlags
	movq	_nummapbrushsides@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_num_entities@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	callq	_Q2_ParseMapEntity
	testq	%rax, %rax
	jne	LBB0_2
## %bb.3:
	movq	_map_mins@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_map_maxs@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_ClearBounds
	movq	_entities@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpl	$0, (%rax)
	jle	LBB0_8
## %bb.4:
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	incq	%r14
	movslq	(%rax), %rcx
	addq	$16, %rbx
	cmpq	%rcx, %r14
	jge	LBB0_8
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	_mapbrushes@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rcx,%rbx), %rdi
	cmpl	$4096, (%rdi)                   ## imm = 0x1000
	jg	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	_map_mins@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_map_maxs@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	callq	_AddPointToBounds
	movq	_mapbrushes@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	8(%rax,%rbx), %rdi
	movl	(%r15), %esi
	movl	(%r12), %edx
	callq	_AddPointToBounds
	movq	_entities@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	jmp	LBB0_7
LBB0_8:
	xorl	%eax, %eax
	callq	_PrintMapInfo
	movq	%r13, %rdi
	callq	_FreeScript
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_Q2_CreateMapTexinfo            ## TAILCALL
LBB0_9:
	leaq	L_.str.1(%rip), %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_Log_Print                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"-- Q2_LoadMapFile --\n"

L_.str.1:                               ## @.str.1
	.asciz	"couldn't open %s\n"

	.comm	_SCFL_NOSTRINGWHITESPACES,4,2   ## @SCFL_NOSTRINGWHITESPACES
	.comm	_SCFL_NOSTRINGESCAPECHARS,4,2   ## @SCFL_NOSTRINGESCAPECHARS
	.comm	_SCFL_PRIMITIVE,4,2             ## @SCFL_PRIMITIVE
	.comm	_nummapbrushsides,8,3           ## @nummapbrushsides
	.comm	_num_entities,8,3               ## @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
	.comm	_MAPTYPE_QUAKE2,4,2             ## @MAPTYPE_QUAKE2
	.comm	_loadedmaptype,4,2              ## @loadedmaptype
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Q2_LoadMapFile                 ; -- Begin function Q2_LoadMapFile
	.p2align	2
_Q2_LoadMapFile:                        ; @Q2_LoadMapFile
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x20, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Log_Print
	mov	x0, x20
	bl	_LoadScriptFile
	cbz	x0, LBB0_9
; %bb.1:
	mov	x19, x0
Lloh2:
	adrp	x8, _SCFL_NOSTRINGWHITESPACES@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SCFL_NOSTRINGWHITESPACES@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _SCFL_NOSTRINGESCAPECHARS@GOTPAGE
Lloh6:
	ldr	x9, [x9, _SCFL_NOSTRINGESCAPECHARS@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh8:
	adrp	x9, _SCFL_PRIMITIVE@GOTPAGE
Lloh9:
	ldr	x9, [x9, _SCFL_PRIMITIVE@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w1, w8, w9
	bl	_SetScriptFlags
Lloh11:
	adrp	x8, _nummapbrushsides@GOTPAGE
Lloh12:
	ldr	x8, [x8, _nummapbrushsides@GOTPAGEOFF]
Lloh13:
	str	xzr, [x8]
Lloh14:
	adrp	x8, _num_entities@GOTPAGE
Lloh15:
	ldr	x8, [x8, _num_entities@GOTPAGEOFF]
Lloh16:
	str	xzr, [x8]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_Q2_ParseMapEntity
	cbnz	x0, LBB0_2
; %bb.3:
Lloh17:
	adrp	x20, _map_mins@GOTPAGE
Lloh18:
	ldr	x20, [x20, _map_mins@GOTPAGEOFF]
	ldr	w0, [x20]
Lloh19:
	adrp	x21, _map_maxs@GOTPAGE
Lloh20:
	ldr	x21, [x21, _map_maxs@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_ClearBounds
Lloh21:
	adrp	x22, _entities@GOTPAGE
Lloh22:
	ldr	x22, [x22, _entities@GOTPAGEOFF]
	ldr	x8, [x22]
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_8
; %bb.4:
	mov	x23, #0
	mov	x24, #0
Lloh23:
	adrp	x25, _mapbrushes@GOTPAGE
Lloh24:
	ldr	x25, [x25, _mapbrushes@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x24, x24, #1
	ldrsw	x9, [x8]
	add	x23, x23, #16
	cmp	x24, x9
	b.ge	LBB0_8
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x25]
	ldr	x0, [x9, x23]
	ldr	w9, [x0]
	cmp	w9, #1, lsl #12                 ; =4096
	b.gt	LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w1, [x20]
	ldr	w2, [x21]
	bl	_AddPointToBounds
	ldr	x8, [x25]
	add	x8, x8, x23
	ldr	x0, [x8, #8]
	ldr	w1, [x20]
	ldr	w2, [x21]
	bl	_AddPointToBounds
	ldr	x8, [x22]
	b	LBB0_5
LBB0_8:
	bl	_PrintMapInfo
	mov	x0, x19
	bl	_FreeScript
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	b	_Q2_CreateMapTexinfo
LBB0_9:
	str	x20, [sp]
Lloh25:
	adrp	x0, l_.str.1@PAGE
Lloh26:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_Log_Print
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotStr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotStr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"-- Q2_LoadMapFile --\n"

l_.str.1:                               ; @.str.1
	.asciz	"couldn't open %s\n"

	.comm	_SCFL_NOSTRINGWHITESPACES,4,2   ; @SCFL_NOSTRINGWHITESPACES
	.comm	_SCFL_NOSTRINGESCAPECHARS,4,2   ; @SCFL_NOSTRINGESCAPECHARS
	.comm	_SCFL_PRIMITIVE,4,2             ; @SCFL_PRIMITIVE
	.comm	_nummapbrushsides,8,3           ; @nummapbrushsides
	.comm	_num_entities,8,3               ; @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
	.comm	_MAPTYPE_QUAKE2,4,2             ; @MAPTYPE_QUAKE2
	.comm	_loadedmaptype,4,2              ; @loadedmaptype
.subsections_via_symbols
