	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function AVIFILE_LoadFile
_AVIFILE_LoadFile:                      ## @AVIFILE_LoadFile
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	$0, 40(%rdi)
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 76(%rdi)
	movq	$0, -88(%rbp)
	movl	8(%rdi), %edi
	movq	_MMIO_FINDRIFF@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-88(%rbp), %rsi
	xorl	%edx, %edx
	callq	_mmioDescend
	movq	_S_OK@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rax
	jne	LBB0_1
## %bb.2:
	movq	-88(%rbp), %rax
	movq	_formtypeWAVE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.4:
	movq	_ckidWAVEFORMAT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	leaq	12(%rbx), %r14
	movl	8(%rbx), %esi
	movq	_MMIO_FINDCHUNK@GOTPCREL(%rip), %r13
	movl	(%r13), %r8d
	leaq	-64(%rbp), %rdx
	leaq	-88(%rbp), %rcx
	movq	%r14, %rdi
	callq	_FindChunkAndKeepExtras
	cmpq	(%r12), %rax
	jne	LBB0_5
## %bb.6:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movq	-56(%rbp), %rdx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_HeapAlloc
	movq	%rax, 64(%rbx)
	testq	%rax, %rax
	je	LBB0_5
## %bb.7:
	movq	-56(%rbp), %rdx
	movq	%rdx, (%rbx)
	movl	8(%rbx), %edi
	movl	%eax, %esi
	callq	_mmioRead
	cmpq	-56(%rbp), %rax
	jne	LBB0_5
## %bb.8:
	movl	8(%rbx), %edi
	leaq	-64(%rbp), %rsi
	xorl	%edx, %edx
	callq	_mmioAscend
	cmpq	(%r12), %rax
	jne	LBB0_5
## %bb.9:
	movq	_ckidWAVEDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leaq	16(%rbx), %r15
	movl	%eax, 36(%rbx)
	movl	8(%rbx), %esi
	movl	(%r13), %r8d
	leaq	-88(%rbp), %rcx
	movq	%r14, %rdi
	movq	%r15, %rdx
	callq	_FindChunkAndKeepExtras
	cmpq	(%r12), %rax
	jne	LBB0_5
## %bb.10:
	leaq	40(%rbx), %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movq	_streamtypeAUDIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 60(%rbx)
	movq	24(%rbx), %rcx
	movq	64(%rbx), %rax
	movl	4(%rax), %edx
	movl	%edx, 56(%rbx)
	movslq	(%rax), %rsi
	movl	%esi, 48(%rbx)
	movl	%esi, 44(%rbx)
	movq	%rcx, %rax
	orq	%rsi, %rax
	shrq	$32, %rax
	je	LBB0_11
## %bb.12:
	movq	%rcx, %rax
	cqto
	idivq	%rsi
	jmp	LBB0_13
LBB0_1:
	movq	%rbx, %rdi
	callq	_AVIFILE_LoadSunFile
	jmp	LBB0_20
LBB0_3:
	movq	_AVIERR_BADFORMAT@GOTPCREL(%rip), %rax
	jmp	LBB0_19
LBB0_5:
	movq	_AVIERR_FILEREAD@GOTPCREL(%rip), %rax
LBB0_19:
	movl	(%rax), %eax
LBB0_20:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movl	%ecx, %eax
	xorl	%edx, %edx
	divl	%esi
                                        ## kill: def $eax killed $eax def $rax
LBB0_13:
	movl	%eax, 40(%rbx)
	movl	%ecx, 52(%rbx)
	movl	$1, 72(%rbx)
	movl	8(%rbx), %edi
	movq	%r15, %rsi
	xorl	%edx, %edx
	callq	_mmioAscend
	cmpq	(%r12), %rax
	je	LBB0_18
## %bb.14:
	leaq	L_.str(%rip), %rdi
	callq	_WARN
	movl	8(%rbx), %edi
	movq	_SEEK_END@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_mmioSeek
	movslq	32(%rbx), %rdx
	movslq	%eax, %rcx
	subq	%rdx, %rcx
	movq	%rcx, 24(%rbx)
	movq	64(%rbx), %rax
	movslq	(%rax), %rsi
	movq	%rcx, %rax
	orq	%rsi, %rax
	shrq	$32, %rax
	je	LBB0_15
