	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_grabdata                       ## -- Begin function grabdata
	.p2align	4, 0x90
_grabdata:                              ## @grabdata
	.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	%rsi, %r12
	movl	%edi, %ebx
	leaq	L_.str(%rip), %rdi
	callq	_getenv
	testq	%rax, %rax
	leaq	L_.str.1(%rip), %r13
	cmovneq	%rax, %r13
	movq	%r13, %rdi
	callq	_strlen
	leaq	11(%rax), %rdi
	callq	_malloc
	leaq	L_.str.2(%rip), %rsi
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	movq	%r13, %rdx
	callq	_sprintf
	movq	%r13, %rdi
	callq	_strlen
	leaq	11(%rax), %rdi
	callq	_malloc
	leaq	L_.str.3(%rip), %rsi
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	movq	%r13, %rdx
	callq	_sprintf
	movq	%r13, %rdi
	callq	_strlen
	leaq	12(%rax), %rdi
	callq	_malloc
	leaq	L_.str.4(%rip), %rsi
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	movq	%r13, %rdx
	callq	_sprintf
	movq	%r13, %rdi
	callq	_strlen
	leaq	10(%rax), %rdi
	callq	_malloc
	leaq	L_.str.5(%rip), %rsi
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	movq	%r13, %rdx
	callq	_sprintf
	movq	%r13, %rdi
	callq	_strlen
	leaq	10(%rax), %rdi
	callq	_malloc
	leaq	L_.str.6(%rip), %rsi
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	movq	%r13, %rdx
	callq	_sprintf
	cmpl	$2, %ebx
	jl	LBB0_5
## %bb.1:
	movl	%ebx, %ebx
	movl	$1, %r14d
	leaq	L_.str.7(%rip), %r13
	movq	_snd_verbose@GOTPCREL(%rip), %r15
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%r14
	cmpq	%r14, %rbx
	je	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12,%r14,8), %rdi
	movq	%r13, %rsi
	callq	_strcmp
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	$0, (%r15)
	jmp	LBB0_4
LBB0_5:
	movq	_NUMSFX@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	movq	_numsounds@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_longsound@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_R_OK@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_access
	testl	%eax, %eax
	je	LBB0_10
## %bb.6:
	movl	(%r14), %esi
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_access
	testl	%eax, %eax
	je	LBB0_10
## %bb.7:
	movl	(%r14), %esi
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_access
	testl	%eax, %eax
	je	LBB0_10
## %bb.8:
	movl	(%r14), %esi
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_access
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	(%r14), %esi
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_access
	testl	%eax, %eax
	jne	LBB0_20
LBB0_10:
	movq	%rbx, %rdi
	callq	_openwad
	movq	_snd_verbose@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_12
## %bb.11:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.9(%rip), %rsi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	_fprintf
LBB0_12:
	cmpl	$2, (%r13)
	jl	LBB0_19
## %bb.13:
	movq	_S_sfx@GOTPCREL(%rip), %r14
	movq	(%r14), %rcx
	movl	$1, %r15d
	movl	$8, %ebx
	movq	_lengths@GOTPCREL(%rip), %r12
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_14 Depth=1
	movl	8(%rax), %edx
	movl	%edx, 8(%rcx,%rbx,2)
	movq	(%r12), %rdx
	subq	%rcx, %rax
	sarq	$3, %rax
	andq	$-8, %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, (%rdx,%rbx)
LBB0_18:                                ##   in Loop: Header=BB0_14 Depth=1
	incq	%r15
	movslq	(%r13), %rax
	addq	$8, %rbx
	cmpq	%rax, %r15
	jge	LBB0_19
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rcx,%rbx,2), %rax
	testq	%rax, %rax
	jne	LBB0_17
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	movl	12(%rcx,%rbx,2), %edi
	movq	(%r12), %rsi
	addq	%rbx, %rsi
	callq	_getsfx
	movq	_longsound@GOTPCREL(%rip), %rdx
	movq	(%r14), %rcx
	movl	%eax, 8(%rcx,%rbx,2)
	movq	(%r12), %rax
	movq	(%rax,%rbx), %rax
	cmpq	%rax, (%rdx)
	jge	LBB0_18
## %bb.16:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	%rax, (%rdx)
	jmp	LBB0_18
