	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Q1_LoadMapFromBSP              ## -- Begin function Q1_LoadMapFromBSP
	.p2align	4, 0x90
_Q1_LoadMapFromBSP:                     ## @Q1_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
	movl	%edx, %r14d
	movl	%esi, %r15d
	movq	%rdi, %rbx
	leaq	L_.str(%rip), %rdi
	callq	_Log_Print
	movq	_MAPTYPE_QUAKE1@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_loadedmaptype@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	leaq	L_.str.1(%rip), %rdi
	movq	%rbx, %rsi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_qprintf
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movl	%r14d, %edx
	callq	_Q1_LoadBSPFile
	movq	_q1_numclipbrushes@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	xorl	%eax, %eax
	callq	_Q1_ParseEntities
	movq	_map_mins@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_map_maxs@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_ClearBounds
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_qprintf
	movq	_lessbrushes@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	leaq	L_.str.4(%rip), %rax
	leaq	L_.str.3(%rip), %rdi
	cmoveq	%rax, %rdi
	xorl	%eax, %eax
	callq	_qprintf
	movq	_num_entities@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_10
## %bb.1:
	xorl	%r12d, %r12d
	movq	_nummapbrushes@GOTPCREL(%rip), %r15
	movq	_entities@GOTPCREL(%rip), %r14
	leaq	L_.str.5(%rip), %rbx
	xorl	%r13d, %r13d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	xorl	%esi, %esi
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r14), %rdi
	addq	%r12, %rdi
	callq	_Q1_CreateMapBrushes
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%r13
	movq	_num_entities@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	$16, %r12
	cmpq	%rax, %r13
	jge	LBB0_10
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %eax
	movq	(%r14), %rcx
	leaq	(%rcx,%r12), %rdi
	movl	%eax, 8(%rcx,%r12)
	movq	$0, (%rcx,%r12)
	movq	%rbx, %rsi
	callq	_ValueForKey
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %rdi
	leaq	L_.str.6(%rip), %rsi
	callq	_strcmp
	testl	%eax, %eax
	je	LBB0_4
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r14), %rdi
	addq	%r12, %rdi
	leaq	L_.str.7(%rip), %rsi
	callq	_ValueForKey
	testq	%rax, %rax
	je	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpb	$42, (%rax)
	jne	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	incq	%rax
	movq	%rax, %rdi
	callq	_atoi
	movl	%eax, %esi
	jmp	LBB0_8
LBB0_10:
	movq	_nummapbrushes@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.8(%rip), %rdi
	xorl	%eax, %eax
	callq	_qprintf
	movq	_q1_numclipbrushes@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.9(%rip), %rdi
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_qprintf                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"-- Q1_LoadMapFromBSP --\n"

	.comm	_MAPTYPE_QUAKE1,4,2             ## @MAPTYPE_QUAKE1
	.comm	_loadedmaptype,4,2              ## @loadedmaptype
L_.str.1:                               ## @.str.1
	.asciz	"loading map from %s at %d\n"

	.comm	_q1_numclipbrushes,4,2          ## @q1_numclipbrushes
	.comm	_map_mins,4,2                   ## @map_mins
	.comm	_map_maxs,4,2                   ## @map_maxs
L_.str.2:                               ## @.str.2
	.asciz	"creating Quake1 brushes\n"

	.comm	_lessbrushes,8,3                ## @lessbrushes
L_.str.3:                               ## @.str.3
	.asciz	"creating minimum number of brushes\n"

L_.str.4:                               ## @.str.4
	.asciz	"placing textures correctly\n"

	.comm	_num_entities,4,2               ## @num_entities
	.comm	_nummapbrushes,4,2              ## @nummapbrushes
	.comm	_entities,8,3                   ## @entities
L_.str.5:                               ## @.str.5
	.asciz	"classname"

L_.str.6:                               ## @.str.6
	.asciz	"worldspawn"

L_.str.7:                               ## @.str.7
	.asciz	"model"

L_.str.8:                               ## @.str.8
	.asciz	"%5d map brushes\n"

L_.str.9:                               ## @.str.9
	.asciz	"%5d clip brushes\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Q1_LoadMapFromBSP              ; -- Begin function Q1_LoadMapFromBSP
	.p2align	2
_Q1_LoadMapFromBSP:                     ; @Q1_LoadMapFromBSP
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Log_Print
Lloh2:
	adrp	x8, _MAPTYPE_QUAKE1@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MAPTYPE_QUAKE1@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _loadedmaptype@GOTPAGE
Lloh6:
	ldr	x9, [x9, _loadedmaptype@GOTPAGEOFF]
Lloh7:
	str	w8, [x9]
	stp	x21, x20, [sp]
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_qprintf
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_Q1_LoadBSPFile
Lloh10:
	adrp	x22, _q1_numclipbrushes@GOTPAGE
