	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_packet
_write_packet:                          ## @write_packet
	.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	%rsi, %rbx
	movq	%rdi, %r12
	movq	16(%rdi), %r15
	movq	(%rdi), %rax
	movq	8(%rdi), %r14
	movq	(%rsi), %rcx
	movq	(%rax,%rcx,8), %rsi
	movq	(%rsi), %rax
	movq	(%rax), %rax
	movq	_AV_CODEC_ID_MJPEG@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.1:
	cmpl	$0, 40(%r14)
	je	LBB0_2
LBB0_3:
	movq	_AV_CODEC_ID_H264@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.4:
	movq	%r12, %rdi
	movq	%rbx, %rdx
	callq	_ff_check_h264_startcode
	testl	%eax, %eax
	js	LBB0_21
LBB0_5:
	movl	(%r14), %eax
	movslq	4(%r14), %rcx
	testq	%rcx, %rcx
	je	LBB0_6
## %bb.7:
	movq	32(%r14), %rdx
	movl	-4(%rdx,%rcx,4), %ecx
	jmp	LBB0_8
LBB0_6:
	xorl	%ecx, %ecx
LBB0_8:
	subl	%ecx, %eax
	cmpl	$50, %eax
	jl	LBB0_10
## %bb.9:
	movq	%r12, %rdi
	callq	_write_sync
LBB0_10:
	movl	8(%rbx), %ecx
	movq	_AV_NOPTS_VALUE@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	cmpl	%eax, %ecx
	je	LBB0_19
## %bb.11:
	movslq	8(%r14), %rdx
	testq	%rdx, %rdx
	je	LBB0_12
## %bb.13:
	movq	24(%r14), %rsi
	movl	-4(%rsi,%rdx,4), %edx
	jmp	LBB0_14
LBB0_2:
	addq	$40, %r14
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_av_packet_ref
	jmp	LBB0_20
LBB0_12:
	xorl	%edx, %edx
LBB0_14:
	movl	%ecx, %esi
	subl	%edx, %esi
	cmpl	$5000000, %esi                  ## imm = 0x4C4B40
	jl	LBB0_16
## %bb.15:
	leaq	8(%r14), %rsi
	leaq	24(%r14), %rdi
	movl	(%r14), %edx
	callq	_add_serial_pair
	movl	8(%rbx), %ecx
	movl	(%r13), %eax
LBB0_16:
	cmpl	%eax, %ecx
	je	LBB0_19
## %bb.17:
	cmpl	12(%r14), %ecx
	jle	LBB0_19
## %bb.18:
	movl	%ecx, 12(%r14)
	movl	(%r14), %eax
	movl	%eax, 16(%r14)
LBB0_19:
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_write_timestamp
	movq	(%rbx), %rcx
	movq	16(%rbx), %rdx
	movq	_INDEX_BASE@GOTPCREL(%rip), %rax
	addq	(%rax), %rcx
	movq	_ff_data_guid@GOTPCREL(%rip), %rsi
	movq	%r12, %rdi
	callq	_write_chunk_header
	movl	24(%rbx), %esi
	movq	16(%rbx), %rdx
	movq	%r15, %rdi
	callq	_avio_write
	movq	16(%rbx), %rdi
	callq	_WTV_PAD8
	subq	16(%rbx), %rax
	movq	%r15, %rdi
	movq	%rax, %rsi
	callq	_write_pad
	incl	(%r14)
LBB0_20:
	xorl	%eax, %eax
LBB0_21:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_CODEC_ID_MJPEG,8,3          ## @AV_CODEC_ID_MJPEG
	.comm	_AV_CODEC_ID_H264,8,3           ## @AV_CODEC_ID_H264
	.comm	_AV_NOPTS_VALUE,4,2             ## @AV_NOPTS_VALUE
	.comm	_ff_data_guid,4,2               ## @ff_data_guid
	.comm	_INDEX_BASE,8,3                 ## @INDEX_BASE
	.no_dead_strip	_write_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_packet
