	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_W_AddFile                      ## -- Begin function W_AddFile
	.p2align	4, 0x90
_W_AddFile:                             ## @W_AddFile
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	cmpb	$126, (%rdi)
	jne	LBB0_2
## %bb.1:
	incq	%rbx
	movq	_reloadname@GOTPCREL(%rip), %rax
	movq	%rbx, (%rax)
	movq	_numlumps@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_reloadlump@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
LBB0_2:
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movq	_O_BINARY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_open
	cmpl	$-1, %eax
	je	LBB0_17
## %bb.3:
	movl	%eax, %r14d
	leaq	L_.str.1(%rip), %rdi
	movq	%rbx, %rsi
	callq	_printf
	movq	_numlumps@GOTPCREL(%rip), %r12
	movl	(%r12), %r13d
	movq	%rbx, %rdi
	callq	_strlen
	cltq
	leaq	(%rbx,%rax), %rdi
	addq	$-3, %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_strcmpi
	testq	%rax, %rax
	movl	%r14d, -48(%rbp)                ## 4-byte Spill
	je	LBB0_5
## %bb.4:
	movl	$0, -72(%rbp)
	movl	%r14d, %edi
	callq	_filelength
	movl	%eax, %edi
	callq	_LONG
	movl	%eax, -68(%rbp)
	movq	%rbx, %rdi
	callq	_ExtractFileBase
	leaq	-72(%rbp), %rbx
	movl	$1, %r15d
	jmp	LBB0_9
LBB0_17:
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_printf                         ## TAILCALL
LBB0_5:
	leaq	-72(%rbp), %rsi
	movl	%r14d, %edi
	movl	$24, %edx
	callq	_read
	movl	-52(%rbp), %r15d
	leaq	L_.str.3(%rip), %rsi
	movl	%r15d, %edi
	movl	$4, %edx
	callq	_strncmp
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:
	leaq	L_.str.4(%rip), %rsi
	movl	%r15d, %edi
	movl	$4, %edx
	callq	_strncmp
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	leaq	L_.str.5(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_I_Error
LBB0_8:
	movl	-64(%rbp), %edi
	callq	_LONG
	movq	%rax, %r15
	movl	%r15d, -64(%rbp)
	movl	-60(%rbp), %edi
	callq	_LONG
	movq	%rax, %r12
	movl	%r12d, -60(%rbp)
	leal	(,%r15,8), %eax
	leal	(%rax,%rax,2), %edi
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	callq	_alloca
	movq	%rax, %rbx
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r14d, %edi
	movl	%r12d, %esi
	callq	_lseek
	movl	%r14d, %edi
	movq	%rbx, %rsi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_read
	movq	_numlumps@GOTPCREL(%rip), %r12
LBB0_9:
	addl	(%r12), %r15d
	movl	%r15d, (%r12)
	movq	_lumpinfo@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	shll	$3, %r15d
	leal	(%r15,%r15,2), %esi
	callq	_realloc
	movq	%rax, (%r14)
	testq	%rax, %rax
	jne	LBB0_11
## %bb.10:
	leaq	L_.str.6(%rip), %rdi
	xorl	%eax, %eax
	callq	_I_Error
	movq	(%r14), %rax
LBB0_11:
	movq	_reloadname@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	xorl	%esi, %esi
	movq	%rcx, %rdx
	negq	%rdx
	sbbl	%esi, %esi
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	cmpl	(%r12), %r13d
	jae	LBB0_15
## %bb.12:
	movq	%r12, %rdx
	movslq	%r13d, %rcx
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	orl	-48(%rbp), %esi                 ## 4-byte Folded Reload
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	leaq	(%rcx,%rcx,2), %rcx
	leaq	(%rax,%rcx,8), %r15
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%r15,%r14)
	movl	(%rbx,%r14), %edi
	callq	_LONG
	movq	%rax, 16(%r15,%r14)
	movl	4(%rbx,%r14), %edi
	callq	_LONG
	movq	%rax, 8(%r15,%r14)
	movl	4(%r15,%r14), %edi
	movl	16(%rbx,%r14), %esi
	movl	$8, %edx
	callq	_strncpy
	incl	%r13d
	addq	$24, %r14
	cmpl	(%r12), %r13d
	jb	LBB0_13
## %bb.14:
	movq	_reloadname@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
LBB0_15:
	testq	%rcx, %rcx
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	je	LBB0_16
## %bb.18:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_close                          ## TAILCALL
LBB0_16:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_reloadname,8,3                 ## @reloadname
	.comm	_numlumps,4,2                   ## @numlumps
	.comm	_reloadlump,4,2                 ## @reloadlump
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_O_BINARY,4,2                   ## @O_BINARY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	" couldn't open %s\n"

L_.str.1:                               ## @.str.1
	.asciz	" adding %s\n"

L_.str.2:                               ## @.str.2
	.asciz	"wad"

L_.str.3:                               ## @.str.3
	.asciz	"IWAD"

L_.str.4:                               ## @.str.4
	.asciz	"PWAD"

L_.str.5:                               ## @.str.5
	.asciz	"Wad file %s doesn't have IWAD or PWAD id\n"

	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_lumpinfo,8,3                   ## @lumpinfo
L_.str.6:                               ## @.str.6
	.asciz	"Couldn't realloc lumpinfo"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_W_AddFile                      ; -- Begin function W_AddFile
	.p2align	2
_W_AddFile:                             ; @W_AddFile
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x20, x0
	ldrb	w8, [x0]
