	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ivf_write_header
_ivf_write_header:                      ## @ivf_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, %rbx
	cmpl	$1, (%rdi)
	jne	LBB0_1
## %bb.3:
	movq	8(%rbx), %rax
	movq	(%rax), %rax
	movq	8(%rax), %r15
	movq	(%r15), %rax
	movq	_AVMEDIA_TYPE_VIDEO@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.4:
	movq	16(%rbx), %r14
	movq	8(%r15), %rax
	movq	_AV_CODEC_ID_AV1@GOTPCREL(%rip), %rcx
	movq	_AV_CODEC_ID_VP8@GOTPCREL(%rip), %r13
	movq	_AV_CODEC_ID_VP9@GOTPCREL(%rip), %r12
	cmpq	(%rcx), %rax
	je	LBB0_8
## %bb.5:
	cmpq	(%r13), %rax
	je	LBB0_8
## %bb.6:
	cmpq	(%r12), %rax
	je	LBB0_8
LBB0_7:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	jmp	LBB0_2
LBB0_1:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
LBB0_2:
	movq	%rbx, %rdi
	callq	_av_log
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_8:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	movl	$4, %edx
	callq	_avio_write
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_avio_wl16
	movq	%r14, %rdi
	movl	$32, %esi
	callq	_avio_wl16
	movq	8(%r15), %rax
	cmpq	(%r13), %rax
	leaq	L_.str.4(%rip), %rcx
	leaq	L_.str.5(%rip), %rdx
	cmoveq	%rcx, %rdx
	cmpq	(%r12), %rax
	leaq	L_.str.3(%rip), %rdi
	cmovneq	%rdx, %rdi
	callq	_AV_RL32
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_avio_wl32
	movl	16(%r15), %esi
	movq	%r14, %rdi
	callq	_avio_wl16
	movl	20(%r15), %esi
	movq	%r14, %rdi
	callq	_avio_wl16
	movq	8(%rbx), %rax
	movq	(%rax), %rax
	movl	4(%rax), %esi
	movq	%r14, %rdi
	callq	_avio_wl32
	movq	8(%rbx), %rax
	movq	(%rax), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_avio_wl32
	movq	%r14, %rdi
	movl	$-1, %esi
	callq	_avio_wl64
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	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	"Format supports only exactly one video stream\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_AVMEDIA_TYPE_VIDEO,8,3         ## @AVMEDIA_TYPE_VIDEO
	.comm	_AV_CODEC_ID_AV1,8,3            ## @AV_CODEC_ID_AV1
	.comm	_AV_CODEC_ID_VP8,8,3            ## @AV_CODEC_ID_VP8
	.comm	_AV_CODEC_ID_VP9,8,3            ## @AV_CODEC_ID_VP9
L_.str.1:                               ## @.str.1
	.asciz	"Currently only VP8, VP9 and AV1 are supported!\n"

L_.str.2:                               ## @.str.2
	.asciz	"DKIF"

L_.str.3:                               ## @.str.3
	.asciz	"VP90"

L_.str.4:                               ## @.str.4
	.asciz	"VP80"

L_.str.5:                               ## @.str.5
	.asciz	"AV01"

	.no_dead_strip	_ivf_write_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ivf_write_header
_ivf_write_header:                      ; @ivf_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
	ldr	w8, [x0]
	cmp	w8, #1
	b.ne	LBB0_4
; %bb.1:
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldr	x21, [x8, #8]
	ldr	x8, [x21]
Lloh0:
	adrp	x9, _AVMEDIA_TYPE_VIDEO@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AVMEDIA_TYPE_VIDEO@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.2:
	ldr	x8, [x21, #8]
Lloh3:
	adrp	x9, _AV_CODEC_ID_AV1@GOTPAGE
Lloh4:
	ldr	x9, [x9, _AV_CODEC_ID_AV1@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
Lloh6:
	adrp	x22, _AV_CODEC_ID_VP8@GOTPAGE
Lloh7:
	ldr	x22, [x22, _AV_CODEC_ID_VP8@GOTPAGEOFF]
	ldr	x10, [x22]
Lloh8:
	adrp	x23, _AV_CODEC_ID_VP9@GOTPAGE
Lloh9:
	ldr	x23, [x23, _AV_CODEC_ID_VP9@GOTPAGEOFF]
	ldr	x11, [x23]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	ccmp	x8, x11, #4, ne
	b.ne	LBB0_5
; %bb.3:
	ldr	x20, [x19, #16]
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	mov	w2, #4
	bl	_avio_write
	mov	x0, x20
	mov	w1, #0
	bl	_avio_wl16
	mov	x0, x20
	mov	w1, #32
	bl	_avio_wl16
	ldr	x8, [x21, #8]
	ldr	x9, [x23]
	ldr	x10, [x22]
Lloh12:
	adrp	x11, l_.str.5@PAGE
Lloh13:
	add	x11, x11, l_.str.5@PAGEOFF
Lloh14:
	adrp	x12, l_.str.4@PAGE
Lloh15:
	add	x12, x12, l_.str.4@PAGEOFF
	cmp	x8, x10
	csel	x10, x12, x11, eq
Lloh16:
	adrp	x11, l_.str.3@PAGE
Lloh17:
	add	x11, x11, l_.str.3@PAGEOFF
	cmp	x8, x9
	csel	x0, x11, x10, eq
	bl	_AV_RL32
	mov	x1, x0
	mov	x0, x20
	bl	_avio_wl32
	ldr	w1, [x21, #16]
	mov	x0, x20
	bl	_avio_wl16
	ldr	w1, [x21, #20]
	mov	x0, x20
	bl	_avio_wl16
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldr	w1, [x8, #4]
	mov	x0, x20
	bl	_avio_wl32
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldr	w1, [x8]
	mov	x0, x20
	bl	_avio_wl32
	mov	x0, x20
	mov	w1, #-1
	bl	_avio_wl64
	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
LBB0_4:
Lloh18:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh19:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
Lloh21:
	adrp	x2, l_.str@PAGE
Lloh22:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_6
LBB0_5:
Lloh23:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh24:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
Lloh26:
	adrp	x2, l_.str.1@PAGE
Lloh27:
	add	x2, x2, l_.str.1@PAGEOFF
LBB0_6:
	mov	x0, x19
	bl	_av_log
Lloh28:
	adrp	x8, _EINVAL@GOTPAGE
Lloh29:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh30:
	ldr	w0, [x8]
	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
	b	_AVERROR
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Format supports only exactly one video stream\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_AVMEDIA_TYPE_VIDEO,8,3         ; @AVMEDIA_TYPE_VIDEO
	.comm	_AV_CODEC_ID_AV1,8,3            ; @AV_CODEC_ID_AV1
	.comm	_AV_CODEC_ID_VP8,8,3            ; @AV_CODEC_ID_VP8
	.comm	_AV_CODEC_ID_VP9,8,3            ; @AV_CODEC_ID_VP9
l_.str.1:                               ; @.str.1
	.asciz	"Currently only VP8, VP9 and AV1 are supported!\n"

l_.str.2:                               ; @.str.2
	.asciz	"DKIF"

l_.str.3:                               ; @.str.3
	.asciz	"VP90"

l_.str.4:                               ; @.str.4
	.asciz	"VP80"

l_.str.5:                               ; @.str.5
	.asciz	"AV01"

	.no_dead_strip	_ivf_write_header
.subsections_via_symbols