_write_packet:                          ; @write_packet
	.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, x1
	mov	x21, x0
	ldp	x22, x20, [x0, #8]
	ldr	x8, [x0]
	ldr	x9, [x1]
	ldr	x1, [x8, x9, lsl #3]
	ldr	x8, [x1]
	ldr	x8, [x8]
Lloh0:
	adrp	x9, _AV_CODEC_ID_MJPEG@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AV_CODEC_ID_MJPEG@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	mov	x0, x22
	ldr	w9, [x0, #40]!
	cbz	w9, LBB0_17
LBB0_2:
Lloh3:
	adrp	x9, _AV_CODEC_ID_H264@GOTPAGE
Lloh4:
	ldr	x9, [x9, _AV_CODEC_ID_H264@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
	mov	x0, x21
	mov	x2, x19
	bl	_ff_check_h264_startcode
	tbnz	w0, #31, LBB0_18
LBB0_4:
	ldp	w8, w9, [x22]
	cbz	w9, LBB0_6
; %bb.5:
	ldr	x10, [x22, #32]
	sub	w9, w9, #1
	ldr	w9, [x10, w9, sxtw #2]
LBB0_6:
	sub	w8, w8, w9
	cmp	w8, #50
	b.lt	LBB0_8
; %bb.7:
	mov	x0, x21
	bl	_write_sync
LBB0_8:
	ldr	w3, [x19, #8]
Lloh6:
	adrp	x23, _AV_NOPTS_VALUE@GOTPAGE
Lloh7:
	ldr	x23, [x23, _AV_NOPTS_VALUE@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w3, w8
	b.eq	LBB0_16
; %bb.9:
	mov	x1, x22
	ldr	w9, [x1, #8]!
	cbz	w9, LBB0_11
; %bb.10:
	ldr	x10, [x22, #24]
	sub	w9, w9, #1
	ldr	w9, [x10, w9, sxtw #2]
LBB0_11:
	mov	w10, #19264
	movk	w10, #76, lsl #16
	sub	w9, w3, w9
	cmp	w9, w10
	b.lt	LBB0_13
; %bb.12:
	mov	x0, x22
	ldr	w2, [x0], #24
	bl	_add_serial_pair
	ldr	w3, [x19, #8]
	ldr	w8, [x23]
LBB0_13:
	cmp	w3, w8
	b.eq	LBB0_16
; %bb.14:
	ldr	w8, [x22, #12]
	cmp	w3, w8
	b.le	LBB0_16
; %bb.15:
	ldr	w8, [x22]
	stp	w3, w8, [x22, #12]
LBB0_16:
	mov	x0, x21
	mov	x1, x19
	bl	_write_timestamp
	ldr	x2, [x19, #16]
Lloh8:
	adrp	x8, _INDEX_BASE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _INDEX_BASE@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	ldr	x9, [x19]
	add	x3, x9, x8
Lloh11:
	adrp	x1, _ff_data_guid@GOTPAGE
Lloh12:
	ldr	x1, [x1, _ff_data_guid@GOTPAGEOFF]
	mov	x0, x21
	bl	_write_chunk_header
	ldr	w1, [x19, #24]
	ldr	x2, [x19, #16]
	mov	x0, x20
	bl	_avio_write
	ldr	x0, [x19, #16]
	bl	_WTV_PAD8
	ldr	x8, [x19, #16]
	sub	x1, x0, x8
	mov	x0, x20
	bl	_write_pad
	mov	w0, #0
	ldr	w8, [x22]
	add	w8, w8, #1
	str	w8, [x22]
	b	LBB0_18
LBB0_17:
	mov	x1, x19
	bl	_av_packet_ref
	mov	w0, #0
LBB0_18:
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_CODEC_ID_MJPEG,8,3          ; @AV_CODEC_ID_MJPEG
	.comm	_AV_CODEC_ID_H264,8,3           ; @AV_CODEC_ID_H264
	.comm	_AV_NOPTS_VALUE,4,2             ; @AV_NOPTS_VALUE
	.comm	_ff_data_guid,4,2               ; @ff_data_guid
	.comm	_INDEX_BASE,8,3                 ; @INDEX_BASE
	.no_dead_strip	_write_packet
.subsections_via_symbols
