	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_FindQuakeFilesInPak            ## -- Begin function FindQuakeFilesInPak
	.p2align	4, 0x90
_FindQuakeFilesInPak:                   ## @FindQuakeFilesInPak
	.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
	subq	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r13
	movq	%rdi, %rbx
	leaq	L_.str(%rip), %rsi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_1
## %bb.4:
	movq	%rax, %r12
	leaq	-104(%rbp), %rdi
	movl	$1, %esi
	movl	$32, %edx
	movq	%rax, %rcx
	callq	_fread
	cmpl	$32, %eax
	jne	LBB0_8
## %bb.5:
	movq	-104(%rbp), %r14
	movq	_IDPAKHEADER@GOTPCREL(%rip), %r15
	cmpq	(%r15), %r14
	je	LBB0_7
## %bb.6:
	movq	_SINPAKHEADER@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r14
	jne	LBB0_8
LBB0_7:
	movl	-96(%rbp), %edi
	callq	_LittleLong
	movq	_SEEK_SET@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_fseek
	testq	%rax, %rax
	je	LBB0_9
LBB0_8:
	movq	%r12, %rdi
	callq	_fclose
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_2
LBB0_1:
	leaq	L_.str.1(%rip), %rdi
LBB0_2:
	movq	%rbx, %rsi
LBB0_3:
	callq	_Warning
	xorl	%eax, %eax
LBB0_41:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	(%r15), %rbx
	movl	-92(%rbp), %edi
	callq	_LittleLong
	movl	%eax, %r13d
	sarl	$5, %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	%r13d, -56(%rbp)                ## 4-byte Spill
	andl	$-32, %r13d
	movl	%r13d, %edi
	callq	_malloc
	movq	%rax, %r15
	cmpq	%rbx, %r14
	jne	LBB0_21
## %bb.10:
	testq	%r15, %r15
	jne	LBB0_12
## %bb.11:
	leaq	L_.str.3(%rip), %rdi
	callq	_Error
LBB0_12:
	movq	%r15, %rdi
	movl	$32, %esi
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edx
	movq	%r12, %rcx
	callq	_fread
	movl	%eax, %r14d
	movq	%r12, %rdi
	callq	_fclose
	cmpl	%ebx, %r14d
	jne	LBB0_13
## %bb.15:
	movl	%r13d, %edi
	callq	_malloc
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_17
## %bb.16:
	leaq	L_.str.3(%rip), %rdi
	callq	_Error
LBB0_17:
	movl	-56(%rbp), %r13d                ## 4-byte Reload
	cmpl	$32, %r13d
	jl	LBB0_20
## %bb.18:
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	cmpl	$2, %eax
	movl	$1, %r14d
	cmovgel	%eax, %r14d
	shlq	$5, %r14
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%r12,%rbx), %rdi
	movq	16(%r15,%rbx), %rsi
	callq	_strcpy
	movl	24(%r15,%rbx), %edi
	callq	_LittleLong
	movl	%eax, 24(%r12,%rbx)
	movl	28(%r15,%rbx), %edi
	callq	_LittleLong
	movl	%eax, 28(%r12,%rbx)
	addq	$32, %rbx
	cmpq	%rbx, %r14
	jne	LBB0_19
LBB0_20:
	movq	%r15, %rdi
	callq	_free
	jmp	LBB0_29
LBB0_21:
	testq	%r15, %r15
	jne	LBB0_23
## %bb.22:
	leaq	L_.str.3(%rip), %rdi
	callq	_Error
LBB0_23:
	movq	%r15, %rdi
	movl	$32, %esi
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edx
	movq	%r12, %rcx
	callq	_fread
	movl	%eax, %r13d
	movq	%r12, %rdi
	callq	_fclose
	cmpl	%ebx, %r13d
	jne	LBB0_24
## %bb.25:
	movq	%r15, %r12
	movl	-56(%rbp), %r13d                ## 4-byte Reload
	cmpl	$32, %r13d
	jl	LBB0_29
## %bb.26:
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	cmpl	$2, %eax
	movl	$1, %r14d
	cmovgel	%eax, %r14d
	shlq	$5, %r14
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_27:                                ## =>This Inner Loop Header: Depth=1
	movl	24(%r15,%rbx), %edi
	callq	_LittleLong
	movl	%eax, 24(%r15,%rbx)
	movl	28(%r15,%rbx), %edi
	callq	_LittleLong
	movl	%eax, 28(%r15,%rbx)
	addq	$32, %rbx
	cmpq	%rbx, %r14
	jne	LBB0_27
## %bb.28:
	movq	%r15, %r12
LBB0_29:
	cmpl	$32, %r13d
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	jl	LBB0_30
## %bb.31:
	movl	-48(%rbp), %r13d                ## 4-byte Reload
	leaq	16(%r12), %r14
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_32
LBB0_33:                                ##   in Loop: Header=BB0_32 Depth=1
	movq	%r12, %rbx
LBB0_39:                                ##   in Loop: Header=BB0_32 Depth=1
	addq	$32, %r14
	movq	%rbx, %r12
	decq	%r13
	je	LBB0_40