Lloh0:
	adrp	x24, _reloadname@GOTPAGE
Lloh1:
	ldr	x24, [x24, _reloadname@GOTPAGEOFF]
Lloh2:
	adrp	x25, _numlumps@GOTPAGE
Lloh3:
	ldr	x25, [x25, _numlumps@GOTPAGEOFF]
	cmp	w8, #126
	b.ne	LBB0_2
; %bb.1:
	add	x20, x20, #1
	str	x20, [x24]
	ldr	w8, [x25]
Lloh4:
	adrp	x9, _reloadlump@GOTPAGE
Lloh5:
	ldr	x9, [x9, _reloadlump@GOTPAGEOFF]
Lloh6:
	str	w8, [x9]
LBB0_2:
Lloh7:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh8:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _O_BINARY@GOTPAGE
Lloh11:
	ldr	x9, [x9, _O_BINARY@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	x0, x20
	bl	_open
	cmn	w0, #1
	b.eq	LBB0_5
; %bb.3:
	mov	x19, x0
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	bl	_printf
	ldr	w26, [x25]
	mov	x0, x20
	bl	_strlen
	add	x8, x20, w0, sxtw
	sub	x0, x8, #3
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_strcmpi
	cbz	x0, LBB0_6
; %bb.4:
	str	wzr, [sp, #8]
	mov	x0, x19
	bl	_filelength
	bl	_LONG
	str	w0, [sp, #12]
	mov	x0, x20
	bl	_ExtractFileBase
	add	x20, sp, #8
	mov	w21, #1
	b	LBB0_10
LBB0_5:
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	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
	add	sp, sp, #112
	b	_printf
LBB0_6:
	add	x1, sp, #8
	mov	x0, x19
	mov	w2, #24
	bl	_read
	ldr	w21, [sp, #28]
Lloh19:
	adrp	x1, l_.str.3@PAGE
Lloh20:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x21
	mov	w2, #4
	bl	_strncmp
	cbz	x0, LBB0_9
; %bb.7:
Lloh21:
	adrp	x1, l_.str.4@PAGE
Lloh22:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x21
	mov	w2, #4
	bl	_strncmp
	cbz	x0, LBB0_9
; %bb.8:
	str	x20, [sp]
Lloh23:
	adrp	x0, l_.str.5@PAGE
Lloh24:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_I_Error
LBB0_9:
	ldr	w0, [sp, #16]
	bl	_LONG
	mov	x21, x0
	str	w21, [sp, #16]
	ldr	w0, [sp, #20]
	bl	_LONG
	mov	x22, x0
	str	w22, [sp, #20]
	add	w8, w21, w21, lsl #1
	lsl	w23, w8, #3
	mov	x0, x23
	bl	_alloca
	mov	x20, x0
Lloh25:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh26:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh27:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x22
	bl	_lseek
	mov	x0, x19
	mov	x1, x20
	mov	x2, x23
	bl	_read
LBB0_10:
	ldr	w8, [x25]
	add	w8, w8, w21
	str	w8, [x25]
Lloh28:
	adrp	x21, _lumpinfo@GOTPAGE
Lloh29:
	ldr	x21, [x21, _lumpinfo@GOTPAGEOFF]
	ldr	x0, [x21]
	add	w8, w8, w8, lsl #1
	lsl	w1, w8, #3
	bl	_realloc
	str	x0, [x21]
	cbnz	x0, LBB0_12
; %bb.11:
Lloh30:
	adrp	x0, l_.str.6@PAGE
Lloh31:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_I_Error
	ldr	x0, [x21]
LBB0_12:
	ldr	x8, [x24]
	cmp	x8, #0
	csinv	w21, w19, wzr, eq
	ldr	w9, [x25]
	cmp	w26, w9
	b.hs	LBB0_16
; %bb.13:
	sxtw	x8, w26
	mov	w9, #24
	madd	x22, x8, x9, x0
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	str	w21, [x22]
	ldr	w0, [x20]
	bl	_LONG
	str	x0, [x22, #16]
	ldr	w0, [x20, #4]
	bl	_LONG
	str	x0, [x22, #8]
	ldr	w0, [x22, #4]
	ldr	w1, [x20, #16]
	mov	w2, #8
	bl	_strncpy
	add	w26, w26, #1
	ldr	w8, [x25]
	add	x22, x22, #24
	add	x20, x20, #24
	cmp	w26, w8
	b.lo	LBB0_14
; %bb.15:
	ldr	x8, [x24]
LBB0_16:
	cbz	x8, LBB0_18
; %bb.17:
	mov	x0, x19
	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
	add	sp, sp, #112
	b	_close
LBB0_18:
	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
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotStr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_reloadname,8,3                 ; @reloadname
	.comm	_numlumps,4,2                   ; @numlumps
	.comm	_reloadlump,4,2                 ; @reloadlump
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_O_BINARY,4,2                   ; @O_BINARY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	" couldn't open %s\n"

l_.str.1:                               ; @.str.1
	.asciz	" adding %s\n"

l_.str.2:                               ; @.str.2
	.asciz	"wad"

l_.str.3:                               ; @.str.3
	.asciz	"IWAD"

l_.str.4:                               ; @.str.4
	.asciz	"PWAD"

l_.str.5:                               ; @.str.5
	.asciz	"Wad file %s doesn't have IWAD or PWAD id\n"

	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_lumpinfo,8,3                   ; @lumpinfo
l_.str.6:                               ; @.str.6
	.asciz	"Couldn't realloc lumpinfo"

.subsections_via_symbols
