	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function asf_write_header
_asf_write_header:                      ## @asf_write_header
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	24(%rdi), %r14
	movl	56(%r14), %eax
	movl	%eax, 8(%rdi)
	movq	$0, 16(%rdi)
	movq	$0, 48(%r14)
	cmpl	$128, (%rdi)
	jl	LBB0_2
## %bb.1:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	callq	_av_log
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_2:
	movq	_ASF_INDEX_BLOCK@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	shll	$2, %edi
	callq	_av_malloc
	movl	%eax, 32(%r14)
	testl	%eax, %eax
	je	LBB0_3
## %bb.5:
	movl	(%r15), %eax
	movl	%eax, (%r14)
	movq	$0, 40(%r14)
	movq	_DATA_HEADER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%r15d, %r15d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_asf_write_header1
	testq	%rax, %rax
	js	LBB0_6
## %bb.7:
	movl	12(%rbx), %edi
	callq	_avio_flush
	movq	$0, 24(%r14)
	movq	$-1, 4(%r14)
	movl	12(%r14), %esi
	addq	$16, %r14
	movl	8(%rbx), %edx
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rsp)
	movq	%r14, %rdi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_ffio_init_context
	cmpl	$0, 4(%rbx)
	jns	LBB0_9
## %bb.8:
	movl	$1, 4(%rbx)
	jmp	LBB0_9
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_6:
	addq	$32, %r14
	movq	%r14, %rdi
	callq	_av_freep
	movl	$-1, %r15d
LBB0_9:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ASF can only handle 127 streams\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ASF_INDEX_BLOCK,4,2            ## @ASF_INDEX_BLOCK
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_DATA_HEADER_SIZE,4,2           ## @DATA_HEADER_SIZE
	.no_dead_strip	_asf_write_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function asf_write_header
_asf_write_header:                      ; @asf_write_header
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	ldr	x21, [x0, #24]
	ldr	w8, [x21, #56]
	str	w8, [x0, #8]
	str	xzr, [x0, #16]
	str	xzr, [x21, #48]
	ldr	w8, [x0]
	cmp	w8, #128
	b.lt	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_av_log
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_7
LBB0_2:
Lloh7:
	adrp	x22, _ASF_INDEX_BLOCK@GOTPAGE
Lloh8:
	ldr	x22, [x22, _ASF_INDEX_BLOCK@GOTPAGEOFF]
	ldr	w8, [x22]
	lsl	w0, w8, #2
	bl	_av_malloc
	mov	x20, x21
	str	w0, [x20, #32]!
	cbz	w0, LBB0_6
; %bb.3:
	ldr	w8, [x22]
	str	w8, [x21]
	str	xzr, [x21, #40]
Lloh9:
	adrp	x8, _DATA_HEADER_SIZE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DATA_HEADER_SIZE@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #0
	bl	_asf_write_header1
	tbnz	x0, #63, LBB0_8
; %bb.4:
	ldr	w0, [x19, #12]
	bl	_avio_flush
	str	xzr, [x21, #24]
	movi.2d	v0, #0xffffffffffffffff
	stur	d0, [x21, #4]
	add	x0, x21, #16
	ldr	w1, [x21, #12]
	ldr	w2, [x19, #8]
	mov	w20, #1
	mov	w3, #1
	mov	x4, #0
	mov	x5, #0
	mov	x6, #0
	mov	x7, #0
	bl	_ffio_init_context
	ldr	w8, [x19, #4]
	tbnz	w8, #31, LBB0_9
; %bb.5:
	mov	w0, #0
	b	LBB0_10
LBB0_6:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_7:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_AVERROR
LBB0_8:
	mov	x0, x20
	bl	_av_freep
	mov	w0, #-1
	b	LBB0_10
LBB0_9:
	mov	w0, #0
	str	w20, [x19, #4]
LBB0_10:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ASF can only handle 127 streams\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ASF_INDEX_BLOCK,4,2            ; @ASF_INDEX_BLOCK
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_DATA_HEADER_SIZE,4,2           ; @DATA_HEADER_SIZE
	.no_dead_strip	_asf_write_header
.subsections_via_symbols
