	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_W_ReadLump                     ## -- Begin function W_ReadLump
	.p2align	4, 0x90
_W_ReadLump:                            ## @W_ReadLump
	.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	%rsi, -48(%rbp)                 ## 8-byte Spill
	movl	%edi, %r15d
	movq	_numlumps@GOTPCREL(%rip), %rax
	cmpl	%edi, (%rax)
	jg	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	_I_Error
LBB0_2:
	movq	_lumpinfo@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movslq	%r15d, %rax
	leaq	(%rax,%rax,2), %rbx
	movl	(%r13,%rbx,4), %r12d
	cmpl	$-1, %r12d
	jne	LBB0_5
## %bb.3:
	movq	_reloadname@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movq	_O_BINARY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	callq	_open
	movl	%eax, %r12d
	cmpl	$-1, %eax
	jne	LBB0_5
## %bb.4:
	movl	(%r14), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_I_Error
	movl	$-1, %r12d
LBB0_5:
	leaq	(,%rbx,4), %r14
	addq	%r13, %r14
	movl	8(%r13,%rbx,4), %esi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r12d, %edi
	callq	_lseek
	movl	4(%r13,%rbx,4), %edx
	movl	%r12d, %edi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_read
	movl	4(%r13,%rbx,4), %edx
	cmpl	%edx, %eax
	jge	LBB0_7
## %bb.6:
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_I_Error
LBB0_7:
	cmpl	$-1, (%r14)
	je	LBB0_9
## %bb.8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movl	%r12d, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_close                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_numlumps,4,2                   ## @numlumps
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"W_ReadLump: %i >= numlumps"

	.comm	_lumpinfo,8,3                   ## @lumpinfo
	.comm	_reloadname,4,2                 ## @reloadname
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_O_BINARY,4,2                   ## @O_BINARY
L_.str.1:                               ## @.str.1
	.asciz	"W_ReadLump: couldn't open %s"

	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
L_.str.2:                               ## @.str.2
	.asciz	"W_ReadLump: only read %i of %i on lump %i"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_W_ReadLump                     ; -- Begin function W_ReadLump
	.p2align	2
_W_ReadLump:                            ; @W_ReadLump
	.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, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _numlumps@GOTPAGE
Lloh1:
	ldr	x8, [x8, _numlumps@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w0
	b.gt	LBB0_2
; %bb.1:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_I_Error
LBB0_2:
Lloh5:
	adrp	x8, _lumpinfo@GOTPAGE
Lloh6:
	ldr	x8, [x8, _lumpinfo@GOTPAGEOFF]
Lloh7:
	ldr	x23, [x8]
	sxtw	x24, w19
	mov	w8, #12
	smaddl	x22, w19, w8, x23
	ldr	w21, [x22]
	cmn	w21, #1
	b.ne	LBB0_5
; %bb.3:
Lloh8:
	adrp	x25, _reloadname@GOTPAGE
Lloh9:
	ldr	x25, [x25, _reloadname@GOTPAGEOFF]
Lloh10:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh11:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
	ldr	w0, [x25]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	adrp	x9, _O_BINARY@GOTPAGE
Lloh14:
	ldr	x9, [x9, _O_BINARY@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	orr	w1, w9, w8
	bl	_open
	mov	x21, x0
	cmn	w0, #1
	b.ne	LBB0_5
; %bb.4:
	ldr	w1, [x25]
Lloh16:
	adrp	x0, l_.str.1@PAGE
Lloh17:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_I_Error
LBB0_5:
	mov	w8, #12
	madd	x23, x24, x8, x23
	ldr	w1, [x23, #8]
Lloh18:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
	mov	x0, x21
	bl	_lseek
	ldr	w2, [x23, #4]
	mov	x0, x21
	mov	x1, x20
	bl	_read
	ldr	w8, [x23, #4]
	cmp	w0, w8
	b.ge	LBB0_7
; %bb.6:
	mov	x1, x0
                                        ; kill: def $w19 killed $w19 killed $x19 def $x19
	stp	x8, x19, [sp]
Lloh21:
	adrp	x0, l_.str.2@PAGE
Lloh22:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_I_Error
LBB0_7:
	ldr	w8, [x22]
	cmn	w8, #1
	b.eq	LBB0_9
; %bb.8:
	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
LBB0_9:
	mov	x0, x21
	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	_close
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_numlumps,4,2                   ; @numlumps
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"W_ReadLump: %i >= numlumps"

	.comm	_lumpinfo,8,3                   ; @lumpinfo
	.comm	_reloadname,4,2                 ; @reloadname
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_O_BINARY,4,2                   ; @O_BINARY
l_.str.1:                               ; @.str.1
	.asciz	"W_ReadLump: couldn't open %s"

	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
l_.str.2:                               ; @.str.2
	.asciz	"W_ReadLump: only read %i of %i on lump %i"

.subsections_via_symbols
