	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function roq_encode_frame
_roq_encode_frame:                      ## @roq_encode_frame
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	8(%rdi), %rbx
	movq	%rdi, 48(%rbx)
	movq	%rdx, 40(%rbx)
	movl	(%rdx), %eax
	movq	_ROQ_LAMBDA_SCALE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	addl	%ecx, %ecx
	subl	$1, %eax
	cmovbl	%ecx, %eax
	movl	%eax, (%rbx)
	movl	8(%rbx), %eax
	imull	4(%rbx), %eax
	leal	63(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$6, %ecx
	imull	$138, %ecx, %edx
	leal	7(%rdx), %eax
	addl	$14, %edx
	testl	%eax, %eax
	cmovnsl	%eax, %edx
	sarl	$3, %edx
	addl	$2568, %edx                     ## imm = 0xA08
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%ecx, %ecx
	callq	_ff_alloc_packet2
	testl	%eax, %eax
	js	LBB0_11
## %bb.1:
	movq	8(%r15), %rax
	movq	%rax, 16(%rbx)
	movl	12(%rbx), %eax
	cmpl	(%r12), %eax
	jne	LBB0_3
## %bb.2:
	movl	$0, 12(%rbx)
LBB0_3:
	cmpq	$0, 24(%rbx)
	je	LBB0_7
## %bb.4:
	movl	36(%rbx), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_ff_get_buffer
	testl	%eax, %eax
	js	LBB0_11
## %bb.5:
	movl	32(%rbx), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_ff_get_buffer
	testl	%eax, %eax
	js	LBB0_11
## %bb.6:
	movq	%rbx, %rdi
	callq	_roq_write_video_info_chunk
	movq	$0, 24(%rbx)
LBB0_7:
	movq	%rbx, %rdi
	callq	_roq_encode_video
	testl	%eax, %eax
	js	LBB0_11
## %bb.8:
	movq	16(%rbx), %rax
	subq	8(%r15), %rax
	movq	%rax, 16(%r15)
	cmpl	$1, 12(%rbx)
	jne	LBB0_10
## %bb.9:
	movq	_AV_PKT_FLAG_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r15)
LBB0_10:
	movl	$1, (%r14)
	xorl	%eax, %eax
LBB0_11:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ROQ_LAMBDA_SCALE,4,2           ## @ROQ_LAMBDA_SCALE
	.comm	_AV_PKT_FLAG_KEY,4,2            ## @AV_PKT_FLAG_KEY
	.no_dead_strip	_roq_encode_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function roq_encode_frame
_roq_encode_frame:                      ; @roq_encode_frame
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x3
	mov	x20, x1
	mov	x22, x0
	ldr	x21, [x0, #8]
	stp	x2, x0, [x21, #40]
	ldr	w8, [x2]
Lloh0:
	adrp	x9, _ROQ_LAMBDA_SCALE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ROQ_LAMBDA_SCALE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	lsl	w9, w9, #1
	sub	w10, w8, #1
	cmp	w8, #0
	csel	w8, w9, w10, eq
	str	w8, [x21]
	ldp	w8, w9, [x21, #4]
	mul	w8, w9, w8
	add	w9, w8, #63
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #6
	mov	w9, #138
	mul	w8, w8, w9
	add	w9, w8, #7
	add	w8, w8, #14
	cmp	w9, #0
	csel	w8, w8, w9, lt
	asr	w8, w8, #3
	add	w2, w8, #2568
	mov	w3, #0
	bl	_ff_alloc_packet2
	tbnz	w0, #31, LBB0_11
; %bb.1:
	ldr	x8, [x20, #8]
	str	x8, [x21, #16]
	ldr	w8, [x21, #12]
	ldr	w9, [x22]
	cmp	w8, w9
	b.ne	LBB0_3
; %bb.2:
	str	wzr, [x21, #12]
LBB0_3:
	ldr	x8, [x21, #24]
	cbz	x8, LBB0_7
; %bb.4:
	ldr	w1, [x21, #36]
	mov	x0, x22
	mov	w2, #0
	bl	_ff_get_buffer
	tbnz	w0, #31, LBB0_11
; %bb.5:
	ldr	w1, [x21, #32]
	mov	x0, x22
	mov	w2, #0
	bl	_ff_get_buffer
	tbnz	w0, #31, LBB0_11
; %bb.6:
	mov	x0, x21
	bl	_roq_write_video_info_chunk
	str	xzr, [x21, #24]
LBB0_7:
	mov	x0, x21
	bl	_roq_encode_video
	tbnz	w0, #31, LBB0_11
; %bb.8:
	ldr	x8, [x21, #16]
	ldr	x9, [x20, #8]
	sub	x8, x8, x9
	str	x8, [x20, #16]
	ldr	w8, [x21, #12]
	cmp	w8, #1
	b.ne	LBB0_10
; %bb.9:
Lloh3:
	adrp	x8, _AV_PKT_FLAG_KEY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AV_PKT_FLAG_KEY@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldr	w9, [x20]
	orr	w8, w9, w8
	str	w8, [x20]
LBB0_10:
	mov	w0, #0
	mov	w8, #1
	str	w8, [x19]
LBB0_11:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_ROQ_LAMBDA_SCALE,4,2           ; @ROQ_LAMBDA_SCALE
	.comm	_AV_PKT_FLAG_KEY,4,2            ; @AV_PKT_FLAG_KEY
	.no_dead_strip	_roq_encode_frame
.subsections_via_symbols
