	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function roq_write_header
_roq_write_header:                      ## @roq_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	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movaps	l___const.roq_write_header.header+16(%rip), %xmm0
	movaps	%xmm0, -48(%rbp)
	movaps	l___const.roq_write_header.header(%rip), %xmm0
	movaps	%xmm0, -64(%rbp)
	movl	(%rdi), %eax
	testl	%eax, %eax
	jle	LBB0_14
## %bb.1:
	movq	8(%r15), %rcx
	movq	_AVMEDIA_TYPE_VIDEO@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rcx,%rsi,8), %rdi
	movq	8(%rdi), %rbx
	cmpq	%rdx, (%rbx)
	je	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_3 Depth=1
	incq	%rsi
	cmpq	%rsi, %rax
	jne	LBB0_3
	jmp	LBB0_14
LBB0_4:
	cmpl	$1, (%rdi)
	jne	LBB0_5
## %bb.8:
	movl	4(%rdi), %r14d
	cmpl	$256, %r14d                     ## imm = 0x100
	jb	LBB0_11
## %bb.9:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	jmp	LBB0_6
LBB0_5:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
LBB0_6:
	movq	%r15, %rdi
	callq	_av_log
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_10
## %bb.7:
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_11:
	cmpl	$30, %r14d
	je	LBB0_13
## %bb.12:
	movq	_AV_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
	movq	%r15, %rdi
	callq	_av_log
LBB0_13:
	movl	%r14d, -40(%rbp)
LBB0_14:
	movl	4(%r15), %edi
	leaq	-64(%rbp), %rsi
	movl	$8, %edx
	callq	_avio_write
	movl	4(%r15), %edi
	callq	_avio_flush
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_10
## %bb.15:
	xorl	%eax, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @__const.roq_write_header.header
l___const.roq_write_header.header:
	.long	132                             ## 0x84
	.long	16                              ## 0x10
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.long	30                              ## 0x1e
	.long	0                               ## 0x0

	.comm	_AVMEDIA_TYPE_VIDEO,8,3         ## @AVMEDIA_TYPE_VIDEO
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Frame rate must be integer\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Frame rate may not exceed 255fps\n"

	.comm	_AV_LOG_WARNING,4,2             ## @AV_LOG_WARNING
L_.str.2:                               ## @.str.2
	.asciz	"For vintage compatibility fps must be 30\n"

	.no_dead_strip	_roq_write_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function roq_write_header
_roq_write_header:                      ; @roq_write_header
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
Lloh3:
	adrp	x8, l___const.roq_write_header.header@PAGE
Lloh4:
	add	x8, x8, l___const.roq_write_header.header@PAGEOFF
	ldp	q0, q1, [x8]
	stp	q0, q1, [sp]
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.1:
	ldr	x9, [x19, #8]
Lloh5:
	adrp	x10, _AVMEDIA_TYPE_VIDEO@GOTPAGE
Lloh6:
	ldr	x10, [x10, _AVMEDIA_TYPE_VIDEO@GOTPAGEOFF]
Lloh7:
	ldr	x10, [x10]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x9]
	ldr	x12, [x11, #8]
	ldr	x12, [x12]
	cmp	x12, x10
	b.eq	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x9, x9, #8
	subs	x8, x8, #1
	b.ne	LBB0_2
	b	LBB0_13
LBB0_4:
	ldr	w8, [x11]
	cmp	w8, #1
	b.ne	LBB0_7
; %bb.5:
	ldr	w20, [x11, #4]
	cmp	w20, #256
	b.lo	LBB0_10
; %bb.6:
Lloh8:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x2, l_.str.1@PAGE
Lloh12:
	add	x2, x2, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_7:
Lloh13:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
Lloh16:
	adrp	x2, l_.str@PAGE
Lloh17:
	add	x2, x2, l_.str@PAGEOFF
LBB0_8:
	mov	x0, x19
	bl	_av_log
Lloh18:
	adrp	x8, _EINVAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	ldur	x8, [x29, #-24]
Lloh21:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh22:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.9:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	b	_AVERROR
LBB0_10:
	cmp	w20, #30
	b.eq	LBB0_12
; %bb.11:
Lloh24:
	adrp	x8, _AV_LOG_WARNING@GOTPAGE
Lloh25:
	ldr	x8, [x8, _AV_LOG_WARNING@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
Lloh27:
	adrp	x2, l_.str.2@PAGE
Lloh28:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_av_log
LBB0_12:
	str	w20, [sp, #24]
LBB0_13:
	ldr	w0, [x19, #4]
	mov	x1, sp
	mov	w2, #8
	bl	_avio_write
	ldr	w0, [x19, #4]
	bl	_avio_flush
	ldur	x8, [x29, #-24]
Lloh29:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh30:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh31:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.14:
	mov	w0, #0
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_15:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @__const.roq_write_header.header
l___const.roq_write_header.header:
	.long	132                             ; 0x84
	.long	16                              ; 0x10
	.long	255                             ; 0xff
	.long	255                             ; 0xff
	.long	255                             ; 0xff
	.long	255                             ; 0xff
	.long	30                              ; 0x1e
	.long	0                               ; 0x0

	.comm	_AVMEDIA_TYPE_VIDEO,8,3         ; @AVMEDIA_TYPE_VIDEO
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Frame rate must be integer\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Frame rate may not exceed 255fps\n"

	.comm	_AV_LOG_WARNING,4,2             ; @AV_LOG_WARNING
l_.str.2:                               ; @.str.2
	.asciz	"For vintage compatibility fps must be 30\n"

	.no_dead_strip	_roq_write_header
.subsections_via_symbols
