	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function flv_write_header
_flv_write_header:                      ## @flv_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	16(%rdi), %r15
	movq	24(%rdi), %r14
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	$3, %edx
	callq	_avio_write
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_avio_w8
	movl	12(%r15), %esi
	movl	16(%r15), %eax
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movq	_FLV_HEADER_FLAG_HASAUDIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_2:
	testl	%esi, %esi
	je	LBB0_4
## %bb.3:
	movq	_FLV_HEADER_FLAG_HASVIDEO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
LBB0_4:
	addl	%eax, %esi
	movq	%r14, %rdi
	callq	_avio_w8
	movq	%r14, %rdi
	movl	$9, %esi
	callq	_avio_wb32
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_avio_wb32
	movl	(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_9
## %bb.5:
	xorl	%ebx, %ebx
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	incq	%rbx
	movslq	%eax, %rcx
	cmpq	%rcx, %rbx
	jge	LBB0_9
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rcx
	movq	(%rcx,%rbx,8), %rcx
	movq	(%rcx), %rcx
	cmpl	$5, (%rcx)
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%r14, %rdi
	movl	$8, %esi
	callq	_avio_w8
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_avio_wb24
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_avio_wb24
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_avio_wb32
	movq	%r14, %rdi
	movl	$11, %esi
	callq	_avio_wb32
	movl	$5, (%r15)
	movl	(%r12), %eax
	jmp	LBB0_8
LBB0_9:
	movq	_FLV_NO_METADATA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, 4(%r15)
	je	LBB0_11
## %bb.10:
	movq	$0, (%r14)
	testl	%eax, %eax
	jg	LBB0_13
	jmp	LBB0_15
LBB0_11:
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_write_metadata
	movl	(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_15
LBB0_13:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rax
	movq	(%rax,%rbx,8), %rax
	movq	(%rax), %rsi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_flv_write_codec_header
	incq	%rbx
	movslq	(%r12), %rax
	cmpq	%rax, %rbx
	jl	LBB0_14
LBB0_15:
	movq	%r14, %rdi
	callq	_avio_tell
	movl	%eax, 8(%r15)
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"FLV"

	.comm	_FLV_HEADER_FLAG_HASAUDIO,4,2   ## @FLV_HEADER_FLAG_HASAUDIO
	.comm	_FLV_HEADER_FLAG_HASVIDEO,4,2   ## @FLV_HEADER_FLAG_HASVIDEO
	.comm	_FLV_NO_METADATA,4,2            ## @FLV_NO_METADATA
	.no_dead_strip	_flv_write_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function flv_write_header
_flv_write_header:                      ; @flv_write_header
	.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	x20, x0
	ldp	x21, x19, [x0, #16]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	w2, #3
	bl	_avio_write
	mov	x0, x19
	mov	w1, #1
	bl	_avio_w8
Lloh2:
	adrp	x8, _FLV_HEADER_FLAG_HASAUDIO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _FLV_HEADER_FLAG_HASAUDIO@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ldp	w10, w9, [x21, #12]
	cmp	w9, #0
	csel	w8, wzr, w8, eq
Lloh5:
	adrp	x9, _FLV_HEADER_FLAG_HASVIDEO@GOTPAGE
Lloh6:
	ldr	x9, [x9, _FLV_HEADER_FLAG_HASVIDEO@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	cmp	w10, #0
	csel	w9, wzr, w9, eq
	add	w1, w9, w8
	mov	x0, x19
	bl	_avio_w8
	mov	x0, x19
	mov	w1, #9
	bl	_avio_wb32
	mov	x0, x19
	mov	w1, #0
	bl	_avio_wb32
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.1:
	mov	x22, #0
	mov	w23, #5
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x22, x22, #1
	cmp	x22, w8, sxtw
	b.ge	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x20, #8]
	ldr	x9, [x9, x22, lsl #3]
	ldr	x9, [x9]
	ldr	w9, [x9]
	cmp	w9, #5
	b.ne	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	mov	w1, #8
	bl	_avio_w8
	mov	x0, x19
	mov	w1, #0
	bl	_avio_wb24
	mov	x0, x19
	mov	w1, #0
	bl	_avio_wb24
	mov	x0, x19
	mov	w1, #0
	bl	_avio_wb32
	mov	x0, x19
	mov	w1, #11
	bl	_avio_wb32
	str	w23, [x21]
	ldr	w8, [x20]
	b	LBB0_2
LBB0_5:
	ldr	w9, [x21, #4]
Lloh8:
	adrp	x10, _FLV_NO_METADATA@GOTPAGE
Lloh9:
	ldr	x10, [x10, _FLV_NO_METADATA@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_7
; %bb.6:
	str	xzr, [x19]
	cmp	w8, #1
	b.ge	LBB0_8
	b	LBB0_10
LBB0_7:
	mov	x0, x20
	mov	w1, #0
	bl	_write_metadata
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_10
LBB0_8:
	mov	x22, #0
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #8]
	ldr	x8, [x8, x22, lsl #3]
	ldr	x1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_flv_write_codec_header
	add	x22, x22, #1
	ldrsw	x8, [x20]
	cmp	x22, x8
	b.lt	LBB0_9
LBB0_10:
	mov	x0, x19
	bl	_avio_tell
	str	w0, [x21, #8]
	mov	w0, #0
	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 AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"FLV"

	.comm	_FLV_HEADER_FLAG_HASAUDIO,4,2   ; @FLV_HEADER_FLAG_HASAUDIO
	.comm	_FLV_HEADER_FLAG_HASVIDEO,4,2   ; @FLV_HEADER_FLAG_HASVIDEO
	.comm	_FLV_NO_METADATA,4,2            ; @FLV_NO_METADATA
	.no_dead_strip	_flv_write_header
.subsections_via_symbols