LBB0_19:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.8(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	movl	$-1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DOOMWADDIR"

L_.str.1:                               ## @.str.1
	.asciz	"."

L_.str.2:                               ## @.str.2
	.asciz	"%s/doom1.wad"

L_.str.3:                               ## @.str.3
	.asciz	"%s/doom2.wad"

L_.str.4:                               ## @.str.4
	.asciz	"%s/doom2f.wad"

L_.str.5:                               ## @.str.5
	.asciz	"%s/doomu.wad"

L_.str.6:                               ## @.str.6
	.asciz	"%s/doom.wad"

L_.str.7:                               ## @.str.7
	.asciz	"-quiet"

	.comm	_snd_verbose,8,3                ## @snd_verbose
	.comm	_NUMSFX,4,2                     ## @NUMSFX
	.comm	_numsounds,4,2                  ## @numsounds
	.comm	_longsound,8,3                  ## @longsound
	.comm	_R_OK,4,2                       ## @R_OK
	.comm	_stderr,4,2                     ## @stderr
L_.str.8:                               ## @.str.8
	.asciz	"Could not find wadfile anywhere\n"

L_.str.9:                               ## @.str.9
	.asciz	"loading from [%s]\n"

	.comm	_S_sfx,8,3                      ## @S_sfx
	.comm	_lengths,8,3                    ## @lengths
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_grabdata                       ; -- Begin function grabdata
	.p2align	2
_grabdata:                              ; @grabdata
	.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	x22, x1
	mov	x23, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_getenv
Lloh2:
	adrp	x8, l_.str.1@PAGE
Lloh3:
	add	x8, x8, l_.str.1@PAGEOFF
	cmp	x0, #0
	csel	x26, x8, x0, eq
	mov	x0, x26
	bl	_strlen
	add	x0, x0, #11
	bl	_malloc
	mov	x19, x0
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x26
	bl	_sprintf
	mov	x0, x26
	bl	_strlen
	add	x0, x0, #11
	bl	_malloc
	mov	x20, x0
Lloh6:
	adrp	x1, l_.str.3@PAGE
Lloh7:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x2, x26
	bl	_sprintf
	mov	x0, x26
	bl	_strlen
	add	x0, x0, #12
	bl	_malloc
	mov	x21, x0
Lloh8:
	adrp	x1, l_.str.4@PAGE
Lloh9:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x2, x26
	bl	_sprintf
	mov	x0, x26
	bl	_strlen
	add	x0, x0, #10
	bl	_malloc
	mov	x24, x0
Lloh10:
	adrp	x1, l_.str.5@PAGE
Lloh11:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x2, x26
	bl	_sprintf
	mov	x0, x26
	bl	_strlen
	add	x0, x0, #10
	bl	_malloc
	mov	x25, x0
Lloh12:
	adrp	x1, l_.str.6@PAGE
Lloh13:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x2, x26
	bl	_sprintf
Lloh14:
	adrp	x26, _snd_verbose@GOTPAGE
Lloh15:
	ldr	x26, [x26, _snd_verbose@GOTPAGEOFF]
	cmp	w23, #2
	b.lt	LBB0_5
; %bb.1:
	mov	w8, w23
	add	x23, x22, #8
	sub	x27, x8, #1
Lloh16:
	adrp	x22, l_.str.7@PAGE
Lloh17:
	add	x22, x22, l_.str.7@PAGEOFF
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x23, x23, #8
	subs	x27, x27, #1
	b.eq	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x23]
	mov	x1, x22
	bl	_strcmp
	cbnz	w0, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	str	xzr, [x26]
	b	LBB0_2
LBB0_5:
Lloh18:
	adrp	x22, _NUMSFX@GOTPAGE
Lloh19:
	ldr	x22, [x22, _NUMSFX@GOTPAGEOFF]
	ldr	w8, [x22]
Lloh20:
	adrp	x9, _numsounds@GOTPAGE
Lloh21:
	ldr	x9, [x9, _numsounds@GOTPAGEOFF]
Lloh22:
	str	w8, [x9]
Lloh23:
	adrp	x23, _longsound@GOTPAGE
Lloh24:
	ldr	x23, [x23, _longsound@GOTPAGEOFF]
	str	xzr, [x23]
Lloh25:
	adrp	x27, _R_OK@GOTPAGE
Lloh26:
	ldr	x27, [x27, _R_OK@GOTPAGEOFF]
	ldr	w1, [x27]
	mov	x0, x21
	bl	_access
	cbz	w0, LBB0_10
; %bb.6:
	ldr	w1, [x27]
	mov	x0, x20
	bl	_access
	mov	x21, x20
	cbz	w0, LBB0_10
