	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_LoadMapFromBSP                 ## -- Begin function LoadMapFromBSP
	.p2align	4, 0x90
_LoadMapFromBSP:                        ## @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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	leaq	-32(%rbp), %rsi
	xorl	%r14d, %r14d
	xorl	%edx, %edx
	movl	$8, %ecx
	callq	_ReadQuakeFile
	cmpl	$8, %eax
	jne	LBB0_17
## %bb.1:
	movl	-32(%rbp), %edi
	callq	_LittleLong
	movl	%eax, -32(%rbp)
	movl	-28(%rbp), %edi
	callq	_LittleLong
	movl	%eax, -28(%rbp)
	movl	-32(%rbp), %ebx
	movq	_Q3_BSP_IDENT@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %ebx
	jne	LBB0_4
## %bb.2:
	movslq	%eax, %rcx
	movq	_Q3_BSP_VERSION@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_4
## %bb.3:
	xorl	%eax, %eax
	callq	_ResetMapLoading
	movq	%r15, %rdi
	callq	_Q3_LoadMapFromBSP
	xorl	%eax, %eax
	callq	_Q3_FreeMaxBSP
	movl	$1, %r14d
	jmp	LBB0_17
LBB0_4:
	movq	_Q2_BSPHEADER@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %ebx
	jne	LBB0_7
## %bb.5:
	movslq	%eax, %rcx
	movq	_Q2_BSPVERSION@GOTPCREL(%rip), %rdx
	cmpq	%rcx, (%rdx)
	jne	LBB0_7
## %bb.6:
	xorl	%eax, %eax
	callq	_ResetMapLoading
	xorl	%eax, %eax
	callq	_Q2_AllocMaxBSP
	movl	8(%r15), %edi
	movl	(%r15), %edx
	movl	4(%r15), %esi
	callq	_Q2_LoadMapFromBSP
	xorl	%eax, %eax
	callq	_Q2_FreeMaxBSP
	movl	$1, %r14d
	jmp	LBB0_17
LBB0_7:
	movq	_SIN_BSPHEADER@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %ebx
	jne	LBB0_9
## %bb.8:
	movslq	%eax, %rcx
	movq	_SIN_BSPVERSION@GOTPCREL(%rip), %rdx
	cmpq	%rcx, (%rdx)
	je	LBB0_11
LBB0_9:
	movq	_SINGAME_BSPHEADER@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %ebx
	jne	LBB0_12
## %bb.10:
	movslq	%eax, %rcx
	movq	_SINGAME_BSPVERSION@GOTPCREL(%rip), %rdx
	cmpq	%rcx, (%rdx)
	jne	LBB0_12
LBB0_11:
	xorl	%eax, %eax
	callq	_ResetMapLoading
	xorl	%eax, %eax
	callq	_Sin_AllocMaxBSP
	movl	8(%r15), %edi
	movl	(%r15), %edx
	movl	4(%r15), %esi
	callq	_Sin_LoadMapFromBSP
	xorl	%eax, %eax
	callq	_Sin_FreeMaxBSP
	movl	$1, %r14d
	jmp	LBB0_17
LBB0_12:
	movq	_Q1_BSPVERSION@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %ebx
	jne	LBB0_14
## %bb.13:
	xorl	%eax, %eax
	callq	_ResetMapLoading
	xorl	%eax, %eax
	callq	_Q1_AllocMaxBSP
	movl	8(%r15), %edi
	movl	(%r15), %edx
	movl	4(%r15), %esi
	callq	_Q1_LoadMapFromBSP
	xorl	%eax, %eax
	callq	_Q1_FreeMaxBSP
	movl	$1, %r14d
	jmp	LBB0_17
LBB0_14:
	movq	_HL_BSPVERSION@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %ebx
	jne	LBB0_16
## %bb.15:
	xorl	%eax, %eax
	callq	_ResetMapLoading
	xorl	%eax, %eax
	callq	_HL_AllocMaxBSP
	movl	8(%r15), %edi
	movl	(%r15), %edx
	movl	4(%r15), %esi
	callq	_HL_LoadMapFromBSP
	xorl	%eax, %eax
	callq	_HL_FreeMaxBSP
	movl	$1, %r14d
	jmp	LBB0_17
LBB0_16:
	movzbl	%bl, %esi
	movzbl	%bh, %edx
	movl	%ebx, %ecx
	shrl	$16, %ecx
	movzbl	%cl, %ecx
	shrl	$24, %ebx
	movslq	%eax, %r9
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %r8d
	callq	_Error
LBB0_17:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_Q3_BSP_IDENT,4,2               ## @Q3_BSP_IDENT
	.comm	_Q3_BSP_VERSION,8,3             ## @Q3_BSP_VERSION
	.comm	_Q2_BSPHEADER,4,2               ## @Q2_BSPHEADER
	.comm	_Q2_BSPVERSION,8,3              ## @Q2_BSPVERSION
	.comm	_SIN_BSPHEADER,4,2              ## @SIN_BSPHEADER
	.comm	_SIN_BSPVERSION,8,3             ## @SIN_BSPVERSION
	.comm	_SINGAME_BSPHEADER,4,2          ## @SINGAME_BSPHEADER
	.comm	_SINGAME_BSPVERSION,8,3         ## @SINGAME_BSPVERSION
	.comm	_Q1_BSPVERSION,4,2              ## @Q1_BSPVERSION
	.comm	_HL_BSPVERSION,4,2              ## @HL_BSPVERSION
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unknown BSP format %c%c%c%c, version %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_LoadMapFromBSP                 ; -- Begin function LoadMapFromBSP
	.p2align	2
