	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_header
_write_header:                          ## @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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	16(%rdi), %r14
	movq	24(%rdi), %r15
	movq	$-1, (%r14)
	movq	_ff_wtv_guid@GOTPCREL(%rip), %rsi
	movq	%r15, %rdi
	callq	_ff_put_guid
	movq	_sub_wtv_guid@GOTPCREL(%rip), %rsi
	movq	%r15, %rdi
	callq	_ff_put_guid
	movl	$1, %r12d
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_avio_wl32
	movq	%r15, %rdi
	movl	$2, %esi
	callq	_avio_wl32
	movq	_WTV_SECTOR_BITS@GOTPCREL(%rip), %rbx
	movb	(%rbx), %cl
	movl	$1, %esi
	shll	%cl, %esi
	movq	%r15, %rdi
	callq	_avio_wl32
	movq	_WTV_BIGSECTOR_BITS@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	$1, %esi
	shll	%cl, %esi
	movq	%r15, %rdi
	callq	_avio_wl32
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_avio_wl32
	movq	%r15, %rdi
	movl	$4, %esi
	callq	_write_pad
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_avio_wl32
	movq	%r15, %rdi
	movl	$32, %esi
	callq	_write_pad
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_avio_wl32
	movb	(%rbx), %cl
	shll	%cl, %r12d
	movq	%r15, %rdi
	callq	_avio_tell
	subl	%eax, %r12d
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_write_pad
	movq	%r15, %rdi
	callq	_avio_tell
	movl	%eax, 8(%r14)
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, 12(%r14)
	movl	$-1, (%r14)
	cmpl	$0, (%r13)
	jle	LBB0_13
## %bb.1:
	xorl	%ebx, %ebx
	movq	_AV_CODEC_ID_MJPEG@GOTPCREL(%rip), %r15
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	movslq	(%r13), %rax
	cmpq	%rax, %rbx
	jge	LBB0_7
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %rax
	movq	(%rax,%rbx,8), %r12
	movq	(%r12), %rax
	movq	(%rax), %rax
	cmpq	(%r15), %rax
	je	LBB0_18
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_write_stream_codec
	testl	%eax, %eax
	js	LBB0_4
## %bb.16:                              ##   in Loop: Header=BB0_2 Depth=1
	testq	%rbx, %rbx
	jne	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	%r13, %rdi
	callq	_write_sync
	jmp	LBB0_18
LBB0_7:
	testl	%eax, %eax
	jle	LBB0_13
## %bb.8:
	xorl	%ebx, %ebx
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_9 Depth=1
	incq	%rbx
	movslq	%eax, %rcx
	cmpq	%rcx, %rbx
	jge	LBB0_13
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %rcx
	movq	(%rcx,%rbx,8), %r12
	movq	(%r12), %rcx
	movq	(%rcx), %rcx
	cmpq	(%r15), %rcx
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_write_stream_data
	testl	%eax, %eax
	js	LBB0_19
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	(%r13), %eax
	jmp	LBB0_12
LBB0_13:
	cmpq	$0, 24(%r14)
	je	LBB0_15
## %bb.14:
	movq	%r13, %rdi
	callq	_write_index
LBB0_15:
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_4:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r12), %rax
	movl	8(%rax), %ecx
	leaq	L_.str(%rip), %rdx
	jmp	LBB0_5
LBB0_19:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r12), %rax
	movl	8(%rax), %ecx
	leaq	L_.str.1(%rip), %rdx
LBB0_5:
	movq	%r13, %rdi
	callq	_av_log
	movl	$-1, %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ff_wtv_guid,4,2                ## @ff_wtv_guid
	.comm	_sub_wtv_guid,4,2               ## @sub_wtv_guid
	.comm	_WTV_SECTOR_BITS,4,2            ## @WTV_SECTOR_BITS
	.comm	_WTV_BIGSECTOR_BITS,4,2         ## @WTV_BIGSECTOR_BITS
	.comm	_AV_CODEC_ID_MJPEG,8,3          ## @AV_CODEC_ID_MJPEG
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"write stream codec failed codec_type(0x%x)\n"

L_.str.1:                               ## @.str.1
	.asciz	"write stream data failed codec_type(0x%x)\n"

	.no_dead_strip	_write_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_header
