	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rm_write_video
_rm_write_video:                        ## @rm_write_video
	.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
	movl	%edx, %r13d
	movq	_MAX_PACKET_SIZE@GOTPCREL(%rip), %rax
	cmpl	%edx, (%rax)
	jge	LBB0_2
## %bb.1:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movl	%r13d, %ecx
	callq	_av_log
	movq	_AVERROR_PATCHWELCOME@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_6
LBB0_2:
	movq	%rsi, %r14
	movq	(%rdi), %r12
	movq	8(%rdi), %rax
	movq	(%rax), %r15
	movq	_AV_PKT_FLAG_KEY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	andl	(%rax), %ecx
	setne	%bl
	xorl	%eax, %eax
	cmpl	$16384, %r13d                   ## imm = 0x4000
	setge	%al
	leal	7(%r13,%rax,4), %edx
	movq	%r15, %rsi
	movl	%ebx, %ecx
	callq	_write_packet_header
	movq	%r12, %rdi
	movl	$129, %esi
	callq	_avio_w8
	shll	$7, %ebx
	orl	$1, %ebx
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_avio_w8
	cmpl	$16384, %r13d                   ## imm = 0x4000
	jl	LBB0_4
## %bb.3:
	movq	%r12, %rdi
	movl	%r13d, %esi
	callq	_avio_wb32
	movq	%r12, %rdi
	movl	%r13d, %esi
	callq	_avio_wb32
	jmp	LBB0_5
LBB0_4:
	movl	%r13d, %ebx
	orl	$16384, %ebx                    ## imm = 0x4000
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_avio_wb16
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_avio_wb16
LBB0_5:
	movzbl	(%r15), %esi
	movq	%r12, %rdi
	callq	_avio_w8
	movq	%r12, %rdi
	movq	%r14, %rsi
	movl	%r13d, %edx
	callq	_avio_write
	incl	(%r15)
	xorl	%eax, %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_PKT_FLAG_KEY,4,2            ## @AV_PKT_FLAG_KEY
	.comm	_MAX_PACKET_SIZE,4,2            ## @MAX_PACKET_SIZE
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Muxing packets larger than 64 kB (%d) is not supported\n"

	.comm	_AVERROR_PATCHWELCOME,4,2       ## @AVERROR_PATCHWELCOME
	.no_dead_strip	_rm_write_video
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rm_write_video
_rm_write_video:                        ; @rm_write_video
	.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, x2
Lloh0:
	adrp	x8, _MAX_PACKET_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_PACKET_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w2
	b.ge	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	x3, x19
	bl	_av_log
Lloh8:
	adrp	x8, _AVERROR_PATCHWELCOME@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AVERROR_PATCHWELCOME@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	b	LBB0_6
LBB0_2:
	mov	x20, x1
	ldp	x22, x8, [x0]
	ldr	x21, [x8]
Lloh11:
	adrp	x8, _AV_PKT_FLAG_KEY@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AV_PKT_FLAG_KEY@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cmp	w19, #4, lsl #12                ; =16384
	cset	w9, ge
	tst	w8, w3
	cset	w3, ne
	add	w8, w19, w9, lsl #2
	add	w2, w8, #7
	mov	w8, #129
	csinc	w23, w8, wzr, ne
	mov	x1, x21
	bl	_write_packet_header
	mov	x0, x22
	mov	w1, #129
	bl	_avio_w8
	mov	x0, x22
	mov	x1, x23
	bl	_avio_w8
	cmp	w19, #4, lsl #12                ; =16384
	b.lt	LBB0_4
; %bb.3:
	mov	x0, x22
	mov	x1, x19
	bl	_avio_wb32
	mov	x0, x22
	mov	x1, x19
	bl	_avio_wb32
	b	LBB0_5
LBB0_4:
	orr	w23, w19, #0x4000
	mov	x0, x22
	mov	x1, x23
	bl	_avio_wb16
	mov	x0, x22
	mov	x1, x23
	bl	_avio_wb16
LBB0_5:
	ldrb	w1, [x21]
	mov	x0, x22
	bl	_avio_w8
	mov	x0, x22
	mov	x1, x20
	mov	x2, x19
	bl	_avio_write
	mov	w0, #0
	ldr	w8, [x21]
	add	w8, w8, #1
	str	w8, [x21]
LBB0_6:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_PKT_FLAG_KEY,4,2            ; @AV_PKT_FLAG_KEY
	.comm	_MAX_PACKET_SIZE,4,2            ; @MAX_PACKET_SIZE
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Muxing packets larger than 64 kB (%d) is not supported\n"

	.comm	_AVERROR_PATCHWELCOME,4,2       ; @AVERROR_PATCHWELCOME
	.no_dead_strip	_rm_write_video
.subsections_via_symbols