Lloh11:
	ldr	x22, [x22, _q1_numclipbrushes@GOTPAGEOFF]
	str	wzr, [x22]
	bl	_Q1_ParseEntities
Lloh12:
	adrp	x8, _map_mins@GOTPAGE
Lloh13:
	ldr	x8, [x8, _map_mins@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
Lloh15:
	adrp	x8, _map_maxs@GOTPAGE
Lloh16:
	ldr	x8, [x8, _map_maxs@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	bl	_ClearBounds
Lloh18:
	adrp	x0, l_.str.2@PAGE
Lloh19:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_qprintf
Lloh20:
	adrp	x8, _lessbrushes@GOTPAGE
Lloh21:
	ldr	x8, [x8, _lessbrushes@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
Lloh23:
	adrp	x9, l_.str.3@PAGE
Lloh24:
	add	x9, x9, l_.str.3@PAGEOFF
Lloh25:
	adrp	x10, l_.str.4@PAGE
Lloh26:
	add	x10, x10, l_.str.4@PAGEOFF
	cmp	x8, #0
	csel	x0, x10, x9, eq
	bl	_qprintf
Lloh27:
	adrp	x23, _num_entities@GOTPAGE
Lloh28:
	ldr	x23, [x23, _num_entities@GOTPAGEOFF]
	ldr	w8, [x23]
Lloh29:
	adrp	x24, _nummapbrushes@GOTPAGE
Lloh30:
	ldr	x24, [x24, _nummapbrushes@GOTPAGEOFF]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.1:
	mov	x25, #0
	mov	x26, #0
Lloh31:
	adrp	x27, _entities@GOTPAGE
Lloh32:
	ldr	x27, [x27, _entities@GOTPAGEOFF]
Lloh33:
	adrp	x19, l_.str.5@PAGE
Lloh34:
	add	x19, x19, l_.str.5@PAGEOFF
Lloh35:
	adrp	x20, l_.str.7@PAGE
Lloh36:
	add	x20, x20, l_.str.7@PAGEOFF
Lloh37:
	adrp	x21, l_.str.6@PAGE
Lloh38:
	add	x21, x21, l_.str.6@PAGEOFF
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	w1, #0
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x27]
	add	x0, x8, x25
	bl	_Q1_CreateMapBrushes
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x26, x26, #1
	ldrsw	x8, [x23]
	add	x25, x25, #16
	cmp	x26, x8
	b.ge	LBB0_10
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x24]
	ldr	x9, [x27]
	add	x0, x9, x25
	str	w8, [x0, #8]
	str	xzr, [x0]
	mov	x1, x19
	bl	_ValueForKey
	cbz	x0, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x1, x21
	bl	_strcmp
	cbz	w0, LBB0_2
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x27]
	add	x0, x8, x25
	mov	x1, x20
	bl	_ValueForKey
	cbz	x0, LBB0_4
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	ldrb	w8, [x0]
	cmp	w8, #42
	b.ne	LBB0_4
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x0, x0, #1
	bl	_atoi
	mov	x1, x0
	b	LBB0_3
LBB0_10:
	ldr	w8, [x24]
	str	x8, [sp]
Lloh39:
	adrp	x0, l_.str.8@PAGE
Lloh40:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_qprintf
	ldr	w8, [x22]
	str	x8, [sp]
Lloh41:
	adrp	x0, l_.str.9@PAGE
Lloh42:
	add	x0, x0, l_.str.9@PAGEOFF
	bl	_qprintf
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotStr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpAdd	Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"-- Q1_LoadMapFromBSP --\n"

	.comm	_MAPTYPE_QUAKE1,4,2             ; @MAPTYPE_QUAKE1
	.comm	_loadedmaptype,4,2              ; @loadedmaptype
l_.str.1:                               ; @.str.1
	.asciz	"loading map from %s at %d\n"

	.comm	_q1_numclipbrushes,4,2          ; @q1_numclipbrushes
	.comm	_map_mins,4,2                   ; @map_mins
	.comm	_map_maxs,4,2                   ; @map_maxs
l_.str.2:                               ; @.str.2
	.asciz	"creating Quake1 brushes\n"

	.comm	_lessbrushes,8,3                ; @lessbrushes
l_.str.3:                               ; @.str.3
	.asciz	"creating minimum number of brushes\n"

l_.str.4:                               ; @.str.4
	.asciz	"placing textures correctly\n"

	.comm	_num_entities,4,2               ; @num_entities
	.comm	_nummapbrushes,4,2              ; @nummapbrushes
	.comm	_entities,8,3                   ; @entities
l_.str.5:                               ; @.str.5
	.asciz	"classname"

l_.str.6:                               ; @.str.6
	.asciz	"worldspawn"

l_.str.7:                               ; @.str.7
	.asciz	"model"

l_.str.8:                               ; @.str.8
	.asciz	"%5d map brushes\n"

l_.str.9:                               ; @.str.9
	.asciz	"%5d clip brushes\n"

.subsections_via_symbols