## %bb.16:
	movq	%rcx, %rax
	cqto
	idivq	%rsi
	jmp	LBB0_17
LBB0_15:
	movl	%ecx, %eax
	xorl	%edx, %edx
	divl	%esi
                                        ## kill: def $eax killed $eax def $rax
LBB0_17:
	movl	%eax, 40(%rbx)
	movl	%ecx, 52(%rbx)
LBB0_18:
	movl	8(%rbx), %esi
	leaq	-64(%rbp), %rdx
	leaq	-88(%rbp), %rcx
	movq	%r14, %rdi
	xorl	%r8d, %r8d
	callq	_FindChunkAndKeepExtras
	movq	_AVIERR_OK@GOTPCREL(%rip), %rax
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_MMIO_FINDRIFF,4,2              ## @MMIO_FINDRIFF
	.comm	_S_OK,8,3                       ## @S_OK
	.comm	_formtypeWAVE,8,3               ## @formtypeWAVE
	.comm	_AVIERR_BADFORMAT,4,2           ## @AVIERR_BADFORMAT
	.comm	_ckidWAVEFORMAT,4,2             ## @ckidWAVEFORMAT
	.comm	_MMIO_FINDCHUNK,4,2             ## @MMIO_FINDCHUNK
	.comm	_AVIERR_FILEREAD,4,2            ## @AVIERR_FILEREAD
	.comm	_ckidWAVEDATA,4,2               ## @ckidWAVEDATA
	.comm	_streamtypeAUDIO,4,2            ## @streamtypeAUDIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	": file seems to be truncated!\n"

	.comm	_SEEK_END,4,2                   ## @SEEK_END
	.comm	_AVIERR_OK,4,2                  ## @AVIERR_OK
	.no_dead_strip	_AVIFILE_LoadFile
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function AVIFILE_LoadFile
_AVIFILE_LoadFile:                      ; @AVIFILE_LoadFile
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x19, x0
	mov	x21, x0
	str	wzr, [x21, #40]!
Lloh0:
	adrp	x8, _FALSE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x21, #36]
	str	xzr, [sp, #24]
	ldur	w0, [x21, #-32]
Lloh3:
	adrp	x8, _MMIO_FINDRIFF@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MMIO_FINDRIFF@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	add	x1, sp, #24
	mov	x2, #0
	bl	_mmioDescend
Lloh6:
	adrp	x23, _S_OK@GOTPAGE
Lloh7:
	ldr	x23, [x23, _S_OK@GOTPAGEOFF]
	ldr	x8, [x23]
	cmp	x0, x8
	b.ne	LBB0_10
; %bb.1:
	ldr	x8, [sp, #24]
Lloh8:
	adrp	x9, _formtypeWAVE@GOTPAGE
Lloh9:
	ldr	x9, [x9, _formtypeWAVE@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.2:
Lloh11:
	adrp	x8, _ckidWAVEFORMAT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ckidWAVEFORMAT@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	str	w8, [sp, #20]
	add	x20, x19, #12
	ldr	w1, [x19, #8]
Lloh14:
	adrp	x24, _MMIO_FINDCHUNK@GOTPAGE
Lloh15:
	ldr	x24, [x24, _MMIO_FINDCHUNK@GOTPAGEOFF]
	ldr	w4, [x24]
	mov	x2, sp
	add	x3, sp, #24
	mov	x0, x20
	bl	_FindChunkAndKeepExtras
	ldr	x8, [x23]
	cmp	x0, x8
	b.ne	LBB0_12
; %bb.3:
	bl	_GetProcessHeap
	ldr	x2, [sp, #8]
	mov	w1, #0
	bl	_HeapAlloc
	str	x0, [x19, #64]
	cbz	x0, LBB0_12
; %bb.4:
	mov	x1, x0
	ldr	x2, [sp, #8]
	str	x2, [x19]
	ldr	w0, [x19, #8]
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_mmioRead
	ldr	x8, [sp, #8]
	cmp	x0, x8
	b.ne	LBB0_12
; %bb.5:
	ldr	w0, [x19, #8]
	mov	x1, sp
	mov	w2, #0
	bl	_mmioAscend
	ldr	x8, [x23]
	cmp	x0, x8
	b.ne	LBB0_12
; %bb.6:
Lloh16:
	adrp	x8, _ckidWAVEDATA@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ckidWAVEDATA@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	add	x22, x19, #16
	str	w8, [x19, #36]
	ldr	w1, [x19, #8]
	ldr	w4, [x24]
	add	x3, sp, #24
	mov	x0, x20
	mov	x2, x22
	bl	_FindChunkAndKeepExtras
	ldr	x8, [x23]
	cmp	x0, x8
	b.ne	LBB0_12
; %bb.7:
	mov	x0, x21
	mov	w1, #0
	mov	w2, #24
	bl	_memset
Lloh19:
	adrp	x8, _streamtypeAUDIO@GOTPAGE
Lloh20:
	ldr	x8, [x8, _streamtypeAUDIO@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	str	w8, [x19, #60]
	ldr	x8, [x19, #64]
	ldr	w9, [x8, #4]
	str	w9, [x19, #56]
	ldrsw	x8, [x8]
	ldr	x9, [x19, #24]
	sdiv	x10, x9, x8
	stp	w10, w8, [x19, #40]
	stp	w8, w9, [x19, #48]
	mov	w8, #1
	str	w8, [x19, #72]
	ldr	w0, [x19, #8]
	mov	x1, x22
	mov	w2, #0
	bl	_mmioAscend
	ldr	x8, [x23]
	cmp	x0, x8
	b.eq	LBB0_9
; %bb.8:
Lloh22:
	adrp	x0, l_.str@PAGE
Lloh23:
	add	x0, x0, l_.str@PAGEOFF
	bl	_WARN
	ldr	w0, [x19, #8]
Lloh24:
	adrp	x8, _SEEK_END@GOTPAGE
Lloh25:
	ldr	x8, [x8, _SEEK_END@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_mmioSeek
                                        ; kill: def $w0 killed $w0 def $x0
	ldrsw	x8, [x19, #32]
	sxtw	x9, w0
	sub	x8, x9, x8
	str	x8, [x19, #24]
	ldr	x9, [x19, #64]
	ldrsw	x9, [x9]
	sdiv	x9, x8, x9
	str	w9, [x19, #40]
	str	w8, [x19, #52]
LBB0_9:
	ldr	w1, [x19, #8]
	mov	x2, sp
	add	x3, sp, #24
	mov	x0, x20
	mov	w4, #0
	bl	_FindChunkAndKeepExtras
Lloh27:
	adrp	x8, _AVIERR_OK@GOTPAGE
Lloh28:
	ldr	x8, [x8, _AVIERR_OK@GOTPAGEOFF]
	b	LBB0_13
LBB0_10:
	mov	x0, x19
	bl	_AVIFILE_LoadSunFile
	b	LBB0_14
LBB0_11:
Lloh29:
	adrp	x8, _AVIERR_BADFORMAT@GOTPAGE
Lloh30:
	ldr	x8, [x8, _AVIERR_BADFORMAT@GOTPAGEOFF]
	b	LBB0_13
LBB0_12:
Lloh31:
	adrp	x8, _AVIERR_FILEREAD@GOTPAGE
Lloh32:
	ldr	x8, [x8, _AVIERR_FILEREAD@GOTPAGEOFF]
LBB0_13:
	ldr	w0, [x8]
LBB0_14:
	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
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_MMIO_FINDRIFF,4,2              ; @MMIO_FINDRIFF
	.comm	_S_OK,8,3                       ; @S_OK
	.comm	_formtypeWAVE,8,3               ; @formtypeWAVE
	.comm	_AVIERR_BADFORMAT,4,2           ; @AVIERR_BADFORMAT
	.comm	_ckidWAVEFORMAT,4,2             ; @ckidWAVEFORMAT
	.comm	_MMIO_FINDCHUNK,4,2             ; @MMIO_FINDCHUNK
	.comm	_AVIERR_FILEREAD,4,2            ; @AVIERR_FILEREAD
	.comm	_ckidWAVEDATA,4,2               ; @ckidWAVEDATA
	.comm	_streamtypeAUDIO,4,2            ; @streamtypeAUDIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	": file seems to be truncated!\n"

	.comm	_SEEK_END,4,2                   ; @SEEK_END
	.comm	_AVIERR_OK,4,2                  ; @AVIERR_OK
	.no_dead_strip	_AVIFILE_LoadFile
.subsections_via_symbols
