	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function avi_write_headers
_avi_write_headers:                     ## @avi_write_headers
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	(%rax), %r12
	leaq	16(%r12), %r14
	movq	%r14, %rsi
	callq	_vc_container_writer_extraio_enable
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	xorl	%r15d, %r15d
	jmp	LBB0_4
LBB0_2:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_avi_write_header_list
	movq	_VC_CONTAINER_SUCCESS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.3:
	movq	%rbx, %rdi
	callq	_STREAM_POSITION
	movq	%rax, %r15
	addq	$-8, %r15
LBB0_4:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_vc_container_writer_extraio_disable
	movq	%rbx, %rdi
	callq	_STREAM_POSITION
	movq	%rax, %r14
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_avi_write_header_list
	movq	_VC_CONTAINER_SUCCESS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.5:
	cmpq	$0, 8(%r12)
	jne	LBB0_7
## %bb.6:
	movq	%r14, 8(%r12)
	movq	%r15, (%r12)
LBB0_7:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VC_CONTAINER_SUCCESS,8,3       ## @VC_CONTAINER_SUCCESS
	.no_dead_strip	_avi_write_headers
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function avi_write_headers
_avi_write_headers:                     ; @avi_write_headers
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	x8, [x0]
	ldr	x22, [x8]
	add	x20, x22, #16
	mov	x1, x20
	bl	_vc_container_writer_extraio_enable
Lloh0:
	adrp	x23, _VC_CONTAINER_SUCCESS@GOTPAGE
Lloh1:
	ldr	x23, [x23, _VC_CONTAINER_SUCCESS@GOTPAGEOFF]
	cbz	w0, LBB0_2
; %bb.1:
	mov	x21, #0
	b	LBB0_4
LBB0_2:
	mov	x0, x19
	mov	x1, #0
	bl	_avi_write_header_list
	ldr	x8, [x23]
	cmp	x0, x8
	b.ne	LBB0_7
; %bb.3:
	mov	x0, x19
	bl	_STREAM_POSITION
	sub	x21, x0, #8
LBB0_4:
	mov	x0, x19
	mov	x1, x20
	bl	_vc_container_writer_extraio_disable
	mov	x0, x19
	bl	_STREAM_POSITION
	mov	x20, x0
	mov	x0, x19
	mov	x1, x21
	bl	_avi_write_header_list
	ldr	x8, [x23]
	cmp	x0, x8
	b.ne	LBB0_7
; %bb.5:
	ldr	x8, [x22, #8]
	cbnz	x8, LBB0_7
; %bb.6:
	stp	x21, x20, [x22]
LBB0_7:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_VC_CONTAINER_SUCCESS,8,3       ; @VC_CONTAINER_SUCCESS
	.no_dead_strip	_avi_write_headers
.subsections_via_symbols