LBB0_32:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rdi
	callq	_ConvertPath
	movq	(%r14), %rsi
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	xorl	%edx, %edx
	callq	_FileFilter
	testq	%rax, %rax
	je	LBB0_33
## %bb.34:                              ##   in Loop: Header=BB0_32 Depth=1
	movl	$56, %edi
	callq	_malloc
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_36
## %bb.35:                              ##   in Loop: Header=BB0_32 Depth=1
	leaq	L_.str.3(%rip), %rdi
	callq	_Error
LBB0_36:                                ##   in Loop: Header=BB0_32 Depth=1
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$56, %edx
	callq	_memset
	movq	(%rbx), %rdi
	movq	%r15, %rsi
	callq	_strcpy
	movq	8(%rbx), %rdi
	movq	%r15, %rsi
	callq	_strcpy
	movq	16(%rbx), %rdi
	movq	(%r14), %rsi
	callq	_strcpy
	movl	$0, 24(%rbx)
	movl	8(%r14), %eax
	movl	%eax, 28(%rbx)
	movl	12(%r14), %eax
	movl	%eax, 32(%rbx)
	movq	(%r14), %rdi
	callq	_QuakeFileType
	movl	%eax, 48(%rbx)
	movq	$0, 40(%rbx)
	testq	%r12, %r12
	je	LBB0_37
## %bb.38:                              ##   in Loop: Header=BB0_32 Depth=1
	movq	%rbx, 40(%r12)
	jmp	LBB0_39
LBB0_37:                                ##   in Loop: Header=BB0_32 Depth=1
	movq	%rbx, %rax
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_39
LBB0_13:
	movq	%r15, %rdi
	callq	_free
	leaq	L_.str.4(%rip), %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	jmp	LBB0_3
LBB0_24:
	movq	%r15, %rdi
	callq	_free
	leaq	L_.str.5(%rip), %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	jmp	LBB0_3
LBB0_30:
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
LBB0_40:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_free
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	jmp	LBB0_41
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rb"

L_.str.1:                               ## @.str.1
	.asciz	"can't open pak file %s"

	.comm	_IDPAKHEADER,8,3                ## @IDPAKHEADER
	.comm	_SINPAKHEADER,8,3               ## @SINPAKHEADER
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
L_.str.2:                               ## @.str.2
	.asciz	"invalid pak file %s"

L_.str.3:                               ## @.str.3
	.asciz	"out of memory"

L_.str.4:                               ## @.str.4
	.asciz	"can't read the Quake pak file dir entries from %s"

L_.str.5:                               ## @.str.5
	.asciz	"can't read the Sin pak file dir entries from %s"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_FindQuakeFilesInPak            ; -- Begin function FindQuakeFilesInPak
	.p2align	2
_FindQuakeFilesInPak:                   ; @FindQuakeFilesInPak
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fopen
	cbz	x0, LBB0_5
; %bb.1:
	mov	x22, x0
	mov	x0, sp
	mov	w1, #1
	mov	w2, #32
	mov	x3, x22
	bl	_fread
	cmp	w0, #32
	b.ne	LBB0_4
; %bb.2:
	ldr	x26, [sp]
Lloh2:
	adrp	x21, _IDPAKHEADER@GOTPAGE
Lloh3:
	ldr	x21, [x21, _IDPAKHEADER@GOTPAGEOFF]
	ldr	x8, [x21]
Lloh4:
	adrp	x9, _SINPAKHEADER@GOTPAGE