_LoadMapFromBSP:                        ; @LoadMapFromBSP
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	add	x1, sp, #8
	mov	w2, #0
	mov	w3, #8
	bl	_ReadQuakeFile
	mov	x8, x0
	mov	w0, #0
	cmp	w8, #8
	b.ne	LBB0_17
; %bb.1:
	ldr	w0, [sp, #8]
	bl	_LittleLong
	str	w0, [sp, #8]
	ldr	w0, [sp, #12]
	bl	_LittleLong
	str	w0, [sp, #12]
	ldr	w8, [sp, #8]
Lloh0:
	adrp	x9, _Q3_BSP_IDENT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _Q3_BSP_IDENT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_4
; %bb.2:
Lloh3:
	adrp	x9, _Q3_BSP_VERSION@GOTPAGE
Lloh4:
	ldr	x9, [x9, _Q3_BSP_VERSION@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x9, w0, sxtw
	b.ne	LBB0_4
; %bb.3:
	bl	_ResetMapLoading
	mov	x0, x19
	bl	_Q3_LoadMapFromBSP
	bl	_Q3_FreeMaxBSP
	mov	w0, #1
	b	LBB0_17
LBB0_4:
Lloh6:
	adrp	x9, _Q2_BSPHEADER@GOTPAGE
Lloh7:
	ldr	x9, [x9, _Q2_BSPHEADER@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_7
; %bb.5:
Lloh9:
	adrp	x9, _Q2_BSPVERSION@GOTPAGE
Lloh10:
	ldr	x9, [x9, _Q2_BSPVERSION@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x9, w0, sxtw
	b.ne	LBB0_7
; %bb.6:
	bl	_ResetMapLoading
	bl	_Q2_AllocMaxBSP
	ldp	w1, w0, [x19, #4]
	ldr	w2, [x19]
	bl	_Q2_LoadMapFromBSP
	bl	_Q2_FreeMaxBSP
	mov	w0, #1
	b	LBB0_17
LBB0_7:
Lloh12:
	adrp	x9, _SIN_BSPHEADER@GOTPAGE
Lloh13:
	ldr	x9, [x9, _SIN_BSPHEADER@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_9
; %bb.8:
Lloh15:
	adrp	x9, _SIN_BSPVERSION@GOTPAGE
Lloh16:
	ldr	x9, [x9, _SIN_BSPVERSION@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x9, w0, sxtw
	b.eq	LBB0_11
LBB0_9:
Lloh18:
	adrp	x9, _SINGAME_BSPHEADER@GOTPAGE
Lloh19:
	ldr	x9, [x9, _SINGAME_BSPHEADER@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_12
; %bb.10:
Lloh21:
	adrp	x9, _SINGAME_BSPVERSION@GOTPAGE
Lloh22:
	ldr	x9, [x9, _SINGAME_BSPVERSION@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x9, w0, sxtw
	b.ne	LBB0_12
LBB0_11:
	bl	_ResetMapLoading
	bl	_Sin_AllocMaxBSP
	ldp	w1, w0, [x19, #4]
	ldr	w2, [x19]
	bl	_Sin_LoadMapFromBSP
	bl	_Sin_FreeMaxBSP
	mov	w0, #1
	b	LBB0_17
LBB0_12:
Lloh24:
	adrp	x9, _Q1_BSPVERSION@GOTPAGE
Lloh25:
	ldr	x9, [x9, _Q1_BSPVERSION@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_14
; %bb.13:
	bl	_ResetMapLoading
	bl	_Q1_AllocMaxBSP
	ldp	w1, w0, [x19, #4]
	ldr	w2, [x19]
	bl	_Q1_LoadMapFromBSP
	bl	_Q1_FreeMaxBSP
	mov	w0, #1
	b	LBB0_17
LBB0_14:
Lloh27:
	adrp	x9, _HL_BSPVERSION@GOTPAGE
Lloh28:
	ldr	x9, [x9, _HL_BSPVERSION@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_16
; %bb.15:
	bl	_ResetMapLoading
	bl	_HL_AllocMaxBSP
	ldp	w1, w0, [x19, #4]
	ldr	w2, [x19]
	bl	_HL_LoadMapFromBSP
	bl	_HL_FreeMaxBSP
	mov	w0, #1
	b	LBB0_17
LBB0_16:
	ubfx	w2, w8, #8, #8
	and	w1, w8, #0xff
	ubfx	w3, w8, #16, #8
	lsr	w4, w8, #24
	sxtw	x5, w0
Lloh30:
	adrp	x0, l_.str@PAGE
Lloh31:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Error
	mov	w0, #0
LBB0_17:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_Q3_BSP_IDENT,4,2               ; @Q3_BSP_IDENT
	.comm	_Q3_BSP_VERSION,8,3             ; @Q3_BSP_VERSION
	.comm	_Q2_BSPHEADER,4,2               ; @Q2_BSPHEADER
	.comm	_Q2_BSPVERSION,8,3              ; @Q2_BSPVERSION
	.comm	_SIN_BSPHEADER,4,2              ; @SIN_BSPHEADER
	.comm	_SIN_BSPVERSION,8,3             ; @SIN_BSPVERSION
	.comm	_SINGAME_BSPHEADER,4,2          ; @SINGAME_BSPHEADER
	.comm	_SINGAME_BSPVERSION,8,3         ; @SINGAME_BSPVERSION
	.comm	_Q1_BSPVERSION,4,2              ; @Q1_BSPVERSION
	.comm	_HL_BSPVERSION,4,2              ; @HL_BSPVERSION
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unknown BSP format %c%c%c%c, version %d\n"

.subsections_via_symbols
