	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function AVIFILE_WriteBlock
_AVIFILE_WriteBlock:                    ## @AVIFILE_WriteBlock
	.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	%r9, %r12
	movq	%r8, %r13
	movl	%ecx, %r14d
	movl	%edx, %r15d
	movq	%rdi, %rbx
	movl	%edx, -56(%rbp)
	movq	%r9, -64(%rbp)
	movq	$0, -72(%rbp)
	movq	(%rdi), %rdi
	cmpq	$0, (%rdi)
	jne	LBB0_2
## %bb.1:
	callq	_AVIFILE_ComputeMoviStart
	movq	(%rbx), %rdi
LBB0_2:
	movl	8(%rdi), %esi
	movl	12(%rdi), %edi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_mmioSeek
	cmpl	$-1, %eax
	je	LBB0_3
## %bb.4:
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movq	(%rbx), %rax
	movl	12(%rax), %edi
	leaq	-80(%rbp), %rsi
	xorl	%edx, %edx
	callq	_mmioCreateChunk
	movq	_S_OK@GOTPCREL(%rip), %r14
	cmpq	(%r14), %rax
	jne	LBB0_3
## %bb.5:
	testq	%r13, %r13
	je	LBB0_8
## %bb.6:
	testq	%r12, %r12
	jle	LBB0_8
## %bb.7:
	movq	(%rbx), %rax
	movl	12(%rax), %edi
	movq	%r13, %rsi
	movq	%r12, %rdx
	callq	_mmioWrite
	cmpq	%r12, %rax
	jne	LBB0_3
LBB0_8:
	movq	(%rbx), %rax
	movl	12(%rax), %edi
	leaq	-80(%rbp), %rsi
	xorl	%edx, %edx
	callq	_mmioAscend
	cmpq	(%r14), %rax
	jne	LBB0_3
## %bb.9:
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	(%rbx), %rcx
	movl	%eax, 16(%rcx)
	movl	12(%rcx), %edi
	movq	_SEEK_CUR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_mmioSeek
	movq	(%rbx), %rcx
	movl	%eax, 8(%rcx)
	movq	-80(%rbp), %rcx
	addq	$-8, %rcx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movq	%r12, %rdx
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	callq	_AVIFILE_AddFrame
	jmp	LBB0_10
LBB0_3:
	movq	_AVIERR_FILEWRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_10:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_AVIERR_FILEWRITE,4,2           ## @AVIERR_FILEWRITE
	.comm	_S_OK,8,3                       ## @S_OK
	.comm	_TRUE,4,2                       ## @TRUE
	.comm	_SEEK_CUR,4,2                   ## @SEEK_CUR
	.no_dead_strip	_AVIFILE_WriteBlock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function AVIFILE_WriteBlock
_AVIFILE_WriteBlock:                    ; @AVIFILE_WriteBlock
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x20, x5
	mov	x23, x4
	mov	x19, x3
	mov	x21, x2
	mov	x22, x0
	str	w2, [sp, #24]
	stp	xzr, x5, [sp, #8]
	ldr	x0, [x0]
	ldr	x8, [x0]
	cbnz	x8, LBB0_2
; %bb.1:
	bl	_AVIFILE_ComputeMoviStart
	ldr	x0, [x22]
LBB0_2:
	ldp	w1, w8, [x0, #8]
Lloh0:
	adrp	x9, _SEEK_SET@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SEEK_SET@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x9]
	mov	x0, x8
	bl	_mmioSeek
	cmn	w0, #1
	b.eq	LBB0_9
; %bb.3:
	ldr	x8, [x22]
	ldr	w0, [x8, #12]
	mov	x1, sp
	mov	w2, #0
	bl	_mmioCreateChunk
Lloh3:
	adrp	x24, _S_OK@GOTPAGE
Lloh4:
	ldr	x24, [x24, _S_OK@GOTPAGEOFF]
	ldr	x8, [x24]
	cmp	x0, x8
	b.ne	LBB0_9
; %bb.4:
	cbz	x23, LBB0_7
; %bb.5:
	cmp	x20, #1
	b.lt	LBB0_7
; %bb.6:
	ldr	x8, [x22]
	ldr	w0, [x8, #12]
	mov	x1, x23
	mov	x2, x20
	bl	_mmioWrite
	cmp	x0, x20
	b.ne	LBB0_9
LBB0_7:
	ldr	x8, [x22]
	ldr	w0, [x8, #12]
	mov	x1, sp
	mov	w2, #0
	bl	_mmioAscend
	ldr	x8, [x24]
	cmp	x0, x8
	b.ne	LBB0_9
; %bb.8:
Lloh5:
	adrp	x8, _TRUE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	ldr	x9, [x22]
	str	w8, [x9, #16]
	ldr	w0, [x9, #12]
Lloh8:
	adrp	x8, _SEEK_CUR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SEEK_CUR@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_mmioSeek
	ldr	x8, [x22]
	str	w0, [x8, #8]
	ldr	x8, [sp]
	sub	x3, x8, #8
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	mov	x4, x19
	bl	_AVIFILE_AddFrame
	b	LBB0_10
LBB0_9:
Lloh11:
	adrp	x8, _AVIERR_FILEWRITE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AVIERR_FILEWRITE@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
LBB0_10:
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_AVIERR_FILEWRITE,4,2           ; @AVIERR_FILEWRITE
	.comm	_S_OK,8,3                       ; @S_OK
	.comm	_TRUE,4,2                       ; @TRUE
	.comm	_SEEK_CUR,4,2                   ; @SEEK_CUR
	.no_dead_strip	_AVIFILE_WriteBlock
.subsections_via_symbols