Lloh5:
	ldr	x9, [x9, _SINPAKHEADER@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	cmp	x26, x8
	ccmp	x26, x9, #4, ne
	b.ne	LBB0_4
; %bb.3:
	ldr	w0, [sp, #8]
	bl	_LittleLong
	mov	x1, x0
Lloh7:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
	mov	x0, x22
	bl	_fseek
	cbz	x0, LBB0_8
LBB0_4:
	mov	x0, x22
	bl	_fclose
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_6
LBB0_5:
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_6:
	mov	x1, x19
	bl	_Warning
	mov	x23, #0
LBB0_7:
	mov	x0, x23
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_8:
	ldr	x27, [x21]
	ldr	w0, [sp, #12]
	bl	_LittleLong
	mov	x23, x0
	asr	w21, w0, #5
	and	w25, w0, #0xffffffe0
	mov	x0, x25
	bl	_malloc
	mov	x24, x0
	cmp	x26, x27
	b.ne	LBB0_18
; %bb.9:
	cbnz	x24, LBB0_11
; %bb.10:
Lloh14:
	adrp	x0, l_.str.3@PAGE
Lloh15:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_Error
LBB0_11:
	mov	x0, x24
	mov	w1, #32
	mov	x2, x21
	mov	x3, x22
	bl	_fread
	mov	x26, x0
	mov	x0, x22
	bl	_fclose
	cmp	w26, w21
	b.ne	LBB0_35
; %bb.12:
	mov	x0, x25
	bl	_malloc
	mov	x22, x0
	cbnz	x0, LBB0_14
; %bb.13:
Lloh16:
	adrp	x0, l_.str.3@PAGE
Lloh17:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_Error
LBB0_14:
	cmp	w23, #32
	b.lt	LBB0_17
; %bb.15:
	cmp	w21, #1
	csinc	w25, w21, wzr, gt
	add	x26, x22, #28
	add	x27, x24, #28
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	ldur	x0, [x26, #-12]
	ldur	x1, [x27, #-12]
	bl	_strcpy
	ldur	w0, [x27, #-4]
	bl	_LittleLong
	stur	w0, [x26, #-4]
	ldr	w0, [x27], #32
	bl	_LittleLong
	str	w0, [x26], #32
	subs	x25, x25, #1
	b.ne	LBB0_16
LBB0_17:
	mov	x0, x24
	bl	_free
	b	LBB0_25
LBB0_18:
	cbnz	x24, LBB0_20
; %bb.19:
Lloh18:
	adrp	x0, l_.str.3@PAGE
Lloh19:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_Error
LBB0_20:
	mov	x0, x24
	mov	w1, #32
	mov	x2, x21
	mov	x3, x22
	bl	_fread
	mov	x25, x0
	mov	x0, x22
	bl	_fclose
	cmp	w25, w21
	b.ne	LBB0_36
; %bb.21:
	mov	x22, x24
	cmp	w23, #32
	b.lt	LBB0_25
; %bb.22:
	cmp	w21, #1
	csinc	w22, w21, wzr, gt
	add	x25, x24, #28
LBB0_23:                                ; =>This Inner Loop Header: Depth=1
	ldur	w0, [x25, #-4]
	bl	_LittleLong
	stur	w0, [x25, #-4]
	ldr	w0, [x25]
	bl	_LittleLong
	str	w0, [x25], #32
	subs	x22, x22, #1
	b.ne	LBB0_23
; %bb.24:
	mov	x22, x24
LBB0_25:
	cmp	w23, #32
	b.lt	LBB0_37
; %bb.26:
	mov	x27, #0
	mov	x23, #0
	add	x26, x22, #16
Lloh20:
	adrp	x24, l_.str.3@PAGE
Lloh21:
	add	x24, x24, l_.str.3@PAGEOFF
	b	LBB0_29
LBB0_27:                                ;   in Loop: Header=BB0_29 Depth=1
	mov	x25, x27
LBB0_28:                                ;   in Loop: Header=BB0_29 Depth=1
	add	x26, x26, #32
	mov	x27, x25
	subs	x21, x21, #1
	b.eq	LBB0_38
LBB0_29:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x26]
	bl	_ConvertPath
	ldr	x1, [x26]
	mov	x0, x20
	mov	w2, #0
	bl	_FileFilter
	cbz	x0, LBB0_27
; %bb.30:                               ;   in Loop: Header=BB0_29 Depth=1
	mov	w0, #56
	bl	_malloc
	mov	x25, x0
	cbnz	x0, LBB0_32
; %bb.31:                               ;   in Loop: Header=BB0_29 Depth=1
	mov	x0, x24
	bl	_Error
LBB0_32:                                ;   in Loop: Header=BB0_29 Depth=1
	mov	x0, x25
	mov	w1, #0
	mov	w2, #56
	bl	_memset
	ldr	x0, [x25]
	mov	x1, x19
	bl	_strcpy
	ldr	x0, [x25, #8]
	mov	x1, x19
	bl	_strcpy
	ldr	x0, [x25, #16]
	ldr	x1, [x26]
	bl	_strcpy
	str	wzr, [x25, #24]
	ldr	d0, [x26, #8]
	stur	d0, [x25, #28]
	ldr	x0, [x26]
	bl	_QuakeFileType
	str	w0, [x25, #48]
	str	xzr, [x25, #40]
	cbz	x27, LBB0_34
; %bb.33:                               ;   in Loop: Header=BB0_29 Depth=1
	str	x25, [x27, #40]
	b	LBB0_28
LBB0_34:                                ;   in Loop: Header=BB0_29 Depth=1
	mov	x23, x25
	b	LBB0_28
LBB0_35:
	mov	x0, x24
	bl	_free
Lloh22:
	adrp	x0, l_.str.4@PAGE
Lloh23:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_6
LBB0_36:
	mov	x0, x24
	bl	_free
Lloh24:
	adrp	x0, l_.str.5@PAGE
Lloh25:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_6
LBB0_37:
	mov	x23, #0
LBB0_38:
	mov	x0, x22
	bl	_free
	b	LBB0_7
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rb"

l_.str.1:                               ; @.str.1
	.asciz	"can't open pak file %s"

	.comm	_IDPAKHEADER,8,3                ; @IDPAKHEADER
	.comm	_SINPAKHEADER,8,3               ; @SINPAKHEADER
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
l_.str.2:                               ; @.str.2
	.asciz	"invalid pak file %s"

l_.str.3:                               ; @.str.3
	.asciz	"out of memory"

l_.str.4:                               ; @.str.4
	.asciz	"can't read the Quake pak file dir entries from %s"

l_.str.5:                               ; @.str.5
	.asciz	"can't read the Sin pak file dir entries from %s"

.subsections_via_symbols