_write_header:                          ; @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	x19, x0
	ldp	x21, x20, [x0, #16]
	movi.2d	v0, #0xffffffffffffffff
	str	d0, [x21]
Lloh0:
	adrp	x1, _ff_wtv_guid@GOTPAGE
Lloh1:
	ldr	x1, [x1, _ff_wtv_guid@GOTPAGEOFF]
	mov	x0, x20
	bl	_ff_put_guid
Lloh2:
	adrp	x1, _sub_wtv_guid@GOTPAGE
Lloh3:
	ldr	x1, [x1, _sub_wtv_guid@GOTPAGEOFF]
	mov	x0, x20
	bl	_ff_put_guid
	mov	w22, #1
	mov	x0, x20
	mov	w1, #1
	bl	_avio_wl32
	mov	x0, x20
	mov	w1, #2
	bl	_avio_wl32
Lloh4:
	adrp	x23, _WTV_SECTOR_BITS@GOTPAGE
Lloh5:
	ldr	x23, [x23, _WTV_SECTOR_BITS@GOTPAGEOFF]
	ldr	w8, [x23]
	lsl	w1, w22, w8
	mov	x0, x20
	bl	_avio_wl32
Lloh6:
	adrp	x8, _WTV_BIGSECTOR_BITS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _WTV_BIGSECTOR_BITS@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	lsl	w1, w22, w8
	mov	x0, x20
	bl	_avio_wl32
	mov	x0, x20
	mov	w1, #0
	bl	_avio_wl32
	mov	x0, x20
	mov	w1, #4
	bl	_write_pad
	mov	x0, x20
	mov	w1, #0
	bl	_avio_wl32
	mov	x0, x20
	mov	w1, #32
	bl	_write_pad
	mov	x0, x20
	mov	w1, #0
	bl	_avio_wl32
	ldr	w8, [x23]
	lsl	w22, w22, w8
	mov	x0, x20
	bl	_avio_tell
	sub	w1, w22, w0
	mov	x0, x20
	bl	_write_pad
	mov	x0, x20
	bl	_avio_tell
	str	w0, [x21, #8]
	mov	w8, #-1
	str	w8, [x21]
	movi.2s	v0, #1
	stur	d0, [x21, #12]
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.1:
	mov	x23, #0
Lloh9:
	adrp	x22, _AV_CODEC_ID_MJPEG@GOTPAGE
Lloh10:
	ldr	x22, [x22, _AV_CODEC_ID_MJPEG@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x19]
	cmp	x23, x8
	b.ge	LBB0_7
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	x20, [x8, x23, lsl #3]
	ldr	x8, [x20]
	ldr	x8, [x8]
	ldr	x9, [x22]
	cmp	x8, x9
	b.eq	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_write_stream_codec
	tbnz	w0, #31, LBB0_16
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	cbnz	x23, LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	bl	_write_sync
	b	LBB0_2
LBB0_7:
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.8:
	mov	x23, #0
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x23, x23, #1
	cmp	x23, w8, sxtw
	b.ge	LBB0_13
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x19, #8]
	ldr	x20, [x9, x23, lsl #3]
	ldr	x9, [x20]
	ldr	x9, [x9]
	ldr	x10, [x22]
	cmp	x9, x10
	b.eq	LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_write_stream_data
	tbnz	w0, #31, LBB0_17
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	w8, [x19]
	b	LBB0_9
LBB0_13:
	ldr	x8, [x21, #24]
	cbz	x8, LBB0_15
; %bb.14:
	mov	x0, x19
	bl	_write_index
LBB0_15:
	mov	w0, #0
	b	LBB0_19
LBB0_16:
Lloh11:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	ldr	x8, [x20]
	ldr	w3, [x8, #8]
Lloh14:
	adrp	x2, l_.str@PAGE
Lloh15:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_18
LBB0_17:
Lloh16:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh17:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	ldr	x8, [x20]
	ldr	w3, [x8, #8]
Lloh19:
	adrp	x2, l_.str.1@PAGE
Lloh20:
	add	x2, x2, l_.str.1@PAGEOFF
LBB0_18:
	mov	x0, x19
	bl	_av_log
	mov	w0, #-1
LBB0_19:
	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	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_ff_wtv_guid,4,2                ; @ff_wtv_guid
	.comm	_sub_wtv_guid,4,2               ; @sub_wtv_guid
	.comm	_WTV_SECTOR_BITS,4,2            ; @WTV_SECTOR_BITS
	.comm	_WTV_BIGSECTOR_BITS,4,2         ; @WTV_BIGSECTOR_BITS
	.comm	_AV_CODEC_ID_MJPEG,8,3          ; @AV_CODEC_ID_MJPEG
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"write stream codec failed codec_type(0x%x)\n"

l_.str.1:                               ; @.str.1
	.asciz	"write stream data failed codec_type(0x%x)\n"

	.no_dead_strip	_write_header
.subsections_via_symbols