; %bb.7:
	ldr	w1, [x27]
	mov	x0, x24
	bl	_access
	mov	x21, x24
	cbz	w0, LBB0_10
; %bb.8:
	ldr	w1, [x27]
	mov	x0, x25
	bl	_access
	mov	x21, x25
	cbz	w0, LBB0_10
; %bb.9:
	ldr	w1, [x27]
	mov	x0, x19
	bl	_access
	mov	x21, x19
	cbnz	w0, LBB0_20
LBB0_10:
	mov	x0, x21
	bl	_openwad
	ldr	x8, [x26]
	cbz	x8, LBB0_12
; %bb.11:
Lloh27:
	adrp	x8, _stderr@GOTPAGE
Lloh28:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
	str	x21, [sp]
Lloh30:
	adrp	x1, l_.str.9@PAGE
Lloh31:
	add	x1, x1, l_.str.9@PAGEOFF
	bl	_fprintf
LBB0_12:
	ldr	w8, [x22]
	cmp	w8, #2
	b.lt	LBB0_19
; %bb.13:
	mov	x19, #0
Lloh32:
	adrp	x20, _S_sfx@GOTPAGE
Lloh33:
	ldr	x20, [x20, _S_sfx@GOTPAGEOFF]
	ldr	x8, [x20]
	mov	w21, #1
	mov	w24, #8
Lloh34:
	adrp	x25, _lengths@GOTPAGE
Lloh35:
	ldr	x25, [x25, _lengths@GOTPAGEOFF]
	b	LBB0_16
LBB0_14:                                ;   in Loop: Header=BB0_16 Depth=1
	ldr	w11, [x10, #8]
	str	w11, [x9, #24]
	ldr	x9, [x25]
	sub	x10, x10, x8
	asr	x10, x10, #3
	and	x10, x10, #0xfffffffffffffff8
	ldr	x10, [x9, x10]
	str	x10, [x9, x24]
LBB0_15:                                ;   in Loop: Header=BB0_16 Depth=1
	add	x21, x21, #1
	ldrsw	x9, [x22]
	add	x24, x24, #8
	add	x19, x19, #16
	cmp	x21, x9
	b.ge	LBB0_19
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	add	x9, x8, x19
	ldr	x10, [x9, #16]
	cbnz	x10, LBB0_14
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	w0, [x9, #28]
	ldr	x8, [x25]
	add	x1, x8, x24
	bl	_getsfx
	ldr	x8, [x20]
	add	x9, x8, x19
	str	w0, [x9, #24]
	ldr	x10, [x23]
	ldr	x9, [x25]
	ldr	x9, [x9, x24]
	cmp	x10, x9
	b.ge	LBB0_15
; %bb.18:                               ;   in Loop: Header=BB0_16 Depth=1
	str	x9, [x23]
	b	LBB0_15
LBB0_19:
	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
LBB0_20:
Lloh36:
	adrp	x8, _stderr@GOTPAGE
Lloh37:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh38:
	ldr	w0, [x8]
Lloh39:
	adrp	x1, l_.str.8@PAGE
Lloh40:
	add	x1, x1, l_.str.8@PAGEOFF
	bl	_fprintf
	mov	w0, #-1
	bl	_exit
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotStr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DOOMWADDIR"

l_.str.1:                               ; @.str.1
	.asciz	"."

l_.str.2:                               ; @.str.2
	.asciz	"%s/doom1.wad"

l_.str.3:                               ; @.str.3
	.asciz	"%s/doom2.wad"

l_.str.4:                               ; @.str.4
	.asciz	"%s/doom2f.wad"

l_.str.5:                               ; @.str.5
	.asciz	"%s/doomu.wad"

l_.str.6:                               ; @.str.6
	.asciz	"%s/doom.wad"

l_.str.7:                               ; @.str.7
	.asciz	"-quiet"

	.comm	_snd_verbose,8,3                ; @snd_verbose
	.comm	_NUMSFX,4,2                     ; @NUMSFX
	.comm	_numsounds,4,2                  ; @numsounds
	.comm	_longsound,8,3                  ; @longsound
	.comm	_R_OK,4,2                       ; @R_OK
	.comm	_stderr,4,2                     ; @stderr
l_.str.8:                               ; @.str.8
	.asciz	"Could not find wadfile anywhere\n"

l_.str.9:                               ; @.str.9
	.asciz	"loading from [%s]\n"

	.comm	_S_sfx,8,3                      ; @S_sfx
	.comm	_lengths,8,3                    ; @lengths
.subsections_via_symbols
